[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [6597] merge 6587:6596 from trunk
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [6597] merge 6587:6596 from trunk |
Date: |
Mon, 15 Nov 2010 21:48:48 +0000 |
Revision: 6597
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=6597
Author: sigurdne
Date: 2010-11-15 21:48:48 +0000 (Mon, 15 Nov 2010)
Log Message:
-----------
merge 6587:6596 from trunk
Modified Paths:
--------------
branches/Version-1_0-branch/bookingfrontend/templates/base/resource.xsl
branches/Version-1_0-branch/property/inc/class.bocategory.inc.php
branches/Version-1_0-branch/property/inc/class.bocommon.inc.php
branches/Version-1_0-branch/property/inc/class.boinvoice.inc.php
branches/Version-1_0-branch/property/inc/class.menu.inc.php
branches/Version-1_0-branch/property/inc/class.soXport.inc.php
branches/Version-1_0-branch/property/inc/class.socategory.inc.php
branches/Version-1_0-branch/property/inc/class.soinvoice.inc.php
branches/Version-1_0-branch/property/inc/class.solookup.inc.php
branches/Version-1_0-branch/property/inc/class.uiactor.inc.php
branches/Version-1_0-branch/property/inc/class.uicategory.inc.php
branches/Version-1_0-branch/property/inc/class.uiinvoice.inc.php
branches/Version-1_0-branch/property/inc/cron/default/Import_fra_basware_X205.php
branches/Version-1_0-branch/property/inc/export/default/Basware_X114
branches/Version-1_0-branch/property/js/yahoo/category.index.js
branches/Version-1_0-branch/property/js/yahoo/invoice.index.js
branches/Version-1_0-branch/property/js/yahoo/invoice.list_sub.js
branches/Version-1_0-branch/property/setup/phpgw_no.lang
branches/Version-1_0-branch/property/setup/setup.inc.php
branches/Version-1_0-branch/property/setup/tables_current.inc.php
branches/Version-1_0-branch/property/setup/tables_update.inc.php
branches/Version-1_0-branch/property/templates/base/category.xsl
branches/Version-1_0-branch/property/tutorials/property/examples/install.apache.sh
Removed Paths:
-------------
branches/Version-1_0-branch/property/inc/class.bob_account.inc.php
branches/Version-1_0-branch/property/inc/class.bop_of_town.inc.php
branches/Version-1_0-branch/property/inc/class.bor_agreement.inc.php
branches/Version-1_0-branch/property/inc/class.bostandard_2.inc.php
branches/Version-1_0-branch/property/inc/class.bostandard_3.inc.php
branches/Version-1_0-branch/property/inc/class.sob_account.inc.php
branches/Version-1_0-branch/property/inc/class.sop_of_town.inc.php
branches/Version-1_0-branch/property/inc/class.sor_agreement.inc.php
branches/Version-1_0-branch/property/inc/class.sostandard_2.inc.php
branches/Version-1_0-branch/property/inc/class.sostandard_3.inc.php
branches/Version-1_0-branch/property/inc/class.uib_account.inc.php
branches/Version-1_0-branch/property/inc/class.uip_of_town.inc.php
branches/Version-1_0-branch/property/inc/class.uir_agreement.inc.php
branches/Version-1_0-branch/property/inc/class.uistandard_2.inc.php
branches/Version-1_0-branch/property/inc/class.uistandard_3.inc.php
branches/Version-1_0-branch/property/js/yahoo/account.index.js
branches/Version-1_0-branch/property/js/yahoo/uistandard_2.index.js
branches/Version-1_0-branch/property/js/yahoo/uistandard_3.index.js
branches/Version-1_0-branch/property/templates/base/b_account.xsl
branches/Version-1_0-branch/property/templates/base/p_of_town.xsl
branches/Version-1_0-branch/property/templates/base/r_agreement.xsl
branches/Version-1_0-branch/property/templates/base/standard_2.xsl
branches/Version-1_0-branch/property/templates/base/standard_3.xsl
Property Changed:
----------------
branches/Version-1_0-branch/
Property changes on: branches/Version-1_0-branch
___________________________________________________________________
Modified: svn:mergeinfo
-
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586
+
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596
Modified:
branches/Version-1_0-branch/bookingfrontend/templates/base/resource.xsl
===================================================================
--- branches/Version-1_0-branch/bookingfrontend/templates/base/resource.xsl
2010-11-15 21:41:12 UTC (rev 6596)
+++ branches/Version-1_0-branch/bookingfrontend/templates/base/resource.xsl
2010-11-15 21:48:48 UTC (rev 6597)
@@ -50,7 +50,7 @@
YAHOO.util.Event.addListener(window, "load", function() {
var url =
'index.php?menuaction=bookingfrontend.uidocument_resource.index&sort=name&no_images=1&filter_owner_id='
+ resource_id + '&phpgw_return_as=json&';
- var colDefs = [{key: 'name', label: lang['Name']}];
+ var colDefs = [{key: 'name', label: lang['Name'], formatter:
YAHOO.booking.formatLink}];
YAHOO.booking.inlineTableHelper('documents_container', url, colDefs);
var url =
'index.php?menuaction=bookingfrontend.uidocument_resource.index_images&sort=name&filter_owner_id='
+ resource_id + '&phpgw_return_as=json&';
Deleted: branches/Version-1_0-branch/property/inc/class.bob_account.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.bob_account.inc.php
2010-11-15 21:41:12 UTC (rev 6596)
+++ branches/Version-1_0-branch/property/inc/class.bob_account.inc.php
2010-11-15 21:48:48 UTC (rev 6597)
@@ -1,195 +0,0 @@
-<?php
- /**
- * phpGroupWare - property: a Facilities Management System.
- *
- * @author Sigurd Nes <address@hidden>
- * @copyright Copyright (C) 2003,2004,2005,2006,2007 Free Software
Foundation, Inc. http://www.fsf.org/
- * This file is part of phpGroupWare.
- *
- * phpGroupWare is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * phpGroupWare is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with phpGroupWare; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
USA
- *
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
- * @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
- * @package property
- * @subpackage admin
- * @version $Id$
- */
-
- /**
- * Description
- * @package property
- */
-
- class property_bob_account
- {
- var $start;
- var $query;
- var $filter;
- var $sort;
- var $order;
- var $cat_id;
-
- var $public_functions = array
- (
- 'read' => true,
- 'read_single' => true,
- 'save' => true,
- 'delete' => true,
- 'check_perms' => true
- );
-
- var $soap_functions = array(
- 'list' => array(
- 'in' =>
array('int','int','struct','string','int'),
- 'out' => array('array')
- ),
- 'read' => array(
- 'in' => array('int','struct'),
- 'out' => array('array')
- ),
- 'save' => array(
- 'in' => array('int','struct'),
- 'out' => array()
- ),
- 'delete' => array(
- 'in' => array('int','struct'),
- 'out' => array()
- )
- );
-
- function property_bob_account($session=false)
- {
- // $this->currentapp =
$GLOBALS['phpgw_info']['flags']['currentapp'];
- $this->so =
CreateObject('property.sob_account');
- $this->socommon = CreateObject('property.socommon');
-
- if ($session)
- {
- $this->read_sessiondata();
- $this->use_session = true;
- }
-
- $start = phpgw::get_var('start', 'int', 'REQUEST', 0);
- $query = phpgw::get_var('query');
- $sort = phpgw::get_var('sort');
- $order = phpgw::get_var('order');
- $filter = phpgw::get_var('filter', 'int');
- $cat_id = phpgw::get_var('cat_id', 'int');
- $allrows= phpgw::get_var('allrows', 'bool');
-
- if ($start)
- {
- $this->start=$start;
- }
- else
- {
- $this->start=0;
- }
-
- if(isset($query))
- {
- $this->query = $query;
- }
- if(!empty($filter))
- {
- $this->filter = $filter;
- }
- if(isset($sort))
- {
- $this->sort = $sort;
- }
- if(isset($order))
- {
- $this->order = $order;
- }
- if(isset($cat_id))
- {
- $this->cat_id = $cat_id;
- }
- if(isset($allrows))
- {
- $this->allrows = $allrows;
- }
- }
-
-
- function save_sessiondata($data)
- {
- if ($this->use_session)
- {
-
$GLOBALS['phpgw']->session->appsession('session_data','b_account',$data);
- }
- }
-
- function read_sessiondata()
- {
- $data =
$GLOBALS['phpgw']->session->appsession('session_data','b_account');
-
- //_debug_array($data);
-
- $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->allrows = $data['allrows'];
- }
-
-
- function read()
- {
- $b_account = $this->so->read(array('start' =>
$this->start,'query' => $this->query,'sort' => $this->sort,'order' =>
$this->order,
-
'allrows'=>$this->allrows));
-
- $this->total_records = $this->so->total_records;
-
- return $b_account;
- }
-
- function read_single($id)
- {
- return $this->so->read_single($id);
- }
-
- function select_part_of_town($part_of_town_id)
- {
- return
$this->socommon->select_part_of_town($part_of_town_id);
- }
-
- function save($b_account,$action='')
- {
- if ($action=='edit')
- {
- if ($b_account['id'] != '')
- {
-
- $receipt = $this->so->edit($b_account);
- }
- }
- else
- {
- $receipt = $this->so->add($b_account);
- }
-
- return $receipt;
- }
-
- function delete($id)
- {
- $this->so->delete($id);
- }
- }
-
Modified: branches/Version-1_0-branch/property/inc/class.bocategory.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.bocategory.inc.php
2010-11-15 21:41:12 UTC (rev 6596)
+++ branches/Version-1_0-branch/property/inc/class.bocategory.inc.php
2010-11-15 21:48:48 UTC (rev 6597)
@@ -64,15 +64,8 @@
function __construct($session=false)
{
$this->so =
CreateObject('property.socategory');
- $this->socommon =
CreateObject('property.socommon');
$this->custom = & $this->so->custom;
- if ($session)
- {
- $this->read_sessiondata();
- $this->use_session = true;
- }
-
$start =
phpgw::get_var('start', 'int', 'REQUEST', 0);
$query =
phpgw::get_var('query');
$sort =
phpgw::get_var('sort');
@@ -83,10 +76,16 @@
$type =
phpgw::get_var('type');
$type_id =
phpgw::get_var('type_id', 'int');
+ if ($session)
+ {
+ $this->read_sessiondata($type);
+ $this->use_session = true;
+ }
+
$this->start = $start ? $start : 0;
$this->query = isset($_REQUEST['query']) ?
$query : $this->query;
$this->sort =
isset($_REQUEST['sort']) ? $sort : $this->sort;
- $this->order = isset($_REQUEST['order']) ?
$order : $this->order;
+ $this->order = isset($_REQUEST['order']) &&
$_REQUEST['order'] ? $order : $this->order;
$this->filter = isset($_REQUEST['filter']) ?
$filter : $this->filter;
$this->cat_id = isset($_REQUEST['cat_id']) ?
$cat_id : $this->cat_id;
$this->allrows = isset($allrows) ? $allrows :
false;
@@ -99,13 +98,13 @@
{
if ($this->use_session)
{
-
$GLOBALS['phpgw']->session->appsession('session_data','category',$data);
+
$GLOBALS['phpgw']->session->appsession('session_data',"generic_{$data['type']}",$data);
}
}
- function read_sessiondata()
+ function read_sessiondata($type)
{
- $data =
$GLOBALS['phpgw']->session->appsession('session_data','category');
+ $data =
$GLOBALS['phpgw']->session->appsession('session_data',"generic_{$type}");
// _debug_array($data);
@@ -123,10 +122,22 @@
return $this->so->get_location_info($type,$type_id);
}
- public function read()
+ public function read($filter = array())
{
+
+ if (! $filter )
+ {
+ foreach ( $this->location_info['fields'] as
$field )
+ {
+ if (isset($field['filter']) &&
$field['filter'])
+ {
+ $filter[$field['name']] =
phpgw::get_var($field['name']);
+ }
+ }
+ }
+
$values = $this->so->read(array('start' =>
$this->start,'query' => $this->query,'sort' => $this->sort,'order' =>
$this->order,
-
'allrows'=>$this->allrows));
+
'allrows'=>$this->allrows),$filter);
$this->total_records = $this->so->total_records;
$this->uicols = $this->so->uicols;
@@ -178,9 +189,26 @@
return $receipt;
}
+ /**
+ * Get a list from and tag the selected item
+ *
+ * @param array $data
+ *
+ * @return array with information to include in forms
+ */
+
+ public function get_list($data)
+ {
+ $values = $this->so->get_list($data);
+ foreach ($values as &$entry)
+ {
+ $entry['selected'] = isset($data['selected'])
&& $data['selected'] == $entry['id'] ? 1 : 0;
+ }
+ return $values;
+ }
+
public function delete($id)
{
$this->so->delete($id);
}
}
-
Modified: branches/Version-1_0-branch/property/inc/class.bocommon.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.bocommon.inc.php
2010-11-15 21:41:12 UTC (rev 6596)
+++ branches/Version-1_0-branch/property/inc/class.bocommon.inc.php
2010-11-15 21:48:48 UTC (rev 6597)
@@ -495,6 +495,17 @@
function
get_user_list_right2($format='',$right='',$selected='',$acl_location='',$extra='',$default='')
{
+ if(is_array($format)) // i.e: called by ExecMethod()
+ {
+ $data = $format;
+ $format =
isset($data['format']) ? $data['format'] : '';
+ $right = isset($data['right'])
? $data['right'] : '';
+ $selected =
isset($data['selected']) ? $data['selected'] : '';
+ $acl_location = isset($data['acl_location'])
? $data['acl_location'] : '';
+ $extra = isset($data['extra'])
? $data['extra'] : '';
+ $default =
isset($data['default']) ? $data['default'] : '';
+ }
+
switch($format)
{
case 'select':
@@ -737,17 +748,16 @@
$b_account['lang_b_account'] =
isset($data['role']) && $data['role'] == 'group' ? lang('budget account group')
: lang('Budget account');
if($data['b_account_id'] && !$data['b_account_name'])
{
+ $b_account_object =
CreateObject('property.socategory');
if(isset($data['role']) && $data['role'] ==
'group')
{
- $b_account_object =
CreateObject('property.socategory');
$b_account_object->get_location_info('b_account',false);
- $b_account_data =
$b_account_object->read_single(array('id'=> $data['b_account_id']));
}
else
{
- $b_account_object =
CreateObject('property.sob_account');
- $b_account_data =
$b_account_object->read_single($data['b_account_id']);
+
$b_account_object->get_location_info('budget_account',false);
}
+ $b_account_data =
$b_account_object->read_single(array('id'=> $data['b_account_id']));
$b_account['value_b_account_name'] =
$b_account_data['descr'];
}
Modified: branches/Version-1_0-branch/property/inc/class.boinvoice.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.boinvoice.inc.php
2010-11-15 21:41:12 UTC (rev 6596)
+++ branches/Version-1_0-branch/property/inc/class.boinvoice.inc.php
2010-11-15 21:48:48 UTC (rev 6597)
@@ -111,6 +111,38 @@
'voucher_id'=>$voucher_id,'b_account_class' =>$this->b_account_class,
'district_id' => $this->district_id));
+ $soXport = CreateObject('property.soXport');
+ $soworkorder = CreateObject('property.soworkorder');
+ $sos_agreement = CreateObject('property.sos_agreement');
+ foreach ( $invoice as & $entry )
+ {
+ if( $entry['order_id'] )
+ {
+ if($order_type =
$soXport->check_order($entry['order_id']))
+ {
+ if($order_type == 'workorder')
+ {
+ $workorder =
$soworkorder->read_single($entry['order_id']);
+
+
if($workorder['vendor_id'] && ($workorder['vendor_id'] != $entry['vendor_id']))
+ {
+
$entry['vendor'] =
$this->get_vendor_name($workorder['vendor_id']) . ' => ' . $entry['vendor'];
+ }
+ }
+
+ if($order_type == 's_agreement')
+ {
+ $s_agreement =
$sos_agreement->read_single(array('s_agreement_id'=>$entry['order_id']));
+
+
if($s_agreement['vendor_id'] && ($s_agreement['vendor_id'] !=
$entry['vendor_id']))
+ {
+
$entry['vendor'] =
$this->get_vendor_name($s_agreement['vendor_id']) . ' => ' . $entry['vendor'];
+ }
+ }
+ }
+ }
+ }
+
$this->total_records = $this->so->total_records;
return $invoice;
Deleted: branches/Version-1_0-branch/property/inc/class.bop_of_town.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.bop_of_town.inc.php
2010-11-15 21:41:12 UTC (rev 6596)
+++ branches/Version-1_0-branch/property/inc/class.bop_of_town.inc.php
2010-11-15 21:48:48 UTC (rev 6597)
@@ -1,258 +0,0 @@
-<?php
- /**
- * phpGroupWare - property: a Facilities Management System.
- *
- * @author Sigurd Nes <address@hidden>
- * @copyright Copyright (C) 2003,2004,2005,2006,2007 Free Software
Foundation, Inc. http://www.fsf.org/
- * This file is part of phpGroupWare.
- *
- * phpGroupWare is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * phpGroupWare is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with phpGroupWare; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
USA
- *
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
- * @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
- * @package property
- * @subpackage admin
- * @version $Id$
- */
-
- /**
- * Description
- * @package property
- */
-
- class property_bop_of_town
- {
- var $start;
- var $query;
- var $filter;
- var $sort;
- var $order;
- var $district_id;
-
- var $public_functions = array
- (
- 'read' => true,
- 'read_single' => true,
- 'save' => true,
- 'delete' => true,
- 'check_perms' => true
- );
-
- var $soap_functions = array(
- 'list' => array(
- 'in' =>
array('int','int','struct','string','int'),
- 'out' => array('array')
- ),
- 'read' => array(
- 'in' => array('int','struct'),
- 'out' => array('array')
- ),
- 'save' => array(
- 'in' => array('int','struct'),
- 'out' => array()
- ),
- 'delete' => array(
- 'in' => array('int','struct'),
- 'out' => array()
- )
- );
-
- function property_bop_of_town($session=false)
- {
- // $this->currentapp =
$GLOBALS['phpgw_info']['flags']['currentapp'];
- $this->so = CreateObject('property.sop_of_town');
-
- if ($session)
- {
- $this->read_sessiondata();
- $this->use_session = true;
- }
-
- $start = phpgw::get_var('start', 'int', 'REQUEST', 0);
- $query = phpgw::get_var('query');
- $sort = phpgw::get_var('sort');
- $order = phpgw::get_var('order');
- $filter = phpgw::get_var('filter', 'int');
- $district_id = phpgw::get_var('district_id', 'int');
- $allrows =
phpgw::get_var('allrows', 'bool');
-
- if ($start)
- {
- $this->start=$start;
- }
- else
- {
- $this->start=0;
- }
-
- if(isset($query))
- {
- $this->query = $query;
- }
- if(!empty($filter))
- {
- $this->filter = $filter;
- }
- if(isset($sort))
- {
- $this->sort = $sort;
- }
- if(isset($order))
- {
- $this->order = $order;
- }
- if(isset($district_id) && !empty($district_id))
- {
- $this->district_id = $district_id;
- }
- else
- {
- unset($this->district_id);
- }
- if(isset($allrows))
- {
- $this->allrows = $allrows;
- }
- }
-
- function list_methods($_type='xmlrpc')
- {
- /*
- This handles introspection or discovery by the logged
in client,
- in which case the input might be an array. The
server always calls
- this function to fill the server dispatch map using a
string.
- */
- if (is_array($_type))
- {
- $_type = $_type['type'] ? $_type['type'] :
$_type[0];
- }
- switch($_type)
- {
- case 'xmlrpc':
- $xml_functions = array(
- 'read' => array(
- 'function' => 'read',
- 'signature' =>
array(array(xmlrpcInt,xmlrpcStruct)),
- 'docstring' =>
lang('Read a single entry by passing the id and fieldlist.')
- ),
- 'save' => array(
- 'function' => 'save',
- 'signature' =>
array(array(xmlrpcStruct,xmlrpcStruct)),
- 'docstring' =>
lang('Update a single entry by passing the fields.')
- ),
- 'delete' => array(
- 'function' => 'delete',
- 'signature' =>
array(array(xmlrpcBoolean,xmlrpcInt)),
- 'docstring' =>
lang('Delete a single entry by passing the id.')
- ),
- 'list' => array(
- 'function' => '_list',
- 'signature' =>
array(array(xmlrpcStruct,xmlrpcStruct)),
- 'docstring' =>
lang('Read a list of entries.')
- ),
- 'list_methods' => array(
- 'function' =>
'list_methods',
- 'signature' =>
array(array(xmlrpcStruct,xmlrpcString)),
- 'docstring' =>
lang('Read this list of methods.')
- )
- );
- return $xml_functions;
- break;
- case 'soap':
- return $this->soap_functions;
- break;
- default:
- return array();
- break;
- }
- }
-
- function save_sessiondata($data)
- {
- if ($this->use_session)
- {
-
$GLOBALS['phpgw']->session->appsession('session_data','p_of_town',$data);
- }
- }
-
- function read_sessiondata()
- {
- $data =
$GLOBALS['phpgw']->session->appsession('session_data','p_of_town');
-
- $this->start = $data['start'];
- $this->query = $data['query'];
- $this->filter = $data['filter'];
- $this->sort = $data['sort'];
- $this->order = $data['order'];
- $this->district_id = $data['district_id'];
- }
-
- function check_perms($has, $needed)
- {
- return (!!($has & $needed) == true);
- }
-
-
- function read_district_name($district_id='')
- {
- return $this->so->read_district_name($district_id);
- }
-
-
- function read()
- {
- $p_of_town = $this->so->read(array('start' =>
$this->start,'query' => $this->query,'sort' => $this->sort,'order' =>
$this->order,
-
'filter' => $this->filter,'district_id' =>
$this->district_id,'allrows'=>$this->allrows));
- $this->total_records = $this->so->total_records;
-
- return $p_of_town;
- }
-
- function read_single($part_of_town_id)
- {
- return $this->so->read_single($part_of_town_id);
- }
-
- function save($p_of_town)
- {
-
- if ($p_of_town['part_of_town_id'])
- {
- if ($p_of_town['part_of_town_id'] != 0)
- {
- $part_of_town_id =
$p_of_town['part_of_town_id'];
- $receipt=$this->so->edit($p_of_town);
- }
- }
- else
- {
- $receipt = $this->so->add($p_of_town);
- }
- return $receipt;
- }
-
- function delete($params)
- {
- if (is_array($params))
- {
- $this->so->delete($params[0]);
- }
- else
- {
- $this->so->delete($params);
- }
- }
- }
-
Deleted: branches/Version-1_0-branch/property/inc/class.bor_agreement.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.bor_agreement.inc.php
2010-11-15 21:41:12 UTC (rev 6596)
+++ branches/Version-1_0-branch/property/inc/class.bor_agreement.inc.php
2010-11-15 21:48:48 UTC (rev 6597)
@@ -1,585 +0,0 @@
-<?php
- /**
- * phpGroupWare - property: a Facilities Management System.
- *
- * @author Sigurd Nes <address@hidden>
- * @copyright Copyright (C) 2003,2004,2005,2006,2007 Free Software
Foundation, Inc. http://www.fsf.org/
- * This file is part of phpGroupWare.
- *
- * phpGroupWare is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * phpGroupWare is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with phpGroupWare; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
USA
- *
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
- * @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
- * @package property
- * @subpackage agreement
- * @version $Id$
- */
-
- /**
- * Description
- * @package property
- */
-
- class property_bor_agreement
- {
- var $start;
- var $query;
- var $filter;
- var $sort;
- var $order;
- var $cat_id;
- var $role;
- var $member_id;
-
- /**
- * @var object $custom reference to custom fields object
- */
- protected $custom;
-
- var $public_functions = array
- (
- 'read' => true,
- 'read_single' => true,
- 'save' => true,
- 'delete' => true,
- 'check_perms' => true
- );
-
- function property_bor_agreement($session=false)
- {
- // $this->currentapp =
$GLOBALS['phpgw_info']['flags']['currentapp'];
- $this->so = CreateObject('property.sor_agreement');
- $this->bocommon = CreateObject('property.bocommon');
- $this->custom =
createObject('property.custom_fields');
-
- if ($session)
- {
- $this->read_sessiondata();
- $this->use_session = true;
- }
-
- $reset_query = phpgw::get_var('reset_query',
'bool');
- $sort = phpgw::get_var('sort');
- $order = phpgw::get_var('order');
- $allrows = phpgw::get_var('allrows', 'bool');
- $role = phpgw::get_var('role');
-
- if($reset_query)
- {
- $start = '';
- $query = '';
- $filter = '';
- $cat_id = '';
- $customer_id ='';
- $member_id = '';
- $loc1 = '';
- }
- else
- {
- $start = phpgw::get_var('start', 'int',
'REQUEST', 0);
- $query = phpgw::get_var('query');
- $filter = phpgw::get_var('filter', 'int');
- $cat_id = phpgw::get_var('cat_id', 'int');
- $customer_id = phpgw::get_var('tenant_id',
'int');
- $member_id = phpgw::get_var('member_id',
'int');
- $loc1 = phpgw::get_var('loc1');
- }
-
-
- $this->role = $role;
- $this->so->role = $role;
-
- if ($start)
- {
- $this->start=$start;
- }
- else
- {
- $this->start=0;
- }
-
- if(isset($query))
- {
- $this->query = $query;
- }
- if(!empty($filter))
- {
- $this->filter = $filter;
- }
- if(isset($sort))
- {
- $this->sort = $sort;
- }
- if(isset($order))
- {
- $this->order = $order;
- }
- if(isset($cat_id) && !empty($cat_id))
- {
- $this->cat_id = $cat_id;
- }
- else
- {
- unset($this->cat_id);
- }
- if(isset($allrows))
- {
- $this->allrows = $allrows;
- }
- if(isset($member_id))
- {
- $this->member_id = $member_id;
- }
- if(isset($customer_id))
- {
- $this->customer_id = $customer_id;
- }
- if(isset($loc1))
- {
- $this->loc1 = $loc1;
- }
- }
-
- function save_sessiondata($data)
- {
- if ($this->use_session)
- {
-
$GLOBALS['phpgw']->session->appsession('session_data','r_agreement',$data);
- }
- }
-
- function read_sessiondata()
- {
- $data =
$GLOBALS['phpgw']->session->appsession('session_data','r_agreement');
-
- //_debug_array($data);
-
- $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->customer_id= $data['customer_id'];
- $this->member_id= $data['member_id'];
- $this->allrows = $data['allrows'];
- $this->loc1 = $data['loc1'];
- }
-
- function check_perms($has, $needed)
- {
- return (!!($has & $needed) == true);
- }
-
-
- function select_vendor_list($format='',$selected='')
- {
- switch($format)
- {
- case 'select':
-
$GLOBALS['phpgw']->xslttpl->add_file(array('select_vendor'));
- break;
- case 'filter':
-
$GLOBALS['phpgw']->xslttpl->add_file(array('filter_vendor'));
- break;
- }
-
- $input_list= $this->so->select_vendor_list();
- $vendor_list=
$this->bocommon->select_list($selected,$input_list);
-
- return $vendor_list;
- }
-
- function read()
- {
- $r_agreement = $this->so->read(array('start' =>
$this->start,'query' => $this->query,'sort' => $this->sort,'order' =>
$this->order,
-
'filter' => $this->filter,'cat_id' =>
$this->cat_id,'allrows'=>$this->allrows,'member_id'=>$this->member_id,
-
'customer_id'=>$this->customer_id, 'loc1' => $this->loc1));
- $this->total_records = $this->so->total_records;
-
- $this->uicols = $this->so->uicols;
-
- for ($i=0; $i<count($r_agreement); $i++)
- {
- if($r_agreement[$i]['start_date'])
- {
- $r_agreement[$i]['start_date'] =
$GLOBALS['phpgw']->common->show_date($r_agreement[$i]['start_date'],$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
- }
- if($r_agreement[$i]['end_date'])
- {
- $r_agreement[$i]['end_date'] =
$GLOBALS['phpgw']->common->show_date($r_agreement[$i]['end_date'],$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
- }
- }
- return $r_agreement;
- }
-
- function read_details($id)
- {
- $list = $this->so->read(array('start' =>
$this->start,'query' => $this->query,'sort' => $this->sort,'order' =>
$this->order,
-
'filter' => $this->filter,'cat_id' =>
$this->cat_id,'allrows'=>$this->allrows,'member_id'=>$this->member_id,
-
'r_agreement_id'=>$id,'detail'=>true));
- $this->total_records = $this->so->total_records;
-
- $this->uicols = $this->so->uicols;
-
- for ($i=0; $i<count($list); $i++)
- {
- $list[$i]['index_date'] =
$GLOBALS['phpgw']->common->show_date($list[$i]['index_date'],$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
- }
-
- return $list;
- }
-
- function read_prizing($data)
- {
- $list = $this->so->read_prizing($data);
- $this->total_records = $this->so->total_records;
-
- $this->uicols = $this->so->uicols;
-
- for ($i=0; $i<count($list); $i++)
- {
- $list[$i]['index_date'] =
$GLOBALS['phpgw']->common->show_date($list[$i]['index_date'],$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
- $list[$i]['from_date'] =
$GLOBALS['phpgw']->common->show_date($list[$i]['from_date'],$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
- $list[$i]['to_date'] =
$GLOBALS['phpgw']->common->show_date($list[$i]['to_date'],$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
- if($list[$i]['tenant_id'])
- {
- $list[$i]['tenant'] =
$this->so->get_tenant_name($list[$i]['tenant_id']);
- }
- }
-
- return $list;
- }
-
- function read_event($data)
- {
- $boalarm =
CreateObject('property.boalarm');
- $event =
$this->so->read_single($data['r_agreement_id']);
- $event['alarm_date']=$event['termination_date'];
- $event['alarm'] =
$boalarm->read_alarms($type='r_agreement',$data['r_agreement_id']);
- return $event;
- }
-
- function read_single($data)
- {
-
- $values['attributes'] = $this->custom->find('property',
'.r_agreement', 0, '', 'ASC', 'attrib_sort', true, true);
-
- if(isset($data['r_agreement_id']) &&
$data['r_agreement_id'])
- {
- $values =
$this->so->read_single($data['r_agreement_id'], $values);
- }
-
- $values = $this->custom->prepare($values, 'property',
'.r_agreement', $data['view']);
-
- $dateformat =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
- $values['start_date'] =
$GLOBALS['phpgw']->common->show_date($values['start_date'],$dateformat);
- $values['end_date'] =
$GLOBALS['phpgw']->common->show_date($values['end_date'],$dateformat);
- if($values['termination_date'])
- {
- $values['termination_date']=
$GLOBALS['phpgw']->common->show_date($values['termination_date'],$dateformat);
- }
-
- $vfs = CreateObject('phpgwapi.vfs');
- $vfs->override_acl = 1;
-
- $values['files'] = $vfs->ls (array(
- 'string' => '/property/rental_agreement/' .
$data['r_agreement_id'],
- 'relatives' => array(RELATIVE_NONE)));
-
- $vfs->override_acl = 0;
-
- if(!$values['files'][0]['file_id'])
- {
- unset($values['files']);
- }
-
- return $values;
- }
-
- function read_single_item($data)
- {
- $values['attributes'] = $this->custom->find('property',
'.r_agreement.detail', 0, '', 'ASC', 'attrib_sort', true, true);
-
- if(isset($data['r_agreement_id']) &&
$data['r_agreement_id'] && isset($data['id']) && $data['id'])
- {
- $values = $this->so->read_single_item($data,
$values);
- }
- $values = $this->custom->prepare($values, 'property',
'.r_agreement.detail');
-
- if($values['location_code'])
- {
- $solocation =
CreateObject('property.solocation');
- $values['location_data']
=$solocation->read_single($values['location_code']);
- }
-
- if($values['p_num'])
- {
- $soadmin_entity =
CreateObject('property.soadmin_entity');
- $category =
$soadmin_entity->read_single_category($values['p_entity_id'],$values['p_cat_id']);
-
-
$values['p'][$values['p_entity_id']]['p_num']=$values['p_num'];
-
$values['p'][$values['p_entity_id']]['p_entity_id']=$values['p_entity_id'];
-
$values['p'][$values['p_entity_id']]['p_cat_id']=$values['p_cat_id'];
-
$values['p'][$values['p_entity_id']]['p_cat_name'] = $category['name'];
- }
- return $values;
- }
-
- /**
- * Arrange attributes within groups
- *
- * @param string $location the name of the location of the
attribute
- * @param array $attributes the array of the attributes to be
grouped
- *
- * @return array the grouped attributes
- */
-
- public function get_attribute_groups($location, $attributes =
array())
- {
- return $this->custom->get_attribute_groups('property',
$location, $attributes);
- }
-
- function save($values,$values_attribute='',$action='')
- {
-
- $values['start_date'] =
$this->bocommon->date_to_timestamp($values['start_date']);
- $values['end_date'] =
$this->bocommon->date_to_timestamp($values['end_date']);
- $values['termination_date'] =
$this->bocommon->date_to_timestamp($values['termination_date']);
-
- if(is_array($values_attribute))
- {
- $values_attribute =
$this->custom->convert_attribute_save($values_attribute);
- }
-
- if ($action=='edit')
-// if ($values['r_agreement_id'])
- {
- if ($values['r_agreement_id'] != 0)
- {
-
$receipt=$this->so->edit($values,$values_attribute);
- }
- }
- else
- {
- $receipt =
$this->so->add($values,$values_attribute);
- }
- return $receipt;
- }
-
- function save_item($values,$values_attribute='')
- {
-
- if($values['start_date'])
- {
- $values['start_date'] =
$this->bocommon->date_to_timestamp($values['start_date']);
- }
-
- if($values['start_date'])
- {
- $values['end_date'] =
$this->bocommon->date_to_timestamp($values['end_date']);
- }
-
- while (is_array($values['location']) && list(,$value) =
each($values['location']))
- {
- if($value)
- {
- $location[] = $value;
- }
- }
-
- $values['location_code'address@hidden("-", $location);
-
- if(is_array($values_attribute))
- {
- $values_attribute =
$this->custom->convert_attribute_save($values_attribute);
- }
-
- if ($values['id'])
- {
- if ($values['id'] != 0)
- {
-
$receipt=$this->so->edit_item($values,$values_attribute);
- }
- }
- else
- {
- $receipt =
$this->so->add_item($values,$values_attribute);
- }
- return $receipt;
- }
-
-
- function update_item_history($values)
- {
- if($values['start_date'])
- {
- $values['start_date'] =
$this->bocommon->date_to_timestamp($values['start_date']);
- }
-
- if($values['start_date'])
- {
- $values['end_date'] =
$this->bocommon->date_to_timestamp($values['end_date']);
- }
-
- $values['date'] =
$this->bocommon->date_to_timestamp($values['date']);
-
- return $this->so->update_item_history($values);
- }
-
- function delete_last_index($r_agreement_id,$id)
- {
- $this->so->delete_last_index($r_agreement_id,$id);
- }
-
-
- function delete_item($r_agreement_id,$item_id)
- {
- $this->so->delete_item($r_agreement_id,$item_id);
- }
-
- function delete($r_agreement_id='')
- {
- $this->so->delete($r_agreement_id);
- }
-
- function read_attrib($type_id='')
- {
- $attrib = $this->so->read_attrib(array('start' =>
$this->start,'query' => $this->query,'sort' => $this->sort,'order' =>
$this->order,
-
'allrows'=>$this->allrows));
-
- for ($i=0; $i<count($attrib); $i++)
- {
- $attrib[$i]['datatype'] =
$this->bocommon->translate_datatype($attrib[$i]['datatype']);
- }
-
- $this->total_records = $this->so->total_records;
-
- return $attrib;
- }
-
-
- function column_list($selected='',$allrows='')
- {
- if(!$selected)
- {
-
$selected=$GLOBALS['phpgw_info']['user']['preferences']['property']['r_agreement_columns'];
- }
- $filter = array('list' => ''); // translates to "list
IS NULL"
- $columns =
$this->custom->find('property','.r_agreement', 0, '','','',true, false,
$filter);
-
$column_list=$this->bocommon->select_multi_list($selected,$columns);
- return $column_list;
- }
-
- function request_next_id()
- {
- return $this->so->request_next_id();
- }
-
- function get_rental_type_list($selected = '')
- {
- $input_list[0]['id'] = 1;
- $input_list[0]['name'] = lang('plain');
- $input_list[1]['id'] = 2;
- $input_list[1]['name'] = lang('Floor common');
- $input_list[2]['id'] = 3;
- $input_list[2]['name'] = lang('Building common');
- $input_list[3]['id'] = 4;
- $input_list[3]['name'] = lang('Shared use');
-
- $rental_type_list=
$this->bocommon->select_list($selected,$input_list);
-
- return $rental_type_list;
- }
-
- function get_rental_type_list2($selected = '')
- {
- $rental_type = array(
- 1 => lang('plain'),
- 2 => lang('Floor common'),
- 3 => lang('Building common'),
- 4 => lang('Shared use'),
- );
-
- return $rental_type[$selected];
- }
-
- function read_common($id)
- {
- $dateformat =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
- $values = $this->so->read_common($id);
-
- $this->total_records = $this->so->total_records;
-
- for ($i=0; $i<count($values); $i++)
- {
- $values[$i]['from_date'] =
$GLOBALS['phpgw']->common->show_date($values[$i]['from_date'],$dateformat);
- $values[$i]['to_date'] =
$GLOBALS['phpgw']->common->show_date($values[$i]['to_date'],$dateformat);
- }
-
-
- return $values;
- }
-
- function read_single_common($data)
- {
- $values = $this->so->read_single_common($data);
-
- return $values;
- }
- function read_common_history($data)
- {
- $values = $this->so->read_common_history($data);
- $this->total_records = $this->so->total_records;
- for ($i=0; $i<count($values); $i++)
- {
- $values[$i]['from_date'] =
$GLOBALS['phpgw']->common->show_date($values[$i]['from_date'],$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
- $values[$i]['to_date'] =
$GLOBALS['phpgw']->common->show_date($values[$i]['to_date'],$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
- }
-
- return $values;
- }
-
- function save_common($values)
- {
- if($values['start_date'])
- {
- $values['start_date'] =
$this->bocommon->date_to_timestamp($values['start_date']);
- }
-
- if($values['start_date'])
- {
- $values['end_date'] =
$this->bocommon->date_to_timestamp($values['end_date']);
- }
-
- if ($values['c_id'])
- {
- if ($values['c_id'] != 0)
- {
-
$receipt=$this->so->add_common_history($values);
- }
- }
- else
- {
- $receipt = $this->so->add_common($values);
- }
- return $receipt;
- }
- function delete_common_h($r_agreement_id,$c_id,$id)
- {
- $this->so->delete_common_h($r_agreement_id,$c_id,$id);
- }
- }
-
Deleted: branches/Version-1_0-branch/property/inc/class.bostandard_2.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.bostandard_2.inc.php
2010-11-15 21:41:12 UTC (rev 6596)
+++ branches/Version-1_0-branch/property/inc/class.bostandard_2.inc.php
2010-11-15 21:48:48 UTC (rev 6597)
@@ -1,191 +0,0 @@
-<?php
- /**
- * phpGroupWare - property: a Facilities Management System.
- *
- * @author Sigurd Nes <address@hidden>
- * @copyright Copyright (C) 2003,2004,2005,2006,2007 Free Software
Foundation, Inc. http://www.fsf.org/
- * This file is part of phpGroupWare.
- *
- * phpGroupWare is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * phpGroupWare is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with phpGroupWare; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
USA
- *
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
- * @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
- * @package property
- * @subpackage admin
- * @version $Id$
- */
-
- /**
- * Description
- * @package property
- */
-
- class property_bostandard_2
- {
- var $start;
- var $query;
- var $filter;
- var $sort;
- var $order;
- var $cat_id;
-
- var $public_functions = array
- (
- 'read' => true,
- 'read_single' => true,
- 'save' => true,
- 'delete' => true,
- 'check_perms' => true
- );
-
- var $soap_functions = array(
- 'list' => array(
- 'in' =>
array('int','int','struct','string','int'),
- 'out' => array('array')
- ),
- 'read' => array(
- 'in' => array('int','struct'),
- 'out' => array('array')
- ),
- 'save' => array(
- 'in' => array('int','struct'),
- 'out' => array()
- ),
- 'delete' => array(
- 'in' => array('int','struct'),
- 'out' => array()
- )
- );
-
- function property_bostandard_2($session=false)
- {
- // $this->currentapp =
$GLOBALS['phpgw_info']['flags']['currentapp'];
- $this->so =
CreateObject('property.sostandard_2');
- $this->socommon = CreateObject('property.socommon');
-
- if ($session)
- {
- $this->read_sessiondata();
- $this->use_session = true;
- }
-
- $start = phpgw::get_var('start', 'int', 'REQUEST', 0);
- $query = phpgw::get_var('query');
- $sort = phpgw::get_var('sort');
- $order = phpgw::get_var('order');
- $filter = phpgw::get_var('filter', 'int');
- $cat_id = phpgw::get_var('cat_id', 'int');
- $allrows= phpgw::get_var('allrows', 'bool');
-
- if ($start)
- {
- $this->start=$start;
- }
- else
- {
- $this->start=0;
- }
-
- if(isset($query))
- {
- $this->query = $query;
- }
- if(!empty($filter))
- {
- $this->filter = $filter;
- }
- if(isset($sort))
- {
- $this->sort = $sort;
- }
- if(isset($order))
- {
- $this->order = $order;
- }
- if(isset($cat_id))
- {
- $this->cat_id = $cat_id;
- }
- if(isset($allrows))
- {
- $this->allrows = $allrows;
- }
- }
-
- function save_sessiondata($data)
- {
- if ($this->use_session)
- {
-
$GLOBALS['phpgw']->session->appsession('session_data','standard_2',$data);
- }
- }
-
- function read_sessiondata()
- {
- $data =
$GLOBALS['phpgw']->session->appsession('session_data','standard_2');
-
- $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->allrows = $data['allrows'];
- }
-
- function read($type='')
- {
- $standard = $this->so->read(array('start' =>
$this->start,'query' => $this->query,'sort' => $this->sort,'order' =>
$this->order,
-
'type' => $type,'allrows'=>$this->allrows));
-
- $this->total_records = $this->so->total_records;
-
- return $standard;
- }
-
- function read_single($id,$type)
- {
- return $this->so->read_single($id,$type);
- }
-
- function select_part_of_town($part_of_town_id)
- {
- return
$this->socommon->select_part_of_town($part_of_town_id);
- }
-
- function save($standard,$action='',$type ='')
- {
- if ($action=='edit')
- {
- if ($standard['id'] != '')
- {
-
- $receipt =
$this->so->edit($standard,$type);
- }
- }
- else
- {
- $receipt = $this->so->add($standard,$type);
- }
- return $receipt;
-
- }
-
- function delete($id,$type)
- {
- $this->so->delete($id,$type);
- }
- }
-
Deleted: branches/Version-1_0-branch/property/inc/class.bostandard_3.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.bostandard_3.inc.php
2010-11-15 21:41:12 UTC (rev 6596)
+++ branches/Version-1_0-branch/property/inc/class.bostandard_3.inc.php
2010-11-15 21:48:48 UTC (rev 6597)
@@ -1,181 +0,0 @@
-<?php
- /**
- * phpGroupWare - property: a Facilities Management System.
- *
- * @author Sigurd Nes <address@hidden>
- * @copyright Copyright (C) 2003,2004,2005,2006,2007 Free Software
Foundation, Inc. http://www.fsf.org/
- * This file is part of phpGroupWare.
- *
- * phpGroupWare is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * phpGroupWare is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with phpGroupWare; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
USA
- *
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
- * @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
- * @package property
- * @subpackage admin
- * @version $Id$
- */
-
- /**
- * Description
- * @package property
- */
-
- class property_bostandard_3
- {
- var $start;
- var $query;
- var $filter;
- var $sort;
- var $order;
- var $cat_id;
-
- var $public_functions = array
- (
- 'read' => true,
- 'read_single' => true,
- 'save' => true,
- 'delete' => true,
- 'check_perms' => true
- );
-
- var $soap_functions = array(
- 'list' => array(
- 'in' =>
array('int','int','struct','string','int'),
- 'out' => array('array')
- ),
- 'read' => array(
- 'in' => array('int','struct'),
- 'out' => array('array')
- ),
- 'save' => array(
- 'in' => array('int','struct'),
- 'out' => array()
- ),
- 'delete' => array(
- 'in' => array('int','struct'),
- 'out' => array()
- )
- );
-
- function property_bostandard_3($session=false)
- {
- // $this->currentapp =
$GLOBALS['phpgw_info']['flags']['currentapp'];
- $this->so =
CreateObject('property.sostandard_3');
- $this->socommon = CreateObject('property.socommon');
-
- if ($session)
- {
- $this->read_sessiondata();
- $this->use_session = true;
- }
-
- $start = phpgw::get_var('start', 'int', 'REQUEST', 0);
- $query = phpgw::get_var('query');
- $sort = phpgw::get_var('sort');
- $order = phpgw::get_var('order');
- $filter = phpgw::get_var('filter', 'int');
- $cat_id = phpgw::get_var('cat_id', 'int');
-
- if ($start)
- {
- $this->start=$start;
- }
- else
- {
- $this->start=0;
- }
-
- if(isset($query))
- {
- $this->query = $query;
- }
- if(!empty($filter))
- {
- $this->filter = $filter;
- }
- if(isset($sort))
- {
- $this->sort = $sort;
- }
- if(isset($order))
- {
- $this->order = $order;
- }
- if(isset($cat_id))
- {
- $this->cat_id = $cat_id;
- }
- }
-
- function save_sessiondata($data)
- {
- if ($this->use_session)
- {
-
$GLOBALS['phpgw']->session->appsession('session_data','standard_3',$data);
- }
- }
-
- function read_sessiondata()
- {
- $data =
$GLOBALS['phpgw']->session->appsession('session_data','standard_3');
-
- $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'];
- }
-
-
- function read($type='')
- {
- $standard = $this->so->read(array('start' =>
$this->start,'query' => $this->query,'sort' => $this->sort,'order' =>
$this->order,
-
'type' => $type));
-
- $this->total_records = $this->so->total_records;
-
- return $standard;
- }
-
- function read_single($id,$type)
- {
- return $this->so->read_single($id,$type);
- }
-
- function save($standard,$action='',$type ='')
- {
- if ($action=='edit')
- {
- if ($standard['id'] != '')
- {
-
- $receipt =
$this->so->edit($standard,$type);
- }
- }
- else
- {
- $receipt = $this->so->add($standard,$type);
- }
- return $receipt;
-
- }
-
- function delete($id,$type)
- {
- $this->so->delete($id,$type);
- }
- }
-
Modified: branches/Version-1_0-branch/property/inc/class.menu.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.menu.inc.php 2010-11-15
21:41:12 UTC (rev 6596)
+++ branches/Version-1_0-branch/property/inc/class.menu.inc.php 2010-11-15
21:48:48 UTC (rev 6597)
@@ -108,7 +108,7 @@
'tenant_cats' => array
(
'text' => lang('Tenant
Categories'),
- 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uicategory.index', 'type' => 'tenant') )
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uicategory.index', 'type' => 'tenant_cats') )
),
'tenant_global_cats' => array
(
@@ -132,7 +132,7 @@
'vendor_cats' => array
(
'text' => lang('Vendor
Categories'),
- 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uicategory.index', 'type' => 'vendor') )
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uicategory.index', 'type' => 'vendor_cats') )
),
'vendor_global_cats' => array
(
@@ -150,7 +150,7 @@
'owner_cats' => array
(
'text' => lang('Owner
Categories'),
- 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uicategory.index', 'type' => 'owner') )
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uicategory.index', 'type' => 'owner_cats') )
),
'owner_attribs' => array
(
@@ -166,6 +166,11 @@
'text' => lang('Accounting
Categories'),
'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uicategory.index', 'type' => 'b_account') )
),
+ 'budget_account' => array
+ (
+ 'text' => lang('budget
account'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uicategory.index', 'type' => 'budget_account') )
+ ),
'accounting_dimb' => array
(
'text' => lang('Accounting dim
b'),
@@ -224,23 +229,7 @@
(
'text' => lang('service
agreement item Attributes'),
'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'admin.ui_custom.list_attribute', 'appname' => 'property', 'location'
=>'.s_agreement.detail', 'menu_selection' =>
'admin::property::agreement::service_agree_item_attribs') )
- ),
- 'rental_agree_cats' => array
- (
- 'text' => lang('rental
agreement categories'),
- 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uicategory.index', 'type' => 'r_agreement') )
- ),
- 'rental_agree_attribs' => array
- (
- 'text' => lang('rental
agreement Attributes'),
- 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'admin.ui_custom.list_attribute', 'appname' => 'property', 'location'
=>'.r_agreement', 'menu_selection' =>
'admin::property::agreement::rental_agree_attribs') )
- ),
- 'rental_agree_item_attribs' => array
- (
- 'text' => lang('rental
agreement item Attributes'),
- 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'admin.ui_custom.list_attribute', 'appname' => 'property', 'location'
=>'.r_agreement.detail', 'menu_selection' =>
'admin::property::agreement::rental_agree_item_attribs') )
- ),
-
+ )
);
foreach ( $locations as $location )
@@ -269,10 +258,15 @@
'text' => lang('District'),
'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uicategory.index', 'type' => 'district') )
),
+ 'district' => array
+ (
+ 'text' => lang('District'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uicategory.index', 'type' => 'district') )
+ ),
'town' => array
(
'text' => lang('Part of town'),
- 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uip_of_town.index') )
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uicategory.index', 'type' => 'part_of_town') )
),
'location' => array
(
@@ -447,7 +441,7 @@
'accounting' => array
(
'text' => lang('Accounting'),
- 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uib_account.index') ),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uicategory.index', 'type' => 'budget_account') ),
'children' =>
$admin_children_accounting
),
'admin_async' => array
@@ -725,10 +719,10 @@
'url' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
'property.uiinvoice.consume')),
'text' =>
lang('consume')
),
- 'budget' => array
+ 'budget_account' => array
(
- 'url' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
'property.uib_account.index')),
- 'text' => lang('Budget
account')
+ 'text' => lang('budget
account'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uicategory.index', 'type' => 'budget_account') )
),
'vendor' => array
(
@@ -825,11 +819,6 @@
'url' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
'property.uis_agreement.index')),
'text' =>
lang('Service')
),
- 'rental' => array
- (
- 'url' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
'property.uir_agreement.index')),
- 'text' =>
lang('Rental')
- ),
'alarm' => array
(
'url' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
'property.uialarm.list_alarm')),
Modified: branches/Version-1_0-branch/property/inc/class.soXport.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.soXport.inc.php
2010-11-15 21:41:12 UTC (rev 6596)
+++ branches/Version-1_0-branch/property/inc/class.soXport.inc.php
2010-11-15 21:48:48 UTC (rev 6597)
@@ -251,18 +251,21 @@
false,
$fields['item_type'],
$fields['item_id'],
- $fields['external_ref']
+ $fields['external_ref'],
+ isset($fields['currency']) &&
$fields['currency'] ? $fields['currency'] : 'NOK',
+
$this->db->money_format($fields['belop']),
+
$this->db->money_format($fields['godkjentbelop'])
);
- $bilagsnr = $fields['bilagsnr'];
+ $bilagsnr =
(int)$fields['bilagsnr'];
$values =
$this->db->validate_insert($values);
$sql= "INSERT INTO fm_ecobilag
(project_id,kostra_id,pmwrkord_code,bilagsnr,splitt,kildeid,kidnr,typeid,fakturadato,"
. "
forfallsdato,regtid,artid,spvend_code,dimb,oppsynsmannid,saksbehandlerid,budsjettansvarligid,"
. "
fakturanr,spbudact_code,loc1,dima,dimd,mvakode,periode,merknad,oppsynsigndato,saksigndato,"
- . "
budsjettsigndato,utbetalingsigndato,item_type,item_id,external_ref,
belop,godkjentbelop)"
- . " VALUES ($values," .
$this->db->money_format($fields['belop']) . "," .
$this->db->money_format($fields['godkjentbelop']) . ")";
+ . "
budsjettsigndato,utbetalingsigndato,item_type,item_id,external_ref,currency,belop,godkjentbelop)"
+ . " VALUES ({$values})";
$this->db->query($sql,__LINE__,__FILE__);
@@ -270,7 +273,7 @@
}
}
- $this->db->query("UPDATE fm_idgenerator set value
=$bilagsnr WHERE name = 'Bilagsnummer'");
+ $this->db->query("UPDATE fm_idgenerator set value =
{$bilagsnr} WHERE name = 'Bilagsnummer'");
$this->db->transaction_commit();
Deleted: branches/Version-1_0-branch/property/inc/class.sob_account.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.sob_account.inc.php
2010-11-15 21:41:12 UTC (rev 6596)
+++ branches/Version-1_0-branch/property/inc/class.sob_account.inc.php
2010-11-15 21:48:48 UTC (rev 6597)
@@ -1,157 +0,0 @@
-<?php
- /**
- * phpGroupWare - property: a Facilities Management System.
- *
- * @author Sigurd Nes <address@hidden>
- * @copyright Copyright (C) 2003,2004,2005,2006,2007 Free Software
Foundation, Inc. http://www.fsf.org/
- * This file is part of phpGroupWare.
- *
- * phpGroupWare is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * phpGroupWare is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with phpGroupWare; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
USA
- *
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
- * @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
- * @package property
- * @subpackage admin
- * @version $Id$
- */
-
- /**
- * Description
- * @package property
- */
-
- class property_sob_account
- {
- function __construct()
- {
- $this->account =
$GLOBALS['phpgw_info']['user']['account_id'];
- $this->db = & $GLOBALS['phpgw']->db;
- $this->join = & $this->db->join;
- $this->like = & $this->db->like;
- }
-
- function read($data)
- {
- if(is_array($data))
- {
- $start = isset($data['start']) &&
$data['start'] ? $data['start'] : 0;
- $query =
isset($data['query'])?$data['query']:'';
- $sort = isset($data['sort']) &&
$data['sort'] ? $data['sort']:'DESC';
- $order =
isset($data['order'])?$data['order']:'';
- $allrows =
isset($data['allrows'])?$data['allrows']:'';
- }
-
- if ($order)
- {
- $ordermethod = " order by $order $sort";
-
- }
- else
- {
- $ordermethod = ' order by id asc';
- }
-
- $table = 'fm_b_account';
-
- if($query)
- {
- $query = $this->db->db_addslashes($query);
- $querymethod = " where id $this->like
'%$query%' or descr $this->like '%$query%'";
- }
-
- $sql = "SELECT * FROM $table $querymethod";
-
- $this->db->query($sql,__LINE__,__FILE__);
- $this->total_records = $this->db->num_rows();
-
- if(!$allrows)
- {
- $this->db->limit_query($sql .
$ordermethod,$start,__LINE__,__FILE__);
- }
- else
- {
- $this->db->query($sql .
$ordermethod,__LINE__,__FILE__);
- }
-
- while ($this->db->next_record())
- {
- $b_account[] = array
- (
- 'id' => $this->db->f('id'),
- 'descr' =>
$this->db->f('descr')
- );
- }
- return $b_account;
- }
-
- function read_single($id)
- {
-
- $table = 'fm_b_account';
-
- $sql = "SELECT * FROM $table where id='$id'";
-
- $this->db->query($sql,__LINE__,__FILE__);
-
- if ($this->db->next_record())
- {
- $b_account['id'] =
$this->db->f('id');
- $b_account['descr'] =
$this->db->f('descr');
- $b_account['cat_id'] =
$this->db->f('category');
- $b_account['responsible'] =
$this->db->f('responsible');
-
- return $b_account;
- }
- }
-
- function add($b_account)
- {
- $table = 'fm_b_account';
-
- $b_account['descr'] =
$this->db->db_addslashes($b_account['descr']);
-
- $this->db->query("INSERT INTO $table (id,
descr,category,responsible) "
- . "VALUES ('" . $b_account['id'] . "','" .
$b_account['descr']. "','" .$b_account['cat_id'] . "','" .
$b_account['responsible'] . "')",__LINE__,__FILE__);
-
- $receipt['message'][]=array('msg'=>lang('budget account
%1 has been saved',$b_account['id']));
- return $receipt;
- }
-
- function edit($b_account)
- {
-
- $table = 'fm_b_account';
-
- $b_account['descr'] =
$this->db->db_addslashes($b_account['descr']);
-
- $this->db->query("UPDATE $table set"
- . " descr='" . $b_account['descr'] .
"',"
- . "responsible=" .
$b_account['responsible'] . ","
- . "category=" .
(int)$b_account['cat_id']
- . " WHERE id='" . $b_account['id'].
"'",__LINE__,__FILE__);
-
-
- $receipt['message'][]=array('msg'=>lang('budget account
%1 has been edited',$b_account['id']));
- return $receipt;
- }
-
- function delete($id)
- {
- $table = 'fm_b_account';
-
- $this->db->query("DELETE FROM $table WHERE id='" . $id
. "'",__LINE__,__FILE__);
- }
- }
-
Modified: branches/Version-1_0-branch/property/inc/class.socategory.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.socategory.inc.php
2010-11-15 21:41:12 UTC (rev 6596)
+++ branches/Version-1_0-branch/property/inc/class.socategory.inc.php
2010-11-15 21:48:48 UTC (rev 6597)
@@ -45,7 +45,7 @@
$this->_join = & $this->_db->join;
}
- function read($data)
+ function read($data, $filter)
{
$start = isset($data['start']) &&
$data['start'] ? $data['start']:0;
$query =
isset($data['query'])?$data['query']:'';
@@ -59,6 +59,50 @@
return $values;
}
+ $valid_order = false;
+
+ if($order)
+ {
+ if($this->location_info['id']['name'] != $order)
+ {
+
+ foreach ($this->location_info['fields']
as $field)
+ {
+ if($field['name'] == $order)
+ {
+ $valid_order = true;
+ break;
+ }
+ }
+ }
+ else
+ {
+ $valid_order = true;
+ }
+
+ if(!$valid_order)
+ {
+ $order = '';
+ }
+ }
+
+ $_filter_array = array();
+ $get_single = array();
+ foreach ( $this->location_info['fields'] as $field )
+ {
+ if (isset($field['filter']) && $field['filter'])
+ {
+ if(isset($filter[$field['name']]) &&
$filter[$field['name']])
+ {
+ $_filter_array[] =
"{$field['name']} = '{$filter[$field['name']]}'";
+ }
+ }
+ if (isset($field['get_single']) &&
$field['get_single'])
+ {
+ $get_single[$field['name']] =
$field['get_single'];
+ }
+ }
+
$uicols = array();
$uicols['input_type'][] = 'text';
$uicols['name'][] =
$this->location_info['id']['name'];
@@ -110,15 +154,22 @@
$filtermethod = "{$where} user_id =
{$this->account} OR public = 1";
$where = 'AND';
}
+
+ if($_filter_array)
+ {
+ $filtermethod .= " $where " . implode(' AND ',
$_filter_array);
+ $where = 'AND';
+ }
+
$this->uicols = $uicols;
if ($order)
{
- $ordermethod = " ORDER BY $order $sort";
+ $ordermethod = " ORDER BY {$table}.{$order}
{$sort}";
}
else
{
- $ordermethod = ' ORDER BY id ASC';
+ $ordermethod = " ORDER BY
{$table}.{$this->location_info['id']['name']} ASC";
}
if($query)
@@ -133,7 +184,7 @@
}
$query = $this->_db->db_addslashes($query);
- $querymethod = " {$where }
{$table}.{$this->location_info['id']['name']} = {$id_query}";
+ $querymethod = " {$where }
({$table}.{$this->location_info['id']['name']} = {$id_query}";
foreach($this->location_info['fields'] as
$field)
{
if($field['type'] == 'varchar')
@@ -141,6 +192,7 @@
$querymethod .= " OR
{$table}.{$field['name']} $this->_like '%$query%'";
}
}
+ $querymethod .= ')';
}
$sql = "SELECT * FROM $table $filtermethod
$querymethod";
@@ -159,7 +211,6 @@
$cols_return = $uicols['name'];
$j=0;
-// $n=count($cols_return);
$dataset = array();
while ($this->_db->next_record())
@@ -178,6 +229,32 @@
$values = $this->custom->translate_value($dataset,
$location_id);
+ if($get_single)
+ {
+ foreach($values as $set => &$entry)
+ {
+ foreach ($entry as $field => &$value)
+ {
+ foreach ($get_single as $key =>
$method)
+ {
+ if($field == $key)
+ {
+ switch ($method)
+ {
+ case
'get_user':
+
if($value)
+
{
+
$value = $GLOBALS['phpgw']->accounts->get($value)->__toString();
+
}
+
break;
+ default:
+ //
nothing
+ }
+ }
+ }
+ }
+ }
+ }
return $values;
}
@@ -189,6 +266,54 @@
switch($type)
{
//-------- ID type integer
+ case 'part_of_town':
+ $info = array
+ (
+ 'table'
=> 'fm_part_of_town',
+ 'id'
=> array('name' => 'part_of_town_id', 'type' => 'int', 'descr' => lang('id')),
+ 'fields'
=> array
+ (
+ array
+ (
+ 'name' =>
'name',
+ 'descr' =>
lang('name'),
+ 'type' =>
'varchar',
+ 'nullable'
=> false,
+ 'size'
=> 20
+ ),
+ array
+ (
+ 'name'
=> 'district_id',
+ 'descr'
=> lang('district'),
+ 'type'
=> 'select',
+ 'nullable'
=> false,
+ 'filter'
=> true,
+ 'values_def'
=> array
+ (
+
'valueset' => false,
+
'method' => 'property.bocategory.get_list',
+
'method_input' => array('type' => 'district', 'selected' => '##district_id##')
+ )
+ ),
+ ),
+ 'edit_msg'
=> lang('edit'),
+ 'add_msg'
=> lang('add'),
+ 'name'
=> lang('part of town'),
+ 'acl_location' =>
'.admin',
+ 'menu_selection' =>
'admin::property::location::town',
+/*
+ 'default'
=> array
+ (
+ 'user_id'
=> array('add' => '$this->account'),
+ 'entry_date' =>
array('add' => 'time()'),
+ 'modified_date' =>
array('edit' => 'time()'),
+ ),
+*/
+ 'check_grant' => false
+ );
+
+ break;
+
case 'project_group':
$info = array
(
@@ -367,7 +492,7 @@
throw new
Exception(lang('ERROR: illegal type %1', $type_id));
}
break;
- case 'owner':
+ case 'owner_cats':
$info = array
(
'table' => 'fm_owner_category',
@@ -388,7 +513,7 @@
'menu_selection' =>
'admin::property::owner::owner_cats'
);
break;
- case 'tenant':
+ case 'tenant_cats':
$info = array
(
'table' => 'fm_tenant_category',
@@ -409,7 +534,7 @@
'menu_selection' =>
'admin::property::tenant::tenant_cats'
);
break;
- case 'vendor':
+ case 'vendor_cats':
$info = array
(
'table' => 'fm_vendor_category',
@@ -430,6 +555,69 @@
'menu_selection' =>
'admin::property::vendor::vendor_cats'
);
break;
+ case 'vendor':
+ $info = array
+ (
+ 'table' => 'fm_vendor',
+ 'id'
=> array('name' => 'id', 'type' => 'int'),
+ 'fields'
=> array
+ (
+ array
+ (
+ 'name' =>
'contact_phone',
+ 'descr' =>
lang('contact phone'),
+ 'type' =>
'varchar'
+ ),
+ array
+ (
+ 'name'
=> 'category',
+ 'descr'
=> lang('category'),
+ 'type'
=> 'select',
+ 'nullable'
=> false,
+ 'filter'
=> true,
+ 'sortable'
=> true,
+ 'values_def'
=> array
+ (
+
'valueset' => false,
+
'method' => 'property.bocategory.get_list',
+
'method_input' => array('type' => 'vendor_cats', 'selected' =>
'##category##')
+ )
+ ),
+ array
+ (
+ //FIXME
+ 'name'
=> 'member_of',
+ 'descr'
=> lang('member'),
+ 'type'
=> 'select', // multiple_select
+ 'nullable'
=> false,
+ 'filter'
=> true,
+ 'sortable'
=> true,
+ 'values_def'
=> array
+ (
+
'valueset' => false,
+
'method' => 'phpgwapi.categories.formatted_xslt_list',
+
'method_input' => array('type' => 'vendor_cats', 'selected' =>
'##member_of##')
+ )
+ ),
+ ),
+
+// $values_combo_box[0] =
$this->cats->formatted_xslt_list(array('selected' => $this->member_id,'globals'
=> true));
+
+
+ 'edit_msg' => lang('edit'),
+ 'add_msg' => lang('add'),
+ 'name' =>
lang('vendor'),
+ 'acl_location' => '.vendor',
+ 'menu_selection' =>
'property::invoice::vendor',
+ 'default'
=> array
+ (
+ 'owner_id'
=> array('add' => '$this->account'),
+ 'entry_date' =>
array('add' => 'time()'),
+ // 'modified_date' =>
array('edit' => 'time()'),
+ )
+
+ );
+ break;
case 'district':
$info = array
(
@@ -556,27 +744,6 @@
'menu_selection' =>
'admin::property::request_condition'
);
break;
- case 'r_agreement':
- $info = array
- (
- 'table' =>
'fm_r_agreement_category',
- 'id'
=> array('name' => 'id', 'type' => 'int'),
- 'fields'
=> array
- (
- array
- (
- 'name' =>
'descr',
- 'descr' =>
lang('descr'),
- 'type' =>
'varchar'
- )
- ),
- 'edit_msg' => lang('edit'),
- 'add_msg' => lang('add'),
- 'name' => '',
- 'acl_location' => '.admin',
- 'menu_selection' =>
'admin::property::agreement::rental_agree_cats'
- );
- break;
case 'b_account':
$info = array
(
@@ -782,6 +949,84 @@
'menu_selection' =>
'admin::property::unit'
);
break;
+ case 'budget_account':
+ $info = array
+ (
+ 'table'
=> 'fm_b_account',
+ 'id'
=> array('name' => 'id', 'type' => 'varchar'),
+ 'fields'
=> array
+ (
+ array
+ (
+ 'name' =>
'descr',
+ 'descr' =>
lang('descr'),
+ 'type' =>
'varchar',
+ 'nullable'
=> false,
+ 'size'
=> 60,
+ 'sortable'
=> true
+ ),
+ array
+ (
+ 'name'
=> 'category',
+ 'descr'
=> lang('category'),
+ 'type'
=> 'select',
+ 'nullable'
=> false,
+ 'filter'
=> true,
+ 'sortable'
=> true,
+ 'values_def'
=> array
+ (
+
'valueset' => false,
+
'method' => 'property.bocategory.get_list',
+
'method_input' => array('type' => 'b_account', 'selected' =>
'##category##')//b_account_category
+ )
+ ),
+ array
+ (
+ 'name'
=> 'mva',
+ 'descr'
=> lang('tax code'),
+ 'type'
=> 'int',
+ 'nullable'
=> true,
+ 'size'
=> 4,
+ 'sortable'
=> true
+ ),
+ array
+ (
+ 'name'
=> 'responsible',
+ 'descr'
=> lang('responsible'),
+ 'type'
=> 'select',
+ 'filter'
=> true,
+ 'get_single'
=> 'get_user',
+ 'values_def'
=> array
+ (
+
'valueset' => false,
+
'method' => 'property.bocommon.get_user_list_right2',
+
'method_input' => array('selected' => '##responsible##', 'right' => 128,
'acl_location' => '.invoice')
+ )
+ ),
+ array
+ (
+ 'name' =>
'active',
+ 'descr' =>
lang('active'),
+ 'type' =>
'checkbox',
+ 'default' =>
'checked'
+ ),
+ ),
+ 'edit_msg'
=> lang('edit'),
+ 'add_msg'
=> lang('add'),
+ 'name'
=> lang('budget account'),
+ 'acl_location' =>
'.b_account',
+ 'menu_selection' =>
'property::invoice::budget_account',
+ 'default'
=> array
+ (
+ 'user_id'
=> array('add' => '$this->account'),
+ 'entry_date' =>
array('add' => 'time()'),
+ 'modified_date' =>
array('edit' => 'time()'),
+ ),
+ 'check_grant' => false
+ );
+
+ break;
+
//-------- ID type auto
case 'order_dim1':
$info = array
Modified: branches/Version-1_0-branch/property/inc/class.soinvoice.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.soinvoice.inc.php
2010-11-15 21:41:12 UTC (rev 6596)
+++ branches/Version-1_0-branch/property/inc/class.soinvoice.inc.php
2010-11-15 21:48:48 UTC (rev 6597)
@@ -107,7 +107,7 @@
if ($user_lid=='none' || !$user_lid):
{
- return;
+ return array();
}
elseif ($user_lid!='all'):
{
@@ -210,7 +210,8 @@
);
}
- $invoice = array();
+ $invoice = array();
+
if ($temp)
{
$role= $this->check_role();
@@ -219,13 +220,13 @@
{
$voucher_id =
$invoice_temp['voucher_id'];
- $sql = "SELECT
spvend_code,oppsynsmannid,saksbehandlerid,budsjettansvarligid,"
+ $sql = "SELECT
pmwrkord_code,spvend_code,oppsynsmannid,saksbehandlerid,budsjettansvarligid,"
. "
utbetalingid,oppsynsigndato,saksigndato,budsjettsigndato,utbetalingsigndato,fakturadato,org_name,"
- . "
forfallsdato,periode,artid,kidnr,kreditnota "
- . " from $table $this->join fm_vendor
ON fm_vendor.id = $table.spvend_code WHERE bilagsnr = $voucher_id "
- . " group by
bilagsnr,spvend_code,oppsynsmannid,saksbehandlerid,budsjettansvarligid,"
+ . "
forfallsdato,periode,artid,kidnr,kreditnota,currency "
+ . " FROM {$table} {$this->join}
fm_vendor ON fm_vendor.id = {$table}.spvend_code WHERE bilagsnr = {$voucher_id}
"
+ . " GROUP BY
bilagsnr,pmwrkord_code,spvend_code,oppsynsmannid,saksbehandlerid,budsjettansvarligid,"
. "
utbetalingid,oppsynsigndato,saksigndato,budsjettsigndato,utbetalingsigndato,fakturadato,org_name,"
- . "
forfallsdato,periode,artid,kidnr,kreditnota ";
+ . "
forfallsdato,periode,artid,kidnr,kreditnota,currency";
$this->db->query($sql,__LINE__,__FILE__);
@@ -290,6 +291,8 @@
$invoice[$i]['type']
= $art_list[$this->db->f('artid')];
$invoice[$i]['kidnr']
= $this->db->f('kidnr');
$invoice[$i]['kreditnota']
= $this->db->f('kreditnota');
+ $invoice[$i]['currency']
= $this->db->f('currency');
+ $invoice[$i]['order_id']
= $this->db->f('pmwrkord_code');
$invoice[$i]['amount']
= $invoice_temp['amount'];
$invoice[$i]['num_days']
=
intval(($timestamp_payment_date-$timestamp_voucher_date)/(24*3600));
$invoice[$i]['timestamp_voucher_date']
= $timestamp_voucher_date;
@@ -324,11 +327,11 @@
{
if(is_array($data))
{
- $start = isset($data['start']) &&
$data['start'] ? $data['start'] : 0;
+ $start = isset($data['start']) &&
$data['start'] ? (int)$data['start'] : 0;
$filter = isset($data['filter']) ?
$data['filter'] : 'none';
$sort = isset($data['sort']) ?
$data['sort'] : 'DESC';
$order = isset($data['order']) ?
$data['order'] : '';
- $voucher_id = isset($data['voucher_id']) &&
$data['voucher_id'] ? $data['voucher_id'] : 0;
+ $voucher_id = isset($data['voucher_id']) &&
$data['voucher_id'] ? (int)$data['voucher_id'] : 0;
$paid = isset($data['paid']) ?
$data['paid'] : '';
}
@@ -356,7 +359,8 @@
$filtermethod = " WHERE ( bilagsnr=
'$voucher_id')";
}
- $sql = "SELECT
$table.*,fm_workorder.status,fm_workorder.charge_tenant,org_name,fm_workorder.claim_issued,
fm_workorder.paid_percent, project_group FROM $table"
+ $sql = "SELECT
$table.*,fm_workorder.status,fm_workorder.charge_tenant,org_name,"
+ . "fm_workorder.claim_issued,
fm_workorder.paid_percent, project_group FROM $table"
. " $this->left_join fm_workorder ON fm_workorder.id =
$table.pmwrkord_code"
. " $this->left_join fm_project ON
fm_workorder.project_id = fm_project.id"
. " $this->join fm_vendor ON $table.spvend_code =
fm_vendor.id $filtermethod";
@@ -392,7 +396,8 @@
'vendor'
=> $this->db->f('org_name'),
'paid_percent' =>
$this->db->f('paid_percent'),
'project_group' =>
$this->db->f('project_group'),
- 'external_ref' =>
$this->db->f('external_ref')
+ 'external_ref' =>
$this->db->f('external_ref'),
+ 'currency'
=> $this->db->f('currency')
);
$i++;
@@ -913,29 +918,30 @@
$values = array();
while ($this->db->next_record())
{
- $values[] = Array(
-
- 'location_code' => $this->db->f('id'),
- 'art' =>
$this->db->f('artid'),
- 'type' =>
$this->db->f('typeid'),
- 'dim_a' => $this->db->f('dima'),
- 'dim_b' => $this->db->f('dimb'),
- 'dim_d' => $this->db->f('dimd'),
- 'tax' =>
$this->db->f('mvakode'),
- 'invoice_id' =>
$this->db->f('fakturanr'),
- 'kid_nr' =>
$this->db->f('kidnr'),
- 'vendor_id' =>
$this->db->f('spvend_code'),
- 'janitor' =>
$this->db->f('oppsynsmannid'),
- 'supervisor' =>
$this->db->f('saksbehandlerid'),
- 'budget_responsible' =>
$this->db->f('budsjettansvarligid'),
- 'invoice_date' =>
$this->db->f('fakturadato'),
- 'project_id' =>
$this->db->f('project_id'),
- 'payment_date' =>
$this->db->f('forfallsdato'),
- 'merknad' =>
$this->db->f('merknad'),
- 'b_account_id' =>
$this->db->f('spbudact_code'),
- 'amount' =>
$this->db->f('belop'),
- 'order' =>
$this->db->f('pmwrkord_code'),
- 'kostra_id' =>
$this->db->f('kostra_id'),
+ $values[] = array
+ (
+ 'location_code' =>
$this->db->f('id'),
+ 'art' =>
$this->db->f('artid'),
+ 'type' =>
$this->db->f('typeid'),
+ 'dim_a' =>
$this->db->f('dima'),
+ 'dim_b' =>
$this->db->f('dimb'),
+ 'dim_d' =>
$this->db->f('dimd'),
+ 'tax' =>
$this->db->f('mvakode'),
+ 'invoice_id' =>
$this->db->f('fakturanr'),
+ 'kid_nr' =>
$this->db->f('kidnr'),
+ 'vendor_id' =>
$this->db->f('spvend_code'),
+ 'janitor' =>
$this->db->f('oppsynsmannid'),
+ 'supervisor' =>
$this->db->f('saksbehandlerid'),
+ 'budget_responsible'=>
$this->db->f('budsjettansvarligid'),
+ 'invoice_date' =>
$this->db->f('fakturadato'),
+ 'project_id' =>
$this->db->f('project_id'),
+ 'payment_date' =>
$this->db->f('forfallsdato'),
+ 'merknad' =>
$this->db->f('merknad'),
+ 'b_account_id' =>
$this->db->f('spbudact_code'),
+ 'amount' =>
$this->db->f('belop'),
+ 'order' =>
$this->db->f('pmwrkord_code'),
+ 'kostra_id' =>
$this->db->f('kostra_id'),
+ 'currency' =>
$this->db->f('currency')
);
}
//_debug_array($values);
@@ -1191,4 +1197,3 @@
return $this->db->f('cnt');
}
}
-
Modified: branches/Version-1_0-branch/property/inc/class.solookup.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.solookup.inc.php
2010-11-15 21:41:12 UTC (rev 6596)
+++ branches/Version-1_0-branch/property/inc/class.solookup.inc.php
2010-11-15 21:48:48 UTC (rev 6597)
@@ -207,12 +207,19 @@
$where = 'WHERE';
$filtermethod = '';
- if($role != 'group' && $parent)
+
+ if($role != 'group')
{
- $filtermethod = " WHERE category = {$parent}";
+ $filtermethod .= " {$where} active = 1";
$where = 'AND';
}
+ if($parent)
+ {
+ $filtermethod .= " {$where} category =
{$parent}";
+ $where = 'AND';
+ }
+
if($query)
{
$query = $this->db->db_addslashes($query);
@@ -288,14 +295,14 @@
$this->db->query($sql,__LINE__,__FILE__);
$this->total_records = $this->db->num_rows();
- if(!$allrows)
- {
- $this->db->limit_query($sql .
$ordermethod,$start,__LINE__,__FILE__);
- }
- else
- {
- $this->db->query($sql .
$ordermethod,__LINE__,__FILE__);
+ if(!$allrows)
+ {
+ $this->db->limit_query($sql .
$ordermethod,$start,__LINE__,__FILE__);
}
+ else
+ {
+ $this->db->query($sql .
$ordermethod,__LINE__,__FILE__);
+ }
$street = array();
while ($this->db->next_record())
@@ -344,14 +351,14 @@
$this->db->query($sql,__LINE__,__FILE__);
$this->total_records = $this->db->num_rows();
- if(!$allrows)
- {
- $this->db->limit_query($sql .
$ordermethod,$start,__LINE__,__FILE__);
- }
- else
- {
- $this->db->query($sql .
$ordermethod,__LINE__,__FILE__);
+ if(!$allrows)
+ {
+ $this->db->limit_query($sql .
$ordermethod,$start,__LINE__,__FILE__);
}
+ else
+ {
+ $this->db->query($sql .
$ordermethod,__LINE__,__FILE__);
+ }
$tenant = array();
while ($this->db->next_record())
Deleted: branches/Version-1_0-branch/property/inc/class.sop_of_town.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.sop_of_town.inc.php
2010-11-15 21:41:12 UTC (rev 6596)
+++ branches/Version-1_0-branch/property/inc/class.sop_of_town.inc.php
2010-11-15 21:48:48 UTC (rev 6597)
@@ -1,164 +0,0 @@
-<?php
- /**
- * phpGroupWare - property: a Facilities Management System.
- *
- * @author Sigurd Nes <address@hidden>
- * @copyright Copyright (C) 2003,2004,2005,2006,2007 Free Software
Foundation, Inc. http://www.fsf.org/
- * This file is part of phpGroupWare.
- *
- * phpGroupWare is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * phpGroupWare is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with phpGroupWare; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
USA
- *
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
- * @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
- * @package property
- * @subpackage admin
- * @version $Id$
- */
-
- /**
- * Description
- * @package property
- */
-
- class property_sop_of_town
- {
-
- function __construct()
- {
- $this->account =
$GLOBALS['phpgw_info']['user']['account_id'];
-
- $this->db = & $GLOBALS['phpgw']->db;
- $this->join = & $this->db->join;
- $this->like = & $this->db->like;
- }
-
- function read_district_name($id)
- {
- $this->db->query("SELECT descr FROM fm_district where
id='$id'");
- $this->db->next_record();
- return $this->db->f('descr');
- }
-
- function read($data)
- {
- if(is_array($data))
- {
- $start =
(isset($data['start'])?$data['start']:0);
- $filter =
(isset($data['filter'])?$data['filter']:'none');
- $query =
(isset($data['query'])?$data['query']:'');
- $sort =
(isset($data['sort'])?$data['sort']:'DESC');
- $order =
(isset($data['order'])?$data['order']:'');
- $district_id =
(isset($data['district_id'])?$data['district_id']:0);
- $allrows =
(isset($data['allrows'])?$data['allrows']:'');
- }
-
- if ($order)
- {
- $ordermethod = " order by $order $sort";
- }
- else
- {
- $ordermethod = ' order by part_of_town_id ASC';
- }
-
-
- $where = 'WHERE';
- if ($district_id > 0)
- {
- $filtermethod .= " $where
district_id='$district_id' ";
- $where = 'AND';
-
- }
-
- if($query)
- {
- $query = preg_replace("/'/",'',$query);
- $query = preg_replace('/"/','',$query);
-
- $querymethod = " $where ( name $this->like
'%$query%')";
- }
-
- $sql = "SELECT fm_part_of_town.*, descr as category
FROM fm_part_of_town $this->join fm_district on
fm_part_of_town.district_id=fm_district.id $filtermethod $querymethod";
-
- $this->db->query($sql,__LINE__,__FILE__);
- $this->total_records = $this->db->num_rows();
-
- if(!$allrows)
- {
- $this->db->limit_query($sql .
$ordermethod,$start,__LINE__,__FILE__);
- }
- else
- {
- $this->db->query($sql .
$ordermethod,__LINE__,__FILE__);
- }
-
- while ($this->db->next_record())
- {
- $p_of_towns[] = array
- (
- 'part_of_town_id' =>
$this->db->f('part_of_town_id'),
- 'name' =>
stripslashes($this->db->f('name')),
- 'category' =>
stripslashes($this->db->f('category')),
- 'district_id' =>
$this->db->f('district_id')
- );
- }
- return $p_of_towns;
- }
-
- function read_single($part_of_town_id)
- {
- $this->db->query("select * from fm_part_of_town where
part_of_town_id='$part_of_town_id'",__LINE__,__FILE__);
-
- if ($this->db->next_record())
- {
- $p_of_town['id'] =
(int)$this->db->f('part_of_town_id');
- $p_of_town['name'] =
stripslashes($this->db->f('name'));
- $p_of_town['district_id'] =
(int)$this->db->f('district_id');
-
- return $p_of_town;
- }
- }
-
- function add($p_of_town)
- {
- $p_of_town['name'] =
$this->db->db_addslashes($p_of_town['name']);
-
- $this->db->query("INSERT INTO fm_part_of_town
(name,district_id) "
- . "VALUES ('" . $p_of_town['name']
- . "','" . $p_of_town['district_id'] .
"')",__LINE__,__FILE__);
-
- $receipt['part_of_town_id']=
$this->db->get_last_insert_id('fm_part_of_town','part_of_town_id');
- $receipt['message'][] = array('msg'=>lang('Part of town
%1 has been saved',$receipt['part_of_town_id']));
- return $receipt;
- }
-
- function edit($p_of_town)
- {
- $p_of_town['name'] =
$this->db->db_addslashes($p_of_town['name']);
-
- $this->db->query("UPDATE fm_part_of_town set name='" .
$p_of_town['name'] . "', district_id='"
- .
$p_of_town['district_id'] . "' WHERE part_of_town_id=" .
intval($p_of_town['part_of_town_id']),__LINE__,__FILE__);
-
- $receipt['part_of_town_id']=
$p_of_town['part_of_town_id'];
- $receipt['message'][] = array('msg'=>lang('Part of town
%1 has been edited',$p_of_town['part_of_town_id']));
- return $receipt;
- }
-
- function delete($part_of_town_id)
- {
- $this->db->query('DELETE FROM fm_part_of_town WHERE
part_of_town_id=' . intval($part_of_town_id),__LINE__,__FILE__);
- }
- }
-
Deleted: branches/Version-1_0-branch/property/inc/class.sor_agreement.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.sor_agreement.inc.php
2010-11-15 21:41:12 UTC (rev 6596)
+++ branches/Version-1_0-branch/property/inc/class.sor_agreement.inc.php
2010-11-15 21:48:48 UTC (rev 6597)
@@ -1,1290 +0,0 @@
-<?php
- /**
- * phpGroupWare - property: a Facilities Management System.
- *
- * @author Sigurd Nes <address@hidden>
- * @copyright Copyright (C) 2003,2004,2005,2006,2007 Free Software
Foundation, Inc. http://www.fsf.org/
- * This file is part of phpGroupWare.
- *
- * phpGroupWare is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * phpGroupWare is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with phpGroupWare; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
USA
- *
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
- * @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
- * @package property
- * @subpackage agreement
- * @version $Id$
- */
-
- /**
- * Description
- * @package property
- */
-
- class property_sor_agreement
- {
- var $role;
-
- function __construct()
- {
- $this->account =
$GLOBALS['phpgw_info']['user']['account_id'];
- $this->db = & $GLOBALS['phpgw']->db;
- $this->db2 = clone($this->db);
-
- $this->join = $this->db->join;
- $this->left_join = $this->db->left_join;
- $this->like = $this->db->like;
- }
-
- function select_vendor_list()
- {
- return ;
- $table = 'fm_r_agreement';
- $this->db->query("SELECT vendor_id,org_name FROM $table
$this->join fm_vendor on fm_r_agreement.vendor_id=fm_vendor.id GROUP BY
org_name,vendor_id ");
-
- $i = 0;
- while ($this->db->next_record())
- {
- $vendor[$i]['id']
= $this->db->f('vendor_id');
- $vendor[$i]['name']
= stripslashes($this->db->f('org_name'));
- $i++;
- }
- return $vendor;
- }
-
- function read($data)
- {
- if(is_array($data))
- {
- $start =
(isset($data['start'])?$data['start']:0);
- $filter =
(isset($data['filter'])?$data['filter']:'none');
- $query =
(isset($data['query'])?$data['query']:'');
- $sort =
(isset($data['sort'])?$data['sort']:'DESC');
- $order =
(isset($data['order'])?$data['order']:'');
- $cat_id =
(isset($data['cat_id'])?$data['cat_id']:'');
- $customer_id =
(isset($data['customer_id'])?$data['customer_id']:'');
- $allrows =
(isset($data['allrows'])?$data['allrows']:'');
- $member_id =
(isset($data['member_id'])?$data['member_id']:0);
- $r_agreement_id =
(isset($data['r_agreement_id'])?$data['r_agreement_id']:'');
- $detail =
(isset($data['detail'])?$data['detail']:'');
- $loc1 =
(isset($data['loc1'])?$data['loc1']:'');
-
- }
-
- $choice_table = 'phpgw_cust_choice';
- $attribute_table = 'phpgw_cust_attribute';
-
- if(!$detail)
- {
- $entity_table = 'fm_r_agreement';
- $category_table = 'fm_r_agreement_category';
- $location_id =
$GLOBALS['phpgw']->locations->get_id('property', '.r_agreement');
- $attribute_filter = " location_id =
{$location_id}";
-
- $paranthesis .='(';
- $joinmethod .= " $this->join $category_table ON
( $entity_table.category =$category_table.id))";
-
- $cols = $entity_table .
".*,$category_table.descr as category";
-
-/* if($loc1)
- {
- $paranthesis .='(';
- $joinmethod .= " $this->join
fm_r_agreement_item ON ( $entity_table.id =fm_r_agreement_item.agreement_id))";
-
-
- $cols .= ",location_code";
- }
-`*/
-// $cols .= ",org_name";
-// $paranthesis .='(';
-// $joinmethod .= " $this->join fm_tenant ON (
$entity_table.customer_id =fm_tenant.id))";
-
- $cols_return[] = 'id';
- $uicols['input_type'][] = 'text';
- $uicols['name'][] = 'id';
- $uicols['descr'][] = lang('ID');
- $uicols['statustext'][] = lang('ID');
-
- $cols_return[] = 'name';
- $uicols['input_type'][] = 'text';
- $uicols['name'][] = 'name';
- $uicols['descr'][] = lang('name');
- $uicols['statustext'][] = lang('name');
-
- $cols_return[] =
'customer_name';
- $uicols['input_type'][] = 'text';
- $uicols['name'][] =
'customer_name';
- $uicols['descr'][] =
lang('customer');
- $uicols['statustext'][] =
lang('customer');
-
- $cols_return[] = 'category';
- $uicols['input_type'][] = 'text';
- $uicols['name'][] = 'category';
- $uicols['descr'][] =
lang('category');
- $uicols['statustext'][] =
lang('category');
-
- $cols_return[] = 'start_date';
- $uicols['input_type'][] = 'text';
- $uicols['name'][] = 'start_date';
- $uicols['descr'][] = lang('start');
- $uicols['statustext'][] = lang('start
date');
-
- $cols_return[] = 'end_date';
- $uicols['input_type'][] = 'text';
- $uicols['name'][] = 'end_date';
- $uicols['descr'][] = lang('end');
- $uicols['statustext'][] = lang('end
date');
-
- }
- else
- {
- $allrows=true;
- $entity_table = 'fm_r_agreement_item';
- $location_id =
$GLOBALS['phpgw']->locations->get_id('property', '.r_agreement.detail');
- $attribute_filter = " location_id =
{$location_id}";
-
- $paranthesis .='(';
- $joinmethod .= " $this->join
fm_r_agreement_item_history ON ( $entity_table.agreement_id
=fm_r_agreement_item_history.agreement_id AND $entity_table.id
=fm_r_agreement_item_history.item_id))";
-
-
-
- $cols = "$entity_table.*,
fm_r_agreement_item_history.cost,fm_r_agreement_item_history.id as
index_count,fm_r_agreement_item_history.index_date,fm_r_agreement_item_history.item_id,fm_r_agreement_item_history.this_index,
rental_type_id";
-
- $cols_return[] =
'agreement_id';
- $uicols['input_type'][] = 'hidden';
- $uicols['name'][] =
'agreement_id';
- $uicols['descr'][] =
lang('agreement_id');
- $uicols['statustext'][] =
lang('agreement_id');
-
- $cols_return[] = 'item_id';
- $uicols['input_type'][] = 'text';
- $uicols['name'][] = 'item_id';
- $uicols['descr'][] = lang('ID');
- $uicols['statustext'][] = lang('ID');
-
- $cols_return[] = 'id';
- $uicols['input_type'][] = 'hidden';
- $uicols['name'][] = 'id';
- $uicols['descr'][] = false;
- $uicols['statustext'][] = false;
-
- $cols_return[] =
'location_code';
- $uicols['input_type'][] = 'text';
- $uicols['name'][] =
'location_code';
- $uicols['descr'][] =
lang('location');
- $uicols['statustext'][] =
lang('location');
-
- $cols_return[] = 'address';
- $uicols['input_type'][] = 'text';
- $uicols['name'][] = 'address';
- $uicols['descr'][] =
lang('address');
- $uicols['statustext'][] =
lang('address');
-
-/* $cols_return[] = 'p_num';
- $uicols['input_type'][] = 'text';
- $uicols['name'][] = 'p_num';
- $uicols['descr'][] = lang('entity
num');
- $uicols['statustext'][] = lang('entity
num');
-*/
- $cols_return[] = 'cost';
- $uicols['input_type'][] = 'text';
- $uicols['name'][] = 'cost';
- $uicols['descr'][] = lang('cost');
- $uicols['statustext'][] = lang('cost');
-
- $cols_return[] = 'this_index';
- $uicols['input_type'][] = 'text';
- $uicols['name'][] = 'this_index';
- $uicols['descr'][] = lang('index');
- $uicols['statustext'][] = lang('index');
-
- $cols_return[] = 'index_count';
- $uicols['input_type'][] = 'text';
- $uicols['name'][] = 'index_count';
- $uicols['descr'][] =
lang('index_count');
- $uicols['statustext'][] =
lang('index_count');
-
- $cols_return[] = 'index_date';
- $uicols['input_type'][] = 'text';
- $uicols['name'][] = 'index_date';
- $uicols['descr'][] = lang('date');
- $uicols['statustext'][] = lang('date');
-
- $cols_return[] =
'rental_type_id';
- $uicols['input_type'][] = 'text';
- $uicols['name'][] =
'rental_type_id';
- $uicols['descr'][] = lang('rental
type');
- $uicols['statustext'][] = lang('rental
type');
- }
-
- $from .= " FROM $paranthesis $entity_table ";
-
- $sql = "SELECT $cols $from $joinmethod";
-
- $i = count($uicols['name']);
-
-
$user_columns=$GLOBALS['phpgw_info']['user']['preferences']['property']['r_agreement_columns'
. !!$r_agreement_id];
- $user_column_filter = '';
- if (isset($user_columns) AND is_array($user_columns)
AND $user_columns[0])
- {
- $user_column_filter = " OR ($attribute_filter
AND id IN (" . implode(',',$user_columns) .'))';
- }
-
- $this->db->query("SELECT * FROM $attribute_table WHERE
list=1 AND $attribute_filter $user_column_filter ");
-
- while ($this->db->next_record())
- {
- $uicols['input_type'][] = 'text';
- $uicols['name'][] =
$this->db->f('column_name');
- $uicols['descr'][] =
$this->db->f('input_text');
- $uicols['statustext'][] =
$this->db->f('statustext');
- $uicols['datatype'][$i] =
$this->db->f('datatype');
- $cols_return_extra[]= array(
- 'name' => $this->db->f('column_name'),
- 'datatype' =>
$this->db->f('datatype'),
- 'attrib_id' => $this->db->f('id')
- );
-
- $i++;
- }
-
- $this->uicols = $uicols;
-
-//_debug_array($cols_return_extra);
- if ($order)
- {
- if ($order=='id')
- {
- $ordermethod = " order by
$entity_table.$order $sort";
- }
- else
- {
- $ordermethod = " order by $order $sort";
- }
- }
- else
- {
- $ordermethod = " order by $entity_table.id
DESC";
- }
-
- $where= 'WHERE';
-
-/* if ($filter=='all')
- {
- if (is_array($grants))
- {
- while (list($user) = each($grants))
- {
- $public_user_list[] = $user;
- }
- reset($public_user_list);
- $filtermethod .= " $where (
$entity_table.user_id IN(" . implode(',',$public_user_list) . "))";
-
- $where= 'AND';
- }
-
- }
- else
- {
- $filtermethod = " $where
$entity_table.user_id=$filter ";
- $where= 'AND';
- }
-*/
-
- if ($r_agreement_id)
- {
- $filtermethod .= " $where
$entity_table.agreement_id=$r_agreement_id AND current_index = 1";
- $where= 'AND';
- }
-
- if ($cat_id)
- {
- $filtermethod .= " $where
$entity_table.category='$cat_id' ";
- $where= 'AND';
- }
-
- if ($customer_id)
- {
- $filtermethod .= " $where
$entity_table.customer_id='$customer_id' ";
- $where= 'AND';
- }
-
- if ($member_id>0)
- {
- $filtermethod .= " $where
$entity_table.member_of $this->like '%,$member_id,%' ";
- $where= 'AND';
- }
-
- if ($loc1)
- {
- $this->db->query("SELECT agreement_id FROM
fm_r_agreement_item WHERE location_code $this->like '$loc1%' group by
agreement_id");
- while ($this->db->next_record())
- {
- $filter_id[] =
$this->db->f('agreement_id');
-
- }
-
- if(is_array($filter_id))
- {
- $filtermethod .= " $where
$entity_table.id in (" . implode(',', $filter_id) .")";
- $where= 'AND';
- }
- }
-
- if ($status)
- {
- $filtermethod .= " $where
$entity_table.status='$status' ";
- $where= 'AND';
- }
-
-
- if($query)
- {
- $query = preg_replace("/'/",'',$query);
- $query = preg_replace('/"/','',$query);
-
- $this->db->query("SELECT * FROM
$attribute_table WHERE search=1 AND $attribute_filter");
-
- while ($this->db->next_record())
- {
- if($this->db->f('datatype')=='V' ||
$this->db->f('datatype')=='email' || $this->db->f('datatype')=='CH')
- {
- $querymethod[]=
"$entity_table." . $this->db->f('column_name') . " $this->like '%$query%'";
- }
- else
- {
- $querymethod[]=
"$entity_table." . $this->db->f('column_name') . " = '$query'";
- }
- }
-
- if (isset($querymethod) AND
is_array($querymethod))
- {
- $querymethod = " $where (" . implode ('
OR ',$querymethod) . ')';
- $where = 'AND';
- }
- }
-
- $sql .= " $filtermethod $querymethod";
-//echo $sql;
-
- $this->db2->query($sql,__LINE__,__FILE__);
- $this->total_records = $this->db2->num_rows();
- if(!$allrows)
- {
- $this->db->limit_query($sql .
$ordermethod,$start,__LINE__,__FILE__);
- }
- else
- {
- $this->db->query($sql .
$ordermethod,__LINE__,__FILE__);
- }
-
- $j=0;
- $n=count($cols_return);
-//_debug_array($cols_return);
-
- $contacts =
CreateObject('phpgwapi.contacts');
-
- while ($this->db->next_record())
- {
- for ($i=0;$i<$n;$i++)
- {
- $r_agreement_list[$j][$cols_return[$i]]
= stripslashes($this->db->f($cols_return[$i]));
- $r_agreement_list[$j]['grants'] =
(int)$grants[$this->db->f('user_id')];
- }
-
- for ($i=0;$i<count($cols_return_extra);$i++)
- {
- $value='';
-
$value=$this->db->f($cols_return_extra[$i]['name']);
-
-
if(($cols_return_extra[$i]['datatype']=='R' ||
$cols_return_extra[$i]['datatype']=='LB') && $value)
- {
- $sql="SELECT value FROM
$choice_table WHERE $attribute_filter AND attrib_id="
.$cols_return_extra[$i]['attrib_id']. " AND id=" . $value;
- $this->db2->query($sql);
- $this->db2->next_record();
-
$r_agreement_list[$j][$cols_return_extra[$i]['name']] = $this->db2->f('value');
- }
- else
if($cols_return_extra[$i]['datatype']=='AB' && $value)
- {
- $contact_data =
$contacts->read_single_entry($value,array('n_given'=>'n_given','n_family'=>'n_family','email'=>'email'));
-
$r_agreement_list[$j][$cols_return_extra[$i]['name']] =
$contact_data[0]['n_family'] . ', ' . $contact_data[0]['n_given'];
-
- }
- else
if($cols_return_extra[$i]['datatype']=='VENDOR' && $value)
- {
- $sql="SELECT org_name FROM
fm_vendor where id=$value";
- $this->db2->query($sql);
- $this->db2->next_record();
-
$r_agreement_list[$j][$cols_return_extra[$i]['name']] =
$this->db2->f('org_name');
- }
- else
if($cols_return_extra[$i]['datatype']=='CH' && $value)
- {
- $ch= unserialize($value);
-
- if (isset($ch) AND
is_array($ch))
- {
- for
($k=0;$k<count($ch);$k++)
- {
- $sql="SELECT
value FROM $choice_table WHERE $attribute_filter AND attrib_id="
.$cols_return_extra[$i]['attrib_id']. " AND id=" . $ch[$k];
-
$this->db2->query($sql);
- while
($this->db2->next_record())
- {
-
$ch_value[]=$this->db2->f('value');
- }
- }
-
$r_agreement_list[$j][$cols_return_extra[$i]['name']] = @implode(",",
$ch_value);
- unset($ch_value);
- }
- }
- else
if($cols_return_extra[$i]['datatype']=='D' && $value)
- {
-
$r_agreement_list[$j][$cols_return_extra[$i]['name']]=date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'],strtotime($value));
- }
- else
if($cols_return_extra[$i]['datatype']=='timestamp' && $value)
- {
-
$r_agreement_list[$j][$cols_return_extra[$i]['name']]=date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'],$value);
- }
- else
if($cols_return_extra[$i]['datatype']=='link' && $value)
- {
-
$r_agreement_list[$j][$cols_return_extra[$i]['name']]=
phpgw::safe_redirect($value);
- }
- else
- {
-
$r_agreement_list[$j][$cols_return_extra[$i]['name']]=$value;
- }
- }
-
- $j++;
- }
-//html_print_r($r_agreement_list);
- return $r_agreement_list;
- }
-
- function read_prizing($data)
- {
- if(is_array($data))
- {
- $r_agreement_id =
(isset($data['r_agreement_id'])?$data['r_agreement_id']:0);
- $item_id =
(isset($data['item_id'])?$data['item_id']:0);
- }
-
- $entity_table = 'fm_r_agreement_item_history';
-
- $cols =
"fm_r_agreement_item_history.cost,fm_r_agreement_item_history.id as
index_count,"
- . "
fm_r_agreement_item_history.index_date,fm_r_agreement_item_history.item_id,"
- . "
fm_r_agreement_item_history.this_index,tenant_id,to_date,from_date";
-
- $cols_return[] = 'item_id';
- $uicols['input_type'][] = 'text';
- $uicols['name'][] = 'item_id';
- $uicols['descr'][] = lang('ID');
- $uicols['statustext'][] = lang('ID');
-
- $cols_return[] = 'id';
- $uicols['input_type'][] = 'hidden';
- $uicols['name'][] = 'id';
- $uicols['descr'][] = false;
- $uicols['statustext'][] = false;
-
- $cols_return[] = 'cost';
- $uicols['input_type'][] = 'text';
- $uicols['name'][] = 'cost';
- $uicols['descr'][] = lang('cost');
- $uicols['statustext'][] = lang('cost');
-
- $cols_return[] = 'this_index';
- $uicols['input_type'][] = 'text';
- $uicols['name'][] = 'this_index';
- $uicols['descr'][] = lang('index');
- $uicols['statustext'][] = lang('index');
-
- $cols_return[] = 'index_count';
- $uicols['input_type'][] = 'text';
- $uicols['name'][] = 'index_count';
- $uicols['descr'][] =
lang('index_count');
- $uicols['statustext'][] = lang('index_count');
-
- $cols_return[] = 'index_date';
- $uicols['input_type'][] = 'text';
- $uicols['name'][] = 'index_date';
- $uicols['descr'][] = lang('entry
date');
- $uicols['statustext'][] = lang('entry date');
-
- $cols_return[] = 'from_date';
- $uicols['input_type'][] = 'text';
- $uicols['name'][] = 'from_date';
- $uicols['descr'][] = lang('from
date');
- $uicols['statustext'][] = lang('from date');
-
- $cols_return[] = 'to_date';
- $uicols['input_type'][] = 'text';
- $uicols['name'][] = 'to_date';
- $uicols['descr'][] = lang('to
date');
- $uicols['statustext'][] = lang('to date');
-
- $cols_return[] = 'tenant_id';
- $uicols['input_type'][] = 'text';
- $uicols['name'][] = 'tenant';
- $uicols['descr'][] =
lang('Tenant');
- $uicols['statustext'][] = lang('Tenant');
-
- $from .= " FROM $entity_table ";
-
- $sql = "SELECT $cols $from $joinmethod";
-
-
- $this->uicols = $uicols;
-
- $ordermethod = " order by $entity_table.id ASC";
-
- $where= 'WHERE';
-
-
- if ($r_agreement_id)
- {
- $filtermethod .= " $where
$entity_table.agreement_id=$r_agreement_id AND item_id=$item_id";
- $where= 'AND';
- }
-
-
- $sql .= " $filtermethod";
-//echo $sql;
-
- $this->db2->query($sql,__LINE__,__FILE__);
- $this->total_records = $this->db2->num_rows();
- if(!$allrows)
- {
- $this->db->limit_query($sql .
$ordermethod,$start,__LINE__,__FILE__);
- }
- else
- {
- $this->db->query($sql .
$ordermethod,__LINE__,__FILE__);
- }
-
- $j=0;
- $n=count($cols_return);
-//_debug_array($cols_return);
- while ($this->db->next_record())
- {
- for ($i=0;$i<$n;$i++)
- {
- $r_agreement_list[$j][$cols_return[$i]]
= $this->db->f($cols_return[$i]);
- $r_agreement_list[$j]['agreement_id'] =
$r_agreement_id;
- }
- $j++;
- }
-//_debug_array($r_agreement_list);
- return $r_agreement_list;
- }
-
- function get_tenant_name($id)
- {
- $this->db->query("SELECT first_name,last_name FROM
fm_tenant WHERE id = $id");
- $this->db->next_record();
- return stripslashes($this->db->f('first_name')) . ' ' .
stripslashes($this->db->f('last_name'));
-
- }
-
- function read_single($r_agreement_id, $values = array())
- {
- $table = 'fm_r_agreement';
-
- $this->db->query("SELECT * from $table where
id='$r_agreement_id'");
-
- if($this->db->next_record())
- {
- $values['id'] =
(int)$this->db->f('id');
- $values['entry_date'] =
$this->db->f('entry_date');
- $values['cat_id'] =
$this->db->f('category');
- $values['member_of'] =
explode(',',$this->db->f('member_of'));
- $values['cat_id'] =
$this->db->f('category');
- $values['start_date'] =
$this->db->f('start_date');
- $values['end_date'] =
$this->db->f('end_date');
- $values['termination_date']=
$this->db->f('termination_date');
- $values['customer_id'] =
$this->db->f('customer_id');
- $values['b_account_id'] =
$this->db->f('account_id');
- $values['name'] =
stripslashes($this->db->f('name'));
- $values['descr'] =
stripslashes($this->db->f('descr'));
- $values['user_id'] =
$this->db->f('user_id');
-
- if ( isset($values['attributes']) &&
is_array($values['attributes']) )
- {
- foreach ( $values['attributes'] as
&$attr )
- {
- $attr['value'] =
$this->db->f($attr['column_name']);
- }
- }
- }
-
- return $values;
- }
-
- function read_single_item($data, $values = array())
- {
- $table = 'fm_r_agreement_item';
-
- $r_agreement_id =$data['r_agreement_id'];
- $id =$data['id'];
-
- $this->db->query("SELECT * from $table where
agreement_id=$r_agreement_id AND id=$id");
-
- if($this->db->next_record())
- {
- $values['agreement_id'] =
(int)$this->db->f('agreement_id');
- $values['id']
= (int)$this->db->f('id');
- $values['entry_date'] =
$this->db->f('entry_date');
- $values['location_code'] =
$this->db->f('location_code');
- $values['p_num']
= $this->db->f('p_num');
- $values['p_entity_id'] =
$this->db->f('p_entity_id');
- $values['p_cat_id']
= $this->db->f('p_cat_id');
- $values['cost']
= $this->db->f('cost');
- $values['tenant_id'] =
$this->db->f('tenant_id');
- $values['rental_type_id'] =
$this->db->f('rental_type_id');
-
- if ( isset($values['attributes']) &&
is_array($values['attributes']) )
- {
- foreach ( $values['attributes'] as
&$attr )
- {
- $attr['value'] =
$this->db->f($attr['column_name']);
- }
- }
- }
- return $values;
- }
-
- function add($r_agreement,$values_attribute='')
- {
-//_debug_array($r_agreement);
- $table = 'fm_r_agreement';
- $r_agreement['name'] =
$this->db->db_addslashes($r_agreement['name']);
- $r_agreement['descr'] =
$this->db->db_addslashes($r_agreement['descr']);
-
- if($r_agreement['member_of'])
- {
- $r_agreement['member_of']=',' .
implode(',',$r_agreement['member_of']) . ',';
- }
-
-
- $this->db->transaction_begin();
- $id = $this->db->next_id('fm_r_agreement');
-
- $vals[] = $id;
- $vals[] = $r_agreement['name'];
- $vals[] = $r_agreement['descr'];
- $vals[] = time();
- $vals[] = $r_agreement['cat_id'];
- $vals[] = $r_agreement['member_of'];
- $vals[] = $r_agreement['start_date'];
- $vals[] = $r_agreement['end_date'];
- $vals[] = $r_agreement['termination_date'];
- $vals[] = $r_agreement['customer_id'];
- $vals[] = $r_agreement['customer_name'];
- $vals[] = $r_agreement['b_account_id'];
- $vals[] = $this->account;
-
- if(isset($r_agreement['extra']) &&
is_array($r_agreement['extra']))
- {
- foreach ($r_agreement['extra'] as $input_name
=> $value)
- {
- if(isset($value) && $value)
- {
- $cols[] = $input_name;
- $vals[] = $value;
- }
- }
- }
-
- if (isset($values_attribute) AND
is_array($values_attribute))
- {
- foreach($values_attribute as $entry)
- {
- if($entry['value'])
- {
- $cols[] = $entry['name'];
- $vals[] = $entry['value'];
- }
- }
- }
-
- if($cols)
- {
- $cols = "," . implode(",", $cols);
- }
-
- $vals = $this->db->validate_insert($vals);
-
- $this->db->query("INSERT INTO $table
(id,name,descr,entry_date,category,member_of,start_date,end_date,termination_date,customer_id,customer_name,account_id,user_id
$cols) "
- . "VALUES ($vals)",__LINE__,__FILE__);
-
-// $this->db->query("INSERT INTO fm_orders (id,type)
VALUES ($id,'r_agreement')");
-
- $receipt['r_agreement_id']=
$id;//$this->db->get_last_insert_id($table,'id');
-
- $receipt['message'][] = array('msg'=>lang('agreement %1
has been saved',$receipt['r_agreement_id']));
-
- $this->db->transaction_commit();
- return $receipt;
- }
-
- function add_item($values,$values_attribute='')
- {
-//_debug_array($values);
- $table = 'fm_r_agreement_item';
-
- $cols[] = 'location_code';
- $vals[] = $values['location_code'];
- $cols[] = 'rental_type_id';
- $vals[] = $values['rental_type_id'];
-
-/* while (is_array($values['location']) &&
list($input_name,$value) = each($values['location']))
- {
- if($value)
- {
- $cols[] = $input_name;
- $vals[] = $value;
- }
- }
-*/
- if(isset($values['extra']) &&
is_array($values['extra']))
- {
- foreach ($values['extra'] as $input_name =>
$value)
- {
- if(isset($value) && $value)
- {
- $cols[] = $input_name;
- $vals[] = $value;
- }
- }
- }
-
- if (isset($values_attribute) AND
is_array($values_attribute))
- {
- foreach($values_attribute as $entry)
- {
- if($entry['value'])
- {
- $cols[] = $entry['name'];
- $vals[] = $entry['value'];
- }
- }
- }
-
- if($values['street_name'])
- {
- $address[]= $values['street_name'];
- $address[]= $values['street_number'];
- $address = $this->db->db_addslashes(implode("
", $address));
- }
-
- if(!$address)
- {
- $address =
$this->db->db_addslashes($values['location_name']);
- }
-
- $cols[] = 'address';
- $vals[] = $address;
- $cols[] = 'cost';
- $vals[] = $this->floatval($values['cost']);
-
- if($cols)
- {
- $cols = "," . implode(",", $cols);
- $vals = "," .
$this->db->validate_insert($vals);
- }
-
- $this->db->transaction_begin();
- $id =
$this->db->next_id($table,array('agreement_id'=>$values['r_agreement_id']));
-
- $this->db->query("INSERT INTO $table
(id,agreement_id,entry_date,user_id $cols) "
- . "VALUES ($id," . $values['r_agreement_id']
."," . time()
- . "," . $this->account . " $vals)");
-
-
- $this->db->query("SELECT start_date FROM fm_r_agreement
WHERE id=" . $values['r_agreement_id']);
- $this->db->next_record();
-
- if(!$values['start_date'])
- {
- $start_date = $this->db->f('start_date');
- }
- else
- {
- $start_date = $values['start_date'];
-
- }
-
- if ($values['end_date'])
- {
- $end_date = $values['end_date'];
- }
- else
- {
- $end_date = mktime(0, 0, 0, 12, 31,
date(Y,$start_date)); // last day of start year
- }
-
-
- $this->db->query("INSERT INTO
fm_r_agreement_item_history
(agreement_id,item_id,id,current_index,this_index,cost,index_date,entry_date,user_id,tenant_id,from_date,to_date)
"
- . "VALUES (" . $values['r_agreement_id'] . ","
. $id .",1,1,1," . $this->floatval($values['cost']) . "," . (int)$start_date .
"," . time()
- . "," . $this->account . "," .
(int)$values['tenant_id'] . "," . (int)$start_date . "," . (int)$end_date .
")");
-
- $receipt['r_agreement_id']= $values['r_agreement_id'];
- $receipt['id']= $id;
-
- $receipt['message'][] = array('msg'=>lang('agreement %1
has been saved',$receipt['r_agreement_id']));
-
- $this->db->transaction_commit();
- return $receipt;
- }
-
- function edit($values,$values_attribute='')
- {
-//_debug_array($values_attribute);
- $table = 'fm_r_agreement';
-
- $values['name'] =
$this->db->db_addslashes($values['name']);
-
- if($values['member_of'])
- {
- $values['member_of']=',' .
implode(',',$values['member_of']) . ',';
- }
-
- if(isset($values['extra']) &&
is_array($values['extra']))
- {
- foreach ($values['extra'] as $column => $value)
- {
- $value_set[$column] = $value;
- }
- }
-
- if (isset($values_attribute) AND
is_array($values_attribute))
- {
- foreach($values_attribute as $entry)
- {
- if($entry['datatype']!='AB' &&
$entry['datatype']!='VENDOR')
- {
- if($entry['datatype'] == 'C' ||
$entry['datatype'] == 'T' || $entry['datatype'] == 'V' || $entry['datatype'] ==
'link')
- {
-
$value_set[$entry['name']] = $this->db->db_addslashes($entry['value']);
- }
- else
- {
-
$value_set[$entry['name']] = $entry['value'];
- }
- }
- }
- }
-
- $value_set['name'] = $values['name'];
- $value_set['descr'] = $values['descr'];
- $value_set['customer_id']= $values['customer_id'];
- $value_set['customer_name']= $values['customer_name'];
- if($value_set)
- {
- $value_set = ',' .
$this->db->validate_update($value_set);
- }
-
- $this->db->query("UPDATE $table set entry_date='" .
time() . "', category='"
- . $values['cat_id'] .
"', member_of='" . $values['member_of'] . "', start_date=" .
intval($values['start_date']) . ", end_date=" . intval($values['end_date']) .
", termination_date=" . intval($values['termination_date']) . ", account_id=" .
intval($values['b_account_id']) . " $value_set WHERE id=" .
intval($values['r_agreement_id']));
-
- $this->db->query("UPDATE fm_r_agreement_item_history
set index_date=" . intval($values['start_date']) . " WHERE id=1 AND
agreement_id= " . intval($values['r_agreement_id']));
-
- $receipt['r_agreement_id']= $values['r_agreement_id'];
- $receipt['message'][] = array('msg'=>lang('agreement %1
has been edited',$values['r_agreement_id']));
- return $receipt;
- }
-
- function edit_item($values,$values_attribute='')
- {
-//_debug_array($values);
-//_debug_array($values_attribute);
- $table = 'fm_r_agreement_item';
-
- while (is_array($values['extra']) &&
list($column,$value) = each($values['extra']))
- {
- $value_set[$column] = $value;
- }
-
- if (isset($values_attribute) AND
is_array($values_attribute))
- {
- foreach($values_attribute as $entry)
- {
- if($entry['datatype']!='AB' &&
$entry['datatype']!='VENDOR')
- {
- if($entry['datatype'] == 'C' ||
$entry['datatype'] == 'T' || $entry['datatype'] == 'V' || $entry['datatype'] ==
'link')
- {
-
$value_set[$entry['name']] = $this->db->db_addslashes($entry['value']);
- }
- else
- {
-
$value_set[$entry['name']] = $entry['value'];
- }
- }
- }
- }
-
- if($values['street_name'])
- {
- $address[]= $values['street_name'];
- $address[]= $values['street_number'];
- $address =
$this->db->db_addslashes(implode(" ", $address));
- }
-
- if(!$address)
- {
- $address =
$this->db->db_addslashes($values['location_name']);
- }
-
- $value_set['location_code'] =
$values['location_code'];
- $value_set['cost'] = $values['cost'];
- $value_set['address'] = $address;
- $value_set['rental_type_id'] =
$values['rental_type_id'];
-
-
- if($value_set)
- {
- $value_set = ',' .
$this->db->validate_update($value_set);
- }
-
- $this->db->query("UPDATE $table set entry_date=" .
time() . "$value_set WHERE agreement_id=" . intval($values['r_agreement_id']) .
' AND id=' . intval($values['id']));
-
- $this->db->query("UPDATE fm_r_agreement_item_history
set cost = this_index *" . $this->floatval($values['cost']) . " WHERE
agreement_id=" . intval($values['r_agreement_id']) . ' AND item_id=' .
intval($values['id']));
-
- $receipt['r_agreement_id']= $values['r_agreement_id'];
- $receipt['id']= $values['id'];
- $receipt['message'][] = array('msg'=>lang('agreement %1
has been edited',$values['r_agreement_id']));
- return $receipt;
- }
-
- function update_item_history($values)
- {
-//_debug_array($values);
-
$values['new_index']=$this->floatval($values['new_index']);
- $this->db->transaction_begin();
-
- while (is_array($values['select']) &&
list($item_id,$value) = each($values['select']))
- {
-
- $this->db->query("UPDATE
fm_r_agreement_item_history set current_index = NULL WHERE agreement_id=" .
intval($values['agreement_id']) . ' AND item_id=' . intval($item_id));
-
- $this->db->query("SELECT tenant_id,to_date from
fm_r_agreement_item_history WHERE agreement_id=" .
intval($values['agreement_id']) . ' AND item_id=' . intval($item_id) . ' AND
id=' . intval($values['id'][$item_id]));
-
- $this->db->next_record();
-
- if(!$values['tenant_id'])
- {
- $values['tenant_id'] =
$this->db->f('tenant_id');
- }
-
- if ($values['start_date'])
- {
- $start_date = $values['start_date'];
- if($start_date <
$this->db->f('to_date'))
- {
- $start_date =
$this->db->f('to_date') + (3600 * 24);
- }
- }
- else
- {
- $start_date =
$this->db->f('to_date') + (3600 * 24);
- }
-
- if ($values['end_date'])
- {
- $end_date = $values['end_date'];
- }
- else
- {
- $end_date = mktime(0, 0, 0, 12, 31,
date(Y,$start_date)); // last day of start year
- }
-
- $this->db->query("INSERT INTO
fm_r_agreement_item_history
(agreement_id,item_id,id,current_index,this_index,cost,index_date,entry_date,tenant_id,user_id,from_date,to_date)"
- . "VALUES (" . $values['agreement_id']
. "," . $item_id ."," . ($values['id'][$item_id]+1) .",1,'" .
$values['new_index']
- . "','" . ($value *
$values['new_index']) . "'," . (int)$values['date'] . "," . time() . "," .
(int)$values['tenant_id']
- . "," . $this->account . "," .
(int)$start_date . "," . (int)$end_date . ")");
-
- }
-
- $this->db->transaction_commit();
- $receipt['message'][] = array('msg'=>lang('agreement %1
has been updated for index',$values['agreement_id']));
-
- return $receipt;
- }
-
- function floatval($strValue)
- {
- $floatValue =
preg_replace("/(^[0-9]*)(\\.|,)([0-9]*)(.*)/", "\\1.\\3", $strValue);
- if(!is_numeric($floatValue))
- {
- $floatValue = preg_replace("/(^[0-9]*)(.*)/",
"\\1", $strValue);
- }
- if(!is_numeric($floatValue))
- {
- $floatValue = 0;
- }
- return $floatValue;
- }
-
-
- function delete_last_index($r_agreement_id,$item_id)
- {
- $this->db->transaction_begin();
- $this->db->query("SELECT max(id) as index_count FROM
fm_r_agreement_item_history WHERE agreement_id=$r_agreement_id AND
item_id=$item_id");
- $this->db->next_record();
- $index_count = $this->db->f('index_count');
- if($index_count>1)
- {
- $this->db->query("DELETE FROM
fm_r_agreement_item_history WHERE agreement_id=$r_agreement_id AND
item_id=$item_id AND id=$index_count");
- $this->db->query("UPDATE
fm_r_agreement_item_history set current_index = 1 WHERE
agreement_id=$r_agreement_id AND item_id=$item_id AND id =" . ($index_count-1));
- }
- $this->db->transaction_commit();
- }
-
- function delete_item($r_agreement_id,$item_id)
- {
- $this->db->transaction_begin();
- $this->db->query("DELETE FROM fm_r_agreement_item WHERE
agreement_id=$r_agreement_id AND id=$item_id");
- $this->db->query("DELETE FROM
fm_r_agreement_item_history WHERE agreement_id=$r_agreement_id AND
item_id=$item_id");
- $this->db->transaction_commit();
- }
-
-
- function delete($r_agreement_id)
- {
- $table = 'fm_r_agreement';
- $this->db->transaction_begin();
- $this->db->query("DELETE FROM $table WHERE id=" .
intval($r_agreement_id));
- $this->db->query("DELETE FROM fm_r_agreement_item WHERE
agreement_id=" . intval($r_agreement_id));
- $this->db->query("DELETE FROM
fm_r_agreement_item_history WHERE agreement_id=" . intval($r_agreement_id));
- $this->db->query("DELETE FROM fm_orders WHERE id=" .
intval($r_agreement_id));
- $this->db->transaction_commit();
- }
-
-
- function request_next_id()
- {
- $this->db->query("SELECT max(id) as id FROM
fm_r_agreement",__LINE__,__FILE__);
- $this->db->next_record();
- $next_id= $this->db->f('id')+1;
- return $next_id;
- }
-
- function add_common($values)
- {
- $table = 'fm_r_agreement_common';
-
- $cols[] = 'b_account';
- $vals[] = $values['b_account'];
- $cols[] = 'remark';
- $vals[] = $this->db->db_addslashes($values['remark']);
-
- $cols = "," . implode(",", $cols);
- $vals = "," . $this->db->validate_insert($vals);
-
- $this->db->transaction_begin();
- $c_id =
$this->db->next_id($table,array('agreement_id'=>$values['r_agreement_id']));
-
- $this->db->query("INSERT INTO $table
(id,agreement_id,entry_date,user_id $cols) "
- . "VALUES ($c_id," . $values['r_agreement_id']
."," . time()
- . "," . $this->account . "
$vals)",__LINE__,__FILE__);
-
- $this->db->query("SELECT start_date, end_date FROM
fm_r_agreement WHERE id=" . $values['r_agreement_id'],__LINE__,__FILE__);
- $this->db->next_record();
- if ($values['start_date'])
- {
- $start_date = $values['start_date'];
- if ($start_date < $this->db->f('start_date'))
- {
- $start_date =
$this->db->f('start_date');
- }
- }
- else
- {
- $start_date = $this->db->f('start_date');
- }
-
- if ($values['end_date'])
- {
- $end_date = $values['end_date'];
- }
- else
- {
- $end_date = mktime(0, 0, 0, 12, 31,
date(Y,$start_date)); // last day of start year
- }
-
-
- $this->db->query("INSERT INTO fm_r_agreement_c_history
(agreement_id,c_id,id,current_record,budget_cost,from_date,to_date,user_id,override_fraction)
"
- . "VALUES (" . $values['r_agreement_id'] . ","
. $c_id .",1,1," . $this->floatval($values['budget_cost']) . "," . $start_date
. "," . $end_date
- . "," . $this->account . "," .
$this->floatval($values['override_fraction']) .")",__LINE__,__FILE__);
-
- $receipt['r_agreement_id']= $values['r_agreement_id'];
- $receipt['c_id']= $c_id;
-
- $receipt['message'][] = array('msg'=>lang('agreement %1
has been saved',$receipt['r_agreement_id']));
-
- $this->db->transaction_commit();
- return $receipt;
- }
-
- function add_common_history($values)
- {
- $table = 'fm_r_agreement_c_history';
-
- $this->db->transaction_begin();
- $id =
$this->db->next_id($table,array('agreement_id'=>$values['r_agreement_id'],'c_id'
=>$values['c_id']));
-
- $this->db->query("SELECT from_date, to_date FROM $table
WHERE agreement_id=" . $values['r_agreement_id'] . " AND c_id=" .
$values['c_id'] . " AND id =" .($id-1),__LINE__,__FILE__);
- $this->db->next_record();
- if ($values['start_date'])
- {
- $start_date = $values['start_date'];
- if($start_date < $this->db->f('to_date'))
- {
- $start_date = $this->db->f('to_date') +
(3600 * 24);
- }
- }
- else
- {
- $start_date = $this->db->f('to_date') +
(3600 * 24);
- }
-
- if ($values['end_date'])
- {
- $end_date = $values['end_date'];
- }
- else
- {
- $end_date = mktime(0, 0, 0, 12, 31,
date(Y,$start_date)); // last day of start year
- }
-
-
- $this->db->query("INSERT INTO fm_r_agreement_c_history
(agreement_id,c_id,id,current_record,budget_cost,from_date,to_date,user_id,override_fraction)
"
- . "VALUES (" . $values['r_agreement_id'] . ","
. $values['c_id'] . "," . $id .",1," . $this->floatval($values['budget_cost'])
. "," . $start_date . "," . $end_date
- . "," . $this->account . "," .
$this->floatval($values['override_fraction']) .")",__LINE__,__FILE__);
-
-
- $this->db->query("UPDATE fm_r_agreement_c_history set
current_record = NULL WHERE agreement_id =" . $values['r_agreement_id'] . 'AND
c_id=' . $values['c_id'] . 'AND id=' . ($id-1),__LINE__,__FILE__);
- $receipt['r_agreement_id']= $values['r_agreement_id'];
- $receipt['c_id']= $values['c_id'];
-
- $receipt['message'][] = array('msg'=>lang('agreement %1
has been saved',$receipt['r_agreement_id']));
-
- $this->db->transaction_commit();
- return $receipt;
- }
-
-
- function read_common($agreement_id)
- {
- $sql ="SELECT b_account,budget_cost,
actual_cost,fm_r_agreement_c_history.id,from_date,"
- . "
to_date,fm_r_agreement_c_history.c_id,override_fraction,remark "
- . " FROM fm_r_agreement_common $this->join
fm_r_agreement_c_history "
- . " ON ( fm_r_agreement_common.agreement_id
=fm_r_agreement_c_history.agreement_id "
- . " AND fm_r_agreement_common.id
=fm_r_agreement_c_history.c_id)"
- . " WHERE fm_r_agreement_common.agreement_id =
$agreement_id AND current_record = 1 ORDER BY fm_r_agreement_c_history.c_id
ASC";
-
- $this->db->query($sql,__LINE__,__FILE__);
-
- $this->total_records = $this->db->num_rows();
-
- while ($this->db->next_record())
- {
- $common[] = array
- (
- 'agreement_id' => $agreement_id,
- 'c_id' => $this->db->f('c_id'),
- 'b_account_id' =>
$this->db->f('b_account'),
- 'from_date' =>
$this->db->f('from_date'),
- 'to_date' =>
$this->db->f('to_date'),
- 'budget_cost' =>
$this->db->f('budget_cost'),
- 'actual_cost' =>
$this->db->f('actual_cost'),
- 'override_fraction' =>
$this->db->f('override_fraction'),
- 'remark' =>
stripslashes($this->db->f('remark')),
- );
- }
-
-//_debug_array($common);
- return $common;
- }
-
-
- function read_single_common($data)
- {
- $r_agreement_id =$data['r_agreement_id'];
- $id =$data['c_id'];
-
- $this->db->query("SELECT * FROM fm_r_agreement_common
WHERE agreement_id=$r_agreement_id AND id=$id",__LINE__,__FILE__);
-
- if($this->db->next_record())
- {
- $common = array
- (
- 'agreement_id' => $r_agreement_id,
- 'c_id' => $id,
- 'b_account_id' =>
$this->db->f('b_account'),
- 'remark' =>
stripslashes($this->db->f('remark')),
- 'override_fraction' =>
$this->db->f('override_fraction')
- );
- }
- return $common;
- }
-
- function read_common_history($data)
- {
- if(is_array($data))
- {
- $r_agreement_id =
(isset($data['r_agreement_id'])?$data['r_agreement_id']:0);
- $c_id =
(isset($data['c_id'])?$data['c_id']:0);
- }
-
- $table = 'fm_r_agreement_common';
-//echo $sql;
- $sql ="SELECT b_account,budget_cost,
actual_cost,fm_r_agreement_c_history.id,from_date,"
- . "
to_date,fm_r_agreement_c_history.c_id,override_fraction,remark "
- . " FROM fm_r_agreement_common $this->join
fm_r_agreement_c_history "
- . " ON ( fm_r_agreement_common.agreement_id
=fm_r_agreement_c_history.agreement_id "
- . " AND fm_r_agreement_common.id
=fm_r_agreement_c_history.c_id)"
- . " WHERE fm_r_agreement_common.agreement_id =
$r_agreement_id AND c_id=$c_id ORDER BY fm_r_agreement_c_history.c_id ASC";
-
- $this->db->query($sql,__LINE__,__FILE__);
-
- $this->total_records = $this->db->num_rows();
-
- while ($this->db->next_record())
- {
- $common[] = array
- (
- 'agreement_id' => $id,
- 'c_id' => $this->db->f('c_id'),
- 'id' => $this->db->f('id'),
- 'b_account_id' =>
$this->db->f('b_account'),
- 'from_date' =>
$this->db->f('from_date'),
- 'to_date' =>
$this->db->f('to_date'),
- 'budget_cost' =>
$this->db->f('budget_cost'),
- 'actual_cost' =>
$this->db->f('actual_cost'),
- 'override_fraction' =>
$this->db->f('override_fraction'),
- 'remark' =>
stripslashes($this->db->f('remark')),
- );
- }
-
- return $common;
- }
-
- function delete_common_h($r_agreement_id,$c_id,$id)
- {
- $this->db->transaction_begin();
- $this->db->query("DELETE FROM fm_r_agreement_c_history
WHERE agreement_id=$r_agreement_id AND c_id=$c_id AND
id=$id",__LINE__,__FILE__);
- $this->db->transaction_commit();
- }
- }
-
Deleted: branches/Version-1_0-branch/property/inc/class.sostandard_2.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.sostandard_2.inc.php
2010-11-15 21:41:12 UTC (rev 6596)
+++ branches/Version-1_0-branch/property/inc/class.sostandard_2.inc.php
2010-11-15 21:48:48 UTC (rev 6597)
@@ -1,214 +0,0 @@
-<?php
- /**
- * phpGroupWare - property: a Facilities Management System.
- *
- * @author Sigurd Nes <address@hidden>
- * @copyright Copyright (C) 2003,2004,2005,2006,2007 Free Software
Foundation, Inc. http://www.fsf.org/
- * This file is part of phpGroupWare.
- *
- * phpGroupWare is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * phpGroupWare is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with phpGroupWare; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
USA
- *
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
- * @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
- * @package property
- * @subpackage admin
- * @version $Id$
- */
-
- /**
- * Description
- * @package property
- */
-
- class property_sostandard_2
- {
-
- function __construct()
- {
- $this->account =
$GLOBALS['phpgw_info']['user']['account_id'];
- $this->_db = &
$GLOBALS['phpgw']->db;
- $this->_like = & $this->_db->like;
- }
-
- function read($data)
- {
- if(is_array($data))
- {
- $start = isset($data['start']) &&
$data['start'] ? $data['start'] : 0;
- $query = isset($data['query']) ?
$data['query'] : '';
- $sort = isset($data['sort']) &&
$data['sort'] ? $data['sort']:'DESC';
- $order = isset($data['order']) ?
$data['order'] : '';
- $type = isset($data['type']) ?
$data['type'] : '';
- $allrows = isset($data['allrows']) ?
$data['allrows'] : '';
- }
-
- $standard = array();
- if (!$table = $this->select_table($type))
- {
- return $standard;
- }
-
- if ($order)
- {
- $ordermethod = " ORDER BY $order $sort";
- }
- else
- {
- $ordermethod = ' ORDER BY id ASC';
- }
-
- if($query)
- {
- $query = $this->_db->db_addslashes($query);
-
- $querymethod = " WHERE id $this->_like
'%$query%' OR descr $this->_like '%$query%'";
- }
-
- $sql = "SELECT * FROM $table $querymethod";
-
- $this->_db->query($sql,__LINE__,__FILE__);
- $this->total_records = $this->_db->num_rows();
-
- if(!$allrows)
- {
- $this->_db->limit_query($sql .
$ordermethod,$start,__LINE__,__FILE__);
- }
- else
- {
- $this->_db->query($sql .
$ordermethod,__LINE__,__FILE__);
- }
-
- while ($this->_db->next_record())
- {
- $standard[] = array
- (
- 'id' => $this->_db->f('id'),
- 'descr' => $this->_db->f('descr')
- );
- }
- return $standard;
- }
-
-
- function select_table($type)
- {
-
- switch($type)
- {
- case 'workorder_status':
- $table='fm_workorder_status';
- break;
- case 'request_status':
- $table='fm_request_status';
- break;
- case 'agreement_status':
- $table='fm_agreement_status';
- break;
- case 'building_part':
- $table='fm_building_part';
- break;
- case 'document_status':
- $table='fm_document_status';
- break;
- case 'unit':
- $table='fm_standard_unit';
- break;
- }
-
- return $table;
- }
-
-
- function read_single($id,$type)
- {
- $standard = array();
-
- if (!$table = $this->select_table($type))
- {
- return $standard;
- }
-
- $sql = "SELECT * FROM $table WHERE id='{$id}'";
-
- $this->_db->query($sql,__LINE__,__FILE__);
-
- if ($this->_db->next_record())
- {
- $standard = array
- (
- 'id' => $this->_db->f('id'),
- 'descr' =>
$this->_db->f('descr', true)
- );
- }
- return $standard;
- }
-
- function add($standard,$type)
- {
- $receipt = array();
- if (!$table = $this->select_table($type))
- {
- $receipt['error'][] = array('msg' => lang('not
a valid type'));
- return $receipt;
- }
-
- $standard['descr'] =
$this->_db->db_addslashes($standard['descr']);
-
- $this->_db->transaction_begin();
-
- $this->_db->query("INSERT INTO $table (id, descr) "
- . "VALUES ('" . $standard['id'] . "','" .
$standard['descr']. "')",__LINE__,__FILE__);
-
- $this->_db->transaction_commit();
- $receipt['message'][] = array('msg' => lang('standard
has been saved'));
- return $receipt;
- }
-
- function edit($standard,$type)
- {
- $receipt = array();
- if (!$table = $this->select_table($type))
- {
- $receipt['error'][] = array('msg' => lang('not
a valid type'));
- return $receipt;
- }
-
- $standard['descr'] =
$this->_db->db_addslashes($standard['descr']);
-
- $this->_db->transaction_begin();
-
- $this->_db->query("UPDATE $table set descr='" .
$standard['descr']
- . "' WHERE id='" .
$standard['id']. "'",__LINE__,__FILE__);
-
- $this->_db->transaction_commit();
- $receipt['message'][] = array('msg' => lang('standard
has been edited'));
- return $receipt;
- }
-
- function delete($id,$type)
- {
- $receipt = array();
- if (!$table = $this->select_table($type))
- {
- $receipt['error'][] = array('msg' => lang('not
a valid type'));
- return $receipt;
- }
-
- $this->_db->transaction_begin();
- $this->_db->query("DELETE FROM $table WHERE
id='{$id}'",__LINE__,__FILE__);
- $this->_db->transaction_commit();
- }
- }
-
Deleted: branches/Version-1_0-branch/property/inc/class.sostandard_3.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.sostandard_3.inc.php
2010-11-15 21:41:12 UTC (rev 6596)
+++ branches/Version-1_0-branch/property/inc/class.sostandard_3.inc.php
2010-11-15 21:48:48 UTC (rev 6597)
@@ -1,203 +0,0 @@
-<?php
- /**
- * phpGroupWare - property: a Facilities Management System.
- *
- * @author Sigurd Nes <address@hidden>
- * @copyright Copyright (C) 2003,2004,2005,2006,2007 Free Software
Foundation, Inc. http://www.fsf.org/
- * This file is part of phpGroupWare.
- *
- * phpGroupWare is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * phpGroupWare is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with phpGroupWare; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
USA
- *
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
- * @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
- * @package property
- * @subpackage admin
- * @version $Id$
- */
-
- /**
- * Description
- * @package property
- */
-
- class property_sostandard_3
- {
- function __construct()
- {
- $this->account =
$GLOBALS['phpgw_info']['user']['account_id'];
- $this->socommon =
CreateObject('property.socommon');
- $this->_db = &
$GLOBALS['phpgw']->db;
- $this->_join = & $this->_db->join;
- $this->_like = & $this->_db->like;
- }
-
- function read($data)
- {
- if(is_array($data))
- {
- $start = isset($data['start']) &&
$data['start'] ? $data['start']:0;
- $query =
isset($data['query'])?$data['query']:'';
- $sort = isset($data['sort']) &&
$data['sort'] ? $data['sort']:'DESC';
- $order =
isset($data['order'])?$data['order']:'';
- $type = isset($data['type'])
?$data['type']: '';
- }
-
- $standard = array();
- if (!$table = $this->select_table($type))
- {
- return $standard;
- }
-
- if ($order)
- {
- $ordermethod = " order by $order $sort";
- }
- else
- {
- $ordermethod = ' order by id asc';
- }
-
- if($query)
- {
- $query = $this->_db->db_addslashes($query);
- // FIXME: change fm_async_method.name to
fm_async_method.num
- //$querymethod = " WHERE num $this->_like
'%$query%' or descr $this->_like '%$query%'";
- $querymethod = " WHERE descr $this->_like
'%$query%'";
- }
-
- $sql = "SELECT * FROM $table $querymethod";
-
- $this->_db->query($sql,__LINE__,__FILE__);
- $this->total_records = $this->_db->num_rows();
- $this->_db->limit_query($sql .
$ordermethod,$start,__LINE__,__FILE__);
-
- while ($this->_db->next_record())
- {
- $standard[] = array
- (
- 'id' => $this->_db->f('id'),
- 'num' => $this->_db->f('num', true),
- 'descr' => $this->_db->f('descr',true)
- );
- }
- return $standard;
- }
-
- function select_table($type)
- {
- $table = '';
- switch($type)
- {
- case 'branch':
- $table='fm_branch';
- break;
- case 'key_location':
- $table='fm_key_loc';
- break;
- case 'async':
- $table='fm_async_method';
- break;
- }
- return $table;
- }
-
- function read_single($id, $type)
- {
- $id = (int) $id;
- $standard = array();
-
- if (!$table = $this->select_table($type))
- {
- return $standard;
- }
-
- $sql = "SELECT * FROM $table WHERE id={$id}";
-
- $this->_db->query($sql,__LINE__,__FILE__);
-
- if ($this->_db->next_record())
- {
- $standard = array
- (
- 'id' => $this->_db->f('id'),
- 'num' => $this->_db->f('num',
true),
- 'descr' =>
$this->_db->f('descr', true)
- );
- }
- return $standard;
- }
-
- function add($standard,$type)
- {
- $receipt = array();
- if (!$table = $this->select_table($type))
- {
- $receipt['error'][] = array('msg' => lang('not
a valid type'));
- return $receipt;
- }
-
- $standard['num'] =
$this->_db->db_addslashes($standard['num']);
- $standard['descr'] =
$this->_db->db_addslashes($standard['descr']);
-
- $this->_db->transaction_begin();
- $standard['id'] = $this->socommon->next_id($table);
- $this->_db->query("INSERT INTO $table (id, num, descr) "
- . "VALUES ('" . $standard['id'] . "','" .
$standard['num'] . "','" . $standard['descr']. "')",__LINE__,__FILE__);
-
- $this->_db->transaction_commit();
- $receipt['id'] = $standard['id'];
- $receipt['message'][] = array('msg' => lang('standard
has been saved'));
-
- return $receipt;
- }
-
- function edit($standard,$type)
- {
- $receipt = array();
- if (!$table = $this->select_table($type))
- {
- $receipt['error'][] = array('msg' => lang('not
a valid type'));
- return $receipt;
- }
-
- $standard['num'] =
$this->_db->db_addslashes($standard['num']);
- $standard['descr'] =
$this->_db->db_addslashes($standard['descr']);
-
- $this->_db->transaction_begin();
- $this->_db->query("UPDATE $table set descr='" .
$standard['descr'] . "', num='". $standard['num']
- . "' WHERE id='" .
$standard['id']. "'",__LINE__,__FILE__);
-
- $this->_db->transaction_commit();
-
- $receipt['id'] = $standard['id'];
- $receipt['message'][] = array('msg' =>lang('standard
has been edited'));
- return $receipt;
- }
-
- function delete($id,$type)
- {
- $receipt = array();
- if (!$table = $this->select_table($type))
- {
- $receipt['error'][] = array('msg' => lang('not
a valid type'));
- return $receipt;
- }
-
- $this->_db->transaction_begin();
- $this->_db->query("DELETE FROM $table WHERE id=" .
(int)$id ,__LINE__,__FILE__);
- $this->_db->transaction_commit();
- }
- }
-
Modified: branches/Version-1_0-branch/property/inc/class.uiactor.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uiactor.inc.php
2010-11-15 21:41:12 UTC (rev 6596)
+++ branches/Version-1_0-branch/property/inc/class.uiactor.inc.php
2010-11-15 21:48:48 UTC (rev 6597)
@@ -232,7 +232,7 @@
$default_value = array
('cat_id'=>'','name'=>lang('no member'));
array_unshift
($values_combo_box[0]['cat_list'],$default_value);
- $values_combo_box[1] =
$this->bocommon->select_category_list(array('format'=>'filter','selected' =>
$this->cat_id,'type' => $this->role,'order'=>'descr'));
+ $values_combo_box[1] =
$this->bocommon->select_category_list(array('format'=>'filter','selected' =>
$this->cat_id,'type' => "{$this->role}_cats",'order'=>'descr'));
$default_value = array ('id'=>'','name'=>
lang('no category'));
array_unshift
($values_combo_box[1],$default_value);
@@ -830,7 +830,7 @@
'lang_no_cat'
=> lang('no category'),
'lang_cat_statustext' =>
lang('Select the category the actor belongs to. To do not use a category select
NO CATEGORY'),
'select_name'
=> 'values[cat_id]',
- 'cat_list'
=>
$this->bocommon->select_category_list(array('format'=>'select','selected' =>
$this->cat_id,'type' => $this->role,'order'=>'descr')),
+ 'cat_list'
=>
$this->bocommon->select_category_list(array('format'=>'select','selected' =>
$this->cat_id,'type' => "{$this->role}_cats",'order'=>'descr')),
'lang_member_of'
=> lang('member of'),
'member_of_name'
=> 'member_id',
@@ -941,7 +941,7 @@
'lang_category' =>
lang('category'),
'lang_time_created' =>
lang('time created'),
'lang_done' =>
lang('done'),
- 'cat_list' =>
$this->bocommon->select_category_list(array('format'=>'select','selected' =>
$actor['cat_id'],'type' => $this->role,'order'=>'descr')),
+ 'cat_list' =>
$this->bocommon->select_category_list(array('format'=>'select','selected' =>
$actor['cat_id'],'type' => "{$this->role}_cats",'order'=>'descr')),
'lang_member_of' =>
lang('member of'),
'member_of_list' =>
$member_of_data['cat_list'],
Deleted: branches/Version-1_0-branch/property/inc/class.uib_account.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uib_account.inc.php
2010-11-15 21:41:12 UTC (rev 6596)
+++ branches/Version-1_0-branch/property/inc/class.uib_account.inc.php
2010-11-15 21:48:48 UTC (rev 6597)
@@ -1,618 +0,0 @@
-<?php
- /**
- * phpGroupWare - property: a Facilities Management System.
- *
- * @author Sigurd Nes <address@hidden>
- * @copyright Copyright (C) 2003,2004,2005,2006,2007 Free Software
Foundation, Inc. http://www.fsf.org/
- * This file is part of phpGroupWare.
- *
- * phpGroupWare is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * phpGroupWare is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with phpGroupWare; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
USA
- *
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
- * @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
- * @package property
- * @subpackage admin
- * @version $Id$
- */
- phpgw::import_class('phpgwapi.yui');
-
- /**
- * Description
- * @package property
- */
-
- class property_uib_account
- {
- var $grants;
- var $start;
- var $query;
- var $sort;
- var $order;
- var $sub;
- var $currentapp;
-
- var $public_functions = array
- (
- 'index' => true,
- 'edit' => true,
- 'delete' => true,
- 'download' => true
- );
-
- function property_uib_account()
- {
- $GLOBALS['phpgw_info']['flags']['xslt_app'] = true;
- $GLOBALS['phpgw_info']['flags']['menu_selection'] =
'property::invoice::budget';
-
- $this->account =
$GLOBALS['phpgw_info']['user']['account_id'];
-
- $this->bo =
CreateObject('property.bob_account',true);
- $this->bocommon =
CreateObject('property.bocommon');
-
- $this->acl = &
$GLOBALS['phpgw']->acl;
- $this->acl_location = '.b_account';
- $this->acl_read =
$this->acl->check('.b_account', PHPGW_ACL_READ, 'property');
- $this->acl_add =
$this->acl->check('.b_account', PHPGW_ACL_ADD, 'property');
- $this->acl_edit =
$this->acl->check('.b_account', PHPGW_ACL_EDIT, 'property');
- $this->acl_delete =
$this->acl->check('.b_account', PHPGW_ACL_DELETE, 'property');
-
- $this->start = $this->bo->start;
- $this->query = $this->bo->query;
- $this->sort = $this->bo->sort;
- $this->order = $this->bo->order;
- $this->allrows = $this->bo->allrows;
- }
-
- function save_sessiondata()
- {
- $data = array
- (
- 'start' => $this->start,
- 'query' => $this->query,
- 'sort' => $this->sort,
- 'order' => $this->order,
- 'allrows' => $this->allrows
- );
- $this->bo->save_sessiondata($data);
- }
-
- function download()
- {
- $list = $this->bo->read();
- $uicols['name'][0] = 'id';
- $uicols['descr'][0] = lang('Budget account');
- $uicols['name'][1] = 'descr';
- $uicols['descr'][1] = lang('Description');
-
-
$this->bocommon->download($list,$uicols['name'],$uicols['descr'],$uicols['input_type']);
- }
-
- function index()
- {
- if(!$this->acl_read)
- {
-
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=>
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
- }
-
- $datatable = array();
-
- if( phpgw::get_var('phpgw_return_as') != 'json' )
- {
- $datatable['config']['base_url'] =
$GLOBALS['phpgw']->link('/index.php', array
- (
- 'menuaction' =>
'property.uib_account.index'//,
- ));
-
- $datatable['config']['base_java_url'] =
"menuaction:'property.uib_account.index'";
-
- $link_data = array
- (
- 'menuaction' =>
'property.uib_account.index'//,
- //'id' => $id
- );
-
- $datatable['config']['allow_allrows'] = true;
-
- $datatable['actions']['form'] = array(
- array(
- 'action' =>
$GLOBALS['phpgw']->link('/index.php',
- array(
- 'menuaction'
=> 'property.uib_account.index'//,
- )
- ),
- 'fields' => array(
- 'field' => array
- (
-
array
-
(
-
'type' => 'button',
-
'id' => 'btn_export',
-
'value' => lang('download'),
-
'tab_index' => 9
-
),
-
array(
-
'type' => 'button',
-
'id' => 'btn_new',
-
'value' => lang('add'),
-
'tab_index' => 8
-
),
- array(
//boton SEARCH
-
'id' => 'btn_search',
-
'name' => 'search',
-
'value' => lang('search'),
-
'type' => 'button',
-
'tab_index' => 7
- ),
-
array( // TEXT INPUT
-
'name' => 'query',
-
'id' => 'txt_query',
-
'value' => '',//$query,
-
'type' => 'text',
-
'onkeypress' => 'return pulsar(event)',
-
'size' => 28,
-
'tab_index' => 6
- )
-
)
-
)
- )
- );
- }
-
- $b_account_list = $this->bo->read($type);
-
- $uicols['name'][0] = 'id';
- $uicols['descr'][0] = lang('Budget account');
- $uicols['name'][1] = 'descr';
- $uicols['descr'][1] = lang('Description');
-
- $j = 0;
- $count_uicols_name = count($uicols['name']);
-
- if (isset($b_account_list) AND
is_array($b_account_list))
- {
- foreach($b_account_list as $account_entry)
- {
- for ($k=0;$k<$count_uicols_name;$k++)
- {
-
if($uicols['input_type'][$k]!='hidden')
- {
-
$datatable['rows']['row'][$j]['column'][$k]['name'] =
$uicols['name'][$k];
-
$datatable['rows']['row'][$j]['column'][$k]['value']
= $account_entry[$uicols['name'][$k]];
- }
- }
- $j++;
- }
- }
-
- $datatable['rowactions']['action'] = array();
-
- $parameters = array
- (
- 'parameter' => array
- (
- array
- (
- 'name' => 'id',
- 'source' => 'id'
- ),
- )
- );
-
- if($this->acl_edit)
- {
- $datatable['rowactions']['action'][] = array(
- 'my_name'
=> 'edit',
- 'statustext' =>
lang('edit the account'),
- 'text'
=> lang('edit'),
- 'action'
=> $GLOBALS['phpgw']->link('/index.php',array
- (
-
'menuaction' => 'property.uib_account.edit'
- )),
- 'parameters' => $parameters
- );
- }
-
- if($this->acl_delete)
- {
- $datatable['rowactions']['action'][] = array(
- 'my_name'
=> 'delete',
- 'statustext' =>
lang('delete the actor'),
- 'text'
=> lang('delete'),
- 'confirm_msg' =>
lang('do you really want to delete this entry'),
- 'action'
=> $GLOBALS['phpgw']->link('/index.php',array
- (
-
'menuaction' => 'property.uib_account.delete'
- )),
- 'parameters' => $parameters
- );
- }
-
- $datatable['rowactions']['action'][] = array(
- 'my_name' => 'add',
- 'text' => lang('add'),
- 'action' =>
$GLOBALS['phpgw']->link('/index.php',array
- (
- 'menuaction' =>
'property.uib_account.edit'
- )));
-
- for ($i=0;$i<$count_uicols_name;$i++)
- {
- if($uicols['input_type'][$i]!='hidden')
- {
-
$datatable['headers']['header'][$i]['formatter'] =
($uicols['formatter'][$i]==''? '""' : $uicols['formatter'][$i]);
-
$datatable['headers']['header'][$i]['name'] =
$uicols['name'][$i];
-
$datatable['headers']['header'][$i]['text'] =
$uicols['descr'][$i];
-
$datatable['headers']['header'][$i]['visible'] = true;
-
$datatable['headers']['header'][$i]['sortable'] = false;
- if($uicols['name'][$i]=='id')
- {
-
$datatable['headers']['header'][$i]['sortable'] = true;
-
$datatable['headers']['header'][$i]['sort_field'] = 'id';
- }
- }
- }
-
- //path for property.js
- $datatable['property_js'] =
$GLOBALS['phpgw_info']['server']['webserver_url']."/property/js/yahoo/property.js";
-
- // Pagination and sort values
- $datatable['pagination']['records_start'] =
(int)$this->bo->start;
- $datatable['pagination']['records_limit'] =
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
- $datatable['pagination']['records_returned']=
count($b_account_list);
- $datatable['pagination']['records_total'] =
$this->bo->total_records;
-
- $appname =
lang('budget account');
- $function_msg = lang('list
budget account');
-
- if ( (phpgw::get_var("start")== "") &&
(phpgw::get_var("order",'string')== ""))
- {
- $datatable['sorting']['order']
= 'id'; // name key Column in myColumnDef
- $datatable['sorting']['sort']
= 'desc'; // ASC / DESC
- }
- else
- {
- $datatable['sorting']['order']
= phpgw::get_var('order', 'string'); // name of column of Database
- $datatable['sorting']['sort']
= phpgw::get_var('sort', 'string'); // ASC / DESC
- }
-
- phpgwapi_yui::load_widget('dragdrop');
- phpgwapi_yui::load_widget('datatable');
- phpgwapi_yui::load_widget('menu');
- phpgwapi_yui::load_widget('connection');
- phpgwapi_yui::load_widget('loader');
- phpgwapi_yui::load_widget('tabview');
- phpgwapi_yui::load_widget('paginator');
- phpgwapi_yui::load_widget('animation');
-
- //-- BEGIN----------------------------- JSON CODE
------------------------------
- //values for Pagination
- $json = array
- (
- 'recordsReturned' =>
$datatable['pagination']['records_returned'],
- 'totalRecords' =>
(int)$datatable['pagination']['records_total'],
- 'startIndex' =>
$datatable['pagination']['records_start'],
- 'sort' =>
$datatable['sorting']['order'],
- 'dir' =>
$datatable['sorting']['sort'],
- 'records' =>
array()
- );
-
- // values for datatable
- if(isset($datatable['rows']['row']) &&
is_array($datatable['rows']['row'])){
- foreach( $datatable['rows']['row'] as $row )
- {
- $json_row = array();
- foreach( $row['column'] as $column)
- {
- if(isset($column['format']) &&
$column['format']== "link" && $column['java_link']==true)
- {
-
$json_row[$column['name']] = "<a href='#' id='".$column['link']."'
onclick='javascript:filter_data(this.id);'>" .$column['value']."</a>";
- }
- elseif(isset($column['format'])
&& $column['format']== "link")
- {
- $json_row[$column['name']] =
"<a href='".$column['link']."'>" .$column['value']."</a>";
- }else
- {
- $json_row[$column['name']] =
$column['value'];
- }
- }
- $json['records'][] = $json_row;
- }
- }
-
- // right in datatable
- if(isset($datatable['rowactions']['action']) &&
is_array($datatable['rowactions']['action']))
- {
- $json ['rights'] =
$datatable['rowactions']['action'];
- }
-
- if( phpgw::get_var('phpgw_return_as') == 'json'
)
- {
- return $json;
- }
-
-
- $datatable['json_data'] = json_encode($json);
- //-------------------- JSON CODE ----------------------
-
- $template_vars = array();
- $template_vars['datatable'] = $datatable;
-
$GLOBALS['phpgw']->xslttpl->add_file(array('datatable'));
- $GLOBALS['phpgw']->xslttpl->set_var('phpgw', $template_vars);
-
- if ( !isset($GLOBALS['phpgw']->css) ||
!is_object($GLOBALS['phpgw']->css) )
- {
- $GLOBALS['phpgw']->css = createObject('phpgwapi.css');
- }
-
- $GLOBALS['phpgw']->css->validate_file('datatable');
- $GLOBALS['phpgw']->css->validate_file('property');
-
$GLOBALS['phpgw']->css->add_external_file('property/templates/base/css/property.css');
-
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/datatable/assets/skins/sam/datatable.css');
-
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/paginator/assets/skins/sam/paginator.css');
-
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/container/assets/skins/sam/container.css');
-
- $GLOBALS['phpgw_info']['flags']['app_header'] =
lang('property') . ' - ' . $appname . ': ' . $function_msg;
-
- $GLOBALS['phpgw']->js->validate_file( 'yahoo',
'account.index', 'property' );
-
-
-
- //_debug_array($datatable);die;
- /*if(!$this->acl_read)
- {
-
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=>
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
- }
-
- $GLOBALS['phpgw']->xslttpl->add_file(array('b_account',
'nextmatchs', 'search_field'));
-
- $b_account_list = $this->bo->read($type);
-
- while (is_array($b_account_list) && list(,$b_account) =
each($b_account_list))
- {
- if($this->acl_edit)
- {
- $link_edit =
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
'property.uib_account.edit', 'id'=> $b_account['id']));
- }
-
- if($this->acl_delete)
- {
- $link_delete =
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
'property.uib_account.delete', 'id'=> $b_account['id']));
- }
-
- $content[] = array
- (
- 'id' =>
$b_account['id'],
- 'first' =>
$b_account['descr'],
- 'link_edit' =>
$link_edit,
- 'link_delete' =>
$link_delete,
- 'lang_view_b_accounttext' =>
lang('view the budget account'),
- 'lang_edit_b_accounttext' =>
lang('edit the budget account'),
- 'lang_delete_b_accounttext' =>
lang('delete the budget account'),
- 'text_view' =>
lang('view'),
- 'text_edit' =>
lang('edit'),
- 'text_delete' =>
lang('delete')
- );
-
- }
-
-//_debug_array($content);
-
- $table_header[] = array
- (
-
- 'lang_descr' => lang('Descr'),
- 'lang_edit' => lang('edit'),
- 'lang_delete' => lang('delete'),
- 'sort_id' =>
$this->nextmatchs->show_sort_order(array(
-
'sort' => $this->sort,
-
'var' => 'id',
-
'order' => $this->order,
-
'extra' => array('menuaction' => 'property.uib_account.index')
-
)),
- 'lang_id' => lang('budget account'),
- );
-
- $table_add[] = array
- (
- 'lang_add' => lang('add'),
- 'lang_add_b_accounttext' => lang('add a
budget account'),
- 'add_action' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
'property.uib_account.edit')),
- 'lang_done' => lang('done'),
- 'lang_done_b_accounttext' => lang('back
to admin'),
- 'done_action' =>
$GLOBALS['phpgw']->link('/admin/index.php')
- );
-
- if(!$this->allrows)
- {
- $record_limit =
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
- }
- else
- {
- $record_limit = $this->bo->total_records;
- }
-
-
- $data = array
- (
- 'menu'
=> $this->bocommon->get_menu(),
- 'allow_allrows' => true,
- 'allrows' =>
$this->allrows,
- 'start_record' =>
$this->start,
- 'record_limit' =>
$record_limit,
- 'num_records' =>
count($b_account_list),
- 'all_records' =>
$this->bo->total_records,
- 'link_url' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
'property.uib_account.index', 'type'=> $type)),
- 'img_path' =>
$GLOBALS['phpgw']->common->get_image_path('phpgwapi','default'),
- 'lang_searchfield_b_accounttext' =>
lang('Enter the search string. To show all entries, empty this field and press
the SUBMIT button again'),
- 'lang_searchbutton_b_accounttext' =>
lang('Submit the search string'),
- 'query' =>
$this->query,
- 'lang_search' =>
lang('search'),
- 'table_header' =>
$table_header,
- 'values' =>
$content,
- 'table_add' =>
$table_add
- );
-
- $appname = lang('budget account');
- $function_msg = lang('list budget account');
-
@@ Diff output truncated at 153600 characters. @@
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [6597] merge 6587:6596 from trunk,
Sigurd Nes <=