phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: property/inc class.bocommon.inc.php,1.18,1.19 cl


From: Sigurd Nes <address@hidden>
Subject: [Phpgroupware-cvs] CVS: property/inc class.bocommon.inc.php,1.18,1.19 class.bolookup.inc.php,1.3,1.4 class.boproperty.inc.php,1.3,1.4 class.soapartment.inc.php,1.1,1.2 class.sobuilding.inc.php,1.6,1.7 class.socommon.inc.php,1.11,1.12 class.soentrance.inc.php,1.2,1.3 class.solookup.inc.php,1.10,1.11 class.soproperty.inc.php,1.7,1.8 class.uiapartment.inc.php,1.1,1.2 class.uientrance.inc.php,1.2,1.3 class.uiequipment.inc.php,1.8,1.9 class.uilookup.inc.php,1.8,1.9 class.uiproperty.inc.php,1.10,1.11 hook_admin.inc.php,1.16,1.17
Date: Thu, 27 Feb 2003 04:53:48 -0500

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

Modified Files:
        class.bocommon.inc.php class.bolookup.inc.php 
        class.boproperty.inc.php class.soapartment.inc.php 
        class.sobuilding.inc.php class.socommon.inc.php 
        class.soentrance.inc.php class.solookup.inc.php 
        class.soproperty.inc.php class.uiapartment.inc.php 
        class.uientrance.inc.php class.uiequipment.inc.php 
        class.uilookup.inc.php class.uiproperty.inc.php 
        hook_admin.inc.php 
Log Message:
no message

Index: class.bocommon.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.bocommon.inc.php,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -r1.18 -r1.19
*** class.bocommon.inc.php      21 Feb 2003 10:28:59 -0000      1.18
--- class.bocommon.inc.php      27 Feb 2003 09:53:36 -0000      1.19
***************
*** 250,255 ****
--- 250,263 ----
                                $location['lang_apartment']                     
                        = lang('Apartment');
                                $data['entrance']                               
                                = True;
+                               $data['address']                                
                                = True;
                        }
  
+                       if($data['address'])
+                       {
+                               $location['address']                            
                        = True;
+                               $location['lang_address']                       
                        = lang('Address');
+                               $location['value_street_name']                  
                = $data['street_name'];
+                               $location['value_street_number']                
                = $data['street_number'];
+                       }
                        if($data['entrance'])
                        {
***************
*** 282,286 ****
                        $location['lang_select_property_help']                  
        = lang('Klick this link to select property');
                        $location['lang_property_name']                         
                = lang('Property Name');
-                       $location['lang_address']                               
                        = lang('Address');
  
  //_debug_array($location);
--- 290,293 ----

Index: class.bolookup.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.bolookup.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** class.bolookup.inc.php      10 Feb 2003 16:46:15 -0000      1.3
--- class.bolookup.inc.php      27 Feb 2003 09:53:36 -0000      1.4
***************
*** 103,106 ****
--- 103,115 ----
                }
  
+               function read_street()
+               {
+                       $street = $this->so->read_street(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
+                                                                               
        'filter' => $this->filter,'cat_id' => $this->cat_id));
+                       $this->total_records = $this->so->total_records;
+ 
+                       return $street;
+               }
+ 
                function read_location()
                {

Index: class.boproperty.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.boproperty.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** class.boproperty.inc.php    18 Feb 2003 19:29:00 -0000      1.3
--- class.boproperty.inc.php    27 Feb 2003 09:53:36 -0000      1.4
***************
*** 156,159 ****
--- 156,164 ----
                        }
                }
+ 
+               function update_cat()
+               {
+                       $this->so->update_cat();
+               }
        }
  ?>

Index: class.soapartment.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.soapartment.inc.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** class.soapartment.inc.php   25 Feb 2003 11:29:29 -0000      1.1
--- class.soapartment.inc.php   27 Feb 2003 09:53:36 -0000      1.2
***************
*** 108,112 ****
                        }
  
!                       $sql = "SELECT 
fm_apartment.property_id,fm_property.name,building_id,entrance_id,floor,apartment_id,street_number,street_name"
                                . "     FROM fm_apartment $this->join"
                                . " fm_property ON fm_apartment.property_id = 
fm_property.property_id $this->join"
--- 108,112 ----
                        }
  
!                       $sql = "SELECT 
fm_apartment.location_code,fm_apartment.property_id,fm_property.name,building_id,entrance_id,floor,apartment_id,street_number,street_name"
                                . "     FROM fm_apartment $this->join"
                                . " fm_property ON fm_apartment.property_id = 
