Skip to content

Commit

Permalink
Removed group selector from clients.php as design approach changed.
Browse files Browse the repository at this point in the history
  • Loading branch information
anuko committed Dec 4, 2018
1 parent e63eef5 commit 21a8853
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 42 deletions.
9 changes: 0 additions & 9 deletions WEB-INF/templates/clients.tpl
Expand Up @@ -6,15 +6,6 @@
<tr>
<td valign="top">
{if $user->can('manage_clients')}
{if $group_dropdown}
{$forms.clientsForm.open} {* clientsForm consists only of one dropdown group control *}
<table width="100%">
<tr>
<td align="center">{$i18n.label.group}: {$forms.clientsForm.group.control}</td>
</tr>
</table>
{$forms.clientsForm.close}
{/if}
<table cellspacing="1" cellpadding="3" border="0" width="100%">
{if $inactive_clients}
<tr><td class="sectionHeaderNoBorder">{$i18n.form.clients.active_clients}</td></tr>
Expand Down
2 changes: 1 addition & 1 deletion WEB-INF/templates/footer.tpl
Expand Up @@ -12,7 +12,7 @@
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
<td align="center">&nbsp;Anuko Time Tracker 1.18.29.4580 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
<td align="center">&nbsp;Anuko Time Tracker 1.18.29.4581 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
<a href="https://www.anuko.com/lp/tt_4.htm" target="_blank">{$i18n.footer.credits}</a> |
<a href="https://www.anuko.com/lp/tt_5.htm" target="_blank">{$i18n.footer.license}</a> |
<a href="https://www.anuko.com/lp/tt_7.htm" target="_blank">{$i18n.footer.improve}</a>
Expand Down
33 changes: 1 addition & 32 deletions clients.php
Expand Up @@ -40,45 +40,14 @@
header('Location: feature_disabled.php');
exit();
}
if ($request->isPost()) {
$groupChanged = $request->getParameter('group_changed'); // Reused in multiple places below.
if ($groupChanged && !($user->can('manage_subgroups') && $user->isGroupValid($request->getParameter('group')))) {
header('Location: access_denied.php'); // Group changed, but no rght or wrong group id.
exit();
}
}

// Determine group for which we display this page.
if ($request->isPost() && $groupChanged) {
$group_id = $request->getParameter('group');
$user->setOnBehalfGroup($group_id);
} else {
$group_id = $user->getGroup();
}

$form = new Form('clientsForm');
if ($user->can('manage_subgroups')) {
$groups = $user->getGroupsForDropdown();
if (count($groups) > 1) {
$form->addInput(array('type'=>'combobox',
'onchange'=>'document.clientsForm.group_changed.value=1;document.clientsForm.submit();',
'name'=>'group',
'style'=>'width: 250px;',
'value'=>$group_id,
'data'=>$groups,
'datakeys'=>array('id','name')));
$form->addInput(array('type'=>'hidden','name'=>'group_changed'));
$smarty->assign('group_dropdown', 1);
}
}
// End of access checks.

if($user->can('manage_clients')) {
$active_clients = ttGroupHelper::getActiveClients(true);
$inactive_clients = ttGroupHelper::getInactiveClients(true);
} else
$active_clients = $user->getAssignedClients();

$smarty->assign('forms', array($form->getName()=>$form->toArray()));
$smarty->assign('active_clients', $active_clients);
$smarty->assign('inactive_clients', $inactive_clients);
$smarty->assign('title', $i18n->get('title.clients'));
Expand Down

0 comments on commit 21a8853

Please sign in to comment.