fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [16024] more on integration


From: sigurdne
Subject: [Fmsystem-commits] [16024] more on integration
Date: Fri, 25 Nov 2016 12:22:27 +0000 (UTC)

Revision: 16024
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=16024
Author:   sigurdne
Date:     2016-11-25 12:22:27 +0000 (Fri, 25 Nov 2016)
Log Message:
-----------
more on integration

Modified Paths:
--------------
    trunk/property/inc/class.botts.inc.php
    trunk/property/inc/class.uiwo_hour.inc.php

Modified: trunk/property/inc/class.botts.inc.php
===================================================================
--- trunk/property/inc/class.botts.inc.php      2016-11-25 10:21:03 UTC (rev 
16023)
+++ trunk/property/inc/class.botts.inc.php      2016-11-25 12:22:27 UTC (rev 
16024)
@@ -1823,15 +1823,23 @@
                                $username       = 
$config->config_data['external_register']['username'];
                                $password       = 
$config->config_data['external_register']['password'];
                                $sub_check = 'fullmakter';
-                               $fullmakter = 
$this->check_external_register(array(
-                                       'url'           => $url,
-                                       'username'      => $username,
-                                       'password'      => $password,
-                                       'sub_check'     => $sub_check,
-                                       'id'            => sprintf("%06s", 
$ecodimb)
-                                       )
-                               );
 
+                               try
+                               {
+                                       $fullmakter = 
$this->check_external_register(array(
+                                               'url'           => $url,
+                                               'username'      => $username,
+                                               'password'      => $password,
+                                               'sub_check'     => $sub_check,
+                                               'id'            => 
sprintf("%06s", $ecodimb)
+                                               )
+                                       );
+                               }
+                               catch (Exception $ex)
+                               {
+                                       throw $ex;
+                               }
+
                                /**
                                 * some magic...to decide $supervisor_lid
                                 * Agresso/Bergen spesific
@@ -1946,6 +1954,11 @@
                        $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
                        curl_close($ch);
 
+                       if($httpCode != 200)
+                       {
+                               throw new Exception("HTTP-status {$httpCode}");
+                       }
+
                        return json_decode($result, true);
                }
 

Modified: trunk/property/inc/class.uiwo_hour.inc.php
===================================================================
--- trunk/property/inc/class.uiwo_hour.inc.php  2016-11-25 10:21:03 UTC (rev 
16023)
+++ trunk/property/inc/class.uiwo_hour.inc.php  2016-11-25 12:22:27 UTC (rev 
16024)
@@ -1908,8 +1908,17 @@
                        }
                        else
                        {
-                               
if(!$this->_validate_purchase_grant($workorder_id, $project['ecodimb'] ? 
$project['ecodimb'] : $workorder['ecodimb']))
+                               try
                                {
+                                       $_validated = 
$this->_validate_purchase_grant($workorder_id, $project['ecodimb'] ? 
$project['ecodimb'] : $workorder['ecodimb']);
+                               }
+                               catch (Exception $ex)
+                               {
+                                       throw $ex;
+                               }
+
+                               if(!$_validated)
+                               {
                                        throw new Exception(lang('order %1 is 
not approved'), $workorder_id);
 //                                     
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction' => 
'property.uiwo_hour.view',
 //                                             'workorder_id' => 
$workorder_id, 'from' => phpgw::get_var('from')));
@@ -3405,6 +3414,7 @@
                        {
                                if ($e)
                                {
+                                       
phpgwapi_cache::message_set($e->getMessage(), 'error');
                                        throw $e;
                                }
                        }
@@ -3452,12 +3462,18 @@
                        $_budget_amount = 
$this->boworkorder->get_budget_amount($id);
                        $historylog = CreateObject('property.historylog', 
'workorder');
 
-                       $purchase_grant_ok = false;
-                       $check_purchase = 
createObject('property.botts')->check_purchase_right($ecodimb, $_budget_amount, 
$id);
-                       if($check_purchase)
+                       try
                        {
-                               $purchase_grant_ok = true;
+                               $check_purchase = 
createObject('property.botts')->check_purchase_right($ecodimb, $_budget_amount, 
$id);
+
                        }
+                       catch (Exception $ex)
+                       {
+                               throw $ex;
+                       }
+
+                       $purchase_grant_ok = true;
+
                        foreach ($check_purchase as $purchase_grant)
                        {
                                if(!$purchase_grant['is_user'] && 
($purchase_grant['required'] && !$purchase_grant['approved']))




reply via email to

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