phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] property/inc class.soentity.inc.php, 1.10, 1.11 class


From: Sigurd Nes <address@hidden>
Subject: [Phpgroupware-cvs] property/inc class.soentity.inc.php, 1.10, 1.11 class.bolocation.inc.php, 1.32, 1.33 class.boentity.inc.php, 1.7, 1.8 class.uientity.inc.php, 1.9, 1.10 class.soadmin_entity.inc.php, 1.10, 1.11 class.menu.inc.php, 1.1, 1.2 class.uimeter.inc.php, 1.17, 1.18 class.someter.inc.php, 1.9, 1.10 class.bometer.inc.php, 1.6, 1.7
Date: Wed, 05 Nov 2003 21:15:52 +0000

Update of /cvsroot/phpgroupware/property/inc
In directory subversions:/tmp/cvs-serv11425/inc

Modified Files:
        class.soentity.inc.php class.bolocation.inc.php 
        class.boentity.inc.php class.uientity.inc.php 
        class.soadmin_entity.inc.php class.menu.inc.php 
        class.uimeter.inc.php class.someter.inc.php 
        class.bometer.inc.php 
Log Message:
no message

Index: class.bolocation.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.bolocation.inc.php,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** class.bolocation.inc.php    3 Nov 2003 18:01:13 -0000       1.32
--- class.bolocation.inc.php    5 Nov 2003 21:15:47 -0000       1.33
***************
*** 439,445 ****
  
                        }
- //_debug_array($data);
  
!                       if (isset($data['lookup_entity']) AND 
is_array($data['lookup_entity']))
                        {
                                foreach($data['lookup_entity'] as $entity)
--- 439,444 ----
  
                        }
  
!                       if (isset($data['lookup_entity']) && 
is_array($data['lookup_entity']))
                        {
                                foreach($data['lookup_entity'] as $entity)
***************
*** 452,463 ****
  
                                        $location['location'][$i]['input_type'] 
                                                = 'text';
!                                       $location['location'][$i]['input_name'] 
                                                = 'entity_id_' . $entity['id'];
!                                       $input_name[]                           
                                                                        = 
'entity_id_' . $entity['id'];
!                                       $insert_record['extra']['entity_id']    
                                                = 'entity_id_' . $entity['id'];
                                        $location['location'][$i]['size']       
                                                        = 8;
                                        
$location['location'][$i]['lookup_function_call']                               
= 'lookup_entity_' . $entity['id'] .'()';
                                        
$location['location'][$i]['lookup_link']                                        
        = True;
                                        $location['location'][$i]['name']       
                                                        = $entity['name'];
!                                       $location['location'][$i]['value']      
                                                        = 
$data['values']['entity_' . $entity['id']];
                                        $location['location'][$i]['statustext'] 
                                                = lang('Klick this link to 
select') .' ' . $entity['name'];
  
--- 451,463 ----
  
                                        $location['location'][$i]['input_type'] 
                                                = 'text';
!                                       $location['location'][$i]['input_name'] 
                                                = 'entity_num_' . $entity['id'];
!                                       $input_name[]                           
                                                                        = 
'entity_num_' . $entity['id'];
!                                       $insert_record['extra']['entity_num_' . 
$entity['id']]                  = 'p_num';
! 
                                        $location['location'][$i]['size']       
                                                        = 8;
                                        
$location['location'][$i]['lookup_function_call']                               
= 'lookup_entity_' . $entity['id'] .'()';
                                        
$location['location'][$i]['lookup_link']                                        
        = True;
                                        $location['location'][$i]['name']       
                                                        = $entity['name'];
!                                       $location['location'][$i]['value']      
                                                        = 
$data['entity_data'][$entity['id']]['p_num'];
                                        $location['location'][$i]['statustext'] 
                                                = lang('Klick this link to 
select') .' ' . $entity['name'];
  
***************
*** 467,476 ****
                                        
$location['location'][$i]['extra'][0]['size']                                   
= 30;
                                        
$location['location'][$i]['extra'][0]['lookup_function_call']   = 
'lookup_entity_' . $entity['id'] .'()';
!                                       
$location['location'][$i]['extra'][0]['value']                                  
= $data['values']['entity_category' . $entity['id']];
                                        $i++;
                                }
                        }
  
! //_debug_array($insert_record);
  
                        
$GLOBALS['phpgw']->session->appsession('lookup_fields',$this->currentapp,$input_name);
--- 467,489 ----
                                        
$location['location'][$i]['extra'][0]['size']                                   
= 30;
                                        
$location['location'][$i]['extra'][0]['lookup_function_call']   = 
'lookup_entity_' . $entity['id'] .'()';
!                                       
$location['location'][$i]['extra'][0]['value']                                  
= $data['entity_data'][$entity['id']]['p_cat_name'];
! 
!                                       
$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'];
!                                       $insert_record['extra']['entity_id_' . 
$entity['id']]                   = 'p_entity_id';
!                                       
$location['location'][$i]['extra'][1]['value']                                  
= $data['entity_data'][$entity['id']]['p_entity_id'];
! 
!                                       
$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'];
!                                       $insert_record['extra']['cat_id_' . 
$entity['id']]                              = 'p_cat_id';
!                                       
$location['location'][$i]['extra'][2]['value']                                  
= $data['entity_data'][$entity['id']]['p_cat_id'];
! 
                                        $i++;
                                }
                        }
  