fm_property.property_id $this->join"
***************
*** 147,151 ****
                function read_single($location_code)
                {
!                       $sql = "SELECT 
fm_apartment.property_id,fm_property.name,building_id,entrance_id,floor,apartment_id,street_number,street_name,descr,fm_apartment.cat_id"
                                . "     FROM fm_apartment $this->join"
                                . " fm_property ON fm_apartment.property_id = 
fm_property.property_id $this->join"
--- 147,151 ----
                function read_single($location_code)
                {
!                       $sql = "SELECT 
fm_apartment.property_id,fm_property.name,building_id,entrance_id,floor,apartment_id,fm_apartment.street_id,street_name,street_number,descr,fm_apartment.cat_id,fm_apartment.remark"
                                . "     FROM fm_apartment $this->join"
                                . " fm_property ON fm_apartment.property_id = 
fm_property.property_id $this->join"
***************
*** 165,174 ****
                                $apartment['floor']                             
= $this->db->f('floor');
                                $apartment['apartment_id']              = 
$this->db->f('apartment_id');
                                $apartment['owner']                             
= $this->db->f('owner');
                                $apartment['descr']                             
= stripslashes($this->db->f('descr'));
!                               $apartment['access']                            
= $this->db->f('access');
                                $apartment['date']                              
= $this->db->f('entry_date');
!                               $apartment['cat_id']                            
= (int)$this->db->f('cat_id');
!                               $apartment['remark']                            
= $this->db->f('remark');
  
                                return $apartment;
--- 165,177 ----
                                $apartment['floor']                             
= $this->db->f('floor');
                                $apartment['apartment_id']              = 
$this->db->f('apartment_id');
+                               $apartment['street_id']                 = 
$this->db->f('street_id');
+                               $apartment['street_name']               = 
$this->db->f('street_name');
+                               $apartment['street_number']             = 
$this->db->f('street_number');
                                $apartment['owner']                             
= $this->db->f('owner');
                                $apartment['descr']                             
= stripslashes($this->db->f('descr'));
!                               $apartment['access']                    = 
$this->db->f('access');
                                $apartment['date']                              
= $this->db->f('entry_date');
!                               $apartment['cat_id']                    = 
(int)$this->db->f('cat_id');
!                               $apartment['remark']                    = 
$this->db->f('remark');
  
                                return $apartment;
***************
*** 180,184 ****
                        $apartment['remark'] = 
$this->db->db_addslashes($apartment['remark']);
  
!                       $this->db->query("INSERT INTO fm_apartment 
(location_code, 
property_id,building_id,entrance_id,apartment_id,floor,owner,access,descr,cat_id,remark)
 "
                                . "VALUES ('" .
                                $apartment['location_code']. "','" .
--- 183,187 ----
                        $apartment['remark'] = 
$this->db->db_addslashes($apartment['remark']);
  
!                       $this->db->query("INSERT INTO fm_apartment 
(location_code, 
property_id,building_id,entrance_id,apartment_id,floor,street_id,street_number,owner,access,descr,cat_id,remark)
 "
                                . "VALUES ('" .
                                $apartment['location_code']. "','" .
***************
*** 188,191 ****
--- 191,196 ----
                                $apartment['apartment_id'] . "','" .
                                $apartment['floor'] . "','" .
+                               $apartment['street_idd'] . "','" .
+                               $apartment['street_number'] . "','" .
                                $this->account . "','" .
                                $apartment['access'] . "','" .
***************
*** 202,209 ****
                        $apartment['remark'] = 
$this->db->db_addslashes($apartment['remark']);
  
!                       $this->db->query("UPDATE fm_apartment set descr='" . 
$building['descr'] . "',
                                        cat_id='"       . $apartment['cat_id'] 
. "',
                                        floor='" . $apartment['floor'] . "',
!                                       descr='" . $apartment['descr'] . "',
                                        access='" . $apartment['access'] . "',
                                        remark='" . $apartment['remark']
--- 207,216 ----
                        $apartment['remark'] = 
$this->db->db_addslashes($apartment['remark']);
  
!                       $this->db->query("UPDATE fm_apartment set
                                        cat_id='"       . $apartment['cat_id'] 
. "',
                                        floor='" . $apartment['floor'] . "',
!                                       street_id='" . $apartment['street_idd'] 
. "',
!                                       street_number='" . 
$apartment['street_number'] . "',
!                                       descr='" . $apartment['descr']  . "',
                                        access='" . $apartment['access'] . "',
                                        remark='" . $apartment['remark']

Index: class.sobuilding.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.sobuilding.inc.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** class.sobuilding.inc.php    21 Feb 2003 10:28:59 -0000      1.6
--- class.sobuilding.inc.php    27 Feb 2003 09:53:36 -0000      1.7
***************
*** 95,98 ****
--- 95,102 ----
                                $filtermethod .= " AND cat_id='$cat_id' ";
                        }
+                       else
+                       {
+                               $filtermethod .= " AND  cat_id!='99' ";
+                       }
  
                        if($query)

Index: class.socommon.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.socommon.inc.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** class.socommon.inc.php      25 Feb 2003 11:29:29 -0000      1.11
--- class.socommon.inc.php      27 Feb 2003 09:53:36 -0000      1.12
***************
*** 137,140 ****
--- 137,152 ----
                }
  
+               function 
check_apartment($property_id='',$building_id='',$entrance_id='',$apartment_id='')
+               {
+                       $this->db->query("SELECT count(*) FROM fm_apartment 
where property_id='$property_id' and building_id='$building_id' and 
entrance_id='$entrance_id' and apartment_id='$apartment_id'");
+ 
+                       $this->db->next_record();
+ 
+                       if ( $this->db->f(0))
+                       {
+                               return True;
+                       }
+               }
+ 
                function check_location_code($location_code='')
                {

Index: class.soentrance.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.soentrance.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** class.soentrance.inc.php    25 Feb 2003 11:29:29 -0000      1.2
--- class.soentrance.inc.php    27 Feb 2003 09:53:36 -0000      1.3
***************
*** 95,98 ****
--- 95,102 ----
                                $filtermethod .= " AND cat_id='$cat_id' ";
                        }
+                       else
+                       {
+                               $filtermethod .= " AND  cat_id!='99' ";
+                       }
  
                        if($query)

Index: class.solookup.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.solookup.inc.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** class.solookup.inc.php      25 Feb 2003 11:29:29 -0000      1.10
--- class.solookup.inc.php      27 Feb 2003 09:53:36 -0000      1.11
***************
*** 232,236 ****
                        return $location;
                }
!               function read_property($data)
                {
  //_debug_array($data);
--- 232,291 ----
                        return $location;
                }
! 
!               function read_street($data)
!               {
!                       if(is_array($data))
!                       {
!                               if ($data['start'])
!                               {
!                                       $start=$data['start'];
!                               }
!                               else
!                               {
!                                       $start=0;
!                               }
!                               $filter = 
(isset($data['filter'])?$data['filter']:'none');
!                               $query = 
(isset($data['query'])?$data['query']:'');
!                               $sort = 
(isset($data['sort'])?$data['sort']:'DESC');
!                               $order = 
(isset($data['order'])?$data['order']:'');
!                               $cat_id = 
(isset($data['cat_id'])?$data['cat_id']:0);
!                       }
! 
!                       if ($order)
!                       {
!                               $ordermethod = " order by $order $sort";
!                       }
!                       else
!                       {
!                               $ordermethod = ' order by fm_streetaddress 
.street_name DESC';
!                       }
! 
!                       if($query)
!                       {
!                               $query = ereg_replace("'",'',$query);
!                               $query = ereg_replace('"','',$query);
! 
!                               $querymethod = " where ( street_name LIKE 
'%$query%')";
!                       }
! 
!                       $sql = "SELECT * FROM fm_streetaddress $querymethod  ";
! 
!                       $this->db2->query($sql,__LINE__,__FILE__);
!                       $this->total_records = $this->db2->num_rows();
!                       $this->db->limit_query($sql . 
$ordermethod,$start,__LINE__,__FILE__);
! 
!                       while ($this->db->next_record())
!                       {
!                               $street[] = array
!                               (
!                                       'id'                    => 
$this->db->f('street_id'),
!                                       'street_name'   => 
$this->db->f('street_name')
!                                       );
!                       }
! 
!                       return $street;
!               }
! 
!                       function read_property($data)
                {
  //_debug_array($data);
***************
*** 612,620 ****
                                $query = ereg_replace('"','',$query);
  
!                               $querymethod = " AND ( street_name LIKE 
'%$query%' OR fm_apartment.location_code LIKE '%$query%' OR first_name LIKE 
'%$query%' OR last_name LIKE '%$query%')";
                        }
  
  
!                       $sql = "SELECT 
fm_apartment.property_id,fm_property.name,building_id,entrance_id,floor,apartment_id,street_number,street_name,descr"
                        . "     FROM fm_apartment $this->join"
                        . " fm_property ON fm_apartment.property_id = 
fm_property.property_id $this->join"
--- 667,675 ----
                                $query = ereg_replace('"','',$query);
  
!                               $querymethod = " AND ( street_name LIKE 
'%$query%' OR fm_apartment.location_code LIKE '%$query%')";
                        }
  
  
