phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] [18488] sync to resights [752]


From: Sigurd Nes
Subject: [Phpgroupware-cvs] [18488] sync to resights [752]
Date: Mon, 18 Feb 2008 10:22:49 +0000

Revision: 18488
          
http://svn.sv.gnu.org/viewvc/?view=rev&root=phpgroupware&revision=18488
Author:   sigurdne
Date:     2008-02-18 10:22:48 +0000 (Mon, 18 Feb 2008)

Log Message:
-----------
sync to resights [752]

Modified Paths:
--------------
    trunk/property/inc/class.menu.inc.php
    trunk/property/inc/class.pdf.inc.php
    trunk/property/inc/hook_preferences.inc.php
    trunk/property/inc/hook_settings.inc.php
    trunk/property/login.php
    trunk/property/setup/setup.inc.php

Removed Paths:
-------------
    trunk/property/inc/class.boadmin_custom.inc.php
    trunk/property/inc/class.soadmin_custom.inc.php
    trunk/property/inc/class.uiadmin_custom.inc.php
    trunk/property/templates/base/admin_custom.xsl

Deleted: trunk/property/inc/class.boadmin_custom.inc.php
===================================================================
--- trunk/property/inc/class.boadmin_custom.inc.php     2008-02-15 22:43:36 UTC 
(rev 18487)
+++ trunk/property/inc/class.boadmin_custom.inc.php     2008-02-18 10:22:48 UTC 
(rev 18488)
@@ -1,242 +0,0 @@
-<?php
-       /**
-       * phpGroupWare - property: a Facilities Management System.
-       *
-       * @author Sigurd Nes <address@hidden>
-       * @copyright Copyright (C) 2003,2004,2005,2006,2007 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_boadmin_custom
-       {
-               var $start;
-               var $query;
-               var $filter;
-               var $sort;
-               var $order;
-               var $cat_id;
-
-               var $public_functions = array
-               (
-                       'read'                          => True,
-                       'read_single'           => True,
-                       'save'                          => True,
-                       'delete'                        => True,
-                       'check_perms'           => True
-               );
-
-               var $soap_functions = array(
-                       'list' => array(
-                               'in'  => 
array('int','int','struct','string','int'),
-                               'out' => array('array')
-                       ),
-                       'read' => array(
-                               'in'  => array('int','struct'),
-                               'out' => array('array')
-                       ),
-                       'save' => array(
-                               'in'  => array('int','struct'),
-                               'out' => array()
-                       ),
-                       'delete' => array(
-                               'in'  => array('int','struct'),
-                               'out' => array()
-                       )
-               );
-
-               function property_boadmin_custom($session=False)
-               {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
-                       $this->so               = 
CreateObject('property.soadmin_custom');
-                       $this->bocommon = CreateObject('property.bocommon');
-
-                       if ($session)
-                       {
-                               $this->read_sessiondata();
-                               $this->use_session = True;
-                       }
-
-                       $start  = phpgw::get_var('start', 'int', 'REQUEST', 0);
-                       $query  = phpgw::get_var('query');
-                       $sort   = phpgw::get_var('sort');
-                       $order  = phpgw::get_var('order');
-                       $filter = phpgw::get_var('filter', 'int');
-                       $cat_id = phpgw::get_var('cat_id', 'int');
-                       $allrows        = phpgw::get_var('allrows', 'bool');
-
-                       if ($start)
-                       {
-                               $this->start=$start;
-                       }
-                       else
-                       {
-                               $this->start=0;
-                       }
-
-                       if(isset($query))
-                       {
-                               $this->query = $query;
-                       }
-                       if(!empty($filter))
-                       {
-                               $this->filter = $filter;
-                       }
-                       if(isset($sort))
-                       {
-                               $this->sort = $sort;
-                       }
-                       if(isset($order))
-                       {
-                               $this->order = $order;
-                       }
-                       if(isset($cat_id))
-                       {
-                               $this->cat_id = $cat_id;
-                       }
-                       if(isset($allrows))
-                       {
-                               $this->allrows = $allrows;
-                       }
-               }
-
-
-               function save_sessiondata($data)
-               {
-                       if ($this->use_session)
-                       {
-                               
$GLOBALS['phpgw']->session->appsession('session_data','standard_e',$data);
-                       }
-               }
-
-               function read_sessiondata()
-               {
-                       $data = 
$GLOBALS['phpgw']->session->appsession('session_data','standard_e');
-
-
-                       $this->start    = $data['start'];
-                       $this->query    = $data['query'];
-                       $this->filter   = $data['filter'];
-                       $this->sort     = $data['sort'];
-                       $this->order    = $data['order'];
-                       $this->cat_id   = $data['cat_id'];
-                       $this->allrows  = $data['allrows'];
-               }
-
-
-               function read($allrows='')
-               {
-                       if($allrows)
-                       {
-                               $this->allrows = $allrows;
-                       }
-
-                       $custom_function = $this->so->read(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
-                                                                               
        'acl_location' => $this->cat_id,'allrows'=>$this->allrows));
-
-                       $this->total_records = $this->so->total_records;
-
-                       return $custom_function;
-               }
-
-               function resort_custom_function($id,$resort)
-               {
-                       
$this->so->resort_custom_function(array('resort'=>$resort,'acl_location' => 
$this->cat_id,'id'=>$id));
-               }
-
-               function save_custom_function($custom_function,$action='')
-               {
-                       if ($action=='edit')
-                       {
-                               if ($custom_function['id'] != '')
-                               {
-
-                                       $receipt = 
$this->so->edit_custom_function($custom_function);
-                               }
-                       }
-                       else
-                       {
-                               $receipt = 
$this->so->add_custom_function($custom_function);
-                       }
-                       return $receipt;
-               }
-
-               function select_custom_function($selected='')
-               {
-
-                       $dir_handle = @opendir(PHPGW_APP_INC . SEP . 'custom');
-                       $i=0; $myfilearray = '';
-                       while ($file = readdir($dir_handle))
-                       {
-                               if ((substr($file, 0, 1) != '.') && 
is_file(PHPGW_APP_INC . SEP . 'custom' . SEP . $file) )
-                               {
-                                       $myfilearray[$i] = $file;
-                                       $i++;
-                               }
-                       }
-                       closedir($dir_handle);
-                       sort($myfilearray);
-
-                       for ($i=0;$i<count($myfilearray);$i++)
-                       {
-                               $fname = ereg_replace('_',' ',$myfilearray[$i]);
-                               $sel_file = '';
-                               if ($myfilearray[$i]==$selected)
-                               {
-                                       $sel_file = 'selected';
-                               }
-
-                               $file_list[] = array
-                               (
-                                       'id'            => $myfilearray[$i],
-                                       'name'          => $fname,
-                                       'selected'      => $sel_file
-                               );
-                       }
-
-                       for ($i=0;$i<count($file_list);$i++)
-                       {
-                               if ($file_list[$i]['selected'] != 'selected')
-                               {
-                                       unset($conv_list[$i]['selected']);
-                               }
-                       }
-
-                       return $file_list;
-               }
-
-               function read_single_custom_function($id)
-               {
-                       return 
$this->so->read_single_custom_function($id,$this->cat_id);
-               }
-
-               function delete($id)
-               {
-                       $this->so->delete_custom_function($id,$this->cat_id);
-               }
-       }
-?>

Modified: trunk/property/inc/class.menu.inc.php
===================================================================
--- trunk/property/inc/class.menu.inc.php       2008-02-15 22:43:36 UTC (rev 
18487)
+++ trunk/property/inc/class.menu.inc.php       2008-02-18 10:22:48 UTC (rev 
18488)
@@ -1,636 +1,806 @@
 <?php
        /**
-       * phpGroupWare - property: a Facilities Management System.
-       *
-       * @author Sigurd Nes <address@hidden>
-       * @copyright Copyright (C) 2003,2004,2005,2006,2007 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 core
-       * @version $Id$
-       */
+        * property - Menus
+        *
+        * @author Dave Hall <address@hidden>
+        * @author Sigurd Nes <address@hidden>
+        * @copyright Copyright (C) 2007 Free Software Foundation, Inc. 
http://www.fsf.org/
+        * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+        * @package property
+        * @version $Id$
+        */
 
+       /*
+          This program 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 3 of the License, or
+          (at your option) any later version.
+
+          This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.
+        */
+
+
        /**
-        * Description
+        * Menus
+        *
         * @package property
         */
-
        class property_menu
        {
-               var $sub;
-               var $query;
+               /**
+                * Get the menus for the property
+                *
+                * @return array available menus for the current user
+                */
+               public function get_menu()
+               {
+                       $incoming_app = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       $GLOBALS['phpgw_info']['flags']['currentapp'] = 
'property';
+                       $acl = CreateObject('phpgwapi.acl');
+                       $menus = array();
 
-               var $public_functions = array
-               (
-                       'links' => True,
-               );
+                       $entity                 = 
CreateObject('property.soadmin_entity');
+                       $entity_list    = $entity->read(array('allrows' => 
true));
 
-               function property_menu($sub='')
-               {
-                       $this->sub              = $sub;
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
-                       $this->query    = phpgw::get_var('query');
-               }
-
-               function links($page='',$page_2='')
-               {
-                       $currentapp=$this->currentapp;
-                       $sub = $this->sub;
-                       if(!$this->query)
+                       $start_page = 'location';
+                       if ( 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['default_start_page'])
+                                       && 
$GLOBALS['phpgw_info']['user']['preferences']['property']['default_start_page'] 
)
                        {
-                               $menu = 
$GLOBALS['phpgw']->session->appsession('menu',substr(md5($currentapp.$sub . '_' 
. $page . '_' . $page_2),-20));
+                                       $start_page = 
$GLOBALS['phpgw_info']['user']['preferences']['property']['default_start_page'];
                        }
-//_debug_array($page);
-                       if(!isset($menu) || !$menu)
-                       {
-                               $menu = array();  // set to '' as appsession 
dos'nt return empty array correctly 
-                               $this->acl                      = 
CreateObject('phpgwapi.acl');
 
-                               $i=0;
-                               if ($this->acl->check('.location',1))
-                               {
-                                       if($sub=='location')
-                                       {
-                                               
$menu['module'][$i]['this']=True;
-                                       }
-                                       $menu['module'][$i]['url']              
= $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uilocation.index', 'type_id'=>1));
-                                       $menu['module'][$i]['text']             
= lang('Location');
-                                       $menu['module'][$i]['statustext']       
= lang('Location');
-                                       $i++;
-                               }
+                       $menus['navbar'] = array
+                       (
+                               'property' => array
+                               (
+                                       'text'  => lang('property'),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
"property.ui{$start_page}.index") ),
+                                       'image' => array('property', 'navbar'),
+                                       'order' => 35,
+                                       'group' => 'facilities management'
+                               ),
+                       );
 
-                               if ($this->acl->check('.ifc',1))
-                               {
-                                       if($sub=='ifc')
-                                       {
-                                               
$menu['module'][$i]['this']=True;
-                                       }
-                                       $menu['module'][$i]['url']              
        =       $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uiifc.import'));
-                                       $menu['module'][$i]['text']             
        =       lang('IFC');
-                                       $menu['module'][$i]['statustext']       
=       lang('IFC');
-                                       $i++;
-                               }
+                       $menus['toolbar'] = array();
 
-                               if ($this->acl->check('.ticket',1))
-                               {
-                                       if($sub=='ticket')
-                                       {
-                                               
$menu['module'][$i]['this']=True;
-                                       }
-                                       $menu['module'][$i]['url']              
        =       $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uitts.index'));
-                                       $menu['module'][$i]['text']             
        =       lang('Helpdesk');
-                                       $menu['module'][$i]['statustext']       
=       lang('Helpdesk');
-                                       $i++;
-                               }
+                       $soadmin_location       = 
CreateObject('property.soadmin_location');
+                       $locations      = 
$soadmin_location->select_location_type();
 
-                               if ($this->acl->check('.project',1))
+                       if ( 
isset($GLOBALS['phpgw_info']['user']['apps']['admin']) )
+                       {
+                               if ( is_array($entity_list) && 
count($entity_list) )
                                {
-                                       if($sub=='project')
+                                       foreach($entity_list as $entry)
                                        {
-                                               
$menu['module'][$i]['this']=True;
-                                       }
-                                       $menu['module'][$i]['url']              
        =       $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uiproject.index'));
-                                       $menu['module'][$i]['text']             
        =       lang('Project');
-                                       $menu['module'][$i]['statustext']       
=       lang('Project');
-                                       $i++;
-                               }
+                                               
$admin_children_entity["entity_{$entry['id']}"] = array
+                                               (
+                                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_entity.category', 'entity_id'=> $entry['id'])),
+                                                       'text'  => 
$entry['name']
+                                               );
+                       
+                                               $cat_list = 
$entity->read_category(array('allrows'=>True,'entity_id'=>$entry['id']));
 
-                               if ($this->acl->check('.invoice',1))
-                               {
-                                       if($sub=='invoice')
-                                       {
-                                               
$menu['module'][$i]['this']=True;
-                                       }
-                                       $menu['module'][$i]['url']              
        =       $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uiinvoice.index'));
-                                       $menu['module'][$i]['text']             
        =       lang('Invoice');
-                                       $menu['module'][$i]['statustext']       
=       lang('Invoice');
-                                       $i++;
-                               }
-
-                               if ($this->acl->check('.budget',1))
-                               {
-                                       if($sub=='budget')
-                                       {
-                                               
$menu['module'][$i]['this']=True;
-                                       }
-                                       $menu['module'][$i]['url']              
        =       $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uibudget.index'));
-                                       $menu['module'][$i]['text']             
        =       lang('Budget');
-                                       $menu['module'][$i]['statustext']       
=       lang('Budget');
-                                       $i++;
-                               }
-//--------------------
-                               if ($this->acl->check('.agreement',1))
-                               {
-                                       if($sub=='agreement')
-                                       {
-                                               
$menu['module'][$i]['this']=True;
-                                       }
-                                       $menu['module'][$i]['url']              
        =       $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uiagreement.index'));
-                                       $menu['module'][$i]['text']             
        =       lang('Agreement');
-                                       $menu['module'][$i]['statustext']       
=       lang('Agreement');
-                                       $i++;
-                               }
-//----------------------
-
-                               if ($this->acl->check('.document',1))
-                               {
-                                       if($sub=='document')
-                                       {
-                                               
$menu['module'][$i]['this']=True;
-                                       }
-                                       $menu['module'][$i]['url']              
        =       $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uidocument.index'));
-                                       $menu['module'][$i]['text']             
        =       lang('Documentation');
-                                       $menu['module'][$i]['statustext']       
=       lang('Documentation');
-                                       $i++;
-                               }
-
-                               if ($this->acl->check('.custom',1))
-                               {
-                                       if($sub=='custom')
-                                       {
-                                               
$menu['module'][$i]['this']=True;
-                                       }
-                                       $menu['module'][$i]['url']              
        =       $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uicustom.index'));
-                                       $menu['module'][$i]['text']             
        =       lang('Custom');
-                                       $menu['module'][$i]['statustext']       
=       lang('Custom queries');
-                               }
-       
-                               $entity                 = 
CreateObject('property.soadmin_entity');
-                               $entity_list    = 
$entity->read(array('allrows'=>True));
-
-                               if (isset($entity_list) AND 
is_array($entity_list))
-                               {
-                                       foreach($entity_list as $entry)
-                                       {
-                                               if 
($this->acl->check('.entity.' . $entry['id'],1))
+                                               foreach($cat_list as $category)
                                                {
-                                                       $i++;
-                                                       if($sub=='entity_' . 
$entry['id'])
-                                                       {
-                                                               
$menu['module'][$i]['this']=True;
-                                                       }
-                                                       
$menu['module'][$i]['url']                      =       
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uientity.index', 'entity_id'=> $entry['id']));
-                                                       
$menu['module'][$i]['text']                     =       $entry['name'];
-                                                       
$menu['module'][$i]['statustext']       =       $entry['descr'];
+                                                       
$admin_children_entity["entity_{$entry['id']}"]['children']["entity_{$entry['id']}_{$category['id']}"]
  = array
+                                                       (
+                                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_entity.list_attribute', 'entity_id'=> $entry['id'] , 
'cat_id'=> $category['id'])),
+                                                               'text'  => 
$category['name']
+                                                       );
                                                }
                                        }
                                }
 
