Started to work on group editor for subgroups.
authorNik Okuntseff <support@anuko.com>
Tue, 20 Nov 2018 21:56:40 +0000 (21:56 +0000)
committerNik Okuntseff <support@anuko.com>
Tue, 20 Nov 2018 21:56:40 +0000 (21:56 +0000)
WEB-INF/templates/footer.tpl
WEB-INF/templates/groups.tpl [new file with mode: 0644]
groups.php [new file with mode: 0644]

index 98ee48d..9a9be2d 100644 (file)
@@ -12,7 +12,7 @@
       <br>
       <table cellspacing="0" cellpadding="4" width="100%" border="0">
         <tr>
-          <td align="center">&nbsp;Anuko Time Tracker 1.18.25.4476 | 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.25.4477 | 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>
diff --git a/WEB-INF/templates/groups.tpl b/WEB-INF/templates/groups.tpl
new file mode 100644 (file)
index 0000000..d9748bc
--- /dev/null
@@ -0,0 +1,31 @@
+<script>
+  function chLocation(newLocation) { document.location = newLocation; }
+</script>
+
+<table cellspacing="1" cellpadding="3" border="0" width="720">
+  <tr>
+    <td width="70%" class="tableHeader">{$i18n.label.thing_name}</td>
+    <td class="tableHeader">{$i18n.label.edit}</td>
+    <td class="tableHeader">{$i18n.label.delete}</td>
+  </tr>
+{if $groups}
+  {foreach $groups as $group}
+  <tr bgcolor="{cycle values="#f5f5f5,#ffffff"}">
+    <td>{$group.name|escape}</td>
+    <td><a href="group_edit.php?id={$group.id}">{$i18n.label.edit}</a></td>
+    <td><a href="group_delete.php?id={$group.id}">{$i18n.label.delete}</a></td>
+  </tr>
+  {/foreach}
+{/if}
+</table>
+
+<table width="100%">
+  <tr>
+    <td align="center">
+      <br>
+      <form>
+        <input type="button" onclick="chLocation('group_add.php');" value="{$i18n.button.add}">
+      </form>
+    </td>
+  </tr>
+</table>
diff --git a/groups.php b/groups.php
new file mode 100644 (file)
index 0000000..5a612c1
--- /dev/null
@@ -0,0 +1,45 @@
+<?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('ttUserHelper');
+import('ttRoleHelper');
+import('ttConfigHelper');
+
+// Access checks.
+if (!ttAccessAllowed('manage_subgroups')) {
+  header('Location: access_denied.php');
+  exit();
+}
+// End of access checks.
+
+$smarty->assign('groups', $user->getGroups());
+$smarty->assign('title', $i18n->get('title.groups'));
+$smarty->assign('content_page_name', 'groups.tpl');
+$smarty->display('index.tpl');