@@ -219,7 +219,7 @@ |
||
| 219 | 219 | |
| 220 | 220 | // Pass $view=true to filter hidden caps if the user cannot see them. |
| 221 | 221 | if ($users = get_users_by_capability($context, 'moodle/course:update', 'u.*', 'u.id ASC', |
| 222 | - '', '', '', '', false, true)) { |
|
| 222 | + '', '', '', '', false, true)) { |
|
| 223 | 223 | $users = sort_by_roleassignment_authority($users, $context); |
| 224 | 224 | $teacher = array_shift($users); |
| 225 | 225 | } else { |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | require("../../../config.php"); |
| 33 | 33 | require_once($CFG->libdir.'/eventslib.php'); |
| 34 | -require_once($CFG->libdir . '/filelib.php'); |
|
| 34 | +require_once($CFG->libdir.'/filelib.php'); |
|
| 35 | 35 | |
| 36 | 36 | // PayPal does not like when we return error messages here, |
| 37 | 37 | // the custom handler just logs exceptions and stops. |
@@ -76,15 +76,15 @@ discard block |
||
| 76 | 76 | $custom = optional_param('custom', '', PARAM_TEXT); |
| 77 | 77 | $custom = explode('-', $custom); |
| 78 | 78 | $data->userid = (int)$custom[0]; |
| 79 | -$data->contextid = (int)$custom[1]; |
|
| 79 | +$data->contextid = (int)$custom[1]; |
|
| 80 | 80 | $data->timeupdated = time(); |
| 81 | 81 | |
| 82 | -if (! $user = $DB->get_record("user", array("id" => $data->userid))) { |
|
| 82 | +if (!$user = $DB->get_record("user", array("id" => $data->userid))) { |
|
| 83 | 83 | paypal_message_error_to_admin("Not a valid user id", $data); |
| 84 | 84 | die; |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | -if (! $context = context::instance_by_id($data->contextid, IGNORE_MISSING)) { |
|
| 87 | +if (!$context = context::instance_by_id($data->contextid, IGNORE_MISSING)) { |
|
| 88 | 88 | paypal_message_error_to_admin("Not a valid context id", $data); |
| 89 | 89 | die; |
| 90 | 90 | } |
@@ -166,8 +166,8 @@ discard block |
||
| 166 | 166 | |
| 167 | 167 | // If our status is not completed or not pending on an echeck clearance then ignore and die. |
| 168 | 168 | // This check is redundant at present but may be useful if paypal extend the return codes in the future. |
| 169 | - if (! ( $data->payment_status == "Completed" or |
|
| 170 | - ($data->payment_status == "Pending" and $data->pending_reason == "echeck") ) ) { |
|
| 169 | + if (!($data->payment_status == "Completed" or |
|
| 170 | + ($data->payment_status == "Pending" and $data->pending_reason == "echeck"))) { |
|
| 171 | 171 | die; |
| 172 | 172 | } |
| 173 | 173 | |
@@ -201,10 +201,10 @@ discard block |
||
| 201 | 201 | $coursecontext = context_course::instance($course->id, IGNORE_MISSING); |
| 202 | 202 | |
| 203 | 203 | // Check that amount paid is the correct amount. |
| 204 | - if ( (float) $paypal->cost < 0 ) { |
|
| 205 | - $cost = (float) 0; |
|
| 204 | + if ((float)$paypal->cost < 0) { |
|
| 205 | + $cost = (float)0; |
|
| 206 | 206 | } else { |
| 207 | - $cost = (float) $paypal->cost; |
|
| 207 | + $cost = (float)$paypal->cost; |
|
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | // Use the same rounding of floats as on the plugin form. |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | } |
| 288 | 288 | */ |
| 289 | 289 | |
| 290 | - } else if (strcmp ($result, "INVALID") == 0) { // ERROR |
|
| 290 | + } else if (strcmp($result, "INVALID") == 0) { // ERROR |
|
| 291 | 291 | $DB->insert_record("paypal_transactions", $data, false); |
| 292 | 292 | paypal_message_error_to_admin("Received an invalid payment notification!! (Fake payment?)", $data); |
| 293 | 293 | } |
@@ -26,5 +26,5 @@ |
||
| 26 | 26 | $plugin->version = 2015051100; |
| 27 | 27 | $plugin->requires = 2015050500; |
| 28 | 28 | $plugin->release = 1; |
| 29 | -$plugin->maturity = MATURITY_STABLE; |
|
| 29 | +$plugin->maturity = MATURITY_STABLE; |
|
| 30 | 30 | $plugin->component = 'availability_paypal'; |
@@ -95,7 +95,7 @@ |
||
| 95 | 95 | // should double-check with paypal everytime ? |
| 96 | 96 | $context = $info->get_context(); |
| 97 | 97 | return $DB->record_exists('paypal_transactions', |
| 98 | - array('userid' => $userid, |
|
| 98 | + array('userid' => $userid, |
|
| 99 | 99 | 'contextid' => $context->id, |
| 100 | 100 | 'payment_status' => 'Completed')); |
| 101 | 101 | } |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | $this->cost = $structure->cost; |
| 52 | 52 | } |
| 53 | 53 | if (isset($structure->itemname)) { |
| 54 | - $this->itemname= $structure->itemname; |
|
| 54 | + $this->itemname = $structure->itemname; |
|
| 55 | 55 | } |
| 56 | 56 | if (isset($structure->itemnumber)) { |
| 57 | 57 | $this->itemnumber = $structure->itemnumber; |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | $result->cost = $this->cost; |
| 71 | 71 | } |
| 72 | 72 | if ($this->itemname) { |
| 73 | - $result->itemname= $this->itemname; |
|
| 73 | + $result->itemname = $this->itemname; |
|
| 74 | 74 | } |
| 75 | 75 | if ($this->itemnumber) { |
| 76 | 76 | $result->itemnumber = $this->itemnumber; |