From 04b8b6884815d927aceb3f4b6939bcecc6b96945 Mon Sep 17 00:00:00 2001 From: ethem Date: Wed, 6 Feb 2008 08:13:20 +0000 Subject: [PATCH] MDL-10181 User Management Improvements: Cron unenrolment of manual should takes place in the main cron. It is time to use own enrolment method when calling funcs enrol_into_course, role_assign, role_unassign. Zend Studio Warning: Assignment in condition (line XX), Solved, one more () Assignments in a conditional statement are sometimes the result of a typo. In many cases, instead of the assignment operator =, the equality operator == should be used. When comparing a variable and a non-variable expression, it is common practice to put the variable on the right-hand side of the equality operator, so that if the equality operator is erroneously replaced with the assignment operator, PHP will report a parse error immediately. This helps you avoid a big subset of this class of bugs. Merged from MOODLE_19_STABLE --- enrol/authorize/localfuncs.php | 2 +- enrol/authorize/locallib.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/enrol/authorize/localfuncs.php b/enrol/authorize/localfuncs.php index 9f0eadedb3..bbd4536dc7 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 17911d8561..3cb3ff8a8a 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 ""; echo ""; @@ -155,7 +155,7 @@ function authorize_print_orders($courseid, $userid) $where .= "AND (e.userid = '" . $userid . "') "; } - if ($sort = $table->get_sql_sort()) { + if (($sort = $table->get_sql_sort())) { $sort = ' ORDER BY ' . $sort; } @@ -163,7 +163,7 @@ function authorize_print_orders($courseid, $userid) $table->initialbars($totalcount > $perpage); $table->pagesize($perpage, $totalcount); - if ($records = get_records_sql($select . $from . $where . $sort, $table->get_page_start(), $table->get_page_size())) { + if (($records = get_records_sql($select . $from . $where . $sort, $table->get_page_start(), $table->get_page_size()))) { foreach ($records as $record) { $actionstatus = authorize_get_status_action($record); $color = authorize_get_status_color($actionstatus->status); @@ -312,7 +312,7 @@ function authorize_print_order_details($orderno) $sql = "SELECT SUM(amount) AS refunded FROM {$CFG->prefix}enrol_authorize_refunds " . "WHERE (orderid = '" . $orderno . "') AND (status = '" . AN_STATUS_CREDIT . "')"; - if ($refund = get_record_sql($sql)) { + if (($refund = get_record_sql($sql))) { $extra->sum = floatval($refund->refunded); } $upto = round($order->amount - $extra->sum, 2); -- 2.39.5