fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [11966] property: add attribute disabled to category-


From: Sigurd Nes
Subject: [Fmsystem-commits] [11966] property: add attribute disabled to category-select
Date: Tue, 13 May 2014 08:54:30 +0000

Revision: 11966
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11966
Author:   sigurdne
Date:     2014-05-13 08:54:30 +0000 (Tue, 13 May 2014)
Log Message:
-----------
property: add attribute disabled to category-select

Modified Paths:
--------------
    trunk/property/inc/class.sotts.inc.php
    trunk/property/inc/class.uitts.inc.php
    trunk/property/setup/phpgw_no.lang

Modified: trunk/property/inc/class.sotts.inc.php
===================================================================
--- trunk/property/inc/class.sotts.inc.php      2014-05-13 08:53:59 UTC (rev 
11965)
+++ trunk/property/inc/class.sotts.inc.php      2014-05-13 08:54:30 UTC (rev 
11966)
@@ -1208,7 +1208,7 @@
                                }
                        }
 
-                       if (($oldassigned != $ticket['assignedto']) && 
$ticket['assignedto'] != 'ignore')
+                       if ($ticket['assignedto'] && ( ($oldassigned != 
$ticket['assignedto']) && $ticket['assignedto'] != 'ignore') )
                        {
                                $this->fields_updated[] = 'assignedto';
 
@@ -1219,7 +1219,7 @@
                                
$this->historylog->add('A',$id,$ticket['assignedto'],$oldassigned);
                        }
 
