phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: property/inc class.uigab.inc.php,1.6,1.7 class.s


From: Sigurd Nes <address@hidden>
Subject: [Phpgroupware-cvs] CVS: property/inc class.uigab.inc.php,1.6,1.7 class.sogab.inc.php,1.7,1.8 class.bogab.inc.php,1.5,1.6
Date: Fri, 27 Jun 2003 15:04:33 -0400

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

Modified Files:
        class.uigab.inc.php class.sogab.inc.php class.bogab.inc.php 
Log Message:
no message

Index: class.uigab.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uigab.inc.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** class.uigab.inc.php 27 Jun 2003 12:43:19 -0000      1.6
--- class.uigab.inc.php 27 Jun 2003 19:04:30 -0000      1.7
***************
*** 405,409 ****
                                        'lang_add'                              
=> lang('add'),
                                        'lang_add_statustext'   => lang('add a 
gab'),
!                                       'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uigab.edit')
  
                                );
--- 405,409 ----
                                        'lang_add'                              
=> lang('add'),
                                        'lang_add_statustext'   => lang('add a 
gab'),
!                                       'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uigab.edit&from=list_detail&gab_id='
 . $gab_id . '&new=true')
  
                                );
***************
*** 489,502 ****
                        $GLOBALS['phpgw']->xslttpl->add_file(array('gab'));
  
!                       if($values)
                        {
!                               $values = $values + 
$this->bocommon->get_location();
!                       }
!                       else
!                       {
!                               if($location_code)
!                               {
!                                       $values['location_data'] = 
$this->bolocation->read_single($location_code,$values['extra']);
!                               }
                        }
  
--- 489,495 ----
                        $GLOBALS['phpgw']->xslttpl->add_file(array('gab'));
  
!                       if(!$values && $location_code)
                        {
!                               $values['location_data'] = 
$this->bolocation->read_single($location_code,$values['extra']);
                        }
  
***************
*** 528,533 ****
                                $values['gab_id'] = $gab_id;
  
! //                            $values['location_code'] = $location_code;
  
                                if(!$receipt['error'])
                                {
--- 521,527 ----
                                $values['gab_id'] = $gab_id;
  
!                               $values['location_code'] = $location_code;
  
+ //_debug_array($values);
                                if(!$receipt['error'])
                                {
***************
*** 543,551 ****
                                $values = 
$this->bo->read_single($gab_id,$location_code);
                        }
!                       if ($values['property_id'])
                        {
                                $function_msg = lang('Edit gab');
                                $action='edit';
!                               $location_type ='view';
  
                        }
--- 537,545 ----
                                $values = 
$this->bo->read_single($gab_id,$location_code);
                        }
!                       if ($values['location_code'])
                        {
                                $function_msg = lang('Edit gab');
                                $action='edit';
!                               $lookup_type ='view';
  
                        }
***************
*** 554,558 ****
                                $function_msg = lang('Add gab');
                                $action='add';
!                               $location_type ='form';
                        }
  
--- 548,552 ----
                                $function_msg = lang('Add gab');
                                $action='add';
!                               $lookup_type ='form';
                        }
  
***************
*** 563,573 ****
  
  
                        
$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
                                                'tenant'                => 
False,
                                                'equipment'             => 
False,
!                                               'lookup_type'   => 'form'
                                                ));
  
--- 557,575 ----
  
  
+                       if($values['location_data'])
+                       {
+                               $type_id        = 
count(explode('-',$values['location_code']));
+                       }
+                       else
+                       {
+                               $type_id = -1;
+                       }
                        
$location_data=$this->bolocation->initiate_ui_location(array(
                                                'values'                => 
$values['location_data'],
!                                               'type_id'               => 
$type_id,
                                                'no_link'               => 
False, // disable lookup links for location type less than type_id
                                                'tenant'                => 
False,
                                                'equipment'             => 
False,
!                                               'lookup_type'   => $lookup_type
                                                ));
  
***************
*** 611,615 ****
  
                                'action'                                        
        => $action,
!                               'location_type'                                 
=> $location_type,
                                'location_data'                                 
=> $location_data,
                                'form_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
--- 613,617 ----
  
                                'action'                                        
        => $action,
!                               'lookup_type'                                   
=> $lookup_type,
                                'location_data'                                 
=> $location_data,
                                'form_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',$link_data),

