[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: property/inc class.bolocation.inc.php,1.1,1.2 cl
From: |
Sigurd Nes <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: property/inc class.bolocation.inc.php,1.1,1.2 class.soadmin_location.inc.php,1.5,1.6 class.solocation.inc.php,1.2,1.3 class.uilocation.inc.php,1.2,1.3 |
Date: |
Wed, 04 Jun 2003 08:24:43 -0400 |
Update of /cvsroot/phpgroupware/property/inc
In directory subversions:/tmp/cvs-serv14172/inc
Modified Files:
class.bolocation.inc.php class.soadmin_location.inc.php
class.solocation.inc.php class.uilocation.inc.php
Log Message:
no message
Index: class.bolocation.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.bolocation.inc.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** class.bolocation.inc.php 1 Jun 2003 21:38:47 -0000 1.1
--- class.bolocation.inc.php 4 Jun 2003 12:24:40 -0000 1.2
***************
*** 64,67 ****
--- 64,68 ----
$cat_id = get_var('cat_id',array('POST','GET'));
+
if ($start)
{
***************
*** 77,81 ****
$this->query = $query;
}
! if(!empty($filter))
{
$this->filter = $filter;
--- 78,82 ----
$this->query = $query;
}
! if(isset($filter))
{
$this->filter = $filter;
***************
*** 163,172 ****
'filter' => $this->filter,'cat_id' => $this->cat_id,'type_id' =>
$type_id));
$this->total_records = $this->so->total_records;
!
! for ($i=0; $i<count($location); $i++)
! {
! $location[$i]['date'] =
$GLOBALS['phpgw']->common->show_date($location[$i]['date']);
! $location[$i]['owner'] =
$GLOBALS['phpgw']->accounts->id2name($location[$i]['owner']);
! }
return $location;
}
--- 164,168 ----
'filter' => $this->filter,'cat_id' => $this->cat_id,'type_id' =>
$type_id));
$this->total_records = $this->so->total_records;
! $this->uicols = $this->so->uicols;
return $location;
}
Index: class.soadmin_location.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.soadmin_location.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** class.soadmin_location.inc.php 2 Jun 2003 20:21:38 -0000 1.5
--- class.soadmin_location.inc.php 4 Jun 2003 12:24:40 -0000 1.6
***************
*** 131,134 ****
--- 131,135 ----
(
'column_name' =>
$this->db->f('column_name'),
+ 'input_name' =>
$this->db->f('input_name'),
'f_key' =>
$this->db->f('f_key'),
'ref_to_category' =>
$this->db->f('ref_to_category'),
Index: class.solocation.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.solocation.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** class.solocation.inc.php 2 Jun 2003 20:21:38 -0000 1.2
--- class.solocation.inc.php 4 Jun 2003 12:24:40 -0000 1.3
***************
*** 70,74 ****
$start=0;
}
! $filter =
(isset($data['filter'])?$data['filter']:'');
$query =
(isset($data['query'])?$data['query']:'');
$sort =
(isset($data['sort'])?$data['sort']:'DESC');
--- 70,74 ----
$start=0;
}
! $filter =
(isset($data['filter'])?$data['filter']:0);
$query =
(isset($data['query'])?$data['query']:'');
$sort =
(isset($data['sort'])?$data['sort']:'DESC');
***************
*** 82,90 ****
return;
}
-
$cols = "fm_location" . ($type_id) .".location_code";
! for ($i=($type_id); $i>0; $i--)
{
! $cols .= ",fm_location" . ($type_id) .".loc" .
($i);
}
--- 82,98 ----
return;
}
$cols = "fm_location" . ($type_id) .".location_code";
! $cols_return[] = 'location_code';
!
! $location_types =
$this->soadmin_location->select_location_type();
!
! for ($i=0; $i<($type_id); $i++)
{
!
! $uicols['name'][] ='loc' .
$location_types[$i]['id'];
! $uicols['descr'][]
=$location_types[$i]['name'];
! $uicols['statustext'][]
=$location_types[$i]['descr'];
! $cols .= ",fm_location" . ($type_id) .".loc" .
$location_types[$i]['id'];
! $cols_return[] = 'loc' .
$location_types[$i]['id'];
}
***************
*** 96,99 ****
--- 104,111 ----
{
$cols .= ",fm_location" . ($type_id)
.".".$fm_location_colst[$i]['name'];
+ $cols_return[] =
$fm_location_colst[$i]['name'];
+ $uicols['name'][] =
$fm_location_colst[$i]['name'];
+ $uicols['descr'][] =
$fm_location_colst[$i]['descr'];
+ $uicols['statustext'][] =
$fm_location_colst[$i]['descr'];
}
}
***************
*** 120,125 ****
--- 132,146 ----
}
+
$config = $this->soadmin_location->read_config('');
+ //_debug_array($config);
+
+ $cols.= ',fm_location1.name as property_name';
+ $cols_return[] = 'property_name';
+ $uicols['name'][] = 'property_name';
+ $uicols['descr'][] = lang('Property Name');
+ $uicols['statustext'][] = lang('Property Name');
+
for ($i=0;$i<count($config);$i++)
***************
*** 134,145 ****
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 ";
--- 155,189 ----
if (($config[$i]['location_type'] <= $type_id)
&& ($config[$i]['query_value'] ==1))
{
!
if($config[$i]['column_name']=='street_number')
{
! $sub_query= "or street_name
LIKE '%$query%'";
!
! $cols.=
',fm_streetaddress.street_name';
! $cols_return[]
= 'street_name';
! $uicols['name'][]
= 'street_name';
! $uicols['descr'][]
= lang('street name');
! $uicols['statustext'][] =
lang('street name');
!
! $cols.= ',' .
$config[$i]['column_name'];
! $cols_return[]
= $config[$i]['column_name'];
! $uicols['name'][]
= $config[$i]['column_name'];
! $uicols['descr'][]
= lang($config[$i]['input_name']);
! $uicols['statustext'][] =
lang($config[$i]['input_name']);
!
! }
! else
! {
! $cols.= ',' .
$config[$i]['column_name'];
! $cols_return[]
= $config[$i]['column_name'];
! $uicols['name'][]
= $config[$i]['column_name'];
! $uicols['descr'][]
= $config[$i]['input_name'];
! $uicols['statustext'][] =
$config[$i]['input_name'];
}
}
}
+ $this->uicols = $uicols;
+
$from .= " FROM $paranthesis fm_location$type_id ";
***************
*** 167,171 ****
}
! if ($filter)
{
$filtermethod .= " AND
fm_owner.category='$filter' ";
--- 211,215 ----
}
! if ($filter > 0)
{
$filtermethod .= " AND
fm_owner.category='$filter' ";
***************
*** 177,223 ****
$query = ereg_replace('"','',$query);
! $querymethod = " AND fm_apartment.property_id
LIKE '%$query%' or street_name LIKE '%$query%' or fm_apartment.location_code
LIKE '%$query%'";
}
! /* $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"
! . " 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 "
! . " $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();
$this->db->limit_query($sql .
$ordermethod,$start,__LINE__,__FILE__);
while ($this->db->next_record())
{
! $ngrants =
(int)$this->grants[$this->db->f('apartment_owner')];
! $apartment[] = array
! (
! 'location_code' =>
$this->db->f('location_code'),
! 'property_id' =>
$this->db->f('property_id'),
! 'property_name' => $this->db->f('name'),
! 'building_id' =>
$this->db->f('building_id'),
! 'entrance_id' =>
$this->db->f('entrance_id'),
! 'floor' =>
$this->db->f('floor'),
! 'apartment_id' =>
$this->db->f('apartment_id'),
! 'street_name' =>
$this->db->f('street_name'),
! 'street_number' =>
$this->db->f('street_number'),
! 'owner' =>
$this->db->f('owner'),
! 'access' =>
$this->db->f('access'),
! 'date' =>
$this->db->f('entry_date'),
! 'cat_id' =>
(int)$this->db->f('cat_id'),
! 'descr' =>
stripslashes($this->db->f('descr')),
! 'grants' => $ngrants
! );
}
! return $apartment;
}
--- 221,247 ----
$query = ereg_replace('"','',$query);
! $querymethod = " AND (fm_location" .
($type_id).".loc1 LIKE '%$query%' $sub_query or fm_location" .
($type_id).".location_code LIKE '%$query%')";
}
! $sql = "SELECT $cols $from $joinmethod $filtermethod
$querymethod";
! //echo $sql;
$this->db2->query($sql,__LINE__,__FILE__);
$this->total_records = $this->db2->num_rows();
$this->db->limit_query($sql .
$ordermethod,$start,__LINE__,__FILE__);
+ //_debug_array($cols_return);
+ $test='location_code';
+ $j=0;
while ($this->db->next_record())
{
! for ($i=0;$i<count($cols_return);$i++)
! {
! $location[$j][$cols_return[$i]] =
$this->db->f($cols_return[$i]);
! }
! $j++;
}
!
! return $location;
}
Index: class.uilocation.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uilocation.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** class.uilocation.inc.php 2 Jun 2003 20:21:38 -0000 1.2
--- class.uilocation.inc.php 4 Jun 2003 12:24:40 -0000 1.3
***************
*** 79,126 ****
$location_list = $this->bo->read($type_id);
while (is_array($location_list) && list(,$location) =
each($location_list))
{
! $content[] = array
! (
! 'property_id'
=> $location['property_id'],
! 'building_id'
=> $location['building_id'],
! 'entrance_id'
=> $location['entrance_id'],
! 'floor'
=> $location['floor'],
! 'apartment_id'
=> $location['apartment_id'],
! 'street_name'
=> $location['street_name'],
! 'street_number'
=> $location['street_number'],
! 'descr'
=> $location['descr'],
! 'property_name'
=> $location['property_name'],
! 'link_view'
=>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uilocation.view&location_code='
. $location['location_code']),
! 'link_edit'
=>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uilocation.edit&location_code='
. $location['location_code']),
! 'link_delete'
=>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uilocation.delete&location_code='
. $location['location_code']),
! 'lang_view_statustext' =>
lang('view the location'),
! 'lang_edit_statustext' =>
lang('edit the location'),
! 'lang_delete_statustext' =>
lang('delete the location'),
! 'text_view'
=> lang('view'),
! 'text_edit'
=> lang('edit'),
! 'text_delete'
=> lang('delete')
! );
! }
! $table_header[] = array
! (
! 'sort_street_name' =>
$this->nextmatchs->show_sort_order(array
!
(
!
'sort' => $this->sort,
!
'var' => 'street_name',
!
'order' => $this->order,
!
'extra' => array('menuaction' =>
$this->currentapp.'.uilocation.index',
!
'type_id'
=>$type_id,
!
'cat_id'
=>$this->cat_id)
!
)),
! 'lang_floor' => lang('Floor'),
! 'lang_street_name' => lang('Street name'),
! 'lang_street_number'=> lang('Street number'),
! 'lang_view' => lang('view'),
! 'lang_edit' => lang('edit'),
! 'lang_delete' => lang('delete'),
! 'sort_property_id' =>
$this->nextmatchs->show_sort_order(array
(
'sort' => $this->sort,
--- 79,116 ----
$location_list = $this->bo->read($type_id);
+ $uicols = $this->bo->uicols;
+ //_debug_array($location_list);
+ //_debug_array($uicols);
+
+ $j=0;
while (is_array($location_list) && list(,$location) =
each($location_list))
{
! for ($i=0;$i<count($uicols['name']);$i++)
! {
! $content[$j]['row'][$i]['value']
= $location[$uicols['name'][$i]];
! }
! $content[$j]['row'][$i]['statustext']
= lang('view the location');
! $content[$j]['row'][$i]['text']
= lang('view');
! $content[$j]['row'][$i++]['link']
=
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uilocation.view&location_code='
. $location['location_code']);
! $content[$j]['row'][$i]['statustext']
= lang('edit the location');
! $content[$j]['row'][$i]['text']
= lang('edit');
! $content[$j]['row'][$i++]['link']
=
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uilocation.edit&location_code='
. $location['location_code']);
! $content[$j]['row'][$i]['statustext']
= lang('delete the location');
! $content[$j]['row'][$i]['text']
= lang('delete');
! $content[$j]['row'][$i++]['link']
=
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uilocation.delete&location_code='
. $location['location_code']);
! $j++;
! }
! //_debug_array($content);
! for ($i=0;$i<count($uicols['descr']);$i++)
! {
! $table_header[$i]['header'] =
$uicols['descr'][$i];
! $table_header[$i]['width'] = '5%';
! $table_header[$i]['align'] =
'center';
! if($uicols['descr'][$i]=='loc1')
! {
! $table_header[$i]['sort_link'] =true;
! $table_header[$i]['sort']
= $this->nextmatchs->show_sort_order(array
(
'sort' => $this->sort,
***************
*** 129,141 ****
'extra' => array('menuaction' =>
$this->currentapp.'.uilocation.index',
'type_id'
=>$type_id,
'cat_id'
=>$this->cat_id)
!
)),
! 'lang_property_id' => lang('property id'),
! 'lang_property_id' =>
lang('property id'),
! 'lang_building_id' =>
lang('building id'),
! 'lang_entrance_id' =>
lang('entrance id'),
! 'lang_apartment_id' =>
lang('apartment id'),
! 'lang_owner' => lang('owner')
! );
$table_add[] = array
--- 119,142 ----
'extra' => array('menuaction' =>
$this->currentapp.'.uilocation.index',
'type_id'
=>$type_id,
+
'query'
=>$this->query,
'cat_id'
=>$this->cat_id)
!
!
));
!
! }
! }
!
! $table_header[$i]['width'] = '5%';
! $table_header[$i]['align'] =
'center';
! $table_header[$i++]['header'] = lang('view');
! $table_header[$i]['width'] = '5%';
! $table_header[$i]['align'] =
'center';
! $table_header[$i++]['header'] = lang('edit');
! $table_header[$i]['width'] = '5%';
! $table_header[$i]['align'] =
'center';
! $table_header[$i++]['header'] =
lang('delete');
!
! //_debug_array($table_header);
!
$table_add[] = array
***************
*** 143,147 ****
'lang_add' =>
lang('add'),
'lang_add_statustext' => lang('add a
location'),
! 'add_action' =>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uilocation.edit')
);
--- 144,148 ----
'lang_add' =>
lang('add'),
'lang_add_statustext' => lang('add a
location'),
! 'add_action' =>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uilocation.edit&type_id='
. $type_id)
);
***************
*** 154,158 ****
'district_id'
=>$this->district_id,
'filter'
=>$this->filter,
! 'query'
=>$this->query
);
--- 155,160 ----
'district_id'
=>$this->district_id,
'filter'
=>$this->filter,
! 'query'
=>$this->query,
! 'type_id'
=>$type_id
);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: property/inc class.bolocation.inc.php,1.1,1.2 class.soadmin_location.inc.php,1.5,1.6 class.solocation.inc.php,1.2,1.3 class.uilocation.inc.php,1.2,1.3,
Sigurd Nes <address@hidden> <=