Get only courses made transactions. This lessens the course list; Merged from 17stable.
This commit is contained in:
@@ -18,7 +18,7 @@ define('ORDER_VOID', 'void');
|
||||
*/
|
||||
function authorize_print_orders($courseid, $userid)
|
||||
{
|
||||
global $CFG, $USER;
|
||||
global $CFG, $USER, $SITE;
|
||||
global $strs, $authstrs;
|
||||
require_once($CFG->libdir.'/tablelib.php');
|
||||
|
||||
@@ -44,19 +44,16 @@ function authorize_print_orders($courseid, $userid)
|
||||
AN_STATUS_TEST => $authstrs->tested
|
||||
);
|
||||
|
||||
$sql = "SELECT id, fullname FROM {$CFG->prefix}course ";
|
||||
$sql = "SELECT c.id, c.fullname FROM {$CFG->prefix}course c INNER JOIN {$CFG->prefix}enrol_authorize e ON c.id = e.courseid ";
|
||||
if ($CFG->enrol == 'authorize') { // default enrolment plugin
|
||||
$sql .= "WHERE (enrol IS NULL) OR (enrol='') OR (enrol = 'authorize') ";
|
||||
$sql .= "WHERE (c.enrol IS NULL) OR (c.enrol='') OR (c.enrol = 'authorize') ";
|
||||
}
|
||||
else {
|
||||
$sql .= "WHERE (enrol = 'authorize') ";
|
||||
$sql .= "WHERE (c.enrol = 'authorize') ";
|
||||
}
|
||||
$sql .= "ORDER BY sortorder, fullname";
|
||||
if ($courses = get_records_sql($sql)) {
|
||||
$popupcrs = array();
|
||||
foreach ($courses as $crs) {
|
||||
$popupcrs[$crs->id] = $crs->fullname;
|
||||
}
|
||||
$sql .= "ORDER BY c.sortorder, c.fullname";
|
||||
if ($popupcrs = get_records_sql_menu($sql)) {
|
||||
$popupcrs[$SITE->id] = $SITE->fullname;
|
||||
echo "<table border='0' width='100%' cellspacing=0 cellpadding=3 class='generaltable generalbox'>";
|
||||
echo "<tr>";
|
||||
echo "<td width='5%'>$strs->status: </td><td width='10%'>";popup_form($baseurl.'&course='.$courseid.'&status=',$statusmenu,'statusmenu',$status,'','','',false);echo"</td>\n";
|
||||
|
||||
Reference in New Issue
Block a user