fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [16016] more on integration


From: sigurdne
Subject: [Fmsystem-commits] [16016] more on integration
Date: Tue, 22 Nov 2016 13:13:56 +0000 (UTC)

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

Modified Paths:
--------------
    trunk/property/inc/class.botts.inc.php
    trunk/property/inc/class.uitts.inc.php
    trunk/property/inc/class.uiworkorder.inc.php
    trunk/property/js/portico/workorder.edit.js

Modified: trunk/property/inc/class.botts.inc.php
===================================================================
--- trunk/property/inc/class.botts.inc.php      2016-11-22 12:25:48 UTC (rev 
16015)
+++ trunk/property/inc/class.botts.inc.php      2016-11-22 13:13:55 UTC (rev 
16016)
@@ -1854,12 +1854,7 @@
                                        {
                                                $supervisor_lid = 
strtolower($fullmakter[0]['ubegrenset']);
                                        }
-                                       else
-                                       {
-                                               $supervisor_lid = ''; // maybe 
add a required configurable failsafe as backup...
-                                       }
                                }
-       //                      $supervisor_lid = 'hc483';
 
                                /*
                                        [inntil100k] => (string) DV645
@@ -1872,8 +1867,11 @@
                                        [aktiv] => (bool) true
                                */
 
-                               $supervisor_id = 
$GLOBALS['phpgw']->accounts->name2id($supervisor_lid);
-                               $supervisors[$supervisor_id] = array('id' => 
$supervisor_id, 'required' => true);
+                               if($supervisor_lid)
+                               {
+                                       $supervisor_id = 
$GLOBALS['phpgw']->accounts->name2id($supervisor_lid);
+                                       $supervisors[$supervisor_id] = 
array('id' => $supervisor_id, 'required' => true);
+                               }
                        }
                        else
                        {

Modified: trunk/property/inc/class.uitts.inc.php
===================================================================
--- trunk/property/inc/class.uitts.inc.php      2016-11-22 12:25:48 UTC (rev 
16015)
+++ trunk/property/inc/class.uitts.inc.php      2016-11-22 13:13:55 UTC (rev 
16016)
@@ -2172,12 +2172,12 @@
                                        $action_params['responsible'] = 
$_account_id;
                                        try
                                        {
+                                               $historylog->add('AR', $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');
-                                                       $historylog->add('AR', 
$id, $GLOBALS['phpgw']->accounts->get($_account_id)->__toString() . 
"::{$_budget_amount}");
-                                                       
execMethod('property.sopending_action.set_pending_action', $action_params);
                                                }
                                        }
                                        catch (Exception $exc)

Modified: trunk/property/inc/class.uiworkorder.inc.php
===================================================================
--- trunk/property/inc/class.uiworkorder.inc.php        2016-11-22 12:25:48 UTC 
(rev 16015)
+++ trunk/property/inc/class.uiworkorder.inc.php        2016-11-22 13:13:55 UTC 
(rev 16016)
@@ -851,9 +851,9 @@
                                        'msg' => lang('Percentage addition') . 
': ' . lang('Please enter an integer !'));
                        }
 
-                       if ($values['approval'] && $values['mail_address'] && 
$config->config_data['workorder_approval'])
+                       if (!empty($values['approval']) && 
!empty($config->config_data['workorder_approval']))
                        {
-                               if 
(isset($config->config_data['workorder_approval_status']) && 
$config->config_data['workorder_approval_status'])
+                               if 
(!empty($config->config_data['workorder_approval_status']))
                                {
                                        $values['status'] = 
$config->config_data['workorder_approval_status'];
                                }
@@ -1016,12 +1016,12 @@
                                                $action_params['responsible'] = 
$_account_id;
                                                try
                                                {
+                                                       $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');
-                                                               
$historylog->add('AP', $id, 
$GLOBALS['phpgw']->accounts->get($_account_id)->__toString() . 
"::{$_budget_amount}");
-                                                               
execMethod('property.sopending_action.set_pending_action', $action_params);
                                                        }
                                                }
                                                catch (Exception $exc)

Modified: trunk/property/js/portico/workorder.edit.js
===================================================================
--- trunk/property/js/portico/workorder.edit.js 2016-11-22 12:25:48 UTC (rev 
16015)
+++ trunk/property/js/portico/workorder.edit.js 2016-11-22 13:13:55 UTC (rev 
16016)
@@ -1,4 +1,5 @@
 var amount = 0;
+var order_id;
 var vendor_id;
 var project_ecodimb;
 
@@ -463,7 +464,8 @@
 $(window).on('load', function ()
 {
        ecodimb = $('#ecodimb').val();
-       ecodimb = ecodimb || project_ecodimb
+       ecodimb = ecodimb || project_ecodimb;
+
        if (ecodimb)
        {
                populateTableChkApproval();
@@ -472,12 +474,17 @@
        $("#ecodimb_name").on("autocompleteselect", function (event, ui)
        {
                var ecodimb = ui.item.value;
-               if (ecodimb != ecodimb_selection)
+               if (ecodimb !== ecodimb_selection)
                {
                        populateTableChkApproval(ecodimb);
                }
        });
 
+       $("#field_contract_sum").change(function ()
+       {
+               populateTableChkApproval();
+       });
+
        $("#field_budget").change(function ()
        {
                populateTableChkApproval();
@@ -488,14 +495,18 @@
 function populateTableChkApproval(ecodimb)
 {
        ecodimb = ecodimb || $('#ecodimb').val();
-       ecodimb = ecodimb || project_ecodimb
+       ecodimb = ecodimb || project_ecodimb;
 
        if (!ecodimb)
        {
                return;
        }
 
-       var total_amount = Number(amount) + Number($('#field_budget').val());
+       var contract_sum = Number($('#field_contract_sum').val());
+       var budget_sum = Number($('#field_budget').val());
+
+       var total_amount = Math.max(contract_sum, budget_sum) || Number(amount);
+
        $("#order_received_amount").val(total_amount);
 
        var oArgs = {menuaction: 'property.uitts.check_purchase_right', 
ecodimb: ecodimb, amount: total_amount, order_id: order_id};




reply via email to

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