fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [16299] more on approval


From: sigurdne
Subject: [Fmsystem-commits] [16299] more on approval
Date: Mon, 13 Feb 2017 06:21:25 -0500 (EST)

Revision: 16299
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=16299
Author:   sigurdne
Date:     2017-02-13 06:21:25 -0500 (Mon, 13 Feb 2017)
Log Message:
-----------
more on approval

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

Modified: trunk/property/inc/class.uiworkorder.inc.php
===================================================================
--- trunk/property/inc/class.uiworkorder.inc.php        2017-02-13 09:29:43 UTC 
(rev 16298)
+++ trunk/property/inc/class.uiworkorder.inc.php        2017-02-13 11:21:25 UTC 
(rev 16299)
@@ -975,6 +975,40 @@
                                                        $subject = 
lang('Approval') . ": {$values['project_id']}";
                                                        $message = '<a href ="' 
. $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
$approval_menuaction,
                                                                        'id' => 
$values['project_id']), false, true) . '">' . lang('project %1 needs approval', 
$values['project_id']) . '</a>';
+
+
+
+                                                       //already approved?
+
+                                                       $pending_action = 
CreateObject('property.sopending_action');
+
+
+                                               foreach ($values['approval'] as 
$_account_id => $_address)
+                                               {
+                                                       $action_params_approved 
= array
+                                                       (
+                                                               'appname' => 
'property',
+                                                               'location' => 
'.project',
+                                                               'id' => 
$values['project_id'],
+                                                               'responsible' 
=> $_account_id,
+                                                               
'responsible_type' => 'user',
+                                                               'action' => 
'approval',
+                                                               'remark' => '',
+                                                               'deadline' => 
'',
+                                                               'allrows' => 
false,
+                                                               'closed' => true
+                                                       );
+
+                                                       $approvals = 
$pending_action->get_pending_action($action_params);
+
+                                                       if($approvals)
+                                                       {
+
+                                                       }
+
+                                               }
+
+
                                                        if 
(isset($config->config_data['project_approval_status']) && 
$config->config_data['project_approval_status'])
                                                        {
                                                                
$_project_status = $config->config_data['project_approval_status'];
@@ -1030,24 +1064,27 @@
                                                        $_address = 
$GLOBALS['phpgw']->accounts->id2lid($_account_id) . "@{$email_domain}";
                                                }
 
-                                               foreach ($_orders as $_order_id)
+                                               if($approval_level == 'order')
                                                {
-                                                       
$action_params['responsible'] = $_account_id;
-                                                       $action_params['id'] = 
$_order_id;
-                                                       try
+                                                       foreach ($_orders as 
$_order_id)
                                                        {
-                                                               
$historylog->add('AP', $id, 
$GLOBALS['phpgw']->accounts->get($_account_id)->__toString() . 
"::{$_budget_amount}");
-                                                               
execMethod('property.sopending_action.set_pending_action', $action_params);
-                                                               $rcpt = 
$GLOBALS['phpgw']->send->msg('email', $_address, $subject, 
stripslashes($message), '', $cc, $bcc, $coordinator_email, $coordinator_name, 
'html');
-                                                               if ($rcpt)
+                                                               
$action_params['responsible'] = $_account_id;
+                                                               
$action_params['id'] = $_order_id;
+                                                               try
                                                                {
-                                                                       
phpgwapi_cache::message_set(lang('%1 is notified', $_address),'message');
+                                                                       
$historylog->add('AP', $id, 
$GLOBALS['phpgw']->accounts->get($_account_id)->__toString() . 
"::{$_budget_amount}");
+                                                                       
execMethod('property.sopending_action.set_pending_action', $action_params);
+                                                                       $rcpt = 
$GLOBALS['phpgw']->send->msg('email', $_address, $subject, 
stripslashes($message), '', $cc, $bcc, $coordinator_email, $coordinator_name, 
'html');
+                                                                       if 
($rcpt)
+                                                                       {
+                                                                               
phpgwapi_cache::message_set(lang('%1 is notified', $_address),'message');
+                                                                       }
                                                                }
+                                                               catch 
(Exception $exc)
+                                                               {
+                                                                       
phpgwapi_cache::message_set($exc->getMessage(),'error');
+                                                               }
                                                        }
-                                                       catch (Exception $exc)
-                                                       {
-                                                               
phpgwapi_cache::message_set($exc->getMessage(),'error');
-                                                       }
                                                }
                                        }
                                }




reply via email to

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