[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: property/inc class.uimeter.inc.php,1.13,1.14 cla
From: |
Sigurd Nes <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: property/inc class.uimeter.inc.php,1.13,1.14 class.uiinvestment.inc.php,1.22,1.23 class.someter.inc.php,1.4,1.5 class.soinvestment.inc.php,1.14,1.15 class.bometer.inc.php,1.4,1.5 class.boinvestment.inc.php,1.11,1.12 |
Date: |
Wed, 25 Jun 2003 05:47:31 -0400 |
Update of /cvsroot/phpgroupware/property/inc
In directory subversions:/tmp/cvs-serv10420/inc
Modified Files:
class.uimeter.inc.php class.uiinvestment.inc.php
class.someter.inc.php class.soinvestment.inc.php
class.bometer.inc.php class.boinvestment.inc.php
Log Message:
no message
Index: class.uimeter.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uimeter.inc.php,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** class.uimeter.inc.php 24 Jun 2003 13:07:40 -0000 1.13
--- class.uimeter.inc.php 25 Jun 2003 09:47:28 -0000 1.14
***************
*** 160,164 ****
));
}
! if($uicols['name'][$i]=='meter_id')
{
$table_header[$i]['sort_link']
=true;
--- 160,164 ----
));
}
! if($uicols['name'][$i]=='num')
{
$table_header[$i]['sort_link']
=true;
***************
*** 166,170 ****
(
'sort' => $this->sort,
!
'var' => 'meter_id',
'order' => $this->order,
'extra' => array('menuaction' =>
$this->currentapp.'.uimeter.index',
--- 166,170 ----
(
'sort' => $this->sort,
!
'var' => 'num',
'order' => $this->order,
'extra' => array('menuaction' =>
$this->currentapp.'.uimeter.index',
***************
*** 294,299 ****
$values =
get_var('values',array('POST'));
- //_debug_array($_POST);
-
$GLOBALS['phpgw']->xslttpl->add_file(array('meter'));
--- 294,297 ----
***************
*** 322,325 ****
--- 320,328 ----
$values['location_name'] = $_POST['loc'
. (count($values['location'])).'_name']; // if not address - get the parent
name as address
+ if(!$values['num'] && !$id)
+ {
+
$receipt['error'][]=array('msg'=>lang('Enter a meter ID !'));
+ }
+
if($id)
{
***************
*** 329,336 ****
else
{
!
if($this->bo->check_meter_id($values['meter_id']))
{
!
$receipt['error'][]=array('msg'=>lang('This meter id is already registered!') .
'[ '.$values['meter_id'].' ]');
$error_id=true;
}
else
--- 332,340 ----
else
{
!
if($this->bo->check_meter_num($values['num']))
{
!
$receipt['error'][]=array('msg'=>lang('This meter id is already registered!') .
'[ '.$values['num'].' ]');
$error_id=true;
+ unset($values['num']);
}
else
***************
*** 343,347 ****
{
$receipt['error'][]=array('msg'=>lang('Please select a location !'));
- return $receipt;
}
--- 347,350 ----
***************
*** 349,353 ****
{
$receipt['error'][]=array('msg'=>lang('Please select a category !'));
- $error_id=true;
}
--- 352,355 ----
***************
*** 355,359 ****
{
$receipt =
$this->bo->save($values,$action);
! $id = $values['meter_id'];
}
else
--- 357,361 ----
{
$receipt =
$this->bo->save($values,$action);
! $id = $receipt['meter_id'];
}
else
***************
*** 380,386 ****
}
! if ($values['type'])
{
! $this->cat_id = $values['type'];
}
--- 382,388 ----
}
! if ($values['cat_id'])
{
! $this->cat_id = $values['cat_id'];
}
***************
*** 416,420 ****
'lang_save'
=> lang('save'),
'lang_done'
=> lang('done'),
! 'value_meter_id'
=> $id,
'value_name'
=> $values['name'],
'value_remark'
=> $values['remark'],
--- 418,422 ----
'lang_save'
=> lang('save'),
'lang_done'
=> lang('done'),
! 'value_meter_id'
=> $values['num'],
'value_name'
=> $values['name'],
'value_remark'
=> $values['remark'],
***************
*** 492,498 ****
$function_msg = lang('View meter');
! if ($values['type'])
{
! $this->cat_id = $values['type'];
}
--- 494,500 ----
$function_msg = lang('View meter');
! if ($values['cat_id'])
{
! $this->cat_id = $values['cat_id'];
}
Index: class.uiinvestment.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uiinvestment.inc.php,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -r1.22 -r1.23
*** class.uiinvestment.inc.php 22 Jun 2003 11:10:44 -0000 1.22
--- class.uiinvestment.inc.php 25 Jun 2003 09:47:28 -0000 1.23
***************
*** 74,80 ****
--- 74,95 ----
$links = $this->bocommon->menu($sub);
+ $preserve =
get_var('preserve',array('POST','GET'));
$values = get_var('values',array('POST'));
$date = get_var('date',array('POST'));
+ if($preserve)
+ {
+ $this->bo->read_sessiondata();
+
+ $this->start =
$this->bo->start;
+ $this->query =
$this->bo->query;
+ $this->sort
= $this->bo->sort;
+ $this->order =
$this->bo->order;
+ $this->filter =
$this->bo->filter;
+ $this->cat_id =
$this->bo->cat_id;
+ $this->part_of_town_id =
$this->bo->part_of_town_id;
+ $this->allrows =
$this->bo->allrows;
+ }
+
if($date)
{
***************
*** 377,381 ****
'lang_done' =>
lang('done'),
'lang_done_statustext' => lang('Back to
investment list '),
! 'done_action' =>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiinvestment.index')
);
--- 392,396 ----
'lang_done' =>
lang('done'),
'lang_done_statustext' => lang('Back to
investment list '),
! 'done_action' =>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiinvestment.index&preserve=1')
);
***************
*** 566,570 ****
'lang_equipment'
=> lang('Equipment'),
'form_action'
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
! 'done_action'
=>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiinvestment.index'),
'lang_write_off_period' =>
lang('Write off period'),
--- 581,585 ----
'lang_equipment'
=> lang('Equipment'),
'form_action'
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
! 'done_action'
=>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiinvestment.index&preserve=1'),
'lang_write_off_period' =>
lang('Write off period'),
Index: class.someter.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.someter.inc.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** class.someter.inc.php 24 Jun 2003 13:07:40 -0000 1.4
--- class.someter.inc.php 25 Jun 2003 09:47:28 -0000 1.5
***************
*** 40,46 ****
}
! function check_meter_id($meter_id='')
{
! $this->db->query("SELECT count(*) FROM fm_meter where
id='$meter_id'");
$this->db->next_record();
--- 40,46 ----
}
! function check_meter_num($num='')
{
! $this->db->query("SELECT count(*) FROM fm_meter where
num='$num'");
$this->db->next_record();
***************
*** 80,86 ****
$cols .= ",$entity_table.id as meter_id";
! $cols_return[] = 'meter_id';
$uicols['input_type'][] = 'text';
! $uicols['name'][] = 'meter_id';
$uicols['descr'][] = lang('Meter
ID');
$uicols['statustext'][] = lang('Meter ID');
--- 80,89 ----
$cols .= ",$entity_table.id as meter_id";
! $cols_return[] = 'meter_id';
!
! $cols .= ",$entity_table.num as num";
! $cols_return[] = 'num';
$uicols['input_type'][] = 'text';
! $uicols['name'][] = 'num';
$uicols['descr'][] = lang('Meter
ID');
$uicols['statustext'][] = lang('Meter ID');
***************
*** 101,105 ****
! $joinmethod .= " $this->join fm_meter_category ON
($entity_table.type = fm_meter_category.id))";
$paranthesis .='(';
--- 104,108 ----
! $joinmethod .= " $this->join fm_meter_category ON
($entity_table.category = fm_meter_category.id))";
$paranthesis .='(';
***************
*** 122,126 ****
if ($cat_id)
{
! $filtermethod .= " $where
fm_meter.type='$cat_id' ";
$where = 'AND';
}
--- 125,129 ----
if ($cat_id)
{
! $filtermethod .= " $where
fm_meter.category='$cat_id' ";
$where = 'AND';
}
***************
*** 177,183 ****
{
$meter['meter_id'] =
$this->db->f('id');
$meter['name'] =
stripslashes($this->db->f('name'));
$meter['remark'] =
stripslashes($this->db->f('remark'));
! $meter['type'] =
$this->db->f('type');
$meter['location_code'] =
$this->db->f('location_code');
}
--- 180,187 ----
{
$meter['meter_id'] =
$this->db->f('id');
+ $meter['num'] =
$this->db->f('num');
$meter['name'] =
stripslashes($this->db->f('name'));
$meter['remark'] =
stripslashes($this->db->f('remark'));
! $meter['cat_id'] =
$this->db->f('category');
$meter['location_code'] =
$this->db->f('location_code');
}
***************
*** 197,201 ****
}
-
if($cols)
{
--- 201,204 ----
***************
*** 218,226 ****
$meter['remark'] =
$this->db->db_addslashes($meter['remark']);
! $this->db->query("INSERT INTO fm_meter (location_code,
id,user_id,entry_date,name,address,type,remark $cols ) "
! . "VALUES ('" . $meter['location_code'] . "','"
. $meter['meter_id'] . "','" . $this->account . "','" . time() . "','" .
$meter['name']
. "','" . $address ."','" . $meter['cat_id']
."','" . $meter['remark']. "' $vals )",__LINE__,__FILE__);
! $receipt['message'][]=array('msg'=>lang('Meter %1 has
been saved',$meter['meter_id']));
return $receipt;
}
--- 221,233 ----
$meter['remark'] =
$this->db->db_addslashes($meter['remark']);
! $this->db->query("INSERT INTO fm_meter (location_code,
num,user_id,entry_date,name,address,category,remark $cols ) "
! . "VALUES ('" . $meter['location_code'] . "','"
. $meter['num'] . "','" . $this->account . "','" . time() . "','" .
$meter['name']
. "','" . $address ."','" . $meter['cat_id']
."','" . $meter['remark']. "' $vals )",__LINE__,__FILE__);
!
! $meter_id =
$this->db->get_last_insert_id('fm_meter','id');
!
! $receipt['meter_id'] = $meter_id;
! $receipt['message'][]=array('msg'=>lang('Meter %1 has
been saved',$meter['num']));
return $receipt;
}
***************
*** 254,262 ****
! $this->db->query("UPDATE fm_meter set name='" .
$meter['name'] . "', entry_date='" . time() . "', type='"
. $meter['cat_id'] .
"', location_code='" . $meter['location_code'] . "', address='" . $address .
"', remark='" . $meter['remark']
. "' $vals WHERE id='"
. $meter['meter_id'] . "'",__LINE__,__FILE__);
! $receipt['message'][]=array('msg'=>lang('Meter %1 has
been edited',$meter['meter_id']));
return $receipt;
}
--- 261,269 ----
! $this->db->query("UPDATE fm_meter set name='" .
$meter['name'] . "', entry_date='" . time() . "', category='"
. $meter['cat_id'] .
"', location_code='" . $meter['location_code'] . "', address='" . $address .
"', remark='" . $meter['remark']
. "' $vals WHERE id='"
. $meter['meter_id'] . "'",__LINE__,__FILE__);
! $receipt['message'][]=array('msg'=>lang('Meter %1 has
been edited',$meter['num']));
return $receipt;
}
Index: class.soinvestment.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.soinvestment.inc.php,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** class.soinvestment.inc.php 24 Jun 2003 13:07:40 -0000 1.14
--- class.soinvestment.inc.php 25 Jun 2003 09:47:28 -0000 1.15
***************
*** 9,13 ****
class soinvestment
{
- var $grants;
function soinvestment()
--- 9,12 ----
***************
*** 16,20 ****
$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->socommon =
CreateObject($this->currentapp.'.socommon');
--- 15,18 ----
***************
*** 23,27 ****
}
-
function get_type_list()
{
--- 21,24 ----
***************
*** 174,177 ****
--- 171,189 ----
//_debug_array($values);
+ while (is_array($values['location']) &&
list($input_name,$value) = each($values['location']))
+ {
+ if($value)
+ {
+ $cols[] = $input_name;
+ $vals[] = $value;
+ }
+ }
+
+ if($cols)
+ {
+ $cols = "," . implode(",", $cols);
+ $vals = ",'" . implode("','", $vals) . "'";
+ }
+
$period = $values['period'];
$type = $values['funding'];
***************
*** 188,193 ****
$next_invest_id = $this->db->f('max_invest_id')+1;
! $this->db->query("insert into fm_investment (entity_id,
invest_id,entity_type,location_code,writeoff_year, descr) "
! . " values ('$entity_id',
'$next_invest_id','$entity_type','$location_code','$period','$descr')");
$this->db->query("insert into fm_investment_value
(entity_id, invest_id, index_count, this_index, current_index,
value,initial_value, date) "
--- 200,205 ----
$next_invest_id = $this->db->f('max_invest_id')+1;
! $this->db->query("insert into fm_investment (entity_id,
invest_id,entity_type,location_code,writeoff_year, descr $cols) "
! . " values ('$entity_id',
'$next_invest_id','$entity_type','$location_code','$period','$descr' $vals )");
$this->db->query("insert into fm_investment_value
(entity_id, invest_id, index_count, this_index, current_index,
value,initial_value, date) "
***************
*** 197,201 ****
$receipt['message'][]=array('msg' => lang('Investment
added !'));
$receipt['message'][]=array('msg' => lang('Entity ID
'). $entity_id);
! $receipt['message'][]=array('msg' => lang('Investment
ID:'). $next_invest_id);
return $receipt;
}
--- 209,213 ----
$receipt['message'][]=array('msg' => lang('Investment
added !'));
$receipt['message'][]=array('msg' => lang('Entity ID
'). $entity_id);
! $receipt['message'][]=array('msg' => lang('Investment
ID:'). ' ' . $next_invest_id);
return $receipt;
}
***************
*** 271,301 ****
return $period_list;
- }
-
- function add($building)
- {
-
- $this->db->query("INSERT INTO fm_building
(location_code,
property_id,building_id,owner,access,entry_date,building_name,general_address,cat_id)
"
- . "VALUES ('" . $building['location_code'].
"','" . $building['property_id'] . "','" . $building['building_id'] . "','" .
$this->account . "','" . $building['access'] . "','" . time() . "','" .
$building['name']
- . "','" . $building['general_address'] ."','" .
$building['cat_id']. "')",__LINE__,__FILE__);
-
- $ids['building_id'] = $building['building_id'];
- $ids['property_id'] = $building['property_id'];
-
- $receipt['message'][] = array('msg' => lang('Building
has been saved'));
- return $receipt;
- }
-
- function edit($building)
- {
- $building['content'] =
$this->db->db_addslashes($building['content']);
-
- $this->db->query("UPDATE fm_building set
building_name='" . $building['name'] . "', entry_date='" . time()
- . "', cat_id='" .
$building['cat_id'] . "', general_address='" . $building['general_address'] .
"', access='" . $building['access']
- . "' WHERE property_id= '" .
$building['property_id']
- . "' AND building_id=" .
$building['building_id'],__LINE__,__FILE__);
-
- $receipt['message'][] = array('msg' => lang('Building
has been edited'));
- return $receipt;
}
--- 283,286 ----
Index: class.bometer.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.bometer.inc.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** class.bometer.inc.php 24 Jun 2003 13:07:40 -0000 1.4
--- class.bometer.inc.php 25 Jun 2003 09:47:28 -0000 1.5
***************
*** 197,203 ****
}
! function check_meter_id($meter_id)
{
! return $this->so->check_meter_id($meter_id);
}
--- 197,203 ----
}
! function check_meter_num($num)
{
! return $this->so->check_meter_num($num);
}
Index: class.boinvestment.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.boinvestment.inc.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** class.boinvestment.inc.php 24 Jun 2003 13:07:40 -0000 1.11
--- class.boinvestment.inc.php 25 Jun 2003 09:47:28 -0000 1.12
***************
*** 110,114 ****
{
$data =
$GLOBALS['phpgw']->session->appsession('session_data','investment');
-
$this->start = $data['start'];
$this->query = $data['query'];
--- 110,113 ----
***************
*** 131,134 ****
--- 130,134 ----
function read()
{
+
$investment = $this->so->read(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,'allrows'=>$this->allrows));
***************
*** 235,239 ****
$values['location_code']=implode("-", $location);
! _debug_array($values);
$date_array=$this->bocommon->date_array($values['date']);
--- 235,239 ----
$values['location_code']=implode("-", $location);
! //_debug_array($values);
$date_array=$this->bocommon->date_array($values['date']);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: property/inc class.uimeter.inc.php,1.13,1.14 class.uiinvestment.inc.php,1.22,1.23 class.someter.inc.php,1.4,1.5 class.soinvestment.inc.php,1.14,1.15 class.bometer.inc.php,1.4,1.5 class.boinvestment.inc.php,1.11,1.12,
Sigurd Nes <address@hidden> <=