X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=group_edit.php;h=abc06b469099cfe02181751d9035f7b26b217510;hb=f22a586b11af9c617fdc4241d3ffa0344d4d6a50;hp=b16a15f09354dabc9ece37106a849ee9317acb8a;hpb=4153fc2584a62ab3949b182e42fb61c804925a08;p=timetracker.git diff --git a/group_edit.php b/group_edit.php index b16a15f0..abc06b46 100644 --- a/group_edit.php +++ b/group_edit.php @@ -70,7 +70,7 @@ if ($request->isPost() && $groupChanged) { $groups = $user->getGroupsForDropdown(); $group = ttGroupHelper::getGroupAttrs($group_id); -$config = new ttConfigHelper($group['config']); +$config = $user->getConfigHelper(); $advanced_settings = $home_group ? $user->can('manage_advanced_settings') : true; if (!defined('CURRENCY_DEFAULT')) define('CURRENCY_DEFAULT', '$'); @@ -85,7 +85,7 @@ if ($request->isPost() && !$groupChanged) { $cl_date_format = $request->getParameter('date_format'); $cl_time_format = $request->getParameter('time_format'); $cl_start_week = $request->getParameter('start_week'); - $cl_show_holidays = $request->getParameter('show_holidays'); + $cl_holidays = trim($request->getParameter('holidays')); $cl_tracking_mode = $request->getParameter('tracking_mode'); $cl_project_required = $request->getParameter('project_required'); $cl_task_required = $request->getParameter('task_required'); @@ -106,7 +106,7 @@ if ($request->isPost() && !$groupChanged) { $cl_date_format = $group['date_format']; $cl_time_format = $group['time_format']; $cl_start_week = $group['week_start']; - $cl_show_holidays = $config->getDefinedValue('show_holidays'); + $cl_holidays = $group['holidays']; $cl_tracking_mode = $group['tracking_mode']; $cl_project_required = $group['project_required']; $cl_task_required = $group['task_required']; @@ -179,8 +179,8 @@ foreach ($i18n->weekdayNames as $id => $week_dn) { } $form->addInput(array('type'=>'combobox','name'=>'start_week','style'=>'width: 150px;','data'=>$week_start_options,'datakeys'=>array('id','name'),'value'=>$cl_start_week)); -// Show holidays checkbox. -$form->addInput(array('type'=>'checkbox','name'=>'show_holidays','value'=>$cl_show_holidays)); +// Show holidays control. +$form->addInput(array('type'=>'text','name'=>'holidays','value'=>$cl_holidays)); // Prepare tracking mode choices. $tracking_mode_options = array(); @@ -237,6 +237,7 @@ if ($request->isPost()) { if (!ttValidString($cl_group)) $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 (!ttValidHolidays($cl_holidays)) $err->add($i18n->get('error.field'), $i18n->get('form.group_edit.holidays')); if ($advanced_settings) { if (!ttValidEmail($cl_bcc_email, true)) $err->add($i18n->get('error.field'), $i18n->get('label.bcc')); if (!ttValidIP($cl_allow_ip, true)) $err->add($i18n->get('error.field'), $i18n->get('form.group_edit.allow_ip')); @@ -245,7 +246,6 @@ if ($request->isPost()) { if ($err->no()) { // Update config. - $config->setDefinedValue('show_holidays', $cl_show_holidays); $config->setDefinedValue('punch_mode', $cl_punch_mode); $config->setDefinedValue('allow_overlap', $cl_allow_overlap); $config->setDefinedValue('future_entries', $cl_future_entries); @@ -262,6 +262,7 @@ if ($request->isPost()) { 'date_format' => $cl_date_format, 'time_format' => $cl_time_format, 'week_start' => $cl_start_week, + 'holidays' => $cl_holidays, 'tracking_mode' => $cl_tracking_mode, 'project_required' => $cl_project_required, 'task_required' => $cl_task_required,