Added description field on group_edit.php.
authorNik Okuntseff <support@anuko.com>
Fri, 23 Nov 2018 13:10:34 +0000 (13:10 +0000)
committerNik Okuntseff <support@anuko.com>
Fri, 23 Nov 2018 13:10:34 +0000 (13:10 +0000)
WEB-INF/lib/ttUser.class.php
WEB-INF/templates/footer.tpl
WEB-INF/templates/group_edit.tpl
group_edit.php

index 79f7ae7..ab5bdbf 100644 (file)
@@ -518,6 +518,7 @@ class ttUser {
     if (!$group_id) $group_id = $this->getActiveGroup();
 
     if (isset($fields['name'])) $name_part = ', name = '.$mdb2->quote($fields['name']);
+    if (isset($fields['description'])) $description_part = ', description = '.$mdb2->quote($fields['description']);
     if (isset($fields['currency'])) $currency_part = ', currency = '.$mdb2->quote($fields['currency']);
     if (isset($fields['lang'])) $lang_part = ', lang = '.$mdb2->quote($fields['lang']);
     if (isset($fields['decimal_mark'])) $decimal_mark_part = ', decimal_mark = '.$mdb2->quote($fields['decimal_mark']);
@@ -538,7 +539,7 @@ class ttUser {
     if (isset($fields['workday_minutes'])) $workday_minutes_part = ', workday_minutes = '.$mdb2->quote($fields['workday_minutes']);
     $modified_part = ', modified = now(), modified_ip = '.$mdb2->quote($_SERVER['REMOTE_ADDR']).', modified_by = '.$mdb2->quote($this->id);
 
-    $parts = trim($name_part.$currency_part.$lang_part.$decimal_mark_part.$date_format_part.
+    $parts = trim($name_part.$description_part.$currency_part.$lang_part.$decimal_mark_part.$date_format_part.
       $time_format_part.$week_start_part.$tracking_mode_part.$task_required_part.$project_required_part.$record_type_part.
       $bcc_email_part.$allow_ip_part.$plugins_part.$config_part.$lock_spec_part.$workday_minutes_part.$modified_part, ',');
 
index ab601ca..814be79 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.27.4497 | 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.27.4498 | 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 ea46bec..d159448 100644 (file)
@@ -31,6 +31,10 @@ function handleTaskRequiredCheckbox() {
             <td align="right" nowrap>{$i18n.label.group_name}:</td>
             <td>{$forms.groupForm.group_name.control}</td>
           </tr>
+          <tr>
+            <td align = "right">{$i18n.label.description}:</td>
+            <td>{$forms.groupForm.description.control}</td>
+          </tr>
           <tr>
             <td align="right">{$i18n.label.currency}:</td>
             <td>{$forms.groupForm.currency.control}</td>
index a98243c..77ddc61 100644 (file)
@@ -53,6 +53,7 @@ if (!defined('CURRENCY_DEFAULT')) define('CURRENCY_DEFAULT', '$');
 
 if ($request->isPost()) {
   $cl_group = trim($request->getParameter('group_name'));
+  $cl_description = trim($request->getParameter('description'));
   $cl_currency = trim($request->getParameter('currency'));
   if (!$cl_currency) $cl_currency = CURRENCY_DEFAULT;
   $cl_lang = $request->getParameter('lang');
@@ -73,6 +74,7 @@ if ($request->isPost()) {
   $cl_allow_ip = trim($request->getParameter('allow_ip'));
 } else {
   $cl_group = $group['name'];
+  $cl_description = $group['description'];
   $cl_currency = ($group['currency'] == ''? CURRENCY_DEFAULT : $group['currency']);
   $cl_lang = $group['lang'];
   $cl_decimal_mark = $group['decimal_mark'];
@@ -95,6 +97,7 @@ if ($request->isPost()) {
 $form = new Form('groupForm');
 $form->addInput(array('type'=>'hidden','name'=>'id','value'=>$group_id));
 $form->addInput(array('type'=>'text','maxlength'=>'200','name'=>'group_name','value'=>$cl_group,'enable'=>$advanced_settings));
+$form->addInput(array('type'=>'textarea','name'=>'description','style'=>'width: 250px; height: 40px;','value'=>$cl_description));
 $form->addInput(array('type'=>'text','maxlength'=>'7','name'=>'currency','value'=>$cl_currency));
 
 // Prepare an array of available languages.
@@ -189,6 +192,7 @@ if ($request->isPost()) {
 
   // Validate user input.
   if (!ttValidString($cl_group, true)) $err->add($i18n->get('error.field'), $i18n->get('label.group_name'));
+  if (!ttValidString($cl_description, true)) $err->add($i18n->get('error.field'), $i18n->get('label.description'));
   if (!ttValidString($cl_currency, true)) $err->add($i18n->get('error.field'), $i18n->get('label.currency'));
   if ($advanced_settings) {
     if (!ttValidEmail($cl_bcc_email, true)) $err->add($i18n->get('error.field'), $i18n->get('label.bcc'));
@@ -207,6 +211,7 @@ if ($request->isPost()) {
     if ($user->updateGroup(array(
       'group_id' => $group_id,
       'name' => $cl_group,
+      'description' => $cl_description,
       'currency' => $cl_currency,
       'lang' => $cl_lang,
       'decimal_mark' => $cl_decimal_mark,