]> git.mjollnir.org Git - moodle.git/commitdiff
Tidy up
authorethem <ethem>
Fri, 15 Sep 2006 12:35:08 +0000 (12:35 +0000)
committerethem <ethem>
Fri, 15 Sep 2006 12:35:08 +0000 (12:35 +0000)
enrol/authorize/index.php
enrol/authorize/locallib.php

index 6f7a1f059287c6ca9b4096cda9629e2f7ced0a46..643b1f002e443ae2e05f6287af787d1c52eebc33 100644 (file)
         error("Guests cannot use this page.");
     }
 
+    if (!$course = get_record('course', 'id', $courseid)) {
+        error('Could not find that course');
+    }
+
 /// Load strings. All strings should be defined here. locallib.php uses these strings.
     $strs = get_strings(array('status','action','time','course','confirm','no','all','none','error'));
     $authstrs = get_strings(array('orderid','nameoncard','echeckfirslasttname','void','capture','refund','delete',
 
 /// Print header
     $strpaymentmanagement = get_string('paymentmanagement', 'enrol_authorize');
-    if (!$course = get_record('course', 'id', $courseid)) {
-        error('Could not find that course');
-    }
     print_header_simple("$strpaymentmanagement", "", "<a href=\"index.php\">$strpaymentmanagement</a>");
 
-
-/// If orderid is empty, user wants to see all orders
+/// If orderid is empty, print orders
     if (empty($orderid)) {
-        authorize_print_orders();
+        authorize_print_orders($courseid, $userid);
     } else {
         authorize_print_order_details($orderid);
     }
index 0dca0803c659ed85c53aa0dc786a506d17500c29..af742006ae5c52a77bc63a5b08221ae0578d7d46 100644 (file)
@@ -16,11 +16,10 @@ define('ORDER_VOID',    'void');
  * authorize_print_orders
  *
  */
-function authorize_print_orders()
+function authorize_print_orders($courseid, $userid)
 {
     global $CFG, $USER;
     global $strs, $authstrs;
-    global $courseid, $userid;
     require_once($CFG->libdir.'/tablelib.php');
 
     $perpage = 10;