From: ethem Date: Fri, 15 Sep 2006 12:35:08 +0000 (+0000) Subject: Tidy up X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=0fbf82ea78f840d23f05faaa07d7f4d8af2e11cb;p=moodle.git Tidy up --- diff --git a/enrol/authorize/index.php b/enrol/authorize/index.php index 6f7a1f0592..643b1f002e 100644 --- a/enrol/authorize/index.php +++ b/enrol/authorize/index.php @@ -16,6 +16,10 @@ 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', @@ -25,15 +29,11 @@ /// 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", "", "$strpaymentmanagement"); - -/// 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); } diff --git a/enrol/authorize/locallib.php b/enrol/authorize/locallib.php index 0dca0803c6..af742006ae 100644 --- a/enrol/authorize/locallib.php +++ b/enrol/authorize/locallib.php @@ -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;