Skip to content
Browse files

Cron handles all expired unenrolments. It is time to use own enrolmen…

…t method when calling funcs enrol_into_course, role_assign.

Zend Studio Warning: Assignment in condition (line XX), Solved, one more ()

Merged from MOODLE_18_STABLE
  • Loading branch information...
1 parent 67574a9 commit f461eacc8e0d8cbbb7c6b10be01867030abf762d ethem committed
Showing with 10 additions and 10 deletions.
  1. +3 −3 enrol/authorize/db/mysql.php
  2. +3 −3 enrol/authorize/db/postgres7.php
  3. +4 −4 enrol/authorize/uploadcsv.php
View
6 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 = '" .
View
6 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 = '" .
View
8 enrol/authorize/uploadcsv.php
@@ -20,7 +20,7 @@
print_heading_with_help($struploadcsv, 'uploadcsv', 'enrol/authorize');
/// Handle CSV file
- if ($form = data_submitted() && confirm_sesskey()) {
+ if (($form = data_submitted()) && confirm_sesskey()) {
$um = new upload_manager('csvfile', false, false, null, false, 0);
if ($um->preprocess_files()) {
$filename = $um->files['csvfile']['tmp_name'];
@@ -119,7 +119,7 @@ function authorize_process_csv($filename)
$settlementdate = strtotime($data[$csvfields['Settlement Date/Time']]);
if ($transstatus == 'Approved Review' || $transstatus == 'Review Failed') {
- if ($order = get_record('enrol_authorize', 'transid', $transid)) {
+ if (($order = get_record('enrol_authorize', 'transid', $transid))) {
$order->status = ($transstatus == 'Approved Review') ? AN_STATUS_APPROVEDREVIEW : AN_STATUS_REVIEWFAILED;
update_record('enrol_authorize', $order);
$updated++; // Updated order status
@@ -128,7 +128,7 @@ function authorize_process_csv($filename)
}
if (!empty($reftransid) && is_numeric($reftransid) && 'Settled Successfully' == $transstatus && 'Credit' == $transtype) {
- if ($order = get_record('enrol_authorize', 'transid', $reftransid)) {
+ if (($order = get_record('enrol_authorize', 'transid', $reftransid))) {
if (AN_METHOD_ECHECK == $order->paymentmethod) {
$refund = get_record('enrol_authorize_refunds', 'transid', $transid);
if ($refund) {
@@ -199,7 +199,7 @@ function authorize_process_csv($filename)
}
// If user wasn't enrolled, enrol now. Ignore otherwise. Because admin user might submit this file again.
- if ($role = get_default_course_role($course)) {
+ if (($role = get_default_course_role($course))) {
if (! user_has_role_assignment($user->id, $role->id, $coursecontext->id)) {
$timestart = $timeend = 0;
if ($course->enrolperiod) {

0 comments on commit f461eac

Please sign in to comment.
Something went wrong with that request. Please try again.