phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: property/inc class.uiproject.inc.php,1.28,1.29 c


From: Sigurd Nes <address@hidden>
Subject: [Phpgroupware-cvs] CVS: property/inc class.uiproject.inc.php,1.28,1.29 class.uilookup.inc.php,1.23,1.24class.uiinvestment.inc.php,1.20,1.21 class.solocation.inc.php,1.12,1.13 class.botts.inc.php,1.12,1.13 class.boproject.inc.php,1.8,1.9 class.bolocation.inc.php,1.13,1.14 class.boinvestment.inc.php,1.9,1.10
Date: Sat, 21 Jun 2003 18:32:33 -0400

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

Modified Files:
        class.uiproject.inc.php class.uilookup.inc.php 
        class.uiinvestment.inc.php class.solocation.inc.php 
        class.botts.inc.php class.boproject.inc.php 
        class.bolocation.inc.php class.boinvestment.inc.php 
Log Message:
no message

Index: class.uiproject.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uiproject.inc.php,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -r1.28 -r1.29
*** class.uiproject.inc.php     21 Jun 2003 19:27:35 -0000      1.28
--- class.uiproject.inc.php     21 Jun 2003 22:32:31 -0000      1.29
***************
*** 337,345 ****
                        }
  
!                       if($values && !$bypass)
                        {
                                for ($i=0; 
$i<count($insert_record['location']); $i++)
                                {
!                                       
$values['location'][$insert_record['location'][$i]]= 
$_POST[$insert_record['location'][$i]];
                                }
  
--- 337,348 ----
                        }
  
!                       if($_POST && !$bypass)
                        {
                                for ($i=0; 
$i<count($insert_record['location']); $i++)
                                {
!                                       
if($_POST[$insert_record['location'][$i]])
!                                       {
!                                               
$values['location'][$insert_record['location'][$i]]= 
$_POST[$insert_record['location'][$i]];
!                                       }
                                }
  
***************
*** 376,382 ****
                                if($location_code)
                                {
!                                       
$location_data=$this->bocommon->read_location_data($location_code);
! 
!                                       $values=$values + $location_data;
                                }
  
--- 379,383 ----
                                if($location_code)
                                {
!                                       $values['location_data'] = 
$this->bolocation->read_single($location_code);
                                }
  
***************
*** 461,474 ****
                                                endif;
                                        }
!                                       else
                                        {
!                                               if($values['location'])
!                                               {
!                                                       
$location_code=implode("-", $values['location']);
!                                                       
$values['location_data'] = $this->bolocation->read_single($location_code);
!                                               }
!                                       }
! 
  
                                }
                        }
--- 462,474 ----
                                                endif;
                                        }
!                               }
!                               else
!                               {
!                                       if($values['location'])
                                        {
!                                               $location_code=implode("-", 
$values['location']);
!                                               $values['location_data'] = 
$this->bolocation->read_single($location_code,$values['extra']);
  
+                                       }
                                }
                        }

Index: class.uilookup.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uilookup.inc.php,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -r1.23 -r1.24
*** class.uilookup.inc.php      19 Jun 2003 20:03:09 -0000      1.23
--- class.uilookup.inc.php      21 Jun 2003 22:32:31 -0000      1.24
***************
*** 760,768 ****
                                                                                
'search_field'));
  
- 
- //                    $location_types = 
$this->soadmin_location->select_location_type();
- //_debug_array($location_types);
- //                    $location_type = 
get_var('location_type',array('POST','GET'));
- 
                        $equipment_list = $this->boequipment->read();
  
--- 760,763 ----

Index: class.uiinvestment.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uiinvestment.inc.php,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -r1.20 -r1.21
*** class.uiinvestment.inc.php  12 Jun 2003 20:51:13 -0000      1.20
--- class.uiinvestment.inc.php  21 Jun 2003 22:32:31 -0000      1.21
***************
*** 33,40 ****
                        $this->account                          = 
$GLOBALS['phpgw_info']['user']['account_id'];
  
-                       $this->grants                           = 
$GLOBALS['phpgw']->acl->get_grants($this->currentapp);
-                       $this->grants[$this->account] = PHPGW_ACL_READ + 
PHPGW_ACL_ADD + PHPGW_ACL_EDIT + PHPGW_ACL_DELETE;
                        $this->bo                                       = 
CreateObject($this->currentapp.'.boinvestment',True);
!                       $this->bocommon                                 = 
CreateObject($this->currentapp.'.bocommon');
                        $this->acl2                             = 
CreateObject($this->currentapp.'.acl2');
  
--- 33,39 ----
                        $this->account                          = 
$GLOBALS['phpgw_info']['user']['account_id'];
  
                        $this->bo                                       = 
CreateObject($this->currentapp.'.boinvestment',True);
!                       $this->bocommon                         = 
CreateObject($this->currentapp.'.bocommon');
!                       $this->bolocation                       = 
CreateObject($this->currentapp.'.bolocation');
                        $this->acl2                             = 
CreateObject($this->currentapp.'.acl2');
  
