Some more refactoring for subgroups.
authorNik Okuntseff <support@anuko.com>
Sat, 1 Dec 2018 23:19:41 +0000 (23:19 +0000)
committerNik Okuntseff <support@anuko.com>
Sat, 1 Dec 2018 23:19:41 +0000 (23:19 +0000)
WEB-INF/templates/footer.tpl
client_add.php
client_edit.php
invoice_add.php
mobile/client_add.php
mobile/client_edit.php
mobile/task_add.php

index 00eaa06..5c66c15 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.29.4564 | 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.4565 | 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>
index 6f678ce..b14e8b4 100644 (file)
@@ -29,7 +29,7 @@
 require_once('initialize.php');
 import('form.Form');
 import('ttClientHelper');
-import('ttTeamHelper');
+import('ttGroupHelper');
 
 // Access checks.
 if (!ttAccessAllowed('manage_clients')) {
@@ -41,7 +41,7 @@ if (!$user->isPluginEnabled('cl')) {
   exit();
 }
 
-$projects = ttTeamHelper::getActiveProjects($user->getGroup());
+$projects = ttGroupHelper::getActiveProjects();
 
 if ($request->isPost()) {
   $cl_name = trim($request->getParameter('name'));
index 0d57c9d..0dc3bb6 100644 (file)
@@ -30,6 +30,7 @@ require_once('initialize.php');
 import('form.Form');
 import('ttClientHelper');
 import('ttTeamHelper');
+import('ttGroupHelper');
 
 // Access checks.
 if (!ttAccessAllowed('manage_clients')) {
@@ -43,7 +44,7 @@ if (!$user->isPluginEnabled('cl')) {
 
 $cl_id = (int) $request->getParameter('id');
 
-$projects = ttTeamHelper::getActiveProjects($user->getGroup());
+$projects = ttGroupHelper::getActiveProjects();
 
 if ($request->isPost()) {
   $cl_name = trim($request->getParameter('name'));
index 0cda1a3..e29de2e 100644 (file)
@@ -61,8 +61,8 @@ if ($user->isPluginEnabled('cl')) {
   $form->addInput(array('type'=>'combobox','name'=>'client','style'=>'width: 250px;','data'=>$clients,'datakeys'=>array('id','name'),'value'=>$cl_client,'empty'=>array(''=>$i18n->get('dropdown.select'))));
 }
 // Dropdown for projects.
-if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->tracking_mode) {
-  $projects = ttTeamHelper::getActiveProjects($user->group_id);
+if (MODE_PROJECTS == $user->getTrackingMode() || MODE_PROJECTS_AND_TASKS == $user->getTrackingMode()) {
+  $projects = ttGroupHelper::getActiveProjects();
   $form->addInput(array('type'=>'combobox','name'=>'project','style'=>'width: 250px;','data'=>$projects,'datakeys'=>array('id','name'),'value'=>$cl_project,'empty'=>array(''=>$i18n->get('dropdown.all'))));
 }
 $form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'number','style'=>'width: 250px;','value'=>$cl_number));
index 222012d..f5cc5b6 100644 (file)
@@ -29,7 +29,7 @@
 require_once('../initialize.php');
 import('form.Form');
 import('ttClientHelper');
-import('ttTeamHelper');
+import('ttGroupHelper');
 
 // Access checks.
 if (!ttAccessAllowed('manage_clients')) {
@@ -41,7 +41,7 @@ if (!$user->isPluginEnabled('cl')) {
   exit();
 }
 
-$projects = ttTeamHelper::getActiveProjects($user->group_id);
+$projects = ttGroupHelper::getActiveProjects();
 
 if ($request->isPost()) {
   $cl_name = trim($request->getParameter('name'));
@@ -58,7 +58,7 @@ $form = new Form('clientForm');
 $form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'name','value'=>$cl_name));
 $form->addInput(array('type'=>'textarea','name'=>'address','maxlength'=>'255','class'=>'mobile-textarea','value'=>$cl_address));
 $form->addInput(array('type'=>'floatfield','name'=>'tax','size'=>'10','format'=>'.2','value'=>$cl_tax));
-if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->tracking_mode)
+if (MODE_PROJECTS == $user->getTrackingMode() || MODE_PROJECTS_AND_TASKS == $user->getTrackingMode())
   $form->addInput(array('type'=>'checkboxgroup','name'=>'projects','data'=>$projects,'layout'=>'H','datakeys'=>array('id','name'),'value'=>$cl_projects));
 $form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->get('button.add')));
 
index 917b656..4044637 100644 (file)
@@ -29,7 +29,7 @@
 require_once('../initialize.php');
 import('form.Form');
 import('ttClientHelper');
-import('ttTeamHelper');
+import('ttGroupHelper');
 
 // Access checks.
 if (!ttAccessAllowed('manage_clients')) {
@@ -43,7 +43,7 @@ if (!$user->isPluginEnabled('cl')) {
 
 $cl_id = (int) $request->getParameter('id');
 
-$projects = ttTeamHelper::getActiveProjects($user->group_id);
+$projects = ttGroupHelper::getActiveProjects();
 
 if ($request->isPost()) {
   $cl_name = trim($request->getParameter('name'));
@@ -70,7 +70,7 @@ $form->addInput(array('type'=>'textarea','name'=>'address','maxlength'=>'255','c
 $form->addInput(array('type'=>'floatfield','name'=>'tax','size'=>'10','format'=>'.2','value'=>$cl_tax));
 $form->addInput(array('type'=>'combobox','name'=>'status','value'=>$cl_status,
   'data'=>array(ACTIVE=>$i18n->get('dropdown.status_active'),INACTIVE=>$i18n->get('dropdown.status_inactive'))));
-if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->tracking_mode)
+if (MODE_PROJECTS == $user->getTrackingMode() || MODE_PROJECTS_AND_TASKS == $user->getTrackingMode())
   $form->addInput(array('type'=>'checkboxgroup','name'=>'projects','data'=>$projects,'datakeys'=>array('id','name'),'layout'=>'H','value'=>$cl_projects));
 $form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->get('button.save')));
 $form->addInput(array('type'=>'submit','name'=>'btn_copy','value'=>$i18n->get('button.copy')));
index 9deed92..db73d1c 100644 (file)
@@ -28,8 +28,7 @@
 
 require_once('../initialize.php');
 import('form.Form');
-import('form.ActionForm');
-import('ttTeamHelper');
+import('ttGroupHelper');
 import('ttTaskHelper');
 
 // Access checks.
@@ -37,13 +36,13 @@ if (!ttAccessAllowed('manage_tasks')) {
   header('Location: access_denied.php');
   exit();
 }
-if (MODE_PROJECTS_AND_TASKS != $user->tracking_mode) {
+if (MODE_PROJECTS_AND_TASKS != $user->getTrackingMode()) {
   header('Location: feature_disabled.php');
   exit();
 }
 // End of access checks.
 
-$projects = ttTeamHelper::getActiveProjects($user->group_id);
+$projects = ttGroupHelper::getActiveProjects();
 
 if ($request->isPost()) {
   $cl_name = trim($request->getParameter('name'));