-                               unset($entity);
+                               $admin_children_tenant = array
+                               (
+                                       'tenant_cats'   => array
+                                       (
+                                               'text'  => lang('Tenant 
Categories'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uicategory.index', 'type' => 'tenant', 'menu_selection' => 
'admin::property::tenant::tenant_cats') )
+                                       ),
+                                       'tenant_global_cats'    => array
+                                       (
+                                               'text'  => lang('Tenant Global 
Categories'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.uicategories.index', 'appname' => 'fm_tenant', 'global_cats' => 'True', 
'menu_selection' => 'admin::property::tenant::tenant_global_cats') )
+                                       ),
+                                       'tenant_attribs'        => array
+                                       (
+                                               'text'  => lang('Tenant 
Attributes'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.ui_custom.list_attribute', 'appname' => 'property', 'location' 
=>'.tenant', 'menu_selection' => 'admin::property::tenant::tenant_attribs') )
+                                       ),
+                                       'claims_cats'   => array
+                                       (
+                                               'text'  => lang('Tenant Claim 
Categories'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uicategory.index', 'type' => 'tenant_claim', 'menu_selection' => 
'admin::property::tenant::claims_cats') )
+                                       )
+                               );
 
-                               $i = 0;
-                               if ($this->acl->check('.location',1))
-                               {
-                                       if ($sub == 'location')
-                                       {
-                                               
$menu['menu_title_2']=lang('Location');
+                               $admin_children_vendor = array
+                               (
+                                       'vendor_cats'   => array
+                                       (
+                                               'text'  => lang('Vendor 
Categories'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uicategory.index', 'type' => 'vendor', 'menu_selection' => 
'admin::property::vendor::vendor_cats') )
+                                       ),
+                                       'vendor_global_cats'    => array
+                                       (
+                                               'text'  => lang('Vendor Global 
Categories'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.uicategories.index', 'appname' => 'fm_vendor', 'global_cats' => 'True', 
'menu_selection' => 'admin::property::vendor::vendor_global_cats') )
+                                       ),
+                                       'vendor_attribs'        => array
+                                       (
+                                               'text'  => lang('Vendor 
Attributes'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.ui_custom.list_attribute', 'appname' => 'property', 'location' => 
'.vendor', 'menu_selection' => 'admin::property::vendor::vendor_attribs') )
+                                       )               
+                               );
+                               $admin_children_owner = array
+                               (
+                                       'owner_cats'    => array
+                                       (
+                                               'text'  => lang('Owner 
Categories'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uicategory.index', 'type' => 'owner', 'menu_selection' => 
'admin::property::owner::owner_cats') )
+                                       ),
+                                       'owner_attribs' => array
+                                       (
+                                               'text'  => lang('Owner 
Attributes'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.ui_custom.list_attribute', 'appname' => 'property', 'location' 
=>'.owner', 'menu_selection' => 'admin::property::owner::owner_attribs') )
+                                       )
+                               );
 
-                                               $soadmin_location       = 
CreateObject('property.soadmin_location');
-                                               $location       = 
$soadmin_location->select_location_type();
-                                               $query_temp = 
explode('-',$this->query);
-                                               $query_location = '';
-                                               
-                                               
$location_count=count($location);
-                                               for ($j=0; $j<$location_count; 
$j++)
-                                               {
-                                                       
if(isset($query_temp[$j]) && $query_temp[$j])
-                                                       {
-                                                               $query[] = 
$query_temp[$j];
-                                                               $query_location 
= implode('-',$query);
-                                                       }
-                                                       
if($page=='location'.$location[$j]['id'].'_')
-                                                       {
-                                                               
$menu['sub_menu'][$i]['this']=True;
-                                                       }
-                                                       
$menu['sub_menu'][$i]['url'] = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uilocation.index', 'type_id'=> 
$location[$j]['id'],'query'=>$query_location));
-                                                       
$menu['sub_menu'][$i]['text'] = $location[$j]['name'];
-                                                       
$menu['sub_menu'][$i]['statustext'] = $location[$j]['descr'];
-                                                       $i++;
-                                               }
+                               $admin_children_accounting = array
+                               (
+                                       'accounting_cats'       => array
+                                       (
+                                               'text'  => lang('Accounting 
Categories'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uicategory.index', 'type' => 'b_account', 'menu_selection' => 
'admin::property::accounting::accounting_cats') )
+                                       ),
+                                       'accounting_dim_b'      => array
+                                       (
+                                               'text'  => lang('Accounting dim 
b'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uicategory.index', 'type' => 'dim_b', 'menu_selection' => 
'admin::property::accounting::accounting_dim_b') )
+                                       ),
+                                       'accounting_dim_d'      => array
+                                       (
+                                               'text'  => lang('Accounting dim 
d'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uicategory.index', 'type' => 'dim_d', 'menu_selection' => 
'admin::property::accounting::accounting_dim_d') )
+                                       ),
+                                       'accounting_tax'        => array
+                                       (
+                                               'text'  => lang('Accounting 
tax'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uicategory.index', 'type' => 'tax', 'menu_selection' => 
'admin::property::accounting::accounting_tax') )
+                                       ),
+                                       'voucher_cats'  => array
+                                       (
+                                               'text'  => lang('Accounting 
voucher category'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uicategory.index', 'type' => 'voucher_cat', 'menu_selection' => 
'admin::property::accounting::voucher_cats') )
+                                       ),
+                                       'voucher_type'  => array
+                                       (
+                                               'text'  => lang('Accounting 
voucher type'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uicategory.index', 'type' => 'voucher_type', 'menu_selection' => 
'admin::property::accounting::voucher_type') )
+                                       )
+                               );
 
-                                               $config_tenant = 
$soadmin_location->read_config_single('tenant_id');
+                               $admin_children_agreement = array
+                               (
+                                       'agreement_status'      => array
+                                       (
+                                               'text'  => lang('Agreement 
status'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uistandard_2.index', 'type' => 'agreement_status', 'menu_selection' 
=> 'admin::property::agreement::agreement_status') )
+                                       ),
+                                       'agreement_attribs'     => array
+                                       (
+                                               'text'  => lang('Agreement 
Attributes'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.ui_custom.list_attribute', 'appname' => 'property', 'location' 
=>'.agreement', 'menu_selection' => 
'admin::property::agreement::agreement_attribs') )
+                                       ),
+                                       'service_agree_cats'    => array
+                                       (
+                                               'text'  => lang('service 
agreement categories'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uicategory.index', 'type' => 's_agreement', 'menu_selection' => 
'admin::property::agreement::service_agree_cats') )
+                                       ),
+                                       'service_agree_attribs' => array
+                                       (
+                                               'text'  => lang('service 
agreement Attributes'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.ui_custom.list_attribute', 'appname' => 'property', 'location' 
=>'.s_agreement', 'menu_selection' => 
'admin::property::agreement::service_agree_attribs') )
+                                       ),
+                                       'service_agree_item_attribs'    => array
+                                       (
+                                               'text'  => lang('service 
agreement item Attributes'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.ui_custom.list_attribute', 'appname' => 'property', 'location' 
=>'.s_agreement.detail', 'menu_selection' => 
'admin::property::agreement::service_agree_item_attribs') )
+                                       ),
+                                       'rental_agree_cats'     => array
+                                       (
+                                               'text'  => lang('rental 
agreement categories'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uicategory.index', 'type' => 'r_agreement', 'menu_selection' => 
'admin::property::agreement::rental_agree_cats') )
+                                       ),
+                                       'rental_agree_attribs'  => array
+                                       (
+                                               'text'  => lang('rental 
agreement Attributes'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.ui_custom.list_attribute', 'appname' => 'property', 'location' 
=>'.r_agreement', 'menu_selection' => 
'admin::property::agreement::rental_agree_attribs') )
+                                       ),
+                                       'rental_agree_item_attribs'     => array
+                                       (
+                                               'text'  => lang('rental 
agreement item Attributes'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.ui_custom.list_attribute', 'appname' => 'property', 'location' 
=>'.r_agreement.detail', 'menu_selection' => 
'admin::property::agreement::rental_agree_item_attribs') )
+                                       ),
 
-                                               if(substr($page,-2)=='_1')
-                                               {
-                                                       
$menu['sub_menu'][$i]['this']=True;
-                                               }
-                                               $menu['sub_menu'][$i]['url']    
                =       
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uilocation.index', 'lookup_tenant'=>1, 'type_id'=> 
$config_tenant,'query'=>$query_location));
-                                               $menu['sub_menu'][$i]['text']   
                =       lang('Tenant');
-                                               
$menu['sub_menu'][$i]['statustext']             =       lang('Tenant');
-                                               $i++;
-                                       
-                                               if($page=='gab')
-                                               {
-                                                       
$menu['sub_menu'][$i]['this']=True;
-                                               }
-                                               $menu['sub_menu'][$i]['url']    
                =       
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uigab.index'));
-                                               $menu['sub_menu'][$i]['text']   
                =       lang('gabnr');
-                                               
$menu['sub_menu'][$i]['statustext']             =       lang('gabnr');
-                                               $i++;
-                                       
-                                               if($page=='summary')
-                                               {
-                                                       
$menu['sub_menu'][$i]['this']=True;
-                                               }
-                                               $menu['sub_menu'][$i]['url']    
                =       
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uilocation.summary'));
-                                               $menu['sub_menu'][$i]['text']   
                =       lang('Summary');
-                                               
$menu['sub_menu'][$i]['statustext']             =       lang('Summary');
-                                               $i++;
-                                       }
-                               }
+                               );
 
-                               if ($sub == 'invoice')
+                               foreach ( $locations as $location )
                                {
-                                       $menu['menu_title_2']=lang('Invoice');
+                                       
$admin_children_location_children["attribute_loc_{$location['id']}"] = array
+                                       (
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_location.list_attribute', 'type_id' => $location['id'])),
+                                               'text'  => $location['name'] . 
' ' . lang('attributes'),
+                                       );
+                                       
$admin_children_location_children["category_{$location['id']}"] = array
+                                       (
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uicategory.index', 'type' => 'location', 'type_id' => 
$location['id'], 'menu_selection' => 
"admin::property::location::location::category_{$location['id']}") ),
+                                               'text'  => $location['name'] . 
' ' . lang('categories'),
+                                       );      
+                               }
 
-                                       if($page=='invoice_')
-                                       {
-                                               
$menu['sub_menu'][$i]['this']=True;
-                                       }
-                                       $menu['sub_menu'][$i]['url']            
        =       $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uiinvoice.index'));
-                                       $menu['sub_menu'][$i]['text']           
        =       lang('Invoice');
-                                       $menu['sub_menu'][$i]['statustext']     
        =       lang('Invoice');
