From: Nik Okuntseff Date: Sat, 1 Dec 2018 23:19:41 +0000 (+0000) Subject: Some more refactoring for subgroups. X-Git-Tag: timetracker_1.19-1~501 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=11868a92089a10db070993b89e595f45fac3f6ff;p=timetracker.git Some more refactoring for subgroups. --- diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 00eaa060..5c66c159 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.18.29.4564 | Copyright © Anuko | +  Anuko Time Tracker 1.18.29.4565 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/client_add.php b/client_add.php index 6f678cea..b14e8b45 100644 --- a/client_add.php +++ b/client_add.php @@ -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')); diff --git a/client_edit.php b/client_edit.php index 0d57c9d2..0dc3bb65 100644 --- a/client_edit.php +++ b/client_edit.php @@ -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')); diff --git a/invoice_add.php b/invoice_add.php index 0cda1a38..e29de2eb 100644 --- a/invoice_add.php +++ b/invoice_add.php @@ -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)); diff --git a/mobile/client_add.php b/mobile/client_add.php index 222012d4..f5cc5b69 100644 --- a/mobile/client_add.php +++ b/mobile/client_add.php @@ -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'))); diff --git a/mobile/client_edit.php b/mobile/client_edit.php index 917b656a..4044637b 100644 --- a/mobile/client_edit.php +++ b/mobile/client_edit.php @@ -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'))); diff --git a/mobile/task_add.php b/mobile/task_add.php index 9deed925..db73d1c7 100644 --- a/mobile/task_add.php +++ b/mobile/task_add.php @@ -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'));