!                       $sql = "SELECT 
fm_apartment.property_id,fm_property.name,building_id,entrance_id,floor,apartment_id,street_number,street_name,fm_apartment_category.descr"
                        . "     FROM fm_apartment $this->join"
                        . " fm_property ON fm_apartment.property_id = 
fm_property.property_id $this->join"

Index: class.soproperty.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.soproperty.inc.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** class.soproperty.inc.php    25 Feb 2003 11:29:29 -0000      1.7
--- class.soproperty.inc.php    27 Feb 2003 09:53:36 -0000      1.8
***************
*** 97,100 ****
--- 97,104 ----
                                $filtermethod .= " AND cat_id='$cat_id' ";
                        }
+                       else
+                       {
+                               $filtermethod .= " AND  cat_id!='99' ";
+                       }
  
                        if($query)
***************
*** 177,181 ****
                        $this->db->query("UPDATE fm_property set name='" . 
$property['name'] . "', entry_date='" . time() . "', cat_id='"
                                                        . $property['cat_id'] . 
"', general_address='" . $property['general_address'] . "', access='" . 
$property['access'] . "', bydel_id='" . $property['part_of_town_id']. "', 
generellinfo='" . $property['generellinfo']
!                                                       . "' WHERE 
property_id=" . intval($property['property_id']),__LINE__,__FILE__);
  
                        $receipt['message'][]=array('msg'=>lang('Property has 
been edited'));
--- 181,185 ----
                        $this->db->query("UPDATE fm_property set name='" . 
$property['name'] . "', entry_date='" . time() . "', cat_id='"
                                                        . $property['cat_id'] . 
"', general_address='" . $property['general_address'] . "', access='" . 
$property['access'] . "', bydel_id='" . $property['part_of_town_id']. "', 
generellinfo='" . $property['generellinfo']
!                                                       . "' WHERE 
property_id='" . $property['property_id'] . "'",__LINE__,__FILE__);
  
                        $receipt['message'][]=array('msg'=>lang('Property has 
been edited'));
***************
*** 187,190 ****
--- 191,301 ----
                        $this->db->query("DELETE FROM fm_property WHERE 
property_id='" . $property_id ."'",__LINE__,__FILE__);
                }
+ 
+               function update_cat()
+               {
+                       $sql = "SELECT property_id,building_id,entrance_id, 
count(*) as count_99  FROM fm_apartment where cat_id='99' group by 
property_id,building_id,entrance_id";
+                       $this->db->query($sql,__LINE__,__FILE__);
+ 
+                       while ($this->db->next_record())
+                       {
+                               
$outdated[$this->db->f('property_id')][$this->db->f('building_id')][$this->db->f('entrance_id')]['count_99']=$this->db->f('count_99');
+                       }
+ 
+                       $sql = "SELECT property_id,building_id,entrance_id, 
count(*) as count_all  FROM fm_apartment group by 
property_id,building_id,entrance_id";
+                       $this->db->query($sql,__LINE__,__FILE__);
+                       while ($this->db->next_record())
+                       {
+                               if( 
$outdated[$this->db->f('property_id')][$this->db->f('building_id')][$this->db->f('entrance_id')]['count_99']==$this->db->f('count_all'))
+                               {
+                                       $update[]=array
+                                       (
+                                               'property_id'   => 
$this->db->f('property_id'),
+                                               'building_id'   => 
$this->db->f('building_id'),
+                                               'entrance_id'   => 
$this->db->f('entrance_id')
+                                       );
+ 
+                               }
+                       }
+ 
+                       for ($i=0; $i<count($update); $i++)
+                       {
+                               $this->db->query("UPDATE fm_entrance set
+                                       cat_id='99' "
+                                       . " WHERE property_id= '" . 
$update[$i]['property_id'] ."'"
+                                       . " AND building_id= '" . 
$update[$i]['building_id'] ."'"
+                                       . " AND entrance_id= '" . 
$update[$i]['entrance_id'] ."'",__LINE__,__FILE__);
+                       }
+ 
+                       unset($outdated);
+                       unset($update);
+ 
+                       $sql = "SELECT property_id,building_id, count(*) as 
count_99  FROM fm_entrance where cat_id='99' group by property_id,building_id";
+                       $this->db->query($sql,__LINE__,__FILE__);
+ 
+                       while ($this->db->next_record())
+                       {
+                               
$outdated[$this->db->f('property_id')][$this->db->f('building_id')]['count_99']=$this->db->f('count_99');
+                       }
+ 
+                       $sql = "SELECT property_id,building_id, count(*) as 
count_all  FROM fm_entrance group by property_id,building_id";
+                       $this->db->query($sql,__LINE__,__FILE__);
+                       while ($this->db->next_record())
+                       {
+                               if( 
$outdated[$this->db->f('property_id')][$this->db->f('building_id')]['count_99']==$this->db->f('count_all'))
+                               {
+                                       $update[]=array
+                                       (
+                                               'property_id'   => 
$this->db->f('property_id'),
+                                               'building_id'   => 
$this->db->f('building_id')
+                                       );
+ 
+                               }
+                       }
+ 
+                       for ($i=0; $i<count($update); $i++)
+                       {
+                               $this->db->query("UPDATE fm_building set
+                                       cat_id='99' "
+                                       . " WHERE property_id= '" . 
$update[$i]['property_id'] ."'"
+                                       . " AND building_id= '" . 
$update[$i]['building_id'] ."'",__LINE__,__FILE__);
+                       }
+ 
+                       unset($outdated);
+                       unset($update);
+ 
+                       $sql = "SELECT property_id, count(*) as count_99  FROM 
fm_building where cat_id='99' group by property_id";
+                       $this->db->query($sql,__LINE__,__FILE__);
+ 
+                       while ($this->db->next_record())
+                       {
+                               
$outdated[$this->db->f('property_id')]['count_99']=$this->db->f('count_99');
+                       }
+ 
+                       $sql = "SELECT property_id, count(*) as count_all  FROM 
fm_building group by property_id";
+                       $this->db->query($sql,__LINE__,__FILE__);
+                       while ($this->db->next_record())
+                       {
+                               if( 
$outdated[$this->db->f('property_id')]['count_99']==$this->db->f('count_all'))
+                               {
+                                       $update[]=array
+                                       (
+                                               'property_id'   => 
$this->db->f('property_id')
+                                       );
+ 
+                               }
+                       }
+ 
+                       for ($i=0; $i<count($update); $i++)
+                       {
+                               $this->db->query("UPDATE fm_property set
+                                       cat_id='99' "
+                                       . " WHERE property_id= '" . 
$update[$i]['property_id'] ."'",__LINE__,__FILE__);
+                       }
+ 
+                       unset($outdated);
+                       unset($update);
+ 
+               }
+ 
        }
  ?>

Index: class.uiapartment.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uiapartment.inc.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** class.uiapartment.inc.php   25 Feb 2003 11:29:29 -0000      1.1
--- class.uiapartment.inc.php   27 Feb 2003 09:53:37 -0000      1.2
***************
*** 186,190 ****
                function edit()
                {
!                       $location_code                  = 
get_var('location_code',array('GET'));
                        $location = split('-',$location_code);
                        $property_id = $location[0];
--- 186,190 ----
                function edit()
                {
!                       $location_code                  = 
get_var('location_code',array('POST','GET'));
                        $location = split('-',$location_code);
                        $property_id = $location[0];
***************
*** 197,201 ****
--- 197,206 ----
                        $values['property_name']        = 
get_var('property_name',array('POST'));
                        $values['building_id']  = 
get_var('building_id',array('POST'));
+                       $values['entrance_id']  = 
get_var('entrance_id',array('POST'));
+                       $values['street_idd']   = 
get_var('street_idd',array('POST'));
  
+ //echo 'location_code :' .$location_code. '<br>';
+ //_debug_array($values);
+ //_debug_array($location);
                        $values_attribute               = 
get_var('values_attribute',array('POST','GET'));
  
***************
*** 269,273 ****
                        }
  
!                       $values = $this->bo->read_single($location_code);
  
                        if ($apartment_id)
--- 274,281 ----
                        }
  
!                       if(!$error_id)
!                       {
!                               $values = 
$this->bo->read_single($location_code);
!                       }
  
                        if ($apartment_id)
***************
*** 297,301 ****
                        (
                                'menuaction'    => 
$this->currentapp.'.uiapartment.edit',
!                               'location_code' => $values['location_code']
                        );
  
--- 305,309 ----
                        (
                                'menuaction'    => 
$this->currentapp.'.uiapartment.edit',
!                               'location_code' => $location_code
                        );
  
***************
*** 328,331 ****
--- 336,340 ----
                        $data = array
                        (
+                               'street_link'                                   
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uilookup.street'),
                                'location_type'                                 
=> $location_type,
                                'location_data'                                 
=> $location_data,
***************
*** 339,342 ****
--- 348,352 ----
                                'lang_apartment_id'                             
=> lang('Apartment ID'),
                                'lang_floor'                                    
=> lang('floor'),
+                               'lang_street'                                   
=> lang('Street'),
                                'lang_name'                                     
        => lang('name'),
                                'lang_descr'                                    
=> lang('Description'),
***************
*** 348,354 ****
--- 358,368 ----
                                'value_apartment_id'                    => 
$values['apartment_id'],
                                'value_floor'                                   
=> $values['floor'],
+                               'value_street'                                  
=> $values['street_name'],
+                               'value_street_idd'                              
=> $values['street_id'],
+                               'value_street_number'                   => 
$values['street_number'],
                                'value_name'                                    
=> $values['name'],
                                'value_descr'                                   
=> $values['descr'],
                                'value_access'                                  
=> $values['access'],
+                               'value_street_name'                             
=> $values['street_name'],
                                'value_remark'                                  
=> $values['remark'],
                                'error'                                         
        => $receipt['error'],
***************
*** 356,359 ****
--- 370,375 ----
                                'message'                                       
        => $receipt['message'],
                                'lang_name_statustext'                  => 
lang('Enter the name of the apartment'),
+                               'lang_select_street_help'               => 
lang('Select the street name'),
+                               'lang_street_num_statustext'    => lang('Enter 
the street number'),
                                'lang_apartment_id_statustext'  => lang('Enter 
apartment ID'),
                                'lang_floor_statustext'                 => 
lang('Enter the floor'),
***************
*** 427,431 ****
                        $values = $this->bo->read_single($location_code);
  
!                       $attributes_values              = 
$this->bocommon->read_attibutes(array('form'=>true,'type'=>location,'type_id'=>4,'id'=>$location_code));
                        $attributes_header[]    = array
                                (
--- 443,447 ----
                        $values = $this->bo->read_single($location_code);
  
!                       $attributes_values              = 
$this->bocommon->read_attibutes(array('form'=>false,'type'=>location,'type_id'=>4,'id'=>$location_code));
                        $attributes_header[]    = array
                                (
***************
*** 441,449 ****
                                                'apartment'     => True,
                                                'property_id'   => 
$values['property_id'],
                                                'building_id'   => 
$values['building_id'],
                                                'entrance_id'   => 
$values['entrance_id'],
                                                'floor'                 => 
$values['floor'],
                                                'apartment_id'  => 
$values['apartment_id'],
!                                               'property_name' => 
$values['property_name']));
  
                        $data = array
--- 457,467 ----
                                                'apartment'     => True,
                                                'property_id'   => 
$values['property_id'],
+                                               'property_name' => 
$values['property_name'],
                                                'building_id'   => 
$values['building_id'],
                                                'entrance_id'   => 
$values['entrance_id'],
                                                'floor'                 => 
$values['floor'],
                                                'apartment_id'  => 
$values['apartment_id'],
!                                               'street_name'   => 
$values['street_name'],
!                                               'street_number' => 
$values['street_number']));
  
                        $data = array

Index: class.uientrance.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uientrance.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** class.uientrance.inc.php    25 Feb 2003 11:29:29 -0000      1.2
--- class.uientrance.inc.php    27 Feb 2003 09:53:37 -0000      1.3
***************
*** 253,257 ****
                        }
  
!                       $values = $this->bo->read_single($location_code);
  
                        if ($entrance_id)
--- 253,260 ----
                        }
  
!                       if(!$error_id)
!                       {
!                               $values = 
$this->bo->read_single($location_code);
!                       }
  
                        if ($entrance_id)

Index: class.uiequipment.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uiequipment.inc.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** class.uiequipment.inc.php   21 Feb 2003 10:28:59 -0000      1.8
--- class.uiequipment.inc.php   27 Feb 2003 09:53:37 -0000      1.9
***************
*** 295,302 ****
--- 295,304 ----
                        {
                                $function_msg = lang('edit equipment');
+                               $location_type='view';
                        }
                        else
                        {
                                $function_msg = lang('add equipment');
+                               $location_type='form';
                        }
  
***************
*** 308,314 ****
  
                        
$location_data=$this->bocommon->initiate_ui_location(array(
!                                               'location_type' => 'form',
                                                'equipment'             => 
false,
!                                               'tenant'                => 
false,
                                                'property_id'   => 
$values['property_id'],
                                                'property_name' => 
$values['property_name'],
--- 310,317 ----
  
                        
$location_data=$this->bocommon->initiate_ui_location(array(
!                                               'location_type' => 
$location_type,
                                                'equipment'             => 
false,
!                                               'apartment'             => true,
!                                               'address'               => true,
                                                'property_id'   => 
$values['property_id'],
                                                'property_name' => 
$values['property_name'],
***************
*** 466,471 ****
                        
$location_data=$this->bocommon->initiate_ui_location(array(
                                                'location_type' => 'view',
!                                               'equipment'             => 
false,
!                                               'tenant'                => 
false,
                                                'property_id'   => 
$values['property_id'],
                                                'property_name' => 
$values['property_name'],
--- 469,474 ----
                        
$location_data=$this->bocommon->initiate_ui_location(array(
                                                'location_type' => 'view',
!                                               'apartment'             => true,
!                                               'address'               => true,
                                                'property_id'   => 
$values['property_id'],
                                                'property_name' => 
$values['property_name'],

Index: class.uilookup.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uilookup.inc.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** class.uilookup.inc.php      18 Feb 2003 20:38:18 -0000      1.8
--- class.uilookup.inc.php      27 Feb 2003 09:53:37 -0000      1.9
***************
*** 25,29 ****
                        'addressbook'  => True,
                        'location'   => True,
!                       'equipment'   => True
                );
  
--- 25,30 ----
                        'addressbook'  => True,
                        'location'   => True,
!                       'equipment'   => True,
!                       'street'   => True
                );
  
***************
*** 175,178 ****
--- 176,275 ----
  
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_addressbook' => $data));
+                       $this->save_sessiondata();
+               }
+ 
+ 
+               function street()
+               {
+ 
+                       $GLOBALS['phpgw']->xslttpl->add_file(array('lookup',
+                                                                               
'nextmatchs',
+                                                                               
'headonly',
+                                                                               
$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default') . SEP . 
'app_header',
+                                                                               
$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default') . SEP . 
'filter_select',
+                                                                               
$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default') . SEP . 
'search_field'));
+ 
+                       $street_list = $this->bo->read_street();
+ 
+                       while (is_array($street_list) && list(,$street_entry) = 
each($street_list))
+                       {
+                               $content[] = array
+                               (
+                                       'id'                            => 
$street_entry['id'],
+                                       'street_name'           => 
$street_entry['street_name'],
+                                       'lang_select'           => 
lang('Select'),
+                                       'lang_select_statustext' => 
lang('Select this street')
+                               );
+                       }
+ 
+                       $table_header[] = array
+                       (
+                               'sort_name'     => 
$this->nextmatchs->show_sort_order(array
+                                                                               
(
+                                                                               
        'sort'  => $this->sort,
+                                                                               
        'var'   =>      'street_name',
+                                                                               
        'order' =>      $this->order,
+                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uilookup.street',
+                                                                               
                                                        'cat_id'        
=>$this->cat_id)
+                                                                               
)),
+                               'lang_name'             => lang('Street name'),
+                               'sort_id'       => 
$this->nextmatchs->show_sort_order(array
+                                                                               
(
+                                                                               
        'sort'  => $this->sort,
+                                                                               
        'var'   =>      'street_id',
+                                                                               
        'order' =>      $this->order,
+                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uilookup.street',
+                                                                               
                                                        'cat_id'        
=>$this->cat_id)
+                                                                               
)),
+                               'lang_id'               => lang('ID'),
+                               'lang_select'           => lang('Select')
+                       );
+ 
+                       $table_done[] = array
+                       (
+                               'lang_done'                             => 
lang('Done'),
+                               'lang_done_statustext'  => lang('Close this 
window')
+                       );
+ 
+                       $link_select = array
+                       (
+                               'menuaction'            => 
$this->currentapp.'.uilookup.street',
+                               'second_display'        => true,
+                               'order'                         => $this->order,
+                               'sort'                          => $this->sort,
+                               'cat_id'                        => 
$this->cat_id,
+                               'query'                         => $this->query,
+                               'filter'                        => $this->filter
+                       );
+ 
+ 
+                       $data = array
+                       (
+                               'allow_allrows'                                 
=> false,
+                               'start_record'                                  
=> $this->start,
+                               'record_limit'                                  
=> $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'],
+                               'num_records'                                   
=> count($street_list),
+                               'all_records'                                   
=> $this->bo->total_records,
+                               'link_url'                                      
        => $GLOBALS['phpgw']->link('/index.php',$link_select),
+                               'img_path'                                      
        => $GLOBALS['phpgw']->common->get_image_path('phpgwapi'),
+       //                      'appname'                                       
        => '',
+                               'function_msg'                                  
=> lang('list streets'),
+                               '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->cats->formatted_xslt_list(array('selected' => 
$this->cat_id,'globals' => True)),
+                               'select_action'                                 
=> $GLOBALS['phpgw']->link('/index.php',$link_select),
+                               'filter_list'                                   
=> $this->nextmatchs->xslt_filter(array('filter' => $this->filter,'yours' => 
'yes')),
+                               'lang_filter_statustext'                => 
lang('Select the filter. To show all entries select SHOW ALL'),
+                               'lang_searchfield_statustext'   => lang('Enter 
the search string. To show all entries, empty this field and press the SUBMIT 
button again'),
+                               'lang_searchbutton_statustext'  => lang('Submit 
the search string'),
+                               'query'                                         
        => $this->query,
+                               'lang_submit'                                   
=> lang('submit'),
+                               'table_header_street'           => 
$table_header,
+                               'values_street'                 => $content,
+                               'table_done'                                    
=> $table_done
+                       );
+ 
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_street' => $data));
                        $this->save_sessiondata();
                }

Index: class.uiproperty.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uiproperty.inc.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** class.uiproperty.inc.php    21 Feb 2003 10:28:59 -0000      1.10
--- class.uiproperty.inc.php    27 Feb 2003 09:53:38 -0000      1.11
***************
*** 25,29 ****
                        'view'   => True,
                        'edit'   => True,
!                       'delete' => True
                );
  
--- 25,30 ----
                        'view'   => True,
                        'edit'   => True,
!                       'delete' => True,
!                       'update_cat' => True
                );
  
***************
*** 406,409 ****
--- 407,446 ----
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view' => $data));
                }
+ 
+               function update_cat()
+               {
+                       $confirm        = get_var('confirm',array('POST'));
+ 
+                       $link_data = array
+                       (
+                               'menuaction' => 
$this->currentapp.'.uiproperty.index'
+                       );
+ 
+                       if (get_var('confirm',array('POST')))
+                       {
+                               $this->bo->update_cat();
+                               Header('Location: ' . 
$GLOBALS['phpgw']->link('/admin/index.php'));
+                       }
+ 
+                       $GLOBALS['phpgw']->xslttpl->add_file(array('property',
+                                                                               
$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default') . SEP . 
'app_header'));
+ 
+                       $data = array
+                       (
+                               'appname'                               => 
lang('property'),
+                               'function_msg'                  => lang('Update 
the categories for locations'),
+                               'done_action'                   => 
$GLOBALS['phpgw']->link('/admin/index.php'),
+                               'update_action'                 => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiproperty.update_cat'),
+                               'lang_confirm_msg'              => lang('do you 
really want to update the categories'),
+                               'lang_yes'                              => 
lang('yes'),
+                               'lang_yes_statustext'   => lang('Update the 
categories'),
+                               'lang_no_statustext'    => lang('Back to 
Admin'),
+                               'lang_no'                               => 
lang('no')
+                       );
+ 
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('update_cat' => $data));
+               }
+ 
+ 
        }
  ?>

Index: hook_admin.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/hook_admin.inc.php,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -r1.16 -r1.17
*** hook_admin.inc.php  15 Feb 2003 19:51:39 -0000      1.16
--- hook_admin.inc.php  27 Feb 2003 09:53:39 -0000      1.17
***************
*** 25,28 ****
--- 25,29 ----
                                'Equipment type'=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uistandard_entity.index&type=equipment'),
                                'Location type'=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uistandard_entity.index&type=location'),
+                               'Update Location categories'=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uiproperty.update_cat'),
                                'Property Categories'=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uistandard_2.index&type=property'),
                                'Building Categories'=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uistandard_2.index&type=building'),





reply via email to

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