From 51d4d0c0575e14bf8cbfa81cfdef08361f075f71 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 2 Apr 2016 16:14:05 +0000 Subject: [PATCH] Removing legacy lock interval in days - replaced by Locking plugin. --- WEB-INF/lib/ttExportHelper.class.php | 2 +- WEB-INF/lib/ttImportHelper.class.php | 1 - WEB-INF/lib/ttTeamHelper.class.php | 16 +++------------- WEB-INF/lib/ttUser.class.php | 18 +----------------- WEB-INF/resources/de.lang.php | 1 - WEB-INF/resources/en.lang.php | 1 - WEB-INF/resources/es.lang.php | 2 -- WEB-INF/resources/fa.lang.php | 1 - WEB-INF/resources/fi.lang.php | 1 - WEB-INF/resources/fr.lang.php | 1 - WEB-INF/resources/he.lang.php | 1 - WEB-INF/resources/nl.lang.php | 1 - WEB-INF/resources/pl.lang.php | 1 - WEB-INF/resources/ru.lang.php | 1 - WEB-INF/resources/sk.lang.php | 1 - WEB-INF/resources/sr.lang.php | 1 - WEB-INF/templates/footer.tpl | 2 +- mysql.sql | 1 - profile_edit.php | 4 ---- 19 files changed, 6 insertions(+), 51 deletions(-) diff --git a/WEB-INF/lib/ttExportHelper.class.php b/WEB-INF/lib/ttExportHelper.class.php index 4a607fbf..912ac38a 100644 --- a/WEB-INF/lib/ttExportHelper.class.php +++ b/WEB-INF/lib/ttExportHelper.class.php @@ -61,7 +61,7 @@ class ttExportHelper { fwrite($file, "\n"); // Write team info. - fwrite($file, "currency."\" lock_spec=\"".$user->lock_spec."\" lock_interval=\"".$user->lock_interval."\" lang=\"".$user->lang."\" decimal_mark=\"".$user->decimal_mark."\" date_format=\"".$user->date_format."\" time_format=\"".$user->time_format."\" week_start=\"".$user->week_start. + fwrite($file, "currency."\" lock_spec=\"".$user->lock_spec."\" lang=\"".$user->lang."\" decimal_mark=\"".$user->decimal_mark."\" date_format=\"".$user->date_format."\" time_format=\"".$user->time_format."\" week_start=\"".$user->week_start. "\" plugins=\"".$user->plugins."\" tracking_mode=\"".$user->tracking_mode."\" record_type=\"".$user->record_type."\">\n"); fwrite($file, " team."]]>\n"); fwrite($file, "
address."]]>
\n"); diff --git a/WEB-INF/lib/ttImportHelper.class.php b/WEB-INF/lib/ttImportHelper.class.php index 67d60dff..29c537f3 100644 --- a/WEB-INF/lib/ttImportHelper.class.php +++ b/WEB-INF/lib/ttImportHelper.class.php @@ -118,7 +118,6 @@ class ttImportHelper { 'address' => $this->teamData['ADDRESS'], 'currency' => $this->teamData['CURRENCY'], 'lock_spec' => $this->teamData['LOCK_SPEC'], - 'lock_interval' => $this->teamData['LOCK_INTERVAL'], 'lang' => $this->teamData['LANG'], 'decimal_mark' => $this->teamData['DECIMAL_MARK'], 'date_format' => $this->teamData['DATE_FORMAT'], diff --git a/WEB-INF/lib/ttTeamHelper.class.php b/WEB-INF/lib/ttTeamHelper.class.php index 6633795c..9fa205c0 100644 --- a/WEB-INF/lib/ttTeamHelper.class.php +++ b/WEB-INF/lib/ttTeamHelper.class.php @@ -606,14 +606,6 @@ class ttTeamHelper { $lockspec_v = ''; } - if ($fields['lock_interval'] !== null) { - $locktime_f = ', locktime'; - $locktime_v = ", " . (int)$fields['lock_interval']; - } else { - $locktime_f = ''; - $locktime_v = ''; - } - $lang = $fields['lang']; if (!$lang) { global $i18n; @@ -692,10 +684,10 @@ class ttTeamHelper { $record_type_v = ''; } - $sql = "insert into tt_teams (name, address, currency $lockspec_f $locktime_f, lang $decimal_mark_f $date_format_f $time_format_f $week_start_f $plugins_f $tracking_mode_f $record_type_f) + $sql = "insert into tt_teams (name, address, currency $lockspec_f, lang $decimal_mark_f $date_format_f $time_format_f $week_start_f $plugins_f $tracking_mode_f $record_type_f) values(".$mdb2->quote(trim($fields['name'])). ", ".$mdb2->quote(trim($fields['address'])). - ", ".$mdb2->quote(trim($fields['currency']))." $lockspec_v $locktime_v, ".$mdb2->quote($lang). + ", ".$mdb2->quote(trim($fields['currency']))." $lockspec_v, ".$mdb2->quote($lang). "$decimal_mark_v $date_format_v $time_format_v $week_start_v $plugins_v $tracking_mode_v $record_type_v)"; $affected = $mdb2->exec($sql); @@ -717,7 +709,6 @@ class ttTeamHelper { $name_part = 'name = '.$mdb2->quote($fields['name']); $currency_part = ''; $addr_part = ''; - $locktime_part = ''; $lang_part = ''; $decimal_mark_part = ''; $date_format_part = ''; @@ -730,7 +721,6 @@ class ttTeamHelper { if (isset($fields['address'])) $addr_part = ', address = '.$mdb2->quote($fields['address']); if (isset($fields['currency'])) $currency_part = ', currency = '.$mdb2->quote($fields['currency']); - if (isset($fields['locktime'])) $locktime_part = ', locktime = '.intval($fields['locktime']); 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']); if (isset($fields['date_format'])) $date_format_part = ', date_format = '.$mdb2->quote($fields['date_format']); @@ -741,7 +731,7 @@ class ttTeamHelper { if (isset($fields['plugins'])) $plugins_part = ', plugins = '.$mdb2->quote($fields['plugins']); if (isset($fields['lock_spec'])) $lock_spec_part = ', lock_spec = '.$mdb2->quote($fields['lock_spec']); - $sql = "update tt_teams set $name_part $addr_part $currency_part $locktime_part $lang_part $decimal_mark_part + $sql = "update tt_teams set $name_part $addr_part $currency_part $lang_part $decimal_mark_part $date_format_part $time_format_part $week_start_part $tracking_mode_part $record_type_part $plugins_part $lock_spec_part where id = $team_id"; $affected = $mdb2->exec($sql); diff --git a/WEB-INF/lib/ttUser.class.php b/WEB-INF/lib/ttUser.class.php index c9dee41c..53ddb484 100644 --- a/WEB-INF/lib/ttUser.class.php +++ b/WEB-INF/lib/ttUser.class.php @@ -48,7 +48,6 @@ class ttUser { var $team = null; // Team name. var $custom_logo = 0; // Whether to use a custom logo for team. var $address = null; // Address for invoices. - var $lock_interval = 0; // Lock interval in days for time records. var $lock_spec = null; // Cron specification for record locking. var $rights = 0; // A mask of user rights. @@ -62,7 +61,7 @@ class ttUser { $mdb2 = getConnection(); $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.locktime, t.lang, t.decimal_mark, t.date_format, t.time_format, t.week_start, + 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.plugins, t.lock_spec, t.custom_logo FROM tt_users u LEFT JOIN tt_teams t ON (u.team_id = t.id) WHERE "; if ($id) @@ -98,7 +97,6 @@ class ttUser { $this->plugins = $val['plugins']; $this->lock_spec = $val['lock_spec']; $this->custom_logo = $val['custom_logo']; - $this->lock_interval = $val['locktime']; // Set "on behalf" id and name. if (isset($_SESSION['behalf_id'])) { @@ -180,20 +178,6 @@ class ttUser { function isDateLocked($date) { if ($this->isPluginEnabled('lk') && $this->lock_spec) { - // This is legacy code... - /* - // Determine lock date. Entries earlier than lock date cannot be created or modified. - $lockdate = 0; - if ($this->lock_interval > 0) { - $lockdate = new DateAndTime(); - $lockdate->decDay($this->lock_interval); - } - if($lockdate && $date->before($lockdate)) - return true; - */ - - // New code with cron specification. - // Override for managers. if ($this->canManageTeam()) return false; diff --git a/WEB-INF/resources/de.lang.php b/WEB-INF/resources/de.lang.php index b2cb3ead..b3b37fd4 100644 --- a/WEB-INF/resources/de.lang.php +++ b/WEB-INF/resources/de.lang.php @@ -167,7 +167,6 @@ $i18n_key_words = array( 'label.language' => 'Sprache', // TODO: translate the following string. // 'label.decimal_mark' => 'Decimal mark', -'label.lock_interval' => 'Blockierter Zeitraum in Tagen', 'label.date_format' => 'Datumsformat', 'label.time_format' => 'Zeitformat', 'label.week_start' => 'Erster Wochentag', diff --git a/WEB-INF/resources/en.lang.php b/WEB-INF/resources/en.lang.php index 53eb4683..8a4fe503 100644 --- a/WEB-INF/resources/en.lang.php +++ b/WEB-INF/resources/en.lang.php @@ -165,7 +165,6 @@ $i18n_key_words = array( 'label.id' => 'ID', 'label.language' => 'Language', 'label.decimal_mark' => 'Decimal mark', -'label.lock_interval' => 'Lock interval in days', 'label.date_format' => 'Date format', 'label.time_format' => 'Time format', 'label.week_start' => 'First day of week', diff --git a/WEB-INF/resources/es.lang.php b/WEB-INF/resources/es.lang.php index cdac3804..153df471 100644 --- a/WEB-INF/resources/es.lang.php +++ b/WEB-INF/resources/es.lang.php @@ -193,8 +193,6 @@ $i18n_key_words = array( // TODO: translate the following strings. // 'label.language' => 'Language', // 'label.decimal_mark' => 'Decimal mark', -'label.lock_interval' => 'Intervalo de cierre en días', -// TODO: translate the following strings. // 'label.date_format' => 'Date format', // 'label.time_format' => 'Time format', // 'label.week_start' => 'First day of week', diff --git a/WEB-INF/resources/fa.lang.php b/WEB-INF/resources/fa.lang.php index 53485d22..22b04cb4 100644 --- a/WEB-INF/resources/fa.lang.php +++ b/WEB-INF/resources/fa.lang.php @@ -175,7 +175,6 @@ $i18n_key_words = array( 'label.language' => 'زبان', // TODO: translate the following string. // 'label.decimal_mark' => 'Decimal mark', -'label.lock_interval' => 'قفل کردن فرصت بازه زمانی', 'label.date_format' => 'قالب تاریخ', 'label.time_format' => 'قالب زمان', 'label.week_start' => 'روز اول هفته', diff --git a/WEB-INF/resources/fi.lang.php b/WEB-INF/resources/fi.lang.php index 3f690088..88f08e13 100644 --- a/WEB-INF/resources/fi.lang.php +++ b/WEB-INF/resources/fi.lang.php @@ -168,7 +168,6 @@ $i18n_key_words = array( 'label.id' => 'ID', 'label.language' => 'Kieli', 'label.decimal_mark' => 'Desimaalierotin', -'label.lock_interval' => 'Lukitusväli päivinä', 'label.date_format' => 'Päiväyksen muoto', 'label.time_format' => 'Kellonajan muoto', 'label.week_start' => 'Viikon 1. päivä', diff --git a/WEB-INF/resources/fr.lang.php b/WEB-INF/resources/fr.lang.php index a961f551..52b17db5 100644 --- a/WEB-INF/resources/fr.lang.php +++ b/WEB-INF/resources/fr.lang.php @@ -179,7 +179,6 @@ $i18n_key_words = array( 'label.language' => 'Langage', // TODO: translate the following string. // 'label.decimal_mark' => 'Decimal mark', -'label.lock_interval' => 'Intervalle de verrouillage en jours', 'label.date_format' => 'Format date', 'label.time_format' => 'Format heure', 'label.week_start' => '1er jour de la semaine', diff --git a/WEB-INF/resources/he.lang.php b/WEB-INF/resources/he.lang.php index 704acf4a..698a92bb 100644 --- a/WEB-INF/resources/he.lang.php +++ b/WEB-INF/resources/he.lang.php @@ -180,7 +180,6 @@ $i18n_key_words = array( 'label.language' => 'שפה', // TODO: translate the following string. // 'label.decimal_mark' => 'Decimal mark', -'label.lock_interval' => 'טווח זמן לנעילה', 'label.date_format' => 'תבנית של תאריך', 'label.time_format' => 'תבנית של שעה', 'label.week_start' => 'היום הראשון בשבוע', diff --git a/WEB-INF/resources/nl.lang.php b/WEB-INF/resources/nl.lang.php index ca87180f..187bc813 100644 --- a/WEB-INF/resources/nl.lang.php +++ b/WEB-INF/resources/nl.lang.php @@ -165,7 +165,6 @@ $i18n_key_words = array( 'label.id' => 'ID', 'label.language' => 'Taal', 'label.decimal_mark' => 'Decimaal teken', -'label.lock_interval' => 'Uitsluit interval in dagen', 'label.date_format' => 'Datum formaat', 'label.time_format' => 'Tijdsaanduiding', 'label.week_start' => 'Eerste dag van de week', diff --git a/WEB-INF/resources/pl.lang.php b/WEB-INF/resources/pl.lang.php index 4fc40385..b2abad4e 100644 --- a/WEB-INF/resources/pl.lang.php +++ b/WEB-INF/resources/pl.lang.php @@ -168,7 +168,6 @@ $i18n_key_words = array( 'label.id' => 'ID', 'label.language' => 'Język', 'label.decimal_mark' => 'Znak dziesiętny', -'label.lock_interval' => 'Blokada edycji po okresie (dni)', 'label.date_format' => 'Format daty', 'label.time_format' => 'Format godziny', 'label.week_start' => 'Początek tygodnia', diff --git a/WEB-INF/resources/ru.lang.php b/WEB-INF/resources/ru.lang.php index d338c452..cef0ba4b 100644 --- a/WEB-INF/resources/ru.lang.php +++ b/WEB-INF/resources/ru.lang.php @@ -165,7 +165,6 @@ $i18n_key_words = array( 'label.id' => 'ID', 'label.language' => 'Язык', 'label.decimal_mark' => 'Десятичный знак', -'label.lock_interval' => 'Интервал блокировки в днях', 'label.date_format' => 'Формат даты', 'label.time_format' => 'Формат времени', 'label.week_start' => 'День начала недели', diff --git a/WEB-INF/resources/sk.lang.php b/WEB-INF/resources/sk.lang.php index 3b647d87..bd3abd81 100644 --- a/WEB-INF/resources/sk.lang.php +++ b/WEB-INF/resources/sk.lang.php @@ -177,7 +177,6 @@ $i18n_key_words = array( 'label.language' => 'Jazyk', // TODO: translate the following string. // 'label.decimal_mark' => 'Decimal mark', -'label.lock_interval' => 'Interval uzamknutia záznamov v dňoch', 'label.date_format' => 'Formát dátumu', 'label.time_format' => 'Formát času', 'label.week_start' => 'Prvý deň v týždni', diff --git a/WEB-INF/resources/sr.lang.php b/WEB-INF/resources/sr.lang.php index 7837bc6d..8e42f96f 100644 --- a/WEB-INF/resources/sr.lang.php +++ b/WEB-INF/resources/sr.lang.php @@ -165,7 +165,6 @@ $i18n_key_words = array( 'label.id' => 'ID', 'label.language' => 'Jezik', 'label.decimal_mark' => 'Decimala', -'label.lock_interval' => 'Blokiraj intervale u danima', 'label.date_format' => 'Format datuma', 'label.time_format' => 'Format vremena', 'label.week_start' => 'Prvi dan u nedelji', diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index b9de17f4..931390e6 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.9.22.3477 | Copyright © Anuko | +  Anuko Time Tracker 1.9.22.3478 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/mysql.sql b/mysql.sql index 5e669305..f566df7b 100644 --- a/mysql.sql +++ b/mysql.sql @@ -19,7 +19,6 @@ CREATE TABLE `tt_teams` ( `address` varchar(255) default NULL, # team address, used in invoices `currency` varchar(7) default NULL, # team currency symbol `decimal_mark` char(1) NOT NULL default '.', # separator in decimals - `locktime` int(4) default '0', # lock interval in days `lang` varchar(10) NOT NULL default 'en', # language `date_format` varchar(20) NOT NULL default '%Y-%m-%d', # date format `time_format` varchar(20) NOT NULL default '%H:%M', # time format diff --git a/profile_edit.php b/profile_edit.php index d4465745..5ccccf54 100644 --- a/profile_edit.php +++ b/profile_edit.php @@ -200,14 +200,10 @@ if ($request->isPost()) { if (!ttValidString($cl_team, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.team_name')); if (!ttValidString($cl_address, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.address')); if (!ttValidString($cl_currency, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.currency')); - if (!ttValidInteger($cl_lock_interval, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.lock_interval')); } // Finished validating user input. if ($err->no()) { - if ($cl_lock_interval == null || trim($cl_lock_interval) == '') - $cl_lock_interval = 0; - $update_result = true; if ($user->canManageTeam()) { -- 2.20.1