]> wagnertech.de Git - timetracker.git/commitdiff
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 7867ac8e855524ab18773f8b2c87e1772063d53a..5c21879bf3471e071742fc7de427fceb0849567a 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 ca4c7a04ab8f5c0d8ccadd600f3d90a19ab315dd..cd126f2c863198328607bc5cdd469ce560f2249a 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 e166b089f9c1c3a26e5076a27c752c4694d465d4..f5211eeef49b4f1161acc8e274238a46a300b0d6 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 e29de2eb6557dbcca28df09462d175891f5df340..273d761efc7a8cf5c8040a5487141fdf34cab947 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 4359f2197550e73d0690d933bca16be3249016eb..9b23c876ae5c94f9d7f6d36f64ba78ba3a7c4a2d 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));