From: Nik Okuntseff Date: Mon, 19 Nov 2018 16:47:54 +0000 (+0000) Subject: Populating group_id and org_id in tt_client_project_binds. X-Git-Tag: timetracker_1.19-1~611 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=e5c2856600ec9c939f011226c78f39ae9a63d8b0;p=timetracker.git Populating group_id and org_id in tt_client_project_binds. --- diff --git a/WEB-INF/lib/ttClientHelper.class.php b/WEB-INF/lib/ttClientHelper.class.php index 0c12a953..eeb77f77 100644 --- a/WEB-INF/lib/ttClientHelper.class.php +++ b/WEB-INF/lib/ttClientHelper.class.php @@ -195,7 +195,7 @@ class ttClientHelper { if (count($projects) > 0) foreach ($projects as $p_id) { - $sql = "insert into tt_client_project_binds (client_id, project_id) values($last_id, $p_id)"; + $sql = "insert into tt_client_project_binds (client_id, project_id, group_id, org_id) values($last_id, $p_id, $group_id, $org_id)"; $affected = $mdb2->exec($sql); if (is_a($affected, 'PEAR_Error')) return false; diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index b9077c05..8d292fc5 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.18.21.4460 | Copyright © Anuko | +  Anuko Time Tracker 1.18.21.4461 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/dbinstall.php b/dbinstall.php index 63bfdc0b..bfbb5c2c 100644 --- a/dbinstall.php +++ b/dbinstall.php @@ -1019,6 +1019,8 @@ if ($_POST) { setChange("UPDATE `tt_cron` inner join `tt_site_config` sc on (sc.param_name = 'version_db' and sc.param_value = '1.18.20') set org_id = group_id where org_id is null"); setChange("ALTER TABLE `tt_client_project_binds` ADD `group_id` int(11) default NULL AFTER `project_id`"); setChange("ALTER TABLE `tt_client_project_binds` ADD `org_id` int(11) default NULL AFTER `group_id`"); + setChange("update `tt_client_project_binds` cpb inner join `tt_site_config` sc on (sc.param_name = 'version_db' and sc.param_value = '1.18.20') inner join `tt_clients` c on c.id = cpb.client_id set cpb.group_id = c.group_id, cpb.org_id = c.org_id where cpb.org_id is null"); + setChange("UPDATE `tt_site_config` SET param_value = '1.18.21', modified = now() where param_name = 'version_db' and param_value = '1.18.20'"); } if ($_POST["cleanup"]) {