Populating group_id and org_id in tt_client_project_binds.
authorNik Okuntseff <support@anuko.com>
Mon, 19 Nov 2018 16:47:54 +0000 (16:47 +0000)
committerNik Okuntseff <support@anuko.com>
Mon, 19 Nov 2018 16:47:54 +0000 (16:47 +0000)
WEB-INF/lib/ttClientHelper.class.php
WEB-INF/templates/footer.tpl
dbinstall.php

index 0c12a95..eeb77f7 100644 (file)
@@ -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;
index b9077c0..8d292fc 100644 (file)
@@ -12,7 +12,7 @@
       <br>
       <table cellspacing="0" cellpadding="4" width="100%" border="0">
         <tr>
-          <td align="center">&nbsp;Anuko Time Tracker 1.18.21.4460 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+          <td align="center">&nbsp;Anuko Time Tracker 1.18.21.4461 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
             <a href="https://www.anuko.com/lp/tt_4.htm" target="_blank">{$i18n.footer.credits}</a> |
             <a href="https://www.anuko.com/lp/tt_5.htm" target="_blank">{$i18n.footer.license}</a> |
             <a href="https://www.anuko.com/lp/tt_7.htm" target="_blank">{$i18n.footer.improve}</a>
index 63bfdc0..bfbb5c2 100644 (file)
@@ -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"]) {