Work in progress on project_required option (incomplete). Also started to integrate...
authoranuko <support@anuko.com>
Sun, 9 Jul 2017 22:36:17 +0000 (22:36 +0000)
committeranuko <support@anuko.com>
Sun, 9 Jul 2017 22:36:17 +0000 (22:36 +0000)
WEB-INF/lib/ttClientHelper.class.php
WEB-INF/lib/ttUser.class.php
WEB-INF/templates/footer.tpl
profile_edit.php
reports.php

index 3b7a9cd..c77dae0 100644 (file)
@@ -60,7 +60,7 @@ class ttClientHelper {
     $mdb2 = getConnection();
 
     $sql = "select id, name from tt_clients
-      where team_id = $user->team_id and (status = 0 or status = 1) order by name";
+      where team_id = $user->team_id and (status = 0 or status = 1) order by upper(name)";
     $res = $mdb2->query($sql);
     if (!is_a($res, 'PEAR_Error')) {
       while ($val = $res->fetchRow()) {
index 3f160ff..50f27eb 100644 (file)
@@ -42,6 +42,7 @@ class ttUser {
   var $time_format = null;      // Time format.
   var $week_start = 0;          // Week start day.
   var $tracking_mode = 0;       // Tracking mode.
+  var $project_required = 0;    // Whether project selection is required on time entires.
   var $task_required = 0;       // Whether task selection is required on time entires.
   var $record_type = 0;         // Record type (duration vs start and finish, or both).
   var $uncompleted_indicators = 0; // Uncompleted time entry indicators (show nowhere or on users page).
@@ -65,7 +66,8 @@ class ttUser {
 
     $sql = "SELECT u.id, u.login, u.name, u.team_id, u.role, u.client_id, u.email, t.name as team_name, 
       t.address, t.currency, t.lang, t.decimal_mark, t.date_format, t.time_format, t.week_start,
-      t.tracking_mode, t.task_required, t.record_type, t.uncompleted_indicators, t.plugins, t.lock_spec, t.workday_hours, t.custom_logo
+      t.tracking_mode, t.project_required, t.task_required, t.record_type, t.uncompleted_indicators,
+      t.plugins, t.lock_spec, t.workday_hours, t.custom_logo
       FROM tt_users u LEFT JOIN tt_teams t ON (u.team_id = t.id) WHERE ";
     if ($id)
       $sql .= "u.id = $id";
@@ -93,6 +95,7 @@ class ttUser {
       $this->time_format = $val['time_format'];
       $this->week_start = $val['week_start'];
       $this->tracking_mode = $val['tracking_mode'];
+      $this->project_required = $val['project_required'];
       $this->task_required = $val['task_required'];
       $this->record_type = $val['record_type'];
       $this->uncompleted_indicators = $val['uncompleted_indicators'];
index aaf7f18..24c305e 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.11.44.3638 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+          <td align="center">&nbsp;Anuko Time Tracker 1.11.44.3639 | 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 7c3146a..11ca295 100644 (file)
@@ -59,6 +59,7 @@ if ($request->isPost()) {
     $cl_custom_format_time = $request->getParameter('format_time');
     $cl_start_week = $request->getParameter('start_week');
     $cl_tracking_mode = $request->getParameter('tracking_mode');
+    $cl_project_required = $request->getParameter('project_required');
     $cl_task_required = $request->getParameter('task_required');
     $cl_record_type = $request->getParameter('record_type');
     $cl_uncompleted_indicators = $request->getParameter('uncompleted_indicators');
@@ -87,6 +88,7 @@ if ($request->isPost()) {
     $cl_custom_format_time = $user->time_format;
     $cl_start_week = $user->week_start;
     $cl_tracking_mode = $user->tracking_mode;
+    $cl_project_required = $user->project_required;
     $cl_task_required = $user->task_required;
     $cl_record_type = $user->record_type;
     $cl_uncompleted_indicators = $user->uncompleted_indicators;
@@ -164,6 +166,7 @@ if ($user->canManageTeam()) {
   $tracking_mode_options[MODE_PROJECTS] = $i18n->getKey('form.profile.mode_projects');
   $tracking_mode_options[MODE_PROJECTS_AND_TASKS] = $i18n->getKey('form.profile.mode_projects_and_tasks');
   $form->addInput(array('type'=>'combobox','name'=>'tracking_mode','style'=>'width: 150px;','data'=>$tracking_mode_options,'value'=>$cl_tracking_mode,'onchange'=>'handleTaskRequiredCheckbox()'));
+  $form->addInput(array('type'=>'checkbox','name'=>'project_required','value'=>$cl_project_required));
   $form->addInput(array('type'=>'checkbox','name'=>'task_required','value'=>$cl_task_required));
 
   // Prepare record type choices.
@@ -254,6 +257,7 @@ if ($request->isPost()) {
         'time_format' => $cl_custom_format_time,
         'week_start' => $cl_start_week,
         'tracking_mode' => $cl_tracking_mode,
+        'project_required' => $cl_project_required,
         'task_required' => $cl_task_required,
         'record_type' => $cl_record_type,
         'uncompleted_indicators' => $cl_uncompleted_indicators,
index 2e9bc26..08ac64f 100644 (file)
@@ -68,7 +68,7 @@ $form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->getK
 // Dropdown for clients if the clients plugin is enabled.
 if ($user->isPluginEnabled('cl') && !($user->isClient() && $user->client_id)) {
   if ($user->canManageTeam() || ($user->isClient() && !$user->client_id))
-    $client_list = ttClientHelper::getClients($user->team_id);
+    $client_list = ttClientHelper::getClients();
   else
     $client_list = ttClientHelper::getClientsForUser();
   $form->addInput(array('type'=>'combobox',