[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: property/inc class.sogab.inc.php,1.12,1.13 class
From: |
Sigurd Nes <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: property/inc class.sogab.inc.php,1.12,1.13 class.solocation.inc.php,1.18,1.19class.uilocation.inc.php,1.19,1.20 |
Date: |
Sat, 05 Jul 2003 17:41:37 -0400 |
Update of /cvsroot/phpgroupware/property/inc
In directory subversions:/tmp/cvs-serv27773/inc
Modified Files:
class.sogab.inc.php class.solocation.inc.php
class.uilocation.inc.php
Log Message:
no message
Index: class.sogab.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.sogab.inc.php,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** class.sogab.inc.php 4 Jul 2003 09:56:25 -0000 1.12
--- class.sogab.inc.php 5 Jul 2003 21:41:34 -0000 1.13
***************
*** 270,274 ****
{
- // $sql = 'select location_code,loc' .
$this->gab_insert_level . '_name as location_name FROM fm_location' .
$this->gab_insert_level . " where location_code LIKE '%" .
$gab['location_code'] . "%'";
$sql = 'SELECT location_code,loc' .
$this->gab_insert_level . '_name as location_name FROM fm_location' .
$this->gab_insert_level . " $where_condition ";
--- 270,273 ----
Index: class.solocation.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.solocation.inc.php,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -r1.18 -r1.19
*** class.solocation.inc.php 1 Jul 2003 11:19:24 -0000 1.18
--- class.solocation.inc.php 5 Jul 2003 21:41:35 -0000 1.19
***************
*** 653,801 ****
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')
! );
!
! }
! }
! $j=0;
! for ($i=0; $i<count($update); $i++)
! {
! $sql = "SELECT cat_id FROM fm_entrance "
! . " WHERE property_id= '" .
$update[$i]['property_id'] ."'"
! . " AND building_id= '" .
$update[$i]['building_id'] ."'"
! . " AND entrance_id= '" .
$update[$i]['entrance_id'] ."'";
!
! $this->db->query($sql,__LINE__,__FILE__);
! $this->db->next_record();
! if(!$this->db->f('cat_id')=='99')
{
! $j++;
! $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__);
}
- }
-
- $receipt['message'][]=array('msg'=>lang('%1 Entrances
has been updated to not active of %2 already not active',$j,count($update)));
-
- 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')
! );
!
}
- }
-
- $j=0;
- for ($i=0; $i<count($update); $i++)
- {
- $sql = "SELECT cat_id FROM fm_building "
- . " WHERE property_id= '" .
$update[$i]['property_id'] ."'"
- . " AND building_id= '" .
$update[$i]['building_id'] ."'";
$this->db->query($sql,__LINE__,__FILE__);
! $this->db->next_record();
!
! if(!$this->db->f('cat_id')=='99')
{
! $j++;
! $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__);
}
- }
-
- $receipt['message'][]=array('msg'=>lang('%1 Buildings
has been updated to not active of %2 already not active',$j,count($update)));
-
- 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')
- );
! }
! }
! $j=0;
! for ($i=0; $i<count($update); $i++)
! {
! $sql = "SELECT cat_id FROM fm_property "
! . " WHERE property_id= '" .
$update[$i]['property_id'] ."'";
!
! $this->db->query($sql,__LINE__,__FILE__);
! $this->db->next_record();
! if(!$this->db->f('cat_id')=='99')
! {
! $j++;
! $this->db->query("UPDATE fm_property set
! cat_id='99' "
! . " WHERE property_id= '" .
$update[$i]['property_id'] ."'",__LINE__,__FILE__);
}
- }
! $receipt['message'][]=array('msg'=>lang('%1 Properties
has been updated to not active of %2 already not active',$j,count($update)));
!
! unset($outdated);
! unset($update);
return $receipt;
}
--- 653,719 ----
function update_cat()
{
! $location_types =
$this->soadmin_location->select_location_type();
! for ($type_id=count($location_types); $type_id>1;
$type_id--)
{
! $parent_table = 'fm_location' . ($type_id-1);
! $joinmethod .= " $this->join $parent_table";
! $paranthesis .='(';
! $on = 'ON';
! for ($i=($type_id-1); $i>0; $i--)
{
! $joinmethod .= " $on (fm_location" .
($type_id) .".loc" . ($i). ' = '.$parent_table . ".loc" . ($i) . ")";
! $on = 'AND';
! if($i==1)
! {
! $joinmethod .= ")";
! }
}
! $sql = "SELECT $parent_table.location_code
,count(*) as count_99 FROM $paranthesis fm_location$type_id $joinmethod where
fm_location$type_id.category='99' group by $parent_table.location_code ";
! $this->db->query($sql,__LINE__,__FILE__);
! while ($this->db->next_record())
{
!
$outdated[$this->db->f('location_code')]['count_99']=$this->db->f('count_99');
}
+ $sql = "SELECT $parent_table.location_code
,count(*) as count_all FROM $paranthesis fm_location$type_id $joinmethod group
by $parent_table.location_code ";
$this->db->query($sql,__LINE__,__FILE__);
! while ($this->db->next_record())
{
! if(
$outdated[$this->db->f('location_code')]['count_99']==$this->db->f('count_all'))
! {
! $update[]=array('location_code'
=> $this->db->f('location_code'));
! }
}
! $j=0;
! for ($i=0; $i<count($update); $i++)
{
! $sql = "SELECT category FROM
$parent_table WHERE location_code= '" . $update[$i]['location_code'] ."'";
!
$this->db->query($sql,__LINE__,__FILE__);
! $this->db->next_record();
! if(!$this->db->f('category')=='99')
! {
! $j++;
! $this->db->query("UPDATE
fm_location" . ($type_id-1). " set category='99' WHERE location_code= '" .
$update[$i]['location_code'] ."'",__LINE__,__FILE__);
! }
}
! $receipt['message'][]=array('msg'=>lang('%1
location %2 has been updated to not active of %3 already not
active',$j,$location_types[($type_id-2)]['descr'],count($update)));
+ unset($outdated);
+ unset($update);
+ unset($joinmethod);
+ unset($paranthesis);
+ }
return $receipt;
}
Index: class.uilocation.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uilocation.inc.php,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -r1.19 -r1.20
*** class.uilocation.inc.php 28 Jun 2003 17:57:57 -0000 1.19
--- class.uilocation.inc.php 5 Jul 2003 21:41:35 -0000 1.20
***************
*** 909,914 ****
--- 909,917 ----
$GLOBALS['phpgw']->xslttpl->add_file(array('location'));
+ $msgbox_data = $this->bocommon->msgbox_data($receipt);
+
$data = array
(
+ 'msgbox_data'
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
'done_action' =>
$GLOBALS['phpgw']->link('/admin/index.php'),
'update_action' =>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uilocation.update_cat'),
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: property/inc class.sogab.inc.php,1.12,1.13 class.solocation.inc.php,1.18,1.19class.uilocation.inc.php,1.19,1.20,
Sigurd Nes <address@hidden> <=