Updated Locking config to support subgroups.
authorNik Okuntseff <support@anuko.com>
Fri, 7 Dec 2018 17:12:53 +0000 (17:12 +0000)
committerNik Okuntseff <support@anuko.com>
Fri, 7 Dec 2018 17:12:53 +0000 (17:12 +0000)
WEB-INF/lib/ttUser.class.php
WEB-INF/templates/footer.tpl
WEB-INF/templates/invoice_add.tpl
invoice_add.php
locking.php

index 7867ac8..5c21879 100644 (file)
@@ -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']);
index ca4c7a0..cd126f2 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.4607 | 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.4608 | 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 e166b08..f5211ee 100644 (file)
@@ -15,7 +15,7 @@
           <td align="right">{$i18n.label.client} (*):</td>
           <td>{$forms.invoiceForm.client.control}</td>
         </tr>
-{if ($smarty.const.MODE_PROJECTS == $user->tracking_mode || $smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)}
+{if $show_project}
         <tr>
           <td align="right">{$i18n.label.project}:</td>
           <td>{$forms.invoiceForm.project.control}</td>
index e29de2e..273d761 100644 (file)
@@ -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');
index 4359f21..9b23c87 100644 (file)
@@ -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));