***************
*** 449,465 ****
                        $values['date']                 = 
get_var('date',array('POST'));
  
!                       if($values)
!                       {
!                               $values = $values + 
$this->bocommon->get_location();
!                       }
! 
!                       
$location_data=$this->bocommon->initiate_ui_location(array('equipment'          
=> True,
!                                                                               
                                                                'location_type' 
=> 'form',
!                                                                               
                                                                'tenant'        
        => False,
!                                                                               
                                                                'property_id'   
=> $values['property_id'],
!                                                                               
                                                                'building_id'   
=> $values['building_id'],
!                                                                               
                                                                'entrance_id'   
=> $values['entrance_id'],
!                                                                               
                                                                'apartment_id'  
=> $values['apartment_id'],
!                                                                               
                                                                'equipment_id'  
=> $values['equipment_id']));
  
                        
$GLOBALS['phpgw']->xslttpl->add_file(array('investment'));
--- 448,452 ----
                        $values['date']                 = 
get_var('date',array('POST'));
  
!                       $insert_record = 
$GLOBALS['phpgw']->session->appsession('insert_record',$this->currentapp);
  
                        
$GLOBALS['phpgw']->xslttpl->add_file(array('investment'));
***************
*** 467,470 ****
--- 454,475 ----
                        if ($values['save'])
                        {
+ 
+                               for ($i=0; 
$i<count($insert_record['location']); $i++)
+                               {
+                                       
if($_POST[$insert_record['location'][$i]])
+                                       {
+                                               
$values['location'][$insert_record['location'][$i]]= 
$_POST[$insert_record['location'][$i]];
+                                       }
+                               }
+ 
+                               while (is_array($insert_record['extra']) && 
list($key,) = each($insert_record['extra']))
+                               {
+                                       if($_POST[$key])
+                                       {
+                                               $values['extra'][$key]  = 
$_POST[$key];
+                                       }
+                               }
+ 
+ 
                                $errorcount = 0;
  
***************
*** 489,507 ****
                                }
  
!                               if(!$values['property_id'] && 
!$values['equipment_id'])
                                {
                                        
$receipt['error'][$errorcount++]=array('msg'=>lang('Pleace select a location - 
or an equipment !'));
                                }
  
! //_debug_array($values);
                                if(!$receipt['error'])
                                {
                                        
$receipt=$this->bo->save_investment($values);
                                        unset($values);
- 
-                               //      header('Location: '. 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiinvestment.index'));
                                }
! 
                        }
  
                        $link_data = array
--- 494,527 ----
                                }
  
!                               if(!$values['location']['loc1'] && 
!$values['extra']['equipment_id'])
                                {
                                        
$receipt['error'][$errorcount++]=array('msg'=>lang('Pleace select a location - 
or an equipment !'));
                                }
  
! //_debug_array($values['extra']);
                                if(!$receipt['error'])
                                {
                                        
$receipt=$this->bo->save_investment($values);
                                        unset($values);
                                }
!                               else
!                               {
!                                       if($values['location'])
!                                       {
!                                               $location_code=implode("-", 
$values['location']);
!                                               $values['location_data'] = 
$this->bolocation->read_single($location_code,$values['extra']);
!                                       }
!                               }
                        }
+ 
+ 
+                       
$location_data=$this->bolocation->initiate_ui_location(array(
+                                               'values'                => 
$values['location_data'],
+                                               'type_id'               => -1, 
// calculated from location_types
+                                               'no_link'               => 
False, // disable lookup links for location type less than type_id
+                                               'equipment'             => True,
+                                               'lookup_type'   => 'form'
+                                               ));
+ 
  
                        $link_data = array

Index: class.solocation.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.solocation.inc.php,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** class.solocation.inc.php    21 Jun 2003 19:27:35 -0000      1.12
--- class.solocation.inc.php    21 Jun 2003 22:32:31 -0000      1.13
***************
*** 548,551 ****
--- 548,557 ----
                }
  