! //_debug_array($location['location']);
  
                        
$GLOBALS['phpgw']->session->appsession('lookup_fields',$this->currentapp,$input_name);

Index: class.soadmin_entity.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.soadmin_entity.inc.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** class.soadmin_entity.inc.php        3 Nov 2003 18:01:12 -0000       1.10
--- class.soadmin_entity.inc.php        5 Nov 2003 21:15:47 -0000       1.11
***************
*** 407,410 ****
--- 407,413 ----
                        $fd['id'] = array('type' => 'int', 'precision' => 4, 
'nullable' => False);
                        $fd['num'] = array('type' => 'varchar', 'precision' => 
16, 'nullable' => False);
+                       $fd['p_num'] = array('type' => 'varchar', 'precision' 
=> 16, 'nullable' => True);
+                       $fd['p_entity_id'] = array('type' => 'int', 'precision' 
=> 4, 'nullable' => True);
+                       $fd['p_cat_id'] = array('type' => 'int', 'precision' => 
4, 'nullable' => True);
                        $fd['location_code'] = array('type' => 'varchar', 
'precision' => 25, 'nullable' => True);
                        $fd['vendor_id'] = array('type' => 'int', 'precision' 
=> 4, 'nullable' => True);

Index: class.boentity.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.boentity.inc.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** class.boentity.inc.php      3 Nov 2003 18:01:11 -0000       1.7
--- class.boentity.inc.php      5 Nov 2003 21:15:47 -0000       1.8
***************
*** 147,156 ****
  
                        $columns = 
$soadmin_entity->read_attrib(array('entity_id'=>$entity_id,'cat_id'=>$cat_id,'allrows'=>$allrows));
- //_debug_array($columns);
  
                        
$column_list=$this->bocommon->select_multi_list($selected,$columns);
  
                        return $column_list;
- 
                }
  
--- 147,154 ----
***************
*** 278,281 ****
--- 276,282 ----
                function read_single($data)
                {
+                       $soadmin_entity = 
CreateObject($this->currentapp.'.soadmin_entity');
+                       $contacts                       = 
CreateObject('phpgwapi.contacts');
+ 
                        $entity = $this->so->read_single($data);
                        $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
***************
*** 288,293 ****
                        }
  
!                       $soadmin_entity = 
CreateObject($this->currentapp.'.soadmin_entity');
!                       $contacts                       = 
CreateObject('phpgwapi.contacts');
  
                        $input_type_array = array(
--- 289,302 ----
                        }
  
