[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: property/inc class.bocommon.inc.php,1.52,1.53 cl
From: |
Sigurd Nes <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: property/inc class.bocommon.inc.php,1.52,1.53 class.boequipment.inc.php,1.9,1.10 class.bolocation.inc.php,1.9,1.10 class.socommon.inc.php,1.24,1.25 class.soequipment.inc.php,1.13,1.14 class.solocation.inc.php,1.7,1.8 class.solookup.inc.php,1.18,1.19 class.uilocation.inc.php,1.11,1.12 |
Date: |
Mon, 16 Jun 2003 08:44:51 -0400 |
Update of /cvsroot/phpgroupware/property/inc
In directory subversions:/tmp/cvs-serv7841/inc
Modified Files:
class.bocommon.inc.php class.boequipment.inc.php
class.bolocation.inc.php class.socommon.inc.php
class.soequipment.inc.php class.solocation.inc.php
class.solookup.inc.php class.uilocation.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.52
retrieving revision 1.53
diff -C2 -r1.52 -r1.53
*** class.bocommon.inc.php 13 Jun 2003 13:15:46 -0000 1.52
--- class.bocommon.inc.php 16 Jun 2003 12:44:48 -0000 1.53
***************
*** 780,783 ****
--- 780,791 ----
}
+ function generate_sql($data)
+ {
+ $sql= $this->socommon->generate_sql($data);
+ $this->uicols = $this->socommon->uicols;
+ $this->cols_return = $this->socommon->cols_return;
+ return $sql;
+ }
+
function select_part_of_town($format='',$selected='')
{
Index: class.boequipment.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.boequipment.inc.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** class.boequipment.inc.php 23 May 2003 08:40:19 -0000 1.9
--- class.boequipment.inc.php 16 Jun 2003 12:44:48 -0000 1.10
***************
*** 78,82 ****
$this->query = $query;
}
! if(!empty($filter))
{
$this->filter = $filter;
--- 78,82 ----
$this->query = $query;
}
! if(isset($filter))
{
$this->filter = $filter;
Index: class.bolocation.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.bolocation.inc.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** class.bolocation.inc.php 16 Jun 2003 08:53:22 -0000 1.9
--- class.bolocation.inc.php 16 Jun 2003 12:44:48 -0000 1.10
***************
*** 64,67 ****
--- 64,69 ----
$cat_id = get_var('cat_id',array('POST','GET'));
$lookup_tenant =
get_var('lookup_tenant',array('POST','GET'));
+ $district_id =
get_var('district_id',array('POST','GET'));
+ $part_of_town_id =
get_var('part_of_town_id',array('POST','GET'));
if ($start)
***************
*** 94,101 ****
$this->cat_id = $cat_id;
}
! if(isset($cat_id))
{
$this->lookup_tenant = $lookup_tenant;
}
}
--- 96,111 ----
$this->cat_id = $cat_id;
}
! if(isset($lookup_tenant))
{
$this->lookup_tenant = $lookup_tenant;
}
+ if(isset($part_of_town_id))
+ {
+ $this->part_of_town_id = $part_of_town_id;
+ }
+ if(isset($district_id))
+ {
+ $this->district_id = $district_id;
+ }
}
***************
*** 104,113 ****
$data =
$GLOBALS['phpgw']->session->appsession('session_data','location');
! $this->start = $data['start'];
! $this->query = $data['query'];
! $this->filter = $data['filter'];
! $this->sort = $data['sort'];
! $this->order = $data['order'];
! $this->cat_id = $data['cat_id'];
}
--- 114,125 ----
$data =
$GLOBALS['phpgw']->session->appsession('session_data','location');
! $this->start = $data['start'];
! $this->query = $data['query'];
! $this->filter = $data['filter'];
! $this->sort = $data['sort'];
! $this->order = $data['order'];
! $this->cat_id = $data['cat_id'];
! $this->part_of_town_id = $data['part_of_town_id'];
! $this->district_id = $data['district_id'];
}
***************
*** 274,281 ****
$lookup_functions[$m]['action']
= 'Window1=window.open('."'" . $location_link .'&lookup_tenant=1&type_id=' .
$config[$j]['location_type'] . '&lookup_name=' . $i ."'"
.',"Search","width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");';
!
$location['location'][$i]['lookup_link'] = True;
$location['location'][$i]['name']
= lang('Tenant');
$location['location'][$i]['input_type']
= 'hidden';
!
$location['location'][$i]['value'] =
$data['values'][$config[$j]['column_name']];
$location['location'][$i]['lookup_function_call']
= $lookup_functions[$m]['name'];
$location['location'][$i]['statustext']
= lang('tenant');
--- 286,294 ----
$lookup_functions[$m]['action']
= 'Window1=window.open('."'" . $location_link .'&lookup_tenant=1&type_id=' .
$config[$j]['location_type'] . '&lookup_name=' . $i ."'"
.',"Search","width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");';
!
$location['location'][$i]['lookup_link']
= True;
$location['location'][$i]['name']
= lang('Tenant');
$location['location'][$i]['input_type']
= 'hidden';
!
$location['location'][$i]['input_name']
= 'tenant_id';
!
$location['location'][$i]['value']
= $data['values'][$config[$j]['column_name']];
$location['location'][$i]['lookup_function_call']
= $lookup_functions[$m]['name'];
$location['location'][$i]['statustext']
= lang('tenant');
***************
*** 284,287 ****
--- 297,301 ----
$location['location'][$i]['extra'][0]['input_type']
= 'text';
$location['location'][$i]['extra'][0]['input_name']
= 'last_name';
+
$location['location'][$i]['extra'][0]['readonly']
= True;
$input_name[]
= $location['location'][$i]['extra'][0]['input_name'];
$location['location'][$i]['extra'][0]['size']
= 15;
***************
*** 292,295 ****
--- 306,310 ----
$location['location'][$i]['extra'][1]['input_type']
= 'text';
$location['location'][$i]['extra'][1]['input_name']
= 'first_name';
+
$location['location'][$i]['extra'][1]['readonly']
= True;
$input_name[]
= $location['location'][$i]['extra'][1]['input_name'];
$location['location'][$i]['extra'][1]['size']
= 15;
***************
*** 298,306 ****
$location['location'][$i]['extra'][1]['statustext']
= lang('first name');
!
$location['location'][$i]['extra'][2]['input_type']
= 'text';
$location['location'][$i]['extra'][2]['input_name']
= 'contact_phone';
$input_name[]
= $location['location'][$i]['extra'][2]['input_name'];
$location['location'][$i]['extra'][2]['size']
= 12;
!
$location['location'][$i]['extra'][2]['lookup_function_call'] =
$lookup_functions[$m]['name'];
$location['location'][$i]['extra'][2]['value']
= $data['values']['contact_phone'];
$location['location'][$i]['extra'][2]['statustext']
= lang('contact phone');
--- 313,322 ----
$location['location'][$i]['extra'][1]['statustext']
= lang('first name');
!
$location['location'][$i]['extra'][2]['input_type']
= 'hidden'; // change this
$location['location'][$i]['extra'][2]['input_name']
= 'contact_phone';
$input_name[]
= $location['location'][$i]['extra'][2]['input_name'];
$location['location'][$i]['extra'][2]['size']
= 12;
!
$location['location'][$i]['extra'][2]['lookup_function_call'] =
'';//$lookup_functions[$m]['name'];
! $insert_record[]
= 'contact_phone';
$location['location'][$i]['extra'][2]['value']
= $data['values']['contact_phone'];
$location['location'][$i]['extra'][2]['statustext']
= lang('contact phone');
***************
*** 431,435 ****
{
$location = $this->so->read(array('start' =>
$this->start,'query' => $this->query,'sort' => $this->sort,'order' =>
$this->order,
!
'filter' => $this->filter,'cat_id' => $this->cat_id,'type_id' =>
$type_id,'lookup_tenant'=>$this->lookup_tenant));
$this->total_records = $this->so->total_records;
$this->uicols = $this->so->uicols;
--- 447,452 ----
{
$location = $this->so->read(array('start' =>
$this->start,'query' => $this->query,'sort' => $this->sort,'order' =>
$this->order,
!
'filter' => $this->filter,'cat_id' => $this->cat_id,'type_id' =>
$type_id,'lookup_tenant'=>$this->lookup_tenant,
!
'district_id'=>$this->district_id));
$this->total_records = $this->so->total_records;
$this->uicols = $this->so->uicols;
Index: class.socommon.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.socommon.inc.php,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -r1.24 -r1.25
*** class.socommon.inc.php 15 Jun 2003 19:41:26 -0000 1.24
--- class.socommon.inc.php 16 Jun 2003 12:44:48 -0000 1.25
***************
*** 34,39 ****
! function
generate_sql($entity_table='',$cols='',$cols_return='',$uicols='',$joinmethod='',$paranthesis='',$query='')
{
$location_types =
$this->soadmin_location->select_location_type();
--- 34,47 ----
! function generate_sql($data)
{
+
+ $entity_table =
(isset($data['entity_table'])?$data['entity_table']:'');
+ $cols =
(isset($data['cols'])?$data['cols']:'');
+ $cols_return =
(isset($data['cols_return'])?$data['cols_return']:'');
+ $uicols =
(isset($data['uicols'])?$data['uicols']:'');
+ $joinmethod =
(isset($data['joinmethod'])?$data['joinmethod']:'');
+ $paranthesis =
(isset($data['paranthesis'])?$data['paranthesis']:'');
+ $query =
(isset($data['query'])?$data['query']:'');
$location_types =
$this->soadmin_location->select_location_type();
Index: class.soequipment.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.soequipment.inc.php,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** class.soequipment.inc.php 13 Jun 2003 11:05:30 -0000 1.13
--- class.soequipment.inc.php 16 Jun 2003 12:44:48 -0000 1.14
***************
*** 16,22 ****
$this->db = $GLOBALS['phpgw']->db;
$this->db2 = $this->db;
- $this->grants =
$GLOBALS['phpgw']->acl->get_grants($this->currentapp);
$this->account =
$GLOBALS['phpgw_info']['user']['account_id'];
! $this->bocommon =
CreateObject($this->currentapp.'.bocommon',True);
if
($GLOBALS['phpgw_info']['server']['db_type']=='pgsql')
--- 16,21 ----
$this->db = $GLOBALS['phpgw']->db;
$this->db2 = $this->db;
$this->account =
$GLOBALS['phpgw_info']['user']['account_id'];
! $this->bocommon =
CreateObject($this->currentapp.'.bocommon');
if
($GLOBALS['phpgw_info']['server']['db_type']=='pgsql')
***************
*** 52,56 ****
while ($this->db->next_record())
{
- $ngrants =
(int)$this->grants[$this->db->f('fm_equipment.owner')];
$filter_list[] = array
(
--- 51,54 ----
***************
*** 64,67 ****
--- 62,66 ----
}
+
function read($data)
{
***************
*** 84,87 ****
--- 83,126 ----
}
+ $entity_table = 'fm_equipment';
+
+ $cols = $entity_table . '.location_code';
+ $cols_return[] = 'location_code';
+
+ $cols.= ',equipment_id';
+ $cols_return[] =
'equipment_id';
+ $uicols['input_type'][] = 'text';
+ $uicols['name'][] =
'equipment_id';
+ $uicols['descr'][] =
lang('Equipment');
+ $uicols['statustext'][] = lang('Equipment ID');
+
+ $cols.= ",$entity_table.descr";
+ $cols_return[] = 'descr';
+ $uicols['input_type'][] = 'text';
+ $uicols['name'][] = 'descr';
+ $uicols['descr'][] = lang('descr');
+ $uicols['statustext'][] = lang('descr');
+
+ $cols.= ",fm_equipment_type.name as equipment_type";
+ $cols_return[] =
'equipment_type';
+ $uicols['input_type'][] = 'hidden';
+ $uicols['name'][] =
'equipment_type';
+ $uicols['descr'][] =
lang('equipment type');
+ $uicols['statustext'][] = lang('equipment
type');
+
+ $joinmethod .= " $this->join fm_equipment_type ON
(fm_equipment.equipment_type_id = fm_equipment_type.id))";
+
+ $paranthesis .='(';
+
+ if($filter)
+ {
+ $cols.= ",c,i,n,t,d";
+ $joinmethod .= " $this->join
fm_equipment_attrib ON (fm_equipment.equipment_id =
fm_equipment_attrib.entity_id))";
+
+ $paranthesis .='(';
+ }
+
+ $sql =
$this->bocommon->generate_sql(array('entity_table'=>$entity_table,'cols'=>$cols,'cols_return'=>$cols_return,
+
'uicols'=>$uicols,'joinmethod'=>$joinmethod,'paranthesis'=>$paranthesis,'query'=>$query));
if ($order)
{
***************
*** 90,122 ****
else
{
! $ordermethod = ' order by equipment_id ASC';
}
! $filtermethod = ' ( fm_equipment.owner=' .
$this->account;
! if (is_array($this->grants))
! {
! $grants = $this->grants;
! while (list($user) = each($grants))
! {
! $public_user_list[] = $user;
! }
! reset($public_user_list);
! $filtermethod .= " OR
(fm_equipment.access='public' OR fm_equipment.owner IN(" .
implode(',',$public_user_list) . ")))";
! }
! else
{
! $filtermethod .= ' )';
}
! if ($cat_id > 0)
{
! $filtermethod .= " AND
fm_equipment.equipment_type_id='$cat_id' ";
}
if ($district_id > 0)
{
! $filtermethod .= " AND
district_id='$district_id' ";
}
-
if($query)
{
--- 129,153 ----
else
{
! $ordermethod = ' order by fm_equipment.loc1
DESC';
}
! $where = 'WHERE';
! if ($cat_id > 0)
{
! $filtermethod .= " $where fm_equipment.
equipment_type_id='$cat_id' ";
! $where = 'AND';
}
! if($filter)
{
! $filtermethod .= " $where
fm_equipment_attrib.attrib_id='$filter' ";
! $where = 'AND';
}
if ($district_id > 0)
{
! $filtermethod .= " $where
district_id='$district_id' ";
! $where = 'AND';
}
if($query)
{
***************
*** 124,136 ****
$query = ereg_replace('"','',$query);
! $querymethod = " AND fm_equipment.property_id
LIKE '%$query%' or fm_equipment.descr LIKE '%$query%' or fm_equipment.address
LIKE '%$query%'";
}
! $sql = "SELECT
equipment_id,fm_equipment.location_code,fm_equipment.descr,fm_equipment.address
as address, fm_equipment_type.name as category"
! . " FROM fm_equipment $this->join"
! . " fm_property ON fm_equipment.property_id =
fm_property.property_id $this->join"
! . " fm_part_of_town ON fm_property.part_of_town_id =
fm_part_of_town.part_of_town_id $this->join"
! . " fm_equipment_type ON fm_equipment.equipment_type_id
= fm_equipment_type.id "
! . " WHERE $filtermethod $querymethod ";
$this->db2->query($sql,__LINE__,__FILE__);
--- 155,178 ----
$query = ereg_replace('"','',$query);
! $sub_query = $this->socommon->sub_query;
! $querymethod = " $where ( fm_equipment.descr
LIKE '%$query%' OR fm_equipment.location_code LIKE '%$query%' OR equipment_id
LIKE '%$query%' $sub_query)";
! $where = 'AND';
}
! $sql .= " $filtermethod $querymethod";
!
! //echo $sql;
! $uicols = $this->bocommon->uicols;
! $cols_return = $this->bocommon->cols_return;
!
! if($filter)
! {
! $uicols['input_type'][] = 'text';
! $uicols['name'][] =
'attribute';
! $uicols['descr'][] =
lang('attribute');
! $uicols['statustext'][] =
lang('attribute');
! }
!
! $this->uicols = $uicols;
$this->db2->query($sql,__LINE__,__FILE__);
***************
*** 138,164 ****
$this->db->limit_query($sql .
$ordermethod,$start,__LINE__,__FILE__);
while ($this->db->next_record())
{
! $ngrants =
(int)$this->grants[$this->db->f('fm_equipment.owner')];
! $equipment_list[] = array
! (
! 'equipment_id' =>
$this->db->f('equipment_id'),
! 'location_code' =>
$this->db->f('location_code'),
! 'address' =>
$this->db->f('address'),
! 'category' =>
$this->db->f('category'),
! 'descr' =>
$this->db->f('descr'),
! 'grants' => $ngrants
! );
! }
! //_debug_array($equipment_list);
!
! if($filter)
! {
! while (is_array($equipment_list) &&
list(,$equipment) = each($equipment_list))
{
! $sql = "SELECT c,i,n,t,d from
fm_equipment_attrib where entity_id ='" . $equipment['equipment_id'] . "' and
attrib_id='$filter'";
!
$this->db->query($sql,__LINE__,__FILE__);
! $this->db->next_record();
$char_value = $this->db->f('c');
$int_value = $this->db->f('i');
--- 180,193 ----
$this->db->limit_query($sql .
$ordermethod,$start,__LINE__,__FILE__);
+ $j=0;
while ($this->db->next_record())
{
! for ($i=0;$i<count($cols_return);$i++)
{
! $equipment_list[$j][$cols_return[$i]] =
$this->db->f($cols_return[$i]);
! }
+ if($filter)
+ {
$char_value = $this->db->f('c');
$int_value = $this->db->f('i');
***************
*** 167,192 ****
$date_value = $this->db->f('d');
$attribute = $char_value .$int_value .
$num_value . $memo_value . $date_value;
!
! if ($attribute)
! {
! $equipment_list2[] = array
! (
! 'equipment_id' =>
$equipment['equipment_id'],
! 'location_code' =>
$equipment['location_code'],
! 'address'
=> $equipment['address'],
! 'category'
=> $equipment['category'],
! 'descr'
=> $equipment['descr'],
! 'grants'
=> $equipment['grants'],
! 'attribute'
=> $attribute
! );
! }
}
! $this->total_records = count($equipment_list2);
! return $equipment_list2;
}
return $equipment_list;
}
function read_single($equipment_id)
--- 196,208 ----
$date_value = $this->db->f('d');
$attribute = $char_value .$int_value .
$num_value . $memo_value . $date_value;
!
$equipment_list[$j]['attribute']=$attribute;
}
! $j++;
}
return $equipment_list;
}
+
function read_single($equipment_id)
Index: class.solocation.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.solocation.inc.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** class.solocation.inc.php 16 Jun 2003 08:53:22 -0000 1.7
--- class.solocation.inc.php 16 Jun 2003 12:44:48 -0000 1.8
***************
*** 104,107 ****
--- 104,109 ----
$type_id =
(isset($data['type_id'])?$data['type_id']:'');
$lookup_tenant =
(isset($data['lookup_tenant'])?$data['lookup_tenant']:'');
+ $district_id =
(isset($data['district_id'])?$data['district_id']:'');
+
}
***************
*** 290,293 ****
--- 292,302 ----
$filtermethod .= " AND
fm_owner.category='$filter' ";
}
+
+ if ($district_id > 0)
+ {
+ $filtermethod .= " AND
fm_part_of_town.district_id='$district_id' ";
+ }
+
+
if($query)
Index: class.solookup.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.solookup.inc.php,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -r1.18 -r1.19
*** class.solookup.inc.php 13 Jun 2003 11:05:30 -0000 1.18
--- class.solookup.inc.php 16 Jun 2003 12:44:48 -0000 1.19
***************
*** 1128,1132 ****
$paranthesis .='(';
! $sql =
$this->socommon->generate_sql($entity_table,$cols,$cols_return,$uicols,$joinmethod,$paranthesis,$query);
if ($order)
--- 1128,1133 ----
$paranthesis .='(';
! $sql =
$this->socommon->generate_sql(array('entity_table'=>$entity_table,'cols'=>$cols,'cols_return'=>$cols_return,
!
'uicols'=>$uicols,'joinmethod'=>$joinmethod,'paranthesis'=>$paranthesis,'query'=>$query));
if ($order)
Index: class.uilocation.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uilocation.inc.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** class.uilocation.inc.php 16 Jun 2003 08:53:22 -0000 1.11
--- class.uilocation.inc.php 16 Jun 2003 12:44:48 -0000 1.12
***************
*** 48,51 ****
--- 48,52 ----
$this->cat_id =
$this->bo->cat_id;
$this->part_of_town_id =
$this->bo->part_of_town_id;
+ $this->district_id =
$this->bo->district_id;
$GLOBALS['phpgw']->session->appsession('sub',$this->currentapp,'property');
***************
*** 56,65 ****
$data = array
(
! 'start' => $this->start,
! 'query' => $this->query,
! 'sort' => $this->sort,
! 'order' => $this->order,
! 'filter' => $this->filter,
! 'cat_id' => $this->cat_id
);
$this->bo->save_sessiondata($data);
--- 57,68 ----
$data = array
(
! 'start' => $this->start,
! 'query' => $this->query,
! 'sort' => $this->sort,
! 'order' => $this->order,
! 'filter' =>
$this->filter,
! 'cat_id' =>
$this->cat_id,
! 'part_of_town_id' =>
$this->part_of_town_id,
! 'district_id' => $this->district_id
);
$this->bo->save_sessiondata($data);
***************
*** 242,245 ****
--- 245,254 ----
'link_url'
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
'img_path'
=> $GLOBALS['phpgw']->common->get_image_path('phpgwapi'),
+
+ 'district_list'
=> $this->bocommon->select_district_list('filter',$this->district_id),
+ 'lang_no_district'
=> lang('no district'),
+ 'lang_district_statustext' =>
lang('Select the district the selection belongs to. To do not use a district
select NO DISTRICT'),
+ 'select_district_name' =>
'district_id',
+
'lang_no_cat'
=> lang('no category'),
'lang_cat_statustext' =>
lang('Select the category the location belongs to. To do not use a category
select NO CATEGORY'),
***************
*** 389,393 ****
'no_link' =>
($type_id), // disable lookup links for location type less than type_id
// 'tenant' => True,
! // 'equipment' => True,
'location_type' =>
$location_type
));
--- 398,402 ----
'no_link' =>
($type_id), // disable lookup links for location type less than type_id
// 'tenant' => True,
! 'equipment' => True,
'location_type' =>
$location_type
));
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: property/inc class.bocommon.inc.php,1.52,1.53 class.boequipment.inc.php,1.9,1.10 class.bolocation.inc.php,1.9,1.10 class.socommon.inc.php,1.24,1.25 class.soequipment.inc.php,1.13,1.14 class.solocation.inc.php,1.7,1.8 class.solookup.inc.php,1.18,1.19 class.uilocation.inc.php,1.11,1.12,
Sigurd Nes <address@hidden> <=