fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [9356] property: dimb acl


From: Sigurd Nes
Subject: [Fmsystem-commits] [9356] property: dimb acl
Date: Thu, 10 May 2012 11:37:31 +0000

Revision: 9356
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=9356
Author:   sigurdne
Date:     2012-05-10 11:37:31 +0000 (Thu, 10 May 2012)
Log Message:
-----------
property: dimb acl

Modified Paths:
--------------
    trunk/property/inc/class.soinvoice.inc.php
    trunk/property/inc/class.uiproject.inc.php
    trunk/property/inc/class.uiworkorder.inc.php

Modified: trunk/property/inc/class.soinvoice.inc.php
===================================================================
--- trunk/property/inc/class.soinvoice.inc.php  2012-05-10 11:07:37 UTC (rev 
9355)
+++ trunk/property/inc/class.soinvoice.inc.php  2012-05-10 11:37:31 UTC (rev 
9356)
@@ -1828,14 +1828,15 @@
                public function get_deposition()
                {
                        $sql = "SELECT "
+                       . "dimb as kostnadssted,"
                        . "spbudact_code as art,"
+                       . "project_group as prosjekt,"
                        . "sum(belop) as belop,"
-                       . "dimb as kostnadssted,"
                        . "currency"
                        . ' FROM fm_workorder'
                        . " {$this->join} fm_project ON 
(fm_workorder.project_id = fm_project.id)"
                        . " {$this->join} fm_ecobilag ON (fm_workorder.id = 
fm_ecobilag.pmwrkord_code)"
-                       . " GROUP BY kostnadssted, art, currency ORDER BY 
kostnadssted, art, currency ASC";
+                       . " GROUP BY art, kostnadssted, project_group, currency 
ORDER BY kostnadssted,project_group, art, currency ASC";
                        $this->db->query($sql,__LINE__,__FILE__);
                        
                        $values = array();

Modified: trunk/property/inc/class.uiproject.inc.php
===================================================================
--- trunk/property/inc/class.uiproject.inc.php  2012-05-10 11:07:37 UTC (rev 
9355)
+++ trunk/property/inc/class.uiproject.inc.php  2012-05-10 11:37:31 UTC (rev 
9356)
@@ -1533,40 +1533,70 @@
                                        'project_id'    => (isset($id)?$id:'')
                                );
 
-                       $supervisor_id = 0;
-
-                       if ( 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['approval_from'])
-                               && 
$GLOBALS['phpgw_info']['user']['preferences']['property']['approval_from'] )
-                       {
-                               $supervisor_id = 
$GLOBALS['phpgw_info']['user']['preferences']['property']['approval_from'];
-                       }
-
-                       $need_approval = 
isset($config->config_data['project_approval'])?$config->config_data['project_approval']:'';
                        $supervisor_email = array();
-                       if ($supervisor_id && $need_approval)
+                       if($need_approval = 
isset($config->config_data['project_approval']) ? 
$config->config_data['project_approval'] : '')
                        {
-                               $prefs = 
$this->bocommon->create_preferences('property',$supervisor_id);
-                               $supervisor_email[] = array
+                               $invoice        = 
CreateObject('property.soinvoice');
+                               if(isset($config->config_data['invoice_acl']) 
&& $config->config_data['invoice_acl'] == 'dimb')
+                               {
+                                       $supervisor_id = 
$invoice->get_default_dimb_role_user(2, $values['ecodimb']);
+                                       $prefs = 
$this->bocommon->create_preferences('property',$supervisor_id);                 
               
+                                       $supervisor_email[] = array
                                        (
                                                'id'      => $supervisor_id,
                                                'address' => $prefs['email'],
                                        );
-                               if ( isset($prefs['approval_from']) )
+
+                                       $supervisor2_id = 
$invoice->get_default_dimb_role_user(3, $values['ecodimb']);
+                                       $prefs2 = 
$this->bocommon->create_preferences('property', $supervisor2_id);
+                                       $supervisor_email[] = array
+                                       (
+                                               'id'      => $supervisor2_id,
+                                               'address' => $prefs2['email'],
+                                       );
+                                       $supervisor_email = 
array_reverse($supervisor_email);
+                                       unset($prefs);
+                                       unset($prefs2);
+                                       unset($invoice);
+                               }
+                               else
                                {
-                                       $prefs2 = 
$this->bocommon->create_preferences('property', $prefs['approval_from']);
+                                       $supervisor_id = 0;
 
-                                       if(isset($prefs2['email']))
+                                       if ( 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['approval_from'])
+                                               && 
$GLOBALS['phpgw_info']['user']['preferences']['property']['approval_from'] )
                                        {
+                                               $supervisor_id = 
$GLOBALS['phpgw_info']['user']['preferences']['property']['approval_from'];
+                                       }
+
+
+                                       if ($supervisor_id )
+                                       {
+                                               $prefs = 
$this->bocommon->create_preferences('property',$supervisor_id);
                                                $supervisor_email[] = array
-                                                       (
-                                                               'id'      => 
$prefs['approval_from'],
-                                                               'address' => 
$prefs2['email'],
-                                                       );
-                                               $supervisor_email = 
array_reverse($supervisor_email);
+                                               (
+                                                       'id'      => 
$supervisor_id,
+                                                       'address' => 
$prefs['email'],
+                                               );
+
+                                               if ( 
isset($prefs['approval_from']) )
+                                               {
+                                                       $prefs2 = 
$this->bocommon->create_preferences('property', $prefs['approval_from']);
+
+                                                       
if(isset($prefs2['email']))
+                                                       {
+                                                               
$supervisor_email[] = array
+                                                               (
+                                                                       'id'    
  => $prefs['approval_from'],
+                                                                       
'address' => $prefs2['email'],
+                                                               );
+                                                               
$supervisor_email = array_reverse($supervisor_email);
+                                                       }
+                                                       unset($prefs2);
+                                               }
+                                               unset($prefs);
                                        }
-                                       unset($prefs2);
                                }