!                       if($entity['p_num'])
!                       {
!                               $category = 
$soadmin_entity->read_single_category($entity['p_entity_id'],$entity['p_cat_id']);
! 
!                               
$entity['p'][$entity['p_entity_id']]['p_num']=$entity['p_num'];
!                               
$entity['p'][$entity['p_entity_id']]['p_entity_id']=$entity['p_entity_id'];
!                               
$entity['p'][$entity['p_entity_id']]['p_cat_id']=$entity['p_cat_id'];
!                               
$entity['p'][$entity['p_entity_id']]['p_cat_name'] = $category['name'];
!                       }
! 
  
                        $input_type_array = array(

Index: class.uimeter.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uimeter.inc.php,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** class.uimeter.inc.php       28 Oct 2003 15:14:42 -0000      1.17
--- class.uimeter.inc.php       5 Nov 2003 21:15:49 -0000       1.18
***************
*** 38,42 ****
                        $this->bocommon                         = 
CreateObject($this->currentapp.'.bocommon');
                        $this->menu                                     = 
CreateObject($this->currentapp.'.menu');
-                       $this->bolocation                       = 
CreateObject($this->currentapp.'.bolocation');
  
                        $this->acl2                             = 
CreateObject($this->currentapp.'.acl2');
--- 38,41 ----
***************
*** 90,147 ****
  //_debug_array($uicols);
  
                        $j=0;
!                       while (is_array($meter_list) && list(,$meter_entry) = 
each($meter_list))
                        {
!                               for ($k=0;$k<count($uicols['name']);$k++)
                                {
!                                       if($uicols['input_type'][$k]!='hidden')
                                        {
! 
!                                               
if($meter_entry['query_location'][$uicols['name'][$k]])
!                                               {
!                                                       
$content[$j]['row'][$k]['statustext']                   = lang('search');
!                                                       
$content[$j]['row'][$k]['text']                                 = 
$meter_entry[$uicols['name'][$k]];
!                                                       
$content[$j]['row'][$k]['link']                         = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uimeter.index&query='
 . $meter_entry['query_location'][$uicols['name'][$k]] . '&lookup=' . $lookup);
!                                               }
!                                               else
                                                {
-                                                       
$content[$j]['row'][$k]['value']                        = 
$meter_entry[$uicols['name'][$k]];
-                                                       
$content[$j]['row'][$k]['name']                         = $uicols['name'][$k];
-                                               }
  
                                        }
-                               }
  
!                               if(!$lookup)
!                               {
!                                       if($this->acl_read)
                                        {
!                                               
$content[$j]['row'][$k]['statustext']                   = lang('view the 
meter');
!                                               $content[$j]['row'][$k]['text'] 
                                = lang('view');
!                                               $content[$j]['row'][$k]['link'] 
                                = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uimeter.view&id='
 . $meter_entry['meter_id']);
!                                               $k++;
!                                       }
  
!                                       if($this->acl_edit)
!                                       {
!                                               
$content[$j]['row'][$k]['statustext']                   = lang('edit the 
meter');
!                                               $content[$j]['row'][$k]['text'] 
                                = lang('edit');
!                                               $content[$j]['row'][$k]['link'] 
                                = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uimeter.edit&id='
 . $meter_entry['meter_id']);
!                                               $k++;
!                                       }
  
!                                       if($this->acl_delete)
!                                       {
!                                               
$content[$j]['row'][$k]['statustext']                   = lang('delete the 
meter');
!                                               $content[$j]['row'][$k]['text'] 
                                = lang('delete');
!                                               $content[$j]['row'][$k]['link'] 
                                = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uimeter.delete&id='
 . $meter_entry['meter_id']);
!                                               $k++;
                                        }
                                }
- 
-                               $j++;
                        }
  
!                       for ($i=0;$i<count($uicols['descr']);$i++)
                        {
                                if($uicols['input_type'][$i]!='hidden')
--- 89,149 ----
  //_debug_array($uicols);
  
+                       $m      = count($uicols['name']);
                        $j=0;
!                       if (isset($meter_list) AND is_array($meter_list))
                        {
!                               foreach($meter_list as $meter_entry)
                                {
!                                       for ($k=0;$k<$m;$k++)
                                        {
!                                               
if($uicols['input_type'][$k]!='hidden')
                                                {
  
+                                                       
if($meter_entry['query_location'][$uicols['name'][$k]])
+                                                       {
+                                                               
$content[$j]['row'][$k]['statustext']                   = lang('search');
+                                                               
$content[$j]['row'][$k]['text']                                 = 
$meter_entry[$uicols['name'][$k]];
+                                                               
$content[$j]['row'][$k]['link']                         = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uimeter.index&query='
 . $meter_entry['query_location'][$uicols['name'][$k]] . '&lookup=' . $lookup);
+                                                       }
+                                                       else
+                                                       {
+                                                               
$content[$j]['row'][$k]['value']                        = 
$meter_entry[$uicols['name'][$k]];
+                                                               
$content[$j]['row'][$k]['name']                         = $uicols['name'][$k];
+                                                       }
+                                               }
                                        }
  
!                                       if(!$lookup)
                                        {
!                                               if($this->acl_read)
!                                               {
!                                                       
$content[$j]['row'][$k]['statustext']                   = lang('view the 
meter');
!                                                       
$content[$j]['row'][$k]['text']                                 = lang('view');
!                                                       
$content[$j]['row'][$k]['link']                                 = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uimeter.view&id='
 . $meter_entry['meter_id']);
!                                                       $k++;
!                                               }
  
!                                               if($this->acl_edit)
!                                               {
!                                                       
$content[$j]['row'][$k]['statustext']                   = lang('edit the 
meter');
!                                                       
$content[$j]['row'][$k]['text']                                 = lang('edit');
!                                                       
$content[$j]['row'][$k]['link']                                 = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uimeter.edit&id='
 . $meter_entry['meter_id']);
!                                                       $k++;
!                                               }
  
!                                               if($this->acl_delete)
!                                               {
!                                                       
$content[$j]['row'][$k]['statustext']                   = lang('delete the 
meter');
!                                                       
$content[$j]['row'][$k]['text']                                 = 
lang('delete');
!                                                       
$content[$j]['row'][$k]['link']                                 = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uimeter.delete&id='
 . $meter_entry['meter_id']);
!                                                       $k++;
!                                               }
                                        }
+                                       $j++;
                                }
                        }
  
