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
This commit is contained in:
ethem 2008-02-06 08:13:20 +00:00
parent a040b67d73
commit 04b8b68848
2 changed files with 5 additions and 5 deletions

View File

@ -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";

View File

@ -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 "<table border='0' width='100%' cellspacing='0' cellpadding='3' class='generaltable generalbox'>";
echo "<tr>";
@ -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);