diff --git a/enrol/authorize/db/mysql.php b/enrol/authorize/db/mysql.php index fecdd288bef..9dbf6612bc1 100755 --- a/enrol/authorize/db/mysql.php +++ b/enrol/authorize/db/mysql.php @@ -2,7 +2,7 @@ // THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT! // -// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL +// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL // LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY. // MySQL commands for upgrading this enrolment module @@ -56,7 +56,7 @@ function enrol_authorize_upgrade($oldversion=0) { PRIMARY KEY (`id`), KEY `orderid` (`orderid`));"); // defaults. - if ($courses = get_records_select('course', '', '', 'id, cost, currency')) { + if (($courses = get_records_select('course', '', '', 'id, cost, currency'))) { foreach ($courses as $course) { execute_sql("UPDATE {$CFG->prefix}enrol_authorize SET amount = '$course->cost', currency = '$course->currency' @@ -70,7 +70,7 @@ function enrol_authorize_upgrade($oldversion=0) { table_column('enrol_authorize_refunds', '', 'settletime', 'integer', '10', 'unsigned', '0', 'not null', 'transid'); table_column('enrol_authorize', 'timeupdated', 'settletime', 'integer', '10', 'unsigned', '0', 'not null'); $status = AN_STATUS_AUTH | AN_STATUS_CAPTURE; - if ($settlements = get_records_select('enrol_authorize', "status='$status'", '', 'id, settletime')) { + if (($settlements = get_records_select('enrol_authorize', "status='$status'", '', 'id, settletime'))) { include_once("$CFG->dirroot/enrol/authorize/authorizenetlib.php"); foreach ($settlements as $settlement) { execute_sql("UPDATE {$CFG->prefix}enrol_authorize SET settletime = '" . diff --git a/enrol/authorize/db/postgres7.php b/enrol/authorize/db/postgres7.php index 5dfd62c274f..62c1d878263 100644 --- a/enrol/authorize/db/postgres7.php +++ b/enrol/authorize/db/postgres7.php @@ -2,7 +2,7 @@ // THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT! // -// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL +// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL // LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY. // PostgreSQL commands for upgrading this enrolment module @@ -67,7 +67,7 @@ function enrol_authorize_upgrade($oldversion=0) { );"); modify_database("","CREATE INDEX prefix_enrol_authorize_refunds_orderid_idx ON prefix_enrol_authorize_refunds (orderid);"); // defaults. - if ($courses = get_records_select('course', '', '', 'id, cost, currency')) { + if (($courses = get_records_select('course', '', '', 'id, cost, currency'))) { foreach ($courses as $course) { execute_sql("UPDATE {$CFG->prefix}enrol_authorize SET amount = '$course->cost', currency = '$course->currency' @@ -81,7 +81,7 @@ function enrol_authorize_upgrade($oldversion=0) { table_column('enrol_authorize_refunds', '', 'settletime', 'integer', '10', 'unsigned', '0', 'not null', 'transid'); table_column('enrol_authorize', 'timeupdated', 'settletime', 'integer', '10', 'unsigned', '0', 'not null'); $status = AN_STATUS_AUTH | AN_STATUS_CAPTURE; - if ($settlements = get_records_select('enrol_authorize', "status='$status'", '', 'id, settletime')) { + if (($settlements = get_records_select('enrol_authorize', "status='$status'", '', 'id, settletime'))) { include_once("$CFG->dirroot/enrol/authorize/authorizenetlib.php"); foreach ($settlements as $settlement) { execute_sql("UPDATE {$CFG->prefix}enrol_authorize SET settletime = '" . diff --git a/enrol/authorize/enrol.php b/enrol/authorize/enrol.php index 296a777f90d..2595bb44265 100755 --- a/enrol/authorize/enrol.php +++ b/enrol/authorize/enrol.php @@ -199,7 +199,7 @@ class enrolment_plugin_authorize redirect($CFG->wwwroot, get_string("reviewnotify", "enrol_authorize"), '30'); } else { - enrol_into_course($course, $USER, 'manual'); + enrol_into_course($course, $USER, 'authorize'); redirect("$CFG->wwwroot/course/view.php?id=$course->id"); } return; @@ -222,7 +222,7 @@ class enrolment_plugin_authorize $a->orderid = $order->id; $emailsubject = get_string('adminnewordersubject', 'enrol_authorize', $a); $context = get_context_instance(CONTEXT_COURSE, $course->id); - if ($paymentmanagers = get_users_by_capability($context, 'enrol/authorize:managepayments')) { + if (($paymentmanagers = get_users_by_capability($context, 'enrol/authorize:managepayments'))) { foreach ($paymentmanagers as $paymentmanager) { email_to_user($paymentmanager, $USER, $emailsubject, $emailmessage); } @@ -232,7 +232,7 @@ class enrolment_plugin_authorize } // Credit card captured, ENROL student now... - if (enrol_into_course($course, $USER, 'manual')) { + if (enrol_into_course($course, $USER, 'authorize')) { if (!empty($CFG->enrol_mailstudents)) { send_welcome_messages($order->id); } @@ -423,7 +423,7 @@ class enrolment_plugin_authorize } } - if ($count = count_records('enrol_authorize', 'status', AN_STATUS_AUTH)) { + if (($count = count_records('enrol_authorize', 'status', AN_STATUS_AUTH))) { $a = new stdClass; $a->count = $count; $a->url = $CFG->wwwroot."/enrol/authorize/index.php?status=".AN_STATUS_AUTH; @@ -627,7 +627,7 @@ class enrolment_plugin_authorize $timeend = $order->settletime + $course->enrolperiod; } $user = get_record('user', 'id', $order->userid); - if (role_assign($role->id, $user->id, 0, $context->id, $timestart, $timeend, 0, 'manual')) { + if (role_assign($role->id, $user->id, 0, $context->id, $timestart, $timeend, 0, 'authorize')) { $this->log .= "User($user->id) has been enrolled to course($course->id).\n"; if (!empty($CFG->enrol_mailstudents)) { $sendem[] = $order->id; @@ -766,7 +766,7 @@ class enrolment_plugin_authorize foreach($courseinfos as $courseinfo) { $lastcourse = $courseinfo->courseid; $context = get_context_instance(CONTEXT_COURSE, $lastcourse); - if ($paymentmanagers = get_users_by_capability($context, 'enrol/authorize:managepayments')) { + if (($paymentmanagers = get_users_by_capability($context, 'enrol/authorize:managepayments'))) { $a = new stdClass; $a->course = $courseinfo->shortname; $a->pending = $courseinfo->cnt; diff --git a/enrol/authorize/localfuncs.php b/enrol/authorize/localfuncs.php index 994d49327da..59763f82f59 100644 --- a/enrol/authorize/localfuncs.php +++ b/enrol/authorize/localfuncs.php @@ -40,7 +40,7 @@ function prevent_double_paid($course) $sql .= 'AND status='.AN_STATUS_NONE; } - if ($recid = get_field_sql($sql)) { + if (($recid = get_field_sql($sql))) { $a = new stdClass; $a->orderid = $recid; $a->url = "$CFG->wwwroot/enrol/authorize/index.php?order=$a->orderid"; diff --git a/enrol/authorize/locallib.php b/enrol/authorize/locallib.php index a8c93b5f107..7746b9c77fc 100644 --- a/enrol/authorize/locallib.php +++ b/enrol/authorize/locallib.php @@ -53,7 +53,7 @@ function authorize_print_orders($courseid, $userid) $sql .= "WHERE (e.userid='$userid') "; } $sql .= "ORDER BY c.sortorder, c.fullname"; - if ($popupcrs = get_records_sql_menu($sql)) { + if (($popupcrs = get_records_sql_menu($sql))) { $popupcrs = array($SITE->id => $SITE->fullname) + $popupcrs; echo "