!                       $m      = count($uicols['descr']);
!                       for ($i=0;$i<$m;$i++)
                        {
                                if($uicols['input_type'][$i]!='hidden')
***************
*** 297,300 ****
--- 299,304 ----
                        }
  
+                       $bolocation                     = 
CreateObject($this->currentapp.'.bolocation');
+ 
                        $id                                     = 
get_var('id',array('POST','GET'));
                        $values                         = 
get_var('values',array('POST'));
***************
*** 370,374 ****
                                        {
                                                $location_code=implode("-", 
$values['location']);
!                                               $values['location_data'] = 
$this->bolocation->read_single($location_code,$values['extra']);
                                        }
                                }
--- 374,378 ----
                                        {
                                                $location_code=implode("-", 
$values['location']);
!                                               $values['location_data'] = 
$bolocation->read_single($location_code,$values['extra']);
                                        }
                                }
***************
*** 399,403 ****
                        );
  
!                       
$location_data=$this->bolocation->initiate_ui_location(array(
                                                'values'                => 
$values['location_data'],
                                                'type_id'               => -1, 
// calculated from location_types
--- 403,407 ----
                        );
  
!                       $location_data=$bolocation->initiate_ui_location(array(
                                                'values'                => 
$values['location_data'],
                                                'type_id'               => -1, 
// calculated from location_types
***************
*** 492,495 ****
--- 496,500 ----
                        }
  
+                       $bolocation                     = 
CreateObject($this->currentapp.'.bolocation');
                        $id                                     = 
get_var('id',array('POST','GET'));
  
***************
*** 511,515 ****
                        );
  
!                       
$location_data=$this->bolocation->initiate_ui_location(array(
                                                'values'                => 
$values['location_data'],
                                                'type_id'               => 
count(explode('-',$values['location_data']['location_code'])),
--- 516,520 ----
                        );
  
!                       $location_data=$bolocation->initiate_ui_location(array(
                                                'values'                => 
$values['location_data'],
                                                'type_id'               => 
count(explode('-',$values['location_data']['location_code'])),

Index: class.soentity.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.soentity.inc.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** class.soentity.inc.php      3 Nov 2003 18:01:10 -0000       1.10
--- class.soentity.inc.php      5 Nov 2003 21:15:46 -0000       1.11
***************
*** 111,116 ****
                                if($lookup)
                                {
!                                       $cols .= ',num as entity_id_' . 
$entity_id;
!                                       $cols_return[] = 'entity_id_' . 
$entity_id;
                                }
  
--- 111,116 ----
                                if($lookup)
                                {
!                                       $cols .= ',num as entity_num_' . 
$entity_id;
!                                       $cols_return[] = 'entity_num_' . 
$entity_id;
                                }
  
***************
*** 154,157 ****
--- 154,158 ----
                                if (isset($user_columns) AND 
is_array($user_columns) AND $user_columns[0])
                                {
+                                       $i      = count($uicols['name']);
                                        foreach($user_columns as $column_id)
                                        {
***************
*** 163,166 ****
--- 164,168 ----
                                                $uicols['descr'][]              
        = $this->db->f('input_text');
                                                $uicols['statustext'][]         
= $this->db->f('statustext');
+                                               $uicols['datatype'][$i]         
= $this->db->f('datatype');
                                                $cols_return_extra[]= array(
                                                        'name'  => 
$this->db->f('column_name'),
***************
*** 168,171 ****
--- 170,174 ----
                                                        'attrib_id'     => 
$this->db->f('id')
                                                );
+                                               $i++;
                                        }
                                }
***************
*** 181,185 ****
                        if ($order)
                        {
!                               $ordermethod = " order by $order $sort";
                        }
                        else
--- 184,188 ----
                        if ($order)
                        {
!                               $ordermethod = " order by $entity_table.$order 
$sort";
                        }
                        else
***************
*** 255,259 ****
                                        $entity_list[$j][$cols_return[$i]] = 
$this->db->f($cols_return[$i]);
                                        $entity_list[$j]['grants'] = 
(int)$grants[$this->db->f('user_id')];
!                                       $entity_list[$j]['entity_cat_name_' . 
$entity_id] = $category['name'];
                                }
  
--- 258,267 ----
                                        $entity_list[$j][$cols_return[$i]] = 
$this->db->f($cols_return[$i]);
                                        $entity_list[$j]['grants'] = 
(int)$grants[$this->db->f('user_id')];
!                                       if($lookup)
!                                       {
!                                               
$entity_list[$j]['entity_cat_name_' . $entity_id] = $category['name'];
!                                               $entity_list[$j]['entity_id_' . 
$entity_id] = $entity_id;
!                                               $entity_list[$j]['cat_id_' . 
$entity_id] = $cat_id;
!                                       }
                                }
  
***************
*** 355,358 ****
--- 363,369 ----
                                        $entity['id']                           
= $id;
                                        $entity['num']                          
= $this->db->f('num');
+                                       $entity['p_num']                = 
$this->db->f('p_num');
+                                       $entity['p_entity_id']= 
$this->db->f('p_entity_id');
+                                       $entity['p_cat_id']     = 
$this->db->f('p_cat_id');
                                        $entity['location_code']        = 
$this->db->f('location_code');
                                        $entity['vendor_id']            = 
$this->db->f('vendor_id');
***************
*** 439,443 ****
                                }
                        }
