Skip to content

Commit

Permalink
Version bump, shorten enrol_cvent_registration_guest.
Browse files Browse the repository at this point in the history
enrol_cvent_registration_guest is too long, now it's
senrol_cvent_reg_guest.
  • Loading branch information
moquist committed Feb 16, 2013
1 parent 1d34db4 commit 1f67962
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 139 deletions.
130 changes: 0 additions & 130 deletions cli/test.php

This file was deleted.

4 changes: 2 additions & 2 deletions db/install.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
</KEYS>
</TABLE>
<TABLE NAME="enrol_cvent_contact" COMMENT="save copies of CVent Contact objects" PREVIOUS="enrol_cvent_registration" NEXT="enrol_cvent_registration_guest">
<TABLE NAME="enrol_cvent_contact" COMMENT="save copies of CVent Contact objects" PREVIOUS="enrol_cvent_registration" NEXT="enrol_cvent_reg_guest">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="contactid"/>
<FIELD NAME="contactid" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" ENUM="false" COMMENT="Contact.Id value from Cvent" PREVIOUS="id" NEXT="sourceid"/>
Expand Down Expand Up @@ -158,7 +158,7 @@
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
</KEYS>
</TABLE>
<TABLE NAME="enrol_cvent_registration_guest" COMMENT="Registration.GuestDetail data from Cvent" PREVIOUS="enrol_cvent_contact">
<TABLE NAME="enrol_cvent_reg_guest" COMMENT="Registration.GuestDetail data from Cvent" PREVIOUS="enrol_cvent_contact">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="registrationid"/>
<FIELD NAME="registrationid" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="guestid"/>
Expand Down
12 changes: 6 additions & 6 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function sync_user_enrolments($user) {
}
}
}
if ($guestings = $DB->get_records_sql("SELECT g.* FROM {enrol_cvent_registration_guest} g JOIN {enrol_cvent_registration} r ON r.registrationid = g.registrationid WHERE g.emailaddress = ? AND r.status = ?", array($user->username, CV_ACCEPTED))) {
if ($guestings = $DB->get_records_sql("SELECT g.* FROM {enrol_cvent_reg_guest} g JOIN {enrol_cvent_registration} r ON r.registrationid = g.registrationid WHERE g.emailaddress = ? AND r.status = ?", array($user->username, CV_ACCEPTED))) {
# Ensure enrollment for each course where this user is a Cvent-guest.
foreach ($guestings as $guesting) {
if ($courseid = $this->ensure_enrolment($guesting->registrationid, $user)) {
Expand All @@ -72,7 +72,7 @@ public function sync_user_enrolments($user) {
$rs = $DB->get_recordset_sql($sql, array('userid' => $user->id, 'plugin' => CV_NAME));
foreach ($rs as $instance) {
if (!$context = get_context_instance(CONTEXT_COURSE, $instance->courseid)) {
//weird
// weird...
continue;
}

Expand All @@ -81,7 +81,7 @@ public function sync_user_enrolments($user) {
continue;
}

// deal with enrolments removed from external table
// deal with enrolments removed from Cvent
if ($unenrolaction == ENROL_EXT_REMOVED_UNENROL) {
// unenrol
$this->unenrol_user($instance, $user->id);
Expand Down Expand Up @@ -567,13 +567,13 @@ private function handle_registration_guestdetail($registrationid, $guestdetails)
}
}
}
if ($rec = $DB->get_record('enrol_cvent_registration_guest', array('guestid' => $guestdetail->guestid))) {
if ($rec = $DB->get_record('enrol_cvent_reg_guest', array('guestid' => $guestdetail->guestid))) {
$guestdetail->id = $rec->id;
cvent_safe_print("Updating guestdetail ($guestdetail->guestid)<br />\n");
$DB->update_record('enrol_cvent_registration_guest', $guestdetail);
$DB->update_record('enrol_cvent_reg_guest', $guestdetail);
} else {
cvent_safe_print("Inserting guestdetail ($guestdetail->guestid)<br />\n");
$DB->insert_record('enrol_cvent_registration_guest', $guestdetail);
$DB->insert_record('enrol_cvent_reg_guest', $guestdetail);
}
$guestdetail->homeaddress1 = $guestdetail->address1;
$guestdetail->homecity = $guestdetail->city;
Expand Down
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php // $Id$

$plugin->version = 2013011200;
$plugin->version = 2013021600;
$plugin->requires = 2011033007;
$plugin->cron = 60;

Expand Down

0 comments on commit 1f67962

Please sign in to comment.