[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [11592] Property: fix listing of hierarchy
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [11592] Property: fix listing of hierarchy |
Date: |
Thu, 09 Jan 2014 13:56:07 +0000 |
Revision: 11592
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11592
Author: sigurdne
Date: 2014-01-09 13:56:06 +0000 (Thu, 09 Jan 2014)
Log Message:
-----------
Property: fix listing of hierarchy
Modified Paths:
--------------
trunk/property/inc/class.bogeneric.inc.php
trunk/property/inc/class.sogeneric.inc.php
trunk/property/inc/class.uiimport.inc.php
Modified: trunk/property/inc/class.bogeneric.inc.php
===================================================================
--- trunk/property/inc/class.bogeneric.inc.php 2014-01-09 13:05:16 UTC (rev
11591)
+++ trunk/property/inc/class.bogeneric.inc.php 2014-01-09 13:56:06 UTC (rev
11592)
@@ -148,6 +148,23 @@
$values = $this->so->read(array('start' =>
$this->start,'query' => $this->query,'sort' => $this->sort,'order' =>
$this->order,
'allrows'=>$this->allrows),$filter);
+
+ foreach ( $this->location_info['fields'] as $field )
+ {
+ if (isset($field['role']) && $field['role'] ==
'parent')
+ {
+ foreach($values as &$entry)
+ {
+
if(isset($entry[$field['name']]) && $entry[$field['name']])
+ {
+ $path =
$this->so->get_path(array('type' => $this->type, 'id' =>
$entry[$field['name']]));
+ $entry[$field['name']]
= implode(' > ', $path);
+ }
+ }
+ }
+
+ }
+
$this->total_records = $this->so->total_records;
$this->uicols = $this->so->uicols;
@@ -222,7 +239,7 @@
{
array_unshift($values,array('id'=> '', 'name'=>
lang('select')));
}
-
+
if(isset($data['selected']) &&
is_array($data['selected']))
{
foreach ($values as &$entry)
Modified: trunk/property/inc/class.sogeneric.inc.php
===================================================================
--- trunk/property/inc/class.sogeneric.inc.php 2014-01-09 13:05:16 UTC (rev
11591)
+++ trunk/property/inc/class.sogeneric.inc.php 2014-01-09 13:56:06 UTC (rev
11592)
@@ -3295,6 +3295,7 @@
public function get_children2($data, $parent, $level, $reset =
false)
{
+ $parent = (int)$parent;
$mapping = array();
if(isset($data['mapping']) && $data['mapping'])
{
@@ -3315,6 +3316,7 @@
return $this->tree;
}
$sql = "SELECT * FROM {$table} WHERE parent_id =
{$parent}";
+
$db->query($sql,__LINE__,__FILE__);
while ($db->next_record())
@@ -3324,9 +3326,9 @@
(
'id' => $id,
'name' =>
str_repeat('..',$level) . $db->f($mapping['name'],true),
- 'parent_id' => $db->f('parent_id')
+ 'parent_id' => $parent
);
- $this->get_children2($id, $level+1);
+ $this->get_children2($data, $id, $level+1);
}
return $this->tree;
}
Modified: trunk/property/inc/class.uiimport.inc.php
===================================================================
--- trunk/property/inc/class.uiimport.inc.php 2014-01-09 13:05:16 UTC (rev
11591)
+++ trunk/property/inc/class.uiimport.inc.php 2014-01-09 13:56:06 UTC (rev
11592)
@@ -57,6 +57,7 @@
'fm_condition_survey' => 'fm_condition_survey
(' . lang('condition survey') . ')',
'fm_ecodimb' => 'fm_ecodimb
(' . lang('dimb') . ')',
'fm_budget' =>
'fm_budget (' . lang('budget') . ')',
+ 'fm_department' =>
'fm_department (' . lang('department') . ')',
);
$location_types =
execMethod('property.soadmin_location.select_location_type');
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [11592] Property: fix listing of hierarchy,
Sigurd Nes <=