fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [17250] prepare for custom code outside tree


From: sigurdne
Subject: [Fmsystem-commits] [17250] prepare for custom code outside tree
Date: Wed, 1 Nov 2017 15:15:05 -0400 (EDT)

Revision: 17250
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=17250
Author:   sigurdne
Date:     2017-11-01 15:15:04 -0400 (Wed, 01 Nov 2017)
Log Message:
-----------
prepare for custom code outside tree

Added Paths:
-----------
    
thirdparty/PE_custom/BK_EBF/property/inc/custom/default/kalkuler_risiko_for_ros.php

Copied: 
thirdparty/PE_custom/BK_EBF/property/inc/custom/default/kalkuler_risiko_for_ros.php
 (from rev 17218, trunk/property/inc/custom/default/kalkuler_risiko_for_ros.php)
===================================================================
--- 
thirdparty/PE_custom/BK_EBF/property/inc/custom/default/kalkuler_risiko_for_ros.php
                         (rev 0)
+++ 
thirdparty/PE_custom/BK_EBF/property/inc/custom/default/kalkuler_risiko_for_ros.php
 2017-11-01 19:15:04 UTC (rev 17250)
@@ -0,0 +1,91 @@
+<?php
+//_debug_array($values);
+//_debug_array($values_attribute);
+//_debug_array($action);
+       // this routine will only work with the exact configuration of Bergen 
Bolig og Byfornyelse - but can serve as an example
+
+       $db = & $GLOBALS['phpgw']->db;
+
+       if (isSet($values_attribute) AND is_array($values_attribute))
+       {
+
+               foreach ($values_attribute as $entry)
+               {
+                       switch ($entry['name'])
+                       {
+                               case 'sansynlighet':
+                                       $sansynlighet = (int)$entry['value'];
+                                       break;
+                       }
+               }
+
+               reset($values_attribute);
+
+               $value_set['r_tverrfaglig'] = 0;
+
+               foreach ($values_attribute as $entry)
+               {
+                       $risk = $entry['value'] * $sansynlighet;
+                       switch ($entry['name'])
+                       {
+                               case 'k_beboer':
+                                       $value_set['r_beboer'] = $risk;
+                                       if ($risk > $value_set['r_tverrfaglig'])
+                                       {
+                                               $value_set['r_tverrfaglig'] = 
$risk;
+                                       }
+                                       break;
+                               case 'k_miljo':
+                                       $value_set['r_miljo'] = $risk;
+                                       if ($risk > $value_set['r_tverrfaglig'])
+                                       {
+                                               $value_set['r_tverrfaglig'] = 
$risk;
+                                       }
+                                       break;
+                               case 'k_ok_verdier':
+                                       $value_set['r_ok_verdier'] = $risk;
+                                       if ($risk > $value_set['r_tverrfaglig'])
+                                       {
+                                               $value_set['r_tverrfaglig'] = 
$risk;
+                                       }
+                                       break;
+                               case 'k_drift':
+                                       $value_set['r_drift'] = $risk;
+                                       if ($risk > $value_set['r_tverrfaglig'])
+                                       {
+                                               $value_set['r_tverrfaglig'] = 
$risk;
+                                       }
+                                       break;
+                               case 'k_ansatte':
+                                       $value_set['r_ansatte'] = $risk;
+                                       if ($risk > $value_set['r_tverrfaglig'])
+                                       {
+                                               $value_set['r_tverrfaglig'] = 
$risk;
+                                       }
+                                       break;
+                               case 'k_annet':
+                                       $value_set['r_annet'] = $risk;
+                                       if ($risk > $value_set['r_tverrfaglig'])
+                                       {
+                                               $value_set['r_tverrfaglig'] = 
$risk;
+                                       }
+                                       break;
+                       }
+               }
+
+               $db->transaction_begin();
+
+               $location_id = $GLOBALS['phpgw']->locations->get_id('property', 
'.entity.2.6');
+
+//             $sql = "UPDATE fm_entity_2_6 set $value_set WHERE id=" . 
(int)$receipt['id'];
+
+               foreach ($value_set as $_key => $_value)
+               {
+                       $sql = "UPDATE fm_bim_item SET 
json_representation=jsonb_set(json_representation, '{{$_key}}', 
'\"{$_value}\"', true)"
+                               . " WHERE location_id = {$location_id}"
+                               . " AND id=" . (int)$receipt['id'];
+                       $db->query($sql, __LINE__, __FILE__);
+               }
+
+               $db->transaction_commit();
+       }


Property changes on: 
thirdparty/PE_custom/BK_EBF/property/inc/custom/default/kalkuler_risiko_for_ros.php
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Revision Author Id
\ No newline at end of property
Added: svn:mergeinfo
## -0,0 +1,3 ##
+/branches/dev-syncromind/property/inc/custom/default/kalkuler_risiko_for_ros.php:13653
+/branches/dev-syncromind-2/property/inc/custom/default/kalkuler_risiko_for_ros.php:14933-16846
+/branches/stavangerkommune/property/inc/custom/default/kalkuler_risiko_for_ros.php:12743-12875,12986
\ No newline at end of property



reply via email to

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