-                                       $i++;
+                               $admin_children_location = array
+                               (
+                                       'street'        => array
+                                       (
+                                               'text'  => lang('Street'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uicategory.index', 'type' => 'street', 'menu_selection' => 
'admin::property::location::street') )
+                                       ),
+                                       'district'      => array
+                                       (
+                                               'text'  => lang('District'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uicategory.index', 'type' => 'district', 'menu_selection' => 
'admin::property::location::district') )
+                                       ),
+                                       'town'  => array
+                                       (
+                                               'text'  => lang('Part of town'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uip_of_town.index') )
+                                       ),
+                                       'location' => array
+                                       (
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_location.index') ),
+                                               'text'  => lang('Location 
type'),
+                                               'children'      => 
$admin_children_location_children
+                                       ),
+                                       'config' => array
+                                       (
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_location.config') ),
+                                               'text'  => lang('Config')
+                                       )
+                               );
 
-                                       if($page=='invoice_1')
-                                       {
-                                               
$menu['sub_menu'][$i]['this']=True;
-                                       }
-                                       $menu['sub_menu'][$i]['url']            
        =       $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uiinvoice.index', 'paid'=>true));
-                                       $menu['sub_menu'][$i]['text']           
        =       lang('Paid');
-                                       $menu['sub_menu'][$i]['statustext']     
        =       lang('Paid');
-                                       $i++;
 
-                                       if($page=='consume')
-                                       {
-                                               
$menu['sub_menu'][$i]['this']=True;
-                                       }
-                                       $menu['sub_menu'][$i]['url']            
        =       $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uiinvoice.consume'));
-                                       $menu['sub_menu'][$i]['text']           
        =       lang('consume');
-                                       $menu['sub_menu'][$i]['statustext']     
        =       lang('consume');
-                                       $i++;
+                               $menus['admin'] = array
+                               (
+                                       'index' => array
+                                       (
+                                               'text'  => 
lang('Configuration'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.uiconfig.index', 'appname' => 'property') )
+                                       ),
+                                       'entity'        => array
+                                       (
+                                               'text'  => lang('Admin entity'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uiadmin_entity.index') ),
+                                               'children' => 
$admin_children_entity
+                                       ),
+                                       'location'      => array
+                                       (
+                                               'text'  => lang('Admin 
Location'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uiadmin_location.index') ),
+                                               'children' => 
$admin_children_location
+                                       ),
+                                       'inactive_cats' => array
+                                       (
+                                               'text'  => lang('Update the not 
active category for locations'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uilocation.update_cat') )
+                                       ),
+                                       'request_cats'  => array
+                                       (
+                                               'text'  => lang('Request 
Categories'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uicategory.index', 'type' => 'request', 'menu_selection' => 
'admin::property::request_cats') )
+                                       ),
+                                       'workorder_cats'        => array
+                                       (
+                                               'text'  => lang('Workorder 
Categories'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uicategory.index', 'type' => 'wo', 'menu_selection' => 
'admin::property::workorder_cats') )
+                                       ),
+                                       'workorder_detail'      => array
+                                       (
+                                               'text'  => lang('Workorder 
Detail Categories'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uicategory.index', 'type' => 'wo_hours', 'menu_selection' => 
'admin::property::workorder_detail') )
+                                       ),
+                                       'ticket_cats'   => array
+                                       (
+                                               'text'  => lang('Ticket 
Categories'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uicategory.index', 'type' => 'ticket', 'menu_selection' => 
'admin::property::ticket_cats') )
+                                       ),
+                                       'tenant'        => array
+                                       (
+                                               'text'  => lang('Tenant'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uiactor.index', 'role' => 'tenant', 'admin' => true) ),
+                                               'children'      => 
$admin_children_tenant
+                                       ),
+                                       'owner' => array
+                                       (
+                                               'text'  => lang('Owner'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uiactor.index', 'role' => 'owner', 'admin' => true) ),
+                                               'children'      => 
$admin_children_owner
+                                       ),
+                                       'vendor'        => array
+                                       (
+                                               'text'  => lang('Vendor'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uiactor.index', 'role' => 'vendor', 'admin' => true) ),
+                                               'children'      => 
$admin_children_vendor
+                                       ),
+                                       'doc_cats'      => array
+                                       (
+                                               'text'  => lang('Document 
Categories'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uicategory.index', 'type' => 'document', 'menu_selection' => 
'admin::property::doc_cats') )
+                                       ),
+                                       'building_part' => array
+                                       (
+                                               'text'  => lang('Building 
Part'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uistandard_2.index', 'type' => 'building_part') )
+                                       ),
+                                       'tender'        => array
+                                       (
+                                               'text'  => lang('Tender 
chapter'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uicategory.index', 'type' => 'tender_chapter', 'menu_selection' => 
'admin::property::tender') )
+                                       ),
+                                       'id_control'    => array
+                                       (
+                                               'text'  => lang('ID Control'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uiadmin.edit_id') )
+                                       ),
+                                       'permissions'   => array
+                                       (
+                                               'text'  => lang('Permissions'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uiadmin.list_acl') )
+                                       ),
+                                       'user_contact'  => array
+                                       (
+                                               'text'  => lang('User contact 
info'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uiadmin.contact_info') )
+                                       ),
+                                       'request_status'        => array
+                                       (
+                                               'text'  => lang('Request 
status'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uistandard_2.index', 'type' => 'request_status') )
+                                       ),
+                                       'request_condition'     => array
+                                       (
+                                               'text'  => lang('Request 
condition_type'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uicategory.index', 'type' => 'r_condition_type', 'menu_selection' => 
'admin::property::request_condition') )
+                                       ),
+                                       'workorder_status'      => array
+                                       (
+                                               'text'  => lang('Workorders 
status'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uistandard_2.index', 'type' => 'workorder_status') )
+                                       ),
+                                       'agreement'     => array
+                                       (
+                                               'text'  => lang('Agreement'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uistandard_2.index', 'type' => 'agreement_status') ),
+                                               'children'      => 
$admin_children_agreement
+                                       ),
+                                       'document_status'       => array
+                                       (
+                                               'text'  => lang('Document 
Status'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uistandard_2.index', 'type' => 'document_status', 'menu_selection' => 
'admin::property::document_status') )
+                                       ),
+                                       'unit'  => array
+                                       (
+                                               'text'  => lang('Unit'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uistandard_2.index', 'type' => 'unit', 'menu_selection' => 
'admin::property::unit') )
+                                       ),
+                                       'key_location'  => array
+                                       (
+                                               'text'  => lang('Key location'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uistandard_3.index', 'type' => 'key_location') )
+                                       ),
+                                       'branch'        => array
+                                       (
+                                               'text'  => lang('Branch'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uistandard_3.index', 'type' => 'branch') )
+                                       ),
+                                       'accounting'    => array
+                                       (
+                                               'text'  => lang('Accounting'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uib_account.index') ),
+                                               'children'      => 
$admin_children_accounting
+                                       ),
+                                       'admin_async'   => array
+                                       (
+                                               'text'  => lang('Admin Async 
services'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uialarm.index') )
+                                       ),
+                                       'async' => array
+                                       (
+                                               'text'  => lang('Async 
services'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uiasync.index') )
+                                       ),
+                                       'list_functions'        => array
+                                       (
+                                               'text'  => lang('Admin custom 
functions'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.ui_custom.list_custom_function','appname' => 'property') )
+                                       ),
+                               );
+                       }
 
-                                       if($page=='b_account')
-                                       {
-                                               
$menu['sub_menu'][$i]['this']=True;
-                                       }
-                                       $menu['sub_menu'][$i]['url']            
        =       $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uib_account.index'));
-                                       $menu['sub_menu'][$i]['text']           
        =       lang('Budget account');
-                                       $menu['sub_menu'][$i]['statustext']     
        =       lang('Budget account');
-                                       $i++;
+                       if ( 
isset($GLOBALS['phpgw_info']['user']['apps']['preferences']) )
+                       {
+                               $menus['preferences'] = array
+                               (
+                                       array
+                                       (
+                                               'text'  => 
$GLOBALS['phpgw']->translation->translate('Preferences', array(), true),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/preferences/preferences.php', array('appname' => 
'property', 'type'=> 'user') )
+                                       ),
+                                       array
+                                       (
+                                               'text'  => 
$GLOBALS['phpgw']->translation->translate('Grant Access', array(), true),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uiadmin.aclprefs', 'acl_app'=> 'property'))
+                                       )
+                               );
 
-                                       if($page=='vendor')
-                                       {
-                                               
$menu['sub_menu'][$i]['this']=True;
-                                       }
-                                       $menu['sub_menu'][$i]['url']            
        =       $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uiactor.index', 'role'=> 'vendor'));
-                                       $menu['sub_menu'][$i]['text']           
        =       lang('Vendor');
-                                       $menu['sub_menu'][$i]['statustext']     
        =       lang('Vendor');
-                                       $i++;
+                               $menus['toolbar'][] = array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('Preferences', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/preferences/preferences.php', array('appname'      => 
'property')),
+                                       'image' => array('property', 
'preferences')
+                               );
+                       }
 
-                                       if($page=='tenant')
-                                       {
-                                               
$menu['sub_menu'][$i]['this']=True;
-                                       }
-                                       $menu['sub_menu'][$i]['url']            
        =       $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uiactor.index', 'role'=> 'tenant'));
-                                       $menu['sub_menu'][$i]['text']           
        =       lang('Tenant');
-                                       $menu['sub_menu'][$i]['statustext']     
        =       lang('Tenant');
-                                       $i++;
-                                       
-                                       if ($this->acl->check('.invoice',16))
-                                       {
-                                               if($page=='investment')
-                                               {
-                                                       
$menu['sub_menu'][$i]['this']=True;
-                                               }
-                                               $menu['sub_menu'][$i]['url']    
                =       
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uiinvestment.index'));
-                                               $menu['sub_menu'][$i]['text']   
                =       lang('Investment value');
-                                               
$menu['sub_menu'][$i]['statustext']             =       lang('Investment 
value');
-                                               $i++;
+                       $menus['navigation'] = array();
+                       if ( $acl->check('.location', PHPGW_ACL_READ, 
'property') )
+                       {
+                               $children = array();
 
-                                               if($page=='import_inv')
-                                               {
-                                                       
$menu['sub_menu'][$i]['this']=True;
-                                               }
-                                               $menu['sub_menu'][$i]['url']    
                =       
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uiXport.import'));
-                                               $menu['sub_menu'][$i]['text']   
                =       lang('Import invoice');
-                                               
$menu['sub_menu'][$i]['statustext']             =       lang('Import invoice');
-                                               $i++;
+               //              $soadmin_location       = 
CreateObject('property.soadmin_location');
+               //              $locations      = 
$soadmin_location->select_location_type();
+                               foreach ( $locations as $location )
+                               {
+                                       $children["loc_{$location['id']}"] = 
array
+                                       (
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uilocation.index', 'type_id' => $location['id'])),
+                                               'text'  => $location['name']
+                                       );
+                               }
 
-                                               if($page=='export_inv')
-                                               {
-                                                       
$menu['sub_menu'][$i]['this']=True;
-                                               }
-                                               $menu['sub_menu'][$i]['url']    
                =       
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uiXport.export'));
-                                               $menu['sub_menu'][$i]['text']   
                =       lang('Export invoice');
-                                               
$menu['sub_menu'][$i]['statustext']             =       lang('Export invoice');
-                                               $i++;
-                                       }
+                               $children['tenant'] = array
+                               (
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uilocation.index', 'lookup_tenant' => 1, 'type_id' => 
$soadmin_location->read_config_single('tenant_id'))),
+                                       'text'  => lang('Tenant')
+                               );
+                               $children['gabnr'] = array
+                               (
+                                       'url'   =>      
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uigab.index')),
+                                       'text'  => lang('gabnr')
+                               );
+                               $children['summary'] = array
+                               (
+                                       'url'   =>      
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uilocation.summary')),
+                                       'text'  =>      lang('Summary')
+                               );
 
-                                       if ($this->acl->check('.invoice',2))
-                                       {
-                                               if($page=='add_inv')
-                                               {
-                                                       
$menu['sub_menu'][$i]['this']=True;
-                                               }
-                                               $menu['sub_menu'][$i]['url']    
                =       
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uiinvoice.add'));
-                                               $menu['sub_menu'][$i]['text']   
                =       lang('Add');
-                                               
$menu['sub_menu'][$i]['statustext']             =       lang('Add invoice');
-                                               $i++;
-                                       }
+/*                             if ( $acl->check('.location',16) )
+                               {
+                                       $children['type'] = array
+                                       (
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_location.index')),
+                                               'text'  => lang('Location type')
+                                       );
+                                       $children['config'] = array
+                                       (
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_location.config')),
+                                               'text'  => lang('Config')
+                                       );
                                }
+*/
+                               $menus['navigation']['location'] = array
+                               (
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uilocation.index', 'type_id'=>1)),
+                                       'text'  => lang('Location'),
+                                       'image' => array('property', 
'location'),
+                                       'children'      => $children
+                               );
+                       }
 
