Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Get only courses made transactions. This lessens the course list; Mer…

…ged from 16stable.
  • Loading branch information...
commit 6ef50f6983f21d06383acf04957523dcb5a57962 1 parent 378d834
ethem authored
Showing with 7 additions and 10 deletions.
  1. +7 −10 enrol/authorize/locallib.php
View
17 enrol/authorize/locallib.php
@@ -18,7 +18,7 @@
*/
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.'&amp;course='.$courseid.'&amp;status=',$statusmenu,'statusmenu',$status,'','','',false);echo"</td>\n";
Please sign in to comment.
Something went wrong with that request. Please try again.