Fixed adding custom role with org_id field population.
authorNik Okuntseff <support@anuko.com>
Mon, 5 Nov 2018 21:49:07 +0000 (21:49 +0000)
committerNik Okuntseff <support@anuko.com>
Mon, 5 Nov 2018 21:49:07 +0000 (21:49 +0000)
WEB-INF/lib/ttImportHelper.class.php
WEB-INF/lib/ttRoleHelper.class.php
WEB-INF/templates/footer.tpl
role_add.php

index 42c7102..e250a4f 100644 (file)
@@ -152,6 +152,7 @@ class ttImportHelper {
           foreach ($this->roles as $key=>$role_item) {
             $role_id = ttRoleHelper::insert(array(
               'group_id' => $this->group_id,
+              'org_id' => $this->org_id,
               'name' => $role_item['NAME'],
               'rank' => $role_item['RANK'],
               'rights' => $role_item['RIGHTS'],
index 51c95b1..e5bf6a7 100644 (file)
@@ -154,14 +154,15 @@ class ttRoleHelper {
     $mdb2 = getConnection();
 
     $group_id = (int) $fields['group_id'];
+    $org_id = (int) $fields['org_id'];
     $name = $fields['name'];
     $rank = (int) $fields['rank'];
     $description = $fields['description'];
     $rights = $fields['rights'];
     $status = $fields['status'];
 
-    $sql = "insert into tt_roles (group_id, name, rank, description, rights, status)
-      values ($group_id, ".$mdb2->quote($name).", $rank, ".$mdb2->quote($description).", ".$mdb2->quote($rights).", ".$mdb2->quote($status).")";
+    $sql = "insert into tt_roles (group_id, org_id, name, rank, description, rights, status)
+      values ($group_id, $org_id, ".$mdb2->quote($name).", $rank, ".$mdb2->quote($description).", ".$mdb2->quote($rights).", ".$mdb2->quote($status).")";
     $affected = $mdb2->exec($sql);
     if (is_a($affected, 'PEAR_Error'))
       return false;
index 90828c1..6430f8a 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.08.4371 | 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.08.4372 | 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 c8df24c..cb3d6f4 100644 (file)
@@ -63,6 +63,7 @@ if ($request->isPost()) {
         // Insert a role with default user rights.
         if (ttRoleHelper::insert(array(
           'group_id' => $user->group_id,
+          'org_id' => $user->org_id,
           'name' => $cl_name,
           'rank' => $cl_rank,
           'description' => $cl_description,