-                               if ($sub == 'pricebook' && 
$this->acl->check('.agreement',16))
-                               {
-                                       $menu['menu_title_2']=lang('pricebook');
+                       if ( $acl->check('.ifc', PHPGW_ACL_READ, 'property') )
+                       {
+                               $menus['navigation']['ifc'] = array
+                               (
+                                       'url'           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiifc.import')),
+                                       'text'          => lang('IFC'),
+                                       'image'         => array('property', 
'ifc'),
+                                       'children'      => array
+                                       (
+                                               'import'        => array
+                                               (
+                                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiifc.import')),
+                                                       'text'  => 
lang('import')
+                                               )
+                                       )
+                               );
+                       }
 
-                                       if($page=='agreement_group')
-                                       {
-                                               
$menu['sub_menu'][$i]['this']=True;
-                                       }
-                                       $menu['sub_menu'][$i]['url']            
        =       $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uipricebook.agreement_group'));
-                                       $menu['sub_menu'][$i]['text']           
        =       lang('Agreement group');
-                                       $menu['sub_menu'][$i]['statustext']     
        =       lang('Agreement group');
-                                       $i++;
+                       if ( $acl->check('.ticket',PHPGW_ACL_READ, 'property') )
+                       {
+                               $menus['navigation']['helpdesk'] = array
+                               (
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uitts.index')),
+                                       'text'  => lang('Helpdesk')
+                               );
+                       }
 
-                                       if($page=='activity')
-                                       {
-                                               
$menu['sub_menu'][$i]['this']=True;
-                                       }
-                                       $menu['sub_menu'][$i]['url']            
        =       $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uipricebook.activity'));
-                                       $menu['sub_menu'][$i]['text']           
        =       lang('Activities');
-                                       $menu['sub_menu'][$i]['statustext']     
        =       lang('Activities');
-                                       $i++;
+                       if ( $acl->check('.project', PHPGW_ACL_READ, 
'property') )
+                       {
+                               $menus['navigation']['project'] = array
+                               (
+                                       'url'           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiproject.index')),
+                                       'text'          => lang('Project'),
+                                       'children'      => array
+                                       (
+                                               'project'       => array
+                                               (
+                                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiproject.index')),
+                                                       'text'  => 
lang('Project')
+                                               ),
+                                               'workorder'     => array
+                                               (
+                                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiworkorder.index')),
+                                                       'text'  => 
lang('Workorder')
+                                               ),
+                                               'request'       => array
+                                               (
+                                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uirequest.index')),
+                                                       'text'  => 
lang('Request')
+                                               ),
+                                               'template'      => array
+                                               (
+                                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uitemplate.index')),
+                                                       'text'  => 
lang('template')
+                                               ),
+                                               'claim'         => array
+                                               (
+                                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uitenant_claim.index')),
+                                                       'text'  => lang('Tenant 
claim')
+                                               )
+                                       )
+                               );
+                       }
 
-                                       if($page=='agreement')
-                                       {
-                                               
$menu['sub_menu'][$i]['this']=True;
-                                       }
-                                       $menu['sub_menu'][$i]['url']            
        =       $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uiagreement.index'));
-                                       $menu['sub_menu'][$i]['text']           
        =       lang('Agreement');
-                                       $menu['sub_menu'][$i]['statustext']     
        =       lang('Agreement');
-                                       $i++;
-                               }
-//--------------
-                               if ($sub == 'agreement')
+                       if ( $acl->check('.invoice', PHPGW_ACL_READ, 
'property') )
+                       {
+                               $children = array();
+                               if ( $acl->check('.invoice', PHPGW_ACL_PRIVATE, 
'property') )
                                {
-                                       $menu['menu_title_2']=lang('Agreement');
-                                       if($page=='agreement')
-                                       {
-                                               
$menu['sub_menu'][$i]['this']=True;
-                                       }
-                                       $menu['sub_menu'][$i]['url']            
        =       $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uiagreement.index'));
-                                       $menu['sub_menu'][$i]['text']           
        =       lang('Pricebook');
-                                       $menu['sub_menu'][$i]['statustext']     
        =       lang('Pricebook');
-                                       $i++;
+                                       $children['investment'] = array
+                                       (
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiinvestment.index')),
+                                               'text'  =>      
lang('Investment value')
+                                       );
 
-                                       if($page=='s_agreement')
-                                       {
-                                               
$menu['sub_menu'][$i]['this']=True;
-                                       }
-                                       $menu['sub_menu'][$i]['url']            
        =       $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uis_agreement.index'));
-                                       $menu['sub_menu'][$i]['text']           
        =       lang('Service');
-                                       $menu['sub_menu'][$i]['statustext']     
        =       lang('service agreement');
-                                       $i++;
+                                       $children['import'] = array
+                                       (
+                                               'url'   =>      
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiXport.import')),
+                                               'text'  => lang('Import 
invoice')
+                                       );
 
-                                       if($page=='r_agreement')
-                                       {
-                                               
$menu['sub_menu'][$i]['this']=True;
-                                       }
-                                       $menu['sub_menu'][$i]['url']            
        =       $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uir_agreement.index'));
-                                       $menu['sub_menu'][$i]['text']           
        =       lang('Rental');
-                                       $menu['sub_menu'][$i]['statustext']     
        =       lang('Rental agreement');
-                                       $i++;
-
-                                       if($page=='alarm')
-                                       {
-                                               
$menu['sub_menu'][$i]['this']=True;
-                                       }
-                                       $menu['sub_menu'][$i]['url']            
        =       $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uialarm.list_alarm'));
-                                       $menu['sub_menu'][$i]['text']           
        =       lang('alarm');
-                                       $menu['sub_menu'][$i]['statustext']     
        =       lang('alarm');
-                                       $i++;
-
-                                       if($this->acl->check('.agreement',16) 
&& $page=='agreement')
-                                       {
-                                               
$menu['menu_title_3']=lang('pricebook');
-
-                                               $j=0;
-                                               if($page_2=='agreement_group')
-                                               {
-                                                       
$menu['sub_menu_2'][$j]['this']=True;
-                                               }
-                                               $menu['sub_menu_2'][$j]['url']  
                =       
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uipricebook.agreement_group'));
-                                               $menu['sub_menu_2'][$j]['text'] 
                =       lang('Agreement group');
-                                               
$menu['sub_menu_2'][$j]['statustext']   =       lang('Agreement group');
-                                               $j++;
-
-                                               if($page_2=='activity')
-                                               {
-                                                       
$menu['sub_menu_2'][$j]['this']=True;
-                                               }
-                                               $menu['sub_menu_2'][$j]['url']  
                =       
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uipricebook.activity'));
-                                               $menu['sub_menu_2'][$j]['text'] 
                =       lang('Activities');
-                                               
$menu['sub_menu_2'][$j]['statustext']   =       lang('Activities');
-                                               $j++;
-
-                                               if($page_2=='agreement')
-                                               {
-                                                       
$menu['sub_menu_2'][$j]['this']=True;
-                                               }
-                                               $menu['sub_menu_2'][$j]['url']  
                =       
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uiagreement.index'));
-                                               $menu['sub_menu_2'][$j]['text'] 
                =       lang('Agreement');
-                                               
$menu['sub_menu_2'][$j]['statustext']   =       lang('Agreement');
-                                               $j++;
-                                       }
-
+                                       $children['export'] = array
+                                       (
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiXport.export')),
+                                               'text'  =>      lang('Export 
invoice')
+                                       );
                                }
 
-//---------------
-                               if ($sub == 'project')
+                               if ( $acl->check('.invoice', PHPGW_ACL_ADD, 
'property') )
                                {
-                                       $menu['menu_title_2']=lang('Project');
+                                       $children['add'] = array
+                                       (
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiinvoice.add')),
+                                               'text'  =>      lang('Add')
+                                       );
+                               }
 
-                                       if($page=='project')
-                                       {
-                                               
$menu['sub_menu'][$i]['this']=True;
-                                       }
-                                       $menu['sub_menu'][$i]['url']            
        =       $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uiproject.index'));
-                                       $menu['sub_menu'][$i]['text']           
        =       lang('Project');
-                                       $menu['sub_menu'][$i]['statustext']     
        =       lang('Project');
-                                       $i++;
+                               $menus['navigation']['invoice'] = array
+                               (
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiinvoice.index')),
+                                       'text'  => lang('Invoice'),
+                                       'image' => array('property', 'invoice'),
+                                       'children'      => array_merge(array
+                                       (
+                                               'paid'          => array
+                                               (
+                                                       'url'   =>      
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiinvoice.index', 'paid'=>true)),
+                                                       'text'  => lang('Paid')
+                                               ),
+                                               // Should this be process? 
skwashd jan08
+                                               'consume'       => array
+                                               (
+                                                       'url'   =>      
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiinvoice.consume')),
+                                                       'text'  => 
lang('consume')
+                                               ),
+                                               'budget'        => array
+                                               (
+                                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uib_account.index')),
+                                                       'text'  => lang('Budget 
account')
+                                               ),
+                                               'vendor'        => array
+                                               (
+                                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiactor.index', 'role'=> 'vendor')),
+                                                       'text'  => 
lang('Vendor')
+                                               ),
+                                               'tenant'        => array
+                                               (
+                                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiactor.index', 'role'=> 'tenant')),
+                                                       'text'  => 
lang('Tenant')
+                                               )
+                                       ), $children)
+                               );
+                       }
 
-                                       if($page=='workorder')
-                                       {
-                                               
$menu['sub_menu'][$i]['this']=True;
-                                       }
-                                       $menu['sub_menu'][$i]['url']            
        =       $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uiworkorder.index'));
-                                       $menu['sub_menu'][$i]['text']           
        =       lang('Workorder');
-                                       $menu['sub_menu'][$i]['statustext']     
        =       lang('Workorder');
-                                       $i++;
-                                       
-/*
-                                       if($page=='s_agreement')
-                                       {
-                                               
$menu['sub_menu'][$i]['this']=True;
-                                               
$menu['menu_title_2'][]=lang('Service');
-                                       }
-                                       $menu['sub_menu'][$i]['url']            
        =       $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uis_agreement.index'));
-                                       $menu['sub_menu'][$i]['text']           
        =       lang('Service');
-                                       $menu['sub_menu'][$i]['statustext']     
        =       lang('service agreement');
-                                       $i++;
-*/
-                                       if($page=='request')
-                                       {
-                                               
$menu['sub_menu'][$i]['this']=True;
-                                       }
-                                       $menu['sub_menu'][$i]['url']            
        =       $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uirequest.index'));
-                                       $menu['sub_menu'][$i]['text']           
        =       lang('Request');
-                                       $menu['sub_menu'][$i]['statustext']     
        =       lang('Request');
-                                       $i++;
+                       if ( $acl->check('.budget', PHPGW_ACL_READ, 'property') 
)
+                       {
+                               $menus['navigation']['budget'] = array
+                               (
+                                       'url'           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uibudget.index')),
+                                       'text'          => lang('Budget'),
+                                       'children'      => array
+                                       (
+                                               'basis'         => array
+                                               (
+                                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uibudget.basis')),
+                                                       'text'  => lang('basis')
+                                               ),
+                                               'budget'        => array
+                                               (
+                                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uibudget.index')),
+                                                       'text'  => 
lang('budget')
+                                               ),
+                                               'obligations'   => array
+                                               (
+                                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uibudget.obligations')),
+                                                       'text'  => 
lang('obligations')
+                                               )
+                                       )
+                               );
+                       }
 
-                                       if($page=='template')
-                                       {
-                                               
$menu['sub_menu'][$i]['this']=True;
-                                       }
-                                       $menu['sub_menu'][$i]['url']            
        =       $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uitemplate.index'));
-                                       $menu['sub_menu'][$i]['text']           
        =       lang('template');
-                                       $menu['sub_menu'][$i]['statustext']     
        =       lang('Workorder template');
-                                       $i++;
-
-                                       if($page=='tenant_claim')
-                                       {
-                                               
$menu['sub_menu'][$i]['this']=True;
-                                       }
-                                       $menu['sub_menu'][$i]['url']            
        =       $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uitenant_claim.index'));
-                                       $menu['sub_menu'][$i]['text']           
        =       lang('Tenant claim');
-                                       $menu['sub_menu'][$i]['statustext']     
        =       lang('Tenant claim');
-                                       $i++;
+                       if ( $acl->check('.agreement', PHPGW_ACL_READ, 
'property') )
+                       {
+                               $admin_menu = array();
+                               if ( $acl->check('.agreement',16) )
+                               {
+                                       $admin_menu = array
+                                       (
+                                               'group'         => array
+                                               (
+                                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uipricebook.agreement_group')),
+                                                       'text'  => 
lang('Agreement group')
+                                               ),
+                                               'activities'    => array
+                                               (
+                                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uipricebook.activity')),
+                                                       'text'  => 
lang('Activities')
+                                               ),
+                                               'agreement'             => array
+                                               (
+                                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiagreement.index')),
+                                                       'text'  => 
lang('Agreement')
+                                               )
+                                       );
                                }
 
-                               if ($sub == 'adm_loc' && 
$this->acl->check('.location',16))
-                               {
-                                       $menu['menu_title_2']=lang('Admin 
location');
-                                       if($page=='loc_type')
-                                       {
-                                               
$menu['sub_menu'][$i]['this']=True;
-                                       }
-                                       $menu['sub_menu'][$i]['url']            
        =       $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uiadmin_location.index'));
-                                       $menu['sub_menu'][$i]['text']           
        =       lang('Location type');
-                                       $menu['sub_menu'][$i]['statustext']     
        =       lang('Location type');
-                                       $i++;
+                               $menus['navigation']['agreement'] = array
+                               (
+                                       'url'           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiagreement.index')),
+                                       'text'          => lang('Agreement'),
+                                       'children'      => array
+                                       (
+                                               'pricebook'     => array
+                                               (
+                                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiagreement.index')),
+                                                       'text'  => 
lang('Pricebook'),
+                                                       'children'      => 
$admin_menu
+                                               ),
+                                               'service'       => array
+                                               (
+                                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uis_agreement.index')),
+                                                       'text'  => 
lang('Service')
+                                               ),
+                                               'rental'        => array
+                                               (
+                                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uir_agreement.index')),
+                                                       'text'  => 
lang('Rental')
+                                               ),
+                                               'alarm'         => array
+                                               (
+                                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uialarm.list_alarm')),
+                                                       'text'  => lang('alarm')
+                                               )
+                                       )
+                               );
+                       }
 
-                                       if($page=='loc_config')
-                                       {
-                                               
$menu['sub_menu'][$i]['this']=True;
-                                       }
-                                       $menu['sub_menu'][$i]['url']            
        =       $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uiadmin_location.config'));
-                                       $menu['sub_menu'][$i]['text']           
        =       lang('Config');
-                                       $menu['sub_menu'][$i]['statustext']     
        =       lang('Location Config');
-                                       $i++;
-                               }
-
-                               if ($sub == 'document')
+                       if ( $acl->check('.document', PHPGW_ACL_READ, 
'property') )
+                       {
+                               $menus['navigation']['documentation'] = array
+                               (
+                                       'url'           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uidocument.index')),
+                                       'text'          => 
lang('Documentation'),
+                                       'children'      => array
+                                       (
+                                               'location'      => array
+                                               (
+                                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uidocument.index')),
+                                                       'text'  => 
lang('location')
+                                               )
+                                       )
+                               );
+                               if (is_array($entity_list) && 
count($entity_list) )
                                {
-                                       
$menu['menu_title_2']=lang('documentation');
-                                       if($page=='document_')
+                                       foreach ( $entity_list as $entry )
                                        {
-                                               
$menu['sub_menu'][$i]['this']=True;
-                                       }
-                                       $menu['sub_menu'][$i]['url']            
        =       $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uidocument.index'));
-                                       $menu['sub_menu'][$i]['text']           
        =       lang('location');
-                                       $menu['sub_menu'][$i]['statustext']     
        =       lang('Documentation for locations');
-                                       $i++;
-                                       
-                                       if (isset($entity_list) AND 
is_array($entity_list))
-                                       {
-                                               foreach($entity_list as $entry)
+                                               if($entry['documentation'])
                                                {
-                                                       
if($entry['documentation'])
-                                                       {
-                                                               
if($page=='document_'.$entry['id'])
-                                                               {
-                                                                       
$menu['sub_menu'][$i]['this']=True;
-                                                               }
-                                                               
$menu['sub_menu'][$i]['url']                    =       
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uidocument.index', 'entity_id' => $entry['id']));
-                                                               
$menu['sub_menu'][$i]['text']                   =       $entry['name'];
-                                                               
$menu['sub_menu'][$i]['statustext']             =       $entry['descr'];
-                                                               $i++;
-                                                       }
+                                                       
$menus['navigation']['documentation']['children']["entity_{$entry['id']}"] = 
array
+                                                       (
+                                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'property.uidocument.index', 'entity_id' => $entry['id'])),
+                                                               'text'  => 
$entry['name']
+                                                       );
                                                }
                                        }
-
                                }
-                               
-                               if ($sub == 'budget')
-                               {
-                                       $menu['menu_title_2']=lang('budget');
+                       }
 
-                                       if($page=='budget.basis')
-                                       {
-                                               
$menu['sub_menu'][$i]['this']=True;
-                                       }
-                                       $menu['sub_menu'][$i]['url']            
        =       $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uibudget.basis'));
-                                       $menu['sub_menu'][$i]['text']           
        =       lang('basis');
-                                       $menu['sub_menu'][$i]['statustext']     
        =       lang('budget per group');
-                                       $i++;
+                       if ( $acl->check('.custom', PHPGW_ACL_READ, 'property') 
)
+                       {
+                               $menus['navigation']['custom'] = array
+                               (
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uicustom.index')),
+                                       'text'  => lang('Custom'),
+                               );
+                       }
 
-                                       if($page=='budget')
+                       if ( is_array($entity_list) && count($entity_list) )
+                       {
+                               foreach($entity_list as $entry)
+                               {
+                                       if ( 
$acl->check(".entity.{$entry['id']}", PHPGW_ACL_READ, 'property') )
                                        {
-                                               
$menu['sub_menu'][$i]['this']=True;
+                                               
$menus['navigation']["entity_{$entry['id']}"] = array
+                                               (
+                                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uientity.index', 'entity_id'=> $entry['id'])),
+                                                       'text'  => 
$entry['name']
+                                               );
                                        }
-                                       $menu['sub_menu'][$i]['url']            
        =       $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uibudget.index'));
-                                       $menu['sub_menu'][$i]['text']           
        =       lang('budget');
-                                       $menu['sub_menu'][$i]['statustext']     
        =       lang('budget');
-                                       $i++;
+                                       
+                                       $cat_list = 
$entity->read_category(array('allrows'=>True,'entity_id'=>$entry['id']));
 
-                                       if($page=='budget.obligations')
+                                       foreach($cat_list as $category)
                                        {
-                                               
$menu['sub_menu'][$i]['this']=True;
+                                               if ( 
$acl->check(".entity.{$entry['id']}.{$category['id']}", PHPGW_ACL_READ, 
'property') )
+                                               {
+                                                       
$menus['navigation']["entity_{$entry['id']}"]['children']["entity_{$entry['id']}_{$category['id']}"]
    = array
+                                                       (
+                                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uientity.index', 'entity_id'=> $entry['id'] , 'cat_id'=> 
$category['id'])),
+                                                               'text'  => 
$category['name']
+                                                       );
+                                               }
                                        }
-                                       $menu['sub_menu'][$i]['url']            
        =       $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uibudget.obligations'));
-                                       $menu['sub_menu'][$i]['text']           
        =       lang('obligations');
-                                       $menu['sub_menu'][$i]['statustext']     
        =       lang('contractual obligations');
-                                       $i++;
                                }
-
-                               if ($sub == 'ifc')
-                               {
-                                       $menu['menu_title_2']=lang('ifc');
-
-                                       if($page=='ifc.import')
-                                       {
-                                               
$menu['sub_menu'][$i]['this']=True;
-                                       }
-                                       $menu['sub_menu'][$i]['url']            
        =       $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uiifc.import'));
-                                       $menu['sub_menu'][$i]['text']           
        =       lang('import');
-                                       $menu['sub_menu'][$i]['statustext']     
        =       lang('import ifc xml');
-                                       $i++;
-
-                               }
-
-                               
$GLOBALS['phpgw']->session->appsession('menu',substr(md5($currentapp.$sub . '_' 
. $page . '_' . $page_2),-20),$menu);
                        }
-
-                       
$GLOBALS['phpgw']->session->appsession('menu_property','sidebox',$menu);
-                       return $menu;
+                       unset($entity_list);
+                       unset($entity);
+                       $GLOBALS['phpgw_info']['flags']['currentapp'] = 
$incoming_app;
+                       return $menus;
                }
        }
