From: Nik Okuntseff Date: Fri, 23 Nov 2018 13:10:34 +0000 (+0000) Subject: Added description field on group_edit.php. X-Git-Tag: timetracker_1.19-1~567 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=e19990636073ca1aa353a67033dc0cec311fdab9;p=timetracker.git Added description field on group_edit.php. --- diff --git a/WEB-INF/lib/ttUser.class.php b/WEB-INF/lib/ttUser.class.php index 79f7ae77..ab5bdbff 100644 --- a/WEB-INF/lib/ttUser.class.php +++ b/WEB-INF/lib/ttUser.class.php @@ -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, ','); diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index ab601cac..814be798 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
- + + + + diff --git a/group_edit.php b/group_edit.php index a98243cb..77ddc618 100644 --- a/group_edit.php +++ b/group_edit.php @@ -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,
 Anuko Time Tracker 1.18.27.4497 | Copyright © Anuko | +  Anuko Time Tracker 1.18.27.4498 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/WEB-INF/templates/group_edit.tpl b/WEB-INF/templates/group_edit.tpl index ea46bec6..d1594489 100644 --- a/WEB-INF/templates/group_edit.tpl +++ b/WEB-INF/templates/group_edit.tpl @@ -31,6 +31,10 @@ function handleTaskRequiredCheckbox() { {$i18n.label.group_name}: {$forms.groupForm.group_name.control}
{$i18n.label.description}:{$forms.groupForm.description.control}
{$i18n.label.currency}: {$forms.groupForm.currency.control}