Skip to content

Commit

Permalink
pendingordersemailteacher string added
Browse files Browse the repository at this point in the history
merged from stable
  • Loading branch information
ethem committed Jun 15, 2006
1 parent fa6a9cb commit e3df610
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions enrol/authorize/enrol.php
Expand Up @@ -669,27 +669,26 @@ function cron()
email_to_user($adminuser, $adminuser, $subject, $message); email_to_user($adminuser, $adminuser, $subject, $message);
if (!empty($CFG->an_teachermanagepay) and !empty($CFG->an_emailexpiredteacher)) { if (!empty($CFG->an_teachermanagepay) and !empty($CFG->an_emailexpiredteacher)) {
$sorttype = empty($CFG->an_sorttype) ? 'ttl' : $CFG->an_sorttype; $sorttype = empty($CFG->an_sorttype) ? 'ttl' : $CFG->an_sorttype;
$sql = "SELECT E.courseid, COUNT(E.courseid) AS cnt, SUM(E.amount) as ttl " . $sql = "SELECT E.courseid, E.currency, COUNT(E.courseid) AS cnt, SUM(E.amount) as ttl " .
"FROM {$CFG->prefix}enrol_authorize E " . "FROM {$CFG->prefix}enrol_authorize E " .
"WHERE $select GROUP BY E.courseid ORDER BY $sorttype DESC"; "WHERE $select GROUP BY E.courseid ORDER BY $sorttype DESC";
$message = ''; $subject = ''; $message = ''; $subject = ''; $lastcourse = 0;
$lastcourse = 0; $lastcount = 0;
$courseidandcounts = get_records_sql($sql); $courseidandcounts = get_records_sql($sql);
foreach($courseidandcounts as $courseidandcount) { foreach($courseidandcounts as $courseidandcount) {
if ($lastcourse != $courseidandcount->courseid) { if ($lastcourse != $courseidandcount->courseid) {
$lastcourse = $courseidandcount->courseid; $lastcourse = $courseidandcount->courseid;
$lastcount = $courseidandcount->cnt;
$a = new stdClass; $a = new stdClass;
$a->pending = $lastcount; $a->pending = $courseidandcount->cnt;
$a->days = $CFG->an_emailexpired; $a->days = $CFG->an_emailexpired;
$subject = get_string('pendingorderssubject', 'enrol_authorize', $a); $subject = get_string('pendingorderssubject', 'enrol_authorize', $a);
$a = new stdClass; $a = new stdClass;
$a->pending = $lastcount; $a->pending = $courseidandcount->cnt;
$a->currency = $courseidandcount->currency;
$a->sumcost = $courseidandcount->ttl;
$a->days = $CFG->an_emailexpired; $a->days = $CFG->an_emailexpired;
$a->enrolurl = "$CFG->wwwroot/$CFG->admin/users.php";
$a->url = $CFG->wwwroot.'/enrol/authorize/index.php?course='. $a->url = $CFG->wwwroot.'/enrol/authorize/index.php?course='.
$lastcourse.'&status='.AN_STATUS_AUTH; $lastcourse.'&status='.AN_STATUS_AUTH;
$message = get_string('pendingordersemail', 'enrol_authorize', $a); $message = get_string('pendingordersemailteacher', 'enrol_authorize', $a);
} }
if ($teachers = get_course_teachers($lastcourse)) { if ($teachers = get_course_teachers($lastcourse)) {
foreach ($teachers as $teacher) { foreach ($teachers as $teacher) {
Expand Down

0 comments on commit e3df610

Please sign in to comment.