-?>

Modified: trunk/property/inc/class.pdf.inc.php
===================================================================
--- trunk/property/inc/class.pdf.inc.php        2008-02-15 22:43:36 UTC (rev 
18487)
+++ trunk/property/inc/class.pdf.inc.php        2008-02-18 10:22:48 UTC (rev 
18488)
@@ -30,7 +30,7 @@
        {
                function print_pdf($document = '',$document_name = 'document')
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        
                        $browser = CreateObject('phpgwapi.browser');
 

Deleted: trunk/property/inc/class.soadmin_custom.inc.php
===================================================================
--- trunk/property/inc/class.soadmin_custom.inc.php     2008-02-15 22:43:36 UTC 
(rev 18487)
+++ trunk/property/inc/class.soadmin_custom.inc.php     2008-02-18 10:22:48 UTC 
(rev 18488)
@@ -1,276 +0,0 @@
-<?php
-       /**
-       * phpGroupWare - property: a Facilities Management System.
-       *
-       * @author Sigurd Nes <address@hidden>
-       * @copyright Copyright (C) 2003,2004,2005,2006,2007 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_soadmin_custom
-       {
-
-               function property_soadmin_custom()
-               {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
-                       $this->account          = 
$GLOBALS['phpgw_info']['user']['account_id'];
-                       $this->bocommon         = 
CreateObject('property.bocommon');
-                       $this->db               = $this->bocommon->new_db();
-                       $this->db2              = $this->bocommon->new_db();
-                       $this->join             = $this->bocommon->join;
-                       $this->like             = $this->bocommon->like;
-               }
-
-               function read($data)
-               {
-                       if(is_array($data))
-                       {
-                               $query = 
(isset($data['start'])?$data['start']:0);
-                               $query = 
(isset($data['query'])?$data['query']:'');
-                               $sort = 
(isset($data['sort'])?$data['sort']:'DESC');
-                               $order = 
(isset($data['order'])?$data['order']:'');
-                               $allrows = 
(isset($data['allrows'])?$data['allrows']:'');
-                               $acl_location = 
(isset($data['acl_location'])?$data['acl_location']:'');
-                       }
-
-                       if ($order)
-                       {
-                               $ordermethod = " order by $order $sort";
-
-                       }
-                       else
-                       {
-                               $ordermethod = ' order by custom_sort asc';
-                       }
-
-                       $table = 'fm_custom_function';
-
-                       $filtermethod = " WHERE acl_location='$acl_location'";
-                       $where = 'AND';
-
-                       $querymethod = '';
-                       if($query)
-                       {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
-
-                               $querymethod = " $where file_name $this->like 
'%$query%' or descr $this->like '%$query%'";
-                       }
-
-
-                       $sql = "SELECT * FROM $table $filtermethod 
$querymethod";
-
-                       $this->db2->query($sql,__LINE__,__FILE__);
-                       $this->total_records = $this->db2->num_rows();
-
-                       if(!$allrows)
-                       {
-                               $this->db->limit_query($sql . 
$ordermethod,$start,__LINE__,__FILE__);
-                       }
-                       else
-                       {
-                               $this->db->query($sql . 
$ordermethod,__LINE__,__FILE__);
-                       }
-
-                       while ($this->db->next_record())
-                       {
-                               $custom_function[] = array
-                               (
-                                       'id'            => $this->db->f('id'),
-                                       'acl_location'  => 
$this->db->f('acl_location'),
-                                       'file_name'     => 
$this->db->f('file_name'),
-                                       'sorting'       => 
$this->db->f('custom_sort'),
-                                       'descr'         => 
$this->db->f('descr'),
-                                       'active'        => 
$this->db->f('active')
-                               );
-                       }
-                       return (isset($custom_function)?$custom_function:'');
-               }
-
-
-               function read_single_custom_function($id,$acl_location)
-               {
-
-                       $sql = "SELECT * FROM fm_custom_function where 
acl_location='$acl_location' AND id=$id";
-
-                       $this->db->query($sql,__LINE__,__FILE__);
-
-                       if ($this->db->next_record())
-                       {
-                               $custom_function['id']                  = 
$this->db->f('id');
-                               $custom_function['descr']               = 
$this->db->f('descr');
-                               $custom_function['custom_function_file']= 
$this->db->f('file_name');
-                               $custom_function['active']              = 
$this->db->f('active');
-
-                               return $custom_function;
-                       }
-
-               }
-
-               function add_custom_function($custom_function)
-               {
-                       if(!$custom_function['acl_location'])
-                       {
-                               return  $receipt['error'][] = array('msg' => 
lang('acl_locastion is missing'));
-                       }
-
-                       $acl_location = $custom_function['acl_location'];
-                       
-                       $custom_function['descr'] = 
$this->db->db_addslashes($custom_function['descr']);
-
-
-                       $this->db->query("SELECT max(id) as maximum FROM 
fm_custom_function WHERE acl_location='$acl_location'",__LINE__,__FILE__);
-                       $this->db->next_record();
-                       $custom_function['id'] = $this->db->f('maximum')+1;
-
-                       $sql = "SELECT max(custom_sort) as max_sort FROM 
fm_custom_function where acl_location='$acl_location'";
-                       $this->db->query($sql,__LINE__,__FILE__);
-                       $this->db->next_record();
-                       $custom_sort    = $this->db->f('max_sort')+1;
-
-                       $values= array(
-                               $acl_location,
-                               $custom_function['id'],
-                               $custom_function['custom_function_file'],
-                               $custom_function['descr'],
-                               $custom_function['active'],
-                               $custom_sort
-                               );
-
-                       $values = $this->bocommon->validate_db_insert($values);
-
-                       $this->db->transaction_begin();
-
-                       $this->db->query("INSERT INTO fm_custom_function 
(acl_location, id, file_name, descr, active, custom_sort) "
-                               . "VALUES ($values)",__LINE__,__FILE__);
-
-                       $receipt['id']= $custom_function['id'];
-
-                       $this->db->transaction_commit();
-
-                       return $receipt;
-               }
-
-               function edit_custom_function($custom_function)
-               {
-                       $acl_location = $custom_function['acl_location'];
-
-                       if(!$acl_location)
-                       {
-                               return  $receipt['error'][] = array('msg' => 
lang('acl_locastion is missing'));
-                       }
-
-                       $custom_function['descr'] = 
$this->db->db_addslashes($custom_function['descr']);
-
-                       $this->db->transaction_begin();
-
-                               $value_set=array(
-                                       'descr'         => 
$custom_function['descr'],
-                                       'file_name'     => 
$custom_function['custom_function_file'],
-                                       'active'        => 
$custom_function['active']
-                                       );
-
-                               $value_set      = 
$this->bocommon->validate_db_update($value_set);
-
-                               $this->db->query("UPDATE fm_custom_function set 
$value_set WHERE acl_location='" . $acl_location . "' AND id=" . 
$custom_function['id'],__LINE__,__FILE__);
-
-                       $this->db->transaction_commit();
-
-                       $receipt['message'][] = array('msg'     => lang('Custom 
function has been edited'));
-
-                       return $receipt;
-               }
-
-               function resort_custom_function($data)
-               {
-                       if(is_array($data))
-                       {
-                               $resort = 
(isset($data['resort'])?$data['resort']:'up');
-                               $acl_location = 
(isset($data['acl_location'])?$data['acl_location']:'');
-                               $id = (isset($data['id'])?$data['id']:'');
-                       }
-
-                       if(!$acl_location)
-                       {
-                               return  $receipt['error'][] = array('msg' => 
lang('acl_locastion is missing'));
-                       }
-
-                       $sql = "SELECT custom_sort FROM fm_custom_function 
where acl_location='$acl_location' AND id=$id";
-                       $this->db->query($sql,__LINE__,__FILE__);
-                       $this->db->next_record();
-                       $custom_sort    = $this->db->f('custom_sort');
-                       $sql2 = "SELECT max(custom_sort) as max_sort FROM 
fm_custom_function where acl_location='$acl_location'";
-                       $this->db->query($sql2,__LINE__,__FILE__);
-                       $this->db->next_record();
-                       $max_sort       = $this->db->f('max_sort');
-
-                       switch($resort)
-                       {
-                               case 'up':
-                                       if($custom_sort>1)
-                                       {
-                                               $sql = "UPDATE 
fm_custom_function set custom_sort=$custom_sort WHERE 
acl_location='$acl_location' AND custom_sort =" . ($custom_sort-1);
-                                               
$this->db->query($sql,__LINE__,__FILE__);
-                                               $sql = "UPDATE 
fm_custom_function set custom_sort=" . ($custom_sort-1) ." WHERE 
acl_location='$acl_location' AND id=$id";
-                                               
$this->db->query($sql,__LINE__,__FILE__);
-                                       }
-                                       break;
-                               case 'down':
-                                       if($max_sort > $custom_sort)
-                                       {
-                                               $sql = "UPDATE 
fm_custom_function set custom_sort=$custom_sort WHERE 
acl_location='$acl_location' AND custom_sort =" . ($custom_sort+1);
-                                               
$this->db->query($sql,__LINE__,__FILE__);
-                                               $sql = "UPDATE 
fm_custom_function set custom_sort=" . ($custom_sort+1) ." WHERE 
acl_location='$acl_location' AND id=$id";
-                                               
$this->db->query($sql,__LINE__,__FILE__);
-                                       }
-                                       break;
-                               default:
-                                       return;
-                                       break;
-                       }
-               }
-
-               function delete_custom_function($id,$acl_location)
-               {
-                       $sql = "SELECT custom_sort FROM fm_custom_function 
where acl_location='$acl_location' AND id=$id";
-                       $this->db->query($sql,__LINE__,__FILE__);
-                       $this->db->next_record();
-                       $custom_sort    = $this->db->f('custom_sort');
-                       $sql2 = "SELECT max(custom_sort) as max_sort FROM 
fm_custom_function where acl_location='$acl_location'";
-                       $this->db->query($sql2,__LINE__,__FILE__);
-                       $this->db->next_record();
-                       $max_sort       = $this->db->f('max_sort');
-                       if($max_sort>$custom_sort)
-                       {
-                               $sql = "UPDATE fm_custom_function set 
custom_sort=custom_sort-1 WHERE acl_location='$acl_location' AND custom_sort > 
$custom_sort";
-                               $this->db->query($sql,__LINE__,__FILE__);
-                       }
-                       $this->db->query("DELETE FROM fm_custom_function WHERE 
acl_location='$acl_location' AND id=$id",__LINE__,__FILE__);
-               }
-       }
-?>

Deleted: trunk/property/inc/class.uiadmin_custom.inc.php
===================================================================
--- trunk/property/inc/class.uiadmin_custom.inc.php     2008-02-15 22:43:36 UTC 
(rev 18487)
+++ trunk/property/inc/class.uiadmin_custom.inc.php     2008-02-18 10:22:48 UTC 
(rev 18488)
@@ -1,420 +0,0 @@
-<?php
-       /**
-
-
-       * phpGroupWare - property: a Facilities Management System.
-       *
-       * @author Sigurd Nes <address@hidden>
-       * @copyright Copyright (C) 2003,2004,2005,2006,2007 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_uiadmin_custom
-       {
-               var $grants;
-               var $start;
-               var $query;
-               var $sort;
-               var $order;
-               var $sub;
-               var $currentapp;
-
-               var $public_functions = array
-               (
-                       'index'         => True,
-                       'edit'          => True,
-                       'delete'        => True
-               );
-
-               function property_uiadmin_custom()
-               {
-                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
-                       $this->nextmatchs               = 
CreateObject('phpgwapi.nextmatchs');
-                       $this->account                  = 
$GLOBALS['phpgw_info']['user']['account_id'];
-                       $this->bo                               = 
CreateObject('property.boadmin_custom',True);
-                       $this->boadmin                  = 
CreateObject('property.boadmin',True);
-                       $this->bocommon                 = 
CreateObject('property.bocommon');
-                       $this->menu                             = 
CreateObject('property.menu');
-
-                       $this->acl                              = 
CreateObject('phpgwapi.acl');
-                       $this->acl_location             = '.admin';
-                       $this->acl_read                 = 
$this->acl->check($this->acl_location,1);
-                       $this->acl_add                  = 
$this->acl->check($this->acl_location,2);
-                       $this->acl_edit                 = 
$this->acl->check($this->acl_location,4);
-                       $this->acl_delete               = 
$this->acl->check($this->acl_location,8);
-                       $this->acl_manage               = 
$this->acl->check($this->acl_location,16);
-
-                       $this->start                    = $this->bo->start;
-                       $this->query                    = $this->bo->query;
-                       $this->sort                             = 
$this->bo->sort;
-                       $this->order                    = $this->bo->order;
-                       $this->cat_id                   = $this->bo->cat_id;
-                       $this->allrows                  = $this->bo->allrows;
-
-                       $this->menu->sub                ='admin_custom';
-               }
-
-               function save_sessiondata()
-               {
-                       $data = array
-                       (
-                               'start'         => $this->start,
-                               'query'         => $this->query,
-                               'sort'          => $this->sort,
-                               'order'         => $this->order,
-                               'allrows'       => $this->allrows,
-                               'cat_id'        => $this->cat_id
-                       );
-                       $this->bo->save_sessiondata($data);
-               }
-
-       
-
-               function index()
-               {
-                       if(!$this->acl_read)
-                       {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>1, 'acl_location'=> 
$this->acl_location));
-                       }
-
-                       $id     = phpgw::get_var('id', 'int');
-                       $resort = phpgw::get_var('resort');
-
-                       
$GLOBALS['phpgw']->xslttpl->add_file(array('admin_custom',
-                                                                       
'nextmatchs',
-                                                                       
'search_field'));
-
-                       if($resort)
-                       {
-                               $this->bo->resort_custom_function($id,$resort);
-                       }
-       
-                       $custom_function_list = $this->bo->read();
-
-                       if (isset($custom_function_list) AND 
is_array($custom_function_list))
-                       {
-                               foreach($custom_function_list as $entry)
-                               {
-                                       $content[] = array
-                                       (
-                                               'acl_location'                  
        => $entry['acl_location'],
-                                               'file_name'                     
        => $entry['file_name'],
-                                               'descr'                         
        => $entry['descr'],
-                                               'sorting'                       
        => $entry['sorting'],
-                                               'active'                        
        => $entry['active']?'X':'',
-                                               'link_up'                       
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin_custom.index', 'resort'=>'up', 'cat_id'=> 
$entry['acl_location'], 'id'=> $entry['id'], 'allrows'=> $this->allrows)),
-                                               'link_down'                     
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin_custom.index', 'resort'=>'down', 'cat_id'=> 
$entry['acl_location'], 'id'=> $entry['id'], 'allrows'=> $this->allrows)),
-                                               'link_edit'                     
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin_custom.edit', 'cat_id'=> $entry['acl_location'], 
'id'=> $entry['id'])),
-                                               'link_delete'                   
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin_custom.delete', 'cat_id'=> $entry['acl_location'], 
'id'=> $entry['id'])),
-                                               'lang_up_text'                  
        => lang('shift up'),
-                                               'lang_down_text'                
        => lang('shift down'),
-                                               'lang_edit_text'                
        => lang('edit the custom_function'),
-                                               'lang_delete_text'              
        => lang('delete the custom_function'),
-                                               'text_custom_function'          
        => lang('custom functions'),
-                                               'text_up'                       
        => lang('up'),
-                                               'text_down'                     
        => lang('down'),
-                                               'text_edit'                     
        => lang('edit'),
-                                               'text_delete'                   
        => lang('delete')
-                                       );
-                               }
-                       }
-
-                       $table_header[] = array
-                       (
-                               'lang_acl_location'     => lang('Location'),
-                               'lang_descr'            => lang('Descr'),
-                               'lang_active'           => lang('Active'),
-                               'lang_sorting'          => lang('sorting'),
-                               'lang_search'           => lang('search'),
-                               'lang_edit'             => lang('edit'),
-                               'lang_delete'           => lang('delete'),
-                               'sort_acl_location'     => 
$this->nextmatchs->show_sort_order(array
-                                                                               
(
-                                                                               
        'sort'  => $this->sort,
-                                                                               
        'var'   => 'acl_location',
-                                                                               
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uiadmin_custom.index',
-                                                                               
                                'cat_id'        => $this->cat_id,
-                                                                               
                                'allrows'       => $this->allrows)
-                                                                               
)),
-
-                               'sort_name'     => 
$this->nextmatchs->show_sort_order(array
-                                                                               
(
-                                                                               
        'sort'  => $this->sort,
-                                                                               
        'var'   => 'column_name',
-                                                                               
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uiadmin_custom.index',
-                                                                               
                                'cat_id'        => $this->cat_id,
-                                                                               
                                'allrows'       => $this->allrows)
-                                                                               
)),
-                               'sort_sorting'  => 
$this->nextmatchs->show_sort_order(array
-                                                                               
(
-                                                                               
        'sort'  => $this->sort,
-                                                                               
        'var'   => 'custom_function_sort',
-                                                                               
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uiadmin_custom.index',
-                                                                               
                                'cat_id'        => $this->cat_id,
-                                                                               
                                'allrows'       => $this->allrows)
-                                                                               
)),
-                               'lang_name'     => lang('Name'),
-                       );
-
-                       $table_add[] = array
-                       (
-                               'lang_add'                      => lang('add'),
-                               'lang_add_custom_functiontext'  => lang('add a 
custom_function'),
-                               'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin_custom.edit', 'cat_id'=> $this->cat_id)),
-                               'lang_done'                     => lang('done'),
-                               'lang_done_custom_functiontext' => lang('back 
to admin'),
-                               'done_action'                   => 
$GLOBALS['phpgw']->link('/admin/index.php'),
-                       );
-
-                       if(!$this->allrows)
-                       {
-                               $record_limit   = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
-                       }
-                       else
-                       {
-                               $record_limit   = $this->bo->total_records;
-                       }
-
-                       $link_data = array
-                       (
-                               'menuaction'    => 
$this->currentapp.'.uiadmin_custom.index',
-                               'sort'          => $this->sort,
-                               'order'         => $this->order,
-                               'query'         => $this->query,
-                               'cat_id'        => $this->cat_id
-                       );
-
-                       $data = array
-                       (
-                               'lang_custom'                                   
                => lang('entity'),
-                               'entity_name'                                   
                => $entity['name'],
-                               'lang_category'                                 
                => lang('category'),
-                               'category_name'                                 
                => $category['name'],
-                               'allow_allrows'                                 
                => True,
-                               'allrows'                                       
                        => $this->allrows,
-                               'start_record'                                  
                => $this->start,
-                               'record_limit'                                  
                => $record_limit,
-                               'start_record'                                  
                => $this->start,
-                               'num_records'                                   
                => count($custom_function_list),
-                               'all_records'                                   
                => $this->bo->total_records,
-                               'link_url'                                      
                        => $GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'img_path'                                      
                        => 
$GLOBALS['phpgw']->common->get_image_path('phpgwapi','default'),
-                               'lang_searchfield_custom_functiontext'  => 
lang('Enter the search string. To show all entries, empty this field and press 
the SUBMIT button again'),
-                               'lang_searchbutton_custom_functiontext' => 
lang('Submit the search string'),
-                               'query'                                         
                        => $this->query,
-                               'lang_search'                                   
                => lang('search'),
-                               'table_header_custom_function'                  
=> $table_header,
-                               'values_custom_function'                        
        => $content,
-                               'table_add'                                     
                        => $table_add,
-
-                               'lang_no_location'                              
                => lang('No location'),
-                               'lang_location_statustext'                      
        => lang('Select submodule'),
-                               'select_name_location'                          
        => 'cat_id',
-                               'location_list'                                 
                => $this->boadmin->select_location('filter',$this->cat_id,False)
-                       );
-
-                       $appname        = lang('custom function');
-                       $function_msg   = lang('list custom function');
-
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
-                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
-                       $this->save_sessiondata();
-               }
-
-               function edit()
-               {
-                       if(!$this->acl_add)
-                       {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=> 2, 'acl_location'=> 
$this->acl_location));
-                       }
-
-                       $id             = phpgw::get_var('id', 'int');
-                       $values         = phpgw::get_var('values');
-
-                       
$GLOBALS['phpgw']->xslttpl->add_file(array('admin_custom'));
-
-                       if ($values['save'])
-                       {
-                               if($id)
-                               {
-                                       $values['id']=$id;
-                                       $action='edit';
-                               }
-
-                               $values['acl_location'] = $this->cat_id;
-
-                               if (!$values['acl_location'])
-                               {
-                                       $receipt['error'][] = 
array('msg'=>lang('location not chosen!'));
-                               }
-
-                               if (!$values['custom_function_file'])
-                               {
-                                       $receipt['error'][] = 
array('msg'=>lang('custom function file not chosen!'));
-                               }
-
-
-                               if (!$receipt['error'])
-                               {
-
-                                       $receipt = 
$this->bo->save_custom_function($values,$action);
-
-                                       if(!$id)
-                                       {
-                                               $id=$receipt['id'];
-                                       }
-                               }
-                               else
-                               {
-                                       $receipt['error'][] = array('msg'       
=> lang('Custom function has NOT been saved'));
-                               }
-
-                       }
-
-                       if ($id)
-                       {
-                               $values = 
$this->bo->read_single_custom_function($id);
-                               $type_name=$values['type_name'];
-                               $function_msg = lang('edit custom function'). ' 
' . lang($type_name);
-                               $action='edit';
-                       }
-                       else
-                       {
-                               $function_msg = lang('add custom function');
-                               $action='add';
-                       }
-
-                       $link_data = array
-                       (
-                               'menuaction'    => 
$this->currentapp.'.uiadmin_custom.edit',
-                               'cat_id'        => $this->cat_id,
-                               'id'            => $id
-                       );
-
-
-//_debug_array($values);
-
-                       $msgbox_data = $this->bocommon->msgbox_data($receipt);
-
-                       $data = array
-                       (
-                               'lang_custom'                                   
        => lang('custom'),
-                               'msgbox_data'                                   
        => $GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'form_action'                                   
        => $GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'done_action'                                   
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin_custom.index', 'cat_id'=> $this->cat_id)),
-                               'lang_id'                                       
                => lang('Custom function ID'),
-                               'lang_custom_type'                              
        => lang('Entity type'),
-                               'lang_no_custom_type'                           
=> lang('No entity type'),
-                               'lang_save'                                     
                => lang('save'),
-                               'lang_done'                                     
                => lang('done'),
-                               'value_id'                                      
                => $id,
-
-                               'lang_descr'                                    
        => lang('descr'),
-                               'lang_descr_custom_functiontext'        => 
lang('Enter a descr for the custom function'),
-                               'value_descr'                                   
        => $values['descr'],
-
-                               'lang_done_custom_functiontext'         => 
lang('Back to the list'),
-                               'lang_save_custom_functiontext'         => 
lang('Save the custom function'),
-
-                               'lang_custom_function'                          
=> lang('custom function'),
-                               'lang_custom_function_statustext'       => 
lang('Select a custom function'),
-                               'lang_no_custom_function'                       
=> lang('No custom function'),
-                               'custom_function_list'                          
=> $this->bo->select_custom_function($values['custom_function_file']),
-
-                               'lang_location'                                 
        => lang('Location'),
-                               'lang_no_location'                              
        => lang('No location'),
-                               'lang_location_statustext'                      
=> lang('Select submodule'),
-                               'select_name_location'                          
=> 'cat_id',
-                               'location_list'                                 
        => $this->boadmin->select_location('select',$this->cat_id),
-
-                               'value_active'                                  
        => $values['active'],
-                               'lang_active'                                   
        => lang('Active'),
-                               'lang_active_statustext'                        
=> lang('check to activate custom function'),
-                       );
-
-                       $appname        = lang('entity');
-
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
-                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
-               }
-
-               function delete()
-               {
-                       if(!$this->acl_delete)
-                       {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=> 8, 'acl_location'=> 
$this->acl_location));
-                       }
-
-                       $id     = phpgw::get_var('id', 'int');
-                       $confirm        = phpgw::get_var('confirm', 'bool', 
'POST');
-
-                       $link_data = array
-                       (
-                               'menuaction'    => 
$this->currentapp.'.uiadmin_custom.index',
-                               'id'            => $id,
-                               'cat_id'        => $this->cat_id
-                       );
-
-                       $delete_data = array
-                       (
-                               'menuaction'    => 
$this->currentapp.'.uiadmin_custom.delete',
-                               'cat_id'        => $this->cat_id,
-                               'id'            => $id
-                       );
-
-                       if (phpgw::get_var('confirm', 'bool', 'POST'))
-                       {
-                               $this->bo->delete($id);
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
-                       }
-
-                       
$GLOBALS['phpgw']->xslttpl->add_file(array('app_delete'));
-
-                       $data = array
-                       (
-                               'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'                         => 
$GLOBALS['phpgw']->link('/index.php',$delete_data),
-                               'lang_confirm_msg'                      => 
lang('do you really want to delete this entry'),
-                               'lang_yes'                                      
=> lang('yes'),
-                               'lang_yes_standardtext'         => lang('Delete 
the entry'),
-                               'lang_no_standardtext'          => lang('Back 
to the list'),
-                               'lang_no'                                       
=> lang('no')
-                       );
-
-                       $appname        = lang('entity');
-                       $function_msg   = lang('delete entity type');
-
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
-                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
-               }
-       }
-?>

Modified: trunk/property/inc/hook_preferences.inc.php
===================================================================
--- trunk/property/inc/hook_preferences.inc.php 2008-02-15 22:43:36 UTC (rev 
18487)
+++ trunk/property/inc/hook_preferences.inc.php 2008-02-18 10:22:48 UTC (rev 
18488)
@@ -29,8 +29,8 @@
 
        $title = $appname;
        $file = Array(
-               'Preferences'   => 
$GLOBALS['phpgw']->link('/preferences/preferences.php',array('appname'=> 
$appname, 'type'=> 'user')),
-               'Grant Access'  => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$appname.'.uiadmin.aclprefs', 'acl_app'=> $appname))
+               'Preferences'   => 
$GLOBALS['phpgw']->link('/preferences/preferences.php', array('appname' => 
'property', 'type'=> 'user') ),
+               'Grant Access'  => $GLOBALS['phpgw']->link('/index.php', 
array('menuaction' => 'property.uiadmin.aclprefs', 'acl_app'=> 'property'))
        );
        display_section($appname,$file);
 

Modified: trunk/property/inc/hook_settings.inc.php
===================================================================
--- trunk/property/inc/hook_settings.inc.php    2008-02-15 22:43:36 UTC (rev 
18487)
+++ trunk/property/inc/hook_settings.inc.php    2008-02-18 10:22:48 UTC (rev 
18488)
@@ -27,7 +27,6 @@
        * @version $Id$
        */
 
-       $this->currentapp       = & 
$GLOBALS['phpgw_info']['flags']['currentapp'];
 
        $select_property_filter = array(
                ''      => lang('Owner type'),

Modified: trunk/property/login.php
===================================================================
--- trunk/property/login.php    2008-02-15 22:43:36 UTC (rev 18487)
+++ trunk/property/login.php    2008-02-18 10:22:48 UTC (rev 18488)
@@ -29,7 +29,8 @@
 
        $phpgw_info = array();
        
-       $GLOBALS['phpgw_info']['flags'] = array(
+       $GLOBALS['phpgw_info']['flags'] = array
+       (
                'disable_template_class' => true,
                'login'                  => true,
                'currentapp'             => 'login',

Modified: trunk/property/setup/setup.inc.php
===================================================================
--- trunk/property/setup/setup.inc.php  2008-02-15 22:43:36 UTC (rev 18487)
+++ trunk/property/setup/setup.inc.php  2008-02-18 10:22:48 UTC (rev 18488)
@@ -12,13 +12,12 @@
        */
 
        $setup_info['property']['name']         = 'property';
-       $setup_info['property']['title']        = 'Property';
-       $setup_info['property']['version']      = '0.9.17.540';
+       $setup_info['property']['version']      = '0.9.17.541';
        $setup_info['property']['app_order']    = 8;
        $setup_info['property']['enable']       = 1;
        $setup_info['property']['app_group']    = 'office';
 
-       $setup_info['property']['author'][] = array
+       $setup_info['property']['author'] = array
        (
                'name'  => 'Sigurd Nes',
                'email' => 'address@hidden'

Deleted: trunk/property/templates/base/admin_custom.xsl
===================================================================
--- trunk/property/templates/base/admin_custom.xsl      2008-02-15 22:43:36 UTC 
(rev 18487)
+++ trunk/property/templates/base/admin_custom.xsl      2008-02-18 10:22:48 UTC 
(rev 18488)
@@ -1,591 +0,0 @@
-<!-- $Id$ -->
-
-       <xsl:template name="app_data">
-               <xsl:choose>
-                       <xsl:when test="edit">
-                               <xsl:apply-templates select="edit"/>
-                       </xsl:when>
-                       <xsl:otherwise>
-                               <xsl:apply-templates select="list"/>
-                       </xsl:otherwise>
-               </xsl:choose>
-       </xsl:template>
-       
-       <xsl:template match="table_add">
-                       <tr>
-                               <td height="50">
-                                       <xsl:variable 
name="add_action"><xsl:value-of select="add_action"/></xsl:variable>
-                                       <xsl:variable 
name="lang_add"><xsl:value-of select="lang_add"/></xsl:variable>
-                                       <form method="post" 
action="{$add_action}">
-                                               <input type="submit" name="add" 
value="{$lang_add}" onMouseout="window.status='';return true;">
-                                                       <xsl:attribute 
name="onMouseover">
-                                                               
<xsl:text>window.status='</xsl:text>
-                                                                       
<xsl:value-of select="lang_add_standardtext"/>
-                                                               <xsl:text>'; 
return true;</xsl:text>
-                                                       </xsl:attribute>
-                                               </input>
-                                       </form>
-                               </td>
-                               <td height="50">
-                                       <xsl:variable 
name="done_action"><xsl:value-of select="done_action"/></xsl:variable>
-                                       <xsl:variable 
name="lang_done"><xsl:value-of select="lang_done"/></xsl:variable>
-                                       <form method="post" 
action="{$done_action}">
-                                               <input type="submit" name="add" 
value="{$lang_done}" onMouseout="window.status='';return true;">
-                                                       <xsl:attribute 
name="onMouseover">
-                                                               
<xsl:text>window.status='</xsl:text>
-                                                                       
<xsl:value-of select="lang_add_standardtext"/>
-                                                               <xsl:text>'; 
return true;</xsl:text>
-                                                       </xsl:attribute>
-                                               </input>
-                                       </form>
-                               </td>
-                       </tr>
-       </xsl:template>
-
-
-
-
-<!-- list custom_function -->
-
-       <xsl:template match="list">
-               
-               <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
-                       <tr>
-                               <td>
-                                       <xsl:call-template 
name="filter_location"/>
-                               </td>
-                               <td align="right">
-                                       <xsl:call-template name="search_field"/>
-                               </td>
-                       </tr>
-                       <tr>
-                               <td colspan="3" width="100%">
-                                       <xsl:call-template name="nextmatchs"/>
-                               </td>
-                       </tr>
-               </table>
-               <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
-                       <xsl:apply-templates 
select="table_header_custom_function"/>
-                       <xsl:choose>
-                               <xsl:when test="values_custom_function != ''">
-                                       <xsl:apply-templates 
select="values_custom_function"/>
-                               </xsl:when>
-                       </xsl:choose>
-                       <xsl:apply-templates select="table_add"/>
-               </table>
-       </xsl:template>
-       <xsl:template match="table_header_custom_function">
-               <xsl:variable name="sort_sorting"><xsl:value-of 
select="sort_sorting"/></xsl:variable>
-               <xsl:variable name="sort_name"><xsl:value-of 
select="sort_name"/></xsl:variable>
-               <xsl:variable name="sort_acl_location"><xsl:value-of 
select="sort_acl_location"/></xsl:variable>
-               <tr class="th">
-                       <td class="th_text" width="10%" align="left">
-                               <a href="{$sort_acl_location}"><xsl:value-of 
select="lang_acl_location"/></a>
-                       </td>
-                       <td class="th_text" width="10%" align="left">
-                               <a href="{$sort_name}"><xsl:value-of 
select="lang_name"/></a>
-                       </td>
-                       <td class="th_text" width="20%" align="left">
-                               <xsl:value-of select="lang_descr"/>
-                       </td>
-                       <td class="th_text" width="5%" align="center">
-                               <xsl:value-of select="lang_active"/>
-                       </td>
-                       <td class="th_text" width="10%" align="center">
-                               <a href="{$sort_sorting}"><xsl:value-of 
select="lang_sorting"/></a>
-                       </td>
-                       <td class="th_text" width="5%" align="center">
-                               <xsl:value-of select="lang_edit"/>
-                       </td>
-                       <td class="th_text" width="5%" align="center">
-                               <xsl:value-of select="lang_delete"/>
-                       </td>
-               </tr>
-       </xsl:template>
-
-       <xsl:template match="values_custom_function"> 
-               <xsl:variable name="lang_up_text"><xsl:value-of 
select="lang_up_text"/></xsl:variable>
-               <xsl:variable name="lang_down_text"><xsl:value-of 
select="lang_down_text"/></xsl:variable>
-               <xsl:variable name="lang_edit_text"><xsl:value-of 
select="lang_edit_text"/></xsl:variable>
-               <xsl:variable name="lang_delete_text"><xsl:value-of 
select="lang_delete_text"/></xsl:variable>
-                       <tr>
-                               <xsl:attribute name="class">
-                                       <xsl:choose>
-                                               <xsl:when test="@class">
-                                                       <xsl:value-of 
select="@class"/>
-                                               </xsl:when>
-                                               <xsl:when test="position() mod 
2 = 0">
-                                                       
<xsl:text>row_off</xsl:text>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                       
<xsl:text>row_on</xsl:text>
-                                               </xsl:otherwise>
-                                       </xsl:choose>
-                               </xsl:attribute>
-                               <td align="left">
-                                       <xsl:value-of select="acl_location"/>
-                               </td>
-                               <td align="left">
-                                       <xsl:value-of select="file_name"/>
-                               </td>
-                               <td>
-                                       <xsl:value-of select="descr"/>
-                               </td>
-                               <td align = 'center'>
-                                       <xsl:value-of select="active"/>
-                               </td>
-                               <td>
-                                       <table align="left">
-                                               <tr>
-                                                       <td>
-                                                               <xsl:value-of 
select="sorting"/>
-                                                       </td>
-
-                                                       <td align="left">
-                                                               <xsl:variable 
name="link_up"><xsl:value-of select="link_up"/></xsl:variable>
-                                                               <a 
href="{$link_up}" onMouseover="window.status='{$lang_up_text}';return true;" 
onMouseout="window.status='';return true;"><xsl:value-of select="text_up"/></a>
-                                                               <xsl:text> | 
</xsl:text>
-                                                               <xsl:variable 
name="link_down"><xsl:value-of select="link_down"/></xsl:variable>
-                                                               <a 
href="{$link_down}" onMouseover="window.status='{$lang_down_text}';return 
true;" onMouseout="window.status='';return true;"><xsl:value-of 
select="text_down"/></a>
-                                                       </td>
-
-                                               </tr>
-                                       </table>
-                               </td>
-                               <td align="center">
-                                       <xsl:variable 
name="link_edit"><xsl:value-of select="link_edit"/></xsl:variable>
-                                       <a href="{$link_edit}" 
onMouseover="window.status='{$lang_edit_text}';return true;" 
onMouseout="window.status='';return true;"><xsl:value-of 
select="text_edit"/></a>
-                               </td>
-                               <td align="center">
-                                       <xsl:variable 
name="link_delete"><xsl:value-of select="link_delete"/></xsl:variable>
-                                       <a href="{$link_delete}" 
onMouseover="window.status='{$lang_delete_text}';return true;" 
onMouseout="window.status='';return true;"><xsl:value-of 
select="text_delete"/></a>
-                               </td>
-                       </tr>
-       </xsl:template>
-
-
-<!-- add custom_function / edit custom_function -->
-
-       <xsl:template match="edit">
-               <div align="left">
-               
-               <table cellpadding="2" cellspacing="2" width="80%" 
align="center">
-                       <xsl:choose>
-                               <xsl:when test="msgbox_data != ''">
-                                       <tr>
-                                               <td align="left" colspan="3">
-                                                       <xsl:call-template 
name="msgbox"/>
-                                               </td>
-                                       </tr>
-                               </xsl:when>
-                       </xsl:choose>
-                       
-                       <xsl:variable name="form_action"><xsl:value-of 
select="form_action"/></xsl:variable>
-                       <form method="post" action="{$form_action}">
-
-                       <tr>
-                               <td class="th_text" align="left">
-                                       <xsl:value-of select="lang_entity"/>
-                               </td>
-                               <td class="th_text" align="left">
-                                       <xsl:value-of select="entity_name"/>
-                               </td>
-                       </tr>
-                       <tr>
-                               <td class="th_text" align="left">
-                                       <xsl:value-of select="lang_category"/>
-                               </td>
-                               <td class="th_text" align="left">
-                                       <xsl:value-of select="category_name"/>
-                               </td>
-                       </tr>
-                       <xsl:choose>
-                               <xsl:when test="value_id != ''">
-                                       <tr>
-                                               <td valign="top">
-                                                       <xsl:value-of 
select="lang_id"/>
-                                               </td>
-                                               <td>
-                                                       <xsl:value-of 
select="value_id"/>
-                                               </td>
-                                       </tr>
-                               </xsl:when>
-                       </xsl:choose>
-
-
-                       <tr>
-                               <td valign="top">
-                                       <xsl:value-of select="lang_location"/>
-                               </td>
-                               <td>
-                                       <xsl:call-template 
name="select_location"/>
-                               </td>
-                       </tr>
-
-
-                       <tr>
-                               <td valign="top">
-                                       <xsl:value-of select="lang_descr"/>
-                               </td>
-                               <td>
-                                       <textarea cols="60" rows="10" 
name="values[descr]" wrap="virtual" onMouseout="window.status='';return true;">
-                                               <xsl:attribute 
name="onMouseover">
-                                                       
<xsl:text>window.status='</xsl:text>
-                                                               <xsl:value-of 
select="lang_descr_custom_functiontext"/>
-                                                       <xsl:text>'; return 
true;</xsl:text>
-                                               </xsl:attribute>
-                                               <xsl:value-of 
select="value_descr"/>            
-                                       </textarea>
-
-                               </td>
-                       </tr>
-                       <tr>
-                               <td valign="top">
-                                       <xsl:value-of 
select="lang_custom_function"/>
-                               </td>
-                               <td valign="top">
-                                       <xsl:variable 
name="lang_custom_function_statustext"><xsl:value-of 
select="lang_custom_function_statustext"/></xsl:variable>
-                                       <select 
name="values[custom_function_file]" class="forms" 
onMouseover="window.status='{$lang_custom_function_statustext}'; return true;" 
onMouseout="window.status='';return true;">
-                                               <option value=""><xsl:value-of 
select="lang_no_custom_function"/></option>
-                                               <xsl:apply-templates 
select="custom_function_list"/>
-                                       </select>
-                               </td>
-                       </tr>
-                       <tr>
-                               <td>
-                                       <xsl:value-of select="lang_active"/>
-                               </td>
-                               <td>
-                                       <xsl:choose>
-                                                       <xsl:when 
test="value_active = 1">
-                                                               <input 
type="checkbox" name="values[active]" value="1" checked="checked" 
onMouseout="window.status='';return true;">
-                                                                       
<xsl:attribute name="onMouseover">
-                                                                               
<xsl:text>window.status='</xsl:text>
-                                                                               
        <xsl:value-of select="lang_active_statustext"/>
-                                                                               
<xsl:text>'; return true;</xsl:text>
-                                                                       
</xsl:attribute>
-                                                               </input>
-                                                       </xsl:when>
-                                                       <xsl:otherwise>
-                                                               <input 
type="checkbox" name="values[active]" value="1" 
onMouseout="window.status='';return true;">
-                                                                       
<xsl:attribute name="onMouseover">
-                                                                               
<xsl:text>window.status='</xsl:text>
-                                                                               
        <xsl:value-of select="lang_active_statustext"/>
-                                                                               
<xsl:text>'; return true;</xsl:text>
-                                                                       
</xsl:attribute>
-                                                               </input>
-                                                       </xsl:otherwise>
-                                       </xsl:choose>
-                               </td>
-                       </tr>
-                       <tr height="50">
-                               <td>
-                                       <xsl:variable 
name="lang_save"><xsl:value-of select="lang_save"/></xsl:variable>
-                                       <input type="submit" 
name="values[save]" value="{$lang_save}" onMouseout="window.status='';return 
true;">
-                                               <xsl:attribute 
name="onMouseover">
-                                                       
<xsl:text>window.status='</xsl:text>
-                                                               <xsl:value-of 
select="lang_save_custom_functiontext"/>
-                                                       <xsl:text>'; return 
true;</xsl:text>
-                                               </xsl:attribute>
-                                       </input>
-                               </td>
-                       </tr>
-
-                       </form>
-                       <tr>
-                               <td>
-                                       <xsl:variable 
name="done_action"><xsl:value-of select="done_action"/></xsl:variable>
-                                       <xsl:variable 
name="lang_done"><xsl:value-of select="lang_done"/></xsl:variable>
-                                       <form method="post" 
action="{$done_action}">
-                                               <input type="submit" 
name="done" value="{$lang_done}" onMouseout="window.status='';return true;">
-                                                       <xsl:attribute 
name="onMouseover">
-                                                               
<xsl:text>window.status='</xsl:text>
-                                                                       
<xsl:value-of select="lang_done_custom_functiontext"/>
-                                                               <xsl:text>'; 
return true;</xsl:text>
-                                                       </xsl:attribute>
-                                               </input>
-                                       </form>
-                               </td>
-                       </tr>
-               </table>
-               </div>
-       </xsl:template>
-
-
-
-<!-- location_level_list -->   
-
-       <xsl:template match="location_level_list">
-       <xsl:variable name="id"><xsl:value-of select="id"/></xsl:variable>
-               <xsl:choose>
-                       <xsl:when test="selected">
-                               <option value="{$id}" 
selected="selected"><xsl:value-of disable-output-escaping="yes" 
select="name"/></option>
-                       </xsl:when>
-                       <xsl:otherwise>
-                               <option value="{$id}"><xsl:value-of 
disable-output-escaping="yes" select="name"/></option>
-                       </xsl:otherwise>
-               </xsl:choose>
-       </xsl:template>
-
-<!-- datatype_list --> 
-
-       <xsl:template match="datatype_list">
-       <xsl:variable name="id"><xsl:value-of select="id"/></xsl:variable>
-               <xsl:choose>
-                       <xsl:when test="selected">
-                               <option value="{$id}" 
selected="selected"><xsl:value-of disable-output-escaping="yes" 
select="name"/></option>
-                       </xsl:when>
-                       <xsl:otherwise>
-                               <option value="{$id}"><xsl:value-of 
disable-output-escaping="yes" select="name"/></option>
-                       </xsl:otherwise>
-               </xsl:choose>
-       </xsl:template>
-
-<!-- custom_function_list -->  
-
-       <xsl:template match="custom_function_list">
-       <xsl:variable name="id"><xsl:value-of select="id"/></xsl:variable>
-               <xsl:choose>
-                       <xsl:when test="selected='selected'">
-                               <option value="{$id}" 
selected="selected"><xsl:value-of disable-output-escaping="yes" 
select="name"/></option>
-                       </xsl:when>
-                       <xsl:otherwise>
-                               <option value="{$id}"><xsl:value-of 
disable-output-escaping="yes" select="name"/></option>
-                       </xsl:otherwise>
-               </xsl:choose>
-       </xsl:template>
-
-<!-- nullable_list --> 
-
-       <xsl:template match="nullable_list">
-       <xsl:variable name="id"><xsl:value-of select="id"/></xsl:variable>
-               <xsl:choose>
-                       <xsl:when test="selected">
-                               <option value="{$id}" 
selected="selected"><xsl:value-of disable-output-escaping="yes" 
select="name"/></option>
-                       </xsl:when>
-                       <xsl:otherwise>
-                               <option value="{$id}"><xsl:value-of 
disable-output-escaping="yes" select="name"/></option>
-                       </xsl:otherwise>
-               </xsl:choose>
-       </xsl:template>
-
-       <xsl:template name="choice">
-                       <table cellpadding="2" cellspacing="2" width="80%" 
align="left">
-                       <xsl:choose>
-                               <xsl:when test="value_choice!=''">
-                                       <tr class="th">
-                                               <td class="th_text" width="85%" 
align="left">
-                                                       <xsl:value-of 
select="lang_value"/>
-                                               </td>
-                                               <td class="th_text" width="15%" 
align="center">
-                                                       <xsl:value-of 
select="lang_delete_value"/>
-                                               </td>
-                                       </tr>
-                               <xsl:for-each select="value_choice" >
-                                       <tr>
-                                               <xsl:attribute name="class">
-                                                       <xsl:choose>
-                                                               <xsl:when 
test="@class">
-                                                                       
<xsl:value-of select="@class"/>
-                                                               </xsl:when>
-                                                               <xsl:when 
test="position() mod 2 = 0">
-                                                                       
<xsl:text>row_off</xsl:text>
-                                                               </xsl:when>
-                                                               <xsl:otherwise>
-                                                                       
<xsl:text>row_on</xsl:text>
-                                                               </xsl:otherwise>
-                                                       </xsl:choose>
-                                               </xsl:attribute>
-                                       <td align="left">
-                                               <xsl:value-of select="value"/>
-                                               <xsl:text> </xsl:text>
-                                       </td>
-                                       <td align="center">
-                                               <input type="checkbox" 
name="values[delete_choice][]" value="{id}"  
onMouseout="window.status='';return true;">
-                                                       <xsl:attribute 
name="onMouseover">
-                                                               
<xsl:text>window.status='</xsl:text>
-                                                                       
<xsl:value-of select="//lang_delete_choice_statustext"/>
-                                                               <xsl:text>'; 
return true;</xsl:text>
-                                                       </xsl:attribute>
-                                               </input>
-                                       </td>
-                                       </tr>
-                               </xsl:for-each>
-                               </xsl:when>
-                       </xsl:choose>
-                       <tr>
-                               <td valign="top">
-                                       <xsl:value-of select="lang_new_value"/>
-                               </td>
-                               <td>
-                                       <input type="text" 
name="values[new_choice]" onMouseout="window.status='';return true;">
-                                               <xsl:attribute 
name="onMouseover">
-                                                       
<xsl:text>window.status='</xsl:text>
-                                                               <xsl:value-of 
select="lang_new_value_statustext"/>
-                                                       <xsl:text>'; return 
true;</xsl:text>
-                                               </xsl:attribute>
-                                       </input>
-                               </td>
-                       </tr>
-                       </table>
-       </xsl:template>
-
-       <xsl:template name="include_list">
-                       <table cellpadding="2" cellspacing="2" width="80%" 
align="left">
-                               <tr class="th">
-                                       <td class="th_text" width="85%" 
align="left">
-                                               <xsl:value-of 
select="lang_name"/>
-                                       </td>
-                                       <td class="th_text" width="15%" 
align="center">
-                                               <xsl:value-of 
select="lang_select"/>
-                                       </td>
-                               </tr>
-                               <xsl:for-each select="include_list" >
-                                       <tr>
-                                               <xsl:attribute name="class">
-                                                       <xsl:choose>
-                                                               <xsl:when 
test="@class">
-                                                                       
<xsl:value-of select="@class"/>
-                                                               </xsl:when>
-                                                               <xsl:when 
test="position() mod 2 = 0">
-                                                                       
<xsl:text>row_off</xsl:text>
-                                                               </xsl:when>
-                                                               <xsl:otherwise>
-                                                                       
<xsl:text>row_on</xsl:text>
-                                                               </xsl:otherwise>
-                                                       </xsl:choose>
-                                               </xsl:attribute>
-                                       <td align="left">
-                                               <xsl:value-of select="name"/>
-                                       </td>
-                                       <td align="center">
-                                               <xsl:choose>
-                                                       <xsl:when 
test="selected='selected'">
-                                                               <input 
type="checkbox" name="values[lookup_entity][]" value="{id}" checked="checked" 
onMouseout="window.status='';return true;">
-                                                                       
<xsl:attribute name="onMouseover">
-                                                                               
<xsl:text>window.status='</xsl:text>
-                                                                               
        <xsl:value-of select="//lang_include_statustext"/>
-                                                                               
<xsl:text>'; return true;</xsl:text>
-                                                                       
</xsl:attribute>
-                                                               </input>
-                                                       </xsl:when>
-                                                       <xsl:otherwise>
-                                                               <input 
type="checkbox" name="values[lookup_entity][]" value="{id}"  
onMouseout="window.status='';return true;">
-                                                                       
<xsl:attribute name="onMouseover">
-                                                                               
<xsl:text>window.status='</xsl:text>
-                                                                               
        <xsl:value-of select="//lang_include_statustext"/>
-                                                                               
<xsl:text>'; return true;</xsl:text>
-                                                                       
</xsl:attribute>
-                                                               </input>
-                                                       </xsl:otherwise>
-                                               </xsl:choose>
-                                       </td>
-                                       </tr>
-                               </xsl:for-each>
-                       </table>
-       </xsl:template>
-       
-       <xsl:template name="include_list_2">
-                       <table cellpadding="2" cellspacing="2" width="80%" 
align="left">
-                               <tr class="th">
-                                       <td class="th_text" width="85%" 
align="left">
-                                               <xsl:value-of 
select="lang_name"/>
-                                       </td>
-                                       <td class="th_text" width="15%" 
align="center">
-                                               <xsl:value-of 
select="lang_select"/>
-                                       </td>
-                               </tr>
-                               <xsl:for-each select="include_list_2" >
-                                       <tr>
-                                               <xsl:attribute name="class">
-                                                       <xsl:choose>
-                                                               <xsl:when 
test="@class">
-                                                                       
<xsl:value-of select="@class"/>
-                                                               </xsl:when>
-                                                               <xsl:when 
test="position() mod 2 = 0">
-                                                                       
<xsl:text>row_off</xsl:text>
-                                                               </xsl:when>
-                                                               <xsl:otherwise>
-                                                                       
<xsl:text>row_on</xsl:text>
-                                                               </xsl:otherwise>
-                                                       </xsl:choose>
-                                               </xsl:attribute>
-                                       <td align="left">
-                                               <xsl:value-of select="name"/>
-                                       </td>
-                                       <td align="center">
-                                               <xsl:choose>
-                                                       <xsl:when 
test="selected='selected'">
-                                                               <input 
type="checkbox" name="values[include_entity_for][]" value="{id}" 
checked="checked" onMouseout="window.status='';return true;">
-                                                                       
<xsl:attribute name="onMouseover">
-                                                                               
<xsl:text>window.status='</xsl:text>
-                                                                               
        <xsl:value-of select="//lang_include_2_statustext"/>
-                                                                               
<xsl:text>'; return true;</xsl:text>
-                                                                       
</xsl:attribute>
-                                                               </input>
-                                                       </xsl:when>
-                                                       <xsl:otherwise>
-                                                               <input 
type="checkbox" name="values[include_entity_for][]" value="{id}"  
onMouseout="window.status='';return true;">
-                                                                       
<xsl:attribute name="onMouseover">
-                                                                               
<xsl:text>window.status='</xsl:text>
-                                                                               
        <xsl:value-of select="//lang_include_2_statustext"/>
-                                                                               
<xsl:text>'; return true;</xsl:text>
-                                                                       
</xsl:attribute>
-                                                               </input>
-                                                       </xsl:otherwise>
-                                               </xsl:choose>
-                                       </td>
-                                       </tr>
-                               </xsl:for-each>
-                       </table>
-       </xsl:template>
-       <xsl:template name="include_list_3">
-                       <table cellpadding="2" cellspacing="2" width="80%" 
align="left">
-                               <tr class="th">
-                                       <td class="th_text" width="85%" 
align="left">
-                                               <xsl:value-of 
select="lang_name"/>
-                                       </td>
-                                       <td class="th_text" width="15%" 
align="center">
-                                               <xsl:value-of 
select="lang_select"/>
-                                       </td>
-                               </tr>
-                               <xsl:for-each select="include_list_3" >
-                                       <tr>
-                                               <xsl:attribute name="class">
-                                                       <xsl:choose>
-                                                               <xsl:when 
test="@class">
-                                                                       
<xsl:value-of select="@class"/>
-                                                               </xsl:when>
-                                                               <xsl:when 
test="position() mod 2 = 0">
-                                                                       
<xsl:text>row_off</xsl:text>
-                                                               </xsl:when>
-                                                               <xsl:otherwise>
-                                                                       
<xsl:text>row_on</xsl:text>
-                                                               </xsl:otherwise>
-                                                       </xsl:choose>
-                                               </xsl:attribute>
-                                       <td align="left">
-                                               <xsl:value-of select="name"/>
-                                       </td>
-                                       <td align="center">
-                                               <xsl:choose>
-                                                       <xsl:when 
test="selected='selected'">
-                                                               <input 
type="checkbox" name="values[start_entity_from][]" value="{id}" 
checked="checked" onMouseout="window.status='';return true;">
-                                                               </input>
-                                                       </xsl:when>
-                                                       <xsl:otherwise>
-                                                               <input 
type="checkbox" name="values[start_entity_from][]" value="{id}"  
onMouseout="window.status='';return true;">
-                                                                       
<xsl:attribute name="onMouseover">
-                                                                               
<xsl:text>window.status='</xsl:text>
-                                                                               
        <xsl:value-of select="//lang_include_3_statustext"/>
-                                                                               
<xsl:text>'; return true;</xsl:text>
-                                                                       
</xsl:attribute>
-                                                               </input>
-                                                       </xsl:otherwise>
-                                               </xsl:choose>
-                                       </td>
-                                       </tr>
-                               </xsl:for-each>
-                       </table>
-       </xsl:template>
-       






reply via email to

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