return false;
}
+ // getActiveRoles - returns an array of active roles for team.
+ static function getActiveRoles($team_id)
+ {
+ $result = array();
+ $mdb2 = getConnection();
+
+ $sql = "select id, name, rights from tt_roles where team_id = $team_id and status = 1 order by upper(name)";
+ $res = $mdb2->query($sql);
+ $result = array();
+ if (!is_a($res, 'PEAR_Error')) {
+ while ($val = $res->fetchRow()) {
+ $result[] = $val;
+ }
+ }
+ return $result;
+ }
+
+ // getInactiveRoles - returns an array of inactive roles for team.
+ static function getInactiveRoles($team_id)
+ {
+ $result = array();
+ $mdb2 = getConnection();
+
+ $sql = "select id, name, rights from tt_roles
+ where team_id = $team_id and status = 0 order by upper(name)";
+ $res = $mdb2->query($sql);
+ $result = array();
+ if (!is_a($res, 'PEAR_Error')) {
+ while ($val = $res->fetchRow()) {
+ $result[] = $val;
+ }
+ }
+ return $result;
+ }
+
// The getActiveClients returns an array of active clients for team.
static function getActiveClients($team_id, $all_fields = false)
{
// TODO: translate the following.
// 'form.roles.active_roles' => 'Active Roles',
// 'form.roles.inactive_roles' => 'Inactive Roles',
+// 'form.roles.rights' => 'Rights',
// Clients form. See example at https://timetracker.anuko.com/clients.php
// TODO: translate the following.
// TODO: translate the following.
// 'form.roles.active_roles' => 'Active Roles',
// 'form.roles.inactive_roles' => 'Inactive Roles',
+// 'form.roles.rights' => 'Rights',
// Clients form. See example at https://timetracker.anuko.com/clients.php
// TODO: translate the following.
// TODO: translate the following.
// 'form.roles.active_roles' => 'Active Roles',
// 'form.roles.inactive_roles' => 'Inactive Roles',
+// 'form.roles.rights' => 'Rights',
// Clients form. See example at https://timetracker.anuko.com/clients.php
'form.clients.active_clients' => 'Aktive Klienter',
// TODO: translate the following.
// 'form.roles.active_roles' => 'Active Roles',
// 'form.roles.inactive_roles' => 'Inactive Roles',
+// 'form.roles.rights' => 'Rights',
// Clients form. See example at https://timetracker.anuko.com/clients.php
'form.clients.active_clients' => 'Aktive Kunden',
// Roles form. See example at https://timetracker.anuko.com/roles.php
'form.roles.active_roles' => 'Active Roles',
'form.roles.inactive_roles' => 'Inactive Roles',
+'form.roles.rights' => 'Rights',
// Clients form. See example at https://timetracker.anuko.com/clients.php
'form.clients.active_clients' => 'Active Clients',
// TODO: translate the following.
// 'form.roles.active_roles' => 'Active Roles',
// 'form.roles.inactive_roles' => 'Inactive Roles',
+// 'form.roles.rights' => 'Rights',
// Clients form. See example at https://timetracker.anuko.com/clients.php
// TODO: translate the following.
// TODO: translate the following.
// 'form.roles.active_roles' => 'Active Roles',
// 'form.roles.inactive_roles' => 'Inactive Roles',
+// 'form.roles.rights' => 'Rights',
// Clients form. See example at https://timetracker.anuko.com/clients.php
// TODO: translate the following.
// TODO: translate the following.
// 'form.roles.active_roles' => 'Active Roles',
// 'form.roles.inactive_roles' => 'Inactive Roles',
+// 'form.roles.rights' => 'Rights',
// Clients form. See example at https://timetracker.anuko.com/clients.php
'form.clients.active_clients' => 'مشتری های فعال',
// TODO: translate the following.
// 'form.roles.active_roles' => 'Active Roles',
// 'form.roles.inactive_roles' => 'Inactive Roles',
+// 'form.roles.rights' => 'Rights',
// Clients form. See example at https://timetracker.anuko.com/clients.php
'form.clients.active_clients' => 'Aktiiviset asiakkaat',
// TODO: translate the following.
// 'form.roles.active_roles' => 'Active Roles',
// 'form.roles.inactive_roles' => 'Inactive Roles',
+// 'form.roles.rights' => 'Rights',
// Clients form. See example at https://timetracker.anuko.com/clients.php
'form.clients.active_clients' => 'Clients actifs',
// TODO: translate the following.
// 'form.roles.active_roles' => 'Active Roles',
// 'form.roles.inactive_roles' => 'Inactive Roles',
+// 'form.roles.rights' => 'Rights',
// Clients form. See example at https://timetracker.anuko.com/clients.php
'form.clients.active_clients' => 'לקוחות פעילים',
// TODO: translate the following.
// 'form.roles.active_roles' => 'Active Roles',
// 'form.roles.inactive_roles' => 'Inactive Roles',
+// 'form.roles.rights' => 'Rights',
// Clients form. See example at https://timetracker.anuko.com/clients.php
// TODO: translate the following.
// TODO: translate the following.
// 'form.roles.active_roles' => 'Active Roles',
// 'form.roles.inactive_roles' => 'Inactive Roles',
+// 'form.roles.rights' => 'Rights',
// Clients form. See example at https://timetracker.anuko.com/clients.php
'form.clients.active_clients' => 'Clienti attivi',
// TODO: translate the following.
// 'form.roles.active_roles' => 'Active Roles',
// 'form.roles.inactive_roles' => 'Inactive Roles',
+// 'form.roles.rights' => 'Rights',
// Clients form. See example at https://timetracker.anuko.com/clients.php
// TODO: translate the following.
// TODO: translate the following.
// 'form.roles.active_roles' => 'Active Roles',
// 'form.roles.inactive_roles' => 'Inactive Roles',
+// 'form.roles.rights' => 'Rights',
// Clients form. See example at https://timetracker.anuko.com/clients.php
// TODO: translate the following.
// TODO: translate the following.
// 'form.roles.active_roles' => 'Active Roles',
// 'form.roles.inactive_roles' => 'Inactive Roles',
+// 'form.roles.rights' => 'Rights',
// Clients form. See example at https://timetracker.anuko.com/clients.php
'form.clients.active_clients' => 'Actieve klanten',
// TODO: translate the following.
// 'form.roles.active_roles' => 'Active Roles',
// 'form.roles.inactive_roles' => 'Inactive Roles',
+// 'form.roles.rights' => 'Rights',
// Clients form. See example at https://timetracker.anuko.com/clients.php
// TODO: translate the following.
// TODO: translate the following.
// 'form.roles.active_roles' => 'Active Roles',
// 'form.roles.inactive_roles' => 'Inactive Roles',
+// 'form.roles.rights' => 'Rights',
// Clients form. See example at https://timetracker.anuko.com/clients.phpp
'form.clients.active_clients' => 'Aktywni klienci',
// TODO: translate the following.
// 'form.roles.active_roles' => 'Active Roles',
// 'form.roles.inactive_roles' => 'Inactive Roles',
+// 'form.roles.rights' => 'Rights',
// Clients form. See example at https://timetracker.anuko.com/clients.php
'form.clients.active_clients' => 'Clientes ativos',
// TODO: translate the following.
// 'form.roles.active_roles' => 'Active Roles',
// 'form.roles.inactive_roles' => 'Inactive Roles',
+// 'form.roles.rights' => 'Rights',
// Clients form. See example at https://timetracker.anuko.com/clients.php
// TODO: translate the following.
// TODO: translate the following.
// 'form.roles.active_roles' => 'Active Roles',
// 'form.roles.inactive_roles' => 'Inactive Roles',
+// 'form.roles.rights' => 'Rights',
// Clients form. See example at https://timetracker.anuko.com/clients.php
// TODO: translate the following.
// Roles form. See example at https://timetracker.anuko.com/roles.php
'form.roles.active_roles' => 'Активные роли',
'form.roles.inactive_roles' => 'Неактивные роли',
+'form.roles.rights' => 'Права',
// Deleting Client form. See example at https://timetracker.anuko.com/client_delete.php
'form.client.client_to_delete' => 'Клиент для удаления',
// TODO: translate the following.
// 'form.roles.active_roles' => 'Active Roles',
// 'form.roles.inactive_roles' => 'Inactive Roles',
+// 'form.roles.rights' => 'Rights',
// Clients form. See example at https://timetracker.anuko.com/clients.php
'form.clients.active_clients' => 'Aktívny klienti',
// TODO: translate the following.
// 'form.roles.active_roles' => 'Active Roles',
// 'form.roles.inactive_roles' => 'Inactive Roles',
+// 'form.roles.rights' => 'Rights',
// Clients form. See example at https://timetracker.anuko.com/clients.php
// TODO: translate the following.
// TODO: translate the following.
// 'form.roles.active_roles' => 'Active Roles',
// 'form.roles.inactive_roles' => 'Inactive Roles',
+// 'form.roles.rights' => 'Rights',
// Forma klijenata. Pogledajte primer na https://timetracker.anuko.com/clients.php
'form.clients.active_clients' => 'Aktivni klijent',
// TODO: translate the following.
// 'form.roles.active_roles' => 'Active Roles',
// 'form.roles.inactive_roles' => 'Inactive Roles',
+// 'form.roles.rights' => 'Rights',
// Clients form. See example at https://timetracker.anuko.com/clients.php
'form.clients.active_clients' => 'Aktiva kunder',
// TODO: translate the following.
// 'form.roles.active_roles' => 'Active Roles',
// 'form.roles.inactive_roles' => 'Inactive Roles',
+// 'form.roles.rights' => 'Rights',
// Clients form. See example at https://timetracker.anuko.com/clients.php
// TODO: translate the following.
// TODO: translate the following.
// 'form.roles.active_roles' => 'Active Roles',
// 'form.roles.inactive_roles' => 'Inactive Roles',
+// 'form.roles.rights' => 'Rights',
// Clients form. See example at https://timetracker.anuko.com/clients.php
// TODO: translate the following.
// TODO: translate the following.
// 'form.roles.active_roles' => 'Active Roles',
// 'form.roles.inactive_roles' => 'Inactive Roles',
+// 'form.roles.rights' => 'Rights',
// Clients form. See example at https://timetracker.anuko.com/clients.php
// TODO: translate the following.
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.17.29.4013 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.17.29.4014 | Copyright © <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>
--- /dev/null
+<script>
+ function chLocation(newLocation) { document.location = newLocation; }
+</script>
+
+<table cellspacing="0" cellpadding="7" border="0" width="720">
+ <tr>
+ <td valign="top">
+ <table cellspacing="1" cellpadding="3" border="0" width="100%">
+ {if $inactive_roles}
+ <tr><td class="sectionHeaderNoBorder">{$i18n.form.roles.active_roles}</td></tr>
+ {/if}
+ <tr>
+ <td width="35%" class="tableHeader">{$i18n.label.thing_name}</td>
+ <td width="35%" class="tableHeader">{$i18n.form.roles.rights}</td>
+ <td class="tableHeader">{$i18n.label.edit}</td>
+ <td class="tableHeader">{$i18n.label.delete}</td>
+ </tr>
+ {if $active_roles}
+ {foreach $active_roles as $role}
+ <tr bgcolor="{cycle values="#f5f5f5,#ffffff"}">
+ <td>{$role.name|escape}</td>
+ <td>{$role.rights|escape}</td>
+ <td><a href="task_edit.php?id={$task.id}">{$i18n.label.edit}</a></td>
+ <td><a href="task_delete.php?id={$task.id}">{$i18n.label.delete}</a></td>
+ </tr>
+ {/foreach}
+ {/if}
+ </table>
+
+ <table width="100%">
+ <tr>
+ <td align="center"><br>
+ <form><input type="button" onclick="chLocation('role_add.php');" value="{$i18n.button.add_role}"></form>
+ </td>
+ </tr>
+ </table>
+
+ {if $inactive_roles}
+ <table cellspacing="1" cellpadding="3" border="0" width="100%">
+ <tr><td class="sectionHeaderNoBorder">{$i18n.form.roles.inactive_roles}</td></tr>
+ <tr>
+ <td width="35%" class="tableHeader">{$i18n.label.thing_name}</td>
+ <td width="35%" class="tableHeader">{$i18n.form.roles.rights}</td>
+ <td class="tableHeader">{$i18n.label.edit}</td>
+ <td class="tableHeader">{$i18n.label.delete}</td>
+ </tr>
+ {foreach $inactive_roles as $role}
+ <tr bgcolor="{cycle values="#f5f5f5,#ffffff"}">
+ <td>{$role.name|escape}</td>
+ <td>{$role.rights|escape}</td>
+ <td><a href="task_edit.php?id={$task.id}">{$i18n.label.edit}</a></td>
+ <td><a href="task_delete.php?id={$task.id}">{$i18n.label.delete}</a></td>
+ </tr>
+ {/foreach}
+ </table>
+
+ <table width="100%">
+ <tr>
+ <td align="center"><br>
+ <form><input type="button" onclick="chLocation('role_add.php');" value="{$i18n.button.add_role}"></form>
+ </td>
+ </tr>
+ </table>
+ {/if}
+ </td>
+ </tr>
+</table>
--- /dev/null
+<?php
+// +----------------------------------------------------------------------+
+// | Anuko Time Tracker
+// +----------------------------------------------------------------------+
+// | Copyright (c) Anuko International Ltd. (https://www.anuko.com)
+// +----------------------------------------------------------------------+
+// | LIBERAL FREEWARE LICENSE: This source code document may be used
+// | by anyone for any purpose, and freely redistributed alone or in
+// | combination with other software, provided that the license is obeyed.
+// |
+// | There are only two ways to violate the license:
+// |
+// | 1. To redistribute this code in source form, with the copyright
+// | notice or license removed or altered. (Distributing in compiled
+// | forms without embedded copyright notices is permitted).
+// |
+// | 2. To redistribute modified versions of this code in *any* form
+// | that bears insufficient indications that the modifications are
+// | not the work of the original author(s).
+// |
+// | This license applies to this document only, not any other software
+// | that it may be combined with.
+// |
+// +----------------------------------------------------------------------+
+// | Contributors:
+// | https://www.anuko.com/time_tracker/credits.htm
+// +----------------------------------------------------------------------+
+
+require_once('initialize.php');
+import('form.Form');
+import('ttTeamHelper');
+
+// Access check.
+if (!ttAccessCheck(right_manage_team)) {
+ header('Location: access_denied.php');
+ exit();
+}
+
+$smarty->assign('active_roles', ttTeamHelper::getActiveRoles($user->team_id));
+$smarty->assign('inactive_roles', ttTeamHelper::getInactiveRoles($user->team_id));
+$smarty->assign('title', $i18n->getKey('label.roles'));
+$smarty->assign('content_page_name', 'roles.tpl');
+$smarty->display('index.tpl');