From: Nik Okuntseff Date: Fri, 7 Dec 2018 17:12:53 +0000 (+0000) Subject: Updated Locking config to support subgroups. X-Git-Tag: timetracker_1.19-1~457 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=aa0c3ca69e801da029d6ec90937dd8017186c91f;p=timetracker.git Updated Locking config to support subgroups. --- diff --git a/WEB-INF/lib/ttUser.class.php b/WEB-INF/lib/ttUser.class.php index 7867ac8e..5c21879b 100644 --- a/WEB-INF/lib/ttUser.class.php +++ b/WEB-INF/lib/ttUser.class.php @@ -594,15 +594,10 @@ class ttUser { // updateGroup updates group information with new data. function updateGroup($fields) { - if (!($this->can('manage_basic_settings') || - $this->can('manage_advanced_settings') || - $this->can('manage_features'))) return false; - // TODO: update the above for subgroup updates. + $mdb2 = getConnection(); $group_id = $fields['group_id']; if ($group_id && !$this->isGroupValid($group_id)) return false; - - $mdb2 = getConnection(); if (!$group_id) $group_id = $this->getGroup(); if (isset($fields['name'])) $name_part = ', name = '.$mdb2->quote($fields['name']); diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index ca4c7a04..cd126f2c 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
- -{if ($smarty.const.MODE_PROJECTS == $user->tracking_mode || $smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)} +{if $show_project} diff --git a/invoice_add.php b/invoice_add.php index e29de2eb..273d761e 100644 --- a/invoice_add.php +++ b/invoice_add.php @@ -61,7 +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->getTrackingMode() || MODE_PROJECTS_AND_TASKS == $user->getTrackingMode()) { +$show_project = MODE_PROJECTS == $user->getTrackingMode() || MODE_PROJECTS_AND_TASKS == $user->getTrackingMode(); +if ($show_project) { $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')))); } @@ -100,6 +101,7 @@ if ($request->isPost()) { $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('onload', 'onLoad="document.invoiceForm.number.focus()"'); +$smarty->assign('show_project', $show_project); $smarty->assign('title', $i18n->get('title.add_invoice')); $smarty->assign('content_page_name', 'invoice_add.tpl'); $smarty->display('index.tpl'); diff --git a/locking.php b/locking.php index 4359f219..9b23c876 100644 --- a/locking.php +++ b/locking.php @@ -39,7 +39,7 @@ if (!$user->isPluginEnabled('lk')) { exit(); } -$cl_lock_spec = $request->isPost() ? $request->getParameter('lock_spec') : $user->lock_spec; +$cl_lock_spec = $request->isPost() ? $request->getParameter('lock_spec') : $user->getLockSpec(); $form = new Form('lockingForm'); $form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'lock_spec','style'=>'width: 250px;','value'=>$cl_lock_spec));
 Anuko Time Tracker 1.18.29.4607 | Copyright © Anuko | +  Anuko Time Tracker 1.18.29.4608 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/WEB-INF/templates/invoice_add.tpl b/WEB-INF/templates/invoice_add.tpl index e166b089..f5211eee 100644 --- a/WEB-INF/templates/invoice_add.tpl +++ b/WEB-INF/templates/invoice_add.tpl @@ -15,7 +15,7 @@ {$i18n.label.client} (*): {$forms.invoiceForm.client.control}
{$i18n.label.project}: {$forms.invoiceForm.project.control}