[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [9248] property: invoice: more on ACL based on dime
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [9248] property: invoice: more on ACL based on dime |
Date: |
Mon, 30 Apr 2012 09:41:41 +0000 |
Revision: 9248
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=9248
Author: sigurdne
Date: 2012-04-30 09:41:41 +0000 (Mon, 30 Apr 2012)
Log Message:
-----------
property: invoice: more on ACL based on dime
Modified Paths:
--------------
trunk/property/inc/class.boinvoice.inc.php
trunk/property/inc/class.soinvoice.inc.php
trunk/property/inc/class.uiinvoice2.inc.php
Modified: trunk/property/inc/class.boinvoice.inc.php
===================================================================
--- trunk/property/inc/class.boinvoice.inc.php 2012-04-30 08:40:03 UTC (rev
9247)
+++ trunk/property/inc/class.boinvoice.inc.php 2012-04-30 09:41:41 UTC (rev
9248)
@@ -773,6 +773,11 @@
return $this->so->check_role($dimb);
}
+ public function get_dimb_role_user($role_id, $selected = '')
+ {
+ return $this->so->get_dimb_role_user($role_id,
$selected);
+ }
+
public function get_historical_accounting_periods()
{
return $this->so->get_historical_accounting_periods();
Modified: trunk/property/inc/class.soinvoice.inc.php
===================================================================
--- trunk/property/inc/class.soinvoice.inc.php 2012-04-30 08:40:03 UTC (rev
9247)
+++ trunk/property/inc/class.soinvoice.inc.php 2012-04-30 09:41:41 UTC (rev
9248)
@@ -1070,6 +1070,32 @@
return $this->role;
}
+ function get_dimb_role_user($role_id, $selected = '')
+ {
+ $filter_dimb = '';
+ $role_id = (int) $role_id;
+ $sql = "SELECT DISTINCT account_lid,account_lastname,
account_firstname FROM fm_ecodimb_role_user"
+ ." {$this->db->join} phpgw_accounts ON
fm_ecodimb_role_user.user_id = phpgw_accounts.account_id"
+ ." WHERE role_id = {$role_id} {$filter_dimb} AND
expired_on IS NULL"
+ ." ORDER BY account_lastname ASC, account_firstname
ASC";
+
+//_debug_array($sql);
+ $this->db->query($sql,__LINE__,__FILE__);
+
+ $values = array();
+ while($this->db->next_record())
+ {
+ $id = $this->db->f('account_lid');
+ $values[] = array
+ (
+ 'id' => $id,
+ 'name' =>
$this->db->f('account_lastname') . ', ' . $this->db->f('account_firstname'),
+ 'selected' => $selected == $id ? 1
: 0
+ );
+ }
+ return $values;
+ }
+
function check_count($voucher_id)
{
Modified: trunk/property/inc/class.uiinvoice2.inc.php
===================================================================
--- trunk/property/inc/class.uiinvoice2.inc.php 2012-04-30 08:40:03 UTC (rev
9247)
+++ trunk/property/inc/class.uiinvoice2.inc.php 2012-04-30 09:41:41 UTC (rev
9248)
@@ -45,12 +45,7 @@
var $type_id;
var $location_code;
- private $so_control_area;
- private $so_control;
- private $so_check_list;
- private $so_control_item;
- private $so_check_item;
- private $so_procedure;
+ private $config;
var $public_functions = array
(
@@ -82,6 +77,9 @@
// self::set_active_menu('property::invoice::invoice2');
$GLOBALS['phpgw_info']['flags']['menu_selection'] =
'property::invoice::invoice2';
+ $this->config =
CreateObject('phpgwapi.config','property');
+ $this->config->read();
+
}
public function add_javascript($app, $pkg, $name)
@@ -190,9 +188,18 @@
return $this->query();
}
- $janitor_list =
$this->bocommon->get_user_list_right(32,$janitor,'.invoice');
- $supervisor_list =
$this->bocommon->get_user_list_right(64,$supervisor,'.invoice');
- $budget_responsible_list =
$this->bocommon->get_user_list_right(128,$budget_responsible,'.invoice');
+ if(isset($this->config->config_data['invoice_acl']) &&
$this->config->config_data['invoice_acl'] == 'dimb')
+ {
+ $janitor_list =
$this->bo->get_dimb_role_user(1,$janitor);
+ $supervisor_list =
$this->bo->get_dimb_role_user(2,$supervisor);
+ $budget_responsible_list =
$this->bo->get_dimb_role_user(3,$budget_responsible);
+ }
+ else
+ {
+ $janitor_list =
$this->bocommon->get_user_list_right(32,$janitor,'.invoice');
+ $supervisor_list =
$this->bocommon->get_user_list_right(64,$supervisor,'.invoice');
+ $budget_responsible_list =
$this->bocommon->get_user_list_right(128,$budget_responsible,'.invoice');
+ }
$userlist_default = array();
$userlist_default[] = array('id'=> '*' .
$GLOBALS['phpgw']->accounts->get($this->account_id)->lid, 'name'=>lang('mine
vouchers'));
@@ -518,6 +525,20 @@
{
//---------start forward
+
+
if(isset($this->config->config_data['invoice_acl']) &&
$this->config->config_data['invoice_acl'] == 'dimb')
+ {
+ $janitor_list
=
$this->bo->get_dimb_role_user(1,isset($voucher[0]['janitor'])?$voucher[0]['janitor']:'');
+ $supervisor_list
=
$this->bo->get_dimb_role_user(2,isset($voucher[0]['supervisor'])?$voucher[0]['supervisor']:'');
+ $budget_responsible_list =
$this->bo->get_dimb_role_user(3,isset($voucher[0]['budget_responsible'])?$voucher[0]['budget_responsible']:'');
+ }
+ else
+ {
+ $janitor_list
=
$this->bocommon->get_user_list_right(32,isset($voucher[0]['janitor'])?$voucher[0]['janitor']:'','.invoice');
+ $supervisor_list
=
$this->bocommon->get_user_list_right(64,isset($voucher[0]['supervisor'])?$voucher[0]['supervisor']:'','.invoice');
+ $budget_responsible_list =
$this->bocommon->get_user_list_right(128,isset($voucher[0]['budget_responsible'])?$voucher[0]['budget_responsible']:'','.invoice');
+ }
+
$approve =
execMethod('property.uiinvoice.get_approve_role', $voucher[0]['dim_b']);
$approved_list[] = array
@@ -526,7 +547,7 @@
'role_sign' => 'oppsynsmannid',
'initials' =>
$voucher[0]['janitor'] ? $voucher[0]['janitor'] : '',
'date' =>
$voucher[0]['oppsynsigndato'] ? $GLOBALS['phpgw']->common->show_date(
strtotime( $voucher[0]['oppsynsigndato'] ) ) :'',
- 'user_list' =>
!$voucher[0]['oppsynsigndato'] ? array('options' =>
$this->bocommon->get_user_list_right(32,isset($voucher[0]['janitor'])?$voucher[0]['janitor']:'','.invoice'))
: ''
+ 'user_list' =>
!$voucher[0]['oppsynsigndato'] ? array('options' => $janitor_list) : ''
);
$approved_list[] = array
(
@@ -534,7 +555,7 @@
'role_sign' => 'saksbehandlerid',
'initials' =>
$voucher[0]['supervisor'] ? $voucher[0]['supervisor'] : '',
'date' =>
$voucher[0]['saksigndato'] ? $GLOBALS['phpgw']->common->show_date( strtotime(
$voucher[0]['saksigndato'] ) ) :'',
- 'user_list' =>
!$voucher[0]['saksigndato'] ? array('options' =>
$this->bocommon->get_user_list_right(64,isset($voucher[0]['supervisor'])?$voucher[0]['supervisor']:'','.invoice'))
: ''
+ 'user_list' =>
!$voucher[0]['saksigndato'] ?array('options' => $supervisor_list) : ''
);
$approved_list[] = array
(
@@ -542,7 +563,7 @@
'role_sign' =>
'budsjettansvarligid',
'initials' =>
$voucher[0]['budget_responsible'] ? $voucher[0]['budget_responsible'] : '',
'date' =>
$voucher[0]['budsjettsigndato'] ? $GLOBALS['phpgw']->common->show_date(
strtotime( $voucher[0]['budsjettsigndato'] ) ) :'',
- 'user_list' =>
!$voucher[0]['budsjettsigndato'] ? array('options' =>
$this->bocommon->get_user_list_right(128,isset($voucher[0]['budget_responsible'])?$voucher[0]['budget_responsible']:'','.invoice'))
: ''
+ 'user_list' =>
!$voucher[0]['budsjettsigndato'] ? array('options' => $budget_responsible_list)
: ''
);
foreach($approved_list as &$_approved_list)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [9248] property: invoice: more on ACL based on dime,
Sigurd Nes <=