Index: class.sogab.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.sogab.inc.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** class.sogab.inc.php 27 Jun 2003 12:43:19 -0000      1.7
--- class.sogab.inc.php 27 Jun 2003 19:04:30 -0000      1.8
***************
*** 250,254 ****
                function add($gab)
                {
! 
                        $gab['remark'] = 
$this->db->db_addslashes($gab['remark']);
  
--- 250,254 ----
                function add($gab)
                {
!                       $next_type      = count(explode('-', 
$gab['location_code']))+1;
                        $gab['remark'] = 
$this->db->db_addslashes($gab['remark']);
  
***************
*** 257,261 ****
                        if($gab['propagate'])
                        {
!                               $sql = "select location_code FROM fm_entrance  
where location_code LIKE '%" . $gab['location_code'] . "%'";
  
                                $this->db->query($sql,__LINE__,__FILE__);
--- 257,261 ----
                        if($gab['propagate'])
                        {
!                               $sql = 'select location_code,loc' . $next_type 
. '_name as location_name FROM fm_location' . $next_type . " where 
location_code LIKE '%" . $gab['location_code'] . "%'";
  
                                $this->db->query($sql,__LINE__,__FILE__);
***************
*** 265,277 ****
                                        
if(!$this->exist_gab_location($gab_id,$this->db->f('location_code')))
                                        {
!                                               $gab_insert[] = 
array('location_code'=> $this->db->f('location_code'),
!                                                                               
                'gab_id'        => $gab_id,
!                                                                               
                'remark'        => $gab['remark']);
                                        }
                                        else
                                        {
!                                               $gab_update[] = 
array('location_code'=> $this->db->f('location_code'),
!                                                                               
                'gab_id'        => $gab_id,
!                                                                               
                'remark'        => $gab['remark']);
                                        }
                                }
--- 265,279 ----
                                        
if(!$this->exist_gab_location($gab_id,$this->db->f('location_code')))
                                        {
!                                               $gab_insert[] = 
array('location_code'   => $this->db->f('location_code'),
!                                                                               
                'gab_id'                => $gab_id,
!                                                                               
                'location_name' => $this->db->f('location_name'),
!                                                                               
                'remark'                => $gab['remark']);
                                        }
                                        else
                                        {
!                                               $gab_update[] = 
array('location_code'   => $this->db->f('location_code'),
!                                                                               
                'gab_id'                => $gab_id,
!                                                                               
                'location_name' => $this->db->f('location_name'),
!                                                                               
                'remark'                => $gab['remark']);
                                        }
                                }
***************
*** 281,284 ****
--- 283,289 ----
                                $gab_insert[] = array('location_code'=> 
$gab['location_code'],
                                                                                
'gab_id'        => $gab_id,
+                                                                               
'street_name'   => $gab['street_name'],
+                                                                               
'street_number' => $gab['street_number'],
+                                                                               
'location_name' => $gab['location_name'],
                                                                                
'remark'        => $gab['remark']);
                        }
***************
*** 310,314 ****
                        for ($i=0;$i<count($gab_insert);$i++)
                        {
!                               $this->db->query("INSERT INTO fm_gab_location 
(location_code,gab_id,remark,entry_date,user_id) "
                                        . "VALUES ('"
                                        . $gab_insert[$i]['location_code']. 
"','"
--- 315,348 ----
                        for ($i=0;$i<count($gab_insert);$i++)
                        {
!                               $location = explode('-', 
$gab_insert[$i]['location_code']);
! 
!                               for ($j=0;$j<count($location);$j++)
!                               {
!                                               $cols_insert[] = 'loc' . ($j+1);
!                                               $vals_insert[] = $location[$j];
!                               }
! 
!                               unset($location);
! 
!                               if($cols)
!                               {
!                                       $cols   = "," . implode(",", 
$cols_insert);
!                                       $vals   = ",'" . implode("','", 
$vals_insert) . "'";
!                               }
! 
! 
!                               if($gab_insert[$i]['street_name'])
!                               {
!                                       $address[]= 
$gab_insert[$i]['street_name'];
!                                       $address[]= 
$gab_insert[$i]['street_number'];
!                                       $address        = implode(" ", 
$address);
!                               }
! 
!                               if(!$address)
!                               {
!                                       $address = 
$gab_insert[$i]['location_name'];
!                               }
! 
!                               $this->db->query("INSERT INTO fm_gab_location 
(location_code,gab_id,remark,entry_date,user_id,address $cols) "
                                        . "VALUES ('"
                                        . $gab_insert[$i]['location_code']. 
"','"
***************
*** 316,323 ****
                                        . $gab_insert[$i]['remark']. "','"
                                        . time() . "','"
!                                       . $this->account. 
"')",__LINE__,__FILE__);
  
                                        $receipt['message'][] = 
array('msg'=>lang('at location %1',$gab_insert[$i]['location_code']));
                        }
  
                        return $receipt;
--- 350,359 ----
                                        . $gab_insert[$i]['remark']. "','"
                                        . time() . "','"
!                                       . $this->account. "','"
!                                       . $address . "' $vals 
)",__LINE__,__FILE__);
  
                                        $receipt['message'][] = 
array('msg'=>lang('at location %1',$gab_insert[$i]['location_code']));
                        }
+ 
  
                        return $receipt;

Index: class.bogab.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.bogab.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** class.bogab.inc.php 27 Jun 2003 12:43:19 -0000      1.5
--- class.bogab.inc.php 27 Jun 2003 19:04:30 -0000      1.6
***************
*** 153,160 ****
                function save($values)
                {
- 
                        if(!$values['location_code'])
                        {
!                               
$values['location_code']=$this->bocommon->location_code($values['property_id'],$values['building_id'],$values['entrance_id'],$values['apartment_id']);
                        }
  
--- 153,167 ----
                function save($values)
                {
                        if(!$values['location_code'])
                        {
!                               while (is_array($values['location']) && 
list(,$value) = each($values['location']))
!                               {
!                                       if($value)
!                                       {
!                                               $location[] = $value;
!                                       }
!                               }
! 
!                               $values['location_code']=implode("-", 
$location);
                        }
  





reply via email to

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