From 7b271fc399126b3dc32aadb30cb839241668cead Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Tue, 4 Dec 2018 21:49:24 +0000 Subject: [PATCH] More refactoring for subgroups. --- WEB-INF/lib/form/DateField.class.php | 4 ++-- WEB-INF/templates/footer.tpl | 2 +- expense_edit.php | 9 ++++----- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/WEB-INF/lib/form/DateField.class.php b/WEB-INF/lib/form/DateField.class.php index 9016dff0..f1487d04 100644 --- a/WEB-INF/lib/form/DateField.class.php +++ b/WEB-INF/lib/form/DateField.class.php @@ -48,7 +48,7 @@ class DateField extends TextField { global $user; global $i18n; - $this->mDateObj->setFormat($user->date_format); + $this->mDateObj->setFormat($user->getDateFormat()); $this->mMonthNames = $i18n->monthNames; $this->mWeekDayShortNames = $i18n->weekdayShortNames; @@ -56,7 +56,7 @@ class DateField extends TextField { $this->lCalendarButtons['today'] = $i18n->get('label.today'); $this->lCalendarButtons['close'] = $i18n->get('button.close'); - $this->mDateFormat = $user->date_format; + $this->mDateFormat = $user->getDateFormat(); $this->mWeekStartDay = $user->week_start; } diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 3af107e9..1ed3fe62 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.18.29.4586 | Copyright © Anuko | +  Anuko Time Tracker 1.18.29.4587 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/expense_edit.php b/expense_edit.php index c42bddc8..667d0346 100644 --- a/expense_edit.php +++ b/expense_edit.php @@ -161,18 +161,17 @@ if ($request->isPost()) { // Validate user input. if ($user->isPluginEnabled('cl') && $user->isPluginEnabled('cm') && !$cl_client) $err->add($i18n->get('error.client')); - if (MODE_PROJECTS == $trackingMode || MODE_PROJECTS_AND_TASKS == $trackingMode) { - if (!$cl_project) $err->add($i18n->get('error.project')); - } + if ($show_project && !$cl_project) + $err->add($i18n->get('error.project')); if (!ttValidString($cl_item_name)) $err->add($i18n->get('error.field'), $i18n->get('label.item')); if (!ttValidFloat($cl_cost)) $err->add($i18n->get('error.field'), $i18n->get('label.cost')); if (!ttValidDate($cl_date)) $err->add($i18n->get('error.field'), $i18n->get('label.date')); // This is a new date for the expense item. - $new_date = new DateAndTime($user->date_format, $cl_date); + $new_date = new DateAndTime($user->getDateFormat(), $cl_date); // Prohibit creating entries in future. - if (!$user->future_entries) { + if (!$user->getConfigOption('future_entries')) { $browser_today = new DateAndTime(DB_DATEFORMAT, $request->getParameter('browser_today', null)); if ($new_date->after($browser_today)) $err->add($i18n->get('error.future_date')); -- 2.20.1