fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [15733] Syncromind: merge 15653:15732 from trunk


From: sigurdne
Subject: [Fmsystem-commits] [15733] Syncromind: merge 15653:15732 from trunk
Date: Sun, 25 Sep 2016 20:14:08 +0000 (UTC)

Revision: 15733
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15733
Author:   sigurdne
Date:     2016-09-25 20:14:08 +0000 (Sun, 25 Sep 2016)
Log Message:
-----------
Syncromind: merge 15653:15732 from trunk

Modified Paths:
--------------
    branches/dev-syncromind-2/booking/inc/class.bobooking.inc.php
    branches/dev-syncromind-2/booking/inc/class.uievent.inc.php
    branches/dev-syncromind-2/booking/inc/class.uiresource.inc.php
    branches/dev-syncromind-2/booking/templates/base/event_info.xsl
    branches/dev-syncromind-2/controller/inc/class.uicomponent.inc.php
    branches/dev-syncromind-2/controller/templates/base/component.xsl
    branches/dev-syncromind-2/helpdesk/inc/class.menu.inc.php
    branches/dev-syncromind-2/phpgwapi/inc/class.schema_proc.inc.php
    branches/dev-syncromind-2/phpgwapi/inc/class.schema_proc_pgsql.inc.php
    branches/dev-syncromind-2/phpgwapi/templates/base/datatable_jquery.xsl
    branches/dev-syncromind-2/property/inc/class.bogallery.inc.php
    branches/dev-syncromind-2/property/inc/class.bogeneric.inc.php
    branches/dev-syncromind-2/property/inc/class.botts.inc.php
    branches/dev-syncromind-2/property/inc/class.boworkorder.inc.php
    branches/dev-syncromind-2/property/inc/class.sodocument.inc.php
    branches/dev-syncromind-2/property/inc/class.soentity.inc.php
    branches/dev-syncromind-2/property/inc/class.sotts.inc.php
    branches/dev-syncromind-2/property/inc/class.soworkorder.inc.php
    branches/dev-syncromind-2/property/inc/class.uigeneric.inc.php
    branches/dev-syncromind-2/property/inc/class.uilocation.inc.php
    branches/dev-syncromind-2/property/inc/class.uitts.inc.php
    branches/dev-syncromind-2/property/inc/class.uiworkorder.inc.php
    
branches/dev-syncromind-2/property/inc/custom/default/BkBygg_exporter_varemottak_til_Agresso.php
    branches/dev-syncromind-2/property/js/portico/location.edit.js
    branches/dev-syncromind-2/property/js/portico/tts.view.js
    branches/dev-syncromind-2/property/js/portico/workorder.edit.js
    branches/dev-syncromind-2/property/setup/setup.inc.php
    branches/dev-syncromind-2/property/setup/tables_current.inc.php
    branches/dev-syncromind-2/property/setup/tables_update.inc.php
    branches/dev-syncromind-2/property/templates/base/tts.xsl
    branches/dev-syncromind-2/property/templates/base/workorder.xsl
    branches/dev-syncromind-2/rental/inc/model/class.application.inc.php

Added Paths:
-----------
    branches/dev-syncromind-2/helpdesk/inc/class.bogeneric.inc.php
    branches/dev-syncromind-2/helpdesk/inc/class.sogeneric.inc.php
    branches/dev-syncromind-2/helpdesk/inc/class.uigeneric.inc.php
    branches/dev-syncromind-2/property/inc/class.sogeneric.inc.php
    branches/dev-syncromind-2/property/inc/class.sogeneric_.inc.php

Removed Paths:
-------------
    branches/dev-syncromind-2/property/inc/class.sogeneric.inc.php

Property Changed:
----------------
    branches/dev-syncromind-2/
    branches/dev-syncromind-2/booking/


Property changes on: branches/dev-syncromind-2
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/dev-syncromind:13653
/branches/stavangerkommune:12743-12875,12986
/trunk:14934-14935,15165-15215,15218-15220,15222-15304,15306-15337,15339,15341-15398,15400-15421,15423-15474,15476-15607,15609,15611,15613-15652
   + /branches/dev-syncromind:13653
/branches/stavangerkommune:12743-12875,12986
/trunk:14934-14935,15165-15215,15218-15220,15222-15304,15306-15337,15339,15341-15398,15400-15421,15423-15474,15476-15607,15609,15611,15613-15652,15654-15732


Property changes on: branches/dev-syncromind-2/booking
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/stavangerkommune/booking:9468-12740,12743-12875,12986
/trunk/booking:14937-15027,15165-15215,15253-15304,15306-15337,15341-15398,15476-15607,15613-15652
   + /branches/stavangerkommune/booking:9468-12740,12743-12875,12986
/trunk/booking:14937-15027,15165-15215,15253-15304,15306-15337,15341-15398,15476-15607,15613-15652,15654-15732

Modified: branches/dev-syncromind-2/booking/inc/class.bobooking.inc.php
===================================================================
--- branches/dev-syncromind-2/booking/inc/class.bobooking.inc.php       
2016-09-25 20:08:56 UTC (rev 15732)
+++ branches/dev-syncromind-2/booking/inc/class.bobooking.inc.php       
2016-09-25 20:14:08 UTC (rev 15733)
@@ -952,6 +952,13 @@
                                                        $new_allocations[] = $a;
                                                }
                                        }
+                                       if(!$all_bookings)
+                                       {
+                                               $a = $allocation;
+                                               $a['from_'] = $from_;
+                                               $a['to_'] = $to_;
+                                               $new_allocations[] = $a;
+                                       }
                                        array_shift($times);
                                }
                        }

Modified: branches/dev-syncromind-2/booking/inc/class.uievent.inc.php
===================================================================
--- branches/dev-syncromind-2/booking/inc/class.uievent.inc.php 2016-09-25 
20:08:56 UTC (rev 15732)
+++ branches/dev-syncromind-2/booking/inc/class.uievent.inc.php 2016-09-25 
20:14:08 UTC (rev 15733)
@@ -1062,7 +1062,7 @@
                        $event['resource'] = phpgw::get_var('resource');
                        $event['resource_info'] = join(', ', $res_names);
                        $event['building_link'] = self::link(array('menuaction' 
=> 'booking.uibuilding.show',
-                                       'id' => 
$event['resources'][0]['building_id']));
+                                       'id' => 
$event['resources'][0]['buildings'][0]));
                        $event['org_link'] = self::link(array('menuaction' => 
'booking.uiorganization.show',
                                        'id' => $event['organization_id']));
                        $event['add_link'] = self::link(array('menuaction' => 
'booking.uibooking.add',

Modified: branches/dev-syncromind-2/booking/inc/class.uiresource.inc.php
===================================================================
--- branches/dev-syncromind-2/booking/inc/class.uiresource.inc.php      
2016-09-25 20:08:56 UTC (rev 15732)
+++ branches/dev-syncromind-2/booking/inc/class.uiresource.inc.php      
2016-09-25 20:14:08 UTC (rev 15733)
@@ -140,7 +140,7 @@
                                $resource = extract_values($_POST, 
$this->fields);
                                $resource['active'] = '1';
                                $building_id = phpgw::get_var('building_id', 
'int');
-                               $resource['buildings'] = array('building_id' => 
$building_id);
+                               $resource['buildings'][] = $building_id;
                                $building = 
$this->sobuilding->read_single($building_id);
                                $resource['activity_id'] = 
$building['activity_id'];
 

Modified: branches/dev-syncromind-2/booking/templates/base/event_info.xsl
===================================================================
--- branches/dev-syncromind-2/booking/templates/base/event_info.xsl     
2016-09-25 20:08:56 UTC (rev 15732)
+++ branches/dev-syncromind-2/booking/templates/base/event_info.xsl     
2016-09-25 20:14:08 UTC (rev 15733)
@@ -17,9 +17,9 @@
                        </label>
                        <a href="{event/building_link}">
                                <xsl:value-of 
select="event/resources[position()=1]/building_name"/>
+                               (<xsl:value-of select="event/resource_info"/>)
                        </a>
-                       (<xsl:value-of select="event/resource_info"/>)
-               </div>
+                       </div>
                <div class="pure-control-group">
                        <label>
                                <h4>

Modified: branches/dev-syncromind-2/controller/inc/class.uicomponent.inc.php
===================================================================
--- branches/dev-syncromind-2/controller/inc/class.uicomponent.inc.php  
2016-09-25 20:08:56 UTC (rev 15732)
+++ branches/dev-syncromind-2/controller/inc/class.uicomponent.inc.php  
2016-09-25 20:14:08 UTC (rev 15733)
@@ -57,6 +57,7 @@
                private $edit;
                private $delete;
                private $org_units;
+               private $custom;
                public $public_functions = array
                        (
                        'index' => true,
@@ -85,6 +86,8 @@
                        {
                                $GLOBALS['phpgw_info']['flags']['noframework'] 
= true;
                        }
+                       $this->custom = createObject('phpgwapi.custom_fields');
+
                }
 
                public function add_controll_from_master()
@@ -465,6 +468,88 @@
                        }
                }
 
+               private function _get_location_filter_options( $location_id )
+               {
+                       $attrib_data = $this->_get_attrib_data( $location_id );
+
+                       $combos = array();
+                       $values_combo_box = array();
+
+                       if ($attrib_data)
+                       {
+                               $count = 0;
+                               foreach ($attrib_data as $attrib)
+                               {
+                                       if (($attrib['datatype'] == 'LB' || 
$attrib['datatype'] == 'CH' || $attrib['datatype'] == 'R') && $attrib['choice'])
+                                       {
+                                               $values_combo_box[$count][] = 
array(
+                                                       'id' => '',
+                                                       'name' => 
lang('select') . " '{$attrib['input_text']}'"
+                                               );
+
+                                               foreach ($attrib['choice'] as 
$choice)
+                                               {
+                                                       
$values_combo_box[$count][] = array(
+                                                               'id' => 
$choice['id'],
+                                                               'name' => 
htmlspecialchars($choice['value'], ENT_QUOTES, 'UTF-8'),
+                                                       );
+                                               }
+
+                                               $combos[] = array(
+                                                       'type' => 'filter',
+                                                       'name' => 
$attrib['column_name'],
+                                                       'list' => 
$values_combo_box[$count]
+                                               );
+
+                                               $count++;
+                                       }
+                               }
+                       }
+
+                       return $combos;
+
+               }
+
+               private function _get_attrib_data( $location_id )
+               {
+                       static $attrib_data = array();
+                       if(!isset($attrib_data[$location_id]))
+                       {
+                               $attrib_data[$location_id] = 
$this->custom->find2($location_id, 0, '', '', '', true, true);
+                       }
+                       return $attrib_data[$location_id];
+               }
+
+               private function _get_attrib_filter( $location_id )
+               {
+                       $attrib_data = $this->_get_attrib_data( $location_id );
+
+                       $attrib_filter = array();
+                       if ($attrib_data)
+                       {
+                               foreach ($attrib_data as $attrib)
+                               {
+                                       if ($attrib['datatype'] == 'LB' || 
$attrib['datatype'] == 'R')
+                                       {
+                                               if ($_attrib_filter_value = 
phpgw::get_var("custom_{$location_id}_{$attrib['column_name']}", 'int'))
+                                               {
+                                                       $attrib_filter[] = 
"json_representation->>'{$attrib['column_name']}' = '{$_attrib_filter_value}'";
+                                               }
+                                       }
+                                       else if ($attrib['datatype'] == 'CH')
+                                       {
+                                               if ($_attrib_filter_value = 
phpgw::get_var("custom_{$location_id}_{$attrib['column_name']}", 'int'))
+                                               {
+                                                       $attrib_filter[] = 
"json_representation->>'{$attrib['column_name']}' {$GLOBALS['phpgw']->db->like} 
'%,{$_attrib_filter_value},%'";
+                                               }
+                                       }
+                               }
+                       }
+                       return $attrib_filter;
+               }
+
+
+
                public function query()
                {
                        $entity_group_id = phpgw::get_var('entity_group_id', 
'int');
@@ -573,6 +658,8 @@
                                        $_location_id = 
(int)$_location_filter['id'];
                                        $exclude_locations[] = $_location_id;
 
+                                       $location_filter_options = 
$this->_get_location_filter_options($_location_id);
+
                                        $_components = 
execMethod('property.soentity.read', array(
                                                'filter_entity_group' => 
$entity_group_id,
                                                'location_id' => $_location_id,
@@ -581,10 +668,12 @@
                                                'allrows' => true,
                                                'control_registered' => 
!$all_items,
                                                'check_for_control' => true,
-                                               'filter_item' => 
$filter_component ? array($filter_component) : array()
+                                               'filter_item' => 
$filter_component ? array($filter_component) : array(),
+                                               'attrib_filter' => 
$this->_get_attrib_filter($_location_id)
                                                )
                                        );
                                        $components = array_merge($components, 
$_components);
+
                                }
 
                                if ($lookup_stray_items)
@@ -1021,7 +1110,9 @@
                        return array(
                                'components' => $result,
                                'summary' => null,
-                               'location_filter' => $location_filter
+                               'location_filter' => $location_filter,
+                               'location_filter_options'       => 
$location_filter_options,
+                               'return_location_id'            => 
(int)$_location_id
                        );
                }
 

Modified: branches/dev-syncromind-2/controller/templates/base/component.xsl
===================================================================
--- branches/dev-syncromind-2/controller/templates/base/component.xsl   
2016-09-25 20:08:56 UTC (rev 15732)
+++ branches/dev-syncromind-2/controller/templates/base/component.xsl   
2016-09-25 20:14:08 UTC (rev 15733)
@@ -199,8 +199,20 @@
                                                </td>
                                        </tr>
                                </xsl:for-each>
+                               <tr id = 'extra_row'>
+                                       <td>
+                                               <label for='extra_filter'>
+                                                       Extra
+                                               </label>
+                                               </td>
+                                       <td>
+                                               <div id="extra_filter">
+                                               </div>
+                                       </td>
+                               </tr>
                        </tbody>
                </table>
+               <input type ='hidden' id='filtered_location_id'/>
        </div>
 </xsl:template>
 
@@ -414,6 +426,55 @@
 
                                                }
 
+
+                                               var filter_options = 
data.location_filter_options;
+                                               var return_location_id = 
data.return_location_id;
+                                               var filtered_location_id = 
$("#filtered_location_id").val();
+                                               var location_id = 
$("#location_id").val();
+                                               if(filter_options == null)
+                                               {
+                                                       $("#extra_row").hide();
+
+                                               }
+                                               if(filter_options !==null && 
filtered_location_id != return_location_id)
+                                               {
+                                                       
$("#filtered_location_id").val(location_id);
+                                                       $("#extra_row").show();
+                                                       
$("#extra_filter").html('');
+                                                       var $extra_filter = 
$("#extra_filter");
+                                                       $.each(filter_options, 
function(key, filter) {
+                                                               var list = 
filter.list;
+                                                               
$extra_filter.append($("<select></select>").attr("id", location_id + '_' + 
filter.name).text(location_id + '_' + filter.name));
+
+                                                               var 
custom_select = $("#" + location_id + '_' + filter.name);
+
+                                                               $.each(list, 
function(key, value) {
+                                                               
custom_select.append($("<option></option>").attr("value", 
value.id).text(value.name));
+                                                               });
+
+                                                               
$(document).on("change", "#" + location_id + '_' + filter.name , function() {
+
+                                                                       var 
custom_input = document.getElementById("custom_" + location_id + '_' + 
filter.name);
+
+                                                                       
if(custom_input != null)
+                                                                       {
+                                                                               
$("#custom_" + location_id + '_' + filter.name).val($(this).val());
+                                                                       }
+                                                                       else
+                                                                       {
+                                                                               
$('<input />').attr('type', 'hidden')
+                                                                               
.attr('id', 'custom_' + location_id + '_' + filter.name)
+                                                                               
.attr('name', 'custom_' + location_id + '_' + filter.name)
+                                                                               
.attr('value', $(this).val())
+                                                                               
.appendTo('#queryForm');
+                                                                       }
+                                                                       
update_table();
+
+                                                           });
+
+                                                       });
+                                               }
+
                                                if(components_data !==null)
                                                {
                                                        
$("#tbody").html(components_data.tbody);

Copied: branches/dev-syncromind-2/helpdesk/inc/class.bogeneric.inc.php (from 
rev 15732, trunk/helpdesk/inc/class.bogeneric.inc.php)
===================================================================
--- branches/dev-syncromind-2/helpdesk/inc/class.bogeneric.inc.php              
                (rev 0)
+++ branches/dev-syncromind-2/helpdesk/inc/class.bogeneric.inc.php      
2016-09-25 20:14:08 UTC (rev 15733)
@@ -0,0 +1,37 @@
+<?php
+/**
+        * phpGroupWare - eventplanner: a part of a Facilities Management 
System.
+        *
+        * @author Sigurd Nes <address@hidden>
+        * @copyright Copyright (C) 2016 Free Software Foundation, Inc. 
http://www.fsf.org/
+        * This file is part of phpGroupWare.
+        *
+        * phpGroupWare is free software; you can redistribute it and/or modify
+        * it under the terms of the GNU General Public License as published by
+        * the Free Software Foundation; either version 2 of the License, or
+        * (at your option) any later version.
+        *
+        * phpGroupWare is distributed in the hope that it will be useful,
+        * but WITHOUT ANY WARRANTY; without even the implied warranty of
+        * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+        * GNU General Public License for more details.
+        *
+        * You should have received a copy of the GNU General Public License
+        * along with phpGroupWare; if not, write to the Free Software
+        * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  
02110-1301  USA
+        *
+        * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/ and Nordlandssykehuset
+        * @package helpdesk
+        * @subpackage generic
+        * @version $Id: $
+        */
+       phpgw::import_class('property.bogeneric');
+
+       class helpdesk_bogeneric extends property_bogeneric
+       {
+               public function __construct()
+               {
+                       parent::__construct();
+               }
+       }
\ No newline at end of file

Modified: branches/dev-syncromind-2/helpdesk/inc/class.menu.inc.php
===================================================================
--- branches/dev-syncromind-2/helpdesk/inc/class.menu.inc.php   2016-09-25 
20:08:56 UTC (rev 15732)
+++ branches/dev-syncromind-2/helpdesk/inc/class.menu.inc.php   2016-09-25 
20:14:08 UTC (rev 15733)
@@ -92,7 +92,7 @@
                                                'ticket_status' => array
                                                (
                                                        'text'  => lang('Ticket 
status'),
-                                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uigeneric.index', 'type' => 'helpdesk_status') )
+                                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'helpdesk.uigeneric.index', 'type' => 'helpdesk_status') )
                                                ),
                                                'acl'   => array
                                                (

Copied: branches/dev-syncromind-2/helpdesk/inc/class.sogeneric.inc.php (from 
rev 15732, trunk/helpdesk/inc/class.sogeneric.inc.php)
===================================================================
--- branches/dev-syncromind-2/helpdesk/inc/class.sogeneric.inc.php              
                (rev 0)
+++ branches/dev-syncromind-2/helpdesk/inc/class.sogeneric.inc.php      
2016-09-25 20:14:08 UTC (rev 15733)
@@ -0,0 +1,131 @@
+<?php
+/**
+        * phpGroupWare - eventplanner: a part of a Facilities Management 
System.
+        *
+        * @author Sigurd Nes <address@hidden>
+        * @copyright Copyright (C) 2016 Free Software Foundation, Inc. 
http://www.fsf.org/
+        * This file is part of phpGroupWare.
+        *
+        * phpGroupWare is free software; you can redistribute it and/or modify
+        * it under the terms of the GNU General Public License as published by
+        * the Free Software Foundation; either version 2 of the License, or
+        * (at your option) any later version.
+        *
+        * phpGroupWare is distributed in the hope that it will be useful,
+        * but WITHOUT ANY WARRANTY; without even the implied warranty of
+        * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+        * GNU General Public License for more details.
+        *
+        * You should have received a copy of the GNU General Public License
+        * along with phpGroupWare; if not, write to the Free Software
+        * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  
02110-1301  USA
+        *
+        * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/ and Nordlandssykehuset
+        * @package helpdesk
+        * @subpackage generic
+        * @version $Id: $
+        */
+       phpgw::import_class('property.sogeneric_');
+
+       class helpdesk_sogeneric extends property_sogeneric_
+       {
+               var $appname = 'helpdesk';
+
+               function __construct( $type = '', $type_id = 0 )
+               {
+                       parent::__construct($type, $type_id);
+               }
+
+
+               public function get_location_info( $type, $type_id )
+               {
+
+                       $type_id = (int)$type_id;
+                       $this->type = $type;
+                       $this->type_id = $type_id;
+                       $info = array();
+
+                       if (!$type)
+                       {
+                               return $info;
+                       }
+
+                       switch ($type)
+                       {
+//START HELPDESK - APP
+                               case 'helpdesk_status':
+                                       // the helpdesk app
+                                       $info = array
+                                               (
+                                               'table' => 
'phpgw_helpdesk_status',
+                                               'id' => array('name' => 'id', 
'type' => 'auto'),
+                                               'fields' => array
+                                                       (
+                                                       array
+                                                               (
+                                                               'name' => 
'name',
+                                                               'descr' => 
lang('name'),
+                                                               'type' => 
'varchar'
+                                                       ),
+                                                       array
+                                                               (
+                                                               'name' => 
'sorting',
+                                                               'descr' => 
lang('sorting'),
+                                                               'type' => 
'integer',
+                                                               'sortable' => 
true
+                                                       ),
+                                                       array
+                                                               (
+                                                               'name' => 
'color',
+                                                               'descr' => 
lang('color'),
+                                                               'type' => 
'varchar'
+                                                       ),
+                                                       array
+                                                               (
+                                                               'name' => 
'approved',
+                                                               'descr' => 
lang('approved'),
+                                                               'type' => 
'checkbox'
+                                                       ),
+                                                       array
+                                                               (
+                                                               'name' => 
'in_progress',
+                                                               'descr' => 
lang('In progress'),
+                                                               'type' => 
'checkbox'
+                                                       ),
+                                                       array
+                                                               (
+                                                               'name' => 
'delivered',
+                                                               'descr' => 
lang('delivered'),
+                                                               'type' => 
'checkbox'
+                                                       ),
+                                                       array
+                                                               (
+                                                               'name' => 
'closed',
+                                                               'descr' => 
lang('closed'),
+                                                               'type' => 
'checkbox'
+                                                       )
+                                               ),
+                                               'edit_msg' => lang('edit'),
+                                               'add_msg' => lang('add'),
+                                               'name' => lang('event action'),
+                                               'acl_app' => 'helpdesk',
+                                               'acl_location' => '.admin',
+                                               'menu_selection' => 
'admin::helpdesk::ticket_status'
+                                       );
+                                       break;
+
+//END HELPDESK - APP
+
+                               default:
+                                       $message = lang('ERROR: illegal type 
%1', $type);
+                                       phpgwapi_cache::message_set($message, 
'error');
+//                             throw new Exception(lang('ERROR: illegal type 
%1', $type));
+                       }
+
+                       $this->location_info = $info;
+                       return $info;
+               }
+
+
+       }
\ No newline at end of file

Copied: branches/dev-syncromind-2/helpdesk/inc/class.uigeneric.inc.php (from 
rev 15732, trunk/helpdesk/inc/class.uigeneric.inc.php)
===================================================================
--- branches/dev-syncromind-2/helpdesk/inc/class.uigeneric.inc.php              
                (rev 0)
+++ branches/dev-syncromind-2/helpdesk/inc/class.uigeneric.inc.php      
2016-09-25 20:14:08 UTC (rev 15733)
@@ -0,0 +1,37 @@
+<?php
+/**
+        * phpGroupWare - eventplanner: a part of a Facilities Management 
System.
+        *
+        * @author Sigurd Nes <address@hidden>
+        * @copyright Copyright (C) 2016 Free Software Foundation, Inc. 
http://www.fsf.org/
+        * This file is part of phpGroupWare.
+        *
+        * phpGroupWare is free software; you can redistribute it and/or modify
+        * it under the terms of the GNU General Public License as published by
+        * the Free Software Foundation; either version 2 of the License, or
+        * (at your option) any later version.
+        *
+        * phpGroupWare is distributed in the hope that it will be useful,
+        * but WITHOUT ANY WARRANTY; without even the implied warranty of
+        * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+        * GNU General Public License for more details.
+        *
+        * You should have received a copy of the GNU General Public License
+        * along with phpGroupWare; if not, write to the Free Software
+        * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  
02110-1301  USA
+        *
+        * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/ and Nordlandssykehuset
+        * @package helpdesk
+        * @subpackage generic
+        * @version $Id: $
+        */
+       phpgw::import_class('property.uigeneric');
+
+       class helpdesk_uigeneric extends property_uigeneric
+       {
+               public function __construct()
+               {
+                       parent::__construct();
+               }
+       }
\ No newline at end of file

Modified: branches/dev-syncromind-2/phpgwapi/inc/class.schema_proc.inc.php
===================================================================
--- branches/dev-syncromind-2/phpgwapi/inc/class.schema_proc.inc.php    
2016-09-25 20:08:56 UTC (rev 15732)
+++ branches/dev-syncromind-2/phpgwapi/inc/class.schema_proc.inc.php    
2016-09-25 20:14:08 UTC (rev 15733)
@@ -522,7 +522,7 @@
                                {
                                        if($DEBUG) { echo '<br>_GetFieldSQL(): 
Calling TranslateDefault for "' . $sDefault . '"'; }
                                        // Get default DDL - useful for 
differences in date defaults (eg, now() vs. getdate())
-                                       $sTranslatedDefault = 
$this->m_oTranslator->TranslateDefault($sDefault);
+                                       $sTranslatedDefault = 
$this->m_oTranslator->TranslateDefault($sDefault, $sType);
                                        $sBufDefault = " DEFAULT 
$sTranslatedDefault";
                                        //$sFieldSQL .= " DEFAULT 
$sTranslatedDefault";
                                }

Modified: branches/dev-syncromind-2/phpgwapi/inc/class.schema_proc_pgsql.inc.php
===================================================================
--- branches/dev-syncromind-2/phpgwapi/inc/class.schema_proc_pgsql.inc.php      
2016-09-25 20:08:56 UTC (rev 15732)
+++ branches/dev-syncromind-2/phpgwapi/inc/class.schema_proc_pgsql.inc.php      
2016-09-25 20:14:08 UTC (rev 15733)
@@ -116,7 +116,7 @@
                        return $sTranslated;
                }
 
-               function TranslateDefault($sDefault)
+               function TranslateDefault($sDefault, $sType)
                {
                        // Need Strict comparisons for true/false in case of 
datatype bolean
                        if ($sDefault === true || $sDefault === 'true' || 
$sDefault === 'True')
@@ -129,7 +129,14 @@
                        }
                        else if ($sDefault == 'current_date' || $sDefault == 
'current_timestamp')
                        {
-                               $ret= "now()";
+                               if(preg_match('/int/i', $sType))
+                               {
+                                       $ret= "extract( epoch from now())";
+                               }
+                               else
+                               {
+                                       $ret= "now()";
+                               }
                        }
                        else
                        {
@@ -681,7 +688,7 @@
                        }                                                       
        
                        elseif(!is_numeric($sDefault) && $sDefault != '')
                        {
-                               $sTranslatedDefault = 
$this->TranslateDefault($sDefault);
+                               $sTranslatedDefault = 
$this->TranslateDefault($sDefault, $sType);
                                $defaultSQL = " DEFAULT $sTranslatedDefault";
                        }
                        elseif($sDefault)

Modified: branches/dev-syncromind-2/phpgwapi/templates/base/datatable_jquery.xsl
===================================================================
--- branches/dev-syncromind-2/phpgwapi/templates/base/datatable_jquery.xsl      
2016-09-25 20:08:56 UTC (rev 15732)
+++ branches/dev-syncromind-2/phpgwapi/templates/base/datatable_jquery.xsl      
2016-09-25 20:14:08 UTC (rev 15733)
@@ -328,6 +328,9 @@
                                                                                
        <xsl:attribute name="class">
                                                                                
                <xsl:value-of select="phpgw:conditional(not(class), '', 
class)"/>
                                                                                
        </xsl:attribute>
+                                                                               
        <xsl:attribute name="checked">
+                                                                               
                <xsl:value-of select="phpgw:conditional(not(checked), '', 
checked)"/>
+                                                                               
        </xsl:attribute>
                                                                                