+               function equipment_type($equipment_id)
+               {
+                       $this->db->query("SELECT fm_equipment_type.name FROM 
fm_equipment $this->join fm_equipment_type on fm_equipment.equipment_type_id= 
fm_equipment_type.id where equipment_id='$equipment_id'");
+                       $this->db->next_record();
+                       return $this->db->f('name');
+               }
  
                function add($location='',$type_id='')

Index: class.botts.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.botts.inc.php,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** class.botts.inc.php 19 Jun 2003 20:03:10 -0000      1.12
--- class.botts.inc.php 21 Jun 2003 22:32:31 -0000      1.13
***************
*** 50,53 ****
--- 50,54 ----
                        $this->socommon         = 
CreateObject($this->currentapp.'.socommon');
                        $this->bocommon         = 
CreateObject($this->currentapp.'.bocommon');
+                       $this->solocation       = 
CreateObject($this->currentapp.'.solocation');
                        $this->historylog       = 
CreateObject($this->currentapp.'.historylog','tts');
                        $this->send                     = 
CreateObject('phpgwapi.send');
***************
*** 366,372 ****
                        
$ticket['category_name']=ucfirst($this->cats->id2name($ticket['cat_id']));
  
!                       
$location_data=$this->socommon->read_location_data($ticket['location_code']);
! 
!                       $ticket=$ticket + $location_data;
  
                        return $ticket;
--- 367,374 ----
                        
$ticket['category_name']=ucfirst($this->cats->id2name($ticket['cat_id']));
  
!                       if($ticket['location_code'])
!                       {
!                               $ticket['location_data'] = 
$this->solocation->read_single($ticket['location_code']);
!                       }
  
                        return $ticket;

Index: class.boproject.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.boproject.inc.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** class.boproject.inc.php     20 Jun 2003 10:31:50 -0000      1.8
--- class.boproject.inc.php     21 Jun 2003 22:32:31 -0000      1.9
***************
*** 336,341 ****
                        if($project['location_code'])
                        {
!                               
$location_data=$this->solocation->read_single($project['location_code']);
!                               $project['location_data'] = $location_data;
                        }
  
--- 336,340 ----
                        if($project['location_code'])
                        {
!                               $project['location_data'] 
=$this->solocation->read_single($project['location_code']);
                        }
  

Index: class.bolocation.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.bolocation.inc.php,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** class.bolocation.inc.php    20 Jun 2003 10:31:50 -0000      1.13
--- class.bolocation.inc.php    21 Jun 2003 22:32:31 -0000      1.14
***************
*** 296,303 ****
                                                
$location['location'][$i]['input_type']                                         
        = 'hidden';
                                                
$location['location'][$i]['input_name']                                         
        = 'tenant_id';
                                                
$location['location'][$i]['value']                                              
                = $data['values'][$config[$j]['column_name']];
                                                
$location['location'][$i]['lookup_function_call']                               
= $lookup_functions[$m]['name'];
                                                
$location['location'][$i]['statustext']                                         
        = lang('tenant');
!                                               
$insert_record['extra']['tenant_id']                                            
                                = 'tenant_id';
  
                                                
$location['location'][$i]['extra'][0]['input_type']                             
= 'text';
--- 296,304 ----
                                                
$location['location'][$i]['input_type']                                         
        = 'hidden';
                                                
$location['location'][$i]['input_name']                                         
        = 'tenant_id';
+                                               $input_name[]                   
                                                                                
= $location['location'][$i]['input_name'];
                                                
$location['location'][$i]['value']                                              
                = $data['values'][$config[$j]['column_name']];
                                                
$location['location'][$i]['lookup_function_call']                               
= $lookup_functions[$m]['name'];
                                                
$location['location'][$i]['statustext']                                         
        = lang('tenant');
!                                               
$insert_record['extra']['tenant_id']                                            
        = 'tenant_id';
  
                                                
$location['location'][$i]['extra'][0]['input_type']                             
= 'text';
***************
*** 460,466 ****
                }
  
!               function read_single($location_code='')
                {
!                       return $this->so->read_single($location_code);
                }
  
--- 461,485 ----
                }
  
!               function read_single($location_code='',$extra='')
                {
!                       $location_data = $this->so->read_single($location_code);
! 
!                       if($extra['equipment_id'])
!                       {
!                               $location_data['equipment_type'] = 
$this->so->equipment_type($extra['equipment_id']);
!                               unset($location_data['tenant_id']);
!                               unset($location_data['last_name']);
!                               unset($location_data['first_name']);
!                               unset($location_data['contact_phone']);
! 
!                       }
! 
!                       if(is_array($extra))
!                       {
!                               $location_data = $location_data + $extra;
!                       }
! 
! 
!                       return $location_data;
                }
  

Index: class.boinvestment.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.boinvestment.inc.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** class.boinvestment.inc.php  23 May 2003 08:40:19 -0000      1.9
--- class.boinvestment.inc.php  21 Jun 2003 22:32:31 -0000      1.10
***************
*** 225,229 ****
                function save_investment($values)
                {
! //_debug_array($values);
                        
$date_array=$this->bocommon->date_array($values['date']);
  
--- 225,239 ----
                function save_investment($values)
                {
!                       while (is_array($values['location']) && list(,$value) = 
each($values['location']))
!                       {
!                               if($value)
!                               {
!                                       $location[] = $value;
!                               }
!                       }
! 
!                       $values['location_code']=implode("-", $location);
! 
! _debug_array($values);
                        
$date_array=$this->bocommon->date_array($values['date']);
  
***************
*** 244,252 ****
                        }
  
!                       
$values['location_code']=$this->bocommon->location_code($values['property_id'],$values['building_id'],$values['entrance_id'],$values['apartment_id']);
! 
!                       if($values['equipment_id'])
                        {
!                               $values['entity_id']    = 
$values['equipment_id'];
                                $values['entity_type']  ='equipment';
                        }
--- 254,260 ----
                        }
  
!                       if($values['extra']['equipment_id'])
                        {
!                               $values['entity_id']    = 
$values['extra']['equipment_id'];
                                $values['entity_type']  ='equipment';
                        }





reply via email to

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