From 395edff71f2a114bc3cbccf1c970d4419d9db8d4 Mon Sep 17 00:00:00 2001 From: anuko Date: Sat, 6 May 2017 16:28:48 +0000 Subject: [PATCH] Work in progress on task required option. --- WEB-INF/lib/ttUser.class.php | 4 +++- dbinstall.php | 2 +- mysql.sql | 2 +- profile_edit.php | 2 ++ 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/WEB-INF/lib/ttUser.class.php b/WEB-INF/lib/ttUser.class.php index 6b6a44a2..7edcbde4 100644 --- a/WEB-INF/lib/ttUser.class.php +++ b/WEB-INF/lib/ttUser.class.php @@ -42,6 +42,7 @@ class ttUser { var $time_format = null; // Time format. var $week_start = 0; // Week start day. var $tracking_mode = 0; // Tracking mode. + var $task_required = null; // Whether task selection is required on time entires. var $record_type = 0; // Record type (duration vs start and finish, or both). var $uncompleted_indicators = 0; // Uncompleted time entry indicators (show nowhere or on users page). var $currency = null; // Currency. @@ -64,7 +65,7 @@ class ttUser { $sql = "SELECT u.id, u.login, u.name, u.team_id, u.role, u.client_id, u.email, t.name as team_name, t.address, t.currency, t.lang, t.decimal_mark, t.date_format, t.time_format, t.week_start, - t.tracking_mode, t.record_type, t.uncompleted_indicators, t.plugins, t.lock_spec, t.workday_hours, t.custom_logo + t.tracking_mode, t.task_required, t.record_type, t.uncompleted_indicators, t.plugins, t.lock_spec, t.workday_hours, t.custom_logo FROM tt_users u LEFT JOIN tt_teams t ON (u.team_id = t.id) WHERE "; if ($id) $sql .= "u.id = $id"; @@ -92,6 +93,7 @@ class ttUser { $this->time_format = $val['time_format']; $this->week_start = $val['week_start']; $this->tracking_mode = $val['tracking_mode']; + $this->task_required = $val['task_required']; $this->record_type = $val['record_type']; $this->uncompleted_indicators = $val['uncompleted_indicators']; $this->team = $val['team_name']; diff --git a/dbinstall.php b/dbinstall.php index 3f9b8570..e0f5b56b 100755 --- a/dbinstall.php +++ b/dbinstall.php @@ -636,7 +636,7 @@ if ($_POST) { setChange("ALTER TABLE tt_expense_items modify `name` text NOT NULL"); setChange("ALTER TABLE `tt_teams` ADD `uncompleted_indicators` SMALLINT(2) NOT NULL DEFAULT '0' AFTER `record_type`"); setChange("CREATE TABLE `tt_predefined_expenses` (`id` int(11) NOT NULL auto_increment, `team_id` int(11) NOT NULL, `name` varchar(255) NOT NULL, `cost` decimal(10,2) default '0.00', PRIMARY KEY (`id`))"); - setChange("ALTER TABLE `tt_teams` ADD `tracking_mode_options` smallint(2) default NULL AFTER `tracking_mode`"); + setChange("ALTER TABLE `tt_teams` ADD `task_required` smallint(2) default NULL AFTER `tracking_mode`"); } // The update_clients function updates projects field in tt_clients table. diff --git a/mysql.sql b/mysql.sql index 9ec80322..9e672686 100644 --- a/mysql.sql +++ b/mysql.sql @@ -24,7 +24,7 @@ CREATE TABLE `tt_teams` ( `time_format` varchar(20) NOT NULL default '%H:%M', # time format `week_start` smallint(2) NOT NULL DEFAULT '0', # Week start day, 0 == Sunday. `tracking_mode` smallint(2) NOT NULL DEFAULT '1', # tracking mode ("time", "projects" or "projects and tasks") - `tracking_mode_options` smallint(2) default NULL, # whether a task selection is required or optional + `task_required` smallint(2) default NULL, # whether a task selection is required or optional `record_type` smallint(2) NOT NULL DEFAULT '0', # time record type ("start and finish", "duration", or both) `uncompleted_indicators` smallint(2) NOT NULL DEFAULT '0', # whether to show indicators for users with uncompleted time entries `plugins` varchar(255) default NULL, # a list of enabled plugins for team diff --git a/profile_edit.php b/profile_edit.php index 9fac75f8..1663f446 100644 --- a/profile_edit.php +++ b/profile_edit.php @@ -59,6 +59,7 @@ if ($request->isPost()) { $cl_custom_format_time = $request->getParameter('format_time'); $cl_start_week = $request->getParameter('start_week'); $cl_tracking_mode = $request->getParameter('tracking_mode'); + $cl_task_required = $request->getParameter('task_required'); $cl_record_type = $request->getParameter('record_type'); $cl_uncompleted_indicators = $request->getParameter('uncompleted_indicators'); $cl_charts = $request->getParameter('charts'); @@ -86,6 +87,7 @@ if ($request->isPost()) { $cl_custom_format_time = $user->time_format; $cl_start_week = $user->week_start; $cl_tracking_mode = $user->tracking_mode; + $cl_ttask_required = $user->task_required; $cl_record_type = $user->record_type; $cl_uncompleted_indicators = $user->uncompleted_indicators; -- 2.20.1