Automatic installer.php lang files by installer_builder (20070726)
[moodle-linuxchix.git] / enrol / authorize / index.php
blob552cfba5ec0c10f4ca5a789df302f1ace5888263
1 <?php // $Id$
3 /// Load libraries
4 require_once('../../config.php');
5 require_once('locallib.php');
7 /// Parameters
8 $orderid = optional_param('order', 0, PARAM_INT);
9 $courseid = optional_param('course', SITEID, PARAM_INT);
10 $userid = optional_param('user', 0, PARAM_INT);
12 /// Get course
13 if (! $course = get_record('course', 'id', $courseid)) {
14 error('Could not find that course');
17 /// Only site users can access to this page
18 require_login(); // Don't use $courseid! User may want to see old orders.
20 if (has_capability('moodle/legacy:guest', get_context_instance(CONTEXT_SYSTEM), $USER->id, false)) {
21 error("Guests cannot use this page.");
24 /// Load strings. All strings should be defined here. locallib.php uses these strings.
25 $strs = get_strings(array('search','status','action','time','course','confirm','no','all','none','error'));
26 $authstrs = get_strings(array('orderid','nameoncard','echeckfirslasttname','void','capture','refund','delete',
27 'allpendingorders','authcaptured','authorizedpendingcapture','capturedpendingsettle','settled',
28 'refunded','cancelled','expired','underreview','approvedreview','reviewfailed','tested','new',
29 'paymentmethod','methodcc','methodecheck',
30 'transid','settlementdate','notsettled','amount','unenrolstudent'), 'enrol_authorize');
32 /// Print header
33 $strpaymentmanagement = get_string('paymentmanagement', 'enrol_authorize');
34 print_header_simple($strpaymentmanagement, "", "<a href=\"index.php\">$strpaymentmanagement</a>");
36 /// If orderid is empty, user wants to see all orders
37 if (empty($orderid)) {
38 authorize_print_orders($courseid, $userid);
39 } else {
40 authorize_print_order_details($orderid);
43 /// Print footer
44 print_footer();