2006-08-30 10:29:10 +00:00
|
|
|
<?php // $Id$
|
2005-12-26 19:21:37 +00:00
|
|
|
|
2006-03-27 08:49:43 +00:00
|
|
|
/// Load libraries
|
2006-04-26 16:03:16 +00:00
|
|
|
require_once('../../config.php');
|
|
|
|
require_once('locallib.php');
|
2005-12-26 19:21:37 +00:00
|
|
|
|
2006-04-26 16:03:16 +00:00
|
|
|
/// Parameters
|
|
|
|
$orderid = optional_param('order', 0, PARAM_INT);
|
|
|
|
$courseid = optional_param('course', SITEID, PARAM_INT);
|
|
|
|
$userid = optional_param('user', 0, PARAM_INT);
|
2006-03-13 11:15:09 +00:00
|
|
|
|
2006-11-12 13:26:14 +00:00
|
|
|
/// Get course
|
|
|
|
if (! $course = get_record('course', 'id', $courseid)) {
|
|
|
|
error('Could not find that course');
|
|
|
|
}
|
|
|
|
|
2006-03-27 08:49:43 +00:00
|
|
|
/// Only site users can access to this page
|
2006-04-26 17:39:13 +00:00
|
|
|
require_login(); // Don't use $courseid! User may want to see old orders.
|
2006-04-26 16:03:16 +00:00
|
|
|
|
2006-11-03 12:09:00 +00:00
|
|
|
if (has_capability('moodle/legacy:guest', get_context_instance(CONTEXT_SYSTEM), $USER->id, false)) {
|
2006-03-27 08:31:16 +00:00
|
|
|
error("Guests cannot use this page.");
|
2006-03-10 20:05:24 +00:00
|
|
|
}
|
2005-12-26 19:21:37 +00:00
|
|
|
|
2006-04-24 16:46:39 +00:00
|
|
|
/// Load strings. All strings should be defined here. locallib.php uses these strings.
|
2006-10-16 09:39:08 +00:00
|
|
|
$strs = get_strings(array('search','status','action','time','course','confirm','no','all','none','error'));
|
2006-09-01 16:43:52 +00:00
|
|
|
$authstrs = get_strings(array('orderid','nameoncard','echeckfirslasttname','void','capture','refund','delete',
|
2006-10-30 11:16:09 +00:00
|
|
|
'allpendingorders','authcaptured','authorizedpendingcapture','capturedpendingsettle','settled',
|
2006-10-16 09:39:08 +00:00
|
|
|
'refunded','cancelled','expired','underreview','approvedreview','reviewfailed','tested','new',
|
|
|
|
'paymentmethod','methodcc','methodecheck',
|
2006-06-07 18:47:09 +00:00
|
|
|
'transid','settlementdate','notsettled','amount','unenrolstudent'), 'enrol_authorize');
|
2006-01-20 16:04:52 +00:00
|
|
|
|
2006-03-27 08:49:43 +00:00
|
|
|
/// Print header
|
2006-06-07 18:47:09 +00:00
|
|
|
$strpaymentmanagement = get_string('paymentmanagement', 'enrol_authorize');
|
2006-11-12 13:26:14 +00:00
|
|
|
print_header_simple($strpaymentmanagement, "", "<a href=\"index.php\">$strpaymentmanagement</a>");
|
2005-12-26 19:21:37 +00:00
|
|
|
|
2006-11-12 13:26:14 +00:00
|
|
|
/// If orderid is empty, user wants to see all orders
|
2006-03-27 08:49:43 +00:00
|
|
|
if (empty($orderid)) {
|
2006-09-15 12:35:08 +00:00
|
|
|
authorize_print_orders($courseid, $userid);
|
2006-04-26 16:03:16 +00:00
|
|
|
} else {
|
2006-04-11 12:37:41 +00:00
|
|
|
authorize_print_order_details($orderid);
|
2005-12-26 19:21:37 +00:00
|
|
|
}
|
|
|
|
|
2006-03-27 08:49:43 +00:00
|
|
|
/// Print footer
|
2006-03-27 08:31:16 +00:00
|
|
|
print_footer();
|
2005-12-26 19:21:37 +00:00
|
|
|
?>
|