if (isset($fields['record_type'])) $record_type_part = ', record_type = '.intval($fields['record_type']);
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']);
- if (isset($fields['working_hours'])) $working_hours_part = ', daily_working_hours = '.$mdb2->quote($fields['working_hours']);
+ if (isset($fields['working_hours'])) $working_hours_part = ', workday_hours = '.$mdb2->quote($fields['working_hours']);
$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
setChange("ALTER TABLE tt_teams DROP locktime");
setChange("CREATE TABLE `tt_monthly_quota` (`team_id` int(11) NOT NULL, `year` smallint(5) UNSIGNED NOT NULL, `month` tinyint(3) UNSIGNED NOT NULL, `quota` smallint(5) UNSIGNED NOT NULL, PRIMARY KEY (`year`,`month`,`team_id`))");
setChange("ALTER TABLE `tt_monthly_quota` ADD CONSTRAINT `FK_TT_TEAM_CONSTRAING` FOREIGN KEY (`team_id`) REFERENCES `tt_teams` (`id`) ON DELETE CASCADE ON UPDATE CASCADE");
- setChange("ALTER TABLE `tt_teams` ADD `daily_working_hours` SMALLINT NULL DEFAULT '8' AFTER `lock_spec`");
- setChange("UPDATE `tt_teams` SET `daily_working_hours` = 8");
+ setChange("ALTER TABLE `tt_teams` ADD `workday_hours` SMALLINT NULL DEFAULT '8' AFTER `lock_spec`");
+ setChange("UPDATE `tt_teams` SET `workday_hours` = 8");
+ setChange("ALTER TABLE tt_teams DROP daily_working_hours");
}
// The update_clients function updates projects field in tt_clients table.
`plugins` varchar(255) default NULL, # a list of enabled plugins for team
`lock_spec` varchar(255) default NULL, # Cron specification for record locking,
# for example: "0 10 * * 1" for "weekly on Mon at 10:00".
- `daily_working_hours` smallint(6) DEFAULT '8', # number of working hours per days, a worker is suppose to work
+ `workday_hours` smallint(6) DEFAULT '8', # number of work hours in a regular day
`custom_logo` tinyint(4) default '0', # whether to use a custom logo or not
`status` tinyint(4) default '1', # team status
PRIMARY KEY (`id`)
public function getDailyWorkingHours(){
$teamId = $this->usersTeamId;
- $sql = "SELECT daily_working_hours FROM tt_teams where id = $teamId";
+ $sql = "SELECT workday_hours FROM tt_teams where id = $teamId";
$reader = $this->db->query($sql);
if (is_a($reader, 'PEAR_Error')) {
return false;
}
$row = $reader->fetchRow();
- return $row["daily_working_hours"];
+ return $row["workday_hours"];
}
private function getSingle($year, $month) {