Commit 83cdeb6c authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1798981: Show approved registrations waiting on user completion



On the Admin -> Pending registrations page
Also added the expiry date to show admin when they will disappear if
not actioned
Also updated the text to make it a bit clearer about what is happening
when

behatnotneeded

Change-Id: Icb33def34fa79c41438d58a50e9e139da6a950cb
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent ce39e073
......@@ -48,8 +48,8 @@ $institutionselector = pieform(array(
$pending = get_records_sql_array('
SELECT u.* FROM {usr_registration} u
WHERE u.institution = ? AND u.pending = 1
ORDER BY u.expiry ASC', array($institution)
WHERE u.institution = ? AND u.pending IN (1, 2)
ORDER BY u.pending ASC, u.expiry ASC', array($institution)
);
if (!$pending) {
$pending = array();
......@@ -80,6 +80,7 @@ function build_pending_html($data, $institution) {
}
}
}
$item->expiryformat = format_date(strtotime($item->expiry));
}
}
$smarty = smarty_core();
......
......@@ -2792,7 +2792,7 @@ function auth_register_submit(Pieform $form, $values) {
}
if ($confirm) {
$values['pending'] = 1;
$values['expiry'] = db_format_timestamp(time() + (86400 * 14)); // now + 2 weeks
$values['expiry'] = db_format_timestamp(time() + (int)get_config('defaultregistrationexpirylifetime'));
}
else {
$values['pending'] = 0;
......
......@@ -816,6 +816,7 @@ $string['usersuspended'] = 'User suspended';
$string['userunsuspended'] = 'User unsuspended';
$string['expiredusers'] = 'Expired users';
$string['expired'] = 'Expired';
$string['expires'] = 'Expires';
$string['unexpireusers'] = 'Reactivate expired users';
$string['usersreactivated'] = 'Users reactivated';
......@@ -1110,11 +1111,12 @@ $string['denyregistrationmessage'] = 'This will deny the registration for the us
$string['nopendingregistrations'] = 'No pending registrations were found for this institution.';
$string['pendingregistration'] = 'Pending registration';
$string['pendingregistrations'] = 'Pending registrations';
$string['pendingregistrationspagedescription'] = '<p>On this page you can see users who have self-registered and requested membership of your institution and approve or deny their registration.<p>
<p>On approving their registration, you are also adding them as members of the institution, and they will be notified with further instructions about activating their account. On denying their registration, they will be notified that their application was denied by an automated response email.</p>';
$string['pendingregistrationspagedescription1'] = '<p>On this page you can see users who have self-registered and requested membership of your institution and approve or deny their registration.<p>
<p>On approving their registration, they are notified with further instructions about activating their account. When they follow the activation link supplied they are added as a member of the institution. The activation link expires after 24 hours and their details are removed. If they still want to register they will need to begin the process again.</p>
<p>On denying their registration, they will be notified that their application was denied by an automated response email.</p>';
$string['pendingregistrationdesc'] = 'Approve or deny membership of your institution to self-registering users';
$string['pendingdeletiondesc'] = 'Approve or deny the deletion of users who wish to remove their accounts';
$string['pendingusercompletion'] = 'Approval sent, waiting on user completion';
$string['nosuchinstitution'] = 'No such institution.';
$string['registrationapprovedsuccessfully'] = 'Registration approved successfully.';
$string['registrationdeniedreason'] = 'Denial reason';
......
......@@ -644,3 +644,6 @@ div.toolbarhtml {
font-weight: bold;
}
}
#pendinglist {
margin-bottom: 0;
}
\ No newline at end of file
{include file="header.tpl"}
<div class="lead">{str tag="pendingregistrationspagedescription" section="admin"}</div>
<div class="lead">{str tag="pendingregistrationspagedescription1" section="admin"}</div>
<div class="panel panel-default">
<div id="pendingonlineistcontainer">
{$data|safe}
......
{if $data}
<table id="pendinglist" class="fullwidth table">
<thead>
<th>{str tag=pendingregistration section=admin}</th>
<th>{str tag=registrationreason section=admin}</th>
{if $extracols}
{foreach from=$extracols key=colkey item=col}
<th>{str tag=$colkey section=mahara}</th>
{/foreach}
<thead>
<th>{str tag=pendingregistration section=admin}</th>
<th>{str tag=registrationreason section=admin}</th>
{if $extracols}
{foreach from=$extracols key=colkey item=col}
<th>{str tag=$colkey section=mahara}</th>
{/foreach}
{/if}
<th>{str tag=expires section=admin}</th>
<th>&nbsp;</th>
</thead>
<tbody>
{foreach from=$data item=registration}
<tr class="{cycle values='r0,r1'}">
<td class="pendinginfo">
<div id="pendinginfo_{$registration->id}">
<h3 class="title">{$registration->firstname} {$registration->lastname}</h3>
<div class="detail">{$registration->email}</div>
</div>
</td>
<td class="pendinginfo">
<div class="detail">{$registration->reason}</div>
</td>
{if $extracols}
{foreach from=$extracols key=colkey item=col}
<td>
<div class="detail">{if property_exists($registration->extra, $colkey)}{$registration->extra->$colkey}{/if}</div>
</td>
{/foreach}
{/if}
<td>{$registration->expiryformat}</td>
<td>
{if $registration->pending == 2}
<div>{str tag=pendingusercompletion section=admin}</div>
{else}
<div class="btn-group">
<a class="btn btn-default btn-xs" href="{$WWWROOT}admin/users/actionregistration.php?r={$registration->id}&action=approve">
<span class="icon icon-lg left icon-check text-success" role="presentation" aria-hidden="true"></span>
<span class="btn-approve">{str tag=approve section=admin}</span>
</a>
<a class="btn btn-default btn-xs" href="{$WWWROOT}admin/users/actionregistration.php?r={$registration->id}&action=deny">
<span class="icon icon-lg left icon-ban text-danger" role="presentation" aria-hidden="true"></span>
<span class="btn-deny">{str tag=deny section=admin}</span>
</a>
</div>
{/if}
<th>&nbsp;</th>
</thead>
<tbody>
{foreach from=$data item=registration}
<tr class="{cycle values='r0,r1'}">
<td class="pendinginfo">
<div id="pendinginfo_{$registration->id}">
<h3 class="title">{$registration->firstname} {$registration->lastname}</h3>
<div class="detail">{$registration->email}</div>
</div>
</td>
<td class="pendinginfo">
<div class="detail">{$registration->reason}</div>
</td>
{if $extracols}
{foreach from=$extracols key=colkey item=col}
<td>
<div class="detail">{if property_exists($registration->extra, $colkey)}{$registration->extra->$colkey}{/if}</div>
</td>
{/foreach}
{/if}
<td class="">
<div class="btn-group">
<a class="btn btn-default btn-xs" href="{$WWWROOT}admin/users/actionregistration.php?r={$registration->id}&action=approve">
<span class="icon icon-lg left icon-check text-success" role="presentation" aria-hidden="true"></span>
<span class="btn-approve">{str tag=approve section=admin}</span>
</a>
<a class="btn btn-default btn-xs" href="{$WWWROOT}admin/users/actionregistration.php?r={$registration->id}&action=deny">
<span class="icon icon-lg left icon-ban text-danger" role="presentation" aria-hidden="true"></span>
<span class="btn-deny">{str tag=deny section=admin}</span></a>
</div>
</td>
</tr>
{/foreach}
</td>
</tr>
{/foreach}
</tbody>
</table>
{else}
<tr><td><div class="no-results">{str tag=nopendingregistrations section=admin}</div></td></tr>
<div class="no-results">{str tag=nopendingregistrations section=admin}</div>
{/if}
</tbody>
</table>
Supports Markdown
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