Commit 2b6504b9 authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1740330, Bug 1740331: Change expire/inactive emails to show actual date



Rather the more confusing x days in the future

behatnotneeded

Change-Id: I1413b75ae279bbee537cd7aff3c1ee37b5a73598
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent bddbc2b1
......@@ -1896,6 +1896,7 @@ function auth_handle_account_expiries() {
$daystoexpire = ceil($warn / 86400) . ' ';
$daystoexpire .= ($daystoexpire == 1) ? get_string('day') : get_string('days');
$expiredate = format_date(strtotime('+' . $daystoexpire), 'strftimedate');
// Expiry warning messages
if ($users = get_records_sql_array('SELECT u.id, u.username, u.firstname, u.lastname, u.preferredname, u.email, u.admin, u.staff
......@@ -1905,8 +1906,8 @@ function auth_handle_account_expiries() {
foreach ($users as $user) {
$displayname = display_name($user);
_email_or_notify($user, get_string('accountexpirywarning'),
get_string('accountexpirywarningtext', 'mahara', $displayname, $sitename, $daystoexpire, $wwwroot . 'contact.php', $sitename),
get_string('accountexpirywarninghtml', 'mahara', $displayname, $sitename, $daystoexpire, $wwwroot . 'contact.php', $sitename)
get_string('accountexpirywarningtext1', 'mahara', $displayname, $sitename, $expiredate, $wwwroot . 'export/index.php', $wwwroot . 'contact.php', $sitename),
get_string('accountexpirywarninghtml1', 'mahara', $displayname, $sitename, $expiredate, $wwwroot . 'export/index.php', $wwwroot . 'contact.php', $sitename)
);
set_field('usr', 'expirymailsent', 1, 'id', $user->id);
}
......@@ -1956,8 +1957,8 @@ function auth_handle_account_expiries() {
foreach ($users as $user) {
$displayname = display_name($user);
_email_or_notify($user, get_string('accountinactivewarning'),
get_string('accountinactivewarningtext', 'mahara', $displayname, $sitename, $daystoexpire, $sitename),
get_string('accountinactivewarninghtml', 'mahara', $displayname, $sitename, $daystoexpire, $sitename)
get_string('accountinactivewarningtext1', 'mahara', $displayname, $sitename, $expiredate, $sitename),
get_string('accountinactivewarninghtml1', 'mahara', $displayname, $sitename, $expiredate, $sitename)
);
set_field('usr', 'inactivemailsent', 1, 'id', $user->id);
}
......@@ -1981,10 +1982,10 @@ function auth_handle_account_expiries() {
foreach ($users as $user) {
$displayname = display_name($user);
_email_or_notify($user, get_string('institutionmembershipexpirywarning'),
get_string('institutionmembershipexpirywarningtext', 'mahara', $displayname, $user->institutionname,
$sitename, $daystoexpire, $wwwroot . 'contact.php', $sitename),
get_string('institutionmembershipexpirywarninghtml', 'mahara', $displayname, $user->institutionname,
$sitename, $daystoexpire, $wwwroot . 'contact.php', $sitename)
get_string('institutionmembershipexpirywarningtext1', 'mahara', $displayname, $user->institutionname,
$sitename, $expiredate, $wwwroot . 'contact.php', $sitename),
get_string('institutionmembershipexpirywarninghtml1', 'mahara', $displayname, $user->institutionname,
$sitename, $expiredate, $wwwroot . 'contact.php', $sitename)
);
set_field('usr_institution', 'expirymailsent', 1, 'usr', $user->id,
'institution', $user->institution);
......@@ -2012,6 +2013,7 @@ function auth_handle_institution_expiries() {
$daystoexpire = ceil($warn / 86400) . ' ';
$daystoexpire .= ($daystoexpire == 1) ? get_string('day') : get_string('days');
$expiredate = format_date(strtotime('+' . $daystoexpire), 'strftimedate');
// Get site administrators
$siteadmins = get_records_sql_array('SELECT u.id, u.username, u.firstname, u.lastname, u.preferredname, u.email, u.admin, u.staff FROM {usr} u WHERE u.admin = 1', array());
......@@ -2027,8 +2029,8 @@ function auth_handle_institution_expiries() {
foreach ($siteadmins as $user) {
$user_displayname = display_name($user);
_email_or_notify($user, get_string('institutionexpirywarning'),
get_string('institutionexpirywarningtext_site', 'mahara', $user_displayname, $institution_displayname, $daystoexpire, $sitename, $sitename),
get_string('institutionexpirywarninghtml_site', 'mahara', $user_displayname, $institution_displayname, $daystoexpire, $sitename, $sitename)
get_string('institutionexpirywarningtext_site1', 'mahara', $user_displayname, $institution_displayname, $expiredate, $sitename, $sitename),
get_string('institutionexpirywarninghtml_site1', 'mahara', $user_displayname, $institution_displayname, $expiredate, $sitename, $sitename)
);
}
......@@ -2040,8 +2042,8 @@ function auth_handle_institution_expiries() {
foreach ($institutionaladmins as $user) {
$user_displayname = display_name($user);
_email_or_notify($user, get_string('institutionexpirywarning'),
get_string('institutionexpirywarningtext_institution', 'mahara', $user_displayname, $institution_displayname, $sitename, $daystoexpire, $wwwroot . 'contact.php', $sitename),
get_string('institutionexpirywarninghtml_institution', 'mahara', $user_displayname, $institution_displayname, $sitename, $daystoexpire, $wwwroot . 'contact.php', $sitename)
get_string('institutionexpirywarningtext_institution1', 'mahara', $user_displayname, $institution_displayname, $sitename, $expiredate, $wwwroot . 'contact.php', $sitename),
get_string('institutionexpirywarninghtml_institution1', 'mahara', $user_displayname, $institution_displayname, $sitename, $expiredate, $wwwroot . 'contact.php', $sitename)
);
}
set_field('institution', 'expirymailsent', 1, 'name', $institution->name);
......
......@@ -318,94 +318,104 @@ $string['accountcreatedchangepasswordhtml'] = '<p>Dear %s</p>
<p>Regards, %s site administrator</p>
';
$string['accountexpirywarning'] = 'Account expiry warning';
$string['accountexpirywarningtext'] = 'Dear %s,
$string['accountexpirywarningtext1'] = 'Dear %s,
Your account on %s will expire within %s.
Your account on %s will expire on %s.
We recommend you save the contents of your portfolio using the export tool. Instructions on using this feature may be found within the user guide.
If you wish to keep your portfolio content after your account expires, we recommend you export your portfolio via %s.
If you wish to extend your account access or have any questions regarding the above, please feel free to contact us:
%s
Regards, %s site administrator';
$string['accountexpirywarninghtml'] = '<p>Dear %s,</p>
Regards,
%s site administrator';
$string['accountexpirywarninghtml1'] = '<p>Dear %s,</p>
<p>Your account on %s will expire within %s.</p>
<p>Your account on %s will expire on %s.</p>
<p>We recommend you save the contents of your portfolio using the export tool. Instructions on using this feature may be found within the user guide.</p>
<p>If you wish to keep your portfolio content after your account expires, we recommend you export your portfolio via the <a href="%s">export tool</a>.</p>
<p>If you wish to extend your account access or have any questions regarding the above, please feel free to <a href="%s">contact us</a>.</p>
<p>Regards, %s site administrator</p>';
<p>Regards,<br>
%s site administrator</p>';
$string['institutionmembershipexpirywarning'] = 'Institution membership expiry warning';
$string['institutionmembershipexpirywarningtext'] = 'Dear %s,
$string['institutionmembershipexpirywarningtext1'] = 'Dear %s,
Your membership of %s on %s will expire within %s.
Your membership of %s on %s will expire on %s.
If you wish to extend your membership or have any questions regarding the above, please feel free to contact us:
%s
Regards, %s site administrator';
$string['institutionmembershipexpirywarninghtml'] = '<p>Dear %s,</p>
Regards,
%s site administrator';
$string['institutionmembershipexpirywarninghtml1'] = '<p>Dear %s,</p>
<p>Your membership of %s on %s will expire within %s.</p>
<p>Your membership of %s on %s will expire on %s.</p>
<p>If you wish to extend your membership or have any questions regarding the above, please feel free to <a href="%s">contact us</a>.</p>
<p>Regards, %s site administrator</p>';
<p>Regards,<br>
%s site administrator</p>';
$string['institutionexpirywarning'] = 'Institution expiry warning';
$string['institutionexpirywarningtext_institution'] = 'Dear %s,
$string['institutionexpirywarningtext_institution1'] = 'Dear %s,
%s\'s membership of %s will expire within %s.
%s\'s membership of %s will expire on %s.
If you wish to extend your institution\'s membership or have any questions regarding the above, please feel free to contact us:
%s
Regards, %s site administrator';
$string['institutionexpirywarninghtml_institution'] = '<p>Dear %s,</p>
Regards,
%s site administrator';
$string['institutionexpirywarninghtml_institution1'] = '<p>Dear %s,</p>
<p>%s\'s membership of %s will expire within %s.</p>
<p>%s\'s membership of %s will expire on %s.</p>
<p>If you wish to extend your institution\'s membership or have any questions regarding the above, please feel free to <a href="%s">contact us</a>.</p>
<p>Regards, %s site administrator</p>';
$string['institutionexpirywarningtext_site'] = 'Dear %s,
<p>Regards,<br>
%s site administrator</p>';
$string['institutionexpirywarningtext_site1'] = 'Dear %s,
The institution \'%s\' will expire within %s.
The institution \'%s\' will expire on %s.
You may wish to contact them to extend their membership of %s.
Regards, %s site administrator';
$string['institutionexpirywarninghtml_site'] = '<p>Dear %s,</p>
Regards,
%s site administrator';
$string['institutionexpirywarninghtml_site1'] = '<p>Dear %s,</p>
<p>The institution \'%s\' will expire within %s.</p>
<p>The institution \'%s\' will expire on %s.</p>
<p>You may wish to contact them to extend their membership of %s.</p>
<p>Regards, %s site administrator</p>';
<p>Regards,<br>
%s site administrator</p>';
$string['accountinactive'] = 'Sorry, your account is currently inactive.';
$string['accountinactivewarning'] = 'Account inactivity warning';
$string['accountinactivewarningtext'] = 'Dear %s,
$string['accountinactivewarningtext1'] = 'Dear %s,
Your account on %s will become inactive within %s.
Your account on %s will become inactive on %s.
Once inactive, you will not be able to log in until an administrator re-enables your account.
You can prevent your account from becoming inactive by logging in.
Regards, %s site administrator';
$string['accountinactivewarninghtml'] = '<p>Dear %s,</p>
Regards,
%s site administrator';
$string['accountinactivewarninghtml1'] = '<p>Dear %s,</p>
<p>Your account on %s will become inactive within %s.</p>
<p>Your account on %s will become inactive on %s.</p>
<p>Once inactive, you will not be able to log in until an administrator re-enables your account.</p>
<p>You can prevent your account from becoming inactive by logging in.</p>
<p>Regards, %s site administrator</p>';
<p>Regards,<br>
%s site administrator</p>';
$string['accountsuspended'] = 'Your account has been suspended as of %s.<br />The reason for your suspension is: %s';
$string['youraccounthasbeensuspended'] = 'Your account has been suspended.';
$string['youraccounthasbeenunsuspended'] = 'Your account has been unsuspended.';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment