fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [9252] property: invoice: more on ACL based on dime


From: Sigurd Nes
Subject: [Fmsystem-commits] [9252] property: invoice: more on ACL based on dime
Date: Tue, 01 May 2012 22:02:35 +0000

Revision: 9252
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=9252
Author:   sigurdne
Date:     2012-05-01 22:02:35 +0000 (Tue, 01 May 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
    trunk/property/inc/class.uiproject.inc.php
    trunk/property/inc/class.uiwo_hour.inc.php
    trunk/property/inc/class.uiworkorder.inc.php

Modified: trunk/property/inc/class.boinvoice.inc.php
===================================================================
--- trunk/property/inc/class.boinvoice.inc.php  2012-05-01 20:31:24 UTC (rev 
9251)
+++ trunk/property/inc/class.boinvoice.inc.php  2012-05-01 22:02:35 UTC (rev 
9252)
@@ -773,9 +773,9 @@
                        return $this->so->check_role($dimb);
                }
 
-               public function get_dimb_role_user($role_id, $selected = '')
+               public function get_dimb_role_user($role_id, $dimb = '', 
$selected = '')
                {
-                       return $this->so->get_dimb_role_user($role_id, 
$selected);
+                       return $this->so->get_dimb_role_user($role_id, $dimb, 
$selected);
                }
 
                public function get_historical_accounting_periods()

Modified: trunk/property/inc/class.soinvoice.inc.php
===================================================================
--- trunk/property/inc/class.soinvoice.inc.php  2012-05-01 20:31:24 UTC (rev 
9251)
+++ trunk/property/inc/class.soinvoice.inc.php  2012-05-01 22:02:35 UTC (rev 
9252)
@@ -1070,9 +1070,9 @@
                        return $this->role;
                }
 
-               function get_dimb_role_user($role_id, $selected = '')
+               function get_dimb_role_user($role_id, $dimb = '', $selected = 
'')
                {
-                       $filter_dimb = '';
+                       $filter_dimb = $dimb ? "AND ecodimb = {$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"

Modified: trunk/property/inc/class.uiinvoice2.inc.php
===================================================================
--- trunk/property/inc/class.uiinvoice2.inc.php 2012-05-01 20:31:24 UTC (rev 
9251)
+++ trunk/property/inc/class.uiinvoice2.inc.php 2012-05-01 22:02:35 UTC (rev 
9252)
@@ -190,9 +190,9 @@
 
                        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);
+                               $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
                        {
@@ -528,9 +528,9 @@
 
                                
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']:'');
+                                       $janitor_list                           
= $this->bo->get_dimb_role_user(1,$voucher[0]['dim_b'], 
isset($voucher[0]['janitor'])?$voucher[0]['janitor']:'');
+                                       $supervisor_list                        
= $this->bo->get_dimb_role_user(2,$voucher[0]['dim_b'], 
isset($voucher[0]['supervisor'])?$voucher[0]['supervisor']:'');
+                                       $budget_responsible_list        = 
$this->bo->get_dimb_role_user(3,$voucher[0]['dim_b'], 
isset($voucher[0]['budget_responsible'])?$voucher[0]['budget_responsible']:'');
                                }
                                else
                                {

Modified: trunk/property/inc/class.uiproject.inc.php
===================================================================
--- trunk/property/inc/class.uiproject.inc.php  2012-05-01 20:31:24 UTC (rev 
9251)
+++ trunk/property/inc/class.uiproject.inc.php  2012-05-01 22:02:35 UTC (rev 
9252)
@@ -1117,7 +1117,7 @@
                                                }
 
                                                $approve_role = 