-                               unset($prefs);
                        }
 
                        
$project_status=(isset($GLOBALS['phpgw_info']['user']['preferences']['property']['project_status'])?$GLOBALS['phpgw_info']['user']['preferences']['property']['project_status']:'');

Modified: trunk/property/inc/class.uiworkorder.inc.php
===================================================================
--- trunk/property/inc/class.uiworkorder.inc.php        2012-05-10 11:07:37 UTC 
(rev 9355)
+++ trunk/property/inc/class.uiworkorder.inc.php        2012-05-10 11:37:31 UTC 
(rev 9356)
@@ -1477,48 +1477,76 @@
                        $values['actual_cost']  = 
number_format($values['actual_cost'], 2, ',', '');
 
                        $link_data = array
-                               (
-                                       'menuaction'    => 
'property.uiworkorder.edit',
-                                       'id'            => $id
-                               );
+                       (
+                               'menuaction'    => 'property.uiworkorder.edit',
+                               'id'                    => $id
+                       );
 
-                       $supervisor_id = 0;
-
-                       if ( 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['approval_from'])
-                               && 
$GLOBALS['phpgw_info']['user']['preferences']['property']['approval_from'] )
-                       {
-                               $supervisor_id = 
$GLOBALS['phpgw_info']['user']['preferences']['property']['approval_from'];
-                       }
-
-                       $need_approval = 
isset($config->config_data['workorder_approval']) ? 
$config->config_data['workorder_approval'] : '';
-
                        $supervisor_email = array();
-                       if ($supervisor_id && $need_approval)
+                       if($need_approval = 
isset($config->config_data['workorder_approval']) ? 
$config->config_data['workorder_approval'] : '')
                        {
-                               $prefs = 
$this->bocommon->create_preferences('property',$supervisor_id);
-                               $supervisor_email[] = array
+                               $invoice        = 
CreateObject('property.soinvoice');
+                               if(isset($config->config_data['invoice_acl']) 
&& $config->config_data['invoice_acl'] == 'dimb')
+                               {
+                                       $supervisor_id = 
$invoice->get_default_dimb_role_user(2, $values['ecodimb']);
+                                       $prefs = 
$this->bocommon->create_preferences('property',$supervisor_id);                 
               
+                                       $supervisor_email[] = array
                                        (
                                                'id'      => $supervisor_id,
                                                'address' => $prefs['email'],
                                        );
-                               if ( isset($prefs['approval_from']) )
+
+                                       $supervisor2_id = 
$invoice->get_default_dimb_role_user(3, $values['ecodimb']);
+                                       $prefs2 = 
$this->bocommon->create_preferences('property', $supervisor2_id);
+                                       $supervisor_email[] = array
+                                       (
+                                               'id'      => $supervisor2_id,
+                                               'address' => $prefs2['email'],
+                                       );
+                                       $supervisor_email = 
array_reverse($supervisor_email);
+                                       unset($prefs);
+                                       unset($prefs2);
+                                       unset($invoice);
+                               }
+                               else
                                {
-                                       $prefs2 = 
$this->bocommon->create_preferences('property', $prefs['approval_from']);
+                                       $supervisor_id = 0;
 
-                                       if(isset($prefs2['email']))
+                                       if ( 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['approval_from'])
+                                               && 
$GLOBALS['phpgw_info']['user']['preferences']['property']['approval_from'] )
                                        {
+                                               $supervisor_id = 
$GLOBALS['phpgw_info']['user']['preferences']['property']['approval_from'];
+                                       }
+
+
+                                       if ($supervisor_id )
+                                       {
+                                               $prefs = 
$this->bocommon->create_preferences('property',$supervisor_id);
                                                $supervisor_email[] = array
-                                                       (
-                                                               'id'      => 
$prefs['approval_from'],
-                                                               'address' => 
$prefs2['email'],
-                                                       );
-                                               $supervisor_email = 
array_reverse($supervisor_email);
+                                               (
+                                                       'id'      => 
$supervisor_id,
+                                                       'address' => 
$prefs['email'],
+                                               );
+
+                                               if ( 
isset($prefs['approval_from']) )
+                                               {
+                                                       $prefs2 = 
$this->bocommon->create_preferences('property', $prefs['approval_from']);
+
+                                                       
if(isset($prefs2['email']))
+                                                       {
+                                                               
$supervisor_email[] = array
+                                                               (
+                                                                       'id'    
  => $prefs['approval_from'],
+                                                                       
'address' => $prefs2['email'],
+                                                               );
+                                                               
$supervisor_email = array_reverse($supervisor_email);
+                                                       }
+                                                       unset($prefs2);
+                                               }
+                                               unset($prefs);
                                        }
-                                       unset($prefs2);
                                }
-                               unset($prefs);
                        }
-
                        
$workorder_status=(isset($GLOBALS['phpgw_info']['user']['preferences']['property']['workorder_status'])?$GLOBALS['phpgw_info']['user']['preferences']['property']['workorder_status']:'');
                        if(!$values['status'])
                        {




reply via email to

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