mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
Daily echeck order notification
This commit is contained in:
parent
69aaada0f5
commit
c33e8ec8f7
2 changed files with 27 additions and 3 deletions
|
@ -689,6 +689,7 @@ class enrolment_plugin_authorize
|
||||||
|
|
||||||
$oneday = 86400;
|
$oneday = 86400;
|
||||||
$timenow = time();
|
$timenow = time();
|
||||||
|
$onepass = $timenow - $oneday;
|
||||||
$settlementtime = authorize_getsettletime($timenow);
|
$settlementtime = authorize_getsettletime($timenow);
|
||||||
$timediff30 = $settlementtime - (30 * $oneday);
|
$timediff30 = $settlementtime - (30 * $oneday);
|
||||||
|
|
||||||
|
@ -705,7 +706,24 @@ class enrolment_plugin_authorize
|
||||||
$select = "(status='".AN_STATUS_EXPIRE."') AND (timecreated<'$timediff60')";
|
$select = "(status='".AN_STATUS_EXPIRE."') AND (timecreated<'$timediff60')";
|
||||||
delete_records_select('enrol_authorize', $select);
|
delete_records_select('enrol_authorize', $select);
|
||||||
|
|
||||||
// XXX TODO SEND EMAIL to uploadcsv user
|
// XXX TODO SEND EMAIL to 'enrol/authorize:uploadcsv'
|
||||||
|
// get_users_by_capability() does not handling user level resolving
|
||||||
|
// After user resolving, get_admin() to get_users_by_capability()
|
||||||
|
$adminuser = get_admin();
|
||||||
|
$select = "status IN(".AN_STATUS_UNDERREVIEW.",".AN_STATUS_APPROVEDREVIEW.") " .
|
||||||
|
"AND (timecreated<'$onepass') AND (timecreated>'$timediff60')";
|
||||||
|
$count = count_records_select('enrol_authorize', $select);
|
||||||
|
if ($count) {
|
||||||
|
$a = new stdClass;
|
||||||
|
$a->count = $count;
|
||||||
|
$a->course = $SITE->shortname;
|
||||||
|
$subject = get_string('pendingechecksubject', 'enrol_authorize', $a);
|
||||||
|
$a = new stdClass;
|
||||||
|
$a->count = $count;
|
||||||
|
$a->url = $CFG->wwwroot.'/enrol/authorize/uploadcsv.php';
|
||||||
|
$message = get_string('pendingecheckemail', 'enrol_authorize', $a);
|
||||||
|
@email_to_user($adminuser, $adminuser, $subject, $message);
|
||||||
|
}
|
||||||
|
|
||||||
// Daily warning email for pending orders expiring.
|
// Daily warning email for pending orders expiring.
|
||||||
if (empty($CFG->an_emailexpired)) {
|
if (empty($CFG->an_emailexpired)) {
|
||||||
|
@ -733,7 +751,6 @@ class enrolment_plugin_authorize
|
||||||
$a->enrolurl = "$CFG->wwwroot/$CFG->admin/enrol_config.php?enrol=authorize";
|
$a->enrolurl = "$CFG->wwwroot/$CFG->admin/enrol_config.php?enrol=authorize";
|
||||||
$a->url = $CFG->wwwroot.'/enrol/authorize/index.php?status='.AN_STATUS_AUTH;
|
$a->url = $CFG->wwwroot.'/enrol/authorize/index.php?status='.AN_STATUS_AUTH;
|
||||||
$message = get_string('pendingordersemail', 'enrol_authorize', $a);
|
$message = get_string('pendingordersemail', 'enrol_authorize', $a);
|
||||||
$adminuser = get_admin();
|
|
||||||
email_to_user($adminuser, $adminuser, $subject, $message);
|
email_to_user($adminuser, $adminuser, $subject, $message);
|
||||||
|
|
||||||
// Email to teachers
|
// Email to teachers
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?PHP // $Id$
|
<?PHP // $Id$
|
||||||
// enrol_authorize.php - created with Moodle 1.8 dev (2006102600)
|
// enrol_authorize.php - created with Moodle 1.8 dev (2006112000)
|
||||||
|
|
||||||
|
|
||||||
$string['adminacceptccs'] = 'Which credit card types will be accepted?';
|
$string['adminacceptccs'] = 'Which credit card types will be accepted?';
|
||||||
|
@ -126,6 +126,13 @@ $string['orderid'] = 'OrderID';
|
||||||
$string['paymentmanagement'] = 'Payment Management';
|
$string['paymentmanagement'] = 'Payment Management';
|
||||||
$string['paymentmethod'] = 'Payment Method';
|
$string['paymentmethod'] = 'Payment Method';
|
||||||
$string['paymentpending'] = 'Your payment is pending for this course with this order number $a->orderid. See <a href=\'$a->url\'>Order Details</a>.';
|
$string['paymentpending'] = 'Your payment is pending for this course with this order number $a->orderid. See <a href=\'$a->url\'>Order Details</a>.';
|
||||||
|
$string['pendingecheckemail'] = 'Dear manager,
|
||||||
|
|
||||||
|
There are $a->count pending echecks now and you have to upload a csv file to get the users enrolled.
|
||||||
|
|
||||||
|
Click the link and read the help file on the page seen:
|
||||||
|
$a->url';
|
||||||
|
$string['pendingechecksubject'] = '$a->course: Pending eChecks($a->count)';
|
||||||
$string['pendingordersemail'] = 'Dear admin,
|
$string['pendingordersemail'] = 'Dear admin,
|
||||||
|
|
||||||
$a->pending transactions for course \"$a->course\" will expire unless you accept payment within $a->days days.
|
$a->pending transactions for course \"$a->course\" will expire unless you accept payment within $a->days days.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue