[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [17249] prepare for custom code outside tree
From: |
sigurdne |
Subject: |
[Fmsystem-commits] [17249] prepare for custom code outside tree |
Date: |
Wed, 1 Nov 2017 15:14:38 -0400 (EDT) |
Revision: 17249
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=17249
Author: sigurdne
Date: 2017-11-01 15:14:38 -0400 (Wed, 01 Nov 2017)
Log Message:
-----------
prepare for custom code outside tree
Added Paths:
-----------
thirdparty/PE_custom/BK_EBF/property/inc/custom/default/innflyttetdato_entity_2_11_BBB.php
Copied:
thirdparty/PE_custom/BK_EBF/property/inc/custom/default/innflyttetdato_entity_2_11_BBB.php
(from rev 17218,
trunk/property/inc/custom/default/innflyttetdato_entity_2_11_BBB.php)
===================================================================
---
thirdparty/PE_custom/BK_EBF/property/inc/custom/default/innflyttetdato_entity_2_11_BBB.php
(rev 0)
+++
thirdparty/PE_custom/BK_EBF/property/inc/custom/default/innflyttetdato_entity_2_11_BBB.php
2017-11-01 19:14:38 UTC (rev 17249)
@@ -0,0 +1,41 @@
+<?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;
+
+ $location_id = $GLOBALS['phpgw']->locations->get_id('property',
'.entity.2.11');
+
+// $sql = "SELECT innflyttet FROM fm_entity_2_11 WHERE location_code ='" .
$values['location_code'] . "'";
+
+ $sql = "SELECT id, json_representation->>'innflyttet' as innflyttet
FROM fm_bim_item"
+ . " WHERE location_id = {$location_id}"
+ . " AND location_code='{$values['location_code']}'"
+ . " ORDER BY id DESC";
+ $db->query($sql, __LINE__, __FILE__);
+ $db->next_record();
+ $innflyttetdato_old = $db->f('innflyttet');
+
+ $sql = "SELECT innflyttetdato, tenant_id FROM fm_location4 WHERE
location_code ='" . $values['location_code'] . "'";
+ $db->query($sql, __LINE__, __FILE__);
+ $db->next_record();
+ $innflyttetdato = $db->f('innflyttetdato');
+ $tenant_id = $db->f('tenant_id');
+
+ if ($tenant_id == $values['extra']['tenant_id'] && !$innflyttetdato_old)
+ {
+// $value_set['innflyttet'] = $innflyttetdato;
+// $value_set = $db->validate_update($value_set);
+ $db->transaction_begin();
+// $sql = "UPDATE fm_entity_2_11 set $value_set WHERE id=" .
(int)$receipt['id'];
+ $sql = "UPDATE fm_bim_item SET
json_representation=jsonb_set(json_representation, '{innflyttet}',
'\"{$innflyttetdato}\"', 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/innflyttetdato_entity_2_11_BBB.php
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
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/innflyttetdato_entity_2_11_BBB.php:13653
+/branches/dev-syncromind-2/property/inc/custom/default/innflyttetdato_entity_2_11_BBB.php:14933-16846
+/branches/stavangerkommune/property/inc/custom/default/innflyttetdato_entity_2_11_BBB.php:12743-12875,12986
\ No newline at end of property
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [17249] prepare for custom code outside tree,
sigurdne <=