X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=time.php;h=193f7a2be66289336750fdb9939fcfe618a35bfc;hb=05e0f5266a2959a452adfcae9d53c9729d3a3668;hp=c79315d78d89ab4c7a09a407abda346585ce0c1a;hpb=9e82b53fc5d8cb1e54b5fde774fa68a916f28b4c;p=timetracker.git diff --git a/time.php b/time.php index c79315d7..193f7a2b 100644 --- a/time.php +++ b/time.php @@ -57,7 +57,7 @@ if(!$cl_date) $_SESSION['date'] = $cl_date; // Use custom fields plugin if it is enabled. -if (in_array('cf', explode(',', $user->plugins))) { +if ($user->isPluginEnabled('cf')) { require_once('plugins/CustomFields.class.php'); $custom_fields = new CustomFields($user->team_id); $smarty->assign('custom_fields', $custom_fields); @@ -195,7 +195,7 @@ if ($custom_fields && $custom_fields->fields[0]) { // Only one custom field is supported at this time. if ($custom_fields->fields[0]['type'] == CustomFields::TYPE_TEXT) { $form->addInput(array('type'=>'text','name'=>'cf_1','value'=>$cl_cf_1)); - } else if ($custom_fields->fields[0]['type'] == CustomFields::TYPE_DROPDOWN) { + } elseif ($custom_fields->fields[0]['type'] == CustomFields::TYPE_DROPDOWN) { $form->addInput(array('type'=>'combobox','name'=>'cf_1', 'style'=>'width: 250px;', 'value'=>$cl_cf_1, @@ -231,7 +231,7 @@ if ($request->isPost()) { if (!$cl_duration) { if ('0' == $cl_duration) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.duration')); - else if ($cl_start || $cl_finish) { + elseif ($cl_start || $cl_finish) { if (!ttTimeHelper::isValidTime($cl_start)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.start')); if ($cl_finish) { @@ -297,7 +297,7 @@ if ($request->isPost()) { if ($id && $custom_fields && $cl_cf_1) { if ($custom_fields->fields[0]['type'] == CustomFields::TYPE_TEXT) $result = $custom_fields->insert($id, $custom_fields->fields[0]['id'], null, $cl_cf_1); - else if ($custom_fields->fields[0]['type'] == CustomFields::TYPE_DROPDOWN) + elseif ($custom_fields->fields[0]['type'] == CustomFields::TYPE_DROPDOWN) $result = $custom_fields->insert($id, $custom_fields->fields[0]['id'], $cl_cf_1, null); } if ($id && $result) { @@ -306,8 +306,7 @@ if ($request->isPost()) { } $err->add($i18n->getKey('error.db')); } - } - else if ($request->getParameter('btn_stop')) { + } elseif ($request->getParameter('btn_stop')) { // Stop button pressed to finish an uncompleted record. $record_id = $request->getParameter('record_id'); $record = ttTimeHelper::getRecord($record_id, $user->getActiveUser()); @@ -337,7 +336,7 @@ if ($request->isPost()) { exit(); } } - else if ($request->getParameter('onBehalfUser')) { + elseif ($request->getParameter('onBehalfUser')) { if($user->canManageTeam()) { unset($_SESSION['behalf_id']); unset($_SESSION['behalf_name']); @@ -350,7 +349,7 @@ if ($request->isPost()) { exit(); } } -} // POST +} // isPost $week_total = ttTimeHelper::getTimeForWeek($user->getActiveUser(), $selected_date);