</input>
                                                                        </td>
                                                                </xsl:otherwise>

Modified: branches/dev-syncromind-2/property/inc/class.bogallery.inc.php
===================================================================
--- branches/dev-syncromind-2/property/inc/class.bogallery.inc.php      
2016-09-25 20:08:56 UTC (rev 15732)
+++ branches/dev-syncromind-2/property/inc/class.bogallery.inc.php      
2016-09-25 20:14:08 UTC (rev 15733)
@@ -116,18 +116,6 @@
 
                public function read( $data = array() )
                {
-                       //$dry_run=''
-                       //$data = array()
-                       //$start_date   = 
phpgwapi_datetime::date_to_timestamp($this->start_date);
-                       //$end_date     = 
phpgwapi_datetime::date_to_timestamp($this->end_date);
-//                     $valid_locations = $this->get_gallery_location();
-//            //echo '<pre>'; print_r($valid_locations);echo '</pre>';
-//            array_unshift($data['valid_locations'],$valid_locations);
-//                     $values = $this->so->read(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
-//                     'allrows'=>$this->allrows, 'location_id' => 
$this->location_id, 'user_id' => $this->user_id,
-//                     'mime_type' => $this->mime_type, 'start_date' => 
$start_date, 'end_date' => $end_date,
-//                     'cat_id' => $this->cat_id, 'valid_locations' => 
$valid_locations, 'dry_run'=>$dry_run));
-
                        $values = $this->so->read($data);
 
                        $img_types = array
@@ -150,8 +138,15 @@
                                $entry['img_id'] = '';
                                if (in_array($entry['mime_type'], $img_types))
                                {
-                                       $entry['img_id'] = "img-{$i}";
-                                       $i++;
+                                       $entry['img_id'] = $entry['id'];
+                                       $entry['file_name'] = $entry['name'];
+                                       $entry['img_url'] = 
$GLOBALS['phpgw']->link('/index.php', array(
+                                                       'menuaction' => 
'property.uigallery.view_file',
+                                                       'img_id' => 
$entry['img_id'],
+                                                       'file' => 
"{$entry['directory']}/{$entry['file_name']}"
+                                               )
+                                       );
+                                       $entry['thumbnail_flag'] = 'thumb=1';
                                }
 
                                $entry['date'] = 
$GLOBALS['phpgw']->common->show_date(strtotime($entry['created']), $dateformat);

Modified: branches/dev-syncromind-2/property/inc/class.bogeneric.inc.php
===================================================================
--- branches/dev-syncromind-2/property/inc/class.bogeneric.inc.php      
2016-09-25 20:08:56 UTC (rev 15732)
+++ branches/dev-syncromind-2/property/inc/class.bogeneric.inc.php      
2016-09-25 20:14:08 UTC (rev 15733)
@@ -51,7 +51,11 @@
 
                function __construct( $session = false )
                {
-                       $this->so = CreateObject('property.sogeneric');
+                       $called_class = get_called_class();
+                       $called_class_arr = explode('_', $called_class);
+                       $call_appname = !empty($called_class_arr[0]) && 
!empty($GLOBALS['phpgw_info']['apps'][$called_class_arr[0]]) ? 
$called_class_arr[0] : 'property';
+                       $this->so = CreateObject("{$call_appname}.sogeneric");
+
                        $this->custom = & $this->so->custom;
                        $this->bocommon = CreateObject('property.bocommon');
 

Modified: branches/dev-syncromind-2/property/inc/class.botts.inc.php
===================================================================
--- branches/dev-syncromind-2/property/inc/class.botts.inc.php  2016-09-25 
20:08:56 UTC (rev 15732)
+++ branches/dev-syncromind-2/property/inc/class.botts.inc.php  2016-09-25 
20:14:08 UTC (rev 15733)
@@ -1750,7 +1750,7 @@
                        return $values;
                }
 
-               public function receive_order( $id, $received_percent )
+               public function receive_order( $id, $received_amount )
                {
                        $receive_order = true; // used as trigger within the 
custom function
                        $acl_location = $this->acl_location;

Modified: branches/dev-syncromind-2/property/inc/class.boworkorder.inc.php
===================================================================
--- branches/dev-syncromind-2/property/inc/class.boworkorder.inc.php    
2016-09-25 20:08:56 UTC (rev 15732)
+++ branches/dev-syncromind-2/property/inc/class.boworkorder.inc.php    
2016-09-25 20:14:08 UTC (rev 15733)
@@ -1008,7 +1008,7 @@
                        }
                }
 