-                       if (($oldgroup_id != $ticket['group_id']) && 
$ticket['group_id'] != 'ignore')
+                       if ($ticket['group_id'] && ( ($oldgroup_id != 
$ticket['group_id']) && $ticket['group_id'] != 'ignore') )
                        {
                                $this->fields_updated[] = 'group_id';
 
@@ -1245,7 +1245,7 @@
                                $this->db->query("update fm_tts_tickets set 
contact_id={$contact_id} WHERE id=$id",__LINE__,__FILE__);
                        }
 
-                       if (($oldcat_id != $ticket['cat_id']) && 
$ticket['cat_id'] != 'ignore')
+                       if ($ticket['cat_id'] && ( ($oldcat_id != 
$ticket['cat_id']) && $ticket['cat_id'] != 'ignore') )
                        {
                                $this->fields_updated[] = 'cat_id';
                                $this->db->query("update fm_tts_tickets set 
cat_id='" . $ticket['cat_id']

Modified: trunk/property/inc/class.uitts.inc.php
===================================================================
--- trunk/property/inc/class.uitts.inc.php      2014-05-13 08:53:59 UTC (rev 
11965)
+++ trunk/property/inc/class.uitts.inc.php      2014-05-13 08:54:30 UTC (rev 
11966)
@@ -422,16 +422,16 @@
                        $dry_run = false;
                        $second_display = phpgw::get_var('second_display', 
'bool');
 
-                       $default_category       = 
(isset($GLOBALS['phpgw_info']['user']['preferences']['property']['default_district'])?$GLOBALS['phpgw_info']['user']['preferences']['property']['default_district']:'');
+                       $default_district       = 
(isset($GLOBALS['phpgw_info']['user']['preferences']['property']['default_district'])?$GLOBALS['phpgw_info']['user']['preferences']['property']['default_district']:'');
                        //FIXME: differentiate mainsreen and helpdesk if this 
should be used.
                        $default_status         = 
'';//isset($GLOBALS['phpgw_info']['user']['preferences']['property']['tts_status'])?$GLOBALS['phpgw_info']['user']['preferences']['property']['tts_status']:'';
                        $start_date             = urldecode($this->start_date);
                        $end_date                       = 
urldecode($this->end_date);
 
-                       if ($default_category && !$second_display && 
!$this->district_id)
+                       if ($default_district && !$second_display && 
!$this->district_id)
                        {
-                               $this->bo->district_id  = $default_category;
-                               $this->district_id              = 
$default_category;
+                               $this->bo->district_id  = $default_district;
+                               $this->district_id              = 
$default_district;
                        }
 
                        if ($default_status && !$second_display)
@@ -1393,15 +1393,15 @@
 
                        $second_display = phpgw::get_var('second_display', 
'bool');
 
-                       $default_category = 
(isset($GLOBALS['phpgw_info']['user']['preferences']['property']['default_district'])?$GLOBALS['phpgw_info']['user']['preferences']['property']['default_district']:'');
+                       $default_district = 
(isset($GLOBALS['phpgw_info']['user']['preferences']['property']['default_district'])?$GLOBALS['phpgw_info']['user']['preferences']['property']['default_district']:'');
                        $default_status = 
(isset($GLOBALS['phpgw_info']['user']['preferences']['property']['tts_status'])?$GLOBALS['phpgw_info']['user']['preferences']['property']['tts_status']:'');
                        $start_date     = urldecode($this->start_date);
                        $end_date       = urldecode($this->end_date);
 
-                       if ($default_category && !$second_display && 
!$this->district_id)
+                       if ($default_district && !$second_display && 
!$this->district_id)
                        {
-                               $this->bo->district_id  = $default_category;
-                               $this->district_id              = 
$default_category;
+                               $this->bo->district_id  = $default_district;
+                               $this->district_id              = 
$default_district;
                        }
 
                        if ($default_status && !$second_display)
@@ -3242,6 +3242,39 @@
 //_debug_array($supervisor_email);die();
                        $msgbox_data = $this->bocommon->msgbox_data($receipt);
                        $cat_select     = 
$this->cats->formatted_xslt_list(array('select_name' => 
'values[cat_id]','selected' => $this->cat_id,'use_acl' => 
$this->_category_acl));
+                       
+                       $_ticket_cat_found = false;
+                       if(isset($cat_select['cat_list']) && 
is_array($cat_select['cat_list']))
+                       {
+                               foreach($cat_select['cat_list'] as 
$cat_list_entry)
+                               {
+                                       if($cat_list_entry['cat_id'] == 
$ticket['cat_id'])
+                                       {
+                                               $_ticket_cat_found = true;
+                                               break;
+                                       }
+                               }
+                       }
+                       
+                       if(!$_ticket_cat_found)
+                       {
+                               $category = 
$this->cats->return_single($ticket['cat_id']);
+//_debug_array($category);
+
+                               array_unshift ($cat_select['cat_list'],array
+                                       (
+                                               'cat_id'                => 
$category[0]['id'],
+                                               'name'                  => 
$category[0]['name'],
+                                               'description'   => 
$category[0]['description'],
+                                               'selected'              => true,
+                                       )
+                               );
+                               $cat_select['disabled'] = true;
+                               $cat_select['hidden_value']     = 
$ticket['cat_id'];
+//_debug_array($cat_select);die();                     
+                       }
+
+
                        $this->cats->set_appname('property','.project');
                        $order_catetory = 
$this->cats->formatted_xslt_list(array('select_name' => 
'values[cat_id]','selected' => $ticket['order_cat_id']));
 

Modified: trunk/property/setup/phpgw_no.lang
===================================================================
--- trunk/property/setup/phpgw_no.lang  2014-05-13 08:53:59 UTC (rev 11965)
+++ trunk/property/setup/phpgw_no.lang  2014-05-13 08:54:30 UTC (rev 11966)
@@ -1559,7 +1559,7 @@
 select the category the building belongs to. to do not use a category select 
no category       property        no      velg kategori bygningene tilhører. 
For ikke å bruke kategori velg KATEGORI IKKE VALGT
 select the category the claim belongs to. to do not use a category select no 
category  property        no      Velg kategorien dette kravet tilhører
 select the category the custom belongs to. to do not use a category select no 
category property        no      Velg kategorien denne egentilpassede tilhører
-select the category the data belong to. to do not use a category select no 
category    property        no      Velg kategorien dataen hører til
+select the category the data belong to. to do not use a category select no 
category    property        no      Velg kategorien posten tilhører
 select the category the document belongs to. to do not use a category select 
no category       property        no      velg kategori dokumentene tilhører. 
For ikke å bruke kategori velg KATEGORI IKKE VALGT
 select the category the entrance belongs to. to do not use a category select 
no category       property        no      velg kategori inngang tilhører. For 
ikke å bruke kategori velg KATEGORI IKKE VALGT
 select the category the equipment belongs to. to do not use a category select 
no category      property        no      velg kategori utstyr tilhører. For 
ikke å bruke kategori velg KATEGORI IKKE VALGT




reply via email to

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