execMethod('property.boinvoice.check_role', $values['ecodimb']);
-                                               if( 
!$approve_role['is_supervisor'] && ! $approve_role['budget_responsible'])
+                                               if( 
!$approve_role['is_supervisor'] && ! $approve_role['is_budget_responsible'])
                                                {
                                                        
$receipt['error'][]=array('msg'=>lang('you are not approved for this dimb: %1', 
$values['ecodimb'] ));
                                                        $error_id=true;

Modified: trunk/property/inc/class.uiwo_hour.inc.php
===================================================================
--- trunk/property/inc/class.uiwo_hour.inc.php  2012-05-01 20:31:24 UTC (rev 
9251)
+++ trunk/property/inc/class.uiwo_hour.inc.php  2012-05-01 22:02:35 UTC (rev 
9252)
@@ -1446,7 +1446,7 @@
                                
if(isset($this->config->config_data['invoice_acl']) && 
$this->config->config_data['invoice_acl'] == 'dimb')
                                {
                                        $approve_role = 
execMethod('property.boinvoice.check_role', $project['ecodimb'] ? 
$project['ecodimb'] : $workorder['ecodimb']);
-                                       if(!$approve_role['is_supervisor'] && ! 
$approve_role['budget_responsible'] && !$workorder['approved'])
+                                       if(!$approve_role['is_supervisor'] && ! 
$approve_role['is_budget_responsible'] && !$workorder['approved'])
                                        {
                                                phpgwapi_cache::message_set( 
lang('you are not approved for this dimb: %1', $project['ecodimb'] ? 
$project['ecodimb'] : $workorder['ecodimb'] ), 'error' );
                                                
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uiwo_hour.view', 'workorder_id'=> $workorder_id, 'from' => 
phpgw::get_var('from')));
@@ -1887,7 +1887,7 @@
                        if(isset($this->config->config_data['invoice_acl']) && 
$this->config->config_data['invoice_acl'] == 'dimb')
                        {
                                $approve_role = 
execMethod('property.boinvoice.check_role', $project['ecodimb'] ? 
$project['ecodimb'] : $common_data['workorder']['ecodimb']);
-                               if(!$approve_role['is_supervisor'] && ! 
$approve_role['budget_responsible'] && !$workorder['approved'])
+                               if(!$approve_role['is_supervisor'] && ! 
$approve_role['is_budget_responsible'] && !$workorder['approved'])
                                {
                                        phpgwapi_cache::message_set( lang('you 
are not approved for this dimb: %1', $project['ecodimb'] ? $project['ecodimb'] 
: $workorder['ecodimb'] ), 'error' );
                                        
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uiwo_hour.view', 'workorder_id'=> $workorder_id, 'from' => 
phpgw::get_var('from')));

Modified: trunk/property/inc/class.uiworkorder.inc.php
===================================================================
--- trunk/property/inc/class.uiworkorder.inc.php        2012-05-01 20:31:24 UTC 
(rev 9251)
+++ trunk/property/inc/class.uiworkorder.inc.php        2012-05-01 22:02:35 UTC 
(rev 9252)
@@ -972,7 +972,7 @@
                                if(isset($config->config_data['invoice_acl']) 
&& $config->config_data['invoice_acl'] == 'dimb')
                                {
                                        $approve_role = 
execMethod('property.boinvoice.check_role', $project['ecodimb'] ? 
$project['ecodimb'] : $values['ecodimb']);
-                                       if(!$approve_role['is_janitor'] && 
!$approve_role['is_supervisor'] && ! $approve_role['budget_responsible'])
+                                       if(!$approve_role['is_janitor'] && 
!$approve_role['is_supervisor'] && ! $approve_role['is_budget_responsible'])
                                        {
                                                
$receipt['error'][]=array('msg'=>lang('you are not approved for this dimb: %1', 
$project['ecodimb'] ? $project['ecodimb'] : $values['ecodimb'] ));
                                                $error_id=true;
@@ -980,7 +980,7 @@
 
                                        if(isset($values['approved']) && 
$values['approved'] && (!isset($values['approved_orig']) || ! 
$values['approved_orig']))
                                        {
-                                               
if(!$approve_role['is_supervisor'] && ! $approve_role['budget_responsible'])
+                                               
if(!$approve_role['is_supervisor'] && ! $approve_role['is_budget_responsible'])
                                                {
                                                        
$receipt['error'][]=array('msg'=>lang('you do not have permission to approve 
this order') );
                                                        $error_id=true;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]