! 
                        while (is_array($values['extra']) && 
list($input_name,$value) = each($values['extra']))
                        {
--- 450,454 ----
                                }
                        }
! //_debug_array($values);
                        while (is_array($values['extra']) && 
list($input_name,$value) = each($values['extra']))
                        {
***************
*** 469,472 ****
--- 480,484 ----
                        $table='fm_entity_' . $entity_id .'_' . $cat_id;
                        
$num=$this->generate_num($entity_id,$cat_id,$values['id']);
+                       $this->db->transaction_begin();
  
                        $this->db->query("INSERT INTO $table 
(id,num,address,location_code,vendor_id,entry_date,user_id $cols) "
***************
*** 480,483 ****
--- 492,497 ----
                                . $this->account. " $vals)",__LINE__,__FILE__);
  
+                       $this->db->transaction_commit();
+ 
                        $receipt['message'][] = array('msg'=>lang('Entity %1 
has been saved',$values['id']));
                        return $receipt;
***************
*** 486,489 ****
--- 500,505 ----
                function edit($values,$values_attribute,$entity_id,$cat_id)
                {
+ 
+ //_debug_array($values);
                        if($values['street_name'])
                        {
***************
*** 532,536 ****
--- 548,556 ----
                        $table='fm_entity_' . $entity_id .'_' . $cat_id;
  
+                       $this->db->transaction_begin();
+ 
                        $this->db->query("UPDATE $table set $value_set WHERE 
id=" . $values['id'],__LINE__,__FILE__);
+ 
+                       $this->db->transaction_commit();
  
                        $receipt['message'][] = array('msg'=>lang('entity %1 
has been edited',$values['num']));

Index: class.bometer.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.bometer.inc.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** class.bometer.inc.php       25 Jun 2003 18:27:49 -0000      1.6
--- class.bometer.inc.php       5 Nov 2003 21:15:49 -0000       1.7
***************
*** 48,52 ****
                        $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->so               = 
CreateObject($this->currentapp.'.someter');
-                       $this->solocation = 
CreateObject($this->currentapp.'.solocation');
                        $this->bocommon = 
CreateObject($this->currentapp.'.bocommon');
  
--- 48,51 ----
***************
*** 162,169 ****
                        $this->total_records = $this->so->total_records;
  
-                       $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
- 
                        $this->uicols   = $this->so->uicols;
!                       $cols_extra             = $this->so->cols_extra;
  
                        for ($i=0; $i<count($meter); $i++)
--- 161,168 ----
                        $this->total_records = $this->so->total_records;
  
                        $this->uicols   = $this->so->uicols;
! /*                    $cols_extra             = $this->so->cols_extra;
!                       $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
!                       $solocation = 
CreateObject($this->currentapp.'.solocation');
  
                        for ($i=0; $i<count($meter); $i++)
***************
*** 171,175 ****
                                $meter[$i]['user']              = 
$GLOBALS['phpgw']->accounts->id2name($meter[$i]['user_id']);
                                $meter[$i]['entry_date'] = 
$GLOBALS['phpgw']->common->show_date($meter[$i]['entry_date'],$dateformat);
!                               
$location_data=$this->solocation->read_single($meter[$i]['location_code']);
  
                                for ($j=0;$j<count($cols_extra);$j++)
--- 170,174 ----
                                $meter[$i]['user']              = 
$GLOBALS['phpgw']->accounts->id2name($meter[$i]['user_id']);
                                $meter[$i]['entry_date'] = 
$GLOBALS['phpgw']->common->show_date($meter[$i]['entry_date'],$dateformat);
!                               
$location_data=$solocation->read_single($meter[$i]['location_code']);
  
                                for ($j=0;$j<count($cols_extra);$j++)
***************
*** 177,182 ****
                                        $meter[$i][$cols_extra[$j]] = 
$location_data[$cols_extra[$j]];
                                }
-                       }
  
                        return $meter;
                }
--- 176,182 ----
                                        $meter[$i][$cols_extra[$j]] = 
$location_data[$cols_extra[$j]];
                                }
  
+                       }
+ */
                        return $meter;
                }
***************
*** 188,192 ****
                        if($meter['location_code'])
                        {
!                               $meter['location_data'] 
=$this->solocation->read_single($meter['location_code']);
                        }
  
--- 188,194 ----
                        if($meter['location_code'])
                        {
!                               $solocation = 
CreateObject($this->currentapp.'.solocation');
! 
!                               $meter['location_data'] 
=$solocation->read_single($meter['location_code']);
                        }
  

Index: class.menu.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.menu.inc.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** class.menu.inc.php  28 Oct 2003 15:14:42 -0000      1.1
--- class.menu.inc.php  5 Nov 2003 21:15:49 -0000       1.2
***************
*** 38,44 ****
                                $menu['module'][$i]['statustext']       = 
lang('Property');
                                $i++;
!                               $menu['module'][$i]['link']             = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uiequipment.index');
!                               $menu['module'][$i]['name']             = 
lang('Equipment');
!                               $menu['module'][$i]['statustext']       = 
lang('Equipment');
  
                                $i++;
--- 38,44 ----
                                $menu['module'][$i]['statustext']       = 
lang('Property');
                                $i++;
!                               $menu['module'][$i]['link']             = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uimeter.index');
!                               $menu['module'][$i]['name']             = 
lang('Meter');
!                               $menu['module'][$i]['statustext']       = 
lang('Meter');
  
                                $i++;
***************
*** 81,103 ****
                                }
  
-                               $i=0;
- 
-                               $entity_id = 
$GLOBALS['phpgw']->session->appsession('entity_id',$currentapp);
-                               if ($sub == 'entity_'.$entity_id)
-                               {
-                                       $entity_category        = 
$entity->read_category(array('allrows'=>True,'entity_id'=>$entity_id));
-                                       $k=count($entity_category);
-                                       for ($j=0; $j<$k; $j++)
-                                       {
-                                               $i++;
-                                               $menu['sub_menu'][$i]['link'] = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uientity.index&entity_id='
 .$entity_id .'&cat_id=' .$entity_category[$j]['id'] );
-                                               $menu['sub_menu'][$i]['name'] = 
$entity_category[$j]['name'];
-                                               
$menu['sub_menu'][$i]['statustext'] = $entity_category[$j]['descr'];
-                                       }
- 
-                               }
                                unset($entity);
  
!                               if ($sub == 'equipment')
                                {
                                        $menu['sub_menu'][$i]['link']           
        =       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uiequipment.index');
--- 81,87 ----
                                }
  
                                unset($entity);
  
! /*                            if ($sub == 'equipment')
                                {
                                        $menu['sub_menu'][$i]['link']           
        =       
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uiequipment.index');
***************
*** 118,121 ****
--- 102,106 ----
                                }
  
+ */
                                if ($sub == 'location')
                                {

Index: class.uientity.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uientity.inc.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** class.uientity.inc.php      3 Nov 2003 18:01:11 -0000       1.9
--- class.uientity.inc.php      5 Nov 2003 21:15:47 -0000       1.10
***************
*** 251,256 ****
                        }
  
- //_debug_array($content);
- 
                        for ($i=0;$i<count($uicols['descr']);$i++)
                        {
--- 251,254 ----
***************
*** 260,330 ****
                                        $table_header[$i]['width']              
= '5%';
                                        $table_header[$i]['align']              
= 'center';
!                                       if($uicols['name'][$i]=='loc1')
!                                       {
!                                               $table_header[$i]['sort_link']  
=true;
!                                               $table_header[$i]['sort']       
        = $this->nextmatchs->show_sort_order(array
!                                                                               
(
!                                                                               
        'sort'  => $this->sort,
!                                                                               
        'var'   =>      'location_code',
!                                                                               
        'order' =>      $this->order,
!                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uientity.index',
!                                                                               
                                                        'type_id'       
=>$type_id,
!                                                                               
                                                        'query'         
=>$this->query,
!                                                                               
                                                        'lookup'        
=>$lookup,
!                                                                               
                                                        'district_id'   => 
$this->district_id,
!                                                                               
                                                        'entity_id'             
=>$this->entity_id,
!                                                                               
                                                        'cat_id'        
=>$this->cat_id)
!                                                                               
));
!                                       }
!                                       if($uicols['name'][$i]=='num')
!                                       {
!                                               $table_header[$i]['sort_link']  
=true;
!                                               $table_header[$i]['sort']       
        = $this->nextmatchs->show_sort_order(array
!                                                                               
(
!                                                                               
        'sort'  => $this->sort,
!                                                                               
        'var'   =>      'id',
!                                                                               
        'order' =>      $this->order,
!                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uientity.index',
!                                                                               
                                                        'type_id'       
=>$type_id,
!                                                                               
                                                        'query'         
=>$this->query,
!                                                                               
                                                        'lookup'        
=>$lookup,
!                                                                               
                                                        'district_id'   => 
$this->district_id,
!                                                                               
                                                        'entity_id'             
=>$this->entity_id,
!                                                                               
                                                        'cat_id'        
=>$this->cat_id)
!                                                                               
));
!                                       }
!                                       if($uicols['name'][$i]=='address')
!                                       {
!                                               $table_header[$i]['sort_link']  
=true;
!                                               $table_header[$i]['sort']       
        = $this->nextmatchs->show_sort_order(array
!                                                                               
(
!                                                                               
        'sort'  => $this->sort,
!                                                                               
        'var'   =>      'address',
!                                                                               
        'order' =>      $this->order,
!                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uientity.index',
!                                                                               
                                                        'type_id'       
=>$type_id,
!                                                                               
                                                        'query'         
=>$this->query,
!                                                                               
                                                        'lookup'        
=>$lookup,
!                                                                               
                                                        'district_id'   => 
$this->district_id,
!                                                                               
                                                        'entity_id'             
=>$this->entity_id,
!                                                                               
                                                        'cat_id'        
=>$this->cat_id)
!                                                                               
));
!                                       }
!                                       if($uicols['name'][$i]=='status')
                                        {
                                                $table_header[$i]['sort_link']  
=true;
                                                $table_header[$i]['sort']       
        = $this->nextmatchs->show_sort_order(array
!                                                                               
(
!                                                                               
        'sort'  => $this->sort,
!                                                                               
        'var'   =>      'status',
!                                                                               
        'order' =>      $this->order,
!                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uientity.index',
!                                                                               
                                                        'type_id'       
=>$type_id,
!                                                                               
                                                        'query'         
=>$this->query,
!                                                                               
                                                        'lookup'        
=>$lookup,
!                                                                               
                                                        'district_id'   => 
$this->district_id,
!                                                                               
                                                        'entity_id'             
=>$this->entity_id,
!                                                                               
                                                        'cat_id'        
=>$this->cat_id)
!                                                                               
));
                                        }
                                }
--- 258,277 ----
                                        $table_header[$i]['width']              
= '5%';
                                        $table_header[$i]['align']              
= 'center';
!                                       if($uicols['datatype'][$i]!='T')
                                        {
                                                $table_header[$i]['sort_link']  
=true;
                                                $table_header[$i]['sort']       
        = $this->nextmatchs->show_sort_order(array
!                                                       (
!                                                               'sort'  => 
$this->sort,
!                                                               'var'   =>      
$uicols['name'][$i],
!                                                               'order' =>      
$this->order,
!                                                               'extra'         
=> array('menuaction'   => $this->currentapp.'.uientity.index',
!                                                                               
                        'type_id'       =>$type_id,
!                                                                               
                        'query'         =>$this->query,
!                                                                               
                        'lookup'        =>$lookup,
!                                                                               
                        'district_id'   => $this->district_id,
!                                                                               
                        'entity_id'             =>$this->entity_id,
!                                                                               
                        'cat_id'        =>$this->cat_id)
!                                                       ));
                                        }
                                }
