[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [6701] Property: formatting: intend
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [6701] Property: formatting: intend |
Date: |
Sat, 25 Dec 2010 10:52:00 +0000 |
Revision: 6701
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=6701
Author: sigurdne
Date: 2010-12-25 10:51:59 +0000 (Sat, 25 Dec 2010)
Log Message:
-----------
Property: formatting: intend
Modified Paths:
--------------
trunk/property/inc/class.boXport.inc.php
trunk/property/inc/class.boadmin.inc.php
trunk/property/inc/class.boadmin_entity.inc.php
trunk/property/inc/class.boadmin_location.inc.php
trunk/property/inc/class.boagreement.inc.php
trunk/property/inc/class.boalarm.inc.php
trunk/property/inc/class.boasync.inc.php
trunk/property/inc/class.bobudget.inc.php
trunk/property/inc/class.bocommon.inc.php
trunk/property/inc/class.bocustom.inc.php
trunk/property/inc/class.bodocument.inc.php
trunk/property/inc/class.boentity.inc.php
trunk/property/inc/class.boevent.inc.php
trunk/property/inc/class.bofiles.inc.php
trunk/property/inc/class.bogab.inc.php
trunk/property/inc/class.bogallery.inc.php
trunk/property/inc/class.bogeneric.inc.php
trunk/property/inc/class.boifc.inc.php
trunk/property/inc/class.boinvestment.inc.php
trunk/property/inc/class.boinvoice.inc.php
trunk/property/inc/class.bojasper.inc.php
trunk/property/inc/class.bolocation.inc.php
trunk/property/inc/class.bolookup.inc.php
trunk/property/inc/class.bomigrate.inc.php
trunk/property/inc/class.bopricebook.inc.php
trunk/property/inc/class.boproject.inc.php
trunk/property/inc/class.borequest.inc.php
trunk/property/inc/class.boresponsible.inc.php
trunk/property/inc/class.bos_agreement.inc.php
trunk/property/inc/class.botemplate.inc.php
trunk/property/inc/class.botenant_claim.inc.php
trunk/property/inc/class.botts.inc.php
trunk/property/inc/class.bowo_hour.inc.php
trunk/property/inc/class.boworkorder.inc.php
trunk/property/inc/class.cat_hooks.inc.php
trunk/property/inc/class.custom_fields.inc.php
trunk/property/inc/class.custom_functions.inc.php
trunk/property/inc/class.db_mssql.inc.php
trunk/property/inc/class.fileuploader.inc.php
trunk/property/inc/class.historylog.inc.php
trunk/property/inc/class.import.inc.php
trunk/property/inc/class.interlink.inc.php
trunk/property/inc/class.menu.inc.php
trunk/property/inc/class.ods.inc.php
trunk/property/inc/class.soXport.inc.php
trunk/property/inc/class.soadmin.inc.php
trunk/property/inc/class.soadmin_entity.inc.php
trunk/property/inc/class.soadmin_location.inc.php
trunk/property/inc/class.soagreement.inc.php
trunk/property/inc/class.soalarm.inc.php
trunk/property/inc/class.soasync.inc.php
trunk/property/inc/class.sobudget.inc.php
trunk/property/inc/class.socommon.inc.php
trunk/property/inc/class.socustom.inc.php
trunk/property/inc/class.sodocument.inc.php
trunk/property/inc/class.soentity.inc.php
trunk/property/inc/class.soevent.inc.php
trunk/property/inc/class.sogab.inc.php
trunk/property/inc/class.sogallery.inc.php
trunk/property/inc/class.sogeneric.inc.php
trunk/property/inc/class.soinvestment.inc.php
trunk/property/inc/class.soinvoice.inc.php
trunk/property/inc/class.sojasper.inc.php
trunk/property/inc/class.solocation.inc.php
trunk/property/inc/class.solookup.inc.php
trunk/property/inc/class.sopending_action.inc.php
trunk/property/inc/class.sopricebook.inc.php
trunk/property/inc/class.soproject.inc.php
trunk/property/inc/class.sorequest.inc.php
trunk/property/inc/class.soresponsible.inc.php
trunk/property/inc/class.sos_agreement.inc.php
trunk/property/inc/class.sotemplate.inc.php
trunk/property/inc/class.sotenant_claim.inc.php
trunk/property/inc/class.sotts.inc.php
trunk/property/inc/class.sowo_hour.inc.php
trunk/property/inc/class.soworkorder.inc.php
trunk/property/inc/class.test.inc.php
trunk/property/inc/class.uiadmin.inc.php
trunk/property/inc/class.uiadmin_entity.inc.php
trunk/property/inc/class.uiadmin_location.inc.php
trunk/property/inc/class.uiagreement.inc.php
trunk/property/inc/class.uialarm.inc.php
trunk/property/templates/base/attributes_form.xsl
Modified: trunk/property/inc/class.boXport.inc.php
===================================================================
--- trunk/property/inc/class.boXport.inc.php 2010-12-24 15:00:54 UTC (rev
6700)
+++ trunk/property/inc/class.boXport.inc.php 2010-12-25 10:51:59 UTC (rev
6701)
@@ -34,10 +34,11 @@
class property_boXport
{
- var $public_functions = array(
- 'import' => true,
- 'export' => true
- );
+ var $public_functions = array
+ (
+ 'import' => true,
+ 'export' => true
+ );
var $start;
var $query;
@@ -52,7 +53,6 @@
{
$GLOBALS['phpgw_info']['flags']['currentapp'] =
'property';
- // $this->currentapp =
$GLOBALS['phpgw_info']['flags']['currentapp'];
$this->config =
CreateObject('phpgwapi.config','property');
@@ -69,11 +69,26 @@
$filter = phpgw::get_var('filter', 'int');
$cat_id = phpgw::get_var('cat_id', 'int');
- if($start || $start == 0) { $this->start = $start; }
- if($query) { $this->query = $query; }
- if($sort) { $this->sort = $sort; }
- if($order) { $this->order = $order; }
- if($filter) { $this->filter = $filter; }
+ if($start || $start == 0)
+ {
+ $this->start = $start;
+ }
+ if($query)
+ {
+ $this->query = $query;
+ }
+ if($sort)
+ {
+ $this->sort = $sort;
+ }
+ if($order)
+ {
+ $this->order = $order;
+ }
+ if($filter)
+ {
+ $this->filter = $filter;
+ }
$this->cat_id = $cat_id;
}
@@ -132,11 +147,11 @@
}
$conv_list[] = array
- (
- 'id' => $myfilearray[$i],
- 'name' => $fname,
- 'selected' => $sel_file
- );
+ (
+ 'id' =>
$myfilearray[$i],
+ 'name' => $fname,
+ 'selected' => $sel_file
+ );
}
for ($i=0;$i<count($conv_list);$i++)
@@ -176,11 +191,11 @@
}
$conv_list[] = array
- (
- 'id' => $myfilearray[$i],
- 'name' => $fname,
- 'selected' => $sel_file
- );
+ (
+ 'id' =>
$myfilearray[$i],
+ 'name' => $fname,
+ 'selected' => $sel_file
+ );
}
for ($i=0;$i<count($conv_list);$i++)
@@ -223,11 +238,11 @@
}
$rollback_list[] = array
- (
- 'id' => $myfilearray[$i],
- 'name' => $fname,
- 'selected' => $sel_file
- );
+ (
+ 'id' =>
$myfilearray[$i],
+ 'name' => $fname,
+ 'selected' => $sel_file
+ );
}
for ($i=0;$i<count($rollback_list);$i++)
@@ -253,10 +268,10 @@
$header = $invoice->header;
$import = $invoice->import;
$buffer= array(
- 'table' => $buffer,
- 'header' => $header,
- 'import' => $import
- );
+ 'table' => $buffer,
+ 'header' => $header,
+ 'import' => $import
+ );
}
return $buffer;
}
@@ -268,7 +283,7 @@
$pre_transfer = $data['pre_transfer'];
$force_period_year = $data['force_period_year'];
- include(PHPGW_SERVER_ROOT .
"/property/inc/export/{$GLOBALS['phpgw_info']['user']['domain']}/{$conv_type}");
+ include(PHPGW_SERVER_ROOT .
"/property/inc/export/{$GLOBALS['phpgw_info']['user']['domain']}/{$conv_type}");
$invoice = new export_conv;
$buffer =
$invoice->overfor($download,$pre_transfer,$force_period_year);
@@ -294,4 +309,3 @@
}
}
-
Modified: trunk/property/inc/class.boadmin.inc.php
===================================================================
--- trunk/property/inc/class.boadmin.inc.php 2010-12-24 15:00:54 UTC (rev
6700)
+++ trunk/property/inc/class.boadmin.inc.php 2010-12-25 10:51:59 UTC (rev
6701)
@@ -44,7 +44,7 @@
function property_boadmin($session='')
{
- // $this->currentapp =
$GLOBALS['phpgw_info']['flags']['currentapp'];
+ // $this->currentapp =
$GLOBALS['phpgw_info']['flags']['currentapp'];
$this->so =
CreateObject('property.soadmin');
$this->acl = &
$GLOBALS['phpgw']->acl;
$this->bocommon =
CreateObject('property.bocommon');
@@ -64,7 +64,7 @@
$filter = phpgw::get_var('filter', 'int');
$cat_id = phpgw::get_var('cat_id', 'string');
$permission = phpgw::get_var('permission');
- // $location =
get_var('location',array('POST','GET')); // don't work for some reason...
+ // $location =
get_var('location',array('POST','GET')); // don't work for some reason...
$module = phpgw::get_var('module');
$granting_group = phpgw::get_var('granting_group',
'int');
$allrows = phpgw::get_var('allrows', 'bool');
@@ -144,12 +144,12 @@
{
switch($format)
{
- case 'select':
-
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_select'));
- break;
- case 'filter':
-
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_filter'));
- break;
+ case 'select':
+
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_select'));
+ break;
+ case 'filter':
+
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_filter'));
+ break;
}
$categories[0]['id'] = 'groups';
@@ -164,7 +164,7 @@
{
if ( !is_array($values) )
{
-// return;
+ // return;
}
$totalacl = array();
@@ -302,7 +302,7 @@
$allusers =
$GLOBALS['phpgw']->accounts->get_list($type, -1,$this->sort, $this->order,
$this->query);
-// $allusers = array_intersect_key($allusers,
$valid_users);
+ // $allusers =
array_intersect_key($allusers, $valid_users);
foreach($allusers as $user)
{
@@ -376,20 +376,18 @@
}
}
-//_debug_array($user_list);
+ //_debug_array($user_list);
return $user_list;
}
function read_fm_id()
{
-
$fm_ids = $this->so->read_fm_id();
return $fm_ids;
-
}
+
function edit_id($values='')
{
return $this->so->edit_id($values);
-
}
}
Modified: trunk/property/inc/class.boadmin_entity.inc.php
===================================================================
--- trunk/property/inc/class.boadmin_entity.inc.php 2010-12-24 15:00:54 UTC
(rev 6700)
+++ trunk/property/inc/class.boadmin_entity.inc.php 2010-12-25 10:51:59 UTC
(rev 6701)
@@ -40,38 +40,38 @@
public $start;
/**
- * @var string $query user input: search string
- */
+ * @var string $query user input: search string
+ */
public $query;
/**
- * @var string $sort how to sort: ASC or DESC
- */
+ * @var string $sort how to sort: ASC or DESC
+ */
public $sort;
/**
- * @var string $order field to order by
- */
+ * @var string $order field to order by
+ */
public $order;
/**
- * @var string $type entity set
- */
+ * @var string $type entity set
+ */
public $type;
/**
- * @var integer $entity_id entity type
- */
+ * @var integer $entity_id entity type
+ */
public $entity_id;
/**
- * @var integer $cat_id category of entity type
- */
+ * @var integer $cat_id category of entity type
+ */
public $cat_id;
/**
- * @var bool $use_session read vars from session or not
- */
+ * @var bool $use_session read vars from session or not
+ */
protected $use_session;
/**
@@ -80,19 +80,19 @@
protected $custom;
var $public_functions = array
- (
- 'read' => true,
- 'read_single' => true,
- 'save' => true,
- 'delete' => true,
- 'check_perms' => true
- );
+ (
+ 'read' => true,
+ 'read_single' => true,
+ 'save' => true,
+ 'delete' => true,
+ 'check_perms' => true
+ );
var $type_app = array
- (
- 'entity' => 'property',
- 'catch' => 'catch'
- );
+ (
+ 'entity' => 'property',
+ 'catch' => 'catch'
+ );
function __construct($session=false)
{
@@ -118,7 +118,7 @@
$this->query = isset($query) ?
$query : $this->query;
$this->sort = isset($sort)
&& $sort ? $sort : '';
$this->order = isset($order) &&
$order ? $order : '';
- $this->type = isset($type)
&& $type && isset($this->type_app[$type]) ? $type : 'entity';
+ $this->type = isset($type)
&& $type && isset($this->type_app[$type]) ? $type : 'entity';
$this->cat_id = isset($cat_id) &&
$cat_id ? $cat_id : '';
$this->entity_id = isset($entity_id) &&
$entity_id ? $entity_id : '';
$this->allrows = isset($allrows) &&
$allrows ? $allrows : '';
@@ -260,12 +260,12 @@
if(isset($values['category_template']) &&
$values['category_template'] && isset($receipt['id']) && $receipt['id'])
{
$values2 = array
- (
- 'entity_id'
=> $values['entity_id'],
- 'cat_id'
=> $receipt['id'],
- 'category_template' =>
$values['category_template'],
- 'selected'
=> $values['template_attrib']
- );
+ (
+ 'entity_id'
=> $values['entity_id'],
+ 'cat_id'
=> $receipt['id'],
+ 'category_template'
=> $values['category_template'],
+ 'selected'
=> $values['template_attrib']
+ );
$this->_add_attrib_from_template($values2);
}
@@ -279,19 +279,19 @@
$template_entity_id = $template_info[0];
$template_cat_id = $template_info[1];
- $attrib_group_list =
$this->read_attrib_group($template_entity_id, $template_cat_id, true);
+ $attrib_group_list =
$this->read_attrib_group($template_entity_id, $template_cat_id, true);
foreach ($attrib_group_list as $attrib_group)
{
$group = array
- (
- 'appname' =>
$this->type_app[$this->type],
- 'location' =>
".{$this->type}.{$values['entity_id']}.{$values['cat_id']}",
- 'group_name' =>
$attrib_group['name'],
- 'descr' =>
$attrib_group['descr'],
- 'remark' =>
$attrib_group['remark']
- );
- $this->custom->add_group($group);
+ (
+ 'appname' =>
$this->type_app[$this->type],
+ 'location' =>
".{$this->type}.{$values['entity_id']}.{$values['cat_id']}",
+ 'group_name' =>
$attrib_group['name'],
+ 'descr' =>
$attrib_group['descr'],
+ 'remark' =>
$attrib_group['remark']
+ );
+ $this->custom->add_group($group);
}
$attrib_list =
$this->read_attrib($template_entity_id,$template_cat_id, true);
@@ -332,12 +332,12 @@
function
delete($cat_id='',$entity_id='',$attrib_id='',$acl_location='',$custom_function_id='',
$group_id ='')
{
- if(!$attrib_id && !$cat_id && $entity_id &&
!$custom_function_id && !$group_id)
+ if(!$attrib_id && !$cat_id && $entity_id &&
!$custom_function_id && !$group_id)
{
$this->so->delete_entity($entity_id);
execMethod('phpgwapi.menu.clear');
}
- else if(!$attrib_id && $cat_id && $entity_id &&
!$custom_function_id && !$group_id)
+ else if(!$attrib_id && $cat_id && $entity_id &&
!$custom_function_id && !$group_id)
{
$this->so->delete_category($entity_id, $cat_id);
execMethod('phpgwapi.menu.clear');
@@ -346,7 +346,7 @@
{
$this->custom->delete_group($this->type_app[$this->type],
".{$this->type}.{$entity_id}.{$cat_id}", $group_id);
}
- else if($attrib_id && $cat_id && $entity_id &&
!$custom_function_id && !$group_id)
+ else if($attrib_id && $cat_id && $entity_id &&
!$custom_function_id && !$group_id)
{
$this->custom->delete($this->type_app[$this->type],
".{$this->type}.{$entity_id}.{$cat_id}", $attrib_id);
$this->so->delete_history($entity_id,
$cat_id,$attrib_id);
@@ -360,15 +360,15 @@
function get_attrib_group_list($entity_id,$cat_id, $selected)
{
$group_list = $this->read_attrib_group($entity_id,
$cat_id, true);
-
+
foreach($group_list as &$group)
{
- if( $group['id'] == $selected )
+ if( $group['id'] == $selected )
{
$group['selected'] = true;
}
}
-//_debug_array($group_list);die();
+ //_debug_array($group_list);die();
return $group_list;
}
@@ -424,7 +424,7 @@
{
$receipt = array();
$group['appname'] = $this->type_app[$this->type];
- $group['location'] =
".{$this->type}.{$group['entity_id']}.{$group['cat_id']}";
+ $group['location'] =
".{$this->type}.{$group['entity_id']}.{$group['cat_id']}";
if ( $action=='edit' && $group['id'] )
{
if ( $this->custom->edit_group($group) )
@@ -439,7 +439,7 @@
else
{
$id = $this->custom->add_group($group);
- if ( $id <= 0 )
+ if ( $id <= 0 )
{
$receipt['error'][]=array('msg'=>lang('unable to add group'));
return $receipt;
@@ -461,7 +461,7 @@
{
$receipt = array();
$attrib['appname'] = $this->type_app[$this->type];
- $attrib['location'] =
".{$this->type}.{$attrib['entity_id']}.{$attrib['cat_id']}";
+ $attrib['location'] =
".{$this->type}.{$attrib['entity_id']}.{$attrib['cat_id']}";
if ( $action=='edit' && $attrib['id'] )
{
if ( $this->custom->edit($attrib) )
@@ -476,7 +476,7 @@
else
{
$id = $this->custom->add($attrib);
- if ( $id <= 0 )
+ if ( $id <= 0 )
{
$receipt['error'][]=array('msg'=>lang('Unable to add field'));
return $receipt;
@@ -508,7 +508,7 @@
}
$values =
$GLOBALS['phpgw']->custom_functions->find(array('start' => $this->start,'query'
=> $this->query,'sort' => $this->sort,'order' => $this->order,
-
'appname'=> $this->type_app[$this->type],'location' =>
$acl_location,'allrows'=>$this->allrows));
+ 'appname'=>
$this->type_app[$this->type],'location' =>
$acl_location,'allrows'=>$this->allrows));
$this->total_records =
$GLOBALS['phpgw']->custom_functions->total_records;
Modified: trunk/property/inc/class.boadmin_location.inc.php
===================================================================
--- trunk/property/inc/class.boadmin_location.inc.php 2010-12-24 15:00:54 UTC
(rev 6700)
+++ trunk/property/inc/class.boadmin_location.inc.php 2010-12-25 10:51:59 UTC
(rev 6701)
@@ -41,38 +41,19 @@
public $allrows;
/**
- * @var object $custom reference to custom fields object
- */
+ * @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
- );
+ (
+ '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_boadmin_location($session=false)
{
$this->so =
CreateObject('property.soadmin_location');
@@ -171,7 +152,7 @@
{
$ok = 0;
$receipt = array();
-
+
if($this->custom->delete('property',".location.{$type_id}", $id ,
"fm_location{$type_id}_history", true ))
{
$ok++;
@@ -209,7 +190,7 @@
{
$location = ".location.{$type_id}";
$group_list = $this->read_attrib_group($location, true);
-
+
foreach($group_list as &$group)
{
if( $group['id'] == $selected )
@@ -252,9 +233,9 @@
if ( $this->custom->edit_group($group) )
{
return array
- (
- 'msg' => array('msg' =>
lang('group has been updated'))
- );
+ (
+ 'msg' => array('msg'
=> lang('group has been updated'))
+ );
}
return array('error' => lang('Unable to update
group'));
@@ -269,21 +250,21 @@
else if ( $id == -1 )
{
return array
- (
- 'id' => 0,
- 'error' => array
(
- array('msg' =>
lang('group already exists, please choose another name')),
- array('msg' =>
lang('Attribute group has NOT been saved'))
- )
- );
+ 'id' => 0,
+ 'error' => array
+ (
+ array('msg' =>
lang('group already exists, please choose another name')),
+ array('msg' =>
lang('Attribute group has NOT been saved'))
+ )
+ );
}
return array
- (
- 'id' => $id,
- 'msg' => array('msg' => lang('group
has been created'))
- );
+ (
+ 'id' => $id,
+ 'msg' => array('msg' =>
lang('group has been created'))
+ );
}
}
@@ -324,9 +305,9 @@
public function save_attrib($attrib,$action='')
{
$attrib['appname'] = 'property';
- $attrib['location'] = '.location.' . $attrib['type_id'];
- $primary_table = 'fm_location' . $attrib['type_id'];
- $history_table = $primary_table . '_history';
+ $attrib['location'] = '.location.' . $attrib['type_id'];
+ $primary_table = 'fm_location' . $attrib['type_id'];
+ $history_table = $primary_table . '_history';
if ( $action=='edit' && $attrib['id'] )
{
@@ -334,9 +315,9 @@
{
$this->custom->edit($attrib,
$primary_table);
return array
- (
- 'msg' => array('msg' =>
lang('Field has been updated'))
- );
+ (
+ 'msg' => array('msg'
=> lang('Field has been updated'))
+ );
}
return array('error' => lang('Unable to update
field'));
@@ -352,27 +333,27 @@
else if ( $id == -1 )
{
return array
- (
- 'id' => 0,
- 'error' => array
(
- array('msg' =>
lang('field already exists, please choose another name')),
- array('msg' =>
lang('Attribute has NOT been saved'))
- )
- );
+ 'id' => 0,
+ 'error' => array
+ (
+ array('msg' =>
lang('field already exists, please choose another name')),
+ array('msg' =>
lang('Attribute has NOT been saved'))
+ )
+ );
}
return array
- (
- 'id' => $id,
- 'msg' => array('msg' => lang('Custom
field has been created'))
- );
+ (
+ 'id' => $id,
+ 'msg' => array('msg' =>
lang('Custom field has been created'))
+ );
}
}
function save_config($values='',$column_name='')
{
- return
$this->so->save_config($values,$column_name);
+ return $this->so->save_config($values,$column_name);
}
function select_location_type($selected='')
Modified: trunk/property/inc/class.boagreement.inc.php
===================================================================
--- trunk/property/inc/class.boagreement.inc.php 2010-12-24 15:00:54 UTC
(rev 6700)
+++ trunk/property/inc/class.boagreement.inc.php 2010-12-25 10:51:59 UTC
(rev 6701)
@@ -44,18 +44,18 @@
var $member_id;
/**
- * @var object $custom reference to custom fields object
- */
+ * @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
- );
+ (
+ 'read' => true,
+ 'read_single' => true,
+ 'save' => true,
+ 'delete' => true,
+ 'check_perms' => true
+ );
function property_boagreement($session=false)
{
@@ -161,12 +161,12 @@
{
switch($format)
{
- case 'select':
-
$GLOBALS['phpgw']->xslttpl->add_file(array('select_vendor'));
- break;
- case 'filter':
-
$GLOBALS['phpgw']->xslttpl->add_file(array('filter_vendor'));
- break;
+ 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();
@@ -178,8 +178,8 @@
function read()
{
$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,
-
'vendor_id'=>$this->vendor_id));
+ 'filter' => $this->filter,'cat_id' =>
$this->cat_id,'allrows'=>$this->allrows,'member_id'=>$this->member_id,
+ 'vendor_id'=>$this->vendor_id));
$this->total_records = $this->so->total_records;
$this->uicols = $this->so->uicols;
@@ -204,8 +204,8 @@
function read_details($id)
{
$list = $this->so->read_details(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,
-
'agreement_id'=>$id));
+ 'filter' => $this->filter,'cat_id' =>
$this->cat_id,'allrows'=>$this->allrows,'member_id'=>$this->member_id,
+ 'agreement_id'=>$id));
$this->total_records = $this->so->total_records;
$this->uicols = $this->so->uicols;
@@ -265,8 +265,8 @@
$vfs->override_acl = 1;
$values['files'] = $vfs->ls (array(
- 'string' =>
"/property/agreement/{$data['agreement_id']}",
- 'relatives' => array(RELATIVE_NONE)));
+ 'string' =>
"/property/agreement/{$data['agreement_id']}",
+ 'relatives' => array(RELATIVE_NONE)));
$vfs->override_acl = 0;
@@ -290,13 +290,13 @@
}
/**
- * 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
- */
+ * 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())
{
@@ -315,7 +315,7 @@
}
if ($action=='edit')
-// if ($values['agreement_id'])
+ // if
($values['agreement_id'])
{
if ($values['agreement_id'] != 0)
{
@@ -331,7 +331,7 @@
function save_item($values,$values_attribute='')
{
-//_debug_array($values);
+ //_debug_array($values);
$values['m_cost'] =
str_replace(",",".",$values['m_cost']);
$values['w_cost'] =
str_replace(",",".",$values['w_cost']);
$values['total_cost'] = $values['m_cost'] +
$values['w_cost'];
@@ -390,7 +390,7 @@
function request_next_id()
{
- return $this->so->request_next_id();
+ return $this->so->request_next_id();
}
function get_agreement_group_list($selected='')
@@ -415,12 +415,12 @@
{
switch($format)
{
- case 'select':
-
$GLOBALS['phpgw']->xslttpl->add_file(array('status_select'));
- break;
- case 'filter':
-
$GLOBALS['phpgw']->xslttpl->add_file(array('status_filter'));
- break;
+ case 'select':
+
$GLOBALS['phpgw']->xslttpl->add_file(array('status_select'));
+ break;
+ case 'filter':
+
$GLOBALS['phpgw']->xslttpl->add_file(array('status_filter'));
+ break;
}
$status_entries= $this->so->select_status_list();
@@ -433,4 +433,3 @@
return $this->so->get_activity_descr($id);
}
}
-
Modified: trunk/property/inc/class.boalarm.inc.php
===================================================================
--- trunk/property/inc/class.boalarm.inc.php 2010-12-24 15:00:54 UTC (rev
6700)
+++ trunk/property/inc/class.boalarm.inc.php 2010-12-25 10:51:59 UTC (rev
6701)
@@ -39,30 +39,28 @@
function property_boalarm($session = '')
{
-
$GLOBALS['phpgw_info']['flags']['currentapp'] =
'property';
- // $this->currentapp =
$GLOBALS['phpgw_info']['flags']['currentapp'];
if (!is_object($GLOBALS['phpgw']->asyncservice))
{
$GLOBALS['phpgw']->asyncservice =
CreateObject('phpgwapi.asyncservice');
}
- $this->async = &$GLOBALS['phpgw']->asyncservice;
- $this->so =
CreateObject('property.soalarm');
- $this->bocommon =
CreateObject('property.bocommon');
+ $this->async = &
$GLOBALS['phpgw']->asyncservice;
+ $this->so =
CreateObject('property.soalarm');
+ $this->bocommon =
CreateObject('property.bocommon');
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');
+ $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');
$method_id = phpgw::get_var('method_id', 'int');
- $allrows =
phpgw::get_var('allrows', 'bool');
+ $allrows = phpgw::get_var('allrows', 'bool');
if ($start)
{
@@ -115,12 +113,12 @@
{
$data =
$GLOBALS['phpgw']->session->appsession('session_data','owner');
- $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->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->method_id = $data['method_id'];
}
@@ -140,7 +138,7 @@
function read()
{
$jobs = $this->so->read(array('id'=>'%','start' =>
$this->start,'query' => $this->query,'sort' => $this->sort,'order' =>
$this->order,
-
'filter' => $this->filter,'allrows'=>$this->allrows));
+ 'filter' =>
$this->filter,'allrows'=>$this->allrows));
$this->total_records = $this->so->total_records;
return $jobs;
}
@@ -150,7 +148,7 @@
@abstract read the alarms of a calendar-event specified by
$cal_id
@returns array of alarms with alarm-id as key
@note the alarm-id is a string of 'cal:'.$cal_id.':'.$alarm_nr,
it is used as the job-id too
- */
+ */
function read_alarms($type='',$input_id,$text='')
{
$alarms = array();
@@ -176,7 +174,7 @@
@abstract read a single alarm specified by it's $id
@returns array with data of the alarm
@note the alarm-id is a string of 'cal:'.$cal_id.':'.$alarm_nr,
it is used as the job-id too
- */
+ */
function read_alarm($alarm_type,$id)
{
if (!($jobs = $this->async->read($id)))
@@ -184,10 +182,10 @@
return false;
}
- $alarm = $jobs[$id]['data']; // text, enabled
- $alarm['id'] = $id;
- $alarm['time'] = $jobs[$id]['next'];
- $alarm['times'] = $jobs[$id]['times'];
+ $alarm = $jobs[$id]['data']; //
text, enabled
+ $alarm['id'] = $id;
+ $alarm['time'] = $jobs[$id]['next'];
+ $alarm['times'] = $jobs[$id]['times'];
// echo "<p>read_alarm('$id')="; print_r($alarm); echo
"</p>\n";
return $alarm;
@@ -202,7 +200,7 @@
@param $ids array with alarm ids as keys (!)
@returns the number of alarms enabled or -1 for insuficent
permission to do so
@note Not found alarms or insuficent perms stop the enableing
of multiple alarms
- */
+ */
function enable_alarm($alarm_type,$alarms,$enable=true)
{
$enabled = 0;
@@ -224,7 +222,7 @@
{
return -1;
}
-*/
+ */
$alarm['enabled'] = intval(!$alarm['enabled']);
if
($this->save_alarm($alarm_type,$alarm['event_id'],$alarm))
@@ -242,7 +240,7 @@
@syntax save_alarm($cal_id,$alarm,$id=false)
@param $cal_id Id of the calendar-entry
@param $alarm array with fields: text, owner, enabled, ..
- */
+ */
function save_alarm($alarm_type,$event_id,$alarm,$method='')
{
if(!$method)
@@ -256,10 +254,10 @@
$alarms =
$this->read_alarms($alarm_type,$event_id); // find a free alarm#
$n = count($alarms);
do
- {
- $id = $alarm_type
.':'.intval($event_id).':'.$n;
- ++$n;
- }
+ {
+ $id = $alarm_type .':'.intval($event_id).':'.$n;
+ ++$n;
+ }
while (@isset($alarms[$id]));
$alarm[$alarm_type.'_id'] = $event_id;
// we need the back-reference
@@ -288,14 +286,14 @@
@param $time for the alarm in sec before the starttime of the
event
@param $login_id user to alarm
@returns the alarm or false
- */
+ */
function add_alarm($alarm_type,&$event,$time,$owner)
{
/* if (!$this->check_perms(PHPGW_ACL_SETALARM,$owner) ||
!($cal_id = $event['id']))
{
return false;
}
-*/
+ */
if(!$owner>0)
{
$receipt['error'][]=array('msg'=>lang('No user
selected'));
@@ -327,7 +325,7 @@
@param $ids array with alarm ids as keys (!)
@returns the number of alarms deleted or -1 for insuficent
permission to do so
@note Not found alarms or insuficent perms stop the deleting of
multiple alarms
- */
+ */
function delete_alarm($alarm_type,$alarms)
{
$deleted = 0;
@@ -341,7 +339,7 @@
{
return -1;
}
-*/
+ */
if ($this->async->cancel_timer($id))
{
++$deleted;
@@ -360,7 +358,7 @@
function send_alarm($alarm)
{
- // echo "<p>boalarm::send_alarm("; print_r($alarm); echo
")</p>\n";
+// echo "<p>boalarm::send_alarm("; print_r($alarm); echo
")</p>\n";
$GLOBALS['phpgw_info']['user']['account_id'] =
$this->owner = $alarm['owner'];
if (!$alarm['enabled'] || !$alarm['owner'])
@@ -381,7 +379,7 @@
$from_address=$prefs_user['email'];
- //-----------from--------
+ //-----------from--------
$current_user_id=$GLOBALS['phpgw_info']['user']['account_id'];
@@ -395,11 +393,11 @@
$current_prefs_user =
$this->bocommon->create_preferences('property',$alarm['owner']);
$current_user_address=$current_prefs_user['email'];
- //-----------from--------
- // build body
-
+ //-----------from--------
+ // build body
+
$info = explode(':', $alarm['id']);
-
+
$body = lang('Alarm').' #'.$alarm['event_id']."\n";
$body .= lang('Name').': '.$alarm['event_name']."\n";
$body .= '<a href ="http://' .
$GLOBALS['phpgw_info']['server']['hostname'] .
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
"property.ui{$info[0]}.edit", 'id'=> $info[1])).'">' . $alarm['event_name']
."</a>\n";
@@ -452,7 +450,7 @@
$receipt['error'][]=array('msg'=>lang('SMTP
server is not set! (admin section)'));
}
- // $rc=1;
+ // $rc=1;
if (!$rc)
{
$receipt['error'][] = array('msg'=> lang('Your
message could not be sent by mail!'));
@@ -461,8 +459,8 @@
$receipt['error'][] = array('msg'=> 'to: '.$to);
$receipt['error'][] = array('msg'=> 'subject:
'.$subject);
$receipt['error'][] = array('msg'=> $body );
- // $receipt['error'][] = array('msg'=> 'cc: ' .
$cc);
- // $receipt['error'][] = array('msg'=> 'bcc:
'.$bcc);
+// $receipt['error'][] = array('msg'=> 'cc: ' .
$cc);
+// $receipt['error'][] = array('msg'=> 'bcc:
'.$bcc);
$receipt['error'][] = array('msg'=> 'group:
'.$group_name);
$receipt['error'][] = array('msg'=> 'err_code:
'.$this->send->err['code']);
$receipt['error'][] = array('msg'=> 'err_msg:
'. htmlspecialchars($this->send->err['msg']));
@@ -472,4 +470,3 @@
}
}
-
Modified: trunk/property/inc/class.boasync.inc.php
===================================================================
--- trunk/property/inc/class.boasync.inc.php 2010-12-24 15:00:54 UTC (rev
6700)
+++ trunk/property/inc/class.boasync.inc.php 2010-12-25 10:51:59 UTC (rev
6701)
@@ -43,36 +43,16 @@
var $allrows;
var $public_functions = array
- (
- 'read' => true,
- 'read_single' => true,
- 'save' => true,
- 'delete' => true,
- 'check_perms' => true
- );
+ (
+ '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_boasync($session=false)
{
- // $this->currentapp =
$GLOBALS['phpgw_info']['flags']['currentapp'];
$this->so =
CreateObject('property.soasync');
$this->socommon = CreateObject('property.socommon');
@@ -82,19 +62,19 @@
$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');
- $cat_id = phpgw::get_var('cat_id', 'int');
- $allrows = phpgw::get_var('allrows', 'bool');
+ $start =
phpgw::get_var('start', 'int', 'REQUEST', 0);
+ $query =
phpgw::get_var('query');
+ $sort =
phpgw::get_var('sort');
+ $order =
phpgw::get_var('order');
+ $cat_id =
phpgw::get_var('cat_id', 'int');
+ $allrows =
phpgw::get_var('allrows', 'bool');
- $this->start = $start ? $start : 0;
- $this->query = isset($query) ?
$query : $this->query;
- $this->sort = isset($sort)
&& $sort ? $sort : '';
- $this->order = isset($order) &&
$order ? $order : '';
- $this->cat_id = isset($cat_id) &&
$cat_id ? $cat_id : '';
- $this->allrows = isset($allrows) &&
$allrows ? $allrows : '';
+ $this->start = $start ? $start : 0;
+ $this->query = isset($query) ? $query :
$this->query;
+ $this->sort = isset($sort) && $sort
? $sort : '';
+ $this->order = isset($order) && $order ?
$order : '';
+ $this->cat_id = isset($cat_id) && $cat_id ?
$cat_id : '';
+ $this->allrows = isset($allrows) && $allrows ?
$allrows : '';
}
@@ -122,7 +102,7 @@
function read()
{
$method = $this->so->read(array('start' =>
$this->start,'query' => $this->query,'sort' => $this->sort,'order' =>
$this->order,
-
'allrows' => $this->allrows));
+ 'allrows' => $this->allrows));
$this->total_records = $this->so->total_records;
Modified: trunk/property/inc/class.bobudget.inc.php
===================================================================
--- trunk/property/inc/class.bobudget.inc.php 2010-12-24 15:00:54 UTC (rev
6700)
+++ trunk/property/inc/class.bobudget.inc.php 2010-12-25 10:51:59 UTC (rev
6701)
@@ -48,19 +48,19 @@
var $details;
var $public_functions = array
- (
- 'read' => true,
- 'read_single' => true,
- 'save' => true,
- 'delete' => true,
- 'check_perms' => true
- );
+ (
+ 'read' => true,
+ 'read_single' => true,
+ 'save' => true,
+ 'delete' => true,
+ 'check_perms' => true
+ );
function property_bobudget($session=false)
{
- $this->so =
CreateObject('property.sobudget');
- $this->bocommon =
CreateObject('property.bocommon');
- $this->cats = &
$this->so->cats;
+ $this->so =
CreateObject('property.sobudget');
+ $this->bocommon =
CreateObject('property.bocommon');
+ $this->cats = &
$this->so->cats;
if ($session)
{
@@ -136,9 +136,9 @@
function read()
{
$budget = $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,
- 'district_id' =>
$this->district_id,'year' => $this->year,'grouping' =>
$this->grouping,'revision' => $this->revision,
- 'cat_id' =>
$this->cat_id, 'dimb_id' => $this->dimb_id));
+ 'filter' => $this->filter,'cat_id' =>
$this->cat_id,'allrows'=>$this->allrows,
+ 'district_id' => $this->district_id,'year' =>
$this->year,'grouping' => $this->grouping,'revision' => $this->revision,
+ 'cat_id' => $this->cat_id, 'dimb_id' =>
$this->dimb_id));
$this->total_records = $this->so->total_records;
@@ -155,8 +155,8 @@
function read_basis()
{
$budget = $this->so->read_basis(array('start' =>
$this->start,'query' => $this->query,'sort' => $this->sort,'order' =>
$this->order,
- 'filter' =>
$this->filter,'cat_id' => $this->cat_id,'allrows'=>$this->allrows,
- 'district_id' =>
$this->district_id,'year' => $this->year,'grouping' =>
$this->grouping,'revision' => $this->revision,));
+ 'filter' => $this->filter,'cat_id' =>
$this->cat_id,'allrows'=>$this->allrows,
+ 'district_id' => $this->district_id,'year' =>
$this->year,'grouping' => $this->grouping,'revision' => $this->revision,));
$this->total_records = $this->so->total_records;
@@ -172,10 +172,10 @@
{
//cramirez: add strtoupper function for $this->sort. in
YUI use asc/desc (lowercase letters)
$obligations =
$this->so->read_obligations(array('start' => $this->start, 'query' =>
$this->query,
- 'sort' =>
strtoupper($this->sort), 'order' => $this->order, 'filter' => $this->filter,
- 'cat_id' =>
$this->cat_id, 'allrows'=>$this->allrows, 'district_id' => $this->district_id,
- 'year' => $this->year,
'grouping' => $this->grouping, 'revision' => $this->revision,
- 'details' =>
$this->details,'dimb_id' => $this->dimb_id));
+ 'sort' => strtoupper($this->sort), 'order' =>
$this->order, 'filter' => $this->filter,
+ 'cat_id' => $this->cat_id,
'allrows'=>$this->allrows, 'district_id' => $this->district_id,
+ 'year' => $this->year, 'grouping' =>
$this->grouping, 'revision' => $this->revision,
+ 'details' => $this->details,'dimb_id' =>
$this->dimb_id));
$this->total_records = $this->so->total_records;
return $obligations;
@@ -306,7 +306,7 @@
for ($i=0; $i < $k; $i++)
{
// FIXME
- // if($year_list[$j-1]['id'] < date('Y') + 3)
+ // if($year_list[$j-1]['id'] < date('Y') +
3)
{
$year_list[$j+$i]['id'] =
$year_list[$j+$i-1]['id'] + 1;
$year_list[$j+$i]['name'] =
$year_list[$j+$i-1]['id'] + 1;
@@ -349,4 +349,3 @@
}
}
-
Modified: trunk/property/inc/class.bocommon.inc.php
===================================================================
--- trunk/property/inc/class.bocommon.inc.php 2010-12-24 15:00:54 UTC (rev
6700)
+++ trunk/property/inc/class.bocommon.inc.php 2010-12-25 10:51:59 UTC (rev
6701)
@@ -46,32 +46,13 @@
var $public_functions = array
- (
- 'confirm_session' => true,
- );
+ (
+ 'confirm_session' => 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 __construct()
{
-//_debug_array($bt = debug_backtrace());
+ //_debug_array($bt = debug_backtrace());
$this->socommon =
CreateObject('property.socommon');
$this->account =
$GLOBALS['phpgw_info']['user']['account_id'];
@@ -87,24 +68,24 @@
switch($GLOBALS['phpgw_info']['server']['db_type'])
{
- case 'mssql':
- $this->dateformat = "M d
Y";
- $this->datetimeformat = "M d Y g:iA";
- break;
- case 'mysql':
- $this->dateformat =
"Y-m-d";
- $this->datetimeformat = "Y-m-d G:i:s";
- break;
- case 'pgsql':
- $this->dateformat =
"Y-m-d";
- $this->datetimeformat = "Y-m-d G:i:s";
-// $this->dateformat = "F j,
Y";
-// $this->datetimeformat = "F j, Y g:iA";
- break;
- case 'postgres':
- $this->dateformat =
"Y-m-d";
- $this->datetimeformat = "Y-m-d G:i:s";
- break;
+ case 'mssql':
+ $this->dateformat = "M d Y";
+ $this->datetimeformat = "M d Y g:iA";
+ break;
+ case 'mysql':
+ $this->dateformat = "Y-m-d";
+ $this->datetimeformat = "Y-m-d G:i:s";
+ break;
+ case 'pgsql':
+ $this->dateformat = "Y-m-d";
+ $this->datetimeformat = "Y-m-d G:i:s";
+ //
$this->dateformat = "F j, Y";
+ //
$this->datetimeformat = "F j, Y g:iA";
+ break;
+ case 'postgres':
+ $this->dateformat = "Y-m-d";
+ $this->datetimeformat = "Y-m-d G:i:s";
+ break;
}
}
@@ -219,19 +200,19 @@
if ($entry['id']==$selected)
{
$entry_list[] = array
- (
- 'id' =>
$entry['id'],
- 'name' =>
$entry['name'],
- 'selected' =>
'selected'
- );
+ (
+ 'id'
=> $entry['id'],
+ 'name'
=> $entry['name'],
+ 'selected'
=> 'selected'
+ );
}
else
{
$entry_list[] = array
- (
- 'id' =>
$entry['id'],
- 'name' =>
$entry['name'],
- );
+ (
+ 'id'
=> $entry['id'],
+ 'name'
=> $entry['name'],
+ );
}
}
return $entry_list;
@@ -243,12 +224,12 @@
{
switch($format)
{
- case 'select':
-
$GLOBALS['phpgw']->xslttpl->add_file(array('user_id_select'));
- break;
- case 'filter':
-
$GLOBALS['phpgw']->xslttpl->add_file(array('user_id_filter'));
- break;
+ case 'select':
+
$GLOBALS['phpgw']->xslttpl->add_file(array('user_id_select'));
+ break;
+ case 'filter':
+
$GLOBALS['phpgw']->xslttpl->add_file(array('user_id_filter'));
+ break;
}
if(!$selected && $default)
@@ -263,10 +244,10 @@
foreach($extra as $extra_user)
{
$all_users[]=array
- (
- 'account_id' => $extra_user,
- 'account_firstname' =>
lang($extra_user)
- );
+ (
+ 'account_id' =>
$extra_user,
+ 'account_firstname' =>
lang($extra_user)
+ );
}
}
@@ -281,10 +262,10 @@
if (($enabled && $user->enabled) ||
!$enabled)
{
$all_users[] = array
- (
- 'user_id' =>
$user->id,
- 'name' =>
$user->__toString(),
- );
+ (
+ 'user_id'
=> $user->id,
+ 'name'
=> $user->__toString(),
+ );
}
}
}
@@ -297,24 +278,24 @@
if ($user['user_id'] == $selected)
{
$user_list[] = array
- (
- 'user_id' =>
$user['user_id'],
- 'name' =>
$user['name'],
- 'selected' =>
'selected'
- );
+ (
+ 'user_id'
=> $user['user_id'],
+ 'name'
=> $user['name'],
+ 'selected'
=> 'selected'
+ );
}
else
{
$user_list[] = array
- (
- 'user_id' =>
$user['user_id'],
- 'name' =>
$user['name'],
- );
+ (
+ 'user_id'
=> $user['user_id'],
+ 'name'
=> $user['name'],
+ );
}
}
}
-//_debug_array($user_list);
+ //_debug_array($user_list);
return $user_list;
}
@@ -322,12 +303,12 @@
{
switch($format)
{
- case 'select':
-
$GLOBALS['phpgw']->xslttpl->add_file(array('group_select'));
- break;
- case 'filter':
-
$GLOBALS['phpgw']->xslttpl->add_file(array('group_filter'));
- break;
+ case 'select':
+
$GLOBALS['phpgw']->xslttpl->add_file(array('group_select'));
+ break;
+ case 'filter':
+
$GLOBALS['phpgw']->xslttpl->add_file(array('group_filter'));
+ break;
}
$accounts = & $GLOBALS['phpgw']->accounts;
@@ -345,11 +326,11 @@
}
$user_list[] = array
- (
- 'id' => $user->id,
- 'name' =>
$user->firstname,
- 'selected' => $sel_user
- );
+ (
+ 'id' => $user->id,
+ 'name' =>
$user->firstname,
+ 'selected' =>
$sel_user
+ );
}
}
@@ -362,7 +343,7 @@
}
}
-//_debug_array($user_list);
+ //_debug_array($user_list);
return $user_list;
}
@@ -384,11 +365,11 @@
foreach($extra as $extra_user)
{
$users_extra[]=array
- (
- 'account_lid' =>
$extra_user,
- 'account_firstname' =>
lang($extra_user),
- 'account_lastname' => ''
- );
+ (
+ 'account_lid'
=> $extra_user,
+ 'account_firstname'
=> lang($extra_user),
+ 'account_lastname'
=> ''
+ );
}
}
@@ -399,7 +380,7 @@
{
$users_gross =
array_merge($users_gross, $GLOBALS['phpgw']->acl->get_user_list_right($right,
$acl_location));
}
-
+
$accounts = array();
$users = array();
@@ -443,21 +424,21 @@
if ($user['account_lid']==$selected)
{
$user_list[] = array
- (
- 'lid' =>
$user['account_lid'],
- 'firstname' =>
$user['account_firstname'],
- 'lastname' =>
$user['account_lastname'],
- 'selected' =>
'selected'
- );
+ (
+ 'lid'
=> $user['account_lid'],
+ 'firstname'
=> $user['account_firstname'],
+ 'lastname'
=> $user['account_lastname'],
+ 'selected'
=> 'selected'
+ );
}
else
{
$user_list[] = array
- (
- 'lid' =>
$user['account_lid'],
- 'firstname' =>
$user['account_firstname'],
- 'lastname' =>
$user['account_lastname'],
- );
+ (
+ 'lid'
=> $user['account_lid'],
+ 'firstname'
=> $user['account_firstname'],
+ 'lastname'
=> $user['account_lastname'],
+ );
}
}
return $user_list;
@@ -478,12 +459,12 @@
switch($format)
{
- case 'select':
-
$GLOBALS['phpgw']->xslttpl->add_file(array('user_id_select'));
- break;
- case 'filter':
-
$GLOBALS['phpgw']->xslttpl->add_file(array('user_id_filter'));
- break;
+ case 'select':
+
$GLOBALS['phpgw']->xslttpl->add_file(array('user_id_select'));
+ break;
+ case 'filter':
+
$GLOBALS['phpgw']->xslttpl->add_file(array('user_id_filter'));
+ break;
}
if(!$selected && $default)
@@ -496,10 +477,10 @@
foreach($extra as $extra_user)
{
$users_extra[]=array
- (
- 'account_id' => $extra_user,
- 'account_firstname' =>
lang($extra_user)
- );
+ (
+ 'account_id' =>
$extra_user,
+ 'account_firstname' =>
lang($extra_user)
+ );
}
}
@@ -526,21 +507,21 @@
if ($user['account_id']==$selected)
{
$user_list[] = array
- (
- //'user_id' =>
$user['account_id'],
- 'id' => $user['account_id'],
- 'name' => $name,
- 'selected' => 'selected'
- );
+ (
+ //'user_id' =>
$user['account_id'],
+ 'id' =>
$user['account_id'],
+ 'name' =>
$name,
+ 'selected' =>
'selected'
+ );
}
else
{
$user_list[] = array
- (
- //'user_id' =>
$user['account_id'],
- 'id' => $user['account_id'],
- 'name' => $name
- );
+ (
+ //'user_id' =>
$user['account_id'],
+ 'id' =>
$user['account_id'],
+ 'name' => $name
+ );
}
}
@@ -549,7 +530,7 @@
function initiate_ui_vendorlookup($data)
{
-//_debug_array($data);
+ //_debug_array($data);
if( isset($data['type']) && $data['type']=='view')
{
@@ -590,14 +571,14 @@
$vendor['lang_vendor'] =
lang('Vendor');
$vendor['lang_select_vendor_help'] = lang('click
this link to select vendor');
$vendor['lang_vendor_name'] = lang('Vendor
Name');
-//_debug_array($vendor);
+ //_debug_array($vendor);
return $vendor;
}
function initiate_ui_contact_lookup($data)
{
-//_debug_array($data);
+ //_debug_array($data);
$field = $data['field'];
if( isset($data['type']) && $data['type']=='view')
@@ -610,7 +591,7 @@
}
$contact['value_contact_id'] =
$data['contact_id'];
-// $contact['value_contact_name'] =
$data['contact_name'];
+ // $contact['value_contact_name']
= $data['contact_name'];
if(isset($data['contact_id']) && $data['contact_id'] &&
!$data['contact_name'])
{
@@ -627,7 +608,7 @@
$contact['contact_link']
= $GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
'property.uilookup.addressbook', 'column' => $field));
$contact['lang_contact']
= lang('contact');
$contact['lang_select_contact_help'] = lang('click
this link to select');
-//_debug_array($contact);
+ //_debug_array($contact);
return $contact;
}
@@ -669,7 +650,7 @@
$tenant_data =
$tenant_object->read_single(array('id' => $data['tenant_id']),$tenant_data);
if(is_array($tenant_data['attributes']))
{
-//_debug_array($tenant_data);
+ //_debug_array($tenant_data);
foreach ($tenant_data['attributes'] as
$entry)
{
@@ -685,17 +666,17 @@
}
}
-//_debug_array($tenant);
+ //_debug_array($tenant);
return $tenant;
}
/**
- * initiate design element for lookup to budget account/group
- *
- * @param array $data
- *
- * @return array with information to include in forms
- */
+ * initiate design element for lookup to budget account/group
+ *
+ * @param array $data
+ *
+ * @return array with information to include in forms
+ */
function initiate_ui_budget_account_lookup($data)
{
@@ -711,11 +692,11 @@
$b_account['value_b_account_id'] =
$data['b_account_id'];
$b_account['value_b_account_name'] =
$data['b_account_name'];
$b_account['b_account_link'] =
$GLOBALS['phpgw']->link('/index.php',array
-
(
-
'menuaction'=>
'property.uilookup.b_account',
-
'role' => isset($data['role'])
&& $data['role'] ? $data['role'] : '',
-
'parent' =>
isset($data['parent']) && $data['parent'] ? $data['parent'] : '',
-
));
+ (
+ 'menuaction'=>
'property.uilookup.b_account',
+ 'role' => isset($data['role'])
&& $data['role'] ? $data['role'] : '',
+ 'parent' =>
isset($data['parent']) && $data['parent'] ? $data['parent'] : '',
+ ));
$b_account['lang_select_b_account_help'] =
lang('click this link to select budget account');
$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'])
@@ -816,7 +797,7 @@
{
if(!isset($data['event']) || !$data['event'])
{
-// return $event;
+ //
return $event;
}
$GLOBALS['phpgw']->xslttpl->add_file(array('event_view'));
@@ -855,12 +836,12 @@
$event['lang_next_run'] = lang('next run');
$criteria = array
- (
- 'start_date' =>
$event_info['start_date'],
- 'end_date' =>
$event_info['end_date'],
- 'location_id' =>
$event_info['location_id'],
- 'location_item_id' =>
$event_info['location_item_id']
- );
+ (
+ 'start_date' =>
$event_info['start_date'],
+ 'end_date'
=> $event_info['end_date'],
+ 'location_id' =>
$event_info['location_id'],
+ 'location_item_id' =>
$event_info['location_item_id']
+ );
$event['count'] = 0;
$boevent =
CreateObject('property.boevent');
@@ -883,17 +864,17 @@
}
$event['event_link'] =
$GLOBALS['phpgw']->link('/index.php',array
- (
- 'menuaction' => 'property.uievent.edit',
- 'location' => $data['location'],
- 'attrib_id' => $event['name'],
- 'item_id' =>
isset($event['item_id']) ? $event['item_id'] : '',
- 'id' =>
isset($event['value']) && $event['value'] ? $event['value'] : '')
- );
+ (
+ 'menuaction' =>
'property.uievent.edit',
+ 'location' =>
$data['location'],
+ 'attrib_id' =>
$event['name'],
+ 'item_id' =>
isset($event['item_id']) ? $event['item_id'] : '',
+ 'id' =>
isset($event['value']) && $event['value'] ? $event['value'] : '')
+ );
$event['event_link'] =
"{menuaction:'property.uievent.edit',"
-
."location:'{$data['location']}',"
-
."attrib_id:'{$event['name']}'";
+ ."location:'{$data['location']}',"
+ ."attrib_id:'{$event['name']}'";
$event['event_link'] .= isset($event['item_id']) ?
",item_id:{$event['item_id']}" : '';
$event['event_link'] .= isset($event['value']) ?
",id:{$event['value']}" : '';
$event['event_link'] .= '}';
@@ -918,12 +899,12 @@
}
$alarm['header'][] = array
- (
- 'lang_time' => lang('Time'),
- 'lang_text' => lang('Text'),
- 'lang_user' => lang('User'),
- 'lang_enabled' => lang('Enabled'),
- 'lang_select' => lang('Select')
+ (
+ 'lang_time' => lang('Time'),
+ 'lang_text' => lang('Text'),
+ 'lang_user' =>
lang('User'),
+ 'lang_enabled' =>
lang('Enabled'),
+ 'lang_select' =>
lang('Select')
);
$alarm['values'] =
$boalarm->read_alarms($data['alarm_type'],$data['id'],$data['text']);
@@ -935,10 +916,10 @@
if($data['type']=='form')
{
$alarm['alter_alarm'][] = array
- (
- 'lang_enable' =>
lang('Enable'),
- 'lang_disable' =>
lang('Disable'),
- 'lang_delete' =>
lang('Delete')
+ (
+ 'lang_enable' =>
lang('Enable'),
+ 'lang_disable' =>
lang('Disable'),
+ 'lang_delete' =>
lang('Delete')
);
for ($i=1; $i<=31; $i++)
@@ -973,7 +954,7 @@
}
-//_debug_array($alarm['values']);
+ //_debug_array($alarm['values']);
return $alarm;
}
@@ -1130,10 +1111,10 @@
$d=strpos($dateformat,'d');
$m=strpos($dateformat,'m');
- $dateparts = explode('/',
$values_attribute[$i]['value']);
- $day = $dateparts[$d];
- $month = $dateparts[$m];
- $year = $dateparts[$y];
+ $dateparts = explode('/',
$values_attribute[$i]['value']);
+ $day = $dateparts[$d];
+ $month = $dateparts[$m];
+ $year = $dateparts[$y];
$values_attribute[$i]['value'] =
date($this->dateformat,mktime(2,0,0,$month,$day,$year));
}
}
@@ -1141,58 +1122,6 @@
$this->socommon->save_attributes($values_attribute,$type);
}
- 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 add_leading_zero($num,$id_type='')
{
if ($id_type == "hex")
@@ -1243,7 +1172,7 @@
function generate_sql($data)
{
-//_debug_array($data);
+ //_debug_array($data);
$cols =
(isset($data['cols'])?$data['cols']:'');
$entity_table =
(isset($data['entity_table'])?$data['entity_table']:'');
@@ -1317,7 +1246,7 @@
}
}
-*/
+ */
unset($soadmin_location);
for ($i=0; $i< $this->type_id; $i++)
@@ -1329,10 +1258,10 @@
{
$cols_return[] =
'loc1_name';
$cols_extra[] =
'loc1_name';
- $uicols['input_type'][] =
'text';
+ $uicols['input_type'][] = 'text';
$uicols['name'][] =
'loc1_name';
$uicols['descr'][] =
lang('Property Name');
- $uicols['statustext'][] =
lang('Property Name');
+ $uicols['statustext'][] =
lang('Property Name');
$uicols['exchange'][] = true;
$uicols['align'][] = '';
$uicols['datatype'][] = '';
@@ -1341,8 +1270,8 @@
{
$cols_return_lookup[] = 'loc'
. $i . '_name';
$uicols['input_type'][] =
'hidden';
- $uicols['name'][] = 'loc'
. $i . '_name';
- $uicols['descr'][] = '';
+ $uicols['name'][]
= 'loc' . $i . '_name';
+ $uicols['descr'][]
= '';
$uicols['statustext'][] = '';
$uicols['exchange'][] = true;
$uicols['align'][]
= '';
@@ -1437,9 +1366,9 @@
}
}
- $this->uicols = $uicols;
- $this->cols_return = $cols_return;
- $this->cols_extra = $cols_extra;
+ $this->uicols = $uicols;
+ $this->cols_return = $cols_return;
+ $this->cols_extra = $cols_extra;
$this->cols_return_lookup = $cols_return_lookup;
$from = " FROM $paranthesis $entity_table ";
@@ -1454,41 +1383,41 @@
{
switch($format)
{
- case 'select':
-
$GLOBALS['phpgw']->xslttpl->add_file(array('select_part_of_town'));
- break;
- case 'filter':
-
$GLOBALS['phpgw']->xslttpl->add_file(array('filter_part_of_town'));
- break;
+ case 'select':
+
$GLOBALS['phpgw']->xslttpl->add_file(array('select_part_of_town'));
+ break;
+ case 'filter':
+
$GLOBALS['phpgw']->xslttpl->add_file(array('filter_part_of_town'));
+ break;
}
$parts=
$this->socommon->select_part_of_town($district_id);
$part_of_town_list = array();
//address@hidden 09/09/08 validate for YUI.
if(is_array($parts)&& (count($parts))){
- foreach($parts as $entry)
- {
- if ($entry['id']==$selected)
+ foreach($parts as $entry)
{
- $part_of_town_list[] = array
- (
- 'id' =>
$entry['id'],
- 'name' =>
$entry['name'],
- 'district_id' =>
$entry['district_id'],
- 'selected' =>
'selected'
- );
+ if ($entry['id']==$selected)
+ {
+ $part_of_town_list[] = array
+ (
+ 'id'
=> $entry['id'],
+ 'name'
=> $entry['name'],
+ 'district_id'
=> $entry['district_id'],
+ 'selected'
=> 'selected'
+ );
+ }
+ else
+ {
+ $part_of_town_list[] = array
+ (
+ 'id'
=> $entry['id'],
+ 'name'
=> $entry['name'],
+ 'district_id'
=> $entry['district_id'],
+ );
+ }
}
- else
- {
- $part_of_town_list[] = array
- (
- 'id' =>
$entry['id'],
- 'name' =>
$entry['name'],
- 'district_id' =>
$entry['district_id'],
- );
- }
}
- }
return $part_of_town_list;
}
@@ -1497,12 +1426,12 @@
{
switch($format)
{
- case 'select':
-
$GLOBALS['phpgw']->xslttpl->add_file(array('select_district'));
- break;
- case 'filter':
-
$GLOBALS['phpgw']->xslttpl->add_file(array('filter_district'));
- break;
+ case 'select':
+
$GLOBALS['phpgw']->xslttpl->add_file(array('select_district'));
+ break;
+ case 'filter':
+
$GLOBALS['phpgw']->xslttpl->add_file(array('filter_district'));
+ break;
}
$districts= $this->socommon->select_district_list();
@@ -1515,12 +1444,12 @@
{
switch($data['format'])
{
- case 'select':
-
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_select'));
- break;
- case 'filter':
-
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_filter'));
- break;
+ case 'select':
+
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_select'));
+ break;
+ case 'filter':
+
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_filter'));
+ break;
}
$sogeneric = CreateObject('property.sogeneric');
@@ -1573,9 +1502,9 @@
}
/**
- * Clear all content from cache
- *
- */
+ * Clear all content from cache
+ *
+ */
function reset_fm_cache()
{
@@ -1583,10 +1512,10 @@
}
/**
- * Clear computed userlist for location and rights from cache
- *
- * @return integer number of values was found and cleared
- */
+ * Clear computed userlist for location and rights from cache
+ *
+ * @return integer number of values was found and cleared
+ */
function reset_fm_cache_userlist()
{
@@ -1606,10 +1535,10 @@
foreach( $custom->datatype_text as $key => $name)
{
$datatypes[] = array
- (
- 'id' => $key,
- 'name' => $name,
- );
+ (
+ 'id' => $key,
+ 'name' => $name,
+ );
}
return $this->select_list($selected,$datatypes);
@@ -1626,13 +1555,13 @@
}
/**
- * Choose which download format to use - and call the
appropriate function
- *
- * @param array $list array with data to export
- * @param array $name array containing keys in $list
- * @param array $descr array containing Names for the heading of
the output for the coresponding keys in $list
- * @param array $input_type array containing information whether
fields are to be suppressed from the output
- */
+ * Choose which download format to use - and call the
appropriate function
+ *
+ * @param array $list array with data to export
+ * @param array $name array containing keys in $list
+ * @param array $descr array containing Names for the heading
of the output for the coresponding keys in $list
+ * @param array $input_type array containing information
whether fields are to be suppressed from the output
+ */
function download($list,$name,$descr,$input_type=array())
{
set_time_limit(500);
@@ -1644,29 +1573,29 @@
switch ($export_format)
{
- case 'csv':
-
$this->csv_out($list,$name,$descr,$input_type);
- break;
- case 'excel':
-
$this->excel_out($list,$name,$descr,$input_type);
- break;
- case 'ods':
-
$this->ods_out($list,$name,$descr,$input_type);
- break;
+ case 'csv':
+ $this->csv_out($list,$name,$descr,$input_type);
+ break;
+ case 'excel':
+
$this->excel_out($list,$name,$descr,$input_type);
+ break;
+ case 'ods':
+ $this->ods_out($list,$name,$descr,$input_type);
+ break;
}
}
/**
- * downloads data as MsExcel to the browser
- *
- * @param array $list array with data to export
- * @param array $name array containing keys in $list
- * @param array $descr array containing Names for the heading of
the output for the coresponding keys in $list
- * @param array $input_type array containing information whether
fields are to be suppressed from the output
- */
+ * downloads data as MsExcel to the browser
+ *
+ * @param array $list array with data to export
+ * @param array $name array containing keys in $list
+ * @param array $descr array containing Names for the heading
of the output for the coresponding keys in $list
+ * @param array $input_type array containing information
whether fields are to be suppressed from the output
+ */
function excel_out($list,$name,$descr,$input_type=array())
{
- $filename= str_replace('
','_',$GLOBALS['phpgw_info']['user']['account_lid']).'.xls';
+ $filename= str_replace('
','_',$GLOBALS['phpgw_info']['user']['account_lid']).'.xls';
$workbook = CreateObject('phpgwapi.excel',"-");
$browser = CreateObject('phpgwapi.browser');
@@ -1719,23 +1648,23 @@
}
/**
- * downloads data as CSV to the browser
- *
- * @param array $list array with data to export
- * @param array $name array containing keys in $list
- * @param array $descr array containing Names for the heading of
the output for the coresponding keys in $list
- * @param array $input_type array containing information whether
fields are to be suppressed from the output
- */
+ * downloads data as CSV to the browser
+ *
+ * @param array $list array with data to export
+ * @param array $name array containing keys in $list
+ * @param array $descr array containing Names for the heading
of the output for the coresponding keys in $list
+ * @param array $input_type array containing information
whether fields are to be suppressed from the output
+ */
function csv_out($list, $name, $descr, $input_type = array() )
{
$filename= str_replace('
','_',$GLOBALS['phpgw_info']['user']['account_lid']).'.csv';
$browser = CreateObject('phpgwapi.browser');
$browser->content_header($filename, 'application/csv');
- if ( !$fp = fopen('php://output','w') )
- {
- die('Unable to write to "php://output" - pleace
notify the Administrator');
- }
+ if ( !$fp = fopen('php://output','w') )
+ {
+ die('Unable to write to "php://output" - pleace
notify the Administrator');
+ }
$count_uicols_name=count($name);
@@ -1768,13 +1697,13 @@
fclose($fp);
}
/**
- * downloads data as ODS to the browser
- *
- * @param array $list array with data to export
- * @param array $name array containing keys in $list
- * @param array $descr array containing Names for the heading of
the output for the coresponding keys in $list
- * @param array $input_type array containing information whether
fields are to be suppressed from the output
- */
+ * downloads data as ODS to the browser
+ *
+ * @param array $list array with data to export
+ * @param array $name array containing keys in $list
+ * @param array $descr array containing Names for the heading
of the output for the coresponding keys in $list
+ * @param array $input_type array containing information
whether fields are to be suppressed from the output
+ */
function ods_out($list, $name, $descr, $input_type = array() )
{
$filename= str_replace('
','_',$GLOBALS['phpgw_info']['user']['account_lid']).'.ods';
@@ -1838,31 +1767,30 @@
function get_origin_link($type)
{
- if($type=='tts'):
+ if($type=='tts')
{
$link = array('menuaction' =>
'property.uitts.view');
}
- elseif($type=='request'):
+ else if($type=='request')
{
$link = array('menuaction' =>
'property.uirequest.view');
}
- elseif($type=='project'):
+ else if($type=='project')
{
$link = array('menuaction' =>
'property.uiproject.view');
}
- elseif(substr($type,0,6)=='entity'):
+ else if(substr($type,0,6)=='entity')
{
$type = explode("_",$type);
$entity_id = $type[1];
$cat_id = $type[2];
$link = array
- (
- 'menuaction' =>
'property.uientity.view',
- 'entity_id' => $entity_id,
- 'cat_id' => $cat_id
- );
+ (
+ 'menuaction' =>
'property.uientity.view',
+ 'entity_id' => $entity_id,
+ 'cat_id' => $cat_id
+ );
}
- endif;
return (isset($link)?$link:'');
}
@@ -1878,13 +1806,13 @@
}
/**
- * Preserve attribute values from post in case of an error
- *
- * @param array $values value set with
- * @param array $values_attributes attribute definitions and
values from posting
- *
- * @return array attribute definitions and values
- */
+ * Preserve attribute values from post in case of an error
+ *
+ * @param array $values value set with
+ * @param array $values_attributes attribute definitions and
values from posting
+ *
+ * @return array attribute definitions and values
+ */
public function preserve_attribute_values($values,
$values_attributes)
{
@@ -1946,11 +1874,11 @@
}
/**
- * Converts utf-8 to ascii
- *
- * @param string $text string
- * @return string ascii encoded
- */
+ * Converts utf-8 to ascii
+ *
+ * @param string $text string
+ * @return string ascii encoded
+ */
function utf2ascii($text = '')
{
if(!isset($GLOBALS['phpgw_info']['server']['charset'])
|| $GLOBALS['phpgw_info']['server']['charset']=='utf-8')
@@ -1971,11 +1899,11 @@
}
/**
- * Converts ascii to utf-8
- *
- * @param string $text string
- * @return string utf-8 encoded
- */
+ * Converts ascii to utf-8
+ *
+ * @param string $text string
+ * @return string utf-8 encoded
+ */
function ascii2utf($text = '')
{
if(!isset($GLOBALS['phpgw_info']['server']['charset'])
|| $GLOBALS['phpgw_info']['server']['charset']=='utf-8')
@@ -1989,12 +1917,12 @@
}
/**
- * Collects locationdata from location form and appends to values
- *
- * @param array $values array with data fom post
- * @param array $insert_record array containing fields to
collect from post
- * @return updated values
- */
+ * Collects locationdata from location form and appends to
values
+ *
+ * @param array $values array with data fom post
+ * @param array $insert_record array containing fields to
collect from post
+ * @return updated values
+ */
function collect_locationdata($values = '',$insert_record = '')
{
if($insert_record)
@@ -2087,10 +2015,10 @@
$msgbox_data = $this->msgbox_data($receipt);
$data = array
- (
- 'msgbox_data' =>
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
- 'menu' => $this->get_menu(),
- );
+ (
+ 'msgbox_data' =>
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
+ 'menu' =>
$this->get_menu(),
+ );
$appname = lang('No access');
@@ -2099,12 +2027,12 @@
}
/**
- * Get list of accessible physical locations for current user
- *
- * @param integer $required Right the user has to be granted at
location
- *
- * @return array $access_location list of accessible physical
locations
- */
+ * Get list of accessible physical locations for current user
+ *
+ * @param integer $required Right the user has to be granted at
location
+ *
+ * @return array $access_location list of accessible physical
locations
+ */
public function get_location_list($required)
{
return $this->socommon->get_location_list($required);
@@ -2150,7 +2078,7 @@
}
return $split_values;
}
-
+
public function make_menu_user($array,$id_buttons,$name_hidden)
{
$split_values = array ();
@@ -2160,7 +2088,7 @@
}
return $split_values;
}
-
+
public function choose_select($array, $index_return)
{
foreach ($array as $value)
@@ -2175,19 +2103,19 @@
}
/**
- * pending action for items across the system.
- *
- * @param array $data array containing string 'appname'
- the name of the module being looked up
- *
string 'location' - the location within
the module to look up
- *
integer 'id' - id of the referenced
item - could possibly be a bigint
- *
integer 'responsible' - the user_id asked for approval
- *
string 'responsible_type' - what type of responsible is asked
for action (user,vendor or tenant)
- *
string 'action' - what type of action
is pending
- *
string 'remark' - a general remark - if
any
- *
integer 'deadline' - unix timestamp if any
deadline is given.
- *
- * @return integer $reminder number of request for this action
- */
+ * pending action for items across the system.
+ *
+ * @param array $data array containing string 'appname'
- the name of the module being looked up
+ *
string 'location' - the location within
the module to look up
+ *
integer 'id' - id of the referenced
item - could possibly be a bigint
+ *
integer 'responsible' - the user_id asked for approval
+ *
string 'responsible_type' - what type of responsible is asked
for action (user,vendor or tenant)
+ *
string 'action' - what type of action
is pending
+ *
string 'remark' - a general remark - if
any
+ *
integer 'deadline' - unix timestamp if any
deadline is given.
+ *
+ * @return integer $reminder number of request for this action
+ */
public function set_pending_action($action_params)
{
@@ -2203,11 +2131,11 @@
foreach ($values['cat_list'] as $category)
{
$ret[] = array
- (
- 'id' => $category['cat_id'],
- 'name' => $category['name'],
- 'selected' =>
$category['selected'] ? 1 : 0
- );
+ (
+ 'id' =>
$category['cat_id'],
+ 'name' =>
$category['name'],
+ 'selected' =>
$category['selected'] ? 1 : 0
+ );
}
return $ret;
}
Modified: trunk/property/inc/class.bocustom.inc.php
===================================================================
--- trunk/property/inc/class.bocustom.inc.php 2010-12-24 15:00:54 UTC (rev
6700)
+++ trunk/property/inc/class.bocustom.inc.php 2010-12-25 10:51:59 UTC (rev
6701)
@@ -42,17 +42,16 @@
var $cat_id;
var $public_functions = array
- (
- 'read' => true,
- 'read_single' => true,
- 'save' => true,
- 'delete' => true,
- 'check_perms' => true
- );
+ (
+ 'read' => true,
+ 'read_single' => true,
+ 'save' => true,
+ 'delete' => true,
+ 'check_perms' => true
+ );
function property_bocustom($session=false)
{
- // $this->currentapp =
$GLOBALS['phpgw_info']['flags']['currentapp'];
$this->so = CreateObject('property.socustom');
if ($session)
@@ -61,13 +60,13 @@
$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');
+ $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)
{
@@ -138,7 +137,7 @@
function read()
{
$custom = $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));
+ 'filter' => $this->filter,'cat_id' =>
$this->cat_id,'allrows'=>$this->allrows));
$this->total_records = $this->so->total_records;
for ($i=0; $i<count($custom); $i++)
@@ -201,11 +200,10 @@
$this->allrows=$allrows;
}
$custom = $this->so->read_custom(array('start' =>
$this->start,'query' => $this->query,'sort' => $this->sort,'order' =>
$this->order,
-
'filter' => $this->filter,'custom_id' =>
$custom_id,'allrows'=>$this->allrows));
+ 'filter' => $this->filter,'custom_id' =>
$custom_id,'allrows'=>$this->allrows));
$this->uicols = $this->so->uicols;
$this->total_records = $this->so->total_records;
return $custom;
}
}
-
Modified: trunk/property/inc/class.bodocument.inc.php
===================================================================
--- trunk/property/inc/class.bodocument.inc.php 2010-12-24 15:00:54 UTC (rev
6700)
+++ trunk/property/inc/class.bodocument.inc.php 2010-12-25 10:51:59 UTC (rev
6701)
@@ -46,13 +46,13 @@
var $allrows;
var $public_functions = array
- (
- 'read' => true,
- 'read_single' => true,
- 'save' => true,
- 'delete' => true,
- 'check_perms' => true
- );
+ (
+ 'read' => true,
+ 'read_single' => true,
+ 'save' => true,
+ 'delete' => true,
+ 'check_perms' => true
+ );
function property_bodocument($session=false)
{
@@ -60,7 +60,7 @@
$this->bocommon =
CreateObject('property.bocommon');
$this->solocation =
CreateObject('property.solocation');
$this->historylog =
CreateObject('property.historylog','document');
- $this->contacts = CreateObject('property.sogeneric');
+ $this->contacts =
CreateObject('property.sogeneric');
$this->contacts->get_location_info('vendor',false);
$this->cats = &
$this->so->cats;
$this->bofiles =
CreateObject('property.bofiles');
@@ -71,17 +71,17 @@
$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');
- $status_id = phpgw::get_var('status_id');
- $entity_id = phpgw::get_var('entity_id',
'int');
- $doc_type = phpgw::get_var('doc_type');
- $query_location = phpgw::get_var('query_location');
- $allrows = phpgw::get_var('allrows',
'bool');
+ $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');
+ $status_id =
phpgw::get_var('status_id');
+ $entity_id =
phpgw::get_var('entity_id', 'int');
+ $doc_type =
phpgw::get_var('doc_type');
+ $query_location =
phpgw::get_var('query_location');
+ $allrows =
phpgw::get_var('allrows', 'bool');
$this->start = $start ? $start : 0;
$this->query = isset($query) ?
$query : '';
@@ -116,7 +116,7 @@
$this->sort = $data['sort'];
$this->order = $data['order'];
$this->cat_id = $data['cat_id'];
- // $this->entity_id = $data['entity_id'];
+// $this->entity_id = $data['entity_id'];
$this->doc_type = $data['doc_type'];
$this->query_location = $data['query_location'];
}
@@ -125,12 +125,12 @@
{
switch($format)
{
- case 'select':
-
$GLOBALS['phpgw']->xslttpl->add_file(array('status_select'));
- break;
- case 'filter':
-
$GLOBALS['phpgw']->xslttpl->add_file(array('status_filter'));
- break;
+ case 'select':
+
$GLOBALS['phpgw']->xslttpl->add_file(array('status_select'));
+ break;
+ case 'filter':
+
$GLOBALS['phpgw']->xslttpl->add_file(array('status_filter'));
+ break;
}
$status_entries= $this->so->select_status_list();
@@ -146,7 +146,7 @@
function read()
{
$documents = $this->so->read(array('start' =>
$this->start,'query' => $this->query,'sort' => $this->sort,'order' =>
$this->order,
-
'filter' => $this->filter,'cat_id' => $this->cat_id,'entity_id' =>
$this->entity_id,'doc_type'=>$this->doc_type));
+ 'filter' => $this->filter,'cat_id' =>
$this->cat_id,'entity_id' => $this->entity_id,'doc_type'=>$this->doc_type));
$this->total_records = $this->so->total_records;
$this->uicols = $this->so->uicols;
@@ -190,13 +190,13 @@
$use_svn = false;
if(ereg('svn[s:][:/]/',
$GLOBALS['phpgw_info']['server']['files_dir']))
{
- // $use_svn = true;
+ // $use_svn = true;
}
$document = $this->so->read_at_location(array('start'
=> $this->start,'query' => $this->query,'sort' => $this->sort,'order' =>
$this->order,
-
'filter' => $this->filter,'cat_id' => $this->cat_id,'entity_id' =>
$this->entity_id,
-
'location_code' => $location_code,'doc_type'=>$this->doc_type,
'allrows' => $this->allrows));
+ 'filter' => $this->filter,'cat_id' =>
$this->cat_id,'entity_id' => $this->entity_id,
+ 'location_code' =>
$location_code,'doc_type'=>$this->doc_type, 'allrows' => $this->allrows));
$this->total_records = $this->so->total_records;
$dateformat =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
@@ -290,29 +290,29 @@
switch ($value['status'])
{
- case 'R': $type = lang('Re-opened');
break;
- case 'X': $type = lang('Closed');
break;
- case 'O': $type = lang('Opened');
break;
- case 'A': $type = lang('Re-assigned');
break;
- case 'P': $type = lang('Priority
changed'); break;
- case 'CO': $type = lang('Initial
Coordinator'); break;
- case 'C': $type = lang('Coordinator
changed'); break;
- case 'TO': $type = lang('Initial
Category'); break;
- case 'T': $type = lang('Category
changed'); break;
- case 'SO': $type = lang('Initial
Status'); break;
- case 'S': $type = lang('Status
changed'); break;
- case 'FO': $type = lang('Initial
File'); break;
- case 'F': $type = lang('File changed');
break;
- case 'LO': $type = lang('Initial
Link'); break;
- case 'L': $type = lang('Link changed');
break;
- default: break;
+ case 'R': $type = lang('Re-opened'); break;
+ case 'X': $type = lang('Closed'); break;
+ case 'O': $type = lang('Opened'); break;
+ case 'A': $type = lang('Re-assigned'); break;
+ case 'P': $type = lang('Priority changed');
break;
+ case 'CO': $type = lang('Initial Coordinator');
break;
+ case 'C': $type = lang('Coordinator changed');
break;
+ case 'TO': $type = lang('Initial Category');
break;
+ case 'T': $type = lang('Category changed');
break;
+ case 'SO': $type = lang('Initial Status');
break;
+ case 'S': $type = lang('Status changed'); break;
+ case 'FO': $type = lang('Initial File'); break;
+ case 'F': $type = lang('File changed'); break;
+ case 'LO': $type = lang('Initial Link'); break;
+ case 'L': $type = lang('Link changed'); break;
+ default: break;
}
if($value['new_value']=='O'){$value['new_value']=lang('Opened');}
-
if($value['new_value']=='X'){$value['new_value']=lang('Closed');}
+
if($value['new_value']=='X'){$value['new_value']=lang('Closed');}
- $record_history[$i]['value_action'] =
$type?$type:'';
+
$record_history[$i]['value_action'] = $type?$type:'';
unset($type);
if ($value['status'] == 'A')
@@ -372,17 +372,17 @@
}
if($this->bofiles->vfs->file_exists(array(
- 'string' => $file,
- 'relatives' => Array(RELATIVE_NONE)
- )))
+ 'string' => $file,
+ 'relatives' => Array(RELATIVE_NONE)
+ )))
{
if($get_journal)
{
return
$this->bofiles->vfs->get_journal(array(
- 'string' => $file,
- 'relatives' =>
Array(RELATIVE_NONE)
- ));
+ 'string' => $file,
+ 'relatives' =>
Array(RELATIVE_NONE)
+ ));
}
else
{
@@ -398,7 +398,7 @@
$document_date =
phpgwapi_datetime::date_array($values['document_date']);
$values['document_date'] = mktime
(2,0,0,$document_date['month'],$document_date['day'],$document_date['year']);
-//_debug_array($values);
+ //_debug_array($values);
if ($values['document_id'])
{
if ($values['document_id'] != 0)
@@ -418,4 +418,3 @@
$this->so->delete($document_id);
}
}
-
Modified: trunk/property/inc/class.boentity.inc.php
===================================================================
--- trunk/property/inc/class.boentity.inc.php 2010-12-24 15:00:54 UTC (rev
6700)
+++ trunk/property/inc/class.boentity.inc.php 2010-12-25 10:51:59 UTC (rev
6701)
@@ -45,38 +45,19 @@
var $location_code;
/**
- * @var object $custom reference to custom fields object
- */
+ * @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
- );
+ (
+ '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()
- )
- );
-
var $type_app = array();
var $type;
@@ -108,7 +89,7 @@
$this->type
= isset($type) && $type && $this->type_app[$type] ? $type : 'entity';
$this->location_code =
isset($location_code) && $location_code ? $location_code : '';
-
+
$this->soadmin_entity =
CreateObject('property.soadmin_entity',$entity_id,$cat_id);
$this->custom = &
$this->so->custom;
$this->soadmin_entity->type = $this->type;
@@ -188,7 +169,7 @@
function read_sessiondata()
{
$data =
$GLOBALS['phpgw']->session->appsession('session_data',$this->category_dir);
-//_debug_array($data);
+ //_debug_array($data);
$this->start =
isset($data['start'])?$data['start']:'';
$this->query =
isset($data['query'])?$data['query']:'';
$this->filter =
isset($data['filter'])?$data['filter']:'';
@@ -199,7 +180,7 @@
$this->start_date =
isset($data['start_date'])?$data['start_date']:'';
$this->end_date =
isset($data['end_date'])?$data['end_date']:'';
$this->criteria_id =
isset($data['criteria_id'])?$data['criteria_id']:'';
-
+
//$this->allrows = $data['allrows'];
}
@@ -219,12 +200,12 @@
{
switch($format)
{
- case 'select':
-
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_select'));
- break;
- case 'filter':
-
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_filter'));
- break;
+ case 'select':
+
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_select'));
+ break;
+ case 'filter':
+
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_filter'));
+ break;
}
$categories=
$this->soadmin_entity->read_category(array('allrows'=>true,'entity_id'=>$this->entity_id,
'required' => $required));
@@ -237,12 +218,12 @@
{
switch($format)
{
- case 'select':
-
$GLOBALS['phpgw']->xslttpl->add_file(array('status_select'));
- break;
- case 'filter':
-
$GLOBALS['phpgw']->xslttpl->add_file(array('status_filter'));
- break;
+ case 'select':
+
$GLOBALS['phpgw']->xslttpl->add_file(array('status_select'));
+ break;
+ case 'filter':
+
$GLOBALS['phpgw']->xslttpl->add_file(array('status_filter'));
+ break;
}
$status_entries=
$this->so->select_status_list($this->entity_id,$this->cat_id);
@@ -253,23 +234,23 @@
function get_criteria_list($selected='')
{
$criteria = array
- (
- array
(
- 'id' => 'vendor',
- 'name' => lang('vendor')
- ),
- array
- (
- 'id' => 'ab',
- 'name' => lang('contact')
- ),
- array
- (
- 'id' => 'abo',
- 'name' => lang('organisation')
- )
- );
+ array
+ (
+ 'id' => 'vendor',
+ 'name' => lang('vendor')
+ ),
+ array
+ (
+ 'id' => 'ab',
+ 'name' => lang('contact')
+ ),
+ array
+ (
+ 'id' => 'abo',
+ 'name' => lang('organisation')
+ )
+ );
return
$this->bocommon->select_list($selected,$criteria);
}
@@ -281,21 +262,21 @@
}
$entity = $this->so->read(array('start' =>
$this->start,'query' => $this->query,'sort' => $this->sort,'order' =>
$this->order,
-
'filter' => $this->filter,'cat_id' => $this->cat_id,'district_id' =>
$this->district_id,
-
'lookup'=>isset($data['lookup'])?$data['lookup']:'','allrows'=>isset($data['allrows'])?$data['allrows']:'',
-
'entity_id'=>$this->entity_id,'cat_id'=>$this->cat_id,'status'=>$this->status,
-
'start_date'=>$this->bocommon->date_to_timestamp($data['start_date']),
-
'end_date'=>$this->bocommon->date_to_timestamp($data['end_date']),
-
'dry_run'=>$data['dry_run'], 'type'=>$data['type'], 'location_code' =>
$this->location_code,
-
'criteria_id' => $this->criteria_id));
+ 'filter' => $this->filter,'cat_id' =>
$this->cat_id,'district_id' => $this->district_id,
+
'lookup'=>isset($data['lookup'])?$data['lookup']:'','allrows'=>isset($data['allrows'])?$data['allrows']:'',
+
'entity_id'=>$this->entity_id,'cat_id'=>$this->cat_id,'status'=>$this->status,
+
'start_date'=>$this->bocommon->date_to_timestamp($data['start_date']),
+
'end_date'=>$this->bocommon->date_to_timestamp($data['end_date']),
+ 'dry_run'=>$data['dry_run'],
'type'=>$data['type'], 'location_code' => $this->location_code,
+ 'criteria_id' => $this->criteria_id));
$this->total_records = $this->so->total_records;
$this->uicols = $this->so->uicols;
$cols_extra = $this->so->cols_extra;
$cols_return_lookup =
$this->so->cols_return_lookup;
-//_debug_array($entity);
-//_debug_array($cols_extra);
-//_debug_array($cols_return_lookup);
+ //_debug_array($entity);
+ //_debug_array($cols_extra);
+ //_debug_array($cols_return_lookup);
if(isset($data['lookup']) && $data['lookup'])
{
@@ -329,7 +310,7 @@
}
$values = $this->custom->prepare($values,
$this->type_app[$this->type],".{$this->type}.{$data['entity_id']}.{$data['cat_id']}",
$data['view']);
- // $soadmin_entity =
CreateObject('property.soadmin_entity');
+ // $soadmin_entity =
CreateObject('property.soadmin_entity');
if($values['location_code'])
{
@@ -355,7 +336,7 @@
$vfs = CreateObject('phpgwapi.vfs');
$vfs->override_acl = 1;
-
+
$loc1 = isset($values['location_data']['loc1']) &&
$values['location_data']['loc1'] ? $values['location_data']['loc1'] : 'dummy';
if($this->type_app[$this->type] == 'catch')
@@ -364,8 +345,8 @@
}
$files = $vfs->ls (array(
- 'string' =>
"/property/{$this->category_dir}/{$loc1}/{$data['id']}",
- 'relatives' => array(RELATIVE_NONE)));
+ 'string' =>
"/property/{$this->category_dir}/{$loc1}/{$data['id']}",
+ 'relatives' => array(RELATIVE_NONE)));
$vfs->override_acl = 0;
@@ -376,19 +357,19 @@
if (strpos($file['name'], 'jasper::')===0)//
check for jasper
{
$values['jasperfiles'][] = array
- (
- 'name' => $file['name']
- );
+ (
+ 'name' =>
$file['name']
+ );
}
else
{
$values['files'][] = array
- (
- 'name' => $file['name']
- );
+ (
+ 'name' =>
$file['name']
+ );
}
}
-
+
$interlink = CreateObject('property.interlink');
$values['origin'] =
$interlink->get_relation($this->type_app[$this->type],
".{$this->type}.{$data['entity_id']}.{$data['cat_id']}", $data['id'], 'origin');
$values['target'] =
$interlink->get_relation($this->type_app[$this->type],
".{$this->type}.{$data['entity_id']}.{$data['cat_id']}", $data['id'], 'target');
@@ -396,13 +377,13 @@
}
/**
- * 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
- */
+ * 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())
{
@@ -438,11 +419,11 @@
}
$criteria = array
- (
- 'appname' => $this->type_app[$this->type],
- 'location' =>
".{$this->type}.{$entity_id}.{$cat_id}",
- 'allrows' => true
- );
+ (
+ 'appname' =>
$this->type_app[$this->type],
+ 'location' =>
".{$this->type}.{$entity_id}.{$cat_id}",
+ 'allrows' => true
+ );
$custom_functions =
$GLOBALS['phpgw']->custom_functions->find($criteria);
@@ -482,48 +463,48 @@
{
switch($acl_location)
{
- case '.project.request':
- $history_type ='request';
- break;
- case '.project.workorder':
- $history_type ='workorder';
- break;
- case '.project':
- $history_type ='project';
- break;
- case '.tts':
- $history_type ='tts';
- break;
- case '.document':
- $history_type ='document';
- break;
- case 'entity':
- $this->table='fm_entity_history';
- $this->attrib_id_field =
',history_attrib_id';
- break;
- case '.s_agreement':
- $history_type ='s_agreement';
- break;
- case '.s_agreement.detail':
- $history_type ='s_agreement';
- default:
- $history_type =
str_replace('.','_',substr($acl_location,-strlen($acl_location)+1));
+ case '.project.request':
+ $history_type ='request';
+ break;
+ case '.project.workorder':
+ $history_type ='workorder';
+ break;
+ case '.project':
+ $history_type ='project';
+ break;
+ case '.tts':
+ $history_type ='tts';
+ break;
+ case '.document':
+ $history_type ='document';
+ break;
+ case 'entity':
+ $this->table='fm_entity_history';
+ $this->attrib_id_field = ',history_attrib_id';
+ break;
+ case '.s_agreement':
+ $history_type ='s_agreement';
+ break;
+ case '.s_agreement.detail':
+ $history_type ='s_agreement';
+ default:
+ $history_type =
str_replace('.','_',substr($acl_location,-strlen($acl_location)+1));
}
if(!$history_type)
{
- throw new Exception(lang('Unknown
history type for acl_location: %1', $acl_location));
+ throw new Exception(lang('Unknown history type
for acl_location: %1', $acl_location));
}
return $history_type;
}
-
+
function read_attrib_history($data)
{
- // _debug_array($data);
+ // _debug_array($data);
$history_type =
$this->get_history_type_for_location($data['acl_location']);
$historylog =
CreateObject('property.historylog',$history_type);
$history_values =
$historylog->return_array(array(),array('SO'),'history_timestamp','ASC',$data['id'],$data['attrib_id'],
$data['detail_id']);
$this->total_records = count($history_values);
- // _debug_array($history_values);
+ // _debug_array($history_values);
return $history_values;
}
@@ -541,7 +522,7 @@
function read_entity_to_link($data)
{
- return $this->so->read_entity_to_link($data);
+ return $this->so->read_entity_to_link($data);
}
}
Modified: trunk/property/inc/class.boevent.inc.php
===================================================================
--- trunk/property/inc/class.boevent.inc.php 2010-12-24 15:00:54 UTC (rev
6700)
+++ trunk/property/inc/class.boevent.inc.php 2010-12-25 10:51:59 UTC (rev
6701)
@@ -32,27 +32,27 @@
*/
phpgw::import_class('phpgwapi.datetime');
-if ( !extension_loaded('mcal') )
-{
- define('MCAL_RECUR_NONE',0);
- define('MCAL_RECUR_DAILY',1);
- define('MCAL_RECUR_WEEKLY',2);
- define('MCAL_RECUR_MONTHLY_MDAY',3);
- define('MCAL_RECUR_MONTHLY_WDAY',4);
- define('MCAL_RECUR_YEARLY',5);
+ if ( !extension_loaded('mcal') )
+ {
+ define('MCAL_RECUR_NONE',0);
+ define('MCAL_RECUR_DAILY',1);
+ define('MCAL_RECUR_WEEKLY',2);
+ define('MCAL_RECUR_MONTHLY_MDAY',3);
+ define('MCAL_RECUR_MONTHLY_WDAY',4);
+ define('MCAL_RECUR_YEARLY',5);
- define('MCAL_M_SUNDAY',1);
- define('MCAL_M_MONDAY',2);
- define('MCAL_M_TUESDAY',4);
- define('MCAL_M_WEDNESDAY',8);
- define('MCAL_M_THURSDAY',16);
- define('MCAL_M_FRIDAY',32);
- define('MCAL_M_SATURDAY',64);
+ define('MCAL_M_SUNDAY',1);
+ define('MCAL_M_MONDAY',2);
+ define('MCAL_M_TUESDAY',4);
+ define('MCAL_M_WEDNESDAY',8);
+ define('MCAL_M_THURSDAY',16);
+ define('MCAL_M_FRIDAY',32);
+ define('MCAL_M_SATURDAY',64);
- define('MCAL_M_WEEKDAYS',62);
- define('MCAL_M_WEEKEND',65);
- define('MCAL_M_ALLDAYS',127);
-}
+ define('MCAL_M_WEEKDAYS',62);
+ define('MCAL_M_WEEKEND',65);
+ define('MCAL_M_ALLDAYS',127);
+ }
/**
* Description
@@ -70,22 +70,21 @@
var $location_info = array();
var $cached_events;
protected $event_functions = array
- (
- 'send_sms' => 'send SMS'
- );
+ (
+ 'send_sms' => 'send SMS'
+ );
var $public_functions = array
- (
- 'event_schedule_data' => true,
- 'event_schedule_week_data' => true
- );
+ (
+ 'event_schedule_data' => true,
+ 'event_schedule_week_data' => true
+ );
-
+
function __construct($session=false)
{
$this->so =
CreateObject('property.soevent');
$this->custom =
CreateObject('property.custom_fields');//& $this->so->custom;
- // $this->bocommon =
CreateObject('property.bocommon');
$this->sbox = CreateObject('phpgwapi.sbox');
$this->asyncservice =
CreateObject('phpgwapi.asyncservice');
@@ -130,7 +129,7 @@
{
$data =
$GLOBALS['phpgw']->session->appsession('session_data','category');
- // _debug_array($data);
+ // _debug_array($data);
$this->start = $data['start'];
$this->query = $data['query'];
@@ -146,7 +145,7 @@
public function read($dry_run='')
{
$values = $this->so->read(array('start' =>
$this->start,'query' => $this->query,'sort' => $this->sort,'order' =>
$this->order,
-
'allrows'=>$this->allrows, 'location_id' => $this->location_id,
'user_id' => $this->user_id, 'dry_run'=>$dry_run));
+ 'allrows'=>$this->allrows, 'location_id' =>
$this->location_id, 'user_id' => $this->user_id, 'dry_run'=>$dry_run));
static $locations = array();
static $urls = array();
@@ -159,7 +158,7 @@
if($locations[$entry['location_id']])
{
- $location =
$locations[$entry['location_id']];
+ $location =
$locations[$entry['location_id']];
}
else
{
@@ -198,15 +197,15 @@
if($values['rpt_day'])
{
$rpt_day = array
- (
- 1 => 'Sunday',
- 2 => 'Monday',
- 4 => 'Tuesday',
- 8 => 'Wednesday',
- 16 => 'Thursday',
- 32 => 'Friday',
- 64 => 'Saturday'
- );
+ (
+ 1 =>
'Sunday',
+ 2 =>
'Monday',
+ 4 =>
'Tuesday',
+ 8 =>
'Wednesday',
+ 16 =>
'Thursday',
+ 32 =>
'Friday',
+ 64 =>
'Saturday'
+ );
foreach ($rpt_day as $mask => $name)
{
@@ -224,7 +223,7 @@
$values['next'] =
$GLOBALS['phpgw']->common->show_date($job[$job_id]['next'],$dateformat);
}
- // $this->find_scedules($criteria);
+// $this->find_scedules($criteria);
return $values;
}
@@ -253,15 +252,15 @@
$action = $action_object->read_single(array('id'=>
$data['action']),$values = array());
$rpt_day = array
- (
- 1 => 0, //'Sunday',
- 2 => 1, //'Monday',
- 4 => 2, //'Tuesday',
- 8 => 3, //'Wednesday',
- 16 => 4, //'Thursday',
- 32 => 5, //'Friday',
- 64 => 6 //'Saturday'
- );
+ (
+ 1 => 0, //'Sunday',
+ 2 => 1, //'Monday',
+ 4 => 2, //'Tuesday',
+ 8 => 3, //'Wednesday',
+ 16 => 4, //'Thursday',
+ 32 => 5, //'Friday',
+ 64 => 6 //'Saturday'
+ );
$repeat_day = array();
if ($data['repeat_day'])
@@ -285,73 +284,73 @@
$dow = $rpt_day[$data['repeat_day'][0]];
switch($data['repeat_type'])
{
- case '0':
- $times = $data['start_date'];
- break;
- case '1': //'Daily'
- if($data['repeat_interval'])
- {
- $times = array('day' =>
"*/{$data['repeat_interval']}");
- }
- else
- {
- $times = array('day' =>
"*/1");
- }
- break;
- case '2': //'Weekly'
- if($data['repeat_interval'])
- {
- $day =
$data['repeat_interval'] * 7;
- $times = array('day' =>
"*/{$day}");
- }
- else
- {
- $times = array('day' =>
"*/7");
- }
- if ($data['repeat_day'])
- {
- $times['dow'] =
$repeat_day;
- }
- break;
- case '3': //'Monthly (by day)'
- if( !isset($data['repeat_day'])
|| !is_array($data['repeat_day']) )
- {
- $dow = 1;
- }
-
- if($data['repeat_interval'])
- {
- $times = array('month'
=> "*/{$data['repeat_interval']}", 'dow' => $dow);
- }
- else
- {
- $times = array('month'
=> "*/1", 'dow' => $dow);
- }
- break;
- case '4': //'Monthly (by date)'
- if($data['repeat_interval'])
- {
- $times = array('month'
=> "*/{$data['repeat_interval']}", 'day' => 1);
- }
- else
- {
- $times = array('day' =>
1);
- }
- break;
- case '5': //'Yearly'
- $month = date(n,
$data['start_date']);
- if($data['repeat_interval'])
- {
- $times = array('year'
=> "*/{$data['repeat_interval']}", 'month' => $month);
- }
- else
- {
- $times = array('month'
=> $month);
- }
- break;
- default:
- $times = $data['start_date'];
- break;
+ case '0':
+ $times = $data['start_date'];
+ break;
+ case '1': //'Daily'
+ if($data['repeat_interval'])
+ {
+ $times = array('day' =>
"*/{$data['repeat_interval']}");
+ }
+ else
+ {
+ $times = array('day' => "*/1");
+ }
+ break;
+ case '2': //'Weekly'
+ if($data['repeat_interval'])
+ {
+ $day = $data['repeat_interval']
* 7;
+ $times = array('day' =>
"*/{$day}");
+ }
+ else
+ {
+ $times = array('day' => "*/7");
+ }
+ if ($data['repeat_day'])
+ {
+ $times['dow'] = $repeat_day;
+ }
+ break;
+ case '3': //'Monthly (by day)'
+ if( !isset($data['repeat_day']) ||
!is_array($data['repeat_day']) )
+ {
+ $dow = 1;
+ }
+
+ if($data['repeat_interval'])
+ {
+ $times = array('month' =>
"*/{$data['repeat_interval']}", 'dow' => $dow);
+ }
+ else
+ {
+ $times = array('month' =>
"*/1", 'dow' => $dow);
+ }
+ break;
+ case '4': //'Monthly (by date)'
+ if($data['repeat_interval'])
+ {
+ $times = array('month' =>
"*/{$data['repeat_interval']}", 'day' => 1);
+ }
+ else
+ {
+ $times = array('day' => 1);
+ }
+ break;
+ case '5': //'Yearly'
+ $month = date(n, $data['start_date']);
+ if($data['repeat_interval'])
+ {
+ $times = array('year' =>
"*/{$data['repeat_interval']}", 'month' => $month);
+ }
+ else
+ {
+ $times = array('month' =>
$month);
+ }
+ break;
+ default:
+ $times = $data['start_date'];
+ break;
}
}
@@ -360,14 +359,14 @@
$account_id =
execMethod('property.soresponsible.get_responsible_user_id',
$data['responsible']);
$timer_data = array
- (
- 'start' => $data['start_date'],
- 'enabled' => true,
- 'owner' => $account_id,
- 'enabled' => !! $data['enabled'],
- 'action' => $action['action']
- );
-
+ (
+ 'start' => $data['start_date'],
+ 'enabled' => true,
+ 'owner' => $account_id,
+ 'enabled' => !! $data['enabled'],
+ 'action' => $action['action']
+ );
+
if($data['end_date'])
{
$timer_data['end'] = $data['end_date'];
@@ -388,24 +387,19 @@
$this->asyncservice->cancel_timer($id);
$this->asyncservice->set_timer($times, $id,
'property.boevent.action', $timer_data, $account_id);
-
-
-//
-
$event = $this->so->read_single($receipt['id']);
$criteria = array
- (
- 'start_date' => $event['start_date'],
- 'end_date' =>
$event['end_date'],
- 'location_id' =>
$event['location_id'],
- 'location_item_id' =>
$event['location_item_id']
- );
+ (
+ 'start_date' =>
$event['start_date'],
+ 'end_date' =>
$event['end_date'],
+ 'location_id' =>
$event['location_id'],
+ 'location_item_id' =>
$event['location_item_id']
+ );
$this->find_scedules($criteria);
$schedule = $this->cached_events;
$this->so->create_schedule(array('event_id' =>
$receipt['id'], 'schedule' => $schedule));
-//
return $receipt;
}
@@ -450,14 +444,14 @@
public function get_rpt_type_list($selected='')
{
$rpt_type = array
- (
- 0 => 'None',
- 1 => 'Daily',
- 2 => 'Weekly',
- 3 => 'Monthly (by date)',
- 4 => 'Monthly (by day)',
- 5 => 'Yearly'
- );
+ (
+ 0 => 'None',
+ 1 => 'Daily',
+ 2 => 'Weekly',
+ 3 => 'Monthly (by date)',
+ 4 => 'Monthly (by day)',
+ 5 => 'Yearly'
+ );
return $this->sbox->getArrayItem('values[repeat_type]',
$selected, $rpt_type);
@@ -466,15 +460,15 @@
public function get_rpt_day_list($selected=array())
{
$rpt_day = array
- (
- 1 => 'Sunday',
- 2 => 'Monday',
- 4 => 'Tuesday',
- 8 => 'Wednesday',
- 16 => 'Thursday',
- 32 => 'Friday',
- 64 => 'Saturday'
- );
+ (
+ 1 => 'Sunday',
+ 2 => 'Monday',
+ 4 => 'Tuesday',
+ 8 => 'Wednesday',
+ 16 => 'Thursday',
+ 32 => 'Friday',
+ 64 => 'Saturday'
+ );
$title = lang('(for weekly)');
$i = 0; $boxes = '';
@@ -489,11 +483,11 @@
public function get_responsible($selected = '')
{
$responsible = CreateObject('property.soresponsible');
-
+
$location = phpgw::get_var('location');
$values = $responsible->read_type(array('start' => 0,
'query' =>'', 'sort' => '',
-
'order' => '', 'location' => $location, 'allrows'=>true,
-
'filter' => ''));
+ 'order' => '', 'location' => $location,
'allrows'=>true,
+ 'filter' => ''));
$list = array(0 => lang('none'));
foreach($values as $entry)
@@ -509,36 +503,36 @@
/* $action_object =
CreateObject('property.sogeneric');
$action_object->get_location_info('event_action',false);
$values =
$action_object->read(array('allrows'=> true));
-*/
+ */
$list = array(0 => lang('none'));
/*
foreach($values as $entry)
{
$list[$entry['id']] = $entry['name'];
}
-*/
+ */
$list = array_merge($list,$this->event_functions);
return $this->sbox->getArrayItem('values[action]',
$selected, $list, true);
}
-
+
protected function send_sms()
{
$data = array
- (
- 'p_num_text' => 'xxxxxxxx',//number
- 'message' => 'dette er en melding'
- );
+ (
+ 'p_num_text' => 'xxxxxxxx',//number
+ 'message' => 'dette er en
melding'
+ );
execMethod('sms.bosms.send_sms', $data);
}
/**
- * Find recurring events
- *
- * @param array $date the date array to convert, must contain
keys 'start_date', 'end_date', 'appname', 'location'
- * @return array events
- */
+ * Find recurring events
+ *
+ * @param array $date the date array to convert, must contain
keys 'start_date', 'end_date', 'appname', 'location'
+ * @return array events
+ */
function find_scedules($params)
{
@@ -562,7 +556,7 @@
if(!isset($params['location_item_id']) ||
!$params['location_item_id'])
{
- throw new
Exception("property_boevent::find_scedules - Missing location_item_id in
input");
+ throw new
Exception("property_boevent::find_scedules - Missing location_item_id in
input");
}
$location_item_id = $params['location_item_id'];
@@ -587,7 +581,7 @@
echo '<!-- owner_id in
('.implode($owner_id,',').') -->'."\n";
}
}
-
+
if(!$eyear && !$emonth && !$eday)
{
$edate = mktime(23,59,59,$smonth + 1,$sday +
1,$syear);
@@ -616,7 +610,7 @@
}
$edate = mktime(23,59,59,$emonth,$eday,$eyear);
}
-
+
if($this->debug)
{
echo '<!-- Start Date :
'.sprintf("%04d%02d%02d",$syear,$smonth,$sday).' -->'."\n";
@@ -624,23 +618,23 @@
}
$find_criteria = array
- (
- 'syear' => $syear,
- 'smonth' => $smonth,
- 'sday' => $sday,
- 'eyear' => $eyear,
- 'emonth' => $emonth,
- 'eday' => $eday,
- 'tz_offset' => 0,
- 'extra' => '',
- 'owner_id' => $owner_id,
- 'location_id' => $location_id,
- 'location_item_id' => $location_item_id
- );
+ (
+ 'syear' =>
$syear,
+ 'smonth' =>
$smonth,
+ 'sday' =>
$sday,
+ 'eyear' =>
$eyear,
+ 'emonth' =>
$emonth,
+ 'eday' =>
$eday,
+ 'tz_offset' => 0,
+ 'extra' => '',
+ 'owner_id' =>
$owner_id,
+ 'location_id' => $location_id,
+ 'location_item_id' =>
$location_item_id
+ );
$cached_event_ids =
$this->so->list_events($find_criteria);
$cached_event_ids_repeating =
$this->so->list_repeated_events($find_criteria);
-//_debug_array($cached_event_ids_repeating);die();
+ //_debug_array($cached_event_ids_repeating);die();
unset($find_criteria);
if($this->debug)
@@ -650,7 +644,7 @@
}
$this->cached_events = array();
-
+
if(!$cached_event_ids && !$cached_event_ids_repeating)
{
return;
@@ -696,7 +690,7 @@
$this->repeating_events = array();
if($cached_event_ids_repeating)
{
-//_debug_array($cached_event_ids_repeating);die();
+
//_debug_array($cached_event_ids_repeating);die();
$i = 0;
foreach($cached_event_ids_repeating as
$cached_event_id)
{
@@ -736,7 +730,7 @@
$retval[$j] = $this->cached_events[$j];
}
}
-//_debug_array($this->cached_events);die();
+ //_debug_array($this->cached_events);die();
return $retval;
// return $this->cached_events;
}
@@ -789,7 +783,7 @@
{
$event_recur_time =
mktime(0,0,0,1,1,2030);
}
-*/
+ */
$end_recur_date =
date('Ymd',$event_recur_time);
$full_event_date =
date('Ymd',$event_beg_day);
@@ -816,110 +810,110 @@
$type =
$rep_events['repeat_type'];
switch($type)
{
- case MCAL_RECUR_DAILY:
- if($this->debug)
+ case MCAL_RECUR_DAILY:
+ if($this->debug)
+ {
+ echo '<!--
check_repeating_events - MCAL_RECUR_DAILY - '.$id.' -->'."\n";
+ }
+ //if ($freq == 1 &&
$rep_events['recur_enddate']['month'] != 0 &&
$rep_events['recur_enddate']['mday'] != 0 &&
$rep_events['recur_enddate']['year'] != 0 && $search_date_full <=
$end_recur_date)
+ if ($freq == 1 &&
$rep_events['end_date'] && $search_date_full <= $end_recur_date)
+ {
+
$this->sort_event($rep_events,$search_date_full);
+ }
+ elseif
(floor(($search_beg_day - $event_beg_day)/86400) % $freq)
+ {
+ continue;
+ }
+ else
+ {
+
$this->sort_event($rep_events,$search_date_full);
+ }
+ break;
+ case MCAL_RECUR_WEEKLY:
+ $test =
(($search_beg_day - $event_beg_day)/604800)/$freq;
+ $test_subtract =
floor($test);
+
+ //if
(floor(($search_beg_day - $event_beg_day)/604800) % $freq)
+
if(!$rep_events['rpt_day'])
+ {
+ if(!($test -
$test_subtract))
{
- echo
'<!-- check_repeating_events - MCAL_RECUR_DAILY - '.$id.' -->'."\n";
- }
-// if ($freq == 1
&& $rep_events['recur_enddate']['month'] != 0 &&
$rep_events['recur_enddate']['mday'] != 0 &&
$rep_events['recur_enddate']['year'] != 0 && $search_date_full <=
$end_recur_date)
- if ($freq == 1
&& $rep_events['end_date'] && $search_date_full <= $end_recur_date)
- {
$this->sort_event($rep_events,$search_date_full);
}
- elseif
(floor(($search_beg_day - $event_beg_day)/86400) % $freq)
+ }
+ else
+ {
+ $test =
($search_date_week - $event_beg_week)/$freq;
+ $test_subtract
= floor($test);
+ if(($test -
$test_subtract))
{
continue;
}
- else
- {
-
$this->sort_event($rep_events,$search_date_full);
- }
- break;
- case MCAL_RECUR_WEEKLY:
- $test =
(($search_beg_day - $event_beg_day)/604800)/$freq;
- $test_subtract
= floor($test);
- //if
(floor(($search_beg_day - $event_beg_day)/604800) % $freq)
-
if(!$rep_events['rpt_day'])
+ $check = 0;
+
switch($search_date_dow)
{
-
if(!($test - $test_subtract))
- {
-
$this->sort_event($rep_events,$search_date_full);
- }
+ case 0:
+ $check
= MCAL_M_SUNDAY;
+ break;
+ case 1:
+ $check
= MCAL_M_MONDAY;
+ break;
+ case 2:
+ $check
= MCAL_M_TUESDAY;
+ break;
+ case 3:
+ $check
= MCAL_M_WEDNESDAY;
+ break;
+ case 4:
+ $check
= MCAL_M_THURSDAY;
+ break;
+ case 5:
+ $check
= MCAL_M_FRIDAY;
+ break;
+ case 6:
+ $check
= MCAL_M_SATURDAY;
+ break;
}
- else
- {
- $test =
($search_date_week - $event_beg_week)/$freq;
-
$test_subtract = floor($test);
-
if(($test - $test_subtract))
- {
-
continue;
- }
- $check
= 0;
-
switch($search_date_dow)
- {
-
case 0:
-
$check = MCAL_M_SUNDAY;
-
break;
-
case 1:
-
$check = MCAL_M_MONDAY;
-
break;
-
case 2:
-
$check = MCAL_M_TUESDAY;
-
break;
-
case 3:
-
$check = MCAL_M_WEDNESDAY;
-
break;
-
case 4:
-
$check = MCAL_M_THURSDAY;
-
break;
-
case 5:
-
$check = MCAL_M_FRIDAY;
-
break;
-
case 6:
-
$check = MCAL_M_SATURDAY;
-
break;
- }
-
- if
($rep_events['rpt_day'] & $check)
- {
-
$this->sort_event($rep_events,$search_date_full);
- }
- }
- break;
- case
MCAL_RECUR_MONTHLY_WDAY:
- if
((($search_date_year - $rep_events['start']['year']) * 12 + $search_date_month
- $rep_events['start']['month']) % $freq)
+ if
($rep_events['rpt_day'] & $check)
{
-
continue;
- }
-
- if
((phpgwapi_datetime::day_of_week($rep_events['start']['year'],$rep_events['start']['month'],$rep_events['start']['mday'])
==
phpgwapi_datetime::day_of_week($search_date_year,$search_date_month,$search_date_day))
&&
-
(ceil($rep_events['start']['mday']/7) == ceil($search_date_day/7)))
- {
$this->sort_event($rep_events,$search_date_full);
}
- break;
- case
MCAL_RECUR_MONTHLY_MDAY:
- if
((($search_date_year - $rep_events['start']['year']) * 12 + $search_date_month
- $rep_events['start']['month']) % $freq)
- {
-
continue;
- }
- if
($search_date_day == $rep_events['start']['mday'])
- {
-
$this->sort_event($rep_events,$search_date_full);
- }
- break;
- case MCAL_RECUR_YEARLY:
- if
(($search_date_year - $rep_events['start']['year']) % $freq)
- {
-
continue;
- }
- if
(date('dm',$datetime) == date('dm',$event_beg_day))
- {
-
$this->sort_event($rep_events,$search_date_full);
- }
- break;
+ }
+ break;
+ case MCAL_RECUR_MONTHLY_WDAY:
+ if ((($search_date_year
- $rep_events['start']['year']) * 12 + $search_date_month -
$rep_events['start']['month']) % $freq)
+ {
+ continue;
+ }
+
+ if
((phpgwapi_datetime::day_of_week($rep_events['start']['year'],$rep_events['start']['month'],$rep_events['start']['mday'])
==
phpgwapi_datetime::day_of_week($search_date_year,$search_date_month,$search_date_day))
&&
+
(ceil($rep_events['start']['mday']/7) == ceil($search_date_day/7)))
+ {
+
$this->sort_event($rep_events,$search_date_full);
+ }
+ break;
+ case MCAL_RECUR_MONTHLY_MDAY:
+ if ((($search_date_year
- $rep_events['start']['year']) * 12 + $search_date_month -
$rep_events['start']['month']) % $freq)
+ {
+ continue;
+ }
+ if ($search_date_day ==
$rep_events['start']['mday'])
+ {
+
$this->sort_event($rep_events,$search_date_full);
+ }
+ break;
+ case MCAL_RECUR_YEARLY:
+ if (($search_date_year
- $rep_events['start']['year']) % $freq)
+ {
+ continue;
+ }
+ if
(date('dm',$datetime) == date('dm',$event_beg_day))
+ {
+
$this->sort_event($rep_events,$search_date_full);
+ }
+ break;
}
}
}
@@ -936,7 +930,7 @@
if(isset($event['repeat_exception']))
{
-// $event_time =
mktime($event['start']['hour'],$event['start']['min'],0,intval(substr($date,4,2)),intval(substr($date,6,2)),intval(substr($date,0,4)))
- phpgwapi_datetime::user_timezone();
+ //$event_time =
mktime($event['start']['hour'],$event['start']['min'],0,intval(substr($date,4,2)),intval(substr($date,6,2)),intval(substr($date,0,4)))
- phpgwapi_datetime::user_timezone();
$event_time =
mktime($event['start']['hour'],$event['start']['min'],0,intval(substr($date,4,2)),intval(substr($date,6,2)),intval(substr($date,0,4)));
while($inserted == false &&
list($key,$exception_time) = each($event['repeat_exception']))
{
@@ -946,10 +940,10 @@
}
if($exception_time == $event_time)
{
-//_debug_array(date('Y-m-d',$event_time));die();
-// _debug_array($event);
-//
_debug_array($this->cached_events);die();
-// $inserted = true;
+
//_debug_array(date('Y-m-d',$event_time));die();
+ //
_debug_array($event);
+ //
_debug_array($this->cached_events);die();
+ //
$inserted = true;
$event['exception'] = true;
/*
@@ -960,13 +954,13 @@
die();
}
}
-*/
+ */
}
}
}
if(isset($this->cached_events[$date]) &&
$this->cached_events[$date] && $inserted == false)
{
-
+
if($this->debug)
{
echo '<!-- Cached Events found for
'.$date.' -->'."\n";
@@ -979,7 +973,7 @@
{
echo '<!-- Date : '.$date.' Count :
'.count($this->cached_events[$date]).' -->'."\n";
}
-
+
for($i=0;$i<count($this->cached_events[$date]);$i++)
{
$events =
$this->cached_events[$date][$i];
@@ -1002,7 +996,7 @@
}
if(date('Hi',mktime($event['start']['hour'],$event['start']['min'],$event['start']['sec'],$month,$day,$year))
<
date('Hi',mktime($this->cached_events[$date][$i]['start']['hour'],$this->cached_events[$date][$i]['start']['min'],$this->cached_events[$date][$i]['start']['sec'],$month,$day,$year)))
{
- //
for($j=count($this->cached_events[$date]);$j>=$i;$j--)
+ //
for($j=count($this->cached_events[$date]);$j>=$i;$j--)
for($j=count($this->cached_events[$date]);$j>=($i+1);$j--)
{
$this->cached_events[$date][$j] = $this->cached_events[$date][$j-1];
@@ -1041,14 +1035,14 @@
$prev_date->modify('-1 week');
$next_date->modify('+1 week');
$resource = $this->read_single($id);
- if ($search)
- {
- $resource['buildings_link'] =
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => $search, "type" =>
"building"));
- }
- else
- {
- $resource['buildings_link'] =
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => $buildingmodule .
'.index'));
- }
+ if ($search)
+ {
+ $resource['buildings_link'] =
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => $search, "type" =>
"building"));
+ }
+ else
+ {
+ $resource['buildings_link'] =
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => $buildingmodule .
'.index'));
+ }
$resource['building_link'] =
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => $buildingmodule .
'.show', 'id' => $resource['building_id']));
$resource['resource_link'] =
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => $resourcemodule .
'.show', 'id' => $resource['id']));
@@ -1067,29 +1061,29 @@
/**
- * Find recurring events for a week
- *
- * @return array schedule
- */
+ * Find recurring events for a week
+ *
+ * @return array schedule
+ */
public function event_schedule_week_data()
{
-// $date = new DateTime(phpgw::get_var('date')); Use this one
when moving to php 5.3
+ // $date = new
DateTime(phpgw::get_var('date')); Use this one when moving to php 5.3
$datetime = CreateObject('phpgwapi.datetime');
$date = $datetime->convertDate(phpgw::get_var('date'),
'Y-m-d', $GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
$datetime_start = $datetime->date_to_timestamp($date);
-
+
$id = phpgw::get_var('resource_id', 'int');
-
+
$event = $this->so->read_single($id);
$criteria = array
- (
- 'start_date' => $datetime_start,
- 'end_date' =>
$datetime_start + (86400 * 6),
- 'location_id' =>
$event['location_id'],
- 'location_item_id' =>
$event['location_item_id']
- );
+ (
+ 'start_date' =>
$datetime_start,
+ 'end_date' =>
$datetime_start + (86400 * 6),
+ 'location_id' =>
$event['location_id'],
+ 'location_item_id' =>
$event['location_item_id']
+ );
$this->find_scedules($criteria);
$schedules = $this->cached_events;
@@ -1108,13 +1102,13 @@
for($i = 0; $i < $total_records; $i++)
{
$values[$i] = array
- (
- 'resource' =>
'descr',
- 'resource_id' => 11,
- 'time' => $i+1,
- '_from' =>
'16:30',
- '_to' =>
'17:00'
- );
+ (
+ 'resource'
=> 'descr',
+ 'resource_id' => 11,
+ 'time'
=> $i+1,
+ '_from'
=> '16:30',
+ '_to'
=> '17:00'
+ );
foreach($schedules as $_date => $set)
{
@@ -1122,47 +1116,47 @@
$date = new DateTime($__date);
$day_of_week = $date->format('D');
$values[$i][$day_of_week] = array
- (
- 'exception' =>
$set[$i]['exception'],
- 'lang_exception' =>
$lang_exception,
- 'type' => 'event',
- 'name' => $set[$i]['descr'],
- 'link' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction' =>
'booking.uievent.show', 'location_id' => $set[$i]['location_id'],
'location_item_id' => $set[$i]['location_item_id']))
- );
+ (
+ 'exception' =>
$set[$i]['exception'],
+ 'lang_exception' =>
$lang_exception,
+ 'type' => 'event',
+ 'name' =>
$set[$i]['descr'],
+ 'link' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction' =>
'booking.uievent.show', 'location_id' => $set[$i]['location_id'],
'location_item_id' => $set[$i]['location_item_id']))
+ );
}
}
$data = array
- (
- 'ResultSet' => array(
- "totalResultsAvailable" =>
$total_records,
- "Result" => $values
- )
- );
-//_debug_array($data);die();
+ (
+ 'ResultSet' => array(
+ "totalResultsAvailable" =>
$total_records,
+ "Result" => $values
+ )
+ );
+ //_debug_array($data);die();
return $data;
}
/**
- * Find recurring events for a period defined by the event
- *
- * @return array schedule
- */
+ * Find recurring events for a period defined by the event
+ *
+ * @return array schedule
+ */
public function event_schedule_data()
{
$id = phpgw::get_var('id', 'int');
-
+
$event = $this->so->read_single($id);
$criteria = array
- (
- 'start_date' => $event['start_date'],
- 'end_date' =>
$event['end_date'],
- 'location_id' =>
$event['location_id'],
- 'location_item_id' =>
$event['location_item_id']
- );
+ (
+ 'start_date' =>
$event['start_date'],
+ 'end_date' =>
$event['end_date'],
+ 'location_id' =>
$event['location_id'],
+ 'location_item_id' =>
$event['location_item_id']
+ );
$this->find_scedules($criteria);
$schedules = $this->cached_events;
@@ -1181,29 +1175,29 @@
foreach($set as $entry)
{
$values[] = array
- (
- 'time'
=> $i,
- 'date'
=> array
(
- 'exception' =>
$entry['exception'],
- 'lang_exception' =>
$lang_exception,
- 'type' => 'event',
- 'name' => $date,
- 'link' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction' =>
'booking.uievent.show', 'location_id' => $entry['location_id'],
'location_item_id' => $entry['location_item_id']))
- )
- );
+ 'time'
=> $i,
+ 'date'
=> array
+ (
+ 'exception' =>
$entry['exception'],
+
'lang_exception' => $lang_exception,
+ 'type' =>
'event',
+ 'name' => $date,
+ 'link' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction' =>
'booking.uievent.show', 'location_id' => $entry['location_id'],
'location_item_id' => $entry['location_item_id']))
+ )
+ );
$i++;
}
}
$data = array
- (
- 'ResultSet' => array(
- "totalResultsAvailable" =>
$total_records,
- "Result" => $values
- )
- );
+ (
+ 'ResultSet' => array(
+ "totalResultsAvailable" =>
$total_records,
+ "Result" => $values
+ )
+ );
return $data;
}
@@ -1212,7 +1206,7 @@
{
if(!isset($data['event_id']) || !$data['event_id'])
{
- throw new
Exception("property_boevent::set_exceptions - Missing event_id info in input");
+ throw new
Exception("property_boevent::set_exceptions - Missing event_id info in input");
}
$this->so->set_exceptions($data);
}
Modified: trunk/property/inc/class.bofiles.inc.php
===================================================================
--- trunk/property/inc/class.bofiles.inc.php 2010-12-24 15:00:54 UTC (rev
6700)
+++ trunk/property/inc/class.bofiles.inc.php 2010-12-25 10:51:59 UTC (rev
6701)
@@ -43,12 +43,12 @@
var $rootdir;
/**
- * constructor
- *
- * @param string $fakebase fakebase
- *
- * @return
- */
+ * constructor
+ *
+ * @param string $fakebase fakebase
+ *
+ * @return
+ */
function __construct($fakebase='/property')
{
@@ -77,28 +77,28 @@
}
/**
- * Create catalog - starting with fakebase
- *
- * @param string $type part of path pointing to end target
- *
- * @return array Array with result on the action(failed/success)
for each catalog down the path
- */
+ * Create catalog - starting with fakebase
+ *
+ * @param string $type part of path pointing to end target
+ *
+ * @return array Array with result on the
action(failed/success) for each catalog down the path
+ */
function create_document_dir($type)
{
$receipt = array();
if(!$this->vfs->file_exists(array(
- 'string' => $this->fakebase,
- 'relatives' => array(RELATIVE_NONE)
- )))
+ 'string' => $this->fakebase,
+ 'relatives' => array(RELATIVE_NONE)
+ )))
{
$this->vfs->override_acl = 1;
if(!$this->vfs->mkdir(array(
- 'string' => $this->fakebase,
- 'relatives' => array(
- RELATIVE_NONE
- )
+ 'string' => $this->fakebase,
+ 'relatives' => array(
+ RELATIVE_NONE
+ )
)))
{
$receipt['error'][] =
array('msg'=>lang('failed to create directory') . ' :'. $this->fakebase);
@@ -118,16 +118,16 @@
$catalog .= "/{$entry}";
if(!$this->vfs->file_exists(array(
- 'string' =>
"{$this->fakebase}{$catalog}",
- 'relatives' =>
array(RELATIVE_NONE)
- )))
+ 'string' =>
"{$this->fakebase}{$catalog}",
+ 'relatives' => array(RELATIVE_NONE)
+ )))
{
$this->vfs->override_acl = 1;
if(!$this->vfs->mkdir(array(
- 'string' =>
"{$this->fakebase}{$catalog}",
- 'relatives' => array(
- RELATIVE_NONE
- )
+ 'string' =>
"{$this->fakebase}{$catalog}",
+ 'relatives' => array(
+ RELATIVE_NONE
+ )
)))
{
$receipt['error'][] =
array('msg'=>lang('failed to create directory') . ' :'. $this->fakebase .
$catalog);
@@ -139,18 +139,18 @@
$this->vfs->override_acl = 0;
}
}
-//_debug_array($receipt);
+ //_debug_array($receipt);
return $receipt;
}
/**
- * Delete Files
- *
- * @param string $path part of path where to look for files
- * @param array $values array holding information of selected
files
- *
- * @return array Array with result on the action(failed/success)
for each file
- */
+ * Delete Files
+ *
+ * @param string $path part of path where to look for files
+ * @param array $values array holding information of selected
files
+ *
+ * @return array Array with result on the
action(failed/success) for each file
+ */
function delete_file($path, $values)
{
@@ -169,9 +169,9 @@
if(!$this->vfs->rm(array(
'string' => $file,
- 'relatives' => array(
- RELATIVE_NONE
- )
+ 'relatives' => array(
+ RELATIVE_NONE
+ )
)))
{
$receipt['error'][] =
array('msg'=>lang('failed to delete file') . ' :'. $this->fakebase . $path .
$file_name);
@@ -187,13 +187,13 @@
}
/**
- * View File - echo (or download) to browser.
- *
- * @param string $type part of path where to look for files
- * @param string $file optional filename
- *
- * @return null
- */
+ * View File - echo (or download) to browser.
+ *
+ * @param string $type part of path where to look for files
+ * @param string $file optional filename
+ *
+ * @return null
+ */
function view_file($type = '', $file = '', $jasper = '')
{
@@ -216,14 +216,14 @@
if($this->vfs->file_exists(array(
'string' => $file,
'relatives' => array(RELATIVE_NONE)
- )))
+ )))
{
$ls_array = $this->vfs->ls(array(
- 'string' =>
$file,
- 'relatives' =>
array(RELATIVE_NONE),
- 'checksubdirs' => false,
- 'nofiles' => true
- ));
+ 'string' => $file,
+ 'relatives' => array(RELATIVE_NONE),
+ 'checksubdirs' => false,
+ 'nofiles' => true
+ ));
if(!$jasper)
{
@@ -260,13 +260,13 @@
}
/**
- * Get attachments
- *
- * @param string $path part of path where to look for files
- * @param array $values array holding information of selected
files
- *
- * @return array Array with filecontent
- */
+ * Get attachments
+ *
+ * @param string $path part of path where to look for files
+ * @param array $values array holding information of selected
files
+ *
+ * @return array Array with filecontent
+ */
function get_attachments($path, $values)
{
$mime_magic = createObject('phpgwapi.mime_magic');
@@ -282,11 +282,11 @@
$mime =
$mime_magic->filename2mime($file_name);
$attachments[] = array
- (
- 'file' =>
"{$GLOBALS['phpgw_info']['server']['files_dir']}{$file}",
- 'name' => $file_name,
- 'type' => $mime
- );
+ (
+ 'file' =>
"{$GLOBALS['phpgw_info']['server']['files_dir']}{$file}",
+ 'name' => $file_name,
+ 'type' => $mime
+ );
}
}
return $attachments;
Modified: trunk/property/inc/class.bogab.inc.php
===================================================================
--- trunk/property/inc/class.bogab.inc.php 2010-12-24 15:00:54 UTC (rev
6700)
+++ trunk/property/inc/class.bogab.inc.php 2010-12-25 10:51:59 UTC (rev
6701)
@@ -43,13 +43,13 @@
var $gab_insert_level;
var $public_functions = array
- (
- 'read' => true,
- 'read_single' => true,
- 'save' => true,
- 'delete' => true,
- 'check_perms' => true
- );
+ (
+ 'read' => true,
+ 'read_single' => true,
+ 'save' => true,
+ 'delete' => true,
+ 'check_perms' => true
+ );
function __construct($session=false)
{
@@ -138,9 +138,9 @@
}
$gab = $this->so->read(array('start' =>
$this->start,'sort' => $this->sort,'order' =>
$this->order,'allrows'=>$this->allrows,
-
'cat_id' => $this->cat_id,'location_code' => $location_code,
-
'gaards_nr' => $gaards_nr,'bruksnr' => $bruksnr,'feste_nr' => $feste_nr,
-
'seksjons_nr' => $seksjons_nr,'address' => $address,'check_payments' =>
$check_payments));
+ 'cat_id' => $this->cat_id,'location_code' =>
$location_code,
+ 'gaards_nr' => $gaards_nr,'bruksnr' =>
$bruksnr,'feste_nr' => $feste_nr,
+ 'seksjons_nr' => $seksjons_nr,'address' =>
$address,'check_payments' => $check_payments));
/*
foreach ($gab as &$_gab)
{
@@ -159,17 +159,17 @@
$_gab['address'] =
$location_data['loc1_name'];
}
}
-*/
+ */
$this->total_records = $this->so->total_records;
$this->payment_date = $this->so->payment_date;
return $gab;
}
-
+
//address@hidden $allrows - variable to display all records
function read_detail($gab_id='', $allrows=0)
{
$gab = $this->so->read_detail(array('start' =>
$this->start,'sort' => $this->sort,'order' => $this->order,
-
'cat_id' => $this->cat_id,'gab_id' => $gab_id,'allrows'=>$allrows));
+ 'cat_id' => $this->cat_id,'gab_id' =>
$gab_id,'allrows'=>$allrows));
$this->total_records = $this->so->total_records;
$this->uicols = $this->so->uicols;
@@ -235,4 +235,3 @@
$this->so->delete($gab_id,$location_code);
}
}
-
Modified: trunk/property/inc/class.bogallery.inc.php
===================================================================
--- trunk/property/inc/class.bogallery.inc.php 2010-12-24 15:00:54 UTC (rev
6700)
+++ trunk/property/inc/class.bogallery.inc.php 2010-12-25 10:51:59 UTC (rev
6701)
@@ -46,7 +46,7 @@
var $order;
var $cat_id;
var $location_info = array();
-
+
function __construct($session=false)
{
$this->so =
CreateObject('property.sogallery');
@@ -103,7 +103,7 @@
{
$data =
$GLOBALS['phpgw']->session->appsession('session_data','gallery');
- // _debug_array($data);
+ // _debug_array($data);
$this->start = $data['start'];
$this->query = $data['query'];
@@ -123,17 +123,17 @@
$valid_locations = $this->get_gallery_location();
$values = $this->so->read(array('start' =>
$this->start,'query' => $this->query,'sort' => $this->sort,'order' =>
$this->order,
-
'allrows'=>$this->allrows, 'location_id' => $this->location_id,
'user_id' => $this->user_id,
-
'mime_type' => $this->mime_type, 'start_date' => $start_date,
'end_date' => $end_date,
-
'cat_id' => $this->cat_id, 'valid_locations' => $valid_locations,
'dry_run'=>$dry_run));
+ 'allrows'=>$this->allrows, 'location_id' =>
$this->location_id, 'user_id' => $this->user_id,
+ 'mime_type' => $this->mime_type, 'start_date'
=> $start_date, 'end_date' => $end_date,
+ 'cat_id' => $this->cat_id, 'valid_locations' =>
$valid_locations, 'dry_run'=>$dry_run));
$img_types = array
- (
- 'image/jpeg',
- 'image/png',
- 'image/gif'
- );
+ (
+ 'image/jpeg',
+ 'image/png',
+ 'image/gif'
+ );
static $locations = array();
static $urls = array();
$dateformat =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
@@ -144,7 +144,7 @@
{
$entry['mime_type'] =
$this->mime_magic->filename2mime($entry['name']);
}
-
+
$entry['img_id'] = '';
if(in_array($entry['mime_type'], $img_types))
{
@@ -164,13 +164,13 @@
$entry['location_name'] =
$this->interlink->get_location_name($entry['location']);
$entry['document_url'] =
$GLOBALS['phpgw']->link('/index.php',array
-
(
-
'menuaction' => 'property.uigallery.view_file',
-
'file' =>
urlencode("{$entry['directory']}/{$entry['name']}")
-
));
+ (
+ 'menuaction' =>
'property.uigallery.view_file',
+ 'file' =>
urlencode("{$entry['directory']}/{$entry['name']}")
+ ));
$entry['user'] =
$GLOBALS['phpgw']->accounts->get($entry['createdby_id'])->__toString();
}
-//_debug_array($values);
+ //_debug_array($values);
$this->total_records = $this->so->total_records;
return $values;
@@ -178,40 +178,40 @@
public function get_location($directory = array())
{
- $values = array();
- switch ($directory[2])
- {
- case 'agreement':
- $values['location'] =
'.agreement';
- $values['location_item_id'] =
$directory[3];
- break;
- case 'document':
- $values['location'] =
'.document';
- $values['location_item_id'] =
$directory[4];
- break;
- case 'fmticket':
- $values['location'] = '.ticket';
- $values['location_item_id'] =
$directory[3];
- break;
- case 'request':
- $values['location'] =
'.project.request';
- $values['location_item_id'] =
$directory[4];
- break;
- case 'service_agreement':
- $values['location'] =
'.s_agreement';
- $values['location_item_id'] =
$directory[3];
- break;
- case 'workorder':
- $values['location'] =
'.project.workorder';
- $values['location_item_id'] =
$directory[3];
- break;
- default:
- $values['location'] = '.' .
str_replace('_', '.', $directory[2]);
- $values['location_item_id'] =
$directory[4];
- }
- return $values;
+ $values = array();
+ switch ($directory[2])
+ {
+ case 'agreement':
+ $values['location'] = '.agreement';
+ $values['location_item_id'] = $directory[3];
+ break;
+ case 'document':
+ $values['location'] = '.document';
+ $values['location_item_id'] = $directory[4];
+ break;
+ case 'fmticket':
+ $values['location'] = '.ticket';
+ $values['location_item_id'] = $directory[3];
+ break;
+ case 'request':
+ $values['location'] = '.project.request';
+ $values['location_item_id'] = $directory[4];
+ break;
+ case 'service_agreement':
+ $values['location'] = '.s_agreement';
+ $values['location_item_id'] = $directory[3];
+ break;
+ case 'workorder':
+ $values['location'] = '.project.workorder';
+ $values['location_item_id'] = $directory[3];
+ break;
+ default:
+ $values['location'] = '.' . str_replace('_',
'.', $directory[2]);
+ $values['location_item_id'] = $directory[4];
+ }
+ return $values;
}
-
+
public function get_filetypes()
{
$values = $this->so->get_filetypes();
@@ -224,10 +224,10 @@
if($mime_type)
{
$filetypes[] = array
- (
- 'id' => $mime_type,
- 'name' => $map[$mime_type]
- );
+ (
+ 'id' => $mime_type,
+ 'name' =>
$map[$mime_type]
+ );
}
}
return $filetypes;
@@ -249,10 +249,10 @@
if($GLOBALS['phpgw']->acl->check($location_info['location'], PHPGW_ACL_READ,
'property'))
{
$locations[] = array
- (
- 'id' => $entry,
- 'name' =>
$this->interlink->get_location_name($location_info['location'])
- );
+ (
+ 'id' => $entry,
+ 'name' =>
$this->interlink->get_location_name($location_info['location'])
+ );
}
}
}
Modified: trunk/property/inc/class.bogeneric.inc.php
===================================================================
--- trunk/property/inc/class.bogeneric.inc.php 2010-12-24 15:00:54 UTC (rev
6700)
+++ trunk/property/inc/class.bogeneric.inc.php 2010-12-25 10:51:59 UTC (rev
6701)
@@ -42,24 +42,6 @@
var $cat_id;
var $location_info = array();
- 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 __construct($session=false)
{
@@ -110,7 +92,7 @@
{
$data =
$GLOBALS['phpgw']->session->appsession('session_data',"generic_{$type}");
- // _debug_array($data);
+ // _debug_array($data);
$this->start = $data['start'];
$this->query = $data['query'];
@@ -152,9 +134,9 @@
}
}
}
-
+
$values = $this->so->read(array('start' =>
$this->start,'query' => $this->query,'sort' => $this->sort,'order' =>
$this->order,
-
'allrows'=>$this->allrows),$filter);
+ 'allrows'=>$this->allrows),$filter);
$this->total_records = $this->so->total_records;
$this->uicols = $this->so->uicols;
@@ -207,12 +189,12 @@
}
/**
- * Get a list from and tag the selected item
- *
- * @param array $data
- *
- * @return array with information to include in forms
- */
+ * 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)
{
Modified: trunk/property/inc/class.boifc.inc.php
===================================================================
--- trunk/property/inc/class.boifc.inc.php 2010-12-24 15:00:54 UTC (rev
6700)
+++ trunk/property/inc/class.boifc.inc.php 2010-12-25 10:51:59 UTC (rev
6701)
@@ -44,22 +44,21 @@
var $allrows;
/**
- * @var object $custom reference to custom fields object
- */
+ * @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
- );
+ (
+ 'read' => true,
+ 'read_single' => true,
+ 'save' => true,
+ 'delete' => true,
+ 'check_perms' => true
+ );
function boifc($session=false)
{
- // $this->currentapp =
$GLOBALS['phpgw_info']['flags']['currentapp'];
// $this->so =
CreateObject('property.soifc');
$this->bocommon =
createObject('property.bocommon');
$this->custom =
createObject('property.custom_fields');
@@ -115,22 +114,22 @@
switch($GLOBALS['phpgw_info']['server']['db_type'])
{
- case 'mssql':
- $this->dateformat = "M d
Y";
- $this->datetimeformat = "M d Y g:iA";
- break;
- case 'mysql':
- $this->dateformat =
"Y-m-d";
- $this->datetimeformat = "Y-m-d G:i:s";
- break;
- case 'pgsql':
- $this->dateformat =
"Y-m-d";
- $this->datetimeformat = "Y-m-d G:i:s";
- break;
- case 'postgres':
- $this->dateformat =
"Y-m-d";
- $this->datetimeformat = "Y-m-d G:i:s";
- break;
+ case 'mssql':
+ $this->dateformat = "M d Y";
+ $this->datetimeformat = "M d Y g:iA";
+ break;
+ case 'mysql':
+ $this->dateformat = "Y-m-d";
+ $this->datetimeformat = "Y-m-d G:i:s";
+ break;
+ case 'pgsql':
+ $this->dateformat = "Y-m-d";
+ $this->datetimeformat = "Y-m-d G:i:s";
+ break;
+ case 'postgres':
+ $this->dateformat = "Y-m-d";
+ $this->datetimeformat = "Y-m-d G:i:s";
+ break;
}
}
@@ -170,10 +169,10 @@
$xml = $xmltool->export_var();
_debug_array('hei');
-*/
+ */
/* $xmlparse = CreateObject('phpgwapi.parsexml');
$xml = $xmlparse->GetXMLTree($ifcfile);
-*/
+ */
// _debug_array($this->xml_to_array($ifcfile));
@@ -188,23 +187,23 @@
function read()
{
$ifc_info = $this->so->read(array('start' =>
$this->start,'query' => $this->query,'sort' => $this->sort,'order' =>
$this->order,
-
'cat_id'=>$this->cat_id,'allrows'=>$this->allrows,'filter'=>$this->filter));
+
'cat_id'=>$this->cat_id,'allrows'=>$this->allrows,'filter'=>$this->filter));
$this->total_records = $this->so->total_records;
return $ifc_info;
}
/**
- * Get list of records with dynamically allocated coulmns
- *
- * @return array Array with records.
- */
+ * Get list of records with dynamically allocated coulmns
+ *
+ * @return array Array with records.
+ */
function read2()
{
$custom_attributes = $this->custom->find('property',
$this->acl_location, 0, '', 'ASC', 'attrib_sort', true, true);
$ifc_info = $this->so->read2(array('start' =>
$this->start,'query' => $this->query,'sort' => $this->sort,'order' =>
$this->order,
-
'cat_id'=>$this->cat_id,'allrows'=>$this->allrows,'filter'=>$this->filter,
-
'custom_attributes'=>$custom_attributes));
+
'cat_id'=>$this->cat_id,'allrows'=>$this->allrows,'filter'=>$this->filter,
+ 'custom_attributes'=>$custom_attributes));
$this->total_records = $this->so->total_records;
$this->uicols = $this->so->uicols;
return $ifc_info;
@@ -268,11 +267,11 @@
}
$criteria = array
- (
- 'appname' => 'property',
- 'location' => $this->acl_location,
- 'allrows' => true
- );
+ (
+ 'appname' => 'property',
+ 'location' => $this->acl_location,
+ 'allrows' => true
+ );
$custom_functions =
$GLOBALS['phpgw']->custom_functions->find($criteria);
@@ -303,12 +302,12 @@
{
switch($format)
{
- case 'select':
-
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_select'));
- break;
- case 'filter':
-
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_filter'));
- break;
+ case 'select':
+
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_select'));
+ break;
+ case 'filter':
+
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_filter'));
+ break;
}
$categories= $this->so->select_category_list();
@@ -318,31 +317,31 @@
if ($category['id']==$selected)
{
$category_list[] = array
- (
- 'cat_id' =>
$category['id'],
- 'name' =>
$category['name'],
- 'selected' => 'selected'
- );
+ (
+ 'cat_id' =>
$category['id'],
+ 'name' =>
$category['name'],
+ 'selected' =>
'selected'
+ );
}
else
{
$category_list[] = array
- (
- 'cat_id' =>
$category['id'],
- 'name' =>
$category['name'],
- );
+ (
+ 'cat_id' =>
$category['id'],
+ 'name' =>
$category['name'],
+ );
}
}
return $category_list;
}
/**
- * Preserve attribute values from post in case of an error
- *
- * @param array $values_attribute attribute definition and
values from posting
- * @param array $values value set with
- * @return array Array with attribute definition and values
- */
+ * Preserve attribute values from post in case of an error
+ *
+ * @param array $values_attribute attribute definition and
values from posting
+ * @param array $values value set with
+ * @return array Array with attribute definition and values
+ */
function
preserve_attribute_values($values='',$values_attribute='')
{
return
$this->bocommon->preserve_attribute_values($values,$values_attribute);
@@ -358,6 +357,4 @@
}
return $date;
}
-
-
}
Modified: trunk/property/inc/class.boinvestment.inc.php
===================================================================
--- trunk/property/inc/class.boinvestment.inc.php 2010-12-24 15:00:54 UTC
(rev 6700)
+++ trunk/property/inc/class.boinvestment.inc.php 2010-12-25 10:51:59 UTC
(rev 6701)
@@ -44,36 +44,17 @@
// var $part_of_town_id;
var $public_functions = array
- (
- 'read' => true,
- 'read_single' => true,
- 'save' => true,
- 'delete' => true,
- 'check_perms' => true
- );
+ (
+ '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_boinvestment($session=false)
{
- // $this->currentapp =
$GLOBALS['phpgw_info']['flags']['currentapp'];
$this->so =
CreateObject('property.soinvestment');
$this->bocommon = CreateObject('property.bocommon');
$this->socommon = CreateObject('property.socommon');
@@ -158,14 +139,14 @@
{
$investment = $this->so->read(array('start' =>
$this->start,'query' => $this->query,'sort' => $this->sort,'order' =>
$this->order,
-
'filter' => $this->filter,'cat_id' => $this->cat_id,'part_of_town_id'
=> $this->part_of_town_id,'allrows'=>$this->allrows));
+ 'filter' => $this->filter,'cat_id' =>
$this->cat_id,'part_of_town_id' =>
$this->part_of_town_id,'allrows'=>$this->allrows));
$this->total_records = $this->so->total_records;
/* for ($i=0; $i<count($investment); $i++)
{
$investment[$i]['date'] =
$GLOBALS['phpgw']->common->show_date($investment[$i]['date']);
}
- */
+ */
return $investment;
}
@@ -174,12 +155,12 @@
{
switch($format)
{
- case 'select':
-
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_select'));
- break;
- case 'filter':
-
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_filter'));
- break;
+ case 'select':
+
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_select'));
+ break;
+ case 'filter':
+
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_filter'));
+ break;
}
$categories= $this->so->get_type_list();
@@ -204,11 +185,11 @@
}
$category_list[] = array
- (
- 'id' => $category['period'],
- 'name' => $category['period'],
- 'selected' => $sel_category
- );
+ (
+ 'id' =>
$category['period'],
+ 'name' =>
$category['period'],
+ 'selected' => $sel_category
+ );
}
for ($i=0;$i<count($category_list);$i++)
@@ -237,7 +218,7 @@
$values['location_code']=implode("-", $location);
-//_debug_array($values);
+ //_debug_array($values);
$values['date'] =
$this->bocommon->date_to_timestamp($values['date']);
$values['date']=
date($this->bocommon->dateformat,$values['date']);
@@ -281,7 +262,7 @@
$date_array =
phpgwapi_datetime::date_array($values['date']);
- $date = mktime
(2,0,0,$date_array['month'],$date_array['day'],$date_array['year']);
+ $date = mktime
(2,0,0,$date_array['month'],$date_array['day'],$date_array['year']);
$date= date($this->bocommon->dateformat,$date);
$new_index=str_replace(",",".",$values['new_index']);
@@ -311,7 +292,7 @@
'new_value'
=>$new_value,
'initial_value'
=>$values['initial_value'][$n],
'date' =>$date
- );
+ );
}
}
return $this->so->update_investment($update);
@@ -322,18 +303,18 @@
{
switch($format)
{
- case 'select':
-
$GLOBALS['phpgw']->xslttpl->add_file(array('filter_select'));
- break;
- case 'filter':
-
$GLOBALS['phpgw']->xslttpl->add_file(array('filter_filter'));
- break;
+ case 'select':
+
$GLOBALS['phpgw']->xslttpl->add_file(array('filter_select'));
+ break;
+ case 'filter':
+
$GLOBALS['phpgw']->xslttpl->add_file(array('filter_filter'));
+ break;
}
- $filters[0][id]='investment';
- $filters[0][name]=lang('Investment');
- $filters[1][id]='funding';
- $filters[1][name]=lang('Funding');
+ $filters[0]['id'] ='investment';
+ $filters[0]['name'] =lang('Investment');
+ $filters[1]['id'] ='funding';
+ $filters[1]['name'] =lang('Funding');
return $this->bocommon->select_list($selected,$filters);
}
@@ -359,4 +340,3 @@
$this->so->delete($entity_id,$investment_id,$index_count);
}
}
-
Modified: trunk/property/inc/class.boinvoice.inc.php
===================================================================
--- trunk/property/inc/class.boinvoice.inc.php 2010-12-24 15:00:54 UTC (rev
6700)
+++ trunk/property/inc/class.boinvoice.inc.php 2010-12-25 10:51:59 UTC (rev
6701)
@@ -36,7 +36,7 @@
{
function property_boinvoice($session=false)
{
- $this->so =
CreateObject('property.soinvoice',true);
+ $this->so =
CreateObject('property.soinvoice',true);
$this->bocommon =
CreateObject('property.bocommon');
$this->account_id =
$GLOBALS['phpgw_info']['user']['account_id'];
@@ -84,7 +84,7 @@
{
$data =
$GLOBALS['phpgw']->session->appsession('session_data','invoice');
-// _debug_array($data);
+ // _debug_array($data);
$this->start =
isset($data['start'])?$data['start']:'';
$this->query =
isset($data['query'])?$data['query']:'';
@@ -103,13 +103,13 @@
{
$start_date =
$this->bocommon->date_to_timestamp($start_date);
$end_date =
$this->bocommon->date_to_timestamp($end_date);
-
+
$invoice = $this->so->read_invoice(array('start' =>
$this->start,'query' => $this->query,'sort' => $this->sort,'order' =>
$this->order,
-
'user_lid' => $this->user_lid,'cat_id' => $this->cat_id, 'paid' =>
$paid,
-
'start_date'=>$start_date,'end_date'=>$end_date,'vendor_id'=>$vendor_id,
-
'loc1'=>$loc1,'workorder_id'=>$workorder_id,'allrows'=>$this->allrows,
-
'voucher_id'=>$voucher_id,'b_account_class' =>$this->b_account_class,
-
'district_id' => $this->district_id));
+ 'user_lid' => $this->user_lid,'cat_id' =>
$this->cat_id, 'paid' => $paid,
+
'start_date'=>$start_date,'end_date'=>$end_date,'vendor_id'=>$vendor_id,
+
'loc1'=>$loc1,'workorder_id'=>$workorder_id,'allrows'=>$this->allrows,
+ 'voucher_id'=>$voucher_id,'b_account_class'
=>$this->b_account_class,
+ 'district_id' => $this->district_id));
$soXport = CreateObject('property.soXport');
$soworkorder = CreateObject('property.soworkorder');
@@ -151,7 +151,7 @@
function read_invoice_sub($voucher_id='',$paid='')
{
$invoice = $this->so->read_invoice_sub(array('start' =>
$this->start,'query' => $this->query,'sort' => $this->sort,'order' =>
$this->order,
-
'user_lid' => $this->user_lid,'cat_id' =>
$this->cat_id,'voucher_id'=>$voucher_id,'paid' => $paid));
+ 'user_lid' => $this->user_lid,'cat_id' =>
$this->cat_id,'voucher_id'=>$voucher_id,'paid' => $paid));
$this->total_records = $this->so->total_records;
return $invoice;
}
@@ -172,10 +172,10 @@
$end_date =
$this->bocommon->date_to_timestamp($end_date);
$invoice = $this->so->read_consume(array('start' =>
$this->start,'query' => $this->query,'sort' => $this->sort,'order' =>
$this->order,
-
'user_lid' => $this->user_lid,'cat_id' => $this->cat_id,
-
'start_date'=>$start_date,'end_date'=>$end_date,'vendor_id'=>$vendor_id,
-
'loc1'=>$loc1,'workorder_id'=>$workorder_id,'b_account_class'
=>$b_account_class,
-
'district_id' => $district_id, 'b_account' => $this->b_account ));
+ 'user_lid' => $this->user_lid,'cat_id' =>
$this->cat_id,
+
'start_date'=>$start_date,'end_date'=>$end_date,'vendor_id'=>$vendor_id,
+
'loc1'=>$loc1,'workorder_id'=>$workorder_id,'b_account_class'
=>$b_account_class,
+ 'district_id' => $district_id, 'b_account' =>
$this->b_account ));
$this->total_records = $this->so->total_records;
@@ -227,10 +227,10 @@
}
$tax_code_list[] = array
- (
- 'id' => $code['id'],
- 'selected' => $sel_code
- );
+ (
+ 'id' =>
$code['id'],
+ 'selected' =>
$sel_code
+ );
}
for ($i=0;$i<count($tax_code_list);$i++)
@@ -272,18 +272,17 @@
$arts=$this->so->get_lisfm_ecoart();
return $this->bocommon->select_list($selected,$arts);
}
- //----------
function select_category($format='',$selected='')
{
switch($format)
{
- case 'select':
-
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_select'));
- break;
- case 'filter':
-
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_filter'));
- break;
+ case 'select':
+
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_select'));
+ break;
+ case 'filter':
+
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_filter'));
+ break;
}
$categories= $this->so->get_type_list();
@@ -301,12 +300,12 @@
switch($format)
{
- case 'select':
-
$GLOBALS['phpgw']->xslttpl->add_file(array('user_lid_select'));
- break;
- case 'filter':
-
$GLOBALS['phpgw']->xslttpl->add_file(array('user_lid_filter'));
- break;
+ case 'select':
+
$GLOBALS['phpgw']->xslttpl->add_file(array('user_lid_select'));
+ break;
+ case 'filter':
+
$GLOBALS['phpgw']->xslttpl->add_file(array('user_lid_filter'));
+ break;
}
$users=$this->bocommon->get_user_list_right(array(32,
64, 128),$selected,'.invoice',$extra,$default);
return $users;
@@ -318,14 +317,12 @@
return $this->bocommon->select_list($selected,$types);
}
- //----------
function select_dimb_list($selected='')
{
$dimbs=$this->so->select_dimb_list();
return $this->bocommon->select_list($selected,$dimbs);
}
- //-------------------
function select_dimd_list($selected='')
{
$dimds=$this->so->select_dimd_list();
@@ -384,23 +381,23 @@
$values['kildeid'] = 1;
$values['kidnr'] =
$values['kid_nr'];
$values['typeid'] =
$values['type'];
-//_debug_array($values);die();
+ //_debug_array($values);die();
if($values['order_id'] && $order_type =
$this->soXport->check_order($values['order_id']))
{
if($order_type=='workorder')
{
- $soworkorder =
CreateObject('property.soworkorder');
- $soproject =
CreateObject('property.soproject');
- $workorder =
$soworkorder->read_single($values['order_id']);
- $project =
$soproject->read_single($workorder['project_id']);
+ $soworkorder =
CreateObject('property.soworkorder');
+ $soproject =
CreateObject('property.soproject');
+ $workorder =
$soworkorder->read_single($values['order_id']);
+ $project =
$soproject->read_single($workorder['project_id']);
- $values['spvend_code'] =
$workorder['vendor_id'];
+ $values['spvend_code'] =
$workorder['vendor_id'];
$values['spbudact_code'] =
$workorder['b_account_id'];
- $values['location_code']
=$project['location_code'];
- $values['dima']
=str_replace('-','',$project['location_code']);
+ $values['location_code'] =
$project['location_code'];
+ $values['dima']
= str_replace('-','',$project['location_code']);
$values['vendor_name'] =
$this->get_vendor_name($workorder['vendor_id']);
$values['pmwrkord_code'] =
$values['order_id'];
- $values['project_id']
= $workorder['project_id'];
+ $values['project_id'] =
$workorder['project_id'];
if(!$values['dimb'])
{
$values['dimb']
= $workorder['ecodimb'];
@@ -497,15 +494,15 @@
$contacts->get_location_info('vendor',false);
$criteria = array
- (
- 'attributes' => array
(
- array
+ 'attributes' => array
(
- 'column_name' => 'org_name'
+ array
+ (
+ 'column_name' =>
'org_name'
+ )
)
- )
- );
+ );
$vendor_data = $contacts->read_single(array('id' =>
$vendor_id), $criteria);
Modified: trunk/property/inc/class.bojasper.inc.php
===================================================================
--- trunk/property/inc/class.bojasper.inc.php 2010-12-24 15:00:54 UTC (rev
6700)
+++ trunk/property/inc/class.bojasper.inc.php 2010-12-25 10:51:59 UTC (rev
6701)
@@ -53,23 +53,23 @@
$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');
- $app = phpgw::get_var('app');
+ $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');
+ $app = phpgw::get_var('app');
- $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->cat_id =
isset($_REQUEST['cat_id']) ? $cat_id :
$this->cat_id;
- $this->user_id =
isset($_REQUEST['user_id']) ? $user_id :
$this->user_id;;
- $this->allrows = isset($allrows) &&
$allrows ? $allrows : '';
- $this->app =
isset($_REQUEST['app']) ? $app :
$this->app;
+ $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->cat_id = isset($_REQUEST['cat_id'])
? $cat_id : $this->cat_id;
+ $this->user_id = isset($_REQUEST['user_id'])
? $user_id : $this->user_id;;
+ $this->allrows = isset($allrows) && $allrows
? $allrows : '';
+ $this->app =
isset($_REQUEST['app']) ? $app :
$this->app;
}
@@ -99,7 +99,7 @@
public function read()
{
$jasper = $this->so->read(array('start' =>
$this->start,'query' => $this->query,'sort' => $this->sort,'order' =>
$this->order,
@@ Diff output truncated at 153600 characters. @@
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [6701] Property: formatting: intend,
Sigurd Nes <=