fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [17210] More on helpdesk


From: sigurdne
Subject: [Fmsystem-commits] [17210] More on helpdesk
Date: Tue, 31 Oct 2017 09:48:04 -0400 (EDT)

Revision: 17210
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=17210
Author:   sigurdne
Date:     2017-10-31 09:48:04 -0400 (Tue, 31 Oct 2017)
Log Message:
-----------
More on helpdesk

Modified Paths:
--------------
    trunk/helpdesk/inc/custom/default/ticket_LRS_pre_commit_validate.php

Modified: trunk/helpdesk/inc/custom/default/ticket_LRS_pre_commit_validate.php
===================================================================
--- trunk/helpdesk/inc/custom/default/ticket_LRS_pre_commit_validate.php        
2017-10-31 13:02:15 UTC (rev 17209)
+++ trunk/helpdesk/inc/custom/default/ticket_LRS_pre_commit_validate.php        
2017-10-31 13:48:04 UTC (rev 17210)
@@ -48,9 +48,19 @@
                        $this->db->query($sql);
                        $this->db->next_record();
                        $arbeidssted = (int)$this->db->f('arbeidssted');
+                       $category =  CreateObject('phpgwapi.categories', -1, 
'helpdesk', '.ticket')->return_single($data['cat_id']);
+                       $parent_id =  (int)$category[0]['parent'];
 
-                       $location_id = 
$GLOBALS['phpgw']->locations->get_id('property', ".entity.6.1");
+                       if($parent_id == 255)
+                       {
+                               $location_id = 
$GLOBALS['phpgw']->locations->get_id('property', ".entity.6.1");
+                       }
+                       else
+                       {
+                               $location_id = 
$GLOBALS['phpgw']->locations->get_id('property', ".entity.6.2");
+                       }
 
+
                        $sql = "SELECT json_representation->>'alias' as alias 
FROM fm_bim_item WHERE location_id = {$location_id}"
                        . " AND CAST(json_representation->>'arbeidssted_start' 
AS INTEGER) <= {$arbeidssted}"
                        . " AND CAST(json_representation->>'arbeidssted_slutt' 
AS INTEGER) >= {$arbeidssted}";




reply via email to

[Prev in Thread] Current Thread [Next in Thread]