fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [11219]


From: Sigurd Nes
Subject: [Fmsystem-commits] [11219]
Date: Sun, 30 Jun 2013 16:21:54 +0000

Revision: 11219
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11219
Author:   sigurdne
Date:     2013-06-30 16:21:52 +0000 (Sun, 30 Jun 2013)
Log Message:
-----------


Modified Paths:
--------------
    trunk/property/inc/class.bolocation.inc.php
    trunk/property/inc/class.uilocation.inc.php
    trunk/property/inc/class.uilookup.inc.php

Modified: trunk/property/inc/class.bolocation.inc.php
===================================================================
--- trunk/property/inc/class.bolocation.inc.php 2013-06-29 17:30:01 UTC (rev 
11218)
+++ trunk/property/inc/class.bolocation.inc.php 2013-06-30 16:21:52 UTC (rev 
11219)
@@ -532,6 +532,7 @@
                                }
                        }
 
+                       $input_name_entity = array();
                        if (isset($data['lookup_entity']) && 
is_array($data['lookup_entity']))
                        {
                                foreach($data['lookup_entity'] as $entity)
@@ -548,7 +549,7 @@
 
                                        $location['location'][$i]['input_type'] 
                                        = 'text';
                                        $location['location'][$i]['input_name'] 
                                        = 'entity_num_' . $entity['id'];
-                                       $input_name[]                           
                                                                = 'entity_num_' 
. $entity['id'];
+                                       $input_name_entity[]                    
                                                        = 'entity_num_' . 
$entity['id'];
                                        $insert_record['extra']['entity_num_' . 
$entity['id']]          = 'p_num';
 
                                        $location['location'][$i]['size']       
                                                = 8;
@@ -563,7 +564,7 @@
                                        $location['location'][$i]['statustext'] 
                                        = lang('click this link to select') .' 
' . $entity['name'];
 
                                        
$location['location'][$i]['extra'][0]['input_name']                     = 
'entity_cat_name_' . $entity['id'];
-                                       $input_name[]                           
                                                                = 
$location['location'][$i]['extra'][0]['input_name'];
+                                       $input_name_entity[]                    
                                                                        = 
$location['location'][$i]['extra'][0]['input_name'];
                                        
$location['location'][$i]['extra'][0]['input_type']                     = 
'text';
                                        
$location['location'][$i]['extra'][0]['size']                           = 30;
                                        
$location['location'][$i]['extra'][0]['lookup_function_call']   = 
'lookup_entity_' . $entity['id'] .'()';
@@ -575,7 +576,7 @@
 
                                        
$location['location'][$i]['extra'][1]['input_type']                     = 
'hidden';
                                        
$location['location'][$i]['extra'][1]['input_name']                     = 
'entity_id_' . $entity['id'];
-                                       $input_name[]                           
                                                                = 'entity_id_' 
. $entity['id'];
+                                       $input_name_entity[]                    
                                                        = 'entity_id_' . 
$entity['id'];
                                        $insert_record['extra']['entity_id_' . 
$entity['id']]           = 'p_entity_id';
                                        if (is_array($data['entity_data']))
                                        {
@@ -584,7 +585,7 @@
 
                                        
$location['location'][$i]['extra'][2]['input_type']                     = 
'hidden';
                                        
$location['location'][$i]['extra'][2]['input_name']                     = 
'cat_id_' . $entity['id'];
-                                       $input_name[]                           
                                                                = 'cat_id_' . 
$entity['id'];
+                                       $input_name_entity[]                    
                                                        = 'cat_id_' . 
$entity['id'];
                                        $insert_record['extra']['cat_id_' . 
$entity['id']]                      = 'p_cat_id';
 
                                        if (is_array($data['entity_data']))
@@ -599,17 +600,18 @@
                        //_debug_array($location['location']);
                        if(isset($input_name))
                        {
-                               
$GLOBALS['phpgw']->session->appsession('lookup_fields','property',$input_name);
+                               phpgwapi_cache::session_set('property', 
'lookup_fields',$input_name);
                        }
+                       if($input_name_entity)
+                       {
+                               phpgwapi_cache::session_set('property', 
'lookup_fields_entity',$input_name_entity);
+                       }
+
                        if(isset($insert_record))
                        {
-       //                      
$GLOBALS['phpgw']->session->appsession('insert_record','property',$insert_record);
                                phpgwapi_cache::session_set('property', 
'insert_record',$insert_record);
-
                        }
-                       //                      
$GLOBALS['phpgw']->session->appsession('input_name','property',$input_name);
 
-
                        if(isset($lookup_functions) && 
is_array($lookup_functions))
                        {
                                $_lookup_functions = 
"self.name='first_Window'\n";

Modified: trunk/property/inc/class.uilocation.inc.php
===================================================================
--- trunk/property/inc/class.uilocation.inc.php 2013-06-29 17:30:01 UTC (rev 
11218)
+++ trunk/property/inc/class.uilocation.inc.php 2013-06-30 16:21:52 UTC (rev 
11219)
@@ -879,7 +879,7 @@
                        // for POP-UPs
                        if($lookup)
                        {
-                               $input_name             = 
$GLOBALS['phpgw']->session->appsession('lookup_fields','property');
+                               $input_name             = 
phpgwapi_cache::session_get('property', 'lookup_fields');
 
                                $function_exchange_values = '';
 
@@ -904,17 +904,21 @@
 
                                $datatable['exchange_values'] = 
$function_exchange_values;
 
-                               $function_valida  = "var pos = 
data.indexOf('</a>');"."\r\n";
-                               $function_valida .= "if(pos==-1){"."\r\n";
-                               $function_valida .= "return data;"."\r\n";
-                               $function_valida .= "}else{"."\r\n";
-                               $function_valida .= "pos = 
data.indexOf('>');"."\r\n";
-                               $function_valida .= "var valor = 
data.slice(pos+1);"."\r\n";
-                               $function_valida .= "pos = 
valor.indexOf('<');"."\r\n";
-                               $function_valida .= "valor = 
valor.slice(0,pos);"."\r\n";
-                               $function_valida .= "return valor;"."\r\n";
-                               $function_valida .= "}"."\r\n";
-
+                               $function_valida  = <<<JS
+                                       var pos = data.indexOf('</a>');
+                                               if(pos==-1)
+                                               {
+                                                       return data;
+                                               }
+                                               else
+                                               {
+                                                       pos = data.indexOf('>');
+                                                       var valor = 
data.slice(pos+1);
+                                                       pos = 
valor.indexOf('<');
+                                                       valor = 
valor.slice(0,pos);
+                                                       return valor;
+                                               }
+JS;
                                $datatable['valida'] = $function_valida;
                        }
 

Modified: trunk/property/inc/class.uilookup.inc.php
===================================================================
--- trunk/property/inc/class.uilookup.inc.php   2013-06-29 17:30:01 UTC (rev 
11218)
+++ trunk/property/inc/class.uilookup.inc.php   2013-06-30 16:21:52 UTC (rev 
11219)
@@ -2114,7 +2114,14 @@
                        }
 
                        $entity_list = $boentity->read(array('lookup'=>true));
-                       $input_name = 
$GLOBALS['phpgw']->session->appsession('lookup_fields','property');
+
+                       $input_name                     = 
phpgwapi_cache::session_get('property', 'lookup_fields');
+                       $input_name_entity      = 
phpgwapi_cache::session_get('property', 'lookup_fields_entity');
+                       $input_name = $input_name ? $input_name : array();
+                       $input_name_entity = $input_name_entity ? 
$input_name_entity : array();
+                       
+                       $input_name = 
array_merge($input_name,$input_name_entity);
+
                        $uicols = $boentity->uicols;
 
                        if (count($uicols['name']) > 0)




reply via email to

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