***************
*** 422,425 ****
--- 369,377 ----
                                'select_action'                                 
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
  
+                               'lang_no_cat'                                   
=> lang('no category'),
+                               'lang_cat_statustext'                   => 
lang('Select the category the building belongs to. To do not use a category 
select NO CATEGORY'),
+                               'select_name'                                   
=> 'cat_id',
+                               'cat_list'                                      
        => $this->bo->select_category_list('filter',$this->cat_id),
+ 
                                'lang_status_statustext'                => 
lang('Select the status. To do not use a category select NO STATUS'),
                                'status_name'                                   
=> 'status',
***************
*** 459,467 ****
                                $msgbox_data = 
$this->bocommon->msgbox_data($receipt);
  
-                               $data = array
-                               (
-                                       'msgbox_data'                           
        => $GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                                       'links'                                 
                => $links
-                               );
                                $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname;
                                
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('empty' => $data));
--- 411,414 ----
***************
*** 490,496 ****
                        $insert_record_entity = 
$GLOBALS['phpgw']->session->appsession('insert_record_entity',$this->currentapp);
  
                        for ($j=0;$j<count($insert_record_entity);$j++)
                        {
!                               
$insert_record['extra'][$insert_record_entity[$j]]      = True;
                        }
  
--- 437,446 ----
                        $insert_record_entity = 
