Started to populate org_id upon client creation.
authorNik Okuntseff <support@anuko.com>
Wed, 7 Nov 2018 12:43:23 +0000 (12:43 +0000)
committerNik Okuntseff <support@anuko.com>
Wed, 7 Nov 2018 12:43:23 +0000 (12:43 +0000)
WEB-INF/lib/ttClientHelper.class.php
WEB-INF/lib/ttImportHelper.class.php
WEB-INF/templates/footer.tpl
client_add.php
client_edit.php
mobile/client_add.php
mobile/client_edit.php

index 19409b9..0c12a95 100644 (file)
@@ -168,6 +168,7 @@ class ttClientHelper {
     $mdb2 = getConnection();
 
     $group_id = (int) $fields['group_id'];
+    $org_id = (int) $fields['org_id'];
     $name = $fields['name'];
     $address = $fields['address'];
     $tax = $fields['tax'];
@@ -179,8 +180,8 @@ class ttClientHelper {
     $tax = str_replace(',', '.', $tax);
     if ($tax == '') $tax = 0;
 
-    $sql = "insert into tt_clients (group_id, name, address, tax, projects, status)".
-      " values ($group_id, ".$mdb2->quote($name).", ".$mdb2->quote($address).", $tax, ".$mdb2->quote($comma_separated).", ".$mdb2->quote($status).")";
+    $sql = "insert into tt_clients (group_id, org_id, name, address, tax, projects, status)".
+      " values ($group_id, $org_id, ".$mdb2->quote($name).", ".$mdb2->quote($address).", $tax, ".$mdb2->quote($comma_separated).", ".$mdb2->quote($status).")";
 
     $affected = $mdb2->exec($sql);
     if (is_a($affected, 'PEAR_Error'))
index 8c6fd0c..e732b98 100644 (file)
@@ -222,6 +222,7 @@ class ttImportHelper {
       $this->clientMap[$this->currentElement['ID']] =
         ttClientHelper::insert(array(
           'group_id' => $this->group_id,
+          'org_id' => $this->org_id,
           'name' => $this->currentElement['NAME'],
           'address' => $this->currentElement['ADDRESS'],
           'tax' => $this->currentElement['TAX'],
index 0148ae7..c94ea85 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.09.4380 | 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.09.4381 | 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 3afcbc0..dc99e6c 100644 (file)
@@ -71,7 +71,8 @@ if ($request->isPost()) {
   if ($err->no()) {
     if (!ttClientHelper::getClientByName($cl_name)) {
       if (ttClientHelper::insert(array(
-        'group_id' => $user->group_id,
+        'group_id' => $user->getActiveGroup(),
+        'org_id' => $user->org_id,
         'name' => $cl_name,
         'address' => $cl_address,
         'tax' => $cl_tax,
index 74062d0..19aa5f8 100644 (file)
@@ -103,7 +103,8 @@ if ($request->isPost()) {
     if ($request->getParameter('btn_copy')) {
       if (!ttClientHelper::getClientByName($cl_name)) {
         if (ttClientHelper::insert(array(
-          'group_id' => $user->group_id,
+          'group_id' => $user->getActiveGroup(),
+          'org_id' => $user->org_id,
           'name' => $cl_name,
           'address' => $cl_address,
           'tax' => $cl_tax,
index f83c720..7a097b5 100644 (file)
@@ -71,7 +71,8 @@ if ($request->isPost()) {
   if ($err->no()) {
     if (!ttClientHelper::getClientByName($cl_name)) {
       if (ttClientHelper::insert(array(
-        'group_id' => $user->group_id,
+        'group_id' => $user->getActiveGroup(),
+        'org_id' => $user->org_id,
         'name' => $cl_name,
         'address' => $cl_address,
         'tax' => $cl_tax,
index 093e966..73d50ca 100644 (file)
@@ -104,7 +104,8 @@ if ($request->isPost()) {
     if ($request->getParameter('btn_copy')) {
       if (!ttClientHelper::getClientByName($cl_name)) {
         if (ttClientHelper::insert(array(
-          'group_id' => $user->group_id,
+          'group_id' => $user->getActiveGroup(),
+          'org_id' => $user->org_id,
           'name' => $cl_name,
           'address' => $cl_address,
           'tax' => $cl_tax,