[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: property/inc class.soadmin_location.inc.php,1.4
From: |
Sigurd Nes <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: property/inc class.soadmin_location.inc.php,1.4,1.5 class.solocation.inc.php,1.1,1.2 class.uilocation.inc.php,1.1,1.2 |
Date: |
Mon, 02 Jun 2003 16:21:41 -0400 |
Update of /cvsroot/phpgroupware/property/inc
In directory subversions:/tmp/cvs-serv18761/inc
Modified Files:
class.soadmin_location.inc.php class.solocation.inc.php
class.uilocation.inc.php
Log Message:
no message
Index: class.soadmin_location.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.soadmin_location.inc.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** class.soadmin_location.inc.php 1 Jun 2003 21:38:06 -0000 1.4
--- class.soadmin_location.inc.php 2 Jun 2003 20:21:38 -0000 1.5
***************
*** 128,140 ****
while ($this->db->next_record())
{
! $standard[] = array
(
! 'column_name' =>
$this->db->f('column_name'),
! 'location_name' => $this->db->f('name'),
! 'location_type' =>
$this->db->f('location_type')
);
}
! //_debug_array($standard);
! return $standard;
}
--- 128,144 ----
while ($this->db->next_record())
{
! $config[] = array
(
! 'column_name' =>
$this->db->f('column_name'),
! 'f_key' =>
$this->db->f('f_key'),
! 'ref_to_category' =>
$this->db->f('ref_to_category'),
! 'query_value' =>
$this->db->f('query_value'),
! 'reference_table' =>
$this->db->f('reference_table'),
! 'location_name' =>
$this->db->f('name'),
! 'location_type' =>
$this->db->f('location_type')
);
}
! //_debug_array($config);
! return $config;
}
***************
*** 358,362 ****
}
! $sql = "SELECT $table.id ,$table.column_name
,$table.input_name, $table.datatype ,$type_table.name as type FROM $type_table
$this->join $table on $table.type_id = $type_table.id where $table.type_id=
'$type_id' $querymethod";
$this->db2->query($sql,__LINE__,__FILE__);
--- 362,366 ----
}
! $sql = "SELECT $table.id,$table.list
,$table.column_name ,$table.input_name, $table.datatype ,$type_table.name as
type FROM $type_table $this->join $table on $table.type_id = $type_table.id
where $table.type_id= '$type_id' $querymethod";
$this->db2->query($sql,__LINE__,__FILE__);
***************
*** 369,372 ****
--- 373,377 ----
(
'id' => $this->db->f('id'),
+ 'list' => $this->db->f('list'),
'name' => $this->db->f('column_name'),
'descr' => $this->db->f('input_name'),
Index: class.solocation.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.solocation.inc.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** class.solocation.inc.php 1 Jun 2003 21:38:47 -0000 1.1
--- class.solocation.inc.php 2 Jun 2003 20:21:38 -0000 1.2
***************
*** 18,21 ****
--- 18,22 ----
$this->grants =
$GLOBALS['phpgw']->acl->get_grants($this->currentapp);
$this->account =
$GLOBALS['phpgw_info']['user']['account_id'];
+ $this->soadmin_location =
CreateObject($this->currentapp.'.soadmin_location');
if
($GLOBALS['phpgw_info']['server']['db_type']=='pgsql')
***************
*** 81,157 ****
return;
}
! else
{
! /* $from .= "FROM '" .fm_location . "'. $type_id;
! if($type_id>1);
{
! $from = $this->join fm_location1 ON
fm_location$type_id.loc1 = fm_location1.loc1":
!
}
! $from .= " $this->join fm_part_of_town ON
fm_location1.part_of_town_id = fm_part_of_town.id
!
! if($stree_id)
! {
! $from .= " $this->join fm_streetaddress
ON fm_location1.street_id = fm_streetaddress.street_id
! }
! SELECT fm_location4.loc1, fm_location4.loc2, fm_location4.loc3,
fm_location4.loc4
! FROM ((fm_location1 LEFT JOIN fm_location2 ON fm_location1.loc1 =
fm_location2.loc1) LEFT JOIN fm_location3 ON (fm_location2.loc2 =
fm_location3.loc2) AND (fm_location2.loc1 = fm_location3.loc1)) LEFT JOIN
fm_location4 ON (fm_location3.loc3 = fm_location4.loc3) AND (fm_location3.loc2
= fm_location4.loc2) AND (fm_location3.loc1 = fm_location4.loc1);
! SELECT fm_location4.location_code
! FROM (fm_location4 LEFT JOIN fm_location3 ON (fm_location4.loc3 =
fm_location3.loc3) AND (fm_location4.loc2 = fm_location3.loc2) AND
(fm_location4.loc1 = fm_location3.loc1)) LEFT JOIN (fm_location1 RIGHT JOIN
fm_location2 ON fm_location1.loc1 = fm_location2.loc1) ON (fm_location3.loc2 =
fm_location2.loc2) AND (fm_location3.loc1 = fm_location2.loc1);
! */
! $from .= " FROM fm_location$type_id ";
! for ($j=($type_id-1); $j>0; $j--)
{
! $from .= " $this->join fm_location".
($j);
!
! $on = 'ON';
! for ($i=$j; $i>0; $i--)
{
! $from .= " $on (fm_location" .
($j+1) .".loc" . ($i). " = fm_location" . ($j) . ".loc" . ($i) . ") ";
! $on = 'AND';
!
}
}
- echo $from;
- $from = "FROM (fm_apartment $this->join"
- . " fm_property ON fm_apartment.property_id =
fm_property.property_id $this->join"
- . " fm_part_of_town ON
fm_property.part_of_town_id = fm_part_of_town.id $this->join"
- . " fm_streetaddress ON fm_apartment.street_id
= fm_streetaddress.street_id $this->join"
- . " fm_apartment_category ON
fm_apartment.cat_id = fm_apartment_category.id) $this->join fm_owner on
fm_property.owner_id = fm_owner.owner_id ";
! $from .= " $this->join fm_owner on
fm_location1.owner_id = fm_owner.owner_id ";
! }
if ($order)
{
! $ordermethod = " order by $order $sort";
}
else
{
! $ordermethod = ' order by
fm_apartment.property_id DESC';
}
if ($cat_id > 0)
{
! $filtermethod .= " WHERE
fm_apartment.cat_id='$cat_id' ";
}
else
{
! $filtermethod .= " WHERE
fm_apartment.cat_id!='99' ";
}
--- 82,168 ----
return;
}
!
! $cols = "fm_location" . ($type_id) .".location_code";
! for ($i=($type_id); $i>0; $i--)
{
+ $cols .= ",fm_location" . ($type_id) .".loc" .
($i);
+ }
! $fm_location_colst =
$this->soadmin_location->read_attrib(array('type_id'=>$type_id));
! for ($i=0;$i<count($fm_location_colst);$i++)
! {
! if($fm_location_colst[$i]['list']==1)
{
! $cols .= ",fm_location" . ($type_id)
.".".$fm_location_colst[$i]['name'];
}
+ }
+ //_debug_array($fm_location_colst);
! for ($j=($type_id-1); $j>0; $j--)
! {
! $joinmethod .= " $this->join fm_location". ($j);
+ $paranthesis .='(';
! $on = 'ON';
! for ($i=($j); $i>0; $i--)
! {
! $joinmethod .= " $on (fm_location" .
($j+1) .".loc" . ($i). " = fm_location" . ($j) . ".loc" . ($i) . ")";
! $on = 'AND';
! if($i==1)
! {
! $joinmethod .= ")";
! }
! }
! }
! $config = $this->soadmin_location->read_config('');
! for ($i=0;$i<count($config);$i++)
! {
! if (($config[$i]['location_type'] <= $type_id)
&& ($config[$i]['f_key'] ==1))
! {
! $joinmethod .= " $this->join " .
$config[$i]['reference_table'] . " ON ( fm_location" .
$config[$i]['location_type'] . "." . $config[$i]['column_name'] . "=" .
$config[$i]['reference_table'] . ".".$config[$i]['column_name']."))";
+ $paranthesis .='(';
+ }
! if (($config[$i]['location_type'] <= $type_id)
&& ($config[$i]['query_value'] ==1))
{
! $config_cols.= ',' .
$config[$i]['column_name'];
!
if($config[$i]['column_name']=='street_number')
{
! $config_cols.=
',fm_streetaddress.street_name';
}
}
+ }
+ $from .= " FROM $paranthesis fm_location$type_id ";
! //_debug_array($config);
!
if ($order)
{
! $ordermethod = ' order by fm_location' .
($type_id) .'.' . $order ." $sort";
}
else
{
! $ordermethod = ' order by fm_location' .
($type_id) .'.location_code DESC';
}
if ($cat_id > 0)
{
! $filtermethod .= " WHERE fm_location" .
($type_id). ".category=$cat_id ";
}
else
{
! $filtermethod .= " WHERE fm_location" .
($type_id). ".category !=99 ";
}
***************
*** 169,173 ****
}
! $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"
--- 180,184 ----
}
! /* $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"
***************
*** 177,180 ****
--- 188,196 ----
. " $filtermethod $querymethod ";
+
+ */
+ $sql = "SELECT $cols $config_cols $from $joinmethod
$filtermethod $querymethod";
+
+ echo $sql;
$this->db2->query($sql,__LINE__,__FILE__);
$this->total_records = $this->db2->num_rows();
Index: class.uilocation.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uilocation.inc.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** class.uilocation.inc.php 1 Jun 2003 21:38:47 -0000 1.1
--- class.uilocation.inc.php 2 Jun 2003 20:21:38 -0000 1.2
***************
*** 112,116 ****
--- 112,118 ----
'order' => $this->order,
'extra' => array('menuaction' =>
$this->currentapp.'.uilocation.index',
+
'type_id'
=>$type_id,
'cat_id'
=>$this->cat_id)
+
)),
'lang_floor' => lang('Floor'),
***************
*** 123,129 ****
(
'sort' => $this->sort,
!
'var' => 'property_id',
'order' => $this->order,
'extra' => array('menuaction' =>
$this->currentapp.'.uilocation.index',
'cat_id'
=>$this->cat_id)
)),
--- 125,132 ----
(
'sort' => $this->sort,
!
'var' => 'loc1',
'order' => $this->order,
'extra' => array('menuaction' =>
$this->currentapp.'.uilocation.index',
+
'type_id'
=>$type_id,
'cat_id'
=>$this->cat_id)
)),
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: property/inc class.soadmin_location.inc.php,1.4,1.5 class.solocation.inc.php,1.1,1.2 class.uilocation.inc.php,1.1,1.2,
Sigurd Nes <address@hidden> <=
- Prev by Date:
[Phpgroupware-cvs] CVS: email addressbook.php,1.38.2.1,1.38.2.2
- Next by Date:
[Phpgroupware-cvs] CVS: preferences/setup phpgw_br.lang,1.2,1.3 phpgw_cs.lang,1.2,1.3 phpgw_da.lang,1.4,1.5 phpgw_en.lang,1.16,1.17 phpgw_es.lang,1.7,1.8 phpgw_fi.lang,1.1,1.2 phpgw_fr.lang,1.4,1.5 phpgw_hu.lang,1.3,1.4 phpgw_it.lang,1.6,1.7 phpgw_ja.lang,1.8,1.9 phpgw_ko.lang,1.2,1.3 phpgw_nl.lang,1.4,1.5 phpgw_no.lang,1.2,1.3 phpgw_pl.lang,1.2,1.3 phpgw_pt.lang,1.2,1.3 phpgw_sv.lang,1.2,1.3 phpgw_zt.lang,1.1,1.2
- Previous by thread:
[Phpgroupware-cvs] CVS: email addressbook.php,1.38.2.1,1.38.2.2
- Next by thread:
[Phpgroupware-cvs] CVS: preferences/setup phpgw_br.lang,1.2,1.3 phpgw_cs.lang,1.2,1.3 phpgw_da.lang,1.4,1.5 phpgw_en.lang,1.16,1.17 phpgw_es.lang,1.7,1.8 phpgw_fi.lang,1.1,1.2 phpgw_fr.lang,1.4,1.5 phpgw_hu.lang,1.3,1.4 phpgw_it.lang,1.6,1.7 phpgw_ja.lang,1.8,1.9 phpgw_ko.lang,1.2,1.3 phpgw_nl.lang,1.4,1.5 phpgw_no.lang,1.2,1.3 phpgw_pl.lang,1.2,1.3 phpgw_pt.lang,1.2,1.3 phpgw_sv.lang,1.2,1.3 phpgw_zt.lang,1.1,1.2
- Index(es):