Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Hide order details if an action emerges. (actions: capture, delete, r…

…efund, void)
  • Loading branch information...
commit 743d932c1130f8b2ad9f6e27a0361a849fac59ed 1 parent 9c7c8d6
authored

Showing 1 changed file with 9 additions and 9 deletions. Show diff stats Hide diff stats

  1. 18  enrol/authorize/lib.php
18  enrol/authorize/lib.php
@@ -148,14 +148,14 @@ function print_authorize_order_details($orderno) {
148 148
     global $CFG, $USER;
149 149
     global $strs, $authstrs;
150 150
 
151  
-    $unenrol = optional_param('unenrol', '');
152  
-    $cmdconfirm = optional_param('confirm', '', PARAM_ALPHA);
153  
-
154 151
     $cmdcapture = optional_param(ORDER_CAPTURE, '', PARAM_ALPHA);
155 152
     $cmddelete = optional_param(ORDER_DELETE, '', PARAM_ALPHA);
156 153
     $cmdrefund = optional_param(ORDER_REFUND, '', PARAM_ALPHA);
157 154
     $cmdvoid = optional_param(ORDER_VOID, '', PARAM_ALPHA);
158 155
 
  156
+    $unenrol = optional_param('unenrol', '', PARAM_ALPHA);
  157
+    $confirm = optional_param('confirm', '', PARAM_ALPHA);
  158
+
159 159
     $table->width = '100%';
160 160
     $table->size = array('30%', '70%');
161 161
     $table->align = array('right', 'left');
@@ -185,7 +185,7 @@ function print_authorize_order_details($orderno) {
185 185
     $table->data[] = array("<b>$authstrs->orderid:</b>", $orderno);
186 186
     $table->data[] = array("<b>$authstrs->transid:</b>", $order->transid);
187 187
     $table->data[] = array("<b>$authstrs->amount:</b>", "$order->currency $order->amount");
188  
-    if ((empty($cmdcapture) and empty($cmdrefund) and empty($cmdvoid))) {
  188
+    if (empty($cmdcapture) and empty($cmdrefund) and empty($cmdvoid) and empty($cmddelete)) {
189 189
         $table->data[] = array("<b>$strs->course:</b>", $order->shortname);
190 190
         $table->data[] = array("<b>$strs->status:</b>", $authstrs->{$status->status});
191 191
         $table->data[] = array("<b>$strs->user:</b>", $order->ccname);
@@ -201,7 +201,7 @@ function print_authorize_order_details($orderno) {
201 201
             error(get_string('youcantdo', 'enrol_authorize', $a));
202 202
         }
203 203
 
204  
-        if (empty($cmdconfirm)) {
  204
+        if (empty($confirm)) {
205 205
             $table->data[] = array("<b>$strs->confirm:</b>",
206 206
             "$authstrs->captureyes<br /><a href='index.php?order=$orderno&amp;".ORDER_CAPTURE."=y&amp;confirm=y'>$strs->yes</a>
207 207
             &nbsp;&nbsp;&nbsp;&nbsp;<a href='index.php?order=$orderno'>$strs->no</a>");
@@ -266,7 +266,7 @@ function print_authorize_order_details($orderno) {
266 266
         }
267 267
         else {
268 268
             $amount = format_float(optional_param('amount', $upto), 2);
269  
-            if (($amount > $upto) || empty($cmdconfirm)) {
  269
+            if (($amount > $upto) || empty($confirm)) {
270 270
                 $a->upto = $upto;
271 271
                 $strcanbecredit = get_string('canbecredit', 'enrol_authorize', $a);
272 272
                 $table->data[] = array("<b>$authstrs->unenrolstudent</b>",
@@ -311,7 +311,7 @@ function print_authorize_order_details($orderno) {
311 311
 
312 312
         $suborderno = optional_param('suborder', 0, PARAM_INT);
313 313
         if (empty($suborderno)) { // cancel original transaction.
314  
-            if (empty($cmdconfirm)) {
  314
+            if (empty($confirm)) {
315 315
                 $strvoidyes = get_string('voidyes', 'enrol_authorize');
316 316
                 $table->data[] = array("<b>$strs->confirm:</b>",
317 317
                     "$strvoidyes<br /><input type='hidden' name='".ORDER_VOID."' value='y'>
@@ -347,7 +347,7 @@ function print_authorize_order_details($orderno) {
347 347
                 error("Transaction can not be voided because of already been voided.");
348 348
             }
349 349
             else {
350  
-                if (empty($cmdconfirm)) {
  350
+                if (empty($confirm)) {
351 351
                     $a->transid = $suborder->transid;
352 352
                     $a->amount = $suborder->amount;
353 353
                     $strsubvoidyes = get_string('subvoidyes', 'enrol_authorize', $a);
@@ -392,7 +392,7 @@ function print_authorize_order_details($orderno) {
392 392
             $a->action = $authstrs->delete;
393 393
             error(get_string('youcantdo', 'enrol_authorize', $a));
394 394
         }
395  
-        if (empty($cmdconfirm)) {
  395
+        if (empty($confirm)) {
396 396
             $table->data[] = array("<b>$authstrs->unenrolstudent</b>",
397 397
                 "<input type='checkbox' name='unenrol' value='y'" . (!empty($unenrol) ? " checked" : "") . ">");
398 398
 

0 notes on commit 743d932

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