$GLOBALS['phpgw']->session->appsession('insert_record_entity',$this->currentapp);
  
+ //_debug_array($insert_record);
+ //_debug_array($insert_record_entity);
+ 
                        for ($j=0;$j<count($insert_record_entity);$j++)
                        {
!                               
$insert_record['extra'][$insert_record_entity[$j]]      = 
$insert_record_entity[$j];
                        }
  
***************
*** 512,520 ****
                                }
  
!                               while (is_array($insert_record['extra']) && 
list($key,) = each($insert_record['extra']))
                                {
                                        if($_POST[$key])
                                        {
!                                               $values['extra'][$key]  = 
$_POST[$key];
                                        }
                                }
--- 462,474 ----
                                }
  
! //_debug_array($_POST);
! //_debug_array($insert_record['extra']);
!                               while (is_array($insert_record['extra']) && 
list($key,$column) = each($insert_record['extra']))
                                {
+ //_debug_array($key);
+ 
                                        if($_POST[$key])
                                        {
!                                               $values['extra'][$column]       
= $_POST[$key];
                                        }
                                }
***************
*** 598,606 ****
                        }
  
!                       for ($i=0;$i<count($entity['lookup_entity']);$i++)
!                       {
!                               $lookup_entity[$i]['id'] = 
$entity['lookup_entity'][$i];
!                               $entity_lookup = 
$this->boadmin_entity->read_single($entity['lookup_entity'][$i],false);
!                               $lookup_entity[$i]['name'] = 
$entity_lookup['name'];
                        }
  
--- 552,562 ----
                        }
  
!                       if (isset($entity['lookup_entity']) && 
is_array($entity['lookup_entity']))
!                       {       for 
($i=0;$i<count($entity['lookup_entity']);$i++)
!                               {
!                                       $lookup_entity[$i]['id'] = 
$entity['lookup_entity'][$i];
!                                       $entity_lookup = 
$this->boadmin_entity->read_single($entity['lookup_entity'][$i],false);
!                                       $lookup_entity[$i]['name'] = 
$entity_lookup['name'];
!                               }
                        }
  
***************
*** 612,616 ****
                                                'no_link'               => 
False, // disable lookup links for location type less than type_id
                                                'lookup_type'   => $lookup_type,
!                                               'lookup_entity' => 
$lookup_entity
                                                ));
                        }
--- 568,573 ----
                                                'no_link'               => 
False, // disable lookup links for location type less than type_id
                                                'lookup_type'   => $lookup_type,
!                                               'lookup_entity' => 
$lookup_entity,
!                                               'entity_data'   => $values['p']
                                                ));
                        }

Index: class.someter.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.someter.inc.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** class.someter.inc.php       27 Aug 2003 16:35:12 -0000      1.9
--- class.someter.inc.php       5 Nov 2003 21:15:49 -0000       1.10
***************
*** 17,25 ****
                        $this->account  = 
$GLOBALS['phpgw_info']['user']['account_id'];
                        $this->bocommon         = 
CreateObject($this->currentapp.'.bocommon');
!                       $this->socommon         = 
CreateObject($this->currentapp.'.socommon');
! 
!                       $this->join                     = $this->socommon->join;
! 
! 
                }
  
--- 17,21 ----
                        $this->account  = 
$GLOBALS['phpgw_info']['user']['account_id'];
                        $this->bocommon         = 
CreateObject($this->currentapp.'.bocommon');
!                       $this->join                     = $this->bocommon->join;
                }
  





reply via email to

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