-               public function receive_order( $id, $received_percent )
+               public function receive_order( $id, $received_amount )
                {
                        $receive_order = true; // used as trigger within the 
custom function
                        $acl_location = '.project.workorder';

Modified: branches/dev-syncromind-2/property/inc/class.sodocument.inc.php
===================================================================
--- branches/dev-syncromind-2/property/inc/class.sodocument.inc.php     
2016-09-25 20:08:56 UTC (rev 15732)
+++ branches/dev-syncromind-2/property/inc/class.sodocument.inc.php     
2016-09-25 20:14:08 UTC (rev 15733)
@@ -34,6 +34,8 @@
        class property_sodocument
        {
 
+               public $total_records = 0;
+
                function __construct()
                {
                        $this->account = 
$GLOBALS['phpgw_info']['user']['account_id'];

Modified: branches/dev-syncromind-2/property/inc/class.soentity.inc.php
===================================================================
--- branches/dev-syncromind-2/property/inc/class.soentity.inc.php       
2016-09-25 20:08:56 UTC (rev 15732)
+++ branches/dev-syncromind-2/property/inc/class.soentity.inc.php       
2016-09-25 20:14:08 UTC (rev 15733)
@@ -818,19 +818,19 @@
 
                        $sql_custom_field = '';
 
-                       if ($check_for_control && !$control_registered)
+                       /*
+                        * Filter inactive
+                        */
+                       static $cache_attribute_status = array();
+
+                       if(!isset($cache_attribute_status[$location_id]))
                        {
-                               /*
-                                * Filter inactive
-                                */
-                               static $cache_attribute_status = array();
+                               $filters = array("column_name" => "status");
+                               $cache_attribute_status[$location_id] = 
$GLOBALS['phpgw']->custom_fields->find2($location_id, 0, '', 'ASC', '', true, 
true,$filters);
+                       }
 
-                               
if(!isset($cache_attribute_status[$location_id]))
-                               {
-                                       $filters = array("column_name" => 
"status");
-                                       $cache_attribute_status[$location_id] = 
$GLOBALS['phpgw']->custom_fields->find2($location_id, 0, '', 'ASC', '', true, 
true,$filters);
-                               }
-
+                       if(!phpgw::get_var('status', 'int'))
+                       {
                                
if(!empty($cache_attribute_status[$location_id]))
                                {
                                        foreach 
($cache_attribute_status[$location_id] as $attibute_id => $attibute)
@@ -839,18 +839,13 @@
                                                {
                                                        $_querymethod[] = 
"CAST( json_representation->>'status' AS integer) < 90";
                                                        $__querymethod = 
array(); // remove block
-//                                                     foreach 
($attibute['choice'] as $choice)
-//                                                     {
-//                                                             
if($choice['id'] < 90)
-//                                                             {
-//                                                                     
$_querymethod[] = "CAST( json_representation->>'status' AS integer) = " 
.(int)$choice['id'];
-//                                                                     
$__querymethod = array(); // remove block
-//                                                             }
-//                                                     }
                                                }
                                        }
                                }
+                       }
 
+                       if ($check_for_control && !$control_registered)
+                       {
                                $sql .= "{$this->left_join} {$join_control}";
 
                                $sql_custom_field .= ',count(control_id) AS 
has_control';

Deleted: branches/dev-syncromind-2/property/inc/class.sogeneric.inc.php
===================================================================
--- branches/dev-syncromind-2/property/inc/class.sogeneric.inc.php      
2016-09-25 20:08:56 UTC (rev 15732)
+++ branches/dev-syncromind-2/property/inc/class.sogeneric.inc.php      
2016-09-25 20:14:08 UTC (rev 15733)
@@ -1,3769 +0,0 @@
-<?php
-       /**
-        * phpGroupWare - property: a Facilities Management System.
-        *
-        * @author Sigurd Nes <address@hidden>
-        * @copyright Copyright (C) 2003,2004,2005,2006,2007,2008,2009 Free 
Software Foundation, Inc. http://www.fsf.org/
-        * This file is part of phpGroupWare.
-        *
-        * phpGroupWare is free software; you can redistribute it and/or modify
-        * it under the terms of the GNU General Public License as published by
-        * the Free Software Foundation; either version 2 of the License, or
-        * (at your option) any later version.
-        *
-        * phpGroupWare is distributed in the hope that it will be useful,
-        * but WITHOUT ANY WARRANTY; without even the implied warranty of
-        * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-        * GNU General Public License for more details.
-        *
-        * You should have received a copy of the GNU General Public License
-        * along with phpGroupWare; if not, write to the Free Software
-        * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  
02110-1301  USA
-        *
-        * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
-        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
-        * @package property
-        * @subpackage admin
-        * @version $Id$
-        */
-
-       /**
-        * Description
-        * @package property
-        */
-       class property_sogeneric
-       {
-
-               var $type;
-               var $type_id;
-               var $location_info = array();
-               var $tree = array();
-               protected $table;
-               var $appname = 'property';
-
-               function __construct( $type = '', $type_id = 0 )
-               {
-                       $this->account = 
$GLOBALS['phpgw_info']['user']['account_id'];
-                       $this->custom = createObject('property.custom_fields');
-                       $this->_db = & $GLOBALS['phpgw']->db;
-                       $this->_db2 = clone($this->_db);
-                       $this->_like = & $this->_db->like;
-                       $this->_join = & $this->_db->join;
-
-                       if ($type)
-                       {
-                               $this->get_location_info($type, $type_id);
-                       }
-               }
-
-               function read( $data )
-               {
-                       $start = isset($data['start']) && $data['start'] ? 
$data['start'] : 0;
-                       $query = isset($data['query']) ? $data['query'] : '';
-                       $sort = isset($data['sort']) && $data['sort'] ? 
$data['sort'] : 'DESC';
-                       $order = isset($data['order']) ? $data['order'] : '';
-                       $allrows = isset($data['allrows']) ? $data['allrows'] : 
'';
-                       $custom_criteria = isset($data['custom_criteria']) && 
$data['custom_criteria'] ? $data['custom_criteria'] : array();
-                       $custom_filter = isset($data['custom_filter']) && 
$data['custom_filter'] ? $data['custom_filter'] : array();
-                       $filter = isset($data['filter']) && $data['filter'] ? 
$data['filter'] : array();
-                       $results = isset($data['results']) ? 
(int)$data['results'] : 0;
-
-                       $values = array();
-                       if (!isset($this->location_info['table']) || !$table = 
$this->location_info['table'])
-                       {
-                               return $values;
-                       }
-
-
-                       $_join_method = array();
-                       $_filter_array = array();
-                       if ($custom_criteria)
-                       {
-                               foreach ($custom_criteria as $_custom_criteria)
-                               {
-                                       if 
(isset($this->location_info['custom_criteria'][$_custom_criteria]['join']) && 
is_array($this->location_info['custom_criteria'][$_custom_criteria]['join']))
-                                       {
-                                               $_join_method = 
array_merge($_join_method, 
$this->location_info['custom_criteria'][$_custom_criteria]['join']);
-                                       }
-                                       if 
(isset($this->location_info['custom_criteria'][$_custom_criteria]['filter']) && 
is_array($this->location_info['custom_criteria'][$_custom_criteria]['filter']))
-                                       {
-                                               $_filter_array = 
array_merge($_filter_array, 
$this->location_info['custom_criteria'][$_custom_criteria]['filter']);
-                                       }
-                               }
-                       }
-
-                       foreach ($this->location_info['fields'] as $field)
-                       {
-                               if (isset($field['filter']) && $field['filter'])
-                               {
-                                       if (isset($filter[$field['name']]) && 
$filter[$field['name']] && $field['type'] == 'multiple_select')
-                                       {
-                                               $_filter_array[] = 
"{$field['name']} {$this->_like} '%,{$filter[$field['name']]},%'";
-                                       }
-                                       else if (isset($filter[$field['name']]) 
&& $filter[$field['name']])
-                                       {
-                                               $_filter_array[] = 
"{$field['name']} = '{$filter[$field['name']]}'";
-                                       }
-                               }
-                       }
-
-                       $uicols = array();
-                       $uicols['input_type'][] = 'text';
-                       $uicols['name'][] = $this->location_info['id']['name'];
-                       $uicols['descr'][] = lang('id');
-                       $uicols['datatype'][] = 
$this->location_info['id']['type'] == 'varchar' ? 'V' : 'I';
-                       $uicols['sortable'][] = true;
-                       $uicols['formatter'][] = '';
-
-                       foreach ($this->location_info['fields'] as $field)
-                       {
-                               $uicols['input_type'][] = 
isset($field['hidden']) && $field['hidden'] ? 'hidden' : 'text';
-                               $uicols['name'][] = $field['name'];
-                               $uicols['descr'][] = $field['descr'];
-                               $uicols['datatype'][] = $field['type'];
-                               $uicols['sortable'][] = 
isset($field['sortable']) && $field['sortable'] ? true : false;
-                               $uicols['formatter'][] = $field['type'] == 
'int' ? 'FormatterRight' : '';
-                       }
-
-                       $custom_fields = false;
-                       if 
($GLOBALS['phpgw']->locations->get_attrib_table($this->location_info['acl_app'],
 $this->location_info['acl_location']))
-                       {
-                               $custom_fields = true;
-                               $choice_table = 'phpgw_cust_choice';
-                               $attribute_table = 'phpgw_cust_attribute';
-                               $location_id = 
$GLOBALS['phpgw']->locations->get_id($this->location_info['acl_app'], 
$this->location_info['acl_location']);
-                               $attribute_filter = " location_id = 
{$location_id}";
-
-                               $user_columns = 
isset($GLOBALS['phpgw_info']['user']['preferences'][$this->location_info['acl_app']]["generic_columns_{$this->type}_{$this->type_id}"])
 ? 
$GLOBALS['phpgw_info']['user']['preferences'][$this->location_info['acl_app']]["generic_columns_{$this->type}_{$this->type_id}"]
 : '';
-
-                               $user_column_filter = '';
-                               if (isset($user_columns) AND 
is_array($user_columns) AND $user_columns[0])
-                               {
-                                       $user_column_filter = " OR 
($attribute_filter AND id IN (" . implode(',', $user_columns) . '))';
-                               }
-
-                               $this->_db->query("SELECT * FROM 
$attribute_table WHERE list=1 AND $attribute_filter $user_column_filter ORDER 
BY attrib_sort ASC");
-
-                               $i = count($uicols['name']);
-                               while ($this->_db->next_record())
-                               {
-                                       $uicols['input_type'][] = 'text';
-                                       $uicols['name'][] = 
$this->_db->f('column_name');
-                                       $uicols['descr'][] = 
$this->_db->f('input_text');
-                                       $uicols['statustext'][] = 
$this->_db->f('statustext');
-                                       $uicols['datatype'][$i] = 
$this->_db->f('datatype');
-                                       $uicols['attib_id'][$i] = 
$this->_db->f('id');
-                                       $uicols['formatter'][$i] = 
$this->_db->f('datatype') == 'I' ? 'FormatterRight' : '';
-                                       $cols_return_extra[] = array(
-                                               'name' => 
$this->_db->f('column_name'),
-                                               'datatype' => 
$this->_db->f('datatype'),
-                                               'attrib_id' => 
$this->_db->f('id')
-                                       );
-
-                                       $i++;
-                               }
-                       }
-
-                       $where = 'WHERE';
-                       $filtermethod = '';
-                       if (isset($this->location_info['check_grant']) && 
$this->location_info['check_grant'])
-                       {
-                               $filtermethod = "{$where} user_id = 
{$this->account} OR public = 1";
-                               $where = 'AND';
-                       }
-
-                       if (isset($this->location_info['filter']) && 
$this->location_info['filter'] && is_array($this->location_info['filter']))
-                       {
-                               $_filtermethod = array();
-                               foreach ($this->location_info['filter'] as 
$_argument => $_argument_value)
-                               {
-                                       if (preg_match('/^##/', 
$_argument_value))
-                                       {
-                                               $_argument_value_name = 
trim($_argument_value, '#');
-                                               $_argument_value = 
$values[$_argument_value_name];
-                                       }
-                                       if (preg_match('/^\$this->/', 
$_argument_value))
-                                       {
-                                               $_argument_value_name = 
ltrim($_argument_value, '$this->');
-                                               $_argument_value = 
$this->$_argument_value_name;
-                                       }
-
-                                       $_filtermethod[] = "{$_argument} = 
'{$_argument_value}'";
-                               }
-
-
-                               if ($_filtermethod)
-                               {
-                                       $filtermethod = "{$where} " . implode(' 
AND ', $_filtermethod);
-                                       $where = 'AND';
-                               }
-                       }
-
-                       if ($_filter_array)
-                       {
-                               $filtermethod .= " $where " . implode(' AND ', 
$_filter_array);
-                               $where = 'AND';
-                       }
-
-                       if ($custom_filter)
-                       {
-                               $filtermethod .= " $where " . implode(' AND ', 
$custom_filter);
-                               $where = 'AND';
-                       }
-
-                       $this->uicols = $uicols;
-
-                       if ($order)
-                       {
-                               $ordermethod = " ORDER BY {$table}.{$order} 
{$sort}";
-                       }
-                       else
-                       {
-                               $ordermethod = " ORDER BY 
{$table}.{$this->location_info['id']['name']} ASC";
-                       }
-
-                       if ($query)
-                       {
-                               if ($this->location_info['id']['type'] == 
'auto' || $this->location_info['id']['type'] == 'int')
-                               {
-                                       $id_query = (int)$query;
-                               }
-                               else
-                               {
-                                       $id_query = "'{$query}'";
-                               }
-
-                               $_query_start = '';
-                               $_query_end = '';
-
-                               if ($filtermethod)
-                               {
-                                       $_query_start = '(';
-                                       $_query_end = ')';
-                               }
-                               $query = $this->_db->db_addslashes($query);
-                               $querymethod = " {$where } {$_query_start} 
({$table}.{$this->location_info['id']['name']} = {$id_query}";
-                               //_debug_array($filtermethod);
-                               //_debug_array($where);die();
-
-                               if ($this->location_info['id']['type'] == 
'varchar')
-                               {
-                                               $querymethod .= " OR 
{$table}.{$this->location_info['id']['name']} $this->_like '%$query%'";
-                                               $where = 'OR';
-                               }
-                               else
-                               {
-                                       $querymethod .= " OR CAST 
({$table}.{$this->location_info['id']['name']} AS TEXT) $this->_like 
'%$query%'";
-                               }
-
-                               foreach ($this->location_info['fields'] as 
$field)
-                               {
-                                       if ($field['type'] == 'varchar')
-                                       {
-                                               $querymethod .= " OR 
{$table}.{$field['name']} $this->_like '%$query%'";
-                                       }
-                                       $where = 'OR';
-                               }
-                               $querymethod .= ')';
-
-                               if ($custom_fields)
-                               {
-                                       $_querymethod = array();
-
-                                       $this->_db->query("SELECT * FROM 
$attribute_table WHERE $attribute_filter AND search='1'", __LINE__, __FILE__);
-
-                                       while ($this->_db->next_record())
-                                       {
-                                               if ($this->_db->f('datatype') 
== 'V' || $this->_db->f('datatype') == 'email' || $this->_db->f('datatype') == 
'CH')
-                                               {
-                                                       $_querymethod[] = 
"$table." . $this->_db->f('column_name') . " {$this->_like} '%{$query}%'";
-                                               }
-                                               else if 
($this->_db->f('datatype') == 'I')
-                                               {
-                                                       if (ctype_digit($query))
-                                                       {
-                                                               $_querymethod[] 
= "$table." . $this->_db->f('column_name') . '=' . (int)$query;
-                                                       }
-                                               }
-                                               else
-                                               {
-                                                       $_querymethod[] = 
"$table." . $this->_db->f('column_name') . " = '$query'";
-                                               }
-                                       }
-
-                                       if (isset($_querymethod) && 
is_array($_querymethod) && $_querymethod)
-                                       {
-                                               $querymethod .= " $where (" . 
implode(' OR ', $_querymethod) . ')';
-                                       }
-                               }
-
-                               $querymethod .= $_query_end;
-                       }
-
-                       $join_method = $_join_method ? implode(' ', 
$_join_method) : '';
-
-                       $sql = "SELECT DISTINCT {$table}.* FROM {$table} 
{$join_method} {$filtermethod} {$querymethod}";
-
-                       $this->_db->query('SELECT count(*) as cnt ' . 
substr($sql, strripos($sql, 'from')), __LINE__, __FILE__);
-                       $this->_db->next_record();
-                       $this->total_records = $this->_db->f('cnt');
-
-                       if (!$allrows)
-                       {
-                               $this->_db->limit_query($sql . $ordermethod, 
$start, __LINE__, __FILE__, $results);
-                       }
-                       else
-                       {
-                               $this->_db->query($sql . $ordermethod, 
__LINE__, __FILE__);
-                       }
-
-                       $cols_return = $uicols['name'];
-                       $j = 0;
-
-                       $dataset = array();
-                       while ($this->_db->next_record())
-                       {
-                               foreach ($cols_return as $key => $field)
-                               {
-                                       $dataset[$j][$field] = array
-                                               (
-                                               'value' => 
$this->_db->f($field, true),
-                                               'datatype' => 
$uicols['datatype'][$key],
-                                               'attrib_id' => 
$uicols['attib_id'][$key]
-                                       );
-                               }
-                               $j++;
-                       }
-
-                       $values = $this->custom->translate_value($dataset, 
$location_id);
-
-                       return $values;
-               }
-
-               function get_location_info( $type, $type_id )
-               {
-                       $type_id = (int)$type_id;
-                       $this->type = $type;
-                       $this->type_id = $type_id;
-                       $info = array();
-
-                       if (!$type)
-                       {
-                               return $info;
-                       }
-
-                       switch ($type)
-                       {
-                               //-------- ID type integer
-                               case 'part_of_town':
-                                       $info = array
-                                               (
-                                               'table' => 'fm_part_of_town',
-                                               'id' => array('name' => 'id', 
'type' => 'int', 'descr' => lang('id')),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'name',
-                                                               'descr' => 
lang('name'),
-                                                               'type' => 
'varchar',
-                                                               'nullable' => 
false,
-                                                               'size' => 20
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'district_id',
-                                                               'descr' => 
lang('district'),
-                                                               'type' => 
'select',
-                                                               'nullable' => 
false,
-                                                               'filter' => 
true,
-                                                               'values_def' => 
array
-                                                                       (
-                                                                       
'valueset' => false,
-                                                                       
'method' => 'property.bogeneric.get_list',
-                                                                       
'get_single_value' => 'property.sogeneric.get_name',
-                                                                       
'method_input' => array('type' => 'district', 'selected' => '##district_id##')
-                                                               )
-                                                       ),
-                                               ),
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => lang('part of town'),
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::property::location::town',
-                                               /*
-                                                 'default'                     
=> array
-                                                 (
-                                                 'user_id'             => 
array('add'  => '$this->account'),
-                                                 'entry_date'  => array('add'  
=> 'time()'),
-                                                 'modified_date'       => 
array('edit' => 'time()'),
-                                                 ),
-                                                */
-                                               'check_grant' => false
-                                       );
-
-                                       break;
-
-                               case 'dimb':
-                                       $info = array
-                                               (
-                                               'table' => 'fm_ecodimb',
-                                               'id' => array('name' => 'id', 
'type' => 'int'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'descr',
-                                                               'descr' => 
lang('descr'),
-                                                               'type' => 
'varchar'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'org_unit_id',
-                                                               'descr' => 
lang('department'),
-                                                               'type' => 
'select',
-                                                               'nullable' => 
false,
-                                                               'filter' => 
true,
-                                                               'sortable' => 
true,
-                                                               'values_def' => 
array
-                                                                       (
-                                                                       
'valueset' => false,
-                                                                       
'method' => 'property.bogeneric.get_list',
-                                                                       
'get_single_value' => 'property.sogeneric.get_name',
-                                                                       
'method_input' => array('type' => 'org_unit', 'selected' => '##org_unit_id##')
-                                                               )
-                                                       )
-                                               ),
-                                               'custom_criteria' => array
-                                                       (
-                                                       'dimb_role_user' => 
array
-                                                               (
-                                                               'join' => 
array("{$this->_db->join} fm_ecodimb_role_user ON fm_ecodimb.id = 
fm_ecodimb_role_user.ecodimb"),
-                                                               'filter' => 
array('fm_ecodimb_role_user.user_id = ' . (int)$this->account)
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => lang('dimb'),
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::property::accounting::accounting_dimb'
-                                       );
-                                       break;
-                               case 'dimd':
-                                       $info = array
-                                               (
-                                               'table' => 'fm_ecodimd',
-                                               'id' => array('name' => 'id', 
'type' => 'int'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'descr',
-                                                               'descr' => 
lang('descr'),
-                                                               'type' => 
'varchar'
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => lang('dimd'),
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::property::accounting::accounting_dimd'
-                                       );
-                                       break;
-                               case 'periodization':
-                                       $info = array
-                                               (
-                                               'table' => 
'fm_eco_periodization',
-                                               'id' => array('name' => 'id', 
'type' => 'int'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'descr',
-                                                               'descr' => 
lang('descr'),
-                                                               'type' => 
'varchar'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'active',
-                                                               'descr' => 
lang('active'),
-                                                               'type' => 
'checkbox',
-                                                               'default' => 
'checked'
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => lang('periodization'),
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::property::accounting::periodization'
-                                       );
-                                       break;
-                               case 'tax':
-                                       $info = array
-                                               (
-                                               'table' => 'fm_ecomva',
-                                               'id' => array('name' => 'id', 
'type' => 'int'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'percent',
-                                                               'descr' => 
lang('percent'),
-                                                               'type' => 'int'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'descr',
-                                                               'descr' => 
lang('descr'),
-                                                               'type' => 
'varchar'
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => lang('tax code'),
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::property::accounting::accounting_tax'
-                                       );
-                                       break;
-                               case 'voucher_cat':
-                                       $info = array
-                                               (
-                                               'table' => 
'fm_ecobilag_category',
-                                               'id' => array('name' => 'id', 
'type' => 'int'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'descr',
-                                                               'descr' => 
lang('descr'),
-                                                               'type' => 
'varchar'
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => '',
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::property::accounting::voucher_cats'
-                                       );
-                                       break;
-                               case 'voucher_type':
-                                       $info = array
-                                               (
-                                               'table' => 'fm_ecoart',
-                                               'id' => array('name' => 'id', 
'type' => 'int'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'descr',
-                                                               'descr' => 
lang('descr'),
-                                                               'type' => 
'varchar'
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => '',
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::property::accounting::voucher_type'
-                                       );
-                                       break;
-                               case 'tender_chapter':
-                                       $info = array
-                                               (
-                                               'table' => 'fm_chapter',
-                                               'id' => array('name' => 'id', 
'type' => 'int'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'descr',
-                                                               'descr' => 
lang('descr'),
-                                                               'type' => 
'varchar'
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => '',
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::property::tender'
-                                       );
-                                       break;
-                               case 'location':
-
-                                       $this->_db->query("SELECT id FROM 
fm_location_type WHERE id ={$type_id}", __LINE__, __FILE__);
-
-                                       if ($this->_db->next_record())
-                                       {
-                                               $info = array
-                                                       (
-                                                       'table' => 
"fm_location{$type_id}_category",
-                                                       'id' => array('name' => 
'id', 'type' => 'varchar'),
-                                                       'fields' => array
-                                                               (
-                                                               array
-                                                                       (
-                                                                       'name' 
=> 'descr',
-                                                                       'descr' 
=> lang('descr'),
-                                                                       'type' 
=> 'varchar'
-                                                               )
-                                                       ),
-                                                       'edit_msg' => 
lang('edit'),
-                                                       'add_msg' => 
lang('add'),
-                                                       'name' => '',
-                                                       'acl_app' => 'property',
-                                                       'acl_location' => 
'.admin',
-                                                       'menu_selection' => 
"admin::property::location::location::category_{$type_id}"
-                                               );
-                                       }
-                                       else
-                                       {
-                                               throw new 
Exception(lang('ERROR: illegal type %1', $type_id));
-                                       }
-                                       break;
-                               case 'owner_cats':
-                                       $info = array
-                                               (
-                                               'table' => 'fm_owner_category',
-                                               'id' => array('name' => 'id', 
'type' => 'int'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'descr',
-                                                               'descr' => 
lang('descr'),
-                                                               'type' => 
'varchar'
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => '',
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::property::owner::owner_cats'
-                                       );
-                                       break;
-                               case 'tenant_cats':
-                                       $info = array
-                                               (
-                                               'table' => 'fm_tenant_category',
-                                               'id' => array('name' => 'id', 
'type' => 'int'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'descr',
-                                                               'descr' => 
lang('descr'),
-                                                               'type' => 
'varchar'
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => lang('tenant 
category'),
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::property::tenant::tenant_cats'
-                                       );
-                                       break;
-                               case 'vendor_cats':
-                                       $info = array
-                                               (
-                                               'table' => 'fm_vendor_category',
-                                               'id' => array('name' => 'id', 
'type' => 'int'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'descr',
-                                                               'descr' => 
lang('descr'),
-                                                               'type' => 
'varchar'
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => lang('vendor 
category'),
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::property::vendor::vendor_cats'
-                                       );
-                                       break;
-                               case 'vendor':
-                                       $info = array
-                                               (
-                                               'table' => 'fm_vendor',
-                                               'id' => array('name' => 'id', 
'type' => 'int'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'contact_phone',
-                                                               'descr' => 
lang('contact phone'),
-                                                               'type' => 
'varchar'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'category',
-                                                               'descr' => 
lang('category'),
-                                                               'type' => 
'select',
-                                                               'nullable' => 
false,
-                                                               'filter' => 
true,
-                                                               'sortable' => 
true,
-                                                               'values_def' => 
array
-                                                                       (
-                                                                       
'valueset' => false,
-                                                                       
'method' => 'property.bogeneric.get_list',
-                                                                       
'get_single_value' => 'property.sogeneric.get_name',
-                                                                       
'method_input' => array('type' => 'vendor_cats', 'selected' => '##category##')
-                                                               )
-                                                       ),
-                                                       array
-                                                               (
-                                                               //FIXME
-                                                               'name' => 
'member_of',
-                                                               'descr' => 
lang('member'),
-                                                               'type' => 
'multiple_select',
-                                                               'nullable' => 
true,
-                                                               'filter' => 
true,
-                                                               'sortable' => 
false,
-                                                               'hidden' => 
false,
-                                                               'values_def' => 
array
-                                                                       (
-                                                                       
'valueset' => false,
-                                                                       
'method' => 'property.bocommon.get_categories',
-                                                                       
'method_input' => array('app' => 'property', 'acl_location' => '.vendor',
-                                                                               
'selected' => '##member_of##')
-                                                               )
-                                                       ),
-                                               ),
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => lang('vendor'),
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.vendor',
-                                               'menu_selection' => 
'property::economy::vendor',
-                                               'default' => array
-                                                       (
-                                                       'owner_id' => 
array('add' => '$this->account'),
-                                                       'entry_date' => 
array('add' => 'time()'),
-                                               //                      
'modified_date' => array('edit' => 'time()'),
-                                               )
-                                       );
-                                       break;
-                               case 'owner':
-                                       $info = array
-                                               (
-                                               'table' => 'fm_owner',
-                                               'id' => array('name' => 'id', 
'type' => 'int'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'remark',
-                                                               'descr' => 
lang('remark'),
-                                                               'type' => 'text'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'category',
-                                                               'descr' => 
lang('category'),
-                                                               'type' => 
'select',
-                                                               'nullable' => 
false,
-                                                               'filter' => 
true,
-                                                               'sortable' => 
true,
-                                                               'values_def' => 
array
-                                                                       (
-                                                                       
'valueset' => false,
-                                                                       
'method' => 'property.bogeneric.get_list',
-                                                                       
'get_single_value' => 'property.sogeneric.get_name',
-                                                                       
'method_input' => array('type' => 'owner_cats', 'selected' => '##category##')
-                                                               )
-                                                       ),
-                                               ),
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => lang('owner'),
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.owner',
-                                               'menu_selection' => 
'admin::property::owner',
-                                               'default' => array
-                                                       (
-                                                       'owner_id' => 
array('add' => '$this->account'),
-                                                       'entry_date' => 
array('add' => 'time()'),
-                                               //                      
'modified_date' => array('edit' => 'time()'),
-                                               )
-                                       );
-                                       break;
-                               case 'tenant':
-                                       $info = array
-                                               (
-                                               'table' => 'fm_tenant',
-                                               'id' => array('name' => 'id', 
'type' => 'int'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'contact_email',
-                                                               'descr' => 
lang('contact_email'),
-                                                               'type' => 
'varchar',
-                                                               'sortable' => 
true,
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'category',
-                                                               'descr' => 
lang('category'),
-                                                               'type' => 
'select',
-                                                               'nullable' => 
false,
-                                                               'filter' => 
true,
-                                                               'sortable' => 
true,
-                                                               'values_def' => 
array
-                                                                       (
-                                                                       
'valueset' => false,
-                                                                       
'method' => 'property.bogeneric.get_list',
-                                                                       
'get_single_value' => 'property.sogeneric.get_name',
-                                                                       
'method_input' => array('type' => 'tenant_cats', 'selected' => '##category##')
-                                                               )
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => lang('tenant'),
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.tenant',
-                                               'menu_selection' => 
'admin::property::tenant',
-                                               'default' => array
-                                                       (
-                                                       'owner_id' => 
array('add' => '$this->account'),
-                                                       'entry_date' => 
array('add' => 'time()'),
-                                               //                      
'modified_date' => array('edit' => 'time()'),
-                                               )
-                                       );
-                                       break;
-                               case 'district':
-                                       $info = array
-                                               (
-                                               'table' => 'fm_district',
-                                               'id' => array('name' => 'id', 
'type' => 'int'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'descr',
-                                                               'descr' => 
lang('descr'),
-                                                               'type' => 
'varchar'
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => lang('district'),
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::property::location::district'
-                                       );
-                                       break;
-                               case 'street':
-                                       $info = array
-                                               (
-                                               'table' => 'fm_streetaddress',
-                                               'id' => array('name' => 'id', 
'type' => 'int'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'descr',
-                                                               'descr' => 
lang('descr'),
-                                                               'type' => 
'varchar'
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => lang('streetaddress'),
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::property::location::street'
-                                       );
-                                       break;
-                               case 's_agreement':
-                                       $info = array
-                                               (
-                                               'table' => 
'fm_s_agreement_category',
-                                               'id' => array('name' => 'id', 
'type' => 'int'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'descr',
-                                                               'descr' => 
lang('descr'),
-                                                               'type' => 
'varchar'
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => '',
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::property::agreement::service_agree_cats'
-                                       );
-                                       break;
-                               case 'tenant_claim':
-                                       $info = array
-                                               (
-                                               'table' => 
'fm_tenant_claim_category',
-                                               'id' => array('name' => 'id', 
'type' => 'int'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'descr',
-                                                               'descr' => 
lang('descr'),
-                                                               'type' => 
'varchar'
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => '',
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::property::tenant::claims_cats'
-                                       );
-                                       break;
-                               case 'wo_hours':
-                                       $info = array
-                                               (
-                                               'table' => 
'fm_wo_hours_category',
-                                               'id' => array('name' => 'id', 
'type' => 'int'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'descr',
-                                                               'descr' => 
lang('descr'),
-                                                               'type' => 
'varchar'
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => '',
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::property::workorder_detail'
-                                       );
-                                       break;
-                               case 'r_condition_type':
-                                       $info = array
-                                               (
-                                               'table' => 
'fm_request_condition_type',
-                                               'id' => array('name' => 'id', 
'type' => 'int'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'name',
-                                                               'descr' => 
lang('name'),
-                                                               'type' => 
'varchar'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'descr',
-                                                               'descr' => 
lang('descr'),
-                                                               'type' => 
'varchar'
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => 'condition type',
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::property::request_condition'
-                                       );
-                                       break;
-                               case 'authorities_demands':
-                                       $info = array
-                                               (
-                                               'table' => 
'fm_authorities_demands',
-                                               'id' => array('name' => 'id', 
'type' => 'int'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'name',
-                                                               'descr' => 
lang('name'),
-                                                               'type' => 
'varchar'
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => lang('authorities 
demands'),
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::property::authorities_demands',
-                                               'default' => array
-                                                       (
-                                                       'user_id' => 
array('add' => '$this->account'),
-                                                       'entry_date' => 
array('add' => 'time()'),
-                                                       'modified_date' => 
array('edit' => 'time()'),
-                                               ),
-                                               'check_grant' => false
-                                       );
-                                       break;
-                               case 'b_account':
-                               case 'b_account_category':
-                                       $info = array
-                                               (
-                                               'table' => 
'fm_b_account_category',
-                                               'id' => array('name' => 'id', 
'type' => 'int'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'descr',
-                                                               'descr' => 
lang('descr'),
-                                                               'type' => 
'varchar'
-                                                       ),
-                                                       array(
-                                                               'name' => 
'active',
-                                                               'descr' => 
lang('active'),
-                                                               'type' => 
'checkbox',
-                                                               'default' => 
'checked',
-                                                               'filter' => 
true,
-                                                               'sortable' => 
true,
-                                                               'values_def' => 
array
-                                                                       (
-                                                                       
'valueset' => array(array('id' => 1, 'name' => lang('active'))),
-                                                               )
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'external_project',
-                                                               'descr' => 
lang('mandatory project group'),
-                                                               'type' => 
'checkbox'
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => lang('budget account 
group'),
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::property::accounting::accounting_cats'
-                                       );
-                                       break;
-
-                               case 'dimb_role':
-                                       $info = array
-                                               (
-                                               'table' => 'fm_ecodimb_role',
-                                               'id' => array('name' => 'id', 
'type' => 'int'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'name',
-                                                               'descr' => 
lang('name'),
-                                                               'type' => 
'varchar'
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit role'),
-                                               'add_msg' => lang('add role'),
-                                               'name' => lang('dimb role'),
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::property::accounting::dimb_role'
-                                       );
-                                       break;
-                               case 'condition_survey_status':
-                                       $info = array
-                                               (
-                                               'table' => 
'fm_condition_survey_status',
-                                               'id' => array('name' => 'id', 
'type' => 'int'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'descr',
-                                                               'descr' => 
lang('descr'),
-                                                               'type' => 
'varchar'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'sorting',
-                                                               'descr' => 
lang('sorting'),
-                                                               'type' => 
'integer',
-                                                               'sortable' => 
true
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'in_progress',
-                                                               'descr' => 
lang('In progress'),
-                                                               'type' => 
'checkbox'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'delivered',
-                                                               'descr' => 
lang('delivered'),
-                                                               'type' => 
'checkbox'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'closed',
-                                                               'descr' => 
lang('closed'),
-                                                               'type' => 
'checkbox'
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit 
status'),
-                                               'add_msg' => lang('add status'),
-                                               'name' => lang('request 
status'),
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::property::condition_survey_status'
-                                       );
-                                       break;
-
-                               case 'request_responsible_unit':
-                                       $_lang_responsible_unit = 
lang('responsible unit');
-                                       $info = array
-                                               (
-                                               'table' => 
'fm_request_responsible_unit',
-                                               'id' => array('name' => 'id', 
'type' => 'int'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'name',
-                                                               'descr' => 
lang('name'),
-                                                               'type' => 
'varchar'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'descr',
-                                                               'descr' => 
lang('descr'),
-                                                               'type' => 
'varchar'
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit') . ' 
' . $_lang_responsible_unit,
-                                               'add_msg' => lang('add') . ' ' 
. $_lang_responsible_unit,
-                                               'name' => 
$_lang_responsible_unit,
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::property::request_responsible_unit'
-                                       );
-                                       break;
-
-                               case 'ticket_priority':
-                                       $_lang_priority = lang('priority');
-                                       $info = array
-                                               (
-                                               'table' => 'fm_tts_priority',
-                                               'id' => array('name' => 'id', 
'type' => 'int'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'name',
-                                                               'descr' => 
lang('name'),
-                                                               'type' => 
'varchar'
-                                                       ),
-                                               ),
-                                               'edit_msg' => lang('edit') . ' 
' . $_lang_priority,
-                                               'add_msg' => lang('add') . ' ' 
. $_lang_priority,
-                                               'name' => $_lang_priority,
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::property::ticket::ticket_priority'
-                                       );
-                                       break;
-
-                               //-------- ID type varchar
-                               case 'external_project':
-                                       $info = array
-                                               (
-                                               'table' => 
'fm_external_project',
-                                               'id' => array('name' => 'id', 
'type' => 'varchar'),
-                                               'fields' => array(
-                                                       array(
-                                                               'name' => 
'name',
-                                                               'descr' => 
lang('name'),
-                                                               'type' => 
'varchar'
-                                                       ),
-                                                       array(
-                                                               'name' => 
'budget',
-                                                               'descr' => 
lang('budget'),
-                                                               'type' => 'int'
-                                                       ),
-                                                       array(
-                                                               'name' => 
'active',
-                                                               'descr' => 
lang('active'),
-                                                               'type' => 
'checkbox',
-                                                               'default' => 
'checked',
-                                                               'filter' => 
true,
-                                                               'sortable' => 
true,
-                                                               'values_def' => 
array
-                                                                       (
-                                                                       
'valueset' => array(array('id' => 1, 'name' => lang('active'))),
-                                                               )
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => lang('external 
project'),
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::property::external_project'
-                                       );
-                                       break;
-                               case 'unspsc_code':
-                                       $info = array
-                                               (
-                                               'table' => 'fm_unspsc_code',
-                                               'id' => array('name' => 'id', 
'type' => 'varchar'),
-                                               'fields' => array(
-                                                       array
-                                                               (
-                                                               'name' => 
'name',
-                                                               'descr' => 
lang('name'),
-                                                               'type' => 
'varchar'
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => lang('unspsc code'),
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::property::unspsc_code'
-                                       );
-                                       break;
-                               case 'project_status':
-                                       $info = array
-                                               (
-                                               'table' => 'fm_project_status',
-                                               'id' => array('name' => 'id', 
'type' => 'varchar'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'descr',
-                                                               'descr' => 
lang('descr'),
-                                                               'type' => 
'varchar'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'approved',
-                                                               'descr' => 
lang('approved'),
-                                                               'type' => 
'checkbox'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'closed',
-                                                               'descr' => 
lang('closed'),
-                                                               'type' => 
'checkbox'
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit 
status'),
-                                               'add_msg' => lang('add status'),
-                                               'name' => lang('project 
status'),
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::property::project_status'
-                                       );
-                                       break;
-                               case 'workorder_status':
-                                       $info = array
-                                               (
-                                               'table' => 
'fm_workorder_status',
-                                               'id' => array('name' => 'id', 
'type' => 'varchar'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'descr',
-                                                               'descr' => 
lang('descr'),
-                                                               'type' => 
'varchar'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'approved',
-                                                               'descr' => 
lang('approved'),
-                                                               'type' => 
'checkbox'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'in_progress',
-                                                               'descr' => 
lang('In progress'),
-                                                               'type' => 
'checkbox'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'delivered',
-                                                               'descr' => 
lang('delivered'),
-                                                               'type' => 
'checkbox'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'closed',
-                                                               'descr' => 
lang('closed'),
-                                                               'type' => 
'checkbox'
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit 
status'),
-                                               'add_msg' => lang('add status'),
-                                               'name' => lang('workorder 
status'),
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::property::workorder_status'
-                                       );
-                                       break;
-                               case 'request_status':
-                                       $info = array
-                                               (
-                                               'table' => 'fm_request_status',
-                                               'id' => array('name' => 'id', 
'type' => 'varchar'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'descr',
-                                                               'descr' => 
lang('descr'),
-                                                               'type' => 
'varchar'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'sorting',
-                                                               'descr' => 
lang('sorting'),
-                                                               'type' => 
'integer',
-                                                               'sortable' => 
true
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'in_progress',
-                                                               'descr' => 
lang('In progress'),
-                                                               'type' => 
'checkbox'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'delivered',
-                                                               'descr' => 
lang('delivered'),
-                                                               'type' => 
'checkbox'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'closed',
-                                                               'descr' => 
lang('closed'),
-                                                               'type' => 
'checkbox'
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit 
status'),
-                                               'add_msg' => lang('add status'),
-                                               'name' => lang('request 
status'),
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::property::request_status'
-                                       );
-                                       break;
-                               case 'agreement_status':
-                                       $info = array
-                                               (
-                                               'table' => 
'fm_agreement_status',
-                                               'id' => array('name' => 'id', 
'type' => 'varchar'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'descr',
-                                                               'descr' => 
lang('descr'),
-                                                               'type' => 
'varchar'
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit 
status'),
-                                               'add_msg' => lang('add status'),
-                                               'name' => lang('agreement 
status'),
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::property::agreement::agreement_status'
-                                       );
-                                       break;
-                               case 'building_part':
-
-                                       $config = 
CreateObject('phpgwapi.config', 'property');
-                                       $config->read();
-
-                                       $filter_buildingpart = 
isset($config->config_data['filter_buildingpart']) ? 
$config->config_data['filter_buildingpart'] : array();
-
-                                       $info = array
-                                               (
-                                               'table' => 'fm_building_part',
-                                               'id' => array('name' => 'id', 
'type' => 'varchar'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'descr',
-                                                               'descr' => 
lang('descr'),
-                                                               'type' => 
'varchar'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'filter_1',
-                                                               'descr' => 
isset($filter_buildingpart[1]) && $filter_buildingpart[1] ? 
$filter_buildingpart[1] : 'Filter 1',
-                                                               'type' => 
'checkbox',
-                                                               'filter' => 
true,
-                                                               'sortable' => 
true,
-                                                               'values_def' => 
array
-                                                                       (
-                                                                       
'valueset' => array(array('id' => 1, 'name' => lang('active'))),
-                                                               )
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'filter_2',
-                                                               'descr' => 
isset($filter_buildingpart[2]) && $filter_buildingpart[2] ? 
$filter_buildingpart[2] : 'Filter 2',
-                                                               'type' => 
'checkbox',
-                                                               'filter' => 
true,
-                                                               'sortable' => 
true,
-                                                               'values_def' => 
array
-                                                                       (
-                                                                       
'valueset' => array(array('id' => 1, 'name' => lang('active'))),
-                                                               )
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'filter_3',
-                                                               'descr' => 
isset($filter_buildingpart[3]) && $filter_buildingpart[3] ? 
$filter_buildingpart[3] : 'Filter 3',
-                                                               'type' => 
'checkbox',
-                                                               'filter' => 
true,
-                                                               'sortable' => 
true,
-                                                               'values_def' => 
array
-                                                                       (
-                                                                       
'valueset' => array(array('id' => 1, 'name' => lang('active'))),
-                                                               )
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'filter_4',
-                                                               'descr' => 
isset($filter_buildingpart[4]) && $filter_buildingpart[4] ? 
$filter_buildingpart[4] : 'Filter 4',
-                                                               'type' => 
'checkbox',
-                                                               'filter' => 
true,
-                                                               'sortable' => 
true,
-                                                               'values_def' => 
array
-                                                                       (
-                                                                       
'valueset' => array(array('id' => 1, 'name' => lang('active'))),
-                                                               )
-                                                       ),
-                                               ),
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => lang('building part'),
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::property::building_part'
-                                       );
-                                       break;
-                               case 'document_status':
-                                       $info = array
-                                               (
-                                               'table' => 'fm_document_status',
-                                               'id' => array('name' => 'id', 
'type' => 'varchar'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'descr',
-                                                               'descr' => 
lang('descr'),
-                                                               'type' => 
'varchar'
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit 
status'),
-                                               'add_msg' => lang('add status'),
-                                               'name' => lang('document 
status'),
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::property::document_status'
-                                       );
-                                       break;
-                               case 'ns3420':
-                                       $info = array
-                                               (
-                                               'table' => 'fm_ns3420',
-                                               'id' => array('name' => 'id', 
'type' => 'varchar'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'parent_id',
-                                                               'descr' => 
lang('parent'),
-                                                               'type' => 
'select',
-                                                               'sortable' => 
true,
-                                                               'nullable' => 
true,
-                                                               'filter' => 
false,
-                                                               'role' => 
'parent',
-                                                               'values_def' => 
array
-                                                                       (
-                                                                       
'valueset' => false,
-                                                                       
'method' => 'property.bogeneric.get_list',
-                                                                       
'get_single_value' => 'property.sogeneric.get_name',
-                                                                       
'method_input' => array('type' => 'ns3420', 'role' => 'parent', 'selected' => 
'##parent_id##',
-                                                                               
'id_in_name' => 'num', 'mapping' => array('name' => 'tekst1')
-                                                                       )
-                                                               )
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 'num',
-                                                               'descr' => 
lang('num'),
-                                                               'type' => 
'varchar',
-                                                               'nullable' => 
false,
-                                                               'sortable' => 
true
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'tekst1',
-                                                               'descr' => 
'tekst1',
-                                                               'type' => 
'varchar'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'tekst2',
-                                                               'descr' => 
'tekst2',
-                                                               'type' => 
'varchar'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'tekst3',
-                                                               'descr' => 
'tekst3',
-                                                               'type' => 
'varchar'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'tekst4',
-                                                               'descr' => 
'tekst4',
-                                                               'type' => 
'varchar'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'tekst5',
-                                                               'descr' => 
'tekst5',
-                                                               'type' => 
'varchar'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'tekst6',
-                                                               'descr' => 
'tekst6',
-                                                               'type' => 
'varchar'
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => lang('ns3420'),
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::property::ns3420',
-                                               'check_grant' => false
-                                       );
-                                       break;
-                               case 'unit':
-                                       $info = array
-                                               (
-                                               'table' => 'fm_standard_unit',
-                                               'id' => array('name' => 'id', 
'type' => 'int'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'name',
-                                                               'descr' => 
lang('name'),
-                                                               'type' => 
'varchar'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'descr',
-                                                               'descr' => 
lang('descr'),
-                                                               'type' => 
'varchar'
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit unit'),
-                                               'add_msg' => lang('add unit'),
-                                               'name' => lang('unit'),
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::property::unit'
-                                       );
-                                       break;
-                               case 'budget_account':
-                                       $info = array
-                                               (
-                                               'table' => 'fm_b_account',
-                                               'id' => array('name' => 'id', 
'type' => 'varchar'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'descr',
-                                                               'descr' => 
lang('descr'),
-                                                               'type' => 
'varchar',
-                                                               'nullable' => 
false,
-                                                               'size' => 60,
-                                                               'sortable' => 
true
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'category',
-                                                               'descr' => 
lang('category'),
-                                                               'type' => 
'select',
-                                                               'nullable' => 
false,
-                                                               'filter' => 
true,
-                                                               'sortable' => 
true,
-                                                               'values_def' => 
array
-                                                                       (
-                                                                       
'valueset' => false,
-                                                                       
'method' => 'property.bogeneric.get_list',
-                                                                       
'get_single_value' => 'property.sogeneric.get_name',
-                                                                       
'method_input' => array('type' => 'b_account', 'selected' => 
'##category##')//b_account_category
-                                                               )
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 'mva',
-                                                               'descr' => 
lang('tax code'),
-                                                               'type' => 'int',
-                                                               'nullable' => 
true,
-                                                               'size' => 4,
-                                                               'sortable' => 
true
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'responsible',
-                                                               'descr' => 
lang('responsible'),
-                                                               'type' => 
'select',
-                                                               'filter' => 
true,
-                                                               'values_def' => 
array
-                                                                       (
-                                                                       
'valueset' => false,
-                                                                       
'get_single_value' => 'get_user',
-                                                                       
'method' => 'property.bocommon.get_user_list_right2',
-                                                                       
'method_input' => array('selected' => '##responsible##', 'right' => 128,
-                                                                               
'acl_location' => '.invoice')
-                                                               )
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'active',
-                                                               'descr' => 
lang('active'),
-                                                               'type' => 
'checkbox',
-                                                               'default' => 
'checked'
-                                                       ),
-                                               ),
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => lang('budget 
account'),
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.b_account',
-                                               'menu_selection' => 
'property::economy::budget_account',
-                                               'default' => array
-                                                       (
-                                                       'user_id' => 
array('add' => '$this->account'),
-                                                       'entry_date' => 
array('add' => 'time()'),
-                                                       'modified_date' => 
array('edit' => 'time()'),
-                                               ),
-                                               'check_grant' => false
-                                       );
-
-                                       break;
-                               case 'voucher_process_code':
-                                       $info = array
-                                               (
-                                               'table' => 
'fm_ecobilag_process_code',
-                                               'id' => array('name' => 'id', 
'type' => 'varchar'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'name',
-                                                               'descr' => 
lang('name'),
-                                                               'type' => 
'varchar'
-                                                       ),
-                                               ),
-                                               'edit_msg' => lang('edit 
process code'),
-                                               'add_msg' => lang('add process 
code'),
-                                               'name' => lang('process code'),
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::property::accounting::process_code',
-                                               'default' => array
-                                                       (
-                                                       'user_id' => 
array('add' => '$this->account'),
-                                                       'entry_date' => 
array('add' => 'time()'),
-                                                       'modified_date' => 
array('edit' => 'time()'),
-                                               )
-                                       );
-                                       break;
-
-                               case 'org_unit':
-
-                                       $info = array
-                                               (
-                                               'table' => 'fm_org_unit',
-                                               'id' => array('name' => 'id', 
'type' => 'int'),
-                                               'fields' => array(
-                                                       array(
-                                                               'name' => 
'name',
-                                                               'descr' => 
lang('name'),
-                                                               'type' => 
'varchar',
-                                                               'nullable' => 
false,
-                                                               'size' => 60,
-                                                               'sortable' => 
true
-                                                       ),
-                                                       array(
-                                                               'name' => 
'parent_id',
-                                                               'descr' => 
lang('parent'),
-                                                               'type' => 
'select',
-                                                               'sortable' => 
true,
-                                                               'nullable' => 
true,
-                                                               'filter' => 
false,
-                                                               'role' => 
'parent',
-                                                               'values_def' => 
array
-                                                                       (
-                                                                       
'valueset' => false,
-                                                                       
'method' => 'property.bogeneric.get_list',
-                                                                       
'method_input' => array('type' => 'org_unit', 'role' => 'parent', 'selected' => 
'##parent_id##')
-                                                               )
-                                                       ),
-                                                       array(
-                                                               'name' => 
'active',
-                                                               'descr' => 
lang('active'),
-                                                               'type' => 
'checkbox',
-                                                               'default' => 
'checked',
-                                                               'filter' => 
true,
-                                                               'sortable' => 
true,
-                                                               'values_def' => 
array(
-                                                                       
'valueset' => array(array('id' => 1, 'name' => lang('active'))),
-                                                               )
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => lang('department'),
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.org_unit',
-                                               'menu_selection' => 
'admin::property::accounting::org_unit',
-                                               'default' => array
-                                                       (
-                                                       'created_by' => 
array('add' => '$this->account'),
-                                                       'created_on' => 
array('add' => 'time()'),
-                                                       'modified_by' => 
array('edit' => '$this->account'),
-                                                       'modified_on' => 
array('edit' => 'time()'),
-                                               ),
-                                               'check_grant' => false
-                                       );
-                                       break;
-
-                               case 'eco_service':
-                                       $info = array(
-                                               'table' => 'fm_eco_service',
-                                               'id' => array('name' => 'id', 
'type' => 'int'),
-                                               'fields' => array(
-                                                       array(
-                                                               'name' => 
'name',
-                                                               'descr' => 
lang('name'),
-                                                               'type' => 
'varchar',
-                                                               'nullable' => 
false,
-                                                               'size' => 50,
-                                                               'sortable' => 
true
-                                                       ),
-                                                       array(
-                                                               'name' => 
'active',
-                                                               'descr' => 
lang('active'),
-                                                               'type' => 
'checkbox',
-                                                               'default' => 
'checked'
-                                                       ),
-                                               ),
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => lang('service'),
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.b_account',
-                                               'menu_selection' => 
'property::economy::eco_service',
-                                               'check_grant' => false
-                                       );
-                                       break;
-                               //-------- ID type auto
-
-                               case 'dimb_role_user':
-
-                                       $info = array
-                                               (
-                                               'table' => 
'fm_ecodimb_role_user',
-                                               'id' => array('name' => 'id', 
'type' => 'auto'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'ecodimb',
-                                                               'descr' => 
lang('dim b'),
-                                                               'type' => 
'select',
-                                                               'nullable' => 
false,
-                                                               'filter' => 
true,
-                                                               'sortable' => 
true,
-                                                               'values_def' => 
array
-                                                                       (
-                                                                       
'valueset' => false,
-                                                                       
'method' => 'property.bogeneric.get_list',
-                                                                       
'method_input' => array('type' => 'dimb', 'selected' => 
'##ecodimb##')//b_account_category
-                                                               )
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'role_id',
-                                                               'descr' => 
lang('role type'),
-                                                               'type' => 
'select',
-                                                               'filter' => 
true,
-                                                               'sortable' => 
true,
-                                                               'values_def' => 
array
-                                                                       (
-                                                                       
'valueset' => false,
-                                                                       
'method' => 'property.bogeneric.get_list',
-                                                                       
'get_single_value' => 'property.sogeneric.get_name',
-                                                                       
'method_input' => array('type' => 'dimb_role', 'selected' => '##role_id##')
-                                                               )
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'user_id',
-                                                               'descr' => 
lang('user'),
-                                                               'type' => 
'select',
-                                                               'filter' => 
true,
-                                                               'values_def' => 
array
-                                                                       (
-                                                                       
'valueset' => false,
-                                                                       
'get_single_value' => 'get_user',
-                                                                       
'method' => 'property.bocommon.get_user_list_right2',
-                                                                       
'method_input' => array('selected' => '##user_id##', 'right' => 1, 
'acl_location' => '.invoice')
-                                                               )
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'default_user',
-                                                               'descr' => 
lang('default'),
-                                                               'type' => 
'checkbox',
-                                                               'default' => 
'checked'
-                                                       ),
-                                               ),
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => lang('dimb role'),
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::property::accounting::dimb_role_user',
-                                               'default' => array
-                                                       (
-                                                       'created_by' => 
array('add' => '$this->account'),
-                                                       'created_on' => 
array('add' => 'time()'),
-                                               ),
-                                               'check_grant' => false
-                                       );
-                                       break;
-
-                               case 'order_dim1':
-                                       $info = array
-                                               (
-                                               'table' => 'fm_order_dim1',
-                                               'id' => array('name' => 'id', 
'type' => 'auto'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 'num',
-                                                               'descr' => 
lang('name'),
-                                                               'type' => 
'varchar'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'descr',
-                                                               'descr' => 
lang('descr'),
-                                                               'type' => 
'varchar',
-                                                               'nullable' => 
false
-                                                       ),
-                                               ),
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => lang('order_dim1'),
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::property::order_dim1'
-                                       );
-                                       break;
-                               case 'branch':
-                                       $info = array
-                                               (
-                                               'table' => 'fm_branch',
-                                               'id' => array('name' => 'id', 
'type' => 'auto'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 'num',
-                                                               'descr' => 
lang('name'),
-                                                               'type' => 
'varchar'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'descr',
-                                                               'descr' => 
lang('descr'),
-                                                               'type' => 
'varchar'
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => lang('branch'),
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::property::branch'
-                                       );
-
-                                       break;
-                               case 'key_location':
-                                       $info = array
-                                               (
-                                               'table' => 'fm_key_loc',
-                                               'id' => array('name' => 'id', 
'type' => 'auto'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 'num',
-                                                               'descr' => 
lang('name'),
-                                                               'type' => 
'varchar'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'descr',
-                                                               'descr' => 
lang('key location'),
-                                                               'type' => 'text'
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => lang('branch'),
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::property::key_location'
-                                       );
-
-                                       break;
-
-                               case 'async':
-                                       $info = array
-                                               (
-                                               'table' => 'fm_async_method',
-                                               'id' => array('name' => 'id', 
'type' => 'auto'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'name',
-                                                               'descr' => 
lang('name'),
-                                                               'type' => 
'varchar'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'data',
-                                                               'descr' => 
lang('data'),
-                                                               'type' => 'text'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'descr',
-                                                               'descr' => 
lang('descr'),
-                                                               'type' => 'text'
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => lang('Async 
services'),
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::property::async'
-                                       );
-                                       break;
-
-                               case 'event_action':
-                                       $info = array
-                                               (
-                                               'table' => 'fm_event_action',
-                                               'id' => array('name' => 'id', 
'type' => 'auto'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'name',
-                                                               'descr' => 
lang('name'),
-                                                               'type' => 
'varchar'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'action',
-                                                               'descr' => 
lang('action'),
-                                                               'type' => 
'varchar'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'data',
-                                                               'descr' => 
lang('data'),
-                                                               'type' => 'text'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'descr',
-                                                               'descr' => 
lang('descr'),
-                                                               'type' => 'text'
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => lang('event action'),
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::property::event_action',
-                                               'default' => array
-                                                       (
-                                                       'user_id' => 
array('add' => '$this->account'),
-                                                       'entry_date' => 
array('add' => 'time()'),
-                                                       'modified_date' => 
array('edit' => 'time()'),
-                                               )
-                                       );
-
-                                       break;
-
-                               case 'ticket_status':
-
-                                       $info = array
-                                               (
-                                               'table' => 'fm_tts_status',
-                                               'id' => array('name' => 'id', 
'type' => 'auto'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'name',
-                                                               'descr' => 
lang('name'),
-                                                               'type' => 
'varchar'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'sorting',
-                                                               'descr' => 
lang('sorting'),
-                                                               'type' => 
'integer',
-                                                               'sortable' => 
true
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'color',
-                                                               'descr' => 
lang('color'),
-                                                               'type' => 
'varchar'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'approved',
-                                                               'descr' => 
lang('approved'),
-                                                               'type' => 
'checkbox'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'in_progress',
-                                                               'descr' => 
lang('In progress'),
-                                                               'type' => 
'checkbox'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'delivered',
-                                                               'descr' => 
lang('delivered'),
-                                                               'type' => 
'checkbox'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'closed',
-                                                               'descr' => 
lang('closed'),
-                                                               'type' => 
'checkbox'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'actual_cost',
-                                                               'descr' => 
lang('mandatory actual cost'),
-                                                               'type' => 
'checkbox'
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => lang('ticket status'),
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::property::ticket::ticket_status'
-                                       );
-                                       break;
-
-
-                               case 'regulations':
-                                       $info = array
-                                               (
-                                               'table' => 'fm_regulations',
-                                               'id' => array('name' => 'id', 
'type' => 'auto'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'parent_id',
-                                                               'descr' => 
lang('parent'),
-                                                               'type' => 
'select',
-                                                               'sortable' => 
true,
-                                                               'nullable' => 
true,
-                                                               'filter' => 
false,
-                                                               'role' => 
'parent',
-                                                               'values_def' => 
array
-                                                                       (
-                                                                       
'valueset' => false,
-                                                                       
'method' => 'property.bogeneric.get_list',
-                                                                       
'method_input' => array('type' => 'regulations', 'role' => 'parent', 'selected' 
=> '##parent_id##')
-                                                               )
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'name',
-                                                               'descr' => 
lang('name'),
-                                                               'type' => 
'varchar',
-                                                               'sortable' => 
true,
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'descr',
-                                                               'descr' => 
lang('descr'),
-                                                               'type' => 'text'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'external_ref',
-                                                               'descr' => 
lang('external ref'),
-                                                               'type' => 'link'
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => lang('regulations'),
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::property::regulations',
-                                               'default' => array
-                                                       (
-                                                       'user_id' => 
array('add' => '$this->account'),
-                                                       'entry_date' => 
array('add' => 'time()'),
-                                                       'modified_date' => 
array('edit' => 'time()'),
-                                               )
-                                       );
-                                       break;
-//START HELPDESK - APP
-                               case 'helpdesk_status':
-                                       // the helpdesk app
-                                       $info = array
-                                               (
-                                               'table' => 
'phpgw_helpdesk_status',
-                                               'id' => array('name' => 'id', 
'type' => 'auto'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'name',
-                                                               'descr' => 
lang('name'),
-                                                               'type' => 
'varchar'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'sorting',
-                                                               'descr' => 
lang('sorting'),
-                                                               'type' => 
'integer',
-                                                               'sortable' => 
true
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'color',
-                                                               'descr' => 
lang('color'),
-                                                               'type' => 
'varchar'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'approved',
-                                                               'descr' => 
lang('approved'),
-                                                               'type' => 
'checkbox'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'in_progress',
-                                                               'descr' => 
lang('In progress'),
-                                                               'type' => 
'checkbox'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'delivered',
-                                                               'descr' => 
lang('delivered'),
-                                                               'type' => 
'checkbox'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'closed',
-                                                               'descr' => 
lang('closed'),
-                                                               'type' => 
'checkbox'
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => lang('event action'),
-                                               'acl_app' => 'helpdesk',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::helpdesk::ticket_status'
-                                       );
-                                       break;
-
-//END HELPDESK - APP
-                               case 'pending_action_type':
-                                       $info = array
-                                               (
-                                               'table' => 
'fm_action_pending_category',
-                                               'id' => array('name' => 'num', 
'type' => 'varchar'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'name',
-                                                               'descr' => 
lang('name'),
-                                                               'type' => 
'varchar'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'descr',
-                                                               'descr' => 
lang('descr'),
-                                                               'type' => 'text'
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => lang('Pending action 
type'),
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::property::action_type'
-                                       );
-
-                                       break;
-
-                               case 'order_template':
-
-                                       $info = array
-                                               (
-                                               'table' => 'fm_order_template',
-                                               'id' => array('name' => 'id', 
'type' => 'auto'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'name',
-                                                               'descr' => 
lang('name'),
-                                                               'type' => 
'varchar'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'content',
-                                                               'descr' => 
lang('content'),
-                                                               'type' => 'text'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'public',
-                                                               'descr' => 
lang('public'),
-                                                               'type' => 
'checkbox'
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => lang('order 
template'),
-                                               'acl_app' => 'property',
-                                               'acl_location' => 
'.ticket.order',
-                                               'menu_selection' => 
'property::helpdesk::order_template',
-                                               'default' => array
-                                                       (
-                                                       'user_id' => 
array('add' => '$this->account'),
-                                                       'entry_date' => 
array('add' => 'time()'),
-                                                       'modified_date' => 
array('edit' => 'time()'),
-                                               ),
-                                               'check_grant' => true
-                                       );
-
-                                       break;
-                               case 'response_template':
-
-                                       $info = array
-                                               (
-                                               'table' => 
'fm_response_template',
-                                               'id' => array('name' => 'id', 
'type' => 'auto'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'name',
-                                                               'descr' => 
lang('name'),
-                                                               'type' => 
'varchar'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'content',
-                                                               'descr' => 
lang('content'),
-                                                               'type' => 'text'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'public',
-                                                               'descr' => 
lang('public'),
-                                                               'type' => 
'checkbox'
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => lang('response 
template'),
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.ticket',
-                                               'menu_selection' => 
'property::helpdesk::response_template',
-                                               'default' => array
-                                                       (
-                                                       'user_id' => 
array('add' => '$this->account'),
-                                                       'entry_date' => 
array('add' => 'time()'),
-                                                       'modified_date' => 
array('edit' => 'time()'),
-                                               ),
-                                               'check_grant' => true
-                                       );
-
-                                       break;
-
-                               case 'responsibility_role':
-
-                                       $info = array
-                                               (
-                                               'table' => 
'fm_responsibility_role',
-                                               'id' => array('name' => 'id', 
'type' => 'auto'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'name',
-                                                               'descr' => 
lang('name'),
-                                                               'type' => 
'varchar'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'remark',
-                                                               'descr' => 
lang('remark'),
-                                                               'type' => 'text'
-                                                       ),
-                                                       array(
-                                                               'name' => 
'location_level',
-                                                               'descr' => 
lang('location level'),
-                                                               'type' => 
'varchar'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'responsibility_id',
-                                                               'descr' => 
lang('responsibility'),
-                                                               'type' => 
'select',
-                                                               'values_def' => 
array
-                                                                       (
-                                                                       
'valueset' => false,
-                                                                       
'get_single_value' => 'property.soresponsible.get_responsibility_name',
-                                                                       
'method' => 'property.boresponsible.get_responsibilities',
-                                                                       
'method_input' => array('appname' => '$this->appname', 'selected' => 
'##responsibility_id##')
-                                                               )
-                                                       )
-                                               ),
-                                               'edit_action' => 
'property.uiresponsible.edit_role',
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => lang('responsibility 
role'),
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::property::responsibility_role',
-                                               'default' => array
-                                                       (
-                                                       'appname' => 
array('add' => '$this->appname'),
-                                                       'user_id' => 
array('add' => '$this->account'),
-                                                       'entry_date' => 
array('add' => 'time()'),
-                                                       'modified_date' => 
array('edit' => 'time()'),
-                                               ),
-                                               'check_grant' => false,
-                                               'filter' => array('appname' => 
'$this->appname')
-                                       );
-
-                                       break;
-
-                               case 'custom_menu_items':
-                                       $info = array
-                                               (
-                                               'table' => 
'fm_custom_menu_items',
-                                               'id' => array('name' => 'id', 
'type' => 'auto'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'parent_id',
-                                                               'descr' => 
lang('parent'),
-                                                               'type' => 
'select',
-                                                               'sortable' => 
true,
-                                                               'nullable' => 
true,
-                                                               'filter' => 
false,
-                                                               'role' => 
'parent',
-                                                               'values_def' => 
array
-                                                                       (
-                                                                       
'valueset' => false,
-                                                                       
'method' => 'property.bogeneric.get_list',
-                                                                       
'method_input' => array('type' => 'custom_menu_items', 'role' => 'parent',
-                                                                               
'selected' => '##parent_id##', 'mapping' => array('name' => 'text'))
-                                                               )
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'text',
-                                                               'descr' => 
lang('name'),
-                                                               'type' => 
'varchar'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 'url',
-                                                               'descr' => 
lang('url'),
-                                                               'type' => 'text'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'target',
-                                                               'descr' => 
lang('target'),
-                                                               'type' => 
'select',
-                                                               'filter' => 
false,
-                                                               'values_def' => 
array
-                                                                       (
-                                                                       
'valueset' => array(array('id' => '_blank', 'name' => '_blank'), array(
-                                                                               
        'id' => '_parent', 'name' => '_parent')),
-                                                               )
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'location',
-                                                               'descr' => 
lang('location'),
-                                                               'type' => 
'select',
-                                                               'filter' => 
true,
-                                                               'values_def' => 
array
-                                                                       (
-                                                                       
'valueset' => false,
-                                                                       
'method' => 'preferences.boadmin_acl.get_locations',
-                                                                       
'method_input' => array('acl_app' => 'property', 'selected' => '##location##')
-                                                               )
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'local_files',
-                                                               'descr' => 
lang('local files'),
-                                                               'type' => 
'checkbox',
-                                                               'default' => ''
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => lang('custom menu 
items'),
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::property::custom_menu_items',
-                                               'default' => array
-                                                       (
-                                                       'user_id' => 
array('add' => '$this->account'),
-                                                       'entry_date' => 
array('add' => 'time()'),
-                                                       'modified_date' => 
array('edit' => 'time()'),
-                                               ),
-                                               'check_grant' => false,
-                                               'mapping' => array('name' => 
'text')
-                                       );
-
-                                       break;
-                               case 'location_contact':
-                                       $info = array
-                                               (
-                                               'table' => 
'fm_location_contact',
-                                               'id' => array('name' => 'id', 
'type' => 'auto'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'contact_id',
-                                                               'descr' => 
lang('contact'),
-                                                               'type' => 
'int', //contact
-                                                               'nullable' => 
false,
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'location_code',
-                                                               'descr' => 
lang('location_code'),
-                                                               'type' => 
'varchar', //location
-                                                               'nullable' => 
false,
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => lang('location 
contact'),
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::property::location::location_contact',
-                                               'default' => array
-                                                       (
-                                                       'user_id' => 
array('add' => '$this->account'),
-                                                       'entry_date' => 
array('add' => 'time()'),
-                                                       'modified_date' => 
array('edit' => 'time()'),
-                                               )
-                                       );
-
-                                       break;
-
-                               case 'periodization_outline':
-                                       $valueset_month = array();
-
-                                       for ($i = 1; $i < 13; $i++)
-                                       {
-                                               $valueset_month[] = array
-                                                       (
-                                                       'id' => $i,
-                                                       'name' => $i
-                                               );
-                                       }
-
-                                       $info = array
-                                               (
-                                               'table' => 
'fm_eco_periodization_outline',
-                                               'id' => array('name' => 'id', 
'type' => 'auto'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'periodization_id',
-                                                               'descr' => 
lang('periodization'),
-                                                               'type' => 
'select',
-                                                               'nullable' => 
false,
-                                                               'filter' => 
true,
-                                                               'sortable' => 
true,
-                                                               'values_def' => 
array
-                                                                       (
-                                                                       
'valueset' => false,
-                                                                       
'method' => 'property.bogeneric.get_list',
-                                                                       
'get_single_value' => 'property.sogeneric.get_name',
-                                                                       
'method_input' => array('type' => 'periodization', 'selected' => 
'##periodization_id##')
-                                                               )
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'month',
-                                                               'descr' => 
lang('month'),
-                                                               'type' => 
'select',
-                                                               'nullable' => 
false,
-                                                               'filter' => 
true,
-                                                               'sortable' => 
true,
-                                                               'values_def' => 
array
-                                                                       (
-                                                                       
'valueset' => $valueset_month,
-                                                               )
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'value',
-                                                               'descr' => 
lang('value'),
-                                                               'type' => 
'numeric',
-                                                               'nullable' => 
true,
-                                                               'size' => 4,
-                                                               'sortable' => 
true
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'dividend',
-                                                               'descr' => 
lang('fraction::dividend'),
-                                                               'type' => 
'integer',
-                                                               'nullable' => 
true,
-                                                               'size' => 4,
-                                                               'sortable' => 
true
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'divisor',
-                                                               'descr' => 
lang('fraction::divisor'),
-                                                               'type' => 
'integer',
-                                                               'nullable' => 
true,
-                                                               'size' => 4,
-                                                               'sortable' => 
true
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'remark',
-                                                               'descr' => 
lang('remark'),
-                                                               'type' => 
'varchar',
-                                                               'nullable' => 
false,
-                                                               'size' => 60,
-                                                               'sortable' => 
true
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => lang('periodization'),
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::property::accounting::periodization_outline'
-                                       );
-
-                                       break;
-
-                               case 'period_transition':
-                                       $valueset_month = array();
-                                       $valueset_day = array();
-                                       $valueset_hour = array();
-
-                                       $lang_default = lang('default');
-                                       for ($i = 1; $i < 14; $i++)
-                                       {
-                                               $valueset_month[] = array
-                                                       (
-                                                       'id' => $i,
-                                                       'name' => $i == 13 ? 
"{$i} ({$lang_default})" : $i
-                                               );
-                                       }
-
-                                       for ($i = 1; $i < 32; $i++)
-                                       {
-                                               $valueset_day[] = array
-                                                       (
-                                                       'id' => $i,
-                                                       'name' => $i
-                                               );
-                                       }
-
-                                       for ($i = 1; $i < 25; $i++)
-                                       {
-                                               $valueset_hour[] = array
-                                                       (
-                                                       'id' => $i,
-                                                       'name' => $i
-                                               );
-                                       }
-
-                                       $info = array
-                                               (
-                                               'table' => 
'fm_eco_period_transition',
-                                               'id' => array('name' => 'id', 
'type' => 'auto'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'month',
-                                                               'descr' => 
lang('month'),
-                                                               'type' => 
'select',
-                                                               'nullable' => 
false,
-                                                               'filter' => 
true,
-                                                               'sortable' => 
true,
-                                                               'values_def' => 
array
-                                                                       (
-                                                                       
'valueset' => $valueset_month,
-                                                               )
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 'day',
-                                                               'descr' => 
lang('day'),
-                                                               'type' => 
'select',
-                                                               'nullable' => 
false,
-                                                               'size' => 4,
-                                                               'sortable' => 
true,
-                                                               'values_def' => 
array
-                                                                       (
-                                                                       
'valueset' => $valueset_day,
-                                                               )
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'hour',
-                                                               'descr' => 
lang('hour'),
-                                                               'type' => 
'select',
-                                                               'nullable' => 
true,
-                                                               'size' => 4,
-                                                               'sortable' => 
true,
-                                                               'values_def' => 
array
-                                                                       (
-                                                                       
'valueset' => $valueset_hour,
-                                                               )
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'remark',
-                                                               'descr' => 
lang('remark'),
-                                                               'type' => 
'varchar',
-                                                               'nullable' => 
true,
-                                                               'size' => 60,
-                                                               'sortable' => 
true
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => lang('period 
transition'),
-                                               'acl_app' => 'property',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::property::accounting::period_transition',
-                                               'default' => array
-                                                       (
-                                                       'user_id' => 
array('add' => '$this->account'),
-                                                       'entry_date' => 
array('add' => 'time()'),
-                                                       'modified_date' => 
array('edit' => 'time()'),
-                                               )
-                                       );
-
-                                       break;
-
-                               case 'entity_group':
-                                       $info = array
-                                               (
-                                               'table' => 'fm_entity_group',
-                                               'id' => array('name' => 'id', 
'type' => 'auto'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'name',
-                                                               'descr' => 
lang('name'),
-                                                               'type' => 
'varchar'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'descr',
-                                                               'descr' => 
lang('descr'),
-                                                               'type' => 
'varchar'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'active',
-                                                               'descr' => 
lang('active'),
-                                                               'type' => 
'checkbox',
-                                                               'default' => 
'checked'
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => lang('entity group'),
-                                               'acl_app' => 'property',
-                                               'acl_location' => 
'.admin.entity',
-                                               'menu_selection' => 
'admin::property::entity::entity_group',
-                                               'default' => array
-                                                       (
-                                                       'user_id' => 
array('add' => '$this->account'),
-                                                       'entry_date' => 
array('add' => 'time()'),
-                                                       'modified_date' => 
array('add' => 'time()', 'edit' => 'time()'),
-                                               ),
-                                               'check_grant' => false
-                                       );
-
-                                       break;
-
-// START BOOKING TABLES
-                               case 'bb_office':
-                                       $info = array
-                                               (
-                                               'table' => 'bb_office',
-                                               'id' => array('name' => 'id', 
'type' => 'auto'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'name',
-                                                               'descr' => 
lang('name'),
-                                                               'type' => 
'varchar'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'description',
-                                                               'descr' => 
lang('description'),
-                                                               'type' => 'text'
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => 
$GLOBALS['phpgw']->translation->translate('office', array(), false, 'booking'),
-                                               'acl_app' => 'booking',
-                                               'acl_location' => '.office',
-                                               'menu_selection' => 
'booking::settings::office',
-                                               'default' => array
-                                                       (
-                                                       'user_id' => 
array('add' => '$this->account'),
-                                                       'entry_date' => 
array('add' => 'time()'),
-                                                       'modified_date' => 
array('edit' => 'time()'),
-                                               ),
-                                               'check_grant' => false
-                                       );
-
-                                       break;
-                               case 'bb_office_user':
-                                       $info = array
-                                               (
-                                               'table' => 'bb_office_user',
-                                               'id' => array('name' => 'id', 
'type' => 'auto'),
-                                               'fields' => array(
-                                                       array(
-                                                               'name' => 
'office',
-                                                               'descr' => 
$GLOBALS['phpgw']->translation->translate('office', array(), false, 'booking'),
-                                                               'type' => 
'select',
-                                                               'filter' => 
true,
-                                                               'values_def' => 
array(
-                                                                       
'valueset' => false,
-                                                                       
'method' => 'property.bogeneric.get_list',
-                                                                       
'get_single_value' => 'property.sogeneric.get_name',
-                                                                       
'method_input' => array('type' => 'bb_office', 'selected' => '##office##')
-                                                               )
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => 
$GLOBALS['phpgw']->translation->translate('office user', array(), false, 
'booking'),
-                                               'acl_app' => 'booking',
-                                               'acl_location' => 
'.office.user',
-                                               'menu_selection' => 
'booking::settings::office::office_user',
-                                               'default' => array
-                                                       (
-                                                       'user_id' => 
array('add' => '$this->account'),
-                                                       'entry_date' => 
array('add' => 'time()'),
-                                                       'modified_date' => 
array('edit' => 'time()'),
-                                               ),
-                                               'check_grant' => false
-                                       );
-
-                                       break;
-
-// END BOOKING TABLES
-// START CONTROLLER TABLES
-                               case 'controller_check_item_status':
-                                       $info = array
-                                               (
-                                               'table' => 
'controller_check_item_status',
-                                               'id' => array('name' => 'id', 
'type' => 'auto'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'name',
-                                                               'descr' => 
lang('name'),
-                                                               'type' => 
'varchar'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'sorting',
-                                                               'descr' => 
lang('sorting'),
-                                                               'type' => 
'integer',
-                                                               'sortable' => 
true
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'open',
-                                                               'descr' => 
lang('open'),
-                                                               'type' => 
'checkbox'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'pending',
-                                                               'descr' => 
lang('pending'),
-                                                               'type' => 
'checkbox'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'closed',
-                                                               'descr' => 
lang('closed'),
-                                                               'type' => 
'checkbox'
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit'),
-                                               'add_msg' => lang('add'),
-                                               'name' => lang('status'),
-                                               'acl_app' => 'controller',
-                                               'acl_location' => 'admin',
-                                               'menu_selection' => 
'admin::controller::check_item_status'
-                                       );
-                                       break;
-
-// END CONTROLLER TABLES
-// START RENTAL TABLES
-                               case 'location_factor':
-                                       $info = array
-                                               (
-                                               'table' => 
'rental_location_factor',
-                                               'id' => array('name' => 'id', 
'type' => 'auto'),
-                                               'fields' => array(
-                                                       array(
-                                                               'name' => 
'part_of_town_id',
-                                                               'descr' => 
lang('location'),
-                                                               'type' => 
'select',
-                                                               'nullable' => 
false,
-                                                               'filter' => 
true,
-                                                               'values_def' => 
array(
-                                                                       
'valueset' => false,
-                                                                       
'get_single_value' => 'property.sogeneric.get_name',
-                                                                       
'method' => 'property.bogeneric.get_list',
-                                                                       
'method_input' => array('type' => 'part_of_town', 'selected' => 
'##part_of_town_id##')
-                                                               )
-                                                       ),
-                                                       array(
-                                                               'name' => 
'factor',
-                                                               'descr' => 
lang('factor'),
-                                                               'type' => 
'numeric',
-                                                               'nullable' => 
false,
-                                                               'size' => 4,
-                                                               'sortable' => 
true
-                                                       ),
-                                                       array(
-                                                               'name' => 
'remark',
-                                                               'descr' => 
lang('remark'),
-                                                               'type' => 'text'
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit unit'),
-                                               'add_msg' => lang('add unit'),
-                                               'name' => lang('unit'),
-                                               'acl_app' => 'rental',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::rental::location_factor',
-                                               'default' => array(
-                                                       'user_id' => 
array('add' => '$this->account'),
-                                                       'entry_date' => 
array('add' => 'time()'),
-                                                       'modified_date' => 
array('edit' => 'time()'),
-                                               )
-                                       );
-                                       break;
-                               case 'composite_standard':
-                                       $info = array
-                                               (
-                                               'table' => 
'rental_composite_standard',
-                                               'id' => array('name' => 'id', 
'type' => 'int'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'name',
-                                                               'descr' => 
lang('name'),
-                                                               'type' => 
'varchar'
-                                                       ),
-                                                       array
-                                                               (
-                                                               'name' => 
'factor',
-                                                               'descr' => 
lang('factor'),
-                                                               'type' => 
'numeric',
-                                                               'nullable' => 
false,
-                                                               'size' => 4,
-                                                               'sortable' => 
true
-                                                       )
-                                               ),
-                                               'edit_msg' => lang('edit unit'),
-                                               'add_msg' => lang('add unit'),
-                                               'name' => lang('unit'),
-                                               'acl_app' => 'rental',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::rental::composite_standard'
-                                       );
-                                       break;
-                               case 'responsibility_unit':
-                                       $info = array
-                                               (
-                                               'table' => 
'rental_contract_responsibility_unit',
-                                               'id' => array('name' => 'id', 
'type' => 'int'),
-                                               'fields' => array
-                                                       (
-                                                       array
-                                                               (
-                                                               'name' => 
'name',
-                                                               'descr' => 
lang('name'),
-                                                               'type' => 
'varchar'
-                                                       ),
-                                               ),
-                                               'edit_msg' => lang('edit unit'),
-                                               'add_msg' => lang('add unit'),
-                                               'name' => lang('unit'),
-                                               'acl_app' => 'rental',
-                                               'acl_location' => '.admin',
-                                               'menu_selection' => 
'admin::rental::responsibility_unit'
-                                       );
-                                       break;
-// END RENTAL TABLES
-
-                               default:
-                                       $message = lang('ERROR: illegal type 
%1', $type);
-                                       phpgwapi_cache::message_set($message, 
'error');
-//                             throw new Exception(lang('ERROR: illegal type 
%1', $type));
-                       }
-
-                       $this->location_info = $info;
-                       return $info;
-               }
-
-               public function get_name( $data )
-               {
-                       if (isset($data['type']) && $data['type'] && ! 
$this->location_info)
-                       {
-                               $this->get_location_info($data['type']);
-                       }
-                       $values = $this->read_single($data);
-                       return isset($values['name']) ? $values['name'] : 
$values['descr'];
-               }
-
-               function read_single( $data, $values = array() )
-               {
-                       if (!isset($this->location_info['table']) || !$table = 
$this->location_info['table'])
-                       {
-                               return $values;
-                       }
-
-                       if ($this->location_info['id']['type'] == 'auto' || 
$this->location_info['id']['type'] == 'int')
-                       {
-                               $id = (int)$data['id'];
-                       }
-                       else
-                       {
-                               $id = "'{$data['id']}'";
-                       }
-
-                       $sql = "SELECT * FROM $table WHERE 
{$this->location_info['id']['name']} = {$id}";
-
-                       $this->_db->query($sql, __LINE__, __FILE__);
-
-                       if ($this->_db->next_record())
-                       {
-                               $values['id'] = 
$this->_db->f($this->location_info['id']['name']);
-
-                               // FIXME - add field to $values['attributes']
-                               foreach ($this->location_info['fields'] as 
$field)
-                               {
-                                       $values[$field['name']] = 
$this->_db->f($field['name'], true);
-                               }
-
-                               if (isset($values['attributes']) && 
is_array($values['attributes']))
-                               {
-                                       foreach ($values['attributes'] as 
&$attr)
-                                       {
-                                               $attr['value'] = 
$this->_db->f($attr['column_name'], true);
-                                       }
-                               }
-                       }
-                       return $values;
-               }
-
-               //deprecated
-               function select_generic_list( $data )
-               {
-                       return $this->get_entity_list($data);
-               }
-
-               function get_list( $data )
-               {
-                       $values = array();
-
-                       $this->get_location_info($data['type'], 
$data['type_id']);
-
-                       if (!isset($this->location_info['table']) || !$table = 
$this->location_info['table'])
-                       {
-                               return $values;
-                       }
-
-                       $filtermthod = '';
-                       if (isset($data['filter']) && is_array($data['filter']))
-                       {
-                               $_filter = array();
-                               foreach ($data['filter'] as $_field => $_value)
-                               {
-                                       if ($data['filter_method'] == 'like')
-                                       {
-                                               $_filter[] = "{$_field} 
{$this->_db->like} '%{$_value}%'";
-                                       }
-                                       else
-                                       {
-                                               $_filter[] = "{$_field} = 
'{$_value}'";
-                                       }
-                               }
-                               if ($_filter)
-                               {
-                                       $filtermthod = 'WHERE ' . implode(' AND 
', $_filter);
-                               }
-                       }
-
-                       $order = isset($data['order']) && $data['order'] ? 
$data['order'] : '';
-
-                       if ($order)
-                       {
-                               $ordermethod = " ORDER BY {$table}.{$order} 
{$sort}";
-                       }
-                       else
-                       {
-                               $ordermethod = " ORDER BY 
{$table}.{$this->location_info['id']['name']} ASC";
-                       }
-
-                       foreach ($this->location_info['fields'] as $field)
-                       {
-                               $fields[] = $field['name'];
-                       }
-
-                       // Add extra info to name
-                       if (isset($data['id_in_name']) && $data['id_in_name'])
-                       {
-                               $id_in_name = 'id';
-                               if (in_array($data['id_in_name'], $fields))
-                               {
-                                       $id_in_name = $data['id_in_name'];
-                               }
-                       }
-
-                       $fields = implode(',', $fields);
-
-                       $this->_db->query("SELECT 
{$this->location_info['id']['name']} as id, {$fields} FROM {$table} 
{$filtermthod} {$ordermethod}");
-
-                       $return_fields = isset($data['fields']) && 
$data['fields'] && is_array($data['fields']) ? $data['fields'] : array();
-
-                       $i = 0;
-                       while ($this->_db->next_record())
-                       {
-                               $_extra = $this->_db->f($id_in_name);
-                               $id = $this->_db->f('id');
-                               if (!$name = $this->_db->f('name', true))
-                               {
-                                       $name = $this->_db->f('descr', true);
-                               }
-
-                               if ($_extra)
-                               {
-                                       $name = "{$_extra} - {$name}";
-                               }
-
-                               $values[$i] = array
-                                       (
-                                       'id' => $id,
-                                       'name' => $name
-                               );
-
-                               foreach ($return_fields as $return_field)
-                               {
-                                       $values[$i][$return_field] = 
$this->_db->f($return_field, true);
-                               }
-
-                               $i++;
-                       }
-                       return $values;
-               }
-
-               function add( $data, $values_attribute )
-               {
-                       $receipt = array();
-
-                       if (!isset($this->location_info['table']) || !$table = 
$this->location_info['table'])
-                       {
-                               $receipt['error'][] = array('msg' => lang('not 
a valid type'));
-                               return $receipt;
-                       }
-
-                       if (isset($data['save']))
-                       {
-                               unset($data['save']);
-                       }
-                       if (isset($data['apply']))
-                       {
-                               unset($data['apply']);
-                       }
-
-                       // in case of backslash characters - as in 
path-references
-                       foreach ($data as $_key => &$_value)
-                       {
-                               $_value = str_replace('\\', '/', $_value);
-                       }
-                       unset($_key);
-                       unset($_value);
-
-
-                       foreach ($this->location_info['fields'] as $field)
-                       {
-                               if (isset($field['filter']) && $field['filter'])
-                               {
-                                       if (isset($data[$field['name']]) && 
$data[$field['name']] && $field['type'] == 'multiple_select')
-                                       {
-                                               $data[$field['name']] = ',' . 
implode(',', $data[$field['name']]) . ',';
-                                       }
-                               }
-                       }
-
-                       $cols = array();
-                       $vals = array();
-
-                       $data['descr'] = 
$this->_db->db_addslashes($data['descr']);
-
-                       if (isset($data['extra']))
-                       {
-                               foreach ($data['extra'] as $input_name => 
$value)
-                               {
-                                       if (isset($value) && $value)
-                                       {
-                                               $cols[] = $input_name;
-                                               $vals[] = $value;
-                                       }
-                               }
-                       }
-                       unset($data['extra']);
-
-                       foreach ($data as $input_name => $value)
-                       {
-                               if (isset($value) && $value)
-                               {
-                                       $cols[] = $input_name;
-                                       $vals[] = 
$this->_db->db_addslashes($value);
-                               }
-                       }
-
-                       $data_attribute = $this->custom->prepare_for_db($table, 
$values_attribute);
-                       if (isset($data_attribute['value_set']))
-                       {
-                               foreach ($data_attribute['value_set'] as 
$input_name => $value)
-                               {
-                                       if (isset($value) && $value)
-                                       {
-                                               $cols[] = $input_name;
-                                               $vals[] = $value;
-                                       }
-                               }
-                       }
-
-
-                       if (isset($this->location_info['default']) && 
is_array($this->location_info['default']))
-                       {
-                               foreach ($this->location_info['default'] as 
$field => $default)
-                               {
-                                       if (isset($default['add']))
-                                       {
-                                               $cols[] = $field;
-                                               eval('$vals[] = ' . 
$default['add'] . ';');
-                                       }
-                               }
-                       }
-
-                       $this->_db->transaction_begin();
-
-                       if ($this->location_info['id']['type'] != 'auto')
-                       {
-                               $this->_db->query("SELECT 
{$this->location_info['id']['name']} AS id FROM {$table} WHERE 
{$this->location_info['id']['name']} = 
'{$data[$this->location_info['id']['name']]}'", __LINE__, __FILE__);
-                               if ($this->_db->next_record())
-                               {
-                                       $receipt['error'][] = array('msg' => 
lang('duplicate key value'));
-                                       $receipt['error'][] = array('msg' => 
lang('record has not been saved'));
-                                       return $receipt;
-                               }
-                               $id = $data[$this->location_info['id']['name']];
-                       }
-                       else
-                       {
-                               $id = $this->_db->next_id($table);
-                               $cols[] = 'id';
-                               $vals[] = $id;
-                       }
-
-                       $cols = implode(",", $cols);
-                       $vals = $this->_db->validate_insert($vals);
-
-                       $this->_db->query("INSERT INTO {$table} ({$cols}) 
VALUES ({$vals})", __LINE__, __FILE__);
-
-                       /*                      
if($this->location_info['id']['type']=='auto')
-                         {
-                         if(!$data['id'] = 
$this->_db->get_last_insert_id($table, 'id'))
-                         {
-                         $this->_db->transaction_abort();
-                         $receipt['error'][]=array('msg'=>lang('record has not 
been saved'));
-                         }
-                         }
-                        */
-                       $this->_db->transaction_commit();
-                       $receipt['id'] = $id;
-                       $receipt['message'][] = array('msg' => lang('record has 
been saved'));
-                       return $receipt;
-               }
-
-               function edit( $data, $values_attribute )
-               {
-
-                       $receipt = array();
-
-                       if (!isset($this->location_info['table']) || !$table = 
$this->location_info['table'])
-                       {
-                               $receipt['error'][] = array('msg' => lang('not 
a valid type'));
-                               return $receipt;
-                       }
-
-                       // in case of backslash characters - as in 
path-references
-                       foreach ($data as $_key => &$_value)
-                       {
-                               $_value = str_replace('\\', '/', $_value);
-                       }
-                       unset($_key);
-                       unset($_value);
-
-                       $value_set = array();
-
-                       if (isset($data['extra']))
-                       {
-                               foreach ($data['extra'] as $input_name => 
$value)
-                               {
-                                       $value_set[$input_name] = $value;
-                               }
-                               unset($data['extra']);
-                       }
-
-                       $data_attribute = $this->custom->prepare_for_db($table, 
$values_attribute, $data['id']);
-
-                       if (isset($data_attribute['value_set']))
-                       {
-                               $value_set = array_merge($value_set, 
$data_attribute['value_set']);
-                       }
-
-                       $has_to_move = array();
-
-                       foreach ($this->location_info['fields'] as $field)
-                       {
-                               if (isset($field['filter']) && $field['filter'])
-                               {
-                                       if (isset($data[$field['name']]) && 
$data[$field['name']] && $field['type'] == 'multiple_select')
-                                       {
-                                               $data[$field['name']] = ',' . 
implode(',', $data[$field['name']]) . ',';
-                                       }
-                               }
-                               $value_set[$field['name']] = 
$this->_db->db_addslashes($data[$field['name']]);
-
-                               // keep hierarchy in order
-                               if (isset($field['role']) && $field['role'] == 
'parent')
-                               {
-                                       //FIXME                         
-                                       $this->_db->query("SELECT parent_id 
FROM $table WHERE {$this->location_info['id']['name']}='{$data['id']}'", 
__LINE__, __FILE__);
-                                       $this->_db->next_record();
-                                       $orig_parent_id = 
$this->_db->f('parent_id');
-
-                                       if ($orig_parent_id && 
(int)$orig_parent_id != (int)$data['parent_id'])
-                                       {
-
-                                               $this->_db->query("SELECT 
{$this->location_info['id']['name']} as id FROM $table WHERE parent_id 
='{$data['id']}'", __LINE__, __FILE__);
-
-                                               while 
($this->_db->next_record())
-                                               {
-                                                       $has_to_move[] = 
$this->_db->f('id');
-                                               }
-                                       }
-                               }
-                       }
-
-                       if (isset($this->location_info['default']) && 
is_array($this->location_info['default']))
-                       {
-                               foreach ($this->location_info['default'] as 
$field => $default)
-                               {
-                                       if (isset($default['edit']))
-                                       {
-                                               eval('$value_set[$field] = ' . 
$default['edit'] . ';');
-                                       }
-                               }
-                       }
-
-                       $value_set = $this->_db->validate_update($value_set);
-                       $this->_db->transaction_begin();
-                       $this->_db->query("UPDATE $table SET {$value_set} WHERE 
{$this->location_info['id']['name']} = '{$data['id']}'", __LINE__, __FILE__);
-
-                       // keep hierarchy in order
-                       foreach ($has_to_move as $id)
-                       {
-                               $value_set = 
$this->_db->validate_update(array('parent_id' => $orig_parent_id));
-                               $this->_db->query("UPDATE $table SET 
{$value_set} WHERE {$this->location_info['id']['name']} = '{$id}'", __LINE__, 
__FILE__);
-                       }
-
-                       //FIXME
-                       if (isset($data_attribute['history_set']) && 
is_array($data_attribute['history_set']))
-                       {
-                               $historylog = 
CreateObject('property.historylog', $this->location_info['acl_app'], 
$this->location_info['acl_location']);
-                               foreach ($data_attribute['history_set'] as 
$attrib_id => $history)
-                               {
-                                       $historylog->add('SO', $data['id'], 
$history['value'], isset($history['old_value']) ? $history['old_value'] : null, 
$attrib_id, $history['date']);
-                               }
-                       }
-
-                       $this->_db->transaction_commit();
-
-                       $receipt['id'] = $data['id'];
-
-                       $receipt['message'][] = array('msg' => lang('record has 
been edited'));
-                       return $receipt;
-               }
-
-               function delete( $id )
-               {
-                       if (!isset($this->location_info['table']) || !$table = 
$this->location_info['table'])
-                       {
-                               return false;
-                       }
-
-                       $has_to_move = array();
-
-                       $this->_db->transaction_begin();
-
-                       foreach ($this->location_info['fields'] as $field)
-                       {
-                               // keep hierarchy in order
-                               if (isset($field['role']) && $field['role'] == 
'parent')
-                               {
-                                       $this->_db->query("SELECT parent_id 
FROM $table WHERE {$this->location_info['id']['name']}='{$id}'", __LINE__, 
__FILE__);
-                                       $this->_db->next_record();
-                                       $orig_parent_id = 
$this->_db->f('parent_id');
-
-                                       $this->_db->query("SELECT 
{$this->location_info['id']['name']} as id FROM $table WHERE parent_id 
='{$id}'", __LINE__, __FILE__);
-
-                                       while ($this->_db->next_record())
-                                       {
-                                               $has_to_move[] = 
$this->_db->f('id');
-                                       }
-                               }
-                       }
-
-                       $this->_db->query("DELETE FROM $table WHERE 
{$this->location_info['id']['name']}='{$id}'", __LINE__, __FILE__);
-
-                       // keep hierarchy in order
-                       foreach ($has_to_move as $id)
-                       {
-                               $value_set = 
$this->_db->validate_update(array('parent_id' => $orig_parent_id));
-                               $this->_db->query("UPDATE $table SET 
{$value_set} WHERE {$this->location_info['id']['name']} = '{$id}'", __LINE__, 
__FILE__);
-                       }
-
-                       $this->_db->transaction_commit();
-               }
-
-               public function get_tree2( $data )
-               {
-                       $values = array();
-
-                       $this->get_location_info($data['type'], 
$data['type_id']);
-
-                       if (!isset($this->location_info['table']) || !$table = 
$this->location_info['table'])
-                       {
-                               return $values;
-                       }
-                       $this->table = $table;
-
-                       $filtermthod = 'WHERE (parent_id = 0 OR parent_id IS 
NULL)';
-
-                       if (isset($data['filter']) && is_array($data['filter']))
-                       {
-                               $_filter = array();
-                               foreach ($data['filter'] as $_field => $_value)
-                               {
-                                       $_filter[] = "{$_field} = '{$_value}'";
-                               }
-                               if ($_filter)
-                               {
-                                       $filtermthod .= implode(' AND ', 
$_filter);
-                               }
-                       }
-
-                       $order = isset($data['order']) && $data['order'] ? 
$data['order'] : '';
-
-                       if ($order)
-                       {
-                               $ordermethod = " ORDER BY {$table}.{$order} 
{$sort}";
-                       }
-                       else
-                       {
-                               $ordermethod = " ORDER BY 
{$table}.{$this->location_info['id']['name']} ASC";
-                       }
-
-                       foreach ($this->location_info['fields'] as $field)
-                       {
-                               $fields[] = $field['name'];
-                       }
-
-                       // Add extra info to name
-                       if (isset($data['id_in_name']) && $data['id_in_name'])
-                       {
-                               $id_in_name = 'id';
-                               if (in_array($data['id_in_name'], $fields))
-                               {
-                                       $id_in_name = $data['id_in_name'];
-                               }
-                       }
-
-                       $fields = implode(',', $fields);
-
-                       $this->_db->query("SELECT id, {$fields} FROM {$table} 
{$filtermthod} {$ordermethod}", __LINE__, __FILE__);
-
-                       $return_fields = isset($data['fields']) && 
$data['fields'] && is_array($data['fields']) ? $data['fields'] : array();
-//-----------
-                       $mapping = array();
-                       if (isset($data['mapping']) && $data['mapping'])
-                       {
-                               $mapping = $data['mapping'];
-                       }
-                       else
-                       {
-                               $mapping = array('name' => 'name');
-                       }
-
-                       $values = array();
-                       $i = 0;
-                       while ($this->_db->next_record())
-                       {
-                               $_extra = $this->_db->f($id_in_name);
-                               $id = $this->_db->f('id');
-                               $name = $this->_db->f($mapping['name'], true);
-
-                               if ($_extra)
-                               {
-                                       $name = "{$_extra} - {$name}";
-                               }
-
-                               $values[$i] = array
-                                       (
-                                       'id' => $id,
-                                       'name' => $name,
-                                       'parent_id' => 0
-                               );
-
-                               foreach ($return_fields as $return_field)
-                               {
-                                       $values[$i][$return_field] = 
$this->_db->f($return_field, true);
-                               }
-
-                               $i++;
-                       }
-
-
-                       $this->tree = array();
-
-                       foreach ($values as $value)
-                       {
-                               $this->tree[] = $value;
-                               $this->get_children2($data, $value['id'], 1);
-                       }
-                       return $this->tree;
-               }
-
-               public function get_children2( $data, $parent, $level, $reset = 
false )
-               {
-                       $parent = (int)$parent;
-                       $mapping = array();
-                       if (isset($data['mapping']) && $data['mapping'])
-                       {
-                               $mapping = $data['mapping'];
-                       }
-                       else
-                       {
-                               $mapping = array('name' => 'name');
-                       }
-
-                       if ($reset)
-                       {
-                               $this->tree = array();
-                       }
-                       $db = clone($this->_db);
-                       if (!$table = $this->table)
-                       {
-                               return $this->tree;
-                       }
-                       $sql = "SELECT * FROM {$table} WHERE parent_id = 
{$parent}";
-
-                       $db->query($sql, __LINE__, __FILE__);
-
-                       while ($db->next_record())
-                       {
-                               $id = $db->f('id');
-                               $this->tree[] = array
-                                       (
-                                       'id' => $id,
-                                       'name' => str_repeat('..', $level) . 
$db->f($mapping['name'], true),
-                                       'parent_id' => $parent
-                               );
-                               $this->get_children2($data, $id, $level + 1);
-                       }
-                       return $this->tree;
-               }
-
-               /**
-                * used for retrive a child-node from a hierarchy
-                *
-                * @param integer $entity_id Entity id
-                * @param integer $parent is the parent of the children we want 
to see
-                * @param integer $level is increased when we go deeper into 
the tree,
-                * @return array $child Children
-                */
-               protected function get_children( $data, $parent, $level )
-               {
-                       $children = array();
-
-                       $this->get_location_info($data['type'], 
$data['type_id']);
-
-                       if (!isset($this->location_info['table']) || !$table = 
$this->location_info['table'])
-                       {
-                               return $children;
-                       }
-                       $this->table = $table;
-
-                       $filtermthod = 'WHERE parent_id = ' . (int)$parent;
-
-                       $sql = "SELECT * FROM {$table} {$filtermthod}";
-                       $this->_db2->query($sql, __LINE__, __FILE__);
-
-                       $fields = array(0 => 'id');
-                       foreach ($this->location_info['fields'] as $field)
-                       {
-                               $fields[] = $field['name'];
-                       }
-
-                       while ($this->_db2->next_record())
-                       {
-                               $id = $this->_db2->f('id');
-                               foreach ($fields as $field)
-                               {
-                                       $children[$id][$field] = 
$this->_db2->f($field, true);
-                               }
-                       }
-
-                       foreach ($children as &$child)
-                       {
-                               $_children = $this->get_children($data, 
$child['id'], $level + 1);
-                               if ($_children)
-                               {
-                                       $child['children'] = $_children;
-                               }
-                       }
-                       return $children;
-               }
-
-               /**
-                * Get tree from your node
-                * @param array $data - 'node_id' as parent and 'type'
-                * @return array tree
-                */
-               public function read_tree( $data )
-               {
-                       $parent_id = isset($data['node_id']) && 
$data['node_id'] ? (int)$data['node_id'] : 0;
-                       $tree = array();
-
-                       $this->get_location_info($data['type'], 
$data['type_id']);
-
-                       if (!isset($this->location_info['table']) || !$table = 
$this->location_info['table'])
-                       {
-                               return $tree;
-                       }
-                       $this->table = $table;
-
-                       if ($parent_id)
-                       {
-                               $filtermthod = "WHERE parent_id = {$parent_id}";
-                       }
-                       else
-                       {
-                               $filtermthod = 'WHERE (parent_id = 0 OR 
parent_id IS NULL)';
-                       }
-
-                       if (isset($data['filter']) && is_array($data['filter']))
-                       {
-                               $_filter = array();
-                               foreach ($data['filter'] as $_field => $_value)
-                               {
-                                       $_filter[] = "{$_field} = '{$_value}'";
-                               }
-                               if ($_filter)
-                               {
-                                       $filtermthod .= ' AND ' . implode(' AND 
', $_filter);
-                               }
-                       }
-
-                       $sql = "SELECT * FROM {$table} {$filtermthod}";
-
-                       $this->_db2->query($sql, __LINE__, __FILE__);
-                       $this->total_records = $this->_db2->num_rows();
-
-                       $fields = array(0 => 'id');
-                       foreach ($this->location_info['fields'] as $field)
-                       {
-                               $fields[] = $field['name'];
-                       }
-                       $node = array();
-                       $i = 0;
-                       while ($this->_db2->next_record())
-                       {
-                               $id = $this->_db2->f('id');
-
-                               foreach ($fields as $field)
-                               {
-                                       $tree[$i][$field] = 
$this->_db2->f($field, true);
-                               }
-                               $i++;
-                       }
-
-                       foreach ($tree as &$node)
-                       {
-                               $children = $this->get_children($data, 
$node['id'], 0);
-                               if ($children)
-                               {
-                                       $node['children'] = $children;
-                               }
-                       }
-                       return $tree;
-               }
-
-               /**
-                * used for retrive the path for a particular node from a 
hierarchy
-                *
-                * @param integer $node is the id of the node we want the path 
of
-                * @return array $path Path
-                */
-               public function get_path( $data )
-               {
-
-                       $this->get_location_info($data['type'], 
$data['type_id']);
-
-                       if (!isset($this->location_info['table']) || !$table = 
$this->location_info['table'])
-                       {
-                               return array();
-                       }
-                       $this->table = $table;
-
-                       if (isset($this->location_info['mapping']) && 
$this->location_info['mapping'])
-                       {
-                               $mapping = $this->location_info['mapping'];
-                       }
-                       else
-                       {
-                               $mapping = array('name' => 'name');
-                       }
-
-                       $sql = "SELECT {$mapping['name']}, parent_id FROM 
{$table} WHERE id = '{$data['id']}'";
-
-                       $this->_db->query($sql, __LINE__, __FILE__);
-                       $this->_db->next_record();
-
-                       $parent_id = $this->_db->f('parent_id');
-
-                       $name = $this->_db->f('name', true);
-
-                       $path = array($name);
-
-                       if ($parent_id)
-                       {
-                               $path = 
array_merge($this->get_path(array('type' => $data['type'], 'id' => 
$parent_id)), $path);
-                       }
-                       return $path;
-               }
-
-               public function edit_field( $data = array() )
-               {
-                       if (!isset($this->location_info['table']) || !$table = 
$this->location_info['table'])
-                       {
-                               return false;
-                       }
-
-                       $value_set = 
$this->_db->validate_update(array($data['field_name'] => $data['value']));
-                       return $this->_db->query("UPDATE $table SET 
{$value_set} WHERE {$this->location_info['id']['name']} = '{$data['id']}'", 
__LINE__, __FILE__);
-               }
-       }
\ No newline at end of file

Copied: branches/dev-syncromind-2/property/inc/class.sogeneric.inc.php (from 
rev 15732, trunk/property/inc/class.sogeneric.inc.php)
===================================================================
--- branches/dev-syncromind-2/property/inc/class.sogeneric.inc.php              
                (rev 0)
+++ branches/dev-syncromind-2/property/inc/class.sogeneric.inc.php      
2016-09-25 20:14:08 UTC (rev 15733)
@@ -0,0 +1,2648 @@
+<?php
+       /**
+        * phpGroupWare - property: a Facilities Management System.
+        *
+        * @author Sigurd Nes <address@hidden>
+        * @copyright Copyright (C) 2003,2004,2005,2006,2007,2008,2009 Free 
Software Foundation, Inc. http://www.fsf.org/
+        * This file is part of phpGroupWare.
+        *
+        * phpGroupWare is free software; you can redistribute it and/or modify
+        * it under the terms of the GNU General Public License as published by
+        * the Free Software Foundation; either version 2 of the License, or
+        * (at your option) any later version.
+        *
+        * phpGroupWare is distributed in the hope that it will be useful,
+        * but WITHOUT ANY WARRANTY; without even the implied warranty of
+        * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+        * GNU General Public License for more details.
+        *
+        * You should have received a copy of the GNU General Public License
+        * along with phpGroupWare; if not, write to the Free Software
+        * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  
02110-1301  USA
+        *
+        * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
+        * @package property
+        * @subpackage admin
+        * @version $Id: class.sogeneric.inc.php 15493 2016-08-19 11:45:55Z 
sigurdne $
+        */
+
+       phpgw::import_class('property.sogeneric_');
+
+       /**
+        * Description
+        * @package property
+        */
+       class property_sogeneric extends property_sogeneric_
+       {
+
+               var $appname = 'property';
+
+               function __construct( $type = '', $type_id = 0 )
+               {
+                       parent::__construct($type, $type_id);
+               }
+
+
+               public function get_location_info( $type, $type_id )
+               {
+                       $type_id = (int)$type_id;
+                       $this->type = $type;
+                       $this->type_id = $type_id;
+                       $info = array();
+
+                       if (!$type)
+                       {
+                               return $info;
+                       }
+
+                       switch ($type)
+                       {
+                               //-------- ID type integer
+                               case 'part_of_town':
+                                       $info = array
+                                               (
+                                               'table' => 'fm_part_of_town',
+                                               'id' => array('name' => 'id', 
'type' => 'int', 'descr' => lang('id')),
+                                               'fields' => array
+                                                       (
+                                                       array
+                                                               (
+                                                               'name' => 
'name',
+                                                               'descr' => 
lang('name'),
+                                                               'type' => 
'varchar',
+                                                               'nullable' => 
false,
+                                                               'size' => 20
+                                                       ),
+                                                       array
+                                                               (
+                                                               'name' => 
'district_id',
+                                                               'descr' => 
lang('district'),
+                                                               'type' => 
'select',
+                                                               'nullable' => 
false,
+                                                               'filter' => 
true,
+                                                               'values_def' => 
array
+                                                                       (
+                                                                       
'valueset' => false,
+                                                                       
'method' => 'property.bogeneric.get_list',
+                                                                       
'get_single_value' => 'property.sogeneric.get_name',
+                                                                       
'method_input' => array('type' => 'district', 'selected' => '##district_id##')
+                                                               )
+                                                       ),
+                                               ),
+                                               'edit_msg' => lang('edit'),
+                                               'add_msg' => lang('add'),
+                                               'name' => lang('part of town'),
+                                               'acl_app' => 'property',
+                                               'acl_location' => '.admin',
+                                               'menu_selection' => 
'admin::property::location::town',
+                                               /*
+                                                 'default'                     
=> array
+                                                 (
+                                                 'user_id'             => 
array('add'  => '$this->account'),
+                                                 'entry_date'  => array('add'  
=> 'time()'),
+                                                 'modified_date'       => 
array('edit' => 'time()'),
+                                                 ),
+                                                */
+                                               'check_grant' => false
+                                       );
+
+                                       break;
+
+                               case 'dimb':
+                                       $info = array
+                                               (
+                                               'table' => 'fm_ecodimb',
+                                               'id' => array('name' => 'id', 
'type' => 'int'),
+                                               'fields' => array
+                                                       (
+                                                       array
+                                                               (
+                                                               'name' => 
'descr',
+                                                               'descr' => 
lang('descr'),
+                                                               'type' => 
'varchar'
+                                                       ),
+                                                       array
+                                                               (
+                                                               'name' => 
'org_unit_id',
+                                                               'descr' => 
lang('department'),
+                                                               'type' => 
'select',
+                                                               'nullable' => 
false,
+                                                               'filter' => 
true,
+                                                               'sortable' => 
true,
+                                                               'values_def' => 
array
+                                                                       (
+                                                                       
'valueset' => false,
+                                                                       
'method' => 'property.bogeneric.get_list',
+                                                                       
'get_single_value' => 'property.sogeneric.get_name',
+                                                                       
'method_input' => array('type' => 'org_unit', 'selected' => '##org_unit_id##')
+                                                               )
+                                                       )
+                                               ),
+                                               'custom_criteria' => array
+                                                       (
+                                                       'dimb_role_user' => 
array
+                                                               (
+                                                               'join' => 
array("{$this->_db->join} fm_ecodimb_role_user ON fm_ecodimb.id = 
fm_ecodimb_role_user.ecodimb"),
+                                                               'filter' => 
array('fm_ecodimb_role_user.user_id = ' . (int)$this->account)
+                                                       )
+                                               ),
+                                               'edit_msg' => lang('edit'),
+                                               'add_msg' => lang('add'),
+                                               'name' => lang('dimb'),
+                                               'acl_app' => 'property',
+                                               'acl_location' => '.admin',
+                                               'menu_selection' => 
'admin::property::accounting::accounting_dimb'
+                                       );
+                                       break;
+                               case 'dimd':
+                                       $info = array
+                                               (
+                                               'table' => 'fm_ecodimd',
+                                               'id' => array('name' => 'id', 
'type' => 'int'),
+                                               'fields' => array
+                                                       (
+                                                       array
+                                                               (
+                                                               'name' => 
'descr',
+                                                               'descr' => 
lang('descr'),
+                                                               'type' => 
'varchar'
+                                                       )
+                                               ),
+                                               'edit_msg' => lang('edit'),
+                                               'add_msg' => lang('add'),
+                                               'name' => lang('dimd'),
+                                               'acl_app' => 'property',
+                                               'acl_location' => '.admin',
+                                               'menu_selection' => 
'admin::property::accounting::accounting_dimd'
+                                       );
+                                       break;
+                               case 'periodization':
+                                       $info = array
+                                               (
+                                               'table' => 
'fm_eco_periodization',
+                                               'id' => array('name' => 'id', 
'type' => 'int'),
+                                               'fields' => array
+                                                       (
+                                                       array
+                                                               (
+                                                               'name' => 
'descr',
+                                                               'descr' => 
lang('descr'),
+                                                               'type' => 
'varchar'
+                                                       ),
+                                                       array
+                                                               (
+                                                               'name' => 
'active',
+                                                               'descr' => 
lang('active'),
+                                                               'type' => 
'checkbox',
+                                                               'default' => 
'checked'
+                                                       )
+                                               ),
+                                               'edit_msg' => lang('edit'),
+                                               'add_msg' => lang('add'),
+                                               'name' => lang('periodization'),
+                                               'acl_app' => 'property',
+                                               'acl_location' => '.admin',
+                                               'menu_selection' => 
'admin::property::accounting::periodization'
+                                       );
+                                       break;
+                               case 'tax':
+                                       $info = array
+                                               (
+                                               'table' => 'fm_ecomva',
+                                               'id' => array('name' => 'id', 
'type' => 'int'),
+                                               'fields' => array
+                                                       (
+                                                       array
+                                                               (
+                                                               'name' => 
'percent',
+                                                               'descr' => 
lang('percent'),
+                                                               'type' => 'int'
+                                                       ),
+                                                       array
+                                                               (
+                                                               'name' => 
'descr',
+                                                               'descr' => 
lang('descr'),
+                                                               'type' => 
'varchar'
+                                                       )
+                                               ),
+                                               'edit_msg' => lang('edit'),
+                                               'add_msg' => lang('add'),
+                                               'name' => lang('tax code'),
+                                               'acl_app' => 'property',
+                                               'acl_location' => '.admin',
+                                               'menu_selection' => 
'admin::property::accounting::accounting_tax'
+                                       );
+                                       break;
+                               case 'voucher_cat':
+                                       $info = array
+                                               (
+                                               'table' => 
'fm_ecobilag_category',
+                                               'id' => array('name' => 'id', 
'type' => 'int'),
+                                               'fields' => array
+                                                       (
+                                                       array
+                                                               (
+                                                               'name' => 
'descr',
+                                                               'descr' => 
lang('descr'),
+                                                               'type' => 
'varchar'
+                                                       )
+                                               ),
+                                               'edit_msg' => lang('edit'),
+                                               'add_msg' => lang('add'),
+                                               'name' => '',
+                                               'acl_app' => 'property',
+                                               'acl_location' => '.admin',
+                                               'menu_selection' => 
'admin::property::accounting::voucher_cats'
+                                       );
+                                       break;
+                               case 'voucher_type':
+                                       $info = array
+                                               (
+                                               'table' => 'fm_ecoart',
+                                               'id' => array('name' => 'id', 
'type' => 'int'),
+                                               'fields' => array
+                                                       (
+                                                       array
+                                                               (
+                                                               'name' => 
'descr',
+                                                               'descr' => 
lang('descr'),
+                                                               'type' => 
'varchar'
+                                                       )
+                                               ),
+                                               'edit_msg' => lang('edit'),
+                                               'add_msg' => lang('add'),
+                                               'name' => '',
+                                               'acl_app' => 'property',
+                                               'acl_location' => '.admin',
+                                               'menu_selection' => 
'admin::property::accounting::voucher_type'
+                                       );
+                                       break;
+                               case 'tender_chapter':
+                                       $info = array
+                                               (
+                                               'table' => 'fm_chapter',
+                                               'id' => array('name' => 'id', 
'type' => 'int'),
+                                               'fields' => array
+                                                       (
+                                                       array
+                                                               (
+                                                               'name' => 
'descr',
+                                                               'descr' => 
lang('descr'),
+                                                               'type' => 
'varchar'
+                                                       )
+                                               ),
+                                               'edit_msg' => lang('edit'),
+                                               'add_msg' => lang('add'),
+                                               'name' => '',
+                                               'acl_app' => 'property',
+                                               'acl_location' => '.admin',
+                                               'menu_selection' => 
'admin::property::tender'
+                                       );
+                                       break;
+                               case 'location':
+
+                                       $this->_db->query("SELECT id FROM 
fm_location_type WHERE id ={$type_id}", __LINE__, __FILE__);
+
+                                       if ($this->_db->next_record())
+                                       {
+                                               $info = array
+                                                       (
+                                                       'table' => 
"fm_location{$type_id}_category",
+                                                       'id' => array('name' => 
'id', 'type' => 'varchar'),
+                                                       'fields' => array
+                                                               (
+                                                               array
+                                                                       (
+                                                                       'name' 
=> 'descr',
+                                                                       'descr' 
=> lang('descr'),
+                                                                       'type' 
=> 'varchar'
+                                                               )
+                                                       ),
+                                                       'edit_msg' => 
lang('edit'),
+                                                       'add_msg' => 
lang('add'),
+                                                       'name' => '',
+                                                       'acl_app' => 'property',
+                                                       'acl_location' => 
'.admin',
+                                                       'menu_selection' => 
"admin::property::location::location::category_{$type_id}"
+                                               );
+                                       }
+                                       else
+                                       {
+                                               throw new 
Exception(lang('ERROR: illegal type %1', $type_id));
+                                       }
+                                       break;
+                               case 'owner_cats':
+                                       $info = array
+                                               (
+                                               'table' => 'fm_owner_category',
+                                               'id' => array('name' => 'id', 
'type' => 'int'),
+                                               'fields' => array
+                                                       (
+                                                       array
+                                                               (
+                                                               'name' => 
'descr',
+                                                               'descr' => 
lang('descr'),
+                                                               'type' => 
'varchar'
+                                                       )
+                                               ),
+                                               'edit_msg' => lang('edit'),
+                                               'add_msg' => lang('add'),
+                                               'name' => '',
+                                               'acl_app' => 'property',
+                                               'acl_location' => '.admin',
+                                               'menu_selection' => 
'admin::property::owner::owner_cats'
+                                       );
+                                       break;
+                               case 'tenant_cats':
+                                       $info = array
+                                               (
+                                               'table' => 'fm_tenant_category',
+                                               'id' => array('name' => 'id', 
'type' => 'int'),
+                                               'fields' => array
+                                                       (
+                                                       array
+                                                               (
+                                                               'name' => 
'descr',
+                                                               'descr' => 
lang('descr'),
+                                                               'type' => 
'varchar'
+                                                       )
+                                               ),
+                                               'edit_msg' => lang('edit'),
+                                               'add_msg' => lang('add'),
+                                               'name' => lang('tenant 
category'),
+                                               'acl_app' => 'property',
+                                               'acl_location' => '.admin',
+                                               'menu_selection' => 
'admin::property::tenant::tenant_cats'
+                                       );
+                                       break;
+                               case 'vendor_cats':
+                                       $info = array
+                                               (
+                                               'table' => 'fm_vendor_category',
+                                               'id' => array('name' => 'id', 
'type' => 'int'),
+                                               'fields' => array
+                                                       (
+                                                       array
+                                                               (
+                                                               'name' => 
'descr',
+                                                               'descr' => 
lang('descr'),
+                                                               'type' => 
'varchar'
+                                                       )
+                                               ),
+                                               'edit_msg' => lang('edit'),
+                                               'add_msg' => lang('add'),
+                                               'name' => lang('vendor 
category'),
+                                               'acl_app' => 'property',
+                                               'acl_location' => '.admin',
+                                               'menu_selection' => 
'admin::property::vendor::vendor_cats'
+                                       );
+                                       break;
+                               case 'vendor':
+                                       $info = array
+                                               (
+                                               'table' => 'fm_vendor',
+                                               'id' => array('name' => 'id', 
'type' => 'int'),
+                                               'fields' => array
+                                                       (
+                                                       array
+                                                               (
+                                                               'name' => 
'contact_phone',
+                                                               'descr' => 
lang('contact phone'),
+                                                               'type' => 
'varchar'
+                                                       ),
+                                                       array
+                                                               (
+                                                               'name' => 
'category',
+                                                               'descr' => 
lang('category'),
+                                                               'type' => 
'select',
+                                                               'nullable' => 
false,
+                                                               'filter' => 
true,
+                                                               'sortable' => 
true,
+                                                               'values_def' => 
array
+                                                                       (
+                                                                       
'valueset' => false,
+                                                                       
'method' => 'property.bogeneric.get_list',
+                                                                       
'get_single_value' => 'property.sogeneric.get_name',
+                                                                       
'method_input' => array('type' => 'vendor_cats', 'selected' => '##category##')
+                                                               )
+                                                       ),
+                                                       array
+                                                               (
+                                                               //FIXME
+                                                               'name' => 
'member_of',
+                                                               'descr' => 
lang('member'),
+                                                               'type' => 
'multiple_select',
+                                                               'nullable' => 
true,
+                                                               'filter' => 
true,
+                                                               'sortable' => 
false,
+                                                               'hidden' => 
false,
+                                                               'values_def' => 
array
+                                                                       (
+                                                                       
'valueset' => false,
+                                                                       
'method' => 'property.bocommon.get_categories',
+                                                                       
'method_input' => array('app' => 'property', 'acl_location' => '.vendor',
+                                                                               
'selected' => '##member_of##')
+                                                               )
+                                                       ),
+                                               ),
+                                               'edit_msg' => lang('edit'),
+                                               'add_msg' => lang('add'),
+                                               'name' => lang('vendor'),
+                                               'acl_app' => 'property',
+                                               'acl_location' => '.vendor',
+                                               'menu_selection' => 
'property::economy::vendor',
+                                               'default' => array
+                                                       (
+                                                       'owner_id' => 
array('add' => '$this->account'),
+                                                       'entry_date' => 
array('add' => 'time()'),
+                                               //                      
'modified_date' => array('edit' => 'time()'),
+                                               )
+                                       );
+                                       break;
+                               case 'owner':
+                                       $info = array
+                                               (
+                                               'table' => 'fm_owner',
+                                               'id' => array('name' => 'id', 
'type' => 'int'),
+                                               'fields' => array
+                                                       (
+                                                       array
+                                                               (
+                                                               'name' => 
'remark',
+                                                               'descr' => 
lang('remark'),
+                                                               'type' => 'text'
+                                                       ),
+                                                       array
+                                                               (
+                                                               'name' => 
'category',
+                                                               'descr' => 
lang('category'),
+                                                               'type' => 
'select',
+                                                               'nullable' => 
false,
+                                                               'filter' => 
true,
+                                                               'sortable' => 
true,
+                                                               'values_def' => 
array
+                                                                       (
+                                                                       
'valueset' => false,
+                                                                       
'method' => 'property.bogeneric.get_list',
+                                                                       
'get_single_value' => 'property.sogeneric.get_name',
+                                                                       
'method_input' => array('type' => 'owner_cats', 'selected' => '##category##')
+                                                               )
+                                                       ),
+                                               ),
+                                               'edit_msg' => lang('edit'),
+                                               'add_msg' => lang('add'),
+                                               'name' => lang('owner'),
+                                               'acl_app' => 'property',
+                                               'acl_location' => '.owner',
+                                               'menu_selection' => 
'admin::property::owner',
+                                               'default' => array
+                                                       (
+                                                       'owner_id' => 
array('add' => '$this->account'),
+                                                       'entry_date' => 
array('add' => 'time()'),
+                                               //                      
'modified_date' => array('edit' => 'time()'),
+                                               )
+                                       );
+                                       break;
+                               case 'tenant':
+                                       $info = array
+                                               (
+                                               'table' => 'fm_tenant',
+                                               'id' => array('name' => 'id', 
'type' => 'int'),
+                                               'fields' => array
+                                                       (
+                                                       array
+                                                               (
+                                                               'name' => 
'contact_email',
+                                                               'descr' => 
lang('contact_email'),
+                                                               'type' => 
'varchar',
+                                                               'sortable' => 
true,
+                                                       ),
+                                                       array
+                                                               (
+                                                               'name' => 
'category',
+                                                               'descr' => 
lang('category'),
+                                                               'type' => 
'select',
+                                                               'nullable' => 
false,
+                                                               'filter' => 
true,
+                                                               'sortable' => 
true,
+                                                               'values_def' => 
array
+                                                                       (
+                                                                       
'valueset' => false,
+                                                                       
'method' => 'property.bogeneric.get_list',
+                                                                       
'get_single_value' => 'property.sogeneric.get_name',
+                                                                       
'method_input' => array('type' => 'tenant_cats', 'selected' => '##category##')
+                                                               )
+                                                       )
+                                               ),
+                                               'edit_msg' => lang('edit'),
+                                               'add_msg' => lang('add'),
+                                               'name' => lang('tenant'),
+                                               'acl_app' => 'property',
+                                               'acl_location' => '.tenant',
+                                               'menu_selection' => 
'admin::property::tenant',
+                                               'default' => array
+                                                       (
+                                                       'owner_id' => 
array('add' => '$this->account'),
+                                                       'entry_date' => 
array('add' => 'time()'),
+                                               //                      
'modified_date' => array('edit' => 'time()'),
+                                               )
+                                       );
+                                       break;
+                               case 'district':
+                                       $info = array
+                                               (
+                                               'table' => 'fm_district',
+                                               'id' => array('name' => 'id', 
'type' => 'int'),
+                                               'fields' => array
+                                                       (
+                                                       array
+                                                               (
+                                                               'name' => 
'descr',
+                                                               'descr' => 
lang('descr'),
+                                                               'type' => 
'varchar'
+                                                       )
+                                               ),
+                                               'edit_msg' => lang('edit'),
+                                               'add_msg' => lang('add'),
+                                               'name' => lang('district'),
+                                               'acl_app' => 'property',
+                                               'acl_location' => '.admin',
+                                               'menu_selection' => 
'admin::property::location::district'
+                                       );
+                                       break;
+                               case 'street':
+                                       $info = array
+                                               (
+                                               'table' => 'fm_streetaddress',
+                                               'id' => array('name' => 'id', 
'type' => 'int'),
+                                               'fields' => array
+                                                       (
+                                                       array
+                                                               (
+                                                               'name' => 
'descr',
+                                                               'descr' => 
lang('descr'),
+                                                               'type' => 
'varchar'
+                                                       )
+                                               ),
+                                               'edit_msg' => lang('edit'),
+                                               'add_msg' => lang('add'),
+                                               'name' => lang('streetaddress'),
+                                               'acl_app' => 'property',
+                                               'acl_location' => '.admin',
+                                               'menu_selection' => 
'admin::property::location::street'
+                                       );
+                                       break;
+                               case 's_agreement':
+                                       $info = array
+                                               (
+                                               'table' => 
'fm_s_agreement_category',
+                                               'id' => array('name' => 'id', 
'type' => 'int'),
+                                               'fields' => array
+                                                       (
+                                                       array
+                                                               (
+                                                               'name' => 
'descr',
+                                                               'descr' => 
lang('descr'),
+                                                               'type' => 
'varchar'
+                                                       )
+                                               ),
+                                               'edit_msg' => lang('edit'),
+                                               'add_msg' => lang('add'),
+                                               'name' => '',
+                                               'acl_app' => 'property',
+                                               'acl_location' => '.admin',
+                                               'menu_selection' => 
'admin::property::agreement::service_agree_cats'
+                                       );
+                                       break;
+                               case 'tenant_claim':
+                                       $info = array
+                                               (
+                                               'table' => 
'fm_tenant_claim_category',
+                                               'id' => array('name' => 'id', 
'type' => 'int'),
+                                               'fields' => array
+                                                       (
+                                                       array
+                                                               (
+                                                               'name' => 
'descr',
+                                                               'descr' => 
lang('descr'),
+                                                               'type' => 
'varchar'
+                                                       )
+                                               ),
+                                               'edit_msg' => lang('edit'),
+                                               'add_msg' => lang('add'),
+                                               'name' => '',
+                                               'acl_app' => 'property',
+                                               'acl_location' => '.admin',
+                                               'menu_selection' => 
'admin::property::tenant::claims_cats'
+                                       );
+                                       break;
+                               case 'wo_hours':
+                                       $info = array
+                                               (
+                                               'table' => 
'fm_wo_hours_category',
+                                               'id' => array('name' => 'id', 
'type' => 'int'),
+                                               'fields' => array
+                                                       (
+                                                       array
+                                                               (
+                                                               'name' => 
'descr',
+                                                               'descr' => 
lang('descr'),
+                                                               'type' => 
'varchar'
+                                                       )
+                                               ),
+                                               'edit_msg' => lang('edit'),
+                                               'add_msg' => lang('add'),
+                                               'name' => '',
+                                               'acl_app' => 'property',
+                                               'acl_location' => '.admin',
+                                               'menu_selection' => 
'admin::property::workorder_detail'
+                                       );
+                                       break;
+                               case 'r_condition_type':
+                                       $info = array
+                                               (
+                                               'table' => 
'fm_request_condition_type',
+                                               'id' => array('name' => 'id', 
'type' => 'int'),
+                                               'fields' => array
+                                                       (
+                                                       array
+                                                               (
+                                                               'name' => 
'name',
+                                                               'descr' => 
lang('name'),
+                                                               'type' => 
'varchar'
+                                                       ),
+                                                       array
+                                                               (
+                                                               'name' => 
'descr',
+                                                               'descr' => 
lang('descr'),
+                                                               'type' => 
'varchar'
+                                                       )
+                                               ),
+                                               'edit_msg' => lang('edit'),
+                                               'add_msg' => lang('add'),
+                                               'name' => 'condition type',
+                                               'acl_app' => 'property',
+                                               'acl_location' => '.admin',
+                                               'menu_selection' => 
'admin::property::request_condition'
+                                       );
+                                       break;
+                               case 'authorities_demands':
+                                       $info = array
+                                               (
+                                               'table' => 
'fm_authorities_demands',
+                                               'id' => array('name' => 'id', 
'type' => 'int'),
+                                               'fields' => array
+                                                       (
+                                                       array
+                                                               (
+                                                               'name' => 
'name',
+                                                               'descr' => 
lang('name'),
+                                                               'type' => 
'varchar'
+                                                       )
+                                               ),
+                                               'edit_msg' => lang('edit'),
+                                               'add_msg' => lang('add'),
+                                               'name' => lang('authorities 
demands'),
+                                               'acl_app' => 'property',
+                                               'acl_location' => '.admin',
+                                               'menu_selection' => 
'admin::property::authorities_demands',
+                                               'default' => array
+                                                       (
+                                                       'user_id' => 
array('add' => '$this->account'),
+                                                       'entry_date' => 
array('add' => 'time()'),
+                                                       'modified_date' => 
array('edit' => 'time()'),
+                                               ),
+                                               'check_grant' => false
+                                       );
+                                       break;
+                               case 'b_account':
+                               case 'b_account_category':
+                                       $info = array
+                                               (
+                                               'table' => 
'fm_b_account_category',
+                                               'id' => array('name' => 'id', 
'type' => 'int'),
+                                               'fields' => array
+                                                       (
+                                                       array
+                                                               (
+                                                               'name' => 
'descr',
+                                                               'descr' => 
lang('descr'),
+                                                               'type' => 
'varchar'
+                                                       ),
+                                                       array(
+                                                               'name' => 
'active',
+                                                               'descr' => 
lang('active'),
+                                                               'type' => 
'checkbox',
+                                                               'default' => 
'checked',
+                                                               'filter' => 
true,
+                                                               'sortable' => 
true,
+                                                               'values_def' => 
array
+                                                                       (
+                                                                       
'valueset' => array(array('id' => 1, 'name' => lang('active'))),
+                                                               )
+                                                       ),
+                                                       array
+                                                               (
+                                                               'name' => 
'external_project',
+                                                               'descr' => 
lang('mandatory project group'),
+                                                               'type' => 
'checkbox'
+                                                       )
+                                               ),
+                                               'edit_msg' => lang('edit'),
+                                               'add_msg' => lang('add'),
+                                               'name' => lang('budget account 
group'),
+                                               'acl_app' => 'property',
+                                               'acl_location' => '.admin',
+                                               'menu_selection' => 
'admin::property::accounting::accounting_cats'
+                                       );
+                                       break;
+
+                               case 'dimb_role':
+                                       $info = array
+                                               (
+                                               'table' => 'fm_ecodimb_role',
+                                               'id' => array('name' => 'id', 
'type' => 'int'),
+                                               'fields' => array
+                                                       (
+                                                       array
+                                                               (
+                                                               'name' => 
'name',
+                                                               'descr' => 
lang('name'),
+                                                               'type' => 
'varchar'
+                                                       )
+                                               ),
+                                               'edit_msg' => lang('edit role'),
+                                               'add_msg' => lang('add role'),
+                                               'name' => lang('dimb role'),
+                                               'acl_app' => 'property',
+                                               'acl_location' => '.admin',
+                                               'menu_selection' => 
'admin::property::accounting::dimb_role'
+                                       );
+                                       break;
+                               case 'condition_survey_status':
+                                       $info = array
+                                               (
+                                               'table' => 
'fm_condition_survey_status',
+                                               'id' => array('name' => 'id', 
'type' => 'int'),
+                                               'fields' => array
+                                                       (
+                                                       array
+                                                               (
+                                                               'name' => 
'descr',
+                                                               'descr' => 
lang('descr'),
+                                                               'type' => 
'varchar'
+                                                       ),
+                                                       array
+                                                               (
+                                                               'name' => 
'sorting',
+                                                               'descr' => 
lang('sorting'),
+                                                               'type' => 
'integer',
+                                                               'sortable' => 
true
+                                                       ),
+                                                       array
+                                                               (
+                                                               'name' => 
'in_progress',
+                                                               'descr' => 
lang('In progress'),
+                                                               'type' => 
'checkbox'
+                                                       ),
+                                                       array
+                                                               (
+                                                               'name' => 
'delivered',
+                                                               'descr' => 
lang('delivered'),
+                                                               'type' => 
'checkbox'
+                                                       ),
+                                                       array
+                                                               (
+                                                               'name' => 
'closed',
+                                                               'descr' => 
lang('closed'),
+                                                               'type' => 
'checkbox'
+                                                       )
+                                               ),
+                                               'edit_msg' => lang('edit 
status'),
+                                               'add_msg' => lang('add status'),
+                                               'name' => lang('request 
status'),
+                                               'acl_app' => 'property',
+                                               'acl_location' => '.admin',
+                                               'menu_selection' => 
'admin::property::condition_survey_status'
+                                       );
+                                       break;
+
+                               case 'request_responsible_unit':
+                                       $_lang_responsible_unit = 
lang('responsible unit');
+                                       $info = array
+                                               (
+                                               'table' => 
'fm_request_responsible_unit',
+                                               'id' => array('name' => 'id', 
'type' => 'int'),
+                                               'fields' => array
+                                                       (
+                                                       array
+                                                               (
+                                                               'name' => 
'name',
+                                                               'descr' => 
lang('name'),
+                                                               'type' => 
'varchar'
+                                                       ),
+                                                       array
+                                                               (
+                                                               'name' => 
'descr',
+                                                               'descr' => 
lang('descr'),
+                                                               'type' => 
'varchar'
+                                                       )
+                                               ),
+                                               'edit_msg' => lang('edit') . ' 
' . $_lang_responsible_unit,
+                                               'add_msg' => lang('add') . ' ' 
. $_lang_responsible_unit,
+                                               'name' => 
$_lang_responsible_unit,
+                                               'acl_app' => 'property',
+                                               'acl_location' => '.admin',
+                                               'menu_selection' => 
'admin::property::request_responsible_unit'
+                                       );
+                                       break;
+
+                               case 'ticket_priority':
+                                       $_lang_priority = lang('priority');
+                                       $info = array
+                                               (
+                                               'table' => 'fm_tts_priority',
+                                               'id' => array('name' => 'id', 
'type' => 'int'),
+                                               'fields' => array
+                                                       (
+                                                       array
+                                                               (
+                                                               'name' => 
'name',
+                                                               'descr' => 
lang('name'),
+                                                               'type' => 
'varchar'
+                                                       ),
+                                               ),
+                                               'edit_msg' => lang('edit') . ' 
' . $_lang_priority,
+                                               'add_msg' => lang('add') . ' ' 
. $_lang_priority,
+                                               'name' => $_lang_priority,
+                                               'acl_app' => 'property',
+                                               'acl_location' => '.admin',
+                                               'menu_selection' => 
'admin::property::ticket::ticket_priority'
+                                       );
+                                       break;
+
+                               //-------- ID type varchar
+                               case 'external_project':
+                                       $info = array
+                                               (
+                                               'table' => 
'fm_external_project',
+                                               'id' => array('name' => 'id', 
'type' => 'varchar'),
+                                               'fields' => array(
+                                                       array(
+                                                               'name' => 
'name',
+                                                               'descr' => 
lang('name'),
+                                                               'type' => 
'varchar'
+                                                       ),
+                                                       array(
+                                                               'name' => 
'budget',
+                                                               'descr' => 
lang('budget'),
+                                                               'type' => 'int'
+                                                       ),
+                                                       array(
+                                                               'name' => 
'active',
+                                                               'descr' => 
lang('active'),
+                                                               'type' => 
'checkbox',
+                                                               'default' => 
'checked',
+                                                               'filter' => 
true,
+                                                               'sortable' => 
true,
+                                                               'values_def' => 
array
+                                                                       (
+                                                                       
'valueset' => array(array('id' => 1, 'name' => lang('active'))),
+                                                               )
+                                                       )
+                                               ),
+                                               'edit_msg' => lang('edit'),
+                                               'add_msg' => lang('add'),
+                                               'name' => lang('external 
project'),
+                                               'acl_app' => 'property',
+                                               'acl_location' => '.admin',
+                                               'menu_selection' => 
'admin::property::external_project'
+                                       );
+                                       break;
+                               case 'unspsc_code':
+                                       $info = array
+                                               (
+                                               'table' => 'fm_unspsc_code',
+                                               'id' => array('name' => 'id', 
'type' => 'varchar'),
+                                               'fields' => array(
+                                                       array
+                                                               (
+                                                               'name' => 
'name',
+                                                               'descr' => 
lang('name'),
+                                                               'type' => 
'varchar'
+                                                       )
+                                               ),
+                                               'edit_msg' => lang('edit'),
+                                               'add_msg' => lang('add'),
+                                               'name' => lang('unspsc code'),
+                                               'acl_app' => 'property',
+                                               'acl_location' => '.admin',
+                                               'menu_selection' => 
'admin::property::unspsc_code'
+                                       );
+                                       break;
+                               case 'project_status':
+                                       $info = array
+                                               (
+                                               'table' => 'fm_project_status',
+                                               'id' => array('name' => 'id', 
'type' => 'varchar'),
+                                               'fields' => array
+                                                       (
+                                                       array
+                                                               (
+                                                               'name' => 
'descr',
+                                                               'descr' => 
lang('descr'),
+                                                               'type' => 
'varchar'
+                                                       ),
+                                                       array
+                                                               (
+                                                               'name' => 
'approved',
+                                                               'descr' => 
lang('approved'),
+                                                               'type' => 
'checkbox'
+                                                       ),
+                                                       array
+                                                               (
+                                                               'name' => 
'closed',
+                                                               'descr' => 
lang('closed'),
+                                                               'type' => 
'checkbox'
+                                                       )
+                                               ),
+                                               'edit_msg' => lang('edit 
status'),
+                                               'add_msg' => lang('add status'),
+                                               'name' => lang('project 
status'),
+                                               'acl_app' => 'property',
+                                               'acl_location' => '.admin',

@@ Diff output truncated at 153600 characters. @@



reply via email to

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