[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: property/inc class.uirequest.inc.php,1.20,1.21 c
From: |
Sigurd Nes <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: property/inc class.uirequest.inc.php,1.20,1.21 class.uiproject.inc.php,1.31,1.32 class.sotts.inc.php,1.19,1.20 class.sorequest.inc.php,1.12,1.13 class.soproject.inc.php,1.20,1.21 class.solocation.inc.php,1.14,1.15 class.soequipment.inc.php,1.17,1.18 class.borequest.inc.php,1.6,1.7 class.boproject.inc.php,1.10,1.11 class.bolocation.inc.php,1.16,1.17 class.bocommon.inc.php,1.58,1.59 |
Date: |
Mon, 23 Jun 2003 08:26:46 -0400 |
Update of /cvsroot/phpgroupware/property/inc
In directory subversions:/tmp/cvs-serv32028/inc
Modified Files:
class.uirequest.inc.php class.uiproject.inc.php
class.sotts.inc.php class.sorequest.inc.php
class.soproject.inc.php class.solocation.inc.php
class.soequipment.inc.php class.borequest.inc.php
class.boproject.inc.php class.bolocation.inc.php
class.bocommon.inc.php
Log Message:
no message
Index: class.uirequest.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uirequest.inc.php,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -r1.20 -r1.21
*** class.uirequest.inc.php 22 Jun 2003 18:23:53 -0000 1.20
--- class.uirequest.inc.php 23 Jun 2003 12:26:43 -0000 1.21
***************
*** 38,41 ****
--- 38,42 ----
$this->boproject =
CreateObject($this->currentapp.'.boproject');
$this->bocommon =
CreateObject($this->currentapp.'.bocommon');
+ $this->bolocation =
CreateObject($this->currentapp.'.bolocation');
$this->config =
CreateObject('phpgwapi.config');
***************
*** 219,223 ****
));
}
! if($uicols['name'][$i]=='street_name')
{
$table_header[$i]['sort_link']
=true;
--- 220,224 ----
));
}
! if($uicols['name'][$i]=='address')
{
$table_header[$i]['sort_link']
=true;
***************
*** 225,229 ****
(
'sort' => $this->sort,
!
'var' => 'street_name',
'order' => $this->order,
'extra' => array('menuaction' =>
$this->currentapp.'.uirequest.index',
--- 226,230 ----
(
'sort' => $this->sort,
!
'var' => 'address',
'order' => $this->order,
'extra' => array('menuaction' =>
$this->currentapp.'.uirequest.index',
***************
*** 420,436 ****
$values =
get_var('values',array('POST'));
$GLOBALS['phpgw']->xslttpl->add_file(array('request'));
$bypass =
get_var('bypass',array('POST','GET'));
! if($values && !$bypass)
{
! $values = $values +
$this->bocommon->get_location();
}
else
{
$location_code =
get_var('location_code',array('POST','GET'));
! $values['tenant_id'] =
get_var('tenant_id',array('POST','GET'));
! $values['equipment_id'] =
get_var('equipment_id',array('POST','GET'));
$ticket_id
= get_var('ticket_id',array('POST','GET'));
--- 421,458 ----
$values =
get_var('values',array('POST'));
+ $insert_record =
$GLOBALS['phpgw']->session->appsession('insert_record',$this->currentapp);
+
+ //_debug_array($insert_record);
$GLOBALS['phpgw']->xslttpl->add_file(array('request'));
$bypass =
get_var('bypass',array('POST','GET'));
! if($_POST && !$bypass)
{
! for ($i=0;
$i<count($insert_record['location']); $i++)
! {
!
if($_POST[$insert_record['location'][$i]])
! {
!
$values['location'][$insert_record['location'][$i]]=
$_POST[$insert_record['location'][$i]];
! }
! }
!
! while (is_array($insert_record['extra']) &&
list($key,) = each($insert_record['extra']))
! {
! if($_POST[$key])
! {
! $values['extra'][$key] =
$_POST[$key];
! }
! }
!
! $values['street_name'] =
$_POST['street_name'];
! $values['street_number'] =
$_POST['street_number'];
! $values['location_name'] = $_POST['loc'
. (count($values['location'])).'_name']; // if not address - get the parent
name as address
}
else
{
$location_code =
get_var('location_code',array('POST','GET'));
! $tenant_id
= get_var('tenant_id',array('POST','GET'));
! $equipment_id =
get_var('equipment_id',array('POST','GET'));
$ticket_id
= get_var('ticket_id',array('POST','GET'));
***************
*** 441,456 ****
}
- if($values['tenant_id'])
- {
-
$tenant_data=$this->bocommon->read_single_tenant($values['tenant_id']);
- $values['contact_phone']=
$tenant_data['contact_phone'];
- $values['tenant_name']=
$tenant_data['last_name'] . ', ' . $tenant_data['first_name'];
- }
-
if($location_code)
{
!
$location_data=$this->bocommon->read_location_data($location_code);
!
! $values=$values + $location_data;
}
--- 463,469 ----
}
if($location_code)
{
! $values['location_data'] =
$this->bolocation->read_single($location_code,array('tenant_id'=>$tenant_id,'equipment_id'=>$equipment_id));
}
***************
*** 465,468 ****
--- 478,487 ----
if ($values['save'])
{
+ if(!$values['location'])
+ {
+
$receipt['error'][]=array('msg'=>lang('Please select a location !'));
+ $error_id=true;
+ }
+
if(!$values['title'])
{
***************
*** 535,549 ****
endif;
}
!
}
}
! if(!$receipt['error'] && !$bypass)
{
$values = $this->bo->read_single($id);
}
- $record_history = $this->bo->read_record_history($id);
-
$table_header_history[] = array
(
--- 554,574 ----
endif;
}
! }
! else
! {
! if($values['location'])
! {
! $location_code=implode("-",
$values['location']);
! $values['location_data'] =
$this->bolocation->read_single($location_code,$values['extra']);
! }
}
}
! if(!$receipt['error'] && !$bypass && $id)
{
$values = $this->bo->read_single($id);
+ $record_history =
$this->bo->read_record_history($id);
}
$table_header_history[] = array
(
***************
*** 567,588 ****
$this->cat_id = $values['cat_id'];
}
-
$location_data=$this->bocommon->initiate_ui_location(array(
- 'location_type' => 'form',
- 'equipment' => true,
- 'apartment' => true,
- 'equipment_id' =>
$values['equipment_id'],
- 'property_id' =>
$values['property_id'],
- 'property_name' =>
$values['property_name'],
- 'building_id' =>
$values['building_id'],
- 'entrance_id' =>
$values['entrance_id'],
- 'floor' =>
$values['floor'],
- 'street_name' =>
$values['street_name'],
- 'street_number' =>
$values['street_number'],
- 'tenant_id' =>
$values['tenant_id'],
- 'tenant_name' =>
$values['tenant_name'],
- 'contact_phone' =>
$values['contact_phone'],
- 'apartment_id' =>
$values['apartment_id']));
if($values['origin']== 'ticket')
--- 592,606 ----
$this->cat_id = $values['cat_id'];
}
+ $lookup_type='form';
+
$location_data=$this->bolocation->initiate_ui_location(array(
+ 'values' =>
$values['location_data'],
+ 'type_id' => -1,
// calculated from location_types
+ 'no_link' =>
False, // disable lookup links for location type less than type_id
+ 'tenant' => True,
+ 'equipment' => True,
+ 'lookup_type' => $lookup_type
+ ));
if($values['origin']== 'ticket')
Index: class.uiproject.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uiproject.inc.php,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -r1.31 -r1.32
*** class.uiproject.inc.php 22 Jun 2003 18:23:53 -0000 1.31
--- class.uiproject.inc.php 23 Jun 2003 12:26:43 -0000 1.32
***************
*** 369,379 ****
}
- if($values['tenant_id'])
- {
-
$tenant_data=$this->bocommon->read_single_tenant($values['tenant_id']);
- $values['contact_phone']=
$tenant_data['contact_phone'];
- $values['tenant_name']=
$tenant_data['last_name'] . ', ' . $tenant_data['first_name'];
- }
-
if($location_code)
{
--- 369,372 ----
***************
*** 391,394 ****
--- 384,393 ----
if ($values['save'])
{
+ if(!$values['location_data'])
+ {
+
$receipt['error'][]=array('msg'=>lang('Please select a location !'));
+ $error_id=true;
+ }
+
if(!$values['name'])
{
***************
*** 468,482 ****
$location_code=implode("-",
$values['location']);
$values['location_data'] =
$this->bolocation->read_single($location_code,$values['extra']);
-
}
}
}
! if((!$receipt['error'] || $add_request) && !$bypass)
{
$values = $this->bo->read_single($id);
}
- $record_history = $this->bo->read_record_history($id);
$table_header_history[] = array
--- 467,480 ----
$location_code=implode("-",
$values['location']);
$values['location_data'] =
$this->bolocation->read_single($location_code,$values['extra']);
}
}
}
! if(((!$receipt['error'] || $add_request) && !$bypass)
&& $id)
{
$values = $this->bo->read_single($id);
+ $record_history =
$this->bo->read_record_history($id);
}
$table_header_history[] = array
Index: class.sotts.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.sotts.inc.php,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -r1.19 -r1.20
*** class.sotts.inc.php 22 Jun 2003 11:10:44 -0000 1.19
--- class.sotts.inc.php 23 Jun 2003 12:26:43 -0000 1.20
***************
*** 228,238 ****
function add($ticket)
{
! if($ticket['street_number'])
{
! $address= $ticket['street_name'] . ' ' .
$ticket['street_number'];
}
! else
{
! $address= $ticket['street_name'];
}
--- 228,242 ----
function add($ticket)
{
!
! if($ticket['street_name'])
{
! $address[]= $ticket['street_name'];
! $address[]= $ticket['street_number'];
! $address = implode(" ", $address);
}
!
! if(!$address)
{
! $address = $ticket['location_name'];
}
Index: class.sorequest.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.sorequest.inc.php,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** class.sorequest.inc.php 22 Jun 2003 18:23:53 -0000 1.12
--- class.sorequest.inc.php 23 Jun 2003 12:26:43 -0000 1.13
***************
*** 432,435 ****
--- 432,460 ----
function add($request)
{
+ /* while (is_array($project['location']) &&
list($input_name,$value) = each($project['location']))
+ {
+ if($value)
+ {
+ $cols[] = $input_name;
+ $vals[] = $value;
+ }
+ }
+
+ */
+ while (is_array($project['extra']) &&
list($input_name,$value) = each($project['extra']))
+ {
+ if($value)
+ {
+ $cols[] = $input_name;
+ $vals[] = $value;
+ }
+ }
+
+ if($cols)
+ {
+ $cols = "," . implode(",", $cols);
+ $vals = ",'" . implode("','", $vals) . "'";
+ }
+
$this->historylog->add('SO',$request['request_id'],$request['status']);
***************
*** 437,447 ****
$this->historylog->add('CO',$request['request_id'],$request['coordinator']);
! if($request['street_number'])
{
! $address= $request['street_name'] . ' ' .
$request['street_number'];
}
! else
{
! $address= $request['street_name'];
}
--- 462,476 ----
$this->historylog->add('CO',$request['request_id'],$request['coordinator']);
!
! if($request['street_name'])
{
! $address[]= $request['street_name'];
! $address[]= $request['street_number'];
! $address = implode(" ", $address);
}
!
! if(!$address)
{
! $address = $request['location_name'];
}
***************
*** 449,458 ****
$request['name'] =
$this->db->db_addslashes($request['name']);
// $request['title'] =
$this->db->db_addslashes($request['title']);
! //_debug_array($request);
! $this->db->query("insert into fm_request
(id,title,owner,category,descr,location_code,equipment_id,property_id,floor,"
.
"address,tenant_id,entry_date,budget,status,branch_id,coordinator,"
.
"d_safety,d_aesthetics,d_indoor_climate,d_consequential_damage,d_user_gratification,d_residential_environment,"
.
"c_safety,c_aesthetics,c_indoor_climate,c_consequential_damage,c_user_gratification,c_residential_environment,"
! .
"p_safety,p_aesthetics,p_indoor_climate,p_consequential_damage,p_user_gratification,p_residential_environment,authorities_demands)
"
. "VALUES ('"
. $request['request_id']. "','"
--- 478,487 ----
$request['name'] =
$this->db->db_addslashes($request['name']);
// $request['title'] =
$this->db->db_addslashes($request['title']);
! _debug_array($request);
! $this->db->query("insert into fm_request
(id,title,owner,category,descr,location_code,equipment_id,"
.
"address,tenant_id,entry_date,budget,status,branch_id,coordinator,"
.
"d_safety,d_aesthetics,d_indoor_climate,d_consequential_damage,d_user_gratification,d_residential_environment,"
.
"c_safety,c_aesthetics,c_indoor_climate,c_consequential_damage,c_user_gratification,c_residential_environment,"
! .
"p_safety,p_aesthetics,p_indoor_climate,p_consequential_damage,p_user_gratification,p_residential_environment,authorities_demands
$cols) "
. "VALUES ('"
. $request['request_id']. "','"
***************
*** 463,468 ****
. $request['location_code']. "','"
. $request['equipment_id']. "','"
- . $request['property_id']. "','"
- . $request['floor']. "','"
. $address. "','"
. $request['tenant_id']. "','"
--- 492,495 ----
***************
*** 490,494 ****
. $request['p_user_gratification']. "','"
. $request['p_residential_environment']. "','"
! . $request['authorities_demands'].
"')",__LINE__,__FILE__);
--- 517,521 ----
. $request['p_user_gratification']. "','"
. $request['p_residential_environment']. "','"
! . $request['authorities_demands']. "' $vals
)",__LINE__,__FILE__);
***************
*** 541,553 ****
}
! if($request['street_number'])
{
! $address= $request['street_name'] . ' ' .
$request['street_number'];
}
! else
{
! $address= $request['street_name'];
}
$request['descr'] =
$this->db->db_addslashes($request['descr']);
$request['name'] =
$this->db->db_addslashes($request['name']);
--- 568,599 ----
}
! /* while (is_array($request['location']) &&
list($input_name,$value) = each($request['location']))
{
! $vals[] = "$input_name = '$value'";
}
! */
! while (is_array($request['extra']) &&
list($input_name,$value) = each($request['extra']))
{
! $vals[] = "$input_name = '$value'";
}
+ if($vals)
+ {
+ $vals = "," . implode(",",$vals);
+ }
+
+ if($request['street_name'])
+ {
+ $address[]= $request['street_name'];
+ $address[]= $request['street_number'];
+ $address = implode(" ", $address);
+ }
+
+ if(!$address)
+ {
+ $address = $request['location_name'];
+ }
+
+
$request['descr'] =
$this->db->db_addslashes($request['descr']);
$request['name'] =
$this->db->db_addslashes($request['name']);
***************
*** 590,600 ****
authorities_demands ='" .
$request['authorities_demands'] . "',
address ='" . $address
! . "' WHERE id= '" . $request['request_id']
."'",__LINE__,__FILE__);
$this->update_score('',$request['request_id']);
! if($request['contact_phone'])
{
! $this->db->query("update fm_tenant set
contact_phone='". $request['contact_phone']. "' where tenant_id='".
$request['tenant_id']. "'",__LINE__,__FILE__);
}
--- 636,646 ----
authorities_demands ='" .
$request['authorities_demands'] . "',
address ='" . $address
! . "' $vals WHERE id= '" .
$request['request_id'] ."'",__LINE__,__FILE__);
$this->update_score('',$request['request_id']);
! if($request['extra']['contact_phone'])
{
! $this->db->query("update fm_tenant set
contact_phone='". $request['extra']['contact_phone']. "' where tenant_id='".
$request['extra']['tenant_id']. "'",__LINE__,__FILE__);
}
Index: class.soproject.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.soproject.inc.php,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -r1.20 -r1.21
*** class.soproject.inc.php 22 Jun 2003 11:10:44 -0000 1.20
--- class.soproject.inc.php 23 Jun 2003 12:26:43 -0000 1.21
***************
*** 368,372 ****
{
! while (is_array($project['location']) &&
list($input_name,$value) = each($project['location']))
{
if($value)
--- 368,372 ----
{
! /* while (is_array($project['location']) &&
list($input_name,$value) = each($project['location']))
{
if($value)
***************
*** 377,380 ****
--- 377,381 ----
}
+ */
while (is_array($project['extra']) &&
list($input_name,$value) = each($project['extra']))
{
***************
*** 386,391 ****
}
! $cols = "," . implode(",", $cols);
! $vals = ",'" . implode("','", $vals) . "'";
--- 387,395 ----
}
! if($cols)
! {
! $cols = "," . implode(",", $cols);
! $vals = ",'" . implode("','", $vals) . "'";
! }
***************
*** 394,404 ****
$this->historylog->add('CO',$project['project_id'],$project['coordinator']);
! if($project['street_number'])
{
! $address= $project['street_name'] . ' ' .
$project['street_number'];
}
! else
{
! $address= $project['street_name'];
}
--- 398,412 ----
$this->historylog->add('CO',$project['project_id'],$project['coordinator']);
!
! if($project['street_name'])
{
! $address[]= $project['street_name'];
! $address[]= $project['street_number'];
! $address = implode(" ", $address);
}
!
! if(!$address)
{
! $address = $project['location_name'];
}
***************
*** 434,442 ****
! if($project['contact_phone'])
{
! $this->db->query("update fm_tenant set
contact_phone='". $project['contact_phone']. "' where tenant_id='".
$project['tenant_id']. "'",__LINE__,__FILE__);
}
if ($project['power_meter'] )
{
--- 442,451 ----
! if($project['extra']['contact_phone'])
{
! $this->db->query("update fm_tenant set
contact_phone='". $project['extra']['contact_phone']. "' where tenant_id='".
$project['extra']['tenant_id']. "'",__LINE__,__FILE__);
}
+
if ($project['power_meter'] )
{
***************
*** 506,513 ****
function edit($project)
{
! while (is_array($project['location']) &&
list($input_name,$value) = each($project['location']))
{
$vals[] = "$input_name = '$value'";
}
while (is_array($project['extra']) &&
list($input_name,$value) = each($project['extra']))
{
--- 515,523 ----
function edit($project)
{
! /* while (is_array($project['location']) &&
list($input_name,$value) = each($project['location']))
{
$vals[] = "$input_name = '$value'";
}
+ */
while (is_array($project['extra']) &&
list($input_name,$value) = each($project['extra']))
{
***************
*** 515,519 ****
}
! $vals = "," . implode(",",$vals);
$this->db->query("SELECT status,category,coordinator
FROM fm_project where id='" .$project['project_id']."'",__LINE__,__FILE__);
--- 525,545 ----
}
! if($vals)
! {
! $vals = "," . implode(",",$vals);
! }
!
! if($project['street_name'])
! {
! $address[]= $project['street_name'];
! $address[]= $project['street_number'];
! $address = implode(" ", $address);
! }
!
! if(!$address)
! {
! $address = $project['location_name'];
! }
!
$this->db->query("SELECT status,category,coordinator
FROM fm_project where id='" .$project['project_id']."'",__LINE__,__FILE__);
***************
*** 560,570 ****
charge_tenant ='" . $project['charge_tenant']
. "',
location_code ='" . $project['location_code']
. "',
! floor ='" . $project['floor']
. "',
equipment_id ='" . $project['equipment_id']
. "' $vals WHERE id= '" .
$project['project_id'] ."'",__LINE__,__FILE__);
! if($project['contact_phone'])
{
! $this->db->query("update fm_tenant set
contact_phone='". $project['contact_phone']. "' where tenant_id='".
$project['tenant_id']. "'",__LINE__,__FILE__);
}
--- 586,596 ----
charge_tenant ='" . $project['charge_tenant']
. "',
location_code ='" . $project['location_code']
. "',
! address ='" . $address . "',
equipment_id ='" . $project['equipment_id']
. "' $vals WHERE id= '" .
$project['project_id'] ."'",__LINE__,__FILE__);
! if($project['extra']['contact_phone'])
{
! $this->db->query("update fm_tenant set
contact_phone='". $project['extra']['contact_phone']. "' where tenant_id='".
$project['extra']['tenant_id']. "'",__LINE__,__FILE__);
}
Index: class.solocation.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.solocation.inc.php,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** class.solocation.inc.php 22 Jun 2003 09:23:03 -0000 1.14
--- class.solocation.inc.php 23 Jun 2003 12:26:43 -0000 1.15
***************
*** 161,164 ****
--- 161,173 ----
$uicols['statustext'][] = lang('Property Name');
+ for ($i=2;$i<($type_id+1);$i++)
+ {
+ $cols.= ',fm_location' . $i . '.loc' . $i .
'_name';
+ $cols_return[] = 'loc'
. $i . '_name';
+ $uicols['input_type'][] = 'hidden';
+ $uicols['name'][] = 'loc'
. $i . '_name';
+ $uicols['descr'][] = '';
+ $uicols['statustext'][] = '';
+ }
***************
*** 210,214 ****
$uicols['statustext'][] = lang('first
name');
! $cols.= ',fm_tenant.last_name';
$cols_return[] =
'contact_phone';
$uicols['input_type'][] = 'text';
--- 219,223 ----
$uicols['statustext'][] = lang('first
name');
! $cols.= ',fm_tenant.contact_phone';
$cols_return[] =
'contact_phone';
$uicols['input_type'][] = 'text';
***************
*** 394,399 ****
if($type!=1)
{
! $cols.= ',fm_location1.loc1_name as loc1_name';
! $cols_return[] =
'loc1_name';
$uicols['input_type'][] = 'text';
$uicols['name'][] =
'loc1_name';
--- 403,408 ----
if($type!=1)
{
! // $cols.= ',fm_location1.loc1_name as loc1_name';
! // $cols_return[] =
'loc1_name';
$uicols['input_type'][] = 'text';
$uicols['name'][] =
'loc1_name';
***************
*** 489,492 ****
--- 498,502 ----
$uicols['descr'][]
= lang('contact phone');
$uicols['statustext'][]
= lang('contact phone');
+
}
else:
***************
*** 529,534 ****
$cols_return[] = 'cat_id';
! $cols.= 'loc' . $type_id .'_name';
! $cols_return[] = 'loc' .
$type_id .'_name';
$uicols['input_type'][] = 'text';
$uicols['name'][] = 'loc' .
$type_id .'_name';
--- 539,551 ----
$cols_return[] = 'cat_id';
! for ($i=1;$i<($type_id+1);$i++)
! {
! $cols.= 'fm_location' . $i .'.loc' . $i
.'_name,';
! $cols_return[] = 'loc'
. $i .'_name';
! }
!
!
! // $cols.= 'loc' . $type_id .'_name';
! // $cols_return[] = 'loc' .
$type_id .'_name';
$uicols['input_type'][] = 'text';
$uicols['name'][] = 'loc' .
$type_id .'_name';
***************
*** 536,540 ****
$uicols['statustext'][] = lang('name');
! $cols.= ',fm_location' . $type_id .'.remark as remark,';
$cols_return[] = 'remark';
$uicols['input_type'][] = 'text';
--- 553,557 ----
$uicols['statustext'][] = lang('name');
! $cols.= 'fm_location' . $type_id .'.remark as remark,';
$cols_return[] = 'remark';
$uicols['input_type'][] = 'text';
***************
*** 542,545 ****
--- 559,563 ----
$uicols['descr'][] =
lang('remark');
$uicols['statustext'][] = lang('remark');
+
$sql =
$this->generate_sql($type_id,$cols,$cols_return,$uicols,True);
Index: class.soequipment.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.soequipment.inc.php,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -r1.17 -r1.18
*** class.soequipment.inc.php 19 Jun 2003 20:03:10 -0000 1.17
--- class.soequipment.inc.php 23 Jun 2003 12:26:43 -0000 1.18
***************
*** 287,291 ****
{
! while (is_array($equipment['location']) &&
list($input_name,$value) = each($equipment['location']))
{
if($value)
--- 287,291 ----
{
! /* while (is_array($equipment['location']) &&
list($input_name,$value) = each($equipment['location']))
{
if($value)
***************
*** 296,307 ****
}
! $cols = "," . implode(",", $cols);
! $vals = ",'" . implode("','", $vals) . "'";
$equipment['descr'] =
$this->db->db_addslashes($equipment['descr']);
//_debug_array($equipment);
! $this->db->query("INSERT INTO fm_equipment
(equipment_id,lifetime,status,equipment_type_id,cost,date,descr,location_code,vendor_id,user_id
$cols) "
. "VALUES ('"
. $equipment['equipment_id']. "','"
. $equipment['lifetime']. "','"
. $equipment['status']. "','"
--- 296,335 ----
}
! */
! while (is_array($equipment['extra']) &&
list($input_name,$value) = each($equipment['extra']))
! {
! if($value)
! {
! $cols[] = $input_name;
! $vals[] = $value;
! }
! }
!
! if($cols)
! {
! $cols = "," . implode(",", $cols);
! $vals = ",'" . implode("','", $vals) . "'";
! }
!
$equipment['descr'] =
$this->db->db_addslashes($equipment['descr']);
+
+ if($equipment['street_name'])
+ {
+ $address[]= $equipment['street_name'];
+ $address[]= $equipment['street_number'];
+ $address = implode(" ", $address);
+ }
+
+ if(!$address)
+ {
+ $address = $equipment['location_name'];
+ }
+
//_debug_array($equipment);
! $this->db->query("INSERT INTO fm_equipment
(equipment_id,address,lifetime,status,equipment_type_id,cost,date,descr,location_code,vendor_id,user_id
$cols) "
. "VALUES ('"
. $equipment['equipment_id']. "','"
+ . $address. "','"
. $equipment['lifetime']. "','"
. $equipment['status']. "','"
***************
*** 322,343 ****
//_debug_array($equipment);
! while (is_array($equipment['location']) &&
list($input_name,$value) = each($equipment['location']))
{
$vals[] = "$input_name = '$value'";
}
! $vals = "," . implode(",",$vals);
$equipment['descr'] =
$this->db->db_addslashes($equipment['descr']);
$this->db->query("UPDATE fm_equipment set
! lifetime='" . $equipment['lifetime'] . "',
! status='" . $equipment['status'] . "',
equipment_type_id='" . $equipment['cat_id']
. "',
! cost='" . $equipment['cost'] . "',
! date='" . $equipment['date'] . "',
! descr='" . $equipment['descr'] . "',
! location_code='" . $equipment['location_code']
. "',
! vendor_id='" . $equipment['vendor_id']
. "' $vals WHERE equipment_id= '" .
$equipment['equipment_id'] ."'",__LINE__,__FILE__);
--- 350,393 ----
//_debug_array($equipment);
! /* while (is_array($equipment['location']) &&
list($input_name,$value) = each($equipment['location']))
! {
! $vals[] = "$input_name = '$value'";
! }
! */
! while (is_array($equipment['extra']) &&
list($input_name,$value) = each($equipment['extra']))
{
$vals[] = "$input_name = '$value'";
}
! if($vals)
! {
! $vals = "," . implode(",",$vals);
! }
!
!
! if($equipment['street_name'])
! {
! $address[]= $equipment['street_name'];
! $address[]= $equipment['street_number'];
! $address = implode(" ", $address);
! }
!
! if(!$address)
! {
! $address = $equipment['location_name'];
! }
$equipment['descr'] =
$this->db->db_addslashes($equipment['descr']);
$this->db->query("UPDATE fm_equipment set
! lifetime ='" .
$equipment['lifetime'] . "',
! status ='" .
$equipment['status'] . "',
equipment_type_id='" . $equipment['cat_id']
. "',
! cost ='" .
$equipment['cost'] . "',
! date ='" .
$equipment['date'] . "',
! descr ='" .
$equipment['descr'] . "',
! location_code ='" .
$equipment['location_code'] . "',
! address ='" . $address . "',
! vendor_id ='" .
$equipment['vendor_id']
. "' $vals WHERE equipment_id= '" .
$equipment['equipment_id'] ."'",__LINE__,__FILE__);
Index: class.borequest.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.borequest.inc.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** class.borequest.inc.php 22 Jun 2003 18:23:53 -0000 1.6
--- class.borequest.inc.php 23 Jun 2003 12:26:43 -0000 1.7
***************
*** 404,419 ****
$request['end_date'] =
$GLOBALS['phpgw']->common->show_date($request['end_date'],$dateformat);
! if($request['tenant_id'])
{
!
$tenant_data=$this->bocommon->read_single_tenant($request['tenant_id']);
! $request['contact_phone']=
$tenant_data['contact_phone'];
! $request['tenant_name']=
$tenant_data['last_name'] . ', ' . $tenant_data['first_name'];
}
!
$location_data=$this->socommon->read_location_data($request['location_code']);
! $request=$request + $location_data;
- //_debug_array($location_data);
return $request;
}
--- 404,434 ----
$request['end_date'] =
$GLOBALS['phpgw']->common->show_date($request['end_date'],$dateformat);
! if($request['location_code'])
{
! $request['location_data']
=$this->solocation->read_single($request['location_code']);
}
! if($request['equipment_id'])
! {
! $request['location_data']['equipment_id'] =
$request['equipment_id'];
! $request['location_data']['equipment_type'] =
$this->bocommon->get_equipment_type($request['equipment_id']);
! }
! if($request['tenant_id']>0)
! {
!
$tenant_data=$this->bocommon->read_single_tenant($request['tenant_id']);
! $request['location_data']['tenant_id']=
$request['tenant_id'];
! $request['location_data']['contact_phone']=
$tenant_data['contact_phone'];
! $request['location_data']['last_name'] =
$tenant_data['last_name'];
! $request['location_data']['first_name'] =
$tenant_data['first_name'];
! }
! else
! {
! unset($request['location_data']['tenant_id']);
!
unset($request['location_data']['contact_phone']);
! unset($request['location_data']['last_name']);
! unset($request['location_data']['first_name']);
! }
return $request;
}
***************
*** 495,498 ****
--- 510,522 ----
function save($request,$action='')
{
+ while (is_array($request['location']) && list(,$value)
= each($request['location']))
+ {
+ if($value)
+ {
+ $location[] = $value;
+ }
+ }
+
+ $request['location_code']=implode("-", $location);
$start_date =
$this->bocommon->date_array($request['start_date']);
$end_date =
$this->bocommon->date_array($request['end_date']);
***************
*** 500,504 ****
$request['start_date'] = mktime
(2,0,0,$start_date['month'],$start_date['day'],$start_date['year']);
$request['end_date'] = mktime
(2,0,0,$end_date['month'],$end_date['day'],$end_date['year']);
-
$request['location_code']=$this->bocommon->location_code($request['property_id'],$request['building_id'],$request['entrance_id'],$request['apartment_id']);
//_debug_array($request);
--- 524,527 ----
Index: class.boproject.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.boproject.inc.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** class.boproject.inc.php 22 Jun 2003 11:10:44 -0000 1.10
--- class.boproject.inc.php 23 Jun 2003 12:26:43 -0000 1.11
***************
*** 361,365 ****
}
-
//_debug_array($project);
return $project;
--- 361,364 ----
Index: class.bolocation.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.bolocation.inc.php,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -r1.16 -r1.17
*** class.bolocation.inc.php 22 Jun 2003 11:10:44 -0000 1.16
--- class.bolocation.inc.php 23 Jun 2003 12:26:43 -0000 1.17
***************
*** 268,272 ****
$location['location'][$i]['extra'][0]['lookup_function_call'] = 'lookup_loc'
. ($i+1) . '()';
$location['location'][$i]['extra'][0]['value'] =
$data['values']['loc' . ($i+1).'_name'];
!
}
--- 268,280 ----
$location['location'][$i]['extra'][0]['lookup_function_call'] = 'lookup_loc'
. ($i+1) . '()';
$location['location'][$i]['extra'][0]['value'] =
$data['values']['loc' . ($i+1).'_name'];
! }
! else
! {
!
$location['location'][$i]['extra'][0]['input_name'] = 'loc' .
($i+1).'_name';
! $input_name[]
=
$location['location'][$i]['extra'][0]['input_name'];
!
$location['location'][$i]['extra'][0]['input_type']
= 'text';
!
$location['location'][$i]['extra'][0]['size'] = 30;
!
$location['location'][$i]['extra'][0]['lookup_function_call'] = 'lookup_loc'
. ($i+1) . '()';
!
$location['location'][$i]['extra'][0]['value'] =
$data['values']['loc' . ($i+1).'_name'];
}
***************
*** 316,319 ****
--- 324,328 ----
{
$location['location'][$i]['input_name'] =
$config[$j]['column_name'];
+ $input_name[]
= 'street_id';
$location['location'][$i]['lookup_link'] = True;
$location['location'][$i]['lookup_function_call'] = 'lookup_loc' .
$fm_location_cols[$j]['location_type'] . '()';
***************
*** 372,383 ****
$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['extra']['contact_phone']
= 'contact_phone';
!
$location['location'][$i]['extra'][2]['value']
= $data['values']['contact_phone'];
!
$location['location'][$i]['extra'][2]['statustext']
= lang('contact phone');
}
elseif($config[$j]['column_name']!='tenant_id' &&
$config[$j]['column_name']!='street_id'):
--- 381,394 ----
$location['location'][$i]['extra'][1]['statustext']
= lang('first name');
! $i++;
!
$location['location'][$i]['input_type'] = 'text';
!
$location['location'][$i]['name'] =
lang('Contact phone');
!
$location['location'][$i]['input_name'] =
'contact_phone';
! $input_name[]
=
$location['location'][$i]['input_name'];
!
$location['location'][$i]['size'] = 12;
!
$location['location'][$i]['lookup_function_call'] =
'';//$lookup_functions[$m]['name'];
!
$insert_record['extra']['contact_phone'] =
'contact_phone';
!
$location['location'][$i]['value'] =
$data['values']['contact_phone'];
!
$location['location'][$i]['statustext'] = lang('contact
phone');
}
elseif($config[$j]['column_name']!='tenant_id' &&
$config[$j]['column_name']!='street_id'):
***************
*** 455,459 ****
! //_debug_array($lookup_name);
return $location;
--- 466,470 ----
! //_debug_array($input_name);
return $location;
Index: class.bocommon.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.bocommon.inc.php,v
retrieving revision 1.58
retrieving revision 1.59
diff -C2 -r1.58 -r1.59
*** class.bocommon.inc.php 22 Jun 2003 11:10:44 -0000 1.58
--- class.bocommon.inc.php 23 Jun 2003 12:26:43 -0000 1.59
***************
*** 852,855 ****
--- 852,861 ----
$uicols['statustext'][] = lang('Property Name');
+ $cols.= ",$entity_table.address";
+ $cols_return[] = 'address';
+ $uicols['input_type'][] = 'text';
+ $uicols['name'][] = 'address';
+ $uicols['descr'][] =
lang('address');
+ $uicols['statustext'][] = lang('address');
***************
*** 865,869 ****
$cols_return[]
= 'street_name';
$cols_extra[]
= 'street_name';
! $uicols['input_type'][]
= 'text';
$uicols['name'][]
= 'street_name';
$uicols['descr'][]
= lang('street name');
--- 871,875 ----
$cols_return[]
= 'street_name';
$cols_extra[]
= 'street_name';
! $uicols['input_type'][]
= 'hidden';
$uicols['name'][]
= 'street_name';
$uicols['descr'][]
= lang('street name');
***************
*** 872,876 ****
$cols_return[]
= 'street_number';
$cols_extra[]
= 'street_number';
! $uicols['input_type'][]
= 'text';
$uicols['name'][]
= 'street_number';
$uicols['descr'][]
= lang('street number');
--- 878,882 ----
$cols_return[]
= 'street_number';
$cols_extra[]
= 'street_number';
! $uicols['input_type'][]
= 'hidden';
$uicols['name'][]
= 'street_number';
$uicols['descr'][]
= lang('street number');
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: property/inc class.uirequest.inc.php,1.20,1.21 class.uiproject.inc.php,1.31,1.32 class.sotts.inc.php,1.19,1.20 class.sorequest.inc.php,1.12,1.13 class.soproject.inc.php,1.20,1.21 class.solocation.inc.php,1.14,1.15 class.soequipment.inc.php,1.17,1.18 class.borequest.inc.php,1.6,1.7 class.boproject.inc.php,1.10,1.11 class.bolocation.inc.php,1.16,1.17 class.bocommon.inc.php,1.58,1.59,
Sigurd Nes <address@hidden> <=
- Prev by Date:
[Phpgroupware-cvs] CVS: property/setup tables_current.inc.php,1.94,1.95
- Next by Date:
[Phpgroupware-cvs] CVS: news_admin/templates/default acl.tpl,NONE,1.1.2.1 export.tpl,NONE,1.1.2.1 read.tpl,NONE,1.1.2.1 write.tpl,NONE,1.1.2.1 admin_list.tpl,1.5.4.1,NONEnews.tpl,1.7,NONE
- Previous by thread:
[Phpgroupware-cvs] CVS: property/setup tables_current.inc.php,1.94,1.95
- Next by thread:
[Phpgroupware-cvs] CVS: news_admin/templates/default acl.tpl,NONE,1.1.2.1 export.tpl,NONE,1.1.2.1 read.tpl,NONE,1.1.2.1 write.tpl,NONE,1.1.2.1 admin_list.tpl,1.5.4.1,NONEnews.tpl,1.7,NONE
- Index(es):