phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] [18466] Merge from resight tree


From: Dave Hall
Subject: [Phpgroupware-cvs] [18466] Merge from resight tree
Date: Sat, 02 Feb 2008 13:52:40 +0000

Revision: 18466
          
http://svn.sv.gnu.org/viewvc/?view=rev&root=phpgroupware&revision=18466
Author:   skwashd
Date:     2008-02-02 13:52:39 +0000 (Sat, 02 Feb 2008)

Log Message:
-----------
Merge from resight tree

Significant Features / Enhancements

 * New manu system - replaces various hooks (admin, preferences & sidebox_menu) 
and old navbar code
 * Support transactions for mysql - where the server supports it
 * Dropped SEP constant - just use / (it is cross platform)
 * Switch phpgw class to use __get __set - WIP more of this will be done 
overtime, it makes for cleaner code
 * Switch to native php JSON functions

Fixes
 * Make translations case insensitive
 * Revert error handler change which slipped through in last merge
 * Drop preference option for showing navbar as text or icons - it isn't 
supported by most tpl sets anyway
 * Display errors properly in admin user/groups
 * Fix character encoding so swedish lang installable on utf8 dbs
 * Still function when a template set is no longer available
 * Noitces fixes
 * Various small fixes

Modified Paths:
--------------
    trunk/addressbook/inc/class.boXport.inc.php
    trunk/addressbook/inc/class.boaddressbook.inc.php
    trunk/addressbook/inc/class.uiXport.inc.php
    trunk/addressbook/setup/phpgw_en.lang
    trunk/addressbook/setup/phpgw_sv.lang
    trunk/addressbook/setup/setup.inc.php
    trunk/admin/inc/class.bo_custom.inc.php
    trunk/admin/inc/class.boaccounts.inc.php
    trunk/admin/inc/class.soaccounts.inc.php
    trunk/admin/inc/class.ui_custom.inc.php
    trunk/admin/inc/class.uiaccess_history.inc.php
    trunk/admin/inc/class.uiaccounts.inc.php
    trunk/admin/inc/class.uiaclmanager.inc.php
    trunk/admin/inc/class.uiapplications.inc.php
    trunk/admin/inc/class.uiasyncservice.inc.php
    trunk/admin/inc/class.uicategories.inc.php
    trunk/admin/inc/class.uiconfig.inc.php
    trunk/admin/inc/class.uicurrentsessions.inc.php
    trunk/admin/inc/class.uilog.inc.php
    trunk/admin/inc/class.uiloglevels.inc.php
    trunk/admin/inc/class.uimainscreen.inc.php
    trunk/admin/setup/phpgw_sv.lang
    trunk/admin/setup/setup.inc.php
    trunk/admin/templates/base/app_data.xsl
    trunk/admin/templates/base/app_delete.xsl
    trunk/admin/templates/base/currentusers.tpl
    trunk/admin/templates/base/custom.xsl
    trunk/admin/templates/base/groups.xsl
    trunk/admin/templates/base/users.xsl
    trunk/bookmarks/setup/phpgw_sv.lang
    trunk/calendar/help/JA/add.php
    trunk/calendar/help/JA/calendar.php
    trunk/calendar/help/JA/edit_delete.php
    trunk/calendar/help/JA/view.php
    trunk/calendar/inc/class.bocalendar.inc.php
    trunk/calendar/inc/class.boicalendar.inc.php
    trunk/calendar/setup/phpgw_sv.lang
    trunk/calendar/setup/setup.inc.php
    trunk/chat/setup/phpgw_sv.lang
    trunk/chora/setup/phpgw_sv.lang
    trunk/comic/inc/functions.inc.php
    trunk/comic/setup/phpgw_sv.lang
    trunk/demo/inc/class.bodemo.inc.php
    trunk/demo/setup/phpgw_en.lang
    trunk/demo/templates/base/attributes_form.xsl
    trunk/developer_tools/inc/class.solangfile.inc.php
    trunk/developer_tools/setup/phpgw_sv.lang
    trunk/eldaptir/setup/phpgw_sv.lang
    trunk/email/attach_file.php
    trunk/email/inc/class.boattach_file.inc.php
    trunk/email/inc/class.bocompose.inc.php
    trunk/email/inc/class.bopreferences.inc.php
    trunk/email/inc/class.bosend.inc.php
    trunk/email/inc/class.html_widgets.inc.php
    trunk/email/inc/class.mail_dcom_base.inc.php
    trunk/email/inc/class.mail_dcom_base_sock.inc.php
    trunk/email/inc/class.mail_dcom_imap.inc.php
    trunk/email/inc/class.mail_msg_base.inc.php
    trunk/email/inc/class.mail_msg_wrappers.inc.php
    trunk/email/inc/class.msg_bootstrap.inc.php
    trunk/email/inc/class.uiindex.inc.php
    trunk/email/setup/phpgw_sv.lang
    trunk/email/setup/setup.inc.php
    trunk/etemplate/inc/class.solangfile.inc.php
    trunk/etemplate/setup/phpgw_sv.lang
    trunk/fax/inc/class.manager.inc.php
    trunk/felamimail/inc/class.bocompose.inc.php
    trunk/felamimail/inc/class.bopreferences.inc.php
    trunk/felamimail/inc/class.uicompose.inc.php
    trunk/felamimail/inc/class.uidisplay.inc.php
    trunk/felamimail/inc/class.uifelamimail.inc.php
    trunk/felamimail/inc/class.uifilter.inc.php
    trunk/felamimail/inc/hook_sidebox_menu.inc.php
    trunk/felamimail/index.php
    trunk/felamimail/setup/phpgw_sv.lang
    trunk/felamimail/setup/setup.inc.php
    trunk/filemanager/inc/class.bofilemanager.inc.php
    trunk/filemanager/inc/class.uifilemanager.inc.php
    trunk/filemanager/setup/phpgw_de.lang
    trunk/filemanager/setup/phpgw_sv.lang
    trunk/filemanager/tests/test.php
    trunk/filemanager/tests/test_dav.php
    trunk/forum/setup/phpgw_de.lang
    trunk/forum/setup/phpgw_sv.lang
    trunk/ftp/inc/functions.inc.php
    trunk/ftp/setup/phpgw_sv.lang
    trunk/ged/setup/phpgw_en.lang
    trunk/headlines/setup/phpgw_sv.lang
    trunk/hrm/inc/class.boadmin.inc.php
    trunk/hrm/inc/class.bocategory.inc.php
    trunk/hrm/inc/class.bocommon.inc.php
    trunk/hrm/inc/class.bojob.inc.php
    trunk/hrm/inc/class.boplace.inc.php
    trunk/hrm/inc/class.bouser.inc.php
    trunk/hrm/inc/class.menu.inc.php
    trunk/hrm/inc/class.soadmin.inc.php
    trunk/hrm/inc/class.socategory.inc.php
    trunk/hrm/inc/class.socommon.inc.php
    trunk/hrm/inc/class.sojob.inc.php
    trunk/hrm/inc/class.soplace.inc.php
    trunk/hrm/inc/class.souser.inc.php
    trunk/hrm/inc/class.uiadmin.inc.php
    trunk/hrm/inc/class.uicategory.inc.php
    trunk/hrm/inc/class.uijob.inc.php
    trunk/hrm/inc/class.uiplace.inc.php
    trunk/hrm/inc/class.uiuser.inc.php
    trunk/hrm/setup/default_records.inc.php
    trunk/hrm/setup/phpgw_en.lang
    trunk/hrm/setup/setup.inc.php
    trunk/hrm/templates/base/menu.xsl
    trunk/infolog/inc/class.vfs.inc.php
    trunk/infolog/setup/phpgw_sv.lang
    trunk/inv/setup/phpgw_sv.lang
    trunk/javassh/setup/phpgw_sv.lang
    trunk/manual/inc/class.help.inc.php
    trunk/manual/inc/class.odt2xhtml.inc.php
    trunk/manual/inc/class.uimanual.inc.php
    trunk/manual/setup/phpgw_sv.lang
    trunk/mediadb/setup/phpgw_sv.lang
    trunk/messenger/inc/class.somessenger_sql.inc.php
    trunk/messenger/inc/hook_config.inc.php
    trunk/messenger/setup/phpgw_sv.lang
    trunk/news_admin/setup/phpgw_sv.lang
    trunk/nntp/setup/phpgw_sv.lang
    trunk/notes/setup/phpgw_sv.lang
    trunk/notes/setup/setup.inc.php
    trunk/pbwebmaui/setup/phpgw_en.lang
    trunk/phonelog/setup/phpgw_sv.lang
    trunk/phpbrain/inc/class.uikb.inc.php
    trunk/phpbrain/setup/phpgw_sv.lang
    trunk/phpgroupware/about.php
    trunk/phpgroupware/home.php
    trunk/phpgroupware/index.php
    trunk/phpgroupware/login.php
    trunk/phpgroupware/logout.php
    trunk/phpgwapi/doc/index.html
    trunk/phpgwapi/doc/index.txt
    trunk/phpgwapi/inc/accounts/class.accounts_.inc.php
    trunk/phpgwapi/inc/accounts/class.accounts_SQLLDAP.inc.php
    trunk/phpgwapi/inc/accounts/class.accounts_ldap.inc.php
    trunk/phpgwapi/inc/accounts/class.accounts_sql.inc.php
    trunk/phpgwapi/inc/adodb/drivers/adodb-postgres64.inc.php
    trunk/phpgwapi/inc/class.Template.inc.php
    trunk/phpgwapi/inc/class.applications.inc.php
    trunk/phpgwapi/inc/class.asyncservice.inc.php
    trunk/phpgwapi/inc/class.calendar_holidays.inc.php
    trunk/phpgwapi/inc/class.categories.inc.php
    trunk/phpgwapi/inc/class.common.inc.php
    trunk/phpgwapi/inc/class.crypto.inc.php
    trunk/phpgwapi/inc/class.custom_fields.inc.php
    trunk/phpgwapi/inc/class.datetime.inc.php
    trunk/phpgwapi/inc/class.db.inc.php
    trunk/phpgwapi/inc/class.excelreader.inc.php
    trunk/phpgwapi/inc/class.gdbutton.inc.php
    trunk/phpgwapi/inc/class.gdimage.inc.php
    trunk/phpgwapi/inc/class.hooks.inc.php
    trunk/phpgwapi/inc/class.http_dav_client.inc.php
    trunk/phpgwapi/inc/class.ipc_.inc.php
    trunk/phpgwapi/inc/class.log.inc.php
    trunk/phpgwapi/inc/class.mime_magic.inc.php
    trunk/phpgwapi/inc/class.pdf.inc.php
    trunk/phpgwapi/inc/class.phpgw.inc.php
    trunk/phpgwapi/inc/class.preferences.inc.php
    trunk/phpgwapi/inc/class.sbox.inc.php
    trunk/phpgwapi/inc/class.schema_proc.inc.php
    trunk/phpgwapi/inc/class.schema_proc_mssql.inc.php
    trunk/phpgwapi/inc/class.schema_proc_mysql.inc.php
    trunk/phpgwapi/inc/class.schema_proc_oracle.inc.php
    trunk/phpgwapi/inc/class.schema_proc_pgsql.inc.php
    trunk/phpgwapi/inc/class.service.inc.php
    trunk/phpgwapi/inc/class.setup.inc.php
    trunk/phpgwapi/inc/class.setup_detection.inc.php
    trunk/phpgwapi/inc/class.setup_html.inc.php
    trunk/phpgwapi/inc/class.setup_process.inc.php
    trunk/phpgwapi/inc/class.setup_translation.inc.php
    trunk/phpgwapi/inc/class.sql.inc.php
    trunk/phpgwapi/inc/class.sql_builder.inc.php
    trunk/phpgwapi/inc/class.vfs_dav.inc.php
    trunk/phpgwapi/inc/class.vfs_shared.inc.php
    trunk/phpgwapi/inc/class.vfs_sql.inc.php
    trunk/phpgwapi/inc/class.xslttemplates.inc.php
    trunk/phpgwapi/inc/class.yui.inc.php
    trunk/phpgwapi/inc/common_functions.inc.php
    trunk/phpgwapi/inc/functions.inc.php
    trunk/phpgwapi/inc/phpmailer/test/phpunit.php
    trunk/phpgwapi/inc/sessions/class.sessions.inc.php
    trunk/phpgwapi/inc/sessions/class.sessions_db.inc.php
    trunk/phpgwapi/inc/sessions/class.sessions_php.inc.php
    trunk/phpgwapi/inc/sso/include_login.inc.php
    trunk/phpgwapi/js/core/base.js
    trunk/phpgwapi/js/yahoo/examples/datatable/assets/php/JSON.php
    trunk/phpgwapi/js/yahoo/examples/editor/assets/JSON.php
    trunk/phpgwapi/setup/default_records.inc.php
    trunk/phpgwapi/setup/phpgw_en.lang
    trunk/phpgwapi/setup/phpgw_sv.lang
    trunk/phpgwapi/setup/setup.inc.php
    trunk/phpgwapi/setup/tables_current.inc.php
    trunk/phpgwapi/setup/tables_update.inc.php
    trunk/phpgwapi/templates/base/images/down_nm.png
    trunk/phpgwapi/templates/base/images/stock_add.png
    trunk/phpgwapi/templates/base/images/stock_cancel.png
    trunk/phpgwapi/templates/base/images/stock_close.png
    trunk/phpgwapi/templates/base/images/stock_help.png
    trunk/phpgwapi/templates/base/images/stock_no.png
    trunk/phpgwapi/templates/base/images/stock_ok.png
    trunk/phpgwapi/templates/base/images/stock_remove.png
    trunk/phpgwapi/templates/base/images/stock_view-fields.png
    trunk/phpgwapi/templates/base/images/stock_yes.png
    trunk/phpgwapi/templates/base/login.tpl
    trunk/phpgwapi/templates/base/msgbox.xsl
    trunk/phpgwapi/templates/desktop/navbar.inc.php
    trunk/phpgwapi/templates/desktop/navbar.tpl
    trunk/phpgwapi/templates/idots/css/base.css
    trunk/phpgwapi/templates/idots/css/idots.css
    trunk/phpgwapi/templates/idots/head.inc.php
    trunk/phpgwapi/templates/idots/head.tpl
    trunk/phpgwapi/templates/idots/navbar.inc.php
    trunk/phpgwapi/templates/idots/navbar.tpl
    trunk/phpgwapi/templates/idsociety/css/base.css
    trunk/phpgwapi/templates/idsociety/head.inc.php
    trunk/phpgwapi/templates/idsociety/head.tpl
    trunk/phpgwapi/templates/idsociety/navbar.inc.php
    trunk/phpgwapi/templates/idsociety/navbar.tpl
    trunk/phpgwapi/templates/justweb/navbar.inc.php
    trunk/phpgwapi/templates/linux-at-work.de/navbar.inc.php
    trunk/phpgwapi/templates/probusiness/css/styles.css
    trunk/phpgwapi/templates/probusiness/footer.tpl
    trunk/phpgwapi/templates/probusiness/navbar.inc.php
    trunk/phpgwapi/templates/probusiness/navbar.tpl
    trunk/phpgwapi/templates/simple/css/simple.css
    trunk/phpgwapi/templates/simple/footer.tpl
    trunk/phpgwapi/templates/simple/head.inc.php
    trunk/phpgwapi/templates/simple/head.tpl
    trunk/phpgwapi/templates/simple/navbar.inc.php
    trunk/phpgwapi/templates/simple/navbar.tpl
    trunk/phpgwapi/templates/verdilak/navbar.inc.php
    trunk/phpsysinfo/setup/phpgw_sv.lang
    trunk/polls/setup/phpgw_sv.lang
    trunk/preferences/inc/hook_settings.inc.php
    trunk/preferences/index.php
    trunk/preferences/preferences.php
    trunk/preferences/setup/phpgw_sv.lang
    trunk/preferences/setup/setup.inc.php
    trunk/preferences/templates/base/index.tpl
    trunk/preferences/templates/base/preferences.tpl
    trunk/projects/inc/class.reportOOo.inc.php
    trunk/projects/inc/class.uistatistics.inc.php
    trunk/projects/setup/phpgw_de.lang
    trunk/projects/setup/phpgw_en.lang
    trunk/projects/setup/phpgw_sv.lang
    trunk/property/inc/class.boXport.inc.php
    trunk/property/inc/class.boactor.inc.php
    trunk/property/inc/class.boadmin.inc.php
    trunk/property/inc/class.boadmin_entity.inc.php
    trunk/property/inc/class.boadmin_location.inc.php
    trunk/property/inc/class.boagreement.inc.php
    trunk/property/inc/class.boalarm.inc.php
    trunk/property/inc/class.boasync.inc.php
    trunk/property/inc/class.bob_account.inc.php
    trunk/property/inc/class.bobudget.inc.php
    trunk/property/inc/class.bocategory.inc.php
    trunk/property/inc/class.bocommon.inc.php
    trunk/property/inc/class.bocustom.inc.php
    trunk/property/inc/class.bodocument.inc.php
    trunk/property/inc/class.boentity.inc.php
    trunk/property/inc/class.bogab.inc.php
    trunk/property/inc/class.boifc.inc.php
    trunk/property/inc/class.boinvestment.inc.php
    trunk/property/inc/class.boinvoice.inc.php
    trunk/property/inc/class.bolocation.inc.php
    trunk/property/inc/class.bolookup.inc.php
    trunk/property/inc/class.bop_of_town.inc.php
    trunk/property/inc/class.bopricebook.inc.php
    trunk/property/inc/class.boproject.inc.php
    trunk/property/inc/class.bor_agreement.inc.php
    trunk/property/inc/class.borequest.inc.php
    trunk/property/inc/class.bos_agreement.inc.php
    trunk/property/inc/class.bostandard_2.inc.php
    trunk/property/inc/class.bostandard_3.inc.php
    trunk/property/inc/class.botemplate.inc.php
    trunk/property/inc/class.botenant_claim.inc.php
    trunk/property/inc/class.botts.inc.php
    trunk/property/inc/class.bowo_hour.inc.php
    trunk/property/inc/class.boworkorder.inc.php
    trunk/property/inc/class.custom_functions.inc.php
    trunk/property/inc/class.db_mssql.inc.php
    trunk/property/inc/class.historylog.inc.php
    trunk/property/inc/class.import.inc.php
    trunk/property/inc/class.pdf.inc.php
    trunk/property/inc/class.soXport.inc.php
    trunk/property/inc/class.soactor.inc.php
    trunk/property/inc/class.soadmin.inc.php
    trunk/property/inc/class.soadmin_entity.inc.php
    trunk/property/inc/class.soadmin_location.inc.php
    trunk/property/inc/class.soagreement.inc.php
    trunk/property/inc/class.soalarm.inc.php
    trunk/property/inc/class.soasync.inc.php
    trunk/property/inc/class.sob_account.inc.php
    trunk/property/inc/class.sobudget.inc.php
    trunk/property/inc/class.socategory.inc.php
    trunk/property/inc/class.socommon.inc.php
    trunk/property/inc/class.socustom.inc.php
    trunk/property/inc/class.sodocument.inc.php
    trunk/property/inc/class.soentity.inc.php
    trunk/property/inc/class.sogab.inc.php
    trunk/property/inc/class.soinvestment.inc.php
    trunk/property/inc/class.soinvoice.inc.php
    trunk/property/inc/class.solocation.inc.php
    trunk/property/inc/class.solookup.inc.php
    trunk/property/inc/class.sop_of_town.inc.php
    trunk/property/inc/class.sopricebook.inc.php
    trunk/property/inc/class.soproject.inc.php
    trunk/property/inc/class.sor_agreement.inc.php
    trunk/property/inc/class.sorequest.inc.php
    trunk/property/inc/class.sos_agreement.inc.php
    trunk/property/inc/class.sostandard_2.inc.php
    trunk/property/inc/class.sostandard_3.inc.php
    trunk/property/inc/class.sotemplate.inc.php
    trunk/property/inc/class.sotenant_claim.inc.php
    trunk/property/inc/class.sotts.inc.php
    trunk/property/inc/class.sotts2.inc.php
    trunk/property/inc/class.sowo_hour.inc.php
    trunk/property/inc/class.soworkorder.inc.php
    trunk/property/inc/class.uiXport.inc.php
    trunk/property/inc/class.uiactor.inc.php
    trunk/property/inc/class.uiadmin.inc.php
    trunk/property/inc/class.uiadmin_entity.inc.php
    trunk/property/inc/class.uiadmin_location.inc.php
    trunk/property/inc/class.uiagreement.inc.php
    trunk/property/inc/class.uialarm.inc.php
    trunk/property/inc/class.uiasync.inc.php
    trunk/property/inc/class.uib_account.inc.php
    trunk/property/inc/class.uibudget.inc.php
    trunk/property/inc/class.uicategory.inc.php
    trunk/property/inc/class.uicustom.inc.php
    trunk/property/inc/class.uidocument.inc.php
    trunk/property/inc/class.uientity.inc.php
    trunk/property/inc/class.uigab.inc.php
    trunk/property/inc/class.uiifc.inc.php
    trunk/property/inc/class.uiinvestment.inc.php
    trunk/property/inc/class.uiinvoice.inc.php
    trunk/property/inc/class.uilocation.inc.php
    trunk/property/inc/class.uilookup.inc.php
    trunk/property/inc/class.uip_of_town.inc.php
    trunk/property/inc/class.uipricebook.inc.php
    trunk/property/inc/class.uiproject.inc.php
    trunk/property/inc/class.uir_agreement.inc.php
    trunk/property/inc/class.uirequest.inc.php
    trunk/property/inc/class.uis_agreement.inc.php
    trunk/property/inc/class.uistandard_2.inc.php
    trunk/property/inc/class.uistandard_3.inc.php
    trunk/property/inc/class.uitemplate.inc.php
    trunk/property/inc/class.uitenant_claim.inc.php
    trunk/property/inc/class.uitts.inc.php
    trunk/property/inc/class.uiwo_hour.inc.php
    trunk/property/inc/class.uiworkorder.inc.php
    trunk/property/inc/cron/export_info_as_files.php
    trunk/property/inc/cron/forward_mail_as_sms.php
    trunk/property/inc/cron/import_files.php
    trunk/property/inc/cron/import_from_scanner.php
    trunk/property/inc/cron/lag_lang_filer.php
    trunk/property/inc/cron/oppdater_antall_leieobjekt.php
    trunk/property/inc/cron/oppdater_namssakstatus_pr_leietaker.php
    trunk/property/inc/cron/oppdater_utgaatt_objekt.php
    trunk/property/inc/cron/organize_drawing.php
    trunk/property/inc/cron/synkroniser_med_boei.php
    trunk/property/inc/cron/update_googlemap.php
    trunk/property/inc/cron/update_phpgw.php
    trunk/property/inc/custom/hent_maaler_nr_til_besikt_rapport.php
    trunk/property/inc/export/Agresso
    trunk/property/inc/export/Ecolink
    trunk/property/inc/hook_admin.inc.php
    trunk/property/inc/hook_settings.inc.php
    trunk/property/inc/hook_sidebox_menu.inc.php
    trunk/property/login.php
    trunk/property/setup/default_records.inc.php
    trunk/property/setup/phpgw_en.lang
    trunk/property/setup/setup.inc.php
    trunk/property/setup/tables_current.inc.php
    trunk/property/setup/tables_update.inc.php
    trunk/property/templates/base/actor.xsl
    trunk/property/templates/base/admin_entity.xsl
    trunk/property/templates/base/admin_location.xsl
    trunk/property/templates/base/agreement.xsl
    trunk/property/templates/base/alarm.xsl
    trunk/property/templates/base/attributes_form.xsl
    trunk/property/templates/base/attributes_view.xsl
    trunk/property/templates/base/b_account.xsl
    trunk/property/templates/base/budget.xsl
    trunk/property/templates/base/css/base.css
    trunk/property/templates/base/custom.xsl
    trunk/property/templates/base/document.xsl
    trunk/property/templates/base/entity.xsl
    trunk/property/templates/base/gab.xsl
    trunk/property/templates/base/ifc.xsl
    trunk/property/templates/base/investment.xsl
    trunk/property/templates/base/invoice.xsl
    trunk/property/templates/base/location.xsl
    trunk/property/templates/base/no_access.xsl
    trunk/property/templates/base/p_of_town.xsl
    trunk/property/templates/base/pricebook.xsl
    trunk/property/templates/base/project.xsl
    trunk/property/templates/base/r_agreement.xsl
    trunk/property/templates/base/request.xsl
    trunk/property/templates/base/s_agreement.xsl
    trunk/property/templates/base/template.xsl
    trunk/property/templates/base/tenant_claim.xsl
    trunk/property/templates/base/tts.xsl
    trunk/property/templates/base/wo_hour.xsl
    trunk/property/templates/base/workorder.xsl
    trunk/registration/setup/phpgw_sv.lang
    trunk/setup/applications.php
    trunk/setup/config.php
    trunk/setup/inc/functions.inc.php
    trunk/setup/index.php
    trunk/setup/lang/phpgw_en.lang
    trunk/setup/lang.php
    trunk/setup/manageheader.php
    trunk/setup/schematoy.php
    trunk/setup/setup_demo.php
    trunk/setup/sqltoarray.php
    trunk/setup/templates/base/applications.tpl
    trunk/setup/templates/base/head.tpl
    trunk/setup/templates/base/setup_db_blocks.tpl
    trunk/sitemgr/inc/class.Content_BO.inc.php
    trunk/sitemgr/inc/class.Modules_BO.inc.php
    trunk/sitemgr/inc/class.Theme_BO.inc.php
    trunk/sitemgr/inc/class.module.inc.php
    trunk/sitemgr/modules/class.module_appdir.inc.php
    trunk/sitemgr/modules/class.module_bookmarks.inc.php
    trunk/sitemgr/modules/class.module_galerie.inc.php
    trunk/sitemgr/modules/class.module_xml.inc.php
    trunk/sitemgr/setup/default_records.inc.php
    trunk/sitemgr/setup/phpgw_en.lang
    trunk/sitemgr/setup/phpgw_sv.lang
    trunk/sitemgr/sitemgr-site/inc/class.Template3.inc.php
    trunk/sitemgr/sitemgr-site/inc/class.ui.inc.php
    trunk/sms/bin/config_BR
    trunk/sms/bin/config_ST
    trunk/sms/bin/receipt_service_agreement.php
    trunk/sms/inc/class.boautoreply.inc.php
    trunk/sms/inc/class.bocommand.inc.php
    trunk/sms/inc/class.bocommon.inc.php
    trunk/sms/inc/class.boconfig.inc.php
    trunk/sms/inc/class.bopoll.inc.php
    trunk/sms/inc/class.bosms.inc.php
    trunk/sms/inc/class.menu.inc.php
    trunk/sms/inc/class.sms.inc.php
    trunk/sms/inc/class.soautoreply.inc.php
    trunk/sms/inc/class.socommand.inc.php
    trunk/sms/inc/class.socommon.inc.php
    trunk/sms/inc/class.soconfig.inc.php
    trunk/sms/inc/class.sopoll.inc.php
    trunk/sms/inc/class.sosms.inc.php
    trunk/sms/inc/class.uiautoreply.inc.php
    trunk/sms/inc/class.uiboard.inc.php
    trunk/sms/inc/class.uicommand.inc.php
    trunk/sms/inc/class.uiconfig.inc.php
    trunk/sms/inc/class.uicustom.inc.php
    trunk/sms/inc/class.uipoll.inc.php
    trunk/sms/inc/class.uisms.inc.php
    trunk/sms/inc/feedcreator.class.php
    trunk/sms/inc/plugin/gateway/clickatell/fn.php
    trunk/sms/inc/plugin/gateway/gnokii/fn.php
    trunk/sms/inc/plugin/gateway/kannel/fn.php
    trunk/sms/inc/plugin/gateway/uplink/fn.php
    trunk/sms/init.php
    trunk/sms/setup/default_records.inc.php
    trunk/sms/setup/setup.inc.php
    trunk/sms/templates/base/menu.xsl
    trunk/soap/setup/phpgw_sv.lang
    trunk/stocks/setup/phpgw_sv.lang
    trunk/syncml/setup/phpgw_en.lang
    trunk/todo/inc/class.bopreferences.inc.php
    trunk/todo/setup/phpgw_sv.lang
    trunk/todo/setup/setup.inc.php
    trunk/tts/inc/class.uitts.inc.php
    trunk/tts/setup/phpgw_sv.lang
    trunk/wiki/setup/phpgw_sv.lang
    trunk/xmlrpc/setup/phpgw_en.lang
    trunk/xmlrpc/setup/phpgw_sv.lang

Added Paths:
-----------
    trunk/addressbook/inc/class.menu.inc.php
    trunk/admin/inc/class.menu.inc.php
    trunk/admin/templates/base/images/dot-grey.png
    trunk/admin/templates/base/images/share-grey.png
    trunk/admin/templates/base/images/share.png
    trunk/calendar/inc/class.menu.inc.php
    trunk/email/inc/class.service.inc.php
    trunk/felamimail/inc/class.menu.inc.php
    trunk/folders/inc/class.service.inc.php
    trunk/hrm/inc/hook_sidebox_menu.inc.php
    trunk/manual/templates/base/css/
    trunk/manual/templates/base/css/base.css
    trunk/manual/templates/base/help.tpl
    trunk/notes/inc/class.menu.inc.php
    trunk/phpgroupware/doc/tools/
    trunk/phpgroupware/doc/tools/remove_OIDs_from_postgresql.txt
    trunk/phpgwapi/doc/class.menu.txt
    trunk/phpgwapi/inc/class.jscal.inc.php
    trunk/phpgwapi/inc/class.menu.inc.php
    trunk/phpgwapi/inc/class.menu_apps.inc.php
    trunk/phpgwapi/inc/class.template_newdesign.inc.php
    trunk/phpgwapi/templates/base/images/source/
    trunk/phpgwapi/templates/base/images/source/README
    trunk/phpgwapi/templates/base/images/source/php-logo.svg
    trunk/phpgwapi/templates/idots/images/dot.png
    trunk/preferences/inc/class.menu.inc.php
    trunk/property/help/NO/location.edit.odt
    trunk/property/help/NO/location.index.odt
    trunk/property/help/NO/location.view.odt
    trunk/property/help/NO/tts.add.odt
    trunk/property/help/NO/tts.index.odt
    trunk/property/help/NO/tts.view.odt
    trunk/property/inc/custom/innflyttetdato_entity_2_11_BBB.php
    trunk/sms/inc/hook_sidebox_menu.inc.php
    trunk/todo/inc/class.menu.inc.php

Modified: trunk/addressbook/inc/class.boXport.inc.php
===================================================================
--- trunk/addressbook/inc/class.boXport.inc.php 2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/addressbook/inc/class.boXport.inc.php 2008-02-02 13:52:39 UTC (rev 
18466)
@@ -271,7 +271,7 @@
                                // Here, buffer becomes a string suitable for 
printing
                                $buffer = $contacts->export_end_file($buffer);
 
-                               $tsvfilename = 
$GLOBALS['phpgw_info']['server']['temp_dir'] . SEP . $tsvfilename;
+                               $tsvfilename = 
"{$GLOBALS['phpgw_info']['server']['temp_dir']}/{$tsvfilename}";
 
                        }
                        else // this is the openoffice section

Modified: trunk/addressbook/inc/class.boaddressbook.inc.php
===================================================================
--- trunk/addressbook/inc/class.boaddressbook.inc.php   2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/addressbook/inc/class.boaddressbook.inc.php   2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -736,7 +736,7 @@
                        else
                        {
                                $uploadedfile = 
$_FILES['uploadedfile']['tmp_name'];
-                               $uploaddir = 
$GLOBALS['phpgw_info']['server']['temp_dir'] . SEP;
+                               $uploaddir = 
$GLOBALS['phpgw_info']['server']['temp_dir'] . '/';
 
                                srand((double)microtime()*1000000);
                                $random_number = rand(100000000,999999999);

Added: trunk/addressbook/inc/class.menu.inc.php
===================================================================
--- trunk/addressbook/inc/class.menu.inc.php                            (rev 0)
+++ trunk/addressbook/inc/class.menu.inc.php    2008-02-02 13:52:39 UTC (rev 
18466)
@@ -0,0 +1,196 @@
+<?php
+       /**
+        * Addressbook - Menus
+        *
+        * @author Dave Hall <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 addressbook 
+        * @version $Id: class.menu.inc.php 690 2008-02-02 10:11:33Z dave $
+        */
+
+       /*
+          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/>.
+        */
+
+
+       /**
+        * Menus
+        *
+        * @package addressbook
+        */     
+       class addressbook_menu
+       {
+               /**
+                * Get the menus for the addressbook
+                *
+                * @return array available menus for the current user
+                */
+               function get_menu()
+               {
+                       $menus = array();
+                       $menus['navbar'] = array
+                       (
+                               'addressbook'   => array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('Contacts', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'addressbook.uiaddressbook.index', 'section' => 'Persons') ),
+                                       'image' => array('addressbook', 
'navbar'),
+                                       'order' => 2,
+                                       'group' => 'office'
+                               )
+                       );
+                       if ( 
isset($GLOBALS['phpgw_info']['user']['apps']['admin']) )
+                       {
+                               $menus['admin'] = array
+                               (
+                                       array
+                                       (
+                                               'text'  => 
$GLOBALS['phpgw']->translation->translate('Site Configuration', array(), true),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.uiconfig.index', 'appname' => 'addressbook') )
+                                       ),
+
+                                       array
+                                       (
+                                               'text'  => 
$GLOBALS['phpgw']->translation->translate('Edit custom fields', array(), true),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'addressbook.uifields.index') )
+                                       ),
+
+                                       array
+                                       (
+                                               'text'  => 
$GLOBALS['phpgw']->translation->translate('Global Categories', array(), true),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.uicategories.index', 'appname' => 'addressbook') )
+                                       ),
+
+                                       array
+                                       (
+                                               'text'  => 
$GLOBALS['phpgw']->translation->translate('Communication Types Manager', 
array(), true),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'addressbook.uicatalog_contact_comm_type.view') )
+                                       ),
+
+                                       array
+                                       (
+                                               'text'  => 
$GLOBALS['phpgw']->translation->translate('Communication Descriptions Manager', 
array(), true),
+                                               'url'   =>  
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'addressbook.uicatalog_contact_comm_descr.view') )
+                                       ),
+
+                                       array
+                                       (
+                                               'text'  => 
$GLOBALS['phpgw']->translation->translate('Location Manager', array(), true),
+                                               'url'   =>  
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'addressbook.uicatalog_contact_addr_type.view') )
+                                       ),
+
+                                       array
+                                       (
+                                               'text'  => 'Notes Types 
Manager',
+                                               'url'   =>  
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'addressbook.uicatalog_contact_note_type.view') )
+                                       )
+                               );
+                       }
+
+                       $menus['toolbar'] = array
+                       (
+                               array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('New Person', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'addressbook.uiaddressbook.add_person'))
+                               ),
+                               
+                               array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('New Organisation', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'addressbook.uiaddressbook.add_org'))
+                               )
+                       );
+
+                       $menus['navigation'] = array
+                       (
+                               array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('New Person', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'addressbook.uiaddressbook.add_person'))
+                               ),
+                               
+                               array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('New Organisation', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'addressbook.uiaddressbook.add_org'))
+                               ),
+
+                               array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('Import VCard', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'addressbook.uivcard.in'))
+                               ),
+
+                               array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('Categorise Persons', array(), true),
+                                       'url'   =>  
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'addressbook.uicategorize_contacts.index'))
+                               ),
+                               
+                               array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('Bulk Import - Contacts', array(), 
true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'addressbook.uiXport.import'))
+                               ),
+                               
+                               array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('Bulk Import - CSV', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/addressbook/csv_import.php')
+                               ),
+
+                               array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('Export Contacts', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'addressbook.uiXport.export'))
+                               )
+                       );
+
+                       if ( 
isset($GLOBALS['phpgw_info']['user']['apps']['preferences']) )
+                       {
+                               $menus['preferences'] = array
+                               (
+                                       array
+                                       (
+                                               'text'  => 
$GLOBALS['phpgw']->translation->translate('Preferences', array(), true),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction' => 
'addressbook.uiaddressbook_prefs.index'))
+                                       ),
+
+                                       array
+                                       (
+                                               'text'  => 
$GLOBALS['phpgw']->translation->translate('Grant Access', array(), true),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction' => 
'preferences.uiadmin_acl.aclprefs' , 'acl_app' => 'addressbook'))
+                                       ),
+                                       
+                                       array
+                                       (
+                                               'text'  => 
$GLOBALS['phpgw']->translation->translate('Edit Categories', array(), true),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'preferences.uicategories.index' , 'cats_app' => 'addressbook', 'cats_level' => 
true , 'global_cats' => true))
+                                       )
+                               );
+
+                               $menus['toolbar'][] = array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('Preferences', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction' => 
'addressbook.uiaddressbook_prefs.index'))
+                               );
+                       }
+
+                       $menus['folders'] = 
phpgwapi_menu::get_categories('addressbook');
+
+                       return $menus;
+               }
+       }

Modified: trunk/addressbook/inc/class.uiXport.inc.php
===================================================================
--- trunk/addressbook/inc/class.uiXport.inc.php 2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/addressbook/inc/class.uiXport.inc.php 2008-02-02 13:52:39 UTC (rev 
18466)
@@ -115,11 +115,11 @@
 
                                $this->template->set_file(array('import' => 
'import.tpl'));
 
-                               $dir_handle = opendir(PHPGW_APP_INC . SEP . 
'import');
+                               $dir_handle = opendir(PHPGW_APP_INC . 
'/import');
                                $i=0; $myfilearray = '';
                                while ($file = readdir($dir_handle))
                                {
-                                       if ((substr($file, 0, 1) != '.') && 
is_file(PHPGW_APP_INC . SEP . 'import' . SEP . $file) )
+                                       if ((substr($file, 0, 1) != '.') && 
is_file(PHPGW_APP_INC . "/import/{$file}") )
                                        {
                                                $myfilearray[$i] = $file;
                                                $i++;
@@ -232,11 +232,11 @@
                                
                                $this->template->set_file(array('export' => 
'export.tpl'));
 
-                               $dir_handle = opendir(PHPGW_APP_INC. SEP . 
'export');
+                               $dir_handle = opendir(PHPGW_APP_INC. '/export');
                                $i=0; $myfilearray = '';
                                while ($file = readdir($dir_handle))
                                {
-                                       if ((substr($file, 0, 1) != '.') && 
is_file(PHPGW_APP_INC . SEP . 'export' . SEP . $file) )
+                                       if ((substr($file, 0, 1) != '.') && 
is_file(PHPGW_APP_INC . "/export/{$file}") )
                                        {
                                                $myfilearray[$i] = $file;
                                                $i++;

Modified: trunk/addressbook/setup/phpgw_en.lang
===================================================================
--- trunk/addressbook/setup/phpgw_en.lang       2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/addressbook/setup/phpgw_en.lang       2008-02-02 13:52:39 UTC (rev 
18466)
@@ -50,7 +50,7 @@
 communications addressbook     en      Communications
 company        common  en      Company
 company name   common  en      Company Name
-contact        common  en      Contact
+contacts       common  en      Contacts
 contact application    admin   en      Contact application
 contact settings       admin   en      Contact Settings
 copied by %1, from record #%2. addressbook     en      Copied by %1, from 
record #%2.

Modified: trunk/addressbook/setup/phpgw_sv.lang
===================================================================
--- trunk/addressbook/setup/phpgw_sv.lang       2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/addressbook/setup/phpgw_sv.lang       2008-02-02 13:52:39 UTC (rev 
18466)
@@ -169,3 +169,4 @@
 you must select at least 1 column to display   addressbook     sv      Du 
m\xE5ste v\xE4lja minst 1 kolumn att visa
 your preferences       addressbook     sv      Dina inst\xE4llningar
 zip code       common  sv      Postnummer
+

Modified: trunk/addressbook/setup/setup.inc.php
===================================================================
--- trunk/addressbook/setup/setup.inc.php       2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/addressbook/setup/setup.inc.php       2008-02-02 13:52:39 UTC (rev 
18466)
@@ -31,7 +31,6 @@
        $setup_info['addressbook']['maintainer_email'] = 'address@hidden';
 
        /* The hooks this app includes, needed for hooks registration */
-       $setup_info['addressbook']['hooks'][] = 'admin';
        $setup_info['addressbook']['hooks'][] = 'add_def_pref';
        $setup_info['addressbook']['hooks'][] = 'config_validate';
        $setup_info['addressbook']['hooks'][] = 'home';
@@ -40,12 +39,12 @@
        $setup_info['addressbook']['hooks'][] = 'editaccount';
        $setup_info['addressbook']['hooks'][] = 'deleteaccount';
        $setup_info['addressbook']['hooks'][] = 'notifywindow';
-       $setup_info['addressbook']['hooks'][] = 'preferences';
-       $setup_info['addressbook']['hooks'][] = 'sidebox_menu';
+       $setup_info['addressbook']['hooks']['menu'] = 
'addressbook.menu.get_menu';
 
        /* Dependencies for this app to work */
-       $setup_info['addressbook']['depends'][] = array(
+       $setup_info['addressbook']['depends'][] = array
+       (
                 'appname' => 'phpgwapi',
-                'versions' => Array('0.9.16', '0.9.17', '0.9.18')
+                'versions' => Array('0.9.17', '0.9.18')
        );
 ?>

Modified: trunk/admin/inc/class.bo_custom.inc.php
===================================================================
--- trunk/admin/inc/class.bo_custom.inc.php     2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/admin/inc/class.bo_custom.inc.php     2008-02-02 13:52:39 UTC (rev 
18466)
@@ -68,7 +68,7 @@
                        $start          = phpgw::get_var('start', 'int');
                        $query          = phpgw::get_var('query');
                        $sort           = phpgw::get_var('sort');
-                       $order          = phpgw::get_var('order', 'string', 
'REQUEST', 'attrib_sort');
+                       $order          = phpgw::get_var('order');
                        $filter         = phpgw::get_var('filter');
                        $location       = phpgw::get_var('location');
                        $allrows        = phpgw::get_var('allrows', 'bool');
@@ -210,16 +210,21 @@
                function select_custom_function($selected='', $appname)
                {
                        $file_list = array();
-                       $dir_handle = @opendir(PHPGW_SERVER_ROOT . SEP . 
$appname . SEP . 'inc' . SEP . 'custom');
-                       $i=0; $myfilearray = '';
+                       $dir = PHPGW_SERVER_ROOT . "{$appname}/inc/custom";
+                       if ( !is_dir($dir) )
+                       {
+                               return $file_list;
+                       }
+
+                       $dir_handle = opendir($dir);
+                       $myfilearray = '';
                        if ($dir_handle)
                        {
                                while ($file = readdir($dir_handle))
                                {
-                                       if ((substr($file, 0, 1) != '.') && 
is_file(PHPGW_SERVER_ROOT . SEP . $appname . SEP . 'inc' . SEP . 'custom' . SEP 
. $file) )
+                                       if ((substr($file, 0, 1) != '.') && 
is_file("{$dir}/{$file}") )
                                        {
-                                               $myfilearray[$i] = $file;
-                                               $i++;
+                                               $myfilearray[] = $file;
                                        }
                                }
                                closedir($dir_handle);

Modified: trunk/admin/inc/class.boaccounts.inc.php
===================================================================
--- trunk/admin/inc/class.boaccounts.inc.php    2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/admin/inc/class.boaccounts.inc.php    2008-02-02 13:52:39 UTC (rev 
18466)
@@ -112,6 +112,7 @@
                        $new_group = CreateObject('phpgwapi.accounts', 
$values['account_id'], 'g');
                        $new_group->read_repository();
                        $new_group->firstname = $values['account_name'];
+                       $new_group->lastname = lang('group');
 
                        //TODO Move to transactions?
                        $GLOBALS['phpgw']->db->lock(array('phpgw_accounts',
@@ -125,7 +126,7 @@
                                                                                
          'phpgw_lang' // why lang? no idea, ask sigurd :)
                                                                                
         ));
 
-                       $id = $values['account_id'];
+                       $id = (int) $values['account_id'];
                        if ( $id == 0 ) // add new group?
                        {
                                $new_group_values = array
@@ -134,7 +135,7 @@
                                                                                
'account_lid'   => $values['account_name'],
                                                                                
'passwd'                => '',
                                                                                
'firstname'             => $values['account_name'],
-                                                                               
'lastname'              => lang('group'),
+                                       'lastname'              => 
$new_group->lastname ,
                                                                                
'status'                => 'A',
                                                                                
'expires'               => -1
                                                                        );
@@ -147,8 +148,10 @@
                        }
                        $GLOBALS['phpgw']->db->unlock();                        
                                                                                
                 
 
+                       $new_apps = array();
+
                        // get all new applications for this group
-                       $apps = CreateObject('phpgwapi.applications', 
$values['account_id']);
+                       $apps = CreateObject('phpgwapi.applications', $id);
                        $old_apps = array_keys($apps->read());   
                        foreach($values['account_apps'] as $key => $value)
                        {
@@ -157,11 +160,11 @@
                                        $new_apps[] = $key;
                                }
                        }
-                       $this->set_module_permissions($new_group->account_id, 
$values['account_apps']);
+                       $this->set_module_permissions($id, 
$values['account_apps']);
 
                        // members handling
                        // Add new members to group
-                       $acl = CreateObject('phpgwapi.acl', 
$values['account_id']);
+                       $acl = CreateObject('phpgwapi.acl', $id);
                        $old_group_list = $old_group->get_members();
                        for($i = 0; $i < count($values['account_user']); $i++)
                        {
@@ -177,7 +180,7 @@
                                }
                                if($is_new)
                                {
-                                       $acl->add_repository('phpgw_group', 
$new_group->account_id, $values['account_user'][$i],1);
+                                       $acl->add_repository('phpgw_group', 
$id, $values['account_user'][$i],1);
                                        
$this->refresh_session_data($values['account_user'][$i]);
                                        
                                        // The following sets any default 
preferences needed for new applications..
@@ -212,19 +215,19 @@
                        {
                                if($value)
                                {
-                                       
$acl->delete_repository('phpgw_group',$new_group->account_id, $value);
+                                       
$acl->delete_repository('phpgw_group',$id, $value);
                                        
$this->refresh_session_data($values['account_user'][$i]);
                                }
                        }
                        
                        //Add the group manager
-                       $acl->add_repository('phpgw_group', 
$new_group->account_id, $values['group_manager'], PHPGW_ACL_GROUP_MANAGERS | 1);
+                       $acl->add_repository('phpgw_group', $id, 
$values['group_manager'], PHPGW_ACL_GROUP_MANAGERS | 1);
 
                        // Things that have to change because of new group name
                        // FIXME this needs to be changed to work with all VFS 
backends
                        if($old_group->account_lid != $new_group->account_lid)
                        {
-                               $basedir = 
$GLOBALS['phpgw_info']['server']['files_dir'] . SEP . 'groups' . SEP;
+                               $basedir = 
"{$GLOBALS['phpgw_info']['server']['files_dir']}/groups/";
                                @rename($basedir . $old_group->account_lid, 
$basedir . $new_group->account_lid);
                        }                       
                        return $id;
@@ -488,7 +491,7 @@
 
                        
$GLOBALS['phpgw']->acl->delete_repository('%%','run',$account_id);
 
-                       
@rmdir($GLOBALS['phpgw_info']['server']['files_dir'].SEP.'groups'.SEP.$GLOBALS['phpgw']->accounts->id2name($account_id));
+                       
@rmdir("{$GLOBALS['phpgw_info']['server']['files_dir']}/groups/" . 
$GLOBALS['phpgw']->accounts->id2name($account_id));
 
                        $GLOBALS['phpgw']->accounts->delete($account_id);
                        $GLOBALS['phpgw']->db->unlock();
@@ -526,7 +529,7 @@
                        $GLOBALS['phpgw']->hooks->process('deleteaccount');
 
                        //<??[+_+]??
-                       $basedir = 
$GLOBALS['phpgw_info']['server']['files_dir'] . SEP . 'users' . SEP;
+                       $basedir = 
"{$GLOBALS['phpgw_info']['server']['files_dir']}/users/";
                        $lid = 
$GLOBALS['phpgw']->accounts->id2name($account_id);
                        if (! @rmdir($basedir . $lid))
                        {
@@ -636,14 +639,15 @@
                        if($id && is_array($modules) )
                        {
                                $apps = CreateObject('phpgwapi.applications', 
$id);
-                               $apps->data = array(); //remove all existing 
rights
+                               $data = array(); //remove all existing rights
                                foreach ( $modules as $app_name => $app_status 
) 
                                {
                                        if ( $app_status )
                                        {
-                                               $apps->add($app_name);
+                                               $data[] = $app_name;
                                        }
                                }
+                               $apps->update_data($data);
                                $apps->save_repository();
                        }
                }

Added: trunk/admin/inc/class.menu.inc.php
===================================================================
--- trunk/admin/inc/class.menu.inc.php                          (rev 0)
+++ trunk/admin/inc/class.menu.inc.php  2008-02-02 13:52:39 UTC (rev 18466)
@@ -0,0 +1,235 @@
+<?php
+       /**
+        * Admin - Menus
+        *
+        * @author Dave Hall <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 addressbook 
+        * @version $Id: class.menu.inc.php 690 2008-02-02 10:11:33Z dave $
+        */
+
+       /*
+          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/>.
+        */
+
+
+       /**
+        * Menus
+        *
+        * @package admin
+        */     
+       class admin_menu
+       {
+               /**
+                * Get the menus for admin
+                *
+                * @return array available menus for the current user
+                */
+               function get_menu()
+               {
+                       $menus = array();
+
+                       $menus['navbar'] = array
+                       (
+                               'admin' => array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('Administration', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'admin.uimainscreen.mainscreen') ),
+                                       'image' => array('admin', 'navbar'),
+                                       'order' => -5,
+                                       'group' => 'systools'
+                               )
+                       );
+
+                       $menus['admin'] = array();
+                       if (! 
$GLOBALS['phpgw']->acl->check('site_config_access', PHPGW_ACL_READ, 'admin'))
+                       {
+                               $menus['admin']['index'] = array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('Site Configuration', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.uiconfig.index', 'appname' => 'admin') )
+                               );
+                       }
+
+                       if (! $GLOBALS['phpgw']->acl->check('account_access', 
PHPGW_ACL_READ, 'admin'))
+                       {
+                               $menus['admin']['users'] = array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('User Accounts', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.uiaccounts.list_users') )
+                               );
+                       }
+
+                       if (! $GLOBALS['phpgw']->acl->check('group_access', 
PHPGW_ACL_READ, 'admin'))
+                       {
+                               $menus['admin']['groups'] = array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('User Groups', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.uiaccounts.list_groups') )
+                               );
+                       }
+
+                       if (! 
$GLOBALS['phpgw']->acl->check('applications_access', PHPGW_ACL_READ, 'admin'))
+                       {
+                               $menus['admin']['apps'] = array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('Applications', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.uiapplications.get_list') )
+                               );
+                       }
+
+                       if (! 
$GLOBALS['phpgw']->acl->check('global_categories_access', PHPGW_ACL_READ, 
'admin'))
+                       {
+                               $menus['admin']['categories'] = array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('Global Categories', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.uicategories.index') )
+                               );
+                       }
+
+                       if (! $GLOBALS['phpgw']->acl->check('account_access', 
PHPGW_ACL_READ, 'admin'))
+                       {
+                               $menus['admin']['addressmasters'] = array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('addressmasters', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.uiaclmanager.list_addressmasters', 'account_id' => 
$GLOBALS['phpgw_info']['user']['account_id']) )
+                               );
+                       }
+
+                       if (! 
$GLOBALS['phpgw']->acl->check('custom_fields_access', PHPGW_ACL_READ, 'admin'))
+                       {
+                               $menus['admin']['list_functions'] = array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('custom functions', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.ui_custom.list_custom_function', 'appname' => 'tts') )
+                               );
+                       }
+
+                       if 
(!$GLOBALS['phpgw']->acl->check('mainscreen_message_access', PHPGW_ACL_READ, 
'admin') || 
!$GLOBALS['phpgw']->acl->check('mainscreen_message_access',2,'admin'))
+                       {
+                               $menus['admin']['mainscreen'] = array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('Change Main Screen Message', 
array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.uimainscreen.index') )
+                               );
+                       }
+
+                       if (! 
$GLOBALS['phpgw']->acl->check('current_sessions_access', PHPGW_ACL_READ, 
'admin'))
+                       {
+                               $menus['admin']['sessions'] = array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('View Sessions', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.uicurrentsessions.list_sessions') )
+                               );
+                       }
+
+                       if (! 
$GLOBALS['phpgw']->acl->check('access_log_access', PHPGW_ACL_READ, 'admin'))
+                       {
+                               $menus['admin']['access_log'] = array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('View Access Log', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.uiaccess_history.list_history') )
+                               );
+                       }
+
+                       if (! $GLOBALS['phpgw']->acl->check('error_log_access', 
PHPGW_ACL_READ, 'admin'))
+                       {
+                               $menus['admin']['error_log'] = array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('View Error Log', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.uilog.list_log') )
+                               );
+                       }
+
+                       if (! $GLOBALS['phpgw']->acl->check('error_log_access', 
PHPGW_ACL_READ, 'admin'))
+                       {
+                               $menus['admin']['log_levels'] = array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('Edit Log Levels', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.uiloglevels.edit_log_levels') )
+                               );
+                       }
+
+                       if (! 
$GLOBALS['phpgw']->acl->check('applications_access', PHPGW_ACL_PRIVATE, 
'admin'))
+                       {
+                               $menus['admin']['hooks'] = array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('Find and Register all Application 
Hooks', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.uiapplications.register_all_hooks') )
+                               );
+                       }
+
+                       if (! 
$GLOBALS['phpgw']->acl->check('asyncservice_access', PHPGW_ACL_READ, 'admin'))
+                       {
+                               $menus['admin']['async'] = array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('Asynchronous timed services', 
array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.uiasyncservice.index') )
+                               );
+                       }
+
+                       if (! $GLOBALS['phpgw']->acl->check('info_access', 
PHPGW_ACL_READ, 'admin'))
+                       {
+                               $menus['admin']['phpinfo'] = array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('PHP Configuration', array(), true),
+                                       // degrade gracefully hack
+                                       'url'   => 
$GLOBALS['phpgw']->link('/admin/phpinfo.php') . '" onclick="window.open(\'' . 
$GLOBALS['phpgw']->link('/admin/phpinfo.php', array('noheader' => 1)) . '\'); 
return false;',
+                               );
+                       }
+
+
+                       if ( 
isset($GLOBALS['phpgw_info']['user']['apps']['preferences']) )
+                       {
+                               $menus['preferences'] = array();
+                       }
+
+                       $menus['toolbar'] = array();
+                       if ( $GLOBALS['phpgw']->acl->check('account_access', 
PHPGW_ACL_ADD, 'admin') || $GLOBALS['phpgw']->acl->check('account_access', 
PHPGW_ACL_PRIVATE, 'admin') )
+                       {
+                               $menus['toolbar'][] = array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('Add User', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.uiaccounts.edit_account', 'account_id' => 0) ),
+                                       'image' => array('admin', 'user')
+                               );
+                       }
+                       
+                       if ( $GLOBALS['phpgw']->acl->check('group_access', 
PHPGW_ACL_ADD, 'admin') || $GLOBALS['phpgw']->acl->check('group_access', 
PHPGW_ACL_PRIVATE, 'admin') )
+                       {
+                               $menus['toolbar'][] = array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('Add Group', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.uiaccounts.edit_group', 'account_id' => 0) ),
+                                       'image' => array('admin', 'group')
+                               );
+                       }
+
+                       if (! $GLOBALS['phpgw']->acl->check('info_access', 
PHPGW_ACL_READ, 'admin') )
+                       {
+                               $menus['toolbar'][] = array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('phpInfo', array(), true),
+                                       // degrade gracefully hack
+                                       'url'   => 
$GLOBALS['phpgw']->link('/admin/phpinfo.php') . '" onclick="window.open(\'' . 
$GLOBALS['phpgw']->link('/admin/phpinfo.php') . '\'); return false;"',
+                                       'image' => array('admin', 'php')
+                               );
+                       }
+
+                       //$menus['navigation'] = $menus['admin'];
+
+                       return $menus;
+               }
+       }

Modified: trunk/admin/inc/class.soaccounts.inc.php
===================================================================
--- trunk/admin/inc/class.soaccounts.inc.php    2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/admin/inc/class.soaccounts.inc.php    2008-02-02 13:52:39 UTC (rev 
18466)
@@ -78,7 +78,7 @@
                        }
 
                        $apps->account_type = 'u';
-                       $apps->account_id = $userData['account_id'];
+                       $apps->set_account_id($userData['account_id']);
                        $apps->account_apps = Array(Array());
 
 /* moved to bo

Modified: trunk/admin/inc/class.ui_custom.inc.php
===================================================================
--- trunk/admin/inc/class.ui_custom.inc.php     2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/admin/inc/class.ui_custom.inc.php     2008-02-02 13:52:39 UTC (rev 
18466)
@@ -16,7 +16,7 @@
         * @package property
         */
 
-       class ui_custom
+       class admin_ui_custom
        {
                var $grants;
                var $start;
@@ -35,7 +35,7 @@
                        'edit_custom_function'  => True
                );
 
-               function ui_custom()
+               public function __construct()
                {
                        $this->bo                                       = 
CreateObject('admin.bo_custom',True);
 
@@ -53,6 +53,8 @@
                        $this->account                          = 
$GLOBALS['phpgw_info']['user']['account_id'];
                        $this->bolocation                       = 
CreateObject('preferences.boadmin_acl');
                        $this->bolocation->acl_app      = $this->appname;
+
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
"admin::{$this->appname}";
                }
 
                function save_sessiondata()
@@ -78,6 +80,8 @@
                        $id                     = phpgw::get_var('id', 'int');
                        $resort         = phpgw::get_var('resort');
 
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] .= 
'::list_atrribs';
+
                        $GLOBALS['phpgw']->xslttpl->add_file(array(
                                                                'custom',
                                                                'nextmatchs',
@@ -422,7 +426,16 @@
                                'lang_location_statustext'                      
=> lang('Select submodule'),
                                'select_name_location'                          
=> 'values[location]',
 
-                               'location_list'                                 
        => 
$this->bolocation->select_location('select',(isset($values['location'])?$values['location']:''),False,True)
+                               'location_list'                                 
        => 
$this->bolocation->select_location('select',(isset($values['location'])?$values['location']:''),False,True),
+
+                               'value_disabled'                                
        => isset($values['disabled']) ? $values['disabled'] : '',
+                               'lang_disabled'                                 
        => lang('disabled'),
+                               'lang_disabled_statustext'                      
=> lang('This attribute turn up as disabled in the form'),
+
+                               'value_helpmsg'                                 
        => isset($values['helpmsg']) ? $values['helpmsg'] : '',
+                               'lang_helpmsg'                                  
        => lang('help message'),
+                               'lang_helpmsg_statustext'                       
=> lang('Enables help message for this attribute'),
+                               'value_location'                                
        => isset($values['location']) ? $values['location'] : ''
                        );
 //_debug_array($values);
 
@@ -434,6 +447,8 @@
 
                function list_custom_function()
                {
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] .= 
'::list_functions';
+
                        $appname        = $this->appname;
                        $location       = $this->location;
                        $id                     = phpgw::get_var('id', 'int');
@@ -574,6 +589,7 @@
 
                function edit_custom_function()
                {
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] .= 
'::list_functions';
                        $appname        = $this->appname;
                        $location       = $this->location;
                        $id                     = phpgw::get_var('id', 'int');

Modified: trunk/admin/inc/class.uiaccess_history.inc.php
===================================================================
--- trunk/admin/inc/class.uiaccess_history.inc.php      2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/admin/inc/class.uiaccess_history.inc.php      2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -38,24 +38,26 @@
                        $this->template->set_block('accesslog','row_empty');
                }
 
-               function list_history()
+               public function list_history()
                {
+                       $bo         = createobject('admin.boaccess_history');
+                       $nextmatches = createobject('phpgwapi.nextmatchs');
+
                        $account_id     = phpgw::get_var('account_id', 'int', 
'REQUEST');
                        $start          = phpgw::get_var('start', 'int', 
'POST', 0);
                        $sort           = phpgw::get_var('sort', 'int', 'POST', 
0);
                        $order          = phpgw::get_var('order', 'int', 
'POST', 0);
                        
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('Admin').' - '.lang('View access log');
-                       $GLOBALS['phpgw']->common->phpgw_header();
-                       echo parse_navbar();
+                       $GLOBALS['phpgw']->common->phpgw_header(true);
 
-                       $total_records = $this->bo->total($account_id);
+                       $total_records = $bo->total($account_id);
 
                        $var = array
                        (
-                               'nextmatchs_left'  => 
$this->nextmatchs->left('/index.php',$start,$total_records,'&menuaction=admin.uiaccess_history.list_history&account_id='
 . $account_id),
-                               'nextmatchs_right' => 
$this->nextmatchs->right('/index.php',$start,$total_records,'&menuaction=admin.uiaccess_history.list_history&account_id='
 . $account_id),
-                               'showing'          => 
$this->nextmatchs->show_hits($total_records,$start),
+                               'nextmatchs_left'  => 
$nextmatches->left('/index.php',$start,$total_records,'&menuaction=admin.uiaccess_history.list_history&account_id='
 . $account_id),
+                               'nextmatchs_right' => 
$nextmatches->right('/index.php',$start,$total_records,'&menuaction=admin.uiaccess_history.list_history&account_id='
 . $account_id),
+                               'showing'          => 
$nextmatches->show_hits($total_records,$start),
                                'lang_loginid'     => lang('LoginID'),
                                'lang_ip'     => lang('IP'),
                                'lang_login'  => lang('Login'),
@@ -80,12 +82,12 @@
 
                        $this->template->set_var($var);
 
-                       $records = $this->bo->list_history($account_id, $start, 
$order, $sort);
+                       $records = $bo->list_history($account_id, $start, 
$order, $sort);
                        if ( is_array($records) )
                        {
                                foreach ( $records as &$record )
                                {
-                                       
$this->nextmatchs->template_alternate_row_class($this->template);
+                                       
$nextmatches->template_alternate_row_class($this->template);
 
                                        $var = array
                                        (
@@ -102,12 +104,12 @@
 
                        if (! $total_records && $account_id)
                        {
-                               
$this->nextmatchs->template_alternate_row_class($this->template);
+                               
$nextmatches->template_alternate_row_class($this->template);
                                $this->template->set_var('row_message',lang('No 
login history exists for this user'));
                                $this->template->fp('rows_access','row_empty', 
true);
                        }
 
-                       $loggedout = $this->bo->return_logged_out($account_id);
+                       $loggedout = $bo->return_logged_out($account_id);
 
                        if ($total_records)
                        {

Modified: trunk/admin/inc/class.uiaccounts.inc.php
===================================================================
--- trunk/admin/inc/class.uiaccounts.inc.php    2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/admin/inc/class.uiaccounts.inc.php    2008-02-02 13:52:39 UTC (rev 
18466)
@@ -25,12 +25,13 @@
                        'group_manager' => True
                );
 
-               var $bo;
-               var $nextmatchs;
+               private $bo;
+               private $nextmatchs;
 
-               function uiaccounts()
+               public function __construct()
                {
                        $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
'admin::admin';
 
                        $this->bo = createObject('admin.boaccounts');
                        $this->nextmatchs =createObject('phpgwapi.nextmatchs');
@@ -48,6 +49,8 @@
 
                function list_groups()
                {
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] .= 
'::groups';
+                       
                        if ( phpgw::get_var('done', 'bool', 'POST') || 
$GLOBALS['phpgw']->acl->check('group_access', PHPGW_ACL_READ,'admin'))
                        {
                                $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'admin.uimainscreen.mainscreen'));
@@ -144,6 +147,8 @@
 
                function list_users($param_cd = '')
                {
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] .= 
'::users';
+
                        if ( phpgw::get_var('done', 'bool', 'POST') 
                                || 
$GLOBALS['phpgw']->acl->check('account_access',1,'admin') )
                        {
@@ -279,12 +284,16 @@
 
                function edit_group()
                {
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] .= 
'::groups';
+
                        $account_apps   = array();
                        $account_id             = phpgw::get_var('account_id', 
'int');
-                       $error_list             = '';
+                       $error_list             = array();
                        $values                 = phpgw::get_var('values', 
'string', 'POST', array());
 
-                       if ( (isset($values['cancel']) && $values['cancel']) || 
(!$account_id && $GLOBALS['phpgw']->acl->check('group_access',4,'admin')) || 
($account_id && $GLOBALS['phpgw']->acl->check('group_access',16,'admin')))
+                       if ( (isset($values['cancel']) && $values['cancel'])
+                               || !$account_id && 
$GLOBALS['phpgw']->acl->check('group_access', PHPGW_ACL_EDIT, 'admin')
+                               || $account_id && 
$GLOBALS['phpgw']->acl->check('group_access', PHPGW_ACL_PRIVATE, 'admin') )
                        {
                                $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'admin.uiaccounts.list_groups'));
                        }
@@ -298,10 +307,9 @@
                                
                                $error = $this->bo->validate_group($values);
 
-                               if (is_array($error))
+                               if ( is_array($error) )
                                {
-                                       $error_list = 
$GLOBALS['phpgw']->common->error_list($error);
-                                       echo 'FIXME errors are not displayed 
with idots :(<pre>' . print_r($error, true) . '</pre>';
+                                       $error_list = array('msgbox_text' => 
$GLOBALS['phpgw']->common->error_list($error));
                                }
                                else
                                {
@@ -347,13 +355,14 @@
                                $group_members = array();
                        }
 
-                       // this information should be provided by the app itself
+                       // this information should be provided by the app 
itself - thats why we have hooks
                        $apps_with_acl = array
                        (
                                'addressbook'   => array('top_grant' => true),
                                'bookmarks'             => array('top_grant' => 
true),
                                'calendar'              => array('top_grant' => 
true),
                                'filemanager'   => array('top_grant' => true),
+                               'hrm'                   => array('top_grant' => 
true),
                                'img'                   => array('top_grant' => 
true),
                                'infolog'               => array('top_grant' => 
true),
                                'inv'                   => array('top_grant' => 
true),
@@ -362,6 +371,8 @@
                                'phonelog'              => array('top_grant' => 
true),
                                'phpwebhosting' => array('top_grant' => true),
                                'projects'              => array('top_grant' => 
true),
+                               'property'              => array('top_grant' => 
true),
+                               'sms'                   => array('top_grant' => 
true),
                                'todo'                  => array('top_grant' => 
true),
                                'tts'                   => array('top_grant' => 
true),
                        );
@@ -384,7 +395,7 @@
                                                                                
                                                                                
  $entry['account_firstname'],
                                                                                
                                                                                
  $entry['account_lastname']
                                                                                
                                                                                
 ),
-                                       'selected'              => 
in_array(intval($entry['account_id']), $group_members) ? ' selected' : ''
+                                       'selected'              => 
in_array((int) $entry['account_id'], $group_members) ? ' selected' : ''
                                );
                                if ( in_array( (int)$entry['account_id'], 
$group_members) )
                                {
@@ -411,35 +422,44 @@
                        
                        $apps = array_keys($GLOBALS['phpgw_info']['apps']);
                        asort($apps);
+                       
+                       $img_acl = $GLOBALS['phpgw']->common->image('admin', 
'share', '.png', false);
+                       $img_acl_grey = 
$GLOBALS['phpgw']->common->image('admin', 'share-grey', '.png', false);
+                       $img_grants = $GLOBALS['phpgw']->common->image('admin', 
'dot', '.png', false);
+                       $img_grants_grey = 
$GLOBALS['phpgw']->common->image('admin', 'dot-grey', '.png', false);
+
                        foreach ( $apps as $app )
                        {
                                if 
($GLOBALS['phpgw_info']['apps'][$app]['enabled'] && 
$GLOBALS['phpgw_info']['apps'][$app]['status'] != 3)
                                {
+                                       $grants_enabled = 
isset($apps_with_acl[$app]) && $account_id;
                                        $app_list[] = array
                                        (
-                                               'acl_url'       => 
(isset($apps_with_acl[$app]) && $account_id) 
+                                               'elmid'                 => 
"admin_applist_$app",
+                                               'app_name'              => $app,
+                                               'app_title'             => 
lang($app),
+                                               'checkbox_name' => 
"account_apps[{$app}]",
+                                               'checked'       => 
isset($group_apps[$app]),
+                                               'acl_url'       => 
$grants_enabled
                                                                                
        ? $GLOBALS['phpgw']->link('/index.php',array('menuaction'       => 
'preferences.uiadmin_acl.list_acl',
                                                                                
                                                                                
                'acl_app'               => $app,
                                                                                
                                                                                
                'cat_id'=>'groups',
                                                                                
                                                                                
                'module'=>'.')) : '',
-                                               'acl_img'               => 
$GLOBALS['phpgw']->common->image('admin','dot', '.png', false),
-                                               'app_name'              => $app,
-                                               'app_title'             => 
lang($app),
-                                               'checkbox_name' => 
"account_apps[{$app}]",
-                                               'checked'       => 
isset($group_apps[$app]) ? 'checked' : '',
-                                               'grant_url'             => 
(isset($apps_with_acl[$app]) && $account_id) 
+                                               'acl_img'               => 
$grants_enabled ? $img_acl : $img_acl_grey,
+                                               'acl_img_name'  => lang('Set 
general permissions'),
+                                               'grant_img'             => 
$grants_enabled ? $img_grants : $img_grants_grey,
+                                               'grant_img_name'=> lang('Grant 
Access'),
+                                               'grant_url'             => 
$grants_enabled
                                                                                
        ? $GLOBALS['phpgw']->link('/index.php',array('menuaction'       => 
'preferences.uiadmin_acl.aclprefs',
                                                                                
                                                                                
                'acl_app'               => $app,
                                                                                
                                                                                
                'cat_id'=>'groups',
                                                                                
                                                                                
                'module'=>'.',
-                                                                               
                                                                                
                'granting_group'=>$account_id)) : '',
-                                               'grant_img_name'=> lang('Grant 
Access'),
-                                               'acl_img_name'      => 
lang('Set general permissions')
+                                                                               
                                                                                
                'granting_group'=>$account_id)) : ''
                                        );
                                }
                        }
                        
-                       $GLOBALS['phpgw']->xslttpl->add_file('msgbox', 
PHPGW_TEMPLATE_DIR);                     
+                       $GLOBALS['phpgw']->xslttpl->add_file('msgbox', 
PHPGW_TEMPLATE_DIR, 3); // no point in wasting loops
                        $GLOBALS['phpgw']->xslttpl->add_file('groups');
                        $GLOBALS['phpgw_info']['flags']['app_header'] =  
$account_id > 0 ? lang('edit group') : lang('add group');
                        $data = array
@@ -473,6 +493,8 @@
 
                function edit_user()
                {
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] .= 
'::users';
+
                        $cd                            = phpgw::get_var('cd', 
'int', 'GET');
                        $account_id                    = 
phpgw::get_var('account_id', 'int');
                        $values                        = 
phpgw::get_var('values', 'string', 'POST');
@@ -484,18 +506,20 @@
                        $values['account_expires_month']= 
phpgw::get_var('account_expires_month', 'string', 'POST'); // we use string 
here to allow for MMM
                        $values['account_expires_day'] = 
phpgw::get_var('account_expires_day', 'int', 'POST');
 
-                       if ( (isset($values['cancel']) && $values['cancel']) || 
(!$account_id && $GLOBALS['phpgw']->acl->check('account_access',4,'admin')) || 
($account_id && $GLOBALS['phpgw']->acl->check('account_access',16,'admin')))
+                       if ( (isset($values['cancel']) && $values['cancel']) 
+                               || !$account_id && 
$GLOBALS['phpgw']->acl->check('account_access', PHPGW_ACL_EDIT, 'admin') 
+                               || $account_id && 
$GLOBALS['phpgw']->acl->check('account_access', PHPGW_ACL_PRIVATE, 'admin') )
                        {
                                $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'admin.uiaccounts.list_users'));
                        }
-                       $error_list = '';
+                       $error_list = array();
                        if (isset($values['save']) && $values['save'])
                        {
                                $error = $this->bo->validate_user($values);
 
                                if (is_array($error))
                                {
-                                       $error_list = 
$GLOBALS['phpgw']->common->error_list($error);
+                                       $error_list = array('msgbox_text' => 
$GLOBALS['phpgw']->common->error_list($error));
                                }
                                else
                                {
@@ -519,6 +543,8 @@
                        //print_debug('Type : 
'.gettype($_userData).'<br>_userData(size) = 
"'.$_userData.'"('.strlen($_userData).')');
 
                        $GLOBALS['phpgw']->xslttpl->add_file('users');
+                       $GLOBALS['phpgw']->xslttpl->add_file('msgbox', 
PHPGW_TEMPLATE_DIR, 3); // no point in wasting loops
+
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('administration') . ': ' . ($account_id?lang('edit user 
account'):lang('add user account'));
 
                        $acl = createObject('phpgwapi.acl', $account_id);
@@ -575,7 +601,7 @@
                                $lang_homedir   = lang('home directory');
                                $lang_shell             = lang('login shell');
                                $homedirectory = '<input name="homedirectory" 
value="'
-                                       . 
($account_id?$userData['homedirectory']:$GLOBALS['phpgw_info']['server']['ldap_account_home'].SEP.$account_lid)
+                                       . ($account_id ? 
$userData['homedirectory'] : 
"{$GLOBALS['phpgw_info']['server']['ldap_account_home']}/{$account_lid}")
                                        . '">';
                                $loginshell = '<input name="loginshell" value="'
                                        . 
($account_id?$userData['loginshell']:$GLOBALS['phpgw_info']['server']['ldap_account_shell'])
@@ -695,7 +721,8 @@
                                (
                                        'app_title'             => 
$perm_display[$i]['translatedName'],
                                        'checkbox_name' => 
'account_permissions[' . $perm_display[$i]['appName'] . ']',
-                                       'checked'               => ( 
(isset($userData['account_permissions']) && 
$userData['account_permissions'][$perm_display[$i]['appName']]) || 
(isset($db_perms[$perm_display[$i]['appName']]) && 
$db_perms[$perm_display[$i]['appName']])? '1' : '0')
+                                       'checked'               => 
(isset($userData['account_permissions']) && 
$userData['account_permissions'][$perm_display[$i]['appName']]) 
+                                                                               
|| (isset($db_perms[$perm_display[$i]['appName']]) && 
$db_perms[$perm_display[$i]['appName']])
                                );
                        }
 
@@ -756,6 +783,8 @@
 
                function view_user()
                {
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] .= 
'::users';
+
                        $account_id = phpgw::get_var('account_id', 'int', 
'GET');
                        if ( $GLOBALS['phpgw']->acl->check('account_access', 8, 
'admin') || !$account_id )
                        {
@@ -847,6 +876,8 @@
 
                function delete_group()
                {
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] .= 
'::groups';
+
                        $account_id = phpgw::get_var('account_id', 'int');
 
                        if ( phpgw::get_var('cancel', 'bool', 'POST') || 
$GLOBALS['phpgw']->acl->check('group_access',32,'admin'))
@@ -854,7 +885,7 @@
                                $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'admin.uiaccounts.list_groups'));
                        }
 
-                       if ($account_id && phpgw::get_var('delete', 'bool', 
'POST') )
+                       if ($account_id && phpgw::get_var('confirm', 'bool', 
'POST') )
                        {
                                $this->bo->delete_group($account_id);
                                $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'admin.uiaccounts.list_groups'));
@@ -866,13 +897,15 @@
 
                        $data = array
                        (
-                               'delete_url'                            => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.uiaccounts.delete_group', 'account_id' => $account_id)),
-                               'lang_delete'                           => 
lang('delete'),
-                               'lang_cancel'                           => 
lang('cancel'),
+                               'delete_action'                         => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.uiaccounts.delete_group', 'account_id' => $account_id)),
+                               'lang_yes'                                      
=> lang('delete'),
+                               'lang_no'                                       
=> lang('cancel'),
                                'lang_delete_statustext'        => lang('delete 
the group'),
                                'lang_cancel_statustext'        => lang('Leave 
the group untouched and return back to the list'),
                                'lang_delete_msg'                       => 
lang('are you sure you want to delete this group ?')
                        );
+                       // avoid another call to phpgw::link
+                       $data['cancel_action'] = $data['delete_action'];
 
                        $old_group_list = 
$GLOBALS['phpgw']->acl->get_ids_for_location(intval($account_id),1,'phpgw_group');
 
@@ -901,6 +934,8 @@
 
                function delete_user()
                {
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] .= 
'::users';
+
                        if ( 
$GLOBALS['phpgw']->acl->check('account_access',32,'admin') 
                                || $GLOBALS['phpgw_info']['user']['account_id'] 
== phpgw::get_var('account_id', 'int', 'GET') )
                        {
@@ -965,6 +1000,8 @@
 
                function group_manager($cd='',$account_id='')
                {
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] .= 
'::users';
+
                        if 
($GLOBALS['phpgw']->acl->check('group_access',16,'admin'))
                        {
                                $this->list_groups();
@@ -998,6 +1035,8 @@
 
                function edit_group_managers($group_info,$_errors='')
                {
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] .= 
'::users';
+
                        if 
($GLOBALS['phpgw']->acl->check('group_access',16,'admin'))
                        {
                                $this->list_groups();

Modified: trunk/admin/inc/class.uiaclmanager.inc.php
===================================================================
--- trunk/admin/inc/class.uiaclmanager.inc.php  2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/admin/inc/class.uiaclmanager.inc.php  2008-02-02 13:52:39 UTC (rev 
18466)
@@ -28,7 +28,7 @@
                        'java_script'                   => true
                );
 
-               function uiaclmanager()
+               public function __construct()
                {
                        $this->account_id       = phpgw::get_var('account_id', 
'int', 'GET', $GLOBALS['phpgw_info']['user']['account_id']);
 
@@ -36,7 +36,7 @@
                        {
                                $GLOBALS['phpgw']->redirect_link('/index.php');
                        }
-                       $this->template         = 
createobject('phpgwapi.Template',PHPGW_APP_TPL);
+                       $this->template         =& $GLOBALS['phpgw']->template;
                        $this->nextmatchs       = 
CreateObject('phpgwapi.nextmatchs');
                        $this->boacl            = 
CreateObject('admin.boaclmanager');
                }
@@ -44,6 +44,7 @@
                function common_header()
                {
                        $GLOBALS['phpgw']->common->phpgw_header();
+                       $this->template->set_root(PHPGW_APP_TPL);
                }
 
                function list_apps()

Modified: trunk/admin/inc/class.uiapplications.inc.php
===================================================================
--- trunk/admin/inc/class.uiapplications.inc.php        2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/admin/inc/class.uiapplications.inc.php        2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -22,20 +22,20 @@
                        'register_all_hooks' => true
                );
 
-               var $bo;
-               var $nextmatchs;
+               private $bo;
+               private $nextmatchs;
 
-               function uiapplications()
+               public function __construct()
                {
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
'admin::admin';
                        $this->bo =& CreateObject('admin.boapplications');
                        $this->nextmatchs =& 
CreateObject('phpgwapi.nextmatchs');
-                       $GLOBALS['phpgw']->template->set_root(PHPGW_APP_TPL);
                }
 
                function get_list()
                {
-                       $GLOBALS['phpgw']->common->phpgw_header();
-                       echo parse_navbar();
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] .= 
'::apps';
+                       $GLOBALS['phpgw']->common->phpgw_header(true);
                        
                        $GLOBALS['phpgw']->template->set_root(PHPGW_APP_TPL);
                        
$GLOBALS['phpgw']->template->set_file(array('applications' => 
'applications.tpl'));
@@ -154,7 +154,7 @@
                        $GLOBALS['phpgw']->template->pparse('out','list');
                }
 
-               function display_row($label, $value)
+               private function display_row($label, $value)
                {
                        
$GLOBALS['phpgw']->template->set_var('tr_color',$this->nextmatchs->alternate_row_class());
                        $GLOBALS['phpgw']->template->set_var('label',$label);
@@ -162,8 +162,10 @@
                        $GLOBALS['phpgw']->template->parse('rows','row',True);
                }
 
-               function add()
+               public function add()
                {
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] .= 
'::apps';
+
                        
$GLOBALS['phpgw']->template->set_file(array('application' => 
'application_form.tpl'));
                        
$GLOBALS['phpgw']->template->set_block('application','form','form');
                        
$GLOBALS['phpgw']->template->set_block('application','row','row');
@@ -244,8 +246,10 @@
                        $GLOBALS['phpgw']->template->pparse('out','form');
                }
 
-               function edit()
+               public function edit()
                {
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] .= 
'::apps';
+
                        $app_name = phpgw::get_var('app_name', 'string', 'GET');
 
                        
$GLOBALS['phpgw']->template->set_file(array('application' => 
'application_form.tpl'));
@@ -324,8 +328,10 @@
                        $GLOBALS['phpgw']->template->pparse('out','form');
                }
 
-               function delete()
+               public function delete()
                {
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] .= 
'::apps';
+
                        $app_name = phpgw::get_var('app_name', 'string', 'GET');
 
                        if (!$app_name)
@@ -343,8 +349,7 @@
                                exit;
                        }
 
-                       $GLOBALS['phpgw']->common->phpgw_header();
-                       echo parse_navbar();
+                       $GLOBALS['phpgw']->common->phpgw_header(true);
 
                        
$GLOBALS['phpgw']->template->set_var('messages',lang('Are you sure you want to 
delete this application ?'));
                        $GLOBALS['phpgw']->template->set_var('no','<a href="' . 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>'admin.uiapplications.get_list'))
 . '">' . lang('No') . '</a>');
@@ -354,13 +359,21 @@
                
                function register_all_hooks()
                {
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] .= 
'::hooks';
                        if ( !isset($GLOBALS['phpgw']->hooks) && 
!is_object($GLOBALS['phpgw']->hooks) )
                        {
                                $GLOBALS['phpgw']->hooks = 
CreateObject('phpgwapi.hooks');
                        }
                        $GLOBALS['phpgw']->hooks->register_all_hooks();
                        
-                       $GLOBALS['phpgw']->redirect_link('/admin/index.php');
+                       $GLOBALS['phpgw']->common->phpgw_header(true);
+                       $updated = lang('hooks updated');
+                       $detail = lang('the new hooks should be available to 
all users');
+                       echo <<<HTML
+                               <h1>$updated</h1>
+                               <p>$detail</p>
+
+HTML;
                }
        }
 ?>

Modified: trunk/admin/inc/class.uiasyncservice.inc.php
===================================================================
--- trunk/admin/inc/class.uiasyncservice.inc.php        2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/admin/inc/class.uiasyncservice.inc.php        2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -115,7 +115,8 @@
                        $lr_date = $last_run['end'] ? 
$GLOBALS['phpgw']->common->show_date($last_run['end']) : lang('never');
                        echo '<p><b>'.lang('Async services last 
executed').'</b>: '.$lr_date.' ('.$last_run['run_by'].")</p>\n<hr>\n";
 
-                       if ( $asyncservice != 
$GLOBALS['phpgw_info']['server']['asyncservice'] )
+                       if ( 
!isset($GLOBALS['phpgw_info']['server']['asyncservice'])
+                               || $asyncservice != 
$GLOBALS['phpgw_info']['server']['asyncservice'] )
                        {
                                $config = 
CreateObject('phpgwapi.config','phpgwapi');
                                $config->read_repository();
@@ -177,7 +178,7 @@
                        echo ' <td colspan="8"><input type="checkbox" 
name="debug" value="1"' . ($debug ? ' checked' : '')."> \n".
                                lang('Enable 
debug-messages')."</td>\n</tr></table>\n";
 
-                       if ( $send ])
+                       if ( $send )
                        {
                                $next = $async->next_run($times,True);
 
@@ -211,7 +212,7 @@
                        
                }
                
-               function test($to)
+               private function test($to)
                {
                        if (!is_object($GLOBALS['phpgw']->send))
                        {

Modified: trunk/admin/inc/class.uicategories.inc.php
===================================================================
--- trunk/admin/inc/class.uicategories.inc.php  2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/admin/inc/class.uicategories.inc.php  2008-02-02 13:52:39 UTC (rev 
18466)
@@ -25,17 +25,20 @@
                var $cat_id;
                var $debug = False;
 
-               var $public_functions = array
+               public $public_functions = array
                (
                        'index'  => True,
                        'edit'   => True,
                        'delete' => True
                );
 
-               function uicategories()
+               public function __construct()
                {
                        $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
 
+                       $appname = phpgw::get_var('appname', 'string', 
'REQUEST', 'admin');
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
"admin::$appname::categories";
+
                        $this->bo                       = 
CreateObject('admin.bocategories');
                        $this->nextmatchs       = 
CreateObject('phpgwapi.nextmatchs');
 

Modified: trunk/admin/inc/class.uiconfig.inc.php
===================================================================
--- trunk/admin/inc/class.uiconfig.inc.php      2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/admin/inc/class.uiconfig.inc.php      2008-02-02 13:52:39 UTC (rev 
18466)
@@ -37,6 +37,7 @@
                        }
                                                
                        $appname = phpgw::get_var('appname', 'string', 'GET');
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
"admin::{$appname}::index";
 
                        $GLOBALS['phpgw_info']['apps']['manual']['app'] = 
$appname; // override the appname fetched from the referer for the manual.
 
@@ -258,4 +259,3 @@
                        $t->pfp('out','config');
                }
        }
-?>

Modified: trunk/admin/inc/class.uicurrentsessions.inc.php
===================================================================
--- trunk/admin/inc/class.uicurrentsessions.inc.php     2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/admin/inc/class.uicurrentsessions.inc.php     2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -90,20 +90,20 @@
 
                        $total = $this->bo->total();
 
-                       
$this->template->set_var('bg_color',(isset($GLOBALS['phpgw_info']['theme']['bg_color'])?$GLOBALS['phpgw_info']['theme']['bg_color']:''));
-                       
$this->template->set_var('left_next_matchs',$this->nextmatchs->left('/admin/currentusers.php',$info['start'],$total));
-                       
$this->template->set_var('right_next_matchs',$this->nextmatchs->right('/admin/currentusers.php',$info['start'],$total));
-                       
$this->template->set_var('th_bg',(isset($GLOBALS['phpgw_info']['theme']['th_bg'])?$GLOBALS['phpgw_info']['theme']['th_bg']:''));
+                       $nextmatchs = createobject('phpgwapi.nextmatchs');
 
-                       
$this->template->set_var('sort_loginid',$this->nextmatchs->show_sort_order($info['sort'],'session_lid',$info['order'],
+                       
$this->template->set_var('left_next_matchs',$nextmatchs->left('/admin/currentusers.php',$info['start'],$total));
+                       
$this->template->set_var('right_next_matchs',$nextmatchs->right('/admin/currentusers.php',$info['start'],$total));
+
+                       
$this->template->set_var('sort_loginid',$nextmatchs->show_sort_order($info['sort'],'session_lid',$info['order'],
                                '/admin/currentusers.php',lang('LoginID')));
-                       
$this->template->set_var('sort_ip',$this->nextmatchs->show_sort_order($info['sort'],'session_ip',$info['order'],
+                       
$this->template->set_var('sort_ip',$nextmatchs->show_sort_order($info['sort'],'session_ip',$info['order'],
                                '/admin/currentusers.php',lang('IP')));
-                       
$this->template->set_var('sort_login_time',$this->nextmatchs->show_sort_order($info['sort'],'session_logintime',$info['order'],
+                       
$this->template->set_var('sort_login_time',$nextmatchs->show_sort_order($info['sort'],'session_logintime',$info['order'],
                                '/admin/currentusers.php',lang('Login Time')));
-                       
$this->template->set_var('sort_action',$this->nextmatchs->show_sort_order($info['sort'],'session_action',$info['order'],
+                       
$this->template->set_var('sort_action',$nextmatchs->show_sort_order($info['sort'],'session_action',$info['order'],
                                '/admin/currentusers.php',lang('Action')));
-                       
$this->template->set_var('sort_idle',$this->nextmatchs->show_sort_order($info['sort'],'session_dla',$info['order'],
+                       
$this->template->set_var('sort_idle',$nextmatchs->show_sort_order($info['sort'],'session_dla',$info['order'],
                                '/admin/currentusers.php',lang('idle')));
                        $this->template->set_var('lang_kill',lang('Kill'));
 
@@ -111,7 +111,7 @@
 
                        while (list(,$value) = @each($values))
                        {
-                               
$this->nextmatchs->template_alternate_row_class($this->template);
+                               
$nextmatchs->template_alternate_row_class($this->template);
 
                                
$this->template->set_var('row_loginid',$value['session_lid']);
 
@@ -156,7 +156,7 @@
                        $this->template->pfp('out','list');
                }
 
-               function kill()
+               public function kill()
                {
                        if 
($GLOBALS['phpgw']->acl->check('current_sessions_access',8,'admin'))
                        {

Modified: trunk/admin/inc/class.uilog.inc.php
===================================================================
--- trunk/admin/inc/class.uilog.inc.php 2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/admin/inc/class.uilog.inc.php 2008-02-02 13:52:39 UTC (rev 18466)
@@ -61,16 +61,18 @@
                                $GLOBALS['phpgw_info']['flags']['app_header'] 
.= ' ' . lang('for') . ' ' . 
$GLOBALS['phpgw']->common->grab_owner_name($account_id);
                        }
                        
-                       $GLOBALS['phpgw']->common->phpgw_header();
-                       echo parse_navbar();
+                       $GLOBALS['phpgw']->common->phpgw_header(true);
 
-                       $total_records = $this->bo->total($account_id);
+                       $bo = createObject('admin.bolog');
+                       $nextmatches = createObject('phpgwapi.nextmatchs');
 
+                       $total_records = $bo->total($account_id);
+
                        $var = array
                        (
-                               'nextmatchs_left'  => 
$this->nextmatchs->left('/index.php',$start,$total_records,'&menuaction=admin.uilog.list_log&account_id='
 . $account_id),
-                               'nextmatchs_right' => 
$this->nextmatchs->right('/index.php',$start,$total_records,'&menuaction=admin.uilog.list_log&account_id='
 . $account_id),
-                               'showing'          => 
$this->nextmatchs->show_hits($total_records,$start),
+                               'nextmatchs_left'  => 
$nextmatches->left('/index.php',$start,$total_records,'&menuaction=admin.uilog.list_log&account_id='
 . $account_id),
+                               'nextmatchs_right' => 
$nextmatches->right('/index.php',$start,$total_records,'&menuaction=admin.uilog.list_log&account_id='
 . $account_id),
+                               'showing'          => 
$nextmatches->show_hits($total_records,$start),
                                'lang_loginid'     => lang('LoginID'),
                                'lang_date'        => lang('time'),
                                'lang_app'         => lang('module'),
@@ -83,7 +85,7 @@
 
                        $this->template->set_var($var);
 
-                       $records = 
$this->bo->list_log($account_id,$start,$order,$sort);
+                       $records = 
$bo->list_log($account_id,$start,$order,$sort);
                        if ( !is_array($records) || !count($records) )
                        {
                                $this->template->set_var(array
@@ -99,7 +101,7 @@
                                foreach ( $records as $record )
                                {
 
-                                       $tr_class = 
$this->nextmatchs->alternate_row_class($tr_class);
+                                       $tr_class = 
$nextmatches->alternate_row_class($tr_class);
                                        $this->template->set_var(array
                                        (
                                                'row_date'              => 
$record['log_date'],
@@ -159,13 +161,13 @@
                        $this->template->pfp('out','list');
                }
                
-               function purge_log()
+               public function purge_log()
                {
                        if 
($GLOBALS['phpgw']->acl->check('error_log_access',1,'admin'))
                        {
                                $GLOBALS['phpgw']->redirect_link('/index.php');
                        }
-                       $this->bo->purge_log( phpgw::get_var('account_id', 
'int') );
+                       execMethod('admin.bolog.purge_log', 
phpgw::get_var('account_id', 'int') );
                        $GLOBALS['phpgw']->redirect_link('index.php', 
array('menuaction', 'admin.uilog.list_log'));
                }
        }

Modified: trunk/admin/inc/class.uiloglevels.inc.php
===================================================================
--- trunk/admin/inc/class.uiloglevels.inc.php   2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/admin/inc/class.uiloglevels.inc.php   2008-02-02 13:52:39 UTC (rev 
18466)
@@ -27,20 +27,22 @@
                                $GLOBALS['phpgw']->redirect_link('/index.php');
                        }
 
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
'admin::admin::log_levels';
+
                        $this->template   = $GLOBALS['phpgw']->template;
-                       $this->template->set_file(
-                               Array(
+                       $this->template->set_file(array
+                       (
                                        'loglevels' => 'loglevels.tpl',
                                        'log_level_select' => 
'log_level_select.tpl'
-                               )
-                       );
+                       ));
+
                        // foo removes the module template.  I don't understand 
Templates enough to
                        // know why I needed it.  Trial and error.
                        $this->template->set_block('loglevels','module', 
'foo'); 
                        $this->template->set_block('loglevels','module_add', 
'foo'); 
                }
 
-               function edit_log_levels()
+               public function edit_log_levels()
                {
                        if 
($GLOBALS['phpgw']->acl->check('error_log_access',1,'admin'))
                        {
@@ -96,7 +98,7 @@
                }
                
                
-               function add_modules_list() 
+               private function add_modules_list() 
                {
                        $apps_with_logging = 
$GLOBALS['phpgw_info']['server']['log_levels']['module'];
                        $sorted_apps = array();
@@ -160,7 +162,7 @@
                        
                }
                
-               function add_users_list() 
+               private function add_users_list() 
                {
                        $add_options = '';
                        $tr_class = 'row_on';
@@ -215,7 +217,7 @@
                        }
                }               
                
-               function create_select_box($level_type, $level_key, 
$current_level)
+               private function create_select_box($level_type, $level_key, 
$current_level)
                {
                        $select_name = $level_type . '_' . $level_key . 
'_select';
 
@@ -252,7 +254,7 @@
                        return $this->template->fp('select', 
'log_level_select', True); 
                }
                
-               function update_level($level_type, $level_key, $new_level)
+               private function update_level($level_type, $level_key, 
$new_level)
                {
                        if ( $new_level )
                        {

Modified: trunk/admin/inc/class.uimainscreen.inc.php
===================================================================
--- trunk/admin/inc/class.uimainscreen.inc.php  2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/admin/inc/class.uimainscreen.inc.php  2008-02-02 13:52:39 UTC (rev 
18466)
@@ -19,42 +19,62 @@
                        'mainscreen'    => True
                );
 
-               function uimainscreen()
+               public function __construct()
                {
                        $menuaction = phpgw::get_var('menuaction', 'location');
-                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
$menuaction == 'admin.uimainscreen.mainscreen';
+                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = false; 
//$menuaction == 'admin.uimainscreen.mainscreen';
                        $GLOBALS['phpgw']->nextmatchs = 
CreateObject('phpgwapi.nextmatchs');
                }
 
-               function mainscreen()
+               public function mainscreen()
                {
-                       function display_section($appname,$file,$file2='')
+                       $menu = execMethod('phpgwapi.menu.get', 'admin');
+                       // this is any ugly hack cos the XSLT template engine 
sucks
+                       $html = '';
+                       foreach ( $menu as $module => $entries )
                        {
-                               
$GLOBALS['phpgw']->common->display_mainscreen($appname,$file2 ? $file2 : $file);
+                               $html .= <<<HTML
+                               <h2>$module</h2>
+                               <ul>
+
+HTML;
+                               $i = 0;
+                               foreach ( $entries as $entry )
+                               {
+                                       $row = $i % 2 ? 'on' : 'off';
+                                       $html .= <<<HTML
+                                       <li class="row_{$row}"><a 
href="{$entry['url']}">{$entry['text']}</a></li>
+HTML;
+                                       ++$i;
+                               }
+                               $html .= <<<HTML
+                               </ul>
+HTML;
                        }
-
-                       $GLOBALS['phpgw']->hooks->process('admin');
-                       $GLOBALS['phpgw']->xslttpl->set_var('phpgw', 
array('list' => $GLOBALS['phpgw']->common->output));
+                       $GLOBALS['phpgw']->common->phpgw_header(true);
+                       echo $html;
                }
 
-               function index()
+               public function index()
                {
                        if ( phpgw::get_var('cancel', 'bool', 'POST') )
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/admin/index.php');
+                               $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'admin.uimainscreen.mainscreen'));
                        }
 
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
'admin::admin::mainscreen';
+
                        $GLOBALS['phpgw']->template->set_file(array('message' 
=> 'mainscreen_message.tpl'));
                        
$GLOBALS['phpgw']->template->set_block('message','form','form');
                        
$GLOBALS['phpgw']->template->set_block('message','row','row');
                        
$GLOBALS['phpgw']->template->set_block('message','row_2','row_2');
 
                        $GLOBALS['phpgw']->common->phpgw_header(true);
+                       $select_lang = phpgw::get_var('select_lang', 'string', 
'POST');
+                       $section     = phpgw::get_var('section', 'string', 
'POST');
 
-                       if ( phpgw::get_var('submit', 'bool', 'POST') )
+                       if ( phpgw::get_var('update', 'bool', 'POST') )
                        {
-                               $section     = phpgw::get_var('section', 
'string', 'POST');
-                               $select_lang = phpgw::get_var('select_lang', 
'string', 'POST');
                                $message     = phpgw::get_var('message', 
'string', 'POST');
 
                                $GLOBALS['phpgw']->db->query("DELETE FROM 
phpgw_lang WHERE message_id='$section" . "_message' AND app_name='"
@@ -101,7 +121,7 @@
 
                                $tr_class = 
$GLOBALS['phpgw']->nextmatchs->alternate_row_class($tr_class);
                                
$GLOBALS['phpgw']->template->set_var('tr_class', $tr_class);
-                               
$GLOBALS['phpgw']->template->set_var('value','<input type="submit" value="' . 
lang('Submit')
+                               
$GLOBALS['phpgw']->template->set_var('value','<input type="submit" 
name="submit" value="' . lang('Submit')
                                        . '"><input type="submit" name="cancel" 
value="'. lang('cancel') .'">');
                                
$GLOBALS['phpgw']->template->fp('rows','row_2',True);
                        }
@@ -135,7 +155,7 @@
 
                                $tr_class = 
$GLOBALS['phpgw']->nextmatchs->alternate_row_class($tr_class);
                                
$GLOBALS['phpgw']->template->set_var('tr_class', $tr_class);
-                               
$GLOBALS['phpgw']->template->set_var('value','<input type="submit" 
name="submit" value="' . lang('Update')
+                               
$GLOBALS['phpgw']->template->set_var('value','<input type="submit" 
name="update" value="' . lang('Update')
                                        . '"><input type="submit" name="cancel" 
value="'. lang('cancel') .'">'
                                );
                                
$GLOBALS['phpgw']->template->fp('rows','row_2',True);

Modified: trunk/admin/setup/phpgw_sv.lang
===================================================================
--- trunk/admin/setup/phpgw_sv.lang     2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/admin/setup/phpgw_sv.lang     2008-02-02 13:52:39 UTC (rev 18466)
@@ -349,3 +349,4 @@
 you must enter an application title.   admin   sv      Du måste fylla i en 
rubrik för modulen
 you must select a file type    admin   sv      Du måste välja en filtyp
 you will need to remove the subcategories before you can delete this category  
admin   sv      Du måste ta bort underkategorin innan du kan radera denna 
kategori !
+

Modified: trunk/admin/setup/setup.inc.php
===================================================================
--- trunk/admin/setup/setup.inc.php     2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/admin/setup/setup.inc.php     2008-02-02 13:52:39 UTC (rev 18466)
@@ -40,14 +40,13 @@
        (
                'acl_manager',
                'add_def_pref',
-               'admin',
                'after_navbar',
                'config',
                'deleteaccount',
                'manual',
-               'sidebox_menu',
                'view_user'
        );
+       $setup_info['admin']['hooks']['menu'] = 'admin.menu.get_menu';
 
        /* Dependencies for this app to work */
        $setup_info['admin']['depends'][] = array

Modified: trunk/admin/templates/base/app_data.xsl
===================================================================
--- trunk/admin/templates/base/app_data.xsl     2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/admin/templates/base/app_data.xsl     2008-02-02 13:52:39 UTC (rev 
18466)
@@ -47,26 +47,6 @@
 <!-- BEGIN mainscreen -->
 
        <xsl:template match="list">
-               <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
-                       var phpinfo;
-
-                       function openwindow(url)
-                       {
-                               if (phpinfo)
-                               {
-                                       if (phpinfo.closed)
-                                       {
-                                               phpinfo.stop;
-                                               phpinfo.close;
-                                       }
-                               }
-                               phpinfo = window.open(url, 
"phpinfoWindow","width=700,height=600,location=no,menubar=no,directories=no,toolbar=no,scrollbars=yes,resizable=yes,status=no");
-                               if (phpinfo.opener == null)
-                               {
-                                       phpinfo.opener = window;
-                               }
-                       }
-               </SCRIPT>
                <div id="mainscreen">
                        <xsl:choose>
                                <xsl:when test="app_row_icon">
@@ -97,9 +77,6 @@
                <li>
                        <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>
@@ -108,7 +85,7 @@
                                        </xsl:otherwise>
                                </xsl:choose>
                        </xsl:attribute>
-                       <a href="{$pref_link}"><xsl:value-of 
select="pref_text"/></a>
+                       <a href="{$url}"><xsl:value-of select="text"/></a>
                </li>
        </xsl:template>
 

Modified: trunk/admin/templates/base/app_delete.xsl
===================================================================
--- trunk/admin/templates/base/app_delete.xsl   2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/admin/templates/base/app_delete.xsl   2008-02-02 13:52:39 UTC (rev 
18466)
@@ -11,29 +11,17 @@
                                </tr>
                                <tr>
                                        <td>
-                                               <xsl:variable 
name="delete_action"><xsl:value-of select="delete_action"/></xsl:variable>
-                                               <xsl:variable 
name="lang_yes"><xsl:value-of select="lang_yes"/></xsl:variable>
-                                               <form method="POST" 
action="{$delete_action}">
-                                                       <input type="submit" 
class="forms" name="confirm" value="{$lang_yes}" 
onMouseout="window.status='';return true;">
-                                                               <xsl:attribute 
name="onMouseover">
-                                                                       
<xsl:text>window.status='</xsl:text>
-                                                                               
<xsl:value-of select="lang_yes_statustext"/>
-                                                                       
<xsl:text>'; return true;</xsl:text>
-                                                               </xsl:attribute>
-                                                       </input>
+                                               <xsl:variable 
name="done_action"><xsl:value-of select="done_action"/></xsl:variable>
+                                               <xsl:variable 
name="lang_no"><xsl:value-of select="lang_no"/></xsl:variable>
+                                               <form method="post" 
action="{$done_action}">
+                                                       <input type="submit" 
class="forms" name="cancel" value="{$lang_no}" />
                                                </form>
                                        </td>
                                        <td align="right">
-                                               <xsl:variable 
name="done_action"><xsl:value-of select="done_action"/></xsl:variable>
-                                               <xsl:variable 
name="lang_no"><xsl:value-of select="lang_no"/></xsl:variable>
-                                               <form method="POST" 
action="{$done_action}">
-                                                       <input type="submit" 
class="forms" name="cancel" value="{$lang_no}" 
onMouseout="window.status='';return true;">
-                                                               <xsl:attribute 
name="onMouseover">
-                                                                       
<xsl:text>window.status='</xsl:text>
-                                                                               
<xsl:value-of select="lang_no_statustext"/>
-                                                                       
<xsl:text>'; return true;</xsl:text>
-                                                               </xsl:attribute>
-                                                       </input>
+                                               <xsl:variable 
name="delete_action"><xsl:value-of select="delete_action"/></xsl:variable>
+                                               <xsl:variable 
name="lang_yes"><xsl:value-of select="lang_yes"/></xsl:variable>
+                                               <form method="post" 
action="{$delete_action}">
+                                                       <input type="submit" 
class="forms" name="confirm" value="{$lang_yes}"/>
                                                </form>
                                        </td>
                                </tr>

Modified: trunk/admin/templates/base/currentusers.tpl
===================================================================
--- trunk/admin/templates/base/currentusers.tpl 2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/admin/templates/base/currentusers.tpl 2008-02-02 13:52:39 UTC (rev 
18466)
@@ -1,7 +1,7 @@
 <!-- BEGIN list -->
 <br>
 <table border="0" width="95%" align="center">
- <tr class="bg_color">
+ <tr>
    {left_next_matchs}
    <td>&nbsp;</td>
    <td>&nbsp;</td>

Modified: trunk/admin/templates/base/custom.xsl
===================================================================
--- trunk/admin/templates/base/custom.xsl       2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/admin/templates/base/custom.xsl       2008-02-02 13:52:39 UTC (rev 
18466)
@@ -208,7 +208,15 @@
                                        <xsl:value-of select="lang_location"/>
                                </td>
                                <td align="left">
+                                       <xsl:choose>
+                                               <xsl:when test="value_location 
!= ''">
+                                                       <xsl:value-of 
select="value_location"/>
+                                                       <input type="hidden" 
name="values[location]" value="{value_location}" />
+                                               </xsl:when>
+                                               <xsl:otherwise>
                                        <xsl:call-template 
name="select_location"/>
+                                               </xsl:otherwise>
+                                       </xsl:choose>
                                </td>
                        </tr>
                        <xsl:choose>
@@ -414,7 +422,50 @@
                                        </xsl:choose>
                                </td>
                        </tr>
+                       <tr>
+                               <td>
+                                       <xsl:value-of select="lang_disabled"/>
+                               </td>
+                               <td>
+                                       <xsl:choose>
+                                                       <xsl:when 
test="value_disabled = 1">
+                                                               <input 
type="checkbox" name="values[disabled]" value="1" checked="checked" 
onMouseout="window.status='';return true;">
+                                                                       
<xsl:attribute name="onMouseover">
+                                                                               
<xsl:text>window.status='</xsl:text>
+                                                                               
        <xsl:value-of select="lang_disabled_statustext"/>
+                                                                               
<xsl:text>'; return true;</xsl:text>
+                                                                       
</xsl:attribute>
+                                                               </input>
+                                                       </xsl:when>
+                                                       <xsl:otherwise>
+                                                               <input 
type="checkbox" name="values[disabled]" value="1" 
onMouseout="window.status='';return true;">
+                                                                       
<xsl:attribute name="onMouseover">
+                                                                               
<xsl:text>window.status='</xsl:text>
+                                                                               
        <xsl:value-of select="lang_disabled_statustext"/>
+                                                                               
<xsl:text>'; return true;</xsl:text>
+                                                                       
</xsl:attribute>
+                                                               </input>
+                                                       </xsl:otherwise>
+                                       </xsl:choose>
+                               </td>
+                       </tr>
        
+                       <tr>
+                               <td valign="top">
+                                       <xsl:value-of select="lang_helpmsg"/>
+                               </td>
+                               <td>
+                                       <textarea cols="60" rows="10" 
name="values[helpmsg]" wrap="virtual" onMouseout="window.status='';return 
true;">
+                                               <xsl:attribute 
name="onMouseover">
+                                                       
<xsl:text>window.status='</xsl:text>
+                                                               <xsl:value-of 
select="lang_helpmsg_statustext"/>
+                                                       <xsl:text>'; return 
true;</xsl:text>
+                                               </xsl:attribute>
+                                               <xsl:value-of 
select="value_helpmsg"/>          
+                                       </textarea>
+                               </td>
+                       </tr>
+       
                        <xsl:choose>
                                <xsl:when test="multiple_choice != ''">
                                        <tr>

Modified: trunk/admin/templates/base/groups.xsl
===================================================================
--- trunk/admin/templates/base/groups.xsl       2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/admin/templates/base/groups.xsl       2008-02-02 13:52:39 UTC (rev 
18466)
@@ -43,7 +43,7 @@
                <xsl:variable name="sort_name" select="sort_name"/>
                <xsl:variable name="lang_sort_statustext" 
select="lang_sort_statustext"/>
                <tr class="th">
-                       <td width="20%"><a href="{$sort_name}" 
onMouseover="window.status='{$lang_sort_statustext}';return true;" 
onMouseout="window.status='';return true;" class="th_text"><xsl:value-of 
select="lang_name"/></a></td>
+                       <td width="20%"><a href="{$sort_name}" 
class="th_text"><xsl:value-of select="lang_name"/></a></td>
                        <td width="8%" align="center"><xsl:value-of 
select="lang_edit"/></td>
                        <td width="8%" align="center"><xsl:value-of 
select="lang_delete"/></td>
                </tr>
@@ -52,8 +52,6 @@
 <!-- BEGIN group_data -->
 
        <xsl:template match="group_data">
-               <xsl:variable name="lang_edit_statustext"><xsl:value-of 
select="lang_edit_statustext"/></xsl:variable>
-               <xsl:variable name="lang_delete_statustext"><xsl:value-of 
select="lang_delete_statustext"/></xsl:variable>
                <tr>
                        <xsl:attribute name="class">
                                <xsl:choose>
@@ -71,11 +69,11 @@
                        <td><xsl:value-of select="group_name"/></td>
                        <td align="center">
                                <xsl:variable name="edit_url" 
select="edit_url"/>
-                               <a href="{$edit_url}" 
onMouseover="window.status='{$lang_edit_statustext}';return true;" 
onMouseout="window.status='';return true;" class="th_text"><xsl:value-of 
select="lang_edit"/></a>
+                               <a href="{$edit_url}" 
class="th_text"><xsl:value-of select="lang_edit"/></a>
                        </td>
                        <td align="center">
                                <xsl:variable name="delete_url" 
select="delete_url"/>
-                               <a href="{$delete_url}" 
onMouseover="window.status='{$lang_delete_statustext}';return true;" 
onMouseout="window.status='';return true;" class="th_text"><xsl:value-of 
select="lang_delete"/></a>
+                               <a href="{$delete_url}" 
class="th_text"><xsl:value-of select="lang_delete"/></a>
                        </td>
                </tr>
        </xsl:template>
@@ -90,25 +88,13 @@
                                        <xsl:choose>
                                                <xsl:when test="add_access = 
'yes'">
                                                <xsl:variable 
name="lang_add"><xsl:value-of select="lang_add"/></xsl:variable>
-                                                       <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_statustext"/>
-                                                                       
<xsl:text>'; return true;</xsl:text>
-                                                               </xsl:attribute>
-                                                       </input>
+                                                       <input type="submit" 
name="add" value="{$lang_add}" />
                                                </xsl:when>
                                        </xsl:choose>
                                </td>
                                <td align="right" valign="bottom" colspan="2">
                                <xsl:variable name="lang_done"><xsl:value-of 
select="lang_done"/></xsl:variable>
-                                       <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_statustext"/>
-                                                       <xsl:text>'; return 
true;</xsl:text>
-                                               </xsl:attribute>
-                                       </input>
+                                       <input type="submit" name="done" />
                                </td>
                        </form>
                        </tr>
@@ -119,11 +105,13 @@
 <!-- BEGIN group_edit -->
 
        <xsl:template match="group_edit">
+               <xsl:variable name="edit_url"><xsl:value-of 
select="edit_url"/></xsl:variable>
+               <form action="{$edit_url}" method="POST">
                <table border="0" cellpadding="2" cellspacing="2" 
align="center" width="79%">
                        <xsl:choose>
                                <xsl:when test="msgbox_data != ''">
                                        <tr>
-                                               <td 
align="center"><xsl:call-template name="msgbox"/></td>
+                                               <xsl:call-template 
name="msgbox"/>
                                        </tr>
                                </xsl:when>
                        </xsl:choose>
@@ -133,11 +121,8 @@
                                </td>
                                <td valign="top">
                                        <table border="0" width="100%">
-                                               <xsl:variable 
name="edit_url"><xsl:value-of select="edit_url"/></xsl:variable>
                                                <xsl:variable name="account_id" 
select="account_id"/>
                                                <xsl:variable 
name="select_size" select="select_size"/>
-                                               <form action="{$edit_url}" 
method="POST">
-                                               <input type="hidden" 
name="values[account_id]" value="{$account_id}"/>
                                                <tr>
                                                        <td><xsl:value-of 
select="lang_account_name"/></td>
                                                        <td><input 
name="values[account_name]">
@@ -145,6 +130,7 @@
                                                                        
<xsl:value-of select="value_account_name"/>
                                                                </xsl:attribute>
                                                                </input>
+                                                               <input 
type="hidden" name="values[account_id]" value="{$account_id}"/>
                                                        </td>
                                                </tr>
                                                <tr>
@@ -163,41 +149,40 @@
                                                                </select>
                                                        </td>
                                                </tr>
+                                               <!--
                                                <tr>
                                                        <td><xsl:value-of 
select="lang_file_space"/></td>
                                                        <td>
-<!-- {account_file_space}{account_file_space_select} -->
+ {account_file_space}{account_file_space_select}
                                                        </td>
                                                </tr>
+                                               -->
                                                <tr>
-                                                       <td 
valign="top"><xsl:value-of select="lang_permissions"/></td>
-                                                       <td>
-                                                               <table 
width="100%" border="0" cellpadding="2" cellspacing="2">
-                                                                       <tr 
class="th">
-                                                                               
<td><xsl:value-of select="lang_application"/></td>
-                                                                               
<td>&nbsp;</td>
-                                                                               
<td><xsl:value-of select="lang_acl"/></td>
-                                                                               
<td><xsl:value-of select="lang_grant"/></td>
-                                                                       </tr>
-                                                                               
<xsl:apply-templates select="app_list"/>
-                                                               </table>
+                                                       <td colspan="4">
+                                                               
<h2><xsl:value-of select="lang_permissions" /></h2>
+                                                               <ul>
+                                                                       <!--
+                                                                       <li>
+                                                                               
<xsl:value-of select="lang_acl"/>
+                                                                               
<xsl:value-of select="lang_grant"/>
+                                                                               
<xsl:value-of select="lang_application"/>
+                                                                       </li>
+                                                                       -->
+                                                                       
<xsl:apply-templates select="app_list" />
+                                                               </ul>
                                                        </td>
                                                </tr>
-                                               <tr>
-                                                       <td>
+                                       </table>
+                                       <div class="button_group">
                                                        <xsl:variable 
name="lang_save"><xsl:value-of select="lang_save"/></xsl:variable>
                                                                <input 
type="submit" name="values[save]" value="{$lang_save}"/>
-                                                       </td>
-                                                       <td align="right">
                                                                <xsl:variable 
name="lang_cancel"><xsl:value-of select="lang_cancel"/></xsl:variable>
                                                                <input 
type="submit" name="values[cancel]" value="{$lang_cancel}"/>
-                                                       </td>
-                                               </tr>
-                                               </form>
-                                       </table>
+                                       </div>
                                </td>
                        </tr>
                </table>
+               </form>
        </xsl:template>
 
        <xsl:template match="group_manager">
@@ -213,6 +198,7 @@
        </xsl:template>
 
        <xsl:template match="guser_list">
+
                <xsl:variable name="account_id" select="account_id"/>
                <xsl:choose>
                        <xsl:when test="selected != ''">
@@ -222,16 +208,15 @@
                                <option value="{$account_id}"><xsl:value-of 
select="account_name"/></option>
                        </xsl:otherwise>
                </xsl:choose>
+
        </xsl:template>
 
        <xsl:template match="app_list">
-               <xsl:variable name="checkbox_name" select="checkbox_name"/>
-               <tr>
+               <xsl:variable name="checkbox_name" select="checkbox_name" />
+               <xsl:variable name="elmid" select="elmid" />
+               <li>
                        <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>
@@ -240,36 +225,45 @@
                                        </xsl:otherwise>
                                </xsl:choose>
                        </xsl:attribute>
-                       <td width="40%"><xsl:value-of select="app_name"/></td>
-                       <td width="5%" align="center">
+
                                <xsl:choose>
-                                       <xsl:when test="checked != ''">
-                                               <input type="checkbox" 
name="{$checkbox_name}" value="True" checked="checked"/>
-                                       </xsl:when>
-                                       <xsl:otherwise>
-                                               <input type="checkbox" 
name="{$checkbox_name}" value="True"/>
-                                       </xsl:otherwise>
-                               </xsl:choose>
-                       </td>
-                       <td width="5%" align="center">
-                               <xsl:choose>
                                        <xsl:when test="acl_url != ''">
                                                <xsl:variable name="acl_url" 
select="acl_url"/>
                                                <xsl:variable name="acl_img" 
select="acl_img"/>
                                                <xsl:variable 
name="acl_img_name" select="acl_img_name"/>
-                                               <a href="{$acl_url}"><img 
src="{$acl_img}" border="0" hspace="3" align="absmiddle" alt="{$acl_img_name}" 
name="{$acl_img_name}"/></a>
+                                       <a href="{$acl_url}"><img 
src="{$acl_img}" title="{$acl_img_name}" alt="{$acl_img_name}" /></a>
                                        </xsl:when>
+                               <xsl:otherwise>
+                                       <xsl:variable name="acl_img" 
select="acl_img"/>
+                                       <xsl:variable name="acl_img_name" 
select="acl_img_name"/>
+                                       <img src="{$acl_img}" 
title="{$acl_img_name}" alt="{$acl_img_name}" />
+                               </xsl:otherwise>
                                </xsl:choose>
-                       </td>
-                       <td width="5%" align="center">
+                       <xsl:text> </xsl:text>
                                <xsl:choose>
                                        <xsl:when test="grant_url != ''">
                                                <xsl:variable name="grant_url" 
select="grant_url"/>
-                                               <xsl:variable name="acl_img" 
select="acl_img"/>
+                                       <xsl:variable name="grant_img" 
select="grant_img"/>
                                                <xsl:variable 
name="grant_img_name" select="grant_img_name"/>
-                                               <a href="{$grant_url}"><img 
src="{$acl_img}" border="0" hspace="3" align="absmiddle" 
alt="{$grant_img_name}" name="{$grant_img_name}"/></a>
+                                       <a href="{$grant_url}"><img 
src="{$grant_img}" title="{$grant_img_name}" alt="{$grant_img_name}" /></a>
                                        </xsl:when>
+                               <xsl:otherwise>
+                                       <xsl:variable name="grant_img" 
select="grant_img"/>
+                                       <xsl:variable name="grant_img_name" 
select="grant_img_name"/>
+                                       <img src="{$grant_img}" 
title="{$grant_img_name}" alt="{$grant_img_name}" />
+                               </xsl:otherwise>
                                </xsl:choose>
-                       </td>
-               </tr>
+
+                       <input type="checkbox" id="{$elmid}" 
name="{$checkbox_name}" value="1">
+                               <xsl:if test="checked = '1'">
+                                       <xsl:attribute name="checked">
+                                               <xsl:text>checked</xsl:text>
+                                       </xsl:attribute>
+                               </xsl:if>
+                       </input>
+                       <label for="{$elmid}">
+                               <xsl:value-of select="app_title" />
+                       </label>
+               </li>
        </xsl:template>
+

Added: trunk/admin/templates/base/images/dot-grey.png
===================================================================
(Binary files differ)


Property changes on: trunk/admin/templates/base/images/dot-grey.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/admin/templates/base/images/share-grey.png
===================================================================
(Binary files differ)


Property changes on: trunk/admin/templates/base/images/share-grey.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/admin/templates/base/images/share.png
===================================================================
(Binary files differ)


Property changes on: trunk/admin/templates/base/images/share.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: trunk/admin/templates/base/users.xsl
===================================================================
--- trunk/admin/templates/base/users.xsl        2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/admin/templates/base/users.xsl        2008-02-02 13:52:39 UTC (rev 
18466)
@@ -292,26 +292,19 @@
                                                </tr>
                                                <tr>
                                                        <td colspan="4">
-                                                               <table 
width="100%" border="0" cellpadding="2" cellspacing="2">
-                                                                       <tr 
class="th">
-                                                                               
<td><xsl:value-of select="lang_applications"/></td>
-                                                                               
<td></td>
-                                                                       </tr>
-                                                                               
<xsl:apply-templates select="app_list"/>
-                                                               </table>
+                                                               
<h2><xsl:value-of select="lang_applications" /></h2>
+                                                               <ul>
+                                                                       
<xsl:apply-templates select="app_list" />
+                                                               </ul>
                                                        </td>
                                                </tr>
-                                               <tr height="50" valign="bottom">
-                                                       <td colspan="3">
+                                       </table>
+                                       <div class="button_group">
                                                        <xsl:variable 
name="lang_save"><xsl:value-of select="lang_save"/></xsl:variable>
                                                                <input 
type="submit" name="values[save]" value="{$lang_save}"/>
-                                                       </td>
-                                                       <td colspan="3" 
align="right">
                                                                <xsl:variable 
name="lang_cancel"><xsl:value-of select="lang_cancel"/></xsl:variable>
                                                                <input 
type="submit" name="values[cancel]" value="{$lang_cancel}"/>
-                                                       </td>
-                                               </tr>
-                                       </table>
+                                       </div>
                                </form>
                                </td>
                        </tr>
@@ -335,13 +328,10 @@
 <!-- BEGIN app_list -->
 
        <xsl:template match="app_list">
-               <xsl:variable name="checkbox_name" select="checkbox_name"/>
-               <tr>
+               <xsl:variable name="checkbox_name" select="checkbox_name" />
+               <li>
                        <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>
@@ -350,18 +340,18 @@
                                        </xsl:otherwise>
                                </xsl:choose>
                        </xsl:attribute>
-                       <td width="40%"><xsl:value-of select="app_title"/></td>
-                       <td width="5%" align="center">
                                <xsl:choose>
                                        <xsl:when test="checked = '1'">
-                                               <input type="checkbox" 
name="{$checkbox_name}" value="1" checked="checked" />
+                                       <input type="checkbox" 
id="{$checkbox_name}" name="{$checkbox_name}" value="1" checked="checked" />
                                        </xsl:when>
                                        <xsl:otherwise>
-                                               <input type="checkbox" 
name="{$checkbox_name}" value="1" />
+                                       <input type="checkbox" 
id="{$checkbox_name}" name="{$checkbox_name}" value="1" />
                                        </xsl:otherwise>
                                </xsl:choose>
-                       </td>
-               </tr>
+                       <label for="{$checkbox_name}">
+                               <xsl:value-of select="app_title" />
+                       </label>
+               </li>
        </xsl:template>
 
        <xsl:template match="permissions">

Modified: trunk/bookmarks/setup/phpgw_sv.lang
===================================================================
--- trunk/bookmarks/setup/phpgw_sv.lang 2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/bookmarks/setup/phpgw_sv.lang 2008-02-02 13:52:39 UTC (rev 18466)
@@ -64,3 +64,4 @@
 warning        bookmarks       sv      Varning
 you are viewing this site outside of phpgroupware      bookmarks       sv      
Du \xE4r nu p\xE5 en sida utanf\xF6r phpGroupWare
 you must select a category     bookmarks       sv      Du m\xE5ste v\xE4lja en 
kategori
+

Modified: trunk/calendar/help/JA/add.php
===================================================================
(Binary files differ)

Modified: trunk/calendar/help/JA/calendar.php
===================================================================
(Binary files differ)

Modified: trunk/calendar/help/JA/edit_delete.php
===================================================================
(Binary files differ)

Modified: trunk/calendar/help/JA/view.php
===================================================================
(Binary files differ)

Modified: trunk/calendar/inc/class.bocalendar.inc.php
===================================================================
--- trunk/calendar/inc/class.bocalendar.inc.php 2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/calendar/inc/class.bocalendar.inc.php 2008-02-02 13:52:39 UTC (rev 
18466)
@@ -137,6 +137,7 @@
                var $num_months;
 
                var $save_owner;
+               var $return_to;
 
                public function __construct($session = false)
                {
@@ -504,6 +505,11 @@
                {
                        $data = 
$GLOBALS['phpgw']->session->appsession('session_data','calendar');
                        print_debug('Read',_debug_array($data,False));
+                       // no data is returned as an empty string
+                       if ( !$data )
+                       {
+                               return;
+                       }
 
                        $this->filter = $data['filter'];
                        $this->cat_id = $data['cat_id'];

Modified: trunk/calendar/inc/class.boicalendar.inc.php
===================================================================
--- trunk/calendar/inc/class.boicalendar.inc.php        2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/calendar/inc/class.boicalendar.inc.php        2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -3293,7 +3293,7 @@
                              );
                        $GLOBALS['phpgw']->common->phpgw_exit();
                }
-               $uploaddir = $GLOBALS['phpgw_info']['server']['temp_dir'] . SEP;
+               $uploaddir = "{$GLOBALS['phpgw_info']['server']['temp_dir']}/";
 
                srand((double)microtime()*1000000);
                $random_number = rand(100000000,999999999);
@@ -3385,7 +3385,7 @@
                // time limit should be controlled elsewhere
                @set_time_limit(0);
 
-               $gmt_offset = date('O', phpgw_datetime::user_localtime() );  // 
offset to GMT
+               $gmt_offset = date('O', phpgwapi_datetime::user_localtime() );  
// offset to GMT
                $offset_mins = intval(substr($gmt_offset, 1, 2)) * 60 + 
intval(substr($gmt_offset, 3, 2));
 
                $users_email = ExecMethod('phpgwapi.contacts.get_email', 
$GLOBALS['phpgw_info']['user']['person_id']);

Added: trunk/calendar/inc/class.menu.inc.php
===================================================================
--- trunk/calendar/inc/class.menu.inc.php                               (rev 0)
+++ trunk/calendar/inc/class.menu.inc.php       2008-02-02 13:52:39 UTC (rev 
18466)
@@ -0,0 +1,232 @@
+<?php
+       /**
+        * Calendar - Menus
+        *
+        * @author Dave Hall <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 calendar 
+        * @version $Id: class.menu.inc.php 690 2008-02-02 10:11:33Z dave $
+        */
+
+       /*
+          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/>.
+        */
+
+
+       /**
+        * Menus
+        *
+        * @package calendar
+        */     
+       class calendar_menu
+       {
+               /**
+                * Get the menus for the calendar
+                *
+                * @return array available menus for the current user
+                */
+               function get_menu()
+               {
+                       $menus = array();
+
+                       $menus['navbar'] = array
+                       (
+                               'calendar'      => array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('Calendar', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'calendar.uicalendar.index') ),
+                                       'image' => array('calendar', 'navbar'),
+                                       'order' => 4,
+                                       'group' => 'office'
+                               )
+                       );
+
+                       $menus['toolbar'] = array
+                       (
+                               array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('New', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'calendar.uicalendar.add')),
+                                       'image' => array('calendar', 'new')
+
+                               ),
+                               array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('Today', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'calendar.uicalendar.day')),
+                                       'image' => array('calendar', 'today')
+                               ),
+                               array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('Week', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'calendar.uicalendar.week')),
+                                       'image' => array('calendar', 'week')
+                               ),
+                               array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('Week Detailed', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'calendar.uicalendar.week_new')),
+                                       'image' => array('calendar', 
'week_detailed')
+                               ),
+                               array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('Month', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'calendar.uicalendar.month')),
+                                       'image' => array('calendar', 'month')
+                               ),
+                               array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('Year', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'calendar.uicalendar.year')),
+                                       'image' => array('calendar', 'year')
+                               ),
+                               array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('Group Planner', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'calendar.uicalendar.planner')),
+                                       'image' => array('calendar', 'planner')
+                               ),
+                               array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('Busy/Free', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'calendar.uicalendar.matrixselect')),
+                                       'image' => array('calendar', 
'busy_free')
+                               ),
+                               array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('Import', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'calendar.uiicalendar.import')),
+                                       'image' => array('calendar', 'import')
+                               )
+                       );
+
+                       if ( 
isset($GLOBALS['phpgw_info']['user']['apps']['admin']) )
+                       {
+                               $menus['admin'] = array
+                               (
+                                       'index' => array
+                                       (
+                                               'text'  => 
$GLOBALS['phpgw']->translation->translate('Site Configuration', array(), true),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'     => 
'admin.uiconfig.index', 'appname'    => 'calendar') )
+                                       ),
+                                       'custom'        => array
+                                       (
+                                               'text'  => 
$GLOBALS['phpgw']->translation->translate('Custom fields and sorting', array(), 
true),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'     => 
'calendar.uicustom_fields.index') )
+                                       ),
+                                       'holiday'       => array
+                                       (
+                                               'text'  => 
$GLOBALS['phpgw']->translation->translate('Calendar Holiday Management', 
array(), true),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'     => 
'calendar.uiholiday.admin') )
+                                       ),
+                                       'categories'    => array
+                                       (
+                                               'text'  => 
$GLOBALS['phpgw']->translation->translate('Global Categories', array(), true),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'     => 
'admin.uicategories.index', 'appname'        => 'calendar') )
+                                       )
+                               );
+                       }
+
+                       if ( 
isset($GLOBALS['phpgw_info']['user']['apps']['preferences']) )
+                       {
+                               $menus['preferences'] = array
+                               (
+                                       'preferences'   => array
+                                       (
+                                               'text'  => 
$GLOBALS['phpgw']->translation->translate('Preferences', array(), true),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/preferences/preferences.php', array('appname'      => 
'calendar'))
+                                       ),
+                                       'acls'  => array
+                                       (
+                                               'text'  => 
$GLOBALS['phpgw']->translation->translate('Grant Access', array(), true),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'      => 
'preferences.uiaclprefs.index', 'acl_app'    => 'calendar') )
+                                       ),
+                                       'categories'    => array
+                                       (
+                                               'text'  => 
$GLOBALS['phpgw']->translation->translate('Edit Categories', array(), true),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'     => 
'preferences.uicategories.index', 'cats_app' => 'calendar', 'cats_level'     => 
1, 'global_cats'     => true))
+                                       )
+                               );
+                               $menus['toolbar'][] = array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('Preferences', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/preferences/preferences.php', array('appname'      => 
'calendar')),
+                                       'image' => array('calendar', 
'preferences')
+                               );
+                       }
+
+                       $menus['navigation'] = array
+                       (
+                               array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('New', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'calendar.uicalendar.add'))
+                               ),
+                               array
+                               (
+                                       'text'          => 
$GLOBALS['phpgw']->translation->translate('view', array(), true),
+                                       'url'           => '#',
+                                       'children'      => array
+                                       (
+                                               array
+                                               (
+                                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('Today', array(), true),
+                                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'calendar.uicalendar.day'))
+                                               ),
+                                               array
+                                               (
+                                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('Week', array(), true),
+                                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'calendar.uicalendar.week'))
+                                               ),
+                                               array
+                                               (
+                                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('Week Detailed', array(), true),
+                                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'calendar.uicalendar.week_new'))
+                                               ),
+                                               array
+                                               (
+                                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('Month', array(), true),
+                                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'calendar.uicalendar.month'))
+                                               ),
+                                               array
+                                               (
+                                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('Year', array(), true),
+                                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'calendar.uicalendar.year'))
+                                               ),
+                                               array
+                                               (
+                                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('Group Planner', array(), true),
+                                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'calendar.uicalendar.planner'))
+                                               ),
+                                               array
+                                               (
+                                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('Daily Matrix View', array(), true),
+                                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'calendar.uicalendar.matrixselect'))
+                                               )
+                                       )
+                               ),
+                               array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('Import', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'calendar.uiicalendar.import'))
+                               )
+
+                       );
+
+                       $menus['folders'] = 
phpgwapi_menu::get_categories('calendar');
+
+                       return $menus;
+               }
+       }

Modified: trunk/calendar/setup/phpgw_sv.lang
===================================================================
--- trunk/calendar/setup/phpgw_sv.lang  2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/calendar/setup/phpgw_sv.lang  2008-02-02 13:52:39 UTC (rev 18466)
@@ -307,3 +307,4 @@
 your meeting scheduled for %1 has been canceled        calendar        sv      
Ditt m\xF6te %1 har blivit inst\xE4llt
 your meeting that had been scheduled for %1 has been rescheduled to %2 
calendar        sv      Ditt m\xF6te planerat till %1 har blivit flyttat till %2
 your suggested time of <b> %1 - %2 </b> conflicts with the following existing 
calendar entries:        calendar        sv      Din f\xF6reslagna tid av <B> 
%1 - %2 </B> \xE4r i konflikt med de f\xF6ljande kalender entries:
+

Modified: trunk/calendar/setup/setup.inc.php
===================================================================
--- trunk/calendar/setup/setup.inc.php  2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/calendar/setup/setup.inc.php  2008-02-02 13:52:39 UTC (rev 18466)
@@ -39,7 +39,6 @@
 
        /* The hooks this app includes, needed for hooks registration */
        $setup_info['calendar']['hooks'][] = 'add_def_prefs';
-       $setup_info['calendar']['hooks'][] = 'admin';
        $setup_info['calendar']['hooks'][] = 'deleteaccount';
        $setup_info['calendar']['hooks'][] = 'email';
        $setup_info['calendar']['hooks'][] = 'home';
@@ -49,10 +48,9 @@
        $setup_info['calendar']['hooks'][] = 'home_weeknew';
        $setup_info['calendar']['hooks'][] = 'home_year';
        $setup_info['calendar']['hooks'][] = 'manual';
-       $setup_info['calendar']['hooks'][] = 'preferences';
        $setup_info['calendar']['hooks'][] = 'settings';
-       $setup_info['calendar']['hooks'][] = 'sidebox_menu';
        $setup_info['calendar']['hooks'][] = 'help';
+       $setup_info['calendar']['hooks']['menu'] = 'calendar.menu.get_menu';
 
        /* Dependencies for this app to work */
        $setup_info['calendar']['depends'][] = array(

Modified: trunk/chat/setup/phpgw_sv.lang
===================================================================
--- trunk/chat/setup/phpgw_sv.lang      2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/chat/setup/phpgw_sv.lang      2008-02-02 13:52:39 UTC (rev 18466)
@@ -9,3 +9,4 @@
 send message   chat    sv      Skicka meddelande
 switch room    chat    sv      Byt rum
 whowhere       chat    sv      Vem \xE4r p\xE5
+

Modified: trunk/chora/setup/phpgw_sv.lang
===================================================================
--- trunk/chora/setup/phpgw_sv.lang     2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/chora/setup/phpgw_sv.lang     2008-02-02 13:52:39 UTC (rev 18466)
@@ -20,3 +20,4 @@
 repository name        chora   sv      Repository-namn
 repository title       chora   sv      Repository-rubrik
 that site name has been used already ! chora   sv      Det h\xE4r site-namnet 
anv\xE4nds redan !
+

Modified: trunk/comic/inc/functions.inc.php
===================================================================
--- trunk/comic/inc/functions.inc.php   2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/comic/inc/functions.inc.php   2008-02-02 13:52:39 UTC (rev 18466)
@@ -1074,9 +1074,7 @@
 
 function template_options($app_template, &$options_c, &$images_c)
 {
-    $appname = $GLOBALS['phpgw_info']['flags']['currentapp'];
-    
-    $directory = opendir(PHPGW_SERVER_ROOT . SEP. $appname . SEP . 'templates' 
. SEP . 'default' . SEP);
+    $directory = opendir(PHPGW_SERVER_ROOT . "comic/templates/base/");
 
     $index=0;
 

Modified: trunk/comic/setup/phpgw_sv.lang
===================================================================
--- trunk/comic/setup/phpgw_sv.lang     2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/comic/setup/phpgw_sv.lang     2008-02-02 13:52:39 UTC (rev 18466)
@@ -37,3 +37,4 @@
 showing %1 (%2 - %3 of %4)     comic   sv      visar %1 (%2-%3 av %4)
 template       comic   sv      Mall
 visit %1       comic   sv      Bes\xF6k %1
+

Modified: trunk/demo/inc/class.bodemo.inc.php
===================================================================
--- trunk/demo/inc/class.bodemo.inc.php 2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/demo/inc/class.bodemo.inc.php 2008-02-02 13:52:39 UTC (rev 18466)
@@ -166,30 +166,9 @@
                {
                        if(is_array($values_attribute))
                        {
-                               foreach ( $values_attribute as &$attrib )
-                               {
-                                       if ( $attrib['datatype'] == 'CH' && 
$attrib['value'] )
-                                       {
-                                               $attrib['value'] = 
serialize($attrib[$i]['value'] );
+                               $values_attribute = 
$this->custom->convert_attribute_save($values_attribute);
                                        }
-                                       if ( $attrib['datatype'] == 'R' && 
$attrib['value'] )
-                                       {
-                                               $attrib['value'] = 
$attrib['value'][0];
-                                       }
-
-                                       if ( $attrib['datatype'] == 'N' && 
$attrib['value'] )
-                                       {
-                                               $attrib['value'] = 
str_replace(',', '.', $attrib['value']);
-                                       }
        
-                                       if ( $attrib['datatype'] == 'D' && 
$attrib['value'] )
-                                       {
-                                               $values_attribute[$i]['value'] 
= date($this->dateformat, $this->date_to_timestamp($attrib['value']));
-                                       }
-                               }
-                       }
-
-
                        if (isset($values['demo_id']) && $values['demo_id'])
                        {
                                $receipt = 
$this->so->edit($values,$values_attribute);
@@ -275,7 +254,7 @@
                * @param array $values value set with 
                * @return array Array with attribute definition and values
                */
-               private function 
preserve_attribute_values($values='',$values_attribute='')
+               function 
preserve_attribute_values($values='',$values_attribute='')
                {
                        return 
$this->custom->preserve_attribute_values($values,$values_attribute);
                }

Modified: trunk/demo/setup/phpgw_en.lang
===================================================================
--- trunk/demo/setup/phpgw_en.lang      2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/demo/setup/phpgw_en.lang      2008-02-02 13:52:39 UTC (rev 18466)
@@ -1,4 +1,5 @@
 demo app       demo    en      Demonstration application
+demo   common  en      Demo Module
 Add    demo    en      Add
 Delete demo    en      Delete
 Edit   demo    en      Edit

Modified: trunk/demo/templates/base/attributes_form.xsl
===================================================================
--- trunk/demo/templates/base/attributes_form.xsl       2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/demo/templates/base/attributes_form.xsl       2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -5,7 +5,7 @@
        </xsl:template>
 
        <xsl:template match="attributes_values">
-               <xsl:variable name="lang_attribute_statustext"><xsl:value-of 
select="lang_attribute_statustext"/></xsl:variable>
+               <xsl:variable name="statustext"><xsl:value-of 
select="statustext"/></xsl:variable>
                        <tr>
                                <xsl:attribute name="class">
                                        <xsl:choose>
@@ -21,15 +21,17 @@
                                        </xsl:choose>
                                </xsl:attribute>
 
-                               <td class="{class}" align="left" valign="top">
-                                       <xsl:value-of select="input_text"/>
+                               <td class="{class}" align="left" valign="top" 
title="{$statustext}" style="cursor:help">
                                        <xsl:choose>
                                                <xsl:when test="helpmsg=1">
-                                                       <xsl:variable 
name="help_url"><xsl:value-of select="//help_url"/>&amp;attrib_id=<xsl:value-of 
select="id"/></xsl:variable>
-                                                       <xsl:variable 
name="lang_help"><xsl:value-of select="//lang_help"/></xsl:variable>
+                                                       <xsl:variable 
name="help_url"><xsl:value-of select="help_url"/>&amp;attrib_id=<xsl:value-of 
select="attrib_id"/></xsl:variable>
                                                        <a href="javascript:var 
w=window.open('{$help_url}','','width=550,height=400,scrollbars')">
-                                                       <xsl:text> 
[</xsl:text><xsl:value-of select="$lang_help"/><xsl:text>]</xsl:text></a>
+                                                               
<xsl:text>[</xsl:text><xsl:value-of select="input_text"/><xsl:text>]</xsl:text>
+                                                       </a>
                                                </xsl:when>
+                                               <xsl:otherwise>
+                                                       <xsl:value-of 
select="input_text"/>
+                                               </xsl:otherwise>
                                        </xsl:choose>
                                        <xsl:choose>
                                                <xsl:when test="datatype='pwd'">

Modified: trunk/developer_tools/inc/class.solangfile.inc.php
===================================================================
--- trunk/developer_tools/inc/class.solangfile.inc.php  2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/developer_tools/inc/class.solangfile.inc.php  2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -35,7 +35,6 @@
                //Known Issue, if a phrase contains a ' or a " the parse will 
be thrown off. unless ' are nested inside " or vice versa
                function parse_php_app($fd,$plist)
                {
-       //              define('SEP',filesystem_separator());
                        $d=dir($fd);
                        while ($fn=$d->read())
                        {

Modified: trunk/developer_tools/setup/phpgw_sv.lang
===================================================================
--- trunk/developer_tools/setup/phpgw_sv.lang   2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/developer_tools/setup/phpgw_sv.lang   2008-02-02 13:52:39 UTC (rev 
18466)
@@ -68,3 +68,4 @@
 you must enter a change        developer_tools sv      Du m\xE5ste g\xF6ra en 
\xE4ndring
 you must select a project      developer_tools sv      Du m\xE5ste v\xE4lja 
ett projekt
 you need to set your preferences for this app  developer_tools sv      Du 
m\xE5ste st\xE4lla in inst\xE4llningarna f\xF6r denna modul
+

Modified: trunk/eldaptir/setup/phpgw_sv.lang
===================================================================
--- trunk/eldaptir/setup/phpgw_sv.lang  2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/eldaptir/setup/phpgw_sv.lang  2008-02-02 13:52:39 UTC (rev 18466)
@@ -43,3 +43,4 @@
 value  eldaptir        sv      V\xE4rde
 view ou        eldaptir        sv      Visa OU
 you appear to be running       eldaptir        sv      Du verkar k\xF6ra
+

Modified: trunk/email/attach_file.php
===================================================================
--- trunk/email/attach_file.php 2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/email/attach_file.php 2008-02-02 13:52:39 UTC (rev 18466)
@@ -74,12 +74,12 @@
                        . '<br />';
        }
 
-       if (!file_exists($GLOBALS['phpgw_info']['server']['temp_dir'] . SEP . 
$GLOBALS['phpgw_info']['user']['sessionid']))
+       if 
(!file_exists("{$GLOBALS['phpgw_info']['server']['temp_dir']}/{$GLOBALS['phpgw_info']['user']['sessionid']}"))
        {
-               mkdir($GLOBALS['phpgw_info']['server']['temp_dir'] . SEP . 
$GLOBALS['phpgw_info']['user']['sessionid'],0700);
+               
mkdir("{$GLOBALS['phpgw_info']['server']['temp_dir']}/{$GLOBALS['phpgw_info']['user']['sessionid']}",0700);
        }
 
-       //$uploaddir = $GLOBALS['phpgw_info']['server']['temp_dir'] . SEP . 
$GLOBALS['phpgw_info']['user']['sessionid'] . SEP;
+       //$uploaddir = 
"{$GLOBALS['phpgw_info']['server']['temp_dir']}/{$GLOBALS['phpgw_info']['user']['sessionid']}/";
        $uploaddir = $GLOBALS['phpgw']->msg->att_files_dir;
        
        // if we were NOT able to create this temp directory, then make an 
ERROR report
@@ -108,25 +108,6 @@
        // also note that uploading file to *memory* is wasteful
        */
        
-       // probably UNNECESSARY debug code, delete it after this is all stable
-       if (($GLOBALS['phpgw']->msg->minimum_version("4.1.0"))
-       && (!isset($GLOBALS['phpgw']->msg->ref_FILES)))
-       {
-               echo 'file attach_file ('.__LINE__.') ERROR: 
$GLOBALS[phpgw]->msg->ref_FILES should be set here, but it IS NOT set<br />';
-       }
-       
-       // the following code only applies to php < 4.1.0 where that 
superglobal was not available
-       // thanks Dave Hall for this code suggestion
-       if (
-         (! (isset($HTTP_POST_FILES) || isset($GLOBALS['HTTP_POST_FILES'])) )
-         && ($GLOBALS['phpgw']->msg->minimum_version("4.1.0") == False)
-       )
-       {
-               $_FILES = $GLOBALS['HTTP_POST_FILES'];
-               global $_FILES;
-               // REDEFINE THE REFERENCE TO THE FILES DATA
-               $GLOBALS['phpgw']->msg->ref_FILES = &$_FILES;
-       }
        // yes I am aware that the above code and the below code kind of deal 
with the same thing
        // if  the above code still does not give a good reference to FILES 
data, below there is "oldschool" fallback code
        // also I do not want to force global something every script run when 
it is only needed here
@@ -134,9 +115,7 @@
        
        // clean / prepare PHP provided file info
        // note that "uploadedfile" is the POST submit form identification for 
the file
-       if ( ($GLOBALS['phpgw']->msg->minimum_version("4.1.0"))
-       // or we may have otherwise obtained a good reference above
-       || (isset($GLOBALS['phpgw']->msg->ref_FILES['uploadedfile'])) )
+       if ( isset($GLOBALS['phpgw']->msg->ref_FILES['uploadedfile']) )
        {
                $file_tmp_name = 
$GLOBALS['phpgw']->msg->stripslashes_gpc(trim($GLOBALS['phpgw']->msg->ref_FILES['uploadedfile']['tmp_name']));
                $file_name = 
$GLOBALS['phpgw']->msg->stripslashes_gpc(trim($GLOBALS['phpgw']->msg->ref_FILES['uploadedfile']['name']));
@@ -144,14 +123,6 @@
                $file_type = 
$GLOBALS['phpgw']->msg->stripslashes_gpc(trim($GLOBALS['phpgw']->msg->ref_FILES['uploadedfile']['type']));
                if ($fup_debug > 1) { echo 'ref_FILE dump: 
'.htmlspecialchars(serialize($GLOBALS['phpgw']->msg->ref_FILES)).'<br />'; } 
        }
-       else
-       {
-               // php less then 4.1 uses these pre-superglobals enviornment 
vars
-               $file_tmp_name = 
$GLOBALS['phpgw']->msg->stripslashes_gpc(trim($uploadedfile));
-               $file_name = 
$GLOBALS['phpgw']->msg->stripslashes_gpc(trim($uploadedfile_name));
-               $file_size = 
$GLOBALS['phpgw']->msg->stripslashes_gpc(trim($uploadedfile_size));
-               $file_type = 
$GLOBALS['phpgw']->msg->stripslashes_gpc(trim($uploadedfile_type));        
-       }
        
        // sometimes PHP is very clue-less about MIME types, and gives NO 
file_type
        // rfc default for unknown MIME type is:
@@ -162,30 +133,6 @@
                $file_type = $mime_type_default;
        }
 
-       // Netscape 6 sometimes passes file_name with a full path, we need to 
extract just the filename
-       function wbasename($input)
-       {
-               if (strstr($input, SEP) == False)
-               {
-                       // no filesystem seperator is present
-                       return $input;
-               }
-
-               for($i=0; $i < strlen($input); $i++ )
-               {
-                       $pos = strpos($input, SEP, $i);
-                       if ($pos != false)
-                       {
-                               $lastpos = $pos;
-                       }
-               }
-               return substr($input, $lastpos + 1, strlen($input));
-       }
-       // now use that function to get a clean file name
-       if ($fup_debug > 1) { echo 'file_name (pre-wbasename): ' .$file_name 
.'<br />'; } 
-       // Netscape 6 passes file_name with a full path, we need to extract 
just the filename
-       $file_name = wbasename($file_name);
-
        // Some server side attachment upload handling code is borrowed from
        // Squirrelmail <Luke Ehresman> http://www.squirrelmail.org
        // particularly the moving, temporary naming, and the ".info" file code.
@@ -193,8 +140,8 @@
        {
                for ($i=0; $i<count($delete); $i++)
                {
-                       unlink($uploaddir.SEP.$delete[$i]);
-                       unlink($uploaddir.SEP.$delete[$i] . '.info');
+                       unlink("{$uploaddir}/{$delete[$i]}");
+                       unlink("{$uploaddir}/{$delete[$i]}.info");
                }
        }
 
@@ -211,14 +158,14 @@
                //if ($file_tmp_name == "none" && $file_size == 0) This could 
work also
                if ($file_size == 0)
                {
-                       touch ($uploaddir.SEP.$newfilename);
+                       touch ("{$uploaddir}/{$newfilename}");
                }
                else
                {
-                       copy($file_tmp_name, $uploaddir.SEP.$newfilename);
+                       copy($file_tmp_name, "{$uploaddir}/{$newfilename}");
                }
 
-               $ftp = fopen($uploaddir.SEP.$newfilename . '.info','wb');
+               $ftp = fopen("{$uploaddir}/{$newfilename}.info",'wb');
                fputs($ftp,$file_type."\n".$file_name."\n");
                fclose($ftp);
        }
@@ -232,39 +179,40 @@
                        . '<br />';
        }
 
-       $dh = opendir($uploaddir);
-       //while ($file = readdir($dh)) // 
http://www.php.net/manual/en/function.readdir.php says this is wrong ... 
-       while (false !== ($file = readdir($dh))) // is correct according to the 
manual but only works with 4.0.0RC2+
+       $dh = dir($uploaddir);
+       while ( false !== ($file = $dh->dir() ) )
        {
                if (($file != '.')
                && ($file != '..')
-               && (ereg("\.info",$file)))
+               && (preg_match('/\.info/', $file)))
                {
-                       $file_info = file($uploaddir.SEP.$file);
+                       $file_info = file("{$uploaddir}/{$file}");
                        
                        //get filesize in kb, but do not tell user a file is 
0kb, because it is probably closer to 1kb
                        $real_file = str_replace('.info','',$file);
-                       $real_file_size = ((int) 
(@filesize($uploaddir.SEP.$real_file)/1024));
-                       if ($real_file_size < 1)
+
+                       $real_file_size = (int) 
filesize("{$uploaddir}/{$real_file}");
+                       if ( $real_file_size / 1024 > 1 )
                        {
-                               $real_file_size = 1;
+                               $real_file_size = ($real_file_size / 1024) . 
'kb';
                        }
+                       else
+                       {
+                               $real_file_size .= 'b';
+                       }
                        
-                       if ($fup_debug > 2) { echo 'FILE contents DUMP: <pre>'; 
print_r(file($uploaddir.SEP.$real_file)); echo '</pre>'; } 
+                       if ($fup_debug > 2) { echo 'FILE contents DUMP: <pre>'; 
print_r(file("{$uploaddir}/{$real_file}")); echo '</pre>'; } 
                        // for every file, fill the file list template with it
-                       
$GLOBALS['phpgw']->template->set_var('ckbox_delete_name','delete[]');
-                       
$GLOBALS['phpgw']->template->set_var('ckbox_delete_value',substr($file,0,-5));
-                       
$GLOBALS['phpgw']->template->set_var('hidden_delete_name',substr($file,0,-5));
-                       
$GLOBALS['phpgw']->template->set_var('hidden_delete_filename',
-                                       $file_info[1]);
-                       
$GLOBALS['phpgw']->template->set_var('ckbox_delete_filename',
-                                       //$file_info[1].' ('.((int) 
(@filesize($uploaddir.SEP.$real_file)/1024)).'k)'); //also shows file size in kb
-                                       $file_info[1].' 
('.$real_file_size.'k)'); //also shows file size in kb
+                       
$GLOBALS['phpgw']->template->set_var('ckbox_delete_name', 'delete[]');
+                       
$GLOBALS['phpgw']->template->set_var('ckbox_delete_value', substr($file,0,-5));
+                       
$GLOBALS['phpgw']->template->set_var('hidden_delete_name', substr($file,0,-5));
+                       
$GLOBALS['phpgw']->template->set_var('hidden_delete_filename', $file_info[1]);
+                       
$GLOBALS['phpgw']->template->set_var('ckbox_delete_filename', "{$file_info[1]} 
({$real_file_size})");
                        
$GLOBALS['phpgw']->template->parse('V_attached_list','B_attached_list',True);
                        $totalfiles++;
                }
        }
-       closedir($dh);
+       $dh->close();
        if ($totalfiles == 0)
        {
                // there is no list of files, clear that block

Modified: trunk/email/inc/class.boattach_file.inc.php
===================================================================
--- trunk/email/inc/class.boattach_file.inc.php 2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/email/inc/class.boattach_file.inc.php 2008-02-02 13:52:39 UTC (rev 
18466)
@@ -107,33 +107,6 @@
                        }
                }
                
-               /*!
-               @function wbasename
-               @abstract returns a filename with the path stripped off
-               @param $input (string) filename with or without the path. If 
path is there it will be stripped. 
-               @authors Angles and some help from php.net manual
-               @discussion Netscape 6 sometimes passes file_name with a full 
path, we need to extract just the filename. 
-               WHY use this insead of the buildin PHP function, I DO NOT KNOW. 
-               */
-               function wbasename($input)
-               {
-                       if (strstr($input, SEP) == False)
-                       {
-                               // no filesystem seperator is present
-                               return $input;
-                       }
-       
-                       for($i=0; $i < strlen($input); $i++ )
-                       {
-                               $pos = strpos($input, SEP, $i);
-                               if ($pos != false)
-                               {
-                                       $lastpos = $pos;
-                               }
-                       }
-                       return substr($input, $lastpos + 1, strlen($input));
-               }
-               
                /**
                * Grab gpc POST vars used in this script for "this->action" and 
"this->delete" values.
                *
@@ -182,11 +155,6 @@
                                $this->file_data['file_type'] = 
$mime_type_default;
                        }
                        
-                       // Netscape 6 passes file_name with a full path, we 
need to extract just the filename
-                       if ($this->debug > 1) { echo 
'emai.boattach_file.fill_file_data_gpc ('.__LINE__.'): file_name 
(pre-wbasename): ' .$this->file_data['file_name'] .'<br />'; } 
-                       $this->file_data['file_name'] = 
$this->wbasename($this->file_data['file_name']);
-                       if ($this->debug > 1) { echo 
'emai.boattach_file.fill_file_data_gpc ('.__LINE__.'): file_name 
(post-wbasename): ' .$this->file_data['file_name'] .'<br />'; } 
-                       
                        if ($this->debug > 2) { echo 
'emai.boattach_file.fill_file_data_gpc ('.__LINE__.'): filled $this->file_data 
DUMP<pre>'; print_r($this->file_data);  echo '</pre>'; } 
                        if ($this->debug > 0) { echo 'LEAVING 
emai.boattach_file.fill_file_data_gpc ('.__LINE__.')<br />'; }
                }
@@ -271,8 +239,8 @@
                                // sometimes $this->control_data[delete][] 
seems to have multiple entries for the same filename
                                for ($i=0; 
$i<count($this->control_data['delete']); $i++)
                                {
-                                       $full_fname_attachment = 
$this->uploaddir.SEP.$this->control_data['delete'][$i];
-                                       $full_fname_metafile = 
$this->uploaddir.SEP.$this->control_data['delete'][$i] . '.info';
+                                       $full_fname_attachment = 
"{$this->uploaddir}/{$this->control_data['delete'][$i]}";
+                                       $full_fname_metafile = 
"{$this->uploaddir}/{$this->control_data['delete'][$i]}.info";
                                        if (file_exists($full_fname_attachment))
                                        {
                                                if ($this->debug > 1) { echo 
'boattach_file.attach ('.__LINE__.'): loop['.$i.'] deleting file: 
['.$full_fname_attachment.']: <br />'; } 
@@ -308,14 +276,14 @@
                                //if ($this->file_data['file_tmp_name'] == 
"none" && $this->file_data['file_size'] == 0) This could work also
                                if ($this->file_data['file_size'] == 0)
                                {
-                                       touch 
($this->uploaddir.SEP.$newfilename);
+                                       touch 
("{$this->uploaddir}/{$newfilename}");
                                }
                                else
                                {
-                                       
move_uploaded_file($this->file_data['file_tmp_name'], 
$this->uploaddir.SEP.$newfilename);
+                                       
move_uploaded_file($this->file_data['file_tmp_name'], 
"{$this->uploaddir}/{$newfilename}");
                                }
                
-                               $ftp = fopen($this->uploaddir.SEP.$newfilename 
. '.info','wb');
+                               $ftp = 
fopen("{$this->uploaddir}/{$newfilename}.info",'wb');
                                
fputs($ftp,$this->file_data['file_type']."\n".$this->file_data['file_name']."\n");
                                fclose($ftp);
                        }
@@ -329,38 +297,40 @@
                                        . '<br />';
                        }
                
-                       $dh = opendir($this->uploaddir);
-                       //while ($file = readdir($dh)) // 
http://www.php.net/manual/en/function.readdir.php says this is wrong ... 
-                       while (false !== ($file = readdir($dh))) // is correct 
according to the manual but only works with 4.0.0RC2+
+                       $dh = dir($uploaddir);
+                       while ( false !== ($file = $dh->dir() ) )
                        {
                                if (($file != '.')
                                && ($file != '..')
-                               && (ereg("\.info",$file)))
+                                       && (preg_match('/\.info/', $file)))
                                {
-                                       $file_info = 
file($this->uploaddir.SEP.$file);
+                                       $file_info = 
file("{$uploaddir}/{$file}");
                                        
                                        //get filesize in kb, but do not tell 
user a file is 0kb, because it is probably closer to 1kb
-                                       // actual 0kb files are probably an 
error, and are detected in the actual upload code (HOPEFULLY) 
                                        $real_file = 
str_replace('.info','',$file);
-                                       $real_file_size = ((int) 
(@filesize($this->uploaddir.SEP.$real_file)/1024));
-                                       if ($real_file_size < 1)
+
+                                       $real_file_size = (int) 
filesize("{$uploaddir}/{$real_file}");
+                                       if ( $real_file_size / 1024 > 1 )
                                        {
-                                               $real_file_size = 1;
+                                               $real_file_size = 
($real_file_size / 1024) . 'kb';
                                        }
+                                       else
+                                       {
+                                               $real_file_size .= 'b';
+                                       }
                                        
-                                       if ($this->debug > 2) { echo 'FILE 
contents DUMP: <pre>'; print_r(file($this->uploaddir.SEP.$real_file)); echo 
'</pre>'; } 
+                                       if ($fup_debug > 2) { echo 'FILE 
contents DUMP: <pre>'; print_r(file("{$uploaddir}/{$real_file}")); echo 
'</pre>'; } 
                                        // for every file, fill the file list 
template with it
-                                       
$GLOBALS['phpgw']->template->set_var('ckbox_delete_name','delete[]');
-                                       
$GLOBALS['phpgw']->template->set_var('ckbox_delete_value',substr($file,0,-5));
-                                       
$GLOBALS['phpgw']->template->set_var('hidden_delete_name',substr($file,0,-5));
+                                       
$GLOBALS['phpgw']->template->set_var('ckbox_delete_name', 'delete[]');
+                                       
$GLOBALS['phpgw']->template->set_var('ckbox_delete_value', substr($file,0,-5));
+                                       
$GLOBALS['phpgw']->template->set_var('hidden_delete_name', substr($file,0,-5));
                                        
$GLOBALS['phpgw']->template->set_var('hidden_delete_filename', $file_info[1]);
-                                       
$GLOBALS['phpgw']->template->set_var('ckbox_delete_filename', 
-                                                       $file_info[1].' 
('.$real_file_size.'k)'); //also shows file size in kb
+                                       
$GLOBALS['phpgw']->template->set_var('ckbox_delete_filename', "{$file_info[1]} 
({$real_file_size})");
                                        
$GLOBALS['phpgw']->template->parse('V_attached_list','B_attached_list',True);
                                        $totalfiles++;
                                }
                        }
-                       closedir($dh);
+                       $dh->close();
                        if ($totalfiles == 0)
                        {
                                // there is no list of files, clear that block

Modified: trunk/email/inc/class.bocompose.inc.php
===================================================================
--- trunk/email/inc/class.bocompose.inc.php     2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/email/inc/class.bocompose.inc.php     2008-02-02 13:52:39 UTC (rev 
18466)
@@ -524,13 +524,13 @@
                                                                $part_string = 
base64_decode($part_string);
                                                        }
                                                        
-                                                       $fpart = 
fopen($GLOBALS['phpgw']->msg->att_files_dir . SEP . $newfilename,'wb');
+                                                       $fpart = 
fopen("{$GLOBALS['phpgw']->msg->att_files_dir}/{$newfilename}",'wb');
                                                        fputs($fpart, 
$part_string);
                                                        fclose($fpart);
                                                        unset($fpart);
                                                        unset($part_string);
                                
-                                                       $finfo = 
fopen($GLOBALS['phpgw']->msg->att_files_dir . SEP . $newfilename . 
'.info','wb');
+                                                       $finfo = 
fopen("{$GLOBALS['phpgw']->msg->att_files_dir}/{$newfilename}" . '.info','wb');
                                                        fputs($finfo, 
strtolower($mimemajors[$part->type] . '/' . $part->subtype) ."\n" 
                                                                . $filename . 
"\n");
                                                        fclose($finfo);

Modified: trunk/email/inc/class.bopreferences.inc.php
===================================================================
--- trunk/email/inc/class.bopreferences.inc.php 2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/email/inc/class.bopreferences.inc.php 2008-02-02 13:52:39 UTC (rev 
18466)
@@ -21,7 +21,7 @@
        * GLOBALS[phpgw]->msg->expire_session_cache_item("mailserver_callstr")
        * @package email
        */      
-       class bopreferences
+       class email_bopreferences
        {
                var $public_functions = array(
                        'preferences' => True,
@@ -55,7 +55,7 @@
                //var $debug_set_prefs = 4;
                
                
-               function bopreferences()
+               public function __construct()
                {
                        if ($this->debug_set_prefs > 0) { echo 
'email.bopreferences *constructor*: ENTERING <br />'; }
                        /*!

Modified: trunk/email/inc/class.bosend.inc.php
===================================================================
--- trunk/email/inc/class.bosend.inc.php        2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/email/inc/class.bosend.inc.php        2008-02-02 13:52:39 UTC (rev 
18466)
@@ -188,10 +188,11 @@
                                $dh = dir($upload_dir);
                                while ( ($file = $dh->read() ) !== false )
                                {
-                                       if( $file != '.' && $file != '..' )
+                                       if( $file == '.' || $file == '..' )
                                        {
-                                               unlink($upload_dir . SEP . 
$file);
+                                               continue;
                                        }
+                                       unlink("{$upload_dir}/{$file}");
                                }
                                $dh->close();
                                rmdir($upload_dir);
@@ -723,9 +724,9 @@
                                        && ( strpos($file, '.info') )
                                        )
                                        {
-                                               $meta_data = explode("\n", 
file_get_contents($upload_dir . SEP . $file) );
+                                               $meta_data = explode("\n", 
file_get_contents("{$upload_dir}/{$file}") );
                                                $real_file = substr($file, 0, 
strpos($file, '.info'));
-                                               $this->smtp->AddAttachment( 
$upload_dir .SEP. $real_file, 
+                                               $this->smtp->AddAttachment( 
"{$upload_dir}/{$real_file}", 
                                                                
trim($meta_data[1]), 
                                                                'base64', 
                                                                
trim($meta_data[0]) );

Modified: trunk/email/inc/class.html_widgets.inc.php
===================================================================
--- trunk/email/inc/class.html_widgets.inc.php  2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/email/inc/class.html_widgets.inc.php  2008-02-02 13:52:39 UTC (rev 
18466)
@@ -1806,7 +1806,8 @@
                        $GLOBALS['phpgw']->common->phpgw_header(True);
                        $GLOBALS['phpgw']->template->set_root(PHPGW_APP_TPL);
 
-                       $GLOBALS['phpgw']->template->set_file(array(
+                       $GLOBALS['phpgw']->template->set_file(array
+                       (
                                'T_error_report' => 'error_report.tpl'
                        ));
                        
$GLOBALS['phpgw']->template->set_var('error_report_text', 
$this->prop_error_report_text());
@@ -1816,11 +1817,9 @@
                        // do we exit the script here?
                        if ($do_exit)
                        {
-                               // kill this script, we re outa here...
                                if (is_object($GLOBALS['phpgw']->msg))
                                {
                                        $GLOBALS['phpgw']->msg->end_request();
-                                       $GLOBALS['phpgw']->msg = '';
                                        unset($GLOBALS['phpgw']->msg);
                                }
                                $GLOBALS['phpgw']->common->phpgw_exit();
@@ -1834,6 +1833,9 @@
                */
                function get_geek_bar()
                {
+                       //disabling "geekbar"
+                       return '';
+
                        $row_on = $GLOBALS['phpgw_info']['theme']['row_on'];
                        $this_server_type = 
$GLOBALS['phpgw']->msg->get_pref_value('mail_server_type');
                        if (extension_loaded('imap') && 
function_exists('imap_open'))

Modified: trunk/email/inc/class.mail_dcom_base.inc.php
===================================================================
--- trunk/email/inc/class.mail_dcom_base.inc.php        2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/email/inc/class.mail_dcom_base.inc.php        2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -52,7 +52,7 @@
                        $this->err["code"] = " ";
                        $this->err["msg"]  = " ";
                        $this->err["desc"] = " ";
-                       $this->tempfile = 
$GLOBALS['phpgw_info']['server']['temp_dir'].SEP.$GLOBALS['phpgw_info']['user']['sessionid'].'.mhd';
+                       $this->tempfile = 
"{$GLOBALS['phpgw_info']['server']['temp_dir']}/" . 
$GLOBALS['phpgw']->common->randomstring() . '.mhd';
                        $this->force_check = false;
                        $this->got_structure = false;
                }

Modified: trunk/email/inc/class.mail_dcom_base_sock.inc.php
===================================================================
--- trunk/email/inc/class.mail_dcom_base_sock.inc.php   2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/email/inc/class.mail_dcom_base_sock.inc.php   2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -476,8 +476,8 @@
                        $this->network(True);
                        if (isset($GLOBALS['phpgw_info']))
                        {
-                               $this->tempfile = 
$GLOBALS['phpgw_info']['server']['temp_dir'].SEP.$GLOBALS['phpgw_info']['user']['sessionid'].'.mhd';
-                               $this->att_files_dir = 
$GLOBALS['phpgw_info']['server']['temp_dir'].SEP.$GLOBALS['phpgw_info']['user']['sessionid'];
+                               $this->tempfile = 
"{$GLOBALS['phpgw_info']['server']['temp_dir']}/" . 
$GLOBALS['phpgw']->common->randomstring() . '.mhd';
+                               $this->att_files_dir = 
"{$GLOBALS['phpgw_info']['server']['temp_dir']}/{$GLOBALS['phpgw_info']['user']['sessionid']}";
                        }
                        else
                        {

Modified: trunk/email/inc/class.mail_dcom_imap.inc.php
===================================================================
--- trunk/email/inc/class.mail_dcom_imap.inc.php        2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/email/inc/class.mail_dcom_imap.inc.php        2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -164,9 +164,13 @@
 
                function listmailbox($stream,$ref,$pattern)
                {
+                       if ( !is_resource($stream) )
+                       {
+                               return array();
+                       }
                        //return imap_listmailbox($stream,$ref,$pattern);
                        $pattern = $this->utf7_encode($pattern);
-                       $return_list = imap_listmailbox($stream,$ref,$pattern);
+                       $return_list = imap_list($stream,$ref,$pattern);
                        return $this->utf7_decode($return_list);
                }
 
@@ -212,7 +216,7 @@
                function open($mailbox,$username,$password,$flags=0)
                {
                        $mailbox = $this->utf7_encode($mailbox);
-                       return imap_open($mailbox,$username,$password,$flags);
+                       return @imap_open($mailbox, $username, $password, 
$flags);
                }
 
                function qprint($message)
@@ -259,6 +263,10 @@
 
                function status($stream,$mailbox,$options=0)
                {
+                       if ( !is_resource($stream) )
+                       {
+                               return;
+                       }
                        $mailbox = $this->utf7_encode($mailbox);
                        return imap_status($stream,$mailbox,$options);
                }

Modified: trunk/email/inc/class.mail_msg_base.inc.php
===================================================================
--- trunk/email/inc/class.mail_msg_base.inc.php 2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/email/inc/class.mail_msg_base.inc.php 2008-02-02 13:52:39 UTC (rev 
18466)
@@ -347,8 +347,8 @@
                */
                function mail_msg_base()
                {
-                       if (($this->debug_logins > 0) && 
(is_object($this->dbug->out))) { $this->dbug->out('mail_msg('.__LINE__.'): 
*constructor*: $GLOBALS[PHP_SELF] = ['.$GLOBALS['PHP_SELF'].'] $this->acctnum = 
['.$this->acctnum.']  get_class($this) : "'.get_class($this).'" ; 
get_parent_class($this) : "'.get_parent_class($this).'"<br />'); }
-                       if ($this->debug_logins > 0) { echo 
'mail_msg('.__LINE__.'): *constructor*: $GLOBALS[PHP_SELF] = 
['.$GLOBALS['PHP_SELF'].'] $this->acctnum = ['.$this->acctnum.']  
get_class($this) : "'.get_class($this).'" ; get_parent_class($this) : 
"'.get_parent_class($this).'"<br />'; }
+                       if (($this->debug_logins > 0) && 
(is_object($this->dbug->out))) { $this->dbug->out('mail_msg('.__LINE__.'): 
*constructor*: $GLOBALS[PHP_SELF] = ['.$_SERVER['PHP_SELF'].'] $this->acctnum = 
['.$this->acctnum.']  get_class($this) : "'.get_class($this).'" ; 
get_parent_class($this) : "'.get_parent_class($this).'"<br />'); }
+                       if ($this->debug_logins > 0) { echo 
'mail_msg('.__LINE__.'): *constructor*: $GLOBALS[PHP_SELF] = 
['.$_SERVER['PHP_SELF'].'] $this->acctnum = ['.$this->acctnum.']  
get_class($this) : "'.get_class($this).'" ; get_parent_class($this) : 
"'.get_parent_class($this).'"<br />'; }
                        return;
                }
                
@@ -378,51 +378,15 @@
                                $this->dbug = CreateObject('email.svc_debug');
                        }
                        
-                       if ($this->debug_logins > 0) { 
$this->dbug->out('mail_msg.initialize_mail_msg('.__LINE__.'): ENTERING manual 
*constructor*: $GLOBALS[PHP_SELF] = ['.$GLOBALS['PHP_SELF'].'] $this->acctnum = 
['.$this->acctnum.']  get_class($this) : "'.get_class($this).'" ; 
get_parent_class($this) : "'.get_parent_class($this).'"<br />'); }
+                       if ($this->debug_logins > 0) { 
$this->dbug->out('mail_msg.initialize_mail_msg('.__LINE__.'): ENTERING manual 
*constructor*: $GLOBALS[PHP_SELF] = ['.$_SERVER['PHP_SELF'].'] $this->acctnum = 
['.$this->acctnum.']  get_class($this) : "'.get_class($this).'" ; 
get_parent_class($this) : "'.get_parent_class($this).'"<br />'); }
                        if ($this->debug_logins > 1) { 
$this->dbug->out('mail_msg.initialize_mail_msg('.__LINE__.'): manual 
*constructor*: $this->acctnum = ['.$this->acctnum.'] ; $this->a  DUMP:', 
$this->a); }
                        if ($this->debug_logins > 1) { 
$this->dbug->out('mail_msg.initialize_mail_msg('.__LINE__.'): manual 
*constructor*: extra data $p1 (if provided): '.serialize($p1).'<br />'); }
                        
-                       if ($this->debug_logins > 1) { 
$this->dbug->out('mail_msg.initialize_mail_msg('.__LINE__.'): manual 
*constructor*: checking and or setting GET and POST reference based on PHP 
version<br />'); }
-                       // make GPC reference for php versions < 4.1 and > 4.2
-                       // since this constructor is apparently called many 
times 
-                       // during the script run (not sure why) we check if 
we've already done it first
-                       $force_GPC_new = False;
-                       //$force_GPC_new = True;
-                       if (($this->ref_GET == '##NOTHING##')
-                       || ($this->ref_POST == '##NOTHING##')
-                       || ($this->ref_SERVER == '##NOTHING##')
-                       || ($this->ref_FILES == '##NOTHING##')
-                       || ($this->ref_SESSION == '##NOTHING##'))
-                       {
-                               // set this to force using the new superglobals
-                               if ($force_GPC_new == True)
-                               {
                                        $this->ref_GET = &$_GET;
                                        $this->ref_POST = &$_POST;
                                        $this->ref_SERVER = &$_SERVER;
                                        $this->ref_FILES = &$_FILES;
                                        $this->ref_SESSION = &$_SESSION;
-                               }
-                               // make the appropriate reference (pointer) 
based on php version 4.1.0
-                               elseif ($this->minimum_version("4.1.0"))
-                               {
-                                       $this->ref_GET = &$_GET;
-                                       $this->ref_POST = &$_POST;
-                                       $this->ref_SERVER = &$_SERVER;
-                                       $this->ref_FILES = &$_FILES;
-                                       $this->ref_SESSION = &$_SESSION;
-                               }
-                               // fallback to the "old way"
-                               else
-                               {
-                                       $this->ref_GET = 
&$GLOBALS['HTTP_GET_VARS'];
-                                       $this->ref_POST = 
&$GLOBALS['HTTP_POST_VARS'];
-                                       $this->ref_SERVER = 
&$GLOBALS['HTTP_SERVER_VARS'];
-                                       //$this->ref_FILES = &$HTTP_POST_FILES;
-                                       $this->ref_FILES = 
&$GLOBALS['HTTP_POST_FILES'];
-                                       $this->ref_SESSION = 
&$GLOBALS['HTTP_SESSION_VARS'];
-                               }
-                       }
 
                        // SO object has data storage functions
                        if ($this->so == '##NOTHING##')
@@ -486,46 +450,6 @@
                                        $this->phpgw_before_xslt = True;
                                }
                        }
-                       /*
-                       // relfbecker recommends NOT using a version test for 
xslt check
-                       if ($this->phpgw_before_xslt == '-1')
-                       {
-                               $this_ver = 
$GLOBALS['phpgw_info']['server']['versions']['phpgwapi'];
-                               $pre_xslt_ver = '0.9.14.0.1.1';
-                               if (!$this_ver)
-                               {
-                                       // damn stupid fallback if the api 
moves the version to another place
-                                       $this->phpgw_before_xslt = True;
-                               }
-                               // this is a function in phpgwapi 
"common_functions" file for phpgw 0.9.15+
-                               elseif (function_exists(amorethanb))
-                               {
-                                       if (amorethanb($this_ver, 
$pre_xslt_ver))
-                                       {
-                                               // this phpgw version is after 
the switch to xslt templates
-                                               $this->phpgw_before_xslt = 
False;
-                                       }
-                                       else
-                                       {
-                                               // this phpgw version is NOT in 
the xslt era
-                                               $this->phpgw_before_xslt = True;
-                                       }
-                               }
-                               else
-                               {
-                                       if 
($GLOBALS['phpgw']->common->cmp_version_long($this_ver, $pre_xslt_ver))
-                                       {
-                                               // this phpgw version is after 
the switch to xslt templates
-                                               $this->phpgw_before_xslt = 
False;
-                                       }
-                                       else
-                                       {
-                                               // this phpgw version is NOT in 
the xslt era
-                                               $this->phpgw_before_xslt = True;
-                                       }
-                               }
-                       }
-                       */
                        
                        $this->known_external_args = array(
                                // === NEW GPC "OBJECTS" or Associative Arrays 
=== 
@@ -817,67 +741,35 @@
                // ----  BEGIN request from Mailserver / Initialize This Mail 
Session  -----
                function begin_request($args_array)
                {
-                       if ($this->debug_logins > 0) { 
$this->dbug->out('mail_msg.begin_request('.__LINE__.'): ENTERING'.'<br />'); } 
-                       if ($this->debug_logins > 1) { 
$this->dbug->out('mail_msg.begin_request('.__LINE__.'): feed var args_array[] 
DUMP:', $args_array); }
-                       
+                       $got_args=array();
                        // Grab GPC vars, after we get an acctnum, we'll put 
them in the appropriate account's "args" data
                        // issue?: which acctnum arg array would this be 
talking to when we inquire about "already_grab_class_args_gpc"?
-                       if ( 
($this->get_isset_arg('already_grab_class_args_gpc'))
-                       && 
((string)$this->get_arg_value('already_grab_class_args_gpc') != '') )
+                       if ( 
!$this->get_isset_arg('already_grab_class_args_gpc') )
                        {
-                               // somewhere, there's already been a call to 
grab_class_args_gpc(), do NOT re-run
-                               if ($this->debug_logins > 1) { 
$this->dbug->out('mail_msg.begin_request('.__LINE__.'): 
"already_grab_class_args_gpc" is set, do not re-grab<br />'); }
-                               if ($this->debug_logins > 2) { 
$this->dbug->out('mail_msg.begin_request('.__LINE__.'): 
"already_grab_class_args_gpc" pre-existing $this->get_all_args() DUMP:', 
$this->get_all_args()); } 
-                               $got_args=array();
-                       }
-                       else
-                       {
-                               if ($this->debug_logins > 1) { 
$this->dbug->out('mail_msg.begin_request('.__LINE__.'): 
"already_grab_class_args_gpc" is NOT set, call grab_class_args_gpc() now<br 
/>'); }
-                               $got_args=array();
                                $got_args = $this->grab_class_args_gpc();
                        }
                        
                        // FIND THE "BEST ACCTNUM" and set it
-                       if ($this->debug_logins > 1) { 
$this->dbug->out('mail_msg.begin_request('.__LINE__.'): about to call:  
get_best_acctnum($args_array, $got_args) <br />'); }
                        $acctnum = $this->get_best_acctnum($args_array, 
$got_args);
-                       if ($this->debug_logins > 1) { 
$this->dbug->out('mail_msg.begin_request('.__LINE__.'): "get_best_acctnum" 
returns $acctnum ['.$acctnum.']<br />'); }
-                       if ($this->debug_logins > 1) { 
$this->dbug->out('mail_msg.begin_request('.__LINE__.'): * * * *SETTING CLASS 
ACCTNUM* * * * by calling $this->set_acctnum('.serialize($acctnum).')<br />'); }
                        $this->set_acctnum($acctnum);
                        
                        // SET GOT_ARGS TO THAT ACCTNUM
                        // use that acctnum to set "got_args" to the appropiate 
acctnum
-                       if ($this->debug_logins > 1) { 
$this->dbug->out('mail_msg.begin_request('.__LINE__.'): about to call: 
$this->set_arg_array($got_args); <br />'); }
                        $this->set_arg_array($got_args, $acctnum);
-                       if ($this->debug_logins > 2) { 
$this->dbug->out('mail_msg.begin_request('.__LINE__.'): post set_arg_array 
$this->get_all_args() DUMP:', $this->get_all_args()); } 
                        
                        // Initialize Internal Args
-                       if ($this->debug_logins > 1) { 
$this->dbug->out('mail_msg.begin_request('.__LINE__.'): about to call: 
"init_internal_args_and_set_them('.$acctnum.')"<br />'); }
                        $this->init_internal_args_and_set_them($acctnum);
                        
-                       if ($this->debug_logins > 2) { 
$this->dbug->out('mail_msg.begin_request('.__LINE__.'): POST 
"grab_class_args_gpc", "get_best_acctnum", and 
"init_internal_args_and_set_them" : this->get_all_args() DUMP:', 
$this->get_all_args()); } 
-                       
-                       // (chopped out the re-use existing object code - never 
worked right, maybe later...)
-                       
                        // ----  Things To Be Done Whether You Login Or Not  
-----
-                       
                        // UNDER DEVELOPMEMT - backwards_compat with 
sessions_db where php4 sessions are not being used
                        // ALSO UNDER DEVELOPMENT - using private table for 
anglemail
                        if (($GLOBALS['phpgw_info']['server']['sessions_type'] 
== 'db')
                        || ($this->use_private_table == True))
                        {
-                               /*
-                               if (! is_object($this->so))
-                               {
-                                       $this->initialize_mail_msg();
-                               }
-                               */
-
-                               // REF_SESSION should not really be in 
$_SESSION namespace so RE-CREATE all this outside of php4 sessions
                                
$this->so->prep_db_session_compat('begin_request LINE '.__LINE__);
                        }
                        
                        
-                       if ($this->debug_logins > 1) { 
$this->dbug->out('mail_msg.begin_request('.__LINE__.'): about to handle email 
preferences and setup extra accounts<br />'); } 
                        // ----  Obtain Preferences Data  ----
                        
                        /*
@@ -1191,14 +1083,6 @@
                                // -end- extra account init handling
                        }
                        
-                       //if ($this->debug_logins > 2) { echo 
'mail_msg.begin_request('.__LINE__.'): POST create_email_preferences 
GLOBALS[phpgw_info][user][preferences][email] dump:<pre>'; 
print_r($GLOBALS['phpgw_info']['user']['preferences']['email']) ; echo 
'</pre>';}
-                       //if ($this->debug_logins > 2) { echo 
'mail_msg.begin_request('.__LINE__.'): POST create_email_preferences 
$this->get_all_prefs() dump:<pre>'; print_r($this->get_all_prefs()) ; echo 
'</pre>';}
-                       if ($this->debug_logins > 2) { 
$this->dbug->out('mail_msg.begin_request('.__LINE__.'): POST 
create_email_preferences direct access dump of $this->a DUMP:', $this->a); } 
-                       //if ($this->debug_logins > 2) { echo 
'mail_msg.begin_request('.__LINE__.'):  preferences->create_email_preferences 
called, GLOBALS[phpgw_info][user][preferences] dump:<pre>'; 
print_r($GLOBALS['phpgw_info']['user']['preferences']) ; echo '</pre>';}
-                       //if ($this->debug_logins > 2) { echo 
'mail_msg.begin_request('.__LINE__.'):  preferences->create_email_preferences 
called, GLOBALS[phpgw_info][user] dump:<pre>'; 
print_r($GLOBALS['phpgw_info']['user']) ; echo '</pre>';}
-                       //if ($this->debug_logins > 2) { echo 
'mail_msg.begin_request('.__LINE__.'): preferences->create_email_preferences 
called, GLOBALS[phpgw_info] dump:<pre>'; print_r($GLOBALS['phpgw_info']) ; echo 
'</pre>';}
-                       //if ($this->debug_logins > 2) { echo 
'mail_msg.begin_request('.__LINE__.'): preferences->create_email_preferences 
called, GLOBALS[phpgw] dump:<pre>'; print_r($GLOBALS['phpgw']) ; echo '</pre>';}
-                       
                        // ---- CACHE THE COMPLETED PREF DATA
                        if (($this->use_cached_prefs == True)
                        && (!$cached_prefs))
@@ -1249,16 +1133,19 @@
                                $cached_prefs['extra_accounts'] = 
$this->extra_accounts;
                                $cached_prefs['extra_and_default_acounts'] = 
$this->extra_and_default_acounts;
                                $cached_prefs['a'] = array();
-                               $defang_these = array();
-                               $defang_these[0] = 'passwd';
-                               $defang_these[1] = 'email_sig';
-                               $defang_these[2] = 'trash_folder_name';
-                               $defang_these[3] = 'sent_folder_name';
-                               $defang_these[4] = 'userid';
-                               $defang_these[5] = 'address';
-                               $defang_these[6] = 'mail_folder';
-                               $defang_these[7] = 'fullname';
-                               $defang_these[8] = 'account_name';
+                               $defang_these = array
+                               (
+                                       'passwd',
+                                       'email_sig',
+                                       'trash_folder_name',
+                                       'sent_folder_name',
+                                       'userid',
+                                       'address',
+                                       'mail_folder',
+                                       'fullname',
+                                       'account_name'
+                               );
+
                                $loops = 
count($this->extra_and_default_acounts);
                                for ($i=0; $i < $loops; $i++)
                                {
@@ -1282,7 +1169,7 @@
                        }
                        
                        // ---- SET important class vars  ----
-                       $this->att_files_dir = 
$GLOBALS['phpgw_info']['server']['temp_dir'].SEP.$GLOBALS['phpgw_info']['user']['sessionid'];
+                       $this->att_files_dir = 
"{$GLOBALS['phpgw_info']['server']['temp_dir']}/{$GLOBALS['phpgw_info']['user']['sessionid']}";
                        
                        // and.or get some vars we will use later in this 
function
                        $mailsvr_callstr = 
$this->get_arg_value('mailsvr_callstr');
@@ -1448,30 +1335,6 @@
                                        
$this->set_arg_value('mailsvr_account_username', $user, $acctnum);
                                }
                        }
-                       /*
-                       elseif ($args_array['do_login_ex'] == 
BS_LOGIN_ONLY_IF_NEEDED)
-                       {
-                               // if extreme is on and 
"BS_LOGIN_ONLY_IF_NEEDED" then that's taken care of above, 
-                               // therefor
-                               // * if we are here then caching is NOT on
-                               // * we are told a login is "not 100% necessary"
-                               // in that case we'll pass thru this function 
without logging in
-                               // and rely on the rest of the code to open a 
stream if it is needed
-                               $decision_to_login = False;
-                               
-                               // get a few more things that we would 
otherwise get during the login code (which we'll be skiping)
-                               $processed_folder_arg = 
$this->get_best_folder_arg($args_array, $got_args, $acctnum);
-                               if ($this->debug_logins > 1) { 
$this->dbug->out('mail_msg: begin_request ('.__LINE__.'): we are NOT allowed to 
log in (see code this line) but we still need to get this info, so about to 
issue: $this->set_arg_value("folder", '.$processed_folder_arg.', 
'.serialize($acctnum).')<br />'); }
-                               $this->set_arg_value('folder', 
$processed_folder_arg, $acctnum);
-                               if ( $this->get_isset_pref('userid')
-                               && ($this->get_pref_value('userid') != ''))
-                               {
-                                       $user = $this->get_pref_value('userid');
-                                       if ($this->debug_logins > 1) { 
$this->dbug->out('mail_msg: begin_request ('.__LINE__.'): we are NOT allowed to 
log in (see code this line) but we still need to get this info, so about to 
issue: $this->set_arg_value("mailsvr_account_username", '.$user.', 
'.serialize($acctnum).')<br />'); }
-                                       
$this->set_arg_value('mailsvr_account_username', $user, $acctnum);
-                               }
-                       }
-                       */
                        else
                        {
                                // extreme caching and logins handled above in 
the first if .. then
@@ -1570,21 +1433,16 @@
                                //@set_time_limit(60);
                                // login to INBOX because we know that 
always(?) should exist on an imap server and pop server
                                // after we are logged in we can get additional 
info that will lead us to the desired folder (if not INBOX)
-                               if ($this->debug_logins > 1) { 
$this->dbug->out('mail_msg.begin_request('.__LINE__.'): about to call 
dcom->open: 
$GLOBALS["phpgw_dcom_".$acctnum('.$acctnum.')]->dcom->open('.$mailsvr_callstr."INBOX".',
 '.$user.', '.$pass.', )'.'<br />'); }
-                               if ($this->debug_logins > 0) { 
$this->dbug->out('mail_msg.begin_request('.__LINE__.'): <font color="red">MAIL 
SERVER COMMAND</font>'.'<br />'); } 
                                $mailsvr_stream = 
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->open($mailsvr_callstr."INBOX", $user, 
$pass, '');
                                $pass = '';
-                               //@set_time_limit(0);
                                
                                if ($this->debug_logins > 1) { 
$this->dbug->out('mail_msg.begin_request('.__LINE__.'): open returns 
$mailsvr_stream = ['.serialize($mailsvr_stream).']<br />'); } 
                                
                                // Logged In Success or Faliure check
-                               if ( (!isset($mailsvr_stream))
-                               || ($mailsvr_stream == '') )
+                               if ( !$mailsvr_stream )
                                {
                                        // set the "mailsvr_stream" to blank so 
all will know the login failed
                                        $this->set_arg_value('mailsvr_stream', 
'');
-                                       if ($this->debug_logins > 0) { 
$this->dbug->out('mail_msg.begin_request('.__LINE__.'): LEAVING with ERROR: 
failed to open mailsvr_stream : '.$mailsvr_stream.'<br />'); } 
                                        // we return false, but SHOULD WE ERROR 
EXIT HERE?
                                        return False;
                                }
@@ -1771,12 +1629,11 @@
                the source or destination mail  server stream is open and the 
required folder is selected. If not, this 
                function will open the connection and select the desired folder.
                */
-               function ensure_stream_and_folder($fldball='', $called_from='')
+               function ensure_stream_and_folder($fldball='', $called_from='', 
$display_error = true)
                {
                        if ($this->debug_logins > 0) { 
$this->dbug->out('mail_msg: ensure_stream_and_folder: ENTERING, $fldball: 
['.serialize($fldball).'] ; $called_from: ['.$called_from.']<br />'); }
                        
-                       if ((isset($fldball['acctnum']))
-                       && ((string)$fldball['acctnum'] != ''))
+                       if ( isset($fldball['acctnum']) && 
(string)$fldball['acctnum'] != '' )
                        {
                                $acctnum = (int)$fldball['acctnum'];
                        }
@@ -1784,20 +1641,13 @@
                        {
                                $acctnum = $this->get_acctnum();
                        }
-                       if ((isset($fldball['folder']))
-                       && ((string)$fldball['folder'] != ''))
+                       if ( isset($fldball['folder']) 
+                                       && (string)$fldball['folder'] != '' )
                        {
                                $input_folder_arg = $fldball['folder'];
-                               //$input_folder_arg = 
urldecode($fldball['folder']);
-                               //$input_folder_arg = 
$this->prep_folder_in($fldball['folder']);
                        }
                        else
                        {
-                               // an empty string means folder is NOT 
important, such as with "listmailbox"
-                               //$input_folder_arg = '';
-                               
-                               // DAMN - this thing has been moved to the 
"no_select_away"
-                               // therefor this *should* be INBOX if none was 
given
                                $input_folder_arg = 'INBOX';
                        }
                        
@@ -1809,15 +1659,15 @@
                        $ctrl_info['do_reopen_to_folder'] = '';
                        
                        // fill it with what we know
-                       if (($this->get_isset_arg('folder', $acctnum))
-                       && ($this->get_arg_value('folder', $acctnum) != ''))
+                       if ( $this->get_isset_arg('folder', $acctnum) 
+                                       && $this->get_arg_value('folder', 
$acctnum) != '' )
                        {
                                $ctrl_info['pre_existing_folder_arg'] = 
$this->get_arg_value('folder', $acctnum);
                                // folder arg is stored urlDEcoded, but fldball 
and all other folder stuff is urlENcoded until the last second
                                $ctrl_info['pre_existing_folder_arg'] = 
$this->prep_folder_out($ctrl_info['pre_existing_folder_arg']);
                        }
-                       if ((isset($fldball['no_switch_away']))
-                       && ($fldball['no_switch_away']))
+                       if ( isset($fldball['no_switch_away'])
+                                       && $fldball['no_switch_away'] )
                        {
                                // "no_switch_away" means folder is NOT 
important, such as with "listmailbox"
                                if ($this->debug_logins > 1) { 
$this->dbug->out('mail_msg: ensure_stream_and_folder: there may be NO need to 
switch folders: setting $ctrl_info[no_switch_away] because 
$fldball[no_switch_away] is ['.serialize($fldball['no_switch_away']).'],  
$called_from: ['.$called_from.']<br />'); } 
@@ -1862,7 +1712,7 @@
                                {
                                        $user = $this->get_pref_value('userid', 
$acctnum);
                                }
-                               else
+                               else if ( $display_error )
                                {
                                                echo 'mail_msg: 
ensure_stream_and_folder: ERROR: userid or passwd empty'."<br />\r\n"
                                                        .' * * 
$this->get_pref_value(userid, '.$acctnum.') = '
@@ -1898,57 +1748,35 @@
                                //@set_time_limit(0);
                                if ($this->debug_logins > 1) { 
$this->dbug->out('mail_msg: ensure_stream_and_folder: open returns 
$mailsvr_stream = ['.serialize($mailsvr_stream).']<br />'); } 
                                
-                               if ( (!isset($mailsvr_stream)) || 
($mailsvr_stream == '') )
+                               if ( !$mailsvr_stream )
                                {
+                                       $mailsvr_stream_test2 = 
$this->get_arg_value('mailsvr_stream', $acctnum);
+                                       if ( $mailsvr_stream_test2 )
+                                       {
+                                               // recursive call to this 
function has done the job for us
+                                               if ($this->debug_logins > 0) { 
$this->dbug->out('mail_msg: ensure_stream_and_folder: LEAVING, apparently a 
recursive call to this function fixed the RH bug for us, returning 
$this->get_arg_value(mailsvr_stream, '.$acctnum.') 
['.$mailsvr_stream_test2.']<br />'); }
+                                               // IF THE RECURSIVE FUNCION DID 
THE JOB, I GUESS WE JUST EXIT NOW
+                                               return $mailsvr_stream_test2;
+                                       }
+                                       if ( $display_error )
+                               {
                                        if ($this->debug_logins > 1) { 
$this->dbug->out('mail_msg: ensure_stream_and_folder ('.__LINE__.'): 
$mailsvr_stream FAILS ['.serialize($mailsvr_stream).']<br />'); } 
                                        
//$this->set_arg_value('mailsvr_stream', '', $acctnum);
                                        // this error function will try to call 
this function again to attempt RedHat bug recovery
                                        // the 
"ensure_stream_and_folder_already_tried_again" lets us try again before exiting
                                        // otherwise the code would never 
continue below to a place where recovery could be detected
-                                       
//$GLOBALS['phpgw']->msg->login_error($GLOBALS['PHP_SELF'].', mail_msg: 
ensure_mail_msg_exists(), called_from: '.$called_from);
+                                               
//$GLOBALS['phpgw']->msg->login_error($_SERVER['PHP_SELF'].', mail_msg: 
ensure_mail_msg_exists(), called_from: '.$called_from);
                                        // DIRECTLY call the retry logic
                                        $mail_server_type = 
$this->get_pref_value('mail_server_type', $acctnum);
                                        
//$this->loginerr_tryagain_buggy_cert('ensure_stream_and_folder line 
('.__LINE__.'), which was called_from: '.$called_from, 'error_report_HUH?', 
$mail_server_type, $acctnum);
                                        // oops, that means we just skipped 
possible showing the right login error message
-                                       
$this->login_error($GLOBALS['PHP_SELF'].', mail_msg: 
ensure_stream_and_folder(), called_from: '.$called_from, $acctnum);
-                                       
-                                       //if ($this->debug_logins > 0) { echo 
'mail_msg: ensure_stream_and_folder: LEAVING with ERROR: failed to open 
mailsvr_stream : '.$mailsvr_stream.'<br />';}
-                                       //return False;
-                                       if ($this->debug_logins > 1) { 
$this->dbug->out('mail_msg: ensure_stream_and_folder ('.__LINE__.'): code just 
called the "login_error" function, did we get to here?<br />'); } 
-                               }
-                               
-                               // if we get here either 
-                               // (a) all is fine and dandy, 
-                               // or (b) then the error function has called us 
again with the RehHat buggy server fix attempt
-                               // in case of (b) we need to test the 
$mailsvr_stream again
-                               // if the failure was not recoverable or if 
already tried, the above error function would have exited the script by now
-                               if ( (!isset($mailsvr_stream)) || 
($mailsvr_stream == '') )
-                               {
-                                       if ($this->debug_logins > 1) { 
$this->dbug->out('mail_msg: ensure_stream_and_folder ('.__LINE__.'): 2nd test, 
$mailsvr_stream fails ['.serialize($mailsvr_stream).'] as expected, but the 
recursive call may have left behind a a sign this has been fixed ...<br />'); } 
-                                       // try to obtain the mailsvr_stream 
that the recursive call to here may have left for us
-                                       $mailsvr_stream_test2 = 
$this->get_arg_value('mailsvr_stream', $acctnum);
-                                       if ( (isset($mailsvr_stream_test2))
-                                       && ((string)$mailsvr_stream_test2 != 
'') )
-                                       {
-                                               // recursive call to this 
function has done the job for us
-                                               if ($this->debug_logins > 0) { 
$this->dbug->out('mail_msg: ensure_stream_and_folder: LEAVING, apparently a 
recursive call to this function fixed the RH bug for us, returning 
$this->get_arg_value(mailsvr_stream, '.$acctnum.') 
['.$mailsvr_stream_test2.']<br />'); }
-                                               // IF THE RECURSIVE FUNCION DID 
THE JOB, I GUESS WE JUST EXIT NOW
-                                               return $mailsvr_stream_test2;
+                                               return 
$this->login_error($_SERVER['PHP_SELF'].', mail_msg: 
ensure_stream_and_folder(), called_from: '.$called_from, $acctnum);
                                        }
-                                       else
-                                       {
-                                               if ($this->debug_logins > 0) { 
$this->dbug->out('mail_msg: ensure_stream_and_folder: LEAVING, 2nd test using 
$mailsvr_stream_test2 looked for recursive fix but not found, now calling 
this->login_error which will exit the script probably<br />'); }
-                                               
//$GLOBALS['phpgw']->msg->login_error($GLOBALS['PHP_SELF'].', mail_msg 
('.__LINE__.'): ensure_mail_msg_exists(), called_by: '.$called_by);
-                                               
$this->login_error($GLOBALS['PHP_SELF'].', mail_msg ('.__LINE__.'): 
ensure_stream_and_folder(), called_by: '.$called_by);
-                                               if ($this->debug_logins > 1) { 
$this->dbug->out('mail_msg: ensure_stream_and_folder ('.__LINE__.'): 2nd test, 
code just called the "login_error" function, did we get to here?<br />'); } 
-                                       }
+                                       return false;
                                }
-                               else
-                               {
-                                       // if login_error is able to recover, 
it will set "mailsvr_stream", we do not want to over write the recovered 
mailsvr_stream
-                                       if ($this->debug_logins > 1) { 
$this->dbug->out('mail_msg: ensure_stream_and_folder ('.__LINE__.'): 
$mailsvr_stream is GOOD<br />'); } 
+
                                        $this->set_arg_value('mailsvr_stream', 
$mailsvr_stream, $acctnum);
-                               }
+
                                
$this->set_arg_value('mailsvr_account_username', $user, $acctnum);
                                // SET FOLDER ARG NOW because we'll need to 
check against it below!!!
                                // WHY: because we DID actually OPEN a stream 
AND we DID select the INBOX
@@ -2111,67 +1939,49 @@
                        if ($this->debug_logins > 0) { 
$this->dbug->out('mail_msg: login_error('.__LINE__.'): $error_report 
['.$error_report.']<br />'); }
                        
                        // ATTEMPT TO RECOVER FROM KNOWS PHP BUG even if 
"Certificate failure" is not obvious
-                       $always_try_recover = True;
+                       $always_try_recover = true;
                        
                        if 
($this->get_isset_arg('beenthere_loginerr_tryagain_buggy_cert', $acctnum))
                        {
                                if ($this->debug_logins > 0) { 
$this->dbug->out('mail_msg: login_error('.__LINE__.'): ALREADY TRIED THIS: this 
arg is set: "beenthere_loginerr_tryagain_buggy_cert"<br />'); } 
                        }
-                       elseif ((stristr($imap_err,'Certificate failure'))
-                       || ($always_try_recover == True))
+                       else if ( preg_match('/certificate failure/i', 
$imap_err) || $always_try_recover )
                        {
                                $mail_server_type = 
$this->get_pref_value('mail_server_type', $acctnum);
                                // onhy happens with non-ssl connections
-                               if (($mail_server_type == 'pop3')
-                               || ($mail_server_type == 'imap'))
+                               if ( $mail_server_type == 'pop3' || 
$mail_server_type == 'imap' )
                                {
-                                       if ($this->debug_logins > 0) { 
$this->dbug->out('mail_msg: login_error('.__LINE__.'): LEAVING, with call to: 
$this->loginerr_tryagain_buggy_cert('.$called_from.', '.$error_report.', 
'.$mail_server_type.', '.$acctnum.');<br />'); } 
-                                       
$this->loginerr_tryagain_buggy_cert($called_from, $error_report, 
$mail_server_type, $acctnum);
-                                       return;
+                                       return 
$this->loginerr_tryagain_buggy_cert($called_from, $error_report, 
$mail_server_type, $acctnum);
                                }
                                // not recoverable, continue with error report
                        }
                        if ($this->debug_logins > 0) { 
$this->dbug->out('mail_msg: login_error('.__LINE__.'): this is not an error 
related to RH Cert issue because server string is already (apparently) correct 
in that respect.<br />'); }
                        
-                       /*
-                       // this should be templated
-                       echo "<p><center><b>"
-                         . lang("There was an error trying to connect to your 
mail server.<br />Please, check your username and password, or contact your 
admin.")."<br /> \r\n"
-                         ."source: email class.mail_msg_base.inc.php"."<br /> 
\r\n"
-                         ."called from: ".$called_from."<br /> \r\n"
-                         ."imap_last_error: [".$error_report."]<br /> \r\n"
-                         ."tried RH bug recovery?: 
[".$this->get_isset_arg('beenthere_loginerr_tryagain_buggy_cert', $acctnum)."] 
<br /> \r\n"
-                         ."if there is no obvious error, then check your 
username and password first.<br /> \r\n"
-                         . "</b></center></p>"
-                         .'<p><center>'
-                         .'<a 
href="'.$GLOBALS['phpgw']->link('/index.php').'">Click here to continue.</a>'
-                         .'</center></p>'."<br /> \r\n";
-                       */
                        // we could just return this text
                        $error_text_plain = 
-                         lang("There was an error trying to connect to your 
mail server.<br />Please, check your username and password, or contact your 
admin.")."\r\n"
-                         ."source: email class.mail_msg_base.inc.php"."\r\n"
-                         ."called from: ".$called_from."\r\n"
-                         ."imap_last_error: [".$error_report."]\r\n"
-                         ."tried RH bug recovery?: 
[".$this->get_isset_arg('beenthere_loginerr_tryagain_buggy_cert', 
$acctnum)."]\r\n"
-                         .lang('if there is no obvious error, check your 
username and password first.')."\r\n";
+                         lang("There was an error trying to connect to your 
mail server.<br />Please, check your username and password, or contact your 
admin.")."\n"
+                         ."source: email class.mail_msg_base.inc.php"."\n"
+                         ."called from: {$called_from}\n"
+                         ."imap_last_error: [{$error_report}]\n"
+                         ."tried RH bug recovery?: 
[".$this->get_isset_arg('beenthere_loginerr_tryagain_buggy_cert', 
$acctnum)."]\n"
+                         .lang('if there is no obvious error, check your 
username and password first.')."\n";
                        // or use this text in an html error report
                        $error_text_formatted = 
-                         lang("There was an error trying to connect to your 
mail server.<br />Please, check your username and password, or contact your 
admin.")."<br /> \r\n"
-                         ."<br /> \r\n"
-                         ."<br /> \r\n"
-                         ."source: email class.mail_msg_base.inc.php"."<br /> 
\r\n"
-                         ."<br /> \r\n"
-                         ."called from: ".$called_from."<br /> \r\n"
-                         ."<br /> \r\n"
-                         ."imap_last_error: [".$error_report."]<br /> \r\n"
-                         ."tried RH bug recovery?: 
[".$this->get_isset_arg('beenthere_loginerr_tryagain_buggy_cert', $acctnum)."] 
<br /> \r\n"
-                         ."<br /> \r\n"
-                         ."<br /> \r\n"
-                         .lang('if there is no obvious error, check your 
username and password first.')."<br /> \r\n";
+                         '<div class="error">'
+                         .lang("There was an error trying to connect to your 
mail server.<br />Please, check your username and password, or contact your 
admin.")."<br>\n"
+                         ."<br>\n"
+                         ."source: email class.mail_msg_base.inc.php<br>\n"
+                         ."<br>\n"
+                         ."called from: {$called_from}<br>\n"
+                         ."<br>\n"
+                         ."imap_last_error: [{$error_report}]<br\n"
+                         ."tried RH bug recovery?: 
[".$this->get_isset_arg('beenthere_loginerr_tryagain_buggy_cert', $acctnum)."] 
<br>\n"
+                         ."<br>\n"
+                         .lang('if there is no obvious error, check your 
username and password first.')."<br>\n</div>\n";
                        // HOW we were called determines HOW we display the 
error 
-                       if (stristr($this->ref_SERVER['REQUEST_URI'] 
,'index.php?menuaction=email'))
+                       if ( preg_match('/menuaction=email/', 
phpgw::get_var('REQUEST_URI', 'string', 'SERVER') ) ) 
                        {
+                               $GLOBALS['phpgw']->common->phpgw_header(true);
                                // we were called from within the email app 
itself
                                // so show the error PAGE and then have it EXIT 
for us
                                // use the error report page widget
@@ -2179,7 +1989,7 @@
                                $widgets->init_error_report_values();
                                
$widgets->prop_error_report_text($error_text_formatted);
                                
-                               if ((string)$acctnum == '0')
+                               if ( $acctnum == 0 )
                                {
                                        $go_somewhere_url = 
$GLOBALS['phpgw']->link('/index.php',array(
                                                                                
                                        'menuaction' => 
'email.uipreferences.preferences',
@@ -2197,21 +2007,11 @@
                                
                                if ($this->debug_logins > 0) { 
$this->dbug->out('mail_msg: login_error('.__LINE__.'): LEAVING, called from 
within the email app, so use out own error page and exit.<br />'); }
                                // by putting anything (or TRUE) in the param 
of this function, it will shutdown the script for us.
-                               $widgets->display_error_report_page('do_exit');
-                               // we should not get here if the error widget 
exits for us
-                               //$GLOBALS['phpgw']->common->phpgw_exit();
-                       }
-                       else
-                       {
-                               // we were called by another app, maybe the 
home page, do not monopolize the page, but DO EXIT the script so we don't loop
-                               if ($this->debug_logins > 0) { 
$this->dbug->out('mail_msg: login_error('.__LINE__.'): LEAVING, we were called 
by another app, the home page perhaps, so simple output the message and common 
EXIT (return causes a loop).<br />'); }
-                               //echo 
'<center><b>'.$error_text_plain.'</b></center>';
-                               echo 
'<center><b>'.$error_text_formatted.'</b></center>'."<br /> \r\n";
-                               $GLOBALS['phpgw']->common->phpgw_exit();
-                       }
-                       // we should not get here
+                               $widgets->display_error_report_page(true);
                        $GLOBALS['phpgw']->common->phpgw_exit(False);
                }
+                       return false;
+               }
                
                /*!
                @function loginerr_tryagain_buggy_cert
@@ -2240,27 +2040,6 @@
                        // avoid infinite RECURSION by setting this flag, says 
we've alreasy been here
                        if ($this->debug_logins > 1) { 
$this->dbug->out('mail_msg: loginerr_tryagain_buggy_cert('.__LINE__.'): setting 
flag "beenthere_loginerr_tryagain_buggy_cert" to "beenthere" so we know we have 
been here.<br />'); } 
                        
$this->set_arg_value('beenthere_loginerr_tryagain_buggy_cert', 'beenthere', 
$acctnum);
-                       /*!
-                       @capability "show_recover_msg" during 
loginerr_tryagain_buggy_cert
-                       @abstract whether ot not to show the user a 
"show_recover_msg" 
-                       @discussion set this "show_recover_msg" var to True to 
show the user an error 
-                       message during the recovery from the initial error a 
RH73+ php imap module can cause. 
-                       Or set "show_recover_msg" to False to not show such a 
message. NOTE the error generated 
-                       by php itself is controlled by your ini file settings, 
show_errors and log_errors.
-                       */
-                       //$show_recover_msg = True;
-                       $show_recover_msg = False;
-                       if ($show_recover_msg == True)
-                       {
-                               // this should be templated
-                               //echo "<br /><center><b>"
-                               //  .'You have encountered a <u>KNOWN PHP - 
UWASH bug</u>, called the "<u>non-ssl no validate cert bug</u>"'
-                               //  .' attempting to recover ...'.'<br 
/>'."\r\n"
-                               //  . "</b></center><br />";
-                               echo '<small><i>'
-                                               .'Please ignore this message, 
you will only see this once on login'
-                                       .'</i></small><br />'."\r\n";
-                       }
                        
                        // MAKE A NEW MAILSVR_CALLSTR with the "novalidate-cert"
                        // UPDATE: using "notls" because user did not 
specifically request encryption
@@ -2281,10 +2060,14 @@
                        
//elseif(stristr($old_mailsvr_callstr,'novalidate-cert'))
                        elseif(stristr($old_mailsvr_callstr,'notls'))
                        {
-                               echo "<p><center><b>"
-                                 .'detected that there has already been an 
attempting to recover that failed'.'<br />'."\r\n"
-                                 .'exiting...'
-                                 . "</b></center></p>";
+                               return false;
+                               echo <<<HTML
+                                       <div class="error">
+                                               Detected that there has already 
been an attempt to recover that failed<br>
+                                               exiting...'
+                                       </div>
+
+HTML;
                                if ($this->debug_logins > 0) { 
$this->dbug->out('mail_msg: loginerr_tryagain_buggy_cert('.__LINE__.'): 
LEAVING, calling $this->login_error because it will show the error msg to the 
user.<br />'); }
                                //$GLOBALS['phpgw']->common->phpgw_exit(False);
                                $this->login_error('mail_msg: 
loginerr_tryagain_buggy_cert(LINE '.__LINE__.'), called_from: '.$called_from, 
$acctnum);
@@ -2837,36 +2620,17 @@
                name string, such as a bare forward slash, or dot dot slash, 
etc. 
                @access private or public 
                */
-               function uwash_string_ok($namespace='')
+               function uwash_string_ok($ns = '')
                {
-                       // it os OK unless we find bad stuff
-                       $is_ok = True;
-                       $ns = trim($namespace);
-                       if ($ns == '')
+                       $ns = trim($ns);
+                       if ( $ns == '' 
+                               || $ns == '/'
+                               || preg_match('#\./|/\.|\.\.#', $ns) )
                        {
-                               $is_ok = False;
+                               return false;
                        }
-                       elseif (($ns == '/')
-                       || ($ns == SEP))
-                       {
-                               $is_ok = False;
-                       }
-                       elseif ((stristr($ns,'..'))
-                       || (stristr($ns,'./'))
-                       || (stristr($ns,'/.')))
-                       {
-                               $is_ok = False;
-                       }
-                       // return False if bad, else return the ns we verified 
as OK    
-                       if ($is_ok == True)
-                       {
                                return $ns;
                        }
-                       else
-                       {
-                               return False;
-                       }
-               }
                
                /*!
                @function  get_mailsvr_delimiter
@@ -2905,33 +2669,21 @@
                                return $class_cached_mailsvr_delimiter;
                        }
                        
-                       //if ($this->debug_args_special_handlers > 0) { 
$this->dbug->out('mail_msg: get_mailsvr_delimiter: 
$this->get_pref_value(imap_server_type, '.$acctnum.') returns: 
['.$this->get_pref_value('imap_server_type', $acctnum).'] ; api var SEP: 
['.serialize(SEP).']<br />'); }
                        if ($this->get_pref_value('imap_server_type', $acctnum) 
== 'UWash')
                        {
-                               //$delimiter = '/';
-                               //$delimiter = SEP;
+                               $delimiter = '/';
                                
+                               // Comment from Angles
                                // UWASH is a filesystem based thing, so the 
delimiter is whatever the system SEP is
                                // unix = /  and win = \ (win maybe even "\\" 
because the backslash needs escaping???
                                // currently the filesystem seterator is 
provided by phpgw api as constant "SEP"
-                               if ($this->debug_args_special_handlers > 1) { 
$this->dbug->out('mail_msg: get_mailsvr_delimiter: imap_server_type is UWash<br 
/>'); }
-                               if (!SEP)
-                               {
-                                       $delimiter = '/';
-                               }
-                               else
-                               {
-                                       $delimiter = SEP;
-                               }
+                               //
+                               // why this is wrong from skwashd jan08
+                               // The UWIMAP server could be running on a 
different box - we need to be smarter about 
+                               // this, but this will do for now.
                        }
                        else
                        {
-                               // GENERIC IMAP DELIMITER
-                               // imap servers usually use a "." as their 
delimiter
-                               // this is supposed to be discoverable with the 
NAMESPACE command
-                               // see http://www.rfc-editor.org/rfc/rfc2342.txt
-                               // however as of PHP 4.0 this is not implemented
-                               if ($this->debug_args_special_handlers > 1) { 
$this->dbug->out('mail_msg: get_mailsvr_delimiter: imap_server_type is OTHER 
than UWash<br />'); }
                                $delimiter = '.';
                        }
                        // cache the result to "level 1 cache" class arg holder 
var
@@ -3103,36 +2855,26 @@
                        return $sucess;
                }
                
-               /*!
-               @function get_folder_list
-               @abstract  list of folders in a numbered array, each element 
has 2 properties, "folder_long" and "folder_short"
-               @param $acctnum (int) OPTIONAL
-               @param $force_refresh   boolean, will cause any cached folder 
data to expire, and "fresh" data is retrieved from the mailserver
-               @return   array   numbered, with each numbered element having 
array keys  "folder_long" and "folder_short"
-               @discussion  returns a numbered array, each element has 2 
properties, "folder_long" and "folder_short"
-               so every available folder is in the structure in both long form 
[namespace][delimiter][foldername]
-               and short form (does not have the [namespace][delimiter] prefix 
to the folder name)
-               This function can cache data in 2 ways
-               (1) caching as server data in the prefs DB cache department, and
-               (2) in the class var $this->get_arg_value("folder_list")
-               Data will be grabbed from cache when available and when allowed.
-               CACHE NOTE: this item is saved in the appsession cache.         
-               @access private  - public access is 
object->get_arg_value("folder_list") but may be 
-               called directly if you need to manually force_refresh any 
cached data, although this is still for 
-               private use as well.
+               /**
+               * list of folders in a numbered array, each element has 2 
properties, "folder_long" and "folder_short"
+               *
+               * @internal this method should be accessed via 
this->get_arg_value("folder_list") but may be 
+               *       called directly if you need to manually force_refresh
+               * @param int $acctnum the account to use
+               * @param bool $force_refresh should the cache be disregarded
+               * @return array folder data with each element containing keys  
"folder_long" and "folder_short"
                */
-               function get_folder_list($acctnum='', $force_refresh=False)
+               public function get_folder_list($acctnum = -1, 
$force_refresh=False)
                {
                        if ($this->debug_args_special_handlers > 0) { 
$this->dbug->out('mail_msg: get_folder_list: ENTERING<br />'); }
                        // what acctnum is operative here, we can only get a 
folder list for one account at a time (obviously)
-                       if ((!isset($acctnum))
-                       || ((string)$acctnum == ''))
+                       if ( $acctnum == -1)
                        {
                                $acctnum = $this->get_acctnum();
                        }
                        if ($this->debug_args_special_handlers > 1) { 
$this->dbug->out('mail_msg: get_folder_list: for the rest of this function we 
will use $acctnum: ['.$acctnum.'] <br />'); }
                        // hardcore debug
-                       if (stristr($this->skip_args_special_handlers, 
'get_folder_list'))
+                       if ( preg_match('/get_folder_list/', 
$this->skip_args_special_handlers) )
                        {
                                $fake_return = array();
                                $fake_return[0] = array();
@@ -3143,39 +2885,17 @@
                                return $fake_return;
                        }
                        
-                       //if ($this->debug_args_special_handlers > 2) { 
$this->dbug->out('mail_msg: get_folder_list: 
$this->_direct_access_arg_value(folder_list, '.$acctnum.') dump:<pre>'; 
print_r($this->_direct_access_arg_value('folder_list', $acctnum)); echo 
'</pre>'); }
-                       
-                       // check if class dcom reports that the folder list has 
changed
-                       // is this accounts dcom object has not been created 
yet, then obviously we did not just change its folder list
-                       // NOTE THIS IS OBSOLETED - THE DCOM CLASS NOW USES 
CALLBACK FUNCTION "folder_list_change_callback"
-                       if ((isset($GLOBALS['phpgw_dcom_'.$acctnum]->dcom) && 
is_object($GLOBALS['phpgw_dcom_'.$acctnum]->dcom))
-                       && 
($GLOBALS['phpgw_dcom_'.$acctnum]->dcom->folder_list_changed == True))
-                       {
-                               // class dcom recorded a change in the folder 
list
-                               // supposed to happen when create or delete 
mailbox is called
-                               // reset the changed flag
-                               
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->folder_list_changed = False;
-                               // set up for a force_refresh
-                               $force_refresh = True;
-                               if ($this->debug_args_special_handlers > 1) { 
$this->dbug->out('mail_msg: get_folder_list: class dcom report folder list 
changed<br />'); }
-                               if ($this->debug_args_special_handlers > 1) { 
$this->dbug->out('mail_msg: get_folder_list: make sure folder data is removed 
from cache <br />'); }
-                               // expire appsession cache
-                               $this->expire_session_cache_item('folder_list', 
$acctnum);
-                       }
-       
                        // see if we have object class var cached data that we 
can use
                        $class_cached_folder_list = 
$this->_direct_access_arg_value('folder_list', $acctnum);
-                       if ($this->debug_args_special_handlers > 2) { 
$this->dbug->out('mail_msg: get_folder_list: 
$this->_direct_access_arg_value(folder_list, '.$acctnum.') DUMP:', 
$this->_direct_access_arg_value('folder_list', $acctnum)); }
-                       if ((count($class_cached_folder_list) > 0)
-                       && ($force_refresh == False))
+                       if ( count($class_cached_folder_list) > 0 && 
!$force_refresh == False)
                        {
                                // use the cached data
                                if ($this->debug_args_special_handlers > 2) { 
$this->dbug->out(' * * $class_cached_folder_list DUMP:', 
$class_cached_folder_list); }
                                if ($this->debug_args_special_handlers > 0) { 
$this->dbug->out('mail_msg: get_folder_list: LEAVING,  using object cached 
folder list data<br />'); }
                                return $class_cached_folder_list;
                        }
-                       elseif (($this->get_pref_value('mail_server_type', 
$acctnum) == 'pop3')
-                       || ($this->get_pref_value('mail_server_type', $acctnum) 
== 'pop3s'))
+                       else if ( $this->get_pref_value('mail_server_type', 
$acctnum) == 'pop3'
+                               || $this->get_pref_value('mail_server_type', 
$acctnum) == 'pop3s' )
                        {
                                // normalize the folder_list property
                                $my_folder_list = array();
@@ -3189,7 +2909,7 @@
                                if ($this->debug_args_special_handlers > 0) { 
$this->dbug->out('mail_msg: get_folder_list: LEAVING,  pop3 servers only have 
one folder: INBOX<br />'); }
                                return $my_folder_list;
                        }
-                       elseif ($force_refresh == False)
+                       else if ( !$force_refresh )
                        {
                                // -----------
                                // TRY CACHED DATA FROM APPSESSION
@@ -3198,23 +2918,18 @@
                                $appsession_cached_folder_list = 
$this->read_session_cache_item('folder_list', $acctnum);
                                if ($appsession_cached_folder_list)
                                {
-                                       if ($this->debug_args_special_handlers 
> 1) { $this->dbug->out('mail_msg: get_folder_list: got appsession cached 
data<br />'); }
                                        $cached_data = 
$appsession_cached_folder_list;
-                                       if ($this->debug_args_special_handlers 
> 2) { $this->dbug->out('mail_msg: get_folder_list: appsession cached data 
DUMP:', $cached_data); }
                                        // we no longer need this var
-                                       $appsession_cached_folder_list = '';
                                        unset($appsession_cached_folder_list);
                                }
                                else
                                {
-                                       if ($this->debug_args_special_handlers 
> 1) { $this->dbug->out('mail_msg: get_folder_list: NO appsession cached data 
was available<br />'); }
                                        $cached_data = False;
                                }
                                
                                // if there's no data we'll get back a FALSE
-                               if ($cached_data && is_array($cached_data))
+                               if ( $cached_data && is_array($cached_data) )
                                {
-                                       //if 
($this->debug_args_special_handlers > 1) { echo 'mail_msg: get_folder_list: 
using *Prefs DB* cached folder list data<br />';}
                                        if ($this->debug_args_special_handlers 
> 1) { $this->dbug->out('mail_msg: get_folder_list: using appsession cached 
folder list data<br />'); } 
                                        if 
(!isset($cached_data[0]['folder_short']))
                                        {
@@ -3247,18 +2962,8 @@
                                        if ($this->debug_args_special_handlers 
> 0) { $this->dbug->out('mail_msg: get_folder_list: LEAVING, got data from 
cache<br />'); }
                                        return $cached_data;
                                }
-                               else
-                               {
-                                       if ($this->debug_args_special_handlers 
> 1) { $this->dbug->out('mail_msg: get_folder_list: NO cached folder list data, 
fallback to get data from mailserver<br />'); } 
-                               }
                        }
                        
-                       // if we get here we must actually get the data from 
the mailsvr
-                       // otherwise we would have return/broke out of this 
function
-                       // only IF statement above that allows code to reach 
here is if we are allowed to use
-                       // cached data, BUT none exists
-                       if ($this->debug_args_special_handlers > 1) { 
$this->dbug->out('mail_msg: get_folder_list: need to get data from 
mailserver<br />'); }
-                       
                        // Establish Email Server Connectivity Information
                        $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $acctnum);
                        $mailsvr_callstr = 
$this->get_arg_value('mailsvr_callstr', $acctnum);
@@ -3269,31 +2974,7 @@
                        if ($this->get_pref_value('imap_server_type', $acctnum) 
== 'UWash')
                        {
                                if ($this->debug_args_special_handlers > 1) { 
$this->dbug->out('mail_msg: get_folder_list: mailserver is of type UWash<br 
/>'); } 
-                               /*!
-                               @concept UWash IMAP Namespace
-                               @discussion uwash is file system based, so it 
requires a filesystem slash after the namespace. 
-                               Note that with uwash the delimiter is in fact 
the file system slash. 
-                               example: requesting list for "mail/*" 
-                               (NOTE  this <slash><star> request will NOT 
yield a list the INBOX folder included in the returned folder list). 
-                               However, we have no choice since without the 
<slash> filesystem delimiter, requesting "email*" returns NOTHING. 
-                               Example queries: (a) "~/" 
-                               OR (b) if the user specifies specific mbox 
folder, then: "~/emails/*"  
-                               OR (c) "emails/*" give the same result, much 
like a unix "ls" command.
-                               At this time we use "unqualified" a.k.a. 
"relative" directory names if the user provides a namespace. 
-                               UWash will consider it relative to the 
mailuser's $HOME property as with "emails/*" (DOES THIS WORK ON ALL 
PLATFORMS??).
-                               BUT we use <tilde><slash> "~/" if no namespace 
is given.
-                               @returns
-                               UWASH IMAP returns information in this format 
(same as any other IMAP server format):
-                               {SERVER_NAME:PORT}FOLDERNAME 
-                               (inline docparser repeat): 
&#123;SERVER_NAME:PORT&#125;FOLDERNAME 
-                               For Example: 
-                               {some.server.com:143}Trash AND 
-                               {some.server.com:143}Archives/Letters 
-                               (inline docparser repeat): 
-                               &#123;some.server.com:143&#125;Trash AND 
-                               &#123;some.server.com:143&#125;Archives/Letters 
                                
-                               */
-                               $mailboxes = 
$this->phpgw_listmailbox($mailsvr_callstr, "$name_space" ."$delimiter" ."*", 
$acctnum);
+                               $mailboxes = 
$this->phpgw_listmailbox($mailsvr_callstr, "$name_space" ."$delimiter" ."*", 
$acctnum, false);
                                // UWASH IMAP returns information in this 
format:
                                // {SERVER_NAME:PORT}FOLDERNAME
                                // example:
@@ -3302,25 +2983,7 @@
                        }
                        else
                        {
-                               if ($this->debug_args_special_handlers > 1) { 
$this->dbug->out('mail_msg: get_folder_list: mailserver is other than UWash 
type<br />'); } 
-                               /*!
-                               @concept non-UWash IMAP Server Namespace
-                               @discussion when handling handle non-UWash IMAP 
servers, 
-                               i.e. typical IMAP servers that do not use a 
filesystem slash as the "delimiter", 
-                               the last arg is typically "INBOX*" (no dot) 
which DOES include the inbox in the list of folders. 
-                               Wheres adding the delimiter "INBOX.*" (has dot) 
will NOT include the INBOX in the list of folders. 
-                               So - it's theoretically safe to include the 
delimiter here, but the INBOX will not be included in the list, 
-                               this is typically the ONLY TIME you would ever 
*not* use the delimiter between the namespace and what comes after it.
-                               HOWEVER to get *shared* folders included in the 
return, better NOT include the "." delimiter.
-                               For example: Cyrus does not like anything but a 
"*" as the pattern IF you want shared folders returned.
-                               Return data is a list suck as this:
-                               {some.server.com:143}INBOX
-                               {some.server.com:143}INBOX.Trash
-                               (inline docparser repeat): 
-                               &#123;some.server.com:143&#125;INBOX AND 
-                               &#123;some.server.com:143&#125;INBOX.Trash      
                
-                               */
-                               $mailboxes = 
$this->phpgw_listmailbox($mailsvr_callstr, "*", $acctnum);
+                               $mailboxes = 
$this->phpgw_listmailbox($mailsvr_callstr, "*", $acctnum, false);
                                // returns information in this format:
                                // {SERVER_NAME:PORT} NAMESPACE DELIMITER 
FOLDERNAME
                                // example:
@@ -3328,7 +2991,6 @@
                                // {some.server.com:143}INBOX.Trash
                        }
                        if ($this->debug_args_special_handlers > 2) { 
$this->dbug->out('mail_msg: get_folder_list: server returned $mailboxes DUMP:', 
$mailboxes); }
-                       //echo 'raw mailbox list:<br 
/>'.htmlspecialchars(serialize($mailboxes)).'<br />';
                        
                        // ERROR DETECTION
                        if (!$mailboxes)
@@ -3355,10 +3017,9 @@
                                $this_folder = 
$this->get_folder_short($mailboxes[$i]);
                                //if ($this_folder == 'INBOX')
                                // rfc2060 says "INBOX" as a namespace can not 
be case sensitive
-                               if ((stristr($this_folder, 'INBOX'))
-                               && (strlen($this_folder) == strlen('INBOX')))
+                               if ( preg_match('/^INBOX$/i', $this_folder) )
                                {
-                                       $has_inbox = True;
+                                       $has_inbox = true;
                                        break;
                                }
                        }
@@ -6210,4 +5871,3 @@
        
        }
        // end of class mail_msg
-?>

Modified: trunk/email/inc/class.mail_msg_wrappers.inc.php
===================================================================
--- trunk/email/inc/class.mail_msg_wrappers.inc.php     2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/email/inc/class.mail_msg_wrappers.inc.php     2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -29,11 +29,10 @@
        class mail_msg_wrappers extends mail_msg_base
        {
        
-               /*!
-               @function mail_msg_wrappers
-               @abstract CONSTRUCTOR place holder, does nothing  
+               /**
+               * Constructor
                */
-               function mail_msg_wrappers()
+               public function __construct()
                {
                        return;
                }
@@ -55,7 +54,7 @@
                of cache if the message is moved to another folder. If 
$this->session_cache_extreme is False, 
                then caching is NOT used on this data.
                */
-               function phpgw_fetchstructure($msgball='')
+               function phpgw_fetchstructure($msgball='', $display_error = 
true)
                {
                        if (!(isset($msgball))
                        || ((string)$msgball == ''))
@@ -74,7 +73,7 @@
                        
                        if ($this->session_cache_extreme == True)
                        {
-                               // function 
read_session_cache_item($data_name='misc', $acctnum='', $extra_keys='')
+                               // function 
read_session_cache_item($data_name='misc', $acctnum='', $extra_keys='', 
$display_error = true)
                                // this key, if it exists in the cached array 
of msg_structures, will hold the data we want as its value 
                                // this msgball *may* not have a "folder" 
element because fetchstructure can only be for the current folder anyway
                                // so sometimes we feed the msgball with no 
folder into here because it is obvious anyway.
@@ -114,7 +113,7 @@
                        {
                                // NO CACHED ITEM or CACHING NOT ENABLED
                                // get  the data from the mail server
-                               $this->ensure_stream_and_folder($msgball, 
'phpgw_fetchstructure'.' LINE '.__LINE__);
+                               $this->ensure_stream_and_folder($msgball, 
'phpgw_fetchstructure'.' LINE '.__LINE__, $display_error);
                                $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $acctnum);
                                $data = 
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->fetchstructure($mailsvr_stream, 
$msgball['msgnum']);
                                // PUT THIS IN CACHE
@@ -171,7 +170,7 @@
                message list page, would already be in the cache. If 
$this->session_cache_extreme is False, 
                then caching is NOT used on this data.
                */
-               function phpgw_header($msgball='')
+               function phpgw_header($msgball='', $display_error = true)
                {
                        if (!(isset($msgball))
                        || ((string)$msgball == ''))
@@ -200,7 +199,7 @@
                        
                        if ($this->session_cache_extreme == True)
                        {
-                               // function 
read_session_cache_item($data_name='misc', $acctnum='', $extra_keys='')
+                               // function 
read_session_cache_item($data_name='misc', $acctnum='', $extra_keys='', 
$display_error = true)
                                // this key, if it exists in the cached array 
of msg_structures, will hold the data we want as its value 
                                // this msgball *may* not have a "folder" 
element because header can only be for the current folder anyway
                                // so sometimes we feed the msgball with no 
folder into here because it is obvious anyway.
@@ -240,7 +239,7 @@
                        {
                                // NO CACHED ITEM or CACHING NOT ENABLED
                                // get  the data from the mail server
-                               $this->ensure_stream_and_folder($msgball, 
'phpgw_header'.' LINE '.__LINE__);
+                               $this->ensure_stream_and_folder($msgball, 
'phpgw_header'.' LINE '.__LINE__, $display_error);
                                $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $acctnum);
                                $data = 
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->header($mailsvr_stream, 
$msgball['msgnum']);
                                
@@ -295,7 +294,7 @@
                @author Angles
                @discussion ?
                
-               function cache_clean_phpgw_header(&$msg_headers)
+               function cache_clean_phpgw_header(&$msg_headers, $display_error 
= true)
                {
                        //$debug = 0;
                        $debug = 3;
@@ -397,7 +396,7 @@
                @discussion Used by filtering, and in other cases where testing 
or checking the 
                actual message headers as a text item, is necessary.
                */
-               function phpgw_fetchheader($msgball='')
+               function phpgw_fetchheader($msgball='', $display_error = true)
                {
                        if (!(isset($msgball))
                        || ((string)$msgball == ''))
@@ -411,7 +410,7 @@
                                $acctnum = $this->get_acctnum();
                        }
                        
-                       $this->ensure_stream_and_folder($msgball, 
'phpgw_fetchheader'.' LINE '.__LINE__);
+                       $this->ensure_stream_and_folder($msgball, 
'phpgw_fetchheader'.' LINE '.__LINE__, $display_error);
                        
                        $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $acctnum);
                        // Message Information: THE MESSAGE'S HEADERS RETURNED 
RAW (no processing)
@@ -430,7 +429,7 @@
                returns array of strings, each string is extremely truncated
                partial contents of date, from, and subject, also includes the 
msg size in chars
                */
-               function all_headers_in_folder($fldball='')
+               function all_headers_in_folder($fldball='', $display_error = 
true)
                {
                        if (!(isset($fldball))
                        || ((string)$fldball == ''))
@@ -443,7 +442,7 @@
                        {
                                $acctnum = $this->get_acctnum();
                        }
-                       $this->ensure_stream_and_folder($fldball, 
'all_headers_in_folder');
+                       $this->ensure_stream_and_folder($fldball, 
'all_headers_in_folder', $display_error);
                        $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $acctnum);
                        
                        return 
$GLOBALS['phpgw_dcom_'.$acctnum]->dcom->headers($mailsvr_stream);
@@ -453,7 +452,7 @@
                @function phpgw_get_flag
                @abstract ?
                */
-               function phpgw_get_flag($flag='')
+               function phpgw_get_flag($flag='', $display_error = true)
                {
                        // sanity check
                        if ($flag == '')
@@ -463,7 +462,7 @@
                        else
                        {
                                $msgball = $this->get_arg_value('msgball');
-                               $this->ensure_stream_and_folder($msgball , 
'phpgw_get_flag'.' LINE '.__LINE__);
+                               $this->ensure_stream_and_folder($msgball , 
'phpgw_get_flag'.' LINE '.__LINE__, $display_error);
                                return 
$GLOBALS['phpgw_dcom_'.$this->acctnum]->dcom->get_flag($this->get_arg_value('mailsvr_stream'),$this->get_arg_value('["msgball"]["msgnum"]'),$flag);
                        }
                }
@@ -472,9 +471,9 @@
                @function phpgw_get_flag
                @abstract ?
                */
-               function phpgw_set_flag($msgball, $flag)
+               function phpgw_set_flag($msgball, $flag, $display_error = true)
                {
-                       $this->ensure_stream_and_folder($msgball , 
'phpgw_set_flag'.' LINE '.__LINE__);
+                       $this->ensure_stream_and_folder($msgball , 
'phpgw_set_flag'.' LINE '.__LINE__, $display_error);
                        return $GLOBALS['phpgw_dcom_'.$msgball['acctnum'] 
]->dcom->set_flag($this->get_arg_value('mailsvr_stream'), $msgball['msgnum'], 
$flag);
                }
                
@@ -487,7 +486,7 @@
                @author Angles
                @discussion If only a part of the message body is desired, use 
"phpgw_fetchbody" instead.
                */
-               function phpgw_body($msgball='')
+               function phpgw_body($msgball='', $display_error = true)
                {
                        if (!(isset($msgball))
                        || ((string)$msgball == ''))
@@ -500,7 +499,7 @@
                        {
                                $acctnum = $this->get_acctnum();
                        }
-                       $this->ensure_stream_and_folder($msgball, 
'phpgw_body'.' LINE '.__LINE__);
+                       $this->ensure_stream_and_folder($msgball, 
'phpgw_body'.' LINE '.__LINE__, $display_error);
                        $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $acctnum);
                        // notice of event
                        $this->event_msg_seen($msgball, 'phpgw_body');
@@ -515,7 +514,7 @@
                (Not related to a message flag like "unseen", this is an 
optional argument for the mail server.) 
                @author Angles
                */
-               function phpgw_fetchbody($msgball='', $flags='')
+               function phpgw_fetchbody($msgball='', $flags='', $display_error 
= true)
                {
                        //echo 'mail_msg(_wrappers): phpgw_fetchbody: ENTERING, 
$msgball dump<pre>'; print_r($msgball); echo '</pre>';
                        if ( (!isset($msgball))
@@ -540,7 +539,7 @@
                                return $cached_phpgw_fetchbody;
                        }
                        // if we get here we need to contact mailserver
-                       $this->ensure_stream_and_folder($msgball, 
'phpgw_fetchbody'.' LINE '.__LINE__);
+                       $this->ensure_stream_and_folder($msgball, 
'phpgw_fetchbody'.' LINE '.__LINE__, $display_error);
                        $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $acctnum);
                        $msgnum = $msgball['msgnum'];
                        $part_no = $msgball['part_no'];
@@ -569,7 +568,7 @@
                
                /*
                // OLD FUNCTION
-               function phpgw_fetchbody($msgball='', $flags='')
+               function phpgw_fetchbody($msgball='', $flags='', $display_error 
= true)
                {
                        //echo 'mail_msg(_wrappers): phpgw_fetchbody: ENTERING, 
$msgball dump<pre>'; print_r($msgball); echo '</pre>';
                        if ( (!isset($msgball))
@@ -583,7 +582,7 @@
                        {
                                $acctnum = $this->get_acctnum();
                        }
-                       $this->ensure_stream_and_folder($msgball, 
'phpgw_fetchbody'.' LINE '.__LINE__);
+                       $this->ensure_stream_and_folder($msgball, 
'phpgw_fetchbody'.' LINE '.__LINE__, $display_error);
                        $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $acctnum);
                        $msgnum = $msgball['msgnum'];
                        $part_no = $msgball['part_no'];
@@ -623,7 +622,7 @@
                Sort and Order is applied by the class, so the calling process 
does not need to specify sorting here
                The data communications object (class mail_dcom) is supplied by 
the class
                */
-               function get_msgball_list($acctnum='', $folder='', 
$only_fill_cache=False)
+               function get_msgball_list($acctnum='', $folder='', 
$only_fill_cache=False, $display_error = true)
                {
                        if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(wrappers).get_msgball_list:  ENTERING $acctnum 
['.$acctnum.'] ; $folder ['.$folder.'] <br />'); }
                        // IF specifying a folder, as a filter search may do, 
we need to ensure stream and folder
@@ -645,7 +644,7 @@
                                $fake_fldball['acctnum'] = $acctnum;
                                $fake_fldball['folder'] = $folder;
                                // WHY DO THIS HERE?
-                               
//$this->ensure_stream_and_folder($fake_fldball, 'get_msgball_list'.' LINE 
'.__LINE__);
+                               
//$this->ensure_stream_and_folder($fake_fldball, 'get_msgball_list'.' LINE 
'.__LINE__, $display_error);
                                // ok, so now we KNOW the stream exists and 
folder value is what we need for this desired account
                        }
                        elseif ((!isset($acctnum))
@@ -683,7 +682,7 @@
                                $fake_fldball['acctnum'] = $acctnum;
                                //$fake_fldball['folder'] = 
$this->get_arg_value('folder');
                                $fake_fldball['folder'] = 
$this->prep_folder_out($this->get_arg_value('folder'));
-                               $this->ensure_stream_and_folder($fake_fldball, 
'get_msgball_list'.' LINE '.__LINE__);
+                               $this->ensure_stream_and_folder($fake_fldball, 
'get_msgball_list'.' LINE '.__LINE__, $display_error);
                                
                                $server_msgnum_list = array();
                                
@@ -765,7 +764,7 @@
                @author Angles
                @access public
                */
-               function get_msgball_list_oldschool($acctnum='', $folder='', 
$only_fill_cache=False)
+               function get_msgball_list_oldschool($acctnum='', $folder='', 
$only_fill_cache=False, $display_error = true)
                {
                        $msgball_list = $this->get_msgball_list($acctnum, 
$folder, $only_fill_cache);
                        $loops = count($msgball_list);
@@ -798,17 +797,17 @@
                @author Angles
                @access public
                */
-               function get_folder_size()
+               function get_folder_size($display_error = true)
                {
                        if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): get_folder_size: ('.__LINE__.') 
ENTERING<br />'); } 
                        $fldball = array();
                        $fldball['acctnum'] = $this->get_acctnum();
                        $fldball['folder'] = 
$this->prep_folder_out($this->get_arg_value('folder', $fldball['acctnum']));
-                       if ($this->debug_wrapper_dcom_calls > 1) { 
$this->dbug->out('mail_msg(_wrappers): get_folder_size: ('.__LINE__.') this 
function does not take a param, we made a fldball: ['.serialize($fldball).']<br 
/>'); } 
+                       if ($this->debug_wrapper_dcom_calls > 1) { 
$this->dbug->out('mail_msg(_wrappers): get_folder_size: ('.__LINE__.') this 
function does not take a param, we made a fldball: ['.serialize($fldball).']<br 
/>', $display_error = true); } 
                        // make sure a stream is open
-                       if (($this->debug_session_caching > 1) || 
($this->debug_wrapper_dcom_calls > 1)) { $this->dbug->out('mail_msg(_wrappers): 
get_folder_size: ('.__LINE__.') call to $this->ensure_stream_and_folder(), 
$fldball ['.serialize($fldball).'] <br />'); } 
+                       if (($this->debug_session_caching > 1) || 
($this->debug_wrapper_dcom_calls > 1)) { $this->dbug->out('mail_msg(_wrappers): 
get_folder_size: ('.__LINE__.') call to $this->ensure_stream_and_folder(), 
$fldball ['.serialize($fldball).'] <br />', $display_error); } 
                        if (($this->debug_session_caching > 1) || 
($this->debug_wrapper_dcom_calls > 1)) { $this->dbug->out('mail_msg(_wrappers): 
get_folder_size: ('.__LINE__.') NOTE THIS DOES REQUIRE A CHANGE OF FOLDER to 
get the data, this may cause problems. <br />'); } 
-                       $this->ensure_stream_and_folder($fldball, 
'get_folder_size'.' LINE '.__LINE__);
+                       $this->ensure_stream_and_folder($fldball, 
'get_folder_size'.' LINE '.__LINE__, $display_error);
                        
                        if ($this->debug_wrapper_dcom_calls > 1) { 
$this->dbug->out('mail_msg(_wrappers): get_folder_size: ('.__LINE__.') calling 
$GLOBALS[phpgw_dcom_'.$this->acctnum.']->dcom->mailboxmsginfo('.$this->get_arg_value('mailsvr_stream').',
 '.$fldball['acctnum'].')<br />'); } 
                        $mailbox_detail = 
$GLOBALS['phpgw_dcom_'.$fldball['acctnum']]->dcom->mailboxmsginfo($this->get_arg_value('mailsvr_stream'),
 $fldball['acctnum']); 
@@ -834,7 +833,7 @@
                @author Angles
                @access Public
                */
-               function new_message_check($fldball='')
+               function new_message_check($fldball='', $display_error = true)
                {
                        // detect OLD param which was string only
                        if ((isset($fldball))
@@ -887,7 +886,7 @@
                @abstract wrapper for IMAP_STATUS, get status info for the 
current folder, with emphesis on reporting to user about new messages
                @param $fldball  typed array  OPTIONAL  as with many functions 
in this class, the folder you are interested in is usually the currently 
                "selected" folder, in IMAP terms, which is selected during 
begin_request(), in which case it is not necessary to supply this information 
-               again in this param, instead this function will use the class 
vars about foldername and acctnum established during begin_request(). However, 
+               again in this param, instead this function will use the class 
vars about foldername and acctnum established during 
begin_request($display_error = true). However, 
                since there are multiple accounts, and since IMAP accounts 
themselves can contain many folders, it is understood that you may want 
                information about a folder other than the currently selected 
folder, or about an  account that you may want to move messges to.  In these 
                cases you may supply this param of type fldball, like this: 
parmarray[acctnum] = 1,  parmarray[folder]  = "INBOX", for example. The fldball 
@@ -909,7 +908,7 @@
                result['number_new'] integer - for IMAP: the number "recent" 
and/or "unseen"messages; for POP3: the total number of messages
                result['number_all'] integer - for IMAP and POP3: the total 
number messages in the folder
                @discussion gives user friendly "alert_string" element to show 
the user, info is for what ever folder the msg
-               class is currently logged into, you may want to apply PHP 
function "number_format()" to
+               class is currently logged into, you may want to apply PHP 
function "number_format($display_error = true)" to
                the integers after you have done any math code and befor eyou 
display them to the user, it adds the thousands comma. 
                CACHE NOTE: If $this->session_cache_extreme is True, the data 
this function gets is cached in the appsession 
                cache and is assumed to be "fresh" for X period of time, as 
defined in $this->timestamp_age_limit 
@@ -935,7 +934,7 @@
                @author Angles
                @access public
                */
-               function get_folder_status_info($fldball='', 
$force_refresh=False)
+               function get_folder_status_info($fldball='', 
$force_refresh=False, $display_error = true)
                {
                        if (($this->debug_session_caching > 0) || 
($this->debug_wrapper_dcom_calls > 0)) { $this->dbug->out('class_msg: 
get_folder_status_info: ('.__LINE__.') ENTERING, $fldball: 
'.serialize($fldball).' ; $force_refresh (DEPRECIATED): 
'.serialize($force_refresh).' <br />'); }
                        
@@ -1030,9 +1029,9 @@
                        $special_fldball['folder'] = $fldball['folder'];
                        // STATUS does not require opening the folder we want 
information about
                        $special_fldball['no_switch_away'] = True;
-                       if (($this->debug_session_caching > 1) || 
($this->debug_wrapper_dcom_calls > 1)) { $this->dbug->out('class_msg: 
get_folder_status_info: ('.__LINE__.') call to 
$this->ensure_stream_and_folder(), $special_fldball 
['.serialize($special_fldball).'] <br />'); } 
+                       if (($this->debug_session_caching > 1) || 
($this->debug_wrapper_dcom_calls > 1)) { $this->dbug->out('class_msg: 
get_folder_status_info: ('.__LINE__.') call to 
$this->ensure_stream_and_folder(), $special_fldball 
['.serialize($special_fldball).'] <br />', $display_error); } 
                        if (($this->debug_session_caching > 1) || 
($this->debug_wrapper_dcom_calls > 1)) { $this->dbug->out('class_msg: 
get_folder_status_info: ('.__LINE__.') DO NOT pass a folderame IN THIS 
PARTICULAR case because getting folder status DOES NOT require opening that 
folder, "ensure_stream_and_folder" understands this.<br />'); } 
-                       $this->ensure_stream_and_folder($special_fldball, 
'get_folder_status_info'.' LINE '.__LINE__);
+                       $this->ensure_stream_and_folder($special_fldball, 
'get_folder_status_info'.' LINE '.__LINE__, $display_error);
                        
                        //$mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $acctnum);
                        $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $fldball['acctnum']);
@@ -1139,13 +1138,13 @@
                @discussion Debug with flag "debug_wrapper_dcom_calls" . FIXME 
change param to fldball. 
                @access public
                */
-               function phpgw_status($feed_folder_long='')
+               function phpgw_status($feed_folder_long='', $display_error = 
true)
                {
                        if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(wrappers): phpgw_status ('.__LINE__.'): ENTERING, 
$feed_folder_long ['.($feed_folder_long).']<br />'); }
                        $fake_fldball = array();
                        $fake_fldball['acctnum'] = $this->get_acctnum();
                        $fake_fldball['folder'] = $feed_folder_long;
-                       $this->ensure_stream_and_folder($fake_fldball, 
'phpgw_status'.' LINE '.__LINE__);
+                       $this->ensure_stream_and_folder($fake_fldball, 
'phpgw_status'.' LINE '.__LINE__, $display_error);
                        $server_str = $this->get_arg_value('mailsvr_callstr');
                        $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream');
                        if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(wrappers): phpgw_status ('.__LINE__.'): calling 
$GLOBALS[phpgw_dcom_$fake_fldball[acctnum]('.$fake_fldball['acctnum'].')]->dcom->status($mailsvr_stream['.$mailsvr_stream.'],"$server_str"."$feed_folder_long"['.htmlspecialchars("$server_str"."$feed_folder_long").'],SA_ALL)<br
 />'); } 
@@ -1161,7 +1160,7 @@
                @discussion Debug with flag "debug_wrapper_dcom_calls" 
                @access public
                */
-               function phpgw_server_last_error($acctnum='')
+               function phpgw_server_last_error($acctnum='', $display_error = 
true)
                {
                        if ((!isset($acctnum))
                        || ((string)$acctnum == ''))
@@ -1179,7 +1178,7 @@
                @discussion Debug with flag "debug_wrapper_dcom_calls" 
                @access public
                */
-               function phpgw_ping($acctnum='')
+               function phpgw_ping($acctnum='', $display_error = true)
                {
                        if ((!isset($acctnum))
                        || ((string)$acctnum == ''))
@@ -1201,7 +1200,7 @@
                @discussion Debug with flag "debug_wrapper_dcom_calls" 
                @access public
                */
-               function phpgw_search($fldball='', $criteria='', $flags='')
+               function phpgw_search($fldball='', $criteria='', $flags='', 
$display_error = true)
                {
                        if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): phpgw_search ('.__LINE__.'): ENTERING, 
$fldball ['.serialize($fldball).']; $criteria ['.$criteria.']; 
$flags['.serialize($flags).'] <br />'); } 
                        $acctnum = (int)$fldball['acctnum'];
@@ -1223,7 +1222,7 @@
                        $fake_fldball = array();
                        $fake_fldball['acctnum'] = $acctnum;
                        $fake_fldball['folder'] = $folder;
-                       $this->ensure_stream_and_folder($fake_fldball, 
'phpgw_search LINE '.__LINE__);
+                       $this->ensure_stream_and_folder($fake_fldball, 
'phpgw_search LINE '.__LINE__, $display_error);
                        $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $acctnum);
                        
                        // now we have the stream and the desired folder open
@@ -1240,7 +1239,7 @@
                @author Angles
                @access public
                */
-               function phpgw_createmailbox($target_fldball)
+               function phpgw_createmailbox($target_fldball, $display_error = 
true)
                {
                        $acctnum = (int)$target_fldball['acctnum'];
                        if ((!isset($acctnum))
@@ -1263,7 +1262,7 @@
                        $fake_fldball['folder'] = $folder;
                        // tell "ensure_stream_and_folder" that its NOT 
NECESSARY to switch TO this folder
                        $fake_fldball['no_switch_away'] = True;
-                       $this->ensure_stream_and_folder($fake_fldball, 
'phpgw_createmailbox LINE ('.__LINE__.')');
+                       $this->ensure_stream_and_folder($fake_fldball, 
'phpgw_createmailbox LINE ('.__LINE__.')', $display_error);
                        // if $folder dies not have the {SERVERNAME}  then add 
it
                        if (!strstr($folder, '}'))
                        {
@@ -1285,7 +1284,7 @@
                @author Angles
                @access public
                */
-               function phpgw_createmailbox_ex($target_fldball)
+               function phpgw_createmailbox_ex($target_fldball, $display_error 
= true)
                {
                        if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('phpgw_createmailbox_ex('.__LINE__.'): ENTERING: raw 
$target_fldball arg ['.htmlspecialchars($target_fldball).']<br />'); } 
                        if ((isset($target_fldball['acctnum']))
@@ -1313,7 +1312,7 @@
                        // "ensure_stream_and_folder" will verify for us, 
                        // tell "ensure_stream_and_folder" that its NOT 
NECESSARY to switch TO this folder
                        $target_fldball['no_switch_away'] = True;
-                       $this->ensure_stream_and_folder($target_fldball, 
'phpgw_createmailbox_ex LINE ('.__LINE__.')');
+                       $this->ensure_stream_and_folder($target_fldball, 
'phpgw_createmailbox_ex LINE ('.__LINE__.')', $display_error);
                        // if $folder dies not have the {SERVERNAME}  then add 
it
                        //$target_folder_clean = 
$this->prep_folder_in($target_fldball['folder']);
                        $target_folder_clean = 
urldecode($target_fldball['folder']);
@@ -1333,9 +1332,9 @@
                @author Angles
                @access public
                */
-               function phpgw_deletemailbox($target_fldball)
+               function phpgw_deletemailbox($target_fldball, $display_error = 
true)
                {
-                       $this->ensure_stream_and_folder($target_fldball, 
'phpgw_deletemailbox'.' LINE '.__LINE__);
+                       $this->ensure_stream_and_folder($target_fldball, 
'phpgw_deletemailbox'.' LINE '.__LINE__, $display_error);
                        $acctnum = $target_fldball['acctnum'];
                        $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $acctnum);
                        $folder = $target_fldball['folder'];
@@ -1353,7 +1352,7 @@
                @author Angles
                @access public
                */
-               function phpgw_deletemailbox_ex($target_fldball)
+               function phpgw_deletemailbox_ex($target_fldball, $display_error 
= true)
                {
                        if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('phpgw_deletemailbox_ex('.__LINE__.'): ENTERING: raw 
$target_fldball arg ['.htmlspecialchars($target_fldball).']<br />'); } 
                        if ((isset($target_fldball['acctnum']))
@@ -1381,7 +1380,7 @@
                        // "ensure_stream_and_folder" will verify for us, 
                        // tell "ensure_stream_and_folder" that its NOT 
NECESSARY to switch TO this folder
                        $target_fldball['no_switch_away'] = True;
-                       $this->ensure_stream_and_folder($target_fldball, 
'phpgw_deletemailbox_ex LINE ('.__LINE__.')');
+                       $this->ensure_stream_and_folder($target_fldball, 
'phpgw_deletemailbox_ex LINE ('.__LINE__.')', $display_error);
                        // if $folder dies not have the {SERVERNAME}  then add 
it
                        //$target_folder_clean = 
$this->prep_folder_in($target_fldball['folder']);
                        $target_folder_clean = 
urldecode($target_fldball['folder']);
@@ -1401,9 +1400,9 @@
                @author Angles
                @access public
                */
-               function phpgw_renamemailbox($source_fldball,$target_fldball)
+               function phpgw_renamemailbox($source_fldball,$target_fldball, 
$display_error = true)
                {
-                       $this->ensure_stream_and_folder($source_fldball, 
'phpgw_renamemailbox'.' LINE '.__LINE__);
+                       $this->ensure_stream_and_folder($source_fldball, 
'phpgw_renamemailbox'.' LINE '.__LINE__, $display_error);
                        $acctnum = (int)$source_fldball['acctnum'];
                        $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $acctnum);
                        $folder_old = $source_fldball['folder'];
@@ -1422,7 +1421,7 @@
                @author Angles
                @access public
                */
-               function phpgw_renamemailbox_ex($source_fldball,$target_fldball)
+               function 
phpgw_renamemailbox_ex($source_fldball,$target_fldball, $display_error = true)
                {
                        if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('phpgw_renamemailbox_ex('.__LINE__.'): ENTERING<br />'); } 
                        if ($this->debug_wrapper_dcom_calls > 1) { 
$this->dbug->out('phpgw_renamemailbox_ex('.__LINE__.'): raw $source_fldball arg 
['.htmlspecialchars($source_fldball).']; raw $target_fldball arg 
['.htmlspecialchars($target_fldball).']<br />'); } 
@@ -1451,7 +1450,7 @@
                        // "ensure_stream_and_folder" will verify for us, 
                        // tell "ensure_stream_and_folder" that its NOT 
NECESSARY to switch TO this folder
                        $target_fldball['no_switch_away'] = True;
-                       $this->ensure_stream_and_folder($target_fldball, 
'phpgw_renamemailbox_ex LINE ('.__LINE__.')');
+                       $this->ensure_stream_and_folder($target_fldball, 
'phpgw_renamemailbox_ex LINE ('.__LINE__.')', $display_error);
                        // if $folder dies not have the {SERVERNAME}  then add 
it
                        //$target_folder_clean = 
$this->prep_folder_in($target_fldball['folder']);
                        $target_folder_clean = 
urldecode($target_fldball['folder']);
@@ -1495,7 +1494,7 @@
                @discussion Debug with flag "debug_wrapper_dcom_calls" 
                @access public
                */
-               function phpgw_listmailbox($ref,$pattern,$acctnum)
+               function phpgw_listmailbox($ref,$pattern,$acctnum, 
$display_error = true)
                {
                        if (!(isset($acctnum))
                        || ((string)$acctnum == ''))
@@ -1510,7 +1509,7 @@
                        $fake_fldball['acctnum'] = $acctnum;
                        $fake_fldball['folder'] = '';
                        $fake_fldball['no_switch_away'] = True;
-                       $this->ensure_stream_and_folder($fake_fldball, 
'phpgw_listmailbox');
+                       $this->ensure_stream_and_folder($fake_fldball, 
'phpgw_listmailbox', $display_error);
                        $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $acctnum);
                        
                        // ... so stream exists, do the transaction ...
@@ -1525,7 +1524,7 @@
                @discussion Debug with flag "debug_wrapper_dcom_calls" 
                @access public
                */
-               function phpgw_append($folder="Sent", $message, $flags=0)
+               function phpgw_append($folder="Sent", $message, $flags=0, 
$display_error = true)
                {
                        if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): phpgw_append: ('.__LINE__.') ENTERING, 
folder: '.$folder.'<br />'); }
                        
@@ -1585,7 +1584,7 @@
                                $target_fldball['acctnum'] = 
$this->get_acctnum();
                                $this->event_msg_append($target_fldball, 
'phpgw_append'.' LINE '.__LINE__);
                                
-                               
$this->ensure_stream_and_folder($target_fldball, 'phpgw_append'.' LINE 
'.__LINE__);
+                               
$this->ensure_stream_and_folder($target_fldball, 'phpgw_append'.' LINE 
'.__LINE__, $display_error);
                                $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream');
                                // do the append
                                if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): phpgw_append: 
$GLOBALS["phpgw_dcom_'.$target_fldball['acctnum'].']->dcom->append('.$mailsvr_stream.',
 '."$server_str"."$official_folder_long".', $message, '.$flags.') '); } 
@@ -1611,7 +1610,7 @@
                @author Angles
                @access public
                */
-               function phpgw_mail_move($msg_list,$mailbox)
+               function phpgw_mail_move($msg_list,$mailbox, $display_error = 
true)
                {
                        if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): phpgw_mail_move: (DEPRECIATED) 
ENTERING<br />'); }
                        // OLD FUNCTION does not provide enough information, 
all we can do is expire
@@ -1630,7 +1629,7 @@
                @author Angles
                @access public
                */
-               function interacct_mail_move($mov_msgball='', $to_fldball='')
+               function interacct_mail_move($mov_msgball='', $to_fldball='', 
$display_error = true)
                {
                        if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): interacct_mail_move: ENTERING<br />'); }
                        if ($this->debug_wrapper_dcom_calls > 1) { 
$this->dbug->out('mail_msg(_wrappers): interacct_mail_move: $mov_msgball 
['.serialize($mov_msgball).'] ;  $to_fldball ['.serialize($to_fldball).']<br 
/>'); } 
@@ -1647,12 +1646,12 @@
                        {
                                $acctnum = $this->get_acctnum();
                        }
-                       $this->ensure_stream_and_folder($mov_msgball, 
'interacct_mail_move'.' LINE '.__LINE__);
+                       $this->ensure_stream_and_folder($mov_msgball, 
'interacct_mail_move'.' LINE '.__LINE__, $display_error);
                        
                        if ($this->debug_wrapper_dcom_calls > 1) { 
$this->dbug->out('mail_msg(_wrappers): interacct_mail_move:'.' LINE 
'.__LINE__.' If this is a move to a DIFFERENT account, then THIS FUNCTION is 
the WRONG ONE to use, it can not handle that<br />'); } 
                        
                        // NO - this function only works with folders within 
the same account
-                       //$this->ensure_stream_and_folder($to_fldball, 
'interacct_mail_move'.' LINE '.__LINE__);
+                       //$this->ensure_stream_and_folder($to_fldball, 
'interacct_mail_move'.' LINE '.__LINE__, $display_error);
                        
                        //$mailsvr_stream = 
(int)$this->get_arg_value('mailsvr_stream', $acctnum);
                        $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $acctnum);
@@ -1674,12 +1673,12 @@
                * @param int $acctnum target account number
                * @param string $folder target folder
                */
-               function empty_trash($acctnum = '')
+               function empty_trash($acctnum = '', $display_error = true)
                {
                        $acctnum = ($acctnum >= 0 ? $acctnum : 
$this->get_acctnum());
                        $folder = 
$this->get_arg_value('verified_trash_folder_long', $acctnum);
                        
-                       $this->ensure_stream_and_folder(array('folder' => 
$folder, 'acctnum' => $acctnum));
+                       $this->ensure_stream_and_folder(array('folder' => 
$folder, 'acctnum' => $acctnum), $display_error);
                        $this->set_arg_value('fldball[folder]', $folder, 
$acctnum);
                        $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $acctnum);
                        
@@ -1695,7 +1694,7 @@
                @discussion ?
                @access public
                */
-               function industrial_interacct_mail_move($mov_msgball='', 
$to_fldball='')
+               function industrial_interacct_mail_move($mov_msgball='', 
$to_fldball='', $display_error = true)
                {
                        if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): industrial_interacct_mail_move: 
ENTERING, handing off to $this->buffer_move_commands()<br />'); }
                        // Note: Only call this function with ONE msgball at a 
time, i.e. NOT a list of msgballs
@@ -1719,7 +1718,7 @@
                @discussion ?
                @access public
                */
-               function buffer_move_commands($mov_msgball='', $to_fldball='')
+               function buffer_move_commands($mov_msgball='', $to_fldball='', 
$display_error = true)
                {
                        if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): buffer_move_commands ('.__LINE__.'): 
ENTERING<br />'); } 
                        if ($this->debug_wrapper_dcom_calls > 1) { 
$this->dbug->out('mail_msg(_wrappers): buffer_move_commands ('.__LINE__.'): 
$mov_msgball ['.serialize($mov_msgball).'] $to_fldball 
['.serialize($to_fldball).']<br />'); } 
@@ -1769,7 +1768,7 @@
                @discussion ?
                @access public
                */
-               function buffer_delete_commands($mov_msgball='', $to_fldball='')
+               function buffer_delete_commands($mov_msgball='', 
$to_fldball='', $display_error = true)
                {
                        if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): buffer_move_commands ('.__LINE__.'): 
ENTERING<br />'); } 
                        if ($this->debug_wrapper_dcom_calls > 1) { 
$this->dbug->out('mail_msg(_wrappers): buffer_move_commands ('.__LINE__.'): 
$mov_msgball ['.serialize($mov_msgball).'] $to_fldball 
['.serialize($to_fldball).']<br />'); } 
@@ -1860,7 +1859,7 @@
                @discussion ?
                @access public
                */
-               function 
flush_buffered_move_commmands($called_by='not_specified')
+               function 
flush_buffered_move_commmands($called_by='not_specified', $display_error = true)
                {
                        $do_it_for_real = True;
                        //$do_it_for_real = False;
@@ -2158,10 +2157,10 @@
                                        
//$this->event_msg_move_or_delete($mov_msgball, 
'flush_buffered_move_commmands'.' LINE: '.__LINE__.' and CACHE SHOULD BE OFF 
NOW', $to_fldball);
                                        //if ($this->debug_wrapper_dcom_calls > 
1) { echo 'mail_msg(_wrappers): flush_buffered_move_commmands: expire msgball 
list with DIRECT call to $this->expire_session_cache_item (because we know 
extreme caching os turned off for the duration of this function)<br />'; }
                                        
//$this->expire_session_cache_item('msgball_list', $this_acctnum);
-                                       if ($this->debug_wrapper_dcom_calls > 
1) { $this->dbug->out('mail_msg(_wrappers): flush_buffered_move_commmands: 
($do_it_for_real is '.serialize($do_it_for_real).'): calling 
$this->ensure_stream_and_folder($mov_msgball ['.serialize($mov_msgball).'], 
who_is_calling) <br />'); }
+                                       if ($this->debug_wrapper_dcom_calls > 
1) { $this->dbug->out('mail_msg(_wrappers): flush_buffered_move_commmands: 
($do_it_for_real is '.serialize($do_it_for_real).'): calling 
$this->ensure_stream_and_folder($mov_msgball ['.serialize($mov_msgball).'], 
who_is_calling) <br />', $display_error); }
                                        if ($do_it_for_real == True)
                                        {
-                                               
$this->ensure_stream_and_folder($mov_msgball, 'flush_buffered_move_commmands'.' 
LINE: '.__LINE__);
+                                               
$this->ensure_stream_and_folder($mov_msgball, 'flush_buffered_move_commmands'.' 
LINE: '.__LINE__, $display_error);
                                        }
                                        $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $this_acctnum);
                                        // IS THIS A MOVE OR A DELETE?
@@ -2239,7 +2238,7 @@
                Fills arg "expunge_folders" for any account that has folders 
needing to be expunged. 
                @access public
                */
-               function single_interacct_mail_move($mov_msgball='', 
$to_fldball='')
+               function single_interacct_mail_move($mov_msgball='', 
$to_fldball='', $display_error = true)
                {
                        if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): single_interacct_mail_move: ENTERING 
(note: only feed ONE msgball at a time, i.e. NOT a list of msgballs) <br />'); }
                        // Note: Only call this function with ONE msgball at a 
time, i.e. NOT a list of msgballs
@@ -2272,7 +2271,7 @@
                                // we need to SELECT the folder the message is 
being moved FROM
                                $mov_msgball['folder'] = 
urldecode($mov_msgball['folder']);
                                
-                               $this->ensure_stream_and_folder($mov_msgball, 
'single_interacct_mail_move'.' LINE: '.__LINE__);
+                               $this->ensure_stream_and_folder($mov_msgball, 
'single_interacct_mail_move'.' LINE: '.__LINE__, $display_error);
                                $mov_msgball['msgnum'] = 
(string)$mov_msgball['msgnum'];
                                $to_fldball['folder'] = 
urldecode($to_fldball['folder']);
                                $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $common_acctnum);
@@ -2306,7 +2305,7 @@
                                // Make Sure Stream Exists
                                // multiple accounts means one stream may be 
open but another may not
                                // "ensure_stream_and_folder" will verify for 
us, 
-                               $this->ensure_stream_and_folder($mov_msgball, 
'single_interacct_mail_move');
+                               $this->ensure_stream_and_folder($mov_msgball, 
'single_interacct_mail_move', $display_error);
                                // GET MESSAGE FLAGS (before you get the mgs, 
so unseen/seen is not tainted by our grab)
                                $hdr_envelope = 
$this->phpgw_header($mov_msgball);
                                $mov_msgball['flags'] = 
$this->make_flags_str($hdr_envelope);
@@ -2339,7 +2338,7 @@
                                //$to_fldball['folder'] = '';
                                // PASS "no_switch_away" to indicate we should 
NOT CHANGE FOLDERS
                                $to_fldball['no_switch_away'] = True;
-                               $this->ensure_stream_and_folder($to_fldball, 
'single_interacct_mail_move');
+                               $this->ensure_stream_and_folder($to_fldball, 
'single_interacct_mail_move', $display_error);
                                $mailsvr_callstr = 
$this->get_arg_value('mailsvr_callstr', $to_fldball['acctnum']);
                                $to_mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $to_fldball['acctnum']);
                                //$to_fldball['folder'] = $remember_to_fldball;
@@ -2383,7 +2382,7 @@
                call "expunge_expungable_folders" when all the moves or deletes 
are done. 
                @access private
                */
-               function track_expungable_folders($fldball='')
+               function track_expungable_folders($fldball='', $display_error = 
true)
                {
                        if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): track_expungable_folders ('.__LINE__.'): 
ENTERING, $fldball ['.serialize($fldball).']<br />'); } 
                        if (!(isset($fldball['acctnum']))
@@ -2465,7 +2464,7 @@
                to expunge. Call this function after all your moves or deletes 
are done.
                @access public
                */
-               function expunge_expungable_folders($called_by='not_specified')
+               function expunge_expungable_folders($called_by='not_specified', 
$display_error = true)
                {
                        if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): expunge_expungable_folders 
('.__LINE__.'): ENTERING, called by ['.$called_by.'], <br />'); } 
                        
@@ -2519,7 +2518,7 @@
                assuming the move or delete function you used calls 
"track_expungable_folders". 
                @access public
                */
-               function phpgw_expunge($acctnum='', $fldball='')
+               function phpgw_expunge($acctnum='', $fldball='', $display_error 
= true)
                {
                        if (!(isset($acctnum))
                        || ((string)$acctnum == ''))
@@ -2541,7 +2540,7 @@
                        // NOTE: it is OK to pass blank folder to 
"ensure_stream_and_folder" when FOLDER DOE NOT MATTER
                        // for expunge, all we need is a stream, 
                        //$fake_fldball['acctnum'] = $acctnum;
-                       //$this->ensure_stream_and_folder($fake_fldball, 
'phpgw_expunge'.' LINE '.__LINE__);
+                       //$this->ensure_stream_and_folder($fake_fldball, 
'phpgw_expunge'.' LINE '.__LINE__, $display_error);
                        // NOTE THAT CAUSED MAILSERVER TO REOPEN *AWAY* FROM 
FOLDER NEEDING EXPUNGE 
                        // and re-open to INBOX because a blank folder arg was 
passed.
                        if ((isset($fldball['acctnum']))
@@ -2549,7 +2548,7 @@
                        && (isset($fldball['folder']))
                        && ((string)$fldball['folder'] != ''))
                        {
-                               $this->ensure_stream_and_folder($fldball, 
'phpgw_expunge'.' LINE '.__LINE__);
+                               $this->ensure_stream_and_folder($fldball, 
'phpgw_expunge'.' LINE '.__LINE__, $display_error);
                        }
                        
                        $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $acctnum);
@@ -2578,7 +2577,7 @@
                call "expunge_expungable_folders" after all deletes have been 
done.
                @access public
                */
-               function phpgw_delete($msg_num,$flags=0, $currentfolder="", 
$acctnum='', $known_single_delete=False) 
+               function phpgw_delete($msg_num,$flags=0, $currentfolder="", 
$acctnum='', $known_single_delete=False, $display_error = true) 
                {
                        if ($this->debug_wrapper_dcom_calls > 0) { 
$this->dbug->out('mail_msg(_wrappers): phpgw_delete: ENTERING <br />'); }
                        
@@ -2672,8 +2671,8 @@
                                $this->event_msg_move_or_delete($mov_msgball, 
'phpgw_delete'.' LINE: '.__LINE__);
                                
//$this->expire_session_cache_item('msgball_list', $acctnum);
                                // delete this when we start buffering straight 
deletes
-                               if ($this->debug_wrapper_dcom_calls > 1) { echo 
'mail_msg(_wrappers): phpgw_delete('.__LINE__.'): calling 
$this->ensure_stream_and_folder()<br />'; }
-                               $this->ensure_stream_and_folder($mov_msgball, 
'phpgw_delete'.' LINE '.__LINE__);
+                               if ($this->debug_wrapper_dcom_calls > 1) { echo 
'mail_msg(_wrappers): phpgw_delete('.__LINE__.'): calling 
$this->ensure_stream_and_folder($display_error)<br />'; }
+                               $this->ensure_stream_and_folder($mov_msgball, 
'phpgw_delete'.' LINE '.__LINE__, $display_error);
                        
                                if ($this->debug_wrapper_dcom_calls > 1) { echo 
'mail_msg(_wrappers): phpgw_delete('.__LINE__.'): getting "mailsvr_stream"<br 
/>'; }
                                $mailsvr_stream = 
$this->get_arg_value('mailsvr_stream', $acctnum);
@@ -2751,7 +2750,7 @@
                must be expired if new prefs are submited.
                @author Angles
                */
-               function get_verified_trash_folder_long($acctnum='')
+               function get_verified_trash_folder_long($acctnum='', 
$display_error = true)
                {
                        if ($this->debug_args_special_handlers > 0) { 
$this->dbug->out('mail_msg(_wrappers)('.__LINE__.'): 
get_verified_trash_folder_long: ENTERING<br />'); }
                        
@@ -2896,7 +2895,7 @@
                @author Angles
                @access Public
                */
-               function is_ball_data($maybe_ball='##NOTHING##', 
$expect_ball_type='any', $is_uri_type_string='')
+               function is_ball_data($maybe_ball='##NOTHING##', 
$expect_ball_type='any', $is_uri_type_string='', $display_error = true)
                {
                        if ($this->debug_args_input_flow > 0) { 
$this->dbug->out('mail_msg: is_ball_data('.__LINE__.'): ENTERING<br />'); } 
                        if ($this->debug_args_input_flow > 1) { 
$this->dbug->out('mail_msg: is_ball_data('.__LINE__.'): param $maybe_ball 
['.htmlspecialchars(serialize($maybe_ball)).'], param $expect_ball_type 
['.$expect_ball_type.'], param $is_uri_type_string 
['.htmlspecialchars(serialize($is_uri_type_string)).']  <br />'); } 
@@ -2999,7 +2998,7 @@
                @author Angles
                @access Public
                */
-               function ball_data_parse_str($uri_ball_data='', 
$do_stripslashes=True)
+               function ball_data_parse_str($uri_ball_data='', 
$do_stripslashes=True, $display_error = true)
                {
                        if ($this->debug_args_input_flow > 0) { 
$this->dbug->out('mail_msg: ball_data_parse_str('.__LINE__.'): ENTERING<br 
/>'); } 
                        if ($this->debug_args_input_flow > 1) { 
$this->dbug->out('mail_msg: ball_data_parse_str('.__LINE__.'): param 
$uri_ball_data ['.$uri_ball_data.']<br />'); } 
@@ -3077,7 +3076,7 @@
                @author Angles
                @access Public
                */
-               function decode_fake_uri($uri_type_string='', $raise_up=False)
+               function decode_fake_uri($uri_type_string='', $raise_up=False, 
$display_error = true)
                {
                        /*
                        $fake_url_b = explode('&', $uri_type_string);
@@ -3200,7 +3199,7 @@
                @discussion to further seperate the mail functionality from php 
itself, this function will perform
                the variable handling of the traditional php page view Get Post 
Cookie (no cookie data used here though)
                The same data could be grabbed from any source, XML-RPC for 
example, insttead of the php GPC vars, 
-               so this function could (should) have an equivalent XML-RPC 
version to handle filling these class variables 
+               so this function could (should, $display_error = true) have an 
equivalent XML-RPC version to handle filling these class variables 
                from an alternative source. This function looks for all the var 
names listed in the 
                $this->known_external_args[] array. Therefor, by adding 
something to that array, it will be looked 
                for here. This is similar to the new phpgwapi "get_var" 
function, but does less syntax checking (validation), and 
@@ -3222,7 +3221,7 @@
                @author Angles
                @access Public
                */
-               function grab_class_args_gpc()
+               function grab_class_args_gpc($display_error = true)
                {
                        if ($this->debug_args_input_flow > 0) { 
$this->dbug->out('mail_msg: grab_class_args_gpc('.__LINE__.'): ENTERING<br 
/>'); }
                        if ($this->debug_args_input_flow > 2) { 
$this->dbug->out('mail_msg: grab_class_args_gpc('.__LINE__.'): $this->ref_POST 
DUMP:', $this->ref_POST); }
@@ -3366,7 +3365,7 @@
                        
                        // in order to know wgat account's arg array to insert 
$got_args[] into, we need to determine what account 
                        // we are dealing with before we can call 
$this->set_arg_array or "->get_isset_arg" or "->get_arg_value", etc...
-                       // so whoever called this function should obtain that 
before calling $this->set_arg_array() with the data we return here
+                       // so whoever called this function should obtain that 
before calling $this->set_arg_array($display_error = true) with the data we 
return here
                        if ($this->debug_args_input_flow > 0) { 
$this->dbug->out('mail_msg: grab_class_args_gpc('.__LINE__.'): LEAVING, 
returning $got_args<br />'); }
                        return $got_args;
                }
@@ -3375,13 +3374,13 @@
                @function grab_class_args_xmlrpc
                @abstract grab data an XML-RPC call and fill various class arg 
variables with the available data
                @result none, this is an object call
-               @discussion functional relative to function 
"grab_class_args_gpc()", except this function grabs the
+               @discussion functional relative to function 
"grab_class_args_gpc($display_error = true)", except this function grabs the
                data from an alternative, non-php-GPC, source
                NOT YET IMPLEMENTED
                @author Angles
                @access Public
                */
-               function grab_class_args_xmlrpc()
+               function grab_class_args_xmlrpc($display_error = true)
                {
                        // STUB, for future use
                        echo 'call to un-implemented function 
grab_class_args_xmlrpc';
@@ -3417,7 +3416,7 @@
                Typically we are dealing with either "fldball" or "msgball" 
data which carry with them the 
                acctnum they are associated with. Being able to determine the 
"best acctnum" that 
                applies to a particular page view is helpful since this value 
will be stored and available 
-               using function $this->get_acctnum() which is easy to call from 
anyewhere.
+               using function $this->get_acctnum($display_error = true) which 
is easy to call from anyewhere.
                Before it became possible to operate on mesages from seperate 
folders and accounts in the same page, 
                this "best acctnum" has more importance, but still it is most 
common not to have a list of messages 
                from different sources, so this function is useful in a 
majority of the usages we will handle. Since 
@@ -3427,7 +3426,7 @@
                @author Angles
                @access Private
                */
-               function get_best_acctnum($args_array='', $got_args='', 
$force_feed_acctnum='')
+               function get_best_acctnum($args_array='', $got_args='', 
$force_feed_acctnum='', $display_error = true)
                {
                        if ($this->debug_args_input_flow > 0) { 
$this->dbug->out('mail_msg: get_best_acctnum('.__LINE__.'): ENTERING, param 
$force_feed_acctnum ['.$force_feed_acctnum.']<br />'); }
                        if ($this->debug_args_input_flow > 2) { 
$this->dbug->out('mail_msg: get_best_acctnum('.__LINE__.'): parm $args_array[] 
DUMP:', $args_array); }
@@ -3492,7 +3491,7 @@
                        if ((isset($force_feed_acctnum))
                        && ((string)$force_feed_acctnum != ''))
                        {
-                               if ($this->debug_args_input_flow > 1) { 
$this->dbug->out('mail_msg: get_best_acctnum('.__LINE__.'): "what acctnum to 
use": will use function param 
$force_feed_acctnum=['.serialize($force_feed_acctnum).']<br />'); }
+                               if ($this->debug_args_input_flow > 1) { 
$this->dbug->out('mail_msg: get_best_acctnum('.__LINE__.'): "what acctnum to 
use": will use function param 
$force_feed_acctnum=['.serialize($force_feed_acctnum).']<br />', $display_error 
= true); }
                                $acctnum = (int)$force_feed_acctnum;
                        }
                        elseif ((isset($got_args['msgball']['acctnum']))
@@ -3587,7 +3586,7 @@
                @author Angles
                @access Public
                */
-               function init_internal_args_and_set_them($acctnum='')
+               function init_internal_args_and_set_them($acctnum='', 
$display_error = true)
                {
                        if ($this->debug_args_input_flow > 0) { 
$this->dbug->out('mail_msg: init_internal_args: ENTERING, (parm 
$acctnum=['.serialize($acctnum).'])<br />'); }
                        // we SHOULD have already obtained a valid acctnum 
before calling this function
@@ -3731,7 +3730,7 @@
                @author Angles
                @access Private
                */
-               function get_best_folder_arg($args_array='', $got_args='', 
$acctnum='')
+               function get_best_folder_arg($args_array='', $got_args='', 
$acctnum='', $display_error = true)
                {
                        if ($this->debug_args_input_flow > 0) { 
$this->dbug->out('mail_msg: get_best_folder_arg: ENTERING <br />'); }
                        if ($this->debug_args_input_flow > 2) { 
$this->dbug->out('mail_msg: get_best_folder_arg: param $acctnum ['.$acctnum.'] 
; parm $args_array[] DUMP:', $args_array); }
@@ -3894,7 +3893,7 @@
                GLOBALS[phpgw_session][phpgw_app_sessions][email]
                @access private
                */
-               function 
save_session_cache_item($data_name='misc',$data,$acctnum='',$extra_keys='')
+               function 
save_session_cache_item($data_name='misc',$data,$acctnum='',$extra_keys='', 
$display_error = true)
                {
                        if ($this->debug_session_caching > 0) { 
$this->dbug->out('mail_msg: save_session_cache_item('.__LINE__.'): ENTERED, 
$this->session_cache_enabled='.serialize($this->session_cache_enabled).', 
$data_name: ['.$data_name.'], $acctnum (optional): ['.$acctnum.'], $extra_keys: 
['.$extra_keys.']<br />'); }
                        $has_handler = False;
@@ -4174,7 +4173,7 @@
                        elseif ($data_name == 'folder_status_info')
                        {
                                if ($this->debug_session_caching > 1) { 
$this->dbug->out('mail_msg: save_session_cache_item('.__LINE__.'): 
(extreme-mode) data exists for "'.$data_name.'" AND has a handler<br />'); }
-                               if ($this->debug_session_caching > 2) { 
$this->dbug->out('mail_msg: save_session_cache_item('.__LINE__.'): 
"'.$data_name.'" ARRIVING param $data as it is passed into this function 
DUMP:', $data); } 
+                               if ($this->debug_session_caching > 2) { 
$this->dbug->out('mail_msg: save_session_cache_item('.__LINE__.'): 
"'.$data_name.'" ARRIVING param $data as it is passed into this function 
DUMP:', $data, $display_error = true); } 
                                // DATA REQUIRING "extra_keys" because it is 
probably one element of a larger group of related data
                                // we will not waste time making a sub array, 
instead we add the "extra_keys" to the "location"
                                // that way we can directly access this 
individual datUM without the hastle of a sub array
@@ -4253,7 +4252,7 @@
                        || ($data_name == 'phpgw_header'))
                        {
                                if ($this->debug_session_caching > 1) { 
$this->dbug->out('mail_msg: save_session_cache_item('.__LINE__.'): 
(extreme-mode) data exists for "'.$data_name.'" AND has a handler<br />'); }
-                               if ($this->debug_session_caching > 2) { 
$this->dbug->out('mail_msg: save_session_cache_item('.__LINE__.'): 
"'.$data_name.'" ARRIVING param $data as it is passed into this function 
DUMP:', $data); } 
+                               if ($this->debug_session_caching > 2) { 
$this->dbug->out('mail_msg: save_session_cache_item('.__LINE__.'): 
"'.$data_name.'" ARRIVING param $data as it is passed into this function 
DUMP:', $data, $display_error = true); } 
                                // DATA REQUIRING "extra_keys" because it is 
probably one element of a larger group of related data
                                // we will not waste time making a sub array, 
instead we add the "extra_keys" to the "location"
                                // that way we can directly access this 
individual datUM without the hastle of a sub array
@@ -4345,7 +4344,7 @@
                        elseif ($data_name == 'phpgw_fetchbody')
                        {
                                if ($this->debug_session_caching > 1) { 
$this->dbug->out('mail_msg: save_session_cache_item('.__LINE__.'): 
(extreme-mode) data exists for "'.$data_name.'" AND has a handler<br />'); }
-                               if ($this->debug_session_caching > 2) { 
$this->dbug->out('mail_msg: save_session_cache_item('.__LINE__.'): 
"'.$data_name.'" ARRIVING param $data as it is passed into this function 
DUMP:', $data); } 
+                               if ($this->debug_session_caching > 2) { 
$this->dbug->out('mail_msg: save_session_cache_item('.__LINE__.'): 
"'.$data_name.'" ARRIVING param $data as it is passed into this function 
DUMP:', $data, $display_error = true); } 
                                
                                //(1) Data Param ARRIVES to this function like 
this
                                //msg_structure $data param arrives into this 
function like this:
@@ -4474,7 +4473,7 @@
                NOTE: ALL INFO SUBJECT TO CHANGE. 
                @access private
                */
-               function read_session_cache_item($data_name='misc', 
$acctnum='', $ex_folder='', $ex_msgnum='', $ex_part_no='')
+               function read_session_cache_item($data_name='misc', 
$acctnum='', $ex_folder='', $ex_msgnum='', $ex_part_no='', $display_error = 
true)
                {
                        if ($this->debug_session_caching > 0) { 
$this->dbug->out('mail_msg: read_session_cache_item('.__LINE__.'): ENTERED, 
$data_name: ['.$data_name.']; optional: $acctnum: ['.$acctnum.'], $ex_folder: 
['.$ex_folder.'], $ex_msgnum: ['.$ex_msgnum.'], $ex_part_no: ['.$ex_part_no.'] 
'.'<br />'); }
                        if ($this->debug_session_caching > 1) { 
$this->dbug->out('AND 
$this->session_cache_enabled='.serialize($this->session_cache_enabled).'; 
$this->session_cache_extreme='.serialize($this->session_cache_extreme).'<br 
/>'); } 
@@ -4691,7 +4690,7 @@
                                        $fldball['folder'] = 
$this->prep_folder_out($this->get_arg_value('folder', $acctnum));
                                        if ($this->debug_session_caching > 1) { 
$this->dbug->out('mail_msg: read_session_cache_item('.__LINE__.'): handling 
['.$data_name.'] requires obtaining "folder_status_info" we get by calling 
$this->get_folder_status_info('.serialize($fldball).')<br />'); } 
                                        $folder_info = 
$this->get_folder_status_info($fldball);
-                                       if ($this->debug_session_caching > 1) { 
$this->dbug->out('mail_msg: read_session_cache_item('.__LINE__.'): 
['.$data_name.'] will be verified as representing this folder and acctnum, then 
freshness checked <i>details: with the stored "folder_status_info" compared to 
the "folder_status_info" we just obtained a few lines up, which 
"folder_status_info" was itself validated in the function we got it from. The 
"msgball_list" is appsession cached whether in "extreme-mode" or not, as long 
as "enable_session_cache" is true </i><br />'); }
+                                       if ($this->debug_session_caching > 1) { 
$this->dbug->out('mail_msg: read_session_cache_item('.__LINE__.'): 
['.$data_name.'] will be verified as representing this folder and acctnum, then 
freshness checked <i>details: with the stored "folder_status_info" compared to 
the "folder_status_info" we just obtained a few lines up, which 
"folder_status_info" was itself validated in the function we got it from. The 
"msgball_list" is appsession cached whether in "extreme-mode" or not, as long 
as "enable_session_cache" is true </i><br />', $display_error = true); }
                                        
                                        // "validity_test" is what the test is 
like, but it's only really used for the debug data dump
                                        // because the real test below gets all 
the same info all over again as exists in this "match_to_be_fresh" array
@@ -4919,7 +4918,7 @@
                @access private
                */
                // ---- session-only data cached to appsession  ----
-               function 
expire_session_cache_item($data_name='misc',$acctnum='', $ex_folder='', 
$ex_msgnum='', $ex_part_no='')
+               function 
expire_session_cache_item($data_name='misc',$acctnum='', $ex_folder='', 
$ex_msgnum='', $ex_part_no='', $display_error = true)
                {               
                        if ((!isset($acctnum))
                        || ((string)$acctnum == ''))
@@ -5104,7 +5103,7 @@
                which produces a more desirable result.
                @author Angles
                */
-               function get_acctnum($unset_returns_default=True)
+               function get_acctnum($unset_returns_default=True, 
$display_error = true)
                {
                        if ($this->debug_accts > 0) { 
$this->dbug->out('mail_msg: get_acctnum: ENTERING, (parm 
$unset_returns_default=['.serialize($unset_returns_default).'])<br />'); }
                        
@@ -5139,7 +5138,7 @@
                @discussion ?
                @access public
                */
-               function set_acctnum($acctnum='')
+               function set_acctnum($acctnum='', $display_error = true)
                {
                        if ($this->debug_accts > 0) { 
$this->dbug->out('mail_msg: set_acctnum: ENTERING, (parm 
$acctnum=['.serialize($acctnum).'])<br />'); }
                        if ((isset($acctnum))
@@ -5170,7 +5169,7 @@
                @access public
                @author Angles
                */
-               function get_pref_value($pref_name='',$acctnum='')
+               function get_pref_value($pref_name='',$acctnum='', 
$display_error = true)
                {
                        if ($this->debug_args_oop_access > 0) { 
$this->dbug->out('mail_msg(_wrappers): get_pref_value: ENTERING, $pref_name: 
['.$pref_name.'] $acctnum: ['.$acctnum.']'.'<br />'); }
                        if ((!isset($acctnum))
@@ -5208,7 +5207,7 @@
                a single script run. 
                @access public
                */
-               function set_pref_value($pref_name='', $this_value='', 
$acctnum='')
+               function set_pref_value($pref_name='', $this_value='', 
$acctnum='', $display_error = true)
                {
                        if ((!isset($acctnum))
                        || ((string)$acctnum == ''))
@@ -5245,25 +5244,20 @@
                is a valid value.
                @access public
                */
-               function get_isset_pref($pref_name='',$acctnum='')
+               function get_isset_pref($pref_name='',$acctnum='', 
$display_error = true)
                {
-                       if ((!isset($acctnum))
-                       || ((string)$acctnum == ''))
+                       if ( !$acctnum )
                        {
                                $acctnum = $this->get_acctnum();
                        }
                        // error check
-                       if ((isset($pref_name))
-                       && ((string)$pref_name != '')
-                       && (isset($this->a[$acctnum]['prefs'][$pref_name])))
+                       if ( isset($pref_name) && $pref_name
+                               && 
isset($this->a[$acctnum]['prefs'][$pref_name]) )
                        {
-                               return True;
+                               return true;
                        }
-                       else
-                       {
                                // arg not set, or invalid input $arg_name
-                               return False;
-                       }
+                       return false;
                }
                
                /*!
@@ -5277,7 +5271,7 @@
                @discussion ?
                @access public
                */
-               function unset_pref($pref_name='', $acctnum='')
+               function unset_pref($pref_name='', $acctnum='', $display_error 
= true)
                {
                        if ((!isset($acctnum))
                        || ((string)$acctnum == ''))
@@ -5311,7 +5305,7 @@
                have passed through some logic to process and normalize them,
                @access public
                */
-               function get_all_prefs($acctnum='')
+               function get_all_prefs($acctnum='', $display_error = true)
                {
                        if ((!isset($acctnum))
                        || ((string)$acctnum == ''))
@@ -5347,7 +5341,7 @@
                preference array.
                @access private
                */
-               function set_pref_array($pref_array_data='', $acctnum='')
+               function set_pref_array($pref_array_data='', $acctnum='', 
$display_error = true)
                {
                        if ((!isset($acctnum))
                        || ((string)$acctnum == ''))
@@ -5385,7 +5379,7 @@
                @discussion ?
                @access private
                */
-               function _get_arg_is_known($arg_name='', 
$calling_function_name='')
+               function _get_arg_is_known($arg_name='', 
$calling_function_name='', $display_error = true)
                {
                        // skip this unless debug level 4
                        if ($this->debug_args_oop_access < 4)
@@ -5442,7 +5436,7 @@
                @discussion ?
                @access public
                */
-               function get_isset_arg($arg_name='',$acctnum='', $extra_keys='')
+               function get_isset_arg($arg_name='',$acctnum='', 
$extra_keys='', $display_error = true)
                {
                        if ($this->debug_args_oop_access > 0) { 
$this->dbug->out('mail_msg(_wrappers): get_isset_arg: ENTERING, $arg_name: 
['.$arg_name.'] $acctnum: ['.$acctnum.']'.'<br />'); }
                        if ($this->debug_args_oop_access > 1) { 
$this->_get_arg_is_known($arg_name, 'get_isset_arg'); }
@@ -5518,7 +5512,7 @@
                @discussion ?
                @access public
                */
-               function unset_arg($arg_name='', $acctnum='')
+               function unset_arg($arg_name='', $acctnum='', $display_error = 
true)
                {
                        if ($this->debug_args_oop_access > 1) { 
$this->_get_arg_is_known($arg_name, 'unset_arg'); }
                        
@@ -5591,74 +5585,41 @@
                class variable desired is a simple variable and its value is 
returned.
                @access public
                */
-               function get_arg_value($arg_name='',$acctnum='', $extra_keys='')
+               function get_arg_value($arg_name='',$acctnum='', 
$extra_keys='', $display_error = true)
                {
                        if ($this->debug_args_oop_access > 0) { 
$this->dbug->out('mail_msg(_wrappers): get_arg_value: ENTERING ($arg_name: 
['.$arg_name.'], $acctnum: ['.$acctnum.'] )<br />'); }
                        if ($this->debug_args_oop_access > 1) { 
$this->_get_arg_is_known($arg_name, 'get_arg_value'); }
                        
-                       if ((!isset($acctnum))
-                       || ((string)$acctnum == ''))
+                       if ( !$acctnum )
                        {
                                $acctnum = $this->get_acctnum();
                        }
                        
-                       if ((isset($arg_name))
-                       && ((string)$arg_name != ''))
-                       {
                                // ----  SPECIAL HANDLERS  ----
-                               if ($arg_name == 'mailsvr_callstr')
+                       switch ( $arg_name )
                                {
+                               case 'mailsvr_callstr':
                                        if ($this->debug_args_oop_access > 0) { 
$this->dbug->out('mail_msg(_wrappers): get_arg_value: LEAVING with HANDOFF to 
get_mailsvr_callstr('.$acctnum.')<br />'); }
                                        return 
$this->get_mailsvr_callstr($acctnum);
-                               }
-                               elseif ($arg_name == 'mailsvr_namespace')
-                               {
+
+                               case 'mailsvr_namespace':
                                        if ($this->debug_args_oop_access > 0) { 
$this->dbug->out('mail_msg(_wrappers): get_arg_value: LEAVING with HANDOFF to 
get_mailsvr_namespace('.$acctnum.')<br />'); }
                                        return 
$this->get_mailsvr_namespace($acctnum);
-                               }
-                               elseif ($arg_name == 'mailsvr_delimiter')
-                               {
+
+                               case 'mailsvr_delimiter':
                                        if ($this->debug_args_oop_access > 0) { 
$this->dbug->out('mail_msg(_wrappers): get_arg_value: LEAVING with HANDOFF to 
get_mailsvr_delimiter('.$acctnum.')<br />'); }
                                        return 
$this->get_mailsvr_delimiter($acctnum);
-                               }
-                               elseif ($arg_name == 'folder_list')
-                               {
+
+                               case 'folder_list':
                                        if ($this->debug_args_oop_access > 0) { 
$this->dbug->out('mail_msg(_wrappers): get_arg_value: LEAVING with HANDOFF to 
get_folder_list()<br />'); }
                                        return $this->get_folder_list($acctnum);
-                               }
-                               elseif ($arg_name == 
'verified_trash_folder_long')
-                               {
+
+                               case 'verified_trash_folder_long':
                                        if ($this->debug_args_oop_access > 0) { 
$this->dbug->out('mail_msg(_wrappers): get_arg_value: LEAVING with HANDOFF to 
get_verified_trash_folder_long()<br />'); }
                                        return 
$this->get_verified_trash_folder_long($acctnum);
                                }
-                               /*
-                               elseif ($arg_name == 'folder')
-                               {
-                                       if ($this->debug_args_oop_access > 1) { 
echo 'mail_msg(_wrappers): get_arg_value: request for backwards compat arg 
"folder"<br />'; }
-                                       // look for foder in (1) msgball , then 
(2) fldball , then (3) return default value INBOX
-                                       if ( 
(isset($this->a[$acctnum]['args']['msgball']['folder']))
-                                       && 
($this->a[$acctnum]['args']['msgball']['folder'] != '') )
-                                       {
-                                               $folder_arg_decision = 
$this->a[$acctnum]['args']['msgball']['folder'];
-                                               if 
($this->debug_args_oop_access > 1) { echo 'mail_msg(_wrappers): get_arg_value: 
request for "folder" will use value in 
$this->a['.$acctnum.'][args][msgball][folder] = ['.$folder_arg_decision.']<br 
/>'; }
-                                       }
-                                       elseif ( 
(isset($this->a[$acctnum]['args']['fldball']['folder']))
-                                       && 
($this->a[$acctnum]['args']['fldball']['folder'] != '') )
-                                       {
-                                               $folder_arg_decision = 
$this->a[$acctnum]['args']['fldball']['folder'];
-                                               if 
($this->debug_args_oop_access > 1) { echo 'mail_msg(_wrappers): get_arg_value: 
request for "folder" will use value in 
$this->a['.$acctnum.'][args][fldball][folder] = ['.$folder_arg_decision.']<br 
/>'; }
-                                       }
-                                       else
-                                       {
-                                               if 
($this->debug_args_oop_access > 1) { echo 'mail_msg(_wrappers): get_arg_value: 
request for "folder" using "INBOX", found nothing in [args][msgball][folder] 
nor [args][fldball][folder]<br />'; }
-                                               $folder_arg_decision = 'INBOX';
-                                       }
-                                       if ($this->debug_args_oop_access > 0) { 
echo 'mail_msg(_wrappers): get_arg_value: LEAVING, returning (backward compat) 
$folder_arg_decision ['.$folder_arg_decision.']<br />'; }
-                                       return $folder_arg_decision;
-                               }
-                               */
                                // ----  STANDARD HANDLER (arg_name has 
sub-levels) ----
-                               elseif (strstr($arg_name, ']['))
+                       if ( preg_match('/\]\[/', $arg_name) )
                                {
                                        if ($extra_keys)
                                        {
@@ -5673,43 +5634,32 @@
                                                //$code = '$evaled = 
$this->a[$acctnum][\'args\']'.$arg_name.';';
                                                $code = '$evaled = 
$this->a[$acctnum]["args"]'.$arg_name.';';
                                        }
-                                       if ($this->debug_args_oop_access > 1) { 
$this->dbug->out('mail_msg(_wrappers): get_arg_value: $arg_name is requesting 
sub-level array element(s),  use EVAL, $arg_name: '.serialize($arg_name).'<br 
/>'); }
                                        $evaled = '';
-                                       if ($this->debug_args_oop_access > 1) { 
$this->dbug->out(' * $code: '.$code.'<br />'); }
                                        eval($code);
-                                       if ($this->debug_args_oop_access > 1) { 
$this->dbug->out(' * $evaled: '.$evaled.'<br />'); }
-                                       if ((isset($evaled))
-                                       && (!$extra_keys)
-                                       && (strstr($arg_name, 
'folder_status_info')))
+                               if ( !$extra_keys && 
preg_match('/folder_status_info/', $argname) )
                                        {
-                                               if 
($this->debug_args_oop_access > 1) { $this->dbug->out('mail_msg(_wrappers): 
get_arg_value: sublevels with folder_status_info NEED values to be serialized 
since we eval it, so unserialize(base64_decode($evaled)) now: <br />'); }
                                                $evaled = 
unserialize(base64_decode($evaled));
                                        }
                                        if (isset($evaled))
                                        {
-                                               if 
($this->debug_args_oop_access > 0) { $this->dbug->out('mail_msg(_wrappers): 
get_arg_value: LEAVING returning $evaled: ['.$evaled.'] produced by $code: 
'.$code.'<br />'); }
                                                return $evaled;
                                        }
                                }
                                // ----  STANDARD HANDLER (arg_name has NO 
sub-levels) ----
-                               elseif (($extra_keys)
-                               && 
(isset($this->a[$acctnum]['args'][$arg_name][$extra_keys])))
+                       if ( $extra_keys
+                               && 
isset($this->a[$acctnum]['args'][$arg_name][$extra_keys]) )
                                {
-                                       if ($this->debug_args_oop_access > 0) { 
$this->dbug->out('mail_msg(_wrappers): get_arg_value: LEAVING returning 
$this->a[$acctnum('.$acctnum.')][args][$arg_name]: 
'.$this->a[$acctnum]['args'][$arg_name].'<br />'); }
                                        return 
$this->a[$acctnum]['args'][$arg_name];
                                }
-                               elseif ((!$extra_keys)
-                               && 
(isset($this->a[$acctnum]['args'][$arg_name])))
+                       else if ( !$extra_keys
+                               && isset($this->a[$acctnum]['args'][$arg_name]) 
)
                                {
-                                       if ($this->debug_args_oop_access > 0) { 
$this->dbug->out('mail_msg(_wrappers): get_arg_value: LEAVING returning 
$this->a[$acctnum('.$acctnum.')][args][$arg_name]: 
'.$this->a[$acctnum]['args'][$arg_name].'<br />'); }
                                        return 
$this->a[$acctnum]['args'][$arg_name];
                                }
-                       }
                        
                        // we ONLY get here if there's no data to return,
                        // arg not set, or invalid input $arg_name
                        // otherwise, anything that is sucessful returns and 
exist at that point, never gets to here
-                       if ($this->debug_args_oop_access > 0) { 
$this->dbug->out('mail_msg(_wrappers): get_arg_value: LEAVING, returning 
*nothing*, arg not set of input arg invalid, using naked "return" call<br />'); 
}
                        return;
                }
                
@@ -5723,7 +5673,7 @@
                @discussion Esoteric utility function for specialized private 
use.
                @access private
                */
-               function _direct_access_arg_value($arg_name='',$acctnum='')
+               function _direct_access_arg_value($arg_name='',$acctnum='', 
$display_error = true)
                {
                        if ($this->debug_args_oop_access > 1) { 
$this->_get_arg_is_known($arg_name, '_direct_access_arg_value'); }
                        
@@ -5758,7 +5708,7 @@
                NOTE: Returning References requires the ampersand in BOTH the 
call to the function AND the function 
                declaration here.
                @example 
-                       function &find_var ($param)
+                       function &find_var ($param, $display_error = true)
                        {
                                ...code...
                                return $found_var;
@@ -5767,7 +5717,7 @@
                        // that was straing from the phpmanual
                @access private
                */
-               function &_get_arg_ref($arg_name='',$acctnum='')
+               function &_get_arg_ref($arg_name='',$acctnum='', $display_error 
= true)
                {
                        if ($this->debug_args_oop_access > 1) { 
$this->_get_arg_is_known($arg_name, 'get_arg_ref'); }
                        
@@ -5802,7 +5752,7 @@
                $this->nothing on failure.
                @author Angles
                */
-               function &get_arg_value_ref($arg_name='',$acctnum='')
+               function &get_arg_value_ref($arg_name='',$acctnum='', 
$display_error = true)
                {
                        if ($this->debug_args_oop_access > 0) { 
$this->dbug->out('mail_msg(_wrappers): get_arg_value_ref: ENTERING ($arg_name: 
['.$arg_name.'], $acctnum: ['.$acctnum.'] )<br />'); }
                        if ($this->debug_args_oop_access > 1) { 
$this->_get_arg_is_known($arg_name, 'get_arg_value_ref'); }
@@ -5875,7 +5825,7 @@
                @discussion ?
                @access public
                */
-               function set_arg_value($arg_name='', $this_value='', 
$acctnum='', $extra_keys='')
+               function set_arg_value($arg_name='', $this_value='', 
$acctnum='', $extra_keys='', $display_error = true)
                {
                        if ($this->debug_args_oop_access > 1) { 
$this->_get_arg_is_known($arg_name, 'set_arg_value'); }
                        if ($this->debug_args_oop_access > 0) { 
$this->dbug->out('mail_msg(_wrappers)('.__LINE__.'): set_arg_value: ENTERING, 
$arg_name: ['.$arg_name.'] ; $this_value: ['.$this_value.'] ; $acctnum: 
['.$acctnum.']<br />'); }
@@ -5971,7 +5921,7 @@
                @discussion ?
                @access private
                */
-               function set_arg_array($arg_array_data='', $acctnum='')
+               function set_arg_array($arg_array_data='', $acctnum='', 
$display_error = true)
                {
                        if ((!isset($acctnum))
                        || ((string)$acctnum == ''))
@@ -6010,7 +5960,7 @@
                @discussion ?
                @access private
                */
-               function get_all_args($acctnum='')
+               function get_all_args($acctnum='', $display_error = true)
                {
                        if ((!isset($acctnum))
                        || ((string)$acctnum == ''))
@@ -6038,7 +5988,7 @@
                @discussion ?
                @access private
                */
-               function unset_all_args($acctnum='')
+               function unset_all_args($acctnum='', $display_error = true)
                {
                        if ((!isset($acctnum))
                        || ((string)$acctnum == ''))
@@ -6051,18 +6001,18 @@
                
                
                // depreciated
-               //function get_folder($acctnum='')
+               //function get_folder($acctnum='', $display_error = true)
                //{
                //      return $this->get_arg_value('folder');
                //}
                
                // depreciated
-               //function get_msgnum($acctnum='')
+               //function get_msgnum($acctnum='', $display_error = true)
                //{
                //      return $this->get_arg_value('["msgball"]["msgnum"]');
                //}
                
-               //function get_pref_layout($acctnum='')
+               //function get_pref_layout($acctnum='', $display_error = true)
                //{
                //      return $this->get_pref_value('layout', $acctnum);
                //}

Modified: trunk/email/inc/class.msg_bootstrap.inc.php
===================================================================
--- trunk/email/inc/class.msg_bootstrap.inc.php 2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/email/inc/class.msg_bootstrap.inc.php 2008-02-02 13:52:39 UTC (rev 
18466)
@@ -27,7 +27,7 @@
        * message, and the script exits.
        * @package email
        */      
-       class msg_bootstrap
+       class email_msg_bootstrap
        {
                /**
                 * @var boolean $do_login Defaults to True, most often you do 
not need to change this.
@@ -39,7 +39,7 @@
                var $debug_level=0;
                //var $debug_level=3;
                
-               function msg_bootstrap()
+               function __construct()
                {
                        if (defined('BS_LOGIN_NEVER') == False)
                        {
@@ -57,38 +57,6 @@
                }
                
                
-               /* * * * 
-               @function set_do_login
-               @abstract whether to try to login to the mail server or not 
during a call to "ensure_mail_msg_exists". 
-               OPTIONAL, default is True. Behavior depends on caching method.
-               @param $do_login (boolean) 
-               @author Angles
-               @result (boolean) whatever the value var $this->do_login has on 
exiting the function.
-               @discussion OPTONAL, default of True works for most situations. 
This do_login value is 
-               used in this objects function "ensure_mail_msg_exists" where it 
is passed to the mail_msg class. 
-               Again, this is OPTONAL, default of True works for most 
situations, such as 
-               (1a) If session_cache_extreme is True, and do_login=True, this 
will _allow_ a server login, 
-               if needed, only if the app needs to get data that is not 
already cached.
-               (1b) If session_cache_extreme is False, and do_login=True, this 
will _always_ try to establish 
-               a mail server stream at the beginning of every script run. 
-               (2a and 2b) Setting do_login to False is useful in certain 
limited situations, such as the email settings page, 
-               or the preferences page. There you want to set or get email 
preference data but you do NOT 
-               require a login, or when there may be no preference data set 
yet, such as the first time a user 
-               sets the preferences, so a login is not even possible. The 
preference data will be handled by the 
-               mail_msg class as usual. Setting do_login to False for these 
occasions is OK no matter if 
-               session_cache_extreme is True or False. 
-               @access public
-               *
-               function set_do_login($do_login='##NOTHING##')
-               {
-                       if (is_bool($do_login))
-                       {
-                               $this->do_login = $do_login;
-                       }
-                       return $this->do_login;
-               }
-               */
-               
                /*!
                @function set_do_login REIMPLEMENTATION
                @abstract whether to try to login to the mail server or not 
during a call to "ensure_mail_msg_exists". 
@@ -119,54 +87,40 @@
                        {
                                if ($do_login == True)
                                {
-                                       $this->do_login = True;
                                        $this->do_login_ex = 
BS_LOGIN_ONLY_IF_NEEDED;
                                }
                                else
                                {
-                                       $this->do_login = False;
                                        $this->do_login_ex = BS_LOGIN_NEVER;
                                }
+
+                               $this->do_login = $do_login;
+
                                // LEAVING HERE
-                               if ($this->debug_level > 0) { echo 'LEAVING: 
msg_bootstrap: set_do_login: (bool input) (called_by: '.$called_by.') 
$this->do_login: ['.$this->do_login.'] $this->do_login_ex: 
['.$this->do_login_ex.'] '.'<br />'; }
                                return $this->do_login;
                        }
                        elseif (is_int($do_login))
                        {
                                // new way has 3 possibilities
+                               $this->do_login = true;
                                switch($do_login)
                                {
                                        case BS_LOGIN_NEVER:
-                                               {
-                                                       $this->do_login = False;
-                                                       $this->do_login_ex = 
BS_LOGIN_NEVER;
-                                                       break;
-                                               }
+                                               $this->do_login = false;
+                                               // no break here - we want to 
fall thru
                                        case BS_LOGIN_ONLY_IF_NEEDED:
-                                               {
-                                                       $this->do_login = True;
-                                                       $this->do_login_ex = 
BS_LOGIN_ONLY_IF_NEEDED;
-                                                       break;
-                                               }
                                        case BS_LOGIN_YES:
-                                               {
-                                                       $this->do_login = True;
-                                                       $this->do_login_ex = 
BS_LOGIN_YES;
-                                                       break;
-                                               }
+                                               $this->do_login_ex = $do_login;
+
                                        default:
-                                               {
-                                                       $this->do_login = True;
                                                        $this->do_login_ex = 
BS_LOGIN_ONLY_IF_NEEDED;
                                                }
                                }
-                       }
                        else
                        {
                                $this->do_login = True;
                                $this->do_login_ex = BS_LOGIN_ONLY_IF_NEEDED;
                        }
-                       if ($this->debug_level > 0) { echo 'LEAVING: 
msg_bootstrap: set_do_login: (not bool input) (called_by: '.$called_by.') 
$this->do_login: ['.$this->do_login.'] $this->do_login_ex: 
['.$this->do_login_ex.'] '.'<br />'; }
                        return $this->do_login_ex;
                }
                
@@ -241,16 +195,8 @@
                        // make sure utility classes (like html widgets) exist 
for global access
                        //$this->ensure_utility_classes($debug_level);
                        
-                       if (is_object($GLOBALS['phpgw']->msg))
-                       //if ((isset($GLOBALS['phpgw']->msg))
-                       //&& (isset($GLOBALS['phpgw']->msg->been_constructed))
-                       //&& ($GLOBALS['phpgw']->msg->been_constructed == True)
-                       //)
+                       if ( !is_object($GLOBALS['phpgw']->msg) )
                        {
-                               if ($this->debug_level > 1) { echo 
'msg_bootstrap: ensure_mail_msg_exists('.__LINE__.'): (called_by: 
'.$called_by.'): is_object test: $GLOBALS[phpgw]->msg is already set, do not 
create again<br />'; }
-                       }
-                       else
-                       {
                                if ($this->debug_level > 1) { echo 
'msg_bootstrap: ensure_mail_msg_exists('.__LINE__.'): (called_by: 
'.$called_by.'): $GLOBALS[phpgw]->msg is NOT set, creating mail_msg object<br 
/>'; }
                                $GLOBALS['phpgw']->msg = 
CreateObject("email.mail_msg");
                                //$GLOBALS['phpgw']->msg =& 
CreateObject("email.mail_msg");
@@ -269,19 +215,17 @@
                                return True;
                        }
                        
-                       $args_array = Array();
-                       // should we log in or not
-                       if ($this->debug_level > 1) { echo 'msg_bootstrap: 
ensure_mail_msg_exists: (called_by: '.$called_by.'): $this->do_login: 
['.serialize($this->do_login).']<br />'; }
-                       $args_array['do_login'] = $this->do_login;
-                       if ($this->debug_level > 1) { echo 'msg_bootstrap: 
ensure_mail_msg_exists: (called_by: '.$called_by.'): $this->do_login_ex: 
['.serialize($this->do_login_ex).']<br />'; }
-                       $args_array['do_login_ex'] = $this->do_login_ex;
+                       $args_array = array
+                       (
+                               'do_login'              => $this->do_login,
+                               'do_login_ex'   => $this->do_login_ex
+                       );
                        
                        // "start your engines"
                        if ($this->debug_level > 1) { echo 'msg_bootstrap: 
ensure_mail_msg_exists: (called_by: '.$called_by.'): call msg->begin_request 
with args array:<pre>'; print_r($args_array); echo '</pre>'; }
                        $some_stream = 
$GLOBALS['phpgw']->msg->begin_request($args_array);
                        // error if login failed
-                       if (($args_array['do_login'] == True)
-                       && (!$some_stream))
+                       if (  $args_array['do_login']  && !$some_stream )
                        {
                                
$GLOBALS['phpgw']->msg->login_error($_SERVER['PHP_SELF'].', msg_bootstrap: 
ensure_mail_msg_exists(), called_by: '.$called_by);
                        }
@@ -326,4 +270,3 @@
 
        }
        
-?>

Added: trunk/email/inc/class.service.inc.php
===================================================================
--- trunk/email/inc/class.service.inc.php                               (rev 0)
+++ trunk/email/inc/class.service.inc.php       2008-02-02 13:52:39 UTC (rev 
18466)
@@ -0,0 +1,200 @@
+<?php
+/**
+ * EMail - Service
+ *
+ * @author Philipp Kamps <address@hidden>
+ * @author Dave Hall <address@hidden>
+ * @copyright Copyright (C) 2003-2007 Free Software Foundation, Inc. 
http://www.fsf.org/
+ * @license http://www.gnu.org/licenses/gpl.html GNU General Public License
+ * @package email
+ * @version $Id$
+ */
+
+
+/**
+ * Service
+ *
+ * @package email
+ */    
+class email_service
+{
+       /**
+       * @param enable debugging
+       */ 
+       private $debug = false;
+
+       /**
+        * Get the menus for the email module
+        * 
+        * @return array available menus for the current user
+        */
+       public function get_menu()
+       {
+               $menu = array();
+
+               $menu['navbar'] = array
+               (
+                       'email' => array
+                       (
+                               'text'  => lang('Email'),
+                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'email.uiindex.index') ),
+                               'image' => array('email', 'navbar'),
+                               'order' => 6,
+                               'group' => 'office'
+                       )
+               );
+
+
+               if ( isset($GLOBALS['phpgw_info']['user']['apps']['admin']) )
+               {
+                       $menu['admin'] = array();
+                       $menu['admin'][] = array
+                       (
+                               'text'  => lang('Site Configuration'),
+                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.uiconfig.index', 'appname' => 'email') )
+                       );
+               }
+
+               $menu['toolbar'] = array
+               (
+                       array
+                       (
+                               // this is a bit of a hack, but it means that 
we can degrade gracefully
+                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'email.uicompose.compose')) . '" onclick="window.open(\'' . 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'email.uicompose.compose')) . '\'); return false;"',
+                               'text'  => lang('New'),
+                               'image' => array('email', 'new')
+                       ),
+                       array
+                       (
+                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'email.uisearch.form')),
+                               'text'  => lang('Search'),
+                               'image' => array('email', 'search')
+                       ),
+                       array
+                       (
+                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'email.uifilters.filters_list') ),
+                               'text'  => lang('Filters'),
+                               'image' => array('email', 'filters')
+                       )
+               );
+
+               if ( 
isset($GLOBALS['phpgw_info']['user']['apps']['preferences']) )
+               {
+                       $menu['preferences'] = array
+                       (
+                               array
+                               (
+                                       'text'  => lang('EMail Preferences'),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'email.uipreferences.preferences'))
+                               ),
+                               array
+                               (
+                                       'text'  => lang('Extra EMail Accounts'),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'email.uipreferences.ex_accounts_list'))
+                               ),
+                               array
+                               (
+                                       'text'  => lang('EMail Filters'),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'email.uifilters.filters_list'))
+                               )
+                       );
+
+                       $menu['toolbar'][] = array
+                       (
+                               'text'  => lang('Preferences'),
+                               'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'email.uipreferences.preferences'))
+                       );
+
+                       $menu['toolbar'][] = array
+                       (
+                               'text'  => lang('Accounts'),
+                               'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'email.uipreferences.ex_accounts_list'))
+                       );
+               }
+
+               $menu['navigation'] = $menu['toolbar'];
+
+               $msg_bootstrap = CreateObject('email.msg_bootstrap');
+               $msg_bootstrap->ensure_mail_msg_exists('email.bofolder.folder', 
false);
+
+               $bopreferences = CreateObject('email.bopreferences');
+               $accts = $bopreferences->msg->a;
+
+               $menu['folders'] = array();
+               foreach ( $accts as $id => $acct )
+               {
+                       if ( is_array($acct) && isset($acct['prefs']) )
+                       {
+                               $folders = array();
+                               if ( substr($acct['prefs']['mail_server_type'], 
0, 4) == 'imap' )
+                               {
+                                       $raw_folders = 
$GLOBALS['phpgw']->msg->get_arg_value('folder_list', $id, '', false);
+                                       $sep = 
$acct['prefs']['imap_server_type'] == 'Cyrus' ? '.' : '/';
+                                       $folders = 
self::process_folders($raw_folders, $sep, $id);
+                               }
+                               else // POP3 doesn't support folders
+                               {
+                                       $folders = array( array
+                                       (
+                                               'text'  => lang('inbox'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'email.uiindex.index', 'fldball[folder]' => 'INBOX', 'fldball[acctnum]' => 
$id)),
+                                               'image' => array('email', 
'folder')
+                                       ));
+                               }
+                               $menu['folders'][] = array
+                               (
+                                       'text'          => 
trim($acct['prefs']['account_name']) ? $acct['prefs']['account_name'] : 
$acct['prefs']['address'],
+                                       'image'         => array('email', 
'account'),
+                                       'children'      => $folders
+                               );
+                       }
+               }
+               return $menu;
+       }
+
+
+       /**
+        * The method provides the list of email folders
+        * 
+        * @return array
+        * @access public
+        */
+       function getFolderContent()
+       {
+               return array('content', 'this is being phased out');
+       }
+
+       /**
+       * Convert a flat folder structure into a menu compatiable associate 
array
+       *
+       * @param array $folders the folders to parse
+       * @param string $sep the folder separator character
+       * @param int $acct the mail account id for the folders
+       * @return array properly formatted folder array that can be used in a 
menu
+       */
+       private static function process_folders($folders, $sep, $acct)
+       {
+               $nu_mboxes = array();
+               foreach ( $folders as $id => $info)
+               {
+                       $parts = explode($sep, $info['folder_long']);
+                       $ref =& $nu_mboxes;
+                       foreach ( $parts as $part)
+                       {
+                               //echo "$mpart ";
+                               if ( !isset($ref['children'][$part]) )
+                               {
+                                       $ref['children'][$part] = array
+                                       (
+                                               'text'          => $part,
+                                               'url'           => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'email.uiindex.index', 'fldball[folder]' => $info['folder_long'], 
'fldball[acctnum]' => $acct)),
+                                               'children'      => array(),
+                                               'image'         => 
array('email', 'folder')
+                                       );
+                               }
+                               $ref = &$ref['children'][$part];
+                       }
+               }
+               return $nu_mboxes['children'];
+       }
+}

Modified: trunk/email/inc/class.uiindex.inc.php
===================================================================
--- trunk/email/inc/class.uiindex.inc.php       2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/email/inc/class.uiindex.inc.php       2008-02-02 13:52:39 UTC (rev 
18466)
@@ -38,13 +38,13 @@
                        }
                        
$GLOBALS['phpgw']->js->validate_file('core','base','phpgwapi');
                        
-                       $folder = get_var('folder',array('POST','GET'));
+                       $folder = phpgw::get_var('folder');
                        if($folder)
                        {
                                $_GET['fldball[folder]']=$folder;
                        }
                        
-                       $acctnum = get_var('acctnum',array('POST','GET'));
+                       $acctnum = phpgw::get_var('acctnum');
                        if($acctnum)
                        {
                                $_GET['fldball[acctnum]']=$folder;
@@ -75,6 +75,8 @@
                        $this->bo = CreateObject('email.boindex');
                        $this->bo->index_data();
                        
+                       $this->index_old_tpl();
+                       return;
                        if ($GLOBALS['phpgw']->msg->phpgw_before_xslt)
                        {
                                $this->index_old_tpl();
@@ -96,19 +98,8 @@
                        // we point to the global template for this version of 
phpgw templatings
                        $this->tpl =& $GLOBALS['phpgw']->template;
                        
-                       // NOW we can out the header, because "index_data()" 
filled this global
-                       //      
$GLOBALS['phpgw_info']['flags']['email_refresh_uri']
-                       // which is needed to preserve folder and sort settings 
during the auto-refresh-ing
-                       // currently (Dec 6, 2001) that logic is in 
phpgwapi/inc/templates/idsociety/head.inc.php
-                       unset($GLOBALS['phpgw_info']['flags']['noheader']);
-                       unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
-                       $GLOBALS['phpgw_info']['flags']['noappheader'] = True;
-                       $GLOBALS['phpgw_info']['flags']['noappfooter'] = True;
                        $GLOBALS['phpgw']->common->phpgw_header(true);
                        $this->tpl->set_root(PHPGW_APP_TPL);
-                       // HOWEVER still this class must NOT invoke 
$GLOBALS['phpgw']->common->phpgw_header()
-                       // even though we had to output the header (go 
figure... :)
-                       // later: What does that mean ?
                        
                        $this->bo->xi['my_layout'] = 
$GLOBALS['phpgw']->msg->get_pref_value('layout');
                        $this->bo->xi['my_browser'] = 
$GLOBALS['phpgw']->msg->browser;
@@ -593,9 +584,6 @@
                */
                function mlist()
                {
-                       //raw HTTP_POST_VARS dump
-                       //echo 'HTTP_POST_VARS print_r dump:<b><pre>'."\r\n"; 
print_r($GLOBALS['HTTP_POST_VARS']); echo '</pre><br /><br />'."\r\n";
-                       
                        $this->bo = CreateObject("email.boindex");
                        $this->bo->mlist_data();
                        
@@ -603,16 +591,8 @@
                        // NOW we can out the header, because "index_data()" 
filled this global
                        //      
$GLOBALS['phpgw_info']['flags']['email_refresh_uri']
                        // which is needed to preserve folder and sort settings 
during the auto-refresh-ing
-                       // currently (Dec 6, 2001) that logic is in 
phpgwapi/inc/templates/idsociety/head.inc.php
-                       unset($GLOBALS['phpgw_info']['flags']['noheader']);
-                       unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
-                       $GLOBALS['phpgw_info']['flags']['noappheader'] = True;
-                       $GLOBALS['phpgw_info']['flags']['noappfooter'] = True;
-                       $GLOBALS['phpgw']->common->phpgw_header();
+                       $GLOBALS['phpgw']->common->phpgw_header(true);
                        $GLOBALS['phpgw']->template->set_root(PHPGW_APP_TPL);
-                       // NOTE: as of Dec 10, 2001 a call from menuaction 
defaults to NOT modular
-                       // HOWEVER still this class must NOT invoke 
$GLOBALS['phpgw']->common->phpgw_header()
-                       // even though we had to output the header and navbar, 
(go figure... :)
 
                        // MUCH of this data may not be necessary nor used for 
mlists 
                        $this->bo->xi['my_layout'] = 
$GLOBALS['phpgw']->msg->prefs['layout'];

Modified: trunk/email/setup/phpgw_sv.lang
===================================================================
--- trunk/email/setup/phpgw_sv.lang     2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/email/setup/phpgw_sv.lang     2008-02-02 13:52:39 UTC (rev 18466)
@@ -375,3 +375,4 @@
 your full name common  sv      Ditt hela namn
 your message has been sent     common  sv      Ditt meddelande har skickats!
 your server administrator will set the default values for the following 
options. you may never need to change any of them. if you do need to use 
settings that are different from the defaults for the options below here, then 
check this box. default is disabled, not checked. if you fill in some of the 
options, but later decide to go back to the default values, unchecking this box 
will erase your custom values and put back the default values. all of the 
following options start out with the default value, so you may see some 
settings below even if you have never filled them in. this checkbox only shows 
up for the default email account. if you are setting up additional email 
accounts, you will be required to fill in the following options and this 
checkbox will not be displayed, it will be checked for all extra email 
accounts.       email   sv      Din serveradministrat\xF6r st\xE4ller in 
normalv\xE4rden f\xF6r de f\xF6ljande valen. Du beh\xF6ver kanske inte \xE4ndra 
n\xE5gon av dem. Om du beh\xF6ver anv\xE4nda andra inst\xE4llningar \xE4n de 
f\xF6rinst\xE4llda v\xE4rdena nedan, markera d\xE5 detta val. 
F\xF6rinst\xE4llningen \xE4r avaktiverad, allts\xE5 omarkerad. Om du fyller i 
n\xE5gra av inst\xE4llningarna men vill g\xE5 tillbaka till de 
f\xF6rinst\xE4llda v\xE4rdena, markera d\xE5 av denna, d\xE5 \xE5terg\xE5r det 
till det f\xF6rinst\xE4llda. Alla f\xF6ljande val utg\xE5r fr\xE5n de 
f\xF6rinst\xE4llda v\xE4rdena s\xE5 du kan se n\xE5gra av inst\xE4llningarna 
fast du inte har fyllt i n\xE5gra sj\xE4lv. Denna markering syns bara i det 
ordinarie epostkontot. Om du l\xE4gger till flera konton m\xE5ste du fylla i de 
f\xF6ljande rutorna och denna markering kommer inte att visas, den kommer att 
vara markerad f\xF6r alla extra epostkonton.
+

Modified: trunk/email/setup/setup.inc.php
===================================================================
--- trunk/email/setup/setup.inc.php     2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/email/setup/setup.inc.php     2008-02-02 13:52:39 UTC (rev 18466)
@@ -43,7 +43,8 @@
        $setup_info['email']['hooks'][] = 'add_def_prefs';
        $setup_info['email']['hooks'][] = 'preferences';
        $setup_info['email']['hooks'][] = 'settings';
-       $setup_info['email']['hooks']['getFolderContent'] = 
'email.email_service.getFolderContent';
+       //$setup_info['email']['hooks']['getFolderContent'] = 
'email.email_service.getFolderContent';
+       $setup_info['email']['hooks']['menu'] = 'email.service.get_menu';
 
        /* Dependacies for this app to work */
        $setup_info['email']['depends'][] = array(

Modified: trunk/etemplate/inc/class.solangfile.inc.php
===================================================================
--- trunk/etemplate/inc/class.solangfile.inc.php        2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/etemplate/inc/class.solangfile.inc.php        2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -39,21 +39,20 @@
                function parse_php_app($fd,$plist)
                {
                        $reg_expr = 
'('.implode('|',array_keys($this->functions)).")[ \t]*\([ \t]*(.*)$";
-                       define('SEP',filesystem_separator());
-                       list($app) = explode(SEP,$fd);
+                       list($app) = explode(DIRECTORY_SEPARATOR,$fd);
                        $d=dir($fd);
                        while ($fn=$d->read())
                        {
-                               if (@is_dir($fd.$fn.SEP))
+                               if (@is_dir($fd.$fn.DIRECTORY_SEPARATOR))
                                {
                                        if 
(($fn!='.')&&($fn!='..')&&($fn!='CVS'))
                                        {
-                                               
$plist=$this->parse_php_app($fd.$fn.SEP,$plist);
+                                               
$plist=$this->parse_php_app($fd.$fn.DIRECTORY_SEPARATOR,$plist);
                                        }
                                }
                                elseif ((strpos($fn,'.php')>1) && 
(is_readable($fd.$fn)))
                                {
-                                       $lines = file($fd.SEP.$fn);
+                                       $lines = 
file($fd.DIRECTORY_SEPARATOR.$fn);
 
                                        foreach($lines as $n => $line)
                                        {
@@ -114,8 +113,7 @@
                function missing_app($app,$userlang=en)
                {
                        $cur_lang=$this->load_app($app,$userlang);
-                       define('SEP',filesystem_separator());
-                       $fd = PHPGW_SERVER_ROOT . SEP . $app . SEP;
+                       $fd = PHPGW_SERVER_ROOT . "/{$app}/";
                        $plist=array();
                        $plist = $this->parse_php_app($fd,$plist);
                        reset($plist);
@@ -129,10 +127,8 @@
                */
                function add_app($app,$userlang='en')
                {
-                       define('SEP',filesystem_separator());
-
-                       $fd = PHPGW_SERVER_ROOT . SEP . $app . SEP . 'setup';
-                       $fn = $fd . SEP . 'phpgw_' . $userlang . '.lang';
+                       $fd = PHPGW_SERVER_ROOT . "/{$app}/setup";
+                       $fn = "{$fd}/phpgw_{$userlang}.lang";
                        if (@is_writeable($fn) || is_writeable($fd))
                        {
                                $wr = True;
@@ -180,10 +176,8 @@
                */
                function load_app($app,$userlang='en')
                {
-                       define('SEP',filesystem_separator());
-
-                       $fd = PHPGW_SERVER_ROOT . SEP . $app . SEP . 'setup';
-                       $fn = $fd . SEP . 'phpgw_' . $userlang . '.lang';
+                       $fd = PHPGW_SERVER_ROOT . "/{$app}/setup";
+                       $fn = "{$fd}/phpgw_{$userlang}.lang";
                        if (@is_writeable($fn) || is_writeable($fd))
                        {
                                $wr = True;
@@ -248,7 +242,7 @@
 
                function write_file($app_name,$langarray,$userlang)
                {
-                       $fn = PHPGW_SERVER_ROOT . SEP . $app_name . SEP . 
'setup' . SEP . 'phpgw_' . $userlang . '.lang';
+                       $fn = PHPGW_SERVER_ROOT . 
"/{$app_name}/setup/phpgw_{$userlang}.lang";
                        if (file_exists($fn))
                        {
                                $backup = $fn . '.old';

Modified: trunk/etemplate/setup/phpgw_sv.lang
===================================================================
--- trunk/etemplate/setup/phpgw_sv.lang 2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/etemplate/setup/phpgw_sv.lang 2008-02-02 13:52:39 UTC (rev 18466)
@@ -267,3 +267,4 @@
 xml-file to import     etemplate       sv      xml-fil att importera
 xslt template  etemplate       sv      XSLT-mall
 year   etemplate       sv      \xC5r
+

Modified: trunk/fax/inc/class.manager.inc.php
===================================================================
--- trunk/fax/inc/class.manager.inc.php 2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/fax/inc/class.manager.inc.php 2008-02-02 13:52:39 UTC (rev 18466)
@@ -94,7 +94,7 @@
             if (is_uploaded_file($_FILES['userfile']['tmp_name'])) 
                        { 
                 $filename = $_FILES['userfile']['name'];
-                $filename_real = 
$GLOBALS['phpgw_info']['server']['temp_dir'].SEP.'phpgw_fax_'.$GLOBALS['phpgw']->accounts->data['account_lid'].'_'.$this->randomname(8).'_'.$filename;
+                $filename_real = 
"{$GLOBALS['phpgw_info']['server']['temp_dir']}/phpgw_fax_{$GLOBALS['phpgw']->accounts->data['account_lid']}_"
 . $this->randomname(8) . "_{$filename}";
                                
                                # avoid to add wrong files
                                if (filesize($_FILES['userfile']['tmp_name']) 
!= 0)
@@ -276,8 +276,8 @@
                           'filename_real'      =>      $filename_real,
                           'fc_url'     =>      $file_chooser,
                           'preview_url'        =>      $preview_url,
-                          'img_dn'     =>      $img_path.SEP.'down.png',
-                          'img_up'     =>      $img_path.SEP.'up.png',
+                          'img_dn'     =>      $img_path.'/down.png',
+                          'img_up'     =>      $img_path.'/up.png',
                           'l_faxnumber'        =>      lang('faxnumber'),
                           'l_recipient'        =>      lang('recipient'),
                           'l_company'  =>      lang('company'),
@@ -503,10 +503,11 @@
                 $i = 0;
                 foreach ($ls as $cover_file)
                                {
-                    $tpl->set_var('cover_path', $cp.SEP.$cover_file);
+                    $tpl->set_var('cover_path', "{$cp}/{$cover_file}");
                     $tpl->set_var('cover_name', $cover_file);
                                        
-                    if ($_POST['cover'] == $cp.SEP.$cover_file or 
($_POST['cover'] == '' and $i == 0))
+                    if ($_POST['cover'] == "{$cp}/{$cover_file}"
+                                               || ($_POST['cover'] == '' && $i 
== 0))
                                        {
                         $i = 1;
                         $tpl->set_var('sel', 'selected');
@@ -549,7 +550,7 @@
                 $rand_name = $this->randomname(12);
                 $tmp_dir = $GLOBALS['phpgw_info']['server']['temp_dir'];
                                
-                $filename_real = 
$tmp_dir.SEP.'phpgw_fax_'.$user_login.'_'.$rand_name.'.txt';
+                $filename_real = 
"{$tmp_dir}/phpgw_fax_{$user_login}_{$rand_name}.txt";
                 
                 #ToDo: catch errors!
                 $fle = fopen($filename_real, 'w+');
@@ -960,12 +961,13 @@
             $i = 0;
             foreach ($ls as $cover_file)
                        {
-                $tpl->set_var('cover_path', $cp.SEP.$cover_file);
+                $tpl->set_var('cover_path', "{$cp}/{$cover_file}");
                 $tpl->set_var('cover_name', $cover_file);
-                if ($prefs['cover'] == $cp.SEP.$cover_file or 
(!$prefs['cover'] and $i == 0)) 
+                if ($prefs['cover'] == "{$cp}/{$cover_file}" 
+                                       || (!$prefs['cover'] && $i == 0)) 
                                {
                     $i = 1;
-                    $prefs['cover'] = $cp.SEP.$cover_file;
+                    $prefs['cover'] = "{$cp}/{$cover_file}";
                     $tpl->set_var('sel', 'selected');
                                }
                 else 
@@ -984,7 +986,7 @@
                        
                        #ToDo: use the cover_preview func?
                        
-            $command = 'faxcover -C "'.$prefs['cover'].'" -f "'.$user_name.'" 
-n "'.$c_faxnum.'" -t "'.$recipient.'" -c "'.$comments.'" -r "'.$regarding.'" 
-x "'.$company.'" > '.$tmp_dir.SEP.$user_login.'_COVER.ps';
+            $command = "faxcover -C \"{$prefs['cover']}\" -f \"{$user_name}\" 
-n \"{$c_faxnum}\" -t \"{$recipient}\" -c \"{$comments}\" -r \"{$regarding}\" 
-x \"{$company}\" > {$tmp_dir}/{$user_login}_COVER.ps";
                        
                        exec ($command,$ou);
             
@@ -992,9 +994,9 @@
             #ToDo: check acl
             #Memo: original pics: 596x842 
                        
-            $command = 'convert -size 596x842 
'.$tmp_dir.SEP.$user_login.'_COVER.ps  '.$tmp_dir.SEP.$user_login.'_COVER.jpg';
+            $command = "convert -size 596x842 
{$tmp_dir}/{$user_login}_COVER.ps {$tmp_dir}/{$user_login}_COVER.jpg";
             exec ($command, $ou);
-                       $tpl->set_var('img_src', 
$tmp_dir.SEP.$user_login.'_COVER.jpg');
+                       $tpl->set_var('img_src', 
"{$tmp_dir}/{$user_login}_COVER.jpg");
                        
             $tpl->pparse('write_cover_footer', 'cover_footer');
                        
@@ -1088,7 +1090,7 @@
 
                        $tmp_dir = $GLOBALS['phpgw_info']['server']['temp_dir'];
                        
-                       $command = 'faxcover -C "'.$cp.SEP.$cover_file.'" -f 
"'.$user_name.'" -n "'.$c_faxnum.'" -t "'.$recipient.'" -c "'.$comments.'" -r 
"'.$regarding.'" -x "'.$company.'" > '.$tmp_dir.SEP.$user_login.'_COVER.ps';
+                       $command = "faxcover -C \"{$cp}/{$cover_file}\" -f 
\"{$user_name}\" -n \"{$c_faxnum}\" -t \"{$recipient}\" -c \"{$comments}\" -r 
\"{$regarding}\" -x \"{$company}\" > {$tmp_dir}/{$user_login}_COVER.ps";
                        #print $command;
                        exec ($command, $ou);
                        
@@ -1096,10 +1098,10 @@
                        #ToDO: check the rights over the files
                        #Memo: Original pic size: 596x842
                        
-                       $command = 'convert -size 596x842 
'.$tmp_dir.SEP.$user_login.'_COVER.ps  '.$tmp_dir.SEP.$user_login.'_COVER.jpg';
+                       $command = "convert -size 596x842 
{$tmp_dir}/{$user_login}_COVER.ps  {$tmp_dir}/{$user_login}_COVER.jpg";
                        exec ($command, $ou);
                        
-                       $tpl->set_var('img_src', 
$tmp_dir.SEP.$user_login.'_COVER.jpg');
+                       $tpl->set_var('img_src', 
"{$tmp_dir}/{$user_login}_COVER.jpg}");
                        $tpl->set_var('back_url',$back_url);
                        $tpl->set_var('l_goback',lang('goback'));
                        $tpl->pparse('write_form_header','form_header');

Modified: trunk/felamimail/inc/class.bocompose.inc.php
===================================================================
--- trunk/felamimail/inc/class.bocompose.inc.php        2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/felamimail/inc/class.bocompose.inc.php        2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -81,14 +81,11 @@
                                        $_formData['type'] = $mime_type_default;
                                }
                                
-                               $tmpFileName = 
$GLOBALS['phpgw_info']['server']['temp_dir'].
-                                       SEP.
-                                       
$GLOBALS['phpgw_info']['user']['account_id'].
-                                       $this->composeID.
-                                       basename($_formData['file']);
+                               $tmpFileName = 
"{$GLOBALS['phpgw_info']['server']['temp_dir']}/{$GLOBALS['phpgw_info']['user']['account_id']}/{$this->composeID}"
+                                       . basename($_formData['file']);
                                
move_uploaded_file($_FILES['attachfile']['tmp_name'],$tmpFileName);
                                
-                               $this->sessionData['attachments'][]=array
+                               $this->sessionData['attachments'][] = array
                                (
                                        'name'  => $_formData['name'],
                                        'type'  => $_formData['type'],
@@ -188,11 +185,8 @@
                                        $attachmentData = 
$bofelamimail->getAttachment($_uid, $partID);
                                        #_debug_array($attachmentData);
                                        
-                                       $tmpFileName = 
$GLOBALS['phpgw_info']['server']['temp_dir'].
-                                               SEP.
-                                               
$GLOBALS['phpgw_info']['user']['account_id'].
-                                               $this->composeID.
-                                               
basename($attachmentData['filename']);
+                                       $tmpFileName = 
"{$GLOBALS['phpgw_info']['server']['temp_dir']}/{$GLOBALS['phpgw_info']['user']['account_id']}/{$this->composeID}"
+                                               . 
basename($attachmentData['file']);    
                                
                                        if ($handle = fopen($tmpFileName, 'w')) 
                                        {

Modified: trunk/felamimail/inc/class.bopreferences.inc.php
===================================================================
--- trunk/felamimail/inc/class.bopreferences.inc.php    2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/felamimail/inc/class.bopreferences.inc.php    2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -21,9 +21,11 @@
                        'none'  => True
                );
                
-               function bopreferences()
+               /*
+               function __construct()
                {
                }
+               */
                
                function getPreferences()
                {

Added: trunk/felamimail/inc/class.menu.inc.php
===================================================================
--- trunk/felamimail/inc/class.menu.inc.php                             (rev 0)
+++ trunk/felamimail/inc/class.menu.inc.php     2008-02-02 13:52:39 UTC (rev 
18466)
@@ -0,0 +1,128 @@
+<?php
+       /**
+        * felamimail - Menus
+        *
+        * @author Dave Hall <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 felamimail 
+        * @version $Id: class.menu.inc.php 690 2008-02-02 10:11:33Z dave $
+        */
+
+       /*
+          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/>.
+        */
+
+
+       /**
+        * Menus
+        *
+        * @package felamimail
+        */     
+       class felamimail_menu
+       {
+               /**
+                * Get the menus for the felamimail
+                *
+                * @return array available menus for the current user
+                */
+               function get_menu()
+               {
+                       $menus = array();
+
+                       $menus['navbar'] = array
+                       (
+                               'felamimail'    => array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('Felamimail', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'felamimail.uifelamimail.index') ),
+                                       'image' => array('felamimail', 
'navbar'),
+                                       'order' => 6,
+                                       'group' => 'office'
+                               )
+                       );
+
+                       $menus['toolbar'] = array
+                       (
+                               array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('New', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'felamimail.uicompose.compose'))
+                               ),
+                       );
+
+                       if ( 
isset($GLOBALS['phpgw_info']['user']['apps']['admin']) )
+                       {
+                               $menus['admin'] = array
+                               (
+                                       array
+                                       (
+                                               'text'  => 
$GLOBALS['phpgw']->translation->translate('Site Configuration', array(), true),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>'admin.uiconfig.index','appname'=>
 'felamimail'))
+                                       )
+                               );
+                       }
+
+                       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' => 
'felamimail')),
+                                       ),
+                                       array
+                                       (
+                                               'text'  => 
$GLOBALS['phpgw']->translation->translate('Manage Filters', array(), true),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'felamimail.uisieve.mainScreen', 'action' => 'updateFilter')),
+                                       ),
+                                       array
+                                       (
+                                               'text'  =>'Manage Folders',
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>'felamimail.uipreferences.listFolder')
 )
+                                       )
+                               );
+
+                               $menus['toolbar'][] = array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('Preferences', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/preferences/preferences.php', array('appname'      => 
'felamimail')),
+                                       'image' => array('felamimail', 
'preferences')
+                               );
+                               $menus['toolbar'][] = array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('Manage Filters', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'felamimail.uisieve.mainScreen', 'action' => 'updateFilter')),
+                               );
+                               $menus['toolbar'][] = array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('Manage Folders', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>'felamimail.uipreferences.listFolder')
 )
+                               );
+                       }
+
+                       $menus['navigation'] = array
+                       (
+                               array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('New', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'felamimail.uicompose.compose'))
+                               )
+                       );
+                       //$menus['folders'] = 
phpgwapi_menu::get_categories('felamimail');
+
+                       return $menus;
+               }
+       }

Modified: trunk/felamimail/inc/class.uicompose.inc.php
===================================================================
--- trunk/felamimail/inc/class.uicompose.inc.php        2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/felamimail/inc/class.uicompose.inc.php        2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -117,7 +117,7 @@
                                        
                                        $linkData = array
                                        (
-                                               'menuaction'=> 
'felamimail.uifelamimail.viewMainScreen',
+                                               'menuaction'=> 
'felamimail.uifelamimail.index',
                                                'mailbox'       => 
isset($_GET['mailbox']) ? $_GET['mailbox'] : '',
                                                'startMessage'  => '1'
                                        );
@@ -155,7 +155,7 @@
 
                        $linkData = array
                        (
-                               'menuaction'    => 
'felamimail.uifelamimail.viewMainScreen'
+                               'menuaction'    => 
'felamimail.uifelamimail.index'
                        );
                        
$this->t->set_var("link_message_list",$GLOBALS['phpgw']->link('/felamimail/index.php',$linkData));
 

Modified: trunk/felamimail/inc/class.uidisplay.inc.php
===================================================================
--- trunk/felamimail/inc/class.uidisplay.inc.php        2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/felamimail/inc/class.uidisplay.inc.php        2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -138,7 +138,7 @@
                                // navbar
                                $linkData = array
                                (
-                                       'menuaction'    => 
'felamimail.uifelamimail.viewMainScreen'
+                                       'menuaction'    => 
'felamimail.uifelamimail.index'
                                );
                                
$this->t->set_var("link_message_list",$GLOBALS['phpgw']->link('/felamimail/index.php',$linkData));
        

Modified: trunk/felamimail/inc/class.uifelamimail.inc.php
===================================================================
--- trunk/felamimail/inc/class.uifelamimail.inc.php     2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/felamimail/inc/class.uifelamimail.inc.php     2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -174,13 +174,13 @@
                                $data['filter']         = $_GET["filter"];
                                $this->bofilter->updateFilter($data);
                        }
-                       $this->viewMainScreen();
+                       $this->index();
                }
 
                function compressFolder()
                {
                        $this->bofelamimail->compressFolder();
-                       $this->viewMainScreen();
+                       $this->index();
                }
 
                function deleteMessage()
@@ -189,7 +189,7 @@
 
                        $this->bofelamimail->deleteMessages($message);
 
-                       $this->viewMainScreen();
+                       $this->index();
                }
                
                function display_app_header()
@@ -245,10 +245,10 @@
                        }
                        
 
-                       $this->viewMainScreen();
+                       $this->index();
                }
 
-               function viewMainScreen()
+               function index()
                {
                        $bopreferences          = 
CreateObject('felamimail.bopreferences');
                        $preferences            = 
$bopreferences->getPreferences();
@@ -347,7 +347,7 @@
                        // set the url to open when refreshing
                        $linkData = array
                        (
-                               'menuaction'    => 
'felamimail.uifelamimail.viewMainScreen'
+                               'menuaction'    => 
'felamimail.uifelamimail.index'
                        );
                        $this->t->set_var('refresh_url', 
$GLOBALS['phpgw']->link('/index.php',$linkData));
                        
@@ -355,7 +355,7 @@
                        // set the default values for the sort links (sort by 
url)
                        $linkData = array
                        (
-                               'menuaction'    => 
'felamimail.uifelamimail.viewMainScreen',
+                               'menuaction'    => 
'felamimail.uifelamimail.index',
                                'startMessage'  => 1,
                                'sort'                  => 2
                        );
@@ -364,7 +364,7 @@
                        // set the default values for the sort links (sort by 
date)
                        $linkData = array
                        (
-                               'menuaction'    => 
'felamimail.uifelamimail.viewMainScreen',
+                               'menuaction'    => 
'felamimail.uifelamimail.index',
                                'startMessage'  => 1,
                                'sort'                  => 0
                        );
@@ -373,7 +373,7 @@
                        // set the default values for the sort links (sort by 
subject)
                        $linkData = array
                        (
-                               'menuaction'    => 
'felamimail.uifelamimail.viewMainScreen',
+                               'menuaction'    => 
'felamimail.uifelamimail.index',
                                'startMessage'  => 1,
                                'sort'                  => 4
                        );
@@ -411,7 +411,7 @@
                                case 2:
                                        $linkData = array
                                        (
-                                               'menuaction'    => 
'felamimail.uifelamimail.viewMainScreen',
+                                               'menuaction'    => 
'felamimail.uifelamimail.index',
                                                'startMessage'  => 1,
                                                'sort'                  => 3
                                        );
@@ -421,7 +421,7 @@
                                case 4:
                                        $linkData = array
                                        (
-                                               'menuaction'    => 
'felamimail.uifelamimail.viewMainScreen',
+                                               'menuaction'    => 
'felamimail.uifelamimail.index',
                                                'startMessage'  => 1,
                                                'sort'                  => 5
                                        );
@@ -431,7 +431,7 @@
                                case 0:
                                        $linkData = array
                                        (
-                                               'menuaction'    => 
'felamimail.uifelamimail.viewMainScreen',
+                                               'menuaction'    => 
'felamimail.uifelamimail.index',
                                                'startMessage'  => 1,
                                                'sort'                  => 1
                                        );
@@ -663,7 +663,7 @@
                                // link to unselect all messages
                                $linkData = array
                                (
-                                       'menuaction'    => 
'felamimail.uifelamimail.viewMainScreen'
+                                       'menuaction'    => 
'felamimail.uifelamimail.index'
                                );
                                $selectLink = sprintf("<a class=\"body_link\" 
href=\"%s\">%s</a>",
                                                        
$GLOBALS['phpgw']->link('/index.php',$linkData),
@@ -677,7 +677,7 @@
                                $linkData = array
                                (
                                        'select_all'    => 'select_all',
-                                       'menuaction'    => 
'felamimail.uifelamimail.viewMainScreen'
+                                       'menuaction'    => 
'felamimail.uifelamimail.index'
                                );
                                $selectLink = sprintf("<a class=\"body_link\" 
href=\"%s\">%s</a>",
                                                        
$GLOBALS['phpgw']->link('/index.php',$linkData),
@@ -725,7 +725,7 @@
                        {
                                $linkData = array
                                (
-                                       'menuaction'    => 
'felamimail.uifelamimail.viewMainScreen',
+                                       'menuaction'    => 
'felamimail.uifelamimail.index',
                                        'startMessage'  => $this->startMessage 
- $maxMessages
                                );
                                $link = 
$GLOBALS['phpgw']->link('/index.php',$linkData);
@@ -740,7 +740,7 @@
                        {
                                $linkData = array
                                (
-                                       'menuaction'    => 
'felamimail.uifelamimail.viewMainScreen',
+                                       'menuaction'    => 
'felamimail.uifelamimail.index',
                                        'startMessage'  => $this->startMessage 
+ $maxMessages
                                );
                                $link = 
$GLOBALS['phpgw']->link('/index.php',$linkData);
@@ -833,7 +833,7 @@
                function toggleFilter()
                {
                        $this->bofelamimail->toggleFilter();
-                       $this->viewMainScreen();
+                       $this->index();
                }
 
                function translate()

Modified: trunk/felamimail/inc/class.uifilter.inc.php
===================================================================
--- trunk/felamimail/inc/class.uifilter.inc.php 2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/felamimail/inc/class.uifilter.inc.php 2008-02-02 13:52:39 UTC (rev 
18466)
@@ -152,7 +152,7 @@
                        $this->t->set_var("filterrows",'');
                        $linkData = array
                        (
-                               'menuaction'    => 
'felamimail.uifelamimail.viewMainScreen',
+                               'menuaction'    => 
'felamimail.uifelamimail.index',
                                'filter'        => -1
                        );
                        $link = $GLOBALS['phpgw']->link('/index.php',$linkData);

Modified: trunk/felamimail/inc/hook_sidebox_menu.inc.php
===================================================================
--- trunk/felamimail/inc/hook_sidebox_menu.inc.php      2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/felamimail/inc/hook_sidebox_menu.inc.php      2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -28,7 +28,7 @@
                'text'  => 'Compose',
                'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>'felamimail.uicompose.compose')));
                #'_NewLine_'=>'', // give a newline
-               
#'INBOX'=>$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>'felamimail.uifelamimail.viewMainScreen'))
+               
#'INBOX'=>$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>'felamimail.uifelamimail.index'))
 
        display_sidebox($appname,$menu_title,$file);
        unset($file);

Modified: trunk/felamimail/index.php
===================================================================
--- trunk/felamimail/index.php  2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/felamimail/index.php  2008-02-02 13:52:39 UTC (rev 18466)
@@ -21,6 +21,5 @@
        );
        include('../header.inc.php');
 
-       $obj = CreateObject('felamimail.uifelamimail');
-       $obj->viewMainScreen();
+       execMethod('felamimail.uifelamimail.index');
 ?>

Modified: trunk/felamimail/setup/phpgw_sv.lang
===================================================================
--- trunk/felamimail/setup/phpgw_sv.lang        2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/felamimail/setup/phpgw_sv.lang        2008-02-02 13:52:39 UTC (rev 
18466)
@@ -307,3 +307,4 @@
 you must login first.  felamimail      sv      Du m\xE5ste logga in f\xF6rst.
 you need a valid user and password to access this page!        felamimail      
sv      Du m\xE5ste ha en giltig anv\xE4ndare och l\xF6senord f\xF6r att f\xE5 
\xE5tkomst till denna sida!
 your search failed with the following error(s) felamimail      sv      Din 
s\xF6kning misslyckades p g a f\xF6ljande fel
+

Modified: trunk/felamimail/setup/setup.inc.php
===================================================================
--- trunk/felamimail/setup/setup.inc.php        2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/felamimail/setup/setup.inc.php        2008-02-02 13:52:39 UTC (rev 
18466)
@@ -35,17 +35,15 @@
        );
 
        /* The hooks this app includes, needed for hooks registration */
-       $setup_info['felamimail']['hooks'][] = 'preferences';
-       $setup_info['felamimail']['hooks'][] = 'admin';
        $setup_info['felamimail']['hooks'][] = 'manual';
        $setup_info['felamimail']['hooks'][] = 'help';
        $setup_info['felamimail']['hooks'][] = 'settings';
        $setup_info['felamimail']['hooks'][] = 'home';
-       $setup_info['felamimail']['hooks'][] = 'sidebox_menu';
+       $setup_info['felamimail']['hooks'][] = 'felamimail.menu.get_menu';
 
        /* Dependacies for this app to work */
        $setup_info['felamimail']['depends'][] = array(
                'appname'  => 'phpgwapi',
-               'versions' => Array('0.9.17','0.9.18')
+               'versions' => Array('0.9.17', '0.9.18')
        );
 ?>

Modified: trunk/filemanager/inc/class.bofilemanager.inc.php
===================================================================
--- trunk/filemanager/inc/class.bofilemanager.inc.php   2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/filemanager/inc/class.bofilemanager.inc.php   2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -170,7 +170,7 @@
                        $this->userinfo['account_id']   = 
$GLOBALS['phpgw_info']['user']['account_id'];
                        $this->userinfo['account_lid']  = 
$GLOBALS['phpgw_info']['user']['account_lid'];
                        $this->userinfo['hdspace']              = 10000000000;
-                       $this->homedir                                  = 
$this->fakebase.SEP.$this->userinfo['account_lid'];
+                       $this->homedir                                  = 
"{$this->fakebase}/{$this->userinfo['account_lid']}";
 
                        if(!defined('NULL'))
                        {
@@ -707,7 +707,7 @@
                                if($this->fileman[$i])
                                {
                                        $ls_array = 
$GLOBALS['phpgw']->vfs->ls(array(
-                                                               'string' => 
$this->path.SEP.$this->fileman[$i],
+                                                               'string' => 
"{$this->path}/{$this->fileman[$i]}",
                                                                'relatives' => 
array(RELATIVE_NONE),
                                                                'checksubdirs' 
=>False,
                                                                'nofiles' => 
True));
@@ -725,19 +725,19 @@
                                                        $mime_type = 'File';
                                                }
                                                
if($GLOBALS['phpgw']->vfs->delete(array(
-                                                                               
'string' => $this->path.SEP.$this->fileman[$i],
+                                                                               
'string' => "{$this->path}/{$this->fileman[$i]}",
                                                                                
'relatives' => Array(RELATIVE_USER_NONE))))
                                                {
-                                                       $result[] = 
lang('deleted %1', $this->path.SEP.$this->fileman[$i]);
+                                                       $result[] = 
lang('deleted %1', "{$this->path}/{$this->fileman[$i]}");
                                                }
                                                else
                                                {
-                                                       $result[] = lang('could 
not delete %1',$this->path.SEP.$this->fileman[$i]);
+                                                       $result[] = lang('could 
not delete %1', "{$this->path}/{$this->fileman[$i]}");
                                                }
                                        }
                                        else
                                        {
-                                               $result[] = lang('%1 does not 
exist', $this->path.SEP.$this->fileman[$i]);
+                                               $result[] = lang('%1 does not 
exist', "{$this->path}/{$this->fileman[$i]}");
                                        }
                                }
                        }
@@ -752,18 +752,18 @@
                                {
                                        
if(!$this->check_quota($this->fileman[$i]))
                                        {
-                                               $result[] = lang('Could not 
copy %1 to %2 quota 
exceeded',$this->todir.SEP.$this->fileman[$i],$this->path.SEP.$this->fileman[$i]);
+                                               $result[] = lang('Could not 
copy %1 to %2 quota exceeded', "{$this->todir}/{$this->fileman[$i]}", 
"{$this->path}/{$this->fileman[$i]}");
                                        }
                                        elseif($GLOBALS['phpgw']->vfs->cp(array(
-                                                                       'from' 
=> $this->path.SEP.$this->fileman[$i],
-                                                                       'to' => 
$this->todir.SEP.$this->fileman[$i],
+                                                                       'from' 
=> "{$this->path}/{$this->fileman[$i]}",
+                                                                       'to' => 
"{$this->todir}/{$this->fileman[$i]}",
                                                                        
'relatives' => array(RELATIVE_NONE,RELATIVE_NONE))))
                                        {
-                                               $result[] = lang('file %1 
copied to %2'. 
$this->todir.SEP.$this->fileman[$i],$this->path.SEP.$this->fileman[$i]);
+                                               $result[] = lang('file %1 
copied to %2'. "{$this->todir}/{$this->fileman[$i]}", 
"{$this->path}/{$this->fileman[$i]}");
                                        }
                                        else
                                        {                                       
-                                               $result[] = lang('could not 
copy %1 to %2', 
$this->todir.SEP.$this->fileman[$i],$this->path.SEP.$this->fileman[$i]);
+                                               $result[] = lang('could not 
copy %1 to %2', "{$this->todir}/{$this->fileman[$i]}", 
"{$this->path}/{$this->fileman[$i]}");
                                        }
                                }
                        }
@@ -777,19 +777,19 @@
                                if($this->fileman[$i])
                                {
                                        if($GLOBALS['phpgw']->vfs->mv(array(
-                                                                       'from' 
=> $this->path.SEP.$this->fileman[$i],
-                                                                       'to' => 
$this->todir.SEP.$this->fileman[$i],
+                                                                       'from' 
=> "{$this->path}/{$this->fileman[$i]}",
+                                                                       'to' => 
"{$this->todir}/{$this->fileman[$i]}",
                                                                        
'relatives' => array(RELATIVE_NONE,RELATIVE_NONE))))
                                        {
-                                               $result[] = lang('file %1 moved 
to %2',$this->path.SEP.$this->fileman[$i], $this->todir.SEP.$this->fileman[$i]);
+                                               $result[] = lang('file %1 moved 
to %2', "{$this->path}/{$this->fileman[$i]}", 
"{$this->todir}/{$this->fileman[$i]}");
                                        }
                                        else
                                        {                                       
-                                               $result[] = lang('could not 
move %1 to %2',$this->path.SEP.$this->fileman[$i], 
$this->todir.SEP.$this->fileman[$i]);
+                                               $result[] = lang('could not 
move %1 to %2', "{$this->path}/{$this->fileman[$i]}", 
"{$this->todir}/{$this->fileman[$i]}");
                                        }
                                }
                        }
-                       return is_array($result)?$result:True;
+                       return is_array($result) ? $result : true;
                }
 
                function f_download()
@@ -838,7 +838,7 @@
                                }
                                
                                $dir_to_check = array(
-                                               'string' => 
$this->path.SEP.$this->createdir.SEP,
+                                               'string' => 
"{$this->path}/{$this->createdir}/",
                                                'relatives' => 
array(RELATIVE_NONE),
                                                'checksubdirs' => False,
                                                'nofiles' => True);
@@ -859,15 +859,15 @@
                                else
                                {
                                        if ($GLOBALS['phpgw']->vfs->mkdir(array(
-                                                                       
'string' => $this->path.SEP.$this->createdir,
+                                                                       
'string' => "{$this->path}/{$this->createdir}",
                                                                        
'relatives' => Array(RELATIVE_NONE))))
                                        {
-                                               $result[] = lang('created 
directory %1', $this->path.SEP.$this->createdir);
-                                               $this->path = 
$this->path.SEP.$this->createdir;
+                                               $this->path = 
"{$this->path}/{$this->createdir}";
+                                               $result[] = lang('created 
directory %1', $this->path);
                                        }
                                        else
                                        {
-                                               $result[] = lang('could not 
create %1', $this->path.SEP.$this->createdir);
+                                               $result[] = lang('could not 
create %1', "{$this->path}/{$this->createdir}");
                                        }
                                }
                        }
@@ -883,21 +883,21 @@
                        {
                                if($badchar = 
$this->bad_chars($this->createfile,True,True))
                                {
-                                       $result[] = lang('file names cannot 
contain %1, file %2', $badchar,$this->path.SEP.$this->createfile);
+                                       $result[] = lang('file names cannot 
contain %1, file %2', $badchar, "{$this->path}/{$this->createfile}");
                                        return $result;
                                }
                                if($GLOBALS['phpgw']->vfs->file_exists(array(
                                                                'string' => 
$this->createfile,
                                                                'relatives' => 
array(RELATIVE_ALL))))
                                {
-                                       $result[] = lang('file %1 already 
exists. Please edit it or delete it first', $this->path.SEP.$this->createfile);
+                                       $result[] = lang('file %1 already 
exists. Please edit it or delete it first', 
"{$this->path}/{$this->createfile}");
                                        return $result;
                                }
                                if(!$GLOBALS['phpgw']->vfs->touch(array(
                                                                'string' => 
$this->createfile,
                                                                'relatives' => 
Array(RELATIVE_ALL))))
                                {
-                                       $result[] = lang('file %1 could not be 
created', $this->path.SEP.$this->createfile);
+                                       $result[] = lang('file %1 could not be 
created', "{$this->path}/{$this->createfile}");
                                }
                        }
                        else

Modified: trunk/filemanager/inc/class.uifilemanager.inc.php
===================================================================
--- trunk/filemanager/inc/class.uifilemanager.inc.php   2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/filemanager/inc/class.uifilemanager.inc.php   2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -457,7 +457,7 @@
                                                );
 
                                                $ls_array = 
$GLOBALS['phpgw']->vfs->ls(array(
-                                               'string' => 
$this->bofilemanager->fakebase.SEP.$GLOBALS['phpgw']->accounts->id2lid($group_array['account_id']),
+                                               'string' => 
"{$this->bofilemanager->fakebase}/" . 
$GLOBALS['phpgw']->accounts->id2lid($group_array['account_id']),
                                                'relatives' => 
Array(RELATIVE_NONE),
                                                'checksubdirs'  => True,
                                                'mime_type' => 'Directory'
@@ -483,7 +483,7 @@
 
                                                if($dir['directory'] != '/')
                                                {
-                                                       $dir['directory'] .= 
SEP;
+                                                       $dir['directory'] .= 
'/';
                                                }
 
                                                // No point in displaying the 
current directory, or a directory that doesn't exist
@@ -1311,7 +1311,7 @@
                                $this->bofilemanager->path = 
$file_array['path'];
                                $this->bofilemanager->file = 
$file_array['file'];
                        }
-                       $file = 
$this->bofilemanager->path.SEP.$this->bofilemanager->file;
+                       $file = 
"{$this->bofilemanager->path}/{$this->bofilemanager->file}";
                        if($GLOBALS['phpgw']->vfs->file_exists(array('string' 
=> $file,'relatives' => Array(RELATIVE_NONE))))
                        {
                                $ls_array = 
$GLOBALS['phpgw']->vfs->ls(array('string' => $file,'relatives' => array 
(RELATIVE_ALL),'checksubdirs' => False,'nofiles' => True));

Modified: trunk/filemanager/setup/phpgw_de.lang
===================================================================
--- trunk/filemanager/setup/phpgw_de.lang       2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/filemanager/setup/phpgw_de.lang       2008-02-02 13:52:39 UTC (rev 
18466)
@@ -40,7 +40,7 @@
 edit comments  filemanager     de      Kommentare bearbeiten
 edit quota     filemanager     de      Quota bearbeiten
 Enter comma separated Quota value in MB        filemanager     de      Komma 
separierte Quota Werte eingeben in MB
-erroneous input! check quota value!    filemanager     en      Fehlerhafte 
Eingabe! Prüfen Sie die Quota Werte!
+erroneous input! check quota value!    filemanager     de      Fehlerhafte 
Eingabe! Prüfen Sie die Quota Werte!
 error running command  filemanager     de      Fehler beim Ausführen des 
Kommandos
 execute        filemanager     de      Ausführen
 failed to create directory     filemanager     de      Verzeichnis konnte 
nicht erstellt werden

Modified: trunk/filemanager/setup/phpgw_sv.lang
===================================================================
--- trunk/filemanager/setup/phpgw_sv.lang       2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/filemanager/setup/phpgw_sv.lang       2008-02-02 13:52:39 UTC (rev 
18466)
@@ -92,3 +92,4 @@
 view documents on server (if available)        filemanager     sv      Visa 
dokument p\xE5 servern (om de finns)
 who    filemanager     sv      Vem
 you do not have access to %1   filemanager     sv      Du har inte 
beh\xF6righet till %1
+

Modified: trunk/filemanager/tests/test.php
===================================================================
--- trunk/filemanager/tests/test.php    2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/filemanager/tests/test.php    2008-02-02 13:52:39 UTC (rev 18466)
@@ -28,7 +28,7 @@
 html_text_italic (PHP_OS . " - " . $phpgw_info["server"]["db_type"] . " - " . 
PHP_VERSION . " - " . $phpgw->vfs->basedir);
 html_break (1);
 
-$sep = SEP;
+$sep = '/';
 $phpgw =& $GLOBALS['phpgw'];
 $user = $phpgw->vfs->working_lid;
 $homedir = $phpgw->vfs->fakebase . "/" . $user;

Modified: trunk/filemanager/tests/test_dav.php
===================================================================
--- trunk/filemanager/tests/test_dav.php        2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/filemanager/tests/test_dav.php        2008-02-02 13:52:39 UTC (rev 
18466)
@@ -52,7 +52,7 @@
 //html_table_begin();
 
 
-$sep = SEP;
+$sep = '/';
 $user = $phpgw->vfs->working_lid;
 $homedir = $phpgw->vfs->fakebase . "/" . $user;
 $realhomedir = preg_replace ("|/|", $sep, $homedir);

Added: trunk/folders/inc/class.service.inc.php
===================================================================
--- trunk/folders/inc/class.service.inc.php                             (rev 0)
+++ trunk/folders/inc/class.service.inc.php     2008-02-02 13:52:39 UTC (rev 
18466)
@@ -0,0 +1,76 @@
+<?php
+/**
+ * folders module
+ * @author Philipp Kamps <address@hidden>
+ * @copyright Copyright (C) 2003,2005 Free Software Foundation 
http://www.fsf.org/
+ * @license http://www.fsf.org/licenses/gpl.html GNU General Public License
+ * @package folders
+ * @subpackage services
+ * @version $Id: class.service.inc.php 690 2008-02-02 10:11:33Z dave $
+ */
+ 
+
+
+/**
+* folders services
+*
+* @package folders
+* @subpackage services
+*/
+class folders_service
+{
+       function getFolderContent()
+       {
+               /*  Not working - retrun_sorted_array only returns cats
+                   from the actual appl. and not for every application
+                   when needed :-(((
+
+               $catObj = CreateObject('phpgwapi.categories');
+               $cats = $catObj->return_sorted_array(0,false,'','','',true);
+               
+               */
+
+               /* Workaround for phpgw.categories.return_sorted_array */
+               $db = $GLOBALS['phpgw']->db;
+               $sql = (
+               'SELECT ' .
+                       'cat_id AS id, ' .
+                       'cat_parent AS parent_id, ' .
+                       'cat_name AS text, ' .
+                       'cat_name AS href, ' .
+                       'cat_name AS title, ' .
+                       //'cat_id AS icon, ' .
+                       'cat_appname AS target, ' .
+                       'cat_description AS description '.
+               'FROM phpgw_categories ' .
+               'WHERE ( 
cat_owner='.$GLOBALS['phpgw_info']['user']['account_id'].' or cat_access = 
\'public\' ) '
+               );
+               /* End of workaround */
+
+               //echo $sql;
+               $db->query($sql,__LINE__,__FILE__);
+
+               while ($db->next_record())
+               {
+                       if ($db->f('target') == 'phpgw')
+                       {
+                               $module = '';
+                       }
+                       else
+                       {
+                               $module = $db->f('target');
+                       }
+                       $tpl_set = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['template_set'];
+                       
+                       $return[$db->f('id')]['parent_id'] = 
$db->f('parent_id');
+                       $return[$db->f('id')]['text']      = $db->f('text');
+                       $return[$db->f('id')]['href']      = 
$GLOBALS['phpgw']->link('/'.$module.'/index.php', array( 'fcat_id' => 
$db->f('id') ) );
+                       $return[$db->f('id')]['title']     = 
$db->f('description');
+                       $return[$db->f('id')]['icon']      = 
$module.'/templates/'.$tpl_set.'/images/folders.png';
+                       $return[$db->f('id')]['target']    = '_parent';
+                       //$this->_tmpArray[$db->f('id')]['expanded']  = 
$db->f('expanded');
+               }
+               return array('content' => $return );
+       }
+}
+?>

Modified: trunk/forum/setup/phpgw_de.lang
===================================================================
--- trunk/forum/setup/phpgw_de.lang     2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/forum/setup/phpgw_de.lang     2008-02-02 13:52:39 UTC (rev 18466)
@@ -5,7 +5,7 @@
 author forum   de      Author
 belongs to category    forum   de      Gehört zu Kategorie
 category description   forum   de      Kategorie Beschreibung
-category name  forum   en      Kategorie Name
+category name  forum   de      Kategorie Name
 collapse threads       forum   de      Zurück; Nur Themen sichbar
 current categories and sub forums      forum   de      Verfügbare Kategorien 
und Foren
 email replies to this thread to the address above      forum   de      Email 
Antworten zu diesem Beitrag an die oben genannte Adresse

Modified: trunk/forum/setup/phpgw_sv.lang
===================================================================
--- trunk/forum/setup/phpgw_sv.lang     2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/forum/setup/phpgw_sv.lang     2008-02-02 13:52:39 UTC (rev 18466)
@@ -37,3 +37,4 @@
 view threads   forum   sv      Visa tr\xE5dar
 your email     forum   sv      Din epost
 your name      forum   sv      Ditt namn
+

Modified: trunk/ftp/inc/functions.inc.php
===================================================================
--- trunk/ftp/inc/functions.inc.php     2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/ftp/inc/functions.inc.php     2008-02-02 13:52:39 UTC (rev 18466)
@@ -176,7 +176,7 @@
        function getMimeType($file)
        {
                $file=basename($file);
-               $mimefile = PHPGW_APP_ROOT . SEP . 'mime.types';
+               $mimefile = PHPGW_APP_ROOT . '/mime.types';
                $fp=fopen($mimefile,"r");
                $contents = explode("\n",fread ($fp, filesize($mimefile)));
                fclose($fp);

Modified: trunk/ftp/setup/phpgw_sv.lang
===================================================================
--- trunk/ftp/setup/phpgw_sv.lang       2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/ftp/setup/phpgw_sv.lang       2008-02-02 13:52:39 UTC (rev 18466)
@@ -32,3 +32,4 @@
 upload ftp     sv      ladda upp
 username       ftp     sv      Anv\xE4ndarnamn
 view   ftp     sv      visa
+

Modified: trunk/ged/setup/phpgw_en.lang
===================================================================
--- trunk/ged/setup/phpgw_en.lang       2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/ged/setup/phpgw_en.lang       2008-02-02 13:52:39 UTC (rev 18466)
@@ -5,6 +5,7 @@
 current version        ged     en      Current version
 documents      ged     en      Documents
 first version  ged     en      First version
+ged    common  en      Document Manager
 informations   ged     en      Informations
 last updated on        ged     en      Last updated on
 new    ged     en      New

Modified: trunk/headlines/setup/phpgw_sv.lang
===================================================================
--- trunk/headlines/setup/phpgw_sv.lang 2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/headlines/setup/phpgw_sv.lang 2008-02-02 13:52:39 UTC (rev 18466)
@@ -42,3 +42,4 @@
 you must enter a news url      admin   sv      Du m\xE5ste skriva in en nyhets 
url
 you must enter the number of listings display  admin   sv      Du m\xE5ste 
skriva in antalet rader att visa
 you must enter the number of minutes between reload    admin   sv      Du 
m\xE5ste skriva in antalet minuter mellan uppdatering
+

Modified: trunk/hrm/inc/class.boadmin.inc.php
===================================================================
--- trunk/hrm/inc/class.boadmin.inc.php 2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/hrm/inc/class.boadmin.inc.php 2008-02-02 13:52:39 UTC (rev 18466)
@@ -27,7 +27,7 @@
 
                function hrm_boadmin($session='')
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->so                       = 
CreateObject('hrm.soadmin');
                        $this->catbo = createobject('phpgwapi.categories');
 
@@ -67,7 +67,7 @@
                        }
                        else
                        {
-                               $this->acl_app = $this->currentapp;
+                               $this->acl_app = 'hrm';
                        }
                        if(isset($query))
                        {

Modified: trunk/hrm/inc/class.bocategory.inc.php
===================================================================
--- trunk/hrm/inc/class.bocategory.inc.php      2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/hrm/inc/class.bocategory.inc.php      2008-02-02 13:52:39 UTC (rev 
18466)
@@ -55,7 +55,7 @@
 
                function hrm_bocategory($session=False)
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->so               = 
CreateObject('hrm.socategory');
                        $this->bocommon = CreateObject('hrm.bocommon');
 

Modified: trunk/hrm/inc/class.bocommon.inc.php
===================================================================
--- trunk/hrm/inc/class.bocommon.inc.php        2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/hrm/inc/class.bocommon.inc.php        2008-02-02 13:52:39 UTC (rev 
18466)
@@ -55,7 +55,7 @@
                function hrm_bocommon()
                {
 //                     $GLOBALS['phpgw_info']['flags']['currentapp']   =       
'hrm';
-                       $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->socommon                 = 
CreateObject('hrm.socommon');
                        $this->account          = 
$GLOBALS['phpgw_info']['user']['account_id'];
 
@@ -666,7 +666,7 @@
 
                        $appname        = lang('No access');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('hrm') . ' - ' . $appname;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('no_access' => $data));
                }
 

Modified: trunk/hrm/inc/class.bojob.inc.php
===================================================================
--- trunk/hrm/inc/class.bojob.inc.php   2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/hrm/inc/class.bojob.inc.php   2008-02-02 13:52:39 UTC (rev 18466)
@@ -60,7 +60,7 @@
 
                public function __construct($session=False)
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->so               = CreateObject('hrm.sojob');
                        $this->socommon = CreateObject('hrm.socommon');
 

Modified: trunk/hrm/inc/class.boplace.inc.php
===================================================================
--- trunk/hrm/inc/class.boplace.inc.php 2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/hrm/inc/class.boplace.inc.php 2008-02-02 13:52:39 UTC (rev 18466)
@@ -55,7 +55,7 @@
 
                function hrm_boplace($session=False)
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->so               = CreateObject('hrm.soplace');
                        $this->bocommon         = CreateObject('hrm.bocommon');
 

Modified: trunk/hrm/inc/class.bouser.inc.php
===================================================================
--- trunk/hrm/inc/class.bouser.inc.php  2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/hrm/inc/class.bouser.inc.php  2008-02-02 13:52:39 UTC (rev 18466)
@@ -57,7 +57,7 @@
 
                function hrm_bouser($session=False)
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->so               = CreateObject('hrm.souser');
                        $this->bocommon         = CreateObject('hrm.bocommon');
                        $this->grants = $this->so->grants;

Modified: trunk/hrm/inc/class.menu.inc.php
===================================================================
--- trunk/hrm/inc/class.menu.inc.php    2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/hrm/inc/class.menu.inc.php    2008-02-02 13:52:39 UTC (rev 18466)
@@ -28,21 +28,26 @@
                function hrm_menu($sub='')
                {
                        $this->sub              = $sub;
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                }
 
                function links($page='',$page_2='')
                {
-                       $currentapp=$this->currentapp;
+                       $currentapp='hrm';
                        $sub = $this->sub;
 
+                       $menu = 
$GLOBALS['phpgw']->session->appsession('menu',substr(md5($currentapp.$sub . '_' 
. $page . '_' . $page_2),-20));
+
+                       if(!isset($menu) || !$menu)
+                       {
+                               $menu = array(); 
+
                        $i=0;
                        if($sub=='user')
                        {
                                $menu['module'][$i]['this']=True;
                        }
-                       $menu['module'][$i]['link']             = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$currentapp.'.uiuser.index'));
-                       $menu['module'][$i]['name']             = lang('User');
+                               $menu['module'][$i]['url']              = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$currentapp.'.uiuser.index'));
+                               $menu['module'][$i]['text']             = 
lang('User');
                        $menu['module'][$i]['statustext']       = lang('User');
                        $i++;
 
@@ -50,8 +55,8 @@
                        {
                                $menu['module'][$i]['this']=True;
                        }
-                       $menu['module'][$i]['link']                     =       
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$currentapp.'.uijob.index'));
-                       $menu['module'][$i]['name']                     =       
lang('Job');
+                               $menu['module'][$i]['url']                      
=       $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$currentapp.'.uijob.index'));
+                               $menu['module'][$i]['text']                     
=       lang('Job');
                        $menu['module'][$i]['statustext']               =       
lang('Job');
                        $i++;
 
@@ -59,8 +64,8 @@
                        {
                                $menu['module'][$i]['this']=True;
                        }
-                       $menu['module'][$i]['link']                     =       
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$currentapp.'.uiplace.index'));
-                       $menu['module'][$i]['name']                     =       
lang('PLace');
+                               $menu['module'][$i]['url']                      
=       $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$currentapp.'.uiplace.index'));
+                               $menu['module'][$i]['text']                     
=       lang('PLace');
                        $menu['module'][$i]['statustext']               =       
lang('Place');
                        $i++;
 
@@ -71,8 +76,8 @@
                                {
                                        $menu['sub_menu'][$j]['this']=True;
                                }
-                               $menu['sub_menu'][$j]['link']                   
=       $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$currentapp.'.uijob.index'));
-                               $menu['sub_menu'][$j]['name']                   
=       lang('Job type');
+                                       $menu['sub_menu'][$j]['url']            
        =       $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$currentapp.'.uijob.index'));
+                                       $menu['sub_menu'][$j]['text']           
        =       lang('Job type');
                                $menu['sub_menu'][$j]['statustext']             
=       lang('Job type');
                                $j++;
 
@@ -80,12 +85,15 @@
                                {
                                        $menu['sub_menu'][$j]['this']=True;
                                }
-                               $menu['sub_menu'][$j]['link']                   
=       $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$currentapp.'.uijob.hierarchy'));
-                               $menu['sub_menu'][$j]['name']                   
=       lang('Organisation');
+                                       $menu['sub_menu'][$j]['url']            
        =       $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$currentapp.'.uijob.hierarchy'));
+                                       $menu['sub_menu'][$j]['text']           
        =       lang('Organisation');
                                $menu['sub_menu'][$j]['statustext']             
=       lang('Organisation');
                                $j++;
                        }
 
+                               
$GLOBALS['phpgw']->session->appsession('menu',substr(md5($currentapp.$sub . '_' 
. $page . '_' . $page_2),-20),$menu);
+                       }
+                       
$GLOBALS['phpgw']->session->appsession('menu_hrm','sidebox',$menu);
                        return $menu;
                }
        }

Modified: trunk/hrm/inc/class.soadmin.inc.php
===================================================================
--- trunk/hrm/inc/class.soadmin.inc.php 2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/hrm/inc/class.soadmin.inc.php 2008-02-02 13:52:39 UTC (rev 18466)
@@ -20,7 +20,7 @@
        {
                public function __construct()
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->account          = 
$GLOBALS['phpgw_info']['user']['account_id'];
                        $this->bocommon         = createObject('hrm.bocommon');
                        $this->db                       = 
$this->bocommon->new_db();

Modified: trunk/hrm/inc/class.socategory.inc.php
===================================================================
--- trunk/hrm/inc/class.socategory.inc.php      2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/hrm/inc/class.socategory.inc.php      2008-02-02 13:52:39 UTC (rev 
18466)
@@ -20,7 +20,7 @@
        {
                public function __construct()
                {
-                       $this->currentapp       = 'hrm';
+               //      $this->currentapp       = 'hrm';
                        $this->account          = 
$GLOBALS['phpgw_info']['user']['account_id'];
                        $this->bocommon         = CreateObject('hrm.bocommon');
                        $this->db                       = 
$this->bocommon->new_db();
@@ -67,8 +67,8 @@
 
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
                                $querymethod = " where id $this->like 
'%$query%' or descr $this->like '%$query%'";
                        }

Modified: trunk/hrm/inc/class.socommon.inc.php
===================================================================
--- trunk/hrm/inc/class.socommon.inc.php        2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/hrm/inc/class.socommon.inc.php        2008-02-02 13:52:39 UTC (rev 
18466)
@@ -21,7 +21,7 @@
                function hrm_socommon()
                {
                        //$GLOBALS['phpgw_info']['flags']['currentapp'] =       
'hrm';
-                       $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                //      $this->db               = $GLOBALS['phpgw']->db;
                        $this->db = CreateObject('phpgwapi.db');
                        $this->db->Host = 
$GLOBALS['phpgw_info']['server']['db_host'];

Modified: trunk/hrm/inc/class.sojob.inc.php
===================================================================
--- trunk/hrm/inc/class.sojob.inc.php   2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/hrm/inc/class.sojob.inc.php   2008-02-02 13:52:39 UTC (rev 18466)
@@ -26,7 +26,7 @@
 
                public function __construct()
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->account  = 
$GLOBALS['phpgw_info']['user']['account_id'];
                        $this->bocommon         = CreateObject('hrm.bocommon');
                        $this->db               = $this->bocommon->new_db();
@@ -275,8 +275,8 @@
 
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
                                $querymethod = " AND name $this->like 
'%$query%'";
                        }
@@ -426,8 +426,8 @@
 
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
                                $querymethod = " WHERE name $this->like 
'%$query%'";
                        }
@@ -502,8 +502,8 @@
 
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
                                $querymethod .= " AND name $this->like 
'%$query%'";
                        }

Modified: trunk/hrm/inc/class.soplace.inc.php
===================================================================
--- trunk/hrm/inc/class.soplace.inc.php 2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/hrm/inc/class.soplace.inc.php 2008-02-02 13:52:39 UTC (rev 18466)
@@ -25,7 +25,7 @@
 
                function hrm_soplace()
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->account  = 
$GLOBALS['phpgw_info']['user']['account_id'];
                        $this->bocommon         = CreateObject('hrm.bocommon');
                        $this->db               = $this->bocommon->new_db();
@@ -69,8 +69,8 @@
 
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
                                $querymethod = " WHERE name $this->like 
'%$query%'";
                        }

Modified: trunk/hrm/inc/class.souser.inc.php
===================================================================
--- trunk/hrm/inc/class.souser.inc.php  2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/hrm/inc/class.souser.inc.php  2008-02-02 13:52:39 UTC (rev 18466)
@@ -24,7 +24,7 @@
 
                public function __construct()
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->account          = 
$GLOBALS['phpgw_info']['user']['account_id'];
                        $this->bocommon = CreateObject('hrm.bocommon');
                        $this->db               = $this->bocommon->new_db();

Modified: trunk/hrm/inc/class.uiadmin.inc.php
===================================================================
--- trunk/hrm/inc/class.uiadmin.inc.php 2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/hrm/inc/class.uiadmin.inc.php 2008-02-02 13:52:39 UTC (rev 18466)
@@ -41,7 +41,7 @@
                function hrm_uiadmin()
                {
                        $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->nextmatchs                       = 
CreateObject('phpgwapi.nextmatchs');
                        $this->account                          = 
$GLOBALS['phpgw_info']['user']['account_id'];
 
@@ -184,7 +184,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiadmin.aclprefs',
+                               'menuaction'    => 'hrm.uiadmin.aclprefs',
                                                'sort'                          
=>$this->sort,
                                                'order'                         
=>$this->order,
                                                'cat_id'                        
=>$this->cat_id,
@@ -219,7 +219,7 @@
                                'record_limit'                                  
=> $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'],
                                'num_records'                                   
=> $num_records,
                                'all_records'                                   
=> $this->bo->total_records,
-                               'link_url'                                      
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiadmin.aclprefs'),
+                               'link_url'                                      
=> $GLOBALS['phpgw']->link('/index.php','menuaction='.'hrm.uiadmin.aclprefs'),
                                'img_path'                                      
=> $GLOBALS['phpgw']->common->get_image_path('phpgwapi','default'),
 
                                'lang_groups'                                   
=> lang('groups'),
@@ -256,7 +256,7 @@
                        $function_msg                                   = 
lang('set grants');
                        $owner_name = 
$GLOBALS['phpgw']->accounts->id2name($GLOBALS['phpgw']->accounts->account_id);  
          // get owner name for title
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg . ': ' . 
$owner_name;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('hrm') . ' - ' . $appname . ': ' . $function_msg . ': ' . $owner_name;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_permission' => $data));
                        $this->save_sessiondata();
                }
@@ -377,7 +377,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   =>      'account_lid',
                                                                                
        'order' =>      $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uiadmin.list_acl',
+                                                                               
        'extra' => array('menuaction'   => 'hrm.uiadmin.list_acl',
                                                                                
                                                        'cat_id'        
=>$this->cat_id,
                                                                                
                                                        'query'         
=>$this->query,
                                                                                
                                                        'module'                
=> $this->location,
@@ -388,7 +388,7 @@
                                                                                
        'sort'  =>      $this->sort,
                                                                                
        'var'   =>      'account_lastname',
                                                                                
        'order' =>      $this->order,
-                                                                               
        'extra' =>      array('menuaction'      => 
$this->currentapp.'.uiadmin.list_acl',
+                                                                               
        'extra' =>      array('menuaction'      => 'hrm.uiadmin.list_acl',
                                                                                
                                                        'cat_id'        
=>$this->cat_id,
                                                                                
                                                        'query'         
=>$this->query,
                                                                                
                                                        'module'                
=> $this->location,
@@ -399,7 +399,7 @@
                                                                                
        'sort'  =>      $this->sort,
                                                                                
        'var'   =>      'account_firstname',
                                                                                
        'order' =>      $this->order,
-                                                                               
        'extra' =>      array('menuaction'      => 
$this->currentapp.'.uiadmin.list_acl',
+                                                                               
        'extra' =>      array('menuaction'      => 'hrm.uiadmin.list_acl',
                                                                                
                                                        'cat_id'        
=>$this->cat_id,
                                                                                
                                                        'query'         
=>$this->query,
                                                                                
                                                        'module'                
=> $this->location,
@@ -417,7 +417,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiadmin.list_acl',
+                               'menuaction'    => 'hrm.uiadmin.list_acl',
                                                'sort'                  
=>$this->sort,
                                                'order'                 
=>$this->order,
                                                'cat_id'                
=>$this->cat_id,
@@ -493,7 +493,7 @@
                        $appname                                                
= lang('permission');
                        $function_msg                                   = 
lang('set permission');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('hrm') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_permission' => $data));
                        $this->save_sessiondata();
                }
@@ -511,22 +511,22 @@
 
                                if ($values['old_email'] != $values['email'])
                                {
-                                       
$GLOBALS['phpgw']->preferences->add($this->currentapp,"email",$values['email'],'user');
+                                       
$GLOBALS['phpgw']->preferences->add('hrm',"email",$values['email'],'user');
                                        $receipt['message'][] = array('msg' => 
lang('Users email is updated'));
                                }
                                if ($values['old_phone'] != $values['phone'])
                                {
-                                       
$GLOBALS['phpgw']->preferences->add($this->currentapp,"cellphone",$values['phone'],'user');
+                                       
$GLOBALS['phpgw']->preferences->add('hrm',"cellphone",$values['phone'],'user');
                                        $receipt['message'][] = array('msg' => 
lang('Users phone is updated'));
                                }
                                if ($values['old_approval_from'] != 
$values['approval_from'])
                                {
-                                       
$GLOBALS['phpgw']->preferences->add($this->currentapp,"approval_from",$values['approval_from'],'user');
+                                       
$GLOBALS['phpgw']->preferences->add('hrm',"approval_from",$values['approval_from'],'user');
                                        $receipt['message'][] = array('msg' => 
lang('Approval from is updated'));
                                }
                                if ($values['old_default_vendor_category'] != 
$values['default_vendor_category'])
                                {
-                                       
$GLOBALS['phpgw']->preferences->add($this->currentapp,"default_vendor_category",$values['default_vendor_category'],'user');
+                                       
$GLOBALS['phpgw']->preferences->add('hrm',"default_vendor_category",$values['default_vendor_category'],'user');
                                        $receipt['message'][] = array('msg' => 
lang('default vendor category is updated'));
                                }
                                
$GLOBALS['phpgw']->preferences->save_repository();
@@ -534,7 +534,7 @@
 
                        if($this->filter)
                        {
-                               $prefs = 
$this->bocommon->create_preferences($this->currentapp,$this->filter);
+                               $prefs = 
$this->bocommon->create_preferences('hrm',$this->filter);
                        }
 
                        $cats           = CreateObject('phpgwapi.categories');
@@ -547,7 +547,7 @@
                        $data = array
                        (
                                'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'form_action'                                   
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiadmin.contact_info'),
+                               'form_action'                                   
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.'hrm.uiadmin.contact_info'),
                                'done_action'                                   
=> $GLOBALS['phpgw']->link('/admin/index.php'),
                                'lang_submit'                                   
=> lang('submit'),
                                'lang_save'                                     
        => lang('Edit'),
@@ -591,7 +591,7 @@
                        $appname                                                
        = lang('User contact info');
                        $function_msg                                           
= lang('edit info');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('hrm') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('contact_info' => $data));
                        $this->save_sessiondata();
                }

Modified: trunk/hrm/inc/class.uicategory.inc.php
===================================================================
--- trunk/hrm/inc/class.uicategory.inc.php      2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/hrm/inc/class.uicategory.inc.php      2008-02-02 13:52:39 UTC (rev 
18466)
@@ -37,7 +37,7 @@
                function hrm_uicategory()
                {
                        $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->nextmatchs                       = 
CreateObject('phpgwapi.nextmatchs');
                        $this->account                          = 
$GLOBALS['phpgw_info']['user']['account_id'];
                        $this->bo                               = 
CreateObject('hrm.bocategory',true);
@@ -82,8 +82,8 @@
                                (
                                        'id'                            => 
$category['id'],
                                        'first'                         => 
$first,
-                                       'link_edit'                     => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uicategory.edit', 'id'=> $category['id'], 'type'=> $type,  
'type_id'=> $type_id)),
-                                       'link_delete'                   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uicategory.delete', 'id'=> $category['id'], 'type'=> $type, 
 'type_id'=> $type_id)),
+                                       'link_edit'                     => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'hrm.uicategory.edit', 'id'=> $category['id'], 'type'=> $type,  'type_id'=> 
$type_id)),
+                                       'link_delete'                   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'hrm.uicategory.delete', 'id'=> $category['id'], 'type'=> $type,  'type_id'=> 
$type_id)),
                                        'lang_view_categorytext'        => 
lang('view the category'),
                                        'lang_edit_categorytext'        => 
lang('edit the category'),
                                        'lang_delete_categorytext'      => 
lang('delete the category'),
@@ -106,7 +106,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'id',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uicategory.index',
+                                                                               
        'extra' => array('menuaction'   => 'hrm.uicategory.index',
                                                                                
                                'type'  =>$type,
                                                                                
                                'type_id' => $type_id)
                                                                                
)),
@@ -117,7 +117,7 @@
                        (
                                'lang_add'                      => lang('add'),
                                'lang_add_categorytext'         => lang('add a 
category'),
-                               'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uicategory.edit', 'type'=> $type, 'type_id'=> $type_id)),
+                               'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'hrm.uicategory.edit', 'type'=> $type, 'type_id'=> $type_id)),
                                'lang_done'                     => lang('done'),
                                'lang_done_categorytext'        => lang('back 
to admin'),
                                'done_action'                   => 
$GLOBALS['phpgw']->link('/admin/index.php')
@@ -141,7 +141,7 @@
                                'record_limit'                                  
=> $record_limit,
                                'num_records'                                   
=> count($category_list),
                                'all_records'                                   
=> $this->bo->total_records,
-                               'link_url'                                      
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uicategory.index', 'type'=> $type,  'type_id'=> $type_id)),
+                               'link_url'                                      
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'hrm.uicategory.index', 'type'=> $type,  'type_id'=> $type_id)),
                                'img_path'                                      
=> $GLOBALS['phpgw']->common->get_image_path('phpgwapi','default'),
                                'lang_searchfield_categorytext'                 
=> lang('Enter the search string. To show all entries, empty this field and 
press the SUBMIT button again'),
                                'lang_searchbutton_categorytext'                
=> lang('Submit the search string'),
@@ -155,7 +155,7 @@
                        $appname = lang($type). ' ' . $type_id;
                        $function_msg   = lang('list %1 category',$type);
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('hrm') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
@@ -210,7 +210,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uicategory.edit',
+                               'menuaction'    => 'hrm.uicategory.edit',
                                'id'            => $id,
                                'type'          => $type,
                                'type_id'       => $type_id
@@ -223,7 +223,7 @@
                        (
                                '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.'.uicategory.index', 'type'=> $type, 'type_id'=> $type_id)),
+                               'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'hrm.uicategory.index', 'type'=> $type, 'type_id'=> $type_id)),
                                'lang_id'                               => 
lang('category ID'),
                                'lang_descr'                            => 
lang('Descr'),
                                'lang_save'                             => 
lang('save'),
@@ -239,7 +239,7 @@
 
                        $appname        = lang($type). ' ' . $type_id;
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('hrm') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -253,7 +253,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uicategory.index',
+                               'menuaction'    => 'hrm.uicategory.index',
                                'type'          => $type,
                                'type_id'       => $type_id
                        );
@@ -269,7 +269,7 @@
                        $data = array
                        (
                                'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uicategory.delete', 'id'=> $id, 'type'=> $type, 'type_id'=> 
$type_id)),
+                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'hrm.uicategory.delete', 'id'=> $id, 'type'=> $type, 'type_id'=> $type_id)),
                                'lang_confirm_msg'              => lang('do you 
really want to delete this entry'),
                                'lang_yes'                      => lang('yes'),
                                'lang_yes_categorytext'         => lang('Delete 
the entry'),
@@ -280,7 +280,7 @@
                        $appname        = lang($type). ' ' . $type_id;
                        $function_msg   = lang('delete '.$type.' category');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('hrm') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }

Modified: trunk/hrm/inc/class.uijob.inc.php
===================================================================
--- trunk/hrm/inc/class.uijob.inc.php   2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/hrm/inc/class.uijob.inc.php   2008-02-02 13:52:39 UTC (rev 18466)
@@ -60,7 +60,7 @@
                public function __construct()
                {
                        $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       $this->currentapp                       = 'hrm';
+               //      $this->currentapp                       = 'hrm';
                        $this->nextmatchs                       = 
CreateObject('phpgwapi.nextmatchs');
                        $this->account                          = 
$GLOBALS['phpgw_info']['user']['account_id'];
                        $this->bo                               = 
CreateObject('hrm.bojob',true);
@@ -134,12 +134,12 @@
                                        'descr'                                 
=> $entry['descr'],
                                        'task_count'                            
=> $entry['task_count'],
                                        'quali_count'                           
=> $entry['quali_count'],
-                                       'link_add_sub'                          
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uijob.edit_job','parent_id'=> $entry['id'])),
-                                       'link_edit'                             
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uijob.edit_job', 'id'=> $entry['id'])),
-                                       'link_delete'                           
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uijob.delete_job', 'job_id'=> $entry['id'])),
-                                       'link_view'                             
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uijob.view_job', 'id'=> $entry['id'])),
-                                       'link_qualification'                    
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uijob.qualification', 'job_id'=> $entry['id'])),
-                                       'link_task'                             
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uijob.task', 'job_id'=> $entry['id'])),
+                                       'link_add_sub'                          
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'hrm.uijob.edit_job','parent_id'=> $entry['id'])),
+                                       'link_edit'                             
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'hrm.uijob.edit_job', 'id'=> $entry['id'])),
+                                       'link_delete'                           
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'hrm.uijob.delete_job', 'job_id'=> $entry['id'])),
+                                       'link_view'                             
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'hrm.uijob.view_job', 'id'=> $entry['id'])),
+                                       'link_qualification'                    
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'hrm.uijob.qualification', 'job_id'=> $entry['id'])),
+                                       'link_task'                             
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 'hrm.uijob.task', 
'job_id'=> $entry['id'])),
                                        'lang_qualification_job_text'           
=> lang('qualifications for this job'),
                                        'lang_task_job_text'                    
=> lang('tasks for this job'),
                                        'lang_view_job_text'                    
=> lang('view the job'),
@@ -164,7 +164,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'name',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => $this->currentapp.'.uijob.index',
+                                                                               
        'extra' => array('menuaction'   => 'hrm.uijob.index',
                                                                                
                                'query'         => $this->query,
                                                                                
                                'cat_id'        => $this->cat_id,
                                                                                
                                'allrows'       => $this->allrows)
@@ -184,10 +184,10 @@
                        (
                                'lang_add'              => lang('add'),
                                'lang_add_statustext'   => lang('add a 
category'),
-                               'add_action'            => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uijob.edit_job')),
+                               'add_action'            => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'hrm.uijob.edit_job')),
                                'lang_reset'            => lang('reset 
hierarchy'),
                                'lang_reset_statustext' => lang('Reset the 
hierarchy'),
-                               'reset_action'          => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uijob.reset_job_type_hierarchy'))
+                               'reset_action'          => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'hrm.uijob.reset_job_type_hierarchy'))
                        );
 
                        $table_reset_job_type[] = array
@@ -235,15 +235,15 @@
                                'values'                                        
        => $content,
                                'table_add_job'                                 
=> $table_add,
                                'lang_select_all'                               
=> lang('Select All'),
-                               'img_check'                                     
        => 
$GLOBALS['phpgw']->common->get_image_path($this->currentapp).'/check.png',
+                               'img_check'                                     
        => $GLOBALS['phpgw']->common->get_image_path('hrm').'/check.png',
                                'lang_print'                                    
=> lang('print'),
-                               'print_action'                                  
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uijob.print_pdf')),
+                               'print_action'                                  
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'hrm.uijob.print_pdf')),
                        );
 
                        $appname        = lang('job');
                        $function_msg   = lang('list job');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('hrm') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
                        $this->save_sessiondata();
                }
@@ -384,8 +384,8 @@
                                $content[] = array
                                (
                                        'sorting'               => 
$entry['value_sort'],
-                                       'link_up'               => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uijob.qualification', 'resort'=> 'up', 'id'=> 
$entry['quali_id'], 'job_id'=> $job_id, 'allrows'=> $this->allrows)),
-                                       'link_down'             => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uijob.qualification', 'resort'=> 'down', 'id'=> 
$entry['quali_id'], 'job_id'=> $job_id, 'allrows'=> $this->allrows)),
+                                       'link_up'               => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'hrm.uijob.qualification', 'resort'=> 'up', 'id'=> $entry['quali_id'], 
'job_id'=> $job_id, 'allrows'=> $this->allrows)),
+                                       'link_down'             => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'hrm.uijob.qualification', 'resort'=> 'down', 'id'=> $entry['quali_id'], 
'job_id'=> $job_id, 'allrows'=> $this->allrows)),
                                        'text_up'               => lang('up'),
                                        'text_down'             => lang('down'),
 
@@ -394,9 +394,9 @@
                                        'descr'                 => 
$entry['descr'],
                                        'remark'                => 
$entry['remark'],
                                        'category'              => 
$entry['category'],
-                                       'link_edit'             => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uijob.edit_qualification', 'job_id'=> $job_id, 'quali_id'=> 
$entry['quali_id'])),
-                                       'link_view'             => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uijob.view_qualification', 'job_id'=> $job_id, 'quali_id'=> 
$entry['quali_id'])),
-                                       'link_delete'           => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uijob.delete_qualification', 'job_id'=> $job_id, 
'quali_id'=> $entry['quali_id'])),
+                                       'link_edit'             => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'hrm.uijob.edit_qualification', 'job_id'=> $job_id, 'quali_id'=> 
$entry['quali_id'])),
+                                       'link_view'             => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'hrm.uijob.view_qualification', 'job_id'=> $job_id, 'quali_id'=> 
$entry['quali_id'])),
+                                       'link_delete'           => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'hrm.uijob.delete_qualification', 'job_id'=> $job_id, 'quali_id'=> 
$entry['quali_id'])),
                                        'lang_view_text'        => lang('view 
qualification item'),
                                        'lang_edit_text'        => lang('edit 
qualification item'),
                                        'lang_delete_text'      => lang('delete 
qualification item'),
@@ -415,7 +415,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'name',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uijob.qualification',
+                                                                               
        'extra' => array('menuaction'   => 'hrm.uijob.qualification',
                                                                                
                                'job_id'        => $job_id,
                                                                                
                                'query'         => $this->query,
                                                                                
                                'cat_id'        => $this->cat_id,
@@ -426,7 +426,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'value_sort',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uijob.qualification',
+                                                                               
        'extra' => array('menuaction'   => 'hrm.uijob.qualification',
                                                                                
                                'job_id'        => $job_id,
                                                                                
                                'query'         => $this->query,
                                                                                
                                'cat_id'        => $this->cat_id,
@@ -451,7 +451,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uijob.edit_qualification',
+                               'menuaction'    => 
'hrm.uijob.edit_qualification',
                                'job_id'        => $job_id
                        );
 
@@ -459,10 +459,10 @@
                        (
                                'lang_add'                      => lang('add'),
                                'lang_add_qualification_text'   => lang('add a 
qualification item'),
-                               'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uijob.edit_qualification', 'job_id'=> $job_id)),
+                               'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'hrm.uijob.edit_qualification', 'job_id'=> $job_id)),
                                'lang_done'                     => lang('done'),
                                'lang_done_qualification_text'  => lang('back 
to user list'),
-                               'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uijob.index'))
+                               'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 'hrm.uijob.index'))
                        );
 
                        $msgbox_data = $this->bocommon->msgbox_data($receipt);
@@ -477,7 +477,7 @@
                                'user_values'                           => 
$user_values,
                                '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.'.uijob.index')),
+                               'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 'hrm.uijob.index')),
                                'lang_id'                               => 
lang('qualification ID'),
                                'lang_descr'                            => 
lang('Descr'),
                                'lang_save'                             => 
lang('save'),
@@ -495,7 +495,7 @@
 
                        $appname = lang('qualification');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('hrm') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('qualification' => $data));
                }
 
@@ -535,17 +535,17 @@
                                $content[] = array
                                (
                                        'sorting'               => 
$entry['value_sort'],
-                                       'link_up'               => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uijob.task', 'resort'=> 'up', 'id'=> $entry['id'], 
'job_id'=> $job_id, 'allrows'=> $this->allrows)),
-                                       'link_down'             => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uijob.task', 'resort'=> 'down', 'id'=> $entry['id'], 
'job_id'=> $job_id, 'allrows'=> $this->allrows)),
+                                       'link_up'               => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 'hrm.uijob.task', 
'resort'=> 'up', 'id'=> $entry['id'], 'job_id'=> $job_id, 'allrows'=> 
$this->allrows)),
+                                       'link_down'             => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 'hrm.uijob.task', 
'resort'=> 'down', 'id'=> $entry['id'], 'job_id'=> $job_id, 'allrows'=> 
$this->allrows)),
                                        'text_up'               => lang('up'),
                                        'text_down'             => lang('down'),
 
                                        'id'                    => $entry['id'],
                                        'name'                  => 
$entry['name'],
                                        'descr'                 => 
$entry['descr'],
-                                       'link_edit'             => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uijob.edit_task', 'job_id'=> $job_id, 'id'=> $entry['id'])),
-                                       'link_view'             => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uijob.view_task', 'job_id'=> $job_id, 'id'=> $entry['id'])),
-                                       'link_delete'           => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uijob.delete_task', 'job_id'=> $job_id, 'id'=> 
$entry['id'])),
+                                       'link_edit'             => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'hrm.uijob.edit_task', 'job_id'=> $job_id, 'id'=> $entry['id'])),
+                                       'link_view'             => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'hrm.uijob.view_task', 'job_id'=> $job_id, 'id'=> $entry['id'])),
+                                       'link_delete'           => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'hrm.uijob.delete_task', 'job_id'=> $job_id, 'id'=> $entry['id'])),
                                        'lang_view_text'        => lang('view 
task item'),
                                        'lang_edit_text'        => lang('edit 
task item'),
                                        'lang_delete_text'      => lang('delete 
task item'),
@@ -564,7 +564,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'phpgw_hrm_task.name',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => $this->currentapp.'.uijob.task',
+                                                                               
        'extra' => array('menuaction'   => 'hrm.uijob.task',
                                                                                
                                'job_id'        => $job_id,
                                                                                
                                'query'         => $this->query,
                                                                                
                                'cat_id'        => $this->cat_id,
@@ -575,7 +575,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'value_sort',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => $this->currentapp.'.uijob.task',
+                                                                               
        'extra' => array('menuaction'   => 'hrm.uijob.task',
                                                                                
                                'job_id'        => $job_id,
                                                                                
                                'query'         => $this->query,
                                                                                
                                'cat_id'        => $this->cat_id,
@@ -595,7 +595,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uijob.edit_task',
+                               'menuaction'    => 'hrm.uijob.edit_task',
                                'job_id'        => $job_id
                        );
 
@@ -603,10 +603,10 @@
                        (
                                'lang_add'                      => lang('add'),
                                'lang_add_task_text'            => lang('add a 
task item'),
-                               'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uijob.edit_task', 'job_id'=> $job_id)),
+                               'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'hrm.uijob.edit_task', 'job_id'=> $job_id)),
                                'lang_done'                     => lang('done'),
                                'lang_done_task_text'           => lang('back 
to user list'),
-                               'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uijob.index'))
+                               'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 'hrm.uijob.index'))
                        );
 
                        $msgbox_data = $this->bocommon->msgbox_data($receipt);
@@ -621,7 +621,7 @@
                                'user_values'                           => 
$user_values,
                                '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.'.uijob.index')),
+                               'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 'hrm.uijob.index')),
                                'lang_id'                               => 
lang('task ID'),
                                'lang_descr'                            => 
lang('Descr'),
                                'lang_save'                             => 
lang('save'),
@@ -639,7 +639,7 @@
 
                        $appname = lang('task');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('hrm') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('task' => $data));
                }
 
@@ -695,13 +695,13 @@
                                                if ($values['save'])
                                                {
                                                        
$GLOBALS['phpgw']->session->appsession('session_data','hrm_task_receipt',$receipt);
-                                                       
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction'=> 
$this->currentapp.'.uijob.task', 'job_id'=> $job_id));
+                                                       
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction'=> 
'hrm.uijob.task', 'job_id'=> $job_id));
                                                }
                                        }
                                }
                                else
                                {
-                                       
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction'=> 
$this->currentapp.'.uijob.task', 'job_id'=> $job_id));
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction'=> 
'hrm.uijob.task', 'job_id'=> $job_id));
                                }
                        }
 
@@ -725,7 +725,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uijob.edit_task',
+                               'menuaction'    => 'hrm.uijob.edit_task',
                                'id'            => $id,
                                'job_id'        => $job_id                      
        
                        );
@@ -764,7 +764,7 @@
 
                        $appname        = lang('task');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('hrm') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_task' => $data));
                }
 
@@ -795,7 +795,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uijob.task',
+                               'menuaction'    => 'hrm.uijob.task',
                                'id'            => $id,
                                'job_id'        => $job_id
                        );
@@ -827,7 +827,7 @@
 
                        $appname        = lang('task');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('hrm') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view_task' => $data));
                }
 
@@ -865,7 +865,7 @@
 
                                if ($allowed_edit)
                                {
-                                       $link_edit              = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uijob.edit_qualification_type', 'quali_type_id'=> 
$entry['id']));
+                                       $link_edit              = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'hrm.uijob.edit_qualification_type', 'quali_type_id'=> $entry['id']));
                                        $text_edit              = lang('edit');
                                }
 
@@ -875,8 +875,8 @@
                                        'name'                  => 
$entry['name'],
                                        'descr'                 => 
$entry['descr'],
                                        'link_edit'             => $link_edit,
-//                                     'link_view'             => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uijob.edit_qualification_type', 'quali_type_id'=> 
$entry['id']));
-//                                     'link_delete'           => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uijob.edit_qualification_type', 'quali_type_id'=> 
$entry['id']));
+//                                     'link_view'             => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'hrm.uijob.edit_qualification_type', 'quali_type_id'=> $entry['id']));
+//                                     'link_delete'           => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'hrm.uijob.edit_qualification_type', 'quali_type_id'=> $entry['id']));
                                        'lang_select'           => 
lang('select'),
                                        'text_delete'           => 
lang('delete'),
                                        'text_edit'             => $text_edit,
@@ -894,7 +894,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'name',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uijob.lookup_qualification',
+                                                                               
        'extra' => array('menuaction'   => 'hrm.uijob.lookup_qualification',
                                                                                
                                'query'         => $this->query,
                                                                                
                                'cat_id'        => $this->cat_id,
                                                                                
                                'allrows'       => $this->allrows)
@@ -923,7 +923,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uijob.lookup_qualification',
+                               'menuaction'    => 
'hrm.uijob.lookup_qualification',
                                'sort'          => $this->sort,
                                'order'         => $this->order,
                                'cat_id'        => $this->cat_id,
@@ -935,10 +935,10 @@
                        (
                                'lang_add'                      => lang('add'),
                                'lang_add_qualification_text'   => lang('add a 
qualification item'),
-                               'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uijob.edit_qualification_type', 'job_id'=> $job_id)),
+                               'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'hrm.uijob.edit_qualification_type', 'job_id'=> $job_id)),
                                'lang_done'                     => lang('done'),
                                'lang_done_qualification_text'  => lang('back 
to user list'),
-                               'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uijob.lookup_qualification'))
+                               'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'hrm.uijob.lookup_qualification'))
                        );
 
 
@@ -978,12 +978,12 @@
 
                                'lang_add'                                      
=> lang('add'),
                                'lang_add_qualification_text'                   
=> lang('add a qualification item'),
-                               'add_action'                                    
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uijob.edit_qualification_type')),
+                               'add_action'                                    
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'hrm.uijob.edit_qualification_type')),
 
                                'user_values'                                   
=> $user_values,
                                '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.'.uijob.index')),
+                               'done_action'                                   
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'hrm.uijob.index')),
                                'lang_id'                                       
=> lang('qualification ID'),
                                'lang_descr'                                    
=> lang('Descr'),
                                'lang_save'                                     
=> lang('save'),
@@ -1001,7 +1001,7 @@
 
                        $appname        = lang('qualification');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('hrm') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('lookup_qualification' => 
$data));
                }
 
@@ -1040,13 +1040,13 @@
                                                if ($values['save'])
                                                {
                                                        
$GLOBALS['phpgw']->session->appsession('session_data','hrm_quali_tp_receipt',$receipt);
-                                                       
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction'=> 
$this->currentapp.'.uijob.lookup_qualification', 'query'=> $values['name']));
+                                                       
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction'=> 
'hrm.uijob.lookup_qualification', 'query'=> $values['name']));
                                                }
                                        }
                                }
                                else
                                {
-                                       
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction'=> 
$this->currentapp.'.uijob.lookup_qualification'));
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction'=> 
'hrm.uijob.lookup_qualification'));
                                }
                        }
 
@@ -1068,7 +1068,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uijob.edit_qualification_type',
+                               'menuaction'    => 
'hrm.uijob.edit_qualification_type',
                                'quali_type_id' => $quali_type_id
                        );
 
@@ -1100,7 +1100,7 @@
 
                        $appname        = lang('Place');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('hrm') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_qualification_type' => 
$data));
                }
 
@@ -1160,13 +1160,13 @@
                                                if ($values['save'])
                                                {
                                                        
$GLOBALS['phpgw']->session->appsession('session_data','hrm_job_receipt',$receipt);
-                                                       
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction'=> 
$this->currentapp.'.uijob.index'));
+                                                       
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction'=> 
'hrm.uijob.index'));
                                                }
                                        }
                                }
                                else
                                {
-                                       
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction'=> 
$this->currentapp.'.uijob.index'));
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction'=> 
'hrm.uijob.index'));
                                }
                        }
 
@@ -1189,7 +1189,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uijob.edit_job',
+                               'menuaction'    => 'hrm.uijob.edit_job',
                                'id'            => $id
                        );
 
@@ -1199,7 +1199,7 @@
                        (
                                '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.'.uijob.index' ,'type'=> $type, 'type_id'=> $type_id)),
+                               'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 'hrm.uijob.index' 
,'type'=> $type, 'type_id'=> $type_id)),
                                'lang_id'                               => 
lang('category ID'),
                                'lang_descr'                            => 
lang('Descr'),
                                'lang_save'                             => 
lang('save'),
@@ -1229,7 +1229,7 @@
 
                        $appname = lang('job');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('hrm') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_job' => $data));
                }
 
@@ -1261,7 +1261,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uijob.edit_job',
+                               'menuaction'    => 'hrm.uijob.edit_job',
                                'id'            => $id
                        );
 
@@ -1270,7 +1270,7 @@
                        $data = array
                        (
                                'msgbox_data'                           => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uijob.index', 'type'=> $type, 'type_id'=> $type_id)),
+                               'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 'hrm.uijob.index', 
'type'=> $type, 'type_id'=> $type_id)),
                                'lang_id'                               => 
lang('category ID'),
                                'lang_descr'                            => 
lang('Descr'),
                                'lang_save'                             => 
lang('save'),
@@ -1299,7 +1299,7 @@
 
                        $appname        = lang('job');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('hrm') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view_job' => $data));
                }
 
@@ -1360,13 +1360,13 @@
                                                if ($values['save'])
                                                {
                                                        
$GLOBALS['phpgw']->session->appsession('session_data','hrm_quali_receipt',$receipt);
-                                                       
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction'=> 
$this->currentapp.'.uijob.qualification', 'job_id'=> $job_id));
+                                                       
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction'=> 
'hrm.uijob.qualification', 'job_id'=> $job_id));
                                                }
                                        }
                                }
                                else
                                {
-                                       
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction'=> 
$this->currentapp.'.uijob.qualification' ,'job_id'=> $job_id));
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction'=> 
'hrm.uijob.qualification' ,'job_id'=> $job_id));
                                }
                        }
 
@@ -1389,7 +1389,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uijob.edit_qualification',
+                               'menuaction'    => 
'hrm.uijob.edit_qualification',
                                'quali_id'      => $quali_id,
                                'job_id'        => $job_id
                        );
@@ -1397,7 +1397,7 @@
 
                        $link_data_lookup = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uijob.lookup_qualification',
+                               'menuaction'    => 
'hrm.uijob.lookup_qualification',
                                'quali_id'      => $quali_id,
                                'job_id'        => $job_id
                        );
@@ -1463,7 +1463,7 @@
 
                        $appname                                        = 
lang('qualification') .' ' . $job_info['name'];
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('hrm') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_qualification' => 
$data));
                }
 
@@ -1485,7 +1485,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uijob.qualification',
+                               'menuaction'    => 'hrm.uijob.qualification',
                                'job_id'        => $job_id
                        );
 
@@ -1535,7 +1535,7 @@
 
                        $job_info = $this->bo->read_single_job($job_id);
                        $appname                                        = 
lang('qualification') .' ' . $job_info['name'];
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('hrm') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view_qualification' => 
$data));
                }
 
@@ -1551,7 +1551,7 @@
                        $confirm                = phpgw::get_var('confirm', 
'bool', 'POST');
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uijob.index',
+                               'menuaction'    => 'hrm.uijob.index',
                                'job_id'        => $job_id
                        );
 
@@ -1565,7 +1565,7 @@
                        $data = array
                        (
                                'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uijob.delete_job', 'job_id'=> $job_id)),
+                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'hrm.uijob.delete_job', 'job_id'=> $job_id)),
                                'lang_confirm_msg'              => lang('do you 
really want to delete this entry'),
                                'lang_yes'                      => lang('yes'),
                                'lang_yes_statustext'           => lang('Delete 
the entry'),
@@ -1576,7 +1576,7 @@
                        $appname        = lang('job');
                        $function_msg   = lang('delete');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('hrm') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                }
 
@@ -1594,7 +1594,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uijob.task',
+                               'menuaction'    => 'hrm.uijob.task',
                                'job_id'        => $job_id
                        );
 
@@ -1609,7 +1609,7 @@
                        $data = array
                        (
                                'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uijob.delete_task', 'job_id'=> $job_id, 'id'=> $id)),
+                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'hrm.uijob.delete_task', 'job_id'=> $job_id, 'id'=> $id)),
                                'lang_confirm_msg'              => lang('do you 
really want to delete this entry'),
                                'lang_yes'                      => lang('yes'),
                                'lang_yes_categorytext'         => lang('Delete 
the entry'),
@@ -1620,7 +1620,7 @@
                        $appname        = lang('task');
                        $function_msg   = lang('delete');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('hrm') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                }
 
@@ -1638,7 +1638,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uijob.qualification',
+                               'menuaction'    => 'hrm.uijob.qualification',
                                'job_id'        => $job_id
                        );
 
@@ -1653,7 +1653,7 @@
                        $data = array
                        (
                                'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uijob.delete_qualification', 'job_id'=> $job_id, 
'quali_id'=> $quali_id)),
+                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'hrm.uijob.delete_qualification', 'job_id'=> $job_id, 'quali_id'=> $quali_id)),
                                'lang_confirm_msg'              => lang('do you 
really want to delete this entry'),
                                'lang_yes'                      => lang('yes'),
                                'lang_yes_categorytext'         => lang('Delete 
the entry'),
@@ -1664,7 +1664,7 @@
                        $appname        = lang('qualification');
                        $function_msg   = lang('delete');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('hrm') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                }
 
@@ -1679,7 +1679,7 @@
                        $confirm                = phpgw::get_var('confirm', 
'bool', 'POST');
                        $link_data = array
                        (
-                               'menuaction' => $this->currentapp.'.uijob.index'
+                               'menuaction' => 'hrm.uijob.index'
                        );
 
                        if (phpgw::get_var('confirm', 'bool', 'POST'))
@@ -1693,7 +1693,7 @@
                        $data = array
                        (
                                'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uijob.reset_job_type_hierarchy')),
+                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'hrm.uijob.reset_job_type_hierarchy')),
                                'lang_confirm_msg'              => lang('do you 
really want to reset the hierarchy'),
                                'lang_yes'                      => lang('yes'),
                                'lang_yes_statustext'           => lang('Reset 
the hierarchy'),
@@ -1703,7 +1703,7 @@
 
                        $appname        = lang('job');
                        $function_msg   = lang('delete');
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('hrm') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                }
                

Modified: trunk/hrm/inc/class.uiplace.inc.php
===================================================================
--- trunk/hrm/inc/class.uiplace.inc.php 2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/hrm/inc/class.uiplace.inc.php 2008-02-02 13:52:39 UTC (rev 18466)
@@ -38,7 +38,7 @@
                function hrm_uiplace()
                {
                        $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->nextmatchs               = 
CreateObject('phpgwapi.nextmatchs');
                        $this->account                  = 
$GLOBALS['phpgw_info']['user']['account_id'];
                        $this->bo                       = 
CreateObject('hrm.boplace',true);
@@ -80,9 +80,9 @@
                                $content[] = array
                                (
                                        'name'                                  
=> $entry['name'],
-                                       'link_edit'                             
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uiplace.edit', 'place_id'=> $entry['id'])),
-                                       'link_delete'                           
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uiplace.delete', 'place_id'=> $entry['id'])),
-                                       'link_view'                             
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uiplace.view', 'place_id'=> $entry['id'])),
+                                       'link_edit'                             
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'hrm.uiplace.edit', 'place_id'=> $entry['id'])),
+                                       'link_delete'                           
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'hrm.uiplace.delete', 'place_id'=> $entry['id'])),
+                                       'link_view'                             
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'hrm.uiplace.view', 'place_id'=> $entry['id'])),
                                        'lang_view_place_text'                  
=> lang('view the place'),
                                        'lang_edit_place_text'                  
=> lang('edit the place'),
                                        'text_view'                             
=> lang('view'),
@@ -102,7 +102,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'name',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => $this->currentapp.'.uiplace.index',
+                                                                               
        'extra' => array('menuaction'   => 'hrm.uiplace.index',
                                                                                
                                'query'         => $this->query,
                                                                                
                                'cat_id'        => $this->cat_id,
                                                                                
                                'allrows'       => $this->allrows)
@@ -123,7 +123,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiplace.index',
+                               'menuaction'    => 'hrm.uiplace.index',
                                'sort'          => $this->sort,
                                'order'         => $this->order,
                                'cat_id'        => $this->cat_id,
@@ -135,7 +135,7 @@
                        (
                                'lang_add'              => lang('add'),
                                'lang_add_statustext'   => lang('add a place'),
-                               'add_action'            => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uiplace.edit')),
+                               'add_action'            => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 'hrm.uiplace.edit')),
                        );
 
                        $msgbox_data = $this->bocommon->msgbox_data($receipt);
@@ -164,7 +164,7 @@
                        $appname        = lang('place');
                        $function_msg= lang('list place');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('hrm') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
                        $this->save_sessiondata();
                }
@@ -213,13 +213,13 @@
                                                if ($values['save'])
                                                {
                                                        
$GLOBALS['phpgw']->session->appsession('session_data','hrm_training_receipt',$receipt);
-                                                       
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction'=> 
$this->currentapp.'.uiplace.index', 'place_id'=> $place_id));
+                                                       
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction'=> 
'hrm.uiplace.index', 'place_id'=> $place_id));
                                                }
                                        }
                                }
                                else
                                {
-                                       
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction'=> 
$this->currentapp.'.uiplace.index', 'place_id'=> $place_id));
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction'=> 
'hrm.uiplace.index', 'place_id'=> $place_id));
                                }
                        }
 
@@ -241,7 +241,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiplace.edit',
+                               'menuaction'    => 'hrm.uiplace.edit',
                                'place_id'      => $place_id
                        );
 
@@ -279,7 +279,7 @@
 
                        $appname                                        = 
lang('Place');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('hrm') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
                }
 
@@ -318,14 +318,14 @@
                                'lang_town'                     => lang('town'),
                                'lang_remark'                   => 
lang('remark'),
 
-                               'form_action'                   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uiplace.index')),
+                               'form_action'                   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'hrm.uiplace.index')),
                                'lang_cancel'                   => 
lang('cancel'),
                                'value_id'                      => $place_id,
                        );
 
                        $appname        = lang('Place');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('hrm') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view' => $data));
                }
 
@@ -336,7 +336,7 @@
 
                        $link_data = array
                        (
-                               'menuaction' => 
$this->currentapp.'.uiplace.index'
+                               'menuaction' => 'hrm.uiplace.index'
                        );
 
                        if (phpgw::get_var('confirm', 'bool', 'POST'))
@@ -350,7 +350,7 @@
                        $data = array
                        (
                                'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uiplace.delete', 'place_id'=> $place_id)),
+                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'hrm.uiplace.delete', 'place_id'=> $place_id)),
                                'lang_confirm_msg'              => lang('do you 
really want to delete this entry'),
                                'lang_yes'                      => lang('yes'),
                                'lang_yes_statustext'           => lang('Delete 
the entry'),
@@ -361,7 +361,7 @@
                        $appname        = lang('Place');
                        $function_msg   = lang('delete');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('hrm') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                }
 

Modified: trunk/hrm/inc/class.uiuser.inc.php
===================================================================
--- trunk/hrm/inc/class.uiuser.inc.php  2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/hrm/inc/class.uiuser.inc.php  2008-02-02 13:52:39 UTC (rev 18466)
@@ -81,7 +81,7 @@
                        {
                                if($entry['grants'])
                                {
-                                       $link_training                          
= $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uiuser.training', 'user_id'=> $entry['account_id']));
+                                       $link_training                          
= $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'hrm.uiuser.training', 'user_id'=> $entry['account_id']));
                                        $text_training                          
= lang('training');
                                        $lang_training_user_text        = 
lang('Training profile');
                                }
@@ -96,9 +96,9 @@
                                (
                                        'first_name'                            
=> $entry['account_firstname'],
                                        'last_name'                             
        => $entry['account_lastname'],
-//                                     'link_edit'                             
        => $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uiuser.training', 'user_id'=> $entry['account_id'])),
+//                                     'link_edit'                             
        => $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'hrm.uiuser.training', 'user_id'=> $entry['account_id'])),
                                        'link_training'                         
=> $link_training,
-                                       'link_view'                             
        => $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uiuser.view' ,' user_id'=> $entry['account_id'])),
+                                       'link_view'                             
        => $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'hrm.uiuser.view' ,' user_id'=> $entry['account_id'])),
                                        'lang_view_user_text'           => 
lang('view the user'),
                                        'lang_training_user_text'       => 
$lang_training_user_text,
                                        'lang_edit_user_text'           => 
lang('edit the user'),
@@ -117,7 +117,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'account_lastname',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'           => 
$this->currentapp.'.uiuser.index',
+                                                                               
        'extra' => array('menuaction'           => 'hrm.uiuser.index',
                                                                                
                                'query'         => $this->query,
                                                                                
                                'allrows'       => $this->allrows)
                                                                                
)),
@@ -127,7 +127,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'account_firstname',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'           => 
$this->currentapp.'.uiuser.index',
+                                                                               
        'extra' => array('menuaction'           => 'hrm.uiuser.index',
                                                                                
                                'query'         => $this->query,
                                                                                
                                'allrows'       => $this->allrows)
                                                                                
)),
@@ -148,7 +148,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiuser.index',
+                               'menuaction'    => 'hrm.uiuser.index',
                                'sort'                  => $this->sort,
                                'order'                 => $this->order,
                                'query'                 => $this->query
@@ -176,7 +176,7 @@
                        $appname        = lang('user');
                        $function_msg   = lang('list user');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('hrm') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
                        $this->save_sessiondata();
                }
@@ -326,13 +326,13 @@
 
                                
if($this->bocommon->check_perms($this->grants[$user_id], PHPGW_ACL_EDIT))
                                {
-                                       $link_edit      = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uiuser.edit', 'user_id'=> $user_id, 'training_id'=> 
$entry['training_id']));
+                                       $link_edit      = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 'hrm.uiuser.edit', 
'user_id'=> $user_id, 'training_id'=> $entry['training_id']));
                                        $text_edit      = lang('edit');
                                        $lang_edit_text = lang('edit training 
item');
                                }
                                
if($this->bocommon->check_perms($this->grants[$user_id], PHPGW_ACL_DELETE))
                                {
-                                       $link_delete            = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uiuser.delete', 'user_id'=> $user_id, 'training_id'=> 
$entry['training_id']));
+                                       $link_delete            = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 'hrm.uiuser.delete', 
'user_id'=> $user_id, 'training_id'=> $entry['training_id']));
                                        $text_delete            = 
lang('delete');
                                        $lang_delete_text       = lang('delete 
training item');
                                }
@@ -345,7 +345,7 @@
                                        'end_date'              => 
$entry['end_date'],
                                        'category'              => 
$entry['category'],
                                        'link_edit'             => $link_edit,
-                                       'link_view'             => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uiuser.view', 'user_id'=> $user_id, 'training_id'=> 
$entry['training_id'])),
+                                       'link_view'             => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 'hrm.uiuser.view', 
'user_id'=> $user_id, 'training_id'=> $entry['training_id'])),
                                        'link_delete'           => $link_delete,
                                        'lang_view_text'        => lang('view 
training item'),
                                        'lang_edit_text'        => 
$lang_edit_text,
@@ -370,7 +370,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'phpgw_hrm_training_place.name',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => $this->currentapp.'.uiuser.training',
+                                                                               
        'extra' => array('menuaction'   => 'hrm.uiuser.training',
                                                                                
                                'user_id'       => $user_id,
                                                                                
                                'query'         => $this->query,
                                                                                
                //              'cat_id'        => $this->cat_id,
@@ -381,7 +381,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'start_date',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'           => 
$this->currentapp.'.uiuser.training',
+                                                                               
        'extra' => array('menuaction'           => 'hrm.uiuser.training',
                                                                                
                                'user_id'       => $user_id,
                                                                                
                                'query'         => $this->query,
                                                                                
                //              'cat_id'        => $this->cat_id,
@@ -393,7 +393,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'phpgw_hrm_training.title',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => $this->currentapp.'.uiuser.training',
+                                                                               
        'extra' => array('menuaction'   => 'hrm.uiuser.training',
                                                                                
                                'user_id'       => $user_id,
                                                                                
                                'query'         => $this->query,
                                                                                
                //              'cat_id'        => $this->cat_id,
@@ -411,13 +411,13 @@
                        $function_msg = lang('list training');
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiuser.edit',
+                               'menuaction'    => 'hrm.uiuser.edit',
                                'user_id'       => $user_id
                        );
 
                        
if($this->bocommon->check_perms($this->grants[$user_id], PHPGW_ACL_ADD))
                        {
-                               $add_action     = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uiuser.edit', 'user_id'=> $user_id));
+                               $add_action     = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 'hrm.uiuser.edit', 
'user_id'=> $user_id));
                                $lang_add       = lang('add');
                        }
                        
@@ -428,14 +428,14 @@
                                'add_action'                            => 
$add_action,
                                'lang_done'                                     
=> lang('done'),
                                'lang_done_training_text'       => lang('back 
to user list'),
-                               'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uiuser.index'))
+                               'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 'hrm.uiuser.index'))
                        );
 
                        $msgbox_data = $this->bocommon->msgbox_data($receipt);
 
                        $link_cv_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiuser.view_cv',
+                               'menuaction'    => 'hrm.uiuser.view_cv',
                                'user_id'       => $user_id,
                                'order'         => $this->order,
                                'sort'          => $this->sort
@@ -453,7 +453,7 @@
                                'user_values'                           => 
$user_values,
                                '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.'.uiuser.index')),
+                               'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 'hrm.uiuser.index')),
                                'lang_id'                                       
=> lang('training ID'),
                                'lang_descr'                            => 
lang('Descr'),
                                'lang_save'                                     
=> lang('save'),
@@ -471,7 +471,7 @@
 
                        $appname                                        = 
lang('Training');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('hrm') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('training' => $data));
                }
 
@@ -552,13 +552,13 @@
                                                if ($values['save'])
                                                {
                                                        
$GLOBALS['phpgw']->session->appsession('session_data','hrm_training_receipt',$receipt);
-                                                       
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction'=> 
$this->currentapp.'.uiuser.training', 'user_id'=> $user_id));
+                                                       
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction'=> 
'hrm.uiuser.training', 'user_id'=> $user_id));
                                                }
                                        }
                                }
                                else
                                {
-                                       
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction'=> 
$this->currentapp.'.uiuser.training', 'user_id'=> $user_id));
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction'=> 
'hrm.uiuser.training', 'user_id'=> $user_id));
                                }
                        }
 
@@ -581,7 +581,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiuser.edit',
+                               'menuaction'    => 'hrm.uiuser.edit',
                                'training_id'   => $training_id,
                                'user_id'       => $user_id
                        );
@@ -690,7 +690,7 @@
 
                        $appname                                        = 
lang('Training');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('hrm') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
                }
 
@@ -751,7 +751,7 @@
                                'lang_new_place_status_text'            => 
lang('Enter a new place'),
                                'lang_no_place'                         => 
lang('select a place'),
 
-                               'form_action'                           => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uiuser.training', 'user_id'=> $user_id)),
+                               'form_action'                           => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'hrm.uiuser.training', 'user_id'=> $user_id)),
                                'lang_id'                               => 
lang('training ID'),
                                'lang_descr'                            => 
lang('Descr'),
                                'lang_save'                             => 
lang('save'),
@@ -775,7 +775,7 @@
 
                        $appname        = lang('Training');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('hrm') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view' => $data));
                }
 
@@ -793,7 +793,7 @@
 
                        $link_data = array
                        (
-                               'menuaction' => 
$this->currentapp.'.uiuser.training',
+                               'menuaction' => 'hrm.uiuser.training',
                                'user_id' => $user_id
                        );
 
@@ -808,7 +808,7 @@
                        $data = array
                        (
                                'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uiuser.delete', 'user_id'=> $user_id, 'training_id'=> 
$training_id)),
+                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 'hrm.uiuser.delete', 
'user_id'=> $user_id, 'training_id'=> $training_id)),
                                'lang_confirm_msg'              => lang('do you 
really want to delete this entry'),
                                'lang_yes'                      => lang('yes'),
                                'lang_yes_categorytext'         => lang('Delete 
the entry'),
@@ -819,7 +819,7 @@
                        $appname        = lang('Training');
                        $function_msg   = lang('delete');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('hrm') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                }
 
@@ -877,7 +877,7 @@
                        //error_reporting(7);
                        //error_reporting(E_ALL);
                        set_time_limit(1800);
-                       $pdf -> ezSetMargins(50,70,50,50);
+                       $pdf -> ezSetMargins(90,70,50,50);
                        $pdf->selectFont(PHPGW_API_INC . 
'/pdf/fonts/Helvetica.afm');
 
                        // put a line top and bottom on all the pages
@@ -903,7 +903,6 @@
                        $pdf->addObject($all,'all');
                        $pdf->ezStartPageNumbers(500,28,10,'right','{PAGENUM} ' 
. lang('of') . ' {TOTALPAGENUM}',1);
 
-                       $pdf->ezSetDy(-50);
                        $pdf->ezTable($content_heading,'','',
                                                        
array('xPos'=>220,'xOrientation'=>'right','width'=>300,0,'shaded'=>0,'fontSize' 
=> 10,'showLines'=> 0,'titleFontSize' => 
12,'outerLineThickness'=>0,'showHeadings'=>0
                                                        
,'cols'=>array('text'=>array('justification'=>'left','width'=>100),

Added: trunk/hrm/inc/hook_sidebox_menu.inc.php
===================================================================
--- trunk/hrm/inc/hook_sidebox_menu.inc.php                             (rev 0)
+++ trunk/hrm/inc/hook_sidebox_menu.inc.php     2008-02-02 13:52:39 UTC (rev 
18466)
@@ -0,0 +1,13 @@
+<?php
+
+       $menu_title = $GLOBALS['phpgw_info']['apps'][$appname]['title'] . ' '. 
lang('Menu');
+       $menu = $GLOBALS['phpgw']->session->appsession('menu_hrm','sidebox');   
+       if(isset($menu) && is_array($menu))
+       {
+               display_sidebox($appname,$menu_title,$menu['module'],$use_lang 
= false);
+               if(isset($menu['sub_menu']) && $menu['sub_menu'])
+               {
+                       display_sidebox($appname,$menu['sub_menu'] . ' ' . lang 
('sub menu'),$menu['sub_menu'],$use_lang = false);      
+               }
+       }       
+?>

Modified: trunk/hrm/setup/default_records.inc.php
===================================================================
--- trunk/hrm/setup/default_records.inc.php     2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/hrm/setup/default_records.inc.php     2008-02-02 13:52:39 UTC (rev 
18466)
@@ -17,6 +17,7 @@
         * @package hrm
         */
 
+       $GLOBALS['phpgw_setup']->oProc->query("DELETE FROM phpgw_acl_location 
where appname = 'hrm'");
        $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname,id, descr) VALUES ('hrm', '.', 'Top')");
        $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname,id, descr, allow_grant) VALUES ('hrm', '.user', 'User',1)");
        $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname,id, descr) VALUES ('hrm', '.job', 'Job description')");

Modified: trunk/hrm/setup/phpgw_en.lang
===================================================================
--- trunk/hrm/setup/phpgw_en.lang       2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/hrm/setup/phpgw_en.lang       2008-02-02 13:52:39 UTC (rev 18466)
@@ -1,4 +1,4 @@
-hrm    hrm     en      Human Resource Management
+hrm    common  en      Human Resource Management
 Add    hrm     en      Add
 Job    hrm     en      Job
 Place  hrm     en      Place

Modified: trunk/hrm/setup/setup.inc.php
===================================================================
--- trunk/hrm/setup/setup.inc.php       2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/hrm/setup/setup.inc.php       2008-02-02 13:52:39 UTC (rev 18466)
@@ -75,7 +75,8 @@
                'settings',
                'preferences',
                'admin',
-               'help'
+               'help',
+               'sidebox_menu'
        );
 
        /* Dependencies for this app to work */

Modified: trunk/hrm/templates/base/menu.xsl
===================================================================
--- trunk/hrm/templates/base/menu.xsl   2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/hrm/templates/base/menu.xsl   2008-02-02 13:52:39 UTC (rev 18466)
@@ -12,10 +12,10 @@
                                                <xsl:text>  </xsl:text>
                                                <xsl:choose>
                                                        <xsl:when test="this=1">
-                                                               <a 
href="{link}" onMouseover="window.status='{statustext}';return true;" 
onMouseout="window.status='';return 
true;"><b><xsl:text>[</xsl:text><xsl:value-of 
select="name"/><xsl:text>]</xsl:text></b></a>                                   
     
+                                                               <a href="{url}" 
onMouseover="window.status='{statustext}';return true;" 
onMouseout="window.status='';return 
true;"><b><xsl:text>[</xsl:text><xsl:value-of 
select="text"/><xsl:text>]</xsl:text></b></a>                                 
                                                        </xsl:when>
                                                        <xsl:otherwise>
-                                                               <a 
href="{link}" onMouseover="window.status='{statustext}';return true;" 
onMouseout="window.status='';return true;"><xsl:value-of select="name"/></a>    
                               
+                                                               <a href="{url}" 
onMouseover="window.status='{statustext}';return true;" 
onMouseout="window.status='';return true;"><xsl:value-of select="text"/></a>    
                                
                                                        </xsl:otherwise>
                                                </xsl:choose>
 
@@ -31,10 +31,10 @@
                                                <xsl:text>  </xsl:text>
                                                <xsl:choose>
                                                        <xsl:when test="this=1">
-                                                               <a 
href="{link}" onMouseover="window.status='{statustext}';return true;" 
onMouseout="window.status='';return 
true;"><b><xsl:text>[</xsl:text><xsl:value-of 
select="name"/><xsl:text>]</xsl:text></b></a>                                   
     
+                                                               <a href="{url}" 
onMouseover="window.status='{statustext}';return true;" 
onMouseout="window.status='';return 
true;"><b><xsl:text>[</xsl:text><xsl:value-of 
select="text"/><xsl:text>]</xsl:text></b></a>                                 
                                                        </xsl:when>
                                                        <xsl:otherwise>
-                                                               <a 
href="{link}" onMouseover="window.status='{statustext}';return true;" 
onMouseout="window.status='';return true;"><xsl:value-of select="name"/></a>    
                               
+                                                               <a href="{url}" 
onMouseover="window.status='{statustext}';return true;" 
onMouseout="window.status='';return true;"><xsl:value-of select="text"/></a>    
                                
                                                        </xsl:otherwise>
                                                </xsl:choose>
                                        </xsl:for-each>
@@ -52,10 +52,10 @@
                                                                <xsl:text>  
</xsl:text>
                                                                <xsl:choose>
                                                                        
<xsl:when test="this=1">
-                                                                               
<a href="{link}" onMouseover="window.status='{statustext}';return true;" 
onMouseout="window.status='';return 
true;"><b><xsl:text>[</xsl:text><xsl:value-of 
select="name"/><xsl:text>]</xsl:text></b></a>                                   
     
+                                                                               
<a href="{url}" onMouseover="window.status='{statustext}';return true;" 
onMouseout="window.status='';return 
true;"><b><xsl:text>[</xsl:text><xsl:value-of 
select="text"/><xsl:text>]</xsl:text></b></a>                                 
                                                                        
</xsl:when>
                                                                        
<xsl:otherwise>
-                                                                               
<a href="{link}" onMouseover="window.status='{statustext}';return true;" 
onMouseout="window.status='';return true;"><xsl:value-of select="name"/></a>    
                               
+                                                                               
<a href="{url}" onMouseover="window.status='{statustext}';return true;" 
onMouseout="window.status='';return true;"><xsl:value-of select="text"/></a>    
                                
                                                                        
</xsl:otherwise>
                                                                </xsl:choose>
                                                        </xsl:for-each>

Modified: trunk/infolog/inc/class.vfs.inc.php
===================================================================
--- trunk/infolog/inc/class.vfs.inc.php 2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/infolog/inc/class.vfs.inc.php 2008-02-02 13:52:39 UTC (rev 18466)
@@ -687,7 +687,7 @@
                                $relatives = array (RELATIVE_CURRENT);
                        }
 
-                       $sep = SEP;
+                       $sep = '/';
 
                        $rarray['mask'] = RELATIVE_NONE;
 

Modified: trunk/infolog/setup/phpgw_sv.lang
===================================================================
--- trunk/infolog/setup/phpgw_sv.lang   2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/infolog/setup/phpgw_sv.lang   2008-02-02 13:52:39 UTC (rev 18466)
@@ -236,3 +236,4 @@
 you have entered an invalid starting date      infolog sv      Du har angivit 
ett felaktigt startdatum
 you have to enter a name, to create a new typ!!!       infolog sv      Du 
m\xE5ste ange ett namn, f\xF6r att skapa en ny typ !!!
 you must enter a subject or a description      infolog sv      Du m\xE5ste 
ange en rubrik eller beskrivning
+

Modified: trunk/inv/setup/phpgw_sv.lang
===================================================================
--- trunk/inv/setup/phpgw_sv.lang       2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/inv/setup/phpgw_sv.lang       2008-02-02 13:52:39 UTC (rev 18466)
@@ -146,3 +146,4 @@
 you have entered an invalid selling date !     inv     sv      Du har angett 
ett f\xF6rs\xE4ljnings ink\xF6psdatum !
 you have no customer selected !        inv     sv      Du har inte valt 
n\xE5gon kund !
 you have selected an invalid main category !   inv     sv      Du har valt en 
felaktig huvudkategori !
+

Modified: trunk/javassh/setup/phpgw_sv.lang
===================================================================
--- trunk/javassh/setup/phpgw_sv.lang   2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/javassh/setup/phpgw_sv.lang   2008-02-02 13:52:39 UTC (rev 18466)
@@ -9,3 +9,4 @@
 protocol       javassh sv      Protokoll
 server javassh sv      Server
 servers        javassh sv      Servrar
+

Modified: trunk/manual/inc/class.help.inc.php
===================================================================
--- trunk/manual/inc/class.help.inc.php 2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/manual/inc/class.help.inc.php 2008-02-02 13:52:39 UTC (rev 18466)
@@ -73,7 +73,7 @@
                        {
                                $this->output = array();
                        }
-                       
$GLOBALS['phpgw']->xslttpl->add_file($GLOBALS['phpgw']->common->get_tpl_dir('manual','base')
 . SEP . 'help');
+                       
$GLOBALS['phpgw']->xslttpl->add_file($GLOBALS['phpgw']->common->get_tpl_dir('manual','base')
 . '/help');
                }
 
                /*
@@ -109,8 +109,8 @@
                {
                        if ($this->app_name)
                        {
-                               
$GLOBALS['phpgw']->xslttpl->add_file($GLOBALS['phpgw']->common->get_tpl_dir('manual','base')
 . SEP . 'help_data');
-               //              
$GLOBALS['phpgw']->xslttpl->add_file($GLOBALS['phpgw']->common->get_tpl_dir($this->app_name,'base')
 . SEP . 'help_data');
+                               
$GLOBALS['phpgw']->xslttpl->add_file($GLOBALS['phpgw']->common->get_tpl_dir('manual','base')
 . '/help_data');
+               //              
$GLOBALS['phpgw']->xslttpl->add_file($GLOBALS['phpgw']->common->get_tpl_dir($this->app_name,'base')
 . '/help_data');
                        }
                }
 

Modified: trunk/manual/inc/class.odt2xhtml.inc.php
===================================================================
--- trunk/manual/inc/class.odt2xhtml.inc.php    2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/manual/inc/class.odt2xhtml.inc.php    2008-02-02 13:52:39 UTC (rev 
18466)
@@ -67,8 +67,8 @@
                public function oo_convert($xml)
                {
                        $xls = new DOMDocument;
-                       $xls->load(PHPGW_SERVER_ROOT . SEP . 'manual' . SEP . 
'templates' . SEP . 'base' . SEP . 'odt2html.xsl');
-               //      $xls->load(PHPGW_SERVER_ROOT . SEP . 'manual' . SEP . 
'templates' . SEP . 'base' . SEP . 'odt2xhtml.xsl');
+                       $xls->load(PHPGW_SERVER_ROOT . 
'/manual/templates/base/odt2html.xsl');
+               //      $xls->load(PHPGW_SERVER_ROOT . 
'/manual/templates/base/odt2xhtml.xsl');
                //      $xls->load('xslt/export/xhtml/ooo2xhtml.xsl');
                //      $xls->load('template.xsl');
                        $xslt = new XSLTProcessor;

Modified: trunk/manual/inc/class.uimanual.inc.php
===================================================================
--- trunk/manual/inc/class.uimanual.inc.php     2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/manual/inc/class.uimanual.inc.php     2008-02-02 13:52:39 UTC (rev 
18466)
@@ -27,11 +27,12 @@
 
                var $public_functions = array
                (
-                       'index'  => True,
-                       'help'  => True
+                       'index'                 => true,
+                       'help'                  => true,
+                       'attrib_help'   => true
                );
 
-               function manual_uimanual()
+               public function __construct()
                {
                        $GLOBALS['phpgw']->help = 
CreateObject('manual.help_helper');
                }
@@ -39,7 +40,7 @@
                function index()
                {
 //                     $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       $this->currentapp               = 
get_var('app',array('POST','GET'));
+                       $this->currentapp               = phpgw::get_var('app');
 
                        if (!$this->currentapp || $this->currentapp == 'manual')
                        {
@@ -68,40 +69,33 @@
                function help()
                {
                        $odt2xhtml      = CreateObject('manual.odt2xhtml');
-                       $app = get_var('app',array('GET'));
-                       $section = get_var('section',array('GET'));
+                       $app = phpgw::get_var('app', 'string', 'GET');
+                       $section = phpgw::get_var('section', 'string', 'GET');
 
                        if(!$section)
                        {
-                               $referer = parse_url($_SERVER['HTTP_REFERER']);
+                               $referer = 
parse_url(phpgw::get_var('HTTP_REFERER', 'string', 'SERVER') );
                                parse_str($referer['query']);
 
                                if(isset($menuaction) && $menuaction)
                                {
-                                       list($app_from_referer,$class,$method) 
= explode('.',$menuaction);
-                                       if(strpos($class,'ui')== 0 )
+                                       list($app_from_referer, $class, 
$method) = explode('.',$menuaction);
+                                       if ( strpos($class, 'ui') === 0 )
                                        {
-                                               $class = ltrim($class,'ui');
+                                               $class = ltrim($class, 'ui');
                                        }
-                                       $section = $class . '.' . $method;
+                                       $section = "{$class}.{$method}";
                                }
                        }       
 
                        if(!$app)
                        {
-                               if(isset($app_from_referer) && 
$app_from_referer)
-                               {
-                                       $app = $app_from_referer;
-                               }
-                               else
-                               {
-                                       $app = 'manual';
-                               }
+                               $app = isset($app_from_referer) && 
$app_from_referer ? $app_from_referer : 'manual';
                        }
 
-                       $section        = $section?$section:'overview';
-                       $lang           = 
isset($GLOBALS['phpgw_info']['user']['preferences']['common']['lang']) && 
$GLOBALS['phpgw_info']['user']['preferences']['common']['lang'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['common']['lang']: 'en';
-                       $navbar = get_var('navbar',array('GET'));
+                       $section        = $section ? $section : 'overview';
+                       $lang           = 
strtoupper(isset($GLOBALS['phpgw_info']['user']['preferences']['common']['lang'])
 && $GLOBALS['phpgw_info']['user']['preferences']['common']['lang'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['common']['lang']: 'en');
+                       $navbar         = phpgw::get_var('navbar', 'string', 
'GET');
 
                        $GLOBALS['phpgw_info']['flags']['app_header'] = $app . 
'::' . lang($section);
                        $GLOBALS['phpgw']->common->phpgw_header();
@@ -113,7 +107,7 @@
                                parse_navbar();
                        }
                                
-                       $odtfile = PHPGW_SERVER_ROOT . SEP . $app . SEP . 
'help' . SEP . strtoupper($lang) . SEP . $section . '.odt';
+                       $odtfile = PHPGW_SERVER_ROOT . 
"/{$app}/help/{$lang}/{$section}.odt";
 
                        if(is_file($odtfile))
                        {
@@ -121,11 +115,41 @@
                        }
                        else
                        {
-                               echo '<h2 align = "center">Missing manual 
entry</h2>'; // fix this to a proper message
+                               $error = lang('Invalid or missing manual entry 
requested, please contact your system administrator');
+                               echo <<<HTML
+                                       <div class="err">$error</div>
+
+HTML;
                        }
                        
                        $GLOBALS['phpgw']->common->phpgw_footer();
 
                }
+
+               function attrib_help()
+               {
+                       $t =& $GLOBALS['phpgw']->template;
+                       $t->set_root(PHPGW_APP_TPL);
+
+                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = false;
+                       $GLOBALS['phpgw_info']['flags']['nofooter'] = True;
+
+                       $appname        = phpgw::get_var('appname');
+                       $location       = phpgw::get_var('location');
+                       $id                     = phpgw::get_var('id', 'int');
+
+                       $custom         = 
createObject('phpgwapi.custom_fields');
+                       
+                       $attrib_data    = $custom->get_attrib_single($appname, 
$location, $id);
+
+                       $function_msg   = lang('Help');
+
+                       $t->set_file('help','help.tpl');
+                       $t->set_var('title',lang('Help') . ' - "' . 
$attrib_data['input_text'] . '"');
+                       $t->set_var('help_msg',$attrib_data['helpmsg'] );
+                       $t->set_var('lang_close',lang('close') );
+                                                                               
        
+                       $GLOBALS['phpgw']->common->phpgw_header();
+                       $t->pfp('out','help');
+               }
        }
-?>

Modified: trunk/manual/setup/phpgw_sv.lang
===================================================================
--- trunk/manual/setup/phpgw_sv.lang    2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/manual/setup/phpgw_sv.lang    2008-02-02 13:52:39 UTC (rev 18466)
@@ -9,3 +9,4 @@
 settings       manual  sv      Inst\xE4llningar
 user manual    common  sv      Anv\xE4ndarmanual
 viewing        manual  sv      Visning
+

Added: trunk/manual/templates/base/css/base.css
===================================================================
--- trunk/manual/templates/base/css/base.css                            (rev 0)
+++ trunk/manual/templates/base/css/base.css    2008-02-02 13:52:39 UTC (rev 
18466)
@@ -0,0 +1,12 @@
+/*placeholder for the css*/
+
+.P1
+{
+
+}
+/*     
+       font-weight: bold;
+       font-size: 14px;
+       text-decoration: none;
+       text-decoration: underline;
+*/

Added: trunk/manual/templates/base/help.tpl
===================================================================
--- trunk/manual/templates/base/help.tpl                                (rev 0)
+++ trunk/manual/templates/base/help.tpl        2008-02-02 13:52:39 UTC (rev 
18466)
@@ -0,0 +1,22 @@
+<!-- BEGIN help.tpl -->
+<script type="text/javascript">
+       //<![CDATA[
+
+       //]]>
+</script>
+
+<h2>{title}</h2>
+<table>
+       <tr>
+               <td>
+                       {help_msg}
+               </td>
+       </tr>
+</table>
+<p align="center"><a href="javascript:this.window.close()">{lang_close}</a></p>
+
+</body>
+</html>
+
+
+<!-- END help.tpl -->

Modified: trunk/mediadb/setup/phpgw_sv.lang
===================================================================
--- trunk/mediadb/setup/phpgw_sv.lang   2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/mediadb/setup/phpgw_sv.lang   2008-02-02 13:52:39 UTC (rev 18466)
@@ -1 +1,2 @@
 first page     common  sv      f\xF6rsta sidan
+

Modified: trunk/messenger/inc/class.somessenger_sql.inc.php
===================================================================
--- trunk/messenger/inc/class.somessenger_sql.inc.php   2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/messenger/inc/class.somessenger_sql.inc.php   2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -12,7 +12,7 @@
        *  option) any later version.                                           
   *
        
\**************************************************************************/
 
-       /* $Id$ */
+       /* $Id: class.somessenger_sql.inc.php 690 2008-02-02 10:11:33Z dave $ */
 
        class somessenger extends somessenger_
        {

Modified: trunk/messenger/inc/hook_config.inc.php
===================================================================
--- trunk/messenger/inc/hook_config.inc.php     2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/messenger/inc/hook_config.inc.php     2008-02-02 13:52:39 UTC (rev 
18466)
@@ -15,7 +15,7 @@
 *  option) any later version.                                              *
 \**************************************************************************/
 
-       /* $Id$ */
+       /* $Id: hook_config.inc.php 690 2008-02-02 10:11:33Z dave $ */
 
        function restrict_to_group($config)
        {

Modified: trunk/messenger/setup/phpgw_sv.lang
===================================================================
--- trunk/messenger/setup/phpgw_sv.lang 2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/messenger/setup/phpgw_sv.lang 2008-02-02 13:52:39 UTC (rev 18466)
@@ -33,3 +33,4 @@
 you have no messages   messenger       sv      Du har inga meddelanden
 you must enter a subject       messenger       sv      Du måste ange en rubrik
 you must enter the username this message is for        messenger       sv      
Du måste ange användarnamnet som meddelandet ska skickas till
+

Modified: trunk/news_admin/setup/phpgw_sv.lang
===================================================================
--- trunk/news_admin/setup/phpgw_sv.lang        2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/news_admin/setup/phpgw_sv.lang        2008-02-02 13:52:39 UTC (rev 
18466)
@@ -47,3 +47,4 @@
 webpage news admin     news_admin      sv      Webside nyhetsadmin
 write  news_admin      sv      Skriv
 write permissions      news_admin      sv      Skrivr\xE4ttigheter
+

Modified: trunk/nntp/setup/phpgw_sv.lang
===================================================================
--- trunk/nntp/setup/phpgw_sv.lang      2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/nntp/setup/phpgw_sv.lang      2008-02-02 13:52:39 UTC (rev 18466)
@@ -33,3 +33,4 @@
 threads        nntp    sv      Tr\xE5dar
 to     nntp    sv      till
 update nntp    sv      Uppdatera
+

Added: trunk/notes/inc/class.menu.inc.php
===================================================================
--- trunk/notes/inc/class.menu.inc.php                          (rev 0)
+++ trunk/notes/inc/class.menu.inc.php  2008-02-02 13:52:39 UTC (rev 18466)
@@ -0,0 +1,109 @@
+<?php
+       /**
+        * notes - Menus
+        *
+        * @author Dave Hall <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 notes 
+        * @version $Id: class.menu.inc.php 690 2008-02-02 10:11:33Z dave $
+        */
+
+       /*
+          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/>.
+        */
+
+
+       /**
+        * Menus
+        *
+        * @package notes
+        */     
+       class notes_menu
+       {
+               /**
+                * Get the menus for the notes
+                *
+                * @return array available menus for the current user
+                */
+               function get_menu()
+               {
+                       $menus = array();
+
+                       $menus['navbar'] = array
+                       (
+                               'notes' => array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('notes', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'notes.uinotes.index') ),
+                                       'image' => array('notes', 'navbar'),
+                                       'order' => 8,
+                                       'group' => 'office'
+                               )
+                       );
+
+                       $menus['toolbar'] = array
+                       (
+                               array
+                               (
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'notes.uinotes.edit')),
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('New', array(), true),
+                                       'image' => array('notes', 'new')
+                               )
+
+                       );
+
+                       if ( 
isset($GLOBALS['phpgw_info']['user']['apps']['admin']) )
+                       {
+                               $menus['admin'] = array
+                               (
+                                       array
+                                       (
+                                               'text'  => 'Global Categories',
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.uicategories.index', 'appname' => 'notes', 'global_cats' => 'true') )
+                                       )
+                               );
+                       }
+
+                       if ( 
isset($GLOBALS['phpgw_info']['user']['apps']['preferences']) )
+                       {
+                               $menus['preferences'] = array
+                               (
+                                       array
+                                       (
+                                               'text'  => 'Grant Access',
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'preferences.uiadmin_acl.aclprefs', 'acl_app' => 'notes'))
+                                       ),
+                                       array
+                                       (
+                                               'text'  => 'Edit categories',
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>'preferences.uicategories.index',
 'cats_app' => 'notes', 'cats_level' => true, 'global_cats' => true))
+                                       )
+                               );
+                       }
+
+                       $menus['navigation'] = array
+                       (
+                               array
+                               (
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'notes.uinotes.edit')),
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('New', array(), true),
+                                       'image' => array('notes', 'new')
+                               )
+                       );
+                       $menus['folders'] = 
phpgwapi_menu::get_categories('notes');
+
+                       return $menus;
+               }
+       }

Modified: trunk/notes/setup/phpgw_sv.lang
===================================================================
--- trunk/notes/setup/phpgw_sv.lang     2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/notes/setup/phpgw_sv.lang     2008-02-02 13:52:39 UTC (rev 18466)
@@ -27,3 +27,4 @@
 verdana        notes   sv      Verdana
 very large     notes   sv      V\xE4ldigt stor
 very small     notes   sv      V\xE4ldigt liten
+

Modified: trunk/notes/setup/setup.inc.php
===================================================================
--- trunk/notes/setup/setup.inc.php     2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/notes/setup/setup.inc.php     2008-02-02 13:52:39 UTC (rev 18466)
@@ -55,8 +55,7 @@
                'add_def_pref',
                'deleteaccount',
                'help',
-               'preferences',
-               'admin'
+               'menu'  => 'notes.menu.get_menu'
        );
 
        /* Dependencies for this app to work */

Modified: trunk/pbwebmaui/setup/phpgw_en.lang
===================================================================
--- trunk/pbwebmaui/setup/phpgw_en.lang 2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/pbwebmaui/setup/phpgw_en.lang 2008-02-02 13:52:39 UTC (rev 18466)
@@ -37,11 +37,11 @@
 Mailfilter Menu        pbwebmaui       en      Mailfilter Menu
 mail filter    pbwebmaui       en      mail filter
 mail redirect to recipient     pbwebmaui       en      mail redirect to 
recipient
-Mailaccount spool directory    pbwebmaui       en      Mailaccount spool 
directory     pbwebmaui
+Mailaccount spool directory    pbwebmaui       en      Mailaccount spool 
directory
 Maildomain Menu        pbwebmaui       en      Maildomain Menu
 maildrops      pbwebmaui       en      maildrops
 Maildrops Menu pbwebmaui       en      Maildrops Menu
-Mailserver Type        admin   en      Mailserver Type admin
+Mailserver Type        admin   en      Mailserver Type
 message        pbwebmaui       en      message
 move mail in the folder        pbwebmaui       en      move mail in the folder
 New Mail Account       pbwebmaui       en      New Mail Account
@@ -65,7 +65,7 @@
 Synchronize Groups     pbwebmaui       en      Synchronize Groups
 text file      pbwebmaui       en      text file
 until  pbwebmaui       en      until
-select address pbwebmaui       de      select address
-Generate Out of Office Message calendar        de      Generate Out of Office 
Message
-forward to     calendar        de      Forward to
-select address calendar        de      select address
\ No newline at end of file
+select address pbwebmaui       en      select address
+Generate Out of Office Message calendar        en      Generate Out of Office 
Message
+forward to     calendar        en      Forward to
+select address calendar        en      select address

Modified: trunk/phonelog/setup/phpgw_sv.lang
===================================================================
--- trunk/phonelog/setup/phpgw_sv.lang  2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/phonelog/setup/phpgw_sv.lang  2008-02-02 13:52:39 UTC (rev 18466)
@@ -7,3 +7,4 @@
 date called    phonelog        sv      datum f\xF6r samtal
 phone log - add        phonelog        sv      telefonlogg - l\xE4gg till
 summary        phonelog        sv      summering telefonlogg
+

Modified: trunk/phpbrain/inc/class.uikb.inc.php
===================================================================
--- trunk/phpbrain/inc/class.uikb.inc.php       2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/phpbrain/inc/class.uikb.inc.php       2008-02-02 13:52:39 UTC (rev 
18466)
@@ -1892,7 +1892,7 @@
                                $num_main_cat ++;
                                $categories_str .= "<tr><td valign=top>";
                                if ($cat['icon'])
-                                               $categories_str .= "<img src='" 
. $GLOBALS['phpgw_info']['server']['webserver_url'] . SEP . 'phpgwapi' . SEP . 
'images' . SEP . $cat['icon'] . "'>";
+                                               $categories_str .= "<img 
src=\"{$GLOBALS['phpgw_info']['server']['webserver_url']}/phpgwapi/images/cats/{$cat['icon']}\">";
                                $categories_str .= "</td><td><a 
href='".$this->link('menuaction=phpbrain.uikb.index&cat='.$cat['id'])
                                                                                
."'><b>".$cat['name']."</b></a><br><div style='padding-left:10px'>";
                                $has_subcats = False;

Modified: trunk/phpbrain/setup/phpgw_sv.lang
===================================================================
--- trunk/phpbrain/setup/phpgw_sv.lang  2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/phpbrain/setup/phpgw_sv.lang  2008-02-02 13:52:39 UTC (rev 18466)
@@ -187,3 +187,4 @@
 your message could not be sent!        phpbrain        sv      Meddelandet 
kunde inte skickas
 your question will be posted, but only will be published after approval by a 
user with publishing rights       phpbrain        sv      Din fr\xE5ga kommer 
att skickas, men kommer bara att publiceras n\xE4r n\xE5gon med beh\xF6righet 
att publicera v\xE4ljer att g\xF6ra det.
 your question will be published immediately    phpbrain        sv      Din 
fr\xE5ga kommer att publiceras omedelbart
+

Modified: trunk/phpgroupware/about.php
===================================================================
--- trunk/phpgroupware/about.php        2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/phpgroupware/about.php        2008-02-02 13:52:39 UTC (rev 18466)
@@ -19,7 +19,21 @@
        */
        include_once('header.inc.php');
 
-       $app = $_GET['app'];
+       $app = phpgw::get_var('app', 'string', 'get');
+       switch ( $app )
+       {
+               case 'about':
+               case 'admin':
+               case 'home':
+               case 'preferences':
+               case '':
+                       $app = $app_title = 'phpGroupWare';
+                       break;
+
+               default:
+                       $app_title = lang($app);
+       }
+
        if ($app)
        {
                if (!($included = 
$GLOBALS['phpgw']->hooks->single('about',$app)))

Added: trunk/phpgroupware/doc/tools/remove_OIDs_from_postgresql.txt
===================================================================
--- trunk/phpgroupware/doc/tools/remove_OIDs_from_postgresql.txt                
                (rev 0)
+++ trunk/phpgroupware/doc/tools/remove_OIDs_from_postgresql.txt        
2008-02-02 13:52:39 UTC (rev 18466)
@@ -0,0 +1,9 @@
+/*For removing OID from postgresql > 8.1
+*/
+
+$tables = $this->db->table_names();
+_debug_array($tables);
+foreach($tables as $table)
+{
+       $this->db->query("ALTER TABLE $table SET WITHOUT OIDS");
+}

Modified: trunk/phpgroupware/home.php
===================================================================
--- trunk/phpgroupware/home.php 2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/phpgroupware/home.php 2008-02-02 13:52:39 UTC (rev 18466)
@@ -122,7 +122,7 @@
                }
 
                $GLOBALS['phpgw']->translation->add_app('mainscreen');
-               if (lang('mainscreen_message') != 'mainscreen_message*')
+               if (lang('mainscreen_message') != '!mainscreen_message')
                {
                        echo '<div class="msg">' . 
stripslashes(lang('mainscreen_message')) . '</div>';
                }

Modified: trunk/phpgroupware/index.php
===================================================================
--- trunk/phpgroupware/index.php        2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/phpgroupware/index.php        2008-02-02 13:52:39 UTC (rev 18466)
@@ -18,6 +18,7 @@
 
        /**
        * @global string $GLOBALS['sessionid']
+       * @internal FIXME this is ugly and probably not needed - skwashd jan08
        */
        $GLOBALS['sessionid'] = isset($_REQUEST['sessionid'])? 
$_REQUEST['sessionid'] : '';
 
@@ -83,7 +84,7 @@
                {
                        Header('Content-Type: text/javascript');
                        $return_data = $GLOBALS[$class]->$method();
-                       echo execMethod('phpgwapi.Services_JSON.encode', 
$return_data);
+                       echo json_encode($return_data);
                        $GLOBALS['phpgw_info']['flags']['nofooter'] = true;
                        $GLOBALS['phpgw']->common->phpgw_exit();
                }

Modified: trunk/phpgroupware/login.php
===================================================================
--- trunk/phpgroupware/login.php        2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/phpgroupware/login.php        2008-02-02 13:52:39 UTC (rev 18466)
@@ -178,4 +178,3 @@
        }
 
        $uilogin->phpgw_display_login($variables);
-?>

Modified: trunk/phpgroupware/logout.php
===================================================================
--- trunk/phpgroupware/logout.php       2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/phpgroupware/logout.php       2008-02-02 13:52:39 UTC (rev 18466)
@@ -25,26 +25,28 @@
        */
        include_once('header.inc.php');
 
-       $GLOBALS['sessionid'] = phpgw::get_var('sessionid', 'string', 'any');
-       $GLOBALS['kp3']       = phpgw::get_var('kp3', 'string', 'any');
+       $sessionid = phpgw::get_var('sessionid');
+       $kp3       = phpgw::get_var('kp3');
 
        $verified = $GLOBALS['phpgw']->session->verify();
        if ($verified)
        {
-               if (file_exists($GLOBALS['phpgw_info']['server']['temp_dir'] . 
SEP . $GLOBALS['sessionid']))
+               if ( 
is_dir("{$GLOBALS['phpgw_info']['server']['temp_dir']}/{$sessionid}") )
                {
-                       $dh = 
opendir($GLOBALS['phpgw_info']['server']['temp_dir'] . SEP . 
$GLOBALS['sessionid']);
-                       while ($file = readdir($dh))
+                       $dh = 
dir("{$GLOBALS['phpgw_info']['server']['temp_dir']}/{$sessionid}");
+                       while ( ($file = $dh->read()) !== false )
                        {
-                               if ($file != '.' && $file != '..')
+                               if ( $file == '.' || $file == '..' )
                                {
-                                       
unlink($GLOBALS['phpgw_info']['server']['temp_dir'] . SEP . 
$GLOBALS['sessionid'] . SEP . $file);
+                                       continue;
                                }
+                               
unlink("{$GLOBALS['phpgw_info']['server']['temp_dir']}/{$sessionid}/{$file}");
                        }
-                       rmdir($GLOBALS['phpgw_info']['server']['temp_dir'] . 
SEP . $GLOBALS['sessionid']);
+                       
rmdir("{$GLOBALS['phpgw_info']['server']['temp_dir']}/{$sessionid}");
+                       $dh->close();
                }
                $GLOBALS['phpgw']->hooks->process('logout');
-               
$GLOBALS['phpgw']->session->destroy($GLOBALS['sessionid'],$GLOBALS['kp3']);
+               $GLOBALS['phpgw']->session->destroy($sessionid,$kp3);
        }
        else
        {
@@ -66,4 +68,3 @@
        }
 
        
$GLOBALS['phpgw']->redirect($GLOBALS['phpgw_info']['server']['webserver_url'].'/login.php?cd=1');
-?>

Added: trunk/phpgwapi/doc/class.menu.txt
===================================================================
--- trunk/phpgwapi/doc/class.menu.txt                           (rev 0)
+++ trunk/phpgwapi/doc/class.menu.txt   2008-02-02 13:52:39 UTC (rev 18466)
@@ -0,0 +1,122 @@
+<?php
+       /**
+        * <<APP>> - Menus
+        *
+        * @author Dave Hall <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 <<APP>> 
+        * @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/>.
+        */
+
+/*
+//////////////////////////////////////////////////////////////////////////////////
+
+       This is an example stub menu class, you will need to read it in order
+       to understand how to use the new menu API.
+
+       Here is a quick start guide
+               * <module> is the name of your phpGW module
+               * copy this file to <module>/inc/class.menu.inc.php
+               * run find and replace :%s/<<APP>>/<module>/g
+               * edit <module>/setup/setup.inc.php and make sure it has a hook 
entry 
+                       for the menu, something like this should do it for you
+                       $setup_info['<module>']['hooks']['menu'] = 
'<module>.menu.get_menu';
+               * edit the class to suit your requirements
+               * Remove this comment block
+
+\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
+*/
+
+
+       /**
+        * Menus
+        *
+        * @package <<APP>>
+        */     
+       class <<APP>>_menu
+       {
+               /**
+                * Get the menus for the <<APP>>
+                *
+                * @return array available menus for the current user
+                */
+               function get_menu()
+               {
+                       /* The base array which holds all the menus */
+                       $menus = array();
+
+                       /*
+                               This gives you entries on the navigation bar, 
you can use multiple entries
+                               order values less than 20 are reserved for the 
API and core modules
+                       */
+                       $menus['navbar'] = array
+                       (
+                               '<<APP>>' => array
+                               (
+                                       'text'  => lang('<<APP>>'),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'<<APP>>.ui<<APP>>.index') ),
+                                       'image' => array('<<APP>>', 'navbar'),
+                                       'order' => 25, // must be greater than 
19
+                                       'group' => 'office' // which collection 
of apps does it belong in, if in doubt ask on the dev list
+                               )
+                       );
+
+                       /*
+                               This should be rendered as a toolbar when your 
module is being used by a user
+                       */
+                       $menus['toolbar'] = array();
+
+                       if ( 
isset($GLOBALS['phpgw_info']['user']['apps']['admin']) )
+                       {
+                               /*
+                                       These items are available to users with 
access to the admin module
+                                               - they are grouped by module
+                               */
+                               $menus['admin'] = array();
+                       }
+
+                       if ( 
isset($GLOBALS['phpgw_info']['user']['apps']['preferences']) )
+                       {
+                               /*
+                                       These items are available to users with 
access to the preferences module 
+                                               - they are grouped by module
+                               */
+                               $menus['preferences'] = array();
+
+                               $menus['toolbar'][] = array
+                               (
+                                       'text'  => lang('Preferences'),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/preferences/preferences.php', array('appname'      => 
'<<APP>>')),
+                                       'image' => array('<<APP>>', 
'preferences')
+                               );
+                       }
+
+                       /*
+                               These items are used by the navigation menu, 
this is rendered differently by different template sets
+                       */
+                       $menus['navigation'] = array();
+
+                       /*
+                               OPTIONAL This is used by the folders view - not 
implemented in all template sets 
+                       */
+                       $menus['folders'] = 
phpgwapi_menu::get_categories('<<APP>>');
+
+                       return $menus;
+               }
+       }

Modified: trunk/phpgwapi/doc/index.html
===================================================================
--- trunk/phpgwapi/doc/index.html       2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/phpgwapi/doc/index.html       2008-02-02 13:52:39 UTC (rev 18466)
@@ -659,9 +659,6 @@
 $GLOBALS['phpgw_info']['server']['template_dir'] = Active template files 
directory. 
        This is defaulted by the server, and changeable by the user. 
 
-$GLOBALS['phpgw_info']['server']['dir_separator'] = Allows compatibility with 
WindowsNT directory format 
-       - same as php constant SEP
-
 $GLOBALS['phpgw_info']['server']['encrpytkey'] = Key used for encryption 
functions
 
 $GLOBALS['phpgw_info']['server']['site_title'] = Site Title will show in the 
title bar of each webpage.

Modified: trunk/phpgwapi/doc/index.txt
===================================================================
--- trunk/phpgwapi/doc/index.txt        2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/phpgwapi/doc/index.txt        2008-02-02 13:52:39 UTC (rev 18466)
@@ -545,10 +545,6 @@
   directory.
        This is defaulted by the server, and changeable by the user.
 
-  $GLOBALS['phpgw_info']['server']['dir_separator'] = Allows compatibility with
-  WindowsNT directory format
-       - same as php constant SEP
-
   $GLOBALS['phpgw_info']['server']['encrpytkey'] = Key used for encryption
   functions
 

Modified: trunk/phpgwapi/inc/accounts/class.accounts_.inc.php
===================================================================
--- trunk/phpgwapi/inc/accounts/class.accounts_.inc.php 2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/phpgwapi/inc/accounts/class.accounts_.inc.php 2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -196,11 +196,11 @@
        *
        * @package phpgwapi
        * @subpackage accounts
-       * @abstract
        */
-       class accounts_
+       abstract class accounts_
        {
                var $account_id;
+               var $account_lid;
                var $lid;
                var $firstname;
                var $lastname;
@@ -227,21 +227,12 @@
                * @param string $account_type Account type 'u': account; 'g' : 
group; defaults to current account type
                * @internal I might move this to the accounts_shared if it 
stays around
                */
-               function accounts($account_id = null, $account_type = null)
+               function __construct($account_id = null, $account_type = null)
                {
                        $this->db =& $GLOBALS['phpgw']->db;
                        $this->like = $this->db->like;
 
-                       if($account_id != '')
-                       {
-                               $this->account_id = get_account_id($account_id);
-                       }
-
-                       if($account_type != '')
-                       {
-                               $this->account_type = $account_type;
-                       }
-
+                       // FIXME move me to a proper instance variable
                        $this->xmlrpc_methods[] = array(
                                'name'        => 'get_list',
                                'description' => 'Returns a list of accounts 
and/or groups'
@@ -254,8 +245,23 @@
                                'name'        => 'id2name',
                                'description' => 'Cross reference account_id 
with account_lid'
                        );
+
+                       $this->set_account($account_id, $account_type);
                }
 
+               public function set_account($account_id = null, $account_type = 
null)
+               {
+                       if ( !is_null($account_id) )
+                       {
+                               $this->account_id = get_account_id($account_id);
+                       }
+
+                       if( !is_null($account_type))
+                       {
+                               $this->account_type = $account_type;
+                       }
+               }
+
                function sync_accounts_contacts()
                {
                        $accounts = $this->get_account_without_contact();
@@ -287,6 +293,7 @@
 
                function save_contact_for_account($userData)
                {
+                       
                        $owner = 
$GLOBALS['phpgw_info']['server']['addressmaster'];
                        $contacts = createObject('phpgwapi.contacts');
                        $type = $contacts->search_contact_type('Persons');
@@ -313,10 +320,12 @@
                                                {
                                                                
$domain=$GLOBALS['phpgw_info']['server']['mail_server'];
                                                }
+
+
                                                if($domain)//Attempts to grab 
domain succeded
                                                {
-                                                               
$comm['comm_descr']=$contacts->search_comm_descr('work email');
-                                                               
$comm['comm_data']=$userData['account_lid'].'@'.$domain;
+                               $comm['comm_descr'] = 
$contacts->search_comm_descr('work email');
+                               $comm['comm_data'] = 
$userData['account_lid'].'@'.$domain;
                                                                
$comm['comm_preferred']='Y';
                                $comms = array($comm);
                                                }
@@ -573,8 +582,7 @@
                        
$GLOBALS['phpgw']->template->set_var('img',$GLOBALS['phpgw']->common->image('phpgwapi','select'));
                        
$GLOBALS['phpgw']->template->set_var('lang_select_user',lang('Select user'));
                        
$GLOBALS['phpgw']->template->set_var('lang_select_group',lang('Select group'));
-                       
$GLOBALS['phpgw']->template->set_var('css_file',$GLOBALS['phpgw_info']['server']['webserver_url']
 . SEP . 'phpgwapi' . SEP . 'templates'
-                                                                               
                                        . SEP . 'idots' . SEP . 'css' . SEP . 
'idots.css');
+                       $GLOBALS['phpgw']->template->set_var('css_file', 
"{$GLOBALS['phpgw_info']['server']['webserver_url']}/phpgwapi/templates/idots/css/idots.css");
 
                        switch($app)
                        {
@@ -873,14 +881,14 @@
                {
                        $this->account_id               = 
isset($data['account_id']) ? (int)$data['account_id'] : $this->account_id;
                        $this->lid                              = 
isset($data['account_lid']) ? $data['account_lid'] : $this->lid;
-                       $this->firstname                = 
$data['account_firstname'] ? $data['account_firstname'] : $this->firstname;
-                       $this->lastname                 = 
$data['account_lastname'] ? $data['account_lastname'] : $this->lastname;
-                       $this->password                 = 
$data['account_passwd'] ? $data['account_passwd'] : $this->password;
-                       $data['account_status'] = !$data['account_status'] ? 
$data['status'] : $data['account_status'];
-                       $this->status                   = 
$data['account_status'] ? $data['account_status'] : $this->status;
-                       $data['account_expires']= !$data['account_expires'] ? 
$data['expires'] : $data['account_expires'];
-                       $this->expires                  = 
$data['account_expires'] ? $data['account_expires'] : $this->expires;
-                       $this->person_id                = $data['person_id'] ? 
$data['person_id'] : $this->person_id;
+                       $this->firstname                = 
isset($data['account_firstname']) ? $data['account_firstname'] : 
$this->firstname;
+                       $this->lastname                 = 
isset($data['account_lastname']) ? $data['account_lastname'] : $this->lastname;
+                       $this->password                 = 
isset($data['account_passwd']) ? $data['account_passwd'] : $this->password;
+                       $data['account_status'] = 
!isset($data['account_status']) ? $data['status'] : $data['account_status'];
+                       $this->status                   = 
isset($data['account_status']) ? $data['account_status'] : $this->status;
+                       $data['account_expires']= 
!isset($data['account_expires']) ? $data['expires'] : $data['account_expires'];
+                       $this->expires                  = 
isset($data['account_expires']) ? $data['account_expires'] : $this->expires;
+                       $this->person_id                = 
isset($data['person_id']) ? $data['person_id'] : $this->person_id;
                        $this->quota                    = isset($data['quota']) 
? (int)$data['quota'] : $this->quota;
                        return true;
                }

Modified: trunk/phpgwapi/inc/accounts/class.accounts_SQLLDAP.inc.php
===================================================================
--- trunk/phpgwapi/inc/accounts/class.accounts_SQLLDAP.inc.php  2008-02-02 
11:18:25 UTC (rev 18465)
+++ trunk/phpgwapi/inc/accounts/class.accounts_SQLLDAP.inc.php  2008-02-02 
13:52:39 UTC (rev 18466)
@@ -25,9 +25,9 @@
        {
                var $LDAPRepository;
                
-               function accounts_SQLLDAP($account_id = null, $account_type = 
null)
+               function __construct($account_id = null, $account_type = null)
                {
-                       parent::accounts_sql($account_id, $account_type);
+                       parent::__construct($account_id, $account_type);
                        include_once(PHPGW_API_INC . 
'/accounts/class.accounts_ldap.inc.php');
                        $this->LDAPRepository = new Accounts_LDAP($account_id, 
$account_type);
                }

Modified: trunk/phpgwapi/inc/accounts/class.accounts_ldap.inc.php
===================================================================
--- trunk/phpgwapi/inc/accounts/class.accounts_ldap.inc.php     2008-02-02 
11:18:25 UTC (rev 18465)
+++ trunk/phpgwapi/inc/accounts/class.accounts_ldap.inc.php     2008-02-02 
13:52:39 UTC (rev 18466)
@@ -67,7 +67,7 @@
                */
                var $fallback_apps = array('addressbook', 'calendar', 'email', 
'notes', 'todo');
 
-               function accounts_ldap($account_id = null, $account_type = null)
+               function __construct($account_id = null, $account_type = null)
                {
                        $this->ds = $GLOBALS['phpgw']->common->ldapConnect();
                        $this->user_context  = 
$GLOBALS['phpgw_info']['server']['ldap_context'];
@@ -466,7 +466,7 @@
                * Convert an id into its corresponding account or group name
                *
                * @param integer $id Account or group id
-               * @return string|boolean Name of the account or the group when 
found othwerwise false
+               * @return string Name of the account or the group when found 
othwerwise empty string
                */
                function id2name($id)
                {
@@ -1391,7 +1391,7 @@
                        {
                                if 
($GLOBALS['phpgw_info']['server']['ldap_account_home'] != '')
                                {
-                                       $return = 
$GLOBALS['phpgw_info']['server']['ldap_account_home'].SEP.$login;
+                                       $return = 
"{$GLOBALS['phpgw_info']['server']['ldap_account_home']}/{$login}";
                                }
                                else
                                {

Modified: trunk/phpgwapi/inc/accounts/class.accounts_sql.inc.php
===================================================================
--- trunk/phpgwapi/inc/accounts/class.accounts_sql.inc.php      2008-02-02 
11:18:25 UTC (rev 18465)
+++ trunk/phpgwapi/inc/accounts/class.accounts_sql.inc.php      2008-02-02 
13:52:39 UTC (rev 18466)
@@ -19,9 +19,9 @@
        */
        class accounts_sql extends accounts_
        {
-               function accounts_sql($account_id = null, $account_type = null)
+               function __construct($account_id = null, $account_type = null)
                {
-                       parent::accounts($account_id, $account_type);
+                       parent::__construct($account_id, $account_type);
                }
 
                function list_methods($_type='xmlrpc')
@@ -244,14 +244,14 @@
                {
                        static $lid_list;
 
-                       (int)$account_id;
+                       $account_id = (int)$account_id;
 
                        if (! $account_id)
                        {
                                return '';
                        }
 
-                       if( isset($lid_list[$account_id]) && 
$id_list[$account_id] ) 
+                       if( isset($lid_list[$account_id]) ) 
                        {
                                return $lid_list[$account_id];
                        }
@@ -269,29 +269,37 @@
                        return $lid_list[$account_id];
                }
 
+               /**
+               * Convert an id into its corresponding account or group name
+               *
+               * @param integer $id Account or group id
+               * @param bool $only_lid only return the account_lid for the 
user, should not be used when output is displayed to other users
+               * @return string Name of the account or the group when found 
othwerwise empty string
+               */
                function id2name($account_id)
                {
                        static $id_list;
 
+                       $account_id = (int) $account_id;
+
                        if (! $account_id)
                        {
-                               return False;
+                               return '';
                        }
 
-                       if( isset($id_list[$account_id]) && 
$id_list[$account_id] ) 
+                       if( isset($id_list[$account_id]) ) 
                        {
                                return $id_list[$account_id];
                        }
 
-                       $this->db->query('SELECT account_lid, 
account_firstname, account_lastname FROM phpgw_accounts WHERE account_id=' . 
intval($account_id),__LINE__,__FILE__);
-                       if($this->db->num_rows())
+                       $this->db->query("SELECT account_lid, 
account_firstname, account_lastname FROM phpgw_accounts WHERE 
account_id={$account_id}", __LINE__, __FILE__);
+                       if($this->db->next_record())
                        {
-                               $this->db->next_record();
                                $id_list[$account_id] = 
$GLOBALS['phpgw']->common->display_fullname($this->db->f('account_lid'), 
$this->db->f('account_firstname'), $this->db->f('account_lastname') );
                        }
                        else
                        {
-                               $id_list[$account_id] = False;
+                               $id_list[$account_id] = '';
                        }
                        return $id_list[$account_id];
                }
@@ -417,6 +425,10 @@
                        $this->set_data($account_info, $default_prefs);
                        $this->db->transaction_begin();
                        
+                       $person_id = 0;
+                       if ( $account_info['account_type'] == 'u' )
+                       {
+                               // FIXME this should use the contacts classes 
via this->save_contact_for_account
                        $values= array
                        (
                                -3,
@@ -430,25 +442,29 @@
                                . "VALUES ($values)",__LINE__,__FILE__);
                        $person_id = 
$this->db->get_last_insert_id('phpgw_contact','contact_id');
 
+                               $ts = time();
                        $values= array
                        (
                                $person_id,
                                $this->db->db_addslashes($this->firstname),
                                $this->db->db_addslashes($this->lastname),
                                ((isset($this->status) && $this->status == 'A') 
? 'Y':'N'),
-                               time(),
-                               0,
-                               time(),
-                               0       
+                                       $ts,
+                                       -3,
+                                       $ts,
+                                       -3      
                        );
 
                        $values = $this->db->validate_insert($values);
 
                        $this->db->query("INSERT INTO phpgw_contact_person 
(person_id,first_name,last_name,active,created_on,created_by,modified_on,modified_by)
 "
                                . "VALUES ($values)",__LINE__,__FILE__);
+                       }
 
 
-                       $fields = array('account_lid',
+                       $fields = array
+                       (
+                               'account_lid',
                                                        'account_type',
                                                        'account_pwd',
                                                        'account_firstname',
@@ -458,15 +474,17 @@
                                                        'person_id',
                                                        'account_quota'
                                                   );
-                       $values = 
array("'".$this->db->db_addslashes($this->lid)."'",
+                       $values = array
+                       (
+                               "'".$this->db->db_addslashes($this->lid)."'",
                                                        
"'".$this->db->db_addslashes($account_info['account_type'])."'",
                                                        
"'".md5($this->password)."'",
                                                        
"'".$this->db->db_addslashes($this->firstname)."'",
                                                        
"'".$this->db->db_addslashes($this->lastname)."'",
                                                        
"'".$this->db->db_addslashes($this->status)."'",
-                                                       intval($this->expires),
-                                                       intval($person_id),
-                                                       intval($this->quota)
+                               (int) $this->expires,
+                               (int) $person_id,
+                               (int) $this->quota
                                                   );
                        if((int)$this->account_id && 
!$this->exists((int)$this->account_id))
                        {
@@ -474,8 +492,7 @@
                                $values[] = (int)$this->account_id;
                        }
                        $this->db->query('INSERT INTO phpgw_accounts 
('.implode($fields, ',').') '.
-                                                                               
                 'VALUES ('.implode($values, ',').')',
-                                                        __LINE__,__FILE__);
+                                                       'VALUES 
('.implode($values, ',').')',  __LINE__, __FILE__);
 
                        $account_info['account_id'] = 
$this->db->get_last_insert_id('phpgw_accounts','account_id');
                        $this->db->transaction_commit();

Modified: trunk/phpgwapi/inc/adodb/drivers/adodb-postgres64.inc.php
===================================================================
--- trunk/phpgwapi/inc/adodb/drivers/adodb-postgres64.inc.php   2008-02-02 
11:18:25 UTC (rev 18465)
+++ trunk/phpgwapi/inc/adodb/drivers/adodb-postgres64.inc.php   2008-02-02 
13:52:39 UTC (rev 18466)
@@ -237,6 +237,10 @@
        function qstr($s,$magic_quotes=false)
        {
                if (!$magic_quotes) {
+                       // FIXME this is a hack until we get something better - 
skwashd feb08
+                       return  "'".pg_escape_string($s)."'";
+                       // end hack
+
                        if (ADODB_PHPVER >= 0x5200) {
                                return  
"'".pg_escape_string($this->_connectionID,$s)."'";
                        } 

Modified: trunk/phpgwapi/inc/class.Template.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.Template.inc.php   2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/phpgwapi/inc/class.Template.inc.php   2008-02-02 13:52:39 UTC (rev 
18466)
@@ -184,26 +184,31 @@
         * @access    public
         * @return    boolean
         */
-       function set_root($root, $attempt = 0)
+       function set_root($root = null, $attempt = 0)
        {
-               if ( empty($root) )
+               if ( is_null($root) )
                {
                        $root = PHPGW_APP_TPL;
                }
 
-               if (!is_dir($root) && $attempt == 1 )
+               if ( !is_dir($root) )
                {
+                       if ( $attempt == 1 )
+               {
                        $this->halt("set_root: $root is not a directory.");
                        return false;
                }
-               elseif ( !is_dir($root) )
+                       else
                {
-                       $this->set_root(substr($root, 0, (0 - 
strlen($GLOBALS['phpgw_info']['server']['template_set']))) . 'base', 1);
+                               $new_root = 
preg_replace("/\/{$GLOBALS['phpgw_info']['server']['template_set']}\$/", 
'/base', $root);
+                               $this->set_root($new_root, 1);
+                       }
                }
 
                $this->root = $root;
 
-               if ($this->debug & 4) {
+               if ($this->debug & 4)
+               {
                        echo "<p><b>set_root:</b> root = $root</p>\n";
                }
 
@@ -866,8 +871,8 @@
                        }
                        else
                        {
-                               $new_root = substr($root, 0, (0 - 
strlen($GLOBALS['phpgw_info']['server']['template_set']))) . 'base';
-                               $new_filename = 
$this->filename(str_replace($root.'/','',$new_filename), $new_root, 1);
+                               $new_root = 
preg_replace("/\/templates\/{$GLOBALS['phpgw_info']['server']['template_set']}\$/",
 '/templates/base', $root);
+                               $new_filename = $this->filename($filename, 
$new_root, 1);
                        }
                }
                return $new_filename;

Modified: trunk/phpgwapi/inc/class.applications.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.applications.inc.php       2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/phpgwapi/inc/class.applications.inc.php       2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -16,32 +16,34 @@
        * @package phpgwapi
        * @subpackage application
        */
-       class applications
+       class phpgwapi_applications
        {
-               var $account_id;
-               var $data = array();
-               var $db;
-               var $public_functions = array(
+               private $account_id;
+               private $data = array();
+               private $db;
+               public $public_functions = array
+               (
                        'list_methods' => True,
                        'read'         => True
                );
-               var $xmlrpc_methods = array();
 
-
                /**
                * Standard constructor for setting $account_id
                *
                * @param integer $account_id Account id
                */
-               function applications($account_id = '')
+               public function __construct($account_id = '')
                {
                        $this->db =& $GLOBALS['phpgw']->db;
+                       $this->set_account_id($account_id);
+               }
+
+               /**
+               * Set the user's id
+               */
+               public function set_account_id($account_id)
+               {
                        $this->account_id = get_account_id($account_id);
-
-                       $this->xmlrpc_methods[] = array(
-                               'name'        => 'read',
-                               'description' => 'Return a list of applications 
the current user has access to'
-                       );
                }
 
                /**
@@ -53,7 +55,7 @@
                * in which case the input might be an array.  The server always 
calls
                * this function to fill the server dispatch map using a string.
                */
-               function list_methods($_type='xmlrpc')
+               function list_methods($_type = 'xmlrpc')
                {
                        if (is_array($_type))
                        {
@@ -62,21 +64,26 @@
                        switch($_type)
                        {
                                case 'xmlrpc':
-                                       $xml_functions = array(
-                                               'read' => array(
+                                       $xml_functions = array
+                                       (
+                                               'read' => array
+                                               (
                                                        'function'  => 'read',
                                                        'signature' => 
array(array(xmlrpcStruct)),
                                                        'docstring' => 
lang('Returns struct of users application access')
                                                ),
-                                               'list_methods' => array(
+                                               'list_methods' => array
+                                               (
                                                        'function'  => 
'list_methods',
-                                                       'signature' => 
array(array(xmlrpcStruct,xmlrpcString)),
+                                                       'signature' => 
array(array(xmlrpcStruct, xmlrpcString)),
                                                        'docstring' => 
lang('Read this list of methods.')
                                                )
                                        );
                                        return $xml_functions;
+                               /* SOAP disabled - no instance variable
                                case 'soap':
                                        return $this->soap_functions;
+                               */
                                default:
                                        return array();
                        }
@@ -112,8 +119,9 @@
                                $check = isset($apps[$app['name']]) ? 
$apps[$app['name']] : False;
                                if ($check)
                                {
-                                       $this->data[$app['name']] = array(
-                                               'title'   => 
$GLOBALS['phpgw_info']['apps'][$app['name']]['title'],
+                                       $this->data[$app['name']] = array
+                                       (
+                                               'title'   => lang($app['name']),
                                                'name'    => $app['name'],
                                                'enabled' => True,
                                                'status'  => 
$GLOBALS['phpgw_info']['apps'][$app['name']]['status'],
@@ -121,7 +129,6 @@
                                        );
                                } 
                        }
-                       reset($this->data);
                        return $this->data;
                }
 
@@ -136,7 +143,6 @@
                        {
                                $this->read_repository();
                        }
-                       reset($this->data);
                        return $this->data;
                }
 
@@ -150,12 +156,13 @@
                {
                        if(is_array($apps))
                        {
-                               while($app = each($apps))
+                               foreach ( $apps as $app )
                                {
-                                       $this->data[$app[1]] = array(
-                                               'title'   => 
$GLOBALS['phpgw_info']['apps'][$app[1]]['title'],
+                                       $this->data[$app[1]] = array
+                                       (
+                                               'title'   => lang($app[1]),
                                                'name'    => $app[1],
-                                               'enabled' => True,
+                                               'enabled' => true,
                                                'status'  => 
$GLOBALS['phpgw_info']['apps'][$app[1]]['status'],
                                                'id'      => 
$GLOBALS['phpgw_info']['apps'][$app[1]]['id']
                                        );
@@ -163,15 +170,15 @@
                        }
                        else if (is_string($apps))
                        {
-                               $this->data[$apps] = array(
-                                       'title'   => 
$GLOBALS['phpgw_info']['apps'][$apps]['title'],
+                               $this->data[$apps] = array
+                               (
+                                       'title'   => lang($apps),
                                        'name'    => $apps,
-                                       'enabled' => True,
+                                       'enabled' => true,
                                        'status'  => 
$GLOBALS['phpgw_info']['apps'][$apps]['status'],
                                        'id'      => 
$GLOBALS['phpgw_info']['apps'][$apps]['id']
                                );
                        }
-                       reset($this->data);
                        return $this->data;
                }
                
@@ -187,7 +194,6 @@
                        {
                                unset($this->data[$appname]);
                        }
-                       reset($this->data);
                        return $this->data;
                }
                
@@ -199,10 +205,7 @@
                */
                function update_data($data)
                {
-                       reset($data);
-                       $this->data = Array();
                        $this->data = $data;
-                       reset($this->data);
                        return $this->data;
                }
                
@@ -214,16 +217,20 @@
                function save_repository()
                {
                        $num_rows = 
$GLOBALS['phpgw']->acl->delete_repository("%%", 'run', $this->account_id);
-                       reset($this->data);
-                       while($app = each($this->data))
+
+                       if ( !is_array($this->data) || !count($this->data) )
                        {
-                               if(!$this->is_system_enabled($app[0]))
+                               return array();
+                       }
+
+                       foreach ( $this->data as $app )
+                       {
+                               if ( !$this->is_system_enabled($app) )
                                {
                                        continue;
                                }
-                               
$GLOBALS['phpgw']->acl->add_repository($app[0],'run',$this->account_id,1);
+                               $GLOBALS['phpgw']->acl->add_repository($app, 
'run', $this->account_id, 1);
                        }
-                       reset($this->data);
                        return $this->data;
                }
 
@@ -237,7 +244,6 @@
                        {
                                $this->read_repository();
                        }
-                       @reset($this->data);
                        while (list ($key) = each ($this->data))
                        {
                                $app[] = $this->data[$key]['name'];
@@ -261,8 +267,9 @@
                        {
                                if ($this->is_system_enabled($app))
                                {
-                                       $this->data[$app] = array(
-                                               'title'   => 
$GLOBALS['phpgw_info']['apps'][$app]['title'],
+                                       $this->data[$app] = array
+                                       (
+                                               'title'   => lang($app),
                                                'name'    => $app,
                                                'enabled' => true,
                                                'status'  => 
$GLOBALS['phpgw_info']['apps'][$app]['status'],
@@ -287,8 +294,8 @@
                        {
                                
$GLOBALS['phpgw_info']['apps'][$value['app_name']] = array
                                (
-                                       'title'   => $value['app_name'],
                                        'name'    => $value['app_name'],
+                                       'title'   => lang($value['app_name']),
                                        'enabled' => true,
                                        'status'  => $value['app_enabled'],
                                        'id'      => (int) $value['app_id'],
@@ -316,22 +323,20 @@
 
                function id2name($id)
                {
-                       @reset($GLOBALS['phpgw_info']['apps']);
-                       while (list($appname,$app) = 
each($GLOBALS['phpgw_info']['apps']))
+                       $id = (int) $id;
+                       foreach ( $GLOBALS['phpgw_info']['apps'] as $appname => 
$app )
                        {
-                               if(intval($app['id']) == intval($id))
+                               if( $app['id'] == $id )
                                {
-                                       @reset($GLOBALS['phpgw_info']['apps']);
                                        return $appname;
                                }
                        }
-                       @reset($GLOBALS['phpgw_info']['apps']);
                        return '';
                }
                
                function name2id($appname)
                {
-                       if(is_array($GLOBALS['phpgw_info']['apps'][$appname]))
+                       if ( is_array($GLOBALS['phpgw_info']['apps'][$appname]) 
)
                        {
                                return 
$GLOBALS['phpgw_info']['apps'][$appname]['id'];
                        }

Modified: trunk/phpgwapi/inc/class.asyncservice.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.asyncservice.inc.php       2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/phpgwapi/inc/class.asyncservice.inc.php       2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -399,7 +399,6 @@
                                                        
                                                        if ($lang != 
$GLOBALS['phpgw_info']['user']['preferences']['common']['lang'])
                                                        {
-                                                               
unset($GLOBALS['lang']);
                                                                
$GLOBALS['phpgw']->translation->add_app('common');
                                                        }
                                                }

Modified: trunk/phpgwapi/inc/class.calendar_holidays.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.calendar_holidays.inc.php  2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/phpgwapi/inc/class.calendar_holidays.inc.php  2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -6,7 +6,7 @@
  * @license http://www.fsf.org/licenses/lgpl.html GNU Lesser General Public 
License
  * @package phpgwapi
  * @subpackage utilities
- * @version $Id$
+ * @version $Id: class.calendar_holidays.inc.php 682 2008-02-01 12:19:55Z dave 
$
  * @internal Original ANSI-C code (C) 2003 Dipl.-Inform. Kai Hofmann 
<address@hidden>
  * @internal For more about calendar calculations see http://www.datelib.de/
  */

Modified: trunk/phpgwapi/inc/class.categories.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.categories.inc.php 2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/phpgwapi/inc/class.categories.inc.php 2008-02-02 13:52:39 UTC (rev 
18466)
@@ -571,7 +571,7 @@
                                $cats = $this->return_sorted_array(0, false, 
'', '', '',$globals);
                        }
 
-                       
$GLOBALS['phpgw']->xslttpl->add_file($GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','base')
 . SEP . 'categories');
+                       
$GLOBALS['phpgw']->xslttpl->add_file($GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','base')
 . '/categories');
 
                        if($self)
                        {

Modified: trunk/phpgwapi/inc/class.common.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.common.inc.php     2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/phpgwapi/inc/class.common.inc.php     2008-02-02 13:52:39 UTC (rev 
18466)
@@ -29,7 +29,6 @@
                * @var array Debugging info from the API
                */
                var $debug_info;
-               var $found_files;
 
                /**
                * @var array $output array to be converted by XSLT
@@ -44,10 +43,10 @@
                * @param boolean $debug Debug flag
                * @return integer 1 when str2 is newest (bigger version number) 
than str1
                */
-               function cmp_version($str1,$str2,$debug=False)
+               public function cmp_version($str1,$str2,$debug=False)
                {
-                       
ereg("([0-9]+)\.([0-9]+)\.([0-9]+)[a-zA-Z]*([0-9]*)",$str1,$regs);
-                       
ereg("([0-9]+)\.([0-9]+)\.([0-9]+)[a-zA-Z]*([0-9]*)",$str2,$regs2);
+                       
preg_match("/([0-9]+)\.([0-9]+)\.([0-9]+)[a-z]*([0-9]*)/i", $str1, $regs);
+                       
preg_match("/([0-9]+)\.([0-9]+)\.([0-9]+)[a-z]*([0-9]*)/i", $str2, $regs2);
                        if($debug) { echo "<br />$regs[0] - $regs2[0]"; }
 
                        for($i=1;$i<5;++$i)
@@ -76,10 +75,10 @@
                * @param boolean $debug Debug flag
                * @return integer 1 when str2 is newest (bigger version number) 
than str1
                */
-               function cmp_version_long($str1,$str2,$debug=False)
+               public function cmp_version_long($str1,$str2,$debug=False)
                {
-                       
ereg("([0-9]+)\.([0-9]+)\.([0-9]+)[a-zA-Z]*([0-9]*)\.([0-9]*)",$str1,$regs);
-                       
ereg("([0-9]+)\.([0-9]+)\.([0-9]+)[a-zA-Z]*([0-9]*)\.([0-9]*)",$str2,$regs2);
+                       
preg_match("/([0-9]+)\.([0-9]+)\.([0-9]+)[a-z]*([0-9]*)\.([0-9]*)/i", $str1, 
$regs);
+                       
preg_match("/([0-9]+)\.([0-9]+)\.([0-9]+)[a-z]*([0-9]*)\.([0-9]*)/i", $str2, 
$regs2);
                        if($debug) { echo "<br />$regs[0] - $regs2[0]"; }
 
                        for($i=1;$i<6;++$i)
@@ -113,7 +112,7 @@
                * @return string SQL where clause
                * @deprecated Use ACL class instead
                */
-               function sql_search($table, $owner=0 )
+               public function sql_search($table, $owner=0 )
                {
                        echo 'common::sql_search() is a deprecated function - 
use ACL class instead';
                        if (!$owner)
@@ -138,10 +137,10 @@
                *
                * @return array List of installed languages
                */
-               function getInstalledLanguages()
+               public function getInstalledLanguages()
                {
                        $GLOBALS['phpgw']->db->query('select distinct lang from 
phpgw_lang');
-                       while (@$GLOBALS['phpgw']->db->next_record()) 
+                       while ($GLOBALS['phpgw']->db->next_record()) 
                        {
                                
$installedLanguages[$GLOBALS['phpgw']->db->f('lang')] = 
$GLOBALS['phpgw']->db->f('lang');
                        }
@@ -155,10 +154,10 @@
                * Uses HTTP_ACCEPT_LANGUAGE (from the users browser) to find 
out which languages are installed
                * @return string Users preferred language (two character ISO 
code)
                */
-               function getPreferredLanguage()
+               public function getPreferredLanguage()
                {
                        // create a array of languages the user is accepting
-                       $userLanguages = 
explode(',',$_SERVER['HTTP_ACCEPT_LANGUAGE']);
+                       $userLanguages = explode(',', 
phpgw::get_var('HTTP_ACCEPT_LANGUAGE', 'string', 'SERVER'));
                        $supportedLanguages = $this->getInstalledLanguages();
 
                        // find usersupported language
@@ -193,7 +192,7 @@
                * @param string $passwd LDAP password
                * @return resource LDAP link identifier
                */
-               function ldapConnect($host = '', $dn = '', $passwd = '')
+               public function ldapConnect($host = '', $dn = '', $passwd = '')
                {
                        if (! $host)
                        {
@@ -262,7 +261,7 @@
                * @internal There may need to be some cleanup before hand
                * @param boolean $call_footer When true then call footer else 
exit
                */
-               function phpgw_exit($call_footer = False)
+               public function phpgw_exit($call_footer = False)
                {
                        if (!defined('PHPGW_EXIT'))
                        {
@@ -276,19 +275,23 @@
                        exit;
                }
 
-               function phpgw_final()
+               /**
+               * Do some cleaning up before we exit
+               *
+               * @internal called by register_shutdown_function()
+               */
+               public function phpgw_final()
                {
-                       if (!defined('PHPGW_FINAL'))
+                       static $final_called = null;
+                       if ( is_null($final_called) )
                        {
-                               define('PHPGW_FINAL',True);
-
                                // call the asyncservice check_run function if 
it is not explicitly set to cron-only
-                               //
                                if 
(!isset($GLOBALS['phpgw_info']['server']['asyncservice']) || 
!$GLOBALS['phpgw_info']['server']['asyncservice'] )
                                {
-                                       
ExecMethod('phpgwapi.asyncservice.check_run','fallback');
+                                       
ExecMethod('phpgwapi.asyncservice.check_run', 'fallback');
                                }
                                $GLOBALS['phpgw']->db->disconnect();
+                               $final_called = true;
                        }
                }
 
@@ -296,12 +299,11 @@
                * Get random string of size $size
                *
                * @param integer $size Size of random string to return
-               * @return string STring with random generated characters and 
numbers
+               * @return string randomly generated characters
                */
-               function randomstring($size)
+               public function randomstring($size = 20)
                {
                        $s = '';
-                       srand((double)microtime()*1000000);
                        $random_char = 
array('0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f',
                                
'g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v',
                                
'w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L',
@@ -309,17 +311,11 @@
 
                        for ($i=0; $i<$size; ++$i)
                        {
-                               $s .= $random_char[rand(1,61)];
+                               $s .= $random_char[mt_rand(1,61)];
                        }
                        return $s;
                }
 
-
-               function filesystem_separator()
-               {
-                       return filesystem_separator();
-               }
-
                /**
                * This is used for reporting errors in a nice format
                *
@@ -327,20 +323,31 @@
                * @param string $text Heading error text
                * @return string HTML table with error messages or empty string 
when there is no error/s
                */
-               function error_list($errors, $text='Error')
+               public function error_list($errors, $text = 'Error')
                {
-                       if (! is_array($errors))
+                       if ( !is_array($errors) || !count($errors) )
                        {
                                return '';
                        }
 
-                       $html_error = '<h3>' . lang($text) . "</h3>\n"
-                                               . "<ul 
class=\"errors\">\n<ul>\n<li>{$errors[0]}</li>";
-                       for ($i=1; $i<count($errors); ++$i)
+                       $text = lang($text);
+                       $html_error = <<<HTML
+                               <h3>$text</h3>
+                                       <ul>
+
+HTML;
+                       foreach ( $errors as $error )
                        {
-                               $html_error .= "<li>{$errors[$i]}</li>\n";
+                               $html_error .= <<<HTML
+                                               <li>{$error}</li>
+
+HTML;
                        }
-                       return "$html_error</ul>\n";
+                       $html_error .= <<<HTML
+                               </ul>
+
+HTML;
+                       return $html_error;
                }
 
                /**
@@ -352,11 +359,11 @@
                * @param array $extravars URL parameter
                * @deprecated use ACL instead
                */
-               function check_owner($record, $link, $label, $extravars = 
array())
+               public function check_owner($record, $link, $label, $extravars 
= array())
                {
                        echo 'check_owner() is a depreciated function - use ACL 
class instead <br>';
                        $s = '<a href="' . 
$GLOBALS['phpgw']->link($link,$extravars) . '"> ' . lang($label) . ' </a>';
-                       if (ereg('^[0-9]+$',$record))
+                       if ( preg_match('/^[0-9]+$/',$record))
                        {
                                if ($record != 
$GLOBALS['phpgw_info']['user']['account_id'])
                                {
@@ -382,7 +389,7 @@
                * @param string $lastname Lastname
                * @return Fullname
                */
-               function display_fullname($lid = '', $firstname = '', $lastname 
= '')
+               public function display_fullname($lid = '', $firstname = '', 
$lastname = '')
                {
                        if (! $lid && ! $firstname && ! $lastname)
                        {
@@ -433,7 +440,7 @@
                * @param array menu data
                * @returns array menu data
                */
-               function display_mainscreen($appname, $file)
+               public function display_mainscreen($appname, $file)
                {
                        if(is_array($file))
                        {
@@ -470,7 +477,7 @@
                * @param integer $accountid Account id
                * @return string Users fullname
                */
-               function grab_owner_name($accountid = '')
+               public function grab_owner_name($accountid = '')
                {
                        
$GLOBALS['phpgw']->accounts->get_account_name($accountid,$lid,$fname,$lname);
                        return $this->display_fullname($lid,$fname,$lname);
@@ -480,118 +487,33 @@
                * Create tabs
                *
                * @param array $tabs With ($id,$tab) pairs
-               * @param integer $selected Id of selected tab
-               * @param string $fontsize Optional font size
+               * @param integer $selection array key of selected tab
                * @param boolean $lang When true use translation otherwise use 
given label
-               * @param boolean $no_image Do not use an image for the tabs
                * @return string HTML output string
                */
-               function create_tabs($tabs, $selected, $fontsize = '', $lang = 
False, $no_image = True)
+               public function create_tabs($tabs, $selection, $lang = false)
                {
-                       if($no_image)
-                       {
-                               $output_text = "<table style=\"{padding: 0px; 
border-collapse: collapse; width: 100%;}\">\n\t<tr>\n";
-//                             $output_text = "<table style=\"{padding: 0px; 
width: 100%;}\">\n\t<tr>\n";
+                       $output = <<<HTML
+                       <div class="yui-navset">
+                               <ul class="yui-nav">
+
+HTML;
                                foreach($tabs as $id => $tab)
                                {
-                                       $output_text .= "\t\t" . '<th class="';
-                                       $output_text .= ($id != $selected ? 
'in' : '');
-                                       $output_text .= 'activetab">';
-                                       $output_text .= '<a href="' . 
$tab['link'] . '">';
-                                       $output_text .= ($lang ? 
lang($tab['label']) : $tab['label']);
-                                       $output_text .= "</a></th>\n";
-//                                     $output_text .= "<th 
style=\"border-bottom: 1px solid #000000; \">&nbsp;</th>\n";
-                               }
-                               $output_text .= "\t\t" . '<th 
class="tablast">&nbsp;</th>' . "\n"; 
-                               $output_text .= "\t</tr>\n</table>\n";
-                               return $output_text;
+                               $selected = $id == $selection ? ' 
class="selected"' : '';
+                               $label = $lang ? lang($tab['label']) : 
$tab['label'];
+                               $output .= <<<HTML
+                                       <li{$selected}><a 
href="{$tab['link']}"><em>{$label}</em></a></li>
+
+HTML;
                        }
+                       $output .= <<<HTML
+                               </ul>
+                       </div>
                        
-                       $output_text = '<table border="0" cellspacing="0" 
cellpadding="0"><tr>';
+HTML;
+                       return $output;
 
-                       /* This is a php3 workaround */
-                       if(PHPGW_IMAGES_DIR == 'PHPGW_IMAGES_DIR')
-                       {
-                               $ir = 
ExecMethod('phpgwapi.phpgw.common.get_image_path', 'phpgwapi');
-                       }
-                       else
-                       {
-                               $ir = PHPGW_IMAGES_DIR;
-                       }
-
-                       if ($fontsize)
-                       {
-                               $fs  = '<font size="' . $fontsize . '">';
-                               $fse = '</font>';
-                       }
-
-                       $i = 1;
-                       if( !is_array($tabs) )
-                       {
-                               $tabs = array();
-                       }
-                       foreach($tabs as $tabs)
-                       {
-                               if ($tab[0] == $selected)
-                               {
-                                       if ($i == 1)
-                                       {
-                                               $output_text .= '<td 
align="right"><img src="' . $ir . '/tabs-start1.gif" /></td>';
-                                       }
-
-                                       $output_text .= '<td nowrap="nowrap" 
align="left" background="' . $ir . '/tabs-bg1.gif">&nbsp;<strong><a href="'
-                                               . $tab[1]['link'] . '" 
class="tablink">' . $fs . $tab[1]['label']
-                                               . $fse . 
'</a></strong>&nbsp;</td>';
-                                       if ($i == count($tabs))
-                                       {
-                                               $output_text .= '<td 
align="left"><img src="' . $ir . '/tabs-end1.gif" /></td>';
-                                       }
-                                       else
-                                       {
-                                               $output_text .= '<td 
align="left"><img src="' . $ir . '/tabs-sepr.gif" /></td>';
-                                       }
-                               }
-                               else
-                               {
-                                       if ($i == 1)
-                                       {
-                                               $output_text .= '<td 
align="right"><img src="' . $ir . '/tabs-start0.gif" /></td>';
-                                       }
-                                       $output_text .= '<td nowrap="nowrap" 
align="left" background="' . $ir . '/tabs-bg0.gif">&nbsp;<strong><a href="'
-                                               . $tab[1]['link'] . '" 
class="tablink">' . $fs . $tab[1]['label'] . $fse
-                                               . '</a></strong>&nbsp;</td>';
-                                       if (($i + 1) == $selected)
-                                       {
-                                               $output_text .= '<td 
align="left"><img src="' . $ir . '/tabs-sepl.gif" /></td>';
-                                       }
-                                       elseif ($i == $selected || $i != 
count($tabs))
-                                       {
-                                               $output_text .= '<td 
align="left"><img src="' . $ir . '/tabs-sepm.gif" /></td>';
-                                       }
-                                       elseif ($i == count($tabs))
-                                       {
-                                               if ($i == $selected)
-                                               {
-                                                       $output_text .= '<td 
align="left"><img src="' . $ir . '/tabs-end1.gif" /></td>';
-                                               }
-                                               else
-                                               {
-                                                       $output_text .= '<td 
align="left"><img src="' . $ir . '/tabs-end0.gif" /></td>';
-                                               }
-                                       }
-                                       else
-                                       {
-                                               if ($i != count($tabs))
-                                               {
-                                                       $output_text .= '<td 
align="left"><img src="' . $ir . '/tabs-sepr.gif" /></td>';
-                                               }
-                                       }
-                               }
-                               ++$i;
-                               $output_text .= "\n";
-                       }
-                       $output_text .= "</table>\n";
-                       return $output_text;
                }
 
                /**
@@ -600,7 +522,7 @@
                * @param string $appname Name of application defaults to 
$GLOBALS['phpgw_info']['flags']['currentapp']
                * @return string|boolean Application directory or false
                */
-               function get_app_dir($appname = '')
+               public function get_app_dir($appname = '')
                {
                        if ($appname == '')
                        {
@@ -634,7 +556,7 @@
                * @param string $appname Name of application, defaults to 
$GLOBALS['phpgw_info']['flags']['currentapp']
                * @return string|boolean Include directory or false
                */
-               function get_inc_dir($appname = '')
+               public function get_inc_dir($appname = '')
                {
                        if (! $appname)
                        {
@@ -736,7 +658,7 @@
                * @param string $appname application name optional can be 
derived from $GLOBALS['phpgw_info']['flags']['currentapp'];
                * @param string? $layout optional can force the template set to 
a specific layout
                */
-               function get_tpl_dir($appname = '',$layout = '')
+               public function get_tpl_dir($appname = '',$layout = '')
                {
                        if (! $appname)
                        {
@@ -799,7 +721,7 @@
                * @return boolean True when it is an image directory, otherwise 
false.
                * @internal This is just a workaround for idots, better to use 
find_image, which has a fallback on a per image basis to the default dir
                */
-               function is_image_dir($dir)
+               public function is_image_dir($dir)
                {
                        if (address@hidden($dir))
                        {
@@ -825,7 +747,7 @@
                * @param string $appname Application name, defaults to 
$GLOBALS['phpgw_info']['flags']['currentapp']
                * @return string|boolean Image directory of given application 
or false
                */
-               function get_image_dir($appname = '')
+               public function get_image_dir($appname = '')
                {
                        if ($appname == '')
                        {
@@ -859,7 +781,7 @@
                * @param string $appname Appication name, defaults to 
$GLOBALS['phpgw_info']['flags']['currentapp']
                * @return string|boolean Image directory path of given 
application or false
                */
-               function get_image_path($appname = '')
+               public function get_image_path($appname = '')
                {
                        if ($appname == '')
                        {
@@ -888,72 +810,71 @@
                        }
                }
 
-               function find_image($appname,$image)
+               /**
+               * Find an image
+               *
+               * @internal caches look ups for faster response times on 
subsequent searches
+               * @param string $module the module to check first for the image
+               * @param string $image the image to look for - without the 
extension, this is added during the checks
+               * @return string the URL pointing to the image
+               */
+               public static function find_image($module, $image)
                {
-                       if ( !(isset($this->found_files[$appname]) && 
is_array($this->found_files[$appname]) ) )
+                       static $found_files = null;
+                       if ( !isset($found_files[$module]) || 
is_array($found_files[$module]) )
                        {
-                               $imagedir_default       = 
"/{$appname}/templates/base/images";
-                               $imagedir = 
"/{$appname}/templates/{$GLOBALS['phpgw_info']['user']['preferences']['common']['template_set']}/images";
+                               $paths = array
+                               (
+                                       "/{$module}/templates/base/images",
+                                       
"/{$module}/templates/{$GLOBALS['phpgw_info']['user']['preferences']['common']['template_set']}/images"
+                               );
 
-                               if 
(@is_dir(PHPGW_INCLUDE_ROOT.$imagedir_default))
-                               {
-                                       $d = 
dir(PHPGW_INCLUDE_ROOT.$imagedir_default);
-                                       while (false != ($entry = $d->read()))
+                               foreach ( $paths as $path )
                                        {
-                                               if ($entry != '.' && $entry != 
'..')
-                                               {
-                                                       
$this->found_files[$appname][$entry] = $imagedir_default;
-                                               }
-                                       }
-                                       $d->close();
-                               }
-
-                               if (@is_dir(PHPGW_INCLUDE_ROOT.$imagedir))
+                                       if ( is_dir(PHPGW_INCLUDE_ROOT . $path) 
)
                                {
-                                       $d = dir(PHPGW_INCLUDE_ROOT.$imagedir);
+                                               $d = dir(PHPGW_INCLUDE_ROOT . 
$path);
                                        while (false != ($entry = $d->read()))
                                        {
-                                               if ($entry != '.' && $entry != 
'..')
+                                                       if ($entry == '.' || 
$entry == '..')
                                                {
-                                                       
$this->found_files[$appname][$entry] = $imagedir;
+                                                               continue;
                                                }
+                                                       
$found_files[$module][$entry] = $path;
                                        }
                                        $d->close();
                                }
                        }
+                       }
 
-                       if(isset($this->found_files[$appname]["{$image}.png"]))
+                       $exts = array('.png', '.jpg', '');
+                       foreach ( array($module, 'phpgwapi') as $module )
                        {
-                               $imgfile = 
$GLOBALS['phpgw_info']['server']['webserver_url'].$this->found_files[$appname][$image.'.png'].'/'.$image.'.png';
-                       }
-                       
elseif(isset($this->found_files[$appname]["{$image}.jpg"]))
+                               if ( !isset($found_files[$module]) )
                        {
-                               $imgfile = 
$GLOBALS['phpgw_info']['server']['webserver_url'].$this->found_files[$appname][$image.'.jpg'].'/'.$image.'.jpg';
+                                       continue;
                        }
-                       elseif(isset($this->found_files[$appname][$image]))
+                               foreach ( $exts as $ext )
                        {
-                               $imgfile = 
$GLOBALS['phpgw_info']['server']['webserver_url'].$this->found_files[$appname][$image].'/'.$image;
-                       }
-                       
elseif(isset($this->found_files['phpgwapi']["{$image}.png"]))
+                                       if ( 
isset($found_files[$module]["{$image}{$ext}"]) )
                        {
-                               $imgfile = 
$GLOBALS['phpgw_info']['server']['webserver_url'].$this->found_files['phpgwapi'][$image.'.png'].'/'.$image.'.png';
+                                               return 
"{$GLOBALS['phpgw_info']['server']['webserver_url']}{$found_files[$module]["{$image}{$ext}"]}/{$image}{$ext}";
                        }
-                       
elseif(isset($this->found_files['phpgwapi']["{$image}.jpg"]))
-                       {
-                               $imgfile = 
$GLOBALS['phpgw_info']['server']['webserver_url'].$this->found_files['phpgwapi'][$image.'.jpg'].'/'.$image.'.jpg';
                        }
-                       elseif(isset($this->found_files['phpgwapi'][$image]))
-                       {
-                               $imgfile = 
$GLOBALS['phpgw_info']['server']['webserver_url'].$this->found_files['phpgwapi'][$image].'/'.$image;
                        }
-                       else
-                       {
-                               $imgfile = '';
-                       }
-                       return $imgfile;
+                       return '';
                }
 
-               function image($appname, $image='', $ext='', $use_lang=True)
+               /**
+               * Find an individual image
+               *
+               * @param string $module the module the image is for
+               * @param string $image the image to search for
+               * @param string $ext the filename extension of the image - 
should usually be an empty string
+               * @param bool $use_lang use a translated verison of the image
+               * @return string URL to image
+               */
+               public static function image($module, $image = '', $ext = '', 
$use_lang = true)
                {
                        if (!is_array($image))
                        {
@@ -966,7 +887,7 @@
 
                        if ($use_lang)
                        {
-                               while (list(,$img) = each($image))
+                               foreach ( $image as $img )
                                {
                                        $lang_images[] = $img . '_' . 
$GLOBALS['phpgw_info']['user']['preferences']['common']['lang'];
                                        $lang_images[] = $img;
@@ -974,136 +895,46 @@
                                $image = $lang_images;
                        }
                        
-                       $image_found = false;
-                       while (!$image_found && (list(,$img) = each($image)))
+                       foreach ( $image as $img )
                        {
-                               
if(isset($this->found_files[$appname][$img.$ext]))
+                               $image_found = self::find_image($module, 
$img.$ext); 
+                               if ( $image_found )
                                {
-                                       $image_found = 
"{$GLOBALS['phpgw_info']['server']['webserver_url']}{$this->found_files[$appname][$img.$ext]}/{$img}{$ext}";
-                               }
-                               else
-                               {
-                                       $image_found = 
$this->find_image($appname, $img.$ext);
-                               }
-                       }
-                       //echo "image: {" . print_r($image, true) . " 
image_found: {$image_found}<br />\n";
                        return $image_found;
                }
-
-               function image_on($appname,$image,$extension='_on')
-               {
-                       $with_extension = 
$this->image($appname,$image,$extension);
-                       $without_extension = $this->image($appname,$image);
-                       if($with_extension != '')
-                       {
-                               return $with_extension;
                        }
-                       elseif($without_extension != '')
-                       {
-                               return $without_extension;
-                       }
-                       else
-                       {
                                return '';
                        }
-               }
 
-               function navbar()
-               {
-                       $GLOBALS['phpgw_info']['navbar']['home']['title'] = 
'Home';
-                       $GLOBALS['phpgw_info']['navbar']['home']['url']   = 
$GLOBALS['phpgw']->link('/home.php');
-                       $GLOBALS['phpgw_info']['navbar']['home']['icon']  = 
$this->image('phpgwapi',Array('home','nonav'));
-                       $GLOBALS['phpgw_info']['navbar']['home']['icon_hover']  
= $this->image_on('phpgwapi',Array('home','nonav'),'-over');
-
-                       list($first) = 
each($GLOBALS['phpgw_info']['user']['apps']);
-                       if ( 
isset($GLOBALS['phpgw_info']['user']['apps']['admin'])
-                               && 
is_array($GLOBALS['phpgw_info']['user']['apps']['admin']) 
-                               && $first != 'admin')
+               /**
+               * Find an individual "mouse over" image
+               *
+               * @param string $module the module the image is for
+               * @param string $image the image to search for
+               * @param string $ext the extension used to indicate a "mouse 
ob" image
+               * @return string URL to image
+               */
+               public function image_on($appname, $image, $extension = '_on')
                        {
-                               $newarray['admin'] = 
$GLOBALS['phpgw_info']['user']['apps']['admin'];
-                               foreach($GLOBALS['phpgw_info']['user']['apps'] 
as $index => $value)
-                               {
-                                       if($index != 'admin')
-                                       {
-                                               $newarray[$index] = $value;
-                                       }
-                               }
-                               $GLOBALS['phpgw_info']['user']['apps'] = 
$newarray;
-                               reset($GLOBALS['phpgw_info']['user']['apps']);
-                       }
-                       unset($index);
-                       unset($value);
-                       unset($newarray);
-                       
-                       foreach($GLOBALS['phpgw_info']['user']['apps'] as $app 
=> $data)
+                       $with_extension = 
$this->image($appname,$image,$extension);
+                       if ( $with_extension )
                        {
-                               if (is_long($app))
-                               {
-                                       continue;
-                               }
-
-                               if ($app == 'preferences' || 
$GLOBALS['phpgw_info']['apps'][$app]['status'] != 2 && 
$GLOBALS['phpgw_info']['apps'][$app]['status'] != 3)
-                               {
-                                       
$GLOBALS['phpgw_info']['navbar'][$app]['title'] = 
$GLOBALS['phpgw_info']['apps'][$app]['title'];
-                                       
$GLOBALS['phpgw_info']['navbar'][$app]['url']   = $GLOBALS['phpgw']->link('/' . 
$app . '/index.php');
-                                       
$GLOBALS['phpgw_info']['navbar'][$app]['name']  = $app;
-
-                                       if ($app != 
$GLOBALS['phpgw_info']['flags']['currentapp'])
-                                       {
-                                               
$GLOBALS['phpgw_info']['navbar'][$app]['icon']  = 
$this->image($app,Array('navbar','nonav'));
-                                               
$GLOBALS['phpgw_info']['navbar'][$app]['icon_hover']  = 
$this->image_on($app,Array('navbar','nonav'),'-over');
-                                       }
-                                       else
-                                       {
-                                               
$GLOBALS['phpgw_info']['navbar'][$app]['icon']  = 
$this->image_on($app,Array('navbar','nonav'),'-over');
-                                               
$GLOBALS['phpgw_info']['navbar'][$app]['icon_hover']  = 
$this->image($app,Array('navbar','nonav'));
-                                       }
-
-                                       
if($GLOBALS['phpgw_info']['navbar'][$app]['icon'] == '')
-                                       {
-                                               
$GLOBALS['phpgw_info']['navbar'][$app]['icon']  = 
$this->image('phpgwapi','nonav');
-                                       }
-                               }
+                               return $with_extension;
                        }
-                       if ($GLOBALS['phpgw_info']['flags']['currentapp'] == 
'home' || $GLOBALS['phpgw_info']['flags']['currentapp'] == 'preferences' || 
$GLOBALS['phpgw_info']['flags']['currentapp'] == 'about')
-                       {
-                               $app = $app_title = 'phpGroupWare';
-                       }
-                       else
-                       {
-                               $app = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
-                               $app_title = lang($app);
-                       }
 
-                       if 
(isset($GLOBALS['phpgw_info']['user']['apps']['preferences']) 
-                               && 
$GLOBALS['phpgw_info']['user']['apps']['preferences'])       // preferences last
+                       $without_extension = $this->image($appname,$image);
+                       if ( $without_extension )
                        {
-                               $prefs = 
$GLOBALS['phpgw_info']['navbar']['preferences'];
-                               
unset($GLOBALS['phpgw_info']['navbar']['preferences']);
-                               $GLOBALS['phpgw_info']['navbar']['preferences'] 
= $prefs;
+                               return $without_extension;
                        }
 
-                       // We handle this here becuase its special
-                       if(isset($GLOBALS['phpgw_info']['navbar']['manual']))
-                       {
-                               
$GLOBALS['phpgw_info']['navbar']['manual']['url']   = "javascript:openwindow('" 
. $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'manual.uimanual.help', 'app' => 
isset($GLOBALS['phpgw_info']['apps']['manual']['app']) && 
$GLOBALS['phpgw_info']['apps']['manual']['app'] ? 
$GLOBALS['phpgw_info']['apps']['manual']['app'] : $app, 'section' => 
isset($GLOBALS['phpgw_info']['apps']['manual']['section'])?$GLOBALS['phpgw_info']['apps']['manual']['section']:''))
 . "','700','600')";
-                       }
-
-                       $GLOBALS['phpgw_info']['navbar']['about']['title'] = 
lang('About %1', $app_title);
-                       $GLOBALS['phpgw_info']['navbar']['about']['url']   = 
$GLOBALS['phpgw']->link('/about.php', array('app' => $app) );
-                       $GLOBALS['phpgw_info']['navbar']['about']['icon']  = 
$this->image('phpgwapi',Array('about','nonav'));
-                       $GLOBALS['phpgw_info']['navbar']['about']['icon_hover'] 
 = $this->image_on('phpgwapi',Array('about','nonav'),'-over');
-
-                       $GLOBALS['phpgw_info']['navbar']['logout']['title'] = 
'Logout';
-                       $GLOBALS['phpgw_info']['navbar']['logout']['url']   = 
$GLOBALS['phpgw']->link('/logout.php');
-                       $GLOBALS['phpgw_info']['navbar']['logout']['icon']  = 
$this->image('phpgwapi',Array('logout','nonav'));
-                       
$GLOBALS['phpgw_info']['navbar']['logout']['icon_hover']  = 
$this->image_on('phpgwapi',Array('logout','nonav'),'-over');
+                       return '';
                }
 
                /**
                * Load header.inc.php for an application
                */
-               function app_header()
+               public function app_header()
                {
                        if (file_exists(PHPGW_APP_INC . '/header.inc.php'))
                        {
@@ -1114,11 +945,25 @@
                /**
                * Load the phpgw header
                */
-               function phpgw_header($navbar = False)
+               public function phpgw_header($navbar = False)
                {
-                       include(PHPGW_INCLUDE_ROOT . '/phpgwapi/templates/' . 
$GLOBALS['phpgw_info']['server']['template_set'] . '/head.inc.php');
-                       $this->navbar(False);
-                       include(PHPGW_INCLUDE_ROOT . '/phpgwapi/templates/' . 
$GLOBALS['phpgw_info']['server']['template_set'] . '/navbar.inc.php');
+                       // this prevents infinite loops caused by bad code - 
skwashd jan08
+                       static $called = false;
+                       if ( $called )
+                       {
+                               return;
+                       }
+                       $called = true;
+
+                       $tpl_name = 
$GLOBALS['phpgw_info']['server']['template_set'];
+                       if ( !is_dir(PHPGW_INCLUDE_ROOT . 
"/phpgwapi/templates/{$tpl_name}/")
+                               || !is_readable(PHPGW_INCLUDE_ROOT . 
"/phpgwapi/templates/{$tpl_name}/head.inc.php") )
+               {
+                               $tpl_name = 'simple';
+                       }
+
+                       include_once(PHPGW_INCLUDE_ROOT . 
"/phpgwapi/templates/{$tpl_name}/head.inc.php");
+                       include_once(PHPGW_INCLUDE_ROOT . 
"/phpgwapi/templates/{$tpl_name}/navbar.inc.php");
                        if ($navbar)
                        {
                                echo parse_navbar();
@@ -1131,12 +976,15 @@
                        }
                }
 
-               function phpgw_footer()
+               /**
+               * Render the page footer
+               */
+               public function phpgw_footer()
                {
-                       if (!defined('PHPGW_FOOTER'))
+                       static $footer_rendered = false;
+                       if ( !$footer_rendered )
                        {
-                               define('PHPGW_FOOTER',True);
-
+                               $footer_rendered = true;
                                /* used for xslt apps without xslt framework */
                                if ( 
isset($GLOBALS['phpgw_info']['flags']['xslt_app'])
                                        && 
$GLOBALS['phpgw_info']['flags']['xslt_app'] )
@@ -1144,7 +992,8 @@
                                        $GLOBALS['phpgw']->xslttpl->pparse();
                                }
 
-                               if 
(!isset($GLOBALS['phpgw_info']['flags']['nofooter']) || 
!$GLOBALS['phpgw_info']['flags']['nofooter'])
+                               if ( 
!isset($GLOBALS['phpgw_info']['flags']['nofooter']) 
+                                       || 
!$GLOBALS['phpgw_info']['flags']['nofooter'] )
                                {
                                        include(PHPGW_API_INC . 
'/footer.inc.php');
                                }
@@ -1161,7 +1010,7 @@
                * @author Dave Hall skwashd at phpgroupware.org
                * @return string Template including CSS definitions
                */
-               function get_css()
+               public function get_css()
                {
                        $all_css = '';
                        if( isset($GLOBALS['phpgw']->css) && 
is_object($GLOBALS['phpgw']->css) )
@@ -1200,7 +1049,7 @@
                * Backwards compatibility method
                * @see get_javascript
                */
-               function get_java_script()
+               public function get_java_script()
                {
                        return $this->get_javascript();
                }
@@ -1215,7 +1064,7 @@
                * @author Dave Hall skwashd at phpgroupware.org
                * @return string The JavaScript code to include
                */
-               function get_javascript()
+               public function get_javascript()
                {
                        $js = '';
                        if( isset($GLOBALS['phpgw']->js) && 
is_object($GLOBALS['phpgw']->js))
@@ -1248,7 +1097,7 @@
                * @author Dave Hall skwashd at phpgroupware.org
                * @return string the wndow events to be used or empty
                */
-               function get_on_events()
+               public function get_on_events()
                {
                        if(@is_object($GLOBALS['phpgw']->js))
                        {
@@ -1260,10 +1109,16 @@
                        }
                }
 
-               function hex2bin($data)
+               /**
+               * Convert hexadecimal data into binary
+               *
+               * @param string $data hexidecimal data as a string
+               * @return string binary value of $data;
+               */
+               public function hex2bin($data)
                {
                        $len = strlen($data);
-                       return @pack('H' . $len, $data);
+                       return pack('H' . $len, $data);
                }
 
                /**
@@ -1272,7 +1127,7 @@
                * @param string $data Data to be encrypted
                * @return string Encrypted data
                */
-               function encrypt($data)
+               public function encrypt($data)
                {
                        return $GLOBALS['phpgw']->crypto->encrypt($data);
                }
@@ -1282,7 +1137,7 @@
                * @param string $data Data to be decrypted
                * @return string Decrypted data
                */
-               function decrypt($data)
+               public function decrypt($data)
                {
                        return $GLOBALS['phpgw']->crypto->decrypt($data);
                }
@@ -1294,7 +1149,7 @@
                * @param string $random Random seed
                * @return string DES encrypted password
                */
-               function des_cryptpasswd($userpass, $random)
+               public function des_cryptpasswd($userpass, $random)
                {
                        $lcrypt = '{crypt}';
                        $password = crypt($userpass, $random);
@@ -1311,7 +1166,7 @@
                * @param string $random Random seed
                * @return string MD5 encrypted password
                */ 
-               function md5_cryptpasswd($userpass)
+               public function md5_cryptpasswd($userpass)
                {
                        return '{md5}' . base64_encode(pack('H*', 
md5($userpass)));
                }
@@ -1322,7 +1177,7 @@
                * @param string $password Password to encrypt
                * @return Encrypted password or false
                */
-               function encrypt_password($password)
+               public function encrypt_password($password)
                {
                        if 
(strtolower($GLOBALS['phpgw_info']['server']['ldap_encryption_type']) == 'des')
                        {
@@ -1345,7 +1200,7 @@
                * @param integer $app Application id to find current position
                * @return integer Applications position or -1
                */
-               function find_portal_order($app)
+               public function find_portal_order($app)
                {
                        
if(!is_array($GLOBALS['phpgw_info']['user']['preferences']['portal_order']))
                        {
@@ -1371,7 +1226,7 @@
                * @return mixed Result of 
$GLOBALS['phpgw']->session->appsession()
                * @deprecated
                */
-               function appsession($data = '##NOTHING##')
+               public function appsession($data = '##NOTHING##')
                {
                        echo 'common::appsession() is a depreciated function'
                                . " - use session::appsession() instead<br>\n";
@@ -1386,7 +1241,7 @@
                * @param string $format Date format, defaults to user 
preferences
                * @return string Formated date
                */
-               function show_date($t = '', $format = '')
+               public function show_date($t = '', $format = '')
                {
                        if (!$t || (substr(php_uname(), 0, 7) == "Windows" && 
intval($t) <= 0))
                        {
@@ -1420,7 +1275,7 @@
                * @param boolean $add_seperator Use separator, defaults to space
                * @return string Formatted date
                */
-               function 
dateformatorder($yearstr,$monthstr,$daystr,$add_seperator = False)
+               public function 
dateformatorder($yearstr,$monthstr,$daystr,$add_seperator = False)
                {
                        $dateformat = 
strtolower($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
                        $sep = 
substr($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'],1,1);
@@ -1448,7 +1303,7 @@
                * @param integer $sec Second
                * @return string Time formatted as hhmmss with am/pm
                */
-               function formattime($hour, $min = 0, $sec = null)
+               public function formattime($hour, $min = 0, $sec = null)
                {
                        die('use phpgwapi_datetime::format_time()');
                }
@@ -1460,7 +1315,7 @@
                * @param integer $account_id Account id, defaults to 
phpgw_info['user']['account_id']
                * @internal This is not the best place for it, but it needs to 
be shared between Aeromail and SM
                */
-               function create_emailpreferences($prefs='',$accountid='')
+               public function create_emailpreferences($prefs='',$accountid='')
                {
                        return 
$GLOBALS['phpgw']->preferences->create_email_preferences($accountid);
                        // Create the email Message Class if needed
@@ -1491,7 +1346,7 @@
                * @return string HTML string with code check result message
                * @internal This will be moved into the applications area
                */
-               function check_code($code)
+               public function check_code($code)
                {
                        $s = '<br />';
                        switch ($code)
@@ -1585,7 +1440,7 @@
                * @param integer $line Line number of error
                * @param string $file Filename in which the error occured
                */
-               function phpgw_error($error,$line = '', $file = '') 
+               public function phpgw_error($error,$line = '', $file = '') 
                {
                        echo '<p><strong>phpGroupWare internal 
error:</strong><p>'.$error;
                        if ($line)
@@ -1605,7 +1460,7 @@
                *
                * @internal Works on systems with grep only
                */
-               function debug_list_core_functions()
+               public function debug_list_core_functions()
                {
                        echo 'common::debug_list_core_functions() is deprecated 
- no output generated!<br />';
                }
@@ -1618,7 +1473,7 @@
                * @param integer $max Maximum of id range
                * @return integer|boolean Next available id or false
                */
-               function next_id($appname,$min=0,$max=0)
+               public function next_id($appname,$min=0,$max=0)
                {
                        if (!$appname)
                        {
@@ -1662,7 +1517,7 @@
                * @param integer $max Maximum of id range
                * @return integer|boolean Last used id or false
                */
-               function last_id($appname,$min=0,$max=0)
+               public function last_id($appname,$min=0,$max=0)
                {
                        if (!$appname)
                        {
@@ -1702,7 +1557,10 @@
                        }
                }
 
-               function start_xslt_capture()
+               /**
+               * Starts capturing all output so it can be used by the XSLT 
temaplte engine
+               */
+               public function start_xslt_capture()
                {
                        if (!isset($GLOBALS['phpgw_info']['xslt_capture']))
                        {
@@ -1711,10 +1569,14 @@
                        }
                }
 
-               /* Note: need to be run BEFORE exit is called, as buffers get 
flushed automatically before
+               /**
+               * Stops capturing all output and uses it in the XSLT temaplte 
engine by stuffing it 
+               * into an xml node called "body_data"
+               *
+               * @internal Note: need to be run BEFORE exit is called, as 
buffers get flushed automatically before
                 *       any registered shutdown-functions (eg. phpgw_footer) 
gets called
                 */
-               function stop_xslt_capture()
+               public function stop_xslt_capture()
                {
                        if (isset($GLOBALS['phpgw_info']['xslt_capture']))
                        {
@@ -1736,8 +1598,7 @@
                * @param string $base ???
                * @returns ????
                */
-
-               function msgbox($text = '', $type = True, $base = '')
+               public function msgbox($text = '', $type = True, $base = '')
                {
                        if ($text=='' && 
@isset($GLOBALS['phpgw_info']['flags']['msgbox_data']))
                        {
@@ -1749,7 +1610,7 @@
                                return;
                        }
 
-                       
$GLOBALS['phpgw']->xslttpl->add_file($this->get_tpl_dir('phpgwapi','base') . 
SEP . 'msgbox');
+                       
$GLOBALS['phpgw']->xslttpl->add_file($this->get_tpl_dir('phpgwapi','base') . 
'/msgbox');
 
                //      $prev_helper = 
$GLOBALS['phpgw']->translation->translator_helper;
                //      $GLOBALS['phpgw']->translation->translator_helper = '';
@@ -1821,7 +1682,7 @@
                * @returns array for use with msgbox
                */
                
-               function msgbox_data($receipt)
+               public function msgbox_data($receipt)
                {
                        $msgbox_data_error=array();
                        if (isSet($receipt['error']) AND 
is_array($receipt['error']))
@@ -1847,4 +1708,3 @@
                        return $msgbox_data;
                }
        }
-?>

Modified: trunk/phpgwapi/inc/class.crypto.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.crypto.inc.php     2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/phpgwapi/inc/class.crypto.inc.php     2008-02-02 13:52:39 UTC (rev 
18466)
@@ -110,7 +110,7 @@
                                echo '<br>' . time() . ' crypto->encrypt() 
unencrypted data: ---->>>>' . $data . "\n";
                        }
 
-                       if ( $data === '' )
+                       if ( $data === '' || is_null($data) )
                        {
                                // no point in encrypting an empty string
                                return $data;
@@ -179,7 +179,7 @@
                                echo '<br>' . time() . ' crypto->decrypt() 
crypted data: ---->>>>' . $encrypteddata;
                        }
 
-                       if ( $encrypteddata === '' )
+                       if ( $encrypteddata === '' || is_null($encrypteddata) )
                        {
                                // an empty string is always a usless empty 
string
                                return $encrypteddata;

Modified: trunk/phpgwapi/inc/class.custom_fields.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.custom_fields.inc.php      2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/phpgwapi/inc/class.custom_fields.inc.php      2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -92,6 +92,8 @@
                        $this->db           =& $GLOBALS['phpgw']->db; // clone 
to avoid conflict the db in lang-function
                        $this->join                     = $this->db->join;
                        $this->like                     = $this->db->like;
+                       $this->dateformat               = 
phpgwapi_db::date_format();
+                       $this->datetimeformat   = 
phpgwapi_db::datetime_format();
 
                        if($this->appname && $this->location)
                        {
@@ -119,10 +121,11 @@
                /**
                 * Add a custom field/attribute
                 * 
-                * @param array $attirb the field data
+                * @param array $attrib the field data
+                * @param string $attrib_table where to append the attrib
                 * @return int the the new custom field db pk
                 */
-               function add_attrib($attrib)
+               function add_attrib($attrib, $attrib_table = '')
                {
                        $receipt = array();
                        // Checkboxes are only present if ticked, so we declare 
them here to stop errors
@@ -130,10 +133,11 @@
                        $attrib['list'] = isset($attrib['list']) ? 
!!$attrib['list'] : false;
                        $attrib['history'] = isset($attrib['history']) ? 
!!$attrib['history'] : false;
 
-                       $attrib['column_name'] = 
$this->db->db_addslashes($attrib['column_name']);
+                       $attrib['column_name'] = 
$this->db->db_addslashes(strtolower($attrib['column_name']));
                        $attrib['input_text'] = 
$this->db->db_addslashes($attrib['input_text']);
                        $attrib['statustext'] = 
$this->db->db_addslashes($attrib['statustext']);
                        $attrib['default'] =  isset($arrib['default']) ? 
$this->db->db_addslashes($attrib['default']) : '';
+                       $attrib['helpmsg'] = 
$this->db->db_addslashes($attrib['helpmsg']);
 
                        $sql = "SELECT * FROM phpgw_cust_attribute where 
appname='{$attrib['appname']}' AND location='{$attrib['location']}' AND 
column_name = '{$attrib['column_name']}'";
                        $this->db->query($sql,__LINE__,__FILE__);
@@ -146,8 +150,8 @@
                                return $receipt; //no point continuing
                        }
 
-                       $this->db->transaction_begin();
 
+
                        $sql = 'SELECT MAX(attrib_sort) AS max_sort, MAX(id) AS 
current_id FROM phpgw_cust_attribute'
                                        . " WHERE 
appname='{$attrib['appname']}' AND location='{$attrib['location']}'";
                        $this->db->query($sql,__LINE__,__FILE__);
@@ -176,6 +180,8 @@
                                $attrib['search'],
                                $attrib['list'],
                                $attrib['history'],
+                               $attrib['disabled'],
+                               $attrib['helpmsg'],
                                $attrib_sort,
                                $attrib['column_info']['type'],
                                $attrib['column_info']['precision'],
@@ -186,7 +192,11 @@
 
                        $values = $this->db->validate_insert($values);
 
-                       $this->db->query("INSERT INTO phpgw_cust_attribute 
(appname,location,id,column_name, input_text, 
statustext,search,list,history,attrib_sort, 
datatype,precision_,scale,default_value,nullable) "
+                       $this->_init_process();
+
+                       $this->db->transaction_begin();
+
+                       $this->db->query("INSERT INTO phpgw_cust_attribute 
(appname,location,id,column_name, input_text, 
statustext,search,list,history,disabled,helpmsg,attrib_sort, 
datatype,precision_,scale,default_value,nullable) "
                                . "VALUES ($values)",__LINE__,__FILE__);
 
                        $receipt['id']= $attrib['id'];
@@ -206,15 +216,19 @@
                                unset($attrib['column_info']['default']);
                        }
 
+                       if(!$attrib_table)
+                       {
                        $attrib_table = 
$this->get_attrib_table($attrib['appname'],$attrib['location']);
+                       }
 
-                       $this->_init_process();
+                       $this->oProc->m_odb->transaction_begin();
+
+                       
$this->oProc->AddColumn($attrib_table,$attrib['column_name'], 
$attrib['column_info']);
                        
-                       
if($this->oProc->AddColumn($attrib_table,$attrib['column_name'], 
$attrib['column_info']))
+                       if($this->oProc->m_odb->transaction_commit())
                        {
                                $receipt['message'][] = array('msg'     => 
lang('Attribute has been saved')     );
                                $this->db->transaction_commit();
-
                        }
                        else
                        {
@@ -230,6 +244,7 @@
 
                                }
                        }
+
                        return $receipt;
                }
 
@@ -310,21 +325,26 @@
                 * Edit a custom field
                 * 
                 * @param array $attrib the field data
+                * @param string $attrib_table where to edit the attrib
                 * @return int the field db pk
                 */
-               function edit_attrib($attrib)
+               function edit_attrib($attrib, $attrib_table = '')
                {
                        // Checkboxes are only present if ticked, so we declare 
them here to stop errors
                        $attrib['search'] = isset($attrib['search']) ? 
!!$attrib['search'] : false;
                        $attrib['list'] = isset($attrib['list']) ? 
!!$attrib['list'] : false;
                        $attrib['history'] = isset($attrib['history']) ? 
!!$attrib['history'] : false;
                        
+                       if(!$attrib_table)
+                       {
                        $attrib_table = 
$this->get_attrib_table($attrib['appname'],$attrib['location']);
+                       }
                        $choice_table = 'phpgw_cust_choice';
 
                        $attrib['column_name'] = 
$this->db->db_addslashes($attrib['column_name']);
                        $attrib['input_text'] = 
$this->db->db_addslashes($attrib['input_text']);
                        $attrib['statustext'] = 
$this->db->db_addslashes($attrib['statustext']);
+                       $attrib['helpmsg'] = 
$this->db->db_addslashes($attrib['helpmsg']);
                        $attrib['column_info']['default'] = 
$this->db->db_addslashes($attrib['column_info']['default']);
 
                        if($attrib['column_info']['type']=='R' || 
$attrib['column_info']['type']== 'CH' || $attrib['column_info']['type'] =='LB' 
|| $attrib['column_info']['type'] =='AB' || $attrib['column_info']['type'] 
=='VENDOR')
@@ -343,7 +363,7 @@
                        $OldDataType            = $this->db->f('datatype');
                        $OldPrecision           = $this->db->f('precision_');   
                
                        
-//                     $table_def = 
$this->get_table_def($attrib['appname'],$attrib['location']);      
+                       $table_def = $this->get_table_def($attrib_table);       
 
                        $this->db->transaction_begin();
 
@@ -354,18 +374,18 @@
                                'search'                => 
isset($attrib['search']) ? $attrib['search'] : '',
                                'list'                  => 
isset($attrib['list']) ? $attrib['list'] : '',
                                'history'               => 
isset($attrib['history']) ? $attrib['history'] : '',
-                               'nullable'              => 
$attrib['column_info']['nullable'] == False ? 'False' : 'True'
+                               'nullable'              => 
$attrib['column_info']['nullable'] == 'False' ? 'False' : 'True',
+                               'disabled'              => 
isset($attrib['disabled']) ? $attrib['disabled'] : '',
+                               'helpmsg'               => $attrib['helpmsg'],
                        );
 
                        $value_set      = 
$this->db->validate_update($value_set);
 
                        $this->db->query("UPDATE phpgw_cust_attribute set 
$value_set WHERE appname='" . $attrib['appname']. "' AND location='" . 
$attrib['location']. "' AND id=" . $attrib['id'],__LINE__,__FILE__);
 
-                       $this->_init_process();
-                       
                        $this->oProc->m_odb->transaction_begin();
 
-//                     $this->oProc->m_aTables = $table_def;
+                       $this->oProc->m_aTables = $table_def;
 
                        if($OldColumnName !=$attrib['column_name'])
                        {
@@ -491,7 +511,7 @@
                 * @param string $appname the name of the application
                 * @param string $location the name of the location
                 */
-               function get_attribs($appname, $location, $start = 0, $query = 
'', $sort = 'ASC', $order = 'attrib_sort', $allrows = false, $inc_choices = 
false)
+               function get_attribs($appname, $location, $start = 0, $query = 
'', $sort = 'ASC', $order = 'attrib_sort', $allrows = false, $inc_choices = 
false,$filtermethod='')
                {
                        $start          = (int) $start;
                        $query          = $this->db->db_addslashes($query);
@@ -522,7 +542,7 @@
                                $querymethod = " AND 
(phpgw_cust_attribute.column_name $this->like '%$query%' or 
phpgw_cust_attribute.input_text $this->like '%$query%')";
                        }
 
-                       $sql = "FROM phpgw_cust_attribute WHERE 
appname='$appname' AND location = '$location' $querymethod";
+                       $sql = "FROM phpgw_cust_attribute WHERE 
appname='$appname' AND location = '$location' AND custom = 1 $querymethod 
$filtermethod";
 
                        $this->total_records = 0;
                        $this->db->query("SELECT COUNT(id) AS cnt_rec 
$sql",__LINE__,__FILE__);
@@ -546,13 +566,14 @@
                                $attribs[] = array
                                (
                                        'id'                            => 
$this->db->f('id'),
+                                       'attrib_id'                     => 
$this->db->f('id'), // FIXME: for now...
                                        'entity_type'           => 
$this->db->f('type_id'),
                                        'attrib_sort'           => (int) 
$this->db->f('attrib_sort'),
                                        'list'                          => 
$this->db->f('list'),
                                        'lookup_form'           => 
$this->db->f('lookup_form'),
                                        'entity_form'           => 
$this->db->f('entity_form'),
                                        'column_name'           => 
$this->db->f('column_name'),
-                                       'name'                          => 
$this->db->f('input_text', true),
+                                       'name'                          => 
$this->db->f('column_name'),
                                        'size'                          => 
$this->db->f('size'),
                                        'statustext'            => 
$this->db->f('statustext', true),
                                        'input_text'            => 
$this->db->f('input_text', true),
@@ -560,7 +581,12 @@
                                        'datatype'                      => 
$this->db->f('datatype'),
                                        'search'                        => 
$this->db->f('search'),
                                        'trans_datatype'        => 
$this->translate_datatype($this->db->f('datatype')),
-                                       'nullable'                      => 
($this->db->f('nullable') == 'True')
+                                       'nullable'                      => 
($this->db->f('nullable') == 'True'),
+                                       'allow_null'            => 
($this->db->f('nullable') == 'True'), // FIXME: for now...
+                                       'history'                       => 
$this->db->f('history'),
+                                       'disabled'                      => 
$this->db->f('disabled'),
+                                       'helpmsg'                       => 
!!$this->db->f('helpmsg')
+
                                );
                        }
 
@@ -598,6 +624,7 @@
                        if ($this->db->next_record())
                        {
                                $attrib['id']                                   
        = $this->db->f('id');
+                               $attrib['attrib_id']                            
= $this->db->f('id'); // for now...
                                $attrib['column_name']                          
= $this->db->f('column_name');
                                $attrib['input_text']                           
= $this->db->f('input_text', true);
                                $attrib['statustext']                           
= $this->db->f('statustext', true);
@@ -613,6 +640,10 @@
                                $attrib['search']                               
        = $this->db->f('search');
                                $attrib['history']                              
        = $this->db->f('history');
                                $attrib['location']                             
        = $this->db->f('location');
+                               $attrib['nullable']                             
        = ($this->db->f('nullable') == 'True');
+                               $attrib['allow_null']                           
= ($this->db->f('nullable') == 'True'); // FIXME: for now...
+                               $attrib['disabled']                             
        = $this->db->f('disabled');
+                               $attrib['helpmsg']                              
        = stripslashes($this->db->f('helpmsg'));
                                
                                if ( $inc_choices 
                                        && ( $this->db->f('datatype') == 'R' 
@@ -805,8 +836,8 @@
                function resort_custom_function($id, $resort, $appname, 
$location)
                {
                        $resort = $resort == 'down' ? 'down' : 'up';
-                       $appname = $this->db->db_addslashes($this->appname);
-                       $location = $this->db->db_addslashes($this->location);
+                       $appname = $this->db->db_addslashes($appname);
+                       $location = $this->db->db_addslashes($location);
                        $id = (int)$id;
 
                        if(!$location || !$appname)
@@ -852,45 +883,45 @@
 
                function select_custom_function($selected='', $appname)
                {
-
-                       $dir_handle = @opendir(PHPGW_SERVER_ROOT . SEP . 
$appname . SEP . 'inc' . SEP . 'custom');
-                       $i=0; $myfilearray = '';
+                       $dirname = PHPGW_SERVER_ROOT . 
"/{$appname}/inc/custom"; 
+                       $myfilearray = array();
+                       $dir_handle = dir($dirname);
                        if ($dir_handle)
                        {
-                               while ($file = readdir($dir_handle))
+                               while ( ($file = 
$dir_handle->read($dir_handle)) !== false )
                                {
-                                       if ((substr($file, 0, 1) != '.') && 
is_file(PHPGW_SERVER_ROOT . SEP . $appname . SEP . 'inc' . SEP . 'custom' . SEP 
. $file) )
+                                       if ((substr($file, 0, 1) != '.') && 
is_file("{$dirname}/{$file}") )
                                        {
-                                               $myfilearray[$i] = $file;
-                                               $i++;
+                                               $myfilearray[] = $file;
                                        }
                                }
-                               closedir($dir_handle);
+                               $dir_handle->close();
                                sort($myfilearray);
                        }
 
-                       for ($i=0;$i<count($myfilearray);$i++)
+                       $file_list = array();
+                       foreach ( $myfilearray as $myfile )
                        {
-                               $fname = ereg_replace('_',' ',$myfilearray[$i]);
+                               $fname = preg_replace('/_/', ' ', $myfile);
                                $sel_file = '';
-                               if ($myfilearray[$i]==$selected)
+                               if ( $myfile == $selected )
                                {
                                        $sel_file = 'selected';
                                }
 
                                $file_list[] = array
                                (
-                                       'id'            => $myfilearray[$i],
+                                       'id'            => $myfile,
                                        'name'          => $fname,
                                        'selected'      => $sel_file
                                );
                        }
 
-                       for ($i=0;$i<count($file_list);$i++)
+                       foreach ( $file_list as &$file )
                        {
-                               if ($file_list[$i]['selected'] != 'selected')
+                               if ( $file['selected'] != 'selected' )
                                {
-                                       unset($file_list[$i]['selected']);
+                                       unset($file['selected']);
                                }
                        }
 
@@ -942,7 +973,7 @@
                        return 
isset($datatype_precision[$datatype])?$datatype_precision[$datatype]:'';
                }
 
-               function _delete_attrib($location,$appname,$attrib_id)
+               function _delete_attrib($location,$appname,$attrib_id,$table = 
'')
                {
                        $this->_init_process();
                        $this->oProc->m_odb->transaction_begin();
@@ -954,7 +985,10 @@
                        $this->db->next_record();
 
                        $ColumnName             = $this->db->f('column_name');
+                       if(!$table)
+                       {
                        $table = $this->get_attrib_table($appname,$location);
+                       }
 
                        $this->oProc->DropColumn($table,false, $ColumnName);
 
@@ -980,6 +1014,30 @@
                        $this->oProc->m_odb->transaction_commit();
                }
                
+               function get_table_def($table = '', $table_def = array())
+               {
+                       if(!isset($this->oProc) || !is_object($this->oProc))
+                       {
+                               $this->_init_process();
+                               $GLOBALS['phpgw_setup']->oProc = $this->oProc;
+                       }
+
+                       $setup = createobject('phpgwapi.setup_process');
+                       $tableinfo = $setup->sql_to_array($table);
+
+                       $fd = '$fd = array(' . 
str_replace("\t",'',$tableinfo[0]) .');';
+
+                       eval($fd);
+                       $table_def[$table]['fd'] = 
isset($table_def[$table]['fd']) && $table_def[$table]['fd'] ? 
$table_def[$table]['fd'] + $fd : $fd;
+                       $table_def[$table]['pk'] = 
isset($table_def[$table]['pk']) && $table_def[$table]['pk'] ? 
$table_def[$table]['pk'] : $tableinfo[1];
+                       $table_def[$table]['fk'] = 
isset($table_def[$table]['fk']) && $table_def[$table]['fk'] ? 
$table_def[$table]['fk'] : $tableinfo[2];              
+                       $table_def[$table]['ix'] = 
isset($table_def[$table]['ix']) && $table_def[$table]['ix'] ? 
$table_def[$table]['ix'] : $tableinfo[3];
+                       $table_def[$table]['uc'] = 
isset($table_def[$table]['uc']) && $table_def[$table]['uc'] ? 
$table_def[$table]['uc'] : $tableinfo[4];
+                       
+//     _debug_array($table_def);
+                       return $table_def;
+               }
+               
                function 
_delete_custom_function($appname,$location,$custom_function_id)
                {
                        $this->db->transaction_begin();
@@ -1003,8 +1061,8 @@
                function _init_process()
                {
                        $this->oProc                            = 
createObject('phpgwapi.schema_proc',$GLOBALS['phpgw_info']['server']['db_type']);
-                       $this->oProc->m_odb                     =& $this->db;
-                       $this->oProc->m_odb->Halt_On_Error      = 'report';
+                       $this->oProc->m_odb                     = 
clone($this->db); // nested transactions
+                       $this->oProc->m_odb->Halt_On_Error      = 'yes';
                }
                
                /**
@@ -1044,8 +1102,12 @@
                 * @return array values and definitions of custom attributes 
prepared for ui
                 */
 
-               function prepare_attributes($values='',$appname, $location)
+               function prepare_attributes($values='',$appname, 
$location,$view_only='')
                {
+                       $contacts               = 
CreateObject('phpgwapi.contacts');
+                       $vendor                 = 
CreateObject('property.soactor');
+                       $vendor->role   = 'vendor';
+
                        $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
 
                        $input_type_array = array(
@@ -1054,13 +1116,15 @@
                                'LB' => 'listbox'
                        );
 
-//_debug_array($values['attributes']);
                        $m=0;
                        for ($i=0;$i<count($values['attributes']);$i++)
                        {
                                $values['attributes'][$i]['datatype_text']      
= $this->translate_datatype($values['attributes'][$i]['datatype']);
+                               $values['attributes'][$i]['help_url']           
= $values['attributes'][$i]['helpmsg'] ? $GLOBALS['phpgw']->link('/index.php', 
array('menuaction'=> 'manual.uimanual.attrib_help', 'appname'=> $appname, 
'location'=> $location, 'id' => $values['attributes'][$i]['id'])): '';
                                if($values['attributes'][$i]['datatype']=='D')
                                {
+                                       if(!$view_only)
+                                       {
                                        if ( !isset($GLOBALS['phpgw']->jscal) 
|| !is_object($GLOBALS['phpgw']->jscal) )
                                        {
                                                $GLOBALS['phpgw']->jscal = 
createObject('phpgwapi.jscalendar');
@@ -1069,6 +1133,7 @@
                                        
$GLOBALS['phpgw']->jscal->add_listener('values_attribute_' . $i);
                                        $values['attributes'][$i]['img_cal']= 
$GLOBALS['phpgw']->common->image('phpgwapi','cal');
                                        
$values['attributes'][$i]['lang_datetitle']= lang('Select date');
+                                       }
 
                                        
if(isset($values['attributes'][$i]['value']) && 
$values['attributes'][$i]['value'])
                                        {
@@ -1076,7 +1141,7 @@
                                                
$values['attributes'][$i]['value']      = 
$GLOBALS['phpgw']->common->show_date($timestamp_date,$dateformat);
                                        }
                                }
-                               if($values['attributes'][$i]['datatype']=='AB')
+                               else 
if($values['attributes'][$i]['datatype']=='AB')
                                {
                                        if($values['attributes'][$i]['value'])
                                        {
@@ -1085,13 +1150,13 @@
                                        }
 
                                        $insert_record_values[] = 
$values['attributes'][$i]['name'];
-                                       $lookup_link            = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilookup.addressbook', 'column'=> 
$values['attributes'][$i]['name']));
+                                       $lookup_link            = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uilookup.addressbook', 'column'=> $values['attributes'][$i]['name']));
 
                                        $lookup_functions[$m]['name'] = 
'lookup_'. $values['attributes'][$i]['name'] .'()';
                                        $lookup_functions[$m]['action'] = 
'Window1=window.open('."'" . $lookup_link ."'" 
.',"Search","width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");';
                                        $m++;
                                }
-/*                             
if($values['attributes'][$i]['datatype']=='VENDOR')
+                               else 
if($values['attributes'][$i]['datatype']=='VENDOR')
                                {
                                        if($values['attributes'][$i]['value'])
                                        {
@@ -1108,14 +1173,13 @@
                                        }
 
                                        $insert_record_values[] = 
$values['attributes'][$i]['name'];
-                                       $lookup_link            = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilookup.vendor', 'column'=> 
$values['attributes'][$i]['name']));
+                                       $lookup_link            = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uilookup.vendor', 'column'=> $values['attributes'][$i]['name']));
 
                                        $lookup_functions[$m]['name'] = 
'lookup_'. $values['attributes'][$i]['name'] .'()';
                                        $lookup_functions[$m]['action'] = 
'Window1=window.open('."'" . $lookup_link ."'" 
.',"Search","width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");';
                                        $m++;
                                }
-*/
-                               
if($values['attributes'][$i]['datatype']=='user')
+                               else 
if($values['attributes'][$i]['datatype']=='user')
                                {
                                        if($values['attributes'][$i]['value'])
                                        {
@@ -1123,14 +1187,13 @@
                                        }
 
                                        $insert_record_values[] = 
$values['attributes'][$i]['name'];
-                                       $lookup_link            = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilookup.phpgw_user', 'column'=> 
$values['attributes'][$i]['name']));
+                                       $lookup_link            = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->appname.'.uilookup.phpgw_user', 'column'=> 
$values['attributes'][$i]['name']));
 
                                        $lookup_functions[$m]['name'] = 
'lookup_'. $values['attributes'][$i]['name'] .'()';
                                        $lookup_functions[$m]['action'] = 
'Window1=window.open('."'" . $lookup_link ."'" 
.',"Search","width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");';
                                        $m++;
                                }
-
-                               if($values['attributes'][$i]['datatype']=='R' 
|| $values['attributes'][$i]['datatype']=='CH' || 
$values['attributes'][$i]['datatype']=='LB')
+                               else 
if($values['attributes'][$i]['datatype']=='R' || 
$values['attributes'][$i]['datatype']=='CH' || 
$values['attributes'][$i]['datatype']=='LB')
                                {
                                        $values['attributes'][$i]['choice']     
= $this->read_attrib_choice($appname, 
$location,$values['attributes'][$i]['id']);
                                        
$input_type=$input_type_array[$values['attributes'][$i]['datatype']];
@@ -1138,8 +1201,24 @@
                                        
if($values['attributes'][$i]['datatype']=='CH')
                                        {
                                                
$values['attributes'][$i]['value']=unserialize($values['attributes'][$i]['value']);
-                                               
$values['attributes'][$i]['choice'] = 
$this->bocommon->select_multi_list_2($values['attributes'][$i]['value'],$values['attributes'][$i]['choice'],$input_type);
 
+                                               if 
(isset($values['attributes'][$i]['choice']) AND 
is_array($values['attributes'][$i]['choice']))
+                                               {
+                                                       
foreach($values['attributes'][$i]['choice'] as &$choice)
+                                                       {
+                                                               
$choice['input_type'] = $input_type;
+                                                               
if(isset($values['attributes'][$i]['value']) && 
is_array($values['attributes'][$i]['value']))
+                                                               {
+                                                                       foreach 
($values['attributes'][$i]['value'] as &$selected)
+                                                                       {
+                                                                               
if($selected == $choice['id'])
+                                                                               
{
+                                                                               
        $choice['checked'] = 'checked';
+                                                                               
}
+                                                                       }
+                                                               }
+                                                       }
+                                               }
                                        }
                                        else
                                        {
@@ -1153,6 +1232,10 @@
                                                }
                                        }
                                }
+                               else if 
($entity['attributes'][$i]['datatype']!='I' && 
$entity['attributes'][$i]['value'])
+                               {
+                                       $entity['attributes'][$i]['value'] = 
stripslashes($entity['attributes'][$i]['value']);
+                               }
 
                                $values['attributes'][$i]['datatype_text'] = 
$this->translate_datatype($values['attributes'][$i]['datatype']);
                                $values['attributes'][$i]['counter']    = $i;
@@ -1187,29 +1270,78 @@
                */
                function preserve_attribute_values($values,$values_attribute)
                {
+//_debug_array($values);
+//_debug_array($values_attribute);
                        foreach ( $values_attribute as $key => $attribute )
                        {       
                                for ($i=0;$i<count($values['attributes']);$i++)
                                {
                                        if($values['attributes'][$i]['id'] == 
$attribute['attrib_id'])
                                        {
-                                               
$values['attributes'][$i]['value'] = $attribute['value'];
+                                               if(isset($attribute['value']))
+                                               {
+                                                       
if(is_array($attribute['value']))
+                                                       {
+                                                               
foreach($values['attributes'][$i]['choice'] as &$choice)
+                                                               {
+                                                                       foreach 
($attribute['value'] as &$selected)
+                                                                       {
+                                                                               
if($selected == $choice['id'])
+                                                                               
{
+                                                                               
        $choice['checked'] = 'checked';
+                                                                               
}
+                                                                       }
+                                                               }
+                                                       }
+                                                       else 
if(isset($values['attributes'][$i]['choice']) && 
is_array($values['attributes'][$i]['choice']))
+                                                       {
 
-                                               
if(isset($values['attributes'][$i]['choice']) && 
is_array($values['attributes'][$i]['choice']))
+                                                               foreach 
($values['attributes'][$i]['choice'] as &$choice)
                                                {
-                                                       for 
($j=0;$j<count($values['attributes'][$i]['choice']);$j++)
+                                                                       
if($choice['id'] == $attribute['value'])
                                                        {
-                                                               
if($values['attributes'][$i]['choice'][$j]['id'] == $attribute['value'])
+                                                                               
$choice['checked'] = 'checked'; 
+                                                                       }
+                                                               }
+                                                       }
+                                                       else
                                                                {
-                                                                       
$values['attributes'][$i]['choice'][$j]['checked'] = 'checked'; 
+                                                               
$values['attributes'][$i]['value'] = $attribute['value'];
                                                                }
                                                        }
                                                }
                                        }
                                }
+                       return $values;
                        }
                        
-                       return $values;
+               function convert_attribute_save($values_attribute='')
+               {
+                       if(is_array($values_attribute))
+                       {
+                               foreach ( $values_attribute as &$attrib )
+                               {
+                                       if ( $attrib['datatype'] == 'CH' && 
$attrib['value'] )
+                                       {
+                                               $attrib['value'] = 
serialize($attrib['value'] );
+                                       }
+                                       if ( $attrib['datatype'] == 'R' && 
$attrib['value'] )
+                                       {
+                                               $attrib['value'] = 
$attrib['value'][0];
+                                       }
+
+                                       if ( $attrib['datatype'] == 'N' && 
$attrib['value'] )
+                                       {
+                                               $attrib['value'] = 
str_replace(',', '.', $attrib['value']);
+                                       }
+       
+                                       if ( $attrib['datatype'] == 'D' && 
$attrib['value'] )
+                                       {
+                                               $attrib['value'] = 
date($this->dateformat, phpgwapi_datetime::date_to_timestamp($attrib['value']));
+                                       }
+                               }
+                       }
+                       return $values_attribute;
                }
        }
 ?>

Modified: trunk/phpgwapi/inc/class.datetime.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.datetime.inc.php   2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/phpgwapi/inc/class.datetime.inc.php   2008-02-02 13:52:39 UTC (rev 
18466)
@@ -125,6 +125,11 @@
                        'Su'
                );
 
+               /**
+               * Get the current GMT time as a unixtime stamp
+               *
+               * @return int unixtime stamp
+               */
                public static function gmtnow()
                {
                        static $offset = null;
@@ -143,17 +148,32 @@
                        return time() + $offset;
                }
 
+               /**
+               * Gets the current user's UTC offset in seconds
+               *
+               * @return int offset in seconds
+               */
                public static function user_timezone()
                {
                                return 
isset($GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset']) 
                                        ? (int) 
$GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset'] * 
self::SECONDS_IN_HOUR : 0;
                }
 
+               /**
+               * Get the current user's localtime as a unix timestmap
+               *
+               * @return int unix timestmap
+               */
                public static function user_localtime()
                {
                        return time() + self::user_timezone();
                }
                
+               /**
+               * Get the current server UTC offset using an NTP server
+               *
+               * @return int offset in hours
+               */
                public static function getntpoffset()
                {
                        $error_occured = False;
@@ -187,7 +207,7 @@
                                {
                                        $date = explode('-',$array[1]);
                                        $time = explode(':',$array[2]);
-                                       $gmtnow = 
mktime(intval($time[0]),intval($time[1]),intval($time[2]),intval($date[1]),intval($date[2]),intval($date[0])
 + 2000);
+                                       $gmtnow = mktime((int) $time[0], (int) 
$time[1], (int) $time[2], (int) $date[1], (int) $date[2], (int) $date[0] + 
2000);
                                        print_debug('Temporary RFC 
epoch',$gmtnow,'api');
                                        print_debug('GMT',date('Ymd 
H:i:s',$gmtnow),'api');
                                }
@@ -207,6 +227,11 @@
                        }
                }
 
+               /**
+               * Get the current server UTC offset using a NIST's time 
information webpage
+               *
+               * @return int offset in hours
+               */
                public static function gethttpoffset()
                {
                        $error_occured = false;
@@ -243,6 +268,11 @@
                        return (int) ($server_time - $gmtnow) / 
self::SECONDS_IN_HOUR;
                }
 
+               /**
+               * Get the current server UTC offset using a guess
+               *
+               * @return int offset in hours
+               */
                public static function getbestguess()
                {
                        print_debug('datetime::datetime::debug: Inside getting 
from local server','api');
@@ -327,9 +357,9 @@
 
                        if ( substr($dta[5],0,3) != 'GMT' )
                        {
-                               $tzoffset = substr($dta[5],0,1);
-                               $tzhours = intval(substr($dta[5],1,2));
-                               $tzmins = intval(substr($dta[5],3,2));
+                               $tzoffset = substr($dta[5], 0, 1);
+                               $tzhours = (int) substr($dta[5], 1, 2);
+                               $tzmins = (int) substr($dta[5], 3, 2);
                                switch ($tzoffset)
                                {
                                        case '-':
@@ -345,7 +375,15 @@
                        return 
mktime($ta[0],$ta[1],$ta[2],$month[$dta[2]],$dta[1],$dta[3]);
                }
 
-               function get_weekday_start($year,$month,$day)
+               /**
+               * Get the first day of the current week
+               *
+               * @param int $year the year to check
+               * @param int $month the month to check
+               * @param int $day the day to check
+               * @return int starting weekday
+               */
+               function get_weekday_start($year, $month, $day)
                {
                        $weekday = self::day_of_week($year, $month, $day);
                        
switch($GLOBALS['phpgw_info']['user']['preferences']['calendar']['weekdaystarts'])
@@ -514,7 +552,7 @@
                */
                function days_in_month($month, $year)
                {
-                       return date('t', mktime(13, 0, 0, (int)$month, 1, 
(int)$year) );
+                       return cal_days_in_month(CAL_GREGORIAN, (int) $month, 
(int) $year);
                }
 
                /**
@@ -598,6 +636,18 @@
                        return (mktime(0, 0, 0, $m2, $d2, $y2, 0) - mktime(13, 
0, 0, $m1, $d1, $y1, 0) ) / self::SECONDS_IN_DAY;
                }
 
+               /**
+               * Compare 2 dates
+               *
+               * @internal see http://php.net/strcmp
+               * @param int $a_year the year of the first date
+               * @param int $a_month the month of the first date
+               * @param int $a_day the day of the first date
+               * @param int $b_year the year of the second date
+               * @param int $b_month the month of the second date
+               * @param int $b_day the day of the second date
+               * @return int comparsion result - same as php's native strcmp()
+               */ 
                public static function date_compare($a_year, $a_month, $a_day, 
$b_year, $b_month, $b_day)
                {
                        $a_date = mktime(13, 0, 0, (int)$a_month, (int)$a_day, 
(int)$a_year);
@@ -613,6 +663,18 @@
                        return -1;
                }
 
+               /**
+               * Compare 2 dates
+               *
+               * @internal see http://php.net/strcmp
+               * @param int $a_hour the hour of the first time
+               * @param int $a_minute the minutes of the first time
+               * @param int $a_second the seconds of the first time
+               * @param int $b_hour the hour of the second time
+               * @param int $b_minute the minutes of the second time
+               * @param int $b_second the seconds of the second time
+               * @return int comparsion result - same as php's native strcmp()
+               */
                public static function time_compare($a_hour, $a_minute, 
$a_second, $b_hour, $b_minute, $b_second)
                {
                        // I use the 1970/1/2 to compare the times, as the 1. 
can get via TZ-offest still 
@@ -630,29 +692,52 @@
                        return -1;
                }
 
+               /**
+               * Convert a local date and time to UTC
+               *
+               * @param int $hour the hour to convert
+               * @param int $minute the minute to convert
+               * @param int $second the second to convert
+               * @param int $month the month to convert
+               * @param int $day the day to convert
+               * @oaram int $year the year to convert
+               * @return int the localtime as a UTC unix timestamp
+               */
                public static function 
makegmttime($hour,$minute,$second,$month,$day,$year)
                {
                        return self::gmtdate(mktime($hour, $minute, $second, 
$month, $day, $year));
                }
 
+               /**
+               * Convert a unix timestamp to an array of date information
+               *
+               * @param int $localtime the current user's local time as a unix 
timestamp
+               * @return array date information - keys 'raw', 'day', 'month', 
'year', 'full', 'dow', 'dm' & 'bd'
+               */
                public static function localdates($localtime)
                {
                        $date = Array('raw', 'day', 'month', 'year', 'full', 
'dow', 'dm', 'bd');
                        $date['raw'] = $localtime;
-                       $date['year'] = 
intval($GLOBALS['phpgw']->common->show_date($date['raw'],'Y'));
-                       $date['month'] = 
intval($GLOBALS['phpgw']->common->show_date($date['raw'],'m'));
-                       $date['day'] = 
intval($GLOBALS['phpgw']->common->show_date($date['raw'],'d'));
-                       $date['full'] = 
intval($GLOBALS['phpgw']->common->show_date($date['raw'],'Ymd'));
+                       $date['year'] = (int) 
$GLOBALS['phpgw']->common->show_date($date['raw'],'Y');
+                       $date['month'] = (int) 
$GLOBALS['phpgw']->common->show_date($date['raw'],'m');
+                       $date['day'] = (int) 
$GLOBALS['phpgw']->common->show_date($date['raw'],'d');
+                       $date['full'] = (int) 
$GLOBALS['phpgw']->common->show_date($date['raw'],'Ymd');
                        $date['bd'] = mktime(13, 0, 0, $date['month'], 
$date['day'], $date['year']);
-                       $date['dm'] = 
intval($GLOBALS['phpgw']->common->show_date($date['raw'],'dm'));
+                       $date['dm'] = (int) 
$GLOBALS['phpgw']->common->show_date($date['raw'],'dm');
                        $date['dow'] = 
self::day_of_week($date['year'],$date['month'],$date['day']);
-                       $date['hour'] = 
intval($GLOBALS['phpgw']->common->show_date($date['raw'],'H'));
-                       $date['minute'] = 
intval($GLOBALS['phpgw']->common->show_date($date['raw'],'i'));
-                       $date['second'] = 
intval($GLOBALS['phpgw']->common->show_date($date['raw'],'s'));
+                       $date['hour'] = (int) 
$GLOBALS['phpgw']->common->show_date($date['raw'],'H');
+                       $date['minute'] = (int) 
$GLOBALS['phpgw']->common->show_date($date['raw'],'i');
+                       $date['second'] = (int) 
$GLOBALS['phpgw']->common->show_date($date['raw'],'s');
                
                        return $date;
                }
 
+               /**
+               * Convert user's current local time to a UTC unix timestamp
+               *
+               * @param int $locatime the user's local time as a unix timestamp
+               * @return int UTC unix timestamp
+               */
                public static function gmtdate($localtime)
                {
                        return self::localdates($localtime - 
self::user_timezone());
@@ -688,41 +773,35 @@
 
                                if($key == 'M')
                                {
-                                       for($j=1; $j <=12; $j++)
-                                       {
-                                               
if(date('M',mktime(0,0,0,$j,1,2000)) == $val)
-                                               {
-                                                       $map_date['m'] = $j;
-                                               }
-                                       }
+                                       $map_date['m'] = 
self::convert_m_to_int($val);
                                }
                                else
                                {
-                                       $map_date[strtolower($key)] = 
intval($val);
+                                       $map_date[strtolower($key)] = (int) 
$val;
                                }
                        }
-                       return date($formatTarget, mktime(0,0,0,$map_date['m'], 
$map_date['d'], $map_date['y']));
+                       return date($formatTarget, mktime(0, 0, 0, 
$map_date['m'], $map_date['d'], $map_date['y']));
                }
 
+               /**
+               * Convert a date string to a unix timestamp
+               *
+               * @param string $datestr the date string to convert - must 
match user's preferred date format
+               * @return int unix timestamp
+               */
                public static function date_array($datestr)
                {
                        $dateformat =& 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
 
-                       $fields = preg_split('/[./-]/',$datestr);
-                       foreach ( preg_split('/[./-]/', $dateformat) as $n => 
$field )
+                       $pattern = '/[\.\/\-]/';
+                       $fields = preg_split($pattern, $datestr);
+                       foreach(preg_split($pattern, $dateformat) as $n => 
$field)
                        {
                                $date[$field] = (int) $fields[$n];
 
                                if ( $field == 'M' )
                                {
-                                       for($i=1; $i <=12; $i++)
-                                       {
-                                               if ( date('M', mktime(0, 0, 0, 
$i, 1, 2000)) == $fields[$n] )
-                                               {
-                                                       $date['m'] = $i;
-                                                       break;
-                                               }
-                                       }
+                                       $date['m'] = 
self::convert_M_to_int($fields[$n]);
                                }
                        }
 
@@ -734,6 +813,12 @@
                        );
                }
 
+               /**
+               * Convert a date araray to a unix timestamp
+               *
+               * @param array $date the date array to convert, must contain 
keys day, month & year
+               * @return int unix timestamp
+               */
                public static function date_to_timestamp($date = array())
                {
                        if ( !count($date) )
@@ -746,6 +831,24 @@
                }
 
                /**
+               * Convert a M month string to an int
+               *
+               * @param string $str abbreviated month name string
+               * @return int the month number - 0 is returned for invalid input
+               */
+               private static function convert_M_to_int($str)
+               {
+                       for($i=1; $i <=12; ++$i)
+                       {
+                               if ( date('M', mktime(0, 0, 0, $i, 1, 2000)) == 
$str )
+                               {
+                                       return $i;
+                               }
+                       }
+                       return 0;
+               }
+
+               /**
                * Get a list of translated day names
                *
                * @return array list of day names

Modified: trunk/phpgwapi/inc/class.db.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.db.inc.php 2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/phpgwapi/inc/class.db.inc.php 2008-02-02 13:52:39 UTC (rev 18466)
@@ -26,7 +26,6 @@
        * 
        * @package phpgwapi
        * @subpackage database
-       * @abstract
        */
        class phpgwapi_db
        {
@@ -86,6 +85,8 @@
                */
                var $auto_stripslashes = false;
                
+               var $resultSet;
+               
                /**
                * Constructor
                * @param string $query query to be executed (optional)
@@ -137,6 +138,11 @@
                */
                private function new_adodb()
                {
+                       $type = $this->Type;
+                       if ( $type == 'mysql' )
+                       {
+                               $type = 'mysqlt';
+                       }
                        $this->adodb = newADOConnection($this->Type);
                        $this->connect();
                         // would be good if one day we just use 
ADODB_FETCH_ASSOC
@@ -203,7 +209,7 @@
                                $this->Password = $Password;
                        }
 
-                       return $this->adodb->connect($this->Host, $this->User, 
$this->Password, $this->Database);
+                       return @$this->adodb->connect($this->Host, $this->User, 
$this->Password, $this->Database);
                }
 
                /**
@@ -231,9 +237,7 @@
                        {
                                return addslashes($str);
                        }
-                       // Sigurd: this is broken for postgres - anyway it 
should probably be adodb->qstr - not adodb->quote
-                       //return substr($this->adodb->quote($str, 
get_magic_quotes_gpc()), 1, -1);
-                       return addslashes($str);
+                       return substr($this->adodb->Quote($str), 1, -1);
                }
 
                /**
@@ -501,20 +505,20 @@
                        $insert_value = array();
                        foreach ( $values as $value )
                        {
-                               if($value || $value === 0)
-                               {
                                        if ( is_numeric($value) )
                                        {
-                                               $insert_value[] = "$value";
+                                       if ( !$value )
+                                       {
+                                               $insert_value[] = 'NULL';
                                        }
                                        else
                                        {
-                                               $insert_value[] = "'$value'";
+                                               $insert_value[] = $value;
                                        }
                                }
                                else
                                {
-                                       $insert_value[] = 'NULL';
+                                       $insert_value[] = "'$value'";
                                }
                        }
                        return implode(",", $insert_value);
@@ -712,6 +716,27 @@
                }
 
                /**
+               * Returns an associate array of foreign keys, or false if not 
supported.
+               *
+               * @param string $table name of table to describe
+               * @param boolean $owner optional, default False. The optional 
schema or owner can be defined in $owner.
+               * @param boolean $upper optional, default False. If $upper is 
true, then the table names (array keys) are upper-cased.
+               * @return array Table meta data
+               */  
+               public function MetaForeignKeys($table = '', $owner=false, 
$upper=false)
+               {
+                       if(!$this->adodb->IsConnected())
+                       {
+                               $this->connect();
+                       }
+                       if(!($return =& $this->adodb->MetaForeignKeys($table, 
$owner, $upper)))
+                       {
+                               $return = array();
+                       }
+                       return $return;
+               }
+
+               /**
                * Error handler
                *
                * @param string $msg error message

Modified: trunk/phpgwapi/inc/class.excelreader.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.excelreader.inc.php        2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/phpgwapi/inc/class.excelreader.inc.php        2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -23,6 +23,6 @@
        /**
        * 
        */
-       require_once(PHPGW_API_INC . SEP . 'excelreader' . SEP . 'reader.php');
+       require_once(PHPGW_API_INC . '/excelreader/reader.php');
 
 ?>

Modified: trunk/phpgwapi/inc/class.gdbutton.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.gdbutton.inc.php   2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/phpgwapi/inc/class.gdbutton.inc.php   2008-02-02 13:52:39 UTC (rev 
18466)
@@ -37,14 +37,14 @@
                        $this->image            = 0;
                        $this->font_size        = 0;
                        $this->font_text        = '';
-                       $this->ttf_font         = PHPGW_SERVER_ROOT . SEP . 
'phpgwapi' . SEP . 'fonts' . SEP . 'FreeSans.ttf';
+                       $this->ttf_font         = PHPGW_SERVER_ROOT . 
'/phpgwapi/fonts/FreeSans.ttf';
                        $this->filename         = '';
 
                        $this->xspace           = 4;
                        $this->yspace           = 4;
 
-                       $this->save_dir         = $_SERVER['DOCUMENT_ROOT'] . 
PHPGW_IMAGES_DIR . SEP;
-                       $this->img_dir          = PHPGW_IMAGES_DIR . SEP;
+                       $this->save_dir         = $_SERVER['DOCUMENT_ROOT'] . 
PHPGW_IMAGES_DIR . '/';
+                       $this->img_dir          = PHPGW_IMAGES_DIR . '/';
                }
 
                function button_init()

Modified: trunk/phpgwapi/inc/class.gdimage.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.gdimage.inc.php    2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/phpgwapi/inc/class.gdimage.inc.php    2008-02-02 13:52:39 UTC (rev 
18466)
@@ -51,8 +51,8 @@
                        $this->hColor = 0;
                        $this->font = 0;
                        $this->type = 'png';                    
-                       $this->temp_dir = PHPGW_SERVER_ROOT . SEP . 'phpgwapi' 
. SEP . 'images' . SEP;
-//                     $this->temp_dir = 
$GLOBALS['phpgw_info']['server']['temp_dir'] . SEP;
+                       $this->temp_dir = PHPGW_SERVER_ROOT . 
'/phpgwapi/images/';
+//                     $this->temp_dir = 
$GLOBALS['phpgw_info']['server']['temp_dir'] . '/';
                }
 
                function check_gd()

Modified: trunk/phpgwapi/inc/class.hooks.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.hooks.inc.php      2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/phpgwapi/inc/class.hooks.inc.php      2008-02-02 13:52:39 UTC (rev 
18466)
@@ -15,15 +15,22 @@
        * @package phpgwapi
        * @subpackage application
        */
-       class hooks
+       class phpgwapi_hooks
        {
                var $found_hooks = Array();
-               var $db = '';
+               var $db = null;
 
-               function hooks($db='')
+               function __construct($db = null)
                {
-                       $this->db = $db ? $db : $GLOBALS['phpgw']->db;  // this 
is to allow setup to set the db
+                       $this->db = !is_null($db) ? $db : 
$GLOBALS['phpgw']->db;        // this is to allow setup to set the db
+                       $this->read();
+               }
 
+               /**
+               * Read all the hooks
+               */
+               public function read()
+               {
                        $this->db->query("SELECT hook_appname, hook_location, 
hook_filename FROM phpgw_hooks",__LINE__,__FILE__);
                        while( $this->db->next_record() )
                        {
@@ -32,6 +39,7 @@
                        //echo '<pre>';
                        //print_r($this->found_hooks);
                        //echo '</pre>';
+                       return $this->found_hooks;
                }
                
                /**
@@ -61,7 +69,7 @@
                        {
                                $results[$appname] = 
$this->single($args,$appname,$no_permission_check);
 
-                               if (!isset($results[$appname])) // happens if 
the methode hook has no return-value
+                               if (!isset($results[$appname])) // happens if 
th methode hook has no return-value
                                {
                                        $results[$appname] = False;
                                }
@@ -77,6 +85,10 @@
                        {
                                $apps = $GLOBALS['phpgw_info']['user']['apps'];
                        }
+
+                       // Run any API hooks first
+                       $results['phpgwapi'] = $this->single($args, 'phpgwapi', 
false);
+
                        if(is_array($apps))
                        {
                                foreach($apps as $app)
@@ -121,7 +133,6 @@
                        {
                                $appname = is_array($args) && 
isset($args['appname']) ? $args['appname'] : 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        }
-                       $SEP = filesystem_separator();
 
                        /* First include the ordered apps hook file */
                        if (isset($this->found_hooks[$appname][$location]) || 
$try_unregistered)
@@ -138,7 +149,7 @@
                                        {
                                                $method = 
'hook_'.$location.'.inc.php';
                                        }
-                                       $f = PHPGW_SERVER_ROOT . $SEP . 
$appname . $SEP . 'inc' . $SEP . $method;
+                                       $f = PHPGW_SERVER_ROOT . 
"/{$appname}/inc/{$method}";
                                        if ( ( 
(isset($GLOBALS['phpgw_info']['user']['apps'][$appname]) && 
$GLOBALS['phpgw_info']['user']['apps'][$appname]) 
                                                        || 
(($no_permission_check || $location == 'config' || $appname == 'phpgwapi') && 
$appname)) 
                                                && file_exists($f) )
@@ -158,7 +169,6 @@
 
                /**
                 * loop through the applications and count the hooks
-               *
                 */
                function count($location)
                {
@@ -174,19 +184,6 @@
                }
                
                /**
-                * currently not being used
-               *
-                */
-               function read()
-               {
-                       //if (!is_array($this->found_hooks))
-                       //{
-                               $this->hooks();
-                       //}
-                       return $this->found_hooks;
-               }
-
-               /**
                 * Register and/or de-register an application's hooks
                *
                 * @param $appname      Application 'name' 
@@ -208,7 +205,7 @@
                        //echo "<p>ADDING hooks for: $appname</p>";
                        foreach($hooks as $key => $hook)
                        {
-                               if (!is_numeric($key))  // new methode-hook
+                               if (!is_numeric($key))  // new method based hook
                                {
                                        $location = $key;
                                        $filename = $hook;
@@ -231,17 +228,19 @@
                 */
                function register_all_hooks()
                {
-                       $SEP = filesystem_separator();
+                       $app_list = array_keys($GLOBALS['phpgw_info']['apps']);
+                       $app_list[] = 'phpgwapi';
                        
-                       foreach($GLOBALS['phpgw_info']['apps'] as $appname => 
$app)
+                       foreach ( $app_list as $appname )
                        {                       
-                               $f = PHPGW_SERVER_ROOT . $SEP . $appname . $SEP 
. 'setup' . $SEP . 'setup.inc.php';
-                               if(@file_exists($f))
+                               $f = PHPGW_SERVER_ROOT . 
"/$appname/setup/setup.inc.php";
+                               if ( file_exists($f) )
                                {
+                                       //DO NOT USE include_once here it 
breaks API hooks - skwashd dec07
                                        include($f);
-                                       
if(isset($setup_info[$appname]['hooks']))
+                                       if ( 
isset($setup_info[$appname]['hooks']) )
                                        {
-                                               
$this->register_hooks($appname,$setup_info[$appname]['hooks']);
+                                               $this->register_hooks($appname, 
$setup_info[$appname]['hooks']);
                                        }
                                }
                        }

Modified: trunk/phpgwapi/inc/class.http_dav_client.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.http_dav_client.inc.php    2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/phpgwapi/inc/class.http_dav_client.inc.php    2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -85,7 +85,7 @@
                                        {
                                                case 'href':
                                                        $string = 
urldecode(trim($c->node_value()));
-                                                       $idx = 
strrpos($string,SEP);
+                                                       $idx = strrpos($string, 
'/');
                                                        if( $idx && ($idx == 
strlen( $string ) - 1 ) )
                                                        {
                                                                $string = 
substr($string, 0, $idx);
@@ -918,11 +918,11 @@
                                        $ret = 
$this->http_client->Unlock($uri,$token);
                                }
                        }
-                       elseif ( isset($this->cached_propfind[$uri.SEP]) )
+                       elseif ( isset($this->cached_propfind["{$uri}/"]) )
                        {
-                               if ( ($ret = $this->cached_propfind[$uri.SEP]) 
== 207 )
+                               if ( ($ret = $this->cached_propfind["{$uri}/"]) 
== 207 )
                                {
-                                       $ret = 
$this->http_client->Unlock($uri.SEP,$token);
+                                       $ret = 
$this->http_client->Unlock("{$uri}/",$token);
                                }
                        }
                        else
@@ -931,9 +931,9 @@
                                {
                                        $this->cached_propfind[$uri] = 207;
                                }
-                               elseif( $ret == 301 && ($ret = 
$this->http_client->Unlock($uri.SEP,$token)) == 204 )
+                               elseif( $ret == 301 && ($ret = 
$this->http_client->Unlock("{$uri}/",$token)) == 204 )
                                {
-                                       $this->cached_propfind[$uri.SEP] = 207;
+                                       $this->cached_propfind["{$uri}/"] = 207;
                                }
                        }
 
@@ -977,11 +977,11 @@
                                        $ret = $this->http_client->Lock($uri, 
'exclusive', 'write', $owner);
                                }
                        }
-                       elseif ( isset($this->cached_propfind[$uri.SEP]) )
+                       elseif ( isset($this->cached_propfind["{$uri}/"]) )
                        {
-                               if ( ($ret = $this->cached_propfind[$uri.SEP]) 
== 207 )
+                               if ( ($ret = $this->cached_propfind["{$uri}/"]) 
== 207 )
                                {
-                                       $ret = 
$this->http_client->Lock($uri.SEP, 'exclusive', 'write', $owner);
+                                       $ret = 
$this->http_client->Lock("{$uri}/", 'exclusive', 'write', $owner);
                                }
                        }
                        else
@@ -991,9 +991,9 @@
                                {
                                        $this->cached_propfind[$uri] = 207;
                                }
-                               elseif ( $ret == 301 && ($ret = 
$this->http_client->Lock($uri.SEP, 'exclusive', 'write', $owner)) == 200)
+                               elseif ( $ret == 301 && ($ret = 
$this->http_client->Lock("{$uri}/", 'exclusive', 'write', $owner)) == 200)
                                {
-                                       $this->cached_propfind[$uri.SEP] = 207;
+                                       $this->cached_propfind["{$uri}/"] = 207;
                                }
                        }
 

Modified: trunk/phpgwapi/inc/class.ipc_.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.ipc_.inc.php       2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/phpgwapi/inc/class.ipc_.inc.php       2008-02-02 13:52:39 UTC (rev 
18466)
@@ -14,14 +14,12 @@
        * Abstract IPC Application class for the IPC Layer
        * @package phpgwapi
        * @subpackage communication
-       * @abstract
        */
-       class ipc_
+       abstract class ipc_
        {
                /**
                * Constructor
                *
-               * @abstract
                * @access public
                */
                function ipc_()
@@ -32,7 +30,6 @@
                /**
                * Add data in a certain mime type format to the application.
                *
-               * @abstract
                * @param   mixed    $data  data for adding to the application, 
the datatype depends on the mime type
                * @param   string   $type  specifies the mime type of the 
passed data
                * @return  integer         id of the added data
@@ -45,7 +42,6 @@
                /**
                * Convert data from a mime type to another.
                *
-               * @abstract
                * @access  public
                * @param   mixed    $data     data for converting, the datatype 
depends on the input mime type
                * @param   string   $typeIn   specifies the input mime type of 
the passed data
@@ -60,7 +56,6 @@
                /**
                * Checks if data for the passed id exists.
                *
-               * @abstract
                * @param   integer  $id  id to check
                * @return  boolean       true if the data with id exist, 
otherwise false
                */
@@ -72,7 +67,6 @@
                /**
                * Get data from the application in a certain mime type format.
                *
-               * @abstract
                * @param   integer  $id    id of data to get from the 
application
                * @param   string   $type  specifies the mime type of the 
returned data
                * @return  mixed           data from application, the datatype 
depends on the passed mime type, false if no data exists for the passed id
@@ -87,7 +81,6 @@
                * The optional lastmod parameter allows a limitations of the 
data id list.
                * The list contains all the id's of the modified data since the 
passed lastmod timestamp.
                *
-               * @abstract
                * @param   integer  $lastmod  last modification time, default 
is -1 and means return all data id's
                * @return  array              list of data id's
                */
@@ -99,7 +92,6 @@
                /**
                * Remove data of the passed id.
                *
-               * @abstract
                * @param   integer  $id  id of data to remove from the 
application
                * @return  boolean       true if the data is removed, otherwise 
false
                */
@@ -111,7 +103,6 @@
                /**
                * Replace the existing data of the passed id with the passed 
data in a certain mime type format.
                *
-               * @abstract
                * @param   integer  $id    id of data to replace
                * @param   mixed    $data  the new data, the datatype depends 
on the passed mime type
                * @param   string   $type  specifies the mime type of the 
passed data

Added: trunk/phpgwapi/inc/class.jscal.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.jscal.inc.php                              (rev 0)
+++ trunk/phpgwapi/inc/class.jscal.inc.php      2008-02-02 13:52:39 UTC (rev 
18466)
@@ -0,0 +1,312 @@
+<?php
+       /**
+       * jsCalendar wrapper-class
+       *
+       * @author Dave Hall
+       * @copyright Copyright (C) 2003,2004 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * @license http://www.fsf.org/licenses/gpl.html GNU General Public 
License
+       * @package phpgwapi
+       * @subpackage gui
+       * @version $Id: class.jscal.inc.php 682 2008-02-01 12:19:55Z dave $
+       */
+
+       /**
+       * Import the YUI class
+       */
+       phpgw::import_class('phpgwapi.yui');
+
+       /**
+       * jsCalendar wrapper-class
+       *
+       * @package phpgwapi
+       * @subpackage gui
+       */
+       class phpgwapi_calendar
+       {
+
+               public static function input($id, $date, $format = 'input', 
$title = null)
+               {
+                       $date_format =& 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+                       if ( !$title )
+                       {
+                               $title = 'Select a date';
+                       }
+                       $title = lang($title);
+                       $datels = self::get_translated_dates();
+                       $date_pos = self::_get_date_pos();
+
+                       $range_sep = '-';
+                       switch ( substr($date_format, 1, 1) )
+                       {
+                               case '-':
+                                       $range_sep = '--';
+                                       $delim = '-';
+
+                               case '.':
+                                       $delim = '.';
+                                       break;
+
+                               case '/':
+                               default:
+                                       $delim = '/';
+                                       break;
+                       }
+                       
+
+                       $date_selected = date(str_replace('M', 'm', 
$date_format), $date);
+
+
+                       $namespace = phpgwapi_yui::import_widget('calendar');
+                       $code = <<<JS
+                       YAHOO.namespace('{$namespace}');
+
+                       YAHOO.$namespace.$id.init = function()
+                       {
+                               YAHOO.$namespace.$id = new 
YAHOO.widget.Calendar('{$id}-cal','{$id}-container', { title:'{$title}', 
close:true } );
+                               
YAHOO.$namespace.$id.cfg.setProperty('DATE_FIELD_DELIMITER', '.');
+
+                               
YAHOO.$namespace.$id.cfg.setProperty('MDY_DAY_POSITION', {$date_pos['d']});
+                               
YAHOO.$namespace.$id.cfg.setProperty('MDY_MONTH_POSITION', {$date_post['m']});
+                               
YAHOO.$namespace.$id.cfg.setProperty('MDY_YEAR_POSITION', {$date_pos['y']});
+
+                               
YAHOO.$namespace.$id.cfg.setProperty('MD_DAY_POSITION', {$date_pos['d']});
+                               
YAHOO.$namespace.$id.cfg.setProperty('MD_MONTH_POSITION', {$date_post['m']});
+
+                               
YAHOO.$namespace.$id.cfg.setProperty('MONTHS_SHORT',   
['{$datels['months'][1]}', '{$datels['months'][2]}', '{$datels['months'][3]}', 
'{$datels['months'][4]}', '{$datels['months'][5]}', '{$datels['months'][6]}', 
'{$datels['months'][7]}', '{$datels['months'][8]}', '{$datels['months'][9]}', 
'{$datels['months'][10]}', '{$datels['months'][11]}', 
'{$datels['months'][12]}']);
+                               
YAHOO.$namespace.$id.cfg.setProperty('MONTHS_LONG',    
['{$datels['monthl'][1]}', '{$datels['monthl'][2]}', '{$datels['monthl'][3]}', 
'{$datels['monthl'][4]}', '{$datels['monthl'][5]}', '{$datels['monthl'][6]}', 
'{$datels['monthl'][7]}', '{$datels['monthl'][8]}', '{$datels['monthl'][9]}', 
'{$datels['monthl'][10]}', '{$datels['monthl'][11]}', 
'{$datels['monthl'][12]}']);
+                               
YAHOO.$namespace.$id.cfg.setProperty('WEEKDAYS_1CHAR', ['{$datels['day1'][7]}', 
'{$datels['day1'][1]}', '{$datels['day1'][2]}', '{$datels['day1'][3]}', 
'{$datels['day1'][4]}', '{$datels['day1'][5]}', '{$datels['day1'][6]}']);
+                               
YAHOO.$namespace.$id.cfg.setProperty('WEEKDAYS_SHORT', ['{$datels['days'][7]}', 
'{$datels['days'][1]}', '{$datels['days'][2]}', '{$datels['days'][3]}', 
'{$datels['days'][4]}', '{$datels['days'][5]}', '{$datels['days'][6]}']);
+                               
YAHOO.$namespace.$id.cfg.setProperty('WEEKDAYS_MEDIUM',['{$datels['daym'][7]}', 
'{$datels['daym'][1]}', '{$datels['daym'][2]}', '{$datels['daym'][3]}', 
'{$datels['daym'][4]}', '{$datels['daym'][5]}', '{$datels['daym'][6]}']);
+                               
YAHOO.$namespace.$id.cfg.setProperty('WEEKDAYS_LONG',  ['{$datels['dayl'][7]}', 
'{$datels['dayl'][1]}', '{$datels['dayl'][2]}', '{$datels['dayl'][3]}', 
'{$datels['dayl'][4]}', '{$datels['dayl'][5]}', '{$datels['dayl'][6]}']);
+
+                               YAHOO.$namespace.$id.select($date_selected);
+                               YAHOO.$namespace.$id.render();
+                               YAHOO.util.Event.addListener('{$id}-trigger', 
'click', YAHOO.$namespace.$id.show, YAHOO.$namespace.$id, true);
+                       }
+
+                       YAHOO.util.Event.onDOMReady(YAHOO.$namespace.$id.init);
+
+JS;
+
+                       $GLOBALS['phpgw']->js->add_code($namespace, $code);
+
+                       if ( isset($GLOBALS['phpgw_info']['flags']['xslt_app'])
+                               && $GLOBALS['phpgw_info']['flags']['xslt_app'])
+                       {
+                               return self::input_html($id, $namespace, $date, 
$format, $title);
+                       }
+                       return '';
+               }
+
+               private static function input_html($id, $namespace, $date, 
$format, $title)
+               {
+                       $html = <<<HTML
+                       <div id="{$id}-container" class="calendar_container">
+
+HTML;
+
+                       $date_str = date(str_replace('M', 'm', 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']), $date);
+
+                       switch ( $format )
+                       {
+                               case 'select':
+                                       $posies = 
array_flip(self::get_date_pos());
+                                       foreach ( $posies as $pos )
+                                       {
+                                               switch ( $pos )
+                                               {
+                                                       case 'd':
+                                                               $html .= 
phpgwapi_sbox2::
+                                               }
+                                       }
+
+                               case 'input':
+                               default:
+                                       $html .= <<<HTML
+                                       <input type="text" id="$id" name="$id" 
value="$date_str" onchange="updateCalFromSelect('{$namespace}', '{$id}');">
+
+HTML;
+
+                       }
+
+                       $img = $GLOBALS['phpgw']->common->image('phpgwapi', 
'calendar', 'png', false)
+                       $alt = lang('date selector trigger');
+
+
+                       $html .= <<<HTML
+                               <img src="$img" alt="$alt" title="$title">
+                       </div>
+
+HTML;
+
+                       return $html;
+               }
+
+               function add_listener($name)
+               {
+                       $this->_input_modern($name);
+               }
+
+               /**
+                * @author ralfbecker
+                * converts the date-string back to an array with year, month, 
day and a timestamp
+               *
+                * @param $datestr content of the inputfield generated by 
jscalendar::input()
+                * @param $raw key of the timestamp-field in the returned array 
or False of no timestamp
+                * @param $day,$month,$year keys for the array, eg. to set mday 
instead of day
+                */
+               public static function 
input2date($datestr,$raw='raw',$day='day',$month='month',$year='year')
+               {
+                       if ($datestr === '')
+                       {
+                               return False;
+                       }
+                       $fields = split('[./-]',$datestr);
+                       foreach(split('[./-]',$this->dateformat) as $n => 
$field)
+                       {
+                               $date[$field] = intval($fields[$n]);
+                               if($field == 'M')
+                               {
+                                       for($i=1; $i <=12; $i++)
+                                       {
+                                               
if(date('M',mktime(0,0,0,$i,1,2000)) == $fields[$n])
+                                               {
+                                                       $date['m'] = $i;
+                                               }
+                                       }
+                               }
+                       }
+                       $ret = array(
+                               $year  => $date['Y'],
+                               $month => $date['m'],
+                               $day   => $date['d']
+                       );
+                       if ($raw)
+                       {
+                               $ret[$raw] = 
mktime(12,0,0,$date['m'],$date['d'],$date['Y']);
+                       }
+                       //echo 
"<p>jscalendar::input2date('$datestr','$raw',$day','$month','$year') = "; 
print_r($ret); echo "</p>\n";
+
+                       return $ret;
+               }
+
+               /**
+               * Get the positions of the components of the date
+               */
+               private static get_date_pos()
+               {
+                       static $positions = null;
+                       if ( !is_null($positions) )
+                       {
+                               return $positions;
+                       }
+
+                       $positions = array();
+
+                       $parts = preg_split('/\/-\./', 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
+                       foreach ( $parts as $cnt => $part )
+                       {
+                               switch ( $part )
+                               {
+                                       case 'd':
+                                       case 'j':
+                                               $positions['d'] = $cnt + 1;
+                                               break;
+
+                                       case 'f':
+                                       case 'm':
+                                       case 'M':
+                                       case 'n':
+                                               $positions['m'] = $cnt + 1;
+                                               break;
+
+                                       case 'y':
+                                       case 'Y':
+                                               $positions['y'] = $cnt + 1;
+                                               break;
+                               }
+                       }
+                       return $positions;
+               }
+
+               private static function get_translated_dates()
+               {
+                       static $datels = null;
+                       if ( is_null($datels) )
+                       {
+                               $datels = array
+                               (
+                                       'months'        => array
+                                       (
+                                               'Jan'   => lang('Jan'),
+                                               'Feb'   => lang('Feb'),
+                                               'Mar'   => lang('Mar'),
+                                               'Apr'   => lang('Apr'),
+                                               'May'   => lang('May'),
+                                               'Jun'   => lang('Jun'),
+                                               'Jul'   => lang('Jul'),
+                                               'Aug'   => lang('Aug'),
+                                               'Sep'   => lang('Sep'),
+                                               'Oct'   => lang('Oct'),
+                                               'Nov'   => lang('Nov'),
+                                               'Dec'   => lang('Dec')
+                                       ),
+                                       'monthl'        => array
+                                       (
+                                               'Jan'   => lang('January'),
+                                               'Feb'   => lang('Febuary'),
+                                               'Mar'   => lang('March'),
+                                               'Apr'   => lang('April'),
+                                               'May'   => lang('May'),
+                                               'Jun'   => lang('June'),
+                                               'Jul'   => lang('July'),
+                                               'Aug'   => lang('August'),
+                                               'Sep'   => lang('September'),
+                                               'Oct'   => lang('October'),
+                                               'Nov'   => lang('November'),
+                                               'Dec'   => lang('December')
+                                       ),
+                                       'days'  => array
+                                       (
+                                               'Sun'   => lang('Su'),
+                                               'Mon'   => lang('Mo'),
+                                               'Tue'   => lang('Tu'),
+                                               'Wed'   => lang('We'),
+                                               'Thu'   => lang('Th'),
+                                               'Fri'   => lang('Fr'),
+                                               'Sat'   => lang('Sa'),
+                                               'Sun'   => lang('Su'),
+                                       ),
+                                       'daym'  => array
+                                       (
+                                               'Sun'   => lang('Sun'),
+                                               'Mon'   => lang('Mon'),
+                                               'Tue'   => lang('Tue'),
+                                               'Wed'   => lang('Wed'),
+                                               'Thu'   => lang('Thu'),
+                                               'Fri'   => lang('Fri'),
+                                               'Sat'   => lang('Sat'),
+                                               'Sun'   => lang('Sun'),
+                                       ),
+                                       'dayl'  => array
+                                       (
+                                               'Sun'   => lang('Sunday'),
+                                               'Mon'   => lang('Monday'),
+                                               'Tue'   => lang('Tuesday'),
+                                               'Wed'   => lang('Wednesday'),
+                                               'Thu'   => lang('Thursday'),
+                                               'Fri'   => lang('Friday'),
+                                               'Sat'   => lang('Saturday'),
+                                               'Sun'   => lang('Sunday'),
+                                       )
+                               );
+
+                               foreach ( $dayls['days'] as $day => $native )
+                               {
+                                       $dayls['day1'][$day] = substr($native, 
0, 1);
+                               }
+                       }
+                       return $datels;
+               }
+       }
+?>

Modified: trunk/phpgwapi/inc/class.log.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.log.inc.php        2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/phpgwapi/inc/class.log.inc.php        2008-02-02 13:52:39 UTC (rev 
18466)
@@ -189,13 +189,31 @@
 
                function write_error_to_db($err)
                {
+                       if ( isset($GLOBALS['phpgw']->db)
+                               && is_object($GLOBALS['phpgw']->db))
+                       {
                        $db =& $GLOBALS['phpgw']->db;
-                       $db->lock('phpgw_log');
+                       }
+                       else if ( isset($GLOBALS['phpgw_setup']->oProc->m_odb)
+                               && 
is_object($GLOBALS['phpgw_setup']->oProc->m_odb) ) // during setup
+                       {
+                               $db =& $GLOBALS['phpgw_setup']->oProc->m_odb;
+                               if(!$db->metadata('phpgw_log'))
+                               {
+                                       echo 'Failed to log error to database.';
+                                       return;
+                               }
+                       }
+                       else
+                       {
+                               //trigger_error("Failed to log error to 
database: no database object available");
+                               return;
+                       }
                        $db->query("insert into phpgw_log (log_date, log_app, 
log_account_id, log_account_lid, log_severity, log_file, log_line, log_msg) 
values "
-                               . "('" . 
$GLOBALS['phpgw']->db->to_timestamp(time()) . "'"
+                               . "('" . $db->to_timestamp(time()) . "'"
                                . ",'" . 
$db->db_addslashes($GLOBALS['phpgw_info']['flags']['currentapp']) . "'"
-                               . ","  . ( 
$GLOBALS['phpgw']->session->account_id ? $GLOBALS['phpgw']->session->account_id 
: -1)
-                               . ",'" . 
$db->db_addslashes($GLOBALS['phpgw']->session->account_lid) . "'"
+                               . ","  . ( 
isset($GLOBALS['phpgw']->session->account_id) ? 
$GLOBALS['phpgw']->session->account_id : -1)
+                               . ",'" . 
$db->db_addslashes(isset($GLOBALS['phpgw']->session->account_lid) ? 
$GLOBALS['phpgw']->session->account_lid : 'not authenticated') . "'"
                                . ",'" . $err->severity . "'"
                                . ",'" . $db->db_addslashes($err->fname) . "'"
                                . ","  . intval($err->line)
@@ -205,9 +223,8 @@
                        );
                        if ( isset($db->Errno) )
                        {
-                               trigger_error("Failed to log error to database. 
DB errno " . $db->Errno . ": message " . $db->Error,  E_USER_NOTICE);
+                               //trigger_error("Failed to log error to 
database. DB errno " . $db->Errno . ": message " . $db->Error,  E_USER_NOTICE);
                        }
-                       $db->unlock();
                }
 
                // I pulled this from the old code, where it's used to display 
a fatal error and determinate processing..
@@ -239,9 +256,12 @@
                                        . lang('line') . ': ' . $err->line . 
"</p>\n"
                                        . $trace;
 
+                               if ( isset($GLOBALS['phpgw']->common) && 
is_object($GLOBALS['phpgw']->common) )
+                               {
                                $GLOBALS['phpgw']->common->phpgw_exit(True);
                        }
                }
+               }
 
                
                // write() left in for backward compatibility

Added: trunk/phpgwapi/inc/class.menu.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.menu.inc.php                               (rev 0)
+++ trunk/phpgwapi/inc/class.menu.inc.php       2008-02-02 13:52:39 UTC (rev 
18466)
@@ -0,0 +1,130 @@
+<?php
+       /**
+        * phpGroupWare menu handler class
+        *
+        * @author Dave Hall <address@hidden>
+        * @copyright Copyright (C) 2007-2008 Free Software Foundation, Inc. 
http://www.fsf.org/
+        * @license http://www.fsf.org/licenses/gpl.html GNU General Public 
License
+        * @package phpgwapi
+        * @subpackage utitlity
+        * @version $Id: class.menu.inc.php 682 2008-02-01 12:19:55Z dave $
+        */
+
+       /*
+          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/>.
+        */
+
+       /*
+        * phpGroupWare menu handler class
+        *
+        * @package phpgwapi
+        * @subpackage utitlity
+        */
+       class phpgwapi_menu
+       {
+               /**
+               * Clear the user's menu so it can be regenerated cleanly
+               */
+               public function clear()
+               {
+                       $GLOBALS['phpgw']->session->appsession('phpgwapi', 
'menu', null);
+               }
+
+               /**
+               * Get the menu structure and return it
+               *
+               * @param string $mtype the type of menu sought - default all 
returned
+               * @return array menu structure
+               */
+               public function get($mtype = null)
+               {
+                       //$menu = 
$GLOBALS['phpgw']->session->appsession('phpgwapi', 'menu');
+                       $menu = null;
+                       if ( !$menu )
+                       {
+                               $menu = self::load();
+                               
$GLOBALS['phpgw']->session->appsession('phpgwapi', 'menu', $menu);
+                       }
+                       if ( !is_null($mtype) && isset($menu[$mtype]) )
+                       {
+                               return $menu[$mtype];
+                       }
+                       return $menu;
+               }
+
+               /**
+               * Get categories available for the current user
+               *
+               * @param string $module the module the categories are sought for
+               * @return array menu class compatiable array of categories
+               */
+               public static function get_categories($module)
+               {
+                       $catobj = createObject('phpgwapi.categories', 
$GLOBALS['phpgw_info']['user']['account_id'], $module);
+                       $cats = $catobj->return_sorted_array(0, false, '', 
'ASC', 'cat_main, cat_level, cat_name', true);
+                       //echo "module: $module <pre>" . print_r($cats, true) . 
'</pre>';
+               }
+               
+               /**
+               * Load the menu structure from all available applications
+               *
+               * @return array the menu structure for the current user
+               */
+               private function load()
+               {
+                       $menus = array();
+                       $raw_menus = $GLOBALS['phpgw']->hooks->process('menu');
+                       foreach ( $raw_menus as $app => $raw_menu )
+                       {
+                               // Ignore invalid entries
+                               if ( !is_array($raw_menu) )
+                               {
+                                       continue;
+                               }
+                               foreach ( $raw_menu as $mtype => $menu )
+                               {
+                                        //no point in adding empty items
+                                       if ( !count($menu) )
+                                       {
+                                               continue;
+                                       }
+
+                                       if ( !isset($menus[$mtype]) )
+                                       {
+                                               $menus[$mtype] = array();
+                                       }
+
+                                       switch ( $mtype )
+                                       {
+                                               case 'navbar':
+                                                       $menus[$mtype] = 
array_merge($menus[$mtype], $menu);
+                                                       break;
+                                               case 'admin':
+                                                       $app_text = $app == 
'admin' ? lang('General') : lang($app);
+                                                       
$menus['navigation']['admin'][$app] = array
+                                                       (
+                                                               'text'  => 
$GLOBALS['phpgw']->translation->translate($app, array(), true),
+                                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.uiconfig.index', 'appname' => $app)),
+                                                               'image' => 
$raw_menu['navbar'][$app]['image'],
+                                                               'children'      
=> $menu
+                                                       );
+                                                       // no break here - fall 
thru
+                                               default:
+                                                       $menus[$mtype][$app] = 
$menu;
+                                       }
+                               }
+                       }
+                       return $menus;
+               }
+       }

Added: trunk/phpgwapi/inc/class.menu_apps.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.menu_apps.inc.php                          (rev 0)
+++ trunk/phpgwapi/inc/class.menu_apps.inc.php  2008-02-02 13:52:39 UTC (rev 
18466)
@@ -0,0 +1,92 @@
+<?php
+       /**
+        * phpgwapi - Menus
+        *
+        * @author Dave Hall <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 phpgwapi 
+        * @version $Id: class.menu_apps.inc.php 682 2008-02-01 12:19:55Z dave $
+        */
+
+       /*
+          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/>.
+        */
+
+
+       /**
+        * Menus
+        *
+        * @package phpgwapi
+        */     
+       class phpgwapi_menu_apps
+       {
+               /**
+                * Get the menus for the phpgwapi related stuff
+                *
+                * @return array available menus for the current user
+                */
+               function get_menu()
+               {
+                       $menus = array();
+
+                       $menus['navbar'] = array
+                       (
+                               'home' => array
+                               (
+                                       'text'  => lang('Home'),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/home.php'),
+                                       'image' => array('phpgwapi', 'home'),
+                                       'order' => -100,
+                                       'group' => 'core'
+                               ),
+                               /*
+                               'home' => array
+                               (
+                                       'text'  => lang('something'),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'phpgwapi.uiphpgwapi.index') ),
+                                       'image' => array('phpgwapi', 'navbar'),
+                                       'order' => 99,
+                                       'group' => 'core'
+                               )
+                               */
+                               'logout' => array
+                               (
+                                       'text'  => lang('Logout'),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/logout.php'),
+                                       'image' => array('phpgwapi', 'logout'),
+                                       'order' => 999,
+                                       'group' => 'core'
+                               )
+                       );
+                       /*
+
+                       $menus['toolbar'] = array();
+
+                       if ( 
isset($GLOBALS['phpgw_info']['user']['apps']['admin']) )
+                       {
+                               $menus['admin'] = array();
+                       }
+
+                       if ( 
isset($GLOBALS['phpgw_info']['user']['apps']['preferences']) )
+                       {
+                               $menus['preferences'] = array();
+                       }
+
+                       $menus['navigation'] = array();
+                       $menus['folders'] = 
phpgwapi_menu::get_categories('phpgwapi');
+                       */
+                       return $menus;
+               }
+       }

Modified: trunk/phpgwapi/inc/class.mime_magic.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.mime_magic.inc.php 2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/phpgwapi/inc/class.mime_magic.inc.php 2008-02-02 13:52:39 UTC (rev 
18466)
@@ -33,23 +33,12 @@
                var $mime_magic_file;
                
                /**
-               * Wrapper to PHP5 Compatiable Constructor
-               *
-               * @author skwashd
-               
-               function mime_magic()
-               {
-                       $this->__constructor()
-               }
-               */
-
-               /**
                * Constructor 
                *
                * Load the map values into the instance arrays
                * @author skwashd
                */
-               function mime_magic() //__constructor()
+               function __construct()
                {
                        $this->mime_extension_map = $this->get_mime_ext_map();
                        $this->mime_magic_file = $this->get_mime_magic_file();
@@ -205,8 +194,7 @@
                                return false;
                        }
                        
-                       mt_srand(time());
-                       $filename = 
$GLOBALS['phpgw_info']['server']['temp_dir'] . SEP 
+                       $filename = 
"{$GLOBALS['phpgw_info']['server']['temp_dir']}/" 
                                . md5( time() + mt_rand() ) . '.tmp';
 
                        $fp = @fopen($filename, 'ab');

Modified: trunk/phpgwapi/inc/class.pdf.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.pdf.inc.php        2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/phpgwapi/inc/class.pdf.inc.php        2008-02-02 13:52:39 UTC (rev 
18466)
@@ -58,7 +58,7 @@
                        }
                        else
                        {
-                               $dir = PHPGW_API_INC  . SEP . 'pdf' . SEP . 
'pdf_files';
+                               $dir = PHPGW_API_INC  . '/pdf/pdf_files';
   
                                //save the file
                                if (!file_exists($dir))
@@ -66,7 +66,7 @@
                                        die('Directory for temporary pdf-files 
is missing - pleace notify the Administrator');
                                }
 
-                               $fname = tempnam($dir.SEP,'PDF_').'.pdf';
+                               $fname = tempnam("{$dir}/PDF_") . '.pdf';
  
                                if(!$fp = @fopen($fname,'wb'))
                                {
@@ -98,10 +98,10 @@
                                                if (substr($file,0,4)=="PDF_")
                                                {
                                                        // then check to see if 
this one is too old
-                                                       $ftime = 
filemtime($dir.SEP.$file);
+                                                       $ftime = 
filemtime("{$dir}/{$file}");
                                                        if (time()-$ftime > 
3600*1) // one hour
                                                        {
-                                                               
unlink($dir.SEP.$file);
+                                                               
unlink("{$dir}/{$file}");
                                                        }
                                                }
                                        }  
@@ -122,4 +122,4 @@
        * @see @pdf
        */
        include (PHPGW_API_INC . '/pdf/class.ezpdf.php');
-?>
+

Modified: trunk/phpgwapi/inc/class.phpgw.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.phpgw.inc.php      2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/phpgwapi/inc/class.phpgw.inc.php      2008-02-02 13:52:39 UTC (rev 
18466)
@@ -19,7 +19,7 @@
        class phpgw
        {
                var $accounts;
-               var $applications;
+               var $adodb;
                var $acl;
                var $auth;
                var $db; 
@@ -42,7 +42,7 @@
                var $session;
                var $send;
                var $template;
-               var $translation;
+               //var $translation;
                var $utilities;
                var $vfs;
                var $calendar;
@@ -50,9 +50,64 @@
                var $addressbook;
                var $todo;
                var $xslttpl;
-               var $shm = null;
+               //var $shm = null;
                var $mapping;
 
+               /**
+               * @var array $instance_vars holds most of the public instance 
variable, so they are only instatiated when needed
+               * @internal removes the need for a lot of if ( !isset($var) || 
!is_object($var)) { $var = createObject("phpgwapi.$var"); } - YAY!
+               */
+               private $instance_vars = array();
+
+               /**
+               * Handle instance variables better - this way we only load what 
we need
+               *
+               * @param string $var the variable name to get
+               */
+               public function __get($var)
+               {
+                       if ( !isset($this->instance_vars[$var]) || 
!is_object($this->instance_vars[$var]) )
+                       {
+                               $this->instance_vars[$var] = 
createObject("phpgwapi.{$var}");
+                       }
+                       return $this->instance_vars[$var];
+               }
+
+               /**
+               * Handle setting instance variables better
+               *
+               * @internal this will probably validate the variable name at 
some point in the future to stop typo bugs
+               * @param string $var the varliable to set
+               * @param mixed $value the value to assign to the variable
+               */
+               public function __set($var, $value)
+               {
+                       $this->instance_vars[$var] = $value;
+               }
+
+               /**
+               * Handle unset()ing of instance variables
+               *
+               * @param string $var the variable to unset
+               */
+               public function __unset($var)
+               {
+                       unset($this->instance_vars[$var]);
+               }
+
+               /**
+               * Check if an instance variable isset() or not
+               *
+               * @internal we also check if it an object or not - as that is 
all we should be storing in here
+               * @param string $var the variable to check
+               * @return bool is the variable set or not 
+               */
+               public function __isset($var)
+               {
+                       return isset($this->instance_vars[$var]) && 
is_object($this->instance_vars[$var]);
+               }
+
+
                
/**************************************************************************\
                * Core functions                                                
           *
                
\**************************************************************************/
@@ -185,7 +240,7 @@
                        {
                                $vars = array($m1, $m2, $m3, $m4, $m5, $m6, 
$m7, $m8, $m9, $m10);
                        }
-                       if ( !isset($GLOBALS['phpgw']->translation) || 
!is_object($GLOBALS['phpgw']->translation) )
+                       if ( !isset($this->translation) )
                        {
                                $str = $key;
                                for ( $i = 10; $i > 0; --$i )
@@ -234,6 +289,13 @@
                                                }
                                                break;
 
+                                       case 'SERVER':
+                                               if ( isset($_SERVER[$var_name]) 
)
+                                               {
+                                                       $value = 
$_SERVER[$var_name];
+                                               }
+                                               break;
+
                                        case 'SESSION':
                                                if ( 
isset($_SESSION[$var_name]) )
                                                {

Modified: trunk/phpgwapi/inc/class.preferences.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.preferences.inc.php        2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/phpgwapi/inc/class.preferences.inc.php        2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -66,9 +66,19 @@
                 * Constructor
                 * @param int $account_id the user id for which preferences are 
sought - 0 == current user
                 */
-               function preferences($account_id = 0)
+               public function __construct($account_id = 0)
                {
                        $this->db         =& $GLOBALS['phpgw']->db;
+                       $this->set_account_id($account_id);
+               }
+
+               /**
+               * Set the current user id
+               *
+               * @param int $account_id the account id - 0 = current user's id
+               */
+               public function set_account_id($account_id = 0)
+               {
                        $this->account_id = get_account_id($account_id);
                }
 
@@ -547,6 +557,9 @@
                 */
                function save_repository($update_session_info = 
False,$type='user')
                {
+                       // Don't get the old values back from the cache on next 
load
+                       $GLOBALS['phpgw']->session->clear_phpgw_info_cache();
+
                        switch($type)
                        {
                                case 'forced':
@@ -807,19 +820,18 @@
                 */
                function sub_default_userid($account_id='')
                {
-                       if 
(isset($GLOBALS['phpgw_info']['server']['mail_login_type']) && 
$GLOBALS['phpgw_info']['server']['mail_login_type'] == 'vmailmgr')
+                       $prefs_email_userid = 
$GLOBALS['phpgw']->accounts->id2lid($account_id, true);
+
+                       if 
(isset($GLOBALS['phpgw_info']['server']['mail_login_type']) )
                        {
-                               $prefs_email_userid = 
$GLOBALS['phpgw']->accounts->id2name($account_id)
-                                       . '@' . 
$GLOBALS['phpgw_info']['server']['mail_suffix'];
-                       }
-                       else if 
(isset($GLOBALS['phpgw_info']['server']['mail_login_type']) && 
$GLOBALS['phpgw_info']['server']['mail_login_type'] == 'ispman')
+                               if ( 
$GLOBALS['phpgw_info']['server']['mail_login_type'] == 'vmailmgr' )
                        {
-                               $prefs_email_userid = 
$GLOBALS['phpgw']->accounts->id2name($account_id)
-                                       . '_' . str_replace('.', '_', 
$GLOBALS['phpgw_info']['server']['mail_suffix']);
+                                       $prefs_email_userid .= 
"@{$GLOBALS['phpgw_info']['server']['mail_suffix']}";
                        }
-                       else
+                               else if ( 
$GLOBALS['phpgw_info']['server']['mail_login_type'] == 'ispman' )
                        {
-                               $prefs_email_userid = 
$GLOBALS['phpgw']->accounts->id2name($account_id);
+                                       $prefs_email_userid .= '_' . 
str_replace('.', '_', $GLOBALS['phpgw_info']['server']['mail_suffix']);
+                               }
                        }
                        return $prefs_email_userid;
                }
@@ -840,10 +852,12 @@
                        {
                                return $this->data['email']['address'];
                        }
-                       $prefs_email_address = 
$GLOBALS['phpgw']->accounts->id2name($account_id);
-                       if (strstr($prefs_email_address,'@') === False)
+
+                       $prefs_email_address = 
$GLOBALS['phpgw']->accounts->id2lid($account_id);
+
+                       if ( !preg_match('/@/', $prefs_email_address) )
                        {
-                               $prefs_email_address .= '@' . 
$GLOBALS['phpgw_info']['server']['mail_suffix'];
+                               $prefs_email_address .= 
"@{$GLOBALS['phpgw_info']['server']['mail_suffix']}";
                        }
                        return $prefs_email_address;
                }

Modified: trunk/phpgwapi/inc/class.sbox.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.sbox.inc.php       2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/phpgwapi/inc/class.sbox.inc.php       2008-02-02 13:52:39 UTC (rev 
18466)
@@ -191,15 +191,20 @@
                */
                public static function getMonthText($name, $selected = null)
                {
+                       if ( empty($selected) )
+                       {
+                               $selected = date('n');
+                       }
+
                        $html = <<<HTML
                        <select name="{$name}" id="{$name}">
 
 HTML;
                        foreach ( phpgwapi_datetime::get_month_fullnames() as 
$id => $month )
                        {
-                               $slctd = $id == $selected ? ' selected' : '';
+                               $slctd = $id == $selected ? ' 
selected="selected"' : '';
                                $html .= <<<HTML
-                               <option value="{$id}"{$selected}>$month</option>
+                               <option value="{$id}"{$slctd}>$month</option>
 
 HTML;
                        }
@@ -219,16 +224,18 @@
                */
                public static function getDays($name, $selected = null)
                {
-                       $lang_day = lang('day');
+                       if ( empty($selected) )
+                       {
+                               $selected = date('j');
+                       }
 
                        $html = <<<HTML
                        <select name="{$name}" id="{$name}">
-                               <option value="0">$day</option>
 
 HTML;
                        for ( $i=1; $i <= 31; ++$i )
                        {
-                               $slctd = $i == $selected ? ' selected' : '';
+                               $slctd = $i == $selected ? ' 
selected="selected"' : '';
                                $html .= <<<HTML
                                <option value="{$i}"{$slctd}>{$i}</option>
 
@@ -247,11 +254,16 @@
                * @param string $name the name and id of the html select element
                * @param int $selected the currently selected year
                * @param int $start_year the year to start (default: current 
year - 5)
-               * @param int $endYear the last year in the list (default: 
current year + 10)
+               * @param int $end_year the last year in the list (default: 
current year + 10)
                * @return string html select element populated with year options
                */
-               public static function getYears($name, $selected = null, 
$startYear = null, $endYear = null)
+               public static function getYears($name, $selected = null, 
$start_year = null, $end_year = null)
                {
+                       if ( empty($selected) )
+               {
+                               $selected = date('Y');
+                       }
+
                        if (!$start_year)
                        {
                                $start_year = date('Y') - 5;
@@ -261,9 +273,9 @@
                                $start_year = $selected;
                        }
 
-                       if (!$endYear)
+                       if (!$end_year)
                        {
-                               $endYear = date('Y') + 10;
+                               $end_year = date('Y') + 10;
                        }
 
                        if ($selected && $end_year < $selected)
@@ -274,13 +286,12 @@
                        $lang_year = lang('year');
 
                        $html = <<<HTML
-                       <select name="{$name}" id="{$id}">
-                               <option value="0">$lang_year</option>
+                       <select name="{$name}" id="{$name}">
 
 HTML;
                        for ( $i = $start_year; $i <= $end_year; ++$i )
                        {
-                               $slctd = $id == $selected ? ' selected' : '';
+                               $slctd = $i == $selected ? ' 
selected="selected"' : '';
                                $html .= <<<HTML
                                        <option value="$i"{$slctd}>{$i}</option>
 

Modified: trunk/phpgwapi/inc/class.schema_proc.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.schema_proc.inc.php        2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/phpgwapi/inc/class.schema_proc.inc.php        2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -476,7 +476,7 @@
                                        $sFieldSQL .= ' NULL';
                                }
                                
-                               if($sDefault == '0')
+                               if($sDefault === '0' || $sDefault === 0)
                                {
                                        $sFieldSQL .= ' DEFAULT 0';
                                }                                               
                
@@ -589,6 +589,7 @@
                function _GetFK($aFields, &$sFKSQL)
                {
                        $sFKSQL = '';
+                       $sFKSQLarr = array();
                        if(count($aFields) < 1)
                        {
                                return True;
@@ -596,17 +597,15 @@
 
                        $sFields = '';
                        reset($aFields);
-                       foreach($aFields as $key => $sField)
-                       {
-                               if(@is_array($sField))
+                       foreach($aFields as $reftable => $sField)
                                {
-                                       $sFKSQL .= 
$this->m_oTranslator->GetFKSQL(implode(',', $sField));
+                               $sFKSQLarr[] = 
$this->m_oTranslator->GetFKSQL($reftable, $sField);
                                }
-                               else
+                       if(isset($sFKSQLarr[0]) && $sFKSQLarr[0])
                                {
-                                       $sFKSQL .= 
$this->m_oTranslator->GetFKSQL($sField);
-                               }
+                               $sFKSQL = implode(",\n",$sFKSQLarr);
                        }
+                       
                        return True;
                }
                
@@ -651,7 +650,7 @@
                        
                        if($this->dbms == 'mysql' && $sIXSQL)
                        {
-                               $this->query($sIXSQL);
+                               $this->query($sIXSQL, __LINE__, __FILE__);
                        }
                        
                        // postgres
@@ -659,11 +658,22 @@
                        {
                                foreach($this->m_oTranslator->indexes_sql as 
$key => $sIndexSQL)
                                {
-                                       $ix_name = 
str_replace(',','_',$key).'_'.$sTableName.'_idx';
+                                       $ix_name = $key.'_'.$sTableName.'_idx';
                                        $IndexSQL = 
str_replace(array('__index_name__','__table_name__'), 
array($ix_name,$sTableName), $sIndexSQL);
-                                       $this->query($IndexSQL);
+                                       $this->query($IndexSQL, __LINE__, 
__FILE__);
                                }
                        }                       
                }
+
+               /**
+                * Prepare the VALUES component of an INSERT sql statement
+                * 
+                * @param array $value_set array of values to insert into the 
database
+                * @return string the prepared sql, empty string for invalid 
input
+                */
+               function validate_insert($values)
+               {
+                       return $this->m_odb->validate_insert($values);
+               }
        }
 ?>

Modified: trunk/phpgwapi/inc/class.schema_proc_mssql.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.schema_proc_mssql.inc.php  2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/phpgwapi/inc/class.schema_proc_mssql.inc.php  2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -211,7 +211,7 @@
                        $this->uc = array();
 
                        // Field, Type, Null, Key, Default, Extra
-                       $oProc->m_odb->query("exec sp_columns '$sTableName'");
+                       $oProc->m_odb->query("exec sp_columns '$sTableName'", 
__LINE__, __FILE__);
                        while ($oProc->m_odb->next_record())
                        {
                                $type = $default = $null = $nullcomma = $prec = 
$scale = $ret = $colinfo = $scales = '';
@@ -351,15 +351,18 @@
 
                        return false;
                }
-               function GetFKSQL($sFields)
+               function GetFKSQL($reftable, $sFields)
                {
-                  if (ereg("\((.*)\)", $sFields, $regs))
+                       if(is_array($sFields))
                        {
-                         $ret = "FOREIGN KEY (".$regs[1].")\n" .
-                               "  REFERENCES ".$sFields;
+                               $ret = "FOREIGN KEY 
(".implode(',',array_keys($sFields)).")\n" .
+                                       "  REFERENCES 
$reftable(".implode(',',array_values($sFields)).")";
                          return $ret;
-                       } else
+                       }
+                       else
+                       {
                          return ""; // incorrect FK declaration found
                }
        }
+       }
 ?>

Modified: trunk/phpgwapi/inc/class.schema_proc_mysql.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.schema_proc_mysql.inc.php  2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/phpgwapi/inc/class.schema_proc_mysql.inc.php  2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -74,7 +74,7 @@
                        switch($sType)
                        {
                                case 'auto':
-                                       $sTranslated = 'int(11) auto_increment 
not null';
+                                       $sTranslated = 'int(11) auto_increment';
                                        break;
                                case 'blob':
                                        $sTranslated = 'blob';
@@ -256,17 +256,22 @@
                           // foreign key supports needs MySQL 3.23.44 and up 
with InnoDB or MySQL 5.1
                           // or other versions the syntax is parsed in table 
create commands
                           // see chapter 1.8.4.5
-                          function GetFKSQL($sFields)
+
+               function GetFKSQL($reftable, $sFields)
                           {
-                                if (ereg("\((.*)\)", $sFields, $regs))
+                       if(is_array($sFields))
                                 {
-                                  $ret = "FOREIGN KEY (".$regs[1].")\n" .
-                                        "  REFERENCES ".$sFields;
+                               $ret = "FOREIGN KEY 
(".implode(',',array_keys($sFields)).")\n" .
+                                       "  REFERENCES 
$reftable(".implode(',',array_values($sFields)).")";
                                   return $ret;
-                                } else
+                       }
+                       else
+                       {
                                   return ""; // incorrect FK declaration found
                           }
+               }
 
+
                function _GetColumns($oProc, $sTableName, &$sColumns, 
$sDropColumn = '')
                {
                        $sColumns = '';
@@ -276,7 +281,7 @@
                        $this->uc = array();
 
                        /* Field, Type, Null, Key, Default, Extra */
-                       $oProc->m_odb->query("describe $sTableName");
+                       $oProc->m_odb->query("DESCRIBE $sTableName", __LINE__, 
__FILE__);
                        while ($oProc->m_odb->next_record())
                        {
                                $type = $default = $null = $nullcomma = $prec = 
$scale = $ret = $colinfo = $scales = '';
@@ -355,17 +360,17 @@
 
                function DropTable($oProc, &$aTables, $sTableName)
                {
-                       return !!($oProc->m_odb->query("DROP TABLE " . 
$sTableName));
+                       return !!($oProc->m_odb->query("DROP TABLE " . 
$sTableName, __LINE__, __FILE__));
                }
 
                function DropColumn($oProc, &$aTables, $sTableName, 
$aNewTableDef, $sColumnName, $bCopyData = true)
                {
-                       return !!($oProc->m_odb->query("ALTER TABLE $sTableName 
DROP COLUMN $sColumnName"));
+                       return !!($oProc->m_odb->query("ALTER TABLE $sTableName 
DROP COLUMN $sColumnName", __LINE__, __FILE__));
                }
 
                function RenameTable($oProc, &$aTables, $sOldTableName, 
$sNewTableName)
                {
-                       return !!($oProc->m_odb->query("ALTER TABLE 
$sOldTableName RENAME $sNewTableName"));
+                       return !!($oProc->m_odb->query("ALTER TABLE 
$sOldTableName RENAME $sNewTableName", __LINE__, __FILE__));
                }
 
                function RenameColumn($oProc, &$aTables, $sTableName, 
$sOldColumnName, $sNewColumnName, $bCopyData = true)
@@ -378,7 +383,7 @@
                        if ($DEBUG) { echo '<br>RenameColumn: calling 
_GetFieldSQL for ' . $sNewColumnName; }
                        if (isset($aTables[$sTableName]["fd"][$sNewColumnName]) 
&& $oProc->_GetFieldSQL($aTables[$sTableName]["fd"][$sNewColumnName], 
$sNewColumnSQL))
                        {
-                               return !!($oProc->m_odb->query("ALTER TABLE 
$sTableName CHANGE $sOldColumnName $sNewColumnName " . $sNewColumnSQL));
+                               return !!($oProc->m_odb->query("ALTER TABLE 
$sTableName CHANGE $sOldColumnName $sNewColumnName " . $sNewColumnSQL, 
__LINE__, __FILE__));
                        }
                        return false;
                }
@@ -389,7 +394,7 @@
                        if ($DEBUG) { echo '<br>AlterColumn: calling 
_GetFieldSQL for ' . $sNewColumnName; }
                        if (isset($aTables[$sTableName]["fd"][$sColumnName]) && 
$oProc->_GetFieldSQL($aTables[$sTableName]["fd"][$sColumnName], $sNewColumnSQL))
                        {
-                               return !!($oProc->m_odb->query("ALTER TABLE 
$sTableName MODIFY $sColumnName " . $sNewColumnSQL));
+                               return !!($oProc->m_odb->query("ALTER TABLE 
$sTableName MODIFY $sColumnName " . $sNewColumnSQL, __LINE__, __FILE__));
                                /* return !!($oProc->m_odb->query("ALTER TABLE 
$sTableName CHANGE $sColumnName $sColumnName " . $sNewColumnSQL)); */
                        }
 
@@ -401,7 +406,7 @@
                        $oProc->_GetFieldSQL($aColumnDef, $sFieldSQL);
                        $query = "ALTER TABLE $sTableName ADD COLUMN 
$sColumnName $sFieldSQL";
 
-                       return !!($oProc->m_odb->query($query));
+                       return !!($oProc->m_odb->query($query, __LINE__, 
__FILE__));
                }
 
                function GetSequenceSQL($sTableName, &$sSequenceSQL)
@@ -423,11 +428,11 @@
                                /* create sequence first since it will be 
needed for default */
                                if ($sSequenceSQL != '')
                                {
-                                       $oProc->m_odb->query($sSequenceSQL);
+                                       $oProc->m_odb->query($sSequenceSQL, 
__LINE__, __FILE__);
                                }
 
                                $query = "CREATE TABLE $sTableName 
($sTableSQL)";
-                               return !!($oProc->m_odb->query($query));
+                               return !!($oProc->m_odb->query($query, 
__LINE__, __FILE__));
                        }
 
                        return false;

Modified: trunk/phpgwapi/inc/class.schema_proc_oracle.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.schema_proc_oracle.inc.php 2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/phpgwapi/inc/class.schema_proc_oracle.inc.php 2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -208,7 +208,7 @@
                        $this->uc = array();
 
                        /* Field, Type, Null, Key, Default, Extra */
-                       $oProc->m_odb->query("describe $sTableName");
+                       $oProc->m_odb->query("DESCRIBE $sTableName", __LINE__, 
__FILE__);
                        while ($oProc->m_odb->next_record())
                        {
                                $type = $default = $null = $nullcomma = $prec = 
$scale = $ret = $colinfo = $scales = '';
@@ -315,17 +315,17 @@
                {
                        $this->DropSequenceForTable($oProc,$sTableName);
 
-                       return !!($oProc->m_odb->query("DROP TABLE " . 
$sTableName));
+                       return !!($oProc->m_odb->query("DROP TABLE " . 
$sTableName, __LINE__, __FILE__));
                }
 
                function DropColumn($oProc, &$aTables, $sTableName, 
$aNewTableDef, $sColumnName, $bCopyData = true)
                {
-                       return !!($oProc->m_odb->query("ALTER TABLE $sTableName 
DROP COLUMN $sColumnName"));
+                       return !!($oProc->m_odb->query("ALTER TABLE $sTableName 
DROP COLUMN $sColumnName", __LINE__, __FILE__));
                }
 
                function RenameTable($oProc, &$aTables, $sOldTableName, 
$sNewTableName)
                {
-                       return !!($oProc->m_odb->query("ALTER TABLE 
$sOldTableName RENAME $sNewTableName"));
+                       return !!($oProc->m_odb->query("ALTER TABLE 
$sOldTableName RENAME $sNewTableName", __LINE__, __FILE__));
                }
 
                function RenameColumn($oProc, &$aTables, $sTableName, 
$sOldColumnName, $sNewColumnName, $bCopyData = true)
@@ -336,7 +336,7 @@
                        */
                        if 
($oProc->_GetFieldSQL($aTables[$sTableName]["fd"][$sNewColumnName], 
$sNewColumnSQL))
                        {
-                               return !!($oProc->m_odb->query("ALTER TABLE 
$sTableName CHANGE $sOldColumnName $sNewColumnName " . $sNewColumnSQL));
+                               return !!($oProc->m_odb->query("ALTER TABLE 
$sTableName CHANGE $sOldColumnName $sNewColumnName " . $sNewColumnSQL, 
__LINE__, __FILE__));
                        }
                        return false;
                }
@@ -345,7 +345,7 @@
                {
                        if 
($oProc->_GetFieldSQL($aTables[$sTableName]["fd"][$sColumnName], 
$sNewColumnSQL))
                        {
-                               return !!($oProc->m_odb->query("ALTER TABLE 
$sTableName MODIFY $sColumnName " . $sNewColumnSQL));
+                               return !!($oProc->m_odb->query("ALTER TABLE 
$sTableName MODIFY $sColumnName " . $sNewColumnSQL, __LINE__, __FILE__));
                                /* return !!($oProc->m_odb->query("ALTER TABLE 
$sTableName CHANGE $sColumnName $sColumnName " . $sNewColumnSQL)); */
                        }
 
@@ -357,7 +357,7 @@
                        $oProc->_GetFieldSQL($aColumnDef, $sFieldSQL);
                        $query = "ALTER TABLE $sTableName ADD COLUMN 
$sColumnName $sFieldSQL";
 
-                       return !!($oProc->m_odb->query($query));
+                       return !!($oProc->m_odb->query($query, __LINE__, 
__FILE__));
                }
 
                function GetSequenceSQL($sTableName, &$sSequenceSQL)
@@ -410,12 +410,12 @@
                                if ($bCreateSequence && $sSequenceSQL != '')
                                {
                                        if ($DEBUG) { echo '<br>Making sequence 
using: ' . $sSequenceSQL; }
-                                       $oProc->m_odb->query($sSequenceSQL);
+                                       $oProc->m_odb->query($sSequenceSQL, 
__LINE__, __FILE__);
                                }
 
                                $query = "CREATE TABLE $sTableName 
($sTableSQL)";
 
-                               $result = !!($oProc->m_odb->query($query));
+                               $result = !!($oProc->m_odb->query($query, 
__LINE__, __FILE__));
                                if($result==True)
                                {
                                        if ($DEBUG)
@@ -431,7 +431,7 @@
                                                {
                                                        $ix_name = 
strtoupper($this->m_sIndexPrefix) . "_" . $sTableName . '_' . $key;
                                                        $IndexSQL = 
str_replace(array('__index_name__','__table_name__'), 
array($ix_name,$sTableName), $sIndexSQL);
-                                                       
$oProc->m_odb->query($IndexSQL);
+                                                       
$oProc->m_odb->query($IndexSQL, __LINE__, __FILE__);
                                                }
                                        }                       
 
@@ -443,7 +443,7 @@
                                                        print_r($sTriggerSQL);
                                                        echo '</pre>';
                                                }                       
-                                               
$oProc->m_odb->query($sTriggerSQL);
+                                               
$oProc->m_odb->query($sTriggerSQL, __LINE__, __FILE__);
                                        }
                                }
                                return $result;

Modified: trunk/phpgwapi/inc/class.schema_proc_pgsql.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.schema_proc_pgsql.inc.php  2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/phpgwapi/inc/class.schema_proc_pgsql.inc.php  2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -145,9 +145,12 @@
                                        }
                                        break;
                                case 'numeric':
+                                       if($iPrecision == -1)
+                                       {
                                        /* Borrowed from phpPgAdmin */
                                        $iPrecision = ($iScale >> 16) & 0xffff;
                                        $iScale     = ($iScale - 4) & 0xffff;
+                                       }
                                        $sTranslated = "'type' => 'decimal', 
'precision' => $iPrecision, 'scale' => $iScale";
                                        break;
                                case 'float':
@@ -194,26 +197,29 @@
 
                function GetIXSQL($sFields)
                {
-                       $this->indexes_sql[$sFields] = "CREATE INDEX 
__index_name__ ON __table_name__ USING btree ($sFields)";
+                       $this->indexes_sql[str_replace(',','_',$sFields)] = 
"CREATE INDEX __index_name__ ON __table_name__ USING btree ($sFields)";
                        return '';
                }
 
                        
-                          function GetFKSQL($sFields)
+               function GetFKSQL($reftable, $sFields)
                           {
-                                if (ereg("\((.*)\)", $sFields, $regs))
+                       if(is_array($sFields))
                                 {
-                                  $ret = "FOREIGN KEY (".$regs[1].")\n" .
-                                        "  REFERENCES ".$sFields;
+                               $ret = "FOREIGN KEY 
(".implode(',',array_keys($sFields)).")\n" .
+                                       "  REFERENCES 
$reftable(".implode(',',array_values($sFields)).")";
                                   return $ret;
-                                } else
+                       }
+                       else
+                       {
                                   return ""; // incorrect FK declaration found
                           }
+               }
                        
                function _GetColumns($oProc, $sTableName, &$sColumns, 
$sDropColumn = '', $sAlteredColumn = '', $sAlteredColumnType = '')
                {
-                       $sdb = $oProc->m_odb;
-                       $sdc = $oProc->m_odb;
+                       $sdb = clone($oProc->m_odb);
+                       $sdc = clone($oProc->m_odb);
 
                        $sColumns = '';
                        $this->pk = array();
@@ -229,7 +235,7 @@
                        }
                        $query .= ' ORDER BY a.attnum';
 
-                       $oProc->m_odb->query($query);
+                       $sdb->query($query, __LINE__, __FILE__);
                        while ($oProc->m_odb->next_record())
                        {
                                if ($sColumns != '')
@@ -265,13 +271,13 @@
                                        and a.atttypid = t.oid
                                        ORDER BY a.attnum";
                        /* attnum field type length lengthvar notnull(Yes/No) */
-                       $sdb->query($sql_get_fields);
+                       $sdb->query($sql_get_fields, __LINE__, __FILE__);
                        while ($sdb->next_record())
                        {
                                $colnum  = $sdb->f(0);
                                $colname = $sdb->f(1);
 
-                               if ($sdb->f(5) == 'Yes')
+                               if ($sdb->f(5) == 'f')
                                {
                                        $null = "'nullable' => True";
                                }
@@ -311,7 +317,7 @@
                                                        c.oid = d.adrelid AND
                                                        d.adnum = $colnum
                                        ";
-                               $sdc->query($sql_get_default);
+                               $sdc->query($sql_get_default, __LINE__, 
__FILE__);
                                $sdc->next_record();
                                if ($sdc->f(0))
                                {
@@ -319,10 +325,16 @@
                                        {
                                                $default = '';
                                                $nullcomma = '';
+                                               $type = "'type' => 'auto'";
                                        }
                                        else
                                        {
-                                               $default = "'default' => 
'".$sdc->f(0)."'";
+                                               $default = "'default' => '" . 
str_replace(array('::bpchar','::character 
varying','now()'),array('','','current_timestamp'),$sdc->f(0));
+                                               // For db-functions - add an 
apos
+                                               if(substr($default,-1)!= "'")
+                                               {
+                                                       $default .= "'"; 
+                                               }
                                                $nullcomma = ',';
                                        }
                                }
@@ -358,7 +370,7 @@
                                        AND ta.attnum = i.indkey[ia.attnum-1]
                                ORDER BY
                                        index_name, tab_name, column_name";
-                       $sdc->query($sql_pri_keys);
+                       $sdc->query($sql_pri_keys, __LINE__, __FILE__);
                        while ($sdc->next_record())
                        {
                                //echo '<br> checking: ' . $sdc->f(4);
@@ -371,13 +383,43 @@
                                        $this->uc[] = $sdc->f(2);
                                }
                        }
+
+                       $ForeignKeys = $sdc->MetaForeignKeys($sTableName);
+
+                       foreach($ForeignKeys as $table => $keys)
+                       {
+                               $keystr = array();
+                               foreach ($keys as $keypair)
+                               {
+                                       $keypair = explode('=',$keypair);
+                                       $keystr[] = "'" . $keypair[0] . "' => 
'" . $keypair[1] . "'";
+                               }
+                               $this->fk[] = $table . "' => array(" . 
implode(', ',$keystr)  . ')';
+                       }
+
+                       $MetaIndexes = $sdc->adodb->MetaIndexes($sTableName);
+
+                       foreach($MetaIndexes as $key => $index)
+                       {
+                               if(count($index['columns']) > 1)
+                               {
+                                       $this->ix[] = "array('" . implode("', 
'",$index['columns']) . "')";
+                               }
+                               else
+                               {
+                                       $this->ix[] = "'" . 
$index['columns'][0] . "'"; 
+                               }
+                       }
+
                        /* ugly as heck, but is here to chop the trailing comma 
on the last element (for php3) */
+                       if($this->sCol)
+                       {
                        $this->sCol[count($this->sCol) - 1] = 
substr($this->sCol[count($this->sCol) - 1],0,-2) . "\n";
+                       }
 
                        return false;
                }
 
-
                function GetSequenceForTable($oProc,$table,&$sSequenceName)
                {
                        global $DEBUG;
@@ -396,7 +438,7 @@
                {
                        global $DEBUG;
                        if($DEBUG) { echo '<br>GetSequenceFieldForTable: You 
rang?'; }
-                       $oProc->m_odb->query("SELECT a.attname FROM 
pg_attribute a, pg_class c, pg_attrdef d WHERE c.relname='$table' AND 
c.oid=d.adrelid AND d.adsrc LIKE '%seq_$table%' AND a.attrelid=c.oid AND 
d.adnum=a.attnum");
+                       $oProc->m_odb->query("SELECT a.attname FROM 
pg_attribute a, pg_class c, pg_attrdef d WHERE c.relname='$table' AND 
c.oid=d.adrelid AND d.adsrc LIKE '%seq_$table%' AND a.attrelid=c.oid AND 
d.adnum=a.attnum", __LINE__, __FILE__);
                        $oProc->m_odb->next_record();
                        if ($oProc->m_odb->f('attname'))
                        {
@@ -422,14 +464,14 @@
                {
                        $this->DropSequenceForTable($oProc,$sTableName);
 
-                       return $oProc->m_odb->query("DROP TABLE " . $sTableName 
. " CASCADE") &&
+                       return $oProc->m_odb->query("DROP TABLE " . $sTableName 
. " CASCADE", __LINE__, __FILE__) &&
                                   $this->DropSequenceForTable($oProc, 
$sTableName);
                }
 
                function DropColumn($oProc, &$aTables, $sTableName, 
$aNewTableDef, $sColumnName, $bCopyData = true)
                {
                        $query = "ALTER TABLE $sTableName DROP COLUMN 
$sColumnName CASCADE";
-                       $bRet = !!($oProc->m_odb->query($query));
+                       $bRet = !!($oProc->m_odb->query($query, __LINE__, 
__FILE__));
                        return $bRet;
                }
 
@@ -461,10 +503,10 @@
                                if ($DEBUG) { echo '<br>RenameTable(): Altering 
column default for: ' . $sField; }
                        }
 
-                       $oProc->m_odb->query("ALTER TABLE $sOldTableName RENAME 
TO $sNewTableName");                    
+                       $oProc->m_odb->query("ALTER TABLE $sOldTableName RENAME 
TO $sNewTableName", __LINE__, __FILE__);
                        if ($sSequenceName)
                        {
-                               $Ok = !!($oProc->m_odb->query("ALTER TABLE 
$sNewTableName ALTER $sField SET DEFAULT nextval('seq_" . $sNewTableName . 
"')"));
+                               $Ok = !!$oProc->m_odb->query("ALTER TABLE 
$sNewTableName ALTER $sField SET DEFAULT nextval('seq_" . $sNewTableName . 
"')", __LINE__, __FILE__);
                                
$this->DropSequenceForTable($oProc,$sOldTableName);
                        }
                        
@@ -493,7 +535,7 @@
                function RenameColumn($oProc, &$aTables, $sTableName, 
$sOldColumnName, $sNewColumnName, $bCopyData = true)
                {
                        $query = "ALTER TABLE $sTableName RENAME COLUMN 
$sOldColumnName TO $sNewColumnName";
-                       return !!($oProc->m_odb->query($query));
+                       return !!($oProc->m_odb->query($query, __LINE__, 
__FILE__));
                }
 
                function AlterColumn($oProc, &$aTables, $sTableName, 
$sColumnName, &$aColumnDef, $bCopyData = true)
@@ -529,15 +571,20 @@
 
                        $sFieldSQL = $this->TranslateType($sType, $iPrecision, 
$iScale);
                        $query = "ALTER TABLE $sTableName ALTER COLUMN 
$sColumnName TYPE $sFieldSQL";
-                       $Ok = !!($oProc->m_odb->query($query));
+                       $Ok = !!($oProc->m_odb->query($query, __LINE__, 
__FILE__));
 
-                       if($bNullable == False || $bNullable == 'False')
+                       if($bNullable === False || $bNullable === 'False')
                        {
-                               $sFieldSQL = ' NOT NULL';
-                               $query = "ALTER TABLE $sTableName ALTER COLUMN 
$sColumnName SET $sFieldSQL";
-                               $Ok = !!($oProc->m_odb->query($query));
+                               $sFieldSQL = ' SET NOT NULL';
                        }
+                       else
+                       {
+                               $sFieldSQL = ' DROP NOT NULL';                  
+                       }
 
+                       $query = "ALTER TABLE $sTableName ALTER COLUMN 
$sColumnName $sFieldSQL";
+                       $Ok = !!$oProc->m_odb->query($query, __LINE__, 
__FILE__);
+
                        if($sDefault == '0')
                        {
                                $defaultSQL = " DEFAULT 0";
@@ -555,7 +602,7 @@
                        if(isset($defaultSQL) && $defaultSQL)
                        {
                                $query = "ALTER TABLE $sTableName ALTER COLUMN 
$sColumnName SET $defaultSQL";
-                               $Ok = !!($oProc->m_odb->query($query));
+                               $Ok = !!$oProc->m_odb->query($query, __LINE__, 
__FILE__);
                        }
 
                        return $Ok;
@@ -563,7 +610,9 @@
 
                function AddColumn($oProc, &$aTables, $sTableName, 
$sColumnName, &$aColumnDef)
                {
-                       if (isset($aColumnDef['default']))      // pgsql cant 
add a colum with a default
+                       $default = '';
+                       $Ok = '';
+                       if (isset($aColumnDef['default']) && 
$aColumnDef['default'])    // pgsql cant add a colum with a default
                        {
                                $default = $aColumnDef['default'];
                                unset($aColumnDef['default']);
@@ -576,7 +625,7 @@
                        $oProc->_GetFieldSQL($aColumnDef, $sFieldSQL);
                        $query = "ALTER TABLE $sTableName ADD COLUMN 
$sColumnName $sFieldSQL";
 
-                       if (($Ok = !!($oProc->m_odb->query($query))) && 
isset($default))
+                       if (($Ok = !!$oProc->m_odb->query($query, __LINE__, 
__FILE__)) && isset($default) && $default)
                        {
                                if($default == '0')
                                {
@@ -596,7 +645,7 @@
 
                                $query .= "UPDATE $sTableName SET 
$sColumnName='$default';\n";
 
-                               $Ok = !!($oProc->m_odb->query($query));
+                               $Ok = !!$oProc->m_odb->query($query, __LINE__, 
__FILE__);
 
                                if ($OK && $notnull)
                                {
@@ -632,13 +681,13 @@
                                if ($bCreateSequence && $sSequenceSQL != '')
                                {
                                        if ($DEBUG) { echo '<br>Making sequence 
using: ' . $sSequenceSQL; }
-                                       $oProc->m_odb->query($sSequenceSQL);
+                                       $oProc->m_odb->query($sSequenceSQL, 
__LINE__, __FILE__);
                                }
 
-                               $query = "CREATE TABLE $sTableName ($sTableSQL) 
WITH OIDS";
+                               $query = "CREATE TABLE $sTableName 
($sTableSQL)";
                                //echo 'sql' .$query . "\n";
 
-                               $result = !!($oProc->m_odb->query($query));
+                               $result = !!$oProc->m_odb->query($query, 
__LINE__, __FILE__);
                                if($result==True)
                                {
                                        if (isset($this->indexes_sql) && $DEBUG)
@@ -654,7 +703,7 @@
                                                {
                                                        $ix_name = 
str_replace(',','_',$key).'_'.$sTableName.'_idx';
                                                        $IndexSQL = 
str_replace(array('__index_name__','__table_name__'), 
array($ix_name,$sTableName), $sIndexSQL);
-                                                       
$oProc->m_odb->query($IndexSQL);
+                                                       
$oProc->m_odb->query($IndexSQL, __LINE__, __FILE__);
                                                }
                                        }                       
                                }

Modified: trunk/phpgwapi/inc/class.service.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.service.inc.php    2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/phpgwapi/inc/class.service.inc.php    2008-02-02 13:52:39 UTC (rev 
18466)
@@ -15,9 +15,8 @@
        * 
        * @package phpgwapi
        * @subpackage application
-       * @abstract
        */
-       class service
+       abstract class service
        {
                var $provider = '';
                var $svc      = '';

Modified: trunk/phpgwapi/inc/class.setup.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.setup.inc.php      2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/phpgwapi/inc/class.setup.inc.php      2008-02-02 13:52:39 UTC (rev 
18466)
@@ -555,7 +555,7 @@
                 */
                function deregister_hooks($appname)
                {
-                       
if($this->alessthanb($setup_info['phpgwapi']['currentver'],'0.9.8pre5'))
+                       if(isset($setup_info['phpgwapi']['currentver']) && 
$this->alessthanb($setup_info['phpgwapi']['currentver'],'0.9.8pre5'))
                        {
                                /* No phpgw_hooks table yet. */
                                return False;
@@ -589,14 +589,13 @@
                        return 
$this->hooks->single($location,$appname,True,True);
                }
 
-               /*
-               @function alessthanb
-               @abstract phpgw version checking, is param 1 < param 2 in phpgw 
versionspeak?
-               @param  $a      phpgw version number to check if less than $b
-               @param  $b      phpgw version number to check $a against
-               #return True if $a < $b
+               /**
+               * phpgw version checking, is param 1 < param 2 in phpgw 
versionspeak?
+               * @param string $a phpgw version number to check if less than $b
+               * @param sting $b phpgw version number to check $a against
+               * @return bool True if $a < $b
                */
-               function alessthanb($a,$b,$DEBUG=False)
+               function alessthanb($a, $b, $DEBUG=False)
                {
                        $num = array('1st','2nd','3rd','4th');
 

Modified: trunk/phpgwapi/inc/class.setup_detection.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.setup_detection.inc.php    2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/phpgwapi/inc/class.setup_detection.inc.php    2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -230,7 +230,7 @@
                        (
                                'phpgwapi'              => true,
                                //if this isn't here, it can never be installed 
as it is part of the api - skwashd
-                               'notifywindows' => true ,
+                               'notifywindow'  => true ,
                                'admin'                 => true,
                                'preferences'   => true
                        );
@@ -413,11 +413,10 @@
                        }
                }
 
-               /*
-               @function check_app_tables
-               @abstract       Verify that all of an app's tables exist in the 
db
-               @param $appname
-               @param $any             optional, set to True to see if any of 
the apps tables are installed
+               /**
+               * Verify that all of an app's tables exist in the db
+               * @param $appname
+               * @param $any optional, set to True to see if any of the apps 
tables are installed
                */
                function check_app_tables($appname,$any=False)
                {

Modified: trunk/phpgwapi/inc/class.setup_html.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.setup_html.inc.php 2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/phpgwapi/inc/class.setup_html.inc.php 2008-02-02 13:52:39 UTC (rev 
18466)
@@ -70,14 +70,14 @@
                        /* hack to get tpl dir */
                        if (is_dir(PHPGW_SERVER_ROOT))
                        {
-                               $srv_root = PHPGW_SERVER_ROOT . SEP . 
"$app_name" . SEP;
+                               $srv_root = PHPGW_SERVER_ROOT . "/$app_name/";
                        }
                        else
                        {
                                $srv_root = '';
                        }
 
-                       return $srv_root . 'templates' . SEP . 'base';
+                       return "{$srv_root}/templates/base";
                }
 
                function show_header($title='',$nologoutbutton=False, 
$logoutfrom='config', $configdomain='')

Modified: trunk/phpgwapi/inc/class.setup_process.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.setup_process.inc.php      2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/phpgwapi/inc/class.setup_process.inc.php      2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -51,7 +51,7 @@
                        $GLOBALS['phpgw_setup']->oProc->m_odb->Database = 
$phpgw_domain[$ConfigDomain]['db_name'];
                        $GLOBALS['phpgw_setup']->oProc->m_odb->User     = 
$phpgw_domain[$ConfigDomain]['db_user'];
                        $GLOBALS['phpgw_setup']->oProc->m_odb->Password = 
$phpgw_domain[$ConfigDomain]['db_pass'];
-                       $GLOBALS['phpgw_setup']->oProc->m_odb->Halt_On_Error = 
'report';
+                       $GLOBALS['phpgw_setup']->oProc->m_odb->Halt_On_Error = 
'yes';
                        $GLOBALS['phpgw_setup']->oProc->m_odb->connect();
                }
 
@@ -265,7 +265,7 @@
 
                                if($DEBUG) { echo '<br>process->current(): 
Incoming status: ' . $appname . ',status: '. $setup_info[$key]['status']; }
 
-                               $appdir  = PHPGW_SERVER_ROOT . SEP . $appname . 
SEP . 'setup' . SEP;
+                               $appdir  = PHPGW_SERVER_ROOT . 
"/{$appname}/setup/";
 
                                if ( isset($setup_info[$key]['tables']) 
                                        && $setup_info[$key]['tables'] 
@@ -348,7 +348,7 @@
                        foreach ( array_keys($setup_info) as $key )
                        {
                                $appname = isset($setup_info[$key]['name']) ? 
$setup_info[$key]['name'] : '';
-                               $appdir  = PHPGW_SERVER_ROOT . SEP . $appname . 
SEP . 'setup' . SEP;
+                               $appdir  = PHPGW_SERVER_ROOT . 
"/{$appname}/setup/";
 
                                if( isset($setup_info[$key]['tables'])
                                        && $setup_info[$key]['tables']
@@ -459,7 +459,7 @@
                        foreach($setup_info as $key => $ignored)
                        {
                                $appname = $setup_info[$key]['name'];
-                               $appdir  = PHPGW_SERVER_ROOT . SEP . $appname . 
SEP . 'setup' . SEP;
+                               $appdir  = PHPGW_SERVER_ROOT . 
"/{$appname}/setup/";
 
                                if(file_exists($appdir.'test_data.inc.php'))
                                {
@@ -496,7 +496,7 @@
                        foreach($setup_info as $key => $ignored)
                        {
                                $appname = $setup_info[$key]['name'];
-                               $appdir  = PHPGW_SERVER_ROOT . SEP . $appname . 
SEP . 'setup' . SEP;
+                               $appdir  = PHPGW_SERVER_ROOT . 
"/{$appname}/setup/";
 
                                
if(file_exists($appdir.'tables_baseline.inc.php'))
                                {
@@ -570,7 +570,7 @@
                                        $apptitle   = 
isset($setup_info[$key]['title']) ? $setup_info[$key]['title'] : '';
                                        $currentver = 
$setup_info[$key]['currentver'];
                                        $targetver  = 
$setup_info[$key]['version'];     // The version we need to match when done
-                                       $appdir     = PHPGW_SERVER_ROOT . SEP . 
$appname . SEP . 'setup' . SEP;
+                                       $appdir     = PHPGW_SERVER_ROOT . 
"/{$appname}/setup/";
 
                                        $test   = array();
                                        
$GLOBALS['phpgw_setup']->oProc->m_aTables = $phpgw_baseline = array();
@@ -820,17 +820,23 @@
                                $this->init_process();
                        }
 
-                       
$GLOBALS['phpgw_setup']->oProc->m_oTranslator->_GetColumns($GLOBALS['phpgw_setup']->oProc,
 $tablename, $sColumns, $sColumnName);
+                       $GLOBALS['phpgw_setup']->oProc->m_oTranslator->sCol = 
array();
+                       
$GLOBALS['phpgw_setup']->oProc->m_oTranslator->_GetColumns($GLOBALS['phpgw_setup']->oProc,
 $tablename, $sColumns);
 
-                       while(list($key,$tbldata) = 
each($GLOBALS['phpgw_setup']->oProc->m_oTranslator->sCol))
+                       $arr = '';
+                       
if(is_array($GLOBALS['phpgw_setup']->oProc->m_oTranslator->sCol))
                        {
+                               
reset($GLOBALS['phpgw_setup']->oProc->m_oTranslator->sCol);
+                               
foreach($GLOBALS['phpgw_setup']->oProc->m_oTranslator->sCol as $tbldata)
+                       {
                                $arr .= $tbldata;
                        }
+                       }
+                       
                        $pk = $GLOBALS['phpgw_setup']->oProc->m_oTranslator->pk;
                        $fk = $GLOBALS['phpgw_setup']->oProc->m_oTranslator->fk;
                        $ix = $GLOBALS['phpgw_setup']->oProc->m_oTranslator->ix;
                        $uc = $GLOBALS['phpgw_setup']->oProc->m_oTranslator->uc;
-
                        return array($arr,$pk,$fk,$ix,$uc);
                }
        }

Modified: trunk/phpgwapi/inc/class.setup_translation.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.setup_translation.inc.php  2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/phpgwapi/inc/class.setup_translation.inc.php  2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -25,7 +25,7 @@
        * @package phpgwapi
        * @subpackage application
        */
-       class setup_translation
+       class phpgwapi_setup_translation
        {
                var $langarray;
 
@@ -34,23 +34,19 @@
                *
                 * @param $lang user lang variable (defaults to en)
                 */
-               function setup_translation()
+               function __construct()
                {
                        $ConfigLang = phpgw::get_var('ConfigLang');
 
-                       if(!$ConfigLang)
+                       if($ConfigLang)
                        {
-                               $lang = 'en';
+                               $this->userlang = $ConfigLang;
                        }
-                       else
-                       {
-                               $lang = $ConfigLang;
-                       }
 
-                       $fn = '.' . SEP . 'lang' . SEP . 'phpgw_' . $lang . 
'.lang';
+                       $fn = "./lang/phpgw_{$lang}.lang";
                        if (!file_exists($fn))
                        {
-                               $fn = '.' . SEP . 'lang' . SEP . 
'phpgw_en.lang';
+                               $fn = './lang/phpgw_en.lang';
                        }
 
                        if (file_exists($fn))
@@ -196,7 +192,7 @@
                                {
                                        echo '<br>add_langs(): Working on: ' . 
$lang . ' for ' . $appname;
                                }
-                               $appfile = PHPGW_SERVER_ROOT . SEP . $appname . 
SEP . 'setup' . SEP . 'phpgw_' . strtolower($lang) . '.lang';
+                               $appfile = PHPGW_SERVER_ROOT . 
"/{$appname}/setup/phpgw_" . strtolower($lang) . '.lang';
                                if(file_exists($appfile))
                                {
                                        if($DEBUG)
@@ -241,4 +237,3 @@
                        }
                }
        }
-?>

Modified: trunk/phpgwapi/inc/class.sql.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.sql.inc.php        2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/phpgwapi/inc/class.sql.inc.php        2008-02-02 13:52:39 UTC (rev 
18466)
@@ -97,9 +97,8 @@
        * to use in a query (for the where clause).
        * @package phpgwapi
        * @subpackage database
-       * @abstract
        */
-       class sql_
+       abstract class sql_
        {
                function sql_()
                {

Modified: trunk/phpgwapi/inc/class.sql_builder.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.sql_builder.inc.php        2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/phpgwapi/inc/class.sql_builder.inc.php        2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -19,7 +19,6 @@
        * This class provide common methods to create transaction sql queries.
        * @package phpgwapi
        * @subpackage database
-       * @abstract
        */
        class sql_builder
        {

Added: trunk/phpgwapi/inc/class.template_newdesign.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.template_newdesign.inc.php                         
(rev 0)
+++ trunk/phpgwapi/inc/class.template_newdesign.inc.php 2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -0,0 +1,67 @@
+<?php
+       // INSERT HEADER HERE
+       class phpgwapi_template_newdesign
+       {
+               public $public_functions = array
+               (
+                       'store'                 => True,
+                       'retrive'               => True
+               );
+
+               // TODO: document me with phpdoc
+               public function store()
+               {
+                       $location = phpgw::get_var('location');
+                       $data = phpgw::get_var('data', 'raw');
+
+                       if( $location == null )
+                       {
+                               header("HTTP/1.0 406 Not Acceptable");
+                               return "Missing location parameter";
+                       }
+
+                       $json = json_decode($data, true);
+
+                       if( $json == null )
+                       {
+                               header("HTTP/1.0 406 Not Acceptable");
+                               return "Invalid JSON data parameter";
+                       }
+
+                       
$GLOBALS['phpgw']->session->appsession("template_newdesign_$location", 
'phpgwapi', $json);
+                       return $json;
+               }
+
+               // TODO: document me with phpdoc
+               public function retrieve()
+               {
+                       $location = phpgw::get_var('location');
+
+                       if( $location == null )
+                       {
+                               header("HTTP/1.0 406 Not Acceptable");
+                               return "Missing location parameter";
+                       }
+
+                       $data = self::retrieve_local($location);
+
+                       if ( $data == null )
+                       {
+                               header("HTTP/1.0 404 Not Found");
+                               return "No data found on that location";
+                       }
+
+                       return $data;
+               }
+
+               // TODO: document me with phpdoc
+               public static function retrieve_local($location)
+               {
+                       return 
$GLOBALS['phpgw']->session->appsession("template_newdesign_{$location}", 
'phpgwapi');
+               }
+
+               public static function store_local($location, $data)
+               {
+                       
$GLOBALS['phpgw']->session->appsession("template_newdesign_$location", 
'phpgwapi', $data);
+               }
+       }

Modified: trunk/phpgwapi/inc/class.vfs_dav.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.vfs_dav.inc.php    2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/phpgwapi/inc/class.vfs_dav.inc.php    2008-02-02 13:52:39 UTC (rev 
18466)
@@ -537,12 +537,12 @@
                        }
                }
 
-               /*
-               @function lock
-               @abstract DAV (class 2) locking - sets an exclusive write lock
-               @param string filename
-               @param relatives Relativity array
-               @result True if successfull 
+               /**
+               * DAV (class 2) locking - sets an exclusive write lock
+               *
+               * @param string filename
+               * @param relatives Relativity array
+               * @result True if successfull 
                */              
                function lock ($data)
                {
@@ -633,13 +633,12 @@
                }
 
                
-               /*
-               @function unlock
-               @abstract DAV (class 2) unlocking - unsets the specified lock
-               @param string filename
-               @param relatives Relativity array
-               @param tocken   The token for the lock we wish to remove.
-               @result True if successfull
+               /**
+               * DAV (class 2) unlocking - unsets the specified lock
+               * @param string filename
+               * @param relatives Relativity array
+               * @param token  The token for the lock we wish to remove.
+               * @return bool true if successfull
                */              
                function unlock ($data)
                {
@@ -677,16 +676,16 @@
                        }
                }
 
-               /*
-               @function options
-               @abstract Allows querying for optional features - esp optional 
DAV features 
-               like locking
-               @param option   The option you want to test for.  Options 
include 'LOCKING'
-                       'VIEW', 'VERSION-CONTROL (eventually) etc
-               @result true if the specified option is supported
-               @discussion This should really check the server.  Unfortunately 
the overhead of doing this
-               in every VFS instance is unacceptable (it essentially doubles 
the time for any request). Ideally
-               we would store these features in the session perhaps?
+               /**
+               * Allows querying for optional features - esp optional DAV 
features like locking
+               *
+               * @internal     This should really check the server.  
Unfortunately the overhead of doing 
+               * this in every VFS instance is unacceptable (it essentially 
doubles the time for 
+               * any request). Ideally we would store these features in the 
session perhaps?
+               * 
+               * @param option The option you want to test for.  Options 
include 'LOCKING'
+               *       'VIEW', 'VERSION-CONTROL (eventually) etc
+               * @return true if the specified option is supported
                */              
                function options($option)
                {
@@ -1903,7 +1902,7 @@
                                                }
 
                                                $rarray[] = 
$this->get_real_info (array(
-                                                               'string'        
=> $p->real_full_path . SEP . $filename,
+                                                               'string'        
=> "{$p->real_full_path}/{$filename}",
                                                                'relatives'     
=> array ($p->mask)
                                                        )
                                                );
@@ -1982,16 +1981,16 @@
                                        * since forbiden infinite recursion is 
a good idea 
                                        * to avoid DoS 
                                        */
-/*_debug_array($p->fake_full_path.$value['name'].SEP);*/
-//                                     $datanew['string'] = 
$p->fake_full_path.SEP.$value['name'];
-                                       $datanew['string'] = 
preg_replace('#[/]+#','/',$p->fake_full_path.SEP.$value['name']);
+/*_debug_array($p->fake_full_path.$value['name'].'/');*/
+//                                     $datanew['string'] = 
"{$p->fake_full_path}/{$value['name']};
+                                       $datanew['string'] = 
preg_replace('#[/]+#','/', "{$p->fake_full_path}/{$value['name']}");
                                        $tmp = $this->ls($datanew);
                                        foreach($tmp as $f)
                                        {
                                                //If ls is working well, 
                                                //the returned ls match the 
values
                                                //except if the directory is 
protected
-                                               if ( 
$f['directory'].SEP.$f['name'] != $p->fake_full_path.SEP.$value['name'] )
+                                               if ( 
"{$f['directory']}/{$f['name']}" != "{$p->fake_full_path}/{$value['name']}" )
                                                        $rarray[] = $f;
                                        }
                                }

Modified: trunk/phpgwapi/inc/class.vfs_shared.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.vfs_shared.inc.php 2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/phpgwapi/inc/class.vfs_shared.inc.php 2008-02-02 13:52:39 UTC (rev 
18466)
@@ -1152,14 +1152,7 @@
                                return $data['string'];
                        }
 
-                       if ($data['fake'])
-                       {
                                $sep = '/';
-                       }
-                       else
-                       {
-                               $sep = SEP;
-                       }
 
                        /* if RELATIVE_CURRENT, retrieve the current mask */
                        if ($data['mask'][0] & RELATIVE_CURRENT)
@@ -1386,7 +1379,7 @@
 
                        $data = array_merge ($this->default_values ($data, 
$default_values), $data);
 
-                       $sep = SEP;
+                       $sep = '/';
 
                        $rarray['mask'] = RELATIVE_NONE;
                        $fake = false;
@@ -1501,7 +1494,7 @@
                                        if (ereg 
("^$link_info[directory]/$link_info[name](/|$)", $rarray['fake_full_path']))
                                        {
                                                $rarray['real_full_path'] = 
ereg_replace ("^$this->basedir", '', $rarray['real_full_path']);
-                                               $rarray['real_full_path'] = 
ereg_replace ("^$link_info[directory]" . SEP . "$link_info[name]", 
$link_info['link_directory'] . SEP . $link_info['link_name'], 
$rarray['real_full_path']);
+                                               $rarray['real_full_path'] = 
ereg_replace ("^{$link_info['directory']}/{$link_info['name']}", 
"{$link_info['link_directory']}/{$link_info['link_name']}", 
$rarray['real_full_path']);
 
                                                $p = $this->path_parts (array(
                                                                'string'        
=> $rarray['real_full_path'],
@@ -1594,14 +1587,7 @@
 
                        $data = array_merge ($this->default_values ($data, 
$default_values), $data);
 
-                       if ($data['relatives'][0] & VFS_REAL)
-                       {
-                               $sep = SEP;
-                       }
-                       else
-                       {
                                $sep = '/';
-                       }
 
                        if ($data['relative'] == 'relative' || 
$data['relative'] == True)
                        {

Modified: trunk/phpgwapi/inc/class.vfs_sql.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.vfs_sql.inc.php    2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/phpgwapi/inc/class.vfs_sql.inc.php    2008-02-02 13:52:39 UTC (rev 
18466)
@@ -2005,6 +2005,11 @@
                                                $edited_comment = True;
                                        }
 
+                                       if ($attribute == 'owner_id' && 
!$$attribute)
+                                       {
+                                               $$attribute = 
$GLOBALS['phpgw_info']['user']['account_id'];
+                                       }
+
                                        $$attribute = $this->clean_string 
(array ('string' => $$attribute));
 
                                        if ($change_attributes > 0)
@@ -2285,7 +2290,7 @@
                                                        continue;
                                                }
                                                $rarray[] = 
$this->get_real_info (array(
-                                                               'string'        
=> $p->real_full_path . SEP . $filename,
+                                                               'string'        
=> "{$p->real_full_path}/{$filename}",
                                                                'relatives'     
=> array ($p->mask)
                                                        )
                                                );

Modified: trunk/phpgwapi/inc/class.xslttemplates.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.xslttemplates.inc.php      2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/phpgwapi/inc/class.xslttemplates.inc.php      2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -27,7 +27,7 @@
        * @package phpgwapi
        * @subpackage gui
        */
-       class xslttemplates
+       class phpgwapi_xslttemplates
        {
                var $rootdir = '';
                var $prev_rootdir = '';
@@ -54,7 +54,12 @@
                var $xmlvars = array();
                var $xmldata = '';
 
-               function xslttemplates($root = '.')
+               /**
+               * Constructor
+               *
+               * @param string $root the root directory
+               */
+               function __construct($root = '.')
                {
                        //FIXME Print view/mode should be handled by CSS not 
different markup
                        if ( 
isset($GLOBALS['phpgw_info']['flags']['printview']) && 
$GLOBALS['phpgw_info']['flags']['printview'] )
@@ -68,6 +73,11 @@
                        }
                }
 
+               /**
+               * Error hanlder
+               *
+               * @param string $msg the error message
+               */
                function halt($msg)
                {
                        die($msg);
@@ -112,16 +122,24 @@
 
                function add_file($filename, $rootdir='', $time=1)
                {
-                       if (!is_array($filename))
+                       if ( is_array($filename) )
                        {
+                               foreach ( $filename as $file )
+                               {
+                                       $this->add_file($file);
+                               }
+                               return;
+                       }
+
                                if($rootdir=='')
                                {
                                        $rootdir=$this->rootdir;
                                }
 
-                               if (substr($filename, 0, 1) != SEP && 
substr($filename, 1, 1) != ':')
+                       if ( substr($filename, 0, 1) != '/' 
+                               && substr($filename, 1, 1) != ':' )
                                {
-                                       $new_filename = $rootdir . SEP . 
$filename;
+                               $new_filename = "{$rootdir}/{$filename}";
                                }
                                else
                                {
@@ -135,24 +153,24 @@
                                        {
                                                case 2:
                                                        $new_root = 
str_replace($GLOBALS['phpgw_info']['server']['template_set'],'base',$rootdir);
-                                                       
$this->add_file($filename,$new_root,3);
+                                               $this->add_file($filename, 
$new_root, 3);
                                                        return true;
                                                case 3:
                                                        $new_root = 
PHPGW_SERVER_ROOT . '/phpgwapi/templates/' . 
$GLOBALS['phpgw_info']['server']['template_set'];
-                                                       
$this->add_file($filename,$new_root,4);
+                                               $this->add_file($filename, 
$new_root, 4);
                                                        return true;
                                                case 4:
                                                        $new_root = 
PHPGW_SERVER_ROOT . '/phpgwapi/templates/base';
-                                                       
$this->add_file($filename,$new_root,5);
+                                               $this->add_file($filename, 
$new_root, 5);
                                                        return true;
                                                case 5:
-                                                       
$this->add_file($filename,$rootdir,6);
+                                               $this->add_file($filename, 
$rootdir, 6);
                                                        return true;
                                                case 6:
                                                        $this->halt("filename: 
file $new_filename.xsl does not exist.");
                                                        break true;
                                                default:
-                                                       
$this->add_file($filename,$rootdir,2);
+                                               $this->add_file($filename, 
$rootdir, 2);
                                                        return true;
                                        }
                                }
@@ -161,14 +179,6 @@
                                        $this->xslfiles[$filename] = 
$new_filename.'.xsl';
                                }
                        }
-                       else
-                       {
-                               foreach ( $filename as $file )
-                               {
-                                       $this->add_file($file);
-                               }
-                       }
-               }
 
                function set_var($name, $value, $append = false)
                {
@@ -230,7 +240,7 @@
                */
                function xsl_parse()
                {
-                       if( is_array($this->xslfiles) && count($this->xslfiles) 
> 0)
+                       if ( is_array($this->xslfiles) && 
count($this->xslfiles) )
                        {
                                $this->xsldata = <<<XSLT
 <?xml version="1.0" encoding="UTF-8"?>
@@ -346,12 +356,15 @@
                        $proc = new XSLTProcessor;
                        $proc->importStyleSheet($xsl); // attach the xsl rules
 
-                       $html =  $proc->transformToXML($xml);
+                       $html =  trim($proc->transformToXML($xml));
 
-                       if (!$html)
+                       if (!$html || $html == '<?xml version="1.0"?>')
                        {
-                               echo "<h2>xml-data</h2>";  
$this->list_lineno($this->xmldata);
-                               echo "<h2>xsl-data</h2>"; 
$this->list_lineno($this->xsldata);
+                               echo "<h2>xml-data</h2>";
+                               $this->list_lineno($this->xmldata);
+
+                               echo "<h2>xsl-data</h2>";
+                               $this->list_lineno($this->xsldata);
                                return '';
                        }
                        return preg_replace('/<!DOCTYPE([^>])+>/', '', $html);
@@ -367,4 +380,3 @@
                        return $this->pparse();
                }
        }
-?>

Modified: trunk/phpgwapi/inc/class.yui.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.yui.inc.php        2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/phpgwapi/inc/class.yui.inc.php        2008-02-02 13:52:39 UTC (rev 
18466)
@@ -7,7 +7,7 @@
         * @license http://www.fsf.org/licenses/gpl.html GNU General Public 
License
         * @package phpgwapi
         * @subpackage gui
-        * @version $Id: class.jscalendar.inc.php,v 1.14 2007/01/14 11:10:08 
skwashd Exp $
+        * @version $Id: class.yui.inc.php 682 2008-02-01 12:19:55Z dave $
         */
 
        /*
@@ -139,6 +139,10 @@
                                        $load = array('element-beta', 
'tabview');
                                        break;
 
+                               case 'treeview-hacked':
+                                       $load = array('treeview-hacked');
+                                       break;
+
                                case 'treeview':
                                        $load = array('treeview');
                                        break;

Modified: trunk/phpgwapi/inc/common_functions.inc.php
===================================================================
--- trunk/phpgwapi/inc/common_functions.inc.php 2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/phpgwapi/inc/common_functions.inc.php 2008-02-02 13:52:39 UTC (rev 
18466)
@@ -259,26 +259,27 @@
                if ($partscount == 2)
                {
                        list($appname,$classname,$functionname) = explode(".", 
$method);
-                       if ( !isset($GLOBALS[$classname]) || 
!is_object($GLOBALS[$classname]) )
+                       $unique_class = "{$appname}-{$classname}";
+                       if ( !isset($GLOBALS[$unique_class]) || 
!is_object($GLOBALS[$unique_class]) )
                        {
                                if ($classparams != '_UNDEF_' && ($classparams 
|| $classparams != 'True'))
                                {
-                                       $GLOBALS[$classname] = 
createObject($appname.'.'.$classname, $classparams);
+                                       $GLOBALS[$unique_class] = 
createObject($appname.'.'.$classname, $classparams);
                                }
                                else
                                {
-                                       $GLOBALS[$classname] = 
createObject($appname.'.'.$classname);
+                                       $GLOBALS[$unique_class] = 
createObject($appname.'.'.$classname);
                                }
                        }
 
                        if ( (is_array($functionparams) || 
is_object($functionparams) || $functionparams != '_UNDEF_') 
                                && ($functionparams || $functionparams != 
'True'))
                        {
-                               return 
$GLOBALS[$classname]->$functionname($functionparams);
+                               return 
$GLOBALS[$unique_class]->$functionname($functionparams);
                        }
                        else
                        {
-                               return $GLOBALS[$classname]->$functionname();
+                               return $GLOBALS[$unique_class]->$functionname();
                        }
                }
                /* if the $method includes a parent class (multi-dimensional) 
then we have to work from it */
@@ -406,12 +407,11 @@
                return '';
        }
 
-       /*
-          @function alessthanb
-          @abstract phpgw version checking, is param 1 < param 2 in phpgw 
versionspeak?
-          @param       $a      phpgw version number to check if less than $b
-          @param       $b      phpgw version number to check $a against
-       #return True if $a < $b
+       /**
+       * phpgw version checking, is param 1 < param 2 in phpgw versionspeak?
+       * @param string $a phpgw version number to check if less than $b
+       * @param string $b phpgw version number to check $a against
+       * @return bool true if $a < $b
         */
        function alessthanb($a,$b,$DEBUG=False)
        {
@@ -422,8 +422,8 @@
                        echo'<br>Input values: '
                                . 'A="'.$a.'", B="'.$b.'"';
                }
-               $newa = ereg_replace('pre','.',$a);
-               $newb = ereg_replace('pre','.',$b);
+               $newa = preg_replace('/pre/','.',$a);
+               $newb = preg_replace('/pre/','.',$b);
                $testa = explode('.',$newa);
                if(@$testa[1] == '')
                {
@@ -511,8 +511,8 @@
                        echo'<br>Input values: '
                                . 'A="'.$a.'", B="'.$b.'"';
                }
-               $newa = ereg_replace('pre','.',$a);
-               $newb = ereg_replace('pre','.',$b);
+               $newa = preg_replace('/pre/','.',$a);
+               $newb = preg_replace('/pre/','.',$b);
                $testa = explode('.',$newa);
                if($testa[3] == '')
                {
@@ -584,7 +584,6 @@
         * @param       $tables and array of tables to have the prefix 
prepended to
         * @return array of table names with the prefix prepended
         */
-
        function prepend_tables_prefix($prefix,$tables)
        {
                foreach($tables as $key => $value)

Modified: trunk/phpgwapi/inc/functions.inc.php
===================================================================
--- trunk/phpgwapi/inc/functions.inc.php        2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/phpgwapi/inc/functions.inc.php        2008-02-02 13:52:39 UTC (rev 
18466)
@@ -226,10 +226,7 @@
                        case E_USER_NOTICE:
                                $log_args['severity'] = 'N';
                                $log->notice($log_args);
-                               
if(isset($GLOBALS['phpgw_info']['server']['log_levels']['global_level']) && 
$GLOBALS['phpgw_info']['server']['log_levels']['global_level'] == 'N')
-                               {
-                                       echo "\n<br>" . lang('ERROR Notice: %1 
in %2 at line %3', $error_msg, $error_file, $error_line) . "<br>\n"; //this 
will be commented in the final version
-                               }
+                               echo "\n<br>" . lang('ERROR Notice: %1 in %2 at 
line %3', $error_msg, $error_file, $error_line) . "<br>\n";
                        //No default, we just ignore it, for now
                }
        }
@@ -447,12 +444,6 @@
        // new log_message class with replaced error.  I'm not sure if it is 
needed, though. -doug
        
include_once(PHPGW_INCLUDE_ROOT.'/phpgwapi/inc/class.log_message.inc.php');
 
-       
/****************************************************************************\
-       * This is a global constant that should be used                         
     *
-       * instead of / or \ in file paths                                       
     *
-       
\****************************************************************************/
-       define('SEP', filesystem_separator());
-
        
/*****************************************************************************\
        * ACL defines - moved here to work for xml-rpc/soap, also               
      *
        
\*****************************************************************************/
@@ -484,8 +475,8 @@
                                print_debug('LID',$login,'app');
                                $login_id = 
$GLOBALS['phpgw']->accounts->name2id($login);
                                print_debug('User ID',$login_id,'app');
-                               
$GLOBALS['phpgw']->accounts->accounts($login_id);
-                               
$GLOBALS['phpgw']->preferences->preferences($login_id);
+                               
$GLOBALS['phpgw']->accounts->set_account($login_id);
+                               
$GLOBALS['phpgw']->preferences->set_account_id($login_id);
                        }
                }
        
/**************************************************************************\
@@ -515,7 +506,7 @@
                
if(isset($GLOBALS['phpgw_info']['user']['preferences']['common']['lang']) && 
$GLOBALS['phpgw_info']['user']['preferences']['common']['lang'] !='en')
                {
                        $GLOBALS['phpgw']->translation->userlang = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['lang'];
-                       $GLOBALS['phpgw']->translation->translation($reset = 
True);
+                       $GLOBALS['phpgw']->translation->__construct($reset = 
True);
                }
 
                $redirect = unserialize(phpgw::get_var('redirect','raw', 
'COOKIE'));
@@ -606,10 +597,14 @@
                {
                        if (!$GLOBALS['phpgw']->acl->check('run', 
PHPGW_ACL_READ, $GLOBALS['phpgw_info']['flags']['currentapp']))
                        {
-                               $GLOBALS['phpgw']->common->phpgw_header( true 
); //!(isset($GLOBALS['phpgw_info']['flags']['nonavbar']) && 
$GLOBALS['phpgw_info']['flags']['nonavbar']) );
+                               $GLOBALS['phpgw']->common->phpgw_header(true);
                                
$GLOBALS['phpgw']->log->write(array('text'=>'W-Permissions, Attempted to access 
%1','p1'=>$GLOBALS['phpgw_info']['flags']['currentapp']));
 
-                               echo '<p><center><b>'.lang('Access not 
permitted').'</b></center>';
+                               $lang_denied = lang('Access not permitted');
+                               echo <<<HTML
+                                       <div class="error">$lang_denied</div>
+
+HTML;
                                $GLOBALS['phpgw']->common->phpgw_exit(True);
                        }
                }

Modified: trunk/phpgwapi/inc/phpmailer/test/phpunit.php
===================================================================
--- trunk/phpgwapi/inc/phpmailer/test/phpunit.php       2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/phpgwapi/inc/phpmailer/test/phpunit.php       2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -5,7 +5,7 @@
 // Written by Fred Yankowski <address@hidden>
 //            OntoSys, Inc  <http://www.OntoSys.com>
 //
-// $Id$
+// $Id: phpunit.php 682 2008-02-01 12:19:55Z dave $
 
 // Copyright (c) 2000 Fred Yankowski
 

Modified: trunk/phpgwapi/inc/sessions/class.sessions.inc.php
===================================================================
--- trunk/phpgwapi/inc/sessions/class.sessions.inc.php  2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/phpgwapi/inc/sessions/class.sessions.inc.php  2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -21,9 +21,8 @@
        *
        * @package phpgwapi
        * @subpackage accounts
-       * @abstract
        */
-       class sessions
+       abstract class sessions
        {
                /**
                * @var string current user login
@@ -119,7 +118,7 @@
                /**
                * Constructor just loads up some defaults from cookies
                */
-               function sessions()
+               public function __construct()
                {
                        $this->db =& $GLOBALS['phpgw']->db;
                        $this->sessionid = phpgw::get_var('sessionid');
@@ -296,7 +295,8 @@
                        $this->iv  = 
$GLOBALS['phpgw_info']['server']['mcrypt_iv'];
                        
$GLOBALS['phpgw']->crypto->init(array($this->key,$this->iv));
 
-                       
$this->read_repositories(@$GLOBALS['phpgw_info']['server']['cache_phpgw_info']);
+                       $use_cache = 
isset($GLOBALS['phpgw_info']['server']['cache_phpgw_info']) ? 
!!$GLOBALS['phpgw_info']['server']['cache_phpgw_info'] : false;
+                       $this->read_repositories($use_cache);
                        
                        if ($this->user['expires'] != -1 && 
$this->user['expires'] < time())
                        {
@@ -347,7 +347,8 @@
                                return False;
                        }
 
-                       if 
(@$GLOBALS['phpgw_info']['server']['sessions_checkip'])
+                       $check_ip = 
isset($GLOBALS['phpgw_info']['server']['sessions_checkip']) ? 
!!$GLOBALS['phpgw_info']['server']['sessions_checkip'] : false;
+                       if ($check_ip)
                        {
                                if (PHP_OS != 'Windows' && (! 
$GLOBALS['phpgw_info']['user']['session_ip'] || 
$GLOBALS['phpgw_info']['user']['session_ip'] != $this->getuser_ip()))
                                {
@@ -374,9 +375,9 @@
                        }
 
                        $GLOBALS['phpgw']->acl->acl($this->account_id);
-                       
$GLOBALS['phpgw']->accounts->accounts($this->account_id);
-                       
$GLOBALS['phpgw']->preferences->preferences($this->account_id);
-                       
$GLOBALS['phpgw']->applications->applications($this->account_id);
+                       
$GLOBALS['phpgw']->accounts->set_account($this->account_id);
+                       
$GLOBALS['phpgw']->preferences->set_account_id($this->account_id);
+                       
$GLOBALS['phpgw']->applications->set_account_id($this->account_id);
 
                        if (! $this->account_lid)
                        {
@@ -415,7 +416,8 @@
                */
                function getuser_ip()
                {
-                       return (isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? 
$_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']);
+                       return phpgw::get_var('HTTP_X_FORWARDED_FOR', 'ip', 
'SERVER',
+                               phpgw::get_var('REMOTE_ADDR', 'ip', 'SERVER'));
                }
 
                /**
@@ -425,7 +427,7 @@
                */
                function phpgw_set_cookiedomain()
                {
-                       $dom = $_SERVER['HTTP_HOST'];
+                       $dom = phpgw::get_var('HTTP_HOST', 'string', 'SERVER');
                        if (preg_match("/^(.*):(.*)$/",$dom,$arr))
                        {
                                $dom = $arr[1];
@@ -511,7 +513,7 @@
                        $user_ip = $this->getuser_ip();
 
                        $blocked = false;
-                       if ( ($blocked = $this->login_blocked($login, 
$_SERVER['REMOTE_ADDR'])) // too many unsuccessful attempts
+                       if ( ($blocked = $this->login_blocked($login, 
$this->getuser_ip())) // too many unsuccessful attempts
                                || ( 
isset($GLOBALS['phpgw_info']['server']['global_denied_users'][$this->account_lid])
 && $GLOBALS['phpgw_info']['server']['global_denied_users'][$this->account_lid] 
)
                                || ($passwd_type != 'known' && 
!$GLOBALS['phpgw']->auth->authenticate($this->account_lid, $this->passwd, 
$this->passwd_type) )
                                || 
$GLOBALS['phpgw']->accounts->get_type($this->account_lid) == 'g')
@@ -532,7 +534,7 @@
                                $this->account_id = 
$GLOBALS['phpgw']->accounts->name2id($this->account_lid);
                        }
                        $GLOBALS['phpgw_info']['user']['account_id'] = 
$this->account_id;
-                       
$GLOBALS['phpgw']->accounts->accounts($this->account_id);
+                       
$GLOBALS['phpgw']->accounts->set_account($this->account_id);
                        $this->sessionid = 
md5($GLOBALS['phpgw']->common->randomstring(15));
                        $this->kp3       = 
md5($GLOBALS['phpgw']->common->randomstring(15));
 
@@ -725,7 +727,8 @@
 
                        $GLOBALS['phpgw_info']['user']['account_id'] = 
$this->account_id;
                        
-                       
$this->read_repositories(@$GLOBALS['phpgw_info']['server']['cache_phpgw_info']);
+                       $use_cache = 
isset($GLOBALS['phpgw_info']['server']['cache_phpgw_info']) ? 
!!$GLOBALS['phpgw_info']['server']['cache_phpgw_info'] : false;
+                       $this->read_repositories($use_cache);
 
                        /* init the crypto object before appsession call below 
*/
                        $this->key = md5($this->kp3 . $this->sessionid . 
$GLOBALS['phpgw_info']['server']['encryptkey']);
@@ -760,7 +763,8 @@
                                return False;
                        }
 
-                       if 
(@$GLOBALS['phpgw_info']['server']['sessions_checkip'])
+                       $verify_ip = 
isset($GLOBALS['phpgw_info']['server']['sessions_checkip']) ? 
!!$GLOBALS['phpgw_info']['server']['sessions_checkip'] : false;
+                       if ( $verify_ip )
                        {
                                if (PHP_OS != 'Windows' && (! 
$GLOBALS['phpgw_info']['user']['session_ip'] || 
$GLOBALS['phpgw_info']['user']['session_ip'] != $this->getuser_ip()))
                                {
@@ -787,8 +791,8 @@
                        }
 
                        $GLOBALS['phpgw']->acl->acl($this->account_id);
-                       
$GLOBALS['phpgw']->accounts->accounts($this->account_id);
-                       
$GLOBALS['phpgw']->preferences->preferences($this->account_id);
+                       
$GLOBALS['phpgw']->accounts->set_account($this->account_id);
+                       
$GLOBALS['phpgw']->preferences->set_account_id($this->account_id);
                        
$GLOBALS['phpgw']->applications->applications($this->account_id);
 
                        if (! $this->account_lid)
@@ -898,12 +902,12 @@
                /**
                * Someone needs to document me
                */
-               function read_repositories($cached = false, $write_cache = true)
+               function read_repositories($cached = true, $write_cache = true)
                {
                        $GLOBALS['phpgw']->acl->acl($this->account_id);
-                       
$GLOBALS['phpgw']->accounts->accounts($this->account_id);
-                       
$GLOBALS['phpgw']->preferences->preferences($this->account_id);
-                       
$GLOBALS['phpgw']->applications->applications($this->account_id);
+                       
$GLOBALS['phpgw']->accounts->set_account($this->account_id);
+                       
$GLOBALS['phpgw']->preferences->set_account_id($this->account_id);
+                       
$GLOBALS['phpgw']->applications->set_account_id($this->account_id);
                        
                        if($cached)
                        {
@@ -929,6 +933,14 @@
                }
 
                /**
+               * Clears the appsession cache, should be called before saving 
preferences or other information which will invalidate the cache
+               */
+               public function clear_phpgw_info_cache()
+               {
+                       $this->appsession('phpgw_info_cache', 'phpgwapi', null);
+               }
+
+               /**
                * Someone needs to document me
                */
                function setup_cache($write_cache=True)
@@ -948,7 +960,9 @@
                        $this->user['account_lid'] = $this->account_lid;
                        $this->user['userid']      = $this->account_lid;
                        $this->user['passwd']      = $this->passwd;
-                       
if(@$GLOBALS['phpgw_info']['server']['cache_phpgw_info'] && $write_cache)
+                       
+                       $use_cache = 
isset($GLOBALS['phpgw_info']['server']['cache_phpgw_info']) ? 
!!$GLOBALS['phpgw_info']['server']['cache_phpgw_info'] : false;
+                       if($use_cache && $write_cache)
                        {
                                $this->delete_cache();
                                
$this->appsession('phpgw_info_cache','phpgwapi',$this->user);
@@ -1201,6 +1215,12 @@
                        //used for repost prevention
                        $extravars['click_history'] = 
$this->generate_click_history();
 
+                       /* enable easy use of xdebug */
+                       if ( isset($_REQUEST['XDEBUG_PROFILE']) )
+                       {
+                               $extravars['XDEBUG_PROFILE'] = 1;
+                       }
+
                        if (is_array($extravars)) //we have something to append
                        {
                                return "{$url}?" . http_build_query($extravars, 
null, $term);
@@ -1219,22 +1239,19 @@
                * @param string $sessionid user's session id string
                * @return mixed the session data
                */
-               function read_session($sessionid)
-               {}
+               abstract public function read_session($sessionid);
 
                /**
                * Remove stale sessions out of the database
                */
-               function clean_sessions()
-               {}
+               abstract public function clean_sessions();
 
                /**
-               * Set paramaters for cookies - only implemented in PHP4 sessions
+               * Set paramaters for cookies
                *
                * @param string $domain domain name to use in cookie
                */
-               function set_cookie_params($domain)
-               {}
+               abstract public function set_cookie_params($domain);
 
                /**
                * Create a new session
@@ -1244,16 +1261,14 @@
                * @param int $now time now as a unix timestamp
                * @param string $session_flags A = Anonymous, N = Normal
                */
-               function register_session($login,$user_ip,$now,$session_flags)
-               {}
+               abstract public function 
register_session($login,$user_ip,$now,$session_flags);
 
                /**
                * Update the date last active info for the session, so the 
login does not expire
                *
                * @return bool did it suceed?
                */
-               function update_dla()
-               {}
+               abstract public function update_dla();
 
                /**
                * Terminate a session
@@ -1262,8 +1277,7 @@
                * @param string $kp3 - NOT SURE
                * @return bool did it suceed?
                */
-               function destroy($sessionid, $kp3)
-               {}
+               abstract public function destroy($sessionid, $kp3);
 
                /**
                * Functions for appsession data and session cache
@@ -1274,8 +1288,7 @@
                * 
                * @param int $accountid user account id, defaults to current 
user (optional)
                */
-               function delete_cache($accountid='')
-               {}
+               abstract public function delete_cache($accountid='');
 
                /**
                * Stores or retrieves information from the sessions cache
@@ -1285,8 +1298,7 @@
                * @param mixed $data data to be stored, if left blank data is 
retreived (optional)
                * @return mixed data from cache, only returned if $data arg is 
not used 
                */
-               function appsession($location = 'default', $appname = '', $data 
= '##NOTHING##')
-               {}
+               abstract public function appsession($location = 'default', 
$appname = '', $data = '##NOTHING##');
 
                /**
                * Get list of normal / non-anonymous sessions
@@ -1300,8 +1312,7 @@
                * @param bool $all_no_sort list all with out sorting (optional) 
default False
                * @return array info for all current sessions  
                */
-               function list_sessions($start,$order,$sort,$all_no_sort = False)
-               {}
+               abstract public function list_sessions($start, $order, $sort, 
$all_no_sort = false);
                
                /**
                * Get the number of normal / non-anonymous sessions
@@ -1309,21 +1320,14 @@
                * @author ralfbecker
                * @return int number of sessions
                */
-               function total()
-               {
-                       return 0;
-               }
+               abstract public function total();
 
                /**
                * Get the list of session variables used for non cookie based 
sessions
                *
-               * @access private
                * @return array the variables which are specific to this 
session type
                */
-               function _get_session_vars()
-               {
-                       return array();
-               }
+               abstract protected function _get_session_vars();
 
                /**
                * Stores or retrieves information from persistant cache

Modified: trunk/phpgwapi/inc/sessions/class.sessions_db.inc.php
===================================================================
--- trunk/phpgwapi/inc/sessions/class.sessions_db.inc.php       2008-02-02 
11:18:25 UTC (rev 18465)
+++ trunk/phpgwapi/inc/sessions/class.sessions_db.inc.php       2008-02-02 
13:52:39 UTC (rev 18466)
@@ -22,9 +22,9 @@
        */
        class sessions_db extends sessions
        {
-               function sessions_db()
+               public function __construct()
                {
-                       parent::sessions();
+                       parent::__construct();
                }
                
                function read_session($sessionid)
@@ -168,13 +168,17 @@
                        }
                }
 
-               function list_sessions($start, $order = 'ASC', $sort = 
'session_lid', $all_no_sort = false)
+               function list_sessions($start, $order, $sort, $all_no_sort = 
false)
                {
-                       $SQL_sort  =  strlen($sort) ? 'ORDER BY '.$sort : '';
-                       $SQL_sort .= (strlen($sort) && strlen($order)) ? ' 
'.$order : '' ;
+                       $sql_sort = '';
+                       if ( strlen($sort) )
+                       {
+                               $order = $order == 'DESC' ? 'DESC' : 'ASC';
+                               $sql_sort = 'ORDER BY ' . $sort = 
$this->db->db_addslashes($sort) . " $order";
+                       }
                        
                        $this->db->limit_query('SELECT * FROM phpgw_sessions'
-                                       . " WHERE session_flags != 'A' 
$SQL_sort", $start, __LINE__, __FILE__);
+                                       . " WHERE session_flags != 'A' 
$sql_sort", $start, __LINE__, __FILE__);
 
                        $values = array();
                                
@@ -219,5 +223,15 @@
                                'domain'        => $this->account_domain
                        );
                }
+
+               /**
+               * Set the paramaters for the cookie
+               *
+               * @internal does nothing for db sessions
+               * @param string $domain the domain for the cookie
+               */
+               function set_cookie_params($domain)
+               {
+                       //nothing to do here
+               }
        }
-?>

Modified: trunk/phpgwapi/inc/sessions/class.sessions_php.inc.php
===================================================================
--- trunk/phpgwapi/inc/sessions/class.sessions_php.inc.php      2008-02-02 
11:18:25 UTC (rev 18465)
+++ trunk/phpgwapi/inc/sessions/class.sessions_php.inc.php      2008-02-02 
13:52:39 UTC (rev 18466)
@@ -26,8 +26,8 @@
        {
                function sessions_php()
                {
-                       //Call abstract class constructor
-                       parent::sessions();
+                       //Call parent constructor
+                       parent::__construct();
                        
                        //respect the config option for cookies
                        
ini_set('session.use_cookies',address@hidden'phpgw_info']['server']['usecookies']);
@@ -53,6 +53,11 @@
                        return array();
                }
 
+               /**
+               * Set the paramaters for the cookie
+               *
+               * @param string $domain the domain for the cookie
+               */
                function set_cookie_params($domain)
                {
                        session_set_cookie_params(0,'/',$domain);
@@ -313,4 +318,12 @@
                                'domain'                => $this->account_domain
                        );
                }
+
+               /**
+               * Remove stale sessions out of the database
+               *
+               * @internal this does nothing as PHP handles this internally
+               */
+               public function clean_sessions()
+               {}
        }

Modified: trunk/phpgwapi/inc/sso/include_login.inc.php
===================================================================
--- trunk/phpgwapi/inc/sso/include_login.inc.php        2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/phpgwapi/inc/sso/include_login.inc.php        2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -153,9 +153,9 @@
                        // 
_debug_array($GLOBALS['phpgw_info']['server']['lang_ctimes']);
                        
                        $lang = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['lang'];
-                       $apps = $GLOBALS['phpgw_info']['user']['apps'];
+                       $apps = (array)$GLOBALS['phpgw_info']['user']['apps'];
                        $apps['phpgwapi'] = true;       // check the api too
-                       while (list($app,$data) = each($apps))
+                       foreach ( array_keys($apps) as $app )
                        {
                                $fname = PHPGW_SERVER_ROOT . 
"/$app/setup/phpgw_$lang.lang";
                                
@@ -164,7 +164,7 @@
                                        $ctime = filectime($fname);
                                        $ltime = 
isset($GLOBALS['phpgw_info']['server']['lang_ctimes'][$lang]) && 
                                                
isset($GLOBALS['phpgw_info']['server']['lang_ctimes'][$lang][$app]) ? 
-                                               
intval($GLOBALS['phpgw_info']['server']['lang_ctimes'][$lang][$app]) : 0;
+                                               (int) 
$GLOBALS['phpgw_info']['server']['lang_ctimes'][$lang][$app] : 0;
                                        //echo "checking lang='$lang', 
app='$app', ctime='$ctime', ltime='$ltime'<br>\n";
                                        
                                        if ($ctime != $ltime)
@@ -181,24 +181,12 @@
                */
                function update_langs()
                {
-                       $GLOBALS['phpgw_setup'] = 
CreateObject('phpgwapi.setup');
-                       $GLOBALS['phpgw_setup']->db = $GLOBALS['phpgw']->db;
-                       
-                       $GLOBALS['phpgw_setup']->detection->check_lang(false);  
// get installed langs
-                       $langs = 
$GLOBALS['phpgw_info']['setup']['installed_langs'];
-                       while (list($lang) = @each($langs))
+                       $langs = 
$GLOBALS['phpgw']->translation->get_installed_langs();
+                       foreach ( array_keys($langs) as $lang )
                        {
                                $langs[$lang] = $lang;
                        }
-                       $_POST['submit'] = true;
-                       $_POST['lang_selected'] = $langs;
-                       $_POST['upgrademethod'] = 'dumpold';
-                       $included = 'from_login';
-                       
-                       /**
-                       * Include languages setup
-                       */
-                       include(PHPGW_SERVER_ROOT . '/setup/lang.php');
+                       $GLOBALS['phpgw']->translation->update_db($langs, 
'dumpold');
                }
 
                function phpgw_display_login($variables)
@@ -284,7 +272,7 @@
                        }
                        $GLOBALS['phpgw']->translation->add_app('login');
                        $GLOBALS['phpgw']->translation->add_app('loginscreen');
-                       if ( ($login_msg = lang('loginscreen_message') ) != 
'loginscreen_message*')
+                       if ( ($login_msg = lang('loginscreen_message') ) != 
'!loginscreen_message')
                        {
                                $this->tmpl->set_var('lang_message', 
stripslashes($login_msg) );
                        }

Modified: trunk/phpgwapi/js/core/base.js
===================================================================
--- trunk/phpgwapi/js/core/base.js      2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/phpgwapi/js/core/base.js      2008-02-02 13:52:39 UTC (rev 18466)
@@ -214,3 +214,35 @@
        }
        el.className = np.join(' ');
 }
+
+/**
+ * Open a new window
+ */
+var phpgw_popup;
+function openwindow(url, h, w)
+{
+       if ( !h )
+       {
+               h = 700;
+       }
+
+       if ( !w )
+       {
+               w = 600;
+       }
+
+       if ( phpgw_popup )
+       {
+               if ( phpgw_popup.closed )
+               {
+                       phpgw_popup.stop;
+                       phpgw_popup.close;
+               }
+       }
+       phpgw_popup = window.open(url, 
"pageWindow","width="+h+",height="+w+",location=no,menubar=no,directories=no,toolbar=no,scrollbars=yes,resizable=yes,status=yes");
+       if (phpgw_popup.opener == null)
+       {
+               phpgw_popup.opener = window;
+       }
+}
+

Modified: trunk/phpgwapi/js/yahoo/examples/datatable/assets/php/JSON.php
===================================================================
--- trunk/phpgwapi/js/yahoo/examples/datatable/assets/php/JSON.php      
2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/phpgwapi/js/yahoo/examples/datatable/assets/php/JSON.php      
2008-02-02 13:52:39 UTC (rev 18466)
@@ -53,7 +53,7 @@
 * @author      Matt Knapp <mdknapp[at]gmail[dot]com>
 * @author      Brett Stimmerman <brettstimmerman[at]gmail[dot]com>
 * @copyright   2005 Michal Migurski
-* @version     CVS: $Id: JSON.php,v 1.2 2007/07/31 21:14:29 jennyhan Exp $
+* @version     CVS: $Id: JSON.php 690 2008-02-02 10:11:33Z dave $
 * @license     http://www.opensource.org/licenses/bsd-license.php
 * @link        http://pear.php.net/pepr/pepr-proposal-show.php?id=198
 */

Modified: trunk/phpgwapi/js/yahoo/examples/editor/assets/JSON.php
===================================================================
--- trunk/phpgwapi/js/yahoo/examples/editor/assets/JSON.php     2008-02-02 
11:18:25 UTC (rev 18465)
+++ trunk/phpgwapi/js/yahoo/examples/editor/assets/JSON.php     2008-02-02 
13:52:39 UTC (rev 18466)
@@ -51,7 +51,7 @@
 * @author      Matt Knapp <mdknapp[at]gmail[dot]com>
 * @author      Brett Stimmerman <brettstimmerman[at]gmail[dot]com>
 * @copyright   2005 Michal Migurski
-* @version     CVS: $Id: JSON.php,v 1.1 2007/07/24 18:36:02 davglass Exp $
+* @version     CVS: $Id: JSON.php 690 2008-02-02 10:11:33Z dave $
 * @license     http://www.opensource.org/licenses/bsd-license.php
 * @link        http://pear.php.net/pepr/pepr-proposal-show.php?id=198
 */

Modified: trunk/phpgwapi/setup/default_records.inc.php
===================================================================
--- trunk/phpgwapi/setup/default_records.inc.php        2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/phpgwapi/setup/default_records.inc.php        2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -150,7 +150,7 @@
 
        $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_config 
(config_app, config_name, config_value) VALUES 
('phpgwapi','sessions_checkip','True')");
 
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_config 
(config_app, config_name, config_value) VALUES ('phpgwapi','log_levels', '" . 
serialize(array( 'global_level' => 'E', 'module' => array(), 'user' => 
array())) ."')");
+       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_config 
(config_app, config_name, config_value) VALUES ('phpgwapi','log_levels', '" . 
serialize(array( 'global_level' => 'N', 'module' => array(), 'user' => 
array())) ."')");
        $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_config 
(config_app, config_name, config_value) VALUES 
('phpgwapi','addressmaster','-3')");
 
        $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_interserv(server_name,server_host,server_url,trust_level,trust_rel,server_mode)
 VALUES ('phpGW 
cvsdemo',NULL,'http://www.phpgroupware.org/cvsdemo/xmlrpc.php',99,0,'xmlrpc')");

Modified: trunk/phpgwapi/setup/phpgw_en.lang
===================================================================
--- trunk/phpgwapi/setup/phpgw_en.lang  2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/phpgwapi/setup/phpgw_en.lang  2008-02-02 13:52:39 UTC (rev 18466)
@@ -1,5 +1,4 @@
-about  common  en      about
-about %1       common  en      About %1
+about  common  en      About
 access common  en      Access
 access not permitted   common  en      Access not permitted
 account has been created       common  en      Account has been created

Modified: trunk/phpgwapi/setup/phpgw_sv.lang
===================================================================
--- trunk/phpgwapi/setup/phpgw_sv.lang  2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/phpgwapi/setup/phpgw_sv.lang  2008-02-02 13:52:39 UTC (rev 18466)
@@ -141,8 +141,7 @@
 end time       common  sv      Sluttid
 entry has been deleted sucessfully     common  sv      Det har blivit borttaget
 entry updated sucessfully      common  sv      Det \xE4r uppdaterat
-equatorial guinea      common  sv              
-EKVATORIALGUINEA
+equatorial guinea      common  sv      EKVATORIALGUINEA
 eritrea        common  sv      ERITREA
 error  common  sv      Fel
 error creating %1 %2 directory common  sv      Fel vid skapandet av %1 %2 mapp
@@ -556,3 +555,4 @@
 zambia common  sv      ZAMBIA
 zimbabwe       common  sv      ZIMBABWE
 zip code       common  sv      Postnummer
+

Modified: trunk/phpgwapi/setup/setup.inc.php
===================================================================
--- trunk/phpgwapi/setup/setup.inc.php  2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/phpgwapi/setup/setup.inc.php  2008-02-02 13:52:39 UTC (rev 18466)
@@ -71,3 +71,4 @@
        $setup_info['notifywindow']['tables']           = array();
        $setup_info['notifywindow']['hooks']            = array();
        $setup_info['notifywindow']['hooks'][]          = 'home';
+

Modified: trunk/phpgwapi/setup/tables_current.inc.php
===================================================================
--- trunk/phpgwapi/setup/tables_current.inc.php 2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/phpgwapi/setup/tables_current.inc.php 2008-02-02 13:52:39 UTC (rev 
18466)
@@ -411,7 +411,7 @@
                        'fd' => array(
                                'org_id' => array('type' => 'int','precision' 
=> '4','nullable' => False),
                                'name' => array('type' => 'varchar','precision' 
=> '80','nullable' => False),
-                               'active' => array('type' => 'char','precision' 
=> '1','nullable' => False,'default' => 'Y'),
+                               'active' => array('type' => 'char','precision' 
=> '1','nullable' => True,'default' => 'Y'),
                                'parent' => array('type' => 'int','precision' 
=> '4','nullable' => True),
                                'created_on' => array('type' => 
'int','precision' => '4','nullable' => False),
                                'created_by' => array('type' => 
'int','precision' => '4','nullable' => False),
@@ -441,7 +441,7 @@
                        'fd' => array(
                                'contact_addr_id' => array('type' => 
'auto','nullable' => False),
                                'contact_id' => array('type' => 
'int','precision' => '4','nullable' => False),
-                               'addr_type_id' => array('type' => 
'int','precision' => '4','nullable' => False),
+                               'addr_type_id' => array('type' => 
'int','precision' => '4','nullable' => True),
                                'add1' => array('type' => 'varchar','precision' 
=> '64','nullable' => True),
                                'add2' => array('type' => 'varchar','precision' 
=> '64','nullable' => True),
                                'add3' => array('type' => 'varchar','precision' 
=> '64','nullable' => True),
@@ -578,7 +578,11 @@
                                'precision_' => array('type' => 
'int','precision' => '4','nullable' => True),
                                'scale' => array('type' => 'int','precision' => 
'4','nullable' => True),
                                'default_value' => array('type' => 
'varchar','precision' => '20','nullable' => True),
-                               'nullable' => array('type' => 
'varchar','precision' => '5','nullable' => True)
+                               'nullable' => array('type' => 
'varchar','precision' => '5','nullable' => True),
+                               'disabled' => array('type' => 'int','precision' 
=> '2','nullable' => True),
+                               'lookup_form' => array('type' => 
'int','precision' => '2','nullable' => True),
+                               'custom' => array('type' => 'int','precision' 
=> '2','nullable' => True,'default' => 1),
+                               'helpmsg' => array('type' => 'text','nullable' 
=> True)
                        ),
                        'pk' => array('appname','location','id'),
                        'fk' => array(),

Modified: trunk/phpgwapi/setup/tables_update.inc.php
===================================================================
--- trunk/phpgwapi/setup/tables_update.inc.php  2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/phpgwapi/setup/tables_update.inc.php  2008-02-02 13:52:39 UTC (rev 
18466)
@@ -191,15 +191,15 @@
                $GLOBALS['setup_info']['phpgwapi']['currentver'] = '0.9.14.508';
                return $GLOBALS['setup_info']['phpgwapi']['currentver'];
        }
-
+/*
        $test[] = '0.9.17.001';
        function phpgwapi_upgrade0_9_17_001()
        {
                $GLOBALS['setup_info']['phpgwapi']['currentver'] = '0.9.14.508';
                return $GLOBALS['setup_info']['phpgwapi']['currentver'];
        }
+*/
 
-
        $test[] = '0.9.14.508';
        function phpgwapi_upgrade0_9_14_508()
        {       
@@ -1185,13 +1185,89 @@
        $test[] = '0.9.16.010';
        function phpgwapi_upgrade0_9_16_010()
        {
+               return $GLOBALS['setup_info']['phpgwapi']['currentver']= 
'0.9.16.011';
+       }
+
+       $test[] = '0.9.16.011';
+       function phpgwapi_upgrade0_9_16_011()
+       {
+               return $GLOBALS['setup_info']['phpgwapi']['currentver']= 
'0.9.16.012';
+       }
+
+       $test[] = '0.9.16.012';
+       /**
+       * Update phpgwapi from stable
+       */
+
+       function phpgwapi_upgrade0_9_16_012()
+       {
                return $GLOBALS['setup_info']['phpgwapi']['currentver']= 
'0.9.17.500';
        }
 
 
+       /**
+       * Update phpgwapi from intermediate
+       */
+       $test[] = '0.9.17.000';
+       function phpgwapi_upgrade0_9_17_000()
+       {
+               $GLOBALS['setup_info']['phpgwapi']['currentver'] = '0.9.17.001';
+               return $GLOBALS['setup_info']['phpgwapi']['currentver'];
+       }
+       $test[] = '0.9.17.001';
+       function phpgwapi_upgrade0_9_17_001()
+       {
+               $GLOBALS['setup_info']['phpgwapi']['currentver'] = '0.9.17.002';
+               return $GLOBALS['setup_info']['phpgwapi']['currentver'];
+       }
+       $test[] = '0.9.17.002';
+       function phpgwapi_upgrade0_9_17_002()
+       {
+               $GLOBALS['setup_info']['phpgwapi']['currentver'] = '0.9.17.003';
+               return $GLOBALS['setup_info']['phpgwapi']['currentver'];
+       }
+       $test[] = '0.9.17.003';
+       function phpgwapi_upgrade0_9_17_003()
+       {
+               $GLOBALS['setup_info']['phpgwapi']['currentver'] = '0.9.17.004';
+               return $GLOBALS['setup_info']['phpgwapi']['currentver'];
+       }
+       $test[] = '0.9.17.004';
+       function phpgwapi_upgrade0_9_17_004()
+       {
+               $GLOBALS['setup_info']['phpgwapi']['currentver'] = '0.9.17.512';
+               return $GLOBALS['setup_info']['phpgwapi']['currentver'];
+
+/*
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('phpgw_cust_attribute','lookup_form',array(
+                       'type' => 'int',
+                       'precision' => '2',
+                       'nullable' => True
+               ));
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('phpgw_cust_attribute','custom',array(
+                       'type' => 'int',
+                       'precision' => '2',
+                       'default' => 1,
+                       'nullable' => True
+               ));
+
+               $GLOBALS['phpgw_setup']->oProc->query("UPDATE 
phpgw_cust_attribute SET custom = 1");
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['phpgwapi']['currentver'] = 
'0.9.17.513';
+                       return $GLOBALS['setup_info']['phpgwapi']['currentver'];
+               }
+*/
+       }
+
        $test[] = '0.9.17.500';
        function phpgwapi_upgrade0_9_17_500()
        {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
                
$GLOBALS['phpgw_setup']->oProc->CreateTable('phpgw_cust_fields',array(
                        'fd' => array(
                                'cust_field_id' => array('type' => 
'auto','nullable' => False),
@@ -1241,9 +1317,12 @@
                $GLOBALS['phpgw_setup']->oProc->query('INSERT INTO 
phpgw_cust_field_types(cust_field_type_descr) VALUES(\'list\')');
                $GLOBALS['phpgw_setup']->oProc->query('INSERT INTO 
phpgw_cust_field_types(cust_field_type_descr) VALUES(\'db lookup\')');
 
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
                $GLOBALS['setup_info']['phpgwapi']['currentver'] = '0.9.17.501';
                return $GLOBALS['setup_info']['phpgwapi']['currentver'];
        }
+       }
 
        $test[] = '0.9.17.501';
        function phpgwapi_upgrade0_9_17_501()
@@ -1277,14 +1356,12 @@
                        )
                );
 
-               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_acl_location (appname,id, descr) VALUES ('hrm', '.', 'Top')");
-               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_acl_location (appname,id, descr, allow_grant) VALUES ('hrm', '.user', 
'User',1)");
-               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_acl_location (appname,id, descr) VALUES ('hrm', '.job', 'Job 
description')");
-               
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
                $GLOBALS['setup_info']['phpgwapi']['currentver'] = '0.9.17.502';
-               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit();
                return $GLOBALS['setup_info']['phpgwapi']['currentver'];
        }
+       }
 
 
        $test[] = '0.9.17.502';
@@ -1351,10 +1428,12 @@
                $GLOBALS['phpgw_setup']->oProc->query("DELETE FROM 
phpgw_acl_location WHERE appname = 'tts' AND id = '.'");
                $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_acl_location (appname,id, 
descr,allow_grant,allow_c_attrib,c_attrib_table) VALUES ('tts', '.', 
'Top',1,1,'phpgw_tts_tickets')");
                
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
                $GLOBALS['setup_info']['phpgwapi']['currentver'] = '0.9.17.503';
-               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit();
                return $GLOBALS['setup_info']['phpgwapi']['currentver'];
        }
+       }
 
        $test[] = '0.9.17.503';
        function phpgwapi_upgrade0_9_17_503()
@@ -1379,10 +1458,12 @@
                        )
                );
        
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
                $GLOBALS['setup_info']['phpgwapi']['currentver'] = '0.9.17.504';
-               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit();
                return $GLOBALS['setup_info']['phpgwapi']['currentver'];
        }
+       }
        
        $test[] = '0.9.17.504';
        function phpgwapi_upgrade0_9_17_504()
@@ -1396,10 +1477,12 @@
                        'nullable' => False
                ));
        
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
                $GLOBALS['setup_info']['phpgwapi']['currentver'] = '0.9.17.505';
-               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit();
                return $GLOBALS['setup_info']['phpgwapi']['currentver'];
        }
+       }
 
        $test[] = '0.9.17.505';
        function phpgwapi_upgrade0_9_17_505()
@@ -1412,10 +1495,12 @@
                        'default' => '::1'
                ));
 
-               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit();
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
                $GLOBALS['setup_info']['phpgwapi']['currentver'] = '0.9.17.506';
                return $GLOBALS['setup_info']['phpgwapi']['currentver'];
        }
+       }
 
        $test[] = '0.9.17.506';
        function phpgwapi_upgrade0_9_17_506()
@@ -1438,10 +1523,13 @@
                                'uc' => array()
                                )
                );
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
                $GLOBALS['setup_info']['phpgwapi']['currentver'] = '0.9.17.507';
-               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit();
                return $GLOBALS['setup_info']['phpgwapi']['currentver'];
        }
+       }
 
        $test[] = '0.9.17.507';
        function phpgwapi_upgrade0_9_17_507()
@@ -1491,10 +1579,13 @@
                                'uc' => array()
                                )
                );
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
                $GLOBALS['setup_info']['phpgwapi']['currentver'] = '0.9.17.508';
-               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit();
                return $GLOBALS['setup_info']['phpgwapi']['currentver'];
        }
+       }
 
        $test[] = '0.9.17.508';
        function phpgwapi_upgrade0_9_17_508()
@@ -1531,10 +1622,12 @@
                                )
                );
 
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
                $GLOBALS['setup_info']['phpgwapi']['currentver'] = '0.9.17.509';
-               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit();
                return $GLOBALS['setup_info']['phpgwapi']['currentver'];
        }
+       }
        
        $test[] = '0.9.17.509';
        function phpgwapi_upgrade0_9_17_509()
@@ -1549,10 +1642,12 @@
                        'default' => '0'
                ));
 
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
                $GLOBALS['setup_info']['phpgwapi']['currentver'] = '0.9.17.510';
-               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit();
                return $GLOBALS['setup_info']['phpgwapi']['currentver'];
        }
+       }
 
        $test[] = '0.9.17.510';
        function phpgwapi_upgrade0_9_17_510()
@@ -1565,14 +1660,19 @@
 
                $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit();
 
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
                $GLOBALS['setup_info']['phpgwapi']['currentver'] = '0.9.17.511';
                return $GLOBALS['setup_info']['phpgwapi']['currentver'];
        }       
+       }       
 
 
        $test[] = '0.9.17.511';
        function phpgwapi_upgrade0_9_17_511()
        {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
                
$GLOBALS['phpgw_setup']->oProc->CreateTable('phpgw_mail_handler',array(
                        'fd' => array(
                                'handler_id' => array('type' => 
'auto','nullable' => False),
@@ -1588,8 +1688,257 @@
                        'uc' => array()
                ));
 
-
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
                $GLOBALS['setup_info']['phpgwapi']['currentver'] = '0.9.17.512';
                return $GLOBALS['setup_info']['phpgwapi']['currentver'];
        }
+       }
+       
+       $test[] = '0.9.17.512';
+       function phpgwapi_upgrade0_9_17_512()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('phpgw_cust_attribute','disabled',array(
+                       'type' => 'int',
+                       'precision' => '2',
+                       'nullable' => True
+               ));
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('phpgw_cust_attribute','helpmsg',array(
+                       'type' => 'text',
+                       'nullable' => True
+               ));
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('phpgw_cust_attribute','lookup_form',array(
+                       'type' => 'int',
+                       'precision' => '2',
+                       'nullable' => True
+               ));
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('phpgw_cust_attribute','custom',array(
+                       'type' => 'int',
+                       'precision' => '2',
+                       'default' => 1,
+                       'nullable' => True
+               ));
+
+               $GLOBALS['phpgw_setup']->oProc->query("UPDATE 
phpgw_cust_attribute SET custom = 1");
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['phpgwapi']['currentver'] = 
'0.9.17.513';
+                       return $GLOBALS['setup_info']['phpgwapi']['currentver'];
+               }
+       }
+
+       /*
+       $test[] = '0.9.17.513';
+       function phpgwapi_upgrade0_9_17_513()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+// -- fix addressbook : insertion of organisation
+
+               
$GLOBALS['phpgw_setup']->oProc->AlterColumn('phpgw_contact_addr','addr_type_id',array(
+                       'type' => 'int',
+                       'precision' => '4',
+                       'nullable' => True
+               ));
+
+               
$GLOBALS['phpgw_setup']->oProc->AlterColumn('phpgw_contact_org','active',array(
+                       'type' => 'char',
+                       'precision' => '1',
+                       'nullable' => True,
+                       'default' => 'Y'
+               ));
+//--
+
+//-- setting default log_level to N (Notice)
+
+               $GLOBALS['phpgw_setup']->oProc->query("SELECT config_value FROM 
phpgw_config WHERE config_app = 'phpgwapi' AND config_name = 'log_levels' "); 
+               if ( $GLOBALS['phpgw_setup']->oProc->next_record() )
+               {
+                       $log_levels                     => 
unserialize($GLOBALS['phpgw_setup']->oProc->f('config_value'));
+                       $log_levels['global_level'] = 'N';
+                       $GLOBALS['phpgw_setup']->oProc->query("UPDATE 
phpgw_config SET config_value ='" . serialize($log_levels) . "' WHERE 
config_app = 'phpgwapi' AND config_name = 'log_levels' ");                  
+               }
+               else
+               {
+                       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_config (config_app, config_name, config_value) VALUES 
('phpgwapi','log_levels', '" . serialize(array( 'global_level' => 'N', 'module' 
=> array(), 'user' => array())) ."')");
+               }
+//--
+
+
+//-- phpgw_acl_location : new table due to change in pk
+
+               
$GLOBALS['phpgw_setup']->oProc->RenameTable('phpgw_acl_location','phpgw_acl_location_old');
+
+               
$GLOBALS['phpgw_setup']->oProc->CreateTable('phpgw_acl_location',array
+               (
+                       'fd' => array
+                       (
+                               'id' => array('type' => 'auto','precision' => 
'4','nullable' => False),
+                               'app_id' => array('type' => 'int','precision' 
=> '4','nullable' => False),
+                               'name' => array('type' => 'varchar','precision' 
=> '50','nullable' => False),
+                               'descr' => array('type' => 
'varchar','precision' => '100','nullable' => False),
+                               'allow_grant' => array('type' => 
'int','precision' => '2','nullable' => True),
+                               'allow_c_attrib' => array('type' => 
'int','precision' => '2','nullable' => True),
+                               'c_attrib_table' => array('type' => 
'varchar','precision' => '25','nullable' => True)
+                       ),
+                       'pk' => array('id'),
+                       'fk' => array(),
+                       'ix' => array(),
+                       'uc' => array()
+               ));
+
+// add records
+
+               $location = array();
+               $GLOBALS['phpgw_setup']->oProc->query("SELECT 
phpgw_acl_location_old.*,phpgw_applications.app_id FROM phpgw_acl_location_old 
$GLOBALS['phpgw_setup']->oProc->m_odb->join phpgw_applications ON 
phpgw_acl_location_old.appname = phpgw_applications.app_name"); 
+               while ( $GLOBALS['phpgw_setup']->oProc->next_record() )
+               {
+                       $location[]=array
+                       (
+                                       'app_id'                        => 
$GLOBALS['phpgw_setup']->oProc->f('app_id'),
+                                       'name'                          => 
$GLOBALS['phpgw_setup']->oProc->f('id'),
+                                       'descr'                         => 
$GLOBALS['phpgw_setup']->oProc->f('descr'),
+                                       'allow_grant'           => 
$GLOBALS['phpgw_setup']->oProc->f('allow_grant'),
+                                       'allow_c_attrib'        => 
$GLOBALS['phpgw_setup']->oProc->f('allow_c_attrib'),
+                                       'c_attrib_table'        => 
$GLOBALS['phpgw_setup']->oProc->f('c_attrib_table'),
+                       );
+               }
+
+               foreach ($location as $entry)
+               {
+                       $GLOBALS['phpgw_setup']->oProc->query('INSERT INTO 
phpgw_acl_location (' . implode(',',array_keys($entry)) . ') VALUES (' . 
$GLOBALS['phpgw_setup']->oProc->validate_insert(array_values($entry)) . ')');
+               }
+               
+               unset($location);
+
+               
$GLOBALS['phpgw_setup']->oProc->DropTable('fphpgw_acl_location_old');
+//-------------------
+
+
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('phpgw_acl','acl_app_id',array
+               (
+                       'type' => 'int',
+                       'precision' => '4',
+                       'nullable' => True
+               ));
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('phpgw_acl','acl_location_id',array
+               (
+                       'type' => 'int',
+                       'precision' => '4',
+                       'nullable' => True
+               ));
+
+               $GLOBALS['phpgw_setup']->oProc->query("SELECT 
phpgw_acl.acl_appname, phpgw_applications.app_id FROM phpgw_acl 
$GLOBALS['phpgw_setup']->oProc->m_odb->join phpgw_applications ON 
phpgw_acl.acl_appname = phpgw_applications.app_name GROUP BY 
phpgw_acl.acl_appname"); 
+               while ( $GLOBALS['phpgw_setup']->oProc->next_record() )
+               {
+                       $app[]=array
+                       (
+                                       'app_id'                        => 
$GLOBALS['phpgw_setup']->oProc->f('app_id'),
+                                       'acl_appname'           => 
$GLOBALS['phpgw_setup']->oProc->f('acl_appname')
+                       );
+               }
+
+               foreach ($app as $entry)
+               {
+                       $GLOBALS['phpgw_setup']->oProc->query("UPDATE phpgw_acl 
SET acl_app_id ='" $entry['app_id'] . "' WHERE acl_appname = '" . 
$entry['acl_appname'] . "'");
+               }
+
+               unset($app);
+               
$GLOBALS['phpgw_setup']->oProc->DropColumn('phpgw_acl',null,'acl_appname');
+
+
+               $location = array();
+               $GLOBALS['phpgw_setup']->oProc->query("SELECT 
phpgw_acl.acl_location, phpgw_acl_location.id FROM phpgw_acl 
$GLOBALS['phpgw_setup']->oProc->m_odb->join phpgw_acl_location ON 
phpgw_acl.acl_location = phpgw_acl_location.name GROUP BY 
phpgw_acl.acl_location"); 
+               while ( $GLOBALS['phpgw_setup']->oProc->next_record() )
+               {
+                       $location[]=array
+                       (
+                                       'location_id'           => 
$GLOBALS['phpgw_setup']->oProc->f('id'),
+                                       'acl_location'          => 
$GLOBALS['phpgw_setup']->oProc->f('acl_location')
+                       );
+               }
+
+               foreach ($app as $entry)
+               {
+                       $GLOBALS['phpgw_setup']->oProc->query("UPDATE phpgw_acl 
SET acl_location_id ='" $entry['location_id'] . "' WHERE acl_location = '" . 
$entry['acl_location'] . "'");
+               }
+
+               unset($location);
+
+               
$GLOBALS['phpgw_setup']->oProc->DropColumn('phpgw_acl',null,'acl_location');
+
+//---------- history_log
+
+
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('phpgw_history_log','history_app_id',array
+               (
+                       'type' => 'int',
+                       'precision' => '4',
+                       'nullable' => True
+               ));
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('phpgw_history_log','history_location_id',array
+               (
+                       'type' => 'int',
+                       'precision' => '4',
+                       'nullable' => True
+               ));
+
+               $GLOBALS['phpgw_setup']->oProc->query("SELECT 
phpgw_history_log.history_appname, phpgw_applications.app_id FROM 
phpgw_history_log $GLOBALS['phpgw_setup']->oProc->m_odb->join 
phpgw_applications ON phpgw_acl.history_appname = phpgw_applications.app_name 
GROUP BY history_appname"); 
+               while ( $GLOBALS['phpgw_setup']->oProc->next_record() )
+               {
+                       $app[]=array
+                       (
+                                       'app_id'                                
=> $GLOBALS['phpgw_setup']->oProc->f('app_id'),
+                                       'history_appname'               => 
$GLOBALS['phpgw_setup']->oProc->f('history_appname')
+                       );
+               }
+
+               foreach ( $app as $entry )
+               {
+                       $GLOBALS['phpgw_setup']->oProc->query("UPDATE 
phpgw_history_log SET history_app_id ='" $entry['app_id'] . "' WHERE 
history_appname = '" . $entry['history_appname'] . "'");
+               }
+
+               unset($app);
+               
$GLOBALS['phpgw_setup']->oProc->DropColumn('phpgw_history_log',null,'history_appname');
+
+
+//-------------interlink
+
+
+               
$GLOBALS['phpgw_setup']->oProc->CreateTable('phpgw_interlink',array
+               (
+                       'fd' => array
+                       (
+                               'interlink_id'          => array('type' => 
'auto','precision' => '4','nullable' => False),
+                               'location1_id'          => array('type' => 
'int','precision' => '4','nullable' => False),
+                               'location1_item_id'     => array('type' => 
'int','precision' => '4','nullable' => False),
+                               'location2_id'          => array('type' => 
'int','precision' => '4','nullable' => False),
+                               'location2_item_id'     => array('type' => 
'int','precision' => '4','nullable' => False),
+                               'is_private'            => array('type' => 
'int','precision' => '2','nullable' => False),
+                               'account_id'            => array('type' => 
'int','precision' => '4','nullable' => False),
+                               'entry_date'            => array('type' => 
'int','precision' => '4','nullable' => False),
+                               'start_date'            => array('type' => 
'int','precision' => '4','nullable' => False),
+                               'end_date'                      => array('type' 
=> 'int','precision' => '4','nullable' => False),
+                       ),
+                       'pk' => array('interlink_id'), // not sure about the pk
+                       'fk' => array(),
+                       'ix' => array(),
+                       'uc' => array()
+               ));
+
+// TODO:
+//# phpgw_cust_attribute
+//# phpgw_cust_choice
+//# phpgw_cust_function 
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['phpgwapi']['currentver'] = 
'0.9.17.514';
+                       return $GLOBALS['setup_info']['phpgwapi']['currentver'];
+               }
+       }
+*/
 ?>

Modified: trunk/phpgwapi/templates/base/images/down_nm.png
===================================================================
--- trunk/phpgwapi/templates/base/images/down_nm.png    2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/phpgwapi/templates/base/images/down_nm.png    2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -1,4 +1,4 @@
 \x89PNG
 
-
+
 IHDRVu\\xE7bKGD\xFF\xFF\xFF\xA0\xBD\xA7\x93     
pHYs\xD2\xDD~\xFCSIDATx\x9Cc<p\xE0)\x80\x89$\xD5\xE4h`d``\xF8\xCFŸ\x87(\xC5\xDB\xF6\xB3028p\x80\xF1\xDB\xA2ÝDHL1\>MȊQ4`ӄ\xAECL.\xC5X5\xE0S\x8CS>@\xB2\xF64"\x9C<address@hidden
\ No newline at end of file

Added: trunk/phpgwapi/templates/base/images/source/README
===================================================================
--- trunk/phpgwapi/templates/base/images/source/README                          
(rev 0)
+++ trunk/phpgwapi/templates/base/images/source/README  2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -0,0 +1 @@
+php-logo.svg Taken from 
http://upload.wikimedia.org/wikipedia/en/8/83/PHP_logo.svg on 15-Dec-2007 - 
created by http://en.wikipedia.org/wiki/User:Mysid

Added: trunk/phpgwapi/templates/base/images/source/php-logo.svg
===================================================================
--- trunk/phpgwapi/templates/base/images/source/php-logo.svg                    
        (rev 0)
+++ trunk/phpgwapi/templates/base/images/source/php-logo.svg    2008-02-02 
13:52:39 UTC (rev 18466)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" 
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd";>
+<!-- Creator: CorelDRAW -->
+<svg xmlns="http://www.w3.org/2000/svg"; 
xmlns:odm="http://product.corel.com/CGS/11/cddns/"; xml:space="preserve" 
width="300px" height="159px" style="shape-rendering:geometricPrecision; 
text-rendering:geometricPrecision; image-rendering:optimizeQuality; 
fill-rule:evenodd"
+     viewBox="0 0 300 160">
+ <defs>
+  <style type="text/css">
+   <![CDATA[
+    .str0 {stroke:#FFFFFF;stroke-width:2;stroke-linejoin:round}
+    .fil3 {fill:#000000;fill-rule:evenodd}
+    .fil2 {fill:#6C7EB7}
+    .fil0 {fill:url(#id0)}
+    .fil1 {fill:url(#id1)}
+   ]]>
+  </style>
+  <linearGradient id="id0" gradientUnits="userSpaceOnUse" x1="150" y1="84" 
x2="299" y2="84">
+   <stop offset="0" style="stop-color:#687197"/>
+   <stop offset="0.509804" style="stop-color:#656E94"/>
+   <stop offset="1" style="stop-color:#000000"/>
+  </linearGradient>
+  <radialGradient id="id1" gradientUnits="userSpaceOnUse" cx="16" cy="0" 
r="107" fx="16" fy="0">
+   <stop offset="0" style="stop-color:#DDDCE9"/>
+   <stop offset="1" style="stop-color:#687197"/>
+  </radialGradient>
+ </defs>
+ <g id="Layer 1">
+  <path class="fil0" d="M150 158c82,0 149,-35 149,-78 0,-31 -35,-58 
-85,-71l-64 149z"/>
+  <path class="fil1" d="M150 158c-33,0 -64,-6 -89,-16 -36,-14 -60,-37 -60,-62 
0,-43 67,-78 149,-78 23,0 45,2 64,7l-64 149z"/>
+  <ellipse class="fil2" cx="150" cy="80" rx="143" ry="73"/>
+  <path class="fil3 str0" d="M116 104l16 -81 19 0 -4 21 18 0c16,1 22,9 
20,19l-7 41 -20 0 7 -37c1,-5 1,-8 -6,-8l-15 0 -9 45 -19 0z"/>
+  <path class="fil3 str0" d="M45 125l16 -81 37 0c16,1 24,9 24,23 0,24 -19,38 
-36,37l-18 0 -4 21 -19 0zm27 -36l5 -30 13 0c7,0 12,3 12,9 -1,17 -9,20 
-18,21l-12 0z"/>
+  <path class="fil3 str0" d="M179 125l15 -81 38 0c16,1 24,9 24,23 -1,24 -20,38 
-37,37l-17 0 -4 21 -19 0zm26 -36l6 -30 12 0c8,0 13,3 12,9 0,17 -8,20 -18,21l-12 
0z"/>
+ </g>
+</svg>

Modified: trunk/phpgwapi/templates/base/images/stock_add.png
===================================================================
--- trunk/phpgwapi/templates/base/images/stock_add.png  2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/phpgwapi/templates/base/images/stock_add.png  2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -1,13 +1,13 @@
 \x89PNG
 
-
+
 
IHDR\xE0w=\xF8bKGD\xFF\xFF\xFF\xA0\xBD\xA7\x93\xE1IDATx\xDAՕ\xCFNQ\xC63\xAD\xC1RAD6\xF5X\xB2!\xEC
       \xEE\xF5\\xFA
-\xB8"\xF1\xBAa\x8B.H$\x81Ȓ\xE3°\x80\x88
+\xB8"\xF1\xBAa\x8B.H$\x81Ȓ\xE3°\x80\x88
 \x84
 address@hidden"\xE0t\xBDB\xA97v
-z\xF5ۖ\xFE\x98\xFB\xE4y!Ab\xAB\x90\xEC"\x80
-\xE0\x94\xCFX\xFB\xB1\x83S\xD8\xF3\xFF\x8F\xA7@
-\xB8\x8A5\xBEa\x9F\xFA\x81\x9Dط(\x9D\xDD
+z\xF5ۖ\xFE\x98\xFB\xE4y!Ab\xAB\x90\xEC"\x80
+\xE0\x94\xCFX\xFB\xB1\x83S\xD8\xF3\xFF\x8F\xA7@
+\xB8\x8A5\xBEa\x9F\xFA\x81\x9Dط(\x9D\xDD
 
I\x92\xD8BL#-\xB9\xF3\xEFu\xBB\xEC\xB6xRӖ\x9C\xBA\xA9\xD0j5\xFD\xCF/\xC0\xBE\xDC7Ew
-H\x9BIY\x81\x8C\xBC\xCFk?\xA9\x9E\xD7B\xE9*U\xE7\xA0t\xCA`\xBA\x8F\xF1\xD1
\x8F\x87\xD2x\xFA\xFF\xE4\xED\xF2\xEE\xED,\xC0K\xA0\:\xECG\xF6\xD1 
\xDF7\xF7\xDB\xD6\xF4\xEC\xA2\xC1\xC6\xEEa\xE8\xFF\xC9\xF1\xEFHv\x85z\xB0\xF4u\xA7\xF4'\xE4
 
;\xF6\xD7uQ\xD5R\_S&\xBB\xCC%\x80`1\xCAj.\xB7B\xC5U8\x85<\xF3\xEF\xDB9\xFF\xAC\xDB\xC0I\x81\xAC\xAFf\xCA`\xD3\xF2\xB3'CT\e:address@hidden
 4Q\xC6\xC15\xDCnZ\xB58\xF6g\xE6v\xAB\xA2\xF2\xB7\x8CS\xC8S-;f\xCFz"      
\xE0u\xFE0    d;\xBD  V\x97\xDB4
+H\x9BIY\x81\x8C\xBC\xCFk?\xA9\x9E\xD7B\xE9*U\xE7\xA0t\xCA`\xBA\x8F\xF1\xD1
\x8F\x87\xD2x\xFA\xFF\xE4\xED\xF2\xEE\xED,\xC0K\xA0\:\xECG\xF6\xD1 
\xDF7\xF7\xDB\xD6\xF4\xEC\xA2\xC1\xC6\xEEa\xE8\xFF\xC9\xF1\xEFHv\x85z\xB0\xF4u\xA7\xF4'\xE4
 
;\xF6\xD7uQ\xD5R\_S&\xBB\xCC%\x80`1\xCAj.\xB7B\xC5U8\x85<\xF3\xEF\xDB9\xFF\xAC\xDB\xC0I\x81\xAC\xAFf\xCA`\xD3\xF2\xB3'CT\e:address@hidden
 4Q\xC6\xC15\xDCnZ\xB58\xF6g\xE6v\xAB\xA2\xF2\xB7\x8CS\xC8S-;f\xCFz"      
\xE0u\xFE0    d;\xBD  V\x97\xDB4
 
<v=\x94\xF5PB\xA884\xD65P\xA4dE'\xA5\xE6\xAA\xD3[p\xA7\xDE\xE4\xCB?\xC0\xA8\xAE\xF6\x94{\xFCIEND\xAEB`\x82
\ No newline at end of file

Modified: trunk/phpgwapi/templates/base/images/stock_cancel.png
===================================================================
--- trunk/phpgwapi/templates/base/images/stock_cancel.png       2008-02-02 
11:18:25 UTC (rev 18465)
+++ trunk/phpgwapi/templates/base/images/stock_cancel.png       2008-02-02 
13:52:39 UTC (rev 18466)
@@ -1,6 +1,6 @@
 \x89PNG
 
-
+
 
IHDR\xF3\xFFabKGD\xFF\xFF\xFF\xA0\xBD\xA7\x93\xE9IDATxڝ\x93Kh\u\x87\xBF\xFB\xBF\xF7N\xE6Ν;\x934\xB1L
 
f*t\xA11V\x9B\xA6\x92(\xC1"\xAD\x88Z\xDDAD\xC8N\xA2\x88\xC6RRpS7\x8A\xB8\xB4\xE2\xA6"\x82!\xB15\x8D\xA9v\xC6\xF1\xD1Fg2\x93y8\x99\xFB~\xB9\x90\x91*v\xA1\xBF\xD59\x9C\xF3\xFD8\xE7\xC0\x91\xF9S\xBA\xE2\x98B\x8F\xE3x\x9B\xFF\xAAt:=l\xE8\xB6\xF8P\xB6\xDF3
c\xE1f}\x9A\xA6\x9DB\xE4UU\xFD^UՑ\xBF
 z\xAEϾ\xF3\xF4\xC3\xF1\xF1\xC1\xDE\xD80\x8CW\xFE  
\xEB\xBA>yWo\xF4\xC5\xA7\xE2\xF3\x93bMU~鄊ue\xD7vxq4\xC7x&\xF1\xAAa\xCFu\xE0d2y\xFC\x8E\x8Cv\xE1\xC3ǧ$ic\x95\xEDr\x8D\xC8\x90A\xF8أ}z֫\x94l\x8B\xF1\xE1,mǛ\xFEы\xAB\xA9T\xEAr\xB7̷?1-_[[a\xB3n\xF2\xE9v\x8B\xF5\xB67\x94\xC0\xFDcG>z~%\xCBݽĀW\xDF\xE1dO\x82\xBBu\xF5\x9Ci\x9A?\x9F?5#]\xBB\xB4\xC6Ju\x97w~\xAAp\xA1fM\xC4q|
     
@ꌙJ\xA5^\xBA]S\xDE>\xB4\xAF\xB1C\x84\x84\xC3\xFB\xD9k7Y-^\xE7ͫ%+\xE0\xBE 
.v8\xB9\xF8\xBE\xBFd    
\xA5\xB8Yk\xCDN\xE5\xB2\xB6\x85\x90\xA0[\x91\xA8nW8\x9D/S\xB0\xC33a~p\xE3q\xE5\xDF\xF7/oYnW\xA9\xD1{\xE4\xC8aܝ
 
\x8Ei"\xEF˰n\x87c\xA6\xA4l\xF8\xBE\xFFݿ(\x8A27\xA0H\xA7ߝ\x9F\xA3\xF1\xF52.q!K\xA0Jp\xF8\x96$[\xEE\xAC)\xC9+\xBE\xEF\xFFf
 \x84\x98?\xB8\xA7{\xF1\xFD\xB9'\x95\xC6\xD2gl6m\x9E\xDD(

Modified: trunk/phpgwapi/templates/base/images/stock_close.png
===================================================================
--- trunk/phpgwapi/templates/base/images/stock_close.png        2008-02-02 
11:18:25 UTC (rev 18465)
+++ trunk/phpgwapi/templates/base/images/stock_close.png        2008-02-02 
13:52:39 UTC (rev 18466)
@@ -1,7 +1,7 @@
 \x89PNG
 
-
-IHDR\xB5\xFA7\xEAgAMA\xB1\x8F\xFCabKGD\xFF\x87\x8F̿
       pHYsd_\x91tIME\xD21\xD3,\xBB\x9A{IDATxڵ\x8F\xB1
+
+IHDR\xB5\xFA7\xEAgAMA\xB1\x8F\xFCabKGD\xFF\x87\x8F̿
       pHYsd_\x91tIME\xD21\xD3,\xBB\x9A{IDATxڵ\x8F\xB1
 \x800O\x82\x929PX\x85A2\xCB0A
 J
 6\xA0Dbvx

Modified: trunk/phpgwapi/templates/base/images/stock_help.png
===================================================================
--- trunk/phpgwapi/templates/base/images/stock_help.png 2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/phpgwapi/templates/base/images/stock_help.png 2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -1,20 +1,20 @@
 \x89PNG
 
-
+
 
IHDR\xE0w=\xF8gAMA\xB1\x8F\xFCabKGD\xF9C\xBB 
       address@hidden&:kkZ\xC8 address@hidden(MC    \xADB!S\xB9u
-I\xA0jڄ\xE5P\x94\x83Bmdׅ>\xDB8|\xAC\xD7{\x8C\xF7\x9A\xD9\xD9\xF9\xFA\xB3ȭP_\xE9\x95\xE6\x8FW\xF3<\xDF\xFB=\xCF3#q\xBD\xEER\xC0\xEB\xC0{{v\xFF\xA6dj:\xB0upp\xE8\xDE\xC1!\xFD\xE4\xE4\x94\xC0\xE7\xF3\xAA*\xCB\xCFW\x94\x97\xE2t\xB9\x8E<\xF4Jp\xF79\xC0\xC7\xC04\xF3j\x90ځ׀\x99\x8D\xD6w\xA8\xAA\x9Anh\xA8\x9F\x9F\xF8H\x93">Z$(\xBE\xBC<,\x8E\xBD\xF9\x86\xA8\xAE^"dYN߹n]0\x8Ca`\xF0\xCDx
+I\xA0jڄ\xE5P\x94\x83Bmdׅ>\xDB8|\xAC\xD7{\x8C\xF7\x9A\xD9\xD9\xF9\xFA\xB3ȭP_\xE9\x95\xE6\x8FW\xF3<\xDF\xFB=\xCF3#q\xBD\xEER\xC0\xEB\xC0{{v\xFF\xA6dj:\xB0upp\xE8\xDE\xC1!\xFD\xE4\xE4\x94\xC0\xE7\xF3\xAA*\xCB\xCFW\x94\x97\xE2t\xB9\x8E<\xF4Jp\xF79\xC0\xC7\xC04\xF3j\x90ځ׀\x99\x8D\xD6w\xA8\xAA\x9Anh\xA8\x9F\x9F\xF8H\x93">Z$(\xBE\xBC<,\x8E\xBD\xF9\x86\xA8\xAE^"dYN߹n]0\x8Ca`\xF0\xCDx
 
x`\xEF\x9E\xDF֮n\xAC\xFBWii\xA9H\xA7\xE2\xC22S\xC2H\xC5E<ZtVh\x91\xA0\x88\x86gD44#\xD3\xC2?xA\xA2
 /address@hidden
 ؝}\xB9\x9C
-\x9E{\xF6\xE9\xDA?=\xFF‡;=\xD1\xC6+\xED\xBB\xD1\xDA\xDC\x9A\xA6\x8B\xC5H%u
\xC3\xC44-̌\x85"\xCB$5.\xAE\xF4\xF0\x907Q\xF6\xCF\xD3]kn^S\xFCؐP\x80\xB0:z\xB1o\xC7s5E\xD5\xF7\xC2T\x84^\xDDG\xACv-\x89D\x9CD2\x81\x916\x81\xAC(H\x92\x84On\xC6\x8F\xF0
+\x9E{\xF6\xE9\xDA?=\xFF‡;=\xD1\xC6+\xED\xBB\xD1\xDA\xDC\x9A\xA6\x8B\xC5H%u
\xC3\xC44-̌\x85"\xCB$5.\xAE\xF4\xF0\x907Q\xF6\xCF\xD3]kn^S\xFCؐP\x80\xB0:z\xB1o\xC7s5E\xD5\xF7\xC2T\x84^\xDDG\xACv-\x89D\x9CD2\x81\x916\x81\xAC(H\x92\x84On\xC6\x8F\xF0
 \xAFB2i\xE6~:2\xB9&eYq 
8\x9C\x98m]Vu\xF7\x99Pjӡc\xC7I\x87g\x89~p\x94\xD0\xF0\xC1\x99YB>\xFCC~\x86\x87\xFD\xBA\x8E\xD3\xE9\xC4\xE9p\x90y\xE7\xC4\xEF\x80NYb\xB1[\xE6\xC0\x84\xB1P\x82
 
\xE0g\xC05\xC0\xE2w\xBF|\xA4D\x95H\xC7_F\xEF\xA7b\xE6\xD9\xEDbpS\x9D\xF8le\xBEh\xAFp
 
࿺\xB8\xB8P\xEC\xD9\xF9\xB8\xF0\xAF\xF1\x8A\xE0S[\xC5\xF4\xD6\xE2\xEAZ\xAFm򊃷9`\xAA\xB2\xBC\xF0\xB2<\xAD\x9B[\xB7\xB5\xB5\xA9\xEA]\xDF#\xD1\xFD\xD1s]L\x8D\x8Fs!\x98\xE4\xE7cFv\x95\xB7+\x82\xC1\xD0\xE6]{\xF7\xF1\xFB\x9DD\xFFY\xDC뷡.DU`\xD9#\xBB\x90eY1-뇶t\xBE\xD5r\xCF׮\x8E3m\x88\xF1\xC1\xF3\xE2Ԇ\xA5\xE2\xEDZ\xD7|\xD6\xF7u\xC0"\xA0(\xAE\xAA\xA8X\x88Cu\x85"\xFC£"\xF2\xD2n\x97\xFC\xFD\xA2\xBAz\xB1\xBE\xBE\xB8\xE5A\xBF\xBF\xCE\xEB\xF1\x90LƉ[`>\xB6\x9F\xD0\xEA"x\x98\xB1;h\xEB<2:6ve˖\xCD-\x87\xC7"H˚p\xFE\xE8Q,\xCFW\x96`yC=\xC0\xD7\xA0ʓ\x93S>\xA7S%\x931QdEQ0V\xAD\xCB
 
 \xE8\x80i\xB7\xFEى\x93\xDD='\xCE\xE6ocYL\xD3D7t\xBC\xB9^\x80"\xC0    
(2\x80i\x9AH\x80,\xCB8*E\xC5\xC5Y\x80\xB4i\xC0\x9AgN\xCB\xE7[\x98UUI:\xBA\x9EbN\x8Bqixx\xBE\xC7$\xD5\xE7+
 \x84Ñ[\xF2\xF3\xF3P%%)*Z\xC0\xEClx1p\x95\x9BԖ\xD6ֆ\xD1\xCB#ȲL&c\xA1\xA7
\x898'Ova{\xEB:Jee兾\xBE>$$\xDC\xEE
 \xE0󕲣\xA9\xE0\x8D۪\xAA\x9BǏ+\xEA|\xF9`\xCFCuUX\xD3 
\x99JKij#\xC3\xF6\x89\x85\Y^\xFE\xF1\xAF\x9F|
 =\x9DFUT\xF2]N
-\xDE\xFA#m\x85&\x96\xB9jm\xFD\xC1\xEDe\xA5\xA59\x8D
-\xF5\x8E\x8E\xED\xDF|≝\xC1\xFD\xEB\x9Bil\xAC#\xF9\xF7N\xC1iC\xA7\xAF\xB77\xD0
address@hidden"\x95\xA1\xDERAZ\x8B\xF2\xEE[os8`ѣ%\xC9\xC9\xF1\xB0ey
-\xBFڶ\x99E+V\x93\xF4\x9F#p\xB4\x9D\xC0\x97\xA3\xBF\xBB\x83
address@hidden<\xB7\xF5\xD6r\x955\xB8\xEE\xD8\x86\x8E\xB9\xAA5/\xA7ÅX\xFD=$?y\xED\xD4{\x84\xA7'
  
\xA6%\xF1\xA7\x98\xEE\xB6c;\xAA\\x9D\x98\xB8\xAB,\xDF[d\xA5\x8C\xA2\x8F\x84\x93\xB9z\x89\xF4\xF9.\xE4;6\xE2\\O\xDAБ$
   
S\x80v\xF6D\x8E\xBC\x88\xA1\xD01\xAE\xF3\xF9\x9C\xC8\xEE\xFE\xAB\xC0[\x86l_`\xC5\xF2\xE6\xB5?\xF9s\x90\xA9c
    
#-\xD0]\xB9\xA4j\x9Bд0\xB1x\x8C\xA9\xE9)\xC6\xC7Ǹ\xB6h)W\xD4<.i\xB6$\xF8K\xC8\xC26\xE3^
 
address@hidden,P\x81\xCB\xEF\xBF\xFF\xE1\xF9\xE6\xE65\xDF?\xDA\xDB\xD7\xD91\x93\\xFAR\x95\x83%\xBFx\x9C\x82\xC04V\xC6"\xA5\xEB\xC4b1
address@hidden
+\xDE\xFA#m\x85&\x96\xB9jm\xFD\xC1\xEDe\xA5\xA59\x8D
+\xF5\x8E\x8E\xED\xDF|≝\xC1\xFD\xEB\x9Bil\xAC#\xF9\xF7N\xC1iC\xA7\xAF\xB77\xD0
address@hidden"\x95\xA1\xDERAZ\x8B\xF2\xEE[os8`ѣ%\xC9\xC9\xF1\xB0ey
+\xBFڶ\x99E+V\x93\xF4\x9F#p\xB4\x9D\xC0\x97\xA3\xBF\xBB\x83
address@hidden<\xB7\xF5\xD6r\x955\xB8\xEE\xD8\x86\x8E\xB9\xAA5/\xA7ÅX\xFD=$?y\xED\xD4{\x84\xA7'
  
\xA6%\xF1\xA7\x98\xEE\xB6c;\xAA\\x9D\x98\xB8\xAB,\xDF[d\xA5\x8C\xA2\x8F\x84\x93\xB9z\x89\xF4\xF9.\xE4;6\xE2\\O\xDAБ$
   
S\x80v\xF6D\x8E\xBC\x88\xA1\xD01\xAE\xF3\xF9\x9C\xC8\xEE\xFE\xAB\xC0[\x86l_`\xC5\xF2\xE6\xB5?\xF9s\x90\xA9c
    
#-\xD0]\xB9\xA4j\x9Bд0\xB1x\x8C\xA9\xE9)\xC6\xC7Ǹ\xB6h)W\xD4<.i\xB6$\xF8K\xC8\xC26\xE3^
 
address@hidden,P\x81\xCB\xEF\xBF\xFF\xE1\xF9\xE6\xE65\xDF?\xDA\xDB\xD7\xD91\x93\\xFAR\x95\x83%\xBFx\x9C\x82\xC04V\xC6"\xA5\xEB\xC4b1
address@hidden
 
\x84d\xFC\xD43\xE0\xF6\xBAsf\xE3\xC9\xD4vIB\xA9\xAC\xAC\xA4\xA1~)\xB9\xB9\xB9\x8C^\xE3\xF4\xE93\xF3\xED`\xFD\xC0cv\xF4?\x8C?\xFEcPn\x87\x9AX
 
_\x8F\xDC?\xA7\xED\x8Fx6&f\x80.\xE0E\xE0;\xF6s6\xCF\xD89t\xA3\xA4\x9B\x98T\xB2ٸ\xEC\xC8u\xDB\xCEyf\xB3l\x9D\xEBv\x97\xD9\xC0Y"\xFF`~\x96dE\xA0ڠ\xD9ya\xEF8{\xAA\xCC\xCDV\xF0\xB5.\xCA\xF4$7\x8B\xA6IEND\xAEB`\x82
\ No newline at end of file

Modified: trunk/phpgwapi/templates/base/images/stock_no.png
===================================================================
--- trunk/phpgwapi/templates/base/images/stock_no.png   2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/phpgwapi/templates/base/images/stock_no.png   2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -1,9 +1,9 @@
 \x89PNG
 
-
-IHDR\x8D\x89
+
+IHDR\x8D\x89
 
gAMA\x86\xA01\xE8\x96_IDATx\x9C͔\xCBoU\x87\xBF\xEB\x99\xCC\xD8c;v\xEC$\x8E\xED<\x9B\x8A\xB6P\xF1B
 address@hidden(address@hidden;v\xECxf<\x8F\xFB`C\xA2&q\x90\xD8 
~ҕ\xEE\xB9\xD2\xF9\xF4;:\xE7\xF8\xAFd\x8C\x80s\xFEQbȶm\x9D\xB3m\xAE\x9E[`\xADYc\xCE˲\xFD\xE7.?=|\xCC׏\xF6\x88\xCF\xC8=\xF5h\x8C\xB9\N\xBF\xBF\xF64\y\x95\\xD6%\x89"\xFCN\x9BQ\x9F\xB0@/
-im\xEDp\xAB{0j?\xE4\xF3\xF9>Y\x9Dk\xEBo\xE2Vf0:%\xEC\xF6PiJ8\x99\x8B
+im\xEDp\xAB{0j?\xE4\xF3\xF9>Y\x9Dk\xEBo\xE2Vf0:%\xEC\xF6PiJ8\x99\x8B
 
\x8A\x96\xE0\xAB\xF6\xC0\x9C\x84m\xDB6\xEF>{\x91ko\xAFSZY\xC5)L\x92*\x8Aqr(address@hidden>\xCD^&]\x97\x8F߸B\xA1\xDE
 
7=C\xB1\xD1$[.c{h\x89\xD0҄\x8C\x94XJ\xA1\x95\xE6\x95\xD92'J>\x9A\xAB\x97V)NU\xB1\xB3\x96=\x81\x95\xCBa\xB9.ZJ\x90\xAD$\xA4
    
"I!\x91d\x94\xC4U\x86\x97\x8BYs>*\xF9\x85\xC5\x84m\x91\x8EF\x84\x9D6ɠO\xD8\xDD#x\xF4\x90x0D\x8DF\xA5\xD0F"\x84\xAD1OU&\xB95\x8CHOk\x85\xD1\xC1\x99\xCE.\x99n'\xC4\xC3\xE1\xEE.a\xAFM\xFAH)\xD1Z#SM\xC6\xF5(MW\xC9\xDB\xEC\xB4O7e\xFBq\x9BBu)5(I:
 
H\xFD!\xD1~\x8F\xA0\xD3%G$IB\xA24\xB8\x85\xF9y&\x8B\xFC\xD1\xD9?6\xB7{\xC0R\xBD\x8E\x8C02F\xFA!\xB1?
 
\xA4#\x9F8I\x90ڀ\xE3\xE0\xCC\xCCQZ^%;U\xE1ޝ\xBBc\x9B"\xAEo\xFD\xCE^\xA7͠\xD7e\xB0\xBF\x8F?\xEC\x85Q+E\xAA

\xCAqq\xE7\x9A\x97W\xC9\xCF\xD6\x86C>\xBFs\x97\x9F_;\x9B'\x87Ҽ\xB50\xCBƅ\xF3X\xC2-\xD1q\x84Lt\xA1\x85M\xB1Q\xA7\xB4\xB4\x82;U%\x8ES>\xFB\xF2Z\x9B\xDBd-KDJ\xFB)\xE2惶)\xB9.\x97k\xD3`\xFE\xB6/l\xAC|\x91Bm\x8Eb\xBD\x89S\x9D&\xF2n~\xFF\xAD\xCDm޹pN\xB46\xB7\xE7\xF0\xC8\xE9k\xB5
 
/\xCE7(x^\xB1\x80W\xAE\xE0M\x95qE\xFC~\x9F\xEB\xDF|ˍ\xFB;|\xF4\xDC3\xE2\xD3ۿK\xBB1\xE3\xC1\xFA\xF2<\x97VWh6\x9B

}~\xBE\xB7E\xEB\xD7-"\xA5\xD88\xBF$n\xDC\xDF9#\xFDl\x9Dڇ\xEF]\xBEHֲ\xFE5\xE8\xFF\xA3\xBFT\xF2f9\xA7\xC6\xFC\xD3IEND\xAEB`\x82
\ No newline at end of file

Modified: trunk/phpgwapi/templates/base/images/stock_ok.png
===================================================================
--- trunk/phpgwapi/templates/base/images/stock_ok.png   2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/phpgwapi/templates/base/images/stock_ok.png   2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -1,13 +1,13 @@
 \x89PNG
 
-
-IHDR\x8D\x89
+
+IHDR\x8D\x89
 address@hidden
-\x89\x8B\xD6\xF0.\x8C!^1F_å\x97n}\x97.\x8C;\x8Dх1\xD1D\x8DWDR\x85\xA0\x95(E,!\x95g\(5E\x8AV=\xAB\x99\xCEɗ9\xE7t\x80\xE2&Yy\xE6tV\xD4
-\xE2d[\x87k\xD6Ƭ\x980\x8A\xA5\xF7\xB5\xF9\x82\xC5\xF9%u\x83x]\xDC\xD0\xE8\xC5\xD1\xFE)\xAAժu\xA6er֚sۣ\xA4\xACذ\xC6p
+\x89\x8B\xD6\xF0.\x8C!^1F_å\x97n}\x97.\x8C;\x8Dх1\xD1D\x8DWDR\x85\xA0\x95(E,!\x95g\(5E\x8AV=\xAB\x99\xCEɗ9\xE7t\x80\xE2&Yy\xE6tV\xD4
+\xE2d[\x87k\xD6Ƭ\x980\x8A\xA5\xF7\xB5\xF9\x82\xC5\xF9%u\x83x]\xDC\xD0\xE8\xC5\xD1\xFE)\xAAժu\xA6er֚sۣ\xA4\xACذ\xC6p
 
ʉ\xE4{\xFD\xB4y;\xC1V\xF0\xFB\xDBA8\xF2sPy6\xB70눚\xE6\xCB\xCFKD\x9E\xADn.#\xFB\xD1hA\xE4\x99\xAC\xE78;\xA3T*[\xDFH3\xAC\*\xE3\xEA<\x8ADL\xFEL$\xFE?8B\xE0k\xF3\xA1S\xD0\xE8AwoVWֱ\xBD\xB1\x8B\xA2n҈%\xEFPJ\xEDep\Þ\xA0V{\xC5]\F\xF8,\x8A\x8B\x93+\xFB\x8F]ǔ\x87j\xB5W|\x95\xE7
 \xA4\xEB\x92r
-\x97\xA7o\xCB(YPʾ\xC5\xF29q)\x81\xB4\xA2"|~m\xC3l7\x9E\xC2\xF8\xD40|mΏGMk\x88I
 h
-\x91K\xE9fJ
-M\x8F\xC0\xE3\xF5ؒeȪ9H\x91[\xA8i
+\x97\xA7o\xCB(YPʾ\xC5\xF29q)\x81\xB4\xA2"|~m\xC3l7\x9E\xC2\xF8\xD40|mΏGMk\x88I
 h
+\x91K\xE9fJ
+M\x8F\xC0\xE3\xF5ؒeȪ9H\x91[\xA8i
 7\xD1xS\xAC锃\xA3\x83͌\x821\x8A\xA7|\x8CRtiEE.\xFB\xD8\xFB\xD6ѱ\xC9 
(c\xD8\xDB9\xE7\xB1O\xB8\xE6\x82ȳ\xC1\xE0k\xF5\xFC~\x85\xFE\xF6\x97x\xE1\xE0&\xAC\xA0g\x8FEzTXtSoftwarex\xDAs\xD0P\xD6\xF4\xCCMLO\xF5ML\xCFL\xCEV0\xD13\xD03Q\xB0\xB4\xD070\xD170TH.\xCA,.\xA9t(\xAE\xCC-H,\xC9L\xCE\xD7\xCB/J|j\xF9x\xF6\xC23zTXtSignaturex\xDA3OMK6427J310\xB241\xB74\xB744NJI2\xB6LNIJI36\x8C\x97\xCD:q\xCFTIEND\xAEB`\x82
\ No newline at end of file

Modified: trunk/phpgwapi/templates/base/images/stock_remove.png
===================================================================
--- trunk/phpgwapi/templates/base/images/stock_remove.png       2008-02-02 
11:18:25 UTC (rev 18465)
+++ trunk/phpgwapi/templates/base/images/stock_remove.png       2008-02-02 
13:52:39 UTC (rev 18466)
@@ -1,6 +1,6 @@
 \x89PNG
 
-
+
 
IHDR\xE0w=\xF8bKGD\xFF\xFF\xFF\xA0\xBD\xA7\x93\xD8IDATx\xDA\xEDӽJA\x86\xE1g\xC3\x94E\x854V"ށ\xA5\xF7`\x91\xC2\xCA\xCE\xF0z\xBC\x8A\xA9\xB5
 \xA9-,EA\xC1B\xA36\xFE4B663\x96\xB2I\x983\xCC
\xE7\xE3\x9Co\x99L\xA6\xF8\xE7\xAC3wW,\x98k\xA2k\x92㹇\xCB\xC4    
vQ\xA6*\xE8`:\xB8\xBE\xB1\xB5\xB9Ѻ\xF7w.\xCEO\xE1\x8F\xF8B]6\xEC\xF5v
G\xB7\xAD\xDE_\x9E\xE3\xF6\xF8i
 \x80\xE1\xD5\xD8\xEB\xE4m_+tSޕ8[уK\xF4\xB1}hz\xB0\x8D\xC3Pf۶ 
uh\xCBS\xF0\xE0u\x91\xA8\xA2

Modified: trunk/phpgwapi/templates/base/images/stock_view-fields.png
===================================================================
--- trunk/phpgwapi/templates/base/images/stock_view-fields.png  2008-02-02 
11:18:25 UTC (rev 18465)
+++ trunk/phpgwapi/templates/base/images/stock_view-fields.png  2008-02-02 
13:52:39 UTC (rev 18466)
@@ -1,6 +1,6 @@
 \x89PNG
 
-
+
 
IHDR!\x8F-bKGD\xFF\xFF\xFF\xA0\xBD\xA7\x93\xAEIDATx\xDA핿Ka\xC7?\xB9\xBB\x846A\xD4\xA5\x9A-\x84jc\x95Rk\xC7*785Sh\x85\xB4(1s\xC1A\xFC3Y\x9A\xE2$\x9D\xA2\xA0K'K\x85\xA8D3(\x81\x80\xD4\\xBC\xE8\xBD]ޔD\x93\xA8T\xE8\xD2x\xEF\xEE\xF9\xF1\xFD~\xDF\xE7\x9E\xFE\xAF\xBDl\xF7\xF4\xB5UĈ
 
address@hidden;\xFD\xFD\xFD躎\xA6i(\x8A\x82\xCDV\x8D\xD5\xE3\xF1$\x82\xC1\xE0G\xE2\xF1\xB80M\xF3\x86\xED\xEC숾\xBE>\xE1\xF3\xF9\xC4\xFE\xFE\xBE0

C\x86!\xB6\xB6\xB6\x84\xAE뢻\xBB[lll\x88\xB3\xB33Q,\xABb\xE3\xF1\xB8P\xEAQB0::J$a{{\x9B\xCE\xCENTUEUUzzz\x98\x9E\x9E&
 

Modified: trunk/phpgwapi/templates/base/images/stock_yes.png
===================================================================
--- trunk/phpgwapi/templates/base/images/stock_yes.png  2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/phpgwapi/templates/base/images/stock_yes.png  2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -1,9 +1,9 @@
 \x89PNG
 
-
-IHDR\x8D\x89
address@hidden
-P$\xA4"JS\xA8P\x8AL\xA4J\xA8\x938>\xED\xEE\xEC΁\x8BВ\x92\x85K$^i\xA4\x99\x91\xDEG\xEF7\xDF\xE8\x83\xFFJ\xC60\xEB_e\x81\\xD7է|\x97W\xDE\x893\x97:Tf\x9E<\xDEa\xEB\xC16ݯ\xB6Q\x99)\xF4\x9E\xB84\xC6X\xBE\xEF\xEB\xB7>x\x95\xCB\xBDC\xA9\Fd)\xFB\xC3=\x86\xF1!\x93Ɉ\xC1\xE1\x98\xEF\xD7\xF1\xDB7O\xA1\xEE\xF1C\x86w\xAE}\xB2\xC6ڇ\x97\xA9
+
+IHDR\x8D\x89
address@hidden
+P$\xA4"JS\xA8P\x8AL\xA4J\xA8\x938>\xED\xEE\xEC΁\x8BВ\x92\x85K$^i\xA4\x99\x91\xDEG\xEF7\xDF\xE8\x83\xFFJ\xC60\xEB_e\x81\\xD7է|\x97W\xDE\x893\x97:Tf\x9E<\xDEa\xEB\xC16ݯ\xB6Q\x99)\xF4\x9E\xB84\xC6X\xBE\xEF\xEB\xB7>x\x95\xCB\xBDC\xA9\Fd)\xFB\xC3=\x86\xF1!\x93Ɉ\xC1\xE1\x98\xEF\xD7\xF1\xDB7O\xA1\xEE\xF1C\x86w\xAE}\xB2\xC6ڇ\x97\xA9
 \xA4\x96
&}r\x95\x93\xE4\x93#\x83\xE7p\xE9\xDDsx\xA1\xC3Ϸw\xCCߡρ\xAE\xEB\x9Aׯ\xAE\xB0v\xED
-\x8DE\xA2R\x854\x8B\xC9e\x86_\xF2\xD1F!-\x85\xB15\xCA2,\xAC\xB6\x88cv\xEF^\x80\xDA\xCF6A\xA5\xCCՏ\xDFc\xA6:K=\x9C\xA65\xD5&\xF2\xA7(yG0c\xA4\xC9Q\xB6<\x82j\xC5\xFCk-l\xF7Ū\x9F\xCDꕗiT\xF8\x9E\x8F\xE7xx^
        \xCF=\x85\xD2eJ)\xA4\xC91H
m)\\xCFbv\xB5Ǻ\xFF<ᅕsX\x96C\x9A\xA5\x8C\xF7\xF8\xA5\xD7e{\xFF1\xBD\xE1.q:F\xC8\xAD5\xB9R(4\xC6\xC0\xA6y\xBEQܔ\xA82NF\xF4\x9C\xA7ض\x8DR9\xC3t\xC8\xC1\xA8\xC7\xFEx\x8FXL\x90R\xA2\xB5\xC6H\x8D\x84u\xEC)\x97
+\x8DE\xA2R\x854\x8B\xC9e\x86_\xF2\xD1F!-\x85\xB15\xCA2,\xAC\xB6\x88cv\xEF^\x80\xDA\xCF6A\xA5\xCCՏ\xDFc\xA6:K=\x9C\xA65\xD5&\xF2\xA7(yG0c\xA4\xC9Q\xB6<\x82j\xC5\xFCk-l\xF7Ū\x9F\xCDꕗiT\xF8\x9E\x8F\xE7xx^
        \xCF=\x85\xD2eJ)\xA4\xC91H
m)\\xCFbv\xB5Ǻ\xFF<ᅕsX\x96C\x9A\xA5\x8C\xF7\xF8\xA5\xD7e{\xFF1\xBD\xE1.q:F\xC8\xAD5\xB9R(4\xC6\xC0\xA6y\xBEQܔ\xA82NF\xF4\x9C\xA7ض\x8DR9\xC3t\xC8\xC1\xA8\xC7\xFEx\x8FXL\x90R\xA2\xB5\xC6H\x8D\x84u\xEC)\x97
 
\xBA'\x81;[\xBB4*\xD3h\xA5\xD0F1\xC9bb1a\x90\xF49\x90\x88\x84,\xCBP\xB9±<\x9A\xD59\xE6\xEA~\xD2+N\xD8}\xB0E\xE7\xCCi\x92\x90\xE9
\x91'\xD3!"\x8B\x8B    
Bdh\xA9q-\x8Fz\xB9\xC9\xC2\xF4Y\xAAA\x8Do\xBB\xF7\x81\xD6\xC6\xCDM\xB3\xFC\xE6\xA2(@j\x89P\xA9q\x96"s
       
\xB9\xC1\xC1\xE3tآ]\x9Dg\xBAҤ?\xE8\xF3\xF5\xF5{~)wo|\xC7A\xBFO<\x8EqFg\xA8T\xA32\x8DgJ\xB4\xAB\xF3,6\x97\x98\xA9\xCD"\xB2\x94\x9F\xDE"\xAF\xE4\x9EH`\xFD\xF4\xE5\xAF&\xA8\xF8\xCC/\xCFb,\x83e\x83el\xCAv\xC8\xE9\xA9&\xADz\x9B\x9A\xDF
 Ic>[\xFF\x9C\x8D\xF5\xAC\ȿ \x9C\x94Y|\xA3\xCD\xD2\xCAY\xC2( "\xEAa\x9DJT%,G
Fn^_\xE7\x87/\xFA'`\xCF\xE6\xE2\xDBK,-\x9F\xA7\xD3\xE90\x8E\xD9|\xB8ɽ[\xF93\xD1?y\x8B\xE5x6\xCC\xC3\xE3\xEF\xF5\xFF\xD4\x97\xA0g\xB7\xF5\x82N\xCCIEND\xAEB`\x82
\ No newline at end of file

Modified: trunk/phpgwapi/templates/base/login.tpl
===================================================================
--- trunk/phpgwapi/templates/base/login.tpl     2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/phpgwapi/templates/base/login.tpl     2008-02-02 13:52:39 UTC (rev 
18466)
@@ -1,30 +1,31 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+       "http://www.w3.org/TR/html4/loose.dtd";>
 <html>
 <!-- BEGIN login_form -->
 <head>
-       <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-       <meta name="author" content="phpGroupWare http://www.phpgroupware.org"; 
/>
-       <meta name="description" content="{website_title} login screen, working 
environment powered by phpGroupWare" />
-       <meta name="keywords" content="{website_title} login screen, 
phpgroupware, groupware, groupware suite" />
-       <meta name="robots" content="noindex,nofollow" />
+       <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+       <meta name="author" content="phpGroupWare http://www.phpgroupware.org";>
+       <meta name="description" content="{website_title} login screen, working 
environment powered by phpGroupWare">
+       <meta name="keywords" content="{website_title} login screen, 
phpgroupware, groupware, groupware suite">
+       <meta name="robots" content="noindex,nofollow">
        
        <title>{website_title} - {lang_login}</title>
 
-       <link rel="stylesheet" href="{base_css}" type="text/css" />
-       <link rel="stylesheet" href="{login_css}" type="text/css" />
+       <link rel="stylesheet" href="{base_css}" type="text/css">
+       <link rel="stylesheet" href="{login_css}" type="text/css">
 
        <script type="text/javascript">
        <!--
-               function testjs()
+               window.onload = function()
                {
                        document.getElementById('testjs').style.display = 
'none';
+                       document.getElementById('login').focus();
                }
        -->
        </script>
 </head>
 
-<body onLoad="testjs();">
+<body>
        <div id="horizon">
                
                <div id="loginmsg">{lang_message}</div>
@@ -33,32 +34,32 @@
                <div id="loginbox">
                        <div id="logintitle">{website_title} - 
{lang_login}</div>
                        <p class="msg">{cd}</p>
-                       <input type="hidden" name="passwd_type" value="text" />
+                       <input type="hidden" name="passwd_type" value="text">
                        <!-- BEGIN loging_block -->
                        <label for="login">{lang_username}:</label>
-                       <input type="text" value="{last_loginid}" name="login" 
id="login"{login_read_only} />
+                       <input type="text" value="{last_loginid}" name="login" 
id="login"{login_read_only}>
                        <!-- END loging_block -->
                        <!-- BEGIN domain_from_host -->
-                               @{logindomain}<input type="hidden" 
name="logindomain" value="{logindomain}" />
+                               @{logindomain}<input type="hidden" 
name="logindomain" value="{logindomain}">
                        <!-- END domain_from_host -->
-                       <br />
+                       <br>
                        <!-- BEGIN login_additional_info -->
                        <label for="firstname">{lang_firstname}:</label>
-                       <input type="text" value="{firstname}" maxlength="100" 
name="firstname" id="firstname" />
-                       <br />
+                       <input type="text" value="{firstname}" maxlength="100" 
name="firstname" id="firstname">
+                       <br>
 
                        <label for="lastname">{lang_lastname}:</label>
-                       <input type="text" value="{lastname}" name="lastname" 
id="lastname" maxlength="100" />
-                       <br />
+                       <input type="text" value="{lastname}" name="lastname" 
id="lastname" maxlength="100">
+                       <br>
 
                        <!-- END login_additional_info -->
                        <!-- BEGIN password_block -->
                        <label for="passwd">{lang_password}:</label>
-                       <input type="password" name="passwd" id="passwd" /><br 
/>
+                       <input type="password" name="passwd" id="passwd"><br>
                        <!-- END password_block -->
                        <!-- BEGIN login_check_passwd -->
                        <label 
for="passwd_confirm">{lang_confirm_password}:</label>
-                       <input type="password" name="passwd_confirm" 
id="passwd_confirm" /><br />
+                       <input type="password" name="passwd_confirm" 
id="passwd_confirm"><br>
 
                        <!-- END login_check_passwd -->
                        <!-- BEGIN domain_select -->
@@ -67,17 +68,17 @@
                                <!-- BEGIN domain_option -->
                                <option value="{domain_name}" 
{domain_selected}>{domain_name}</option>
                                <!-- END domain_option -->
-                       </select><br />
+                       </select><br>
                        <!-- END domain_select -->
                        <!-- BEGIN button_block -->
-                       <p class="button_group"><input type="submit" 
value="{lang_login}" name="submitit" /></p>
+                       <p class="button_group"><input type="submit" 
value="{lang_login}" name="submitit"></p>
                        <p class="link_group"><a 
href="{return_sso_login_url}">{lang_return_sso_login}</a></p>
                        <!-- END button_block -->
                        <p id="version">phpGroupWare {version}</p>
                </div>
                </form>
                <div id="testjs">
-                       {lang_testjs}<br />
+                       {lang_testjs}<br>
                </div>
        </div>
 </body>

Modified: trunk/phpgwapi/templates/base/msgbox.xsl
===================================================================
--- trunk/phpgwapi/templates/base/msgbox.xsl    2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/phpgwapi/templates/base/msgbox.xsl    2008-02-02 13:52:39 UTC (rev 
18466)
@@ -5,24 +5,24 @@
        </xsl:template>
 
        <xsl:template match="msgbox_data">
-               <table cellpadding="2" cellspacing="0" align="center" 
class="msgbox">
-                       <tr>
-                               <td align="center" valign="middle">
+               <div>
+                       <xsl:attribute name="class">
+                               <xsl:choose>
+                                       <xsl:when test="msgbox_class != ''">
+                                               <xsl:value-of 
select="msgbox_class" />
+                                       </xsl:when>
+                                       <xsl:otherwise>
+                                               <xsl:text>error</xsl:text>
+                                       </xsl:otherwise>
+                               </xsl:choose>
+                       </xsl:attribute>
                                        <xsl:choose>
                                                <xsl:when test="msgbox_img != 
''">
-                                               <xsl:variable 
name="msgbox_img"><xsl:value-of select="msgbox_img"/></xsl:variable>
+                                       <xsl:variable 
name="msgbox_img"><xsl:value-of select="msgbox_img" /></xsl:variable>
                                                <xsl:variable 
name="msgbox_img_alt"><xsl:value-of select="msgbox_img_alt"/></xsl:variable>
-                                                       <img 
src="{$msgbox_img}" alt="{$msgbox_img_alt}" title="{$msgbox_img_alt}" 
onMouseout="window.status='';return true;">
-                                                               <xsl:attribute 
name="onMouseover">
-                                                                       
<xsl:text>window.status='</xsl:text>
-                                                                               
<xsl:value-of select="lang_msgbox_statustext"/>
-                                                                       
<xsl:text>'; return true;</xsl:text>
-                                                               </xsl:attribute>
-                                                       </img><xsl:text> 
</xsl:text>
+                                       <img src="{$msgbox_img}" 
alt="{$msgbox_img_alt}" title="{$msgbox_img_alt}" />
                                                </xsl:when>
                                        </xsl:choose>
-                                       <xsl:value-of 
disable-output-escaping="yes" select="msgbox_text"/>
-                               </td>
-                       </tr>
-               </table>
+                       <xsl:value-of disable-output-escaping="yes" 
select="msgbox_text" />
+               </div>
        </xsl:template>

Modified: trunk/phpgwapi/templates/desktop/navbar.inc.php
===================================================================
--- trunk/phpgwapi/templates/desktop/navbar.inc.php     2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/phpgwapi/templates/desktop/navbar.inc.php     2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -23,48 +23,9 @@
                        )
                );
 
-               $tpl->set_block('navbar', 'app_text', 'apps_text');
-               $tpl->set_block('navbar', 'app_icon', 'apps_icon');
-               $tpl->set_block('navbar', 'app_both', 'apps_both');
+               $tpl->set_block('navbar', 'app', 'apps');
                $tpl->set_block('navbar', 'prefs', 'prefs_block');
 
-               switch 
($GLOBALS['phpgw_info']['user']['preferences']['common']['navbar_format'])
-               {
-                       case 'text':
-                               $block = 'app_text';
-                               $block_out = 'apps_text';
-                               $tpl->set_var(
-                                               array(
-                                                       'apps_icon'     => '',
-                                                       'apps_both'     => ''
-                                               )
-                               );
-                               break;
-
-                       case 'icons':
-                               $block = 'app_icon';
-                               $block_out = 'apps_icon';
-                               $tpl->set_var(
-                                               array(
-                                                       'apps_text'     => '',
-                                                       'apps_both'     => ''
-                                               )
-                               );
-
-                               break;
-
-                       default:
-                               $block = 'app_both';
-                               $block_out = 'apps_both';
-                               $tpl->set_var(
-                                               array(
-                                                       'apps_text'     => '',
-                                                       'apps_icon'     => ''
-                                               )
-                               );
-                               break;
-               }
-               
                $target = '';
                if ( isset($GLOBALS['phpgw_info']['flags']['navbar_target']) && 
$GLOBALS['phpgw_info']['flags']['navbar_target'] )
                {
@@ -76,12 +37,12 @@
                {
                        if($app == 'preferences')
                        {
-                               $tpl->set_var(
-                                       array(
+                               $tpl->set_var(array
+                               (
                                                'prefs_url'     => 
$app_data['url'],
                                                'lang_prefs'    => 
$app_data['title']
-                                       )
-                               );
+                               ));
+
                                $tpl->parse('prefs_block', 'prefs');
                                $prefs_ok = True;
                                continue;
@@ -94,7 +55,7 @@
 
                        $app_data['target'] = $target;
                        $tpl->set_var($app_data);
-                       $tpl->parse($block_out, $block, True);
+                       $tpl->parse('apps', 'app', True);
                }
 
                if( !$prefs_ok )

Modified: trunk/phpgwapi/templates/desktop/navbar.tpl
===================================================================
--- trunk/phpgwapi/templates/desktop/navbar.tpl 2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/phpgwapi/templates/desktop/navbar.tpl 2008-02-02 13:52:39 UTC (rev 
18466)
@@ -4,17 +4,10 @@
                                <ul id="navbar_ul">
                                        <li><img src="{img_base_url}logo.png" 
alt="phpGroupWare Logo" height="21" width="25" />{lang_applications}
                                                <ul>
-                                                       <!-- BEGIN app_both -->
+                                                       <!-- BEGIN app -->
                                                        <li><a 
href="{url}"{target}><img src="{icon}" alt="{title}" 
                                                                title="{title}" 
height="16" width="16" /> {title}</a></li>
-                                                       <!-- END app_both -->
-                                                       <!-- BEGIN app_text -->
-                                                       <li><a 
href="{url}"{target}>{title}</a></li>
-                                                       <!-- END app_text -->
-                                                       <!-- BEGIN app_icon -->
-                                                       <li><a 
href="{url}"{target}><img src="{icon}" alt="{title}" 
-                                                               title="{title}" 
height="16" width="16" /></a></li>
-                                                       <!-- END app_icon -->
+                                                       <!-- END app -->
                                                </ul>
                                        </li>
                                        <!-- BEGIN prefs -->

Modified: trunk/phpgwapi/templates/idots/css/base.css
===================================================================
--- trunk/phpgwapi/templates/idots/css/base.css 2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/phpgwapi/templates/idots/css/base.css 2008-02-02 13:52:39 UTC (rev 
18466)
@@ -21,32 +21,35 @@
        border: 0px;
 }
 
-label, input[type=text], input[type=password], select, textarea
-{
-       /*
-       display: block;
-       float: left;
-       margin-bottom: 8px;
-       width: 400px;
-       */
-}
-
 input.button
 {
        margin: 10px;
        width: auto;
 }
 
-input.error, select.error, textarea.error
+.error
 {
+       background-color: #fcc;
        border: 1px solid #f00;
-       background-color: #f99;
        color: #f00;
 }
 
+.warn
+{
+       background-color: #ff8;
+       border: 1px solid #fc0;
+       color: #fc0;
+}
+
+div.error, div.warn
+{
+       font-weight: bold;
+       padding: 5px;
+       text-align: center;
+}
+
 label
 {
-       font-weight: bold;
        padding-right: 10px;
        text-align: right;
        vertical-align: top;
@@ -77,3 +80,32 @@
        text-align: center;
 }
 
+/* Reset headings which get broken by YUI! - based on firefox 2 html.css */
+h1
+{
+  font-size: 2em;
+  font-weight: bold;
+  margin: .67em 0;
+}
+
+h2
+{
+  font-size: 1.5em;
+  font-weight: bold;
+  margin: .83em 0;
+}
+
+h3
+{
+  font-size: 1.17em;
+  font-weight: bold;
+  margin: 1em 0;
+}
+
+h4
+{
+  font-weight: bold;
+  margin: 1.33em 0;
+}
+/* End headings fix */
+

Modified: trunk/phpgwapi/templates/idots/css/idots.css
===================================================================
--- trunk/phpgwapi/templates/idots/css/idots.css        2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/phpgwapi/templates/idots/css/idots.css        2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -37,6 +37,7 @@
        min-height: 90%;
        margin: 0px;
        padding: 0px;
+       text-align: left;
        vertical-align: top;
        width: 100%;
 }
@@ -190,17 +191,22 @@
        margin-left: 20px;
 }
 
-.sideboxcontent 
+ul.sideboxcontent
 {
        background-color: #efefef;
        font-family: Verdana, Arial, Helvetica, sans-serif;
        font-size: 12px;
-       list-style-position: inside;
        margin: 0px;
        padding: 5px;
        width: 150px; 
 }
 
+ul.sideboxcontent li
+{
+       list-style: square inside url(../images/dot.png);
+       padding: 1px 3px;
+}
+
 #sidecontent h2
 {
        background-image: url(../images/boxbg.png);
@@ -218,24 +224,11 @@
 .sidebox
 {
        border: 1px solid #98aab1;
-       border-collapse: collapse;
        margin-bottom: 25px;
        padding: 0px;
        width: 160px; 
 }
 
-.sidebox li
-{
-       list-style-type: square;
-}
-
-.sidebox li.empty_item
-{
-       font-size: 6px;
-       height: 8px;
-       list-style-type: none;
-}
-
 /* Save some space when printing */
 @media print
 {
@@ -323,71 +316,6 @@
        clear: left;
 }
 
-/* Used by tabs */
-ul.tabs
-{
-       background-image: url('../images/tabs-bg.png');
-       height: 32px;
-       list-style: none;
-       margin: 0px;
-       padding: 0px;
-}
-
-ul.tabs li
-{
-       display: block;
-       float: left;
-       height: 32px;
-       margin: 0px;
-       padding: 0px;
-       width: 150px;
-}
-
-ul.tabs li a, ul.tabs li input
-{
-       background-image: url('../images/tab-r.png');
-       background-color: transparent;
-       background-repeat: no-repeat;
-       border: 0px;
-       color: #000;
-       display: block;
-       height: 32px;
-       overflow: hidden;
-       padding-top: 7px;
-       text-decoration: none;
-       white-space: nowrap; 
-       width: 150px;
-}
-
-ul.tabs li.tablast
-{
-       background-color: transparent;
-       background-image: url('../images/tab-last.png');
-       background-repeat: no-repeat;
-}
-
-ul.tabs li.activetab
-{
-       background-color: transparent;
-       background-image: url('../images/tab-active-bg.png');
-       height: 32px;
-}
-
-ul.tabs li.activetab a
-{
-       background-image: url('../images/tab-active-r.png');
-       background-position: top right;
-}
- 
-ul.tabs li
-{
-       background-image: url('../images/tab-bg.png');
-       color:#069;
-       height: 32px;
-       text-align: center;
-       white-space: nowrap;
-}
-
 /* nextmatch values */
 .row_off
 {

Modified: trunk/phpgwapi/templates/idots/head.inc.php
===================================================================
--- trunk/phpgwapi/templates/idots/head.inc.php 2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/phpgwapi/templates/idots/head.inc.php 2008-02-02 13:52:39 UTC (rev 
18466)
@@ -1,13 +1,15 @@
 <?php
        /**
        * Template header
-       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * @copyright Copyright (C) 2003-2007 Free Software Foundation, Inc. 
http://www.fsf.org/
        * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
        * @package phpgwapi
        * @subpackage gui
        * @version $Id: head.inc.php,v 1.4 2004/12/30 06:47:34 skwashd Exp 
        */
        
+       phpgw::import_class('phpgwapi.yui');
+
        if ( !isset($GLOBALS['phpgw_info']['server']['site_title']) )
        {
                $GLOBALS['phpgw_info']['server']['site_title'] = lang('please 
set a site name in admin &gt; siteconfig');
@@ -20,49 +22,44 @@
 
        $app = $GLOBALS['phpgw_info']['flags']['currentapp'];
 
-       $theme_styles[] = 
"{$GLOBALS['phpgw_info']['server']['webserver_url']}/phpgwapi/templates/idots/css/base.css";
-       if(file_exists(PHPGW_SERVER_ROOT . '/phpgwapi/templates/idots/css/' . 
$GLOBALS['phpgw_info']['user']['preferences']['common']['theme'] . '.css'))
+       if ( 
!is_readable("/phpgwapi/templates/idsociety/css/{$GLOBALS['phpgw_info']['user']['preferences']['common']['theme']}.css")
 )
        {
-               $theme_styles[] = 
"{$GLOBALS['phpgw_info']['server']['webserver_url']}/phpgwapi/templates/idots/css/{$GLOBALS['phpgw_info']['user']['preferences']['common']['theme']}.css";
-       }
-       else
-       {
-               $theme_styles[] = 
"{$GLOBALS['phpgw_info']['server']['webserver_url']}/phpgwapi/templates/idots/css/idots.css";
                
$GLOBALS['phpgw_info']['user']['preferences']['common']['theme'] = 'idots';
        }
 
-       if(file_exists(PHPGW_SERVER_ROOT . 
"/{$app}/templates/base/css/base.css"))
-       {
-               $theme_styles[] = 
"{$GLOBALS['phpgw_info']['server']['webserver_url']}/{$app}/templates/base/css/base.css";
-       }
+       $theme_styles = array
+       (
+               '/phpgwapi/js/yahoo/reset-fonts-grids/reset-fonts-grids.css',
+               '/phpgwapi/js/yahoo/build/menu/assets/skins/sam/menu.css',
+               '/phpgwapi/js/yahoo/build/tabview/assets/skins/sam/tabview.css',
+               '/phpgwapi/templates/idots/css/base.css',
+               
"/phpgwapi/templates/idots/css/{$GLOBALS['phpgw_info']['user']['preferences']['common']['theme']}.css",
+               "/{$app}/templates/base/css/base.css",
+               "/{$app}/templates/idots/css/base.css",
+               
"/{$app}/templates/idots/css/{$GLOBALS['phpgw_info']['user']['preferences']['common']['theme']}.css"
+       );
 
-       if(file_exists(PHPGW_SERVER_ROOT . 
"/{$app}/templates/idots/css/base.css"))
+       foreach ( $theme_styles as $style )
        {
-               $theme_styles[] = 
"{$GLOBALS['phpgw_info']['server']['webserver_url']}/{$app}/templates/idots/css/base.css";
-       }
 
-       if(file_exists(PHPGW_SERVER_ROOT . 
"/{$app}/templates/idots/css/{$GLOBALS['phpgw_info']['user']['preferences']['common']['theme']}.css"))
+               if( file_exists( PHPGW_SERVER_ROOT . $style ) )
        {
-               $theme_styles[] = 
"{$GLOBALS['phpgw_info']['server']['webserver_url']}/{$app}/templates/idots/css/{$GLOBALS['phpgw_info']['user']['preferences']['common']['theme']}.css";
-       }
-
-       foreach ( $theme_styles as $style )
-       {
-               $GLOBALS['phpgw']->template->set_var('theme_style', $style);
+                       $GLOBALS['phpgw']->template->set_var('theme_style', 
"{$GLOBALS['phpgw_info']['server']['webserver_url']}$style");
                $GLOBALS['phpgw']->template->parse('theme_stylesheets', 
'theme_stylesheet', true);
        }
+       }
        
        $app = $app ? ' ['.(isset($GLOBALS['phpgw_info']['apps'][$app]) ? 
$GLOBALS['phpgw_info']['apps'][$app]['title'] : lang($app)).']':'';
 
+       phpgwapi_yui::load_widget('menu');
        $GLOBALS['phpgw']->template->set_var(array
        (
                'css'                   => $GLOBALS['phpgw']->common->get_css(),
                'javascript'    => $GLOBALS['phpgw']->common->get_javascript(),
                'img_icon'      => PHPGW_IMAGES_DIR . '/favicon.ico',
-               'img_shortcut'  => PHPGW_IMAGES_DIR . '/favicon.ico',
                'str_base_url'  => $GLOBALS['phpgw']->link('/', array(), true), 
        
-               'website_title' => 
$GLOBALS['phpgw_info']['server']['site_title'] . $app,
-               'win_on_events' => $GLOBALS['phpgw']->common->get_on_events(),
+               'website_title' => 
"{$GLOBALS['phpgw_info']['server']['site_title']} | {$app}",
+               'win_on_events' => $GLOBALS['phpgw']->common->get_on_events()
        ));
 
        $GLOBALS['phpgw']->template->pfp('out','head');

Modified: trunk/phpgwapi/templates/idots/head.tpl
===================================================================
--- trunk/phpgwapi/templates/idots/head.tpl     2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/phpgwapi/templates/idots/head.tpl     2008-02-02 13:52:39 UTC (rev 
18466)
@@ -1,5 +1,5 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
-       "http://www.w3.org/TR/html4/strict.dtd";>
+       "http://www.w3.org/TR/html4/loose.dtd";>
 <!-- BEGIN head -->
 <html>
        <head>
@@ -9,7 +9,7 @@
                <meta name="keywords" content="phpGroupWare">
                <meta name="robots" content="none">
                <link rel="icon" href="{img_icon}" type="image/x-ico">
-               <link rel="shortcut icon" href="{img_shortcut}">
+               <link rel="shortcut icon" href="{img_icon}">
                {css}
                 <!-- BEGIN theme_stylesheet -->
                 <link href="{theme_style}" type="text/css" rel="StyleSheet">
@@ -20,26 +20,8 @@
                        var strBaseURL = '{str_base_url}';
                        {win_on_events}
                        -->
-                       var page;
-
-                       function openwindow(url)
-                       {
-                               if (page)
-                               {
-                                       if (page.closed)
-                                       {
-                                               page.stop;
-                                               page.close;
-                                       }
-                               }
-                               page = window.open(url, 
"pageWindow","width=700,height=600,location=no,menubar=no,directories=no,toolbar=no,scrollbars=yes,resizable=yes,status=no");
-                               if (page.opener == null)
-                               {
-                                       page.opener = window;
-                               }
-                       }
                </script>
                {javascript}
        </head>
-       <body>
+       <body class="yui-skin-sam">
 <!-- END Head -->

Added: trunk/phpgwapi/templates/idots/images/dot.png
===================================================================
(Binary files differ)


Property changes on: trunk/phpgwapi/templates/idots/images/dot.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: trunk/phpgwapi/templates/idots/navbar.inc.php
===================================================================
--- trunk/phpgwapi/templates/idots/navbar.inc.php       2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/phpgwapi/templates/idots/navbar.inc.php       2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -24,7 +24,6 @@
                
$GLOBALS['phpgw']->template->set_block('navbar','navbar_header','navbar_header');
                
$GLOBALS['phpgw']->template->set_block('navbar','extra_blocks_header','extra_block_header');
                
$GLOBALS['phpgw']->template->set_block('navbar','extra_block_row','extra_block_row');
-               
$GLOBALS['phpgw']->template->set_block('navbar','extra_block_spacer','extra_block_spacer');
                
$GLOBALS['phpgw']->template->set_block('navbar','extra_blocks_footer','extra_blocks_footer');
                
$GLOBALS['phpgw']->template->set_block('navbar','navbar_footer','navbar_footer');
 
@@ -33,35 +32,27 @@
                $applications = '';
                $items = 0;
 
-//_debug_array($GLOBALS['phpgw_info']['navbar']);
+               $navbar = execMethod('phpgwapi.menu.get', 'navbar');
+               prepare_navbar($navbar);
 
+               $navigation = execMethod('phpgwapi.menu.get', 'navigation');
                $sidecontent = 
isset($GLOBALS['phpgw_info']['user']['preferences']['common']['sidecontent']) 
&& $GLOBALS['phpgw_info']['user']['preferences']['common']['sidecontent'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['common']['sidecontent'] : 
'sidebox';
 
-               foreach($GLOBALS['phpgw_info']['navbar'] as $app => $app_data)
+               foreach($navbar as $app => $app_data)
                {
                        if (($app != 'home' && $app != 'preferences' && $app != 
'about' && $app != 'logout')
-                               || ($sidecontent != 'sidebox' && $sidecontent 
!= 'javamenu'))
+                               || ($sidecontent != 'sidebox' && $sidecontent 
!= 'jsmenu'))
                        {
                                $item = array
                                        (
                                                'app_name'      => '',
                                                'alt_img_app'   => lang($app),
                                                'img_app'       => 
"{$var['img_root']}/noimage_nav.png",
-                                               'url_app'       => 
$app_data['url']
+                                       'url_app'               => 
$app_data['url'],
+                                       'app_name'              => 
$app_data['text'],
+                                       'img_app'               => 
$GLOBALS['phpgw']->common->image($app_data['image'][0], $app_data['image'][1])
                                        );
 
-                               
switch($GLOBALS['phpgw_info']['user']['preferences']['common']['navbar_format'])
-                               {
-                                       case 'icons':
-                                               $item['img_app'] =& 
$app_data['icon'];
-                                               break;
-                                       case 'text':
-                                               $item['app_name'] =& 
$item['alt_img_app'];
-                                               break;
-                                       default:
-                                               $item['app_name'] =& 
$item['alt_img_app'];
-                                               $item['img_app'] =& 
$app_data['icon'];
-                               }
                                $GLOBALS['phpgw']->template->set_var($item);
                                
$GLOBALS['phpgw']->template->parse('navbar_items', 'navbar_item', true);
                        }
@@ -108,33 +99,48 @@
                        $var['messages'] = $api_messages . '<br>' . 
checkcode($cd);
                }
 
-               $var['content_class'] = $sidecontent == 'sidebox' || 
$sidecontent == 'javamenu' ? 'content' : 'content_nosidebox';
+               $var['content_class'] = $sidecontent == 'sidebox' || 
$sidecontent == 'jsmenu' ? 'content' : 'content_nosidebox';
 
                $GLOBALS['phpgw']->template->set_var($var);
                $GLOBALS['phpgw']->template->pfp('out','navbar_header');
 
-               if($sidecontent == 'sidebox' || $sidecontent == 'javamenu')
+               if($sidecontent == 'sidebox' || $sidecontent == 'jsmenu')
                {
                        $menu_title = lang('General Menu');
 
-                       $file[] = array('text' => 'Home',
-                                       'url' => 
$GLOBALS['phpgw_info']['navbar']['home']['url']);
-                       if ( 
isset($GLOBALS['phpgw_info']['navbar']['preferences']))
+                       $menu['home'] = $navbar['home'];
+                       if ( isset($navbar['preferences']))
                        {
-                               $file[] = array ('text' => 'Preferences',
-                                       'url' => 
$GLOBALS['phpgw_info']['navbar']['preferences']['url'] 
-                                                       . '#' . 
$GLOBALS['phpgw_info']['flags']['currentapp']);
+                               $menu['preferences'] = $navbar['preferences'];
                        }
-                       $file[] = array ('text' => 'About %1', 'url' => 
$GLOBALS['phpgw_info']['navbar']['about']['url']);
-                       $file[] = array ('text' => 'Logout', 'url' => 
$GLOBALS['phpgw_info']['navbar']['logout']['url']);
+                       $menu['about'] = array ('text' => lang('About'), 'url' 
=> $GLOBALS['phpgw']->link('/about.php', array('app' => 
$GLOBALS['phpgw_info']['flags']['currentapp']) ));
+                       $menu['logout'] = $navbar['logout'];
 
-                       display_sidebox('',$menu_title,$file);
+                       display_sidebox($menu_title, $menu);
+               }
                
-                       
$GLOBALS['phpgw']->hooks->single('sidebox_menu',$GLOBALS['phpgw_info']['flags']['currentapp']);
+               if ( 
isset($navigation[$GLOBALS['phpgw_info']['flags']['currentapp']])
+                       && $GLOBALS['phpgw_info']['flags']['currentapp'] != 
'admin' )
+               {
+                       
display_sidebox($navbar[$GLOBALS['phpgw_info']['flags']['currentapp']]['text'], 
$navigation[$GLOBALS['phpgw_info']['flags']['currentapp']]);
                }
 
-               $GLOBALS['phpgw']->template->pparse('out','navbar_footer');
+               if ( $GLOBALS['phpgw_info']['flags']['currentapp'] != 
'preferences' )
+               {
+                       $prefs = execMethod('phpgwapi.menu.get', 'preferences');
+                       if ( 
isset($prefs[$GLOBALS['phpgw_info']['flags']['currentapp']]) )
+                       {
+                               display_sidebox(lang('preferences'), 
$prefs[$GLOBALS['phpgw_info']['flags']['currentapp']]);
+                       }
+               }
 
+               if ( 
isset($navigation['admin'][$GLOBALS['phpgw_info']['flags']['currentapp']]['children'])
 )
+               {
+                       display_sidebox(lang('administration'), 
$navigation['admin'][$GLOBALS['phpgw_info']['flags']['currentapp']]['children']);
+               }
+
+               $GLOBALS['phpgw']->template->pparse('out', 'navbar_footer');
+
                // If the application has a header include, we now include it
                if ( (!isset($GLOBALS['phpgw_info']['flags']['noappheader'])
                        || !$GLOBALS['phpgw_info']['flags']['noappheader'] )
@@ -148,28 +154,21 @@
                }
                $GLOBALS['phpgw']->template->set_root(PHPGW_APP_TPL);
                $GLOBALS['phpgw']->hooks->process('after_navbar');
-               unset($GLOBALS['phpgw_info']['navbar']);
        }
 
-
        /**
        * Display sidebox
        *
        * @param string $appname
        * @param string $menu_title
        * @param string $file
-       * @param boolean $use_lang
        */
-       function display_sidebox($appname, $menu_title, $file, $use_lang = true)
-       {
-               
-               if(!$appname || ($appname == 
$GLOBALS['phpgw_info']['flags']['currentapp'] && is_array($file) ) )
+       function display_sidebox($menu_title, $menu)
                {
-                       $var['lang_title'] = $menu_title;
-                       $GLOBALS['phpgw']->template->set_var($var);
+               $GLOBALS['phpgw']->template->set_var('lang_title', $menu_title);
                        
$GLOBALS['phpgw']->template->pfp('out','extra_blocks_header');
                        
-                       foreach ( $file as $item )
+               foreach ( $menu as $key => $item )
                        {
                                if ( !isset($item['url']) )
                                {
@@ -186,11 +185,10 @@
                                        $item['this'] = '';
                                }
 
-                               sidebox_menu_item($item['url'], $item['text'], 
$item['image'], $use_lang, $item['this']);
+                       sidebox_menu_item($item['url'], $item['text'], 
$item['image'], $item['this']);
                        }
 
-                       
$GLOBALS['phpgw']->template->pfp('out','extra_blocks_footer');
-               }
+               $GLOBALS['phpgw']->template->pfp('out', 'extra_blocks_footer');
        }
 
 
@@ -200,26 +198,16 @@
        * @param string $item_link
        * @param string $item_text
        * @param string $item_image
-       * @param boolean $use_lang
        */
-       function sidebox_menu_item($item_link='', $item_text='', 
$item_image='', $use_lang = True, $current_item = '')
+       function sidebox_menu_item($item_link='', $item_text='', 
$item_image='', $highlight = '')
        {
-               if($item_text == '_NewLine_')
-               {
-                       
$GLOBALS['phpgw']->template->pfp('out','extra_block_spacer');
-               }
-               else
-               {
-                       $lang_item = $use_lang ? lang($item_text) : $item_text;
                        $GLOBALS['phpgw']->template->set_var(array
                        (
-                               'list_style_image'      => ($item_image ? 
"url('{$item_image}')" : 'none'),
-                               'lang_item'                     => 
$current_item ? '<b>' . $lang_item . '</b>': $lang_item,
+                       'lang_item'                     => $highlight ? 
"<strong>$item_text</strong>": $item_text,
                                'item_link'                     => $item_link
                        ));
                        
$GLOBALS['phpgw']->template->pfp('out','extra_block_row');
                }
-       }
        
        /**
        * Parse navigation bar end
@@ -244,4 +232,33 @@
                $GLOBALS['phpgw']->template->set_var($var);
                $GLOBALS['phpgw']->template->pfp('out','footer');
        }
-?>
+
+       /**
+       * Callback for usort($navbar)
+       *
+       * @param array $item1 the first item to compare
+       * @param array $item2 the second item to compare
+       * @return int result of comparision
+       */
+       function sort_navbar($item1, $item2)
+       {
+               $a =& $item1['order'];
+               $b =& $item2['order'];
+
+               if ($a == $b)
+               {
+                       return strcmp($item1['text'], $item2['text']);
+               }
+               return ($a < $b) ? -1 : 1;
+       }
+
+       /**
+       * Organise the navbar properly
+       *
+       * @param array $navbar the navbar items
+       * @return array the organised navbar
+       */
+       function prepare_navbar(&$navbar)
+       {
+               uasort($navbar, 'sort_navbar');
+       }

Modified: trunk/phpgwapi/templates/idots/navbar.tpl
===================================================================
--- trunk/phpgwapi/templates/idots/navbar.tpl   2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/phpgwapi/templates/idots/navbar.tpl   2008-02-02 13:52:39 UTC (rev 
18466)
@@ -26,6 +26,7 @@
        </div>
        <div id="{content_class}">
                <h1 class="articletitle">{current_app_title}</h1>
+{menubar}
                <div id="articlecontent">
 <!-- END navbar_footer -->
 
@@ -41,9 +42,6 @@
 <!-- END extra_blocks_footer -->
 
 <!-- BEGIN extra_block_row -->
-                               <li style="list-style-image: 
{list_style_image};"><a href="{item_link}">{lang_item}</a></li>
+                               <li><a href="{item_link}">{lang_item}</a></li>
 <!-- END extra_block_row -->
 
-<!-- BEGIN extra_block_spacer -->
-                               <li class="empty_item">&nbsp;</li>
-<!-- END extra_block_spacer -->

Modified: trunk/phpgwapi/templates/idsociety/css/base.css
===================================================================
--- trunk/phpgwapi/templates/idsociety/css/base.css     2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/phpgwapi/templates/idsociety/css/base.css     2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -4,6 +4,13 @@
        font-size: 11px;
 }
 
+body
+{
+       background-color: #ccc;
+       margin: 0;
+       padding: 0;
+}
+
 a
 {
        text-decoration: none;
@@ -19,13 +26,6 @@
        color: #f00;
 }
 
-body
-{
-       background-color: #ccc;
-       margin: 0px;
-}
-
-
 img
 {
        border: 0px;
@@ -74,3 +74,35 @@
        font-weight: bold;
        text-align: center;
 }
+
+#navbar
+{
+       list-style: none;
+       margin: 0;
+       padding: 0;
+}
+
+#navbar li
+{
+       background: #999 url(../images/nonav.png) no-repeat scroll top right;
+       display: block;
+       font-size: 9px;
+       font-weight: bold;
+       height: 15px;
+       overflow: hidden;
+       margin: 0;
+       padding: 7px 0 0 0;
+       width: 154px;
+       white-space: nowrap;
+}
+
+#navbar li a
+{
+       color: #fff;
+       padding: 3px 0 0 15px;
+}
+
+#navbar li:hover
+{
+       background-image: url(../images/nonav-over.png);
+}

Modified: trunk/phpgwapi/templates/idsociety/head.inc.php
===================================================================
(Binary files differ)

Modified: trunk/phpgwapi/templates/idsociety/head.tpl
===================================================================
(Binary files differ)

Modified: trunk/phpgwapi/templates/idsociety/navbar.inc.php
===================================================================
(Binary files differ)

Modified: trunk/phpgwapi/templates/idsociety/navbar.tpl
===================================================================
(Binary files differ)

Modified: trunk/phpgwapi/templates/justweb/navbar.inc.php
===================================================================
(Binary files differ)

Modified: trunk/phpgwapi/templates/linux-at-work.de/navbar.inc.php
===================================================================
--- trunk/phpgwapi/templates/linux-at-work.de/navbar.inc.php    2008-02-02 
11:18:25 UTC (rev 18465)
+++ trunk/phpgwapi/templates/linux-at-work.de/navbar.inc.php    2008-02-02 
13:52:39 UTC (rev 18466)
@@ -27,44 +27,46 @@
                );
                $tpl->set_block('navbar','preferences','preferences_icon');
 
-               //$tpl->set_block('navbar','B_powered_top','V_powered_top');
-               //$tpl->set_block('navbar','B_num_users','V_num_users');
-
                $var['img_root'] = PHPGW_IMAGES_DIR;
                $var['img_root_roll'] = PHPGW_IMAGES_DIR . '/rollover';
-               $var['table_bg_color'] = 
$GLOBALS['phpgw_info']['theme']['navbar_bg'];
 
-               #  echo '<pre>'; print_r($GLOBALS['phpgw_info']['navbar']); 
echo '</pre>';
-               $applications = '';
-               foreach($GLOBALS['phpgw_info']['navbar'] as $app => $app_data)
+               $exclude = array('home', 'preferences', 'about', 'logout');
+               $navbar = execMethod('phpgwapi.menu.get', 'navbar');
+               prepare_navbar($navbar);
+               foreach ( $navbar as $app => $app_data )
                {
-                       if ($app != 'home' && $app != 'preferences' && ! 
ereg('about',$app) && $app != 'logout')
+                       if ( in_array($app, $exclude) )
                        {
-                               $applications .= '<tr><td 
class="main_menu_apps"><a class="main_menu" href="' . $app_data['url'] . '"';
-                               if 
(isset($GLOBALS['phpgw_info']['flags']['navbar_target']))
-                               {
-                                       $applications .= ' target="' . 
$GLOBALS['phpgw_info']['flags']['navbar_target'] . '"';
-                               }
+                               continue;
+                       }
+                       $img = 
$GLOBALS['phpgw']->common->image($app_data['image'][0], $app_data['image'][1]);
+                       $var['applications'] .= <<<HTML
+                       <tr>
+                               <td class="main_menu_apps">
+                                       <a class="main_menu" 
href="{$app_data['url']}">{$app_data['text']}></a>
+                               </td>
+                       </tr>
 
-                               $applications .= 
'>'.$app_data['title'].'</a></td></tr>'."\r\n";
-                       }
-                       $img_src_over = 
$GLOBALS['phpgw']->common->image($app,'navbar-over.gif');
-                       if($img_src_over)
-                       {
-                               $pre_load[] = $img_src_over;
-                       }
+HTML;
+                       /* TODO this should be implemented at some point - 
skwashd feb08
+                       $tpl->set_var(array
+                       (
+                               'text'  => strtoupper($app_data['text']),
+                               'url'   => $app_data['url']
+                               'img'   => 
$GLOBALS['phpgw']->common->image($app_data['image'][0], $app_data['image'][1])
+                       ));
+                       $tpl->parse('apps', 'app', true);
+                       */
                }
 
-               $var['applications'] = $applications;
-     
-               $var['home_link']       = 
$GLOBALS['phpgw_info']['navbar']['home']['url'];
-               $var['preferences_link'] = 
$GLOBALS['phpgw_info']['navbar']['preferences']['url'];
-               $var['logout_link']     = 
$GLOBALS['phpgw_info']['navbar']['logout']['url'];
-               $var['help_link']       = 
$GLOBALS['phpgw_info']['navbar']['about']['url'];
-               $var['lang_welcome']    = lang('welcome');
-               $var['lang_preferences']        = lang('preferences');
-               $var['lang_logout']     = lang('logout');
-               $var['lang_help']       = lang('help');
+               $var['home_link']       = $navbar['home']['url'];
+               $var['preferences_link'] = $navbar['preferences']['url'];
+               $var['logout_link']     = $navbar['logout']['url'];
+               $var['help_link']       = $navbar['about']['url'];
+               $var['lang_welcome']    = $navbar['home']['text'];;
+               $var['lang_preferences']        = 
$navbar['preferences']['text'];
+               $var['lang_logout']     =  $navbar['logout']['text'];
+               $var['lang_help']       = $navbar['about']['text'];
 
                // "powered_by_color" and "_size" are is also used by number of 
current users thing
                $var['powered_by_size'] = '2';
@@ -195,3 +197,26 @@
                $tpl->pfp('out','footer');
 */
        }
+
+       /**
+       * Callback for usort($navbar)
+       *
+       * @param array $item1 the first item to compare
+       * @param array $item2 the second item to compare
+       * @return int result of comparision
+       */
+       function sort_navbar($item1, $item2)
+       {
+               return strcmp($item1['text'], $item2['text']);
+       }
+
+       /**
+       * Organise the navbar properly
+       *
+       * @param array $navbar the navbar items
+       * @return array the organised navbar
+       */
+       function prepare_navbar(&$navbar)
+       {
+               uasort($navbar, 'sort_navbar');
+       }

Modified: trunk/phpgwapi/templates/probusiness/css/styles.css
===================================================================
--- trunk/phpgwapi/templates/probusiness/css/styles.css 2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/phpgwapi/templates/probusiness/css/styles.css 2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -433,8 +433,8 @@
 TABLE.APINavBar TD.modBg {background-color: #808080; padding-top: 2px; 
padding-bottom: 9px}
 TABLE.APINavBar TD.modBg IMG           { border: 1px solid #808080 }
 TABLE.APINavBar TD.modBg IMG:hover  { border: 1px solid #DACACA }
-TABLE.APINavBar TD.modBg A#selectedNavLink IMG { border: 1px solid #DACACA }
-TABLE.APINavBar TD.modBg A#selectedNavLink SPAN {color: #FFFFFF }
+TABLE.APINavBar TD.modBg A.selectedNavLink IMG { border: 1px solid #DACACA }
+TABLE.APINavBar TD.modBg A.selectedNavLink SPAN {color: #FFFFFF }
 TABLE.APINavBar IFRAME { height: 650px; width: 250px; }
 
 P.current_app_header { font-variant: small-caps; font-weight: bold }

Modified: trunk/phpgwapi/templates/probusiness/footer.tpl
===================================================================
--- trunk/phpgwapi/templates/probusiness/footer.tpl     2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/phpgwapi/templates/probusiness/footer.tpl     2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -6,9 +6,6 @@
        <tr>
          <td align="center">
       <span id="powered_by">{powered_by}</span> - <span 
id="user_info">&nbsp;{user_info}</span>
-
-<!-- not yet supported <div id="current_users">{current_users}</div> -->
- 
     </td>
        </tr>
 </table>

Modified: trunk/phpgwapi/templates/probusiness/navbar.inc.php
===================================================================
--- trunk/phpgwapi/templates/probusiness/navbar.inc.php 2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/phpgwapi/templates/probusiness/navbar.inc.php 2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -22,13 +22,11 @@
                $tpl = createobject('phpgwapi.Template',PHPGW_TEMPLATE_DIR);
                $tpl->set_unknowns('remove');
 
-               $tpl->set_file(array('navbar'           => 'navbar.tpl',
-                         'navbar_app'       => 'navbar_app.tpl',
-                         'navbar_app_select'=> 'navbar_app_select.tpl',
-                         'navbar_app_table' => 'navbar_app_tablecontent.tpl'
-                        ));
+               $tpl->set_file('navbar', 'navbar.tpl');
+               $tpl->set_block('navbar', 'app_row', 'app_rows');
 
                $var['api_root'] = 
$GLOBALS['phpgw_info']['server']['webserver_url'] . 
'/phpgwapi/templates/probusiness/';
+               
        /*
         *  folder handling
         */
@@ -39,7 +37,7 @@
                        $folderMode = $mtree->get_folderMode();
                }
 
-               if ( $folderMode == 'enabled' )
+               if ( false ) //$folderMode == 'enabled' )
                {
                        if 
($GLOBALS['phpgw_info']['user']['apps']['folders']['enabled'] == true)
                        {
@@ -52,45 +50,19 @@
                /*
                 *  application list
                 */
-                       $navBarMode = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['navbar_format'];
-                       
$tpl->set_block('navbar_app_table','app_row','app_rows');
-                       foreach($GLOBALS['phpgw_info']['navbar'] as $app => 
$app_data)
-                       {
-
-                               $label = '';
-                               if ( $navBarMode == 'text' OR $navBarMode == 
'icons_and_text' )
+                       $navbar = execMethod('phpgwapi.menu.get', 'navbar');
+                       prepare_navbar($navbar);
+                       foreach ( $navbar as $app => $app_data )
                                {
-                                       $label = $app_data['title'];
-                               }
-                               if ( $navBarMode == 'icons_and_text' )
+                               if ( $app == 
$GLOBALS['phpgw_info']['flags']['currentapp'] )
                                {
-                                       $var['break'] = '<br />';
+                                       $app_data['class'] = ' 
class="selectedNavLink"';
                                }
-                               if (  $navBarMode == 'icons' OR $navBarMode == 
'icons_and_text' OR $navBarMode == '')
-                               {
+                               $app_data['image'] = 
$GLOBALS['phpgw']->common->image($app_data['image'][0], $app_data['image'][1]);
+                               $tpl->set_var($app_data);
                                        
-                                       $image = '<img src="' . 
$app_data['icon'] .
-                                                '" alt="' . $app_data['title'] 
.
-                                                '" title="' . 
$app_data['title'] .
-                                                '" />';
+                               $tpl->parse('app_rows','app_row',true);
                                }
-
-                               $var['appllink'] = $app_data['url'];
-                               $var['image'] = $image;
-                               $var['label'] = $label;
-                               $tpl->set_var($var);
-                               // mark actual selected application
-                               if 
($GLOBALS['phpgw_info']['flags']['currentapp'] == $app)
-                               {
-                                       $tpl->fp('appdiv','navbar_app_select');
-                               }
-                               else
-                               {
-                                       $tpl->fp('appdiv','navbar_app');
-                               }
-                               $tpl->fp('app_rows','app_row',true);
-                       }
-                       $tpl->parse('navbarview','app_rows',false);
                }
 
                // get sidebox content and parse it as a menu
@@ -157,7 +129,7 @@
                $tpl->set_unknowns('remove');
                $tpl->set_file(array('footer' => 'footer.tpl'));
 
-               $var['powered_by'] = '[ layout powered by <a target="_blank" 
href="http://www.probusiness.de";>pro|business AG</a> ]';
+               $var['powered_by'] = lang('Powered by phpGroupWare version %1', 
$GLOBALS['phpgw_info']['server']['versions']['phpgwapi']);
 
                if (isset($GLOBALS['phpgw_info']['navbar']['admin'])
                        && 
isset($GLOBALS['phpgw_info']['user']['preferences']['common']['show_currentusers'])
@@ -228,3 +200,34 @@
                        return $return;
                }
        }
+
+       
+       /**
+       * Callback for usort($navbar)
+       *
+       * @param array $item1 the first item to compare
+       * @param array $item2 the second item to compare
+       * @return int result of comparision
+       */
+       function sort_navbar($item1, $item2)
+       {
+               $a =& $item1['order'];
+               $b =& $item2['order'];
+
+               if ($a == $b)
+               {
+                       return strcmp($item1['text'], $item2['text']);
+               }
+               return ($a < $b) ? -1 : 1;
+       }
+
+       /**
+       * Organise the navbar properly
+       *
+       * @param array $navbar the navbar items
+       * @return array the organised navbar
+       */
+       function prepare_navbar(&$navbar)
+       {
+               uasort($navbar, 'sort_navbar');
+       }

Modified: trunk/phpgwapi/templates/probusiness/navbar.tpl
===================================================================
--- trunk/phpgwapi/templates/probusiness/navbar.tpl     2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/phpgwapi/templates/probusiness/navbar.tpl     2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -3,9 +3,15 @@
   <tr>
     <td class="APINavBar" align="center">
       <table class="APINavBar">
-        <tr><td id="logo"><img src="{api_root}/images/logo.gif" 
title="www.phpgroupware.org" alt="phpgroupware" /></td></tr>
+        <tr><td id="logo"><img src="{api_root}/images/logo.png" 
title="www.phpgroupware.org" alt="phpgroupware" /></td></tr>
         <tr><td>{switchlink}</td></tr>
-        {navbarview}
+               <!-- BEGIN app_row -->
+        <tr>
+                       <td class="modBg">
+                               <a href="{url}"{class}><img src="{image}" 
alt="{text}"><br>{text}</a>
+                       </td>
+               </tr>
+               <!-- END app_row -->
       </table>
     </td>
     <td valign="top">

Modified: trunk/phpgwapi/templates/simple/css/simple.css
===================================================================
--- trunk/phpgwapi/templates/simple/css/simple.css      2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/phpgwapi/templates/simple/css/simple.css      2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -31,6 +31,49 @@
        background-color: #eee;
 }
 
+#navbar, #footer ul
+{
+       list-style: none;
+       margin: 0;
+       padding: 0;
+}
+
+#navbar, #footer
+{
+       background-color: #99f;
+}
+
+#navbar li
+{
+       display: inline;
+       margin: 0;
+       padding: 3px;
+}
+
+#navbar-current-app
+{
+       text-align: center;
+       font-weight: bold;
+       background-color: #d3dce3;
+       padding:5px;
+}
+
+#footer li
+{
+       display: block;
+       float: left;
+       font-size: smaller;
+       font-weight: bold;
+       padding: 3px; 
+       text-align: center;
+       width: 33%;
+}
+
+#footer li, #footer a
+{
+       color: #fff;
+}
+
 th
 {
        color: #000;
@@ -39,11 +82,10 @@
 
 .tablink
 {
-       color: #000000;
+       color: #000;
 }
 
 img, input[type=image]
 {
        border: 0px;
 }
-

Modified: trunk/phpgwapi/templates/simple/footer.tpl
===================================================================
--- trunk/phpgwapi/templates/simple/footer.tpl  2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/phpgwapi/templates/simple/footer.tpl  2008-02-02 13:52:39 UTC (rev 
18466)
@@ -1,12 +1,12 @@
 <!-- BEGIN footer -->
 </td></tr></table>
-<table border="0" cellspacing="0" cellpadding="0" width="100%" 
bgcolor="{table_bg_color}">
-  <TR>
-    <TD>&nbsp;{user_info}<br></TD>
-    <TD align="center">{current_users}<br></TD>
-    <TD align="right">{powered_by}&nbsp;<br></TD>
-  </TR>
-</Table>
-
+<div id="footer">
+       <ul>
+               <li>{user_info}</li>
+               <li>{current_users}</li>
+               <li>{powered_by}</li>
+       </ul>
+       <br clear="both">
+</ul>
 <!-- END footer -->
 

Modified: trunk/phpgwapi/templates/simple/head.inc.php
===================================================================
--- trunk/phpgwapi/templates/simple/head.inc.php        2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/phpgwapi/templates/simple/head.inc.php        2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -13,8 +13,8 @@
                $GLOBALS['phpgw_info']['server']['site_title'] = lang('please 
set a site name in admin &gt; siteconfig');
        }
 
-       $tpl = CreateObject('phpgwapi.Template',PHPGW_TEMPLATE_DIR);
-       $tpl->set_unknowns('remove');
+       // we hack the template root here as this is the template set of last 
resort
+       $tpl = CreateObject('phpgwapi.Template', dirname(__FILE__), "remove");
        $tpl->set_file(array('head' => 'head.tpl'));
        $tpl->set_block('head', 'theme_stylesheet', 'theme_stylesheets');
 

Modified: trunk/phpgwapi/templates/simple/head.tpl
===================================================================
--- trunk/phpgwapi/templates/simple/head.tpl    2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/phpgwapi/templates/simple/head.tpl    2008-02-02 13:52:39 UTC (rev 
18466)
@@ -1,14 +1,14 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <!-- BEGIN head -->
-<HTML>
-       <HEAD>
-               <META http-equiv="Content-Type" content="text/html; 
charset=utf-8">
-               <META name="AUTHOR" content="phpGroupWare 
http://www.phpgroupware.org";>
-               <META NAME="description" CONTENT="phpGroupWare">
-               <META NAME="keywords" CONTENT="phpGroupWare">
+<html>
+       <head>
+               <meta http-equiv="Content-Type" content="text/html; 
charset=utf-8">
+               <meta name="AUTHOR" content="phpGroupWare 
http://www.phpgroupware.org";>
+               <meta name="description" content="phpGroupWare">
+               <meta name="keywords" content="phpGroupWare">
                <meta name="robots" content="none">
-               <LINK REL="ICON" href="{img_icon}" type="image/x-ico">
-               <LINK REL="SHORTCUT ICON" href="{img_shortcut}">
+               <link rel="ICON" href="{img_icon}" type="image/x-ico">
+               <link rel="SHORTCUT ICON" href="{img_icon}">
                {css}
                <!-- BEGIN theme_stylesheet -->
                <link href="{theme_style}" type="text/css" rel="StyleSheet">
@@ -20,8 +20,7 @@
                        -->
                </script>
                {java_script}
-               <TITLE>{website_title}</TITLE>
-
-       </HEAD>
-<BODY {body_tags}>
+               <title>{website_title}</title>
+       </head>
+<body>
 <!-- END Head -->

Modified: trunk/phpgwapi/templates/simple/navbar.inc.php
===================================================================
--- trunk/phpgwapi/templates/simple/navbar.inc.php      2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/phpgwapi/templates/simple/navbar.inc.php      2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -16,85 +16,32 @@
        */
   function parse_navbar($force = False)
   {
-               $tpl = createobject('phpgwapi.Template',PHPGW_TEMPLATE_DIR);
-               $tpl->set_unknowns('remove');
+               // we hack the template root here as this is the template set 
of last resort
+               $tpl = CreateObject('phpgwapi.Template', dirname(__FILE__), 
"remove");
 
-               $tpl->set_file(
-                       array(
-                               'navbar'                => 'navbar.tpl',
-                               'navbar_app'    => 'navbar_app.tpl'
-                       )
-               );
+               $tpl->set_file('navbar', 'navbar.tpl');
+               $tpl->set_block('navbar', 'app', 'apps');
 
-               $var['navbar_color'] = 
(isset($GLOBALS['phpgw_info']['theme']['navbar_bg'])?$GLOBALS['phpgw_info']['theme']['navbar_bg']:'#9999FF');
-
-               $i = 1;
-               foreach($GLOBALS['phpgw_info']['navbar'] as $app => $app_data)
+               $navbar = execMethod('phpgwapi.menu.get', 'navbar');
+               prepare_navbar($navbar);
+               foreach ( $navbar as $app => $app_data )
                {
-                       if 
($GLOBALS['phpgw_info']['user']['preferences']['common']['navbar_format'] == 
'text')
-                       {
-                               $tabs[$i]['label'] = $app_data['title'];
-                               $tabs[$i]['link']  = $app_data['url'];
-                               if 
(ereg($GLOBALS['phpgw_info']['navbar'][$app],$_SERVER['PHP_SELF']))
-                               {
-                                       $selected = $i;
+                       $tpl->set_var(array
+                       (
+                               'url'   => $app_data['url'],
+                               'text'  => $app_data['text'],
+                               'icon'  => 
$GLOBALS['phpgw']->common->image($app_data['image'][0], $app_data['image'][1])
+                       ));
+                       $tpl->parse('apps', 'app', true);
                                }
-                               $i++;
-                       }
-                       else
-                       {
-                               $title = '<img src="' . $app_data['icon'] . '" 
alt="' . $app_data['title'] . '" title="'
-                                       . $app_data['title'] . '" border="0">';
-                               if 
($GLOBALS['phpgw_info']['user']['preferences']['common']['navbar_format'] == 
'icons_and_text')
-                               {
-                                       $title .= "<br>" . $app_data['title'];
-                                       $var['width'] = '7%';
-                               }
-                               else
-                               {
-                                       $var['width']  = '3%';
-                               }
    
-                               $var['value'] = '<a href="' . $app_data['url'] 
. '">' . $title . '</a>';
-                               $var['align'] = 'center';
-                               $tpl->set_var($var);
-                               $tpl->parse('applications','navbar_app',True);
-                       }
-               }
-               if 
($GLOBALS['phpgw_info']['user']['preferences']['common']['navbar_format'] == 
'text')
-               {
-                       $var['navbar_color'] = 
$GLOBALS['phpgw_info']['theme']['bg_color'];
-                       $var['align'] = 'right';
-                       $var['value'] = 
$GLOBALS['phpgw']->common->create_tabs($tabs,$selected,-1);
-                       $tpl->set_var($var);
-                       $tpl->parse('applications','navbar_app',True);
-               }
-
-               if ($GLOBALS['phpgw_info']['server']['showpoweredbyon'] == 
'top')
-               {
-                       $var['powered_by'] = lang('Powered by phpGroupWare 
version %1',$GLOBALS['phpgw_info']['server']['versions']['phpgwapi']);
-               }
-               if (isset($GLOBALS['phpgw_info']['navbar']['admin'])
-                       && 
isset($GLOBALS['phpgw_info']['user']['preferences']['common']['show_currentusers'])
-                       && 
$GLOBALS['phpgw_info']['user']['preferences']['common']['show_currentusers'])
-               {
-                       $var['current_users'] = '<a href="' . 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.uicurrentsessions.list_sessions'))
-                               . '">&nbsp;' . lang('Current users') . ': ' . 
$GLOBALS['phpgw']->session->total() . '</a>';
-               }
-               $now = time();
-               $var['user_info'] = 
$GLOBALS['phpgw']->common->display_fullname() . ' - '
-                               . 
lang($GLOBALS['phpgw']->common->show_date($now,'l')) . ' '
-                               . 
$GLOBALS['phpgw']->common->show_date($now,$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
-//                             . 
lang($GLOBALS['phpgw']->common->show_date($now,'F')) . ' '
-//                             . $GLOBALS['phpgw']->common->show_date($now,'d, 
Y');
-
                // Maybe we should create a common function in the 
phpgw_accounts_shared.inc.php file
                // to get rid of duplicate code.
                if ($GLOBALS['phpgw_info']['user']['lastpasswd_change'] == 0)
                {
                        $api_messages = lang('You are required to change your 
password during your first login')
                                . '<br> Click this image on the navbar: <img 
src="'
-                               . 
$GLOBALS['phpgw']->common->image('preferences','navbar.gif').'">';
+                               . 
$GLOBALS['phpgw']->common->image('preferences', 'navbar').'">';
                }
                elseif ($GLOBALS['phpgw_info']['user']['lastpasswd_change'] < 
time() - (86400*30))
                {
@@ -104,13 +51,12 @@
                // This is gonna change
                if (isset($cd))
                {
-                       $var['messages'] = $api_messages . '<br>' . 
checkcode($cd);
+                       $var['messages'] = "<div 
class=\"warn\">$api_messages<br>\n" . checkcode($cd) . "</div>\n";
                }
 
                if (isset($GLOBALS['phpgw_info']['flags']['app_header']))
                {
                        $var['current_app_header'] = 
$GLOBALS['phpgw_info']['flags']['app_header'];
-                       $var['th_bg'] = 
isset($GLOBALS['phpgw_info']['theme']['th_bg'])?$GLOBALS['phpgw_info']['theme']['th_bg']:'#D3DCE3';
                }
                else
                {
@@ -119,7 +65,8 @@
                }
 
                $tpl->set_var($var);
-               $tpl->pfp('out','navbar');
+               $tpl->pfp('out', 'navbar');
+
                // If the application has a header include, we now include it
                if ( (!isset($GLOBALS['phpgw_info']['flags']['noappheader'])
                        || !$GLOBALS['phpgw_info']['flags']['noappheader'] )
@@ -142,20 +89,16 @@
        */
        function parse_navbar_end()
        {
-               if ($GLOBALS['phpgw_info']['server']['showpoweredbyon'] == 
'bottom')
-               {
-                       $tpl = 
createobject('phpgwapi.Template',PHPGW_TEMPLATE_DIR);
-                       $tpl->set_unknowns('remove');
+               // we hack the template root here as this is the template set 
of last resort
+               $tpl = CreateObject('phpgwapi.Template', dirname(__FILE__), 
"remove");
    
-                       $tpl->set_file(
-                               array(
-                                       'footer' => 'footer.tpl'
-                               )
+               $tpl->set_file('footer', 'footer.tpl');
+
+               $var = array
+               (
+                       'powered_by' => lang('Powered by phpGroupWare version 
%1',$GLOBALS['phpgw_info']['server']['versions']['phpgwapi'])
                        );
-                       $var = Array(
-                               'table_bg_color'        => 
(isset($GLOBALS['phpgw_info']['theme']['navbar_bg'])?$GLOBALS['phpgw_info']['theme']['navbar_bg']:'#9999FF'),
-                       );
-                       $var['powered_by'] = lang('Powered by phpGroupWare 
version %1',$GLOBALS['phpgw_info']['server']['versions']['phpgwapi']);
+
                        if (isset($GLOBALS['phpgw_info']['navbar']['admin'])
                                && 
isset($GLOBALS['phpgw_info']['user']['preferences']['common']['show_currentusers'])
                                && 
$GLOBALS['phpgw_info']['user']['preferences']['common']['show_currentusers'])
@@ -171,4 +114,33 @@
                        $GLOBALS['phpgw']->hooks->process('navbar_end');
                        $tpl->pfp('out','footer');
                }
+
+       /**
+       * Callback for usort($navbar)
+       *
+       * @param array $item1 the first item to compare
+       * @param array $item2 the second item to compare
+       * @return int result of comparision
+       */
+       function sort_navbar($item1, $item2)
+       {
+               $a =& $item1['order'];
+               $b =& $item2['order'];
+
+               if ($a == $b)
+               {
+                       return strcmp($item1['text'], $item2['text']);
+               }
+               return ($a < $b) ? -1 : 1;
        }
+
+       /**
+       * Organise the navbar properly
+       *
+       * @param array $navbar the navbar items
+       * @return array the organised navbar
+       */
+       function prepare_navbar(&$navbar)
+       {
+               uasort($navbar, 'sort_navbar');
+       }

Modified: trunk/phpgwapi/templates/simple/navbar.tpl
===================================================================
--- trunk/phpgwapi/templates/simple/navbar.tpl  2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/phpgwapi/templates/simple/navbar.tpl  2008-02-02 13:52:39 UTC (rev 
18466)
@@ -1,29 +1,12 @@
 <!-- BEGIN navbar -->
-<table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr bgcolor="{navbar_color}">
-  <td align="left">&nbsp;</td>
-  {applications}  
- </tr>
-</table>
-<table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
-  <td align="left">
-   {powered_by}
-  </td>
- </tr>
-<!-- <tr>
-  <td align="left" colspan="2">
-   {user_info}
-  </td>
-  <td align="right">
-   {current_users}
-  </td>
- </tr>-->
-</table>
+<ul id="navbar">
+       <!-- BEGIN app -->
+       <li><a href="{url}"><img src="{icon}" alt="{text}" 
title="{text}"></a></li>
+       <!-- END app -->
+</ul>
 <table width="100%" cellspacing="5"><tr><td>
 <!-- BEGIN app_header -->
-<div style="text-align: center; font-weight: bold; background-color: {th_bg}; 
padding:5px">{current_app_header}</div>
-<hr>
+<div id="navbar-current-app">{current_app_header}</div>
 <!-- END app_header -->
-{messages}<br>
+{messages}
 <!-- END navbar -->

Modified: trunk/phpgwapi/templates/verdilak/navbar.inc.php
===================================================================
--- trunk/phpgwapi/templates/verdilak/navbar.inc.php    2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/phpgwapi/templates/verdilak/navbar.inc.php    2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -18,6 +18,7 @@
        function parse_navbar($force = False)
        {
 
+               /* FIXME remove this rubbish
                $GLOBALS['phpgw_info']['theme']['bg_color']    = '#FFFFFF';
                $GLOBALS['phpgw_info']['theme']['bg_text']     = '#000000';
                $GLOBALS['phpgw_info']['theme']['vlink']       = 'blue';
@@ -43,15 +44,12 @@
                $GLOBALS['phpgw_info']['theme']['bg08']        = '#da9090';
                $GLOBALS['phpgw_info']['theme']['bg09']        = '#da8a8a';
                $GLOBALS['phpgw_info']['theme']['bg10']        = '#da7a7a';
+               */
 
 
                $tpl = createobject('phpgwapi.Template',PHPGW_TEMPLATE_DIR);
 
-               $tpl->set_file(
-                       array(
-                               'navbartpl' => 'navbar.tpl'
-                       )
-               );
+               $tpl->set_file('navbartpl', 'navbar.tpl');
                $tpl->set_block('navbartpl','preferences');
                $tpl->set_block('navbartpl','navbar');
 
@@ -59,28 +57,23 @@
                $var['table_bg_color'] = 
$GLOBALS['phpgw_info']['theme']['navbar_bg'];
                $var['navbar_text'] = 
$GLOBALS['phpgw_info']['theme']['navbar_text'];
                $applications = '';
-               foreach($GLOBALS['phpgw_info']['navbar'] as $app => $app_data)
+               $exclude = array('home', 'preferences', 'about', 'logout');
+               $navbar = execMethod('phpgwapi.menu.get', 'navbar');
+               prepare_navbar($navbar);
+               foreach ( $navbar as $app => $app_data )
                {
-                       if ($app != 'home' && $app != 'preferences' && ! 
ereg('about',$app) && $app != 'logout')
+                       if ( in_array($app, $exclude) )
                        {
-                               if 
($GLOBALS['phpgw_info']['user']['preferences']['common']['navbar_format'] != 
'text')
-                               {
-                                       $title = '<img src="' . 
$app_data['icon'] . '" alt="' . $app_data['title'] . '" title="'
-                                               . $app_data['title'] . '" 
border="0">';
-                               }
+                               continue;
+                       }
+                       $icon = 
$GLOBALS['phpgw']->common->image($app_data['image'][0], $app_data['image'][1]);
+                       $applications .= <<<HTML
+                               <br>
+                               <a href="{$app_data['url']}">
+                                       <img src="{$icon}" 
alt="{$app_data['text']}" title="{{$app_data['text']}">
+                               </a>
 
-                               if 
($GLOBALS['phpgw_info']['user']['preferences']['common']['navbar_format'] != 
'icons')
-                               {
-                                       $title .= '<br>' . $app_data['title'];
-                               }
-                               $applications .= '<br><a href="' . 
$app_data['url'] . '"';
-                               if (isset($app_data['target']) &&  
$app_data['target'])
-                               {
-                                       $applications .= ' target="' . 
$app_data['target'] . '"';
-                               }
-                               $applications .= '>' . $title . '</a>';
-                               unset($title);
-                       }
+HTML;
                }
                $var['applications'] = $applications;
 
@@ -275,3 +268,33 @@
                        return $return;
                }
        }
+
+       /**
+       * Callback for usort($navbar)
+       *
+       * @param array $item1 the first item to compare
+       * @param array $item2 the second item to compare
+       * @return int result of comparision
+       */
+       function sort_navbar($item1, $item2)
+       {
+               $a =& $item1['order'];
+               $b =& $item2['order'];
+
+               if ($a == $b)
+               {
+                       return strcmp($item1['text'], $item2['text']);
+               }
+               return ($a < $b) ? -1 : 1;
+       }
+
+       /**
+       * Organise the navbar properly
+       *
+       * @param array $navbar the navbar items
+       * @return array the organised navbar
+       */
+       function prepare_navbar(&$navbar)
+       {
+               uasort($navbar, 'sort_navbar');
+       }

Modified: trunk/phpsysinfo/setup/phpgw_sv.lang
===================================================================
--- trunk/phpsysinfo/setup/phpgw_sv.lang        2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/phpsysinfo/setup/phpgw_sv.lang        2008-02-02 13:52:39 UTC (rev 
18466)
@@ -1,2 +1,3 @@
 phpsysinfo     admin   sv      Systeminformation
 view system information        admin   sv      Visa systeminformation
+

Modified: trunk/polls/setup/phpgw_sv.lang
===================================================================
--- trunk/polls/setup/phpgw_sv.lang     2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/polls/setup/phpgw_sv.lang     2008-02-02 13:52:39 UTC (rev 18466)
@@ -27,3 +27,4 @@
 voting booth admin     admin   sv      R\xF6stl\xE5da
 voting booth administration    polls   sv      R\xF6stl\xE5da Administration
 which poll     polls   sv      Vilken poll
+

Added: trunk/preferences/inc/class.menu.inc.php
===================================================================
--- trunk/preferences/inc/class.menu.inc.php                            (rev 0)
+++ trunk/preferences/inc/class.menu.inc.php    2008-02-02 13:52:39 UTC (rev 
18466)
@@ -0,0 +1,118 @@
+<?php
+       /**
+        * preferences - Menus
+        *
+        * @author Dave Hall <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 preferences 
+        * @version $Id: class.menu.inc.php 690 2008-02-02 10:11:33Z dave $
+        */
+
+       /*
+          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/>.
+        */
+
+
+       /**
+        * Menus
+        *
+        * @package preferences
+        */     
+       class preferences_menu
+       {
+               /**
+                * Get the menus for the preferences
+                *
+                * @return array available menus for the current user
+                */
+               function get_menu()
+               {
+                       $menus = array();
+
+                       $menus['navbar'] = array
+                       (
+                               'preferences' => array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('Preferences', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/preferences/index.php'),
+                                       'image' => array('preferences', 
'navbar'),
+                                       'order' => 0,
+                                       'group' => 'office'
+                               )
+                       );
+
+                       $menus['toolbar'] = array();
+
+                       $menus['navigation'] = array();
+                       $menus['navigation'][] = array
+                       (
+                               'text'  => 
$GLOBALS['phpgw']->translation->translate('My Preferences', array(), true),
+                               'url'   => 
$GLOBALS['phpgw']->link('/preferences/preferences.php', array('appname'      => 
'preferences')),
+                               'image' => array('preferences', 'preferences')
+                       );
+
+                       if ($GLOBALS['phpgw']->acl->check('changepassword',1))
+                       {
+                               $menus['navigation'][] = array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('Change your Password', array(), 
true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/preferences/changepassword.php')
+                               );
+                       }
+                       if ( 
(isset($GLOBALS['phpgw_info']['server']['auth_type']) && 
$GLOBALS['phpgw_info']['server']['auth_type'] == 'remoteuser') 
+                               || 
(isset($GLOBALS['phpgw_info']['server']['half_remote_user']) && 
$GLOBALS['phpgw_info']['server']['half_remote_user'] == 'remoteuser') )
+                       {
+                               if($GLOBALS['phpgw_info']['server']['mapping'] 
== 'table' || $GLOBALS['phpgw_info']['server']['mapping'] == 'all')
+                               {
+                                       $menus['navigation'][] = array
+                                       (
+                                               'text'  => 
$GLOBALS['phpgw']->translation->translate('Mapping', array(), true),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'preferences.uimapping.index', 'appname' => 'preferences') )
+                                       );
+                               }
+                       }
+                       
+                       if ( isset($navbar['admin']) )
+                       {
+                               $menus['navigation'][] = array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('Default Preferences', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/preferences/index.php', array('type' => 'default') )
+                               );
+                               $menus['navigation'][] = array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('Forced Preferences', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/preferences/index.php', array('type' => 'forced') )
+                               );
+                       }
+
+                       $menus['preferences'] = array
+                       (
+                               array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('Preferences', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/preferences/preferences.php', array('appname'      => 
'preferences')),
+                                       'image' => array('preferences', 
'preferences')
+                               ),
+                               array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('Change your Password', array(), 
true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/preferences/changepassword.php')
+                               )
+                       );
+
+                       return $menus;
+               }
+       }

Modified: trunk/preferences/inc/hook_settings.inc.php
===================================================================
--- trunk/preferences/inc/hook_settings.inc.php 2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/preferences/inc/hook_settings.inc.php 2008-02-02 13:52:39 UTC (rev 
18466)
@@ -31,14 +31,6 @@
        create_select_box('Theme (colors/fonts) Selection','theme',$_themes,
                'A theme defines the colors and fonts used by the template.');
 
-       $navbar_format = array(
-               'icons'          => lang('Icons only'),
-               'icons_and_text' => lang('Icons and text'),
-               'text'           => lang('Text only')
-       );
-       create_select_box('Show navigation bar 
as','navbar_format',$navbar_format,
-               'You can show the applications as icons only, icons with 
app-name or both.');
-
        $format = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
        $format = ($format ? $format : 'Y/m/d') . ', ';
        if 
($GLOBALS['phpgw_info']['user']['preferences']['common']['timeformat'] == '12')
@@ -151,7 +143,7 @@
 
        $menu_formats = array(
                'sidebox' => lang('Sidebox'),
-               'javamenu' => lang('Javamenu'),
+               'jsmenu' => lang('JS-menu'),
                'no_sidecontent' => lang('No SideContent')
        );
        create_select_box('SideContent','sidecontent',$menu_formats,

Modified: trunk/preferences/index.php
===================================================================
--- trunk/preferences/index.php 2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/preferences/index.php 2008-02-02 13:52:39 UTC (rev 18466)
@@ -17,42 +17,48 @@
         */
        include('../header.inc.php');
 
-       $pref_tpl = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
-       $templates = Array(
+       $GLOBALS['phpgw']->template->set_root(PHPGW_APP_TPL);
+       $templates = array
+       (
                'pref' => 'index.tpl'
        );
 
-       $pref_tpl->set_file($templates);
+       $GLOBALS['phpgw']->template->set_file($templates);
 
-       $pref_tpl->set_block('pref','list');
-       $pref_tpl->set_block('pref','app_row');
-       $pref_tpl->set_block('pref','app_row_noicon');
-       $pref_tpl->set_block('pref','link_row');
-       $pref_tpl->set_block('pref','spacer_row');
+       $GLOBALS['phpgw']->template->set_block('pref', 'list');
+       $GLOBALS['phpgw']->template->set_block('pref', 'app_row');
+       $GLOBALS['phpgw']->template->set_block('pref', 'app_row_noicon');
+       $GLOBALS['phpgw']->template->set_block('pref', 'link_row');
+       $GLOBALS['phpgw']->template->set_block('pref', 'spacer_row');
 
-       if ($GLOBALS['phpgw']->acl->check('run',1,'admin'))
+       if ( !$GLOBALS['phpgw']->acl->check('run', 1, 'admin') )
        {
+               die(lang('You do not have access to preferences'));
+       }
+       
                // This is where we will keep track of our position.
                // Developers won't have to pass around a variable then
-               $session_data = 
$GLOBALS['phpgw']->session->appsession('session_data','preferences');
+       $session_data = $GLOBALS['phpgw']->session->appsession('session_data', 
'preferences');
 
                if (! is_array($session_data))
                {
                        $session_data = array('type' => 'user');
-                       
$GLOBALS['phpgw']->session->appsession('session_data','preferences',$session_data);
+               $GLOBALS['phpgw']->session->appsession('session_data', 
'preferences', $session_data);
                }
 
-               if (! isset($_GET['type']))
+       $type = phpgw::get_var('type', 'string', 'GET');
+
+       if ( !$type )
                {
                        $type = $session_data['type'];
                }
                else
                {
-                       $type = $_GET['type'];
                        $session_data = array('type' => $type);
-                       
$GLOBALS['phpgw']->session->appsession('session_data','preferences',$session_data);
+               $GLOBALS['phpgw']->session->appsession('session_data', 
'preferences', $session_data);
                }
 
+       $tabs = array();
                $tabs[] = array(
                        'label' => lang('Your preferences'),
                        'link'  => 
$GLOBALS['phpgw']->link('/preferences/index.php',array('type'=>'user'))
@@ -68,12 +74,17 @@
 
                switch($type)
                {
-                       case 'user':    $selected = 0; break;
-                       case 'default': $selected = 1; break;
-                       case 'forced':  $selected = 2; break;
-               }
-               
$pref_tpl->set_var('tabs',$GLOBALS['phpgw']->common->create_tabs($tabs,$selected));
+               case 'default':
+                       $selected = 1;
+                       break;
+               case 'forced':
+                       $selected = 2;
+                       break;
+               case 'user':
+               default:
+                       $selected = 0;
        }
+       $GLOBALS['phpgw']->template->set_var('tabs', 
$GLOBALS['phpgw']->common->create_tabs($tabs, $selected));
 
        /**
         * Dump a row header
@@ -81,22 +92,18 @@
         * @param $appname=''
         * @param $icon
         */ 
-       function section_start($appname='',$icon='')
+       function section_start($appname='', $icon='')
        {
-               global $pref_tpl;
-
-               
$pref_tpl->set_var('icon_backcolor',(isset($GLOBALS['phpgw_info']['theme']['row_off'])?$GLOBALS['phpgw_info']['theme']['row_off']:''));
-//             
$pref_tpl->set_var('link_backcolor',$GLOBALS['phpgw_info']['theme']['row_off']);
-               $pref_tpl->set_var('a_name',$appname);
-               
$pref_tpl->set_var('app_name',$GLOBALS['phpgw_info']['apps'][$appname]['title']);
-               $pref_tpl->set_var('app_icon',$icon);
-               if ($icon)
+               $GLOBALS['phpgw']->template->set_var('a_name', $appname);
+               $GLOBALS['phpgw']->template->set_var('app_name', $appname);
+               $GLOBALS['phpgw']->template->set_var('app_icon', $icon);
+               if ( $icon )
                {
-                       $pref_tpl->parse('rows','app_row',True);
+                       $GLOBALS['phpgw']->template->parse('rows', 'app_row', 
true);
                }
                else
                {
-                       $pref_tpl->parse('rows','app_row_noicon',True);
+                       $GLOBALS['phpgw']->template->parse('rows', 
'app_row_noicon', true);
                } 
        }
 
@@ -106,22 +113,20 @@
         * @param string $pref_link
         * @param string $pref_text
         */
-       function section_item($pref_link='',$pref_text='')
+       function section_item($pref_link='', $pref_text='')
        {
-               global $pref_tpl;
+               $GLOBALS['phpgw']->template->set_var('pref_link', $pref_link);
 
-               $pref_tpl->set_var('pref_link',$pref_link);
-
                if (strtolower($pref_text) == 'grant access' && 
isset($GLOBALS['phpgw_info']['server']['deny_user_grants_access']) && 
$GLOBALS['phpgw_info']['server']['deny_user_grants_access'])
                {
                        return False;
                }
                else
                {
-                       $pref_tpl->set_var('pref_text',$pref_text);
+                       $GLOBALS['phpgw']->template->set_var('pref_text', 
$pref_text);
                }
 
-               $pref_tpl->parse('rows','link_row',True);
+               $GLOBALS['phpgw']->template->parse('rows', 'link_row', true);
        } 
 
        /**
@@ -129,9 +134,7 @@
         */
        function section_end()
        {
-               global $pref_tpl;
-
-               $pref_tpl->parse('rows','spacer_row',True);
+               $GLOBALS['phpgw']->template->parse('rows', 'spacer_row', true);
        }
 
        /**
@@ -141,26 +144,22 @@
         * @param $file
         * @param $file2
         */
-       function display_section($appname, $file, $file2 = array() )
+       function display_section($nav, $items)
        {
-               if ( is_array($file2) && count($file2) )
+               section_start($nav['text'], 
$GLOBALS['phpgw']->common->image($nav['image'][0], $nav['image'][1]));
+               foreach ( $items as $item )
                {
-                       $file = $file2;
-               }
-               
-
-               if ( is_array($file) )
-               {
-                       
section_start($appname,$GLOBALS['phpgw']->common->image($appname,Array('navbar',$appname)));
-                       foreach ( $file as $text => $url )
-                       {
-                               section_item($url,lang($text));
+                       section_item($item['url'], $item['text']);
                        }
                        section_end(); 
                }
+
+       $menus = execMethod('phpgwapi.menu.get');
+       foreach ( $menus['preferences'] as $app => $menu )
+       {
+               display_section($menus['navbar'][$app], $menu);
        }
 
-       $GLOBALS['phpgw']->hooks->process('preferences',array('preferences'));
-       $pref_tpl->pfp('out','list');
+       $GLOBALS['phpgw']->template->pfp('out', 'list');
        $GLOBALS['phpgw']->common->phpgw_footer();
 ?>

Modified: trunk/preferences/preferences.php
===================================================================
--- trunk/preferences/preferences.php   2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/preferences/preferences.php   2008-02-02 13:52:39 UTC (rev 18466)
@@ -507,7 +507,7 @@
        $session_data = 
$GLOBALS['phpgw']->session->appsession('session_data','preferences');
 
        $prefix = phpgw::get_var('prefix', 'string', 'GET');
-       if ( !$prefix && (isset($session_data['appname']) && 
$session_data['appname'] == $_GET['appname']) )
+       if ( !$prefix && (isset($session_data['appname']) && 
$session_data['appname'] == phpgw::get_var('appname', 'string', 'GET') ) )
        {
                $prefix = $session_data['prefix'];
        }

Modified: trunk/preferences/setup/phpgw_sv.lang
===================================================================
--- trunk/preferences/setup/phpgw_sv.lang       2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/preferences/setup/phpgw_sv.lang       2008-02-02 13:52:39 UTC (rev 
18466)
@@ -77,3 +77,4 @@
 you must enter a password      preferences     sv      Du m\xE5ste ange ett 
l\xF6senord
 your current theme is: %1      preferences     sv      Ditt nuvarande tema 
\xE4r: %1
 your preferences       preferences     sv      Dina inst\xE4llningar
+

Modified: trunk/preferences/setup/setup.inc.php
===================================================================
--- trunk/preferences/setup/setup.inc.php       2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/preferences/setup/setup.inc.php       2008-02-02 13:52:39 UTC (rev 
18466)
@@ -21,8 +21,8 @@
        $setup_info['preferences']['hooks'][] = 'deleteaccount';
        $setup_info['preferences']['hooks'][] = 'config';
        $setup_info['preferences']['hooks'][] = 'manual';
-       $setup_info['preferences']['hooks'][] = 'preferences';
        $setup_info['preferences']['hooks'][] = 'settings';
+       $setup_info['preferences']['hooks']['menu'] = 
'preferences.menu.get_menu';
 
        // Dependacies for this app to work
        $setup_info['preferences']['depends'][] = array(

Modified: trunk/preferences/templates/base/index.tpl
===================================================================
--- trunk/preferences/templates/base/index.tpl  2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/preferences/templates/base/index.tpl  2008-02-02 13:52:39 UTC (rev 
18466)
@@ -1,36 +1,23 @@
 <!-- BEGIN list -->
-<table border="0" width="75%" cellspacing="0" cellpadding="0">
- <tr>
-  <td align="left">{tabs}</td>
- </tr>
-</table>
-
-<table width="75%" border="0" cellspacing="0" cellpadding="0">
+<div id="preferences-index">
+       {tabs}
  {rows}
-</table>
+</div>
 <!-- END list -->
 
 <!-- BEGIN app_row -->
- <tr bgcolor="{icon_backcolor}">
-  <td width="5%" valign="middle"><a name="{a_name}"></a><img src="{app_icon}" 
alt="[ {app_name} ]"> <a name="{a_name}"></a></td>
-  <td width="95%" valign="middle"><strong>&nbsp;&nbsp;{app_name}</strong></td>
- </tr>
+       <h2><a name="{a_name}"></a><img src="{app_icon}" alt="{app_name}"> 
{app_name}</h2>
 <!-- END app_row -->
 
 <!-- BEGIN app_row_noicon -->
- <tr bgcolor="{icon_backcolor}">
-  <td colspan="2" width="95%" valign="middle"><a 
name="{a_name}"></a><strong>&nbsp;&nbsp;{app_name}</strong> <a 
name="{a_name}"></a></td>
- </tr>
+       <h2><a name="{a_name}"></a> {app_name}</h2>
+       <ul>
 <!-- END app_row_noicon -->
 
 <!-- BEGIN link_row -->
- <tr>
-  <td colspan="2">&nbsp;&#8226;&nbsp;<a href="{pref_link}">{pref_text}</a></td>
- </tr>
+               <li class="{pref_class}"><a 
href="{pref_link}">{pref_text}</a></li>
 <!-- END link_row -->
 
 <!-- BEGIN spacer_row -->
- <tr>
-  <td colspan="2">&nbsp;</td>
- </tr>
+       </ul>
 <!-- END spacer_row -->

Modified: trunk/preferences/templates/base/preferences.tpl
===================================================================
--- trunk/preferences/templates/base/preferences.tpl    2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/preferences/templates/base/preferences.tpl    2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -2,6 +2,7 @@
 
 <!-- BEGIN form -->
 {tabs}
+
 <form method="POST" action="{action_url}">
 
        <!-- BEGIN list -->

Modified: trunk/projects/inc/class.reportOOo.inc.php
===================================================================
--- trunk/projects/inc/class.reportOOo.inc.php  2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/projects/inc/class.reportOOo.inc.php  2008-02-02 13:52:39 UTC (rev 
18466)
@@ -200,7 +200,7 @@
 
                        //$saveFilename = "TB_" . 
$this->accounts->id2name($account_id) . "_" . $sstring . "-" . $estring . 
".sxw";
                        $saveFilename = $filename . ".sxw";
-                               $source = 
stripslashes($GLOBALS['phpgw_info']['server']['temp_dir']).SEP.$saveFilename;
+                               $source = 
stripslashes($GLOBALS['phpgw_info']['server']['temp_dir']). "/$saveFilename";
                        $this->doc->savefile($source);
                        $this->doc->clean();
 

Modified: trunk/projects/inc/class.uistatistics.inc.php
===================================================================
--- trunk/projects/inc/class.uistatistics.inc.php       2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/projects/inc/class.uistatistics.inc.php       2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -884,8 +884,7 @@
                
$GLOBALS['phpgw']->template->set_var('sdate_select',$jscal->input('sdate[str]',$start));
                
$GLOBALS['phpgw']->template->set_var('edate_select',$jscal->input('edate[str]',$end));
 
-               
$GLOBALS['phpgw']->template->set_var('css_file',$GLOBALS['phpgw_info']['server']['webserver_url']
 . SEP . 'phpgwapi' . SEP . 'templates'
-                                         . SEP . 'idots' . SEP . 'css' . SEP . 
'idots.css');
+               $GLOBALS['phpgw']->template->set_var('css_file', 
"{$GLOBALS['phpgw_info']['server']['webserver_url']}/{phpgwapi}/{templates}/idots/css/idots.css");
                
$GLOBALS['phpgw']->template->set_var('gantt_link',$GLOBALS['phpgw']->link('/index.php',array
                                                                                
                                                                                
                                (
                                                                                
                                                                                
                                        
'menuaction'=>'projects.uistatistics.get_screen_size',
@@ -915,7 +914,8 @@
 
                $GLOBALS['phpgw']->template->set_var('lang_close_window', 
lang('close window'));
                
$GLOBALS['phpgw']->template->set_var('lang_show_gantt_in_new_window', 
lang('show gantt chart in new window'));
-               $GLOBALS['phpgw']->template->set_var('pix_src', 
$GLOBALS['phpgw_info']['server']['webserver_url'] . SEP . 'phpgwapi' . SEP . 
'images' . SEP . $gantt_data['img_file']);
+               // FIXME: should use phpgwapi_common::find_image here - skwashd 
jan08
+               $GLOBALS['phpgw']->template->set_var('pix_src', 
"{$GLOBALS['phpgw_info']['server']['webserver_url']}/phpgwapi/images/{$gantt_data['img_file']}");
 
                //_debug_array($gantt_data);
 

Modified: trunk/projects/setup/phpgw_de.lang
===================================================================
--- trunk/projects/setup/phpgw_de.lang  2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/projects/setup/phpgw_de.lang  2008-02-02 13:52:39 UTC (rev 18466)
@@ -325,7 +325,7 @@
 reference      projects        de      Referenz
 Remark can not exceed 8000 characters in length !      projects        de      
Die Betreff der T\xE4tigkeit darf nicht mehr als 8000 Zeichen enthalten.
 remark projects        de      Betreff
-remark can not exceed 8000 characters in length        projects        en      
Betreff darf 8000 Zeichen nicht \xFCberschreiten.
+remark can not exceed 8000 characters in length        projects        de      
Betreff darf 8000 Zeichen nicht \xFCberschreiten.
 remark required        projects        de      Betreff notwendig
 remove projects        de      Entfernen
 result projects        de      Resultat

Modified: trunk/projects/setup/phpgw_en.lang
===================================================================
--- trunk/projects/setup/phpgw_en.lang  2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/projects/setup/phpgw_en.lang  2008-02-02 13:52:39 UTC (rev 18466)
@@ -261,8 +261,8 @@
 setting has not been saved     projects        en      Setting was not saved
 weekly workhours       projects        en      weekly workhours
 cost centre    projects        en      cost centre
-please set the weekly workhours        projects        en      please set the 
weekly workhours projects
-please set the cost centre     projects        en      please set the cost 
centre      projects
+please set the weekly workhours        projects        en      please set the 
weekly workhours
+please set the cost centre     projects        en      please set the cost 
centre
 the choosen timeframe interleaves an already existing timeframe        
projects        en      the choosen timeframe interleaves an already existing 
timeframe
 Summary        projects        en      Summary
 Sum    projects        en      Sum

Modified: trunk/projects/setup/phpgw_sv.lang
===================================================================
--- trunk/projects/setup/phpgw_sv.lang  2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/projects/setup/phpgw_sv.lang  2008-02-02 13:52:39 UTC (rev 18466)
@@ -225,3 +225,4 @@
 you have no customer selected !        projects        sv      Du har inte 
valt n\xE5gon kund !
 you have selected an invalid activity !        projects        sv      Du har 
angett en felaktig aktivitet !
 you have to create a delivery or invoice first !       projects        sv      
Du m\xE5ste SKAPA en leverans eller faktura f\xF6rst !
+

Added: trunk/property/help/NO/location.edit.odt
===================================================================
(Binary files differ)


Property changes on: trunk/property/help/NO/location.edit.odt
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/property/help/NO/location.index.odt
===================================================================
(Binary files differ)


Property changes on: trunk/property/help/NO/location.index.odt
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/property/help/NO/location.view.odt
===================================================================
(Binary files differ)


Property changes on: trunk/property/help/NO/location.view.odt
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/property/help/NO/tts.add.odt
===================================================================
(Binary files differ)


Property changes on: trunk/property/help/NO/tts.add.odt
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/property/help/NO/tts.index.odt
===================================================================
(Binary files differ)


Property changes on: trunk/property/help/NO/tts.index.odt
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/property/help/NO/tts.view.odt
===================================================================
(Binary files differ)


Property changes on: trunk/property/help/NO/tts.view.odt
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: trunk/property/inc/class.boXport.inc.php
===================================================================
--- trunk/property/inc/class.boXport.inc.php    2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.boXport.inc.php    2008-02-02 13:52:39 UTC (rev 
18466)
@@ -52,9 +52,9 @@
                {
 
                        $GLOBALS['phpgw_info']['flags']['currentapp']   =       
'property';
-                       $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
 
-                       $this->config           = 
CreateObject('phpgwapi.config',$this->currentapp);
+                       $this->config           = 
CreateObject('phpgwapi.config','property');
 
                        if($session)
                        {
@@ -98,7 +98,6 @@
                function read_sessiondata()
                {
                        $data = 
$GLOBALS['phpgw']->session->appsession('session_data','export');
-                       if($this->debug) { echo '<br>Read:'; 
_debug_array($data); }
 
                        $this->start  = $data['start'];
                        $this->query  = $data['query'];
@@ -110,11 +109,11 @@
 
                function select_import_conv($selected='')
                {
-                       $dir_handle = @opendir(PHPGW_APP_INC . SEP . 'import');
+                       $dir_handle = @opendir(PHPGW_APP_INC . '/import');
                        $i=0; $myfilearray = '';
                        while ($file = readdir($dir_handle))
                        {
-                               if ((substr($file, 0, 1) != '.') && 
is_file(PHPGW_APP_INC . SEP . 'import' . SEP . $file) )
+                               if ((substr($file, 0, 1) != '.') && 
is_file(PHPGW_APP_INC . '/import/' . $file) )
                                {
                                        $myfilearray[$i] = $file;
                                        $i++;
@@ -125,7 +124,7 @@
 
                        for ($i=0;$i<count($myfilearray);$i++)
                        {
-                               $fname = ereg_replace('_',' ',$myfilearray[$i]);
+                               $fname = preg_replace('/_/',' 
',$myfilearray[$i]);
                                $sel_file = '';
                                if ($myfilearray[$i]==$selected)
                                {
@@ -154,11 +153,11 @@
 
                function select_export_conv($selected='')
                {
-                       $dir_handle = @opendir(PHPGW_APP_INC . SEP . 'export');
+                       $dir_handle = @opendir(PHPGW_APP_INC . '/export');
                        $i=0; $myfilearray = '';
                        while ($file = readdir($dir_handle))
                        {
-                               if ((substr($file, 0, 1) != '.') && 
is_file(PHPGW_APP_INC . SEP . 'export' . SEP . $file) )
+                               if ((substr($file, 0, 1) != '.') && 
is_file(PHPGW_APP_INC . '/export/' . $file) )
                                {
                                        $myfilearray[$i] = $file;
                                        $i++;
@@ -169,7 +168,7 @@
 
                        for ($i=0;$i<count($myfilearray);$i++)
                        {
-                               $fname = ereg_replace('_',' ',$myfilearray[$i]);
+                               $fname = preg_replace('/_/',' 
',$myfilearray[$i]);
                                $sel_file = '';
                                if ($myfilearray[$i]==$selected)
                                {
@@ -205,7 +204,7 @@
                        $i=0; $myfilearray = '';
                        while ($file = readdir($dir_handle))
                        {
-                               if ((substr($file, 0, 1) != '.') && 
is_file($file_catalog . SEP . $file) )
+                               if ((substr($file, 0, 1) != '.') && 
is_file("{$file_catalog}/{$file}") )
                                {
                                        $myfilearray[$i] = $file;
                                        $i++;
@@ -216,7 +215,7 @@
 
                        for ($i=0;$i<count($myfilearray);$i++)
                        {
-                               $fname = ereg_replace('_',' ',$myfilearray[$i]);
+                               $fname = preg_replace('/_/',' 
',$myfilearray[$i]);
                                $sel_file = '';
                                if ($myfilearray[$i]==$selected)
                                {

Modified: trunk/property/inc/class.boactor.inc.php
===================================================================
--- trunk/property/inc/class.boactor.inc.php    2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.boactor.inc.php    2008-02-02 13:52:39 UTC (rev 
18466)
@@ -54,9 +54,10 @@
 
                function property_boactor($session=False)
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->so               = 
CreateObject('property.soactor');
                        $this->bocommon         = 
CreateObject('property.bocommon');
+                       $this->custom           = 
createObject('phpgwapi.custom_fields');
 
                        if ($session)
                        {
@@ -74,7 +75,6 @@
                        $role           = phpgw::get_var('role');
                        $member_id      = phpgw::get_var('member_id', 'int');
 
-
                        $this->role     = $role;
                        $this->so->role = $role;
 
@@ -170,163 +170,20 @@
 
                function read_single($data)
                {
-                       $contacts                       = 
CreateObject('phpgwapi.contacts');
-
-                       $vendor = CreateObject('property.soactor');
-                       $vendor->role = 'vendor';
-
-
-                       $actor  = $this->so->read_single($data);
-                       $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
-
-                       $input_type_array = array(
-                               'R' => 'radio',
-                               'CH' => 'checkbox',
-                               'LB' => 'listbox'
-                       );
-
-                       $sep = '/';
-                       $dlarr[strpos($dateformat,'Y')] = 'Y';
-                       $dlarr[strpos($dateformat,'m')] = 'm';
-                       $dlarr[strpos($dateformat,'d')] = 'd';
-                       ksort($dlarr);
-
-                       $dateformat= (implode($sep,$dlarr));
-
-                       $m=0;
-                       for ($i=0;$i<count($actor['attributes']);$i++)
-                       {
-                               if($actor['attributes'][$i]['datatype']=='D' && 
$actor['attributes'][$i]['value'])
+                       $values['attributes'] = 
$this->custom->get_attribs('property','.' . $this->role, 0, '', 'ASC', 
'attrib_sort', true, true);
+                       if(isset($data['actor_id']) && $data['actor_id'])
                                {
-                                       $timestamp_date= 
mktime(0,0,0,date(m,strtotime($actor['attributes'][$i]['value'])),date(d,strtotime($actor['attributes'][$i]['value'])),date(y,strtotime($actor['attributes'][$i]['value'])));
-                                       $actor['attributes'][$i]['value']       
= $GLOBALS['phpgw']->common->show_date($timestamp_date,$dateformat);
+                               $values = 
$this->so->read_single($data['actor_id'], $values);
                                }
-                               if($actor['attributes'][$i]['datatype']=='AB')
-                               {
-                                       if($actor['attributes'][$i]['value'])
-                                       {
-                                               $contact_data   = 
$contacts->read_single_entry($actor['attributes'][$i]['value'],array('n_given'=>'n_given','n_family'=>'n_family','email'=>'email'));
-                                               
$actor['attributes'][$i]['contact_name']        = $contact_data[0]['n_family'] 
. ', ' . $contact_data[0]['n_given'];
-                                       }
-
-                                       $insert_record_actor[]  = 
$actor['attributes'][$i]['name'];
-                                       $lookup_link            = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilookup.addressbook', 'column'=> 
$actor['attributes'][$i]['name']));
-
-                                       $lookup_functions[$m]['name'] = 
'lookup_'. $actor['attributes'][$i]['name'] .'()';
-                                       $lookup_functions[$m]['action'] = 
'Window1=window.open('."'" . $lookup_link ."'" 
.',"Search","width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");';
-                                       $m++;
-                               }
-                               
if($actor['attributes'][$i]['datatype']=='VENDOR')
-                               {
-                                       if($actor['attributes'][$i]['value'])
-                                       {
-                                               $vendor_data    = 
$vendor->read_single(array('actor_id'=>$actor['attributes'][$i]['value']));
-
-                                               for 
($n=0;$n<count($vendor_data['attributes']);$n++)
-                                               {
-                                                       
if($vendor_data['attributes'][$n]['name'] == 'org_name')
-                                                       {
-                                                               
$actor['attributes'][$i]['vendor_name']= 
$vendor_data['attributes'][$n]['value'];
-                                                               $n 
=count($vendor_data['attributes']);
-                                                       }
-                                               }
-                                       }
-
-                                       $insert_record_actor[]  = 
$actor['attributes'][$i]['name'];
-                                       $lookup_link            = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilookup.vendor', 'column'=> 
$actor['attributes'][$i]['name']));
-
-                                       $lookup_functions[$m]['name'] = 
'lookup_'. $actor['attributes'][$i]['name'] .'()';
-                                       $lookup_functions[$m]['action'] = 
'Window1=window.open('."'" . $lookup_link ."'" 
.',"Search","width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");';
-                                       $m++;
-                               }
-
-                               if($actor['attributes'][$i]['datatype']=='user')
-                               {
-                                       if($actor['attributes'][$i]['value'])
-                                       {
-                                               
$actor['attributes'][$i]['user_name']= 
$GLOBALS['phpgw']->accounts->id2name($actor['attributes'][$i]['value']);
-                                       }
-
-                                       $insert_record_actor[]  = 
$actor['attributes'][$i]['name'];
-                                       $lookup_link            = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilookup.phpgw_user', 'column'=> 
$actor['attributes'][$i]['name']));
-
-                                       $lookup_functions[$m]['name'] = 
'lookup_'. $actor['attributes'][$i]['name'] .'()';
-                                       $lookup_functions[$m]['action'] = 
'Window1=window.open('."'" . $lookup_link ."'" 
.',"Search","width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");';
-                                       $m++;
-                               }
-
-                               if($actor['attributes'][$i]['datatype']=='R' || 
$actor['attributes'][$i]['datatype']=='CH' || 
$actor['attributes'][$i]['datatype']=='LB')
-                               {
-                                       $actor['attributes'][$i]['choice']      
= $this->so->read_attrib_choice($actor['attributes'][$i]['attrib_id']);
-                                       
$input_type=$input_type_array[$actor['attributes'][$i]['datatype']];
-
-                                       
if($actor['attributes'][$i]['datatype']=='CH')
-                                       {
-                                               
$actor['attributes'][$i]['value']=unserialize($actor['attributes'][$i]['value']);
-                                               
$actor['attributes'][$i]['choice'] = 
$this->bocommon->select_multi_list_2($actor['attributes'][$i]['value'],$actor['attributes'][$i]['choice'],$input_type);
-
-                                       }
-                                       else
-                                       {
-                                               for 
($j=0;$j<count($actor['attributes'][$i]['choice']);$j++)
-                                               {
-                                                       
$actor['attributes'][$i]['choice'][$j]['input_type']=$input_type;
-                                                       
if($actor['attributes'][$i]['choice'][$j]['id']==$actor['attributes'][$i]['value'])
-                                                       {
-                                                               
$actor['attributes'][$i]['choice'][$j]['checked']='checked';
-                                                       }
-                                               }
-                                       }
-                               }
-
-                               $actor['attributes'][$i]['datatype_text'] = 
$this->bocommon->translate_datatype($actor['attributes'][$i]['datatype']);
-                               $actor['attributes'][$i]['counter']     = $i;
-//                             $actor['attributes'][$i]['type_id']     = 
$data['type_id'];
-                       }
-
-                       if(isset($lookup_functions) && 
is_array($lookup_functions))
-                       {
-                               $actor['lookup_functions'] = '';
-                               for ($j=0;$j<count($lookup_functions);$j++)
-                               {
-                                       $actor['lookup_functions'] .= 'function 
' . $lookup_functions[$j]['name'] ."\r\n";
-                                       $actor['lookup_functions'] .= 
'{'."\r\n";
-                                       $actor['lookup_functions'] .= 
$lookup_functions[$j]['action'] ."\r\n";
-                                       $actor['lookup_functions'] .= 
'}'."\r\n";
-                               }
-                       }
-
-                       
$GLOBALS['phpgw']->session->appsession('insert_record_actor',$this->currentapp,isset($insert_record_actor)?$insert_record_actor:'');
-
-//_debug_array($actor);
-                       return $actor;
+                       $values = $this->custom->prepare_attributes($values, 
'property','.' . $this->role, $data['view']);
+                       return $values;
                }
 
                function save($actor,$values_attribute='')
                {
                        if(is_array($values_attribute))
                        {
-                               for ($i=0;$i<count($values_attribute);$i++)
-                               {
-                                       
if($values_attribute[$i]['datatype']=='CH' && $values_attribute[$i]['value'])
-                                       {
-                                               $values_attribute[$i]['value'] 
= serialize($values_attribute[$i]['value']);
-                                       }
-                                       
if($values_attribute[$i]['datatype']=='R' && $values_attribute[$i]['value'])
-                                       {
-                                               $values_attribute[$i]['value'] 
= $values_attribute[$i]['value'][0];
-                                       }
-
-                                       
if($values_attribute[$i]['datatype']=='N' && $values_attribute[$i]['value'])
-                                       {
-                                               $values_attribute[$i]['value'] 
= str_replace(",",".",$values_attribute[$i]['value']);
-                                       }
-       
-                                       
if($values_attribute[$i]['datatype']=='D' && $values_attribute[$i]['value'])
-                                       {
-                                               $values_attribute[$i]['value'] 
= 
date($this->bocommon->dateformat,$this->bocommon->date_to_timestamp($values_attribute[$i]['value']));
-                                       }
-                               }
+                               $values_attribute = 
$this->custom->convert_attribute_save($values_attribute);
                        }
 
                        if ($actor['actor_id'])
@@ -344,69 +201,33 @@
                        return $receipt;
                }
 
-               function delete($actor_id='',$id='',$attrib='')
-               {
-                       if ($attrib)
+               function delete($actor_id)
                        {
-                               $this->so->delete_attrib($id);
-                       }
-                       else
-                       {
                                $this->so->delete($actor_id);
                        }
-               }
 
-               function read_attrib($type_id='')
-               {
-                       $attrib = $this->so->read_attrib(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
-                                                                               
        'allrows'=>$this->allrows));
-
-                       for ($i=0; $i<count($attrib); $i++)
-                       {
-                               $attrib[$i]['datatype'] = 
$this->bocommon->translate_datatype($attrib[$i]['datatype']);
-                       }
-
-                       $this->total_records = $this->so->total_records;
-
-                       return $attrib;
-               }
-
-               function read_single_attrib($id)
-               {
-                       return $this->so->read_single_attrib($id);
-               }
-
-               function resort_attrib($data)
-               {
-                       $this->so->resort_attrib($data);
-               }
-
-               function save_attrib($attrib)
-               {
-                       if ($attrib['id'] != '')
-                       {
-                               $receipt = $this->so->edit_attrib($attrib);
-                       }
-                       else
-                       {
-                               $receipt = $this->so->add_attrib($attrib);
-                       }
-
-                       return $receipt;
-               }
-
                function column_list($selected='',$allrows='')
                {
                        if(!$selected)
                        {
-                               
$selected=$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]["actor_columns_"
 . $this->role];
+                               
$selected=$GLOBALS['phpgw_info']['user']['preferences']['property']["actor_columns_"
 . $this->role];
                        }
-
-                       $columns = 
$this->so->read_attrib(array('allrows'=>$allrows,'column_list'=>True));
-
+                       $columns = $this->custom->get_attribs('property','.' . 
$this->role, 0, '','','',true);
                        
$column_list=$this->bocommon->select_multi_list($selected,$columns);
 
                        return $column_list;
                }
+
+               /**
+               * Preserve attribute values from post in case of an error
+               *
+               * @param array $values_attribute attribute definition and 
values from posting
+               * @param array $values value set with 
+               * @return array Array with attribute definition and values
+               */
+               function preserve_attribute_values($values,$values_attribute)
+               {
+                       return 
$this->custom->preserve_attribute_values($values,$values_attribute);
+               }
        }
 ?>

Modified: trunk/property/inc/class.boadmin.inc.php
===================================================================
--- trunk/property/inc/class.boadmin.inc.php    2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.boadmin.inc.php    2008-02-02 13:52:39 UTC (rev 
18466)
@@ -45,7 +45,7 @@
 
                function property_boadmin($session='')
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->so                       = 
CreateObject('property.soadmin');
                        $this->acl                      = 
CreateObject('phpgwapi.acl');
                        $this->bocommon         = 
CreateObject('property.bocommon');
@@ -68,7 +68,7 @@
                        $module = phpgw::get_var('module');
                        $granting_group = phpgw::get_var('granting_group', 
'int');
                        $allrows        = phpgw::get_var('allrows', 'bool');
-                       $acl_app        = $this->currentapp; 
//get_var('acl_app',array('POST','GET'));
+                       $acl_app        = 'property'; 
//get_var('acl_app',array('POST','GET'));
 
                        if ($start)
                        {

Modified: trunk/property/inc/class.boadmin_entity.inc.php
===================================================================
--- trunk/property/inc/class.boadmin_entity.inc.php     2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/inc/class.boadmin_entity.inc.php     2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -72,9 +72,9 @@
 
                function property_boadmin_entity($session=False)
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->so               = 
CreateObject('property.soadmin_entity');
                        $this->bocommon = CreateObject('property.bocommon');
+                       $this->custom   = 
createObject('phpgwapi.custom_fields');
 
                        if ($session)
                        {
@@ -220,31 +220,6 @@
                        return $category;
                }
 
-               function read_status()
-               {
-                       $status = $this->so->read_status(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,
-                               'order' => 
$this->order,'allrows'=>$this->allrows,'entity_id'=>$this->entity_id,'cat_id'=>$this->cat_id));
-
-                       $this->total_records = $this->so->total_records;
-
-                       return $status;
-               }
-
-               function read_config()
-               {
-                       $standard = $this->so->read_config(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order));
-
-                       $this->total_records = $this->so->total_records;
-
-
-                       return $standard;
-               }
-
-               function read_config_single($column_name)
-               {
-                       return $this->so->read_config_single($column_name);
-               }
-
                function read_single($id)
                {
                        return $this->so->read_single($id);
@@ -255,11 +230,6 @@
                        return 
$this->so->read_single_category($entity_id,$cat_id);
                }
 
-               function read_single_status($id)
-               {
-                       return 
$this->so->read_single_status($this->entity_id,$this->cat_id,$id);
-               }
-
                function save($values,$action='')
                {
                        if ($action=='edit')
@@ -292,47 +262,25 @@
                        return $receipt;
                }
 
-               function save_status($values,$action='')
+               function 
delete($cat_id='',$entity_id='',$attrib_id='',$acl_location='',$custom_function_id='')
                {
-                       if ($action=='edit')
+                       if(!$attrib_id && !$cat_id && $entity_id && 
!$custom_function_id)
                        {
-                               if ($values['id'] != '')
-                               {
-                                       $receipt = 
$this->so->edit_status($values,$this->entity_id,$this->cat_id);
-                               }
-                       }
-                       else
-                       {
-                               $receipt = 
$this->so->add_status($values,$this->entity_id,$this->cat_id);
-                       }
-                       return $receipt;
-               }
-
-               function 
delete($cat_id='',$entity_id='',$attrib_id='',$status_id='',$acl_location='',$custom_function_id='')
-               {
-                       if(!$status_id && !$attrib_id && !$cat_id && $entity_id 
&& !$custom_function_id):
-                       {
                                $this->so->delete_entity($entity_id);
                        }
-                       elseif(!$status_id && !$attrib_id && $cat_id && 
$entity_id && !$custom_function_id):
+                       else if(!$attrib_id && $cat_id && $entity_id && 
!$custom_function_id)
                        {
-                               $this->so->delete_category($cat_id,$entity_id);
+                               $this->so->delete_category($entity_id, $cat_id);
                        }
-                       elseif(!$status_id && $attrib_id && $cat_id && 
$entity_id && !$custom_function_id):
+                       else if($attrib_id && $cat_id && $entity_id && 
!$custom_function_id)
                        {
-                               
$this->so->delete_attrib($cat_id,$entity_id,$attrib_id);
+                               $this->custom->_delete_attrib('.entity.' . 
$entity_id . '.' . $cat_id,'property',$attrib_id);
+                               $this->so->delete_history($entity_id, 
$cat_id,$attrib_id);
                        }
-                       elseif($status_id && !$attrib_id && $cat_id && 
$entity_id && !$custom_function_id):
+                       else if($custom_function_id && $acl_location)
                        {
-                               
$this->so->delete_status($cat_id,$entity_id,$status_id);
+                               
$this->custom->_delete_custom_function('property', 
$acl_location,$custom_function_id);
                        }
-                       elseif(!$status_id && $custom_function_id && 
$acl_location):
-                       {
-                               
$this->so->delete_custom_function($acl_location,$custom_function_id);
-                       }
-                       endif;
-
-
                }
 
                function read_attrib($entity_id='',$cat_id='',$allrows='')
@@ -342,51 +290,43 @@
                                $this->allrows = $allrows;
                        }
 
-                       $attrib = $this->so->read_attrib(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
-                                                                               
        'cat_id' => $cat_id,'entity_id' => 
$entity_id,'allrows'=>$this->allrows));
+                       $attrib = $this->custom->get_attribs('property', 
'.entity.' . $entity_id . '.' . $cat_id, $this->start, $this->query, 
$this->sort, $this->order, $this->allrows);
 
-                       for ($i=0; $i<count($attrib); $i++)
-                       {
-                               $attrib[$i]['datatype'] = 
$this->bocommon->translate_datatype($attrib[$i]['datatype']);
-                       }
+                       $this->total_records = $this->custom->total_records;
 
-                       $this->total_records = $this->so->total_records;
-
                        return $attrib;
                }
 
                function read_single_attrib($entity_id,$cat_id,$id)
                {
-                       return 
$this->so->read_single_attrib($entity_id,$cat_id,$id);
+                       return $this->custom->get_attrib_single('property', 
'.entity.' . $entity_id . '.' . $cat_id, $id, true);
                }
 
                function resort_attrib($id,$resort)
                {
-                       
$this->so->resort_attrib(array('resort'=>$resort,'entity_id' => 
$this->entity_id,'cat_id' => $this->cat_id,'id'=>$id));
+                       $this->custom->resort_attrib($id, $resort, 'property', 
'.entity.' . $this->entity_id . '.' . $this->cat_id);
                }
 
                function save_attrib($attrib,$action='')
                {
+                       $attrib['appname'] = 'property';
+                       $attrib['location'] = '.entity.' . $attrib['entity_id'] 
. '.' . $attrib['cat_id'];
+
                        if ($action=='edit')
                        {
                                if ($attrib['id'] != '')
                                {
 
-                                       $receipt = 
$this->so->edit_attrib($attrib);
+                                       $receipt = 
$this->custom->edit_attrib($attrib);
                                }
                        }
                        else
                        {
-                               $receipt = $this->so->add_attrib($attrib);
+                               $receipt = $this->custom->add_attrib($attrib);
                        }
                        return $receipt;
                }
 
-               function save_config($values='',$column_name='')
-               {
-                               return 
$this->so->save_config($values,$column_name);
-               }
-
                function 
read_custom_function($entity_id='',$cat_id='',$allrows='', $acl_location='')
                {
                        if($allrows)
@@ -399,86 +339,55 @@
                                $acl_location = '.entity.' . $entity_id . '.' . 
$cat_id;
                        }
 
-                       $custom_function = 
$this->so->read_custom_function(array('start' => $this->start,'query' => 
$this->query,'sort' => $this->sort,'order' => $this->order,
-                                                                               
        'acl_location' => $acl_location,'allrows'=>$this->allrows));
+                       $custom_function 
=$this->custom->read_custom_function(array('start' => $this->start,'query' => 
$this->query,'sort' => $this->sort,'order' => $this->order,
+                                                                               
        'appname'=>'property','location' => 
$acl_location,'allrows'=>$this->allrows));
 
-                       $this->total_records = $this->so->total_records;
+                       $this->total_records = $this->custom->total_records;
 
                        return $custom_function;
                }
 
                function resort_custom_function($id,$resort)
                {
-                       
$this->so->resort_custom_function(array('resort'=>$resort,'entity_id' => 
$this->entity_id,'cat_id' => $this->cat_id,'id'=>$id));
+                       $location = '.entity.' . $this->entity_id . '.' . 
$this->cat_id;
+                       return $this->custom->resort_custom_function($id, 
$resort, 'property', $location);
                }
 
                function save_custom_function($custom_function,$action='')
                {
+                       $custom_function['appname']='property';
+                       if(!$custom_function['location'] && 
$custom_function['entity_id'] && $custom_function['cat_id'])
+                       {
+                               $custom_function['location'] = '.entity.' . 
$custom_function['entity_id'] . '.' . $custom_function['cat_id'];
+                       }
+
                        if ($action=='edit')
                        {
                                if ($custom_function['id'] != '')
                                {
 
-                                       $receipt = 
$this->so->edit_custom_function($custom_function);
+                                       $receipt = 
$this->custom->edit_custom_function($custom_function);
                                }
                        }
                        else
                        {
-                               $receipt = 
$this->so->add_custom_function($custom_function);
+                               $receipt = 
$this->custom->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++;
-                               }
+                       return $this->custom->select_custom_function($selected, 
'property');
                        }
-                       closedir($dir_handle);
-                       sort($myfilearray);
 
-                       for ($i=0;$i<count($myfilearray);$i++)
+               function 
read_single_custom_function($entity_id='',$cat_id='',$id,$location='')
                        {
-                               $fname = ereg_replace('_',' ',$myfilearray[$i]);
-                               $sel_file = '';
-                               if ($myfilearray[$i]==$selected)
+                       if (!$location && $entity_id && $cat_id)
                                {
-                                       $sel_file = 'selected';
-                               }
-
-                               $file_list[] = array
-                               (
-                                       'id'            => $myfilearray[$i],
-                                       'name'          => $fname,
-                                       'selected'      => $sel_file
-                               );
+                               $location = '.entity.' . $entity_id . '.' . 
$cat_id;
                        }
-
-                       for ($i=0;$i<count($file_list);$i++)
-                       {
-                               if ($file_list[$i]['selected'] != 'selected')
-                               {
-                                       unset($conv_list[$i]['selected']);
-                               }
-                       }
-
-                       return $file_list;
+                       return 
$this->custom->read_single_custom_function('property',$location,$id);
                }
-               function 
read_single_custom_function($entity_id='',$cat_id='',$id,$acl_location='')
-               {
-                       if (!$acl_location && $entity_id && $cat_id)
-                       {
-                               $acl_location = '.entity.' . $entity_id . '.' . 
$cat_id;
-                       }
-                       return 
$this->so->read_single_custom_function($acl_location,$id);
-               }
        }
 ?>

Modified: trunk/property/inc/class.boadmin_location.inc.php
===================================================================
--- trunk/property/inc/class.boadmin_location.inc.php   2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/inc/class.boadmin_location.inc.php   2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -69,13 +69,13 @@
 
                function property_boadmin_location($session=False)
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->so               = 
CreateObject('property.soadmin_location');
                        $this->bocommon = CreateObject('property.bocommon');
+                       $this->custom   = 
createObject('phpgwapi.custom_fields');
 
                        if ($session)
                        {
-                               $this->read_sessiondata();
+               //              $this->read_sessiondata();
                                $this->use_session = True;
                        }
 
@@ -175,49 +175,72 @@
                        return $receipt;
                }
 
-               function delete($type_id,$id,$attrib)
+               function delete($type_id,$id,$attrib='')
                {
-                       $this->so->delete($type_id,$id,$attrib);
+                       if($id && !$attrib)
+                       {
+                               $this->so->delete($id);
                }
-
-               function read_attrib($type_id='')
+                       else if($type_id && $id && $attrib)
                {
-                       $attrib = $this->so->read_attrib(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
-                                                                               
        'type_id' => $type_id,'allrows'=>$this->allrows));
+                               $this->custom->_delete_attrib('.location.' . 
$type_id,'property',$id, 'fm_location' . $type_id);
+                               $this->custom->_delete_attrib('.location.' . 
$type_id,'property',$id, 'fm_location' . $type_id . '_history');
+                       }
+               }
 
-                       for ($i=0; $i<count($attrib); $i++)
+               function read_attrib($type_id)
                        {
-                               $attrib[$i]['datatype'] = 
$this->bocommon->translate_datatype($attrib[$i]['datatype']);
+                       if($allrows)
+                       {
+                               $this->allrows = $allrows;
                        }
 
-                       $this->total_records = $this->so->total_records;
+                       $attrib = $this->custom->get_attribs('property', 
'.location.' . $type_id, $this->start, $this->query, $this->sort, $this->order, 
$this->allrows);
 
+                       $this->total_records = $this->custom->total_records;
+
                        return $attrib;
                }
 
                function read_single_attrib($type_id,$id)
                {
-                       return $this->so->read_single_attrib($type_id,$id);
+                       return $this->custom->get_attrib_single('property', 
'.location.' . $type_id, $id, true);
                }
 
-               function resort_attrib($data)
+               function resort_attrib($data = array())
                {
-                       $this->so->resort_attrib($data);
+                       $resort = isset($data['resort'])?$data['resort']:'up';
+                       $type_id = isset($data['type_id'])?$data['type_id']:'';
+                       $id = (isset($data['id'])?$data['id']:'');
+
+                       if(!$type_id || !$id)
+               {
+                               return;
+                       }
+
+                       $this->custom->resort_attrib($id, $resort, 'property', 
'.location.' . $type_id);
                }
 
                function save_attrib($attrib,$action='')
                {
+                       $attrib['appname'] = 'property';
+                       $attrib['location'] = '.location.' . $attrib['type_id'];
+                       $primary_table = 'fm_location' . $attrib['type_id'];
+                       $history_table = 'fm_location' . $attrib['type_id'] . 
'_history';
+
                        if ($action=='edit')
                        {
                                if ($attrib['id'] != '')
                                {
 
-                                       $receipt = 
$this->so->edit_attrib($attrib);
+                                       $receipt = 
$this->custom->edit_attrib($attrib, $primary_table);
+                                       $this->custom->edit_attrib($attrib, 
$history_table);
                                }
                        }
                        else
                        {
-                               $receipt = $this->so->add_attrib($attrib);
+                               $receipt = $this->custom->add_attrib($attrib, 
$primary_table);
+                               $this->custom->add_attrib($attrib, 
$history_table);
                        }
                        return $receipt;
                }

Modified: trunk/property/inc/class.boagreement.inc.php
===================================================================
--- trunk/property/inc/class.boagreement.inc.php        2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/inc/class.boagreement.inc.php        2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -54,9 +54,9 @@
 
                function property_boagreement($session=False)
                {
-                       $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->so = CreateObject('property.soagreement');
                        $this->bocommon = CreateObject('property.bocommon');
+                       $this->custom           = 
createObject('phpgwapi.custom_fields');
                        $this->vfs                      = 
CreateObject('phpgwapi.vfs');
                        $this->rootdir          = $this->vfs->basedir;
                        $this->fakebase         = $this->vfs->fakebase;
@@ -238,199 +238,65 @@
 
                function read_single($data)
                {
-                       $agreement      = $this->so->read_single($data);
-                       $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
-                       $agreement['start_date']                = 
$GLOBALS['phpgw']->common->show_date($agreement['start_date'],$dateformat);
-                       $agreement['end_date']          = 
$GLOBALS['phpgw']->common->show_date($agreement['end_date'],$dateformat);
-                       if($agreement['termination_date'])
-                       {
-                               $agreement['termination_date']= 
$GLOBALS['phpgw']->common->show_date($agreement['termination_date'],$dateformat);
-                       }
+                       $values['attributes'] = 
$this->custom->get_attribs('property', '.agreement', 0, '', 'ASC', 
'attrib_sort', true, true);
 
-                       $agreement = $this->convert_attribute($agreement);
-
-                       $this->vfs->override_acl = 1;
-
-                       $agreement['files'] = $this->vfs->ls (array(
-                            'string' => $this->fakebase. '/' . 'agreement' .  
'/' . $data['agreement_id'],
-                            'relatives' => array(RELATIVE_NONE)));
-
-                       $this->vfs->override_acl = 0;
-
-                       if(!isset($agreement['files'][0]['file_id']) || 
!$agreement['files'][0]['file_id'])
+                       if(isset($data['agreement_id']) && 
$data['agreement_id'])
                        {
-                               unset($agreement['files']);
+                               $values = 
$this->so->read_single($data['agreement_id'], $values);
                        }
 
-                       return $agreement;
+                       $values = $this->custom->prepare_attributes($values, 
'property', '.agreement');
 
-               }
-
-               function read_single_item($data)
-               {
-                       $item   = $this->so->read_single_item($data);
-//_debug_array($item);
-                       $item   = $this->convert_attribute($item,True);
-                       return $item;
-               }
-
-               function convert_attribute($list,$detail='')
-               {
-                       if($detail)
-                       {
-                               $this->so->role = 'detail';
-                       }
-                       $contacts                       = 
CreateObject('phpgwapi.contacts');
-
-                       $vendor = CreateObject('property.soactor');
-                       $vendor->role = 'vendor';
-
                        $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
-
-                       $input_type_array = array(
-                               'R' => 'radio',
-                               'CH' => 'checkbox',
-                               'LB' => 'listbox'
-                       );
-
-                       $sep = '/';
-                       $dlarr[strpos($dateformat,'Y')] = 'Y';
-                       $dlarr[strpos($dateformat,'m')] = 'm';
-                       $dlarr[strpos($dateformat,'d')] = 'd';
-                       ksort($dlarr);
-
-                       $dateformat= (implode($sep,$dlarr));
-
-//html_print_r($list);
-                       $m=0;
-                       for ($i=0;$i<count($list['attributes']);$i++)
-                       {
-                               if($list['attributes'][$i]['datatype']=='D' && 
$list['attributes'][$i]['value'])
+                       if(isset($values['entry_date']) && 
$values['entry_date'])
                                {
-                                       $timestamp_date= 
mktime(0,0,0,date(m,strtotime($list['attributes'][$i]['value'])),date(d,strtotime($list['attributes'][$i]['value'])),date(y,strtotime($list['attributes'][$i]['value'])));
-                                       $list['attributes'][$i]['value']        
= $GLOBALS['phpgw']->common->show_date($timestamp_date,$dateformat);
+                               $values['entry_date']   = 
$GLOBALS['phpgw']->common->show_date($values['entry_date'],$dateformat);
                                }
-                               if($list['attributes'][$i]['datatype']=='AB')
-                               {
-                                       if($list['attributes'][$i]['value'])
-                                       {
-                                               $contact_data   = 
$contacts->read_single_entry($list['attributes'][$i]['value'],array('n_given'=>'n_given','n_family'=>'n_family','email'=>'email'));
-                                               
$list['attributes'][$i]['contact_name'] = $contact_data[0]['n_family'] . ', ' . 
$contact_data[0]['n_given'];
-                                       }
 
-                                       $insert_record_list[]   = 
$list['attributes'][$i]['name'];
-                                       $lookup_link            = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uilookup.addressbook&column='
 . $list['attributes'][$i]['name']);
-
-                                       $lookup_functions[$m]['name'] = 
'lookup_'. $list['attributes'][$i]['name'] .'()';
-                                       $lookup_functions[$m]['action'] = 
'Window1=window.open('."'" . $lookup_link ."'" 
.',"Search","width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");';
-                                       $m++;
-                               }
-                               
if($list['attributes'][$i]['datatype']=='VENDOR')
-                               {
-                                       if($list['attributes'][$i]['value'])
-                                       {
-                                               $vendor_data    = 
$vendor->read_single(array('actor_id'=>$list['attributes'][$i]['value']));
-
-                                               for 
($n=0;$n<count($vendor_data['attributes']);$n++)
-                                               {
-                                                       
if($vendor_data['attributes'][$n]['name'] == 'org_name')
+                       $values['start_date']           = 
$GLOBALS['phpgw']->common->show_date($values['start_date'],$dateformat);
+                       $values['end_date']             = 
$GLOBALS['phpgw']->common->show_date($values['end_date'],$dateformat);
+                       if(isset($values['termination_date']) && 
$values['termination_date'])
                                                        {
-                                                               
$list['attributes'][$i]['vendor_name']= $vendor_data['attributes'][$n]['value'];
-                                                               $n 
=count($vendor_data['attributes']);
-                                                       }
-                                               }
-                                       }
-
-                                       $insert_record_list[]   = 
$list['attributes'][$i]['name'];
-                                       $lookup_link            = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uilookup.vendor&column='
 . $list['attributes'][$i]['name']);
-
-                                       $lookup_functions[$m]['name'] = 
'lookup_'. $list['attributes'][$i]['name'] .'()';
-                                       $lookup_functions[$m]['action'] = 
'Window1=window.open('."'" . $lookup_link ."'" 
.',"Search","width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");';
-                                       $m++;
+                               $values['termination_date']= 
$GLOBALS['phpgw']->common->show_date($values['termination_date'],$dateformat);
                                }
 
-                               if($list['attributes'][$i]['datatype']=='R' || 
$list['attributes'][$i]['datatype']=='CH' || 
$list['attributes'][$i]['datatype']=='LB')
-                               {
-                                       $list['attributes'][$i]['choice']       
= $this->so->read_attrib_choice($list['attributes'][$i]['attrib_id']);
-                                       
$input_type=$input_type_array[$list['attributes'][$i]['datatype']];
+                       $this->vfs->override_acl = 1;
 
-                                       
if($list['attributes'][$i]['datatype']=='CH')
-                                       {
-                                               
$list['attributes'][$i]['value']=unserialize($list['attributes'][$i]['value']);
-                                               
$list['attributes'][$i]['choice'] = 
$this->bocommon->select_multi_list_2($list['attributes'][$i]['value'],$list['attributes'][$i]['choice'],$input_type);
+                       $values['files'] = $this->vfs->ls (array(
+                            'string' => $this->fakebase. '/' . 'agreement' .  
'/' . $data['agreement_id'],
+                            'relatives' => array(RELATIVE_NONE)));
 
-                                       }
-                                       else
-                                       {
-                                               for 
($j=0;$j<count($list['attributes'][$i]['choice']);$j++)
-                                               {
-                                                       
$list['attributes'][$i]['choice'][$j]['input_type']=$input_type;
-                                                       
if($list['attributes'][$i]['choice'][$j]['id']==$list['attributes'][$i]['value'])
-                                                       {
-                                                               
$list['attributes'][$i]['choice'][$j]['checked']='checked';
-                                                       }
-                                               }
-                                       }
-                               }
+                       $this->vfs->override_acl = 0;
 
-                               $list['attributes'][$i]['datatype_text'] = 
$this->bocommon->translate_datatype($list['attributes'][$i]['datatype']);
-                               $list['attributes'][$i]['counter']      = $i;
-                               $list['attributes'][$i]['type_id']      = 
$data['type_id'];
-                       }
-
-                       if(isset($lookup_functions) && 
is_array($lookup_functions))
-                       {
-                               for ($j=0;$j<count($lookup_functions);$j++)
+                       if(!isset($values['files'][0]['file_id']) || 
!$values['files'][0]['file_id'])
                                {
-                                       $list['lookup_functions'] .= 'function 
' . $lookup_functions[$j]['name'] ."\r\n";
-                                       $list['lookup_functions'] .= '{'."\r\n";
-                                       $list['lookup_functions'] .= 
$lookup_functions[$j]['action'] ."\r\n";
-                                       $list['lookup_functions'] .= '}'."\r\n";
-                               }
-                       }
-
-                       
$GLOBALS['phpgw']->session->appsession('insert_record_agreement' . 
!!$detail,$this->currentapp,isset($insert_record_list)?$insert_record_list:'');
-
-//html_print_r($list);
-                       return $list;
+                               unset($values['files']);
                }
 
-               function convert_attribute_save($values_attribute='')
-               {
-
-                       for ($i=0;$i<count($values_attribute);$i++)
-                       {
-                               if($values_attribute[$i]['datatype']=='CH' && 
$values_attribute[$i]['value'])
-                               {
-                                       $values_attribute[$i]['value'] = 
serialize($values_attribute[$i]['value']);
+                       return $values;
                                }
-                               if($values_attribute[$i]['datatype']=='R' && 
$values_attribute[$i]['value'])
-                               {
-                                       $values_attribute[$i]['value'] = 
$values_attribute[$i]['value'][0];
-                               }
 
-                               if($values_attribute[$i]['datatype']=='N' && 
$values_attribute[$i]['value'])
+               function read_single_item($data)
                                {
-                                       $values_attribute[$i]['value'] = 
str_replace(",",".",$values_attribute[$i]['value']);
-                               }
-
-                               if($values_attribute[$i]['datatype']=='D' && 
$values_attribute[$i]['value'])
+                       $values['attributes'] = 
$this->custom->get_attribs('property', '.agreement.detail', 0, '', 'ASC', 
'attrib_sort', true, true);
+                       if(isset($data['agreement_id']) && 
$data['agreement_id'] && isset($data['id']) && $data['id'])
                                {
-                                       $values_attribute[$i]['value'] = 
date($this->bocommon->dateformat,$this->bocommon->date_to_timestamp($values_attribute[$i]['value']));
+                               $values = $this->so->read_single_item($data, 
$values);
                                }
-                       }
-
-                       return $values_attribute;
+                       $values = $this->custom->prepare_attributes($values, 
'property', '.agreement.detail');
+                       return $values;
                }
 
                function save($values,$values_attribute='',$action='')
                {
-
                        $values['start_date']   = 
$this->bocommon->date_to_timestamp($values['start_date']);
                        $values['end_date']     = 
$this->bocommon->date_to_timestamp($values['end_date']);
                        $values['termination_date']     = 
$this->bocommon->date_to_timestamp($values['termination_date']);
 
-                       $values_attribute = 
$this->convert_attribute_save($values_attribute);
+                       if(is_array($values_attribute))
+                       {
+                               $values_attribute = 
$this->custom->convert_attribute_save($values_attribute);
+                       }
 
                        if ($action=='edit')
 //                     if ($values['agreement_id'])
@@ -443,7 +309,7 @@
                                        {
                                                for 
($i=0;$i<count($values['delete_file']);$i++)
                                                {
-                                                       $file = 
$this->fakebase. SEP . 'agreement' . SEP . $values['agreement_id'] . SEP . 
$values['delete_file'][$i];
+                                                       $file = 
"{$this->fakebase}/agreement/{$values['agreement_id']}/{$values['delete_file'][$i]}";
 
                                                        
if($this->vfs->file_exists(array(
                                                                        
'string' => $file,
@@ -459,11 +325,11 @@
                                                                     )
                                                                )))
                                                                {
-                                                                       
$receipt['error'][]=array('msg'=>lang('failed to delete file') . ' :'. 
$this->fakebase. SEP . 'agreement'. SEP . $values['agreement_id'] . SEP 
.$values['delete_file'][$i]);
+                                                                       
$receipt['error'][] = array('msg' => lang('failed to delete file: %1', $file));
                                                                }
                                                                else
                                                                {
-                                                                       
$receipt['message'][]=array('msg'=>lang('file deleted') . ' :'. 
$this->fakebase. SEP . 'agreement'. SEP . $values['id'] . SEP . 
$values['delete_file'][$i]);
+                                                                       
$receipt['message'][] = array('msg' => lang('file deleted: %1', $file));
                                                                }
                                                                
$this->vfs->override_acl = 0;
                                                        }
@@ -518,68 +384,20 @@
                        $this->so->delete_item($agreement_id,$activity_id);
                }
 
-               function delete($agreement_id='',$id='',$attrib='')
-               {
-                       if ($attrib)
+               function delete($agreement_id='')
                        {
-                               $this->so->delete_attrib($id);
-                       }
-                       else
-                       {
                                $this->so->delete($agreement_id);
                        }
-               }
 
-               function read_attrib($type_id='')
-               {
-                       $attrib = $this->so->read_attrib(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
-                                                                               
        'allrows'=>$this->allrows));
 
-                       for ($i=0; $i<count($attrib); $i++)
-                       {
-                               $attrib[$i]['datatype'] = 
$this->bocommon->translate_datatype($attrib[$i]['datatype']);
-                       }
-
-                       $this->total_records = $this->so->total_records;
-
-                       return $attrib;
-               }
-
-               function read_single_attrib($id)
-               {
-                       return $this->so->read_single_attrib($id);
-               }
-
-               function resort_attrib($data)
-               {
-                       $this->so->resort_attrib($data);
-               }
-
-               function save_attrib($attrib,$action='')
-               {
-                       if ($action=='edit')
-                       {
-                               if ($attrib['id'] != '')
-                               {
-
-                                       $receipt = 
$this->so->edit_attrib($attrib);
-                               }
-                       }
-                       else
-                       {
-                               $receipt = $this->so->add_attrib($attrib);
-                       }
-                       return $receipt;
-               }
-
                function column_list($selected='',$allrows='')
                {
                        if(!$selected)
                        {
-                               $selected = 
isset($GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]["agreement_columns"])?$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]["agreement_columns"]:'';
+                               $selected = 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']["agreement_columns"])?$GLOBALS['phpgw_info']['user']['preferences']['property']["agreement_columns"]:'';
                        }
 
-                       $columns = 
$this->so->read_attrib(array('allrows'=>$allrows,'column_list'=>True));
+                       $columns = 
$this->custom->get_attribs('property','.agreement', 0, '','','',true);
 
                        
$column_list=$this->bocommon->select_multi_list($selected,$columns);
 
@@ -593,25 +411,26 @@
 
                function create_home_dir($receipt='')
                {
+                       $dir = "{$this->fakebase}/agreement";
                        if(!$this->vfs->file_exists(array(
-                                       'string' => $this->fakebase. SEP . 
'agreement',
+                                       'string' => $dir,
                                        'relatives' => Array(RELATIVE_NONE)
                                )))
                        {
                                $this->vfs->override_acl = 1;
 
                                if(!$this->vfs->mkdir (array(
-                                    'string' => $this->fakebase. SEP . 
'agreement',
+                                    'string' => $dir,
                                     'relatives' => array(
                                          RELATIVE_NONE
                                     )
                                )))
                                {
-                                       
$receipt['error'][]=array('msg'=>lang('failed to create directory') . ' :'. 
$this->fakebase. SEP . 'agreement');
+                                       $receipt['error'][] = array('msg' => 
lang('failed to create directory: %1', $dir));
                                }
                                else
                                {
-                                       
$receipt['message'][]=array('msg'=>lang('directory created') . ' :'. 
$this->fakebase. SEP . 'agreement');
+                                       $receipt['message'][] = array('msg' => 
lang('directory created: %1', $dir));
                                }
                                $this->vfs->override_acl = 0;
                        }
@@ -621,25 +440,25 @@
 
                function create_document_dir($id='')
                {
-
+                       $doc_id = "{$this->fakebase}/agreement/{$id}";
                        if(!$this->vfs->file_exists(array(
-                                       'string' => $this->fakebase. SEP . 
'agreement' .  SEP . $id,
+                                       'string' => $doc_id,
                                        'relatives' => Array(RELATIVE_NONE)
                                )))
                        {
                                $this->vfs->override_acl = 1;
                                if(!$this->vfs->mkdir (array(
-                                    'string' => $this->fakebase. SEP . 
'agreement' .  SEP . $id,
+                                       'string' => $doc_id,
                                     'relatives' => array(
                                          RELATIVE_NONE
                                     )
                                )))
                                {
-                                       
$receipt['error'][]=array('msg'=>lang('failed to create directory') . ' :'. 
$this->fakebase. SEP  . 'agreement' .  SEP . $id);
+                                       $receipt['error'][] = array('msg' => 
lang('failed to create directory: %1', $doc_id));
                                }
                                else
                                {
-                                       
$receipt['message'][]=array('msg'=>lang('directory created') . ' :'. 
$this->fakebase. SEP . 'agreement' .  SEP . $id);
+                                       $receipt['message'][] = array('msg' => 
lang('directory created: %1', $doc_id));
                                }
                                $this->vfs->override_acl = 0;
                        }

Modified: trunk/property/inc/class.boalarm.inc.php
===================================================================
--- trunk/property/inc/class.boalarm.inc.php    2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.boalarm.inc.php    2008-02-02 13:52:39 UTC (rev 
18466)
@@ -44,7 +44,7 @@
                {
 
                        $GLOBALS['phpgw_info']['flags']['currentapp']   =       
'property';
-                       $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        if (!is_object($GLOBALS['phpgw']->asyncservice))
                        {
                                $GLOBALS['phpgw']->asyncservice = 
CreateObject('phpgwapi.asyncservice');
@@ -258,7 +258,7 @@
                {
                        if(!$method)
                        {
-                               $method = $this->currentapp 
.'.boalarm.send_alarm';
+                               $method = 'property' .'.boalarm.send_alarm';
                        }
 //                     echo "<p>save_alarm(event_id=$event_id, alarm="; 
print_r($alarm); echo ")</p>\n";
 
@@ -388,7 +388,7 @@
                        // build subject
                        $subject = lang('Alarm').': '.$alarm['event_name'];
 
-                       $prefs_user = 
$this->bocommon->create_preferences($this->currentapp,$alarm['owner']);
+                       $prefs_user = 
$this->bocommon->create_preferences('property',$alarm['owner']);
 
                        $from_address=$prefs_user['email'];
 
@@ -403,7 +403,7 @@
 
                        $current_user_name= $user_firstname . " " 
.$user_lastname ;
 
-                       $current_prefs_user = 
$this->bocommon->create_preferences($this->currentapp,$alarm['owner']);
+                       $current_prefs_user = 
$this->bocommon->create_preferences('property',$alarm['owner']);
                        $current_user_address=$current_prefs_user['email'];
 
                        $headers = "Return-Path: <". $current_user_address 
.">\r\n";
@@ -433,7 +433,7 @@
                        {
                                if ($members[$i]['account_id'])
                                {
-                                       $prefs = 
$this->bocommon->create_preferences($this->currentapp,$members[$i]['account_id']);
+                                       $prefs = 
$this->bocommon->create_preferences('property',$members[$i]['account_id']);
                                        if (strlen($prefs['email'])> 
(strlen($members[$i]['account_name'])+1))
                                        {
                                                $toarray[$prefs['email']] = 
$prefs['email'];

Modified: trunk/property/inc/class.boasync.inc.php
===================================================================
--- trunk/property/inc/class.boasync.inc.php    2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.boasync.inc.php    2008-02-02 13:52:39 UTC (rev 
18466)
@@ -71,7 +71,7 @@
 
                function property_boasync($session=False)
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->so               = 
CreateObject('property.soasync');
                        $this->socommon = CreateObject('property.socommon');
 

Modified: trunk/property/inc/class.bob_account.inc.php
===================================================================
--- trunk/property/inc/class.bob_account.inc.php        2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/inc/class.bob_account.inc.php        2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -71,7 +71,7 @@
 
                function property_bob_account($session=False)
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->so               = 
CreateObject('property.sob_account');
                        $this->socommon = CreateObject('property.socommon');
 

Modified: trunk/property/inc/class.bobudget.inc.php
===================================================================
--- trunk/property/inc/class.bobudget.inc.php   2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.bobudget.inc.php   2008-02-02 13:52:39 UTC (rev 
18466)
@@ -57,7 +57,7 @@
 
                function property_bobudget($session=False)
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->so               = 
CreateObject('property.sobudget');
                        $this->bocommon         = 
CreateObject('property.bocommon');
 
@@ -239,10 +239,8 @@
                        return $receipt;
                }
 
-
                function save_basis($values)
                {
-
                        if ($values['budget_id'])
                        {
                                if ($values['budget_id'] != 0)
@@ -256,7 +254,7 @@
                                $receipt = $this->so->add_basis($values);
                        }
 
-                       if(is_array($values['distribute']) && 
is_array($values['distribute_year']))
+                       if(is_array($values['distribute']) && 
is_array($values['distribute_year']) && (!isset($receipt['error']) || 
!$receipt['error']))
                        {
                                if($values['distribute'][0]=='new')
                                {

Modified: trunk/property/inc/class.bocategory.inc.php
===================================================================
--- trunk/property/inc/class.bocategory.inc.php 2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.bocategory.inc.php 2008-02-02 13:52:39 UTC (rev 
18466)
@@ -71,7 +71,7 @@
 
                function property_bocategory($session=False)
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->so               = 
CreateObject('property.socategory');
                        $this->socommon = CreateObject('property.socommon');
 

Modified: trunk/property/inc/class.bocommon.inc.php
===================================================================
--- trunk/property/inc/class.bocommon.inc.php   2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.bocommon.inc.php   2008-02-02 13:52:39 UTC (rev 
18466)
@@ -46,7 +46,6 @@
                var $public_functions = array
                (
                        'select_part_of_town'   => True,
-                       'menu'                                  => True,
                );
 
                var $soap_functions = array(
@@ -72,14 +71,14 @@
                {
                        if($currentapp)
                        {
-                               $this->currentapp       = $currentapp;
+                       //      $this->currentapp       = $currentapp;
                        }
                        else
                        {
-                               $this->currentapp       = 'property';           
        
+                       //      $this->currentapp       = 'property';           
        
                        }
 
-                       $this->socommon                 = 
CreateObject('property.socommon',$this->currentapp);
+                       $this->socommon                 = 
CreateObject('property.socommon','property');
                        $this->account          = 
$GLOBALS['phpgw_info']['user']['account_id'];
 
                        if (!isset($GLOBALS['phpgw']->asyncservice))
@@ -534,9 +533,6 @@
                {
 //_debug_array($data);
 
-                       $contacts       = CreateObject('property.soactor');
-                       $contacts->role='vendor';
-
                        if( isset($data['type']) && $data['type']=='view')
                        {
                                
$GLOBALS['phpgw']->xslttpl->add_file(array('vendor_view'));
@@ -549,9 +545,14 @@
                        $vendor['value_vendor_id']              = 
$data['vendor_id'];
                        $vendor['value_vendor_name']            = 
$data['vendor_name'];
 
-                       if($data['vendor_id'] && !$data['vendor_name'])
+                       if(isset($data['vendor_id']) && $data['vendor_id'] && 
!$data['vendor_name'])
                        {
-                               $vendor_data    = 
$contacts->read_single(array('actor_id'=>$data['vendor_id']));
+                               $contacts       = 
CreateObject('property.soactor');
+                               $contacts->role='vendor';
+                               $custom                 = 
createObject('phpgwapi.custom_fields');       
+                               $vendor_data['attributes'] = 
$custom->get_attribs('property','.vendor', 0, '', 'ASC', 'attrib_sort', true, 
true);
+
+                               $vendor_data    = 
$contacts->read_single($data['vendor_id'],$vendor_data);
                                if(is_array($vendor_data))
                                {
                                        foreach($vendor_data['attributes'] as 
$attribute)
@@ -563,14 +564,14 @@
                                                }
                                        }
                                }
+                               unset($contacts);
                        }
 
-                       $vendor['vendor_link']                  = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilookup.vendor'));
+                       $vendor['vendor_link']                  = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uilookup.vendor'));
                        $vendor['lang_vendor']                  = 
lang('Vendor');
                        $vendor['lang_select_vendor_help']      = lang('Klick 
this link to select vendor');
                        $vendor['lang_vendor_name']             = lang('Vendor 
Name');
 
-                       unset($contacts);
 //_debug_array($vendor);
                        return $vendor;
                }
@@ -589,7 +590,7 @@
                        $tenant['value_tenant_id']                      = 
$data['tenant_id'];
                        $tenant['value_first_name']                     = 
$data['first_name'];
                        $tenant['value_last_name']                      = 
$data['last_name'];
-                       $tenant['tenant_link']                          = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilookup.tenant'));
+                       $tenant['tenant_link']                          = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uilookup.tenant'));
                        if($data['role']=='customer')
                        {
                                $tenant['lang_select_tenant_help']              
= lang('Klick this link to select customer');
@@ -607,7 +608,9 @@
                        {
                                $tenant_object  = 
CreateObject('property.soactor');
                                $tenant_object->role = 'tenant';
-                               $tenant_data    = 
$tenant_object->read_single(array('actor_id' => $data['tenant_id']));
+                               $custom                 = 
createObject('phpgwapi.custom_fields');
+                               $tenant_data['attributes'] = 
$custom->get_attribs('property','.tenant', 0, '', 'ASC', 'attrib_sort', true, 
true);
+                               $tenant_data    = 
$tenant_object->read_single($data['tenant_id'],$tenant_data);
                                if(is_array($tenant_data['attributes']))
                                {
 //_debug_array($tenant_data);
@@ -643,7 +646,7 @@
 
                        $b_account['value_b_account_id']                = 
$data['b_account_id'];
                        $b_account['value_b_account_name']              = 
$data['b_account_name'];
-                       $b_account['b_account_link']                    = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilookup.b_account'));
+                       $b_account['b_account_link']                    = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uilookup.b_account'));
                        $b_account['lang_select_b_account_help']        = 
lang('Klick this link to select budget account');
                        $b_account['lang_b_account']                    = 
lang('Budget account');
                        if($data['b_account_id'] && !$data['b_account_name'])
@@ -732,37 +735,26 @@
                }
 
 
-               function 
select_multi_list_2($selected='',$input_list,$input_type='')
+               function select_multi_list_2($selected='',$list,$input_type='')
                {
-                       $j=0;
-                       if (isset($input_list) AND is_array($input_list))
+                       if (isset($list) AND is_array($list))
                        {
-                               foreach($input_list as $entry)
+                               foreach($list as &$choice)
                                {
-                                       $output_list[$j]['id'] = $entry['id'];
-                                       $output_list[$j]['value'] = 
$entry['value'];
-                                       $output_list[$j]['input_type'] = 
$input_type;
-
-                                       for ($i=0;$i<count($selected);$i++)
+                                       $choice['input_type'] = $input_type;
+                                       if(isset($selected) && 
is_array($selected))
                                        {
-                                               if($selected[$i] == 
$entry['id'])
+                                               foreach ($selected as &$sel)
                                                {
-                                                       
$output_list[$j]['checked'] = 'checked';
+                                                       if($sel == 
$choice['id'])
+                                                       {
+                                                               
$choice['checked'] = 'checked';
                                                }
                                        }
-                                       $j++;
                                }
                        }
-
-/*                     for ($i=0;$i<count($output_list);$i++)
-                       {
-                               if ($output_list[$i]['checked'] != 'checked')
-                               {
-                                       unset($output_list[$i]['checked']);
                                }
-                       }
-*/
-                       return $output_list;
+                       return $list;
                }
 
                function translate_datatype($datatype)
@@ -1400,15 +1392,15 @@
                {
                        if($type=='tts'):
                        {
-                               $link = array('menuaction' => 
$this->currentapp.'.uitts.view');
+                               $link = array('menuaction' => 
'property.uitts.view');
                        }
                        elseif($type=='request'):
                        {
-                               $link = array('menuaction' => 
$this->currentapp.'.uirequest.view');
+                               $link = array('menuaction' => 
'property.uirequest.view');
                        }
                        elseif($type=='project'):
                        {
-                               $link = array('menuaction' => 
$this->currentapp.'.uiproject.view');
+                               $link = array('menuaction' => 
'property.uiproject.view');
                        }
                        elseif(substr($type,0,6)=='entity'):
                        {
@@ -1417,7 +1409,7 @@
                                $cat_id         = $type[2];
                                $link = array
                                (
-                                       'menuaction'    => 
$this->currentapp.'.uientity.view',
+                                       'menuaction'    => 
'property.uientity.view',
                                        'entity_id'     => $entity_id,
                                        'cat_id'        => $cat_id
                                );
@@ -1455,24 +1447,42 @@
                        {       
                                for ($i=0;$i<count($values['attributes']);$i++)
                                {
-                                       
if($values['attributes'][$i]['attrib_id'] == $attribute['attrib_id'])
+                                       if($values['attributes'][$i]['id'] == 
$attribute['attrib_id'])
                                        {
-                                               
$values['attributes'][$i]['value'] = $attribute['value'];
-
-                                               
if(isset($values['attributes'][$i]['choice']) && 
is_array($values['attributes'][$i]['choice']))
+                                               if(isset($attribute['value']))
                                                {
-                                                       for 
($j=0;$j<count($values['attributes'][$i]['choice']);$j++)
+                                                       
if(is_array($attribute['value']))
+                                               {
+                                                               
foreach($values['attributes'][$i]['choice'] as &$choice)
                                                        {
-                                                               
if($values['attributes'][$i]['choice'][$j]['id'] == $attribute['value'])
+                                                                       foreach 
($attribute['value'] as &$selected)
                                                                {
-                                                                       
$values['attributes'][$i]['choice'][$j]['checked'] = 'checked'; 
+                                                                               
if($selected == $choice['id'])
+                                                                               
{
+                                                                               
        $choice['checked'] = 'checked';
                                                                }
                                                        }
                                                }
                                        }
+                                                       else 
if(isset($values['attributes'][$i]['choice']) && 
is_array($values['attributes'][$i]['choice']))
+                                                       {
+
+                                                               foreach 
($values['attributes'][$i]['choice'] as &$choice)
+                                                               {
+                                                                       
if($choice['id'] == $attribute['value'])
+                                                                       {
+                                                                               
$choice['checked'] = 'checked'; 
+                                                                       }
+                                                               }
+                                                       }
+                                                       else
+                                                       {
+                                                               
$values['attributes'][$i]['value'] = $attribute['value'];
+                                                       }
+                                               }
+                                       }
                                }
                        }
-                       
                        return $values;
                }
                

Modified: trunk/property/inc/class.bocustom.inc.php
===================================================================
--- trunk/property/inc/class.bocustom.inc.php   2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.bocustom.inc.php   2008-02-02 13:52:39 UTC (rev 
18466)
@@ -52,7 +52,7 @@
 
                function property_bocustom($session=False)
                {
-                       $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->so = CreateObject('property.socustom');
 
                        if ($session)

Modified: trunk/property/inc/class.bodocument.inc.php
===================================================================
--- trunk/property/inc/class.bodocument.inc.php 2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.bodocument.inc.php 2008-02-02 13:52:39 UTC (rev 
18466)
@@ -40,6 +40,8 @@
                var $sort;
                var $order;
                var $cat_id;
+               var $entity_id;
+               var $status_id;
 
                var $public_functions = array
                (
@@ -52,7 +54,7 @@
 
                function property_bodocument($session=False)
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->so                       = 
CreateObject('property.sodocument');
                        $this->bocommon         = 
CreateObject('property.bocommon');
                        $this->solocation       = 
CreateObject('property.solocation');
@@ -115,7 +117,7 @@
                        {
                                $this->status_id = $status_id;
                        }
-                       if(isset($entity_id))
+                       if($entity_id)
                        {
                                $this->entity_id = $entity_id;
                        }
@@ -150,7 +152,7 @@
                        $this->sort             = $data['sort'];
                        $this->order    = $data['order'];
                        $this->cat_id   = $data['cat_id'];
-                       $this->entity_id        = $data['entity_id'];
+               //      $this->entity_id        = $data['entity_id'];
                        $this->doc_type = $data['doc_type'];
                        $this->query_location   = $data['query_location'];
                }
@@ -224,10 +226,12 @@
                        $document                                               
= $this->so->read_single($document_id);
                        $dateformat                                             
= $GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
                        $document['document_date']              = 
$GLOBALS['phpgw']->common->show_date($document['document_date'],$dateformat);
-                       $vendor                                                 
= $this->contacts->read_single(array('actor_id'=>$document['vendor_id']));
 
-                       if(is_array($vendor))
+                       if(isset($document['vendor_id']) && 
$document['vendor_id'])
                        {
+                               $custom                                 = 
createObject('phpgwapi.custom_fields');
+                               $vendor['attributes']   = 
$custom->get_attribs('property','.vendor', 0, '', 'ASC', 'attrib_sort', true, 
true);
+                               $vendor                                 = 
$this->contacts->read_single($document['vendor_id'],$vendor);
                                foreach($vendor['attributes'] as $attribute)
                                {
                                        if($attribute['name']=='org_name')
@@ -350,25 +354,26 @@
 
                function create_home_dir()
                {
+                       $dir = "{$this->fakebase}/agreement";
                        if(!$this->vfs->file_exists(array(
-                                       'string' => $this->fakebase. SEP . 
'document',
+                                       'string' => $dir,
                                        'relatives' => Array(RELATIVE_NONE)
                                )))
                        {
                                $this->vfs->override_acl = 1;
 
                                if(!$this->vfs->mkdir (array(
-                                    'string' => $this->fakebase. SEP . 
'document',
+                                    'string' => $dir,
                                     'relatives' => array(
                                          RELATIVE_NONE
                                     )
                                )))
                                {
-                                       
$receipt['error'][]=array('msg'=>lang('failed to create directory') . ' :'. 
$this->fakebase. SEP . 'document');
+                                       $receipt['error'][] = array('msg' => 
lang('failed to create directory: %1', $dir));
                                }
                                else
                                {
-                                       
$receipt['message'][]=array('msg'=>lang('directory created') . ' :'. 
$this->fakebase. SEP . 'document');
+                                       $receipt['message'][] = array('msg' => 
lang('directory created: %1', $dir));
                                }
                                $this->vfs->override_acl = 0;
                                return $receipt;
@@ -389,22 +394,22 @@
                        $this->vfs->override_acl = 1;
 //_debug_array($data);
                        if(!$this->vfs->file_exists(array(
-                                       'string' => $this->fakebase. SEP . 
'document' .  SEP . $loc1,
+                                       'string' => $this->fakebase. '/' . 
'document' .  '/' . $loc1,
                                        'relatives' => Array(RELATIVE_NONE)
                                )))
                        {
                                if(!$this->vfs->mkdir (array(
-                                    'string' => $this->fakebase. SEP . 
'document' .  SEP . $loc1,
+                                    'string' => $this->fakebase. '/' . 
'document' .  '/' . $loc1,
                                     'relatives' => array(
                                          RELATIVE_NONE
                                     )
                                )))
                                {
-                                       
$receipt['error'][]=array('msg'=>lang('failed to create directory') . ' :'. 
$this->fakebase. SEP . 'document' .  SEP . $loc1);
+                                       
$receipt['error'][]=array('msg'=>lang('failed to create directory') . ' :'. 
$this->fakebase. '/' . 'document' .  '/' . $loc1);
                                }
                                else
                                {
-                                       
$receipt['message'][]=array('msg'=>lang('directory created') . ' :'. 
$this->fakebase. SEP . 'document' .  SEP . $loc1);
+                                       
$receipt['message'][]=array('msg'=>lang('directory created') . ' :'. 
$this->fakebase. '/' . 'document' .  '/' . $loc1);
                                }
                                $this->vfs->override_acl = 0;
                        }
@@ -412,69 +417,69 @@
                        if($entity_name)
                        {
                                if(!$this->vfs->file_exists(array(
-                                               'string' => $this->fakebase. 
SEP . 'document' .  SEP . $loc1 .  SEP . $entity_name,
+                                               'string' => $this->fakebase. 
'/' . 'document' .  '/' . $loc1 .  '/' . $entity_name,
                                                'relatives' => 
Array(RELATIVE_NONE)
                                        )))
                                {
 
                                        if(!$this->vfs->mkdir (array(
-                                                'string' => $this->fakebase. 
SEP . 'document' .  SEP . $loc1 .  SEP . $entity_name,
+                                                'string' => $this->fakebase. 
'/' . 'document' .  '/' . $loc1 .  '/' . $entity_name,
                                             'relatives' => array(
                                                  RELATIVE_NONE
                                             )
                                        )))
                                        {
-                                               
$receipt['error'][]=array('msg'=>lang('failed to create directory') . ' :'. 
$this->fakebase. SEP . 'document'  .  SEP . $loc1 .  SEP . $entity_name);
+                                               
$receipt['error'][]=array('msg'=>lang('failed to create directory') . ' :'. 
$this->fakebase. '/' . 'document'  .  '/' . $loc1 .  '/' . $entity_name);
                                        }
                                        else
                                        {
-                                               
$receipt['message'][]=array('msg'=>lang('directory created') . ' :'. 
$this->fakebase. SEP . 'document'  .  SEP . $loc1 .  SEP . $entity_name);
+                                               
$receipt['message'][]=array('msg'=>lang('directory created') . ' :'. 
$this->fakebase. '/' . 'document'  .  '/' . $loc1 .  '/' . $entity_name);
                                        }
                                }
                        }
                        if($category_name)
                        {
                                if(!$this->vfs->file_exists(array(
-                                               'string' => $this->fakebase. 
SEP . 'document' .  SEP . $loc1 .  SEP . $entity_name .  SEP . $category_name,
+                                               'string' => $this->fakebase. 
'/' . 'document' .  '/' . $loc1 .  '/' . $entity_name .  '/' . $category_name,
                                                'relatives' => 
Array(RELATIVE_NONE)
                                        )))
                                {
 
                                        if(!$this->vfs->mkdir (array(
-                                                'string' => $this->fakebase. 
SEP . 'document' .  SEP . $loc1 .  SEP . $entity_name .  SEP . $category_name,
+                                                'string' => $this->fakebase. 
'/' . 'document' .  '/' . $loc1 .  '/' . $entity_name .  '/' . $category_name,
                                             'relatives' => array(
                                                  RELATIVE_NONE
                                             )
                                        )))
                                        {
-                                               
$receipt['error'][]=array('msg'=>lang('failed to create directory') . ' :'. 
$this->fakebase. SEP . 'document'  .  SEP . $loc1 .  SEP . $entity_name .  SEP 
. $category_name);
+                                               
$receipt['error'][]=array('msg'=>lang('failed to create directory') . ' :'. 
$this->fakebase. '/' . 'document'  .  '/' . $loc1 .  '/' . $entity_name .  '/' 
. $category_name);
                                        }
                                        else
                                        {
-                                               
$receipt['message'][]=array('msg'=>lang('directory created') . ' :'. 
$this->fakebase. SEP . 'document'  .  SEP . $loc1 .  SEP . $entity_name .  SEP 
. $category_name);
+                                               
$receipt['message'][]=array('msg'=>lang('directory created') . ' :'. 
$this->fakebase. '/' . 'document'  .  '/' . $loc1 .  '/' . $entity_name .  '/' 
. $category_name);
                                        }
                                }
                        }
                        if($p_num)
                        {
                                if(!$this->vfs->file_exists(array(
-                                               'string' => $this->fakebase. 
SEP . 'document' .  SEP . $loc1 .  SEP . $entity_name .  SEP . $category_name . 
 SEP . $p_num,
+                                               'string' => $this->fakebase. 
'/' . 'document' .  '/' . $loc1 .  '/' . $entity_name .  '/' . $category_name . 
 '/' . $p_num,
                                                'relatives' => 
Array(RELATIVE_NONE)
                                        )))
                                {
 
                                        if(!$this->vfs->mkdir (array(
-                                                'string' => $this->fakebase. 
SEP . 'document' .  SEP . $loc1 .  SEP . $entity_name .  SEP . $category_name . 
 SEP . $p_num,
+                                                'string' => $this->fakebase. 
'/' . 'document' .  '/' . $loc1 .  '/' . $entity_name .  '/' . $category_name . 
 '/' . $p_num,
                                             'relatives' => array(
                                                  RELATIVE_NONE
                                             )
                                        )))
                                        {
-                                               
$receipt['error'][]=array('msg'=>lang('failed to create directory') . ' :'. 
$this->fakebase. SEP . 'document'  .  SEP . $loc1 .  SEP . $entity_name .  SEP 
. $category_name .  SEP . $p_num);
+                                               
$receipt['error'][]=array('msg'=>lang('failed to create directory') . ' :'. 
$this->fakebase. '/' . 'document'  .  '/' . $loc1 .  '/' . $entity_name .  '/' 
. $category_name .  '/' . $p_num);
                                        }
                                        else
                                        {
-                                               
$receipt['message'][]=array('msg'=>lang('directory created') . ' :'. 
$this->fakebase. SEP . 'document'  .  SEP . $loc1 .  SEP . $entity_name .  SEP 
. $category_name .  SEP . $p_num);
+                                               
$receipt['message'][]=array('msg'=>lang('directory created') . ' :'. 
$this->fakebase. '/' . 'document'  .  '/' . $loc1 .  '/' . $entity_name .  '/' 
. $category_name .  '/' . $p_num);
                                        }
                                }
                        }

Modified: trunk/property/inc/class.boentity.inc.php
===================================================================
--- trunk/property/inc/class.boentity.inc.php   2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.boentity.inc.php   2008-02-02 13:52:39 UTC (rev 
18466)
@@ -73,9 +73,9 @@
 
                function property_boentity($session=False)
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->solocation       = 
CreateObject('property.solocation');
                        $this->bocommon         = 
CreateObject('property.bocommon');
+                       $this->custom           = 
createObject('phpgwapi.custom_fields');
                        $this->vfs                      = 
CreateObject('phpgwapi.vfs');
                        $this->rootdir          = $this->vfs->basedir;
                        $this->fakebase         = $this->vfs->fakebase;
@@ -184,14 +184,11 @@
 
                function 
column_list($selected='',$entity_id='',$cat_id,$allrows='')
                {
-                       $soadmin_entity = 
CreateObject('property.soadmin_entity');
-
                        if(!$selected)
                        {
-                               
$selected=$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]["entity_columns_"
 . $this->entity_id . '_' . $this->cat_id];
+                               
$selected=$GLOBALS['phpgw_info']['user']['preferences']['property']["entity_columns_"
 . $this->entity_id . '_' . $this->cat_id];
                        }
-
-                       $columns = 
$soadmin_entity->read_attrib(array('entity_id'=>$entity_id,'cat_id'=>$cat_id,'allrows'=>$allrows,'filter_list'
 =>true));
+                       $columns = 
$this->custom->get_attribs('property','.entity.' . $entity_id . '.' . $cat_id, 
0, '','','',true);
                        
$column_list=$this->bocommon->select_multi_list($selected,$columns);
                        return $column_list;
                }
@@ -276,180 +273,73 @@
 
                function read_single($data)
                {
-                       $soadmin_entity = 
CreateObject('property.soadmin_entity');
-                       $contacts               = 
CreateObject('phpgwapi.contacts');
-                       $vendor                 = 
CreateObject('property.soactor');
-                       $vendor->role   = 'vendor';
-
-                       $entity = $this->so->read_single($data);
-
-                       $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
-               //      $entity['date']  = 
$GLOBALS['phpgw']->common->show_date($entity['date'],$dateformat);
-
-                       if($entity['location_code'])
-                       {
-                               
$entity['location_data']=$this->solocation->read_single($entity['location_code']);
-                               if($entity['tenant_id'])
+                       $values['attributes'] = 
$this->custom->get_attribs('property','.entity.' . $data['entity_id'] .'.' . 
$data['cat_id'], 0, '', 'ASC', 'attrib_sort', true, true);
+                       if(isset($data['id']) && $data['id'])
                                {
-                                       
$tenant_data=$this->bocommon->read_single_tenant($entity['tenant_id']);
-                                       $entity['location_data']['tenant_id']   
= $entity['tenant_id'];
-                                       
$entity['location_data']['contact_phone']= $entity['contact_phone'];
-                                       $entity['location_data']['last_name']   
= $tenant_data['last_name'];
-                                       $entity['location_data']['first_name']  
= $tenant_data['first_name'];
-                               }
-                       }
-
-                       if($entity['p_num'])
-                       {
-                               $category = 
$soadmin_entity->read_single_category($entity['p_entity_id'],$entity['p_cat_id']);
-                               
$entity['p'][$entity['p_entity_id']]['p_num']=$entity['p_num'];
-                               
$entity['p'][$entity['p_entity_id']]['p_entity_id']=$entity['p_entity_id'];
-                               
$entity['p'][$entity['p_entity_id']]['p_cat_id']=$entity['p_cat_id'];
-                               
$entity['p'][$entity['p_entity_id']]['p_cat_name'] = $category['name'];
-                       }
-
-                       $input_type_array = array(
-                               'R' => 'radio',
-                               'CH' => 'checkbox',
-                               'LB' => 'listbox'
-                       );
-
-                       $sep = '/';
-
-                       $dlarr[strpos($dateformat,'Y')] = 'Y';
-                       $dlarr[strpos($dateformat,'m')] = 'm';
-                       $dlarr[strpos($dateformat,'d')] = 'd';
-                       ksort($dlarr);
-                       $dateformat= (implode($sep,$dlarr));
-                       $m=0;
-
-                       //FIXME: This code is duplicated - and should be moved
-                       for ($i=0;$i<count($entity['attributes']);$i++)
-                       {
-                               if($entity['attributes'][$i]['datatype']=='D' 
&& $entity['attributes'][$i]['value'])
-                               {
-                                       $timestamp_date= 
mktime(0,0,0,date(m,strtotime($entity['attributes'][$i]['value'])),date(d,strtotime($entity['attributes'][$i]['value'])),date(y,strtotime($entity['attributes'][$i]['value'])));
-                                       $entity['attributes'][$i]['value']      
= $GLOBALS['phpgw']->common->show_date($timestamp_date,$dateformat);
-                               }
-                               else 
if($entity['attributes'][$i]['datatype']=='AB')
-                               {
-                                       if($entity['attributes'][$i]['value'])
-                                       {
-                                               $contact_data                   
        = 
$contacts->read_single_entry($entity['attributes'][$i]['value'],array('n_given'=>'n_given','n_family'=>'n_family','email'=>'email'));
-                                               
$entity['attributes'][$i]['contact_name']       = $contact_data[0]['n_family'] 
. ', ' . $contact_data[0]['n_given'];
+                               $values = $this->so->read_single($data, 
$values);
                                        }
+                       $values = $this->custom->prepare_attributes($values, 
'property','.entity.' . $data['entity_id'] .'.' . $data['cat_id'], 
$data['view']);
 
-                                       $insert_record_entity[] = 
$entity['attributes'][$i]['name'];
-                                       $lookup_link            = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uilookup.addressbook', 'column'=> 
$entity['attributes'][$i]['name']));
-                                       $lookup_functions[$m]['name'] = 
'lookup_'. $entity['attributes'][$i]['name'] .'()';
-                                       $lookup_functions[$m]['action'] = 
'Window1=window.open('."'" . $lookup_link ."'" 
.',"Search","width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");';
-                                       $m++;
-                               }
-                               else 
if($entity['attributes'][$i]['datatype']=='VENDOR')
-                               {
-                                       if($entity['attributes'][$i]['value'])
-                                       {
-                                               $vendor_data    = 
$vendor->read_single(array('actor_id'=>$entity['attributes'][$i]['value']));
-                                               for 
($n=0;$n<count($vendor_data['attributes']);$n++)
-                                               {
-                                                       
if($vendor_data['attributes'][$n]['name'] == 'org_name')
-                                                       {
-                                                               
$entity['attributes'][$i]['vendor_name']= 
$vendor_data['attributes'][$n]['value'];
-                                                               $n 
=count($vendor_data['attributes']);
-                                                       }
-                                               }
-                                       }
+                       $soadmin_entity = 
CreateObject('property.soadmin_entity');
 
-                                       $insert_record_entity[] = 
$entity['attributes'][$i]['name'];
-                                       $lookup_link            = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uilookup.vendor', 'column'=> 
$entity['attributes'][$i]['name']));
-                                       $lookup_functions[$m]['name'] = 
'lookup_'. $entity['attributes'][$i]['name'] .'()';
-                                       $lookup_functions[$m]['action'] = 
'Window1=window.open('."'" . $lookup_link ."'" 
.',"Search","width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");';
-                                       $m++;
-                               }
-                               else 
if($entity['attributes'][$i]['datatype']=='R' || 
$entity['attributes'][$i]['datatype']=='CH' || 
$entity['attributes'][$i]['datatype']=='LB')
-                               {
-                                       $entity['attributes'][$i]['choice']     
= 
$soadmin_entity->read_attrib_choice($data['entity_id'],$data['cat_id'],$entity['attributes'][$i]['attrib_id']);
-                                       
$input_type=$input_type_array[$entity['attributes'][$i]['datatype']];
-
-                                       
if($entity['attributes'][$i]['datatype']=='CH')
-                                       {
-                                               
$entity['attributes'][$i]['value']=unserialize($entity['attributes'][$i]['value']);
-                                               
$entity['attributes'][$i]['choice'] = 
$this->bocommon->select_multi_list_2($entity['attributes'][$i]['value'],$entity['attributes'][$i]['choice'],$input_type);
-                                       }
-                                       else
-                                       {
-                                               for 
($j=0;$j<count($entity['attributes'][$i]['choice']);$j++)
+                       if($values['location_code'])
                                                {
-                                                       
$entity['attributes'][$i]['choice'][$j]['input_type']=$input_type;
-                                                       
if($entity['attributes'][$i]['choice'][$j]['id']==$entity['attributes'][$i]['value'])
+                               
$values['location_data']=$this->solocation->read_single($values['location_code']);
+                               if($values['tenant_id'])
                                                        {
-                                                               
$entity['attributes'][$i]['choice'][$j]['checked']='checked';
+                                       
$tenant_data=$this->bocommon->read_single_tenant($values['tenant_id']);
+                                       $values['location_data']['tenant_id']   
= $values['tenant_id'];
+                                       
$values['location_data']['contact_phone']= $values['contact_phone'];
+                                       $values['location_data']['last_name']   
= $tenant_data['last_name'];
+                                       $values['location_data']['first_name']  
= $tenant_data['first_name'];
                                                        }
                                                }
-                                       }
-                               }
-                               else if 
($entity['attributes'][$i]['datatype']!='I' && 
$entity['attributes'][$i]['value'])
-                               {
-                                       $entity['attributes'][$i]['value'] = 
stripslashes($entity['attributes'][$i]['value']);
-                               }
 
-                               $entity['attributes'][$i]['datatype_text'] = 
$this->bocommon->translate_datatype($entity['attributes'][$i]['datatype']);
-                               $entity['attributes'][$i]['counter']    = $i;
-//                             $entity['attributes'][$i]['type_id']    = 
$data['type_id'];
-                       }
-
-                       if(isset($lookup_functions) && 
is_array($lookup_functions))
+                       if($values['p_num'])
                        {
-                               for ($j=0;$j<count($lookup_functions);$j++)
-                               {
-                                       $entity['lookup_functions'] .= 
'function ' . $lookup_functions[$j]['name'] ."\r\n";
-                                       $entity['lookup_functions'] .= 
'{'."\r\n";
-                                       $entity['lookup_functions'] .= 
$lookup_functions[$j]['action'] ."\r\n";
-                                       $entity['lookup_functions'] .= 
'}'."\r\n";
-                               }
+                               $category = 
$soadmin_entity->read_single_category($values['p_entity_id'],$values['p_cat_id']);
+                               
$values['p'][$values['p_entity_id']]['p_num']=$values['p_num'];
+                               
$values['p'][$values['p_entity_id']]['p_entity_id']=$values['p_entity_id'];
+                               
$values['p'][$values['p_entity_id']]['p_cat_id']=$values['p_cat_id'];
+                               
$values['p'][$values['p_entity_id']]['p_cat_name'] = $category['name'];
                        }
 
                        $this->vfs->override_acl = 1;
-                       $entity['files'] = $this->vfs->ls (array(
-                            'string' => $this->fakebase. '/' . 
$this->category_dir . '/' . $entity['location_data']['loc1'] .  '/' . 
$data['id'],
+                       $values['files'] = $this->vfs->ls (array(
+                            'string' => $this->fakebase. '/' . 
$this->category_dir . '/' . $values['location_data']['loc1'] .  '/' . 
$data['id'],
                             'relatives' => array(RELATIVE_NONE)));
 
                        $this->vfs->override_acl = 0;
 
-                       if(!isset($entity['files'][0]['file_id']) || 
!$entity['files'][0]['file_id'])
+                       if(!isset($values['files'][0]['file_id']) || 
!$values['files'][0]['file_id'])
                        {
-                               unset($entity['files']);
+                               unset($values['files']);
                        }
 
-
-                       
$GLOBALS['phpgw']->session->appsession('insert_record_entity',$this->currentapp,isset($insert_record_entity)?$insert_record_entity:'');
-
-//_debug_array($insert_record_entity);
-                       return $entity;
+                       return $values;
                }
 
-
                function create_home_dir($receipt='')
                {
                        if(!$this->vfs->file_exists(array(
-                                       'string' => $this->fakebase. SEP . 
$this->category_dir,
+                                       'string' => $this->fakebase. '/' . 
$this->category_dir,
                                        'relatives' => Array(RELATIVE_NONE)
                                )))
                        {
                                $this->vfs->override_acl = 1;
 
                                if(!$this->vfs->mkdir (array(
-                                    'string' => $this->fakebase. SEP . 
$this->category_dir,
+                                    'string' => $this->fakebase. '/' . 
$this->category_dir,
                                     'relatives' => array(
                                          RELATIVE_NONE
                                     )
                                )))
                                {
-                                       
$receipt['error'][]=array('msg'=>lang('failed to create directory') . ' :'. 
$this->fakebase. SEP . $this->category_dir);
+                                       
$receipt['error'][]=array('msg'=>lang('failed to create directory') . ' :'. 
$this->fakebase. '/' . $this->category_dir);
                                }
                                else
                                {
-                                       
$receipt['message'][]=array('msg'=>lang('directory created') . ' :'. 
$this->fakebase. SEP . $this->category_dir);
+                                       
$receipt['message'][]=array('msg'=>lang('directory created') . ' :'. 
$this->fakebase. '/' . $this->category_dir);
                                }
                                $this->vfs->override_acl = 0;
                        }
@@ -460,46 +350,46 @@
                function create_document_dir($loc1='',$id='')
                {
                        if(!$this->vfs->file_exists(array(
-                                       'string' => $this->fakebase. SEP . 
$this->category_dir .  SEP . $loc1,
+                                       'string' => $this->fakebase. '/' . 
$this->category_dir .  '/' . $loc1,
                                        'relatives' => Array(RELATIVE_NONE)
                                )))
                        {
                                $this->vfs->override_acl = 1;
                                if(!$this->vfs->mkdir (array(
-                                    'string' => $this->fakebase. SEP . 
$this->category_dir .  SEP . $loc1,
+                                    'string' => $this->fakebase. '/' . 
$this->category_dir .  '/' . $loc1,
                                     'relatives' => array(
                                          RELATIVE_NONE
                                     )
                                )))
                                {
-                                       
$receipt['error'][]=array('msg'=>lang('failed to create directory') . ' :'. 
$this->fakebase. SEP . $this->category_dir .  SEP . $loc1);
+                                       
$receipt['error'][]=array('msg'=>lang('failed to create directory') . ' :'. 
$this->fakebase. '/' . $this->category_dir .  '/' . $loc1);
                                }
                                else
                                {
-                                       
$receipt['message'][]=array('msg'=>lang('directory created') . ' :'. 
$this->fakebase. SEP . $this->category_dir .  SEP . $loc1);
+                                       
$receipt['message'][]=array('msg'=>lang('directory created') . ' :'. 
$this->fakebase. '/' . $this->category_dir .  '/' . $loc1);
                                }
                                $this->vfs->override_acl = 0;
                        }
 
 
                        if(!$this->vfs->file_exists(array(
-                                       'string' => $this->fakebase. SEP . 
$this->category_dir .  SEP . $loc1 .  SEP . $id,
+                                       'string' => $this->fakebase. '/' . 
$this->category_dir .  '/' . $loc1 .  '/' . $id,
                                        'relatives' => Array(RELATIVE_NONE)
                                )))
                        {
                                $this->vfs->override_acl = 1;
                                if(!$this->vfs->mkdir (array(
-                                    'string' => $this->fakebase. SEP . 
$this->category_dir .  SEP . $loc1 .  SEP . $id,
+                                    'string' => $this->fakebase. '/' . 
$this->category_dir .  '/' . $loc1 .  '/' . $id,
                                     'relatives' => array(
                                          RELATIVE_NONE
                                     )
                                )))
                                {
-                                       
$receipt['error'][]=array('msg'=>lang('failed to create directory') . ' :'. 
$this->fakebase. SEP  . $this->category_dir  .  SEP . $loc1 .  SEP . $id);
+                                       
$receipt['error'][]=array('msg'=>lang('failed to create directory') . ' :'. 
$this->fakebase. '/'  . $this->category_dir  .  '/' . $loc1 .  '/' . $id);
                                }
                                else
                                {
-                                       
$receipt['message'][]=array('msg'=>lang('directory created') . ' :'. 
$this->fakebase. SEP . $this->category_dir .  SEP . $loc1 .  SEP . $id);
+                                       
$receipt['message'][]=array('msg'=>lang('directory created') . ' :'. 
$this->fakebase. '/' . $this->category_dir .  '/' . $loc1 .  '/' . $id);
                                }
                                $this->vfs->override_acl = 0;
                        }
@@ -522,32 +412,9 @@
 
                        $values['date'] = 
$this->bocommon->date_to_timestamp($values['date']);
 
-                       if (is_array($values_attribute))
+                       if(is_array($values_attribute))
                        {
-                               for ($i=0;$i<count($values_attribute);$i++)
-                               {
-                                       
if(isset($values_attribute[$i]['value']) && $values_attribute[$i]['value'])
-                                       {
-                                               
switch($values_attribute[$i]['datatype'])
-                                               {
-                                                       case 'CH':
-                                                               
$values_attribute[$i]['value'] = serialize($values_attribute[$i]['value']);
-                                                               break;
-                                                       case 'R':
-                                                               
$values_attribute[$i]['value'] = $values_attribute[$i]['value'][0];
-                                                               break;
-                                                       case 'N':
-                                                               
$values_attribute[$i]['value'] = 
str_replace(",",".",$values_attribute[$i]['value']);
-                                                               break;
-                                                       case 'D':
-                                                               
$values_attribute[$i]['value'] = 
date($this->bocommon->dateformat,$this->bocommon->date_to_timestamp($values_attribute[$i]['value']));
-                                                               break;
-                                                       case 'T':
-                                                               
$values_attribute[$i]['value'] = 
$GLOBALS['phpgw']->db->db_addslashes($values_attribute[$i]['value']);
-                                                               break;
-                                               }
-                                       }
-                               }
+                               $values_attribute = 
$this->custom->convert_attribute_save($values_attribute);
                        }
 
                        if ($action=='edit')
@@ -558,7 +425,7 @@
                                {
                                        for 
($i=0;$i<count($values['delete_file']);$i++)
                                        {
-                                               $file = $this->fakebase. SEP . 
$this->category_dir . SEP . $location[0] . SEP . $values['id'] . SEP . 
$values['delete_file'][$i];
+                                               $file = $this->fakebase. '/' . 
$this->category_dir . '/' . $location[0] . '/' . $values['id'] . '/' . 
$values['delete_file'][$i];
 
                                                
if($this->vfs->file_exists(array(
                                                                'string' => 
$file,
@@ -574,11 +441,11 @@
                                                             )
                                                        )))
                                                        {
-                                                               
$receipt['error'][]=array('msg'=>lang('failed to delete file') . ' :'. 
$this->fakebase. SEP . $this->category_dir . SEP . $location[0]. SEP . 
$values['id'] . SEP .$values['delete_file'][$i]);
+                                                               
$receipt['error'][]=array('msg'=>lang('failed to delete file') . ' :'. 
$this->fakebase. '/' . $this->category_dir . '/' . $location[0]. '/' . 
$values['id'] . '/' .$values['delete_file'][$i]);
                                                        }
                                                        else
                                                        {
-                                                               
$receipt['message'][]=array('msg'=>lang('file deleted') . ' :'. 
$this->fakebase. SEP . $this->category_dir . SEP . $location[0]. SEP . 
$values['id'] . SEP . $values['delete_file'][$i]);
+                                                               
$receipt['message'][]=array('msg'=>lang('file deleted') . ' :'. 
$this->fakebase. '/' . $this->category_dir . '/' . $location[0]. '/' . 
$values['id'] . '/' . $values['delete_file'][$i]);
                                                        }
                                                        
$this->vfs->override_acl = 0;
                                                }
@@ -591,14 +458,14 @@
                        }
 
                        $acl_location = '.entity.' . $entity_id . '.' . $cat_id;
-                       $custom_functions = 
$this->soadmin_entity->read_custom_function(array('acl_location' => 
$acl_location,'allrows'=>True));
+                       $custom_functions = 
$this->custom->read_custom_function(array('appname'=>'property','location' => 
$acl_location,'allrows'=>True));
 
                        if (isSet($custom_functions) AND 
is_array($custom_functions))
                        {
                                foreach($custom_functions as $entry)
                                {
-                                       if (is_file(PHPGW_APP_INC . SEP . 
'custom' . SEP . $entry['file_name']) && $entry['active'])
-                                       include (PHPGW_APP_INC . SEP . 'custom' 
. SEP . $entry['file_name']);
+                                       if (is_file(PHPGW_APP_INC . '/' . 
'custom' . '/' . $entry['file_name']) && $entry['active'])
+                                       include (PHPGW_APP_INC . '/' . 'custom' 
. '/' . $entry['file_name']);
                                }
                        }
                        return $receipt;

Modified: trunk/property/inc/class.bogab.inc.php
===================================================================
--- trunk/property/inc/class.bogab.inc.php      2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.bogab.inc.php      2008-02-02 13:52:39 UTC (rev 
18466)
@@ -52,7 +52,7 @@
 
                function property_bogab($session=False)
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->bocommon         = 
CreateObject('property.bocommon');
                        $this->solocation       = 
CreateObject('property.solocation');
                        $this->config           = 
CreateObject('phpgwapi.config');
@@ -125,13 +125,13 @@
 
                        //_debug_array($data);
 
-                       $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'];
+                       $this->start    = isset($data['start']) ? 
$data['start'] : '';
+                       $this->query    = isset($data['query']) ? 
$data['query'] : '';
+                       $this->filter   = isset($data['filter']) ? 
$data['filter'] : '';
+                       $this->sort             = isset($data['sort']) ? 
$data['sort'] : '';
+                       $this->order    = isset($data['order']) ? 
$data['order'] : '';
+                       $this->cat_id   = isset($data['cat_id']) ? 
$data['cat_id'] : '';
+                       $this->allrows  = isset($data['allrows']) ? 
$data['allrows'] : '';
                }
 
 

Modified: trunk/property/inc/class.boifc.inc.php
===================================================================
--- trunk/property/inc/class.boifc.inc.php      2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.boifc.inc.php      2008-02-02 13:52:39 UTC (rev 
18466)
@@ -53,7 +53,7 @@
 
                function boifc($session=False)
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
        //              $this->so                       = 
CreateObject('property.soifc');
                        $this->custom           = 
createObject('phpgwapi.custom_fields');
                        $this->acl_location     = '.ifc';
@@ -193,7 +193,7 @@
                */
                function read2()
                {
-                       $custom_attributes = 
$this->custom->get_attribs($this->currentapp, $this->acl_location, 0, '', 
'ASC', 'attrib_sort', true, true);
+                       $custom_attributes = 
$this->custom->get_attribs('property', $this->acl_location, 0, '', 'ASC', 
'attrib_sort', true, true);
                        
                        $ifc_info = $this->so->read2(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
                                                                                
        
'cat_id'=>$this->cat_id,'allrows'=>$this->allrows,'filter'=>$this->filter,
@@ -205,14 +205,14 @@
 
                function read_single($id='')
                {
-                       $values['attributes'] = 
$this->custom->get_attribs($this->currentapp, $this->acl_location, 0, '', 
'ASC', 'attrib_sort', true, true);
+                       $values['attributes'] = 
$this->custom->get_attribs('property', $this->acl_location, 0, '', 'ASC', 
'attrib_sort', true, true);
                        
                        if($id)
                        {
                                $values = $this->so->read_single($id,$values);
                        }
                        
-                       $values = 
$this->custom->prepare_attributes($values,$appname=$this->currentapp, 
$location=$this->acl_location);
+                       $values = 
$this->custom->prepare_attributes($values,$appname='property', 
$location=$this->acl_location);
                        
                        $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
                        if(isset($values['entry_date']) && 
$values['entry_date'])
@@ -260,14 +260,16 @@
                                $receipt = 
$this->so->add($values,$values_attribute);
                        }
 
-                       $custom_functions = 
$this->custom->read_custom_function(array('appname'=>$this->currentapp,'location'
 => $this->acl_location,'allrows'=>True));
+                       $custom_functions = 
$this->custom->read_custom_function(array('appname'=>'property','location' => 
$this->acl_location,'allrows'=>True));
 
                        if (isSet($custom_functions) AND 
is_array($custom_functions))
                        {
                                foreach($custom_functions as $entry)
                                {
-                                       if (is_file(PHPGW_APP_INC . SEP . 
'custom' . SEP . $entry['file_name']) && $entry['active'])
-                                       include (PHPGW_APP_INC . SEP . 'custom' 
. SEP . $entry['file_name']);
+                                       if (is_file(PHPGW_APP_INC . 
"/custom/{$entry['file_name']}") && $entry['active'])
+                                       {
+                                               include_once(PHPGW_APP_INC . 
"/custom/{$entry['file_name']}");
+                                       }
                                }
                        }
 

Modified: trunk/property/inc/class.boinvestment.inc.php
===================================================================
--- trunk/property/inc/class.boinvestment.inc.php       2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/inc/class.boinvestment.inc.php       2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -72,7 +72,7 @@
 
                function property_boinvestment($session=False)
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->so               = 
CreateObject('property.soinvestment');
                        $this->bocommon = CreateObject('property.bocommon');
                        $this->socommon = CreateObject('property.socommon');

Modified: trunk/property/inc/class.boinvoice.inc.php
===================================================================
--- trunk/property/inc/class.boinvoice.inc.php  2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.boinvoice.inc.php  2008-02-02 13:52:39 UTC (rev 
18466)
@@ -39,7 +39,7 @@
                function property_boinvoice($session=False)
                {
                        $this->db               = $GLOBALS['phpgw']->db;
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->so               = 
CreateObject('property.soinvoice',True);
                        $this->bocommon         = 
CreateObject('property.bocommon');
                        $this->account_id       = 
$GLOBALS['phpgw_info']['user']['account_id'];

Modified: trunk/property/inc/class.bolocation.inc.php
===================================================================
--- trunk/property/inc/class.bolocation.inc.php 2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.bolocation.inc.php 2008-02-02 13:52:39 UTC (rev 
18466)
@@ -74,12 +74,14 @@
 
                function property_bolocation($session=False)
                {
-                       $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->so                                       = 
CreateObject('property.solocation');
                        $this->bocommon                         = 
CreateObject('property.bocommon');
                        $this->soadmin_location         = 
CreateObject('property.soadmin_location');
+                       $this->custom                           = 
createObject('phpgwapi.custom_fields');
 
                        $this->lookup   = phpgw::get_var('lookup', 'bool');
+
                        if ($session && !$this->lookup)
                        {
                                $this->read_sessiondata();
@@ -140,14 +142,11 @@
 
                function column_list($selected='',$type_id='',$allrows='')
                {
-                       $soadmin_location       = 
CreateObject('property.soadmin_location');
-
                        if(!$selected)
                        {
-                               $selected = 
isset($GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]["location_columns_"
 . $this->type_id]) ? 
$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]["location_columns_"
 . $this->type_id]:'';
+                               $selected = 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['location_columns_'
 . $this->type_id . !!$this->lookup]) ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']["location_columns_" . 
$this->type_id . !!$this->lookup]:'';
                        }
-
-                       $columns = 
$soadmin_location->read_attrib(array('type_id'=>$type_id,'allrows'=>$allrows,'filter_list'
 =>true));
+                       $columns = 
$this->custom->get_attribs('property','.location.' . $type_id, 0, 
'','','',true);
                        
$column_list=$this->bocommon->select_multi_list($selected,$columns);
                        return $column_list;
                }
@@ -226,7 +225,7 @@
                                }
                        }
 
-                       $location_link          = "menuaction:'". 
$this->currentapp.".uilocation.index',lookup:1";
+                       $location_link          = "menuaction:'". 
'property'.".uilocation.index',lookup:1";
 
                        $config = $this->soadmin_location->read_config('');
 
@@ -241,7 +240,11 @@
                        }
 //_debug_array($data);
 //_debug_array($location_types);
-                       $fm_location_cols = 
$this->soadmin_location->read_attrib(array('type_id'=>$data['type_id'],'lookup_type'=>$data['type_id']));
+//                     $filtermethod = " OR (type_id < $lookup_type AND 
lookup_form=1)";
+                       $filtermethod = " OR (lookup_form=1)";
+                       $fm_location_cols = 
$this->custom->get_attribs('property', '.location.' . $data['type_id'], 0, '', 
'', '', true,$filtermethod);
+
+
 //_debug_array($fm_location_cols);
 
                        for ($i=0;$i<$data['type_id'];$i++)
@@ -310,6 +313,7 @@
                        $location_cols_count =count($fm_location_cols);
                        for ($j=0;$j<$location_cols_count;$j++)
                        {
+                               //FIXME: location_type is currently empty - 
should'nt be...
                                if(($fm_location_cols[$j]['location_type'] <= 
$data['type_id']) && $fm_location_cols[$j]['lookup_form'])
                                {
                                        $location['location'][$i]['input_type'] 
                        = 'text';
@@ -431,7 +435,7 @@
                                        $m++;
 
                                        $lookup_functions[$m]['name'] = 
'lookup_entity_' . $entity['id'] .'()';
-                                       $lookup_functions[$m]['link'] = 
"menuaction:'". 
$this->currentapp.".uilookup.entity',location_type:".$data['type_id'] . 
',entity_id:'. $entity['id'];
+                                       $lookup_functions[$m]['link'] = 
"menuaction:'". 'property'.".uilookup.entity',location_type:".$data['type_id'] 
. ',entity_id:'. $entity['id'];
                                        $lookup_functions[$m]['action'] = 
'Window1=window.open(strURL,"Search","width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");';
 
                                        $location['location'][$i]['input_type'] 
                                        = 'text';
@@ -487,13 +491,13 @@
 //_debug_array($location['location']);
                        if(isset($input_name))
                        {
-                               
$GLOBALS['phpgw']->session->appsession('lookup_fields',$this->currentapp,$input_name);
+                               
$GLOBALS['phpgw']->session->appsession('lookup_fields','property',$input_name);
                        }
                        if(isset($insert_record))
                        {
-                               
$GLOBALS['phpgw']->session->appsession('insert_record',$this->currentapp,$insert_record);
+                               
$GLOBALS['phpgw']->session->appsession('insert_record','property',$insert_record);
                        }
-//                     
$GLOBALS['phpgw']->session->appsession('input_name',$this->currentapp,$input_name);
+//                     
$GLOBALS['phpgw']->session->appsession('input_name','property',$input_name);
 
 
                        if(isset($lookup_functions) && 
is_array($lookup_functions))
@@ -517,7 +521,7 @@
                                        $lookup_name[] = 
$location['location'][$i]['name'];
                                }
 
-                               
$GLOBALS['phpgw']->session->appsession('lookup_name',$this->currentapp,$lookup_name);
+                               
$GLOBALS['phpgw']->session->appsession('lookup_name','property',$lookup_name);
 
                                return $location;
                        }
@@ -536,8 +540,48 @@
                        return $location;
                }
 
-               function read_single($location_code='',$extra='')
+               function read_single($location_code='',$extra=array())
                {
+                       $location_array = split('-',$location_code);
+                       $type_id= count($location_array);
+
+                       if (!$type_id)
+                       {
+                               return;
+                       }
+
+                       $values['attributes'] = 
$this->custom->get_attribs('property','.location.' . $type_id, 0, '', 'ASC', 
'attrib_sort', true, true);
+                       $values = $this->so->read_single($location_code, 
$values);
+                       $values = $this->custom->prepare_attributes($values, 
'property','.location.' . $type_id, $extra['view']);
+
+                       if( isset($extra['tenant_id']) && 
$extra['tenant_id']!='lookup')
+                       {
+                               if($extra['tenant_id']>0)
+                               {
+                                       
$tenant_data=$this->bocommon->read_single_tenant($extra['tenant_id']);
+                                       $values['tenant_id']            = 
$extra['tenant_id'];
+                                       $values['contact_phone']        = 
$extra['contact_phone']?$extra['contact_phone']:$tenant_data['contact_phone'];
+                                       $values['last_name']            = 
$tenant_data['last_name'];
+                                       $values['first_name']   = 
$tenant_data['first_name'];
+                               }
+                               else
+                               {
+                                       unset($values['tenant_id']);
+                                       unset($values['contact_phone']);
+                                       unset($values['last_name']);
+                                       unset($values['first_name']);
+                               }
+                       }
+
+                       if(is_array($extra))
+                       {
+                               $values = $values + $extra;
+                       }
+                       return $values;
+               }
+
+               function read_single_old($location_code='',$extra='')
+               {
                        $location_data = $this->so->read_single($location_code);
 
                        if( isset($extra['tenant_id']) && 
$extra['tenant_id']!='lookup')
@@ -574,32 +618,9 @@
 
                function 
save($location,$values_attribute,$action='',$type_id='',$location_code_parent='')
                {
-                       $m=count($values_attribute);
-                       for ($i=0;$i<$m;$i++)
-                       {
-                               if($values_attribute[$i]['datatype']=='AB' || 
$values_attribute[$i]['datatype']=='VENDOR')
+                       if(is_array($values_attribute))
                                {
-                                       $values_attribute[$i]['value'] = 
$_POST[$values_attribute[$i]['name']];
-                               }
-                               if($values_attribute[$i]['datatype']=='CH' && 
$values_attribute[$i]['value'])
-                               {
-                                       $values_attribute[$i]['value'] = 
serialize($values_attribute[$i]['value']);
-                               }
-                               if($values_attribute[$i]['datatype']=='R' && 
$values_attribute[$i]['value'])
-                               {
-                                       $values_attribute[$i]['value'] = 
$values_attribute[$i]['value'][0];
-                               }
-
-                               if($values_attribute[$i]['datatype']=='N' && 
$values_attribute[$i]['value'])
-                               {
-                                       $values_attribute[$i]['value'] = 
str_replace(",",".",$values_attribute[$i]['value']);
-                               }
-
-                               if($values_attribute[$i]['datatype']=='D' && 
$values_attribute[$i]['value'])
-                               {
-
-                                       $values_attribute[$i]['value'] = 
date($this->bocommon->dateformat,$this->bocommon->date_to_timestamp($values_attribute[$i]['value']));
-                               }
+                               $values_attribute = 
$this->custom->convert_attribute_save($values_attribute);
                        }
 
                        if ($action=='edit')
@@ -615,31 +636,23 @@
                        }
                        else
                        {
-
-/*                             if($type_id>1)
-                               {
-                                       
if(!$this->so->check_location($location_code_parent,($type_id-1)))
-                                       {
-                                               
$receipt['error'][]=array('msg'=>lang('This location parent ID does not 
exist!'));
-                                       }
-                               }
-*/
                                if(!$receipt['error'])
                                {
                                        $receipt = 
$this->so->add($location,$values_attribute,$type_id);
                                }
                        }
 
+                       $acl_location = '.location.' . $type_id;
+                       $custom_functions = 
$this->custom->read_custom_function(array('appname'=>'property','location' => 
$acl_location,'allrows'=>True));
 
-                       $soadmin_custom = 
CreateObject('property.soadmin_custom');
-                       $custom_functions = 
$soadmin_custom->read(array('acl_location' => 
$this->acl_location,'allrows'=>True));
-
                        if (isSet($custom_functions) AND 
is_array($custom_functions))
                        {
                                foreach($custom_functions as $entry)
                                {
-                                       if (is_file(PHPGW_APP_INC . SEP . 
'custom' . SEP . $entry['file_name']) && $entry['active'])
-                                       include (PHPGW_APP_INC . SEP . 'custom' 
. SEP . $entry['file_name']);
+                                       if (is_file(PHPGW_APP_INC . 
"/custom/{$entry['file_name']}") && $entry['active'])
+                                       {
+                                               include_once (PHPGW_APP_INC . 
"/custom/{$entry['file_name']}");
+                                       }
                                }
                        }
 

Modified: trunk/property/inc/class.bolookup.inc.php
===================================================================
--- trunk/property/inc/class.bolookup.inc.php   2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.bolookup.inc.php   2008-02-02 13:52:39 UTC (rev 
18466)
@@ -71,7 +71,7 @@
 
                function property_bolookup($session=False)
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->so               = 
CreateObject('property.solookup');
                        $this->solocation = CreateObject('property.solocation');
 

Modified: trunk/property/inc/class.bop_of_town.inc.php
===================================================================
--- trunk/property/inc/class.bop_of_town.inc.php        2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/inc/class.bop_of_town.inc.php        2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -71,7 +71,7 @@
 
                function property_bop_of_town($session=False)
                {
-                       $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->so = CreateObject('property.sop_of_town');
 
                        if ($session)

Modified: trunk/property/inc/class.bopricebook.inc.php
===================================================================
--- trunk/property/inc/class.bopricebook.inc.php        2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/inc/class.bopricebook.inc.php        2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -71,7 +71,7 @@
 
                function property_bopricebook($session=False)
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->so               = 
CreateObject('property.sopricebook');
                        $this->socommon = CreateObject('property.socommon');
                        $this->bocommon = CreateObject('property.bocommon');

Modified: trunk/property/inc/class.boproject.inc.php
===================================================================
--- trunk/property/inc/class.boproject.inc.php  2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.boproject.inc.php  2008-02-02 13:52:39 UTC (rev 
18466)
@@ -52,7 +52,7 @@
 
                function property_boproject($session=False)
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->so                       = 
CreateObject('property.soproject');
                        $this->bocommon         = 
CreateObject('property.bocommon');
                        $this->solocation = CreateObject('property.solocation');
@@ -258,6 +258,7 @@
                        $sum_workorder_calculation = 0;
                        $sum_workorder_actual_cost = 0;
 
+                       $custom                 = 
createObject('phpgwapi.custom_fields');
                        for ($i=0;$i<count($workorder_data);$i++)
                        {
                                $sum_workorder_budget= 
$sum_workorder_budget+$workorder_data[$i]['budget'];
@@ -270,9 +271,12 @@
                                
$project['workorder_budget'][$i]['calculation']=number_format($workorder_data[$i]['calculation']*$tax,
 2, ',', '');
                                
$project['workorder_budget'][$i]['charge_tenant'] = 
$workorder_data[$i]['charge_tenant'];
                                $project['workorder_budget'][$i]['status'] = 
$workorder_data[$i]['status'];
-                               $vendor = 
$contacts->read_single(array('actor_id'=>(int)$workorder_data[$i]['vendor_id']));
-                               if(is_array($vendor))
+
+                               if(isset($workorder_data[$i]['vendor_id']) && 
$workorder_data[$i]['vendor_id'])
                                {
+                                       $vendor['attributes'] = 
$custom->get_attribs('property','.vendor', 0, '', 'ASC', 'attrib_sort', true, 
true);
+
+                                       $vendor = 
$contacts->read_single($workorder_data[$i]['vendor_id'], $vendor);
                                        foreach($vendor['attributes'] as 
$attribute)
                                        {
                                                
if($attribute['name']=='org_name')

Modified: trunk/property/inc/class.bor_agreement.inc.php
===================================================================
--- trunk/property/inc/class.bor_agreement.inc.php      2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/inc/class.bor_agreement.inc.php      2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -54,9 +54,10 @@
 
                function property_bor_agreement($session=False)
                {
-                       $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->so = CreateObject('property.sor_agreement');
                        $this->bocommon = CreateObject('property.bocommon');
+                       $this->custom           = 
createObject('phpgwapi.custom_fields');
                        $this->vfs                      = 
CreateObject('phpgwapi.vfs');
                        $this->rootdir          = $this->vfs->basedir;
                        $this->fakebase         = $this->vfs->fakebase;
@@ -271,206 +272,67 @@
 
                function read_single($data)
                {
-                       $r_agreement    = $this->so->read_single($data);
-                       $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
-                       $r_agreement['start_date']              = 
$GLOBALS['phpgw']->common->show_date($r_agreement['start_date'],$dateformat);
-                       $r_agreement['end_date']                = 
$GLOBALS['phpgw']->common->show_date($r_agreement['end_date'],$dateformat);
-                       if($r_agreement['termination_date'])
-                       {
-                               $r_agreement['termination_date']= 
$GLOBALS['phpgw']->common->show_date($r_agreement['termination_date'],$dateformat);
-                       }
 
-                       $r_agreement = $this->convert_attribute($r_agreement);
+                       $values['attributes'] = 
$this->custom->get_attribs('property', '.r_agreement', 0, '', 'ASC', 
'attrib_sort', true, true);
 
-                       $this->vfs->override_acl = 1;
-
-                       $r_agreement['files'] = $this->vfs->ls (array(
-                            'string' => $this->fakebase. '/' . 
'rental_agreement' .  '/' . $data['r_agreement_id'],
-                            'relatives' => array(RELATIVE_NONE)));
-
-                       $this->vfs->override_acl = 0;
-
-                       if(!$r_agreement['files'][0]['file_id'])
+                       if(isset($data['r_agreement_id']) && 
$data['r_agreement_id'])
                        {
-                               unset($r_agreement['files']);
-                       }
-
-                       return $r_agreement;
-
+                               $values = 
$this->so->read_single($data['r_agreement_id'], $values);
                }
 
-               function read_single_item($data)
-               {
-                       $item   = $this->so->read_single_item($data);
-//_debug_array($item);
-                       $item   = $this->convert_attribute($item,True);
+                       $values = $this->custom->prepare_attributes($values, 
'property', '.r_agreement', $data['view']);
 
-                       if($item['location_code'])
-                       {
-                               $solocation     = 
CreateObject('property.solocation');
-                               $item['location_data'] 
=$solocation->read_single($item['location_code']);
-                       }
-
-                       if($item['p_num'])
-                       {
-                               $soadmin_entity = 
CreateObject('property.soadmin_entity');
-                               $category = 
$soadmin_entity->read_single_category($item['p_entity_id'],$item['p_cat_id']);
-
-                               
$item['p'][$item['p_entity_id']]['p_num']=$item['p_num'];
-                               
$item['p'][$item['p_entity_id']]['p_entity_id']=$item['p_entity_id'];
-                               
$item['p'][$item['p_entity_id']]['p_cat_id']=$item['p_cat_id'];
-                               $item['p'][$item['p_entity_id']]['p_cat_name'] 
= $category['name'];
-                       }
-
-                       return $item;
-               }
-
-               function convert_attribute($list,$detail='')
-               {
-                       if($detail)
-                       {
-                               $this->so->role = 'detail';
-                       }
-                       $contacts                       = 
CreateObject('phpgwapi.contacts');
-
-                       $vendor = CreateObject('property.soactor');
-                       $vendor->role = 'vendor';
-
                        $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
-
-                       $input_type_array = array(
-                               'R' => 'radio',
-                               'CH' => 'checkbox',
-                               'LB' => 'listbox'
-                       );
-
-                       $sep = '/';
-                       $dlarr[strpos($dateformat,'Y')] = 'Y';
-                       $dlarr[strpos($dateformat,'m')] = 'm';
-                       $dlarr[strpos($dateformat,'d')] = 'd';
-                       ksort($dlarr);
-
-                       $dateformat= (implode($sep,$dlarr));
-
-//html_print_r($list);
-                       $m=0;
-                       for ($i=0;$i<count($list['attributes']);$i++)
+                       $values['start_date']           = 
$GLOBALS['phpgw']->common->show_date($values['start_date'],$dateformat);
+                       $values['end_date']             = 
$GLOBALS['phpgw']->common->show_date($values['end_date'],$dateformat);
+                       if($values['termination_date'])
                        {
-                               if($list['attributes'][$i]['datatype']=='D' && 
$list['attributes'][$i]['value'])
-                               {
-                                       $timestamp_date= 
mktime(0,0,0,date(m,strtotime($list['attributes'][$i]['value'])),date(d,strtotime($list['attributes'][$i]['value'])),date(y,strtotime($list['attributes'][$i]['value'])));
-                                       $list['attributes'][$i]['value']        
= $GLOBALS['phpgw']->common->show_date($timestamp_date,$dateformat);
+                               $values['termination_date']= 
$GLOBALS['phpgw']->common->show_date($values['termination_date'],$dateformat);
                                }
-                               if($list['attributes'][$i]['datatype']=='AB')
-                               {
-                                       if($list['attributes'][$i]['value'])
-                                       {
-                                               $contact_data   = 
$contacts->read_single_entry($list['attributes'][$i]['value'],array('n_given'=>'n_given','n_family'=>'n_family','email'=>'email'));
-                                               
$list['attributes'][$i]['contact_name'] = $contact_data[0]['n_family'] . ', ' . 
$contact_data[0]['n_given'];
-                                       }
 
-                                       $insert_record_list[]   = 
$list['attributes'][$i]['name'];
-                                       $lookup_link            = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uilookup.addressbook&column='
 . $list['attributes'][$i]['name']);
+                       $this->vfs->override_acl = 1;
 
-                                       $lookup_functions[$m]['name'] = 
'lookup_'. $list['attributes'][$i]['name'] .'()';
-                                       $lookup_functions[$m]['action'] = 
'Window1=window.open('."'" . $lookup_link ."'" 
.',"Search","width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");';
-                                       $m++;
-                               }
-                               
if($list['attributes'][$i]['datatype']=='VENDOR')
-                               {
-                                       if($list['attributes'][$i]['value'])
-                                       {
-                                               $vendor_data    = 
$vendor->read_single(array('actor_id'=>$list['attributes'][$i]['value']));
+                       $values['files'] = $this->vfs->ls (array(
+                            'string' => $this->fakebase. '/' . 
'rental_agreement' .  '/' . $data['r_agreement_id'],
+                            'relatives' => array(RELATIVE_NONE)));
 
-                                               for 
($n=0;$n<count($vendor_data['attributes']);$n++)
-                                               {
-                                                       
if($vendor_data['attributes'][$n]['name'] == 'org_name')
-                                                       {
-                                                               
$list['attributes'][$i]['vendor_name']= $vendor_data['attributes'][$n]['value'];
-                                                               $n 
=count($vendor_data['attributes']);
-                                                       }
-                                               }
-                                       }
+                       $this->vfs->override_acl = 0;
 
-                                       $insert_record_list[]   = 
$list['attributes'][$i]['name'];
-                                       $lookup_link            = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uilookup.vendor&column='
 . $list['attributes'][$i]['name']);
-
-                                       $lookup_functions[$m]['name'] = 
'lookup_'. $list['attributes'][$i]['name'] .'()';
-                                       $lookup_functions[$m]['action'] = 
'Window1=window.open('."'" . $lookup_link ."'" 
.',"Search","width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");';
-                                       $m++;
-                               }
-                               if($list['attributes'][$i]['datatype']=='R' || 
$list['attributes'][$i]['datatype']=='CH' || 
$list['attributes'][$i]['datatype']=='LB')
-                               {
-                                       $list['attributes'][$i]['choice']       
= $this->so->read_attrib_choice($list['attributes'][$i]['attrib_id']);
-                                       
$input_type=$input_type_array[$list['attributes'][$i]['datatype']];
-
-                                       
if($list['attributes'][$i]['datatype']=='CH')
+                       if(!$values['files'][0]['file_id'])
                                        {
-                                               
$list['attributes'][$i]['value']=unserialize($list['attributes'][$i]['value']);
-                                               
$list['attributes'][$i]['choice'] = 
$this->bocommon->select_multi_list_2($list['attributes'][$i]['value'],$list['attributes'][$i]['choice'],$input_type);
-
-                                       }
-                                       else
-                                       {
-                                               for 
($j=0;$j<count($list['attributes'][$i]['choice']);$j++)
-                                               {
-                                                       
$list['attributes'][$i]['choice'][$j]['input_type']=$input_type;
-                                                       
if($list['attributes'][$i]['choice'][$j]['id']==$list['attributes'][$i]['value'])
-                                                       {
-                                                               
$list['attributes'][$i]['choice'][$j]['checked']='checked';
-                                                       }
-                                               }
-                                       }
+                               unset($values['files']);
                                }
 
-                               $list['attributes'][$i]['datatype_text'] = 
$this->bocommon->translate_datatype($list['attributes'][$i]['datatype']);
-                               $list['attributes'][$i]['counter']      = $i;
-                               $list['attributes'][$i]['type_id']      = 
$data['type_id'];
+                       return $values;
                        }
 
-                       for ($j=0;$j<count($lookup_functions);$j++)
+               function read_single_item($data)
                        {
-                               $list['lookup_functions'] .= 'function ' . 
$lookup_functions[$j]['name'] ."\r\n";
-                               $list['lookup_functions'] .= '{'."\r\n";
-                               $list['lookup_functions'] .= 
$lookup_functions[$j]['action'] ."\r\n";
-                               $list['lookup_functions'] .= '}'."\r\n";
-                       }
+                       $values['attributes'] = 
$this->custom->get_attribs('property', '.r_agreement.detail', 0, '', 'ASC', 
'attrib_sort', true, true);
 
-                       
$GLOBALS['phpgw']->session->appsession('insert_record_r_agreement' . 
!!$detail,$this->currentapp,$insert_record_list);
-
-//html_print_r($list);
-                       return $list;
-
-               }
-
-               function convert_attribute_save($values_attribute='')
-               {
-                       if(is_array($values_attribute))
+                       if(isset($data['r_agreement_id']) && 
$data['r_agreement_id'] && isset($data['id']) && $data['id'])
                        {
-                               for ($i=0;$i<count($values_attribute);$i++)
-                               {
-                                       
if($values_attribute[$i]['datatype']=='CH' && $values_attribute[$i]['value'])
-                                       {
-                                               $values_attribute[$i]['value'] 
= serialize($values_attribute[$i]['value']);
+                               $values = $this->so->read_single_item($data, 
$values);
                                        }
-                                       
if($values_attribute[$i]['datatype']=='R' && $values_attribute[$i]['value'])
-                                       {
-                                               $values_attribute[$i]['value'] 
= $values_attribute[$i]['value'][0];
-                                       }
+                       $values = $this->custom->prepare_attributes($values, 
'property', '.r_agreement.detail');
 
-                                       
if($values_attribute[$i]['datatype']=='N' && $values_attribute[$i]['value'])
+                       if($values['location_code'])
                                        {
-                                               $values_attribute[$i]['value'] 
= str_replace(",",".",$values_attribute[$i]['value']);
+                               $solocation     = 
CreateObject('property.solocation');
+                               $values['location_data'] 
=$solocation->read_single($values['location_code']);
                                        }
 
-                                       
if($values_attribute[$i]['datatype']=='D' && $values_attribute[$i]['value'])
+                       if($values['p_num'])
                                        {
-                                               $values_attribute[$i]['value'] 
= 
date($this->bocommon->dateformat,$this->bocommon->date_to_timestamp($values_attribute[$i]['value']));
-                                       }
-                               }
-                       }
+                               $soadmin_entity = 
CreateObject('property.soadmin_entity');
+                               $category = 
$soadmin_entity->read_single_category($values['p_entity_id'],$values['p_cat_id']);
 
-                       return $values_attribute;
+                               
$values['p'][$values['p_entity_id']]['p_num']=$values['p_num'];
+                               
$values['p'][$values['p_entity_id']]['p_entity_id']=$values['p_entity_id'];
+                               
$values['p'][$values['p_entity_id']]['p_cat_id']=$values['p_cat_id'];
+                               
$values['p'][$values['p_entity_id']]['p_cat_name'] = $category['name'];
+                       }
+                       return $values;
                }
 
                function save($values,$values_attribute='',$action='')
@@ -480,7 +342,10 @@
                        $values['end_date']     = 
$this->bocommon->date_to_timestamp($values['end_date']);
                        $values['termination_date']     = 
$this->bocommon->date_to_timestamp($values['termination_date']);
 
-                       $values_attribute = 
$this->convert_attribute_save($values_attribute);
+                       if(is_array($values_attribute))
+                       {
+                               $values_attribute = 
$this->custom->convert_attribute_save($values_attribute);
+                       }
 
                        if ($action=='edit')
 //                     if ($values['r_agreement_id'])
@@ -493,7 +358,7 @@
                                        {
                                                for 
($i=0;$i<count($values['delete_file']);$i++)
                                                {
-                                                       $file = 
$this->fakebase. SEP . 'rental_agreement' . SEP . $values['r_agreement_id'] . 
SEP . $values['delete_file'][$i];
+                                                       $file = 
$this->fakebase. '/' . 'rental_agreement' . '/' . $values['r_agreement_id'] . 
'/' . $values['delete_file'][$i];
 
                                                        
if($this->vfs->file_exists(array(
                                                                        
'string' => $file,
@@ -509,11 +374,11 @@
                                                                     )
                                                                )))
                                                                {
-                                                                       
$receipt['error'][]=array('msg'=>lang('failed to delete file') . ' :'. 
$this->fakebase. SEP . 'rental_agreement'. SEP . $values['r_agreement_id'] . 
SEP .$values['delete_file'][$i]);
+                                                                       
$receipt['error'][]=array('msg'=>lang('failed to delete file') . ' :'. 
$this->fakebase. '/' . 'rental_agreement'. '/' . $values['r_agreement_id'] . 
'/' .$values['delete_file'][$i]);
                                                                }
                                                                else
                                                                {
-                                                                       
$receipt['message'][]=array('msg'=>lang('file deleted') . ' :'. 
$this->fakebase. SEP . 'rental_agreement'. SEP . $values['id'] . SEP . 
$values['delete_file'][$i]);
+                                                                       
$receipt['message'][]=array('msg'=>lang('file deleted') . ' :'. 
$this->fakebase. '/' . 'rental_agreement'. '/' . $values['id'] . '/' . 
$values['delete_file'][$i]);
                                                                }
                                                                
$this->vfs->override_acl = 0;
                                                        }
@@ -551,7 +416,10 @@
 
                        $values['location_code'address@hidden("-", $location);
 
-                       $values_attribute = 
$this->convert_attribute_save($values_attribute);
+                       if(is_array($values_attribute))
+                       {
+                               $values_attribute = 
$this->custom->convert_attribute_save($values_attribute);
+                       }
 
                        if ($values['id'])
                        {
@@ -596,17 +464,10 @@
                        $this->so->delete_item($r_agreement_id,$item_id);
                }
 
-               function delete($r_agreement_id='',$id='',$attrib='')
-               {
-                       if ($attrib)
+               function delete($r_agreement_id='')
                        {
-                               $this->so->delete_attrib($id);
-                       }
-                       else
-                       {
                                $this->so->delete($r_agreement_id);
                        }
-               }
 
                function read_attrib($type_id='')
                {
@@ -623,44 +484,15 @@
                        return $attrib;
                }
 
-               function read_single_attrib($id)
-               {
-                       return $this->so->read_single_attrib($id);
-               }
 
-               function resort_attrib($data)
-               {
-                       $this->so->resort_attrib($data);
-               }
-
-               function save_attrib($attrib,$action='')
-               {
-                       if ($action=='edit')
-                       {
-                               if ($attrib['id'] != '')
-                               {
-
-                                       $receipt = 
$this->so->edit_attrib($attrib);
-                               }
-                       }
-                       else
-                       {
-                               $receipt = $this->so->add_attrib($attrib);
-                       }
-                       return $receipt;
-               }
-
                function column_list($selected='',$allrows='')
                {
                        if(!$selected)
                        {
-                               
$selected=$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]["r_agreement_columns"];
+                               
$selected=$GLOBALS['phpgw_info']['user']['preferences']['property']['r_agreement_columns'];
                        }
-
-                       $columns = 
$this->so->read_attrib(array('allrows'=>$allrows,'column_list'=>True));
-
+                       $columns = 
$this->custom->get_attribs('property','.r_agreement', 0, '','','',true);
                        
$column_list=$this->bocommon->select_multi_list($selected,$columns);
-
                        return $column_list;
                }
 
@@ -672,24 +504,24 @@
                function create_home_dir($receipt='')
                {
                        if(!$this->vfs->file_exists(array(
-                                       'string' => $this->fakebase. SEP . 
'rental_agreement',
+                                       'string' => $this->fakebase. '/' . 
'rental_agreement',
                                        'relatives' => Array(RELATIVE_NONE)
                                )))
                        {
                                $this->vfs->override_acl = 1;
 
                                if(!$this->vfs->mkdir (array(
-                                    'string' => $this->fakebase. SEP . 
'rental_agreement',
+                                    'string' => $this->fakebase. '/' . 
'rental_agreement',
                                     'relatives' => array(
                                          RELATIVE_NONE
                                     )
                                )))
                                {
-                                       
$receipt['error'][]=array('msg'=>lang('failed to create directory') . ' :'. 
$this->fakebase. SEP . 'rental_agreement');
+                                       
$receipt['error'][]=array('msg'=>lang('failed to create directory') . ' :'. 
$this->fakebase. '/' . 'rental_agreement');
                                }
                                else
                                {
-                                       
$receipt['message'][]=array('msg'=>lang('directory created') . ' :'. 
$this->fakebase. SEP . 'rental_agreement');
+                                       
$receipt['message'][]=array('msg'=>lang('directory created') . ' :'. 
$this->fakebase. '/' . 'rental_agreement');
                                }
                                $this->vfs->override_acl = 0;
                        }
@@ -701,23 +533,23 @@
                {
 
                        if(!$this->vfs->file_exists(array(
-                                       'string' => $this->fakebase. SEP . 
'rental_agreement' .  SEP . $id,
+                                       'string' => $this->fakebase. '/' . 
'rental_agreement' .  '/' . $id,
                                        'relatives' => Array(RELATIVE_NONE)
                                )))
                        {
                                $this->vfs->override_acl = 1;
                                if(!$this->vfs->mkdir (array(
-                                    'string' => $this->fakebase. SEP . 
'rental_agreement' .  SEP . $id,
+                                    'string' => $this->fakebase. '/' . 
'rental_agreement' .  '/' . $id,
                                     'relatives' => array(
                                          RELATIVE_NONE
                                     )
                                )))
                                {
-                                       
$receipt['error'][]=array('msg'=>lang('failed to create directory') . ' :'. 
$this->fakebase. SEP  . 'rental_agreement' .  SEP . $id);
+                                       
$receipt['error'][]=array('msg'=>lang('failed to create directory') . ' :'. 
$this->fakebase. '/'  . 'rental_agreement' .  '/' . $id);
                                }
                                else
                                {
-                                       
$receipt['message'][]=array('msg'=>lang('directory created') . ' :'. 
$this->fakebase. SEP . 'rental_agreement' .  SEP . $id);
+                                       
$receipt['message'][]=array('msg'=>lang('directory created') . ' :'. 
$this->fakebase. '/' . 'rental_agreement' .  '/' . $id);
                                }
                                $this->vfs->override_acl = 0;
                        }
@@ -819,7 +651,5 @@
                {
                        $this->so->delete_common_h($r_agreement_id,$c_id,$id);
                }
-
-
        }
 ?>

Modified: trunk/property/inc/class.borequest.inc.php
===================================================================
--- trunk/property/inc/class.borequest.inc.php  2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.borequest.inc.php  2008-02-02 13:52:39 UTC (rev 
18466)
@@ -52,7 +52,7 @@
 
                function property_borequest($session=False)
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->so                       = 
CreateObject('property.sorequest');
                        $this->bocommon         = 
CreateObject('property.bocommon');
                        $this->solocation       = 
CreateObject('property.solocation');
@@ -141,24 +141,24 @@
                function create_home_dir($receipt='')
                {
                        if(!$this->vfs->file_exists(array(
-                                       'string' => $this->fakebase. SEP . 
'request',
+                                       'string' => $this->fakebase. '/' . 
'request',
                                        'relatives' => Array(RELATIVE_NONE)
                                )))
                        {
                                $this->vfs->override_acl = 1;
 
                                if(!$this->vfs->mkdir (array(
-                                    'string' => $this->fakebase. SEP . 
'request',
+                                    'string' => $this->fakebase. '/' . 
'request',
                                     'relatives' => array(
                                          RELATIVE_NONE
                                     )
                                )))
                                {
-                                       
$receipt['error'][]=array('msg'=>lang('failed to create directory') . ' :'. 
$this->fakebase. SEP . 'request');
+                                       
$receipt['error'][]=array('msg'=>lang('failed to create directory') . ' :'. 
$this->fakebase. '/' . 'request');
                                }
                                else
                                {
-                                       
$receipt['message'][]=array('msg'=>lang('directory created') . ' :'. 
$this->fakebase. SEP . 'request');
+                                       
$receipt['message'][]=array('msg'=>lang('directory created') . ' :'. 
$this->fakebase. '/' . 'request');
                                }
                                $this->vfs->override_acl = 0;
                        }
@@ -169,46 +169,46 @@
                function create_document_dir($location_code='',$id='')
                {
                        if(!$this->vfs->file_exists(array(
-                                       'string' => $this->fakebase. SEP . 
'request' .  SEP . $location_code,
+                                       'string' => $this->fakebase. '/' . 
'request' .  '/' . $location_code,
                                        'relatives' => Array(RELATIVE_NONE)
                                )))
                        {
                                $this->vfs->override_acl = 1;
                                if(!$this->vfs->mkdir (array(
-                                    'string' => $this->fakebase. SEP . 
'request' .  SEP . $location_code,
+                                    'string' => $this->fakebase. '/' . 
'request' .  '/' . $location_code,
                                     'relatives' => array(
                                          RELATIVE_NONE
                                     )
                                )))
                                {
-                                       
$receipt['error'][]=array('msg'=>lang('failed to create directory') . ' :'. 
$this->fakebase. SEP . 'request' .  SEP . $location_code);
+                                       
$receipt['error'][]=array('msg'=>lang('failed to create directory') . ' :'. 
$this->fakebase. '/' . 'request' .  '/' . $location_code);
                                }
                                else
                                {
-                                       
$receipt['message'][]=array('msg'=>lang('directory created') . ' :'. 
$this->fakebase. SEP . 'request' .  SEP . $location_code);
+                                       
$receipt['message'][]=array('msg'=>lang('directory created') . ' :'. 
$this->fakebase. '/' . 'request' .  '/' . $location_code);
                                }
                                $this->vfs->override_acl = 0;
                        }
 
 
                        if(!$this->vfs->file_exists(array(
-                                       'string' => $this->fakebase. SEP . 
'request' .  SEP . $location_code .  SEP . $id,
+                                       'string' => $this->fakebase. '/' . 
'request' .  '/' . $location_code .  '/' . $id,
                                        'relatives' => Array(RELATIVE_NONE)
                                )))
                        {
                                $this->vfs->override_acl = 1;
                                if(!$this->vfs->mkdir (array(
-                                    'string' => $this->fakebase. SEP . 
'request' .  SEP . $location_code .  SEP . $id,
+                                    'string' => $this->fakebase. '/' . 
'request' .  '/' . $location_code .  '/' . $id,
                                     'relatives' => array(
                                          RELATIVE_NONE
                                     )
                                )))
                                {
-                                       
$receipt['error'][]=array('msg'=>lang('failed to create directory') . ' :'. 
$this->fakebase. SEP  . 'request'  .  SEP . $location_code .  SEP . $id);
+                                       
$receipt['error'][]=array('msg'=>lang('failed to create directory') . ' :'. 
$this->fakebase. '/'  . 'request'  .  '/' . $location_code .  '/' . $id);
                                }
                                else
                                {
-                                       
$receipt['message'][]=array('msg'=>lang('directory created') . ' :'. 
$this->fakebase. SEP . 'request' .  SEP . $location_code .  SEP . $id);
+                                       
$receipt['message'][]=array('msg'=>lang('directory created') . ' :'. 
$this->fakebase. '/' . 'request' .  '/' . $location_code .  '/' . $id);
                                }
                                $this->vfs->override_acl = 0;
                        }
@@ -226,7 +226,7 @@
                        }
                        else
                        {
-                               
$selected=$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp][$degreedefault_type];
+                               
$selected=$GLOBALS['phpgw_info']['user']['preferences']['property'][$degreedefault_type];
                        }
 
                        $degree_comment[0]=' - '.lang('None');
@@ -295,7 +295,7 @@
                        }
                        else
                        {
-                               
$selected=$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp][$consequencedefault_type];
+                               
$selected=$GLOBALS['phpgw_info']['user']['preferences']['property'][$consequencedefault_type];
                        }
 
                        $consequence_comment[0]=' - '.lang('None Consequences');
@@ -522,7 +522,7 @@
                                {
                                        for 
($i=0;$i<count($request['delete_file']);$i++)
                                        {
-                                               $file = $this->fakebase. SEP . 
'request' . SEP . $request['location_code'] . SEP . $request['request_id'] . 
SEP . $request['delete_file'][$i];
+                                               $file = $this->fakebase. '/' . 
'request' . '/' . $request['location_code'] . '/' . $request['request_id'] . 
'/' . $request['delete_file'][$i];
 
                                                
if($this->vfs->file_exists(array(
                                                                'string' => 
$file,
@@ -538,11 +538,11 @@
                                                             )
                                                        )))
                                                        {
-                                                               
$receipt['error'][]=array('msg'=>lang('failed to delete file') . ' :'. 
$this->fakebase. SEP . 'request' . SEP . $request['location_code']. SEP . 
$request['request_id'] . SEP .$request['delete_file'][$i]);
+                                                               
$receipt['error'][]=array('msg'=>lang('failed to delete file') . ' :'. 
$this->fakebase. '/' . 'request' . '/' . $request['location_code']. '/' . 
$request['request_id'] . '/' .$request['delete_file'][$i]);
                                                        }
                                                        else
                                                        {
-                                                               
$receipt['message'][]=array('msg'=>lang('file deleted') . ' :'. 
$this->fakebase. SEP . 'request' . SEP . $request['location_code']. SEP . 
$request['request_id'] . SEP . $request['delete_file'][$i]);
+                                                               
$receipt['message'][]=array('msg'=>lang('file deleted') . ' :'. 
$this->fakebase. '/' . 'request' . '/' . $request['location_code']. '/' . 
$request['request_id'] . '/' . $request['delete_file'][$i]);
                                                        }
                                                        
$this->vfs->override_acl = 0;
                                                }

Modified: trunk/property/inc/class.bos_agreement.inc.php
===================================================================
--- trunk/property/inc/class.bos_agreement.inc.php      2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/inc/class.bos_agreement.inc.php      2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -54,9 +54,9 @@
 
                function property_bos_agreement($session=False)
                {
-                       $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->so = CreateObject('property.sos_agreement');
                        $this->bocommon = CreateObject('property.bocommon');
+                       $this->custom           = 
createObject('phpgwapi.custom_fields');
                        $this->vfs                      = 
CreateObject('phpgwapi.vfs');
                        $this->rootdir          = $this->vfs->basedir;
                        $this->fakebase         = $this->vfs->fakebase;
@@ -243,206 +243,71 @@
 
                function read_single($data)
                {
-                       $s_agreement    = $this->so->read_single($data);
-                       $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
-                       $s_agreement['start_date']              = 
$GLOBALS['phpgw']->common->show_date($s_agreement['start_date'],$dateformat);
-                       $s_agreement['end_date']                = 
$GLOBALS['phpgw']->common->show_date($s_agreement['end_date'],$dateformat);
-                       if($s_agreement['termination_date'])
+                       $values['attributes'] = 
$this->custom->get_attribs('property', '.s_agreement', 0, '', 'ASC', 
'attrib_sort', true, true);
+                       
+                       if(isset($data['s_agreement_id']) && 
$data['s_agreement_id'])
                        {
-                               $s_agreement['termination_date']= 
$GLOBALS['phpgw']->common->show_date($s_agreement['termination_date'],$dateformat);
+                               $values = 
$this->so->read_single($data['s_agreement_id'], $values);
                        }
 
-                       $s_agreement = $this->convert_attribute($s_agreement);
+                       $values = $this->custom->prepare_attributes($values, 
'property', '.s_agreement', $data['view']);
 
+                       $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+                       $values['start_date']           = 
$GLOBALS['phpgw']->common->show_date($values['start_date'],$dateformat);
+                       $values['end_date']             = 
$GLOBALS['phpgw']->common->show_date($values['end_date'],$dateformat);
+                       if($values['termination_date'])
+                       {
+                               $values['termination_date']= 
$GLOBALS['phpgw']->common->show_date($values['termination_date'],$dateformat);
+                       }
+
                        $this->vfs->override_acl = 1;
 
-                       $s_agreement['files'] = $this->vfs->ls (array(
+                       $values['files'] = $this->vfs->ls (array(
                             'string' => $this->fakebase. '/' . 
'service_agreement' .  '/' . $data['s_agreement_id'],
                             'relatives' => array(RELATIVE_NONE)));
 
                        $this->vfs->override_acl = 0;
 
-                       if(!$s_agreement['files'][0]['file_id'])
+                       if(!$values['files'][0]['file_id'])
                        {
-                               unset($s_agreement['files']);
+                               unset($values['files']);
                        }
 
-                       return $s_agreement;
-
+                       return $values;
                }
 
                function read_single_item($data)
                {
-                       $item   = $this->so->read_single_item($data);
-//_debug_array($item);
-                       $item   = $this->convert_attribute($item,True);
+                       $values['attributes'] = 
$this->custom->get_attribs('property', '.s_agreement.detail', 0, '', 'ASC', 
'attrib_sort', true, true);
 
-                       if($item['location_code'])
+                       if(isset($data['s_agreement_id']) && 
$data['s_agreement_id'] && isset($data['id']) && $data['id'])
                        {
-                               $solocation     = 
CreateObject('property.solocation');
-                               $item['location_data'] 
=$solocation->read_single($item['location_code']);
+                               $values = $this->so->read_single_item($data, 
$values);
                        }
+                       $values = $this->custom->prepare_attributes($values, 
'property', '.s_agreement.detail');
 
-                       if($item['p_num'])
-                       {
-                               $soadmin_entity = 
CreateObject('property.soadmin_entity');
-                               $category = 
$soadmin_entity->read_single_category($item['p_entity_id'],$item['p_cat_id']);
+//_debug_array($item);
 
-                               
$item['p'][$item['p_entity_id']]['p_num']=$item['p_num'];
-                               
$item['p'][$item['p_entity_id']]['p_entity_id']=$item['p_entity_id'];
-                               
$item['p'][$item['p_entity_id']]['p_cat_id']=$item['p_cat_id'];
-                               $item['p'][$item['p_entity_id']]['p_cat_name'] 
= $category['name'];
-                       }
-
-                       return $item;
-               }
-
-               function convert_attribute($list,$detail='')
-               {
-                       if($detail)
-                       {
-                               $this->so->role = 'detail';
-                       }
-                       $contacts                       = 
CreateObject('phpgwapi.contacts');
-
-                       $vendor = CreateObject('property.soactor');
-                       $vendor->role = 'vendor';
-
-                       $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
-
-                       $input_type_array = array(
-                               'R' => 'radio',
-                               'CH' => 'checkbox',
-                               'LB' => 'listbox'
-                       );
-
-                       $sep = '/';
-                       $dlarr[strpos($dateformat,'Y')] = 'Y';
-                       $dlarr[strpos($dateformat,'m')] = 'm';
-                       $dlarr[strpos($dateformat,'d')] = 'd';
-                       ksort($dlarr);
-
-                       $dateformat= (implode($sep,$dlarr));
-
-//html_print_r($list);
-                       $m=0;
-                       for ($i=0;$i<count($list['attributes']);$i++)
-                       {
-                               if($list['attributes'][$i]['datatype']=='D' && 
$list['attributes'][$i]['value'])
+                       if($values['location_code'])
                                {
-                                       $timestamp_date= 
mktime(0,0,0,date(m,strtotime($list['attributes'][$i]['value'])),date(d,strtotime($list['attributes'][$i]['value'])),date(y,strtotime($list['attributes'][$i]['value'])));
-                                       $list['attributes'][$i]['value']        
= $GLOBALS['phpgw']->common->show_date($timestamp_date,$dateformat);
+                               $solocation     = 
CreateObject('property.solocation');
+                               $values['location_data'] 
=$solocation->read_single($values['location_code']);
                                }
-                               if($list['attributes'][$i]['datatype']=='AB')
-                               {
-                                       if($list['attributes'][$i]['value'])
-                                       {
-                                               $contact_data   = 
$contacts->read_single_entry($list['attributes'][$i]['value'],array('n_given'=>'n_given','n_family'=>'n_family','email'=>'email'));
-                                               
$list['attributes'][$i]['contact_name'] = $contact_data[0]['n_family'] . ', ' . 
$contact_data[0]['n_given'];
-                                       }
 
-                                       $insert_record_list[]   = 
$list['attributes'][$i]['name'];
-                                       $lookup_link            = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uilookup.addressbook&column='
 . $list['attributes'][$i]['name']);
-
-                                       $lookup_functions[$m]['name'] = 
'lookup_'. $list['attributes'][$i]['name'] .'()';
-                                       $lookup_functions[$m]['action'] = 
'Window1=window.open('."'" . $lookup_link ."'" 
.',"Search","width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");';
-                                       $m++;
-                               }
-                               
if($list['attributes'][$i]['datatype']=='VENDOR')
+                       if($values['p_num'])
                                {
-                                       if($list['attributes'][$i]['value'])
-                                       {
-                                               $vendor_data    = 
$vendor->read_single(array('actor_id'=>$list['attributes'][$i]['value']));
+                               $soadmin_entity = 
CreateObject('property.soadmin_entity');
+                               $category = 
$soadmin_entity->read_single_category($values['p_entity_id'],$values['p_cat_id']);
 
-                                               for 
($n=0;$n<count($vendor_data['attributes']);$n++)
-                                               {
-                                                       
if($vendor_data['attributes'][$n]['name'] == 'org_name')
-                                                       {
-                                                               
$list['attributes'][$i]['vendor_name']= $vendor_data['attributes'][$n]['value'];
-                                                               $n 
=count($vendor_data['attributes']);
-                                                       }
-                                               }
-                                       }
-
-                                       $insert_record_list[]   = 
$list['attributes'][$i]['name'];
-                                       $lookup_link            = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uilookup.vendor&column='
 . $list['attributes'][$i]['name']);
-
-                                       $lookup_functions[$m]['name'] = 
'lookup_'. $list['attributes'][$i]['name'] .'()';
-                                       $lookup_functions[$m]['action'] = 
'Window1=window.open('."'" . $lookup_link ."'" 
.',"Search","width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");';
-                                       $m++;
-                               }
-                               if($list['attributes'][$i]['datatype']=='R' || 
$list['attributes'][$i]['datatype']=='CH' || 
$list['attributes'][$i]['datatype']=='LB')
-                               {
-                                       $list['attributes'][$i]['choice']       
= $this->so->read_attrib_choice($list['attributes'][$i]['attrib_id']);
-                                       
$input_type=$input_type_array[$list['attributes'][$i]['datatype']];
-
-                                       
if($list['attributes'][$i]['datatype']=='CH')
-                                       {
-                                               
$list['attributes'][$i]['value']=unserialize($list['attributes'][$i]['value']);
-                                               
$list['attributes'][$i]['choice'] = 
$this->bocommon->select_multi_list_2($list['attributes'][$i]['value'],$list['attributes'][$i]['choice'],$input_type);
-
-                                       }
-                                       else
-                                       {
-                                               for 
($j=0;$j<count($list['attributes'][$i]['choice']);$j++)
-                                               {
-                                                       
$list['attributes'][$i]['choice'][$j]['input_type']=$input_type;
-                                                       
if($list['attributes'][$i]['choice'][$j]['id']==$list['attributes'][$i]['value'])
-                                                       {
-                                                               
$list['attributes'][$i]['choice'][$j]['checked']='checked';
-                                                       }
-                                               }
-                                       }
-                               }
-
-                               $list['attributes'][$i]['datatype_text'] = 
$this->bocommon->translate_datatype($list['attributes'][$i]['datatype']);
-                               $list['attributes'][$i]['counter']      = $i;
-                               $list['attributes'][$i]['type_id']      = 
$data['type_id'];
+                               
$values['p'][$values['p_entity_id']]['p_num']=$values['p_num'];
+                               
$values['p'][$values['p_entity_id']]['p_entity_id']=$values['p_entity_id'];
+                               
$values['p'][$values['p_entity_id']]['p_cat_id']=$values['p_cat_id'];
+                               
$values['p'][$values['p_entity_id']]['p_cat_name'] = $category['name'];
                        }
 
-                       for ($j=0;$j<count($lookup_functions);$j++)
-                       {
-                               $list['lookup_functions'] .= 'function ' . 
$lookup_functions[$j]['name'] ."\r\n";
-                               $list['lookup_functions'] .= '{'."\r\n";
-                               $list['lookup_functions'] .= 
$lookup_functions[$j]['action'] ."\r\n";
-                               $list['lookup_functions'] .= '}'."\r\n";
-                       }
-
-                       
$GLOBALS['phpgw']->session->appsession('insert_record_s_agreement' . 
!!$detail,$this->currentapp,$insert_record_list);
-
-//html_print_r($list);
-                       return $list;
-
+                       return $values;
                }
 
-               function convert_attribute_save($values_attribute='')
-               {
-
-                       for ($i=0;$i<count($values_attribute);$i++)
-                       {
-                               if($values_attribute[$i]['datatype']=='CH' && 
$values_attribute[$i]['value'])
-                               {
-                                       $values_attribute[$i]['value'] = 
serialize($values_attribute[$i]['value']);
-                               }
-                               if($values_attribute[$i]['datatype']=='R' && 
$values_attribute[$i]['value'])
-                               {
-                                       $values_attribute[$i]['value'] = 
$values_attribute[$i]['value'][0];
-                               }
-
-                               if($values_attribute[$i]['datatype']=='N' && 
$values_attribute[$i]['value'])
-                               {
-                                       $values_attribute[$i]['value'] = 
str_replace(",",".",$values_attribute[$i]['value']);
-                               }
-
-                               if($values_attribute[$i]['datatype']=='D' && 
$values_attribute[$i]['value'])
-                               {
-                                       $values_attribute[$i]['value'] = 
date($this->bocommon->dateformat,$this->bocommon->date_to_timestamp($values_attribute[$i]['value']));
-                               }
-                       }
-
-                       return $values_attribute;
-               }
-
                function save($values,$values_attribute='',$action='')
                {
 
@@ -450,9 +315,9 @@
                        $values['end_date']     = 
$this->bocommon->date_to_timestamp($values['end_date']);
                        $values['termination_date']     = 
$this->bocommon->date_to_timestamp($values['termination_date']);
 
-                       if (is_array($values_attribute))
+                       if(is_array($values_attribute))
                        {
-                               $values_attribute = 
$this->convert_attribute_save($values_attribute);
+                               $values_attribute = 
$this->custom->convert_attribute_save($values_attribute);
                        }
 
                        if ($action=='edit')
@@ -466,7 +331,7 @@
                                        {
                                                for 
($i=0;$i<count($values['delete_file']);$i++)
                                                {
-                                                       $file = 
$this->fakebase. SEP . 'service_agreement' . SEP . $values['s_agreement_id'] . 
SEP . $values['delete_file'][$i];
+                                                       $file = 
$this->fakebase. '/' . 'service_agreement' . '/' . $values['s_agreement_id'] . 
'/' . $values['delete_file'][$i];
 
                                                        
if($this->vfs->file_exists(array(
                                                                        
'string' => $file,
@@ -482,11 +347,11 @@
                                                                     )
                                                                )))
                                                                {
-                                                                       
$receipt['error'][]=array('msg'=>lang('failed to delete file') . ' :'. 
$this->fakebase. SEP . 'service_agreement'. SEP . $values['s_agreement_id'] . 
SEP .$values['delete_file'][$i]);
+                                                                       
$receipt['error'][]=array('msg'=>lang('failed to delete file') . ' :'. 
$this->fakebase. '/' . 'service_agreement'. '/' . $values['s_agreement_id'] . 
'/' .$values['delete_file'][$i]);
                                                                }
                                                                else
                                                                {
-                                                                       
$receipt['message'][]=array('msg'=>lang('file deleted') . ' :'. 
$this->fakebase. SEP . 'service_agreement'. SEP . $values['id'] . SEP . 
$values['delete_file'][$i]);
+                                                                       
$receipt['message'][]=array('msg'=>lang('file deleted') . ' :'. 
$this->fakebase. '/' . 'service_agreement'. '/' . $values['id'] . '/' . 
$values['delete_file'][$i]);
                                                                }
                                                                
$this->vfs->override_acl = 0;
                                                        }
@@ -516,7 +381,7 @@
 
                        if (is_array($values_attribute))
                        {
-                               $values_attribute = 
$this->convert_attribute_save($values_attribute);
+                               $values_attribute = 
$this->custom->convert_attribute_save($values_attribute);
                        }
 
                        if ($values['id'])
@@ -574,74 +439,24 @@
                        $this->so->delete_last_index($s_agreement_id,$id);
                }
 
-
                function delete_item($s_agreement_id,$item_id)
                {
                        $this->so->delete_item($s_agreement_id,$item_id);
                }
 
-               function delete($s_agreement_id='',$id='',$attrib='')
-               {
-                       if ($attrib)
+               function delete($s_agreement_id)
                        {
-                               $this->so->delete_attrib($id);
-                       }
-                       else
-                       {
                                $this->so->delete($s_agreement_id);
                        }
-               }
 
-               function read_attrib($type_id='')
-               {
-                       $attrib = $this->so->read_attrib(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
-                                                                               
        'allrows'=>$this->allrows));
-
-                       for ($i=0; $i<count($attrib); $i++)
-                       {
-                               $attrib[$i]['datatype'] = 
$this->bocommon->translate_datatype($attrib[$i]['datatype']);
-                       }
-
-                       $this->total_records = $this->so->total_records;
-
-                       return $attrib;
-               }
-
-               function read_single_attrib($id)
-               {
-                       return $this->so->read_single_attrib($id);
-               }
-
-               function resort_attrib($data)
-               {
-                       $this->so->resort_attrib($data);
-               }
-
-               function save_attrib($attrib,$action='')
-               {
-                       if ($action=='edit')
-                       {
-                               if ($attrib['id'] != '')
-                               {
-
-                                       $receipt = 
$this->so->edit_attrib($attrib);
-                               }
-                       }
-                       else
-                       {
-                               $receipt = $this->so->add_attrib($attrib);
-                       }
-                       return $receipt;
-               }
-
                function column_list($selected='',$allrows='')
                {
                        if(!$selected)
                        {
-                               
$selected=$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]["s_agreement_columns"];
+                               
$selected=$GLOBALS['phpgw_info']['user']['preferences']['property']['s_agreement_columns'];
                        }
 
-                       $columns = 
$this->so->read_attrib(array('allrows'=>$allrows,'column_list'=>True));
+                       $columns = 
$this->custom->get_attribs('property','.s_agreement', 0, '','','',true);
 
                        
$column_list=$this->bocommon->select_multi_list($selected,$columns);
 
@@ -656,24 +471,24 @@
                function create_home_dir($receipt='')
                {
                        if(!$this->vfs->file_exists(array(
-                                       'string' => $this->fakebase. SEP . 
'service_agreement',
+                                       'string' => $this->fakebase. '/' . 
'service_agreement',
                                        'relatives' => Array(RELATIVE_NONE)
                                )))
                        {
                                $this->vfs->override_acl = 1;
 
                                if(!$this->vfs->mkdir (array(
-                                    'string' => $this->fakebase. SEP . 
'service_agreement',
+                                    'string' => $this->fakebase. '/' . 
'service_agreement',
                                     'relatives' => array(
                                          RELATIVE_NONE
                                     )
                                )))
                                {
-                                       
$receipt['error'][]=array('msg'=>lang('failed to create directory') . ' :'. 
$this->fakebase. SEP . 'service_agreement');
+                                       
$receipt['error'][]=array('msg'=>lang('failed to create directory') . ' :'. 
$this->fakebase. '/' . 'service_agreement');
                                }
                                else
                                {
-                                       
$receipt['message'][]=array('msg'=>lang('directory created') . ' :'. 
$this->fakebase. SEP . 'service_agreement');
+                                       
$receipt['message'][]=array('msg'=>lang('directory created') . ' :'. 
$this->fakebase. '/' . 'service_agreement');
                                }
                                $this->vfs->override_acl = 0;
                        }
@@ -683,25 +498,24 @@
 
                function create_document_dir($id='')
                {
-
                        if(!$this->vfs->file_exists(array(
-                                       'string' => $this->fakebase. SEP . 
'service_agreement' .  SEP . $id,
+                                       'string' => $this->fakebase. '/' . 
'service_agreement' .  '/' . $id,
                                        'relatives' => Array(RELATIVE_NONE)
                                )))
                        {
                                $this->vfs->override_acl = 1;
                                if(!$this->vfs->mkdir (array(
-                                    'string' => $this->fakebase. SEP . 
'service_agreement' .  SEP . $id,
+                                    'string' => $this->fakebase. '/' . 
'service_agreement' .  '/' . $id,
                                     'relatives' => array(
                                          RELATIVE_NONE
                                     )
                                )))
                                {
-                                       
$receipt['error'][]=array('msg'=>lang('failed to create directory') . ' :'. 
$this->fakebase. SEP  . 'service_agreement' .  SEP . $id);
+                                       
$receipt['error'][]=array('msg'=>lang('failed to create directory') . ' :'. 
$this->fakebase. '/'  . 'service_agreement' .  '/' . $id);
                                }
                                else
                                {
-                                       
$receipt['message'][]=array('msg'=>lang('directory created') . ' :'. 
$this->fakebase. SEP . 'service_agreement' .  SEP . $id);
+                                       
$receipt['message'][]=array('msg'=>lang('directory created') . ' :'. 
$this->fakebase. '/' . 'service_agreement' .  '/' . $id);
                                }
                                $this->vfs->override_acl = 0;
                        }
@@ -725,7 +539,5 @@
                        $historylog = 
CreateObject('property.historylog','s_agreement');
                        $historylog->delete_single_record($data['history_id']);
                }
-
-
        }
 ?>

Modified: trunk/property/inc/class.bostandard_2.inc.php
===================================================================
--- trunk/property/inc/class.bostandard_2.inc.php       2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/inc/class.bostandard_2.inc.php       2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -71,7 +71,7 @@
 
                function property_bostandard_2($session=False)
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->so               = 
CreateObject('property.sostandard_2');
                        $this->socommon = CreateObject('property.socommon');
 

Modified: trunk/property/inc/class.bostandard_3.inc.php
===================================================================
--- trunk/property/inc/class.bostandard_3.inc.php       2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/inc/class.bostandard_3.inc.php       2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -71,7 +71,7 @@
 
                function property_bostandard_3($session=False)
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->so               = 
CreateObject('property.sostandard_3');
                        $this->socommon = CreateObject('property.socommon');
 

Modified: trunk/property/inc/class.botemplate.inc.php
===================================================================
--- trunk/property/inc/class.botemplate.inc.php 2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.botemplate.inc.php 2008-02-02 13:52:39 UTC (rev 
18466)
@@ -52,7 +52,7 @@
 
                function property_botemplate($session=False)
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->so               = 
CreateObject('property.sotemplate');
                        $this->bocommon         = 
CreateObject('property.bocommon');
 

Modified: trunk/property/inc/class.botenant_claim.inc.php
===================================================================
--- trunk/property/inc/class.botenant_claim.inc.php     2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/inc/class.botenant_claim.inc.php     2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -45,7 +45,7 @@
 
                function property_botenant_claim($session=False)
                {
-                       $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->bocommon = CreateObject('property.bocommon');
                        $this->so = CreateObject('property.sotenant_claim');
 
@@ -220,14 +220,14 @@
                        }
 
 
-                       $this->config = 
CreateObject('phpgwapi.config',$this->currentapp);
+                       $this->config = 
CreateObject('phpgwapi.config','property');
                        $this->config->read_repository();
                        $claim_notify_mails = 
$this->config->config_data['tenant_claim_notify_mails'];
                        if ($claim_notify_mails)
                        {
                                // notify via email
                                
$current_user_id=$GLOBALS['phpgw_info']['user']['account_id'];
-                               $current_prefs_user = 
$this->bocommon->create_preferences($this->currentapp,$current_user_id);
+                               $current_prefs_user = 
$this->bocommon->create_preferences('property',$current_user_id);
                                $from=$current_prefs_user['email'];
                                $subject = lang("Tenant claim 
%1",$receipt['claim_id']) .' ' . $action;
                                $body    = lang('Reminder');

Modified: trunk/property/inc/class.botts.inc.php
===================================================================
--- trunk/property/inc/class.botts.inc.php      2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.botts.inc.php      2008-02-02 13:52:39 UTC (rev 
18466)
@@ -72,7 +72,7 @@
 
                function property_botts($session=False)
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->so                       = 
CreateObject('property.sotts');
                        $this->bocommon         = 
CreateObject('property.bocommon');
                        $this->historylog       = 
CreateObject('property.historylog','tts');
@@ -223,9 +223,9 @@
 
                function get_priority_list($selected='')
                {
-                       if(!$selected && 
isset($GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['prioritydefault']))
+                       if(!$selected && 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['prioritydefault']))
                        {
-                               $selected = 
$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['prioritydefault'];
+                               $selected = 
$GLOBALS['phpgw_info']['user']['preferences']['property']['prioritydefault'];
                        }
 
                        $priority_comment[1]=' - '.lang('Lowest');
@@ -405,7 +405,7 @@
                        $this->vfs->override_acl = 1;
 
                        $ticket['files'] = $this->vfs->ls (array(
-                            'string' => $this->fakebase. SEP . 'fmticket' . 
SEP . $id,
+                            'string' => $this->fakebase. '/' . 'fmticket' . 
'/' . $id,
                             'relatives' => array(RELATIVE_NONE)));
 
                        $this->vfs->override_acl = 0;
@@ -552,8 +552,8 @@
                        {
                                foreach($custom_functions as $entry)
                                {
-                                       if (is_file(PHPGW_APP_INC . SEP . 
'custom' . SEP . $entry['file_name']) && $entry['active'])
-                                       include (PHPGW_APP_INC . SEP . 'custom' 
. SEP . $entry['file_name']);
+                                       if (is_file(PHPGW_APP_INC . '/' . 
'custom' . '/' . $entry['file_name']) && $entry['active'])
+                                       include (PHPGW_APP_INC . '/' . 'custom' 
. '/' . $entry['file_name']);
                                }
                        }
 
@@ -630,7 +630,7 @@
 
 
                //      $prefs_user = 
$GLOBALS['phpgw']->preferences->create_email_preferences($ticket['user_id']);
-                       $prefs_user = 
$this->bocommon->create_preferences($this->currentapp,$ticket['user_id']);
+                       $prefs_user = 
$this->bocommon->create_preferences('property',$ticket['user_id']);
 
                        $from_address=$prefs_user['email'];
 
@@ -645,7 +645,7 @@
                        $current_user_name= $user_firstname . " " 
.$user_lastname ;
 
 //                     $current_prefs_user = 
$GLOBALS['phpgw']->preferences->create_email_preferences($current_user_id);
-                       $current_prefs_user = 
$this->bocommon->create_preferences($this->currentapp,$current_user_id);
+                       $current_prefs_user = 
$this->bocommon->create_preferences('property',$current_user_id);
                        $current_user_address=$current_prefs_user['email'];
 
                        $headers = "Return-Path: <". $current_user_address 
.">\r\n";
@@ -658,7 +658,7 @@
                // build body
                        $body  = '';
        //              $body .= lang('Ticket').' #'.$id."\n";
-                       $body .= '<a href ="http://' . 
$GLOBALS['phpgw_info']['server']['hostname'] . 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uitts.view&id='
 . $id).'">' . lang('Ticket').' #' .$id .'</a>'."\n";
+                       $body .= '<a href ="http://' . 
$GLOBALS['phpgw_info']['server']['hostname'] . 
$GLOBALS['phpgw']->link('/index.php','menuaction='.'property.uitts.view&id=' . 
$id).'">' . lang('Ticket').' #' .$id .'</a>'."\n";
                        $body .= lang('Date Opened').': '.$timestampopened."\n";
                        $body .= lang('Category').': '. 
$this->get_category_name($ticket['cat_id']) ."\n";
 //                     $body .= lang('Subject').': '. $ticket['subject'] ."\n";
@@ -746,7 +746,7 @@
                                if ($members[$i]['account_id'])
                                {
                        //              $prefs = 
$GLOBALS['phpgw']->preferences->create_email_preferences($members[$i]['account_id']);
-                                       $prefs = 
$this->bocommon->create_preferences($this->currentapp,$members[$i]['account_id']);
+                                       $prefs = 
$this->bocommon->create_preferences('property',$members[$i]['account_id']);
                                        if (strlen($prefs['email'])> 
(strlen($members[$i]['account_name'])+1))
                                        {
                                                $toarray[$prefs['email']] = 
$prefs['email'];
@@ -806,46 +806,46 @@
                function create_document_dir($id='')
                {
                        if(!$this->vfs->file_exists(array(
-                                       'string' => $this->fakebase. SEP . 
'fmticket',
+                                       'string' => $this->fakebase. '/' . 
'fmticket',
                                        'relatives' => Array(RELATIVE_NONE)
                                )))
                        {
                                $this->vfs->override_acl = 1;
                                if(!$this->vfs->mkdir (array(
-                                    'string' => $this->fakebase. SEP . 
'fmticket',
+                                    'string' => $this->fakebase. '/' . 
'fmticket',
                                     'relatives' => array(
                                          RELATIVE_NONE
                                     )
                                )))
                                {
-                                       
$receipt['error'][]=array('msg'=>lang('failed to create directory') . ' :'. 
$this->fakebase. SEP . 'fmticket');
+                                       
$receipt['error'][]=array('msg'=>lang('failed to create directory') . ' :'. 
$this->fakebase. '/' . 'fmticket');
                                }
                                else
                                {
-                                       
$receipt['message'][]=array('msg'=>lang('directory created') . ' :'. 
$this->fakebase. SEP . 'fmticket');
+                                       
$receipt['message'][]=array('msg'=>lang('directory created') . ' :'. 
$this->fakebase. '/' . 'fmticket');
                                }
                                $this->vfs->override_acl = 0;
                        }
 
 
                        if(!$this->vfs->file_exists(array(
-                                       'string' => $this->fakebase. SEP . 
'fmticket' .  SEP . $id,
+                                       'string' => $this->fakebase. '/' . 
'fmticket' .  '/' . $id,
                                        'relatives' => Array(RELATIVE_NONE)
                                )))
                        {
                                $this->vfs->override_acl = 1;
                                if(!$this->vfs->mkdir (array(
-                                    'string' => $this->fakebase. SEP . 
'fmticket' .  SEP . $id,
+                                    'string' => $this->fakebase. '/' . 
'fmticket' .  '/' . $id,
                                     'relatives' => array(
                                          RELATIVE_NONE
                                     )
                                )))
                                {
-                                       
$receipt['error'][]=array('msg'=>lang('failed to create directory') . ' :'. 
$this->fakebase. SEP  . 'fmticket' .  SEP . $id);
+                                       
$receipt['error'][]=array('msg'=>lang('failed to create directory') . ' :'. 
$this->fakebase. '/'  . 'fmticket' .  '/' . $id);
                                }
                                else
                                {
-                                       
$receipt['message'][]=array('msg'=>lang('directory created') . ' :'. 
$this->fakebase. SEP . 'fmticket' .  SEP . $id);
+                                       
$receipt['message'][]=array('msg'=>lang('directory created') . ' :'. 
$this->fakebase. '/' . 'fmticket' .  '/' . $id);
                                }
                                $this->vfs->override_acl = 0;
                        }
@@ -858,7 +858,7 @@
                {
                        for ($i=0;$i<count($values['delete_file']);$i++)
                        {
-                               $file = $this->fakebase. SEP . 'fmticket' . SEP 
. $id . SEP . $values['delete_file'][$i];
+                               $file = $this->fakebase. '/' . 'fmticket' . '/' 
. $id . '/' . $values['delete_file'][$i];
 
                                if($this->vfs->file_exists(array(
                                        'string' => $file,
@@ -874,11 +874,11 @@
                                             )
                                        )))
                                        {
-                                               
$receipt['error'][]=array('msg'=>lang('failed to delete file') . ' :'. 
$this->fakebase. SEP . 'fmticket' . SEP . $id . SEP 
.$values['delete_file'][$i]);
+                                               
$receipt['error'][]=array('msg'=>lang('failed to delete file') . ' :'. 
$this->fakebase. '/' . 'fmticket' . '/' . $id . '/' 
.$values['delete_file'][$i]);
                                        }
                                        else
                                        {
-                                               
$receipt['message'][]=array('msg'=>lang('file deleted') . ' :'. 
$this->fakebase. SEP . 'fmticket' . SEP . $id . SEP . 
$values['delete_file'][$i]);
+                                               
$receipt['message'][]=array('msg'=>lang('file deleted') . ' :'. 
$this->fakebase. '/' . 'fmticket' . '/' . $id . '/' . 
$values['delete_file'][$i]);
                                        }
                                        $this->vfs->override_acl = 0;
                                }

Modified: trunk/property/inc/class.bowo_hour.inc.php
===================================================================
--- trunk/property/inc/class.bowo_hour.inc.php  2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.bowo_hour.inc.php  2008-02-02 13:52:39 UTC (rev 
18466)
@@ -52,7 +52,7 @@
 
                function property_bowo_hour($session=False)
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->so               = 
CreateObject('property.sowo_hour');
                        $this->bocommon         = 
CreateObject('property.bocommon');
 

Modified: trunk/property/inc/class.boworkorder.inc.php
===================================================================
--- trunk/property/inc/class.boworkorder.inc.php        2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/inc/class.boworkorder.inc.php        2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -52,7 +52,7 @@
 
                function property_boworkorder($session=False)
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->so                       = 
CreateObject('property.soworkorder');
                        $this->bocommon         = 
CreateObject('property.bocommon');
 
@@ -252,9 +252,12 @@
                        $dateformat                                             
= $GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
                        $workorder['start_date']                = 
$GLOBALS['phpgw']->common->show_date($workorder['start_date'],$dateformat);
                        $workorder['end_date']                  = 
$GLOBALS['phpgw']->common->show_date($workorder['end_date'],$dateformat);
-                       $vendor                                                 
= $contacts->read_single(array('actor_id'=>(int)$workorder['vendor_id']));
-                       if(is_array($vendor))
+
+                       if(isset($workorder['vendor_id']) && 
$workorder['vendor_id'])
                        {
+                               $custom                 = 
createObject('phpgwapi.custom_fields');
+                               $vendor['attributes'] = 
$custom->get_attribs('property','.vendor', 0, '', 'ASC', 'attrib_sort', true, 
true);
+                               $vendor                 = 
$contacts->read_single($workorder['vendor_id'],$vendor);
                                foreach($vendor['attributes'] as $attribute)
                                {
                                        if($attribute['name']=='org_name')

Modified: trunk/property/inc/class.custom_functions.inc.php
===================================================================
--- trunk/property/inc/class.custom_functions.inc.php   2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/inc/class.custom_functions.inc.php   2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -49,8 +49,8 @@
 
                        $GLOBALS['phpgw_info']['flags']['currentapp']   =       
'property';
 
-                       $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
-                       $this->config           = 
CreateObject('phpgwapi.config',$this->currentapp);
+               //      $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       $this->config           = 
CreateObject('phpgwapi.config','property');
 
                }
 

Modified: trunk/property/inc/class.db_mssql.inc.php
===================================================================
--- trunk/property/inc/class.db_mssql.inc.php   2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.db_mssql.inc.php   2008-02-02 13:52:39 UTC (rev 
18466)
@@ -63,7 +63,7 @@
                        {
                                return '';
                        }
-                       return ereg_replace("'", "''", $str);
+                       return preg_replace("/'/", "''", $str);
                }
 
                function free_result()

Modified: trunk/property/inc/class.historylog.inc.php
===================================================================
--- trunk/property/inc/class.historylog.inc.php 2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.historylog.inc.php 2008-02-02 13:52:39 UTC (rev 
18466)
@@ -198,7 +198,7 @@
                                        'record_id'  => 
$this->db->f('history_record_id'),
                                        'owner'      => 
$GLOBALS['phpgw']->accounts->id2name($this->db->f('history_owner')),
 //                                     'status'     => 
lang($this->types[$this->db->f('history_status')]),
-                                       'status'     => ereg_replace(' 
','',$this->db->f('history_status')),
+                                       'status'     => preg_replace('/ 
/','',$this->db->f('history_status')),
                                        'new_value'  => 
$this->db->f('history_new_value'),
                                        'datetime'   => 
$this->db->from_timestamp($this->db->f('history_timestamp'))
                                );

Modified: trunk/property/inc/class.import.inc.php
===================================================================
--- trunk/property/inc/class.import.inc.php     2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.import.inc.php     2008-02-02 13:52:39 UTC (rev 
18466)
@@ -24,7 +24,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage agreement
-       * @version $Id: class.import.inc.php,v 1.47 2007/08/14 10:45:09 
sigurdne Exp $
+       * @version $Id: class.import.inc.php 690 2008-02-02 10:11:33Z dave $
        */
 
        /**

Modified: trunk/property/inc/class.pdf.inc.php
===================================================================
--- trunk/property/inc/class.pdf.inc.php        2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.pdf.inc.php        2008-02-02 13:52:39 UTC (rev 
18466)
@@ -42,8 +42,7 @@
                        }
                        else
                        {
-                               $dir = PHPGW_APP_INC  . '/..';
-                               $dir = $dir . SEP . 'pdf_files';
+                               $dir = realpath(PHPGW_APP_INC  . 
"/../pdf_files");
   
                                //save the file
                                if (!file_exists($dir))
@@ -51,7 +50,7 @@
                                        die('Directory for temporary pdf-files 
is missing - pleace notify the Administrator');
                                }
 
-                               $fname = tempnam($dir.SEP,'PDF_').'.pdf';
+                               $fname = tempnam("{$dir}/PDF_") . '.pdf';
  
                                $fp = fopen($fname,'w');
                                fwrite($fp,$document);
@@ -62,7 +61,7 @@
                                        die('Directory for temporary pdf-files 
is not writeable to the webserver - pleace notify the Administrator');
                                }
 
-                               $fname = $this->currentapp . '/pdf_files/'. 
basename($fname);
+                               $fname = 'property' . '/pdf_files/'. 
basename($fname);
                                echo '<html>
                                <head>
                                <SCRIPT LANGUAGE="JavaScript"><!-- 

Modified: trunk/property/inc/class.soXport.inc.php
===================================================================
--- trunk/property/inc/class.soXport.inc.php    2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.soXport.inc.php    2008-02-02 13:52:39 UTC (rev 
18466)
@@ -43,7 +43,7 @@
                {
 
                        $GLOBALS['phpgw_info']['flags']['currentapp']   =       
'property';
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->bocommon         = 
CreateObject('property.bocommon');
                        $this->soinvoice        = 
CreateObject('property.soinvoice',True);
                        $this->db               = $this->bocommon->new_db();

Modified: trunk/property/inc/class.soactor.inc.php
===================================================================
--- trunk/property/inc/class.soactor.inc.php    2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.soactor.inc.php    2008-02-02 13:52:39 UTC (rev 
18466)
@@ -38,7 +38,7 @@
 
                function property_soactor()
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $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();
@@ -67,8 +67,10 @@
 
                        $entity_table = 'fm_' . $this->role;
                        $category_table = 'fm_' . $this->role . '_category';
-                       $choice_table = 'fm_' . $this->role . '_choice';
-                       $attribute_table = 'fm_' . $this->role . '_attribute';
+                       $choice_table = 'phpgw_cust_choice';
+                       $attribute_table = 'phpgw_cust_attribute';
+                       $attribute_filter = " appname = 'property' AND location 
= '." . $this->role . "'";
+
                        if(!$sql)
                        {
                                $cols = $entity_table . 
".*,$category_table.descr as category";
@@ -97,7 +99,6 @@
                                $uicols['descr'][]                      = 
lang('entry date');
                                $uicols['statustext'][]         = lang('entry 
date');
 
-
                                $paranthesis .='(';
 
                                $joinmethod .= " $this->join  " . $entity_table 
. "_category ON ( $entity_table" . ".category =" .$entity_table . 
"_category.id))";
@@ -119,34 +120,18 @@
 
                        $i      = count($uicols['name']);
 
-                       $this->db->query("SELECT * FROM $attribute_table WHERE 
list=1 ORDER BY attrib_sort ASC");
-                       while ($this->db->next_record())
+                       
$user_columns=isset($GLOBALS['phpgw_info']['user']['preferences']['property']['actor_columns_'
 . 
$this->role])?$GLOBALS['phpgw_info']['user']['preferences']['property']['actor_columns_'
 . $this->role]:'';
+                       $user_column_filter = '';
+                       if (isset($user_columns) AND is_array($user_columns) 
AND $user_columns[0])
                        {
-                               $uicols['input_type'][]         = 'text';
-                               $uicols['name'][]                       = 
$this->db->f('column_name');
-                               $uicols['descr'][]                      = 
$this->db->f('input_text');
-                               $uicols['statustext'][]         = 
$this->db->f('statustext');
-                               $uicols['datatype'][$i]         = 
$this->db->f('datatype');
-                               $cols_return_extra[]= array(
-                                       'name'  => $this->db->f('column_name'),
-                                       'datatype'      => 
$this->db->f('datatype'),
-                                       'attrib_id'     => $this->db->f('id')
-                               );
-
-                               $i++;
+                               $user_column_filter = " OR ($attribute_filter 
AND id IN (" . implode(',',$user_columns) .'))';
                        }
 
-                       
$user_columns=isset($GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['actor_columns_'
 . 
$this->role])?$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['actor_columns_'
 . $this->role]:'';
+                       $this->db->query("SELECT * FROM $attribute_table WHERE 
list=1 AND $attribute_filter $user_column_filter ORDER BY attrib_sort ASC");
 
-//_debug_array($user_columns);
 
-                       if (isset($user_columns) AND is_array($user_columns) 
AND $user_columns[0])
-                       {
-                               foreach($user_columns as $column_id)
+                       while ($this->db->next_record())
                                {
-                                       $this->db->query("SELECT * FROM 
$attribute_table WHERE id= $column_id");
-
-                                       $this->db->next_record();
                                        $uicols['input_type'][]         = 
'text';
                                        $uicols['name'][]                       
= $this->db->f('column_name');
                                        $uicols['descr'][]                      
= $this->db->f('input_text');
@@ -157,9 +142,9 @@
                                                'datatype'      => 
$this->db->f('datatype'),
                                                'attrib_id'     => 
$this->db->f('id')
                                        );
+
                                        $i++;
                                }
-                       }
 
                        $this->uicols   = $uicols;
 
@@ -175,13 +160,13 @@
 
                        $where= 'WHERE';
 
-                       $grants         = 
$GLOBALS['phpgw']->session->appsession('grants_' . $this->role 
,$this->currentapp);
+                       $grants         = 
$GLOBALS['phpgw']->session->appsession('grants_' . $this->role ,'property');
 
                        if(!$grants)
                        {
                                $this->acl              = & 
$GLOBALS['phpgw']->acl;
-                               $grants = 
$this->acl->get_grants($this->currentapp,'.' . $this->role);
-                               
$GLOBALS['phpgw']->session->appsession('grants_' . 
$this->role,$this->currentapp,$grants);
+                               $grants = $this->acl->get_grants('property','.' 
. $this->role);
+                               
$GLOBALS['phpgw']->session->appsession('grants_' . 
$this->role,'property',$grants);
                        }
 
                        $filtermethod = '';
@@ -219,8 +204,8 @@
                        $_querymethod = array();
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
                        //      $filtermethod .= " $where $entity_table.id ='" 
. (int)$query . "'";
                                $where= 'AND';
@@ -285,14 +270,14 @@
                                        $value='';
                                        
$value=$this->db->f($cols_return_extra[$i]['name']);
 
-                                       
if(($cols_return_extra[$i]['datatype']=='R' || 
$cols_return_extra[$i]['datatype']=='LB') && $value):
+                                       
if(($cols_return_extra[$i]['datatype']=='R' || 
$cols_return_extra[$i]['datatype']=='LB') && $value)
                                        {
-                                               $sql="SELECT value FROM 
$choice_table where attrib_id=" .$cols_return_extra[$i]['attrib_id']. "  AND 
id=" . $value;
+                                               $sql="SELECT value FROM 
$choice_table WHERE $attribute_filter AND attrib_id=" 
.$cols_return_extra[$i]['attrib_id']. "  AND id=" . $value;
                                                $this->db2->query($sql);
                                                $this->db2->next_record();
                                                
$actor_list[$j][$cols_return_extra[$i]['name']] = $this->db2->f('value');
                                        }
-                                       
elseif($cols_return_extra[$i]['datatype']=='AB' && $value):
+                                       else 
if($cols_return_extra[$i]['datatype']=='AB' && $value)
                                        {
                                                $contact_data   = 
$contacts->read_single_entry($value,array('n_given'=>'n_given','n_family'=>'n_family','email'=>'email'));
                                                
$actor_list[$j][$cols_return_extra[$i]['name']] = $contact_data[0]['n_family'] 
. ', ' . $contact_data[0]['n_given'];
@@ -303,14 +288,14 @@
                                                
$actor_list[$j][$cols_return_extra[$i]['name']] = $this->db2->f('org_name');
 */
                                        }
-                                       
elseif($cols_return_extra[$i]['datatype']=='VENDOR' && $value):
+                                       else 
if($cols_return_extra[$i]['datatype']=='VENDOR' && $value)
                                        {
                                                $sql="SELECT org_name FROM 
fm_vendor where id=$value";
                                                $this->db2->query($sql);
                                                $this->db2->next_record();
                                                
$actor_list[$j][$cols_return_extra[$i]['name']] = $this->db2->f('org_name');
                                        }
-                                       
elseif($cols_return_extra[$i]['datatype']=='CH' && $value):
+                                       else 
if($cols_return_extra[$i]['datatype']=='CH' && $value)
                                        {
                                                $ch= unserialize($value);
 
@@ -318,7 +303,7 @@
                                                {
                                                        for 
($k=0;$k<count($ch);$k++)
                                                        {
-                                                               $sql="SELECT 
value FROM $choice_table where attrib_id=" 
.$cols_return_extra[$i]['attrib_id']. "  AND id=" . $ch[$k];
+                                                               $sql="SELECT 
value FROM $choice_table WHERE $attribute_filter AND attrib_id=" 
.$cols_return_extra[$i]['attrib_id']. "  AND id=" . $ch[$k];
                                                                
$this->db2->query($sql);
                                                                while 
($this->db2->next_record())
                                                                {
@@ -329,67 +314,49 @@
                                                        unset($ch_value);
                                                }
                                        }
-                                       
elseif($cols_return_extra[$i]['datatype']=='D' && $value):
+                                       else 
if($cols_return_extra[$i]['datatype']=='D' && $value)
                                        {
-//html_print_r($value);
-
                                                
$actor_list[$j][$cols_return_extra[$i]['name']]=date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'],strtotime($value));
                                        }
-                                       else:
+                                       else
                                        {
                                                
$actor_list[$j][$cols_return_extra[$i]['name']]=$value;
                                        }
-                                       endif;
                                }
-
                                $j++;
                        }
-//html_print_r($actor_list);
                        return $actor_list;
                }
 
-
-               function read_single($data)
+               function read_single($actor_id, $values = array())
                {
-                       $attribute_table = 'fm_' . $this->role . '_attribute';
-                       $table = 'fm_' . $this->role;
-
-                       $actor_id =$data['actor_id'];
-
-                       $this->db->query("SELECT * FROM $attribute_table ORDER 
BY attrib_sort");
-
-                       while ($this->db->next_record())
+                       if(is_array($actor_id))
                        {
-                               $actor['attributes'][] = array
-                               (
-                                       'attrib_id'             => 
$this->db->f('id'),
-                                       'name'                  => 
$this->db->f('column_name'),
-                                       'input_text'    => 
stripslashes($this->db->f('input_text')),
-                                       'statustext'    => 
stripslashes($this->db->f('statustext')),
-                                       'datatype'              => 
$this->db->f('datatype')
-                               );
+                               $actor_id = $actor_id['actor_id'];
+                               $bt = debug_backtrace();
+                               echo "<b>wrong call to soactor::" . 
$bt[0]['function'] . "<br/>Called from file: " . $bt[0]['file'] . "<br/> line: 
" . $bt[0]['line'] . '<br/>args: ' . print_r($bt[0]['args'][0],true) . '</b>';
+                               unset($bt);
                        }
+                       $table = 'fm_' . $this->role;
 
-                       if($actor_id)
-                       {
                                $this->db->query("SELECT * from $table where 
id='$actor_id'");
 
                                if($this->db->next_record())
                                {
-                                       $actor['id']                    = 
(int)$this->db->f('id');
-                                       $actor['entry_date']            = 
$this->db->f('entry_date');
-                                       $actor['cat_id']                        
= $this->db->f('category');
-                                       $actor['member_of']                     
= explode(',',$this->db->f('member_of'));
+                               $values['id']                   = 
(int)$this->db->f('id');
+                               $values['entry_date']           = 
$this->db->f('entry_date');
+                               $values['cat_id']                       = 
$this->db->f('category');
+                               $values['member_of']                    = 
explode(',',$this->db->f('member_of'));
 
-                                       for 
($i=0;$i<count($actor['attributes']);$i++)
+                               if ( isset($values['attributes']) && 
is_array($values['attributes']) )
                                        {
-                                               
$actor['attributes'][$i]['value']       = 
$this->db->f($actor['attributes'][$i]['name']);
-                                               
$actor['attributes'][$i]['datatype_text']       = 
$this->bocommon->translate_datatype($actor['attributes'][$i]['datatype']);
+                                       foreach ( $values['attributes'] as 
&$attr )
+                                       {
+                                               $attr['value']  = 
$this->db->f($attr['column_name']);
                                        }
-
                                }
                        }
-                       return $actor;
+                       return $values;
                }
 
                function add($actor,$values_attribute='')
@@ -401,14 +368,17 @@
                                $actor['member_of']=',' . 
implode(',',$actor['member_of']) . ',';
                        }
 
-                       while (is_array($actor['extra']) && 
list($input_name,$value) = each($actor['extra']))
+                       if(isset($actor['extra']) && is_array($actor['extra']))
                        {
-                               if($value)
+                               foreach ($actor['extra'] as $input_name => 
$value)
+                       {
+                                       if(isset($value) && $value)
                                {
                                        $cols[] = $input_name;
                                        $vals[] = $value;
                                }
                        }
+                       }
 
                        if (isset($values_attribute) AND 
is_array($values_attribute))
                        {
@@ -418,7 +388,7 @@
                                        {
                                                if($entry['datatype']!='AB' && 
$entry['datatype']!='VENDOR' && $entry['datatype']!='user')
                                                {
-                                                       if($entry['datatype'] 
== 'C' || $entry['datatype'] == 'T' || $entry['datatype'] == 'V')
+                                                       if($entry['datatype'] 
== 'C' || $entry['datatype'] == 'T' || $entry['datatype'] == 'V' || 
$entry['datatype'] == 'link')
                                                        {
                                                                $entry['value'] 
= $this->db->db_addslashes($entry['value']);
                                                        }
@@ -511,7 +481,7 @@
                                {
                                        if($entry['datatype']!='AB' && 
$entry['datatype']!='VENDOR' && $entry['datatype']!='user')
                                        {
-                                               if($entry['datatype'] == 'C' || 
$entry['datatype'] == 'T' || $entry['datatype'] == 'V')
+                                               if($entry['datatype'] == 'C' || 
$entry['datatype'] == 'T' || $entry['datatype'] == 'V' || $entry['datatype'] == 
'link')
                                                {
                                                        $entry['value'] = 
$this->db->db_addslashes($entry['value']);
                                                }
@@ -562,528 +532,5 @@
                        $table = 'fm_' . $this->role;
                        $this->db->query("DELETE FROM $table WHERE id=" . 
intval($actor_id));
                }
-
-               function read_attrib($data)
-               {
-                       $attribute_table = 'fm_' . $this->role . '_attribute';
-//html_print_r($data);
-                       if(is_array($data))
-                       {
-                               if ($data['start'])
-                               {
-                                       $start=$data['start'];
-                               }
-                               else
-                               {
-                                       $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']:'');
-                               $column_list = 
(isset($data['column_list'])?$data['column_list']:'');
-                       }
-
-                       $where = 'WHERE';
-                       if ($column_list)
-                       {
-                               $filtermethod = " $where list !=1 or list is 
null";
-                               $where = 'AND';
-
-                       }
-                       if ($order)
-                       {
-                               $ordermethod = " order by $order $sort";
-
-                       }
-                       else
-                       {
-                               $ordermethod = ' order by attrib_sort asc';
-                       }
-
-                       if($query)
-                       {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
-
-                               $querymethod = " $where 
($attribute_table.input_text $this->like '%$query%' or 
$attribute_table.column_name $this->like '%$query%')";
-                       }
-
-                       $sql = "SELECT * FROM $attribute_table $filtermethod 
$querymethod";
-
-//echo $sql;
-                       $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())
-                       {
-                               $attrib[] = array
-                               (
-                                       'id'                    => 
$this->db->f('id'),
-                                       'attrib_sort'   => 
$this->db->f('attrib_sort'),
-                                       'list'                  => 
$this->db->f('list'),
-                                       'lookup_form'   => 
$this->db->f('lookup_form'),
-                                       'column_name'   => 
$this->db->f('column_name'),
-                                       'name'                  => 
$this->db->f('input_text'),
-                                       'size'                  => 
$this->db->f('size'),
-                                       'statustext'    => 
$this->db->f('statustext'),
-                                       'input_text'    => 
$this->db->f('input_text'),
-                                       'type_name'             => 
$this->db->f('type'),
-                                       'datatype'              => 
$this->db->f('datatype'),
-                                       'search'                => 
$this->db->f('search')
-                               );
-                       }
-                       return $attrib;
-               }
-
-               function read_single_attrib($id)
-               {
-                       $attribute_table = 'fm_' . $this->role . '_attribute';
-
-                       $sql = "SELECT * FROM $attribute_table where id=$id";
-
-                       $this->db->query($sql);
-
-                       if($this->db->next_record())
-                       {
-                               $attrib['id']                                   
        = $this->db->f('id');
-                               $attrib['column_name']                          
= $this->db->f('column_name');
-                               $attrib['input_text']                           
= $this->db->f('input_text');
-                               $attrib['statustext']                           
= $this->db->f('statustext');
-                               $attrib['column_info']['precision']     = 
$this->db->f('precision_');
-                               $attrib['column_info']['scale']         = 
$this->db->f('scale');
-                               $attrib['column_info']['default']       = 
$this->db->f('default_value');
-                               $attrib['column_info']['nullable']      = 
$this->db->f('nullable');
-                               $attrib['column_info']['type']          = 
$this->db->f('datatype');
-                               $attrib['type_name']                            
= $this->db->f('type_name');
-                               $attrib['lookup_form']                          
= $this->db->f('lookup_form');
-                               $attrib['list']                                 
        = $this->db->f('list');
-                               $attrib['search']                               
        = $this->db->f('search');
-                               if($this->db->f('datatype')=='R' || 
$this->db->f('datatype')=='CH' || $this->db->f('datatype')=='LB')
-                               {
-                                       $attrib['choice'] = 
$this->read_attrib_choice($id);
-                               }
-
-                               return $attrib;
-                       }
-               }
-
-               function read_attrib_choice($attrib_id)
-               {
-                       $choice_table = 'fm_' . $this->role . '_choice';
-                       $sql = "SELECT * FROM $choice_table WHERE 
attrib_id=$attrib_id";
-                       $this->db->query($sql);
-
-                       while ($this->db->next_record())
-                       {
-                               $choice[] = array
-                               (
-                                       'id'    => $this->db->f('id'),
-                                       'value' => $this->db->f('value')
-                               );
-
-                       }
-                       return $choice;
-               }
-
-               function add_attrib($attrib)
-               {
-                       $table = 'fm_' . $this->role;
-                       $attribute_table = 'fm_' . $this->role . '_attribute';
-                       $attrib['column_name'] = 
strtolower($this->db->db_addslashes($attrib['column_name']));
-                       $attrib['input_text'] = 
$this->db->db_addslashes($attrib['input_text']);
-                       $attrib['statustext'] = 
$this->db->db_addslashes($attrib['statustext']);
-                       $attrib['default'] = 
$this->db->db_addslashes($attrib['default']);
-                       $attrib['id'] = 
$this->bocommon->next_id($attribute_table);
-
-                       $sql = "SELECT * FROM $attribute_table WHERE 
column_name = '{$attrib['column_name']}'";
-                       $this->db->query($sql,__LINE__,__FILE__);
-                       if ( $this->db->next_record() )
-                       {
-                               $receipt['id'] = '';
-                               $receipt['error'] = array();
-                               $receipt['error'][] = array('msg' => 
lang('field already exists, please choose another name'));
-                               $receipt['error'][] = array('msg'       => 
lang('Attribute has NOT been saved'));
-                               return $receipt; //no point continuing
-                       }
-
-
-                       $sql = "SELECT max(attrib_sort) as max_sort FROM 
$attribute_table";
-                       $this->db->query($sql);
-                       $this->db->next_record();
-                       $attrib_sort    = $this->db->f('max_sort')+1;
-
-                       $values= array(
-                               $attrib['id'],
-                               $attrib['column_name'],
-                               $attrib['input_text'],
-                               $attrib['statustext'],
-                               $attrib['lookup_form'],
-                               $attrib['search'],
-                               $attrib['list'],
-                               $attrib_sort,
-                               $attrib['column_info']['type'],
-                               $attrib['column_info']['precision'],
-                               $attrib['column_info']['scale'],
-                               $attrib['column_info']['default'],
-                               $attrib['column_info']['nullable']
-                               );
-
-                       $values = $this->bocommon->validate_db_insert($values);
-
-                       $this->db->transaction_begin();
-
-                       $this->db->query("INSERT INTO $attribute_table 
(id,column_name, input_text, 
statustext,lookup_form,search,list,attrib_sort,datatype,precision_,scale,default_value,nullable)
 "
-                               . "VALUES ($values)");
-
-                       $receipt['id']= $attrib['id'];
-                       
-                       if(!$attrib['column_info']['precision'])
-                       {
-                               $attrib['column_info']['precision'] = 
$this->bocommon->translate_datatype_precision($attrib['column_info']['type']);
-                       }
-
-                       $attrib['column_info']['type']  = 
$this->bocommon->translate_datatype_insert($attrib['column_info']['type']);
-
-                       if($attrib['column_info']['type']=='int' && 
!$attrib['column_info']['precision'])
-                       {
-                               $attrib['column_info']['precision']=4;
-                       }
-
-                       if(!$attrib['column_info']['default'])
-                       {
-                               unset($attrib['column_info']['default']);
-                       }
-
-                       $this->init_process();
-
-                       
if($this->oProc->AddColumn($table,$attrib['column_name'], 
$attrib['column_info']))
-                       {
-                               $receipt['message'][] = array('msg'     => 
lang('Attribute has been saved')     );
-                               $this->db->transaction_commit();
-
-                       }
-                       else
-                       {
-                               $receipt['error'][] = array('msg'       => 
lang('column could not be added')    );
-                               $this->db->transaction_abort();
-                               $this->db->query("DELETE FROM $attribute_table 
WHERE id='" . $receipt['id'] . "'"); // in case transactions is not supported.
-                               unset($receipt['id']);
-                       }
-
-                       return $receipt;
-               }
-
-               function init_process()
-               {
-                       $this->oProc                            = 
CreateObject('phpgwapi.schema_proc',$GLOBALS['phpgw_info']['server']['db_type']);
-                       $this->oProc->m_odb                     = $this->db;
-                       $this->oProc->m_odb->Halt_On_Error      = 'report';
-               }
-
-
-               function get_table_def()
-               {
-                       $table = 'fm_' . $this->role;
-                       $attribute_table = 'fm_' . $this->role . '_attribute';
-
-                       $metadata = $this->db->metadata($table);
-                       
-                       if(isset($this->db->adodb))
-                       {
-                               $i = 0;
-                               foreach($metadata as $key => $val)
-                               {
-                                       $metadata_temp[$i]['name'] = $key;
-                                       $i++;
-                               }
-                               $metadata = $metadata_temp;
-                               unset ($metadata_temp);
-                       }
-
-                       $fd = $this->get_default_column_def();
-                       
-                       for ($i=0; $i<count($metadata); $i++)
-                       {
-                               $sql = "SELECT * FROM $attribute_table WHERE 
column_name = '" . $metadata[$i]['name'] . "'";
-
-                               $this->db->query($sql,__LINE__,__FILE__);
-                               while($this->db->next_record())
-                               {
-                                       if(!$precision = 
$this->db->f('precision_'))
-                                       {
-                                               $precision = 
$this->bocommon->translate_datatype_precision($this->db->f('datatype'));
-                                       }
-
-                                       $fd[$metadata[$i]['name']] = array(
-                                                       'type' => 
$this->bocommon->translate_datatype_insert(stripslashes($this->db->f('datatype'))),
-                                                       'precision' => 
$precision,
-                                                       'nullable' => 
stripslashes($this->db->f('nullable')),
-                                                       'default' => 
stripslashes($this->db->f('default_value')),
-                                                       'scale' => 
$this->db->f('scale')
-                                                       );
-                                       unset($precision);
-                               }
-                       }
-
-                       $table_def = array(
-                               $table =>       array(
-                                       'fd' => $fd
-                                       )
-                               );
-                       
-                       $table_def[$table]['pk'] = array('id');
-                       $table_def[$table]['fk'] = array();                     
-                       $table_def[$table]['ix'] = array();                     
-                       $table_def[$table]['uc'] = array();                     
-
-                       return $table_def;
-               }
-
-
-               function get_default_column_def()
-               {               
-                       $fd=array();
-                       $fd['id'] = array('type' => 'int','precision' => 
'4','nullable' => False);
-                       $fd['entry_date'] = array('type' => 'int','precision' 
=> '4','nullable' => True);
-                       $fd['category'] =array('type' => 'int','precision' => 
'4','nullable' => False);
-                       $fd['owner_id'] =array('type' => 'int','precision' => 
'4','nullable' => False);
-                       
-                       switch($this->role)
-                       {
-                               case 'owner':
-                       //              $fd['abid'] =array('type' => 
'int','precision' => '4','nullable' => False);
-                       //              $fd['org_name'] =array('type' => 
'varchar','precision' => '50','nullable' => True);
-                                       $fd['contact_name'] =array('type' => 
'varchar','precision' => '50','nullable' => True);
-                                       $fd['member_of'] =array('type' => 
'varchar','precision' => '255','nullable' => True);
-                       //              $fd['remark'] =array('type' => 
'varchar','precision' => '255','nullable' => True);
-                                       break;
-                               case 'tenant':
-                                       $fd['member_of'] = array('type' => 
'varchar','precision' => '255','nullable' => True);
-                                       $fd['first_name'] = array('type' => 
'varchar','precision' => '30','nullable' => True);
-                                       $fd['last_name'] = array('type' => 
'varchar','precision' => '30','nullable' => True);
-                                       $fd['contact_phone'] = array('type' => 
'varchar','precision' => '20','nullable' => True);
-
-                                       break;
-                               case 'vendor':
-                                       $fd['org_name'] = array('type' => 
'varchar','precision' => '100','nullable' => True);
-                                       $fd['email'] = array('type' => 
'varchar','precision' => '64','nullable' => True);
-                                       $fd['contact_phone'] = array('type' => 
'varchar','precision' => '20','nullable' => True);
-                                       $fd['klasse'] = array('type' => 
'varchar','precision' => '10','nullable' => True);
-                                       $fd['member_of'] = array('type' => 
'varchar','precision' => '255','nullable' => True);
-                                       $fd['mva'] = array('type' => 
'int','precision' => '4','nullable' => True);
-
-                                       break;
-                               default:
-                                       return;
-                                       break;
-                       }                       
-                       return $fd;
-               }
-
-               function edit_attrib($attrib)
-               {
-                       $attribute_table = 'fm_' . $this->role . '_attribute';
-                       $table = 'fm_' . $this->role;
-
-                       $attrib['column_name'] = 
strtolower($this->db->db_addslashes($attrib['column_name']));
-                       $attrib['input_text'] = 
$this->db->db_addslashes($attrib['input_text']);
-                       $attrib['statustext'] = 
$this->db->db_addslashes($attrib['statustext']);
-                       $attrib['default'] = 
$this->db->db_addslashes((isset($attrib['default'])?$attrib['default']:''));
-
-                       $choice_table = 'fm_' . $this->role . '_choice';
-
-                       $this->db->query("SELECT column_name, 
datatype,precision_ FROM $attribute_table WHERE id='" . $attrib['id']. "'");
-                       $this->db->next_record();
-                       $OldColumnName          = $this->db->f('column_name');
-                       $OldDataType            = $this->db->f('datatype');
-                       $OldPrecision           = $this->db->f('precision_');   
                
-
-                       $table_def = $this->get_table_def();    
-
-                       $this->init_process();
-                       $this->oProc->m_odb->transaction_begin();
-                       $this->db->transaction_begin();
-
-                       $value_set=array(
-                               'input_text'            => 
$attrib['input_text'],
-                               'statustext'            => 
$attrib['statustext'],
-                               'lookup_form'           => 
(isset($attrib['lookup_form'])?$attrib['lookup_form']:''),
-                               'search'                => 
(isset($attrib['search'])?$attrib['search']:''),
-                               'list'                  => 
(isset($attrib['list'])?$attrib['list']:''),
-                               );
-
-                       $value_set      = 
$this->bocommon->validate_db_update($value_set);
-
-                       $this->db->query("UPDATE $attribute_table set 
$value_set WHERE id=" . $attrib['id']);
-
-                       $attrib_type=$attrib['column_info']['type'];
-                       
-                       $this->oProc->m_aTables = $table_def;
-
-                       if($OldColumnName !=$attrib['column_name'])
-                       {
-                               $value_set=array('column_name'  => 
$attrib['column_name']);
-                               $value_set      = 
$this->bocommon->validate_db_update($value_set);
-                               $this->db->query("UPDATE $attribute_table set 
$value_set WHERE  id=" . $attrib['id'],__LINE__,__FILE__);
-
-                               $this->oProc->RenameColumn($table, 
$OldColumnName, $attrib['column_name']);
-                       }
-                               
-                       if (($OldDataType != $attrib['column_info']['type']) || 
($OldPrecision != $attrib['column_info']['precision']) )
-                       {                               
-                               if($attrib_type!='R' && $attrib_type!='CH' && 
$attrib_type!='LB')
-                               {
-                                       $this->db->query("DELETE FROM 
$choice_table WHERE  attrib_id=" . $attrib['id']);
-                               }
-
-                               if(!$attrib['column_info']['precision'])
-                               {
-                                       if($precision = 
$this->bocommon->translate_datatype_precision($attrib['column_info']['type']))
-                                       {
-                                               
$attrib['column_info']['precision']=$precision;
-                                       }
-                               }
-
-                               if(!$attrib['column_info']['default'])
-                               {
-                                       
unset($attrib['column_info']['default']);
-                               }
-
-                               $value_set=array(
-                                       'datatype'              => 
$attrib['column_info']['type'],
-                                       'precision_'            => 
$attrib['column_info']['precision'],
-                                       'scale'                 => 
$attrib['column_info']['scale'],
-                                       'default_value'         => 
$attrib['column_info']['default'],
-                                       'nullable'              => 
$attrib['column_info']['nullable']
-                                       );
-
-                               $value_set      = 
$this->bocommon->validate_db_update($value_set);
-
-                               $this->db->query("UPDATE $attribute_table set 
$value_set WHERE id=" . $attrib['id']);
-
-                               $attrib['column_info']['type']  = 
$this->bocommon->translate_datatype_insert($attrib['column_info']['type']);     
                      
-                               
$this->oProc->AlterColumn($table,$attrib['column_name'],$attrib['column_info']);
-                       }
-
-                       if(isset($attrib['new_choice']) && 
$attrib['new_choice'])
-                       {
-                               $choice_id = 
$this->bocommon->next_id($choice_table ,array('attrib_id'=>$attrib['id']));
-
-                               $values= array(
-                                       $attrib['id'],
-                                       $choice_id,
-                                       $attrib['new_choice']
-                                       );
-
-                               $values = 
$this->bocommon->validate_db_insert($values);
-
-                               $this->db->query("INSERT INTO $choice_table 
(attrib_id,id,value) "
-                               . "VALUES ($values)");
-                       }
-
-                       if(isset($attrib['delete_choice']) && 
is_array($attrib['delete_choice']))
-                       {
-                               for 
($i=0;$i<count($attrib['delete_choice']);$i++)
-                               {
-                                       $this->db->query("DELETE FROM 
$choice_table WHERE  attrib_id=" . $attrib['id']  ." AND id=" . 
$attrib['delete_choice'][$i]);
-                               }
-                       }
-
-                       $this->db->transaction_commit();
-                       $this->oProc->m_odb->transaction_commit();
-                       
-                       $receipt['message'][] = array('msg'     => 
lang('Attribute has been edited'));
-
-                       return $receipt;
-               }
-
-               function resort_attrib($data)
-               {
-                       $attribute_table = 'fm_' . $this->role . '_attribute';
-                       if(is_array($data))
-                       {
-                               $resort = 
(isset($data['resort'])?$data['resort']:'up');
-                               $id = (isset($data['id'])?$data['id']:'');
-                       }
-
-                       $sql = "SELECT attrib_sort FROM $attribute_table where 
id=$id";
-                       $this->db->query($sql);
-                       $this->db->next_record();
-                       $attrib_sort    = $this->db->f('attrib_sort');
-                       $sql = "SELECT max(attrib_sort) as max_sort FROM 
$attribute_table";
-                       $this->db->query($sql);
-                       $this->db->next_record();
-                       $max_sort       = $this->db->f('max_sort');
-                       switch($resort)
-                       {
-                               case 'up':
-                                       if($attrib_sort>1)
-                                       {
-                                               $sql = "UPDATE $attribute_table 
set attrib_sort=$attrib_sort WHERE attrib_sort =" . ($attrib_sort-1);
-                                               $this->db->query($sql);
-                                               $sql = "UPDATE $attribute_table 
set attrib_sort=" . ($attrib_sort-1) ." WHERE id=$id";
-                                               $this->db->query($sql);
-                                       }
-                                       break;
-                               case 'down':
-                                       if($max_sort > $attrib_sort)
-                                       {
-                                               $sql = "UPDATE $attribute_table 
set attrib_sort=$attrib_sort WHERE attrib_sort =" . ($attrib_sort+1);
-                                               $this->db->query($sql);
-                                               $sql = "UPDATE $attribute_table 
set attrib_sort=" . ($attrib_sort+1) ." WHERE id=$id";
-                                               $this->db->query($sql);
-                                       }
-                                       break;
-                               default:
-                                       return;
-                                       break;
-                       }
-               }
-               function delete_attrib($attrib_id)
-               {
-                       $table = 'fm_' . $this->role;
-                       $attribute_table = 'fm_' . $this->role . '_attribute';
-                       $this->init_process();
-
-                       $sql = "SELECT * FROM $attribute_table WHERE 
id=$attrib_id";
-
-                       $this->db->query($sql);
-                       $this->db->next_record();
-                       $ColumnName             = $this->db->f('column_name');
-
-                       if($this->oProc->DropColumn($table,'', $ColumnName))
-                       {
-                               $sql = "SELECT attrib_sort FROM 
$attribute_table where id=$attrib_id";
-                               $this->db->query($sql);
-                               $this->db->next_record();
-                               $attrib_sort    = $this->db->f('attrib_sort');
-                               $sql2 = "SELECT max(attrib_sort) as max_sort 
FROM $attribute_table";
-                               $this->db->query($sql2);
-                               $this->db->next_record();
-                               $max_sort       = $this->db->f('max_sort');
-                               if($max_sort>$attrib_sort)
-                               {
-                                       $sql = "UPDATE $attribute_table set 
attrib_sort=attrib_sort-1 WHERE attrib_sort > $attrib_sort";
-                                       $this->db->query($sql);
-                               }
-
-                               $this->db->query("DELETE FROM $attribute_table 
WHERE id=$attrib_id");
-                       }
-                       else
-                       {
-                               $receipt['error'][] = array('msg'       => 
lang('Attribute has NOT been deleted'));
-                       }
-
-                       return $receipt;
-               }
        }
 ?>

Modified: trunk/property/inc/class.soadmin.inc.php
===================================================================
--- trunk/property/inc/class.soadmin.inc.php    2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.soadmin.inc.php    2008-02-02 13:52:39 UTC (rev 
18466)
@@ -36,7 +36,6 @@
        {
                function property_soadmin()
                {
-                       $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();
@@ -76,7 +75,7 @@
                        {
                                $filter = ' AND allow_grant=1';
                        }
-                       $this->db->query("SELECT * FROM phpgw_acl_location 
WHERE appname = '{$this->currentapp}' $filter ORDER BY id ");
+                       $this->db->query("SELECT * FROM phpgw_acl_location 
WHERE appname = 'property' $filter ORDER BY id ");
 
                                $i = 0;
                                while ($this->db->next_record())

Modified: trunk/property/inc/class.soadmin_entity.inc.php
===================================================================
--- trunk/property/inc/class.soadmin_entity.inc.php     2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/inc/class.soadmin_entity.inc.php     2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -38,7 +38,7 @@
 
                function property_soadmin_entity($entity_id='',$cat_id='')
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $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();
@@ -85,8 +85,8 @@
                        $querymethod = '';
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
                                $querymethod = " where name $this->like 
'%$query%' or descr $this->like '%$query%'";
                        }
@@ -145,8 +145,8 @@
                        $querymethod = '';
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
                                $querymethod = " AND name $this->like 
'%$query%' or descr $this->like '%$query%'";
                        }
@@ -178,72 +178,6 @@
                        return $standard;
                }
 
-               function read_status($data)
-               {
-                       if(is_array($data))
-                       {
-                               if ($data['start'])
-                               {
-                                       $start=$data['start'];
-                               }
-                               else
-                               {
-                                       $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']:'');
-                               $entity_id = 
(isset($data['entity_id'])?$data['entity_id']:'');
-                               $cat_id = 
(isset($data['cat_id'])?$data['cat_id']:'');
-                       }
-
-                       if ($order)
-                       {
-                               $ordermethod = " order by $order $sort";
-
-                       }
-                       else
-                       {
-                               $ordermethod = ' order by id asc';
-                       }
-
-                       $table  = 'fm_entity_'. $entity_id .'_'.$cat_id . 
'_status';
-
-                       if($query)
-                       {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
-
-                               $querymethod = " AND name $this->like 
'%$query%' or descr $this->like '%$query%'";
-                       }
-
-                       $sql = "SELECT * FROM $table $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())
-                       {
-                               $status[] = array
-                               (
-                                       'id'    => $this->db->f('id'),
-                                       'descr' => $this->db->f('descr')
-                               );
-                       }
-                       return $status;
-               }
-
-
                function read_single($id)
                {
 
@@ -313,23 +247,6 @@
                        return $this->db->f('name');
                }
 
-               function read_single_status($entity_id,$cat_id,$id)
-               {
-
-                       $table  = 'fm_entity_'. $entity_id .'_'.$cat_id . 
'_status';
-                       $sql = "SELECT * FROM $table  where id='$id'";
-
-                       $this->db->query($sql,__LINE__,__FILE__);
-
-                       if ($this->db->next_record())
-                       {
-                               $status['id']                           = 
$this->db->f('id');
-                               $status['descr']                        = 
$this->db->f('descr');
-
-                               return $status;
-                       }
-               }
-
                function add_entity($entity)
                {
                        $entity['name'] = 
$this->db->db_addslashes($entity['name']);
@@ -352,7 +269,7 @@
 
 
                        $values_acl_location= array(
-                               $this->currentapp,
+                       //      $this->currentapp,
                                '.entity.' . $entity['id'],
                                $entity['name'],
                                1
@@ -369,30 +286,6 @@
                        return $receipt;
                }
 
-
-               function add_status($values,$entity_id,$cat_id)
-               {
-                       $values['id'] = $this->db->db_addslashes($values['id']);
-                       $values['descr'] = 
$this->db->db_addslashes($values['descr']);
-
-                       $values_insert= array(
-                               $values['id'],
-                               $values['descr'],
-                               );
-
-                       $values_insert  = 
$this->bocommon->validate_db_insert($values_insert);
-
-                       $table  = 'fm_entity_'. $entity_id .'_'.$cat_id . 
'_status';
-
-                       $this->db->query("INSERT INTO $table (id,descr) VALUES 
($values_insert)",__LINE__,__FILE__);
-
-                       $receipt['id']= $values['id'];
-
-                       $receipt['message'][] = array('msg'=> lang('status has 
been added'));
-                       return $receipt;
-               }
-
-
                function get_default_column_def()
                {
                
@@ -451,7 +344,7 @@
                                . "VALUES ($values_insert)",__LINE__,__FILE__);
 
                        $values_acl_location= array(
-                               $this->currentapp,
+                               'property',
                                '.entity.' . $values['entity_id'] . '.' . 
$values['id'],
                                $values['name'],
                                1
@@ -470,15 +363,8 @@
 
                        $pk[]= 'id';
                        $table                  = 'fm_entity_'. 
$values['entity_id'] .'_'.$values['id'];
-/*
-                       $fd_status['id'] = array('type' => 'varchar', 
'precision' => 20, 'nullable' => False);
-                       $fd_status['descr'] = array('type' => 'varchar', 
'precision' => 255, 'nullable' => False);
-                       $pk_status[]= 'id';
 
-                       $statustable    = $table . '_' .'status';
-*/
                        if(($this->oProc->CreateTable($table,array('fd' => 
$fd,'pk' => $pk,'fk' => $fk,'ix' => array('location_code'),'uc' => array()))))
-//                             && 
($this->oProc->CreateTable($statustable,array('fd' => $fd_status,'pk' => 
$pk_status,'fk' => $fk_status,'ix' => False,'uc' => array()))))
                        {
 
                                $values_insert= array(
@@ -518,25 +404,6 @@
                        return $receipt;
                }
 
-               function edit_status($values,$entity_id,$cat_id)
-               {
-                       $table  = 'fm_entity_'. $entity_id .'_'.$cat_id . 
'_status';
-
-                       $values['descr'] = 
$this->db->db_addslashes($values['descr']);
-
-                       $value_set=array(
-                               'descr'                 => $values['descr'],
-                               );
-
-                       $value_set      = 
$this->bocommon->validate_db_update($value_set);
-
-                       $this->db->query("UPDATE $table set $value_set WHERE 
id='" . $values['id'] . "'",__LINE__,__FILE__);
-
-                       $receipt['message'][] = array('msg'=> lang('Status has 
been edited'));
-
-                       return $receipt;
-               }
-
                function edit_entity($entity)
                {
                        if (!$entity['name'])
@@ -576,7 +443,7 @@
 
                                $value_set_acl  = 
$this->bocommon->validate_db_update($value_set_acl);
 
-                               $this->db->query("UPDATE phpgw_acl_location set 
$value_set_acl WHERE appname = '" . $this->currentapp . "' AND id='.entity." . 
$entity['id']. "'",__LINE__,__FILE__);
+                               $this->db->query("UPDATE phpgw_acl_location set 
$value_set_acl WHERE appname = '" . 'property' . "' AND id='.entity." . 
$entity['id']. "'",__LINE__,__FILE__);
 
                                $this->db->query("DELETE FROM fm_entity_lookup 
WHERE type='lookup' AND entity_id=" . $entity['id'],__LINE__,__FILE__);
                                if (isset($entity['include_entity_for']) AND 
is_array($entity['include_entity_for']))
@@ -613,7 +480,6 @@
 
                function edit_category($entity)
                {
-
                        if (!$entity['name'])
                        {
                                $receipt['error'][] = array('msg'=>lang('Name 
not entered!'));
@@ -649,7 +515,7 @@
 
                                $value_set_acl  = 
$this->bocommon->validate_db_update($value_set_acl);
 
-                               $this->db->query("UPDATE phpgw_acl_location set 
$value_set_acl WHERE appname = '" . $this->currentapp . "' AND id='.entity." . 
$entity['entity_id']. "." . $entity['id']. "'",__LINE__,__FILE__);
+                               $this->db->query("UPDATE phpgw_acl_location set 
$value_set_acl WHERE appname = '" . 'property' . "' AND id='.entity." . 
$entity['entity_id']. "." . $entity['id']. "'",__LINE__,__FILE__);
 
 
                                $receipt['message'][] = array('msg'=> 
lang('entity has been edited'));
@@ -668,8 +534,9 @@
                        $this->db->query("DELETE FROM fm_entity WHERE 
id=$id",__LINE__,__FILE__);
                        $this->db->query("DELETE FROM fm_entity_category WHERE 
entity_id=$id",__LINE__,__FILE__);
                        $this->db->query("DELETE FROM fm_entity_attribute WHERE 
entity_id=$id",__LINE__,__FILE__);
-                       $this->db->query("DELETE FROM phpgw_acl_location WHERE 
appname = '" . $this->currentapp . "' AND id " . $this->like ."'.entity." . $id 
."%'",__LINE__,__FILE__);
-                       $this->db->query("DELETE FROM phpgw_acl WHERE 
acl_appname = '" . $this->currentapp . "' AND  acl_location $this->like 
'.entity." . $id ."%'",__LINE__,__FILE__);
+                       $this->db->query("DELETE FROM phpgw_cust_attribute 
WHERE appname='property' AND location " . $this->like . " '.entity." . 
$entity_id ."%'",__LINE__,__FILE__);
+                       $this->db->query("DELETE FROM phpgw_acl_location WHERE 
appname = '" . 'property' . "' AND id " . $this->like ."'.entity." . $id 
."%'",__LINE__,__FILE__);
+                       $this->db->query("DELETE FROM phpgw_acl WHERE 
acl_appname = '" . 'property' . "' AND  acl_location $this->like '.entity." . 
$id ."%'",__LINE__,__FILE__);
                        if (isset($category_list) AND is_array($category_list))
                        {
                                $this->init_process();
@@ -682,19 +549,17 @@
 
                }
 
-               function delete_category($id,$entity_id)
+               function delete_category($entity_id, $id)
                {
                        $this->init_process();
                        $this->oProc->DropTable('fm_entity_' . $entity_id . '_' 
. $id);
-//                     $this->oProc->DropTable('fm_entity_' . $entity_id . '_' 
. $id . '_' . 'status');
                        $this->db->query("DELETE FROM fm_entity_category WHERE 
entity_id= $entity_id AND id= $id",__LINE__,__FILE__);
-                       $this->db->query("DELETE FROM fm_entity_attribute WHERE 
entity_id= $entity_id AND cat_id= $id",__LINE__,__FILE__);
-                       $this->db->query("DELETE FROM phpgw_acl_location WHERE 
appname = '" . $this->currentapp . "' AND id='.entity." . $entity_id . "." . 
$id ."'",__LINE__,__FILE__);
-                       $this->db->query("DELETE FROM phpgw_acl WHERE 
acl_appname = '" . $this->currentapp . "' AND  acl_location='.entity." . 
$entity_id . "." . $id ."'",__LINE__,__FILE__);
+                       $this->db->query("DELETE FROM phpgw_cust_attribute 
WHERE appname='property' AND location='.entity." . $entity_id . "." . $id 
."'",__LINE__,__FILE__);
+                       $this->db->query("DELETE FROM phpgw_acl_location WHERE 
appname = '" . 'property' . "' AND id='.entity." . $entity_id . "." . $id 
."'",__LINE__,__FILE__);
+                       $this->db->query("DELETE FROM phpgw_acl WHERE 
acl_appname = '" . 'property' . "' AND  acl_location='.entity." . $entity_id . 
"." . $id ."'",__LINE__,__FILE__);
                        $this->db->query("DELETE FROM fm_entity_history WHERE 
history_appname = 'entity_" . $entity_id  . '_' . $id . "'",__LINE__,__FILE__);
                }
 
-
                function get_table_def($entity_id,$cat_id)
                {
                        $table = 'fm_entity_' . $entity_id . '_' . $cat_id;
@@ -751,719 +616,16 @@
                        return $table_def;
                }
 
-
-               function delete_attrib($cat_id,$entity_id,$attrib_id)
+               function delete_history($entity_id, $cat_id, $attrib_id)
                {
-                       $this->init_process();
-                       $this->oProc->m_odb->transaction_begin();
-                       $this->db->transaction_begin();
-
-                       $sql = "SELECT * FROM fm_entity_attribute WHERE 
entity_id=$entity_id AND cat_id=$cat_id AND id=$attrib_id";
-
-                       $this->db->query($sql,__LINE__,__FILE__);
-                       $this->db->next_record();
-
-                       $ColumnName             = $this->db->f('column_name');
-                       $table  = 'fm_entity_'. $entity_id .'_'.$cat_id;
-                       $table_def = $this->get_table_def($entity_id,$cat_id);  
-                       $this->oProc->m_aTables = $table_def;
-
-                       $this->oProc->DropColumn($table,$table_def[$table], 
$ColumnName);
-
-                       $sql = "SELECT attrib_sort FROM fm_entity_attribute 
where entity_id=$entity_id AND cat_id=$cat_id AND id=$attrib_id";
-                       $this->db->query($sql,__LINE__,__FILE__);
-                       $this->db->next_record();
-                       $attrib_sort    = $this->db->f('attrib_sort');
-                       $sql2 = "SELECT max(attrib_sort) as max_sort FROM 
fm_entity_attribute where entity_id=$entity_id AND cat_id=$cat_id";
-                       $this->db->query($sql2,__LINE__,__FILE__);
-                       $this->db->next_record();
-                       $max_sort       = $this->db->f('max_sort');
-                       if($max_sort>$attrib_sort)
-                       {
-                               $sql = "UPDATE fm_entity_attribute set 
attrib_sort=attrib_sort-1 WHERE entity_id=$entity_id AND cat_id=$cat_id AND 
attrib_sort > $attrib_sort";
-                               $this->db->query($sql,__LINE__,__FILE__);
-                       }
-
-                       $this->db->query("DELETE FROM fm_entity_attribute WHERE 
entity_id=$entity_id AND cat_id=$cat_id AND id=$attrib_id",__LINE__,__FILE__);
                        $this->db->query("DELETE FROM fm_entity_history WHERE 
history_appname = 'entity_" . $entity_id  . '_' . $cat_id . "' AND 
history_entity_attrib_id = $attrib_id",__LINE__,__FILE__);
-                       $this->db->transaction_commit();
-                       $this->oProc->m_odb->transaction_commit();
-
                }
 
-               function delete_status($cat_id,$entity_id,$status_id)
-               {
-                       $table  = 'fm_entity_'. $entity_id .'_'.$cat_id . 
'_status';
-
-                       $this->db->query("DELETE FROM $table WHERE 
id='$status_id'",__LINE__,__FILE__);
-               }
-
-               function read_attrib($data)
-               {
-                       if(is_array($data))
-                       {
-                               $start = isset($data['start']) && 
$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']:'');
-                               $entity_id = 
(isset($data['entity_id'])?$data['entity_id']:0);
-                               $cat_id = 
(isset($data['cat_id'])?$data['cat_id']:0);
-                               $filter_list = 
(isset($data['filter_list'])?$data['filter_list']:'');
-                       }
-
-                       if ($order)
-                       {
-                               $ordermethod = " order by $order $sort";
-
-                       }
-                       else
-                       {
-                               $ordermethod = ' order by attrib_sort asc';
-                       }
-
-                       if($filter_list)
-                       {
-                               $filter_list = "AND list is NULL";
-                       } 
-                       $querymethod = '';
-                       if($query)
-                       {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
-
-                               $querymethod = " AND (fm_entity_attribute.name 
$this->like '%$query%' or fm_entity_attribute.descr $this->like '%$query%')";
-                       }
-
-                       $sql = "SELECT * FROM fm_entity_attribute WHERE 
entity_id=$entity_id AND cat_id = $cat_id $filter_list $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())
-                       {
-                               $attrib[] = array
-                               (
-                                       'id'            => $this->db->f('id'),
-                                       'entity_type'   => 
$this->db->f('type_id'),
-                                       'attrib_sort'   => 
$this->db->f('attrib_sort'),
-                                       'list'          => $this->db->f('list'),
-                                       'lookup_form'   => 
$this->db->f('lookup_form'),
-                                       'entity_form'   => 
$this->db->f('entity_form'),
-                                       'column_name'   => 
$this->db->f('column_name'),
-                                       'name'          => 
$this->db->f('input_text'),
-                                       'size'          => $this->db->f('size'),
-                                       'statustext'    => 
$this->db->f('statustext'),
-                                       'input_text'    => 
$this->db->f('input_text'),
-                                       'type_name'     => $this->db->f('type'),
-                                       'datatype'      => 
$this->db->f('datatype'),
-                                       'search'        => 
$this->db->f('search')
-                               );
-                       }
-                       return $attrib;
-               }
-
-               function read_single_attrib($entity_id,$cat_id,$id)
-               {
-                       $sql = "SELECT * FROM fm_entity_attribute where 
entity_id=$entity_id AND cat_id=$cat_id AND id=$id";
-
-                       $this->db->query($sql,__LINE__,__FILE__);
-
-                       if ($this->db->next_record())
-                       {
-                               $attrib['id']                                   
        = $this->db->f('id');
-                               $attrib['column_name']                          
= $this->db->f('column_name');
-                               $attrib['input_text']                           
= $this->db->f('input_text');
-                               $attrib['statustext']                           
= $this->db->f('statustext');
-                               $attrib['column_info']['precision']     = 
$this->db->f('precision_');
-                               $attrib['column_info']['scale']         = 
$this->db->f('scale');
-                               $attrib['column_info']['default']       = 
$this->db->f('default_value');
-                               $attrib['column_info']['nullable']      = 
$this->db->f('nullable');
-                               $attrib['column_info']['type']          = 
$this->db->f('datatype');
-                               $attrib['type_id']                              
        = $this->db->f('type_id');
-                               $attrib['type_name']                            
= $this->db->f('type_name');
-                               $attrib['lookup_form']                          
= $this->db->f('lookup_form');
-                               $attrib['list']                                 
        = $this->db->f('list');
-                               $attrib['search']                               
        = $this->db->f('search');
-                               $attrib['history']                              
        = $this->db->f('history');
-                               $attrib['disabled']                             
        = $this->db->f('disabled');
-                               $attrib['helpmsg']                              
        = $this->db->f('helpmsg');
-                               if($this->db->f('datatype')=='R' || 
$this->db->f('datatype')=='CH' || $this->db->f('datatype')=='LB')
-                               {
-                                       $attrib['choice'] = 
$this->read_attrib_choice($entity_id,$cat_id,$id);
-                               }
-
-                               return $attrib;
-                       }
-               }
-
-               function read_attrib_choice($entity_id,$cat_id,$attrib_id)
-               {
-                       $choice_table = 'fm_entity_choice';
-                       $sql = "SELECT * FROM $choice_table WHERE 
entity_id=$entity_id AND cat_id=$cat_id AND attrib_id=$attrib_id ORDER BY id";
-                       $this->db->query($sql,__LINE__,__FILE__);
-
-                       while ($this->db->next_record())
-                       {
-                               $choice[] = array
-                               (
-                                       'id'    => $this->db->f('id'),
-                                       'value' => $this->db->f('value')
-                               );
-                       }
-                       return $choice;
-               }
-
-               function add_attrib($attrib)
-               {
-                       $attrib['column_name'] = 
strtolower($this->db->db_addslashes($attrib['column_name']));
-                       $attrib['input_text'] = 
$this->db->db_addslashes($attrib['input_text']);
-                       $attrib['statustext'] = 
$this->db->db_addslashes($attrib['statustext']);
-                       $attrib['helpmsg'] = 
$this->db->db_addslashes($attrib['helpmsg']);
-                       $attrib['default'] = 
$this->db->db_addslashes($attrib['default']);
-                       $attrib['id'] = 
$this->bocommon->next_id('fm_entity_attribute',array('entity_id'=>$attrib['entity_id'],'cat_id'=>$attrib['cat_id']));
-
-                       $sql = "SELECT * FROM fm_entity_attribute WHERE 
entity_id= '{$attrib['entity_id']}' AND cat_id='{$attrib['cat_id']}' AND 
column_name = '{$attrib['column_name']}'";
-                       $this->db->query($sql,__LINE__,__FILE__);
-                       if ( $this->db->next_record() )
-                       {
-                               $receipt['id'] = '';
-                               $receipt['error'] = array();
-                               $receipt['error'][] = array('msg' => 
lang('field already exists, please choose another name'));
-                               $receipt['error'][] = array('msg'       => 
lang('Attribute has NOT been saved'));
-                               return $receipt; //no point continuing
-                       }
-
-
-                       $sql = "SELECT max(attrib_sort) as max_sort FROM 
fm_entity_attribute where entity_id=" . $attrib['entity_id'] . " AND cat_id=" . 
$attrib['cat_id'];
-                       $this->db->query($sql,__LINE__,__FILE__);
-                       $this->db->next_record();
-                       $attrib_sort    = $this->db->f('max_sort')+1;
-               
-                       if($attrib['column_info']['type']=='R' || 
$attrib['column_info']['type']== 'CH' || $attrib['column_info']['type'] =='LB' 
|| $attrib['column_info']['type'] =='AB' || $attrib['column_info']['type'] 
=='VENDOR')
-                       {
-                               if ($attrib['history'])
-                               {
-                                       $receipt['error'][] = array('msg'       
=> lang('History not allowed for this datatype'));
-                               }
-
-                               $attrib['history'] = False;
-                       }
-
-                       $values= array(
-                               $attrib['entity_id'],
-                               $attrib['cat_id'],
-                               $attrib['id'],
-                               $attrib['column_name'],
-                               $attrib['input_text'],
-                               $attrib['statustext'],
-                               $attrib['search'],
-                               $attrib['list'],
-                               $attrib['history'],
-                               $attrib['disabled'],
-                               $attrib['helpmsg'],
-                               $attrib_sort,
-                               $attrib['column_info']['type'],
-                               $attrib['column_info']['precision'],
-                               $attrib['column_info']['scale'],
-                               $attrib['column_info']['default'],
-                               $attrib['column_info']['nullable']
-                               );
-
-                       $values = $this->bocommon->validate_db_insert($values);
-
-                       $this->db->transaction_begin();
-
-                       $this->db->query("INSERT INTO fm_entity_attribute 
(entity_id,cat_id,id,column_name, input_text, 
statustext,search,list,history,disabled,helpmsg,attrib_sort, 
datatype,precision_,scale,default_value,nullable) "
-                               . "VALUES ($values)",__LINE__,__FILE__);
-
-                       $receipt['id']= $attrib['id'];
-
-                       if($attrib['column_info']['type']=='email' && 
!$attrib['column_info']['precision'])
-                       {
-                               $attrib['column_info']['precision']=64;
-                       }
-
-                       if(!$attrib['column_info']['precision'])
-                       {
-                               
$attrib['column_info']['precision']=$this->bocommon->translate_datatype_precision($attrib['column_info']['type']);
-                       }
-
-                       $attrib['column_info']['type']  = 
$this->bocommon->translate_datatype_insert($attrib['column_info']['type']);
-
-                       if(!$attrib['column_info']['default'])
-                       {
-                               unset($attrib['column_info']['default']);
-                       }
-
-                       $this->init_process();
-
-                       
if($this->oProc->AddColumn('fm_entity_'.$attrib['entity_id'] . '_' . 
$attrib['cat_id'],$attrib['column_name'], $attrib['column_info']))
-                       {
-                               $receipt['message'][] = array('msg'     => 
lang('Attribute has been saved')     );
-                               $this->db->transaction_commit();
-
-                       }
-                       else
-                       {
-                               $receipt['error'][] = array('msg'       => 
lang('column could not be added')    );
-                               if($this->db->Transaction)
-                               {
-                                       $this->db->transaction_abort();
-                               }
-                               else
-                               {
-                                       $this->db->query("DELETE FROM 
fm_entity_attribute WHERE entity_id=" . $attrib['entity_id']. " AND cat_id=" . 
$attrib['id']. " AND id='" . $receipt['id'] . "'",__LINE__,__FILE__);
-                                       unset($receipt['id']);
-
-                               }
-                       }
-
-                       return $receipt;
-               }
-
                function init_process()
                {
                        $this->oProc                            = 
CreateObject('phpgwapi.schema_proc',$GLOBALS['phpgw_info']['server']['db_type']);
-                       $this->oProc->m_odb                     = $this->db;
-                       $this->oProc->m_odb->Halt_On_Error      = 'report';
+                       $this->oProc->m_odb                     = & $this->db;
+                       $this->oProc->m_odb->Halt_On_Error      = 'yes';
                }
-
-               function edit_attrib($attrib)
-               {
-                       $choice_table = 'fm_entity_choice';
-
-                       $attrib['column_name'] = 
strtolower($this->db->db_addslashes($attrib['column_name']));
-                       $attrib['input_text'] = 
$this->db->db_addslashes($attrib['input_text']);
-                       $attrib['statustext'] = 
$this->db->db_addslashes($attrib['statustext']);
-                       $attrib['helpmsg'] = 
$this->db->db_addslashes($attrib['helpmsg']);
-                       $attrib['column_info']['default'] = 
$this->db->db_addslashes($attrib['column_info']['default']);
-
-                       if($attrib['column_info']['type']=='R' || 
$attrib['column_info']['type']== 'CH' || $attrib['column_info']['type'] =='LB' 
|| $attrib['column_info']['type'] =='AB' || $attrib['column_info']['type'] 
=='VENDOR')
-                       {
-                               if ($attrib['history'])
-                               {
-                                       $receipt['error'][] = array('msg'       
=> lang('History not allowed for this datatype'));
-                               }
-                               
-                               $attrib['history'] = False;
-                       }
-
-                       $this->db->query("SELECT column_name, 
datatype,precision_ FROM fm_entity_attribute WHERE entity_id=" . 
$attrib['entity_id']. " AND cat_id=" . $attrib['cat_id']. " AND id='" . 
$attrib['id']. "'",__LINE__,__FILE__);
-                       $this->db->next_record();
-                       $OldColumnName          = $this->db->f('column_name');
-                       $OldDataType            = $this->db->f('datatype');
-                       $OldPrecision           = $this->db->f('precision_');   
                
-                       
-                       $table_def = 
$this->get_table_def($attrib['entity_id'],$attrib['cat_id']);      
-
-                       $this->db->transaction_begin();
-
-                       $value_set=array(
-                               'input_text'    => $attrib['input_text'],
-                               'statustext'    => $attrib['statustext'],
-                               'search'                => 
(isset($attrib['search'])?$attrib['search']:''),
-                               'list'                  => 
(isset($attrib['list'])?$attrib['list']:''),
-                               'history'               => 
(isset($attrib['history'])?$attrib['history']:''),
-                               'nullable'              => 
$attrib['column_info']['nullable'],
-                               'disabled'              => 
(isset($attrib['disabled'])?$attrib['disabled']:''),
-                               'helpmsg'               => $attrib['helpmsg'],
-                               );
-
-                       $value_set      = 
$this->bocommon->validate_db_update($value_set);
-
-                       $this->db->query("UPDATE fm_entity_attribute set 
$value_set WHERE entity_id=" . $attrib['entity_id']. " AND cat_id=" . 
$attrib['cat_id']. " AND id=" . $attrib['id'],__LINE__,__FILE__);
-
-                       $this->init_process();
-                       
-                       $this->oProc->m_odb->transaction_begin();
-
-                       $this->oProc->m_aTables = $table_def;
-
-                       if($OldColumnName !=$attrib['column_name'])
-                       {
-                               $value_set=array('column_name'  => 
$attrib['column_name']);
-
-                               $value_set      = 
$this->bocommon->validate_db_update($value_set);
-
-                               $this->db->query("UPDATE fm_entity_attribute 
set $value_set WHERE entity_id=" . $attrib['entity_id']. " AND cat_id=" . 
$attrib['cat_id']. " AND id=" . $attrib['id'],__LINE__,__FILE__);
-
-                               
$this->oProc->RenameColumn('fm_entity_'.$attrib['entity_id'] . '_' . 
$attrib['cat_id'], $OldColumnName, $attrib['column_name']);
-                       }
-
-                       if (($OldDataType != $attrib['column_info']['type']) || 
($OldPrecision != $attrib['column_info']['precision']) )
-                       {
-                               if($attrib['column_info']['type']!='R' && 
$attrib['column_info']['type']!='CH' && $attrib['column_info']['type']!='LB')
-                               {
-                                       $this->db->query("DELETE FROM 
$choice_table WHERE entity_id=" . $attrib['entity_id']. " AND cat_id=" . 
$attrib['cat_id']. " AND attrib_id=" . $attrib['id'],__LINE__,__FILE__);
-                               }
-
-                               if(!$attrib['column_info']['precision'])
-                               {
-                                       if($precision = 
$this->bocommon->translate_datatype_precision($attrib['column_info']['type']))
-                                       {
-                                               
$attrib['column_info']['precision']=$precision;
-                                       }
-                               }
-
-                               if(!isset($attrib['column_info']['default']))
-                               {
-                                       
unset($attrib['column_info']['default']);
-                               }
-
-                               $value_set=array(
-                                       'column_name'   => 
$attrib['column_name'],
-                                       'datatype'              => 
$attrib['column_info']['type'],
-                                       'precision_'    => 
$attrib['column_info']['precision'],
-                                       'scale'                 => 
$attrib['column_info']['scale'],
-                                       'default_value' => 
$attrib['column_info']['default'],
-                                       'nullable'              => 
$attrib['column_info']['nullable']
-                                       );
-
-                               $value_set      = 
$this->bocommon->validate_db_update($value_set);
-
-                               $this->db->query("UPDATE fm_entity_attribute 
set $value_set WHERE entity_id=" . $attrib['entity_id']. " AND cat_id=" . 
$attrib['cat_id']. " AND id=" . $attrib['id'],__LINE__,__FILE__);
-
-                               $attrib['column_info']['type']  = 
$this->bocommon->translate_datatype_insert($attrib['column_info']['type']);
-                               
$this->oProc->AlterColumn('fm_entity_'.$attrib['entity_id'] . '_' . 
$attrib['cat_id'],$attrib['column_name'],$attrib['column_info']);               
    
-                       }
-                       
-                       if(isset($attrib['new_choice']) && 
$attrib['new_choice'])
-                       {
-                               $choice_id = 
$this->bocommon->next_id($choice_table 
,array('entity_id'=>$attrib['entity_id'],'cat_id'=>$attrib['cat_id'],'attrib_id'=>$attrib['id']));
-
-                               $values= array(
-                                       $attrib['entity_id'],
-                                       $attrib['cat_id'],
-                                       $attrib['id'],
-                                       $choice_id,
-                                       $attrib['new_choice']
-                                       );
-
-                               $values = 
$this->bocommon->validate_db_insert($values);
-
-                               $this->db->query("INSERT INTO $choice_table 
(entity_id,cat_id,attrib_id,id,value) "
-                               . "VALUES ($values)",__LINE__,__FILE__);
-                       }
-
-                       if(isset($attrib['delete_choice']) && 
is_array($attrib['delete_choice']))
-                       {
-                               for 
($i=0;$i<count($attrib['delete_choice']);$i++)
-                               {
-                                       $this->db->query("DELETE FROM 
$choice_table WHERE entity_id=" . $attrib['entity_id']. " AND cat_id=" . 
$attrib['cat_id']. " AND attrib_id=" . $attrib['id']  ." AND id=" . 
$attrib['delete_choice'][$i],__LINE__,__FILE__);
-                               }
-                       }
-
-                       $this->db->transaction_commit();
-                       $this->oProc->m_odb->transaction_commit();
-                       $receipt['message'][] = array('msg'     => 
lang('Attribute has been edited'));
-
-                       return $receipt;
-               }
-
-               function resort_attrib($data)
-               {
-                       if(is_array($data))
-                       {
-                               $resort = 
(isset($data['resort'])?$data['resort']:'up');
-                               $entity_id = 
(isset($data['entity_id'])?$data['entity_id']:0);
-                               $cat_id = 
(isset($data['cat_id'])?$data['cat_id']:0);
-                               $id = (isset($data['id'])?$data['id']:'');
-                       }
-
-                       $sql = "SELECT attrib_sort FROM fm_entity_attribute 
where entity_id=$entity_id AND cat_id=$cat_id AND id=$id";
-                       $this->db->query($sql,__LINE__,__FILE__);
-                       $this->db->next_record();
-                       $attrib_sort    = $this->db->f('attrib_sort');
-                       $sql2 = "SELECT max(attrib_sort) as max_sort FROM 
fm_entity_attribute where entity_id=$entity_id AND cat_id=$cat_id";
-                       $this->db->query($sql2,__LINE__,__FILE__);
-                       $this->db->next_record();
-                       $max_sort       = $this->db->f('max_sort');
-
-                       switch($resort)
-                       {
-                               case 'up':
-                                       if($attrib_sort>1)
-                                       {
-                                               $sql = "UPDATE 
fm_entity_attribute set attrib_sort=$attrib_sort WHERE entity_id=$entity_id AND 
cat_id=$cat_id AND attrib_sort =" . ($attrib_sort-1);
-                                               
$this->db->query($sql,__LINE__,__FILE__);
-                                               $sql = "UPDATE 
fm_entity_attribute set attrib_sort=" . ($attrib_sort-1) ." WHERE 
entity_id=$entity_id AND cat_id=$cat_id AND id=$id";
-                                               
$this->db->query($sql,__LINE__,__FILE__);
-                                       }
-                                       break;
-                               case 'down':
-                                       if($max_sort > $attrib_sort)
-                                       {
-                                               $sql = "UPDATE 
fm_entity_attribute set attrib_sort=$attrib_sort WHERE entity_id=$entity_id AND 
cat_id=$cat_id AND attrib_sort =" . ($attrib_sort+1);
-                                               
$this->db->query($sql,__LINE__,__FILE__);
-                                               $sql = "UPDATE 
fm_entity_attribute set attrib_sort=" . ($attrib_sort+1) ." WHERE 
entity_id=$entity_id AND cat_id=$cat_id AND id=$id";
-                                               
$this->db->query($sql,__LINE__,__FILE__);
-                                       }
-                                       break;
-                               default:
-                                       return;
-                                       break;
-                       }
-               }
-
-               function read_custom_function($data)
-               {
-                       if(isset($data) && is_array($data))
-                       {
-                               $start = isset($data['start']) && 
$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(!$acl_location)
-                       {
-                               return;
-                       }
-
-                       if ($order)
-                       {
-                               $ordermethod = " order by $order $sort";
-                       }
-                       else
-                       {
-                               $ordermethod = ' order by custom_sort asc';
-                       }
-
-                       $table = 'fm_custom_function';
-
-                       $querymethod = '';
-                       if(isset($query) && $query)
-                       {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
-
-                               $querymethod = " AND name $this->like 
'%$query%' or descr $this->like '%$query%'";
-                       }
-
-                       $sql = "SELECT * FROM $table WHERE 
acl_location='$acl_location' $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__);
-                       }
-
-                       $custom_function = array();
-                       while ($this->db->next_record())
-                       {
-                               $custom_function[] = array
-                               (
-                                       'id'    => $this->db->f('id'),
-                                       'file_name'     => 
$this->db->f('file_name'),
-                                       'sorting'       => 
$this->db->f('custom_sort'),
-                                       'descr'         => 
$this->db->f('descr'),
-                                       'active'        => 
$this->db->f('active')
-                               );
-                       }
-                       return $custom_function;
-               }
-
-
-               function read_single_custom_function($acl_location,$id)
-               {
-
-                       $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'] && 
$custom_function['entity_id'] && $custom_function['cat_id'])
-                       {
-                               $acl_location = '.entity.' . 
$custom_function['entity_id'] . '.' . $custom_function['cat_id'];
-                       }
-                       else
-                       {
-                               $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->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)
-               {
-                       if(!$custom_function['acl_location'] && 
$custom_function['entity_id'] && $custom_function['cat_id'])
-                       {
-                               $acl_location = '.entity.' . 
$custom_function['entity_id'] . '.' . $custom_function['cat_id'];
-                       }
-                       else
-                       {
-                               $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');
-                               $entity_id = 
(isset($data['entity_id'])?$data['entity_id']:'');
-                               $cat_id = 
(isset($data['cat_id'])?$data['cat_id']:'');
-                               $acl_location = 
(isset($data['acl_location'])?$data['acl_location']:'');
-                               $id = (isset($data['id'])?$data['id']:'');
-                       }
-
-                       if(!$acl_location && $entity_id && $cat_id)
-                       {
-                               $acl_location = '.entity.' . $entity_id . '.' . 
$cat_id;
-                       }
-                       else
-                       {
-                               $acl_location = $acl_location;
-                       }
-
-                       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($acl_location,$custom_function_id)
-               {
-                       $sql = "SELECT custom_sort FROM fm_custom_function 
where acl_location='$acl_location' AND id=$custom_function_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=$custom_function_id",__LINE__,__FILE__);
-               }
        }
 ?>

Modified: trunk/property/inc/class.soadmin_location.inc.php
===================================================================
--- trunk/property/inc/class.soadmin_location.inc.php   2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/inc/class.soadmin_location.inc.php   2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -34,24 +34,11 @@
 
        class property_soadmin_location
        {
-               var $grants;
-               var $currentapp;
-
-               function property_soadmin_location($currentapp='')
-               {
-                       if($currentapp)
+               function property_soadmin_location()
                        {
-                               $this->currentapp       = $currentapp;
-                       }
-                       else
-                       {
-                               $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];                        
-                       }
-
                        $this->account          = 
$GLOBALS['phpgw_info']['user']['account_id'];
-                       $this->bocommon         = 
CreateObject('property.bocommon',$this->currentapp);
+                       $this->bocommon         = 
CreateObject('property.bocommon','property');
                        $this->db               = $this->bocommon->new_db();
-                       $this->db2              = $this->bocommon->new_db();
 
                        $this->join             = $this->bocommon->join;
                        $this->like             = $this->bocommon->like;
@@ -65,9 +52,9 @@
                function read($data)
                {
                        $start  = isset($data['start']) && $data['start'] ? 
$data['start'] : 0;
-                       $query  = (isset($data['query'])?$data['query']:'');
-                       $sort   = (isset($data['sort'])?$data['sort']:'DESC');
-                       $order  = (isset($data['order'])?$data['order']:'');
+                       $query  = isset($data['query'])?$data['query']:'';
+                       $sort   = isset($data['sort']) && $data['sort'] ? 
$data['sort'] : 'DESC';
+                       $order  = isset($data['order'])?$data['order']:'';
 
                        if ($order)
                        {
@@ -84,16 +71,16 @@
                        $querymethod = '';
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
                                $querymethod = " where name $this->like 
'%$query%' or descr $this->like '%$query%'";
                        }
 
                        $sql = "SELECT * FROM $table $querymethod";
 
-                       $this->db2->query($sql,__LINE__,__FILE__);
-                       $this->total_records = $this->db2->num_rows();
+                       $this->db->query($sql,__LINE__,__FILE__);
+                       $this->total_records = $this->db->num_rows();
                        $this->db->limit_query($sql . 
$ordermethod,$start,__LINE__,__FILE__);
 
                        while ($this->db->next_record())
@@ -139,16 +126,16 @@
                        $querymethod = '';
                        if(isset($query))
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
                                $querymethod = " where name $this->like 
'%$query%' or column_name $this->like '%$query%'";
                        }
 
                        $sql = "SELECT fm_location_config.* 
,fm_location_type.name as name FROM fm_location_config  $this->join 
fm_location_type on fm_location_config.location_type=fm_location_type.id 
$querymethod";
 
-                       $this->db2->query($sql,__LINE__,__FILE__);
-                       $this->total_records = $this->db2->num_rows();
+                       $this->db->query($sql,__LINE__,__FILE__);
+                       $this->total_records = $this->db->num_rows();
 
                        $this->db->limit_query($sql . 
$ordermethod,$start,__LINE__,__FILE__);
 
@@ -332,7 +319,7 @@
 
                        for ($i=1; $i<$standard['id']; $i++)
                        {
-                               $fk['loc' . $i] = $fk_table . '.loc' . $i;
+                               $fk[$fk_table]['loc' . $i]      = 'loc' . $i;
                        }
 
                        if($standard['id']==1)
@@ -358,6 +345,7 @@
 
                        $this->oProc->m_odb->transaction_begin();
                        $this->db->transaction_begin();
+
                        if($this->oProc->CreateTable('fm_location'. 
$standard['id'],array('fd' => $fd,'pk' => $pk,'fk' => $fk,'ix' => $ix,'uc' => 
$uc))
                                && $this->oProc->CreateTable('fm_location'. 
$standard['id'] . '_history',array('fd' => $fd_history)))
                        {
@@ -394,7 +382,8 @@
                                for ($i=0;$i<count($default_attrib['id']);$i++)
                                {
                                        $values_insert= array(
-                                               $standard['id'],
+                                               'property',
+                                               '.location.'.$standard['id'],
                                                $default_attrib['id'][$i],
                                                
$default_attrib['column_name'][$i],
                                                $default_attrib['type'][$i],
@@ -408,25 +397,25 @@
 
                                        $values_insert  = 
$this->bocommon->validate_db_insert($values_insert);
 
-                                       $this->db->query("INSERT INTO 
fm_location_attrib 
(type_id,id,column_name,datatype,precision_,input_text,statustext,attrib_sort,custom,nullable)
 "
+                                       $this->db->query("INSERT INTO 
phpgw_cust_attribute 
(appname,location,id,column_name,datatype,precision_,input_text,statustext,attrib_sort,custom,nullable)
 "
                                                . "VALUES 
($values_insert)",__LINE__,__FILE__);
                                }
 
                                $type_id=$standard['id'];
 
-                               $this->db->query("INSERT INTO 
fm_location_choice (type_id,attrib_id,id,value) "
-                                       . "VALUES 
($type_id,$status_id,1,'ok')",__LINE__,__FILE__);
-                               $this->db->query("INSERT INTO 
fm_location_choice (type_id,attrib_id,id,value) "
-                                       . "VALUES ($type_id,$status_id,2,'Not 
Ok')",__LINE__,__FILE__);
+                               $this->db->query("INSERT INTO phpgw_cust_choice 
(appname,location,attrib_id,id,value) "
+                                       . "VALUES 
('property','.location.$type_id',$status_id,1,'ok')",__LINE__,__FILE__);
+                               $this->db->query("INSERT INTO phpgw_cust_choice 
(appname,location,attrib_id,id,value) "
+                                       . "VALUES 
('property','.location.$type_id',$status_id,2,'Not Ok')",__LINE__,__FILE__);
                                $this->db->query("INSERT INTO 
fm_location{$type_id}_category (id,descr) "
                                        . "VALUES (1,'Category 
1')",__LINE__,__FILE__);
                                $this->db->query("INSERT INTO 
fm_location{$type_id}_category (id,descr) "
                                        . "VALUES (99,'Not 
active')",__LINE__,__FILE__);
 
                                $this->db->query("INSERT INTO 
phpgw_acl_location (appname, id, descr)"
-                                       . " VALUES ('" . $this->currentapp 
."','" . '.location.' . $standard['id'] ."', '" . $standard['name'] . "')");
+                                       . " VALUES ('" . 'property' ."','" . 
'.location.' . $standard['id'] ."', '" . $standard['name'] . "')");
                                        
-       //                      
$GLOBALS['phpgw']->acl->add_location('.location.' . $standard['id'], 
$standard['name'], $this->currentapp, $allow_grant = false, $custom_tbl = '');
+       //                      
$GLOBALS['phpgw']->acl->add_location('.location.' . $standard['id'], 
$standard['name'], 'property', $allow_grant = false, $custom_tbl = '');
 
                                $receipt['message'][] = array('msg' => 
lang('table %1 has been saved','fm_location'. $receipt['id']));
                                $this->db->transaction_commit();
@@ -472,26 +461,12 @@
                        return $receipt;
                }
 
-               function delete($type_id,$id,$attrib)
+               function delete($id)
                {
                        $this->init_process();
                        $this->oProc->m_odb->transaction_begin();
                        $this->db->transaction_begin();
 
-                       if($attrib)
-                       {
-                               $table_def = $this->get_table_def($type_id);
-                               $table = 'fm_location_attrib';
-                               $this->db->query("SELECT column_name,type_id 
FROM fm_location_attrib WHERE type_id = '$type_id' AND id='" . $id . 
"'",__LINE__,__FILE__);
-                               $this->db->next_record();
-                               $ColumnName = $this->db->f('column_name');
-
-                               $this->oProc->DropColumn('fm_location' 
.$type_id ,$table_def['fm_location'.$type_id], $ColumnName);
-                               $this->oProc->DropColumn('fm_location' 
.$type_id . '_history',$table_def['fm_location'.$type_id . '_history'], 
$ColumnName);
-                               $this->db->query("DELETE FROM $table WHERE 
type_id = '$type_id' AND id='" . $id . "'",__LINE__,__FILE__);
-                       }
-                       else
-                       {
                                $table          = 'fm_location_type';
                                $this->db->query("SELECT max(id) as id FROM 
$table",__LINE__,__FILE__);
                                $this->db->next_record();
@@ -500,7 +475,7 @@
                                        $this->db->transaction_abort();
                                        
$this->oProc->m_odb->transaction_abort();
                                        $receipt['error'][] = array('msg' => 
lang('please delete from the bottom'));
-                                       
$GLOBALS['phpgw']->session->appsession('receipt',$this->currentapp,$receipt);
+                               
$GLOBALS['phpgw']->session->appsession('receipt','property',$receipt);
                                        
                                        return;
                                }
@@ -509,260 +484,26 @@
                                $this->oProc->DropTable('fm_location' . $id . 
'_category');
                                $this->oProc->DropTable('fm_location' . $id . 
'_history');
 
-                               $attrib_table   = 'fm_location_attrib';
-                               $this->db->query("DELETE FROM $attrib_table 
WHERE type_id='" . $id . "'",__LINE__,__FILE__);
-                               $this->db->query("DELETE FROM 
fm_location_choice WHERE type_id='" . $id . "'",__LINE__,__FILE__);
-                               $this->db->query("DELETE FROM $table WHERE 
id='" . $id . "'",__LINE__,__FILE__);
-                       }
+                       $attrib_table   = 'phpgw_cust_attribute';
+                       $choice_table   = 'phpgw_cust_choice';
 
-                       $this->db->transaction_commit();
-                       $this->oProc->m_odb->transaction_commit();
-               }
+                       $this->db->query("DELETE FROM $attrib_table WHERE 
appname = 'property' AND location = '.location. " . $id . 
"'",__LINE__,__FILE__);
+                       $this->db->query("DELETE FROM $choice_table WHERE 
appname = 'property' AND location = '.location. " . $id . 
"'",__LINE__,__FILE__);
+                       $this->db->query("DELETE FROM $table WHERE id=" . 
(int)$id,__LINE__,__FILE__);
 
-               function read_attrib($data)
-               {
-
-//_debug_array($data);
-                       if(is_array($data))
-                       {
-                               if (isset($data['start']))
-                               {
-                                       $start=$data['start'];
-                               }
-                               else
-                               {
-                                       $start=0;
-                               }
-                               $query = 
(isset($data['query'])?$data['query']:'');
-                               $sort = 
(isset($data['sort'])?$data['sort']:'DESC');
-                               $order = 
(isset($data['order'])?$data['order']:'');
-                               $type_id = 
(isset($data['type_id'])?$data['type_id']:0);
-                               $lookup_type = 
(isset($data['lookup_type'])?$data['lookup_type']:'');
-                               $allrows = 
(isset($data['allrows'])?$data['allrows']:'');
-                       }
-
-                       if ($order)
-                       {
-                               $ordermethod = " order by $order $sort";
-
-                       }
-                       else
-                       {
-                               $ordermethod = ' order by 
fm_location_attrib.attrib_sort asc';
-                       }
-
-                       $table          = 'fm_location_attrib';
-                       $type_table = 'fm_location_type';
-
-                       $filtermethod = '';
-                       if ($lookup_type)
-                       {
-                               $filtermethod = " OR (type_id < $lookup_type 
AND lookup_form=1) ";
-
-                       }
-
-                       $querymethod = '';
-                       if($query)
-                       {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
-
-                               $querymethod = " and ($table.name $this->like 
'%$query%' or $table.descr $this->like '%$query%')";
-                       }
-
-                       $sql = "SELECT 
$table.id,$table.type_id,$table.list,$table.attrib_sort,$table.location_form,lookup_form,$table.column_name,$table.size
 ,statustext,$table.input_text,"
-                               . " $table.datatype ,$type_table.name as type 
FROM $type_table $this->join $table on $table.type_id = $type_table.id "
-                               . " WHERE $table.type_id= '$type_id' AND custom 
= 1 $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())
-                       {
-                               $attrib[] = array
-                               (
-                                       'id'                    => 
$this->db->f('id'),
-                                       'location_type' => 
$this->db->f('type_id'),
-                                       'attrib_sort'   => 
$this->db->f('attrib_sort'),
-                                       'list'                  => 
$this->db->f('list'),
-                                       'lookup_form'   => 
$this->db->f('lookup_form'),
-                                       'location_form' => 
$this->db->f('location_form'),
-                                       'column_name'   => 
$this->db->f('column_name'),
-                                       'name'                  => 
$this->db->f('input_text'),
-                                       'size'                  => 
$this->db->f('size'),
-                                       'statustext'    => 
$this->db->f('statustext'),
-                                       'input_text'    => 
$this->db->f('input_text'),
-                                       'type_name'             => 
$this->db->f('type'),
-                                       'datatype'              => 
$this->db->f('datatype')
-                               );
-                       }
-                       if (isset($attrib))
-                       {
-                               return $attrib;
-                       }
-               }
-
-               function read_single_attrib($type_id,$id)
-               {
-
-                       $table          = 'fm_location_attrib';
-                       $type_table = 'fm_location_type';
-
-                       $sql = "SELECT $table.* ,$type_table.name as type_name 
FROM $type_table $this->join $table on $table.type_id = $type_id where 
$table.id= '$id'";
-
-                       $this->db->query($sql,__LINE__,__FILE__);
-
-                       if ($this->db->next_record())
-                       {
-                               $attrib['id']                           = 
$this->db->f('id');
-                               $attrib['column_name']                  = 
$this->db->f('column_name');
-                               $attrib['input_text']                   = 
$this->db->f('input_text');
-                               $attrib['statustext']                   = 
$this->db->f('statustext');
-                               $attrib['column_info']['precision']     = 
$this->db->f('precision_');
-                               $attrib['column_info']['scale']         = 
$this->db->f('scale');
-                               $attrib['column_info']['default']       = 
$this->db->f('default_value');
-                               $attrib['column_info']['nullable']      = 
$this->db->f('nullable');
-                               $attrib['column_info']['type']          = 
$this->db->f('datatype');
-                               $attrib['type_id']                      = 
$type_id;
-                               $attrib['type_name']                    = 
$this->db->f('type_name');
-                               $attrib['lookup_form']                  = 
$this->db->f('lookup_form');
-                               $attrib['list']                         = 
$this->db->f('list');
-                               if($this->db->f('datatype')=='R' || 
$this->db->f('datatype')=='CH' || $this->db->f('datatype')=='LB')
-                               {
-                                       $attrib['choice'] = 
$this->read_attrib_choice($type_id,$id);
-                               }
-
-                               return $attrib;
-                       }
-               }
-
-               function read_attrib_choice($type_id,$attrib_id)
-               {
-                       $choice_table = 'fm_location_choice';
-                       $sql = "SELECT * FROM $choice_table WHERE 
type_id=$type_id AND attrib_id=$attrib_id";
-                       $this->db->query($sql,__LINE__,__FILE__);
-
-                       while ($this->db->next_record())
-                       {
-                               $choice[] = array
-                               (
-                                       'id'    => $this->db->f('id'),
-                                       'value' => $this->db->f('value')
-                               );
-                       }
-
-                       if(isset($choice))
-                       {
-                               return $choice;
-                       }
-               }
-
-               function add_attrib($attrib)
-               {
-                       $attrib['column_name'] = 
strtolower($this->db->db_addslashes($attrib['column_name']));
-                       $attrib['input_text'] = 
$this->db->db_addslashes($attrib['input_text']);
-                       $attrib['statustext'] = 
$this->db->db_addslashes($attrib['statustext']);
-                       $attrib['default'] = 
$this->db->db_addslashes($attrib['default']);
-                       $attrib['id'] = 
$this->bocommon->next_id('fm_location_attrib',array('type_id'=>$attrib['type_id']));
-
-                       $sql = "SELECT * FROM fm_location_attrib WHERE type_id= 
'{$attrib['type_id']}' AND column_name = '{$attrib['column_name']}'";
-                       $this->db->query($sql,__LINE__,__FILE__);
-                       if ( $this->db->next_record() )
-                       {
-                               $receipt['id'] = '';
-                               $receipt['error'] = array();
-                               $receipt['error'][] = array('msg' => 
lang('field already exists, please choose another name'));
-                               $receipt['error'][] = array('msg'       => 
lang('Attribute has NOT been saved'));
-                               return $receipt; //no point continuing
-                       }
-
-                       $sql = "SELECT max(attrib_sort) as max_sort FROM 
fm_location_attrib where type_id=" . $attrib['type_id'];
-                       $this->db->query($sql,__LINE__,__FILE__);
-                       $this->db->next_record();
-                       $attrib_sort    = $this->db->f('max_sort')+1;
-
-                       if($precision = 
$this->bocommon->translate_datatype_precision($attrib['column_info']['type']))
-                       {
-                               $attrib['column_info']['precision']=$precision;
-                       }
-
-                       $values= array(
-                               $attrib['id'],
-                               $attrib['column_name'],
-                               $attrib['input_text'],
-                               $attrib['statustext'],
-                               $attrib['type_id'],
-                               $attrib['lookup_form'],
-                               $attrib['list'],
-                               $attrib_sort,
-                               $attrib['column_info']['type'],
-                               $attrib['column_info']['precision'],
-                               $attrib['column_info']['scale'],
-                               $attrib['column_info']['default'],
-                               $attrib['column_info']['nullable'],
-                               1
-                               );
-
-                       $values = $this->bocommon->validate_db_insert($values);
-
-                       $this->db->transaction_begin();
-
-                       $this->db->query("INSERT INTO fm_location_attrib 
(id,column_name, input_text, statustext, 
type_id,lookup_form,list,attrib_sort,datatype,precision_,scale,default_value,nullable,custom)
 "
-                               . "VALUES ($values)",__LINE__,__FILE__);
-
-                       $receipt['id']= $attrib['id'];
-
-                       $attrib['column_info']['type']  = 
$this->bocommon->translate_datatype_insert($attrib['column_info']['type']);
-
-                       if(!$attrib['column_info']['default'])
-                       {
-                               unset($attrib['column_info']['default']);
-                       }
-
-                       $this->init_process();
-
-                       
if($this->oProc->AddColumn('fm_location'.$attrib['type_id'],$attrib['column_name'],
 $attrib['column_info'])
-                               && 
$this->oProc->AddColumn('fm_location'.$attrib['type_id'] 
.'_history',$attrib['column_name'], $attrib['column_info']))
-                       {
-                               $receipt['message'][] = array('msg' => 
lang('Attribute has been saved'));
                                $this->db->transaction_commit();
-
-                       }
-                       else
-                       {
-                               $receipt['error'][] = array('msg' => 
lang('column could not be added'));
-                               if($this->db->Transaction)
-                               {
-                                       $this->db->transaction_abort();
+                       $this->oProc->m_odb->transaction_commit();
                                }
-                               else
-                               {
-                                       $this->db->query("DELETE FROM 
fm_location_attrib WHERE id=" . $receipt['id'] . " AND type_id=" . 
$attrib['type_id'],__LINE__,__FILE__);
-                                       unset($receipt['id']);
 
-                               }
-                       }
 
-                       return $receipt;
-               }
 
                function init_process()
                {
                        $this->oProc                            = 
CreateObject('phpgwapi.schema_proc',$GLOBALS['phpgw_info']['server']['db_type']);
                        $this->oProc->m_odb                     = $this->db;
-                       $this->oProc->m_odb->Halt_On_Error      = 'report';
+                       $this->oProc->m_odb->Halt_On_Error      = 'yes';
                }
 
-
                function save_config($values='',$column_name='')
                {
                        $this->db->query("SELECT * FROM fm_location_config  
WHERE column_name='$column_name' ",__LINE__,__FILE__);
@@ -775,14 +516,14 @@
                        $column_info['nullable']        = 
$this->db->f('nullable');
                        $location_type                  = 
$this->db->f('location_type');
 
-                       $table_def = $this->get_table_def($location_type);
-                       $history_table_def = 
$this->get_table_history_def($table_def,$location_type);
+                       $custom         = 
createObject('phpgwapi.custom_fields');
+                       $table_def = 
$custom->get_table_def('fm_location'.$location_type);
+                       $history_table_def = 
$custom->get_table_def('fm_location' . $location_type . '_history');
 //_debug_array($table_def);
 //_debug_array($history_table_def);
-//die();
                        if(!($location_type==$values[$column_name]))
                        {
-                               $id = 
$this->bocommon->next_id('fm_location_attrib',array('type_id'=>$values[$column_name]));
+                               $id = 
$this->bocommon->next_id('phpgw_cust_attribute',array('appname' => 'property', 
'location' => '.location.' .$values[$column_name]));
                                
                                $this->init_process();
 
@@ -806,24 +547,26 @@
                                                location_type = '". 
$values[$column_name]       . "' WHERE column_name='" . $column_name . 
"'",__LINE__,__FILE__);
 
                                        $values= array(
+                                               'property',
+                                               '.location.' . 
$values[$column_name],
                                                $id,
                                                $column_name,
                                                $column_name,
                                                $column_name,
-                                               $values[$column_name],
                                                $column_info['type'],
                                                $column_info['precision'],
                                                $column_info['scale'],
                                                $column_info['default'],
                                                $column_info['nullable'],
+                                               ''
                                        );
 
                                        $values = 
$this->bocommon->validate_db_insert($values);
 
-                                       $this->db->query("INSERT INTO 
fm_location_attrib (id,column_name, input_text, statustext, 
type_id,datatype,precision_,scale,default_value,nullable) "
+                                       $this->db->query("INSERT INTO 
phpgw_cust_attribute (appname,location,id,column_name, input_text, 
statustext,datatype,precision_,scale,default_value,nullable,custom) "
                                                . "VALUES 
($values)",__LINE__,__FILE__);
 
-                                       $this->db->query("DELETE from 
fm_location_attrib WHERE column_name = '$column_name' AND type_id = 
'$location_type'",__LINE__,__FILE__);
+                                       $this->db->query("DELETE from 
phpgw_cust_attribute WHERE appname = 'property' AND location = '.location.". 
$location_type . "' AND column_name = '" . $column_name . 
"'",__LINE__,__FILE__);
 
                                        $ok = true;
                                }
@@ -846,265 +589,6 @@
                }
 
 
-               function edit_attrib($attrib)
-               {
-                       $choice_table ='fm_location_choice';
-
-                       $attrib['column_name'] = 
strtolower($this->db->db_addslashes($attrib['column_name']));
-                       $attrib['input_text'] = 
$this->db->db_addslashes($attrib['input_text']);
-                       $attrib['statustext'] = 
$this->db->db_addslashes($attrib['statustext']);
-                       $attrib['default'] = 
$this->db->db_addslashes($attrib['default']);
-
-                       $this->db->query("SELECT * FROM fm_location_attrib 
WHERE type_id = " . $attrib['type_id'] ." AND id=" . 
$attrib['id'],__LINE__,__FILE__);
-                       $this->db->next_record();
-                       $OldColumnName          = $this->db->f('column_name');
-                       $OldColumnType          = $this->db->f('datatype');
-                       $OldColumnPrecision     = $this->db->f('precision_');
-
-                       $table_def = $this->get_table_def($attrib['type_id']);
-                       $history_table_def = 
$this->get_table_history_def($table_def,$attrib['type_id']);
-       
-                       if($this->receipt['error'])
-                       {
-                               return $this->receipt;
-                       }
-
-                       $this->db->transaction_begin();
-
-                       $value_set=array(
-                               'input_text'    => $attrib['input_text'],
-                               'statustext'    => $attrib['statustext'],
-                               'list'          => $attrib['list'],
-                               'lookup_form'   => $attrib['lookup_form'],
-                               );
-
-                       $value_set      = 
$this->bocommon->validate_db_update($value_set);
-
-                       $this->db->query("UPDATE fm_location_attrib set 
$value_set WHERE type_id = " . $attrib['type_id'] ." AND id=" . 
$attrib['id'],__LINE__,__FILE__);
-
-                       $this->init_process();
-
-                       $this->oProc->m_odb->transaction_begin();
-
-                       if($OldColumnName !=$attrib['column_name'])
-                       {
-                               $value_set=array('column_name'          => 
$attrib['column_name']);
-
-                               $value_set      = 
$this->bocommon->validate_db_update($value_set);
-
-                               $this->db->query("UPDATE fm_location_attrib set 
$value_set WHERE type_id = " . $attrib['type_id'] ." AND id=" . 
$attrib['id'],__LINE__,__FILE__);
-
-                               $this->oProc->m_aTables = $table_def;
-                               
$this->oProc->RenameColumn('fm_location'.$attrib['type_id'], $OldColumnName, 
$attrib['column_name']);
-                               $this->oProc->m_aTables = $history_table_def;
-                               
$this->oProc->RenameColumn('fm_location'.$attrib['type_id'] . '_history', 
$OldColumnName, $attrib['column_name']);
-                       }
-
-                       if (($OldDataType != $attrib['column_info']['type']) || 
($OldPrecision != $attrib['column_info']['precision']) )
-                       {
-                               if($attrib['column_info']['type']!='R' && 
$attrib['column_info']['type']!='CH' && $attrib['column_info']['type']!='LB')
-                               {
-                                       $this->db->query("DELETE FROM 
$choice_table WHERE type_id=" . $attrib['type_id']. " AND attrib_id=" . 
$attrib['id'],__LINE__,__FILE__);
-                               }
-
-                               if(!$attrib['column_info']['precision'])
-                               {
-                                       if($precision = 
$this->bocommon->translate_datatype_precision($attrib['column_info']['type']))
-                                       {
-                                               
$attrib['column_info']['precision']=$precision;
-                                       }
-                               }
-
-                               if(!$attrib['column_info']['default'])
-                               {
-                                       
unset($attrib['column_info']['default']);
-                               }
-
-                               $value_set=array(
-                                       'type_id'               => 
$attrib['type_id'],
-                                       'datatype'              => 
$attrib['column_info']['type'],
-                                       'precision_'            => 
$attrib['column_info']['precision'],
-                                       'scale'                 => 
$attrib['column_info']['scale'],
-                                       'default_value'         => 
$attrib['column_info']['default'],
-                                       'nullable'              => 
$attrib['column_info']['nullable']
-                                       );
-
-                               $value_set      = 
$this->bocommon->validate_db_update($value_set);
-
-                               $this->db->query("UPDATE fm_location_attrib set 
$value_set WHERE type_id = " . $attrib['type_id'] ." AND id=" . 
$attrib['id'],__LINE__,__FILE__);
-
-                               $attrib['column_info']['type']  = 
$this->bocommon->translate_datatype_insert($attrib['column_info']['type']);
-
-                               $this->oProc->m_aTables = $table_def;
-                               
$this->oProc->AlterColumn('fm_location'.$attrib['type_id'],$attrib['column_name'],$attrib['column_info']);
-                               $this->oProc->m_aTables = $history_table_def;
-                               
$this->oProc->AlterColumn('fm_location'.$attrib['type_id'] . 
'_history',$attrib['column_name'],$attrib['column_info']);
-                       }
-
-                       if($attrib['new_choice'])
-                       {
-                               $choice_id = 
$this->bocommon->next_id($choice_table 
,array('type_id'=>$attrib['type_id'],'attrib_id'=>$attrib['id']));
-
-                               $values= array(
-                                       $attrib['type_id'],
-                                       $attrib['id'],
-                                       $choice_id,
-                                       $attrib['new_choice']
-                                       );
-
-                               $values = 
$this->bocommon->validate_db_insert($values);
-
-                               $this->db->query("INSERT INTO $choice_table 
(type_id,attrib_id,id,value) "
-                               . "VALUES ($values)",__LINE__,__FILE__);
-                       }
-
-                       if($attrib['delete_choice'])
-                       {
-                               for 
($i=0;$i<count($attrib['delete_choice']);$i++)
-                               {
-                                       $this->db->query("DELETE FROM 
$choice_table WHERE type_id=" . $attrib['type_id']. " AND attrib_id=" . 
$attrib['id']  ." AND id=" . $attrib['delete_choice'][$i],__LINE__,__FILE__);
-                               }
-                       }
-
-
-                       $this->db->transaction_commit();
-                       $this->oProc->m_odb->transaction_commit();
-
-                       $receipt['message'][] = array('msg'     => 
lang('Attribute has been edited'));
-
-                       return $receipt;
-
-               }
-
-               function get_table_def($id='')
-               {
-                       $metadata = $this->db->metadata('fm_location'.$id);
-
-                       if(isset($this->db->adodb))
-                       {
-                               $i = 0;
-                               foreach($metadata as $key => $val)
-                               {
-                                       $metadata_temp[$i]['name'] = $key;
-                                       $i++;
-                               }
-                               $metadata = $metadata_temp;
-                               unset ($metadata_temp);
-                       }
-
-//     _debug_array($metadata);
-
-                       for ($i=0; $i<count($metadata); $i++)
-                       {
-                               $sql = "SELECT * FROM fm_location_attrib WHERE 
type_id=$id AND column_name = '" . $metadata[$i]['name'] . "'";
-//     _debug_array($sql);
-
-                               $this->db->query($sql,__LINE__,__FILE__);
-                               if($this->db->next_record())
-                               {
-
-                                       if(!$precision = 
$this->db->f('precision_'))
-                                       {
-                                               $precision = 
$this->bocommon->translate_datatype_precision($this->db->f('datatype'));
-                                       }
-
-                                       $fd[$metadata[$i]['name']] = array(
-                                                       'type' => 
$this->bocommon->translate_datatype_insert(stripslashes($this->db->f('datatype'))),
-                                                       'precision' => 
$precision,
-                                                       'nullable' => 
stripslashes($this->db->f('nullable')),
-                                                       'default' => 
stripslashes($this->db->f('default_value')),
-                                                       'scale' => 
$this->db->f('scale')
-                                                       );
-                                       unset($precision);
-                               }
-                               else
-                               {
-                                       $this->receipt['error'][] = array('msg' 
=> lang('Column %1 is missing from metadata',$metadata[$i]['name']));
-                               }
-                       }
-
-                       $this->db->query("SELECT * FROM fm_location_type WHERE 
id=$id");
-                       $this->db->next_record();
-
-
-                       if($id>1)
-                       {
-                               $fk_table='fm_location'. ($id-1);
-                               for ($i=1; $i<$id; $i++)
-                               {
-                                       $fk['loc' . $i] = $fk_table . '.loc' . 
$i;
-                               }
-                       }
-
-                       $table_def = array(
-                               'fm_location'.$id =>    array(
-                                       'fd' => $fd
-                                       )
-                               );
-
-                       if($this->db->f('pk'))
-                       {
-                               $table_def['fm_location'.$id]['pk'] = 
explode(',',$this->db->f('pk'));
-                       }
-                       else
-                       {
-                               $table_def['fm_location'.$id]['pk'] = array();  
                
-                       }
-
-                       if($fk)
-                       {
-                               $table_def['fm_location'.$id]['fk'] = $fk;
-                       }
-                       else
-                       {
-                               $table_def['fm_location'.$id]['fk'] = array();  
                
-                       }
-
-                       if($this->db->f('ix'))
-                       {
-                               $table_def['fm_location'.$id]['ix'] = 
explode(',',$this->db->f('ix'));
-                       }
-                       else
-                       {
-                               $table_def['fm_location'.$id]['ix'] = array();  
                
-                       }
-
-                       if($this->db->f('uc'))
-                       {
-                               $table_def['fm_location'.$id]['uc'] = 
explode(',',$this->db->f('uc'));
-                       }
-                       else
-                       {
-                               $table_def['fm_location'.$id]['uc'] = array();  
                
-                       }
-
-                       $fd['exp_date'] = array('type' => 
'timestamp','nullable' => True,'default' => 'current_timestamp');
-
-                       $table_def['fm_location'.$id . '_history']['fd'] =  $fd;
-                       $table_def['fm_location'.$id . '_history']['pk'] =   
array();
-                       $table_def['fm_location'.$id . '_history']['fk'] =   
array();
-                       $table_def['fm_location'.$id . '_history']['ix'] =   
array();
-                       $table_def['fm_location'.$id . '_history']['uc'] =   
array();   
-               
-                       return $table_def;
-               }
-
-
-               function get_table_history_def($table_def,$type_id)
-               {
-
-                       $history_table_def['fm_location'.$type_id . '_history'] 
= $table_def['fm_location'.$type_id];
-                       $history_table_def['fm_location'.$type_id . 
'_history']['fd']['exp_date']=array('type' => 'timestamp','nullable' => 
False,'default' => 'current_timestamp');
-                       
-                       $history_table_def['fm_location'.$type_id . 
'_history']['pk'] = array();
-                       $history_table_def['fm_location'.$type_id . 
'_history']['fk'] = array();
-                       $history_table_def['fm_location'.$type_id . 
'_history']['ix'] = array();
-                       $history_table_def['fm_location'.$type_id . 
'_history']['uc'] = array();
-                       
-                       return $history_table_def;
-               }
-
-
                function select_location_type()
                {
                        $this->db->query("SELECT * FROM fm_location_type ORDER 
BY id ");
@@ -1123,54 +607,5 @@
 
                        return $location_type;
                }
-
-               function resort_attrib($data)
-               {
-                       if(is_array($data))
-                       {
-                               $resort = 
(isset($data['resort'])?$data['resort']:'up');
-                               $type_id = 
(isset($data['type_id'])?$data['type_id']:'');
-                               $id = (isset($data['id'])?$data['id']:'');
-                       }
-
-                       if(!$type_id)
-                       {
-                               return;
-                       }
-
-                       $sql = "SELECT attrib_sort FROM fm_location_attrib 
where type_id=$type_id AND id=$id";
-                       $this->db->query($sql,__LINE__,__FILE__);
-                       $this->db->next_record();
-                       $attrib_sort    = $this->db->f('attrib_sort');
-                       $sql2 = "SELECT max(attrib_sort) as max_sort FROM 
fm_location_attrib where type_id=$type_id";
-                       $this->db->query($sql2,__LINE__,__FILE__);
-                       $this->db->next_record();
-                       $max_sort       = $this->db->f('max_sort');
-
-                       switch($resort)
-                       {
-                               case 'up':
-                                       if($attrib_sort>1)
-                                       {
-                                               $sql = "UPDATE 
fm_location_attrib set attrib_sort=$attrib_sort WHERE type_id=$type_id AND 
attrib_sort =" . ($attrib_sort-1);
-                                               
$this->db->query($sql,__LINE__,__FILE__);
-                                               $sql = "UPDATE 
fm_location_attrib set attrib_sort=" . ($attrib_sort-1) ." WHERE 
type_id=$type_id AND id=$id";
-                                               
$this->db->query($sql,__LINE__,__FILE__);
-                                       }
-                                       break;
-                               case 'down':
-                                       if($max_sort > $attrib_sort)
-                                       {
-                                               $sql = "UPDATE 
fm_location_attrib set attrib_sort=$attrib_sort WHERE type_id=$type_id AND 
attrib_sort =" . ($attrib_sort+1);
-                                               
$this->db->query($sql,__LINE__,__FILE__);
-                                               $sql = "UPDATE 
fm_location_attrib set attrib_sort=" . ($attrib_sort+1) ." WHERE 
type_id=$type_id AND id=$id";
-                                               
$this->db->query($sql,__LINE__,__FILE__);
-                                       }
-                                       break;
-                               default:
-                                       return;
-                                       break;
-                       }
-               }
        }
 ?>

Modified: trunk/property/inc/class.soagreement.inc.php
===================================================================
--- trunk/property/inc/class.soagreement.inc.php        2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/inc/class.soagreement.inc.php        2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -38,7 +38,7 @@
 
                function property_soagreement()
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $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();
@@ -85,12 +85,12 @@
                        $filtermethod = '';
                        $querymethod = '';
 
-                       $choice_table = 'fm_agreement_choice';
-                       $attribute_table = 'fm_agreement_attribute';
+                       $choice_table = 'phpgw_cust_choice';
+                       $attribute_table = 'phpgw_cust_attribute';
 
                        $entity_table = 'fm_agreement';
                        $category_table = 'fm_branch';
-                       $attribute_filter = " AND attrib_detail = 1";
+                       $attribute_filter = " appname = 'property' AND location 
= '.agreement'";
                        $paranthesis ='(';
                        $joinmethod = " $this->join $category_table ON ( 
$entity_table.category =$category_table.id)";
                        $joinmethod .= " $this->join  fm_vendor ON ( 
$entity_table.vendor_id =fm_vendor.id ))";
@@ -169,34 +169,17 @@
 
                        $i      = count($uicols['name']);
 
-                       $this->db->query("SELECT * FROM $attribute_table WHERE 
list=1 $attribute_filter ");
-                       while ($this->db->next_record())
+                       $user_columns = 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['agreement_columns'
 . 
!!$agreement_id])?$GLOBALS['phpgw_info']['user']['preferences']['property']['agreement_columns'
 . !!$agreement_id]:'';
+                       $user_column_filter = '';
+                       if (isset($user_columns) AND is_array($user_columns) 
AND $user_columns[0])
                        {
-                               $uicols['input_type'][]         = 'text';
-                               $uicols['name'][]                       = 
$this->db->f('column_name');
-                               $uicols['descr'][]                      = 
$this->db->f('input_text');
-                               $uicols['statustext'][]         = 
$this->db->f('statustext');
-                               $uicols['datatype'][$i]         = 
$this->db->f('datatype');
-                               $cols_return_extra[]= array(
-                                       'name'  => $this->db->f('column_name'),
-                                       'datatype'      => 
$this->db->f('datatype'),
-                                       'attrib_id'     => $this->db->f('id')
-                               );
-
-                               $i++;
+                               $user_column_filter = " OR ($attribute_filter 
AND id IN (" . implode(',',$user_columns) .'))';
                        }
 
-                       $user_columns = 
isset($GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['agreement_columns'
 . 
!!$agreement_id])?$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['agreement_columns'
 . !!$agreement_id]:'';
+                       $this->db->query("SELECT * FROM $attribute_table WHERE 
list=1 AND $attribute_filter $user_column_filter ");
 
-//_debug_array($user_columns);
-
-                       if (isset($user_columns) AND is_array($user_columns) 
AND $user_columns[0])
-                       {
-                               foreach($user_columns as $column_id)
+                       while ($this->db->next_record())
                                {
-                                       $this->db->query("SELECT * FROM 
$attribute_table WHERE id= $column_id");
-
-                                       $this->db->next_record();
                                        $uicols['input_type'][]         = 
'text';
                                        $uicols['name'][]                       
= $this->db->f('column_name');
                                        $uicols['descr'][]                      
= $this->db->f('input_text');
@@ -207,14 +190,12 @@
                                                'datatype'      => 
$this->db->f('datatype'),
                                                'attrib_id'     => 
$this->db->f('id')
                                        );
+
                                        $i++;
                                }
-                       }
 
                        $this->uicols   = $uicols;
 
-//_debug_array($cols_return_extra);
-
                        $where= 'WHERE';
 
 /*                     if ($filter=='all')
@@ -273,10 +254,10 @@
 
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
-                               $this->db->query("SELECT * FROM 
$attribute_table where search='1'");
+                               $this->db->query("SELECT * FROM 
$attribute_table WHERE search='1' AND $attribute_filter ");
 
                                while ($this->db->next_record())
                                {
@@ -333,19 +314,19 @@
                                                $value='';
                                                
$value=$this->db->f($cols_return_extra[$i]['name']);
 
-                                               
if(($cols_return_extra[$i]['datatype']=='R' || 
$cols_return_extra[$i]['datatype']=='LB') && $value):
+                                               
if(($cols_return_extra[$i]['datatype']=='R' || 
$cols_return_extra[$i]['datatype']=='LB') && $value)
                                                {
-                                                       $sql="SELECT value FROM 
$choice_table where attrib_id=" .$cols_return_extra[$i]['attrib_id']. "  AND 
id=" . $value . $attribute_filter;
+                                                       $sql="SELECT value FROM 
$choice_table WHERE $attribute_filter AND attrib_id=" 
.$cols_return_extra[$i]['attrib_id']. "  AND id=" . $value;
                                                        $this->db2->query($sql);
                                                        
$this->db2->next_record();
                                                        
$agreement_list[$j][$cols_return_extra[$i]['name']] = $this->db2->f('value');
                                                }
-                                               
elseif($cols_return_extra[$i]['datatype']=='AB' && $value):
+                                               else 
if($cols_return_extra[$i]['datatype']=='AB' && $value)
                                                {
                                                        $contact_data   = 
$contacts->read_single_entry($value,array('n_given'=>'n_given','n_family'=>'n_family','email'=>'email'));
                                                        
$agreement_list[$j][$cols_return_extra[$i]['name']]     = 
$contact_data[0]['n_family'] . ', ' . $contact_data[0]['n_given'];
                                                }
-                                               
elseif($cols_return_extra[$i]['datatype']=='VENDOR' && $value):
+                                               else 
if($cols_return_extra[$i]['datatype']=='VENDOR' && $value)
                                                {
                                                        $sql="SELECT org_name 
FROM fm_vendor where id=$value";
                                                        $this->db2->query($sql);
@@ -353,7 +334,7 @@
                                                        
$agreement_list[$j][$cols_return_extra[$i]['name']] = $this->db2->f('org_name');
 
                                                }
-                                               
elseif($cols_return_extra[$i]['datatype']=='CH' && $value):
+                                               else 
if($cols_return_extra[$i]['datatype']=='CH' && $value)
                                                {
                                                        $ch= 
unserialize($value);
        
@@ -361,7 +342,7 @@
                                                        {
                                                                for 
($k=0;$k<count($ch);$k++)
                                                                {
-                                                                       
$sql="SELECT value FROM $choice_table where attrib_id=" 
.$cols_return_extra[$i]['attrib_id']. "  AND id=" . $ch[$k] . $attribute_filter;
+                                                                       
$sql="SELECT value FROM $choice_table WHERE $attribute_filter AND attrib_id=" 
.$cols_return_extra[$i]['attrib_id']. "  AND id=" . $ch[$k];
                                                                        
$this->db2->query($sql);
                                                                        while 
($this->db2->next_record())
                                                                        {
@@ -372,19 +353,17 @@
                                                                
unset($ch_value);
                                                        }
                                                }
-                                               
elseif($cols_return_extra[$i]['datatype']=='D' && $value):
+                                               else 
if($cols_return_extra[$i]['datatype']=='D' && $value)
                                                {
 //_debug_array($value);
 
                                                        
$agreement_list[$j][$cols_return_extra[$i]['name']]=date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'],strtotime($value));
                                                }
-                                               else:
+                                               else
                                                {
                                                        
$agreement_list[$j][$cols_return_extra[$i]['name']]=$value;
                                                }
-                                               endif;
                                        }
-
                                }
                                $j++;
                        }
@@ -630,105 +609,68 @@
                }
 
 
-               function read_single($data)
+               function read_single($agreement_id, $values = array())
                {
-                       $attribute_table = 'fm_agreement_attribute';
                        $table = 'fm_agreement';
 
-                       $agreement_id =$data['agreement_id'];
-
-                       $this->db->query("SELECT * FROM $attribute_table WHERE 
attrib_detail = 1 ORDER BY attrib_sort");
-
-                       while ($this->db->next_record())
-                       {
-                               $agreement['attributes'][] = array
-                               (
-                                       'attrib_id'             => 
$this->db->f('id'),
-                                       'name'                  => 
$this->db->f('column_name'),
-                                       'input_text'    => 
stripslashes($this->db->f('input_text')),
-                                       'statustext'    => 
stripslashes($this->db->f('statustext')),
-                                       'datatype'              => 
$this->db->f('datatype')
-                               );
-                       }
-
-                       if($agreement_id)
-                       {
                                $this->db->query("SELECT 
$table.*,fm_vendor.member_of FROM $table $this->join fm_vendor ON 
$table.vendor_id = fm_vendor.id where $table.id='$agreement_id'");
 
                                if($this->db->next_record())
                                {
-                                       $agreement['id']                        
= (int)$this->db->f('id');
-                                       $agreement['entry_date']        = 
$this->db->f('entry_date');
-                                       $agreement['cat_id']            = 
$this->db->f('category');
-                                       $agreement['start_date']        = 
$this->db->f('start_date');
-                                       $agreement['end_date']          = 
$this->db->f('end_date');
-                                       $agreement['termination_date']= 
$this->db->f('termination_date');
-                                       $agreement['vendor_id']         = 
$this->db->f('vendor_id');
-                                       $agreement['b_account_id']      = 
$this->db->f('account_id');
-                                       $agreement['name']                      
= stripslashes($this->db->f('name'));
-                                       $agreement['descr']                     
= stripslashes($this->db->f('descr'));
-                                       $agreement['user_id']           = 
$this->db->f('user_id');
-                                       $agreement['group_id']          = 
$this->db->f('group_id');
-                                       $agreement['status']            = 
$this->db->f('status');
-                                       $agreement['member_of']         = 
explode(',',$this->db->f('member_of'));
+                               $values['id']                           = 
(int)$this->db->f('id');
+                               $values['entry_date']           = 
$this->db->f('entry_date');
+                               $values['cat_id']                       = 
$this->db->f('category');
+                               $values['start_date']           = 
$this->db->f('start_date');
+                               $values['end_date']                     = 
$this->db->f('end_date');
+                               $values['termination_date']     = 
$this->db->f('termination_date');
+                               $values['vendor_id']            = 
$this->db->f('vendor_id');
+                               $values['b_account_id']         = 
$this->db->f('account_id');
+                               $values['name']                         = 
stripslashes($this->db->f('name'));
+                               $values['descr']                        = 
stripslashes($this->db->f('descr'));
+                               $values['user_id']                      = 
$this->db->f('user_id');
+                               $values['group_id']                     = 
$this->db->f('group_id');
+                               $values['status']                       = 
$this->db->f('status');
+                               $values['member_of']            = 
explode(',',$this->db->f('member_of'));
 
-                                       for 
($i=0;$i<count($agreement['attributes']);$i++)
+                               if ( isset($values['attributes']) && 
is_array($values['attributes']) )
                                        {
-                                               
$agreement['attributes'][$i]['value']   = 
$this->db->f($agreement['attributes'][$i]['name']);
-                                               
$agreement['attributes'][$i]['datatype_text']   = 
$this->bocommon->translate_datatype($agreement['attributes'][$i]['datatype']);
+                                       foreach ( $values['attributes'] as 
&$attr )
+                                       {
+                                               $attr['value']  = 
$this->db->f($attr['column_name']);
                                        }
-
                                }
                        }
-//_debug_array($agreement);
-                       return $agreement;
+                       return $values;
                }
 
-               function read_single_item($data)
+               function read_single_item($data, $values = array())
                {
-                       $attribute_table = 'fm_agreement_attribute';
                        $table = 'fm_activities';
 
                        $agreement_id =$data['agreement_id'];
                        $id =$data['id'];
 
-                       $this->db->query("SELECT * FROM $attribute_table WHERE 
attrib_detail = 2 ORDER BY attrib_sort");
-
-                       while ($this->db->next_record())
-                       {
-                               $item['attributes'][] = array
-                               (
-                                       'attrib_id'             => 
$this->db->f('id'),
-                                       'name'                  => 
$this->db->f('column_name'),
-                                       'input_text'    => 
stripslashes($this->db->f('input_text')),
-                                       'statustext'    => 
stripslashes($this->db->f('statustext')),
-                                       'datatype'              => 
$this->db->f('datatype')
-                               );
-                       }
-
-                       if($id && $agreement_id)
-                       {
                                $this->db->query("SELECT * from $table 
$this->join fm_activity_price_index on $table.id = 
fm_activity_price_index.activity_id where $table.id=$id AND 
agreement_id=$agreement_id and index_count = 1");
 
                                if($this->db->next_record())
                                {
-                                       $item['agreement_id']   = 
(int)$this->db->f('agreement_id');
-                                       $item['id']                             
= (int)$this->db->f('id');
-                                       $item['num']                    = 
$this->db->f('num');
-                                       $item['entry_date']             = 
$this->db->f('entry_date');
-                                       $item['m_cost']                 = 
$this->db->f('m_cost');
-                                       $item['w_cost']                 = 
$this->db->f('w_cost');
-                                       $item['total_cost']             = 
$this->db->f('total_cost');
+                               $values['agreement_id']         = 
(int)$this->db->f('agreement_id');
+                               $values['id']                           = 
(int)$this->db->f('id');
+                               $values['num']                          = 
$this->db->f('num');
+                               $values['entry_date']           = 
$this->db->f('entry_date');
+                               $values['m_cost']                       = 
$this->db->f('m_cost');
+                               $values['w_cost']                       = 
$this->db->f('w_cost');
+                               $values['total_cost']           = 
$this->db->f('total_cost');
 
-                                       for 
($i=0;$i<count($item['attributes']);$i++)
+                               if ( isset($values['attributes']) && 
is_array($values['attributes']) )
+                               {
+                                       foreach ( $values['attributes'] as 
&$attr )
                                        {
-                                               
$item['attributes'][$i]['value']        = 
$this->db->f($item['attributes'][$i]['name']);
-                                               
$item['attributes'][$i]['datatype_text']        = 
$this->bocommon->translate_datatype($item['attributes'][$i]['datatype']);
+                                               $attr['value']  = 
$this->db->f($attr['column_name']);
                                        }
-
                                }
                        }
-                       return $item;
+                       return $values;
                }
 
                function add($agreement,$values_attribute='')
@@ -756,15 +698,17 @@
                        $vals[] = $agreement['vendor_id'];
                        $vals[] = $this->account;
 
-
-                       while (is_array($agreement['extra']) && 
list($input_name,$value) = each($agreement['extra']))
+                       if(isset($agreement['extra']) && 
is_array($agreement['extra']))
                        {
-                               if($value)
+                               foreach ($agreement['extra'] as $input_name => 
$value)
+                       {
+                                       if(isset($value) && $value)
                                {
                                        $cols[] = $input_name;
                                        $vals[] = $value;
                                }
                        }
+                       }
 
                        if (isset($values_attribute) AND 
is_array($values_attribute))
                        {
@@ -847,10 +791,13 @@
                                $values['member_of']=',' . 
implode(',',$values['member_of']) . ',';
                        }
 
-                       while (is_array($values['extra']) && 
list($column,$value) = each($values['extra']))
+                       if(isset($values['extra']) && 
is_array($values['extra']))
                        {
+                               foreach ($values['extra'] as $column => $value)
+                       {
                                $value_set[$column]     = $value;
                        }
+                       }
 
                        if (isset($values_attribute) AND 
is_array($values_attribute))
                        {
@@ -858,10 +805,17 @@
                                {
                                        if($entry['datatype']!='AB' && 
$entry['datatype']!='VENDOR')
                                        {
+                                               if($entry['datatype'] == 'C' || 
$entry['datatype'] == 'T' || $entry['datatype'] == 'V' || $entry['datatype'] == 
'link')
+                                               {
+                                                       
$value_set[$entry['name']] = $this->db->db_addslashes($entry['value']);
+                                               }
+                                               else
+                                               {
                                                $value_set[$entry['name']]      
= $entry['value'];
                                        }
                                }
                        }
+                       }
 
                        $value_set['name']      = $values['name'];
                        $value_set['descr']     = $values['descr'];
@@ -934,10 +888,10 @@
 
                function floatval($strValue)
                {
-                       $floatValue = 
ereg_replace("(^[0-9]*)(\\.|,)([0-9]*)(.*)", "\\1.\\3", $strValue);
+                       $floatValue = 
preg_replace("/(^[0-9]*)(\\.|,)([0-9]*)(.*)/", "\\1.\\3", $strValue);
                        if(!is_numeric($floatValue))
                        {
-                               $floatValue = ereg_replace("(^[0-9]*)(.*)", 
"\\1", $strValue);
+                               $floatValue = preg_replace("/(^[0-9]*)(.*)/", 
"\\1", $strValue);
                        }
                        if(!is_numeric($floatValue))
                        {
@@ -986,272 +940,7 @@
                        $this->db->transaction_commit();
                }
 
-               function read_attrib($data)
-               {
-                       $attribute_table = 'fm_agreement_attribute';
-//html_print_r($data);
-                       if(is_array($data))
-                       {
-                               $query = (isset($data['start']) && 
$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']:'');
-                               $column_list = 
(isset($data['column_list'])?$data['column_list']:'');
-                       }
 
-                       $where = 'WHERE';
-                       if ($column_list)
-                       {
-                               $filtermethod = " $where list !=1 or list is 
null";
-                               $where = 'AND';
-                       }
-                       if ($this->role=='detail')
-                       {
-                               $filtermethod .= " $where attrib_detail=2 ";
-                       }
-                       else
-                       {
-                               $filtermethod .= " $where attrib_detail=1 ";
-                       }
-
-                       $where = 'AND';
-
-                       if ($order)
-                       {
-                               $ordermethod = " order by $order $sort";
-
-                       }
-                       else
-                       {
-                               $ordermethod = ' order by attrib_sort asc';
-                       }
-
-                       $querymethod = '';
-                       if($query)
-                       {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
-
-                               $querymethod = " $where 
($attribute_table.input_text $this->like '%$query%' or 
$attribute_table.column_name $this->like '%$query%')";
-                       }
-
-                       $sql = "SELECT * FROM $attribute_table $filtermethod 
$querymethod";
-
-//echo $sql;
-                       $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())
-                       {
-                               $attrib[] = array
-                               (
-                                       'id'                    => 
$this->db->f('id'),
-                                       'attrib_sort'   => 
$this->db->f('attrib_sort'),
-                                       'list'                  => 
$this->db->f('list'),
-                                       'lookup_form'   => 
$this->db->f('lookup_form'),
-                                       'column_name'   => 
$this->db->f('column_name'),
-                                       'name'                  => 
$this->db->f('input_text'),
-                                       'size'                  => 
$this->db->f('size'),
-                                       'statustext'    => 
$this->db->f('statustext'),
-                                       'input_text'    => 
$this->db->f('input_text'),
-                                       'type_name'             => 
$this->db->f('type'),
-                                       'datatype'              => 
$this->db->f('datatype'),
-                                       'search'                => 
$this->db->f('search')
-                               );
-                       }
-                       return $attrib;
-               }
-
-               function read_single_attrib($id)
-               {
-                       $attribute_table = 'fm_agreement_attribute';
-
-                       if ($this->role=='detail')
-                       {
-                               $filtermethod = " AND attrib_detail=2 ";
-                       }
-                       else
-                       {
-                               $filtermethod = " AND attrib_detail=1 ";
-                       }
-
-                       $sql = "SELECT * FROM $attribute_table where id=$id 
$filtermethod";
-
-                       $this->db->query($sql);
-
-                       if($this->db->next_record())
-                       {
-                               $attrib['id']                                   
        = $this->db->f('id');
-                               $attrib['column_name']                          
= $this->db->f('column_name');
-                               $attrib['input_text']                           
= $this->db->f('input_text');
-                               $attrib['statustext']                           
= $this->db->f('statustext');
-                               $attrib['column_info']['precision']     = 
$this->db->f('precision_');
-                               $attrib['column_info']['scale']         = 
$this->db->f('scale');
-                               $attrib['column_info']['default']       = 
$this->db->f('default_value');
-                               $attrib['column_info']['nullable']      = 
$this->db->f('nullable');
-                               $attrib['column_info']['type']          = 
$this->db->f('datatype');
-                               $attrib['type_name']                            
= $this->db->f('type_name');
-                               $attrib['lookup_form']                          
= $this->db->f('lookup_form');
-                               $attrib['list']                                 
        = $this->db->f('list');
-                               $attrib['search']                               
        = $this->db->f('search');
-                               if($this->db->f('datatype')=='R' || 
$this->db->f('datatype')=='CH' || $this->db->f('datatype')=='LB')
-                               {
-                                       $attrib['choice'] = 
$this->read_attrib_choice($id);
-                               }
-
-                               return $attrib;
-                       }
-               }
-
-               function read_attrib_choice($attrib_id)
-               {
-                       $choice_table = 'fm_agreement_choice';
-
-                       if ($this->role=='detail')
-                       {
-                               $filtermethod = " AND attrib_detail=2 ";
-                       }
-                       else
-                       {
-                               $filtermethod = " AND attrib_detail=1 ";
-                       }
-
-                       $sql = "SELECT * FROM $choice_table WHERE 
attrib_id=$attrib_id $filtermethod";
-                       $this->db->query($sql);
-
-                       while ($this->db->next_record())
-                       {
-                               $choice[] = array
-                               (
-                                       'id'    => $this->db->f('id'),
-                                       'value' => $this->db->f('value')
-                               );
-
-                       }
-                       return $choice;
-               }
-
-               function add_attrib($attrib)
-               {
-                       $attribute_table = 'fm_agreement_attribute';
-                       $attrib['column_name'] = 
strtolower($this->db->db_addslashes($attrib['column_name']));
-                       $attrib['input_text'] = 
$this->db->db_addslashes($attrib['input_text']);
-                       $attrib['statustext'] = 
$this->db->db_addslashes($attrib['statustext']);
-                       $attrib['default'] = 
$this->db->db_addslashes($attrib['default']);
-                       $attrib['id'] = 
$this->bocommon->next_id($attribute_table, array('attrib_detail'=>!!$this->role 
+1));
-
-                       if($this->role=='detail')
-                       {
-                               $filtermethod= 'WHERE attrib_detail=2';
-                               $table = 'fm_agreement_detail';
-                       }
-                       else
-                       {
-                               $filtermethod= 'WHERE attrib_detail=1';
-                               $table = 'fm_agreement';
-                       }
-
-                       $sql = "SELECT * FROM $attribute_table $filtermethod 
AND column_name = '{$attrib['column_name']}'";
-                       $this->db->query($sql,__LINE__,__FILE__);
-                       if ( $this->db->next_record() )
-                       {
-                               $receipt['id'] = '';
-                               $receipt['error'] = array();
-                               $receipt['error'][] = array('msg' => 
lang('field already exists, please choose another name'));
-                               $receipt['error'][] = array('msg'       => 
lang('Attribute has NOT been saved'));
-                               return $receipt; //no point continuing
-                       }
-
-                       $sql = "SELECT max(attrib_sort) as max_sort FROM 
$attribute_table $filtermethod";
-                       $this->db->query($sql);
-                       $this->db->next_record();
-                       $attrib_sort    = $this->db->f('max_sort')+1;
-
-                       $values= array(
-                               !!$this->role +1,
-                               $attrib['id'],
-                               $attrib['column_name'],
-                               $attrib['input_text'],
-                               $attrib['statustext'],
-                               $attrib['lookup_form'],
-                               $attrib['search'],
-                               $attrib['list'],
-                               $attrib_sort,
-                               $attrib['column_info']['type'],
-                               $attrib['column_info']['precision'],
-                               $attrib['column_info']['scale'],
-                               $attrib['column_info']['default'],
-                               $attrib['column_info']['nullable']
-                               );
-
-                       $values = $this->bocommon->validate_db_insert($values);
-
-                       $this->db->transaction_begin();
-
-                       $this->db->query("INSERT INTO $attribute_table 
(attrib_detail,id,column_name, input_text, 
statustext,lookup_form,search,list,attrib_sort,datatype,precision_,scale,default_value,nullable)
 "
-                               . "VALUES ($values)");
-
-                       $receipt['id']= $attrib['id'];
-
-                       if($attrib['column_info']['type']=='email' && 
!$attrib['column_info']['precision'])
-                       {
-                               $attrib['column_info']['precision']=64;
-                       }
-
-                       $attrib['column_info']['type']  = 
$this->bocommon->translate_datatype_insert($attrib['column_info']['type']);
-
-                       if($attrib['column_info']['type']=='int' && 
!$attrib['column_info']['precision'])
-                       {
-                               $attrib['column_info']['precision']=4;
-                       }
-
-                       if(!$attrib['column_info']['default'])
-                       {
-                               unset($attrib['column_info']['default']);
-                       }
-
-                       $this->init_process();
-
-                       
if($this->oProc->AddColumn($table,$attrib['column_name'], 
$attrib['column_info']))
-                       {
-                               $receipt['message'][] = array('msg'     => 
lang('Attribute has been saved')     );
-                               $this->db->transaction_commit();
-
-                       }
-                       else
-                       {
-                               $receipt['error'][] = array('msg'       => 
lang('column could not be added')    );
-                               if($this->db->Transaction)
-                               {
-                                       $GLOBALS['phpgw']->db->rollbacktrans();
-                               }
-                               else
-                               {
-                                       $GLOBALS['phpgw']->db->Execute("DELETE 
FROM $attribute_table WHERE id='" . $receipt['id'] . "'");
-                                       unset($receipt['id']);
-
-                               }
-                       }
-
-                       return $receipt;
-               }
-
-               function init_process()
-               {
-                       $this->oProc                                            
= 
CreateObject('phpgwapi.schema_proc',$GLOBALS['phpgw_info']['server']['db_type']);
-                       $this->oProc->m_odb                                     
= $this->db;
-                       $this->oProc->m_odb->Halt_On_Error      = 'report';
-               }
-
                function get_default_column_def($table)
                {
                        switch($table)
@@ -1350,235 +1039,6 @@
                        return $table_def;
                }
 
-
-               function edit_attrib($attrib)
-               {
-                       $attribute_table = 'fm_agreement_attribute';
-                       $table = 'fm_agreement';
-
-                       $attrib['column_name'] = 
strtolower($this->db->db_addslashes($attrib['column_name']));
-                       $attrib['input_text'] = 
$this->db->db_addslashes($attrib['input_text']);
-                       $attrib['statustext'] = 
$this->db->db_addslashes($attrib['statustext']);
-                       $attrib['default'] = 
$this->db->db_addslashes($attrib['default']);
-
-                       $choice_table = 'fm_agreement_choice';
-
-                       if($this->role=='detail')
-                       {
-                               $filtermethod= ' AND attrib_detail=2';
-                               $table = 'fm_agreement_detail';
-                       }
-                       else
-                       {
-                               $filtermethod= ' AND attrib_detail=1';
-                               $table = 'fm_agreement';
-                       }
-
-                       $this->db->query("SELECT column_name, datatype, 
precision_ FROM $attribute_table WHERE id='" . $attrib['id']. "' 
$filtermethod");
-                       $this->db->next_record();
-                       $OldColumnName          = $this->db->f('column_name');
-                       $OldDataType            = $this->db->f('datatype');
-                       $OldPrecision           = $this->db->f('precision_');
-
-                       $table_def = $this->get_table_def($table);      
-
-                       $this->db->transaction_begin();
-
-                       $value_set=array(
-                               'input_text'    => $attrib['input_text'],
-                               'statustext'    => $attrib['statustext'],
-                               'search'        => $attrib['search'],
-                               'list'          => $attrib['list'],
-                               );
-
-                       $value_set      = 
$this->bocommon->validate_db_update($value_set);
-
-                       $this->db->query("UPDATE $attribute_table set 
$value_set WHERE id=" . $attrib['id'] . $filtermethod);
-
-                       $attrib_type=$attrib['column_info']['type'];
-
-                       $this->init_process();
-                       
-                       $this->oProc->m_odb->transaction_begin();
-
-                       $this->oProc->m_aTables = $table_def;
-
-
-                       if($OldColumnName !=$attrib['column_name'])
-                       {
-                               $value_set=array('column_name'  => 
$attrib['column_name']);
-
-                               $value_set      = 
$this->bocommon->validate_db_update($value_set);
-
-                               $this->db->query("UPDATE $attribute_table set 
$value_set WHERE id=" . $attrib['id'] . $filtermethod);
-
-                               $this->oProc->RenameColumn($table, 
$OldColumnName, $attrib['column_name']);
-                       }
-
-
-                       if (($OldDataType != $attrib['column_info']['type']) || 
($OldPrecision != $attrib['column_info']['precision']) )
-                       {
-                               if($attrib['column_info']['type']!='R' && 
$attrib['column_info']['type']!='CH' && $attrib['column_info']['type']!='LB')
-                               {
-                                       $this->db->query("DELETE FROM 
$choice_table WHERE  attrib_id=" . $attrib['id'] . $filtermethod);
-                               }
-
-                               if(!$attrib['column_info']['precision'])
-                               {
-                                       if($precision = 
$this->bocommon->translate_datatype_precision($attrib['column_info']['type']))
-                                       {
-                                               
$attrib['column_info']['precision']=$precision;
-                                       }
-                               }
-
-                               if(!$attrib['column_info']['default'])
-                               {
-                                       
unset($attrib['column_info']['default']);
-                               }
-
-                               $value_set=array(
-                                       'column_name'   => 
$attrib['column_name'],
-                                       'datatype'      => 
$attrib['column_info']['type'],
-                                       'precision_'    => 
$attrib['column_info']['precision'],
-                                       'scale'         => 
$attrib['column_info']['scale'],
-                                       'default_value' => 
$attrib['column_info']['default'],
-                                       'nullable'      => 
$attrib['column_info']['nullable']
-                                       );
-
-                               $value_set      = 
$this->bocommon->validate_db_update($value_set);
-
-                               $this->db->query("UPDATE $attribute_table set 
$value_set WHERE id=" . $attrib['id'] . $filtermethod);
-
-                               $attrib['column_info']['type']  = 
$this->bocommon->translate_datatype_insert($attrib['column_info']['type']);
-                               
$this->oProc->AlterColumn($table,$attrib['column_name'],$attrib['column_info']);
-                       }
-
-                       if($attrib['new_choice'])
-                       {
-                               $this->db->query("SELECT max(id) as id FROM 
$choice_table WHERE attrib_id='" . $attrib['id']. "' $filtermethod");
-                               $this->db->next_record();
-                               $choice_id              = $this->db->f('id')+1;
-
-       //                      $choice_id = 
$this->bocommon->next_id($choice_table 
,array('attrib_detail'=>2,'attrib_id'=>$attrib['id']));
-
-                               $values= array(
-                                       $attrib['id'],
-                                       $choice_id,
-                                       !!$this->role +1,
-                                       $attrib['new_choice']
-                                       );
-
-                               $values = 
$this->bocommon->validate_db_insert($values);
-
-                               $this->db->query("INSERT INTO $choice_table 
(attrib_id,id,attrib_detail,value) "
-                               . "VALUES ($values)");
-                       }
-
-                       if($attrib['delete_choice'])
-                       {
-                               for 
($i=0;$i<count($attrib['delete_choice']);$i++)
-                               {
-                                       $this->db->query("DELETE FROM 
$choice_table WHERE  attrib_id=" . $attrib['id']  ." AND id=" . 
$attrib['delete_choice'][$i] . $filtermethod);
-                               }
-                       }
-
-                       $this->db->transaction_commit();
-                       $this->oProc->m_odb->transaction_commit();
-
-                       $receipt['message'][] = array('msg'     => 
lang('Attribute has been edited'));
-
-                       return $receipt;
-               }
-
-               function resort_attrib($data)
-               {
-//html_print_r($data);
-                       $attribute_table = 'fm_agreement_attribute';
-                       if(is_array($data))
-                       {
-                               $resort = 
(isset($data['resort'])?$data['resort']:'up');
-                               $id = (isset($data['id'])?$data['id']:'');
-                       }
-
-                       $sql = "SELECT attrib_sort FROM $attribute_table where 
id=$id";
-                       $this->db->query($sql);
-                       $this->db->next_record();
-                       $attrib_sort    = $this->db->f('attrib_sort');
-                       $sql = "SELECT max(attrib_sort) as max_sort FROM 
$attribute_table";
-                       $this->db->query($sql);
-                       $this->db->next_record();
-                       $max_sort       = $this->db->f('max_sort');
-                       switch($resort)
-                       {
-                               case 'up':
-                                       if($attrib_sort>1)
-                                       {
-                                               $sql = "UPDATE $attribute_table 
set attrib_sort=$attrib_sort WHERE attrib_sort =" . ($attrib_sort-1);
-                                               $this->db->query($sql);
-                                               $sql = "UPDATE $attribute_table 
set attrib_sort=" . ($attrib_sort-1) ." WHERE id=$id";
-                                               $this->db->query($sql);
-                                       }
-                                       break;
-                               case 'down':
-                                       if($max_sort > $attrib_sort)
-                                       {
-                                               $sql = "UPDATE $attribute_table 
set attrib_sort=$attrib_sort WHERE attrib_sort =" . ($attrib_sort+1);
-                                               $this->db->query($sql);
-                                               $sql = "UPDATE $attribute_table 
set attrib_sort=" . ($attrib_sort+1) ." WHERE id=$id";
-                                               $this->db->query($sql);
-                                       }
-                                       break;
-                               default:
-                                       return;
-                                       break;
-                       }
-               }
-
-               function delete_attrib($attrib_id)
-               {
-                       $table = 'fm_agreement';
-                       $attribute_table = 'fm_agreement_attribute';
-                       $table_def = $this->get_table_def($table);      
-
-                       $this->init_process();
-                       $this->oProc->m_odb->transaction_begin();
-                       $this->db->transaction_begin();
-
-                       $sql = "SELECT * FROM $attribute_table WHERE 
id=$attrib_id";
-
-                       $this->db->query($sql);
-                       $this->db->next_record();
-                       $ColumnName             = $this->db->f('column_name');
-
-                       if($this->oProc->DropColumn($table,$table_def[$table], 
$ColumnName))
-                       {
-                               $sql = "SELECT attrib_sort FROM 
$attribute_table where id=$attrib_id";
-                               $this->db->query($sql);
-                               $this->db->next_record();
-                               $attrib_sort    = $this->db->f('attrib_sort');
-                               $sql2 = "SELECT max(attrib_sort) as max_sort 
FROM $attribute_table";
-                               $this->db->query($sql2);
-                               $this->db->next_record();
-                               $max_sort       = $this->db->f('max_sort');
-                               if($max_sort>$attrib_sort)
-                               {
-                                       $sql = "UPDATE $attribute_table set 
attrib_sort=attrib_sort-1 WHERE attrib_sort > $attrib_sort";
-                                       $this->db->query($sql);
-                               }
-
-                               $this->db->query("DELETE FROM $attribute_table 
WHERE id=$attrib_id");
-                       }
-                       else
-                       {
-                               $receipt['error'][] = array('msg'       => 
lang('Attribute has NOT been deleted'));
-                       }
-
-                       $this->db->transaction_commit();
-                       $this->oProc->m_odb->transaction_commit();
-
-                       return $receipt;
-               }
-
                function request_next_id()
                {
                        $this->db->query("SELECT max(id) as id FROM 
fm_agreement");

Modified: trunk/property/inc/class.soalarm.inc.php
===================================================================
--- trunk/property/inc/class.soalarm.inc.php    2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.soalarm.inc.php    2008-02-02 13:52:39 UTC (rev 
18466)
@@ -36,7 +36,7 @@
        {
                function property_soalarm()
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $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();
@@ -125,8 +125,8 @@
 
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
                                $querymethod = " AND (account_lid $this->like 
'%$query%' OR method $this->like '%$query%' OR id $this->like '%$query%')";
                        }

Modified: trunk/property/inc/class.soasync.inc.php
===================================================================
--- trunk/property/inc/class.soasync.inc.php    2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.soasync.inc.php    2008-02-02 13:52:39 UTC (rev 
18466)
@@ -36,7 +36,7 @@
        {
                function property_soasync()
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $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();
@@ -78,8 +78,8 @@
                        $querymethod = '';
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
                                $querymethod = " where id $this->like 
'%$query%' or descr $this->like '%$query%'";
                        }

Modified: trunk/property/inc/class.sob_account.inc.php
===================================================================
--- trunk/property/inc/class.sob_account.inc.php        2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/inc/class.sob_account.inc.php        2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -36,7 +36,7 @@
        {
                function property_sob_account()
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $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();
@@ -76,8 +76,8 @@
 
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
                                $querymethod = " where id $this->like 
'%$query%' or descr $this->like '%$query%'";
                        }

Modified: trunk/property/inc/class.sobudget.inc.php
===================================================================
--- trunk/property/inc/class.sobudget.inc.php   2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.sobudget.inc.php   2008-02-02 13:52:39 UTC (rev 
18466)
@@ -36,7 +36,7 @@
        {
                function property_sobudget()
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $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();
@@ -103,8 +103,8 @@
 
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
                                $querymethod = " $where ( descr $this->like 
'%$query%')";
                        }
@@ -198,8 +198,8 @@
 
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
                        //      $querymethod = " $where ( descr $this->like 
'%$query%')";
                        }
@@ -270,6 +270,8 @@
                        if($this->db->next_record())
                        {
                                $receipt['error'][] = array('msg'=>lang('budget 
%1 already saved',$this->db->f('id')));
+                               $receipt['budget_id']= $this->db->f('id');
+                               return $receipt;
                        }
 
                        if(!$receipt['error'])
@@ -474,8 +476,8 @@
                        $querymethod = '';
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
                        //      $querymethod = " $where ( descr $this->like 
'%$query%')";
                        }
@@ -793,7 +795,7 @@
                                
                        }
                        
-                       $this->db->query("DELETE FROM fm_budget WHERE year ='" 
. $basis['year'] . "'  AND b_account_id in (" . implode(",",$b_account) . ") 
AND revision = '" . $basis['revision'] . "' AND district_id='" . 
$basis['district_id'] . "'" ,__LINE__,__FILE__);
+                       $this->db->query("DELETE FROM fm_budget WHERE year ='" 
. $basis['year'] . "'  AND b_account_id in ('" . implode("','",$b_account) . 
"') AND revision = '" . $basis['revision'] . "' AND district_id='" . 
$basis['district_id'] . "'" ,__LINE__,__FILE__);
                        $this->db->query('DELETE FROM fm_budget_basis WHERE 
id=' . intval($basis_id),__LINE__,__FILE__);
                        $this->db->transaction_commit();
                }
@@ -845,7 +847,7 @@
                                $sql = "DELETE FROM fm_budget WHERE year = " . 
(int)$basis['year']
                                        . " AND district_id = " . 
(int)$basis['district_id']
                                        . " AND revision = " . 
(int)$basis['revision']
-                                       . " AND b_account_id in (" . 
implode(",",$b_account) . ")";
+                                       . " AND b_account_id in ('" . 
implode("','",$b_account) . "')";
                                        
                                $this->db->query($sql,__LINE__,__FILE__);
                                
@@ -892,6 +894,7 @@
                                }
                        }
                        $this->db->transaction_commit();
+                       return $receipt;
                }
        }
 ?>

Modified: trunk/property/inc/class.socategory.inc.php
===================================================================
--- trunk/property/inc/class.socategory.inc.php 2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.socategory.inc.php 2008-02-02 13:52:39 UTC (rev 
18466)
@@ -36,7 +36,7 @@
        {
                function property_socategory()
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $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();
@@ -84,8 +84,8 @@
 
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
                                $querymethod = " where id $this->like 
'%$query%' or descr $this->like '%$query%'";
                        }

Modified: trunk/property/inc/class.socommon.inc.php
===================================================================
--- trunk/property/inc/class.socommon.inc.php   2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.socommon.inc.php   2008-02-02 13:52:39 UTC (rev 
18466)
@@ -49,11 +49,11 @@
                {
                        if($currentapp)
                        {
-                               $this->currentapp       = $currentapp;
+                       //      $this->currentapp       = $currentapp;
                        }
                        else
                        {
-                               $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];                        
+                       //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];                        
                        }
 
                        if(is_object($GLOBALS['phpgw']->db))
@@ -159,6 +159,7 @@
                {
                        $acl    = CreateObject('phpgwapi.acl');
                        $myaccounts = CreateObject('phpgwapi.accounts');
+                       $active_accounts = array();
 
                        $sql = "SELECT * FROM phpgw_accounts $this->join 
phpgw_acl on phpgw_accounts.account_id=phpgw_acl.acl_account WHERE 
account_status = 'A' AND acl_location $this->like '%$acl_location%' order by 
account_lastname ASC";
                        $this->db->query($sql,__LINE__,__FILE__);

Modified: trunk/property/inc/class.socustom.inc.php
===================================================================
--- trunk/property/inc/class.socustom.inc.php   2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.socustom.inc.php   2008-02-02 13:52:39 UTC (rev 
18466)
@@ -36,7 +36,7 @@
        {
                function property_socustom()
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $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();
@@ -80,8 +80,8 @@
 
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
                                $querymethod = " $where ( abid = '$query' or 
org_name $this->like '%$query%')";
                        }

Modified: trunk/property/inc/class.sodocument.inc.php
===================================================================
--- trunk/property/inc/class.sodocument.inc.php 2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.sodocument.inc.php 2008-02-02 13:52:39 UTC (rev 
18466)
@@ -37,7 +37,7 @@
 
                function property_sodocument()
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $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();
@@ -227,8 +227,8 @@
                        $querymethod = '';
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
                                $querymethod = " $where (fm_document.address 
$this->like '%$query%' or fm_document.location_code $this->like '$query%')";
                        }
@@ -316,8 +316,8 @@
 
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
                                $querymethod = " AND fm_document.title 
$this->like '%$query%' or fm_document.document_name $this->like '%$query%'";
                        }
@@ -543,11 +543,11 @@
 
                                if($old_p_num)
                                {
-                                       $file = $this->fakebase. SEP . 
'document' . SEP . $old_loc1 . SEP . $document['entity_name'] . SEP . 
$document['category_name'] . SEP . $p_num . SEP . $old_document_name;
+                                       $file = $this->fakebase. '/' . 
'document' . '/' . $old_loc1 . '/' . $document['entity_name'] . '/' . 
$document['category_name'] . '/' . $p_num . '/' . $old_document_name;
                                }
                                else
                                {
-                                       $file = $this->fakebase. SEP . 
'document' . SEP . $old_loc1 . SEP . $old_document_name;
+                                       $file = $this->fakebase. '/' . 
'document' . '/' . $old_loc1 . '/' . $old_document_name;
                                }
 
                                $receipt= $this->delete_file($file);
@@ -604,11 +604,11 @@
                                     )
                                )))
                                {
-                                       
$receipt['error'][]=array('msg'=>lang('failed to delete file') . ' :'. 
$this->fakebase. SEP . 'document'. SEP . $document_name);
+                                       
$receipt['error'][]=array('msg'=>lang('failed to delete file') . ' :'. 
$this->fakebase. '/' . 'document'. '/' . $document_name);
                                }
                                else
                                {
-                                       
$receipt['message'][]=array('msg'=>lang('file deleted') . ' :'. 
$this->fakebase. SEP . 'document'. SEP . $document_name);
+                                       
$receipt['message'][]=array('msg'=>lang('file deleted') . ' :'. 
$this->fakebase. '/' . 'document'. '/' . $document_name);
                                }
                                $this->vfs->override_acl = 0;
                        }
@@ -638,11 +638,11 @@
                        {
                                if($p_num)
                                {
-                                       $file = $this->fakebase. SEP . 
'document' . SEP . $loc1 . SEP . $entity['name'] . SEP . $category['name'] . 
SEP . $p_num . SEP . $document_name;
+                                       $file = $this->fakebase. '/' . 
'document' . '/' . $loc1 . '/' . $entity['name'] . '/' . $category['name'] . 
'/' . $p_num . '/' . $document_name;
                                }
                                else
                                {
-                                       $file = $this->fakebase. SEP . 
'document' . SEP . $loc1 . SEP . $document_name;
+                                       $file = $this->fakebase. '/' . 
'document' . '/' . $loc1 . '/' . $document_name;
                                }
 
                                $receipt= $this->delete_file($file);

Modified: trunk/property/inc/class.soentity.inc.php
===================================================================
--- trunk/property/inc/class.soentity.inc.php   2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.soentity.inc.php   2008-02-02 13:52:39 UTC (rev 
18466)
@@ -43,7 +43,7 @@
 
                function property_soentity($entity_id='',$cat_id='')
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $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();
@@ -63,13 +63,13 @@
                                return;
                        }
 
-                       $sql= "SELECT fm_entity_choice.id, 
fm_entity_choice.value FROM fm_entity_attribute $this->join fm_entity_choice ON 
"
-                       . " fm_entity_attribute.entity_id= 
fm_entity_choice.entity_id AND "
-                       . " fm_entity_attribute.cat_id= fm_entity_choice.cat_id 
AND "
-                       . " fm_entity_attribute.id= fm_entity_choice.attrib_id "
-                       . " WHERE fm_entity_attribute.column_name='status' "
-                       . " AND fm_entity_choice.entity_id=$entity_id "
-                       . " AND fm_entity_choice.cat_id=$cat_id ORDER BY 
fm_entity_choice.id";
+                       $sql= "SELECT phpgw_cust_choice.id, 
phpgw_cust_choice.value FROM phpgw_cust_attribute $this->join phpgw_cust_choice 
ON "
+                       . " phpgw_cust_attribute.appname= 
phpgw_cust_choice.appname AND "
+                       . " phpgw_cust_attribute.location= 
phpgw_cust_choice.location AND "
+                       . " phpgw_cust_attribute.id= 
phpgw_cust_choice.attrib_id "
+                       . " WHERE phpgw_cust_attribute.column_name='status' "
+                       . " AND phpgw_cust_choice.appname='property' "
+                       . " AND 
phpgw_cust_choice.location='.entity.$entity_id.$cat_id' ORDER BY 
phpgw_cust_choice.id";
 
 
                        $this->db->query($sql,__LINE__,__FILE__);
@@ -111,13 +111,13 @@
                                return;
                        }
 
-                       $grants         = 
$GLOBALS['phpgw']->session->appsession('grants_entity_'.$entity_id.'_'.$cat_id,$this->currentapp);
+                       $grants         = 
$GLOBALS['phpgw']->session->appsession('grants_entity_'.$entity_id.'_'.$cat_id,'property');
 
                        if(!$grants)
                        {
                                $this->acl      = CreateObject('phpgwapi.acl');
-                               $grants         = 
$this->acl->get_grants($this->currentapp,'.entity.' . $entity_id . '.' . 
$cat_id);
-                               
$GLOBALS['phpgw']->session->appsession('grants_entity_'.$entity_id.'_'.$cat_id,$this->currentapp,$grants);
+                               $grants         = 
$this->acl->get_grants('property','.entity.' . $entity_id . '.' . $cat_id);
+                               
$GLOBALS['phpgw']->session->appsession('grants_entity_'.$entity_id.'_'.$cat_id,'property',$grants);
                        }
 
                        $sql = $this->bocommon->fm_cache('sql_entity_' . 
$entity_id . '_' . $cat_id . '_' . $lookup);
@@ -126,6 +126,10 @@
                        $category = 
$admin_entity->read_single_category($entity_id,$cat_id);
 
                        $entity_table = 'fm_entity_' . $entity_id . '_' . 
$cat_id;
+                       $choice_table = 'phpgw_cust_choice';
+                       $attribute_table = 'phpgw_cust_attribute';
+                       $attribute_filter = " appname = 'property' AND location 
= '.entity." . $entity_id . '.' . $cat_id . "'";
+
                        if(!$sql)
                        {
                                $cols = $entity_table . '.*';
@@ -182,41 +186,21 @@
 
                        if ($cat_id > 0)
                        {
-                               $fm_entity_cols = 
$admin_entity->read_attrib(array('entity_id'=>$entity_id,'cat_id'=>$cat_id,'allrows'=>true));
+//-------------------
 
-                               $result_columns = array();
-                               foreach ($fm_entity_cols as $col_entry)
-                               {
-                                       if ($col_entry['list'])
-                                       {
-                                               $result_columns[] = 
$col_entry['id'];
-                                       }
-                               }
-
-                               $user_columns = 
isset($GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['entity_columns_'.$entity_id.'_'.$cat_id])?$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['entity_columns_'.$entity_id.'_'.$cat_id]:'';
-
+                               $user_columns = 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['entity_columns_'.$entity_id.'_'.$cat_id])?$GLOBALS['phpgw_info']['user']['preferences']['property']['entity_columns_'.$entity_id.'_'.$cat_id]:'';
+                               $user_column_filter = '';
                                if (isset($user_columns) AND 
is_array($user_columns) AND $user_columns[0])
                                {
-                                       $result_columns = 
array_merge($result_columns, $user_columns);
-                                       $result_columns = 
array_unique($result_columns);
+                                       $user_column_filter = " OR 
($attribute_filter AND id IN (" . implode(',',$user_columns) .'))';
                                }
                                        
-                               $i      = count($uicols['name']);
-                               if(isset($result_columns) && 
is_array($result_columns))
-                               {
-                                       foreach($result_columns as $column_id)
-                                       {
-                                               $this->db->query("SELECT * FROM 
fm_entity_attribute WHERE entity_id= $entity_id AND cat_id= $cat_id AND id= 
$column_id");
-                                               $this->db->next_record();
+                               $this->db->query("SELECT * FROM 
$attribute_table WHERE list=1 AND $attribute_filter $user_column_filter ORDER 
BY attrib_sort ASC");
                                                
-                                               if($this->db->f('datatype') == 
'link')
+                               $i      = count($uicols['name']);
+                               while ($this->db->next_record())
                                                {
-                                                       $uicols['input_type'][] 
        = 'link';
-                                               }
-                                               else
-                                               {
                                                        $uicols['input_type'][] 
        = 'text';
-                                               }
                                                $uicols['name'][]               
        = $this->db->f('column_name');
                                                $uicols['descr'][]              
        = $this->db->f('input_text');
                                                $uicols['statustext'][]         
= $this->db->f('statustext');
@@ -226,9 +210,9 @@
                                                        'datatype'      => 
$this->db->f('datatype'),
                                                        'attrib_id'     => 
$this->db->f('id')
                                                );
+       
                                                $i++;
                                        }
-                               }
 
                                $uicols['input_type'][]         = 'text';
                                $uicols['name'][]                       = 
'entry_date';
@@ -309,12 +293,12 @@
                                }
                                else
                                {
-                                       $query = ereg_replace("'",'',$query);
-                                       $query = ereg_replace('"','',$query);
+                                       $query = preg_replace("/'/",'',$query);
+                                       $query = preg_replace('/"/','',$query);
                                        $filtermethod .= " $where ( 
$entity_table.location_code $this->like '%$query%' OR $entity_table.num 
$this->like '%$query%' OR address $this->like '%$query%')";
                                        $where= 'OR';
 
-                                       $this->db->query("SELECT * FROM 
fm_entity_attribute where search='1' AND entity_id= $entity_id AND cat_id = 
$cat_id");
+                                       $this->db->query("SELECT * FROM 
$attribute_table WHERE $attribute_filter AND search='1'");
 
                                        while ($this->db->next_record())
                                        {
@@ -388,7 +372,7 @@
 
                                                
if(($cols_return_extra[$i]['datatype']=='R' || 
$cols_return_extra[$i]['datatype']=='LB') && $value)
                                                {
-                                                       $sql="SELECT value FROM 
fm_entity_choice where entity_id=$entity_id AND cat_id=$cat_id AND attrib_id=" 
.$cols_return_extra[$i]['attrib_id']. "  AND id=" . $value;
+                                                       $sql="SELECT value FROM 
$choice_table WHERE $attribute_filter AND attrib_id=" 
.$cols_return_extra[$i]['attrib_id']. "  AND id=" . $value;
                                                        $this->db2->query($sql);
                                                        
$this->db2->next_record();
                                                        
$entity_list[$j][$cols_return_extra[$i]['name']] = $this->db2->f('value');
@@ -413,7 +397,7 @@
                                                        {
                                                                for 
($k=0;$k<count($ch);$k++)
                                                                {
-                                                                       
$sql="SELECT value FROM fm_entity_choice where entity_id=$entity_id AND 
cat_id=$cat_id AND attrib_id=" .$cols_return_extra[$i]['attrib_id']. "  AND 
id=" . $ch[$k];
+                                                                       
$sql="SELECT value FROM $choice_table WHERE $attribute_filter AND attrib_id=" 
.$cols_return_extra[$i]['attrib_id']. "  AND id=" . $ch[$k];
                                                                        
$this->db2->query($sql);
                                                                        while 
($this->db2->next_record())
                                                                        {
@@ -453,55 +437,34 @@
                        return $entity_list;
                }
 
-               function read_single($data)
+               function read_single($data,$values = array())
                {
                        $entity_id =$data['entity_id'];
                        $cat_id =$data['cat_id'];
                        $id =$data['id'];
-
-                       $this->db->query("SELECT * FROM fm_entity_attribute 
WHERE entity_id =$entity_id AND cat_id =$cat_id ORDER BY attrib_sort");
-
-                       while ($this->db->next_record())
-                       {
-                               $entity['attributes'][] = array
-                               (
-                                       'attrib_id'             => 
$this->db->f('id'),
-                                       'name'                  => 
$this->db->f('column_name'),
-                                       'input_text'    => 
stripslashes($this->db->f('input_text')),
-                                       'statustext'    => 
stripslashes($this->db->f('statustext')),
-//                                     'statustext'    => str_replace("\n"," 
",stripslashes($this->db->f('statustext'))),
-                                       'datatype'              => 
$this->db->f('datatype'),
-                                       'history'               => 
$this->db->f('history'),
-                                       'allow_null'    => 
$this->db->f('nullable'),
-                                       'disabled'              => 
$this->db->f('disabled'),
-                                       'helpmsg'               => 
!!$this->db->f('helpmsg')
-                               );
-                       }
-//_debug_array($entity);
-
-                       if($id)
-                       {
                                $table='fm_entity_' . $entity_id .'_' . $cat_id;
 
                                $this->db->query("SELECT * FROM $table WHERE id 
=$id");
 
                                if($this->db->next_record())
                                {
-                                       $entity['id']                           
= $id;
-                                       $entity['num']                          
= $this->db->f('num');
-                                       $entity['p_num']                        
= $this->db->f('p_num');
-                                       $entity['p_entity_id']          = 
$this->db->f('p_entity_id');
-                                       $entity['p_cat_id']                     
= $this->db->f('p_cat_id');
-                                       $entity['location_code']        = 
$this->db->f('location_code');
-                                       $entity['tenant_id']            = 
$this->db->f('tenant_id');
-                                       $entity['contact_phone']        = 
$this->db->f('contact_phone');
-                                       $entity['status']                       
= $this->db->f('status');
+                                       $values['id']                           
= $id;
+                                       $values['num']                          
= $this->db->f('num');
+                                       $values['p_num']                        
= $this->db->f('p_num');
+                                       $values['p_entity_id']          = 
$this->db->f('p_entity_id');
+                                       $values['p_cat_id']                     
= $this->db->f('p_cat_id');
+                                       $values['location_code']        = 
$this->db->f('location_code');
+                                       $values['tenant_id']            = 
$this->db->f('tenant_id');
+                                       $values['contact_phone']        = 
$this->db->f('contact_phone');
+                                       $values['status']                       
= $this->db->f('status');
 
-                                       for 
($i=0;$i<count($entity['attributes']);$i++)
+                               if ( isset($values['attributes']) && 
is_array($values['attributes']) )
+                               {
+                                       foreach ( $values['attributes'] as 
&$attr )
                                        {
-                                               
$entity['attributes'][$i]['value']      = 
$this->db->f($entity['attributes'][$i]['name']);
-                                               
$entity['attributes'][$i]['datatype_text']      = 
$this->bocommon->translate_datatype($entity['attributes'][$i]['datatype']);
+                                               $attr['value']  = 
$this->db->f($attr['column_name']);
                                        }
+                                       }
                                }
 
 // ------------- get origin---------------
@@ -516,9 +479,9 @@
                                        {
                                                $i++;
                                        }
-                                       $entity['origin'][$i]['type'] = 
$this->db->f('origin');
-                                       $entity['origin'][$i]['link'] = 
$this->bocommon->get_origin_link($this->db->f('origin'));
-                                       $entity['origin'][$i]['data'][]= array(
+                                       $values['origin'][$i]['type'] = 
$this->db->f('origin');
+                                       $values['origin'][$i]['link'] = 
$this->bocommon->get_origin_link($this->db->f('origin'));
+                                       $values['origin'][$i]['data'][]= array(
                                                'id'=> 
$this->db->f('origin_id'),
                                                'type'=> $this->db->f('origin')
                                                );
@@ -538,18 +501,18 @@
                                        {
                                                $i++;
                                        }
-                                       $entity['destination'][$i]['type'] = 
$this->db->f('destination');
-                                       $entity['destination'][$i]['link'] = 
$this->bocommon->get_origin_link($this->db->f('destination'));
-                                       $entity['destination'][$i]['data'][]= 
array(
+                                       $values['destination'][$i]['type'] = 
$this->db->f('destination');
+                                       $values['destination'][$i]['link'] = 
$this->bocommon->get_origin_link($this->db->f('destination'));
+                                       $values['destination'][$i]['data'][]= 
array(
                                                'id'=> 
$this->db->f('destination_id'),
                                                'type'=> 
$this->db->f('destination')
                                                );
 
                                        $last_type=$this->db->f('destination');
                                }
-                       }
+
 // ------------- end get destination---------------
-                       return  $entity;
+                       return  $values;
                }
 
 
@@ -835,8 +798,13 @@
                        $cat_id = (isset($data['cat_id'])?$data['cat_id']:'');
                        $attrib_id = 
(isset($data['attrib_id'])?$data['attrib_id']:'');
                        
-                       $this->db->query("SELECT helpmsg FROM 
fm_entity_attribute WHERE entity_id ='$entity_id' AND cat_id ='$cat_id' AND id 
= '$attrib_id'");
+                       if(!$entity_id || !$cat_id || !$attrib_id)
+                       {
+                               return;
+                       }
 
+                       $this->db->query("SELECT helpmsg FROM 
fphpgw_cust_attribute WHERE appname = 'property' AND location = '.entity." . 
$entity_id . '.' . $cat_id . ' AND id =' . (int)$attrib_id );
+
                        $this->db->next_record();
 //                     $helpmsg = 
str_replace("\n","<br>",stripslashes($this->db->f('helpmsg')));
                        $helpmsg = stripslashes($this->db->f('helpmsg'));

Modified: trunk/property/inc/class.sogab.inc.php
===================================================================
--- trunk/property/inc/class.sogab.inc.php      2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.sogab.inc.php      2008-02-02 13:52:39 UTC (rev 
18466)
@@ -39,7 +39,7 @@
 
                function property_sogab($gab_insert_level)
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $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();

Modified: trunk/property/inc/class.soinvestment.inc.php
===================================================================
--- trunk/property/inc/class.soinvestment.inc.php       2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/inc/class.soinvestment.inc.php       2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -36,7 +36,7 @@
        {
                function property_soinvestment()
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $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();

Modified: trunk/property/inc/class.soinvoice.inc.php
===================================================================
--- trunk/property/inc/class.soinvoice.inc.php  2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.soinvoice.inc.php  2008-02-02 13:52:39 UTC (rev 
18466)
@@ -38,7 +38,7 @@
 
                function property_soinvoice()
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->bocommon         = 
CreateObject('property.bocommon');
                        $this->db               = $this->bocommon->new_db();
                        $this->db2              = $this->bocommon->new_db();
@@ -206,8 +206,8 @@
 
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
                                $querymethod = " $where ( spvend_code 
$this->like '%$query%' OR bilagsnr $this->like '%$query%' )";
                        }

Modified: trunk/property/inc/class.solocation.inc.php
===================================================================
--- trunk/property/inc/class.solocation.inc.php 2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.solocation.inc.php 2008-02-02 13:52:39 UTC (rev 
18466)
@@ -37,7 +37,7 @@
 
                function property_solocation()
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
 
                        $this->account                  = 
$GLOBALS['phpgw_info']['user']['account_id'];
                        $this->soadmin_location = 
CreateObject('property.soadmin_location');
@@ -81,7 +81,7 @@
                        {               
                                $entity[] = array
                                (
-                                       'entity_link'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uitts.index', 'query'=> $location_code)),
+                                       'entity_link'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uitts.index', 'query'=> $location_code)),
                                        'name'          => lang('Helpdesk') . ' 
[' . $this->db2->f('hits') . ']',
                                        'descr'         => lang('Helpdesk')
                                );
@@ -94,7 +94,7 @@
                        {               
                                $entity[] = array
                                (
-                                       'entity_link'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction' => 
$this->currentapp.'.uidocument.index','query'=> $location_code)),
+                                       'entity_link'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction' => 
'property.uidocument.index','query'=> $location_code)),
                                        'name'          => 
lang('Documentation') . ' [' . $this->db2->f('hits') . ']',
                                        'descr'         => lang('Documentation')
                                );
@@ -113,11 +113,13 @@
                                return;
                        }
 
-                       $sql= "SELECT fm_location_choice.id, 
fm_location_choice.value FROM fm_location_attrib $this->join fm_location_choice 
ON "
-                       . " fm_location_attrib.type_id= 
fm_location_choice.type_id AND "
-                       . " fm_location_attrib.id= fm_location_choice.attrib_id 
"
-                       . " WHERE fm_location_attrib.column_name='status' "
-                       . " AND fm_location_choice.type_id=$type_id ORDER BY 
fm_location_choice.id";
+                       $sql= "SELECT phpgw_cust_choice.id, 
phpgw_cust_choice.value FROM phpgw_cust_attribute $this->join phpgw_cust_choice 
ON "
+                       . " phpgw_cust_attribute.appname= 
phpgw_cust_choice.appname AND "
+                       . " phpgw_cust_attribute.location= 
phpgw_cust_choice.location AND "
+                       . " phpgw_cust_attribute.id= 
phpgw_cust_choice.attrib_id "
+                       . " WHERE phpgw_cust_attribute.column_name='status' "
+                       . " AND phpgw_cust_choice.appname='property' "
+                       . " AND phpgw_cust_choice.location='.location.$type_id' 
ORDER BY phpgw_cust_choice.id";
 
 
                        $this->db->query($sql,__LINE__,__FILE__);
@@ -206,6 +208,10 @@
                        }
 
                        $sql = $this->socommon->fm_cache('sql_'. $type_id . '_' 
. $lookup_tenant . '_' . $lookup);
+                       $choice_table = 'phpgw_cust_choice';
+                       $attribute_table = 'phpgw_cust_attribute';
+                       $attribute_filter = " custom = 1 AND appname = 
'property' AND location = '.location." . $type_id . "'";
+                       $attribute_choice_filter = " appname = 'property' AND 
location = '.location." . $type_id . "'";
 
                        if(!$sql)
                        {
@@ -325,7 +331,7 @@
                                                }
                                                else
                                                {
-                                                       $joinmethod .= " 
$this->join  " . $config[$i]['reference_table'] . " ON ( fm_location" . 
$config[$i]['location_type'] . "." . $config[$i]['column_name'] . "=" . 
$config[$i]['reference_table'] . ".".$config[$i]['reference_id']."))";
+                                                       $joinmethod .= " 
$this->left_join  " . $config[$i]['reference_table'] . " ON ( fm_location" . 
$config[$i]['location_type'] . "." . $config[$i]['column_name'] . "=" . 
$config[$i]['reference_table'] . ".".$config[$i]['reference_id']."))";
                                                        $paranthesis .='(';
                                                }
                                        }
@@ -384,6 +390,12 @@
                                        }
                                }
 
+                               $this->db->query("SELECT * FROM 
$attribute_table WHERE list=1 AND $attribute_filter");
+                               while ($this->db->next_record())
+                               {
+                                       $cols .= ",fm_location" . ($type_id) 
.'.' . $this->db->f('column_name');
+                               }
+
                                $from = " FROM $paranthesis fm_location$type_id 
";
 
                                $sql = "SELECT $cols $from $joinmethod";
@@ -403,66 +415,33 @@
                        }
 
 //---------------------start custom user cols
-                               $fm_location_cols = 
$this->soadmin_location->read_attrib(array('type_id'=>$type_id,'lookup_type'=>$type_id,
 'allrows'=>true));
 
-                               $result_columns = array();
-                               foreach ($fm_location_cols as $col_entry)
-                               {
-                                       if ($col_entry['list']==1)
-                                       {
-                                               $result_columns[] = 
$col_entry['id'];
-                                       }
-                               }
-
-                               $user_columns = 
isset($GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['location_columns_'.$type_id])
 ? 
$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['location_columns_'.$type_id]
 : '';
-
+                               $user_columns = 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['location_columns_'.$type_id
 . !!$lookup]) ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['location_columns_'.$type_id
 . !!$lookup] : '';
+                               $user_column_filter = '';
                                if (isset($user_columns) AND 
is_array($user_columns) AND $user_columns[0])
                                {
-                                       $result_columns = 
array_merge($result_columns, $user_columns);
-                                       $result_columns = 
array_unique($result_columns);
+                                       $user_column_filter = " OR 
($attribute_filter AND id IN (" . implode(',',$user_columns) .'))';
                                }
                                        
+                               $this->db->query("SELECT * FROM 
$attribute_table WHERE list=1 AND $attribute_filter $user_column_filter ORDER 
BY attrib_sort ASC");
+                                               
                                $i      = count($uicols['name']);
-                               if(isset($result_columns) && 
is_array($result_columns))
-                               {
-                                       $cols_extra ='';
-                                       foreach($result_columns as $column_id)
-                                       {
-                                               $this->db->query("SELECT * FROM 
fm_location_attrib WHERE type_id= $type_id AND id= $column_id");
-                                               $this->db->next_record();
-                                               
-                                               if($this->db->f('datatype') == 
'link')
+                               while ($this->db->next_record())
                                                {
-                                                       $uicols['input_type'][] 
        = 'link';
-                                               }
-                                               else
-                                               {
                                                        $uicols['input_type'][] 
        = 'text';
-                                               }
-                                               $cols_extra .= 
",fm_location{$type_id}.". $this->db->f('column_name');
-                                               $cols_return[]                  
        = $this->db->f('column_name');
                                                $uicols['name'][]               
        = $this->db->f('column_name');
                                                $uicols['descr'][]              
        = $this->db->f('input_text');
                                                $uicols['statustext'][]         
= $this->db->f('statustext');
-                                               $uicols['datatype'][]           
= $this->db->f('datatype');
-
-                                               if($this->db->f('lookup_form') 
== 1)
-                                               {
-                                                       $uicols['exchange'][$i] 
        = True;
-                                               }
-
-                                               
$uicols['cols_return_extra'][$i]= array(
+                                       $uicols['datatype'][$i]         = 
$this->db->f('datatype');
+                                       $cols_return_extra[]= array(
                                                        'name'                  
=> $this->db->f('column_name'),
                                                        'datatype'              
=> $this->db->f('datatype'),
-                                                       'statustext'    => 
$this->db->f('statustext'),
-                                                       'descr'                 
=> $this->db->f('input_text'),
-                                                       'attrib_id'             
=> $column_id
+                                               'attrib_id'     => 
$this->db->f('id')
                                                );
 
                                                $i++;
                                        }
-                                       $sql = str_replace('FROM' , $cols_extra 
. ' FROM', $sql);
-                               }
+
 //---------------------end custom user cols
 
                        $this->uicols = $uicols;
@@ -499,7 +478,7 @@
 
                        if ($filter > 0)
                        {
-                               
if($GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['property_filter']
 == 'owner')
+                               
if($GLOBALS['phpgw_info']['user']['preferences']['property']['property_filter'] 
== 'owner')
                                {
                                        $filtermethod .= " $where 
fm_owner.id='$filter' ";
                                }
@@ -548,8 +527,8 @@
                                }
                                else
                                {
-                                       $query = ereg_replace("'",'',$query);
-                                       $query = ereg_replace('"','',$query);
+                                       $query = preg_replace("/'/",'',$query);
+                                       $query = preg_replace('/"/','',$query);
 
                                        if($sub_query_tenant)
                                        {
@@ -595,29 +574,35 @@
                                        $location_list[$j][$cols_return[$i]] = 
stripslashes($this->db->f($cols_return[$i]));
 
                                        $value = $this->db->f($cols_return[$i]);
+                               }
 
-                                       
if(isset($uicols['cols_return_extra'][$i]))
+                               if(isset($cols_return_extra) && 
is_array($cols_return_extra))
                                        {
-                                               
if(($uicols['cols_return_extra'][$i]['datatype']=='R' || 
$uicols['cols_return_extra'][$i]['datatype']=='LB') && $value):
+                                       for 
($i=0;$i<count($cols_return_extra);$i++)
                                                {
-                                                       $sql="SELECT value FROM 
fm_location_choice where type_id=$type_id AND attrib_id=" 
.$uicols['cols_return_extra'][$i]['attrib_id']. "  AND id=" . $value;
+                                               $value = 
$this->db->f($cols_return_extra[$i]['name'], true);
+
+                                               
if(($cols_return_extra[$i]['datatype']=='R' || 
$cols_return_extra[$i]['datatype']=='LB') && $value)
+                                               {
+                                       //              $sql="SELECT value FROM 
fm_location_choice where type_id=$type_id AND attrib_id=" 
.$cols_return_extra[$i]['attrib_id']. "  AND id=" . $value;
+                                                       $sql="SELECT value FROM 
$choice_table WHERE $attribute_choice_filter AND attrib_id=" 
.$cols_return_extra[$i]['attrib_id']. "  AND id=" . $value;
                                                        $this->db2->query($sql);
                                                        
$this->db2->next_record();
-                                                       
$location_list[$j][$cols_return[$i]] = $this->db2->f('value');
+                                                       
$location_list[$j][$cols_return_extra[$i]['name']] = $this->db2->f('value');
                                                }
-                                               
elseif($uicols['cols_return_extra'][$i]['datatype']=='AB' && $value):
+                                               else 
if($cols_return_extra[$i]['datatype']=='AB' && $value)
                                                {
                                                        $contact_data   = 
$contacts->read_single_entry($value,array('n_given'=>'n_given','n_family'=>'n_family','email'=>'email'));
-                                                       
$location_list[$j][$cols_return[$i]]    = $contact_data[0]['n_family'] . ', ' . 
$contact_data[0]['n_given'];
+                                                       
$location_list[$j][$cols_return_extra[$i]['name']]      = 
$contact_data[0]['n_family'] . ', ' . $contact_data[0]['n_given'];
                                                }
-                                               
elseif($uicols['cols_return_extra'][$i]['datatype']=='VENDOR' && $value):
+                                               else 
if($cols_return_extra[$i]['datatype']=='VENDOR' && $value)
                                                {
                                                        $sql="SELECT org_name 
FROM fm_vendor where id=$value";
                                                        $this->db2->query($sql);
                                                        
$this->db2->next_record();
-                                                       
$location_list[$j][$cols_return[$i]] = $this->db2->f('org_name');
+                                                       
$location_list[$j][$cols_return_extra[$i]['name']] = $this->db2->f('org_name');
                                                }
-                                               
elseif($uicols['cols_return_extra'][$i]['datatype']=='CH' && $value):
+                                               else 
if($cols_return_extra[$i]['datatype']=='CH' && $value)
                                                {
                                                        $ch= 
unserialize($value);
 
@@ -625,22 +610,30 @@
                                                        {
                                                                for 
($k=0;$k<count($ch);$k++)
                                                                {
-                                                                       
$sql="SELECT value FROM fm_location_choice where type_id=$type_id AND 
attrib_id=" .$uicols['cols_return_extra'][$i]['attrib_id']. "  AND id=" . 
$ch[$k];
+                       //                                              
$sql="SELECT value FROM fm_location_choice where type_id=$type_id AND 
attrib_id=" .$cols_return_extra[$i]['attrib_id']. "  AND id=" . $ch[$k];
+                                                                       
$sql="SELECT value FROM $choice_table WHERE $attribute_choice_filter AND 
attrib_id=" .$cols_return_extra[$i]['attrib_id']. "  AND id=" . $ch[$k];
                                                                        
$this->db2->query($sql);
                                                                        while 
($this->db2->next_record())
                                                                        {
                                                                                
$ch_value[]=$this->db2->f('value');
                                                                        }
                                                                }
-                                                               
$location_list[$j][$cols_return[$i]] = @implode(",", $ch_value);
+                                                               
$location_list[$j][$cols_return_extra[$i]['name']] = @implode(",", $ch_value);
                                                                
unset($ch_value);
                                                        }
                                                }
-                                               
elseif($uicols['cols_return_extra'][$i]['datatype']=='D' && $value):
+                                               else 
if($cols_return_extra[$i]['datatype']=='D' && $value)
                                                {
-                                                       
$location_list[$j][$cols_return[$i]]=date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'],strtotime($value));
+                                                       
$location_list[$j][$cols_return_extra[$i]['name']]=date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'],strtotime($value));
                                                }
-                                               endif;
+                                               else 
if($cols_return_extra[$i]['datatype']=='timestamp' && $value)
+                                               {
+                                                       
$location_list[$j][$cols_return_extra[$i]['name']]=date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'],$value);
+                                               }
+                                               else
+                                               {
+                                                       
$location_list[$j][$cols_return_extra[$i]['name']] = $value;
+                                               }
                                        }
                                        unset($value);
                                }
@@ -659,14 +652,13 @@
                        return $location_list;
                }
 
-
                function 
generate_sql($type_id='',$cols='',$cols_return='',$uicols='',$read_single='')
                {
                        $joinmethod = " fm_location" . ($type_id);
 
                        $location_types = 
$this->soadmin_location->select_location_type();
 
-                       $cols .= "fm_location" . ($type_id) .".location_code";
+       //              $cols .= "fm_location" . ($type_id) .".location_code";
                        $cols_return[] = 'location_code';
                        for ($i=0; $i<($type_id); $i++)
                        {
@@ -674,7 +666,7 @@
                                $uicols['name'][]               = 'loc' . 
$location_types[$i]['id'];
                                $uicols['descr'][]              = 
$location_types[$i]['name'];
                                $uicols['statustext'][]         = 
$location_types[$i]['descr'];
-                               $cols                           .= 
",fm_location" . ($type_id) .".loc" . $location_types[$i]['id'];
+       //                      $cols                           .= 
",fm_location" . ($type_id) .".loc" . $location_types[$i]['id'];
                                $cols_return[]                  = 'loc' . 
$location_types[$i]['id'];
                        }
 
@@ -733,7 +725,7 @@
                                if ($config[$i]['location_type'] <= $type_id)
                                {
 
-                                       
if($config[$i]['column_name']=='street_id'):
+                                       
if($config[$i]['column_name']=='street_id')
                                        {
                                                $cols.= 
',fm_streetaddress.descr as street_name';
                                                $cols_return[]                  
= 'street_name';
@@ -757,7 +749,7 @@
                                                $uicols['statustext'][]         
= lang($config[$i]['input_text']);
 
                                        }
-                                       
elseif($config[$i]['column_name']=='tenant_id'):
+                                       else 
if($config[$i]['column_name']=='tenant_id')
                                        {
                                                $cols.= ',fm_tenant.id as 
tenant_id';
                                                $cols_return[]                  
= 'tenant_id';
@@ -788,7 +780,7 @@
                                                $uicols['statustext'][]         
= lang('contact phone');
 
                                        }
-                                       else:
+                                       else
                                        {
                                                $cols.= ',fm_location' . 
$config[$i]['location_type'] . '.' . $config[$i]['column_name'];
                                                $cols_return[]                  
= $config[$i]['column_name'];
@@ -797,29 +789,24 @@
                                                $uicols['descr'][]              
= $config[$i]['input_text'];
                                                $uicols['statustext'][]         
= $config[$i]['input_text'];
                                        }
-                                       endif;
                                }
                        }
 
-                       $fm_location_cols = 
$this->soadmin_location->read_attrib(array('type_id'=>$type_id,'lookup_type'=>$type_id,'allrows'=>True));
+                       $custom         = 
createObject('phpgwapi.custom_fields');
+
+                       $fm_location_cols = $custom->get_attribs('property', 
'.location.' . $type_id, 0, '', '', '', true);
 //_debug_array($fm_location_cols);
 
                        $location_cols_count    = count($fm_location_cols);
 
-                       for ($i=0;$i<$location_cols_count;$i++)
-                       {
-
                                if($read_single)
                                {
-                                       $cols .= ",fm_location" . 
$fm_location_cols[$i]['location_type'] 
.".".$fm_location_cols[$i]['column_name'];
-                                       $cols_return[]                          
= $fm_location_cols[$i]['column_name'];
-                                       $uicols['input_type'][]                 
= 'text';
-                                       $uicols['name'][]                       
= $fm_location_cols[$i]['column_name'];
-                                       $uicols['descr'][]                      
= $fm_location_cols[$i]['input_text'];
-                                       $uicols['statustext'][]                 
= $fm_location_cols[$i]['statustext'];
+                               $cols .= ",fm_location{$type_id}.*";
                                }
                                else
                                {
+                               for ($i=0;$i<$location_cols_count;$i++)
+                               {
                                        if($fm_location_cols[$i]['list']==1)
                                        {
                                                $cols .= ",fm_location" . 
($type_id) .".".$fm_location_cols[$i]['column_name'];
@@ -850,7 +837,7 @@
                        return $sql;
                }
 
-               function read_single($location_code='')
+               function read_single($location_code='',$values = array())
                {
                        $location_array = split('-',$location_code);
                        $type_id= count($location_array);
@@ -860,23 +847,24 @@
                                return;
                        }
 
-                       $cols = 'fm_location' . $type_id .'.category as 
cat_id,';
+                       $cols = 'fm_location' . $type_id .'.category as cat_id';
                        $cols_return[]  = 'cat_id';
 
-                       for ($i=1;$i<($type_id+1);$i++)
+                       for ($i=1;$i<($type_id);$i++)
                        {
-                               $cols.= 'fm_location' . $i .'.loc' . $i 
.'_name,';
+                               $cols.= ',fm_location' . $i .'.loc' . $i 
.'_name';
                                $cols_return[]                          = 'loc' 
. $i .'_name';
                        }
+                       $cols_return[]                          = 'loc' . 
$type_id .'_name';
 
-                       $cols.= 'fm_location' . $type_id . '.change_type,';
+               //      $cols.= 'fm_location' . $type_id . '.change_type,';
                        $cols_return[]                          = 'change_type';
                        $uicols['input_type'][]         = 'text';
                        $uicols['name'][]                       = 'loc' . 
$type_id .'_name';
                        $uicols['descr'][]                      = lang('name');
                        $uicols['statustext'][]         = lang('name');
 
-                       $cols.= 'fm_location' . $type_id .'.remark as remark,';
+               //      $cols.= 'fm_location' . $type_id .'.remark as remark,';
                        $cols_return[]                          = 'remark';
                        $uicols['input_type'][]         = 'text';
                        $uicols['name'][]                       = 'descr';
@@ -908,12 +896,20 @@
                        $this->db->next_record();
                        for ($i=0;$i<$cols_return_count;$i++)
                        {
-                               $location[$cols_return[$i]] = 
stripslashes($this->db->f($cols_return[$i]));
+                               $values[$cols_return[$i]] = 
stripslashes($this->db->f($cols_return[$i]));
                        }
 
+                       if ( isset($values['attributes']) && 
is_array($values['attributes']) )
+                       {
+                               foreach ( $values['attributes'] as &$attr )
+                               {
+                                       $attr['value']  = 
$this->db->f($attr['column_name']);
+                               }
+                       }
+
 //_debug_array($cols_return);
-//_debug_array($location);
-                       return $location;
+//_debug_array($values);
+                       return $values;
                }
 
                function add($location='',$values_attribute='',$type_id='')
@@ -1171,7 +1167,7 @@
 
                        if($filter>0)
                        {
-                               
if($GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['property_filter']
 == 'owner')
+                               
if($GLOBALS['phpgw_info']['user']['preferences']['property']['property_filter'] 
== 'owner')
                                {
                                        $filtermethod .= " $where 
fm_owner.id='$filter' ";
                                }
@@ -1252,8 +1248,12 @@
 
                        $table_category = 'fm_location' . $type_id . 
'_category';
 
-                       $sql = "SELECT column_name,datatype,input_text,id as 
attrib_id FROM fm_location_attrib WHERE type_id = $type_id";
+                       $choice_table = 'phpgw_cust_choice';
+                       $attribute_table = 'phpgw_cust_attribute';
+                       $attribute_filter = " appname = 'property' AND location 
= '.location." . $type_id . "'";
 
+                       $sql = "SELECT column_name,datatype,input_text,id as 
attrib_id FROM $attribute_table WHERE $attribute_filter";
+
                        $this->db->query($sql,__LINE__,__FILE__);
                        while ($this->db->next_record())
                        {
@@ -1293,7 +1293,8 @@
                                        $value = 
$this->db->f($attrib[$i]['column_name']);
                                        if(($attrib[$i]['datatype']=='R' || 
$attrib[$i]['datatype']=='LB') && $value):
                                        {
-                                               $sql="SELECT value FROM 
fm_location_choice where type_id=$type_id AND attrib_id=" 
.$attrib[$i]['attrib_id']. "  AND id=" . $value;
+
+                                               $sql="SELECT value FROM 
$choice_table WHERE $attribute_filter AND attrib_id=" 
.$attrib[$i]['attrib_id']. "  AND id=" . $value;
                                                $this->db2->query($sql);
                                                $this->db2->next_record();
                                                
$location[$j][$attrib[$i]['column_name']] = $this->db2->f('value');
@@ -1317,7 +1318,7 @@
                                                {
                                                        for 
($k=0;$k<count($ch);$k++)
                                                        {
-                                                               $sql="SELECT 
value FROM fm_location_choice where type_id=$type_id AND attrib_id=" 
.$attrib[$i]['attrib_id']. "  AND id=" . $ch[$k];
+                                                               $sql="SELECT 
value FROM $choice_table WHERE $attribute_filter AND attrib_id=" 
.$attrib[$i]['attrib_id']. "  AND id=" . $ch[$k];
                                                                
$this->db2->query($sql);
                                                                while 
($this->db2->next_record())
                                                                {
@@ -1339,7 +1340,6 @@
                                        endif;
 
                                        unset($value);
-
                                }
                                $j++;
                        }

Modified: trunk/property/inc/class.solookup.inc.php
===================================================================
--- trunk/property/inc/class.solookup.inc.php   2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.solookup.inc.php   2008-02-02 13:52:39 UTC (rev 
18466)
@@ -38,7 +38,7 @@
 
                function property_solookup()
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $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();
@@ -88,8 +88,8 @@
 
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
                                $querymethod = " $where (id $this->like 
'%$query%' or org_name $this->like '%$query%')";
                        }
@@ -153,8 +153,8 @@
 
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
                                $querymethod = " $where (id $this->like 
'%$query%' or org_name $this->like '%$query%')";
                        }
@@ -209,8 +209,8 @@
 
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
                                $querymethod = " where (id $this->like 
'%$query%' or descr $this->like '%$query%')";
                        }
@@ -264,8 +264,8 @@
 
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
                                $querymethod = " where ( descr $this->like 
'%$query%')";
                        }
@@ -318,8 +318,8 @@
 
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
                                $querymethod = " where ( last_name $this->like 
'%$query%' or first_name $this->like '%$query%')";
                        }
@@ -373,8 +373,8 @@
 
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
                                $querymethod = " where ( tekst1 $this->like 
'%$query%' or tekst2 $this->like '%$query%' or tekst3 $this->like '%$query%' or 
tekst4 $this->like '%$query%' or tekst5 $this->like '%$query%' or tekst6 
$this->like '%$query%')";
                        }
@@ -427,8 +427,8 @@
 
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
                                $querymethod = " AND ( account_lastname 
$this->like '%$query%' or account_firstname $this->like '%$query%')";
                        }

Modified: trunk/property/inc/class.sop_of_town.inc.php
===================================================================
--- trunk/property/inc/class.sop_of_town.inc.php        2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/inc/class.sop_of_town.inc.php        2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -37,7 +37,7 @@
 
                function property_sop_of_town()
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $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();
@@ -87,8 +87,8 @@
 
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
                                $querymethod = " $where ( name $this->like 
'%$query%')";
                        }

Modified: trunk/property/inc/class.sopricebook.inc.php
===================================================================
--- trunk/property/inc/class.sopricebook.inc.php        2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/inc/class.sopricebook.inc.php        2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -37,7 +37,7 @@
 
                function property_sopricebook()
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $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();
@@ -229,8 +229,8 @@
 
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
                                $querymethod = " AND (fm_activities.descr 
$this->like '%$query%' or fm_activities.num $this->like '%$query%')";
                        }
@@ -327,8 +327,8 @@
 
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
                                $querymethod = " $where (descr $this->like 
'%$query%' or num $this->like '%$query%')";
                        }
@@ -407,8 +407,8 @@
 
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
                                $querymethod = " AND (fm_activities.descr 
$this->like '%$query%' or fm_activities.num $this->like '%$query%')";
                        }
@@ -485,8 +485,8 @@
                        }
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
 //                             $querymethod = " AND (fm_activities.descr 
$this->like '%$query%' or fm_activities.num $this->like '%$query%')";
                                $querymethod = " and (fm_activities.descr 
$this->like '%$query%' or fm_activities.base_descr $this->like '%$query%' or 
fm_activities.num $this->like '%$query%') ";
@@ -560,8 +560,8 @@
                        }
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
                                $querymethod = " AND (fm_vendor.org_name 
$this->like '%$query%' or vendor_id $this->like '%$query%')";
                        }

Modified: trunk/property/inc/class.soproject.inc.php
===================================================================
--- trunk/property/inc/class.soproject.inc.php  2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.soproject.inc.php  2008-02-02 13:52:39 UTC (rev 
18466)
@@ -37,7 +37,7 @@
 
                function property_soproject()
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->account          = 
$GLOBALS['phpgw_info']['user']['account_id'];
                        $this->bocommon         = 
CreateObject('property.bocommon');
                        $this->db =& $GLOBALS['phpgw']->db;
@@ -48,7 +48,7 @@
                        $this->left_join = " LEFT JOIN ";
 
                        $this->acl              = CreateObject('phpgwapi.acl');
-                       $this->grants   = 
$this->acl->get_grants($this->currentapp,'.project');
+                       $this->grants   = 
$this->acl->get_grants('property','.project');
                }
 
 
@@ -300,8 +300,8 @@
                                }
                                else
                                {
-                                       $query = ereg_replace("'",'',$query);
-                                       $query = ereg_replace('"','',$query);
+                                       $query = preg_replace("/'/",'',$query);
+                                       $query = preg_replace('/"/','',$query);
                                        $querymethod = " $where 
(fm_project.name $this->like '%$query%' or fm_project.address $this->like 
'%$query%' or fm_project.location_code $this->like '%$query%' or fm_project.id 
$this->like '%$query%')";
                                }
                        }

Modified: trunk/property/inc/class.sor_agreement.inc.php
===================================================================
--- trunk/property/inc/class.sor_agreement.inc.php      2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/inc/class.sor_agreement.inc.php      2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -38,7 +38,7 @@
 
                function property_sor_agreement()
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $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();
@@ -84,14 +84,14 @@
                                
                        }
 
-                       $choice_table = 'fm_r_agreement_choice';
-                       $attribute_table = 'fm_r_agreement_attribute';
+                       $choice_table = 'phpgw_cust_choice';
+                       $attribute_table = 'phpgw_cust_attribute';
 
                        if(!$detail)
                        {
                                $entity_table = 'fm_r_agreement';
                                $category_table = 'fm_r_agreement_category';
-                               $attribute_filter = " AND attrib_detail = 1";
+                               $attribute_filter = " appname = 'property' AND 
location = '.r_agreement'";
 
                                $paranthesis .='(';
                                $joinmethod .= " $this->join $category_table ON 
( $entity_table.category =$category_table.id))";
@@ -152,7 +152,7 @@
                        {
                                $allrows=True;
                                $entity_table = 'fm_r_agreement_item';
-                               $attribute_filter = " AND attrib_detail = 2";
+                               $attribute_filter = " appname = 'property' AND 
location = '.r_agreement.detail'";
 
                                $paranthesis .='(';
                                $joinmethod .= " $this->join  
fm_r_agreement_item_history ON ( $entity_table.agreement_id 
=fm_r_agreement_item_history.agreement_id AND $entity_table.id 
=fm_r_agreement_item_history.item_id))";
@@ -234,34 +234,17 @@
 
                        $i      = count($uicols['name']);
 
-                       $this->db->query("SELECT * FROM $attribute_table WHERE 
list=1 $attribute_filter ");
-                       while ($this->db->next_record())
+                       
$user_columns=$GLOBALS['phpgw_info']['user']['preferences']['property']['r_agreement_columns'
 . !!$r_agreement_id];
+                       $user_column_filter = '';
+                       if (isset($user_columns) AND is_array($user_columns) 
AND $user_columns[0])
                        {
-                               $uicols['input_type'][]         = 'text';
-                               $uicols['name'][]                       = 
$this->db->f('column_name');
-                               $uicols['descr'][]                      = 
$this->db->f('input_text');
-                               $uicols['statustext'][]         = 
$this->db->f('statustext');
-                               $uicols['datatype'][$i]         = 
$this->db->f('datatype');
-                               $cols_return_extra[]= array(
-                                       'name'  => $this->db->f('column_name'),
-                                       'datatype'      => 
$this->db->f('datatype'),
-                                       'attrib_id'     => $this->db->f('id')
-                               );
-
-                               $i++;
+                               $user_column_filter = " OR ($attribute_filter 
AND id IN (" . implode(',',$user_columns) .'))';
                        }
 
-                       
$user_columns=$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['r_agreement_columns'
 . !!$r_agreement_id];
+                       $this->db->query("SELECT * FROM $attribute_table WHERE 
list=1 AND $attribute_filter $user_column_filter ");
 
-//_debug_array($user_columns);
-
-                       if (isset($user_columns) AND is_array($user_columns) 
AND $user_columns[0])
-                       {
-                               foreach($user_columns as $column_id)
+                       while ($this->db->next_record())
                                {
-                                       $this->db->query("SELECT * FROM 
$attribute_table WHERE id= $column_id");
-
-                                       $this->db->next_record();
                                        $uicols['input_type'][]         = 
'text';
                                        $uicols['name'][]                       
= $this->db->f('column_name');
                                        $uicols['descr'][]                      
= $this->db->f('input_text');
@@ -272,9 +255,9 @@
                                                'datatype'      => 
$this->db->f('datatype'),
                                                'attrib_id'     => 
$this->db->f('id')
                                        );
+
                                        $i++;
                                }
-                       }
 
                        $this->uicols   = $uicols;
 
@@ -368,8 +351,8 @@
 
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
                                $this->db->query("SELECT * FROM 
$attribute_table where search='1'");
 
@@ -425,27 +408,27 @@
                                        $value='';
                                        
$value=$this->db->f($cols_return_extra[$i]['name']);
 
-                                       
if(($cols_return_extra[$i]['datatype']=='R' || 
$cols_return_extra[$i]['datatype']=='LB') && $value):
+                                       
if(($cols_return_extra[$i]['datatype']=='R' || 
$cols_return_extra[$i]['datatype']=='LB') && $value)
                                        {
-                                               $sql="SELECT value FROM 
$choice_table where attrib_id=" .$cols_return_extra[$i]['attrib_id']. "  AND 
id=" . $value . $attribute_filter;
+                                               $sql="SELECT value FROM 
$choice_table WHERE $attribute_filter AND attrib_id=" 
.$cols_return_extra[$i]['attrib_id']. "  AND id=" . $value;
                                                $this->db2->query($sql);
                                                $this->db2->next_record();
                                                
$r_agreement_list[$j][$cols_return_extra[$i]['name']] = $this->db2->f('value');
                                        }
-                                       
elseif($cols_return_extra[$i]['datatype']=='AB' && $value):
+                                       else 
if($cols_return_extra[$i]['datatype']=='AB' && $value)
                                        {
                                                $contact_data   = 
$contacts->read_single_entry($value,array('n_given'=>'n_given','n_family'=>'n_family','email'=>'email'));
                                                
$r_agreement_list[$j][$cols_return_extra[$i]['name']]   = 
$contact_data[0]['n_family'] . ', ' . $contact_data[0]['n_given'];
 
                                        }
-                                       
elseif($cols_return_extra[$i]['datatype']=='VENDOR' && $value):
+                                       else 
if($cols_return_extra[$i]['datatype']=='VENDOR' && $value)
                                        {
                                                $sql="SELECT org_name FROM 
fm_vendor where id=$value";
                                                $this->db2->query($sql);
                                                $this->db2->next_record();
                                                
$r_agreement_list[$j][$cols_return_extra[$i]['name']] = 
$this->db2->f('org_name');
                                        }
-                                       
elseif($cols_return_extra[$i]['datatype']=='CH' && $value):
+                                       else 
if($cols_return_extra[$i]['datatype']=='CH' && $value)
                                        {
                                                $ch= unserialize($value);
 
@@ -453,7 +436,7 @@
                                                {
                                                        for 
($k=0;$k<count($ch);$k++)
                                                        {
-                                                               $sql="SELECT 
value FROM $choice_table where attrib_id=" 
.$cols_return_extra[$i]['attrib_id']. "  AND id=" . $ch[$k] . $attribute_filter;
+                                                               $sql="SELECT 
value FROM $choice_table WHERE $attribute_filter AND attrib_id=" 
.$cols_return_extra[$i]['attrib_id']. "  AND id=" . $ch[$k];
                                                                
$this->db2->query($sql);
                                                                while 
($this->db2->next_record())
                                                                {
@@ -464,17 +447,16 @@
                                                        unset($ch_value);
                                                }
                                        }
-                                       
elseif($cols_return_extra[$i]['datatype']=='D' && $value):
+                                       else 
if($cols_return_extra[$i]['datatype']=='D' && $value)
                                        {
 //html_print_r($value);
 
                                                
$r_agreement_list[$j][$cols_return_extra[$i]['name']]=date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'],strtotime($value));
                                        }
-                                       else:
+                                       else
                                        {
                                                
$r_agreement_list[$j][$cols_return_extra[$i]['name']]=$value;
                                        }
-                                       endif;
                                }
 
                                $j++;
@@ -608,107 +590,71 @@
                
                }
                
-               function read_single($data)
+               function read_single($r_agreement_id, $values = array())
                {
-                       $attribute_table = 'fm_r_agreement_attribute';
                        $table = 'fm_r_agreement';
 
-                       $r_agreement_id =$data['r_agreement_id'];
-
-                       $this->db->query("SELECT * FROM $attribute_table WHERE 
attrib_detail = 1 ORDER BY attrib_sort");
-
-                       while ($this->db->next_record())
-                       {
-                               $r_agreement['attributes'][] = array
-                               (
-                                       'attrib_id'             => 
$this->db->f('id'),
-                                       'name'                  => 
$this->db->f('column_name'),
-                                       'input_text'    => 
stripslashes($this->db->f('input_text')),
-                                       'statustext'    => 
stripslashes($this->db->f('statustext')),
-                                       'datatype'              => 
$this->db->f('datatype')
-                               );
-                       }
-
-                       if($r_agreement_id)
-                       {
                                $this->db->query("SELECT * from $table where 
id='$r_agreement_id'");
 
                                if($this->db->next_record())
                                {
-                                       $r_agreement['id']                      
= (int)$this->db->f('id');
-                                       $r_agreement['entry_date']              
= $this->db->f('entry_date');
-                                       $r_agreement['cat_id']                  
= $this->db->f('category');
-                                       $r_agreement['member_of']               
= explode(',',$this->db->f('member_of'));
-                                       $r_agreement['cat_id']                  
= $this->db->f('category');
-                                       $r_agreement['start_date']              
= $this->db->f('start_date');
-                                       $r_agreement['end_date']                
= $this->db->f('end_date');
-                                       $r_agreement['termination_date']= 
$this->db->f('termination_date');
-                                       $r_agreement['customer_id']             
= $this->db->f('customer_id');
-                                       $r_agreement['b_account_id']    = 
$this->db->f('account_id');
-                                       $r_agreement['name']                    
= stripslashes($this->db->f('name'));
-                                       $r_agreement['descr']                   
= stripslashes($this->db->f('descr'));
-                                       $r_agreement['user_id']                 
= $this->db->f('user_id');
+                               $values['id']                   = 
(int)$this->db->f('id');
+                               $values['entry_date']           = 
$this->db->f('entry_date');
+                               $values['cat_id']                       = 
$this->db->f('category');
+                               $values['member_of']            = 
explode(',',$this->db->f('member_of'));
+                               $values['cat_id']                       = 
$this->db->f('category');
+                               $values['start_date']           = 
$this->db->f('start_date');
+                               $values['end_date']             = 
$this->db->f('end_date');
+                               $values['termination_date']= 
$this->db->f('termination_date');
+                               $values['customer_id']          = 
$this->db->f('customer_id');
+                               $values['b_account_id'] = 
$this->db->f('account_id');
+                               $values['name']                 = 
stripslashes($this->db->f('name'));
+                               $values['descr']                        = 
stripslashes($this->db->f('descr'));
+                               $values['user_id']                      = 
$this->db->f('user_id');
 
-                                       for 
($i=0;$i<count($r_agreement['attributes']);$i++)
+                               if ( isset($values['attributes']) && 
is_array($values['attributes']) )
+                               {
+                                       foreach ( $values['attributes'] as 
&$attr )
                                        {
-                                               
$r_agreement['attributes'][$i]['value']         = 
$this->db->f($r_agreement['attributes'][$i]['name']);
-                                               
$r_agreement['attributes'][$i]['datatype_text']         = 
$this->bocommon->translate_datatype($r_agreement['attributes'][$i]['datatype']);
+                                               $attr['value']  = 
$this->db->f($attr['column_name']);
                                        }
-
                                }
                        }
-                       return $r_agreement;
+
+                       return $values;
                }
 
-               function read_single_item($data)
+               function read_single_item($data, $values = array())
                {
-                       $attribute_table = 'fm_r_agreement_attribute';
                        $table = 'fm_r_agreement_item';
 
                        $r_agreement_id =$data['r_agreement_id'];
                        $id =$data['id'];
 
-                       $this->db->query("SELECT * FROM $attribute_table WHERE 
attrib_detail = 2 ORDER BY attrib_sort");
-
-                       while ($this->db->next_record())
-                       {
-                               $item['attributes'][] = array
-                               (
-                                       'attrib_id'             => 
$this->db->f('id'),
-                                       'name'                  => 
$this->db->f('column_name'),
-                                       'input_text'    => 
stripslashes($this->db->f('input_text')),
-                                       'statustext'    => 
stripslashes($this->db->f('statustext')),
-                                       'datatype'              => 
$this->db->f('datatype')
-                               );
-                       }
-
-                       if($id && $r_agreement_id)
-                       {
                                $this->db->query("SELECT * from $table where 
agreement_id=$r_agreement_id AND id=$id");
 
                                if($this->db->next_record())
                                {
-                                       $item['agreement_id']           = 
(int)$this->db->f('agreement_id');
-                                       $item['id']                             
        = (int)$this->db->f('id');
-                                       $item['entry_date']                     
= $this->db->f('entry_date');
-                                       $item['location_code']          = 
$this->db->f('location_code');
-                                       $item['p_num']                          
= $this->db->f('p_num');
-                                       $item['p_entity_id']            = 
$this->db->f('p_entity_id');
-                                       $item['p_cat_id']                       
= $this->db->f('p_cat_id');
-                                       $item['cost']                           
= $this->db->f('cost');
-                                       $item['tenant_id']                      
= $this->db->f('tenant_id');
-                                       $item['rental_type_id']         = 
$this->db->f('rental_type_id');
+                               $values['agreement_id']                 = 
(int)$this->db->f('agreement_id');
+                               $values['id']                                   
= (int)$this->db->f('id');
+                               $values['entry_date']                   = 
$this->db->f('entry_date');
+                               $values['location_code']                = 
$this->db->f('location_code');
+                               $values['p_num']                                
= $this->db->f('p_num');
+                               $values['p_entity_id']                  = 
$this->db->f('p_entity_id');
+                               $values['p_cat_id']                             
= $this->db->f('p_cat_id');
+                               $values['cost']                                 
= $this->db->f('cost');
+                               $values['tenant_id']                    = 
$this->db->f('tenant_id');
+                               $values['rental_type_id']               = 
$this->db->f('rental_type_id');
                                        
-                                       
-                                       for 
($i=0;$i<count($item['attributes']);$i++)
+                               if ( isset($values['attributes']) && 
is_array($values['attributes']) )
+                               {
+                                       foreach ( $values['attributes'] as 
&$attr )
                                        {
-                                               
$item['attributes'][$i]['value']        = 
$this->db->f($item['attributes'][$i]['name']);
-                                               
$item['attributes'][$i]['datatype_text']        = 
$this->bocommon->translate_datatype($item['attributes'][$i]['datatype']);
+                                               $attr['value']  = 
$this->db->f($attr['column_name']);
                                        }
-
                                }
                        }
-                       return $item;
+                       return $values;
                }
 
                function add($r_agreement,$values_attribute='')
@@ -741,14 +687,17 @@
                        $vals[] = $r_agreement['b_account_id'];
                        $vals[] = $this->account;
 
-                       while (is_array($r_agreement['extra']) && 
list($input_name,$value) = each($r_agreement['extra']))
+                       if(isset($r_agreement['extra']) && 
is_array($r_agreement['extra']))
                        {
-                               if($value)
+                               foreach ($r_agreement['extra'] as $input_name 
=> $value)
                                {
+                                       if(isset($value) && $value)
+                               {
                                        $cols[] = $input_name;
                                        $vals[] = $value;
                                }
                        }
+                       }
 
                        if (isset($values_attribute) AND 
is_array($values_attribute))
                        {
@@ -801,14 +750,17 @@
                                }
                        }
 */
-                       while (is_array($values['extra']) && 
list($input_name,$value) = each($values['extra']))
+                       if(isset($values['extra']) && 
is_array($values['extra']))
                        {
-                               if($value)
+                               foreach ($values['extra'] as $input_name => 
$value)
                                {
+                                       if(isset($value) && $value)
+                               {
                                        $cols[] = $input_name;
                                        $vals[] = $value;
                                }
                        }
+                       }
 
                        if (isset($values_attribute) AND 
is_array($values_attribute))
                        {
@@ -901,10 +853,13 @@
                                $values['member_of']=',' . 
implode(',',$values['member_of']) . ',';
                        }
 
-                       while (is_array($values['extra']) && 
list($column,$value) = each($values['extra']))
+                       if(isset($values['extra']) && 
is_array($values['extra']))
                        {
+                               foreach ($values['extra'] as $column => $value)
+                       {
                                $value_set[$column]     = $value;
                        }
+                       }
 
                        if (isset($values_attribute) AND 
is_array($values_attribute))
                        {
@@ -912,10 +867,17 @@
                                {
                                        if($entry['datatype']!='AB' && 
$entry['datatype']!='VENDOR')
                                        {
+                                               if($entry['datatype'] == 'C' || 
$entry['datatype'] == 'T' || $entry['datatype'] == 'V' || $entry['datatype'] == 
'link')
+                                               {
+                                                       
$value_set[$entry['name']] = $this->db->db_addslashes($entry['value']);
+                                               }
+                                               else
+                                               {
                                                $value_set[$entry['name']]      
= $entry['value'];
                                        }
                                }
                        }
+                       }
 
                        $value_set['name']      = $values['name'];
                        $value_set['descr']     = $values['descr'];
@@ -953,10 +915,17 @@
                                {
                                        if($entry['datatype']!='AB' && 
$entry['datatype']!='VENDOR')
                                        {
+                                               if($entry['datatype'] == 'C' || 
$entry['datatype'] == 'T' || $entry['datatype'] == 'V' || $entry['datatype'] == 
'link')
+                                               {
+                                                       
$value_set[$entry['name']] = $this->db->db_addslashes($entry['value']);
+                                               }
+                                               else
+                                               {
                                                $value_set[$entry['name']]      
= $entry['value'];
                                        }
                                }
                        }
+                       }
 
                        if($values['street_name'])
                        {
@@ -1048,10 +1017,10 @@
 
                function floatval($strValue)
                {
-                       $floatValue = 
ereg_replace("(^[0-9]*)(\\.|,)([0-9]*)(.*)", "\\1.\\3", $strValue);
+                       $floatValue = 
preg_replace("/(^[0-9]*)(\\.|,)([0-9]*)(.*)/", "\\1.\\3", $strValue);
                        if(!is_numeric($floatValue))
                        {
-                               $floatValue = ereg_replace("(^[0-9]*)(.*)", 
"\\1", $strValue);
+                               $floatValue = preg_replace("/(^[0-9]*)(.*)/", 
"\\1", $strValue);
                        }
                        if(!is_numeric($floatValue))
                        {
@@ -1095,633 +1064,7 @@
                        $this->db->transaction_commit();
                }
 
-               function read_attrib($data)
-               {
-                       $attribute_table = 'fm_r_agreement_attribute';
-//html_print_r($data);
-                       if(is_array($data))
-                       {
-                               if ($data['start'])
-                               {
-                                       $start=$data['start'];
-                               }
-                               else
-                               {
-                                       $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']:'');
-                               $column_list = 
(isset($data['column_list'])?$data['column_list']:'');
-                       }
 
-                       $where = 'WHERE';
-                       if ($column_list)
-                       {
-                               $filtermethod = " $where list !=1 or list is 
null";
-                               $where = 'AND';
-                       }
-                       if ($this->role=='detail')
-                       {
-                               $filtermethod .= " $where attrib_detail=2 ";
-                       }
-                       else
-                       {
-                               $filtermethod .= " $where attrib_detail=1 ";
-                       }
-
-                       $where = 'AND';
-
-                       if ($order)
-                       {
-                               $ordermethod = " order by $order $sort";
-
-                       }
-                       else
-                       {
-                               $ordermethod = ' order by attrib_sort asc';
-                       }
-
-                       if($query)
-                       {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
-
-                               $querymethod = " $where 
($attribute_table.input_text $this->like '%$query%' or 
$attribute_table.column_name $this->like '%$query%')";
-                       }
-
-                       $sql = "SELECT * FROM $attribute_table $filtermethod 
$querymethod";
-
-//echo $sql;
-                       $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())
-                       {
-                               $attrib[] = array
-                               (
-                                       'id'                    => 
$this->db->f('id'),
-                                       'attrib_sort'   => 
$this->db->f('attrib_sort'),
-                                       'list'                  => 
$this->db->f('list'),
-                                       'lookup_form'   => 
$this->db->f('lookup_form'),
-                                       'column_name'   => 
$this->db->f('column_name'),
-                                       'name'                  => 
$this->db->f('input_text'),
-                                       'size'                  => 
$this->db->f('size'),
-                                       'statustext'    => 
$this->db->f('statustext'),
-                                       'input_text'    => 
$this->db->f('input_text'),
-                                       'type_name'             => 
$this->db->f('type'),
-                                       'datatype'              => 
$this->db->f('datatype'),
-                                       'search'                => 
$this->db->f('search')
-                               );
-                       }
-                       return $attrib;
-               }
-
-               function read_single_attrib($id)
-               {
-                       $attribute_table = 'fm_r_agreement_attribute';
-
-                       if ($this->role=='detail')
-                       {
-                               $filtermethod = " AND attrib_detail=2 ";
-                       }
-                       else
-                       {
-                               $filtermethod = " AND attrib_detail=1 ";
-                       }
-
-                       $sql = "SELECT * FROM $attribute_table where id=$id 
$filtermethod";
-
-                       $this->db->query($sql);
-
-                       if($this->db->next_record())
-                       {
-                               $attrib['id']                                   
        = $this->db->f('id');
-                               $attrib['column_name']                          
= $this->db->f('column_name');
-                               $attrib['input_text']                           
= $this->db->f('input_text');
-                               $attrib['statustext']                           
= $this->db->f('statustext');
-                               $attrib['column_info']['precision']     = 
$this->db->f('precision_');
-                               $attrib['column_info']['scale']         = 
$this->db->f('scale');
-                               $attrib['column_info']['default']       = 
$this->db->f('default_value');
-                               $attrib['column_info']['nullable']      = 
$this->db->f('nullable');
-                               $attrib['column_info']['type']          = 
$this->db->f('datatype');
-                               $attrib['type_name']                            
= $this->db->f('type_name');
-                               $attrib['lookup_form']                          
= $this->db->f('lookup_form');
-                               $attrib['list']                                 
        = $this->db->f('list');
-                               $attrib['search']                               
        = $this->db->f('search');
-                               if($this->db->f('datatype')=='R' || 
$this->db->f('datatype')=='CH' || $this->db->f('datatype')=='LB')
-                               {
-                                       $attrib['choice'] = 
$this->read_attrib_choice($id);
-                               }
-
-                               return $attrib;
-                       }
-               }
-
-               function read_attrib_choice($attrib_id)
-               {
-                       $choice_table = 'fm_r_agreement_choice';
-
-                       if ($this->role=='detail')
-                       {
-                               $filtermethod = " AND attrib_detail=2 ";
-                       }
-                       else
-                       {
-                               $filtermethod = " AND attrib_detail=1 ";
-                       }
-
-                       $sql = "SELECT * FROM $choice_table WHERE 
attrib_id=$attrib_id $filtermethod";
-                       $this->db->query($sql);
-
-                       while ($this->db->next_record())
-                       {
-                               $choice[] = array
-                               (
-                                       'id'    => $this->db->f('id'),
-                                       'value' => $this->db->f('value')
-                               );
-
-                       }
-                       return $choice;
-               }
-
-               function add_attrib($attrib)
-               {
-                       $attribute_table = 'fm_r_agreement_attribute';
-                       $attrib['column_name'] = 
strtolower($this->db->db_addslashes($attrib['column_name']));
-                       $attrib['input_text'] = 
$this->db->db_addslashes($attrib['input_text']);
-                       $attrib['statustext'] = 
$this->db->db_addslashes($attrib['statustext']);
-                       $attrib['default'] = 
$this->db->db_addslashes($attrib['default']);
-                       $attrib['id'] = 
$this->bocommon->next_id($attribute_table, array('attrib_detail'=>!!$this->role 
+1));
-
-                       if($this->role=='detail')
-                       {
-                               $filtermethod= 'WHERE attrib_detail=2';
-                               $table = 'fm_r_agreement_item';
-                       }
-                       else
-                       {
-                               $filtermethod= 'WHERE attrib_detail=1';
-                               $table = 'fm_r_agreement';
-                       }
-
-                       $sql = "SELECT * FROM $attribute_table $filtermethod 
AND column_name = '{$attrib['column_name']}'";
-                       $this->db->query($sql,__LINE__,__FILE__);
-                       if ( $this->db->next_record() )
-                       {
-                               $receipt['id'] = '';
-                               $receipt['error'] = array();
-                               $receipt['error'][] = array('msg' => 
lang('field already exists, please choose another name'));
-                               $receipt['error'][] = array('msg'       => 
lang('Attribute has NOT been saved'));
-                               return $receipt; //no point continuing
-                       }
-
-                       $sql = "SELECT max(attrib_sort) as max_sort FROM 
$attribute_table $filtermethod";
-                       $this->db->query($sql);
-                       $this->db->next_record();
-                       $attrib_sort    = $this->db->f('max_sort')+1;
-
-                       $values= array(
-                               !!$this->role +1,
-                               $attrib['id'],
-                               $attrib['column_name'],
-                               $attrib['input_text'],
-                               $attrib['statustext'],
-                               $attrib['lookup_form'],
-                               $attrib['search'],
-                               $attrib['list'],
-                               $attrib_sort,
-                               $attrib['column_info']['type'],
-                               $attrib['column_info']['precision'],
-                               $attrib['column_info']['scale'],
-                               $attrib['column_info']['default'],
-                               $attrib['column_info']['nullable']
-                               );
-
-                       $values = $this->bocommon->validate_db_insert($values);
-
-                       $this->db->transaction_begin();
-
-                       $this->db->query("INSERT INTO $attribute_table 
(attrib_detail,id,column_name, input_text, 
statustext,lookup_form,search,list,attrib_sort,datatype,precision_,scale,default_value,nullable)
 "
-                               . "VALUES ($values)");
-
-                       $receipt['id']= $attrib['id'];
-
-                       if($attrib['column_info']['type']=='email' && 
!$attrib['column_info']['precision'])
-                       {
-                               $attrib['column_info']['precision']=64;
-                       }
-
-                       $attrib['column_info']['type']  = 
$this->bocommon->translate_datatype_insert($attrib['column_info']['type']);
-
-                       if($attrib['column_info']['type']=='int' && 
!$attrib['column_info']['precision'])
-                       {
-                               $attrib['column_info']['precision']=4;
-                       }
-
-                       if(!$attrib['column_info']['default'])
-                       {
-                               unset($attrib['column_info']['default']);
-                       }
-
-                       $this->init_process();
-
-                       
if($this->oProc->AddColumn($table,$attrib['column_name'], 
$attrib['column_info']))
-                       {
-                               $receipt['message'][] = array('msg'     => 
lang('Attribute has been saved')     );
-                               $this->db->transaction_commit();
-
-                       }
-                       else
-                       {
-                               $receipt['error'][] = array('msg'       => 
lang('column could not be added')    );
-                               if($this->db->Transaction)
-                               {
-                                       $GLOBALS['phpgw']->db->rollbacktrans();
-                               }
-                               else
-                               {
-                                       $GLOBALS['phpgw']->db->Execute("DELETE 
FROM $attribute_table WHERE id='" . $receipt['id'] . "'");
-                                       unset($receipt['id']);
-
-                               }
-                       }
-
-                       return $receipt;
-               }
-
-               function init_process()
-               {
-                       $this->oProc                                            
= 
CreateObject('phpgwapi.schema_proc',$GLOBALS['phpgw_info']['server']['db_type']);
-                       $this->oProc->m_odb                                     
= $this->db;
-                       $this->oProc->m_odb->Halt_On_Error      = 'report';
-               }
-
-               function get_default_column_def($table)
-               {
-                       switch($table)
-                       {
-                               case 'fm_r_agreement':
-                                       $fd=array(
-                                               'id' => array('type' => 'int', 
'precision' => 4,'nullable' => False,'default' => '0'),
-                                               'customer_id' => array('type' 
=> 'int', 'precision' => 4,'nullable' => True),
-                                               'customer_name' => array('type' 
=> 'varchar', 'precision' => 255,'nullable' => True),
-                                               'name' => array('type' => 
'varchar', 'precision' => 100,'nullable' => False),
-                                               'descr' => array('type' => 
'text','nullable' => True),
-                                               'status' => array('type' => 
'varchar', 'precision' => 10,'nullable' => True),
-                                               'category' => array('type' => 
'int', 'precision' => 4,'nullable' => True),
-                                               'member_of' => array('type' => 
'text','nullable' => True),
-                                               'entry_date' => array('type' => 
'int', 'precision' => 4,'nullable' => True),
-                                               'start_date' => array('type' => 
'int', 'precision' => 4,'nullable' => True),
-                                               'end_date' => array('type' => 
'int', 'precision' => 4,'nullable' => True),
-                                               'termination_date' => 
array('type' => 'int', 'precision' => 4,'nullable' => True),
-                                               'user_id' => array('type' => 
'int', 'precision' => 4,'nullable' => True),
-                                               'actual_cost' => array('type' 
=> 'decimal', 'precision' => 20, 'scale' => 2,'nullable' => True),
-                                               'account_id' => array('type' => 
'varchar', 'precision' => 20,'nullable' => True)
-                                               );
-                                       break;
-                               case 'fm_r_agreement_item':
-                                       $fd=array(
-                                               'agreement_id' => array('type' 
=> 'int', 'precision' => 4,'nullable' => False,'default' => '0'),
-                                               'id' => array('type' => 'int', 
'precision' => 4,'nullable' => False,'default' => '0'),
-                                               'location_code' => array('type' 
=> 'varchar', 'precision' => 30,'nullable' => True),
-                                               'address' => array('type' => 
'varchar', 'precision' => 150,'nullable' => True),
-                                               'p_num' => array('type' => 
'varchar', 'precision' => 15,'nullable' => True),
-                                               'p_entity_id' => array('type' 
=> 'int', 'precision' => 4,'nullable' => True,'default' => '0'),
-                                               'p_cat_id' => array('type' => 
'int', 'precision' => 4,'nullable' => True,'default' => '0'),
-                                               'descr' => array('type' => 
'text','nullable' => True),
-                                               'unit' => array('type' => 
'varchar', 'precision' => 10,'nullable' => True),
-                                               'quantity' => array('type' => 
'decimal', 'precision' => 20, 'scale' => 2,'nullable' => True),
-                                               'frequency' => array('type' => 
'int', 'precision' => 4,'nullable' => True),
-                                               'user_id' => array('type' => 
'int', 'precision' => 4,'nullable' => True),
-                                               'entry_date' => array('type' => 
'int', 'precision' => 4,'nullable' => True),
-                                               'test' => array('type' => 
'text','nullable' => True),
-                                               'cost' => array('type' => 
'decimal', 'precision' => 20, 'scale' => 2,'nullable' => True),
-                                               'rental_type_id' => 
array('type' => 'int', 'precision' => 4,'nullable' => True)
-                                               );
-                                       break;
-                               default:
-                                       return;
-                                       break;
-                       }
-                       
-                       return $fd;
-               }
-
-               function get_table_def($table)
-               {
-                       $metadata = $this->db->metadata($table);
-
-                       if(isset($this->db->adodb))
-                       {
-                               $i = 0;
-                               foreach($metadata as $key => $val)
-                               {
-                                       $metadata_temp[$i]['name'] = $key;
-                                       $i++;
-                               }
-                               $metadata = $metadata_temp;
-                               unset ($metadata_temp);
-                       }
-
-                       if($this->role=='detail')
-                       {
-                               $filtermethod= ' AND attrib_detail=2';
-                               $pk = array('agreement_id','id');
-                       }
-                       else
-                       {
-                               $filtermethod= ' AND attrib_detail=1';
-                               $pk = array('id');
-                       }
-
-                       $fd = $this->get_default_column_def($table);
-                       
-                       for ($i=0; $i<count($metadata); $i++)
-                       {
-                               $sql = "SELECT * FROM fm_r_agreement_attribute 
WHERE column_name = '" . $metadata[$i]['name'] . "' $filtermethod";
-
-                               $this->db->query($sql,__LINE__,__FILE__);
-                               while($this->db->next_record())
-                               {
-                                       if(!$precision = 
$this->db->f('precision_'))
-                                       {
-                                               $precision = 
$this->bocommon->translate_datatype_precision($this->db->f('datatype'));
-                                       }
-
-                                       $fd[$metadata[$i]['name']] = array(
-                                               'type' => 
$this->bocommon->translate_datatype_insert(stripslashes($this->db->f('datatype'))),
-                                               'precision' => $precision,
-                                               'nullable' => 
stripslashes($this->db->f('nullable')),
-                                               'default' => 
stripslashes($this->db->f('default_value')),
-                                               'scale' => $this->db->f('scale')
-                                                       );
-                                       unset($precision);
-                               }
-                       }
-
-                       $table_def = array(
-                               $table =>       array(
-                                       'fd' => $fd
-                                       )
-                               );
-                       
-                       $table_def[$table]['pk'] = $pk;
-                       $table_def[$table]['fk'] = array();                     
-                       $table_def[$table]['ix'] = array();                     
-                       $table_def[$table]['uc'] = array();                     
-
-                       return $table_def;
-               }
-
-
-               function edit_attrib($attrib)
-               {
-                       $attribute_table = 'fm_r_agreement_attribute';
-                       $table = 'fm_r_agreement';
-
-                       $attrib['column_name'] = 
strtolower($this->db->db_addslashes($attrib['column_name']));
-                       $attrib['input_text'] = 
$this->db->db_addslashes($attrib['input_text']);
-                       $attrib['statustext'] = 
$this->db->db_addslashes($attrib['statustext']);
-                       $attrib['default'] = 
$this->db->db_addslashes($attrib['default']);
-
-                       $choice_table = 'fm_r_agreement_choice';
-
-                       if($this->role=='detail')
-                       {
-                               $filtermethod= ' AND attrib_detail=2';
-                               $table = 'fm_r_agreement_item';
-                       }
-                       else
-                       {
-                               $filtermethod= ' AND attrib_detail=1';
-                               $table = 'fm_r_agreement';
-                       }
-
-                       $this->db->query("SELECT column_name, datatype, 
precision_ FROM $attribute_table WHERE id='" . $attrib['id']. "' 
$filtermethod");
-                       $this->db->next_record();
-                       $OldColumnName          = $this->db->f('column_name');
-                       $OldColumnName          = $this->db->f('column_name');
-                       $OldDataType            = $this->db->f('datatype');
-                       $OldPrecision           = $this->db->f('precision_');
-
-                       $table_def = $this->get_table_def($table);      
-                       $this->db->transaction_begin();
-
-                       $value_set=array(
-                               'input_text'    => $attrib['input_text'],
-                               'statustext'    => $attrib['statustext'],
-                               'search'        => $attrib['search'],
-                               'list'          => $attrib['list'],
-                               );
-
-                       $value_set      = 
$this->bocommon->validate_db_update($value_set);
-
-                       $this->db->query("UPDATE $attribute_table set 
$value_set WHERE id=" . $attrib['id'] . $filtermethod);
-
-                       $attrib_type=$attrib['column_info']['type'];
-
-                       $this->init_process();
-                       
-                       $this->oProc->m_odb->transaction_begin();
-
-                       $this->oProc->m_aTables = $table_def;
-
-
-                       if($OldColumnName !=$attrib['column_name'])
-                       {
-                               $value_set=array('column_name'  => 
$attrib['column_name']);
-
-                               $value_set      = 
$this->bocommon->validate_db_update($value_set);
-
-                               $this->db->query("UPDATE $attribute_table set 
$value_set WHERE id=" . $attrib['id'] . $filtermethod);
-
-                               $this->oProc->RenameColumn($table, 
$OldColumnName, $attrib['column_name']);
-                       }
-
-                       if (($OldDataType != $attrib['column_info']['type']) || 
($OldPrecision != $attrib['column_info']['precision']) )
-                       {
-                               if($attrib['column_info']['type']!='R' && 
$attrib['column_info']['type']!='CH' && $attrib['column_info']['type']!='LB')
-                               {
-                                       $this->db->query("DELETE FROM 
$choice_table WHERE  attrib_id=" . $attrib['id'] . $filtermethod);
-                               }
-
-                               if(!$attrib['column_info']['precision'])
-                               {
-                                       if($precision = 
$this->bocommon->translate_datatype_precision($attrib['column_info']['type']))
-                                       {
-                                               
$attrib['column_info']['precision']=$precision;
-                                       }
-                               }
-
-                               if(!$attrib['column_info']['default'])
-                               {
-                                       
unset($attrib['column_info']['default']);
-                               }
-
-                               $value_set=array(
-                                       'column_name'   => 
$attrib['column_name'],
-                                       'datatype'      => 
$attrib['column_info']['type'],
-                                       'precision_'    => 
$attrib['column_info']['precision'],
-                                       'scale'         => 
$attrib['column_info']['scale'],
-                                       'default_value' => 
$attrib['column_info']['default'],
-                                       'nullable'      => 
$attrib['column_info']['nullable']
-                                       );
-
-                               $value_set      = 
$this->bocommon->validate_db_update($value_set);
-
-                               $this->db->query("UPDATE $attribute_table set 
$value_set WHERE id=" . $attrib['id'] . $filtermethod);
-
-                               $attrib['column_info']['type']  = 
$this->bocommon->translate_datatype_insert($attrib['column_info']['type']);
-                               
$this->oProc->AlterColumn($table,$attrib['column_name'],$attrib['column_info']);
-                       }
-
-                       if($attrib['new_choice'])
-                       {
-                               $this->db->query("SELECT max(id) as id FROM 
$choice_table WHERE attrib_id='" . $attrib['id']. "' $filtermethod");
-                               $this->db->next_record();
-                               $choice_id              = $this->db->f('id')+1;
-
-       //                      $choice_id = 
$this->bocommon->next_id($choice_table 
,array('attrib_detail'=>2,'attrib_id'=>$attrib['id']));
-
-                               $values= array(
-                                       $attrib['id'],
-                                       $choice_id,
-                                       !!$this->role +1,
-                                       $attrib['new_choice']
-                                       );
-
-                               $values = 
$this->bocommon->validate_db_insert($values);
-
-                               $this->db->query("INSERT INTO $choice_table 
(attrib_id,id,attrib_detail,value) "
-                               . "VALUES ($values)");
-                       }
-
-                       if($attrib['delete_choice'])
-                       {
-                               for 
($i=0;$i<count($attrib['delete_choice']);$i++)
-                               {
-                                       $this->db->query("DELETE FROM 
$choice_table WHERE  attrib_id=" . $attrib['id']  ." AND id=" . 
$attrib['delete_choice'][$i] . $filtermethod);
-                               }
-                       }
-
-                       $this->db->transaction_commit();
-                       $this->oProc->m_odb->transaction_commit();
-
-                       $receipt['message'][] = array('msg'     => 
lang('Attribute has been edited'));
-
-                       return $receipt;
-               }
-
-               function resort_attrib($data)
-               {
-                       $attribute_table = 'fm_r_agreement_attribute';
-                       if(is_array($data))
-                       {
-                               $resort = 
(isset($data['resort'])?$data['resort']:'up');
-                               $id = (isset($data['id'])?$data['id']:'');
-                       }
-
-                       $sql = "SELECT attrib_sort FROM $attribute_table where 
id=$id";
-                       $this->db->query($sql);
-                       $this->db->next_record();
-                       $attrib_sort    = $this->db->f('attrib_sort');
-                       $sql = "SELECT max(attrib_sort) as max_sort FROM 
$attribute_table";
-                       $this->db->query($sql);
-                       $this->db->next_record();
-                       $max_sort       = $this->db->f('max_sort');
-                       switch($resort)
-                       {
-                               case 'up':
-                                       if($attrib_sort>1)
-                                       {
-                                               $sql = "UPDATE $attribute_table 
set attrib_sort=$attrib_sort WHERE attrib_sort =" . ($attrib_sort-1);
-                                               $this->db->query($sql);
-                                               $sql = "UPDATE $attribute_table 
set attrib_sort=" . ($attrib_sort-1) ." WHERE id=$id";
-                                               $this->db->query($sql);
-                                       }
-                                       break;
-                               case 'down':
-                                       if($max_sort > $attrib_sort)
-                                       {
-                                               $sql = "UPDATE $attribute_table 
set attrib_sort=$attrib_sort WHERE attrib_sort =" . ($attrib_sort+1);
-                                               $this->db->query($sql);
-                                               $sql = "UPDATE $attribute_table 
set attrib_sort=" . ($attrib_sort+1) ." WHERE id=$id";
-                                               $this->db->query($sql);
-                                       }
-                                       break;
-                               default:
-                                       return;
-                                       break;
-                       }
-               }
-               function delete_attrib($attrib_id)
-               {
-
-                       if($this->role=='detail')
-                       {
-                               $filtermethod= ' AND attrib_detail=2';
-                               $filtermethod2= ' WHERE attrib_detail=2';
-                               $table = 'fm_r_agreement_item';
-                       }
-                       else
-                       {
-                               $filtermethod= ' AND attrib_detail=1';
-                               $filtermethod2= ' WHERE attrib_detail=1';
-                               $table = 'fm_r_agreement';
-                       }
-
-                       $table_def = $this->get_table_def($table);
-                       
-                       $attribute_table = 'fm_r_agreement_attribute';
-                       $this->init_process();
-                       $this->oProc->m_odb->transaction_begin();
-                       $this->db->transaction_begin();
-
-                       $sql = "SELECT * FROM $attribute_table WHERE 
id=$attrib_id $filtermethod";
-
-                       $this->db->query($sql);
-                       $this->db->next_record();
-                       $ColumnName             = $this->db->f('column_name');
-
-                       if($this->oProc->DropColumn($table,$table_def[$table], 
$ColumnName))
-                       {
-                               $sql = "SELECT attrib_sort FROM 
$attribute_table where id=$attrib_id $filtermethod";
-                               $this->db->query($sql);
-                               $this->db->next_record();
-                               $attrib_sort    = $this->db->f('attrib_sort');
-                               $sql2 = "SELECT max(attrib_sort) as max_sort 
FROM $attribute_table $filtermethod2";
-                               $this->db->query($sql2);
-                               $this->db->next_record();
-                               $max_sort       = $this->db->f('max_sort');
-                               if($max_sort>$attrib_sort)
-                               {
-                                       $sql = "UPDATE $attribute_table set 
attrib_sort=attrib_sort-1 WHERE attrib_sort > $attrib_sort $filtermethod";
-                                       $this->db->query($sql);
-                               }
-
-                               $this->db->query("DELETE FROM $attribute_table 
WHERE id=$attrib_id $filtermethod");
-                       }
-                       else
-                       {
-                               $receipt['error'][] = array('msg'       => 
lang('Attribute has NOT been deleted'));
-                       }
-                       $this->db->transaction_commit();
-                       $this->oProc->m_odb->transaction_commit();
-
-                       return $receipt;
-               }
-
                function request_next_id()
                {
                        $this->db->query("SELECT max(id) as id FROM 
fm_r_agreement",__LINE__,__FILE__);
@@ -1937,6 +1280,5 @@
                        $this->db->query("DELETE FROM fm_r_agreement_c_history 
WHERE agreement_id=$r_agreement_id AND c_id=$c_id AND 
id=$id",__LINE__,__FILE__);
                        $this->db->transaction_commit();
                }
-
        }
 ?>

Modified: trunk/property/inc/class.sorequest.inc.php
===================================================================
--- trunk/property/inc/class.sorequest.inc.php  2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.sorequest.inc.php  2008-02-02 13:52:39 UTC (rev 
18466)
@@ -36,7 +36,7 @@
        {
                function property_sorequest()
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->account          = 
$GLOBALS['phpgw_info']['user']['account_id'];
                        $this->soproject        = 
CreateObject('property.soproject');
                        $this->historylog       = 
CreateObject('property.historylog','request');
@@ -294,8 +294,8 @@
 
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
                                $querymethod = " $where (fm_request.title 
$this->like '%$query%' or fm_request.address $this->like '%$query%' or 
fm_request.location_code $this->like '%$query%')";
                        }

Modified: trunk/property/inc/class.sos_agreement.inc.php
===================================================================
--- trunk/property/inc/class.sos_agreement.inc.php      2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/inc/class.sos_agreement.inc.php      2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -38,7 +38,7 @@
 
                function property_sos_agreement()
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $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();
@@ -81,14 +81,14 @@
                                $detail                 = 
isset($data['detail'])?$data['detail']:'';
                        }
 
-                       $choice_table = 'fm_s_agreement_choice';
-                       $attribute_table = 'fm_s_agreement_attribute';
+                       $choice_table = 'phpgw_cust_choice';
+                       $attribute_table = 'phpgw_cust_attribute';
 
                        if(!$detail)
                        {
                                $entity_table = 'fm_s_agreement';
                                $category_table = 'fm_s_agreement_category';
-                               $attribute_filter = " AND attrib_detail = 1";
+                               $attribute_filter = " appname = 'property' AND 
location = '.s_agreement'";
 
                                $paranthesis .='(';
                                $joinmethod .= " $this->join $category_table ON 
( $entity_table.category =$category_table.id))";
@@ -138,13 +138,11 @@
                        {
                                $allrows=True;
                                $entity_table = 'fm_s_agreement_detail';
-                               $attribute_filter = " AND attrib_detail = 2";
+                               $attribute_filter = " appname = 'property' AND 
location = '.s_agreement.detail'";
 
                                $paranthesis .='(';
                                $joinmethod .= " $this->join  
fm_s_agreement_pricing ON ( $entity_table.agreement_id 
=fm_s_agreement_pricing.agreement_id AND $entity_table.id 
=fm_s_agreement_pricing.item_id))";
 
-
-
                                $cols = "$entity_table.*, 
fm_s_agreement_pricing.cost,fm_s_agreement_pricing.id as 
index_count,fm_s_agreement_pricing.index_date,fm_s_agreement_pricing.item_id,fm_s_agreement_pricing.this_index";
 
                                $cols_return[]                          = 
'agreement_id';
@@ -238,48 +236,31 @@
 
                        $i      = count($uicols['name']);
 
-                       $this->db->query("SELECT * FROM $attribute_table WHERE 
list=1 $attribute_filter ");
-                       while ($this->db->next_record())
+                       
$user_columns=$GLOBALS['phpgw_info']['user']['preferences']['property']['s_agreement_columns'
 . !!$s_agreement_id];
+                       $user_column_filter = '';
+                       if (isset($user_columns) AND is_array($user_columns) 
AND $user_columns[0])
                        {
-                               $uicols['input_type'][]         = 'text';
-                               $uicols['name'][]                       = 
$this->db->f('column_name');
-                               $uicols['descr'][]                      = 
$this->db->f('input_text');
-                               $uicols['statustext'][]         = 
$this->db->f('statustext');
-                               $uicols['datatype'][$i]         = 
$this->db->f('datatype');
-                               $uicols['import'][]                     = true;
-                               $cols_return_extra[]= array(
-                                       'name'  => $this->db->f('column_name'),
-                                       'datatype'      => 
$this->db->f('datatype'),
-                                       'attrib_id'     => $this->db->f('id')
-                               );
-
-                               $i++;
+                               $user_column_filter = " OR ($attribute_filter 
AND id IN (" . implode(',',$user_columns) .'))';
                        }
 
-                       
$user_columns=$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['s_agreement_columns'
 . !!$s_agreement_id];
+                       $this->db->query("SELECT * FROM $attribute_table WHERE 
list=1 AND $attribute_filter $user_column_filter ");
 
-//_debug_array($user_columns);
-
-                       if (isset($user_columns) AND is_array($user_columns) 
AND $user_columns[0])
-                       {
-                               foreach($user_columns as $column_id)
+                       while ($this->db->next_record())
                                {
-                                       $this->db->query("SELECT * FROM 
$attribute_table WHERE id= $column_id");
-
-                                       $this->db->next_record();
                                        $uicols['input_type'][]         = 
'text';
                                        $uicols['name'][]                       
= $this->db->f('column_name');
                                        $uicols['descr'][]                      
= $this->db->f('input_text');
                                        $uicols['statustext'][]         = 
$this->db->f('statustext');
                                        $uicols['datatype'][$i]         = 
$this->db->f('datatype');
+                               $uicols['import'][]                     = true;
                                        $cols_return_extra[]= array(
                                                'name'  => 
$this->db->f('column_name'),
                                                'datatype'      => 
$this->db->f('datatype'),
                                                'attrib_id'     => 
$this->db->f('id')
                                        );
+
                                        $i++;
                                }
-                       }
 
                        $this->uicols   = $uicols;
                        
@@ -362,10 +343,10 @@
 
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
-                               $this->db->query("SELECT * FROM 
$attribute_table where search='1'");
+                               $this->db->query("SELECT * FROM 
$attribute_table WHERE search='1' AND $attribute_filter");
 
                                while ($this->db->next_record())
                                {
@@ -419,27 +400,27 @@
                                        $value='';
                                        
$value=$this->db->f($cols_return_extra[$i]['name']);
 
-                                       
if(($cols_return_extra[$i]['datatype']=='R' || 
$cols_return_extra[$i]['datatype']=='LB') && $value):
+                                       
if(($cols_return_extra[$i]['datatype']=='R' || 
$cols_return_extra[$i]['datatype']=='LB') && $value)
                                        {
-                                               $sql="SELECT value FROM 
$choice_table where attrib_id=" .$cols_return_extra[$i]['attrib_id']. "  AND 
id=" . $value . $attribute_filter;
+                                               $sql="SELECT value FROM 
$choice_table WHERE $attribute_filter AND attrib_id=" 
.$cols_return_extra[$i]['attrib_id']. "  AND id=" . $value;
                                                $this->db2->query($sql);
                                                $this->db2->next_record();
                                                
$s_agreement_list[$j][$cols_return_extra[$i]['name']] = $this->db2->f('value');
                                        }
-                                       
elseif($cols_return_extra[$i]['datatype']=='AB' && $value):
+                                       else 
if($cols_return_extra[$i]['datatype']=='AB' && $value)
                                        {
                                                $contact_data   = 
$contacts->read_single_entry($value,array('n_given'=>'n_given','n_family'=>'n_family','email'=>'email'));
                                                
$s_agreement_list[$j][$cols_return_extra[$i]['name']]   = 
$contact_data[0]['n_family'] . ', ' . $contact_data[0]['n_given'];
 
                                        }
-                                       
elseif($cols_return_extra[$i]['datatype']=='VENDOR' && $value):
+                                       else 
if($cols_return_extra[$i]['datatype']=='VENDOR' && $value)
                                        {
                                                $sql="SELECT org_name FROM 
fm_vendor where id=$value";
                                                $this->db2->query($sql);
                                                $this->db2->next_record();
                                                
$s_agreement_list[$j][$cols_return_extra[$i]['name']] = 
$this->db2->f('org_name');
                                        }
-                                       
elseif($cols_return_extra[$i]['datatype']=='CH' && $value):
+                                       else 
if($cols_return_extra[$i]['datatype']=='CH' && $value)
                                        {
                                                $ch= unserialize($value);
 
@@ -447,7 +428,7 @@
                                                {
                                                        for 
($k=0;$k<count($ch);$k++)
                                                        {
-                                                               $sql="SELECT 
value FROM $choice_table where attrib_id=" 
.$cols_return_extra[$i]['attrib_id']. "  AND id=" . $ch[$k] . $attribute_filter;
+                                                               $sql="SELECT 
value FROM $choice_table WHERE  $attribute_filter AND attrib_id=" 
.$cols_return_extra[$i]['attrib_id']. "  AND id=" . $ch[$k];
                                                                
$this->db2->query($sql);
                                                                while 
($this->db2->next_record())
                                                                {
@@ -458,17 +439,14 @@
                                                        unset($ch_value);
                                                }
                                        }
-                                       
elseif($cols_return_extra[$i]['datatype']=='D' && $value):
+                                       else 
if($cols_return_extra[$i]['datatype']=='D' && $value)
                                        {
-//html_print_r($value);
-
                                                
$s_agreement_list[$j][$cols_return_extra[$i]['name']]=date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'],strtotime($value));
                                        }
-                                       else:
+                                       else
                                        {
                                                
$s_agreement_list[$j][$cols_return_extra[$i]['name']]=$value;
                                        }
-                                       endif;
                                }
 
                                $j++;
@@ -575,105 +553,67 @@
                }
 
 
-               function read_single($data)
+               function read_single($s_agreement_id, $values = array())
                {
-                       $attribute_table = 'fm_s_agreement_attribute';
                        $table = 'fm_s_agreement';
 
-                       $s_agreement_id =$data['s_agreement_id'];
-
-                       $this->db->query("SELECT * FROM $attribute_table WHERE 
attrib_detail = 1 ORDER BY attrib_sort");
-
-                       while ($this->db->next_record())
-                       {
-                               $s_agreement['attributes'][] = array
-                               (
-                                       'attrib_id'             => 
$this->db->f('id'),
-                                       'name'                  => 
$this->db->f('column_name'),
-                                       'input_text'    => 
stripslashes($this->db->f('input_text')),
-                                       'statustext'    => 
stripslashes($this->db->f('statustext')),
-                                       'datatype'              => 
$this->db->f('datatype')
-                               );
-                       }
-
-                       if($s_agreement_id)
-                       {
                                $this->db->query("SELECT * from $table where 
id='$s_agreement_id'");
 
                                if($this->db->next_record())
                                {
-                                       $s_agreement['id']                      
= (int)$this->db->f('id');
-                                       $s_agreement['entry_date']              
= $this->db->f('entry_date');
-                                       $s_agreement['cat_id']                  
= $this->db->f('category');
-                                       $s_agreement['member_of']               
= explode(',',$this->db->f('member_of'));
-                                       $s_agreement['cat_id']                  
= $this->db->f('category');
-                                       $s_agreement['start_date']              
= $this->db->f('start_date');
-                                       $s_agreement['end_date']                
= $this->db->f('end_date');
-                                       $s_agreement['termination_date']= 
$this->db->f('termination_date');
-                                       $s_agreement['vendor_id']               
= $this->db->f('vendor_id');
-                                       $s_agreement['b_account_id']    = 
$this->db->f('account_id');
-                                       $s_agreement['name']                    
= stripslashes($this->db->f('name'));
-                                       $s_agreement['descr']                   
= stripslashes($this->db->f('descr'));
-                                       $s_agreement['user_id']                 
= $this->db->f('user_id');
+                               $values['id']                           = 
(int)$this->db->f('id');
+                               $values['entry_date']           = 
$this->db->f('entry_date');
+                               $values['cat_id']                       = 
$this->db->f('category');
+                               $values['member_of']            = 
explode(',',$this->db->f('member_of'));
+                               $values['cat_id']                       = 
$this->db->f('category');
+                               $values['start_date']           = 
$this->db->f('start_date');
+                               $values['end_date']                     = 
$this->db->f('end_date');
+                               $values['termination_date']     = 
$this->db->f('termination_date');
+                               $values['vendor_id']            = 
$this->db->f('vendor_id');
+                               $values['b_account_id']         = 
$this->db->f('account_id');
+                               $values['name']                         = 
stripslashes($this->db->f('name'));
+                               $values['descr']                        = 
stripslashes($this->db->f('descr'));
+                               $values['user_id']                      = 
$this->db->f('user_id');
 
-                                       for 
($i=0;$i<count($s_agreement['attributes']);$i++)
+                               if ( isset($values['attributes']) && 
is_array($values['attributes']) )
+                               {
+                                       foreach ( $values['attributes'] as 
&$attr )
                                        {
-                                               
$s_agreement['attributes'][$i]['value']         = 
$this->db->f($s_agreement['attributes'][$i]['name']);
-                                               
$s_agreement['attributes'][$i]['datatype_text']         = 
$this->bocommon->translate_datatype($s_agreement['attributes'][$i]['datatype']);
+                                               $attr['value']  = 
$this->db->f($attr['column_name']);
                                        }
-
                                }
                        }
-                       return $s_agreement;
+                       return $values;
                }
 
-               function read_single_item($data)
+               function read_single_item($data, $values = array())
                {
-                       $attribute_table = 'fm_s_agreement_attribute';
                        $table = 'fm_s_agreement_detail';
 
                        $s_agreement_id =$data['s_agreement_id'];
                        $id =$data['id'];
 
-                       $this->db->query("SELECT * FROM $attribute_table WHERE 
attrib_detail = 2 ORDER BY attrib_sort");
+                       $this->db->query("SELECT * from $table where 
agreement_id=$s_agreement_id AND id=" . (int)$id );
 
-                       while ($this->db->next_record())
-                       {
-                               $item['attributes'][] = array
-                               (
-                                       'attrib_id'             => 
$this->db->f('id'),
-                                       'name'                  => 
$this->db->f('column_name'),
-                                       'input_text'    => 
stripslashes($this->db->f('input_text')),
-                                       'statustext'    => 
stripslashes($this->db->f('statustext')),
-                                       'datatype'              => 
$this->db->f('datatype'),
-                                       'history'               => 
$this->db->f('history')
-                               );
-                       }
-
-                       if($id && $s_agreement_id)
-                       {
-                               $this->db->query("SELECT * from $table where 
agreement_id=$s_agreement_id AND id=$id");
-
                                if($this->db->next_record())
                                {
-                                       $item['agreement_id']   = 
(int)$this->db->f('agreement_id');
-                                       $item['id']                             
= (int)$this->db->f('id');
-                                       $item['entry_date']             = 
$this->db->f('entry_date');
-                                       $item['location_code']  = 
$this->db->f('location_code');
-                                       $item['p_num']                  = 
$this->db->f('p_num');
-                                       $item['p_entity_id']    = 
$this->db->f('p_entity_id');
-                                       $item['p_cat_id']               = 
$this->db->f('p_cat_id');
-                                       $item['cost']                   = 
$this->db->f('cost');
-
-                                       for 
($i=0;$i<count($item['attributes']);$i++)
+                               $values['agreement_id']         = 
(int)$this->db->f('agreement_id');
+                               $values['id']                           = 
(int)$this->db->f('id');
+                               $values['entry_date']           = 
$this->db->f('entry_date');
+                               $values['location_code']        = 
$this->db->f('location_code');
+                               $values['p_num']                        = 
$this->db->f('p_num');
+                               $values['p_entity_id']          = 
$this->db->f('p_entity_id');
+                               $values['p_cat_id']                     = 
$this->db->f('p_cat_id');
+                               $values['cost']                         = 
$this->db->f('cost');
+                               if ( isset($values['attributes']) && 
is_array($values['attributes']) )
+                               {
+                                       foreach ( $values['attributes'] as 
&$attr )
                                        {
-                                               
$item['attributes'][$i]['value']        = 
$this->db->f($item['attributes'][$i]['name']);
-                                               
$item['attributes'][$i]['datatype_text']        = 
$this->bocommon->translate_datatype($item['attributes'][$i]['datatype']);
+                                               $attr['value']  = 
$this->db->f($attr['column_name']);
                                        }
-
                                }
                        }
-                       return $item;
+                       return $values;
                }
 
                function add($s_agreement,$values_attribute='')
@@ -705,14 +645,17 @@
                        $vals[] = $s_agreement['b_account_id'];
                        $vals[] = $this->account;
 
-                       while (is_array($s_agreement['extra']) && 
list($input_name,$value) = each($s_agreement['extra']))
+                       if(isset($s_agreement['extra']) && 
is_array($s_agreement['extra']))
                        {
-                               if($value)
+                               foreach ($s_agreement['extra'] as $input_name 
=> $value)
                                {
+                                       if(isset($value) && $value)
+                               {
                                        $cols[] = $input_name;
                                        $vals[] = $value;
                                }
                        }
+                       }
 
                        if (isset($values_attribute) AND 
is_array($values_attribute))
                        {
@@ -762,14 +705,18 @@
                                }
                        }
 */
-                       while (is_array($values['extra']) && 
list($input_name,$value) = each($values['extra']))
+
+                       if(isset($values['extra']) && 
is_array($values['extra']))
                        {
-                               if($value)
+                               foreach ($values['extra'] as $input_name => 
$value)
                                {
+                                       if(isset($value) && $value)
+                               {
                                        $cols[] = $input_name;
                                        $vals[] = $value;
                                }
                        }
+                       }
 
                        if (isset($values_attribute) AND 
is_array($values_attribute))
                        {
@@ -869,10 +816,13 @@
                                $values['member_of']=',' . 
implode(',',$values['member_of']) . ',';
                        }
 
-                       while (is_array($values['extra']) && 
list($column,$value) = each($values['extra']))
+                       if(isset($values['extra']) && 
is_array($values['extra']))
                        {
+                               foreach ($values['extra'] as $column => $value)
+                       {
                                $value_set[$column]     = $value;
                        }
+                       }
 
                        if (isset($values_attribute) AND 
is_array($values_attribute))
                        {
@@ -880,10 +830,17 @@
                                {
                                        if($entry['datatype']!='AB' && 
$entry['datatype']!='VENDOR')
                                        {
+                                               if($entry['datatype'] == 'C' || 
$entry['datatype'] == 'T' || $entry['datatype'] == 'V' || $entry['datatype'] == 
'link')
+                                               {
+                                                       
$value_set[$entry['name']] = $this->db->db_addslashes($entry['value']);
+                                               }
+                                               else
+                                               {
                                                $value_set[$entry['name']]      
= $entry['value'];
                                        }
                                }
                        }
+                       }
 
                        $value_set['name']      = $values['name'];
                        $value_set['descr']     = $values['descr'];
@@ -919,7 +876,7 @@
                                {
                                        if($entry['datatype']!='AB' && 
$entry['datatype']!='VENDOR')
                                        {
-                                               if($entry['datatype'] == 'C' || 
$entry['datatype'] == 'T' || $entry['datatype'] == 'V')
+                                               if($entry['datatype'] == 'C' || 
$entry['datatype'] == 'T' || $entry['datatype'] == 'V' || $entry['datatype'] == 
'link')
                                                {
                                                        
$value_set[$entry['name']] = $this->db->db_addslashes($entry['value']);
                                                }
@@ -971,7 +928,8 @@
                        if (isset($history_set) AND is_array($history_set))
                        {
                                $historylog     = 
CreateObject('property.historylog','s_agreement');
-                               while (list($attrib_id,$history) = 
each($history_set))
+                               foreach ($history_set as $attrib_id => $history)
+               //              while (list($attrib_id,$history) = 
each($history_set))
                                {
                                        
$historylog->add('SO',$values['s_agreement_id'],$history['value'],False, 
$attrib_id,$history['date'],$values['id']);
                                }
@@ -1009,10 +967,10 @@
 
                function floatval($strValue)
                {
-                       $floatValue = 
ereg_replace("(^[0-9]*)(\\.|,)([0-9]*)(.*)", "\\1.\\3", $strValue);
+                       $floatValue = 
preg_replace("/(^[0-9]*)(\\.|,)([0-9]*)(.*)/", "\\1.\\3", $strValue);
                        if(!is_numeric($floatValue))
                        {
-                               $floatValue = ereg_replace("(^[0-9]*)(.*)", 
"\\1", $strValue);
+                               $floatValue = preg_replace("/(^[0-9]*)(.*)/", 
"\\1", $strValue);
                        }
                        if(!is_numeric($floatValue))
                        {
@@ -1021,7 +979,6 @@
                        return $floatValue;
                }
 
-
                function delete_last_index($s_agreement_id,$item_id)
                {
                        $this->db->transaction_begin();
@@ -1044,7 +1001,6 @@
                        $this->db->transaction_commit();
                }
 
-
                function delete($s_agreement_id)
                {
                        $table = 'fm_s_agreement';
@@ -1058,628 +1014,14 @@
 
                function attrib_choise2id($id,$value = '')
                {
-                       $sql = "SELECT id FROM fm_s_agreement_choice WHERE 
value = '$value' AND attrib_id = $id";
+                       $choice_table = 'phpgw_cust_choice';
+                       $attribute_filter = " appname = 'property' AND location 
= '.s_agreement.detail'";
+                       $sql = "SELECT id FROM $choice_table WHERE 
$attribute_filter AND value = '$value' AND attrib_id = $id";
                        $this->db->query($sql,__LINE__,__FILE__);
                        $this->db->next_record();
                        return $this->db->f('id');                              
        
                }
                
-               function read_attrib($data)
-               {
-                       $attribute_table = 'fm_s_agreement_attribute';
-//html_print_r($data);
-                       if(is_array($data))
-                       {
-                               if ($data['start'])
-                               {
-                                       $start=$data['start'];
-                               }
-                               else
-                               {
-                                       $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']:'');
-                               $column_list = 
(isset($data['column_list'])?$data['column_list']:'');
-                       }
-
-                       $where = 'WHERE';
-                       if ($column_list)
-                       {
-                               $filtermethod = " $where list !=1 or list is 
null";
-                               $where = 'AND';
-                       }
-                       if ($this->role=='detail')
-                       {
-                               $filtermethod .= " $where attrib_detail=2 ";
-                       }
-                       else
-                       {
-                               $filtermethod .= " $where attrib_detail=1 ";
-                       }
-
-                       $where = 'AND';
-
-                       if ($order)
-                       {
-                               $ordermethod = " order by $order $sort";
-
-                       }
-                       else
-                       {
-                               $ordermethod = ' order by attrib_sort asc';
-                       }
-
-                       if($query)
-                       {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
-
-                               $querymethod = " $where 
($attribute_table.input_text $this->like '%$query%' or 
$attribute_table.column_name $this->like '%$query%')";
-                       }
-
-                       $sql = "SELECT * FROM $attribute_table $filtermethod 
$querymethod";
-
-//echo $sql;
-                       $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())
-                       {
-                               $attrib[] = array
-                               (
-                                       'id'                    => 
$this->db->f('id'),
-                                       'attrib_sort'   => 
$this->db->f('attrib_sort'),
-                                       'list'                  => 
$this->db->f('list'),
-                                       'lookup_form'   => 
$this->db->f('lookup_form'),
-                                       'column_name'   => 
$this->db->f('column_name'),
-                                       'name'                  => 
$this->db->f('input_text'),
-                                       'size'                  => 
$this->db->f('size'),
-                                       'statustext'    => 
$this->db->f('statustext'),
-                                       'input_text'    => 
$this->db->f('input_text'),
-                                       'type_name'             => 
$this->db->f('type'),
-                                       'datatype'              => 
$this->db->f('datatype'),
-                                       'search'                => 
$this->db->f('search')
-                               );
-                       }
-                       return $attrib;
-               }
-
-               function read_single_attrib($id)
-               {
-                       $attribute_table = 'fm_s_agreement_attribute';
-
-                       if ($this->role=='detail')
-                       {
-                               $filtermethod = " AND attrib_detail=2 ";
-                       }
-                       else
-                       {
-                               $filtermethod = " AND attrib_detail=1 ";
-                       }
-
-                       $sql = "SELECT * FROM $attribute_table where id=$id 
$filtermethod";
-
-                       $this->db->query($sql);
-
-                       if($this->db->next_record())
-                       {
-                               $attrib['id']                                   
        = $this->db->f('id');
-                               $attrib['column_name']                          
= $this->db->f('column_name');
-                               $attrib['input_text']                           
= $this->db->f('input_text');
-                               $attrib['statustext']                           
= $this->db->f('statustext');
-                               $attrib['column_info']['precision']     = 
$this->db->f('precision_');
-                               $attrib['column_info']['scale']         = 
$this->db->f('scale');
-                               $attrib['column_info']['default']       = 
$this->db->f('default_value');
-                               $attrib['column_info']['nullable']      = 
$this->db->f('nullable');
-                               $attrib['column_info']['type']          = 
$this->db->f('datatype');
-                               $attrib['type_name']                            
= $this->db->f('type_name');
-                               $attrib['lookup_form']                          
= $this->db->f('lookup_form');
-                               $attrib['list']                                 
        = $this->db->f('list');
-                               $attrib['search']                               
        = $this->db->f('search');
-                               $attrib['history']                              
        = $this->db->f('history');
-                               if($this->db->f('datatype')=='R' || 
$this->db->f('datatype')=='CH' || $this->db->f('datatype')=='LB')
-                               {
-                                       $attrib['choice'] = 
$this->read_attrib_choice($id);
-                               }
-
-                               return $attrib;
-                       }
-               }
-
-               function read_attrib_choice($attrib_id)
-               {
-                       $choice_table = 'fm_s_agreement_choice';
-
-                       if ($this->role=='detail')
-                       {
-                               $filtermethod = " AND attrib_detail=2 ";
-                       }
-                       else
-                       {
-                               $filtermethod = " AND attrib_detail=1 ";
-                       }
-
-                       $sql = "SELECT * FROM $choice_table WHERE 
attrib_id=$attrib_id $filtermethod";
-                       $this->db->query($sql);
-
-                       while ($this->db->next_record())
-                       {
-                               $choice[] = array
-                               (
-                                       'id'    => $this->db->f('id'),
-                                       'value' => $this->db->f('value')
-                               );
-
-                       }
-                       return $choice;
-               }
-
-               function add_attrib($attrib)
-               {
-                       $attribute_table = 'fm_s_agreement_attribute';
-                       $attrib['column_name'] = 
strtolower($this->db->db_addslashes($attrib['column_name']));
-                       $attrib['input_text'] = 
$this->db->db_addslashes($attrib['input_text']);
-                       $attrib['statustext'] = 
$this->db->db_addslashes($attrib['statustext']);
-                       $attrib['default'] = 
$this->db->db_addslashes($attrib['default']);
-                       $attrib['id'] = 
$this->bocommon->next_id($attribute_table, array('attrib_detail'=>!!$this->role 
+1));
-
-                       if($this->role=='detail')
-                       {
-                               $filtermethod= 'WHERE attrib_detail=2';
-                               $table = 'fm_s_agreement_detail';
-                       }
-                       else
-                       {
-                               $filtermethod= 'WHERE attrib_detail=1';
-                               $table = 'fm_s_agreement';
-                       }
-
-                       $sql = "SELECT * FROM $attribute_table $filtermethod 
AND column_name = '{$attrib['column_name']}'";
-                       $this->db->query($sql,__LINE__,__FILE__);
-                       if ( $this->db->next_record() )
-                       {
-                               $receipt['id'] = '';
-                               $receipt['error'] = array();
-                               $receipt['error'][] = array('msg' => 
lang('field already exists, please choose another name'));
-                               $receipt['error'][] = array('msg'       => 
lang('Attribute has NOT been saved'));
-                               return $receipt; //no point continuing
-                       }
-
-                       $sql = "SELECT max(attrib_sort) as max_sort FROM 
$attribute_table $filtermethod";
-                       $this->db->query($sql);
-                       $this->db->next_record();
-                       $attrib_sort    = $this->db->f('max_sort')+1;
-
-                       $values= array(
-                               !!$this->role +1,
-                               $attrib['id'],
-                               $attrib['column_name'],
-                               $attrib['input_text'],
-                               $attrib['statustext'],
-                               $attrib['lookup_form'],
-                               $attrib['search'],
-                               $attrib['list'],
-                               $attrib['history'],
-                               $attrib_sort,
-                               $attrib['column_info']['type'],
-                               $attrib['column_info']['precision'],
-                               $attrib['column_info']['scale'],
-                               $attrib['column_info']['default'],
-                               $attrib['column_info']['nullable']
-                               );
-
-                       $values = $this->bocommon->validate_db_insert($values);
-
-                       $this->db->transaction_begin();
-
-                       $this->db->query("INSERT INTO $attribute_table 
(attrib_detail,id,column_name, input_text, 
statustext,lookup_form,search,list,history,attrib_sort,datatype,precision_,scale,default_value,nullable)
 "
-                               . "VALUES ($values)");
-
-                       $receipt['id']= $attrib['id'];
-
-                       if($attrib['column_info']['type']=='email' && 
!$attrib['column_info']['precision'])
-                       {
-                               $attrib['column_info']['precision']=64;
-                       }
-
-                       $attrib['column_info']['type']  = 
$this->bocommon->translate_datatype_insert($attrib['column_info']['type']);
-
-                       if($attrib['column_info']['type']=='int' && 
!$attrib['column_info']['precision'])
-                       {
-                               $attrib['column_info']['precision']=4;
-                       }
-
-                       if(!$attrib['column_info']['default'])
-                       {
-                               unset($attrib['column_info']['default']);
-                       }
-
-                       $this->init_process();
-
-                       
if($this->oProc->AddColumn($table,$attrib['column_name'], 
$attrib['column_info']))
-                       {
-                               $receipt['message'][] = array('msg'     => 
lang('Attribute has been saved')     );
-                               $this->db->transaction_commit();
-
-                       }
-                       else
-                       {
-                               $receipt['error'][] = array('msg'       => 
lang('column could not be added')    );
-                               if($this->db->Transaction)
-                               {
-                                       $GLOBALS['phpgw']->db->rollbacktrans();
-                               }
-                               else
-                               {
-                                       $GLOBALS['phpgw']->db->Execute("DELETE 
FROM $attribute_table WHERE id='" . $receipt['id'] . "'");
-                                       unset($receipt['id']);
-
-                               }
-                       }
-
-                       return $receipt;
-               }
-
-               function init_process()
-               {
-                       $this->oProc                                            
= 
CreateObject('phpgwapi.schema_proc',$GLOBALS['phpgw_info']['server']['db_type']);
-                       $this->oProc->m_odb                                     
= $this->db;
-                       $this->oProc->m_odb->Halt_On_Error      = 'report';
-               }
-
-               function get_default_column_def($table)
-               {
-                       switch($table)
-                       {
-                               case 'fm_s_agreement':
-                                       $fd=array(
-                                               'id' => array('type' => 'int', 
'precision' => 4,'nullable' => False,'default' => '0'),
-                                               'vendor_id' => array('type' => 
'int', 'precision' => 4,'nullable' => True),
-                                               'name' => array('type' => 
'varchar', 'precision' => 100,'nullable' => False),
-                                               'descr' => array('type' => 
'text','nullable' => True),
-                                               'status' => array('type' => 
'varchar', 'precision' => 10,'nullable' => True),
-                                               'category' => array('type' => 
'int', 'precision' => 4,'nullable' => True),
-                                               'member_of' => array('type' => 
'text','nullable' => True),
-                                               'entry_date' => array('type' => 
'int', 'precision' => 4,'nullable' => True),
-                                               'start_date' => array('type' => 
'int', 'precision' => 4,'nullable' => True),
-                                               'end_date' => array('type' => 
'int', 'precision' => 4,'nullable' => True),
-                                               'termination_date' => 
array('type' => 'int', 'precision' => 4,'nullable' => True),
-                                               'user_id' => array('type' => 
'int', 'precision' => 4,'nullable' => True),
-                                               'actual_cost' => array('type' 
=> 'decimal', 'precision' => 20, 'scale' => 2,'nullable' => True),
-                                               'account_id' => array('type' => 
'varchar', 'precision' => 20,'nullable' => True)
-                                               );
-                                       break;
-                               case 'fm_s_agreement_detail':
-                                       $fd=array(
-                                               'agreement_id' => array('type' 
=> 'int', 'precision' => 4,'nullable' => False,'default' => '0'),
-                                               'id' => array('type' => 'int', 
'precision' => 4,'nullable' => False,'default' => '0'),
-                                               'location_code' => array('type' 
=> 'varchar', 'precision' => 30,'nullable' => True),
-                                               'address' => array('type' => 
'varchar', 'precision' => 150,'nullable' => True),
-                                               'p_num' => array('type' => 
'varchar', 'precision' => 15,'nullable' => True),
-                                               'p_entity_id' => array('type' 
=> 'int', 'precision' => 4,'nullable' => True,'default' => '0'),
-                                               'p_cat_id' => array('type' => 
'int', 'precision' => 4,'nullable' => True,'default' => '0'),
-                                               'descr' => array('type' => 
'text','nullable' => True),
-                                               'unit' => array('type' => 
'varchar', 'precision' => 10,'nullable' => True),
-                                               'quantity' => array('type' => 
'decimal', 'precision' => 20, 'scale' => 2,'nullable' => True),
-                                               'frequency' => array('type' => 
'int', 'precision' => 4,'nullable' => True),
-                                               'user_id' => array('type' => 
'int', 'precision' => 4,'nullable' => True),
-                                               'entry_date' => array('type' => 
'int', 'precision' => 4,'nullable' => True),
-                                               'test' => array('type' => 
'text','nullable' => True),
-                                               'cost' => array('type' => 
'decimal', 'precision' => 20, 'scale' => 2,'nullable' => True)
-                                               );
-                                       break;
-                               default:
-                                       return;
-                                       break;
-                       }
-                       
-                       return $fd;
-               }
-
-               function get_table_def($table)
-               {
-                       $metadata = $this->db->metadata($table);
-
-                       if(isset($this->db->adodb))
-                       {
-                               $i = 0;
-                               foreach($metadata as $key => $val)
-                               {
-                                       $metadata_temp[$i]['name'] = $key;
-                                       $i++;
-                               }
-                               $metadata = $metadata_temp;
-                               unset ($metadata_temp);
-                       }
-
-                       if($this->role=='detail')
-                       {
-                               $filtermethod= ' AND attrib_detail=2';
-                               $pk = array('agreement_id','id');
-                       }
-                       else
-                       {
-                               $filtermethod= ' AND attrib_detail=1';
-                               $pk = array('id');
-                       }
-
-                       $fd = $this->get_default_column_def($table);
-                       
-                       for ($i=0; $i<count($metadata); $i++)
-                       {
-                               $sql = "SELECT * FROM fm_s_agreement_attribute 
WHERE column_name = '" . $metadata[$i]['name'] . "' $filtermethod";
-
-                               $this->db->query($sql,__LINE__,__FILE__);
-                               while($this->db->next_record())
-                               {
-                                       if(!$precision = 
$this->db->f('precision_'))
-                                       {
-                                               $precision = 
$this->bocommon->translate_datatype_precision($this->db->f('datatype'));
-                                       }
-
-                                       $fd[$metadata[$i]['name']] = array(
-                                               'type' => 
$this->bocommon->translate_datatype_insert(stripslashes($this->db->f('datatype'))),
-                                               'precision' => $precision,
-                                               'nullable' => 
stripslashes($this->db->f('nullable')),
-                                               'default' => 
stripslashes($this->db->f('default_value')),
-                                               'scale' => $this->db->f('scale')
-                                                       );
-                                       unset($precision);
-                               }
-                       }
-
-                       $table_def = array(
-                               $table =>       array(
-                                       'fd' => $fd
-                                       )
-                               );
-                       
-                       $table_def[$table]['pk'] = $pk;
-                       $table_def[$table]['fk'] = array();                     
-                       $table_def[$table]['ix'] = array();                     
-                       $table_def[$table]['uc'] = array();                     
-
-                       return $table_def;
-               }
-
-
-               function edit_attrib($attrib)
-               {
-                       $attribute_table = 'fm_s_agreement_attribute';
-                       $table = 'fm_s_agreement';
-
-                       $attrib['column_name'] = 
strtolower($this->db->db_addslashes($attrib['column_name']));
-                       $attrib['input_text'] = 
$this->db->db_addslashes($attrib['input_text']);
-                       $attrib['statustext'] = 
$this->db->db_addslashes($attrib['statustext']);
-                       $attrib['default'] = 
$this->db->db_addslashes($attrib['default']);
-
-                       $choice_table = 'fm_s_agreement_choice';
-
-                       if($this->role=='detail')
-                       {
-                               $filtermethod= ' AND attrib_detail=2';
-                               $table = 'fm_s_agreement_detail';
-                       }
-                       else
-                       {
-                               $filtermethod= ' AND attrib_detail=1';
-                               $table = 'fm_s_agreement';
-                       }
-
-                       $this->db->query("SELECT column_name, datatype, 
precision_ FROM $attribute_table WHERE id='" . $attrib['id']. "' 
$filtermethod");
-                       $this->db->next_record();
-                       $OldColumnName          = $this->db->f('column_name');
-                       $OldColumnName          = $this->db->f('column_name');
-                       $OldDataType            = $this->db->f('datatype');
-                       $OldPrecision           = $this->db->f('precision_');
-
-                       $table_def = $this->get_table_def($table);      
-                       $this->db->transaction_begin();
-
-                       $value_set=array(
-                               'input_text'    => $attrib['input_text'],
-                               'statustext'    => $attrib['statustext'],
-                               'search'        => $attrib['search'],
-                               'list'          => $attrib['list'],
-                               'history'               => $attrib['history'],
-                               );
-
-                       $value_set      = 
$this->bocommon->validate_db_update($value_set);
-
-                       $this->db->query("UPDATE $attribute_table set 
$value_set WHERE id=" . $attrib['id'] . $filtermethod);
-
-                       $attrib_type=$attrib['column_info']['type'];
-
-                       $this->init_process();
-                       
-                       $this->oProc->m_odb->transaction_begin();
-
-                       $this->oProc->m_aTables = $table_def;
-
-
-                       if($OldColumnName !=$attrib['column_name'])
-                       {
-                               $value_set=array('column_name'  => 
$attrib['column_name']);
-
-                               $value_set      = 
$this->bocommon->validate_db_update($value_set);
-
-                               $this->db->query("UPDATE $attribute_table set 
$value_set WHERE id=" . $attrib['id'] . $filtermethod);
-
-                               $this->oProc->RenameColumn($table, 
$OldColumnName, $attrib['column_name']);
-                       }
-
-                       if (($OldDataType != $attrib['column_info']['type']) || 
($OldPrecision != $attrib['column_info']['precision']) )
-                       {
-                               if($attrib['column_info']['type']!='R' && 
$attrib['column_info']['type']!='CH' && $attrib['column_info']['type']!='LB')
-                               {
-                                       $this->db->query("DELETE FROM 
$choice_table WHERE  attrib_id=" . $attrib['id'] . $filtermethod);
-                               }
-
-                               if(!$attrib['column_info']['precision'])
-                               {
-                                       if($precision = 
$this->bocommon->translate_datatype_precision($attrib['column_info']['type']))
-                                       {
-                                               
$attrib['column_info']['precision']=$precision;
-                                       }
-                               }
-
-                               if(!$attrib['column_info']['default'])
-                               {
-                                       
unset($attrib['column_info']['default']);
-                               }
-
-                               $value_set=array(
-                                       'column_name'   => 
$attrib['column_name'],
-                                       'datatype'      => 
$attrib['column_info']['type'],
-                                       'precision_'    => 
$attrib['column_info']['precision'],
-                                       'scale'         => 
$attrib['column_info']['scale'],
-                                       'default_value' => 
$attrib['column_info']['default'],
-                                       'nullable'      => 
$attrib['column_info']['nullable']
-                                       );
-
-                               $value_set      = 
$this->bocommon->validate_db_update($value_set);
-
-                               $this->db->query("UPDATE $attribute_table set 
$value_set WHERE id=" . $attrib['id'] . $filtermethod);
-
-                               $attrib['column_info']['type']  = 
$this->bocommon->translate_datatype_insert($attrib['column_info']['type']);
-                               
$this->oProc->AlterColumn($table,$attrib['column_name'],$attrib['column_info']);
-                       }
-
-                       if($attrib['new_choice'])
-                       {
-                               $this->db->query("SELECT max(id) as id FROM 
$choice_table WHERE attrib_id='" . $attrib['id']. "' $filtermethod");
-                               $this->db->next_record();
-                               $choice_id              = $this->db->f('id')+1;
-
-       //                      $choice_id = 
$this->bocommon->next_id($choice_table 
,array('attrib_detail'=>2,'attrib_id'=>$attrib['id']));
-
-                               $values= array(
-                                       $attrib['id'],
-                                       $choice_id,
-                                       !!$this->role +1,
-                                       $attrib['new_choice']
-                                       );
-
-                               $values = 
$this->bocommon->validate_db_insert($values);
-
-                               $this->db->query("INSERT INTO $choice_table 
(attrib_id,id,attrib_detail,value) "
-                               . "VALUES ($values)");
-                       }
-
-                       if($attrib['delete_choice'])
-                       {
-                               for 
($i=0;$i<count($attrib['delete_choice']);$i++)
-                               {
-                                       $this->db->query("DELETE FROM 
$choice_table WHERE  attrib_id=" . $attrib['id']  ." AND id=" . 
$attrib['delete_choice'][$i] . $filtermethod);
-                               }
-                       }
-
-                       $this->db->transaction_commit();
-                       $this->oProc->m_odb->transaction_commit();
-
-                       $receipt['message'][] = array('msg'     => 
lang('Attribute has been edited'));
-
-                       return $receipt;
-               }
-
-               function resort_attrib($data)
-               {
-                       $attribute_table = 'fm_s_agreement_attribute';
-                       if(is_array($data))
-                       {
-                               $resort = 
(isset($data['resort'])?$data['resort']:'up');
-                               $id = (isset($data['id'])?$data['id']:'');
-                       }
-
-                       $sql = "SELECT attrib_sort FROM $attribute_table where 
id=$id";
-                       $this->db->query($sql);
-                       $this->db->next_record();
-                       $attrib_sort    = $this->db->f('attrib_sort');
-                       $sql = "SELECT max(attrib_sort) as max_sort FROM 
$attribute_table";
-                       $this->db->query($sql);
-                       $this->db->next_record();
-                       $max_sort       = $this->db->f('max_sort');
-                       switch($resort)
-                       {
-                               case 'up':
-                                       if($attrib_sort>1)
-                                       {
-                                               $sql = "UPDATE $attribute_table 
set attrib_sort=$attrib_sort WHERE attrib_sort =" . ($attrib_sort-1);
-                                               $this->db->query($sql);
-                                               $sql = "UPDATE $attribute_table 
set attrib_sort=" . ($attrib_sort-1) ." WHERE id=$id";
-                                               $this->db->query($sql);
-                                       }
-                                       break;
-                               case 'down':
-                                       if($max_sort > $attrib_sort)
-                                       {
-                                               $sql = "UPDATE $attribute_table 
set attrib_sort=$attrib_sort WHERE attrib_sort =" . ($attrib_sort+1);
-                                               $this->db->query($sql);
-                                               $sql = "UPDATE $attribute_table 
set attrib_sort=" . ($attrib_sort+1) ." WHERE id=$id";
-                                               $this->db->query($sql);
-                                       }
-                                       break;
-                               default:
-                                       return;
-                                       break;
-                       }
-               }
-               function delete_attrib($attrib_id)
-               {
-                       $table = 'fm_s_agreement';
-                       $attribute_table = 'fm_s_agreement_attribute';
-                       $table_def = $this->get_table_def($table);
-
-                       $this->init_process();
-                       $this->oProc->m_odb->transaction_begin();
-                       $this->db->transaction_begin();
-
-                       $sql = "SELECT * FROM $attribute_table WHERE 
id=$attrib_id";
-
-                       $this->db->query($sql);
-                       $this->db->next_record();
-                       $ColumnName             = $this->db->f('column_name');
-
-                       if($this->oProc->DropColumn($table,$table_def[$table], 
$ColumnName))
-                       {
-                               $sql = "SELECT attrib_sort FROM 
$attribute_table where id=$attrib_id";
-                               $this->db->query($sql);
-                               $this->db->next_record();
-                               $attrib_sort    = $this->db->f('attrib_sort');
-                               $sql2 = "SELECT max(attrib_sort) as max_sort 
FROM $attribute_table";
-                               $this->db->query($sql2);
-                               $this->db->next_record();
-                               $max_sort       = $this->db->f('max_sort');
-                               if($max_sort>$attrib_sort)
-                               {
-                                       $sql = "UPDATE $attribute_table set 
attrib_sort=attrib_sort-1 WHERE attrib_sort > $attrib_sort";
-                                       $this->db->query($sql);
-                               }
-
-                               $this->db->query("DELETE FROM $attribute_table 
WHERE id=$attrib_id");
-                       }
-                       else
-                       {
-                               $receipt['error'][] = array('msg'       => 
lang('Attribute has NOT been deleted'));
-                       }
-
-                       $this->db->transaction_commit();
-                       $this->oProc->m_odb->transaction_commit();
-
-                       return $receipt;
-               }
-
                function request_next_id()
                {
                        $this->db->query("SELECT max(id) as id FROM 
fm_s_agreement");

Modified: trunk/property/inc/class.sostandard_2.inc.php
===================================================================
--- trunk/property/inc/class.sostandard_2.inc.php       2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/inc/class.sostandard_2.inc.php       2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -37,7 +37,7 @@
 
                function property_sostandard_2()
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $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();
@@ -80,8 +80,8 @@
 
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
                                $querymethod = " where id $this->like 
'%$query%' or descr $this->like '%$query%'";
                        }

Modified: trunk/property/inc/class.sostandard_3.inc.php
===================================================================
--- trunk/property/inc/class.sostandard_3.inc.php       2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/inc/class.sostandard_3.inc.php       2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -37,7 +37,7 @@
 
                function property_sostandard_3()
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $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();
@@ -80,8 +80,8 @@
 
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
                                $querymethod = " where id $this->like 
'%$query%' or descr $this->like '%$query%'";
                        }

Modified: trunk/property/inc/class.sotemplate.inc.php
===================================================================
--- trunk/property/inc/class.sotemplate.inc.php 2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.sotemplate.inc.php 2008-02-02 13:52:39 UTC (rev 
18466)
@@ -36,7 +36,7 @@
        {
                function property_sotemplate()
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $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();
@@ -94,8 +94,8 @@
 
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
                                $querymethod = " $where (fm_template.descr 
$this->like '%$query%')";
                        }
@@ -166,8 +166,8 @@
 
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
                                $querymethod = " AND (hours_descr $this->like 
'%$query%' or fm_template_hours.remark $this->like '%$query%' or ns3420_id 
$this->like '%$query%')";
                        }

Modified: trunk/property/inc/class.sotenant_claim.inc.php
===================================================================
--- trunk/property/inc/class.sotenant_claim.inc.php     2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/inc/class.sotenant_claim.inc.php     2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -36,7 +36,7 @@
        {
                function property_sotenant_claim()
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $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();
@@ -98,8 +98,8 @@
 
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
                                $querymethod = " $where ( abid = '$query' or 
org_name LIKE '%$query%')";
                        }

Modified: trunk/property/inc/class.sotts.inc.php
===================================================================
--- trunk/property/inc/class.sotts.inc.php      2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.sotts.inc.php      2008-02-02 13:52:39 UTC (rev 
18466)
@@ -36,7 +36,7 @@
        {
                function property_sotts()
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->account          = 
$GLOBALS['phpgw_info']['user']['account_id'];
                        $this->historylog       = 
CreateObject('property.historylog','tts');
                        $this->config           = 
CreateObject('phpgwapi.config');
@@ -74,13 +74,13 @@
                                $external = 
(isset($data['external'])?$data['external']:'');
                        }
 
-                       $this->grants   = 
$GLOBALS['phpgw']->session->appsession('grants_ticket',$this->currentapp);
+                       $this->grants   = 
$GLOBALS['phpgw']->session->appsession('grants_ticket','property');
 
                        if(!$this->grants)
                        {
                                $this->acl              = & 
$GLOBALS['phpgw']->acl;
-                               $this->grants   = 
$this->acl->get_grants($this->currentapp,'.ticket');
-                               
$GLOBALS['phpgw']->session->appsession('grants_ticket',$this->currentapp,$this->grants);
+                               $this->grants   = 
$this->acl->get_grants('property','.ticket');
+                               
$GLOBALS['phpgw']->session->appsession('grants_ticket','property',$this->grants);
                        }
 
                        if ($order)
@@ -165,8 +165,8 @@
                                }
                                else
                                {
-                                       $query = ereg_replace("'",'',$query);
-                                       $query = ereg_replace('"','',$query);
+                                       $query = preg_replace("/'/",'',$query);
+                                       $query = preg_replace('/"/','',$query);
                                        $querymethod = " $where (subject 
$this->like '%$query%' or address $this->like '%$query%' or 
fm_tts_tickets.location_code $this->like '%$query%')";
                                }
                        }
@@ -273,12 +273,12 @@
                                $date_info['date_info'][$i]['entry_date']= 
$GLOBALS['phpgw']->common->show_date($this->db->f('entry_date'),$this->dateformat);
                                if($cat_id)
                                {
-                                       
$date_info['date_info'][$i]['link']=$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
 $this->currentapp.'.uientity.view','entity_id'=> $entity_id,'cat_id'=> 
$cat_id, 'id'=> $this->db->f('destination_id')));
+                                       
$date_info['date_info'][$i]['link']=$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
 'property.uientity.view','entity_id'=> $entity_id,'cat_id'=> $cat_id, 'id'=> 
$this->db->f('destination_id')));
                                        
$date_info['date_info'][$i]['descr']=$this->soadmin_entity->read_category_name($entity_id,$cat_id);
                                }
                                else
                                {
-                                       
$date_info['date_info'][$i]['link']=$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
 $this->currentapp.'.ui' . $type . '.view','id'=> 
$this->db->f('destination_id')));
+                                       
$date_info['date_info'][$i]['link']=$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
 'property.ui' . $type . '.view','id'=> $this->db->f('destination_id')));
                                        
$date_info['date_info'][$i]['descr']=lang($type);
                                }
                                $i++;

Modified: trunk/property/inc/class.sotts2.inc.php
===================================================================
--- trunk/property/inc/class.sotts2.inc.php     2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.sotts2.inc.php     2008-02-02 13:52:39 UTC (rev 
18466)
@@ -38,7 +38,7 @@
                
                function property_sotts2()
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->bo               = 
CreateObject('property.botts');
                        $this->historylog       = 
CreateObject('property.historylog','tts');
                        $this->config           = 
CreateObject('phpgwapi.config');
@@ -297,8 +297,10 @@
                                {
                                        foreach($custom_functions as $entry)
                                        {
-                                               if (is_file(PHPGW_APP_INC . SEP 
. 'custom' . SEP . $entry['file_name']) && $entry['active'])
-                                               include (PHPGW_APP_INC . SEP . 
'custom' . SEP . $entry['file_name']);
+                                               if (is_file(PHPGW_APP_INC . 
"/custom/{$entry['file_name']}") && $entry['active'])
+                                               {
+                                                       
include_once(PHPGW_APP_INC . "/custom/{$entry['file_name']}");
+                                               }
                                        }
                                }
 

Modified: trunk/property/inc/class.sowo_hour.inc.php
===================================================================
--- trunk/property/inc/class.sowo_hour.inc.php  2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.sowo_hour.inc.php  2008-02-02 13:52:39 UTC (rev 
18466)
@@ -36,7 +36,7 @@
        {
                function property_sowo_hour()
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $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();
@@ -684,7 +684,7 @@
                {
                        $vendor_id=(int)$vendor_id;
 
-                       $this->db->query("select column_name from 
fm_vendor_attribute WHERE datatype='email'",__LINE__,__FILE__);
+                       $this->db->query("select column_name from 
phpgw_cust_attribute WHERE appname='property' AND location = '.vendor' AND 
datatype='email'",__LINE__,__FILE__);
                        while ($this->db->next_record())
                        {
                                $this->db2->query("select " . 
$this->db->f('column_name') . " from fm_vendor where 
id=$vendor_id",__LINE__,__FILE__);

Modified: trunk/property/inc/class.soworkorder.inc.php
===================================================================
--- trunk/property/inc/class.soworkorder.inc.php        2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/inc/class.soworkorder.inc.php        2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -37,7 +37,7 @@
 
                function property_soworkorder()
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $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();
@@ -48,12 +48,12 @@
 
                        $this->like                     = $this->bocommon->like;
 
-               //      $this->grants           = 
$GLOBALS['phpgw']->session->appsession('grants_project',$this->currentapp);
+               //      $this->grants           = 
$GLOBALS['phpgw']->session->appsession('grants_project','property');
                //      if(!$this->grants)
                        {
                                $this->acl              = 
CreateObject('phpgwapi.acl');
-                               $this->grants           = 
$this->acl->get_grants($this->currentapp,'.project');
-               //              
$GLOBALS['phpgw']->session->appsession('grants_project',$this->currentapp,$this->grants);
+                               $this->grants           = 
$this->acl->get_grants('property','.project');
+               //              
$GLOBALS['phpgw']->session->appsession('grants_project','property',$this->grants);
                        }
                }
 
@@ -370,8 +370,8 @@
                                }
                                else
                                {
-                                       $query = ereg_replace("'",'',$query);
-                                       $query = ereg_replace('"','',$query);
+                                       $query = preg_replace("/'/",'',$query);
+                                       $query = preg_replace('/"/','',$query);
 
                                        $querymethod = " $where 
(fm_workorder.title $this->like '%$query%' or fm_workorder.descr $this->like 
'%$query%' or fm_project.address $this->like '%$query%' or 
fm_project.location_code $this->like '%$query%' or fm_workorder.id $this->like 
'%$query%')";
                                }
@@ -421,6 +421,7 @@
 
                        $count_cols_return=count($cols_return);
                        $j=0;
+                       $workorder_list = array();
                        while ($this->db->next_record())
                        {
                                for ($i=0;$i<$count_cols_return;$i++)
@@ -441,7 +442,7 @@
                                $j++;
                        }
 
-                       return (isset($workorder_list)?$workorder_list:array());
+                       return $workorder_list;
                }
 
                function read_single($workorder_id)

Modified: trunk/property/inc/class.uiXport.inc.php
===================================================================
--- trunk/property/inc/class.uiXport.inc.php    2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.uiXport.inc.php    2008-02-02 13:52:39 UTC (rev 
18466)
@@ -34,14 +34,14 @@
 
        class property_uiXport
        {
-               var $public_functions = array(
+               var $public_functions = array
+               (
                        'import'        => True,
                        'export'        => True,
                        'rollback'      => True
                );
 
                var $start;
-               var $limit;
                var $query;
                var $sort;
                var $order;
@@ -52,11 +52,11 @@
                {
 
                        $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
'property::invoice';
+               //      $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->bo                       = 
CreateObject('property.boXport',True);
                        $this->invoice                  = 
CreateObject('property.boinvoice');
                        $this->bocommon                 = 
CreateObject('property.bocommon');
-                       $this->menu                     = 
CreateObject('property.menu');
                        $this->contacts                 = 
CreateObject('property.soactor');
                        $this->contacts->role           = 'vendor';
 
@@ -69,22 +69,21 @@
                        $this->acl_manage               = 
$this->acl->check('.invoice',16);
 
                        $this->start                    = $this->bo->start;
-                       $this->limit                    = $this->bo->limit;
                        $this->query                    = $this->bo->query;
                        $this->sort                     = $this->bo->sort;
                        $this->order                    = $this->bo->order;
                        $this->filter                   = $this->bo->filter;
                        $this->cat_id                   = $this->bo->cat_id;
-                       $this->menu->sub                ='invoice';
                }
 
                function import()
                {
                        if(!$this->acl_add)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>2, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>2, 'acl_location'=> $this->acl_location));
                        }
 
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] .= 
'::import';
                        $receipt = 
$GLOBALS['phpgw']->session->appsession('session_data','import_receipt');
                        
$GLOBALS['phpgw']->session->appsession('session_data','import_receipt','');
 
@@ -120,8 +119,6 @@
                                $tsvfile = phpgw::get_var('tsvfile');
                        }
 
-                       $links = $this->menu->links('import_inv');
-
                        if ($cancel && $tsvfile)
                        {
                                unlink ($tsvfile);
@@ -251,7 +248,7 @@
                                                unset($payment_date);
                                                unset($conv_type);
                                                unset($auto_tax);
-//                                             
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiXport.import'));
+//                                             
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uiXport.import'));
                                        }
                                        else
                                        {
@@ -266,7 +263,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiXport.import',
+                               'menuaction'    => 'property.uiXport.import',
                                'sub'           => $sub
                        );
 
@@ -288,16 +285,15 @@
                        $data = array
                        (
                                'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'links'                                         
=> $links,
 
                                'img_cal'                                       
        => $GLOBALS['phpgw']->common->image('phpgwapi','cal'),
                                'lang_datetitle'                                
=> lang('Select date'),
 
                                'form_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'cancel_action'                                 
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiinvoice.index', 'sub'=> $sub)),
+                               'cancel_action'                                 
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiinvoice.index', 'sub'=> $sub)),
                                'lang_cancel'                                   
=> lang('Cancel'),
                                'lang_cancel_statustext'                        
=> lang('cancel the import'),
-                               'action_url'                                    
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=>  $this->currentapp 
.'.uiXport.import')),
+                               'action_url'                                    
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=>  'property' 
.'.uiXport.import')),
                                'tsvfilename'                                   
=> '',
 
                                'lang_debug'                                    
=> lang('Debug output in browser'),
@@ -318,7 +314,7 @@
                                'lang_kid_nr_statustext'                        
=> lang('Enter Kid nr'),
 
                                'lang_vendor'                                   
=> lang('Vendor'),
-                               'addressbook_link'                              
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilookup.vendor')),
+                               'addressbook_link'                              
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uilookup.vendor')),
 
                                'lang_invoice_date_statustext'                  
=> lang('Enter the invoice date'),
                                'lang_num_days_statustext'                      
=> lang('Enter the payment date or the payment delay'),
@@ -388,12 +384,12 @@
                                'lang_budget_responsible_statustext'            
=> lang('You have to select a budget responsible for this invoice in order to 
make the import')
                        );
 
-                       
$GLOBALS['phpgw']->xslttpl->add_file(array('invoice','menu'));
+                       $GLOBALS['phpgw']->xslttpl->add_file(array('invoice'));
 
                        $appname        = lang('Invoice');
                        $function_msg   = lang('Import from CSV');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('import' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -432,13 +428,13 @@
 
                        $link_data_add = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiXport.import',
+                               'menuaction'    => 'property.uiXport.import',
                                'convert'       => 'true'
                        );
 
                        $link_data_cancel = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiXport.import',
+                               'menuaction'    => 'property.uiXport.import',
                                'cancel'        => True
 
                        );
@@ -504,7 +500,7 @@
                        $appname                                                
= lang('Invoice');
                        $function_msg   = lang('Debug');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
 
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('debug' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
@@ -514,17 +510,17 @@
                {
                        if(!$this->acl_manage)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>16, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>16, 'acl_location'=> $this->acl_location));
                        }
 
-                       
$GLOBALS['phpgw']->xslttpl->add_file(array('invoice','menu',
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] .= 
'::export';
+                       $GLOBALS['phpgw']->xslttpl->add_file(array('invoice',
                                                                                
'search_field'));
 
                        $values         = phpgw::get_var('values');
                        $date   = phpgw::get_var('date');
+                       $receipt = array();
 
-                       $links = $this->menu->links('export_inv');
-
                        if($values['submit'])
                        {
                                if (!$values['conv_type'] && !$values['file'] ):
@@ -542,7 +538,7 @@
                                                
$GLOBALS['phpgw_info']['flags']['xslt_app'] = False;
                                                
$GLOBALS['phpgw_info']['flags']['noframework'] = True;
                                                echo '<pre>' . 
$receipt['message'][0]['msg'] . '</pre>';
-                                               echo '&nbsp<a 
href="'.$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiXport.export')) . '">' . lang('Back') . '</a>';
+                                               echo '&nbsp<a 
href="'.$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiXport.export')) . '">' . lang('Back') . '</a>';
                                        }
                                }
                                endif;
@@ -555,14 +551,13 @@
 
                        $link_data = array
                        (
-                               'menuaction'            => 
$this->currentapp.'.uiXport.export',
-                               'invoice_id'            => $invoice_id,
-                               'sub'                   => $sub);
+                               'menuaction'            => 
'property.uiXport.export'
+                       );
 
                        $msgbox_data = $this->bocommon->msgbox_data($receipt);
 
-                       $force_period_year[0]['id'] = date(Y);
-                       $force_period_year[1]['id'] = date(Y) -1;
+                       $force_period_year[0]['id'] = date('Y');
+                       $force_period_year[1]['id'] = date('Y') -1;
 
 
                        $data = array
@@ -572,14 +567,13 @@
                                'lang_force_period_year'                => 
lang('Force year for period'),
                                'lang_force_period_year_statustext'     => 
lang('Force year for period'),
                                'lang_select_year'                      => 
lang('select year'),
-                               'links'                                 => 
$links,
                                'lang_select_conv'                      => 
lang('Select conversion'),
                                'conv_list'                             => 
$this->bo->select_export_conv($values['conv_type']),
                                'select_conv'                           => 
'values[conv_type]',
                                'lang_conv_statustext'                  => 
lang('Select conversion'),
 
                                'lang_rollback_file'                    => 
lang('Roll back'),
-                               'link_rollback_file'                    => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiXport.rollback')),
+                               'link_rollback_file'                    => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiXport.rollback')),
 
                                'lang_export_to_file'                   => 
lang('Export to file'),
                                'value_debug'                           => 
$values['debug'],
@@ -588,7 +582,6 @@
                                'lang_submit'                           => 
lang('Submit'),
                                'lang_cancel'                           => 
lang('Cancel'),
 
-                               'message'                               => 
$message,
                                'form_action'                           => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
                                'lang_save'                             => 
lang('save')
                        );
@@ -597,7 +590,7 @@
                        $appname        = lang('Invoice');
                        $function_msg   = lang('Export invoice');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
 
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('export' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
@@ -607,18 +600,16 @@
                {
                        if(!$this->acl_manage)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>16, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>16, 'acl_location'=> $this->acl_location));
                        }
 
-                       
$GLOBALS['phpgw']->xslttpl->add_file(array('invoice','menu',
+                       $GLOBALS['phpgw']->xslttpl->add_file(array('invoice',
                                                                                
'search_field'));
 
                        $values         = phpgw::get_var('values');
                        $date   = phpgw::get_var('date');
 //_debug_array($values);
 
-                       $links = $this->menu->links('export_inv');
-
                        if($values['submit'])
                        {
                                if (!$values['conv_type'])
@@ -641,7 +632,7 @@
                                $date = 
$GLOBALS['phpgw']->common->show_date(mktime(0,0,0,date("m"),date("d"),date("Y")),$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
                        }
 
-                       $link_data = array('menuaction' => 
$this->currentapp.'.uiXport.rollback');
+                       $link_data = array('menuaction' => 
'property.uiXport.rollback');
 
                        $dateformat = 
strtolower($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
                        $sep = '/';
@@ -661,7 +652,6 @@
                        $data = array
                        (
                                'msgbox_data'                           => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'links'                                 => 
$links,
 
                                'img_cal'                                       
=> $GLOBALS['phpgw']->common->image('phpgwapi','cal'),
                                'lang_datetitle'                        => 
lang('Select date'),
@@ -697,7 +687,7 @@
                        $appname                = lang('Invoice');
                        $function_msg           = lang('Rollback invoice');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
 
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('rollback' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();

Modified: trunk/property/inc/class.uiactor.inc.php
===================================================================
--- trunk/property/inc/class.uiactor.inc.php    2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.uiactor.inc.php    2008-02-02 13:52:39 UTC (rev 
18466)
@@ -53,21 +53,18 @@
                        'view'          => True,
                        'edit'          => True,
                        'delete'        => True,
-                       'list_attribute'=> True,
-                       'edit_attrib'   => True,
                        'columns'       => True
                );
 
                function property_uiactor()
                {
                        $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.boactor',True);
                        $this->bocommon                 = 
CreateObject('property.bocommon');
-                       $this->menu                             = 
CreateObject('property.menu');
 
                        $this->role                             = 
$this->bo->role;
 
@@ -99,8 +96,10 @@
                                );
                        if(!$valid_role[$this->role])
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.index'));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.index'));
                        }
+
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
"property::invoice::{$this->role}";
                }
 
                function save_sessiondata()
@@ -121,20 +120,15 @@
 
                function columns()
                {
-
                        $GLOBALS['phpgw']->xslttpl->add_file(array('columns'));
-
-
                        $GLOBALS['phpgw_info']['flags']['noframework'] = True;
-
                        $values                 = phpgw::get_var('values');
 
                        if ($values['save'])
                        {
-
                                
$GLOBALS['phpgw']->preferences->account_id=$this->account;
                                
$GLOBALS['phpgw']->preferences->read_repository();
-                               
$GLOBALS['phpgw']->preferences->add($this->currentapp,'actor_columns_' 
.$this->role,$values['columns'],'user');
+                               
$GLOBALS['phpgw']->preferences->add('property','actor_columns_' 
.$this->role,$values['columns'],'user');
                                
$GLOBALS['phpgw']->preferences->save_repository();
 
                                $receipt['message'][] = array('msg' => 
lang('columns is updated'));
@@ -144,7 +138,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiactor.columns',
+                               'menuaction'    => 'property.uiactor.columns',
                                'role'          => $this->role
                        );
 
@@ -177,22 +171,17 @@
                                'vendor'=>'invoice'
                                );
 
-                       $this->menu->sub        = $menu_sub[$this->role];
-
                        if(!$this->acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>1, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
                        }
 
                        $GLOBALS['phpgw']->xslttpl->add_file(array('actor',
-                                                                               
'menu',
                                                                                
'receipt',
                                                                                
'search_field',
                                                                                
'nextmatchs',
                                                                                
'filter_member_of'));
 
-                       $links = $this->menu->links($this->role);
-
                        $receipt = 
$GLOBALS['phpgw']->session->appsession('session_data','actor_receipt_' . 
$this->role);
                        
$GLOBALS['phpgw']->session->appsession('session_data','actor_receipt_' . 
$this->role,'');
 
@@ -219,19 +208,19 @@
                                        {
                                                
$content[$j]['row'][$i]['statustext']   = lang('view the entity');
                                                $content[$j]['row'][$i]['text'] 
        = lang('view');
-                                               
$content[$j]['row'][$i++]['link']       = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiactor.view', 'actor_id'=> $entry['id'], 'role'=> 
$this->role));
+                                               
$content[$j]['row'][$i++]['link']       = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiactor.view', 'actor_id'=> $entry['id'], 'role'=> $this->role));
                                        }
                                        if($this->acl_edit)
                                        {
                                                
$content[$j]['row'][$i]['statustext']   = lang('edit the actor');
                                                $content[$j]['row'][$i]['text'] 
        = lang('edit');
-                                               
$content[$j]['row'][$i++]['link']       = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiactor.edit', 'actor_id'=> $entry['id'], 'role'=> 
$this->role));
+                                               
$content[$j]['row'][$i++]['link']       = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiactor.edit', 'actor_id'=> $entry['id'], 'role'=> $this->role));
                                        }
                                        if($this->acl_delete)
                                        {
                                                
$content[$j]['row'][$i]['statustext']   = lang('delete the actor');
                                                $content[$j]['row'][$i]['text'] 
        = lang('delete');
-                                               
$content[$j]['row'][$i++]['link']       = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiactor.delete', 'actor_id'=> $entry['id'], 'role'=> 
$this->role));
+                                               
$content[$j]['row'][$i++]['link']       = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiactor.delete', 'actor_id'=> $entry['id'], 'role'=> $this->role));
                                        }
 
                                        $j++;
@@ -254,7 +243,7 @@
                                                                'sort'  => 
$this->sort,
                                                                'var'   => 
$uicols['name'][$i],
                                                                'order' => 
$this->order,
-                                                               'extra' => 
array('menuaction'   => $this->currentapp.'.uiactor.index',
+                                                               'extra' => 
array('menuaction'   => 'property.uiactor.index',
                                                                                
                        'query'         => $this->query,
                                                                                
                        'role'          => $this->role,
                                                                                
                        'member_id'     => $this->member_id
@@ -292,13 +281,13 @@
                                (
                                        'lang_add'              => lang('add'),
                                        'lang_add_statustext'   => lang('add an 
actor'),
-                                       'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiactor.edit', 'role'=> $this->role))
+                                       'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiactor.edit', 'role'=> $this->role))
                                );
                        }
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiactor.index',
+                               'menuaction'    => 'property.uiactor.index',
                                'sort'          =>$this->sort,
                                'order'         =>$this->order,
                                'cat_id'        =>$this->cat_id,
@@ -321,13 +310,13 @@
 
                        $link_columns = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiactor.columns',
+                               'menuaction'    => 'property.uiactor.columns',
                                'role'          => $this->role
                        );
 
                        $member_of_data = 
$this->cats->formatted_xslt_list(array('selected' => $this->member_id,'globals' 
=> True, 'link_data' =>$link_data));
 
-                       
$GLOBALS['phpgw']->js->validate_file('overlib','overlib',$this->currentapp);
+                       
$GLOBALS['phpgw']->js->validate_file('overlib','overlib','property');
 
                        $data = array
                        (
@@ -377,16 +366,15 @@
 
                        if(!$this->acl_edit)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>2, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>2, 'acl_location'=> $this->acl_location));
                        }
 
                        $actor_id       = phpgw::get_var('actor_id', 'int');
                        $values         = phpgw::get_var('values');
                        $values_attribute  = phpgw::get_var('values_attribute');
 
-                       $insert_record_actor = 
$GLOBALS['phpgw']->session->appsession('insert_record_actor',$this->currentapp);
+                       $insert_record_actor = 
$GLOBALS['phpgw']->session->appsession('insert_record_values.' . 
$this->role,'property');
 
-
 //_debug_array($insert_record_actor);
 //_debug_array($values_attribute);
                        for ($j=0;$j<count($insert_record_actor);$j++)
@@ -425,6 +413,17 @@
 //                                             
$receipt['error'][]=array('msg'=>lang('Please enter a name !'));
                                        }
 
+                                       if(isset($values_attribute) && 
is_array($values_attribute))
+                                       {
+                                               foreach ($values_attribute as 
$attribute )
+                                               {
+                                                       
if($attribute['nullable'] != 1 && !$attribute['value'])
+                                                       {
+                                                               
$receipt['error'][]=array('msg'=>lang('Please enter value for attribute %1', 
$attribute['input_text']));
+                                                       }
+                                               }
+                                       }
+
                                        if(!isset($receipt['error']) || 
!$receipt['error'])
                                        {
                                                $values['actor_id']     = 
$actor_id;
@@ -435,13 +434,13 @@
                                                if (isset($values['save']) && 
$values['save'])
                                                {
                                                        
$GLOBALS['phpgw']->session->appsession('session_data','actor_receipt_' . 
$this->role,$receipt);
-                                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiactor.index', 'role'=> $this->role));
+                                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uiactor.index', 'role'=> $this->role));
                                                }
                                        }
                                }
                                else
                                {
-                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiactor.index', 'role'=> $this->role));
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uiactor.index', 'role'=> $this->role));
                                }
                        }
 
@@ -451,7 +450,7 @@
                        /* Preserve attribute values from post */
                        if(isset($receipt['error']) && (isset( 
$values_attribute) && is_array( $values_attribute)))
                        {
-                               $actor = 
$this->bocommon->preserve_attribute_values($actor,$values_attribute);
+                               $actor = 
$this->bo->preserve_attribute_values($actor,$values_attribute);
                        }
 
                        if ($actor_id)
@@ -462,7 +461,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiactor.edit',
+                               'menuaction'    => 'property.uiactor.edit',
                                'actor_id'      => $actor_id,
                                'role'          => $this->role
                        );
@@ -499,7 +498,7 @@
 
                        $member_of_data = 
$this->cats->formatted_xslt_list(array('selected' => $this->member_id,'globals' 
=> True, 'link_data' =>array()));
 
-                       
$GLOBALS['phpgw']->js->validate_file('dateformat','dateformat',$this->currentapp);
+                       
$GLOBALS['phpgw']->js->validate_file('dateformat','dateformat','property');
 
 //_debug_array($member_of_data);
                        $data = array
@@ -537,6 +536,8 @@
                                'dateformat'                                    
=> $dateformat,
                                'lang_edit'                                     
        => lang('edit'),
                                'lang_add'                                      
        => lang('add'),
+                               'textareacols'                          => 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'])
 && $GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'] : 40,
+                               'textarearows'                          => 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'])
 && $GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'] : 6
                        );
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('actor') . ': ' . ($actor_id?lang('edit') . ' ' . 
lang($this->role):lang('add') . ' ' . lang($this->role));
 
@@ -549,33 +550,21 @@
                {
                        if(!$this->acl_delete)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>8, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>8, 'acl_location'=> $this->acl_location));
                        }
 
-                       $attrib         = phpgw::get_var('attrib');
-                       $id                     = phpgw::get_var('id', 'int');
                        $actor_id       = phpgw::get_var('actor_id', 'int');
-       //              $delete         = phpgw::get_var('delete', 'bool', 
'POST');
                        $confirm        = phpgw::get_var('confirm', 'bool', 
'POST');
 
-
-                       if($attrib)
-                       {
-                               $function='list_attribute';
-                       }
-                       else
-                       {
-                               $function='index';
-                       }
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiactor.'.$function,
+                               'menuaction'    => 'property.uiactor.index',
                                'role'          => $this->role
                        );
 
                        if (phpgw::get_var('confirm', 'bool', 'POST'))
                        {
-                               $this->bo->delete($actor_id,$id,$attrib);
+                               $this->bo->delete($actor_id);
                                
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
                        }
 
@@ -584,7 +573,7 @@
                        $data = array
                        (
                                'done_action'           => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'         => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiactor.delete', 'actor_id'=> $actor_id, 'id'=> $id, 
'attrib'=> $attrib, 'role'=> $this->role)),
+                               'delete_action'         => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiactor.delete', 'actor_id'=> $actor_id, 'role'=> $this->role)),
                                'lang_confirm_msg'      => lang('do you really 
want to delete this entry'),
                                'lang_yes'              => lang('yes'),
                                'lang_yes_statustext'   => lang('Delete the 
entry'),
@@ -595,18 +584,16 @@
                        $appname        = lang('actor');
                        $function_msg   = lang('delete') . ' ' . 
lang($this->role);
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
 
-
-
                function view()
                {
                        if(!$this->acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>1, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
                        }
 
                        $actor_id       = phpgw::get_var('actor_id', 'int');
@@ -616,7 +603,7 @@
 
                        
$GLOBALS['phpgw']->xslttpl->add_file(array('actor','attributes_view'));
 
-                       $actor = 
$this->bo->read_single(array('actor_id'=>$actor_id));
+                       $actor = 
$this->bo->read_single(array('actor_id'=>$actor_id, 'view'=>true));
 
                        $attributes_values=$actor['attributes'];
 
@@ -635,7 +622,7 @@
                        (
                                'lang_actor_id'                         => 
lang($this->role) . ' ID',
                                'value_actor_id'                        => 
$actor_id,
-                               'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiactor.index', 'role'=> $this->role)),
+                               'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiactor.index', 'role'=> $this->role)),
                                'lang_category'                         => 
lang('category'),
                                'lang_time_created'                     => 
lang('time created'),
                                'lang_done'                             => 
lang('done'),
@@ -648,331 +635,13 @@
                                'lang_dateformat'                       => 
lang(strtolower($dateformat)),
                                'lang_attributes'                       => 
lang('Attributes'),
                                'attributes_view'                       => 
$attributes_values,
-                               'dateformat'                            => 
$dateformat
+                               'dateformat'                            => 
$dateformat,
+                               'textareacols'                          => 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'])
 && $GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'] : 40,
+                               'textarearows'                          => 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'])
 && $GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'] : 6
                        );
 
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
-
-               function list_attribute()
-               {
-
-                       if(!$this->acl_manage)
-                       {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>16, 'acl_location'=> 
$this->acl_location));
-                       }
-
-                       $id     = phpgw::get_var('id', 'int');
-                       $resort = phpgw::get_var('resort');
-
-                       $GLOBALS['phpgw']->xslttpl->add_file(array(
-                                                               'actor',
-                                                               'nextmatchs',
-                                                               
'search_field'));
-
-                       if($resort)
-                       {
-                               
$this->bo->resort_attrib(array('resort'=>$resort,'id'=>$id));
-                       }
-
-                       $attrib_list = $this->bo->read_attrib();
-
-                       while (is_array($attrib_list) && list(,$attrib) = 
each($attrib_list))
-                       {
-                               $content[] = array
-                               (
-                                       'name'                                  
        => $attrib['name'],
-                                       'type_name'                             
        => $attrib['type_name'],
-                                       'datatype'                              
        => $attrib['datatype'],
-                                       'column_name'                           
=> $attrib['column_name'],
-                                       'input_text'                            
=> $attrib['input_text'],
-                                       'sorting'                               
        => $attrib['attrib_sort'],
-                                       'search'                                
        => $attrib['search'],
-                                       'link_up'                               
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiactor.list_attribute', 'resort'=> 'up', 'id'=> 
$attrib['id'], 'allrows'=> $this->allrows, 'role'=> $this->role)),
-                                       'link_down'                             
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiactor.list_attribute', 'resort'=> 'down', 'id'=> 
$attrib['id'], 'allrows'=> $this->allrows, 'role'=> $this->role)),
-                                       'link_edit'                             
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiactor.edit_attrib', 'id'=> $attrib['id'], 'role'=> 
$this->role)),
-                                       'link_delete'                           
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiactor.delete', 'id'=> $attrib['id'], 'attrib'=> true, 
'role'=> $this->role)),
-                                       'lang_view_attribtext'          => 
lang('view the attrib'),
-                                       'lang_attribute_attribtext'     => 
lang('attributes for the attrib'). ' ' . lang('location'),
-                                       'lang_edit_attribtext'          => 
lang('edit the attrib'),
-                                       'lang_delete_attribtext'        => 
lang('delete the attrib'),
-                                       'text_attribute'                        
=> lang('Attributes'),
-                                       'text_up'                               
        => lang('up'),
-                                       'text_down'                             
        => lang('down'),
-                                       'text_edit'                             
        => lang('edit'),
-                                       'text_delete'                           
=> lang('delete')
-                               );
-                       }
-
-       //html_print_r($content);
-
-                       $table_header[] = array
-                       (
-                               'lang_descr'            => lang('Descr'),
-                               'lang_datatype'         => lang('Datatype'),
-                               'lang_sorting'          => lang('sorting'),
-                               'lang_search'           => lang('search'),
-                               'lang_edit'                     => lang('edit'),
-                               'lang_delete'           => lang('delete'),
-                               'sort_sorting'  => 
$this->nextmatchs->show_sort_order(array
-                                                                               
(
-                                                                               
        'sort'  => $this->sort,
-                                                                               
        'var'   => 'attrib_sort',
-                                                                               
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uiactor.list_attribute',
-                                                                               
                                'allrows'=> $this->allrows,
-                                                                               
                                'role'  => $this->role)
-                                                                               
)),
-
-                               'sort_name'     => 
$this->nextmatchs->show_sort_order(array
-                                                                               
(
-                                                                               
        'sort'  => $this->sort,
-                                                                               
        'var'   => 'column_name',
-                                                                               
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uiactor.list_attribute',
-                                                                               
                                'allrows'=> $this->allrows,
-                                                                               
                                'role'  => $this->role)
-                                                                               
)),
-                               'lang_name'     => lang('Name'),
-                       );
-
-                       $table_add[] = array
-                       (
-                               'lang_add'              => lang('add'),
-                               'lang_add_attribtext'   => lang('add an 
attrib'),
-                               'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiactor.edit_attrib', 'role'=> $this->role)),
-                               'lang_done'             => lang('done'),
-                               'lang_done_attribtext'  => 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.'.uiactor.list_attribute',
-                               'sort'          =>$this->sort,
-                               'order'         =>$this->order,
-                               'query'         =>$this->query,
-                               'role'          => $this->role
-
-                       );
-
-                       $data = array
-                       (
-                               'allow_allrows'                                 
=> True,
-                               'allrows'                                       
        => $this->allrows,
-                               'start_record'                                  
=> $this->start,
-                               'record_limit'                                  
=> $record_limit,
-                               'num_records'                                   
=> count($attrib_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_attribtext'   => lang('Enter 
the search string. To show all entries, empty this field and press the SUBMIT 
button again'),
-                               'lang_searchbutton_attribtext'  => lang('Submit 
the search string'),
-                               'query'                                         
        => $this->query,
-                               'lang_search'                                   
=> lang('search'),
-                               'table_header_attrib'                   => 
$table_header,
-                               'values_attrib'                                 
=> $content,
-                               'table_add2'                                    
=> $table_add
-                       );
-
-                       $appname        = lang('actor');
-                       $function_msg   = lang('list attribute') . ': ' . 
lang($this->role);
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
-                       //$this->save_sessiondata();
-                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_attribute' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
-               }
-
-               function edit_attrib()
-               {
-                       if(!$this->acl_manage)
-                       {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>16, 'acl_location'=> 
$this->acl_location));
-                       }
-
-                       $id             = phpgw::get_var('id', 'int');
-                       $values         = phpgw::get_var('values');
-       //              $GLOBALS['phpgw']->common->msgbox(lang('Altering 
ColumnName OR Datatype  - deletes your data in this Column'));
-       //html_print_r($values);
-                       
$GLOBALS['phpgw']->xslttpl->add_file(array('actor','choice',));
-
-                       if (isset($values['save']) && $values['save'])
-                       {
-                               if($id)
-                               {
-                                       $values['id']=$id;
-                               }
-
-                               if (!$values['column_name'])
-                               {
-                                       $receipt['error'][] = 
array('msg'=>lang('Column name not entered!'));
-                               }
-
-                               if (!$values['input_text'])
-                               {
-                                       $receipt['error'][] = 
array('msg'=>lang('Input text not entered!'));
-                               }
-                               if (!$values['statustext'])
-                               {
-                                       $receipt['error'][] = 
array('msg'=>lang('Statustext not entered!'));
-                               }
-
-                               if (!$values['column_info']['type'])
-                               {
-                                       $receipt['error'][] = 
array('msg'=>lang('Datatype type not chosen!'));
-                               }
-
-                               
if(!ctype_digit($values['column_info']['precision']) && 
$values['column_info']['precision'])
-                               {
-                                       
$receipt['error'][]=array('msg'=>lang('Please enter precision as integer !'));
-                                       
unset($values['column_info']['precision']);
-                               }
-
-                               if($values['column_info']['scale'] && 
!ctype_digit($values['column_info']['scale']))
-                               {
-                                       
$receipt['error'][]=array('msg'=>lang('Please enter scale as integer !'));
-                                       unset($values['column_info']['scale']);
-                               }
-
-                               if (!$values['column_info']['nullable'])
-                               {
-                                       $receipt['error'][] = 
array('msg'=>lang('Nullable not chosen!'));
-                               }
-
-                               if (!isset($receipt['error']) || 
!$receipt['error'])
-                               {
-                                       $receipt = 
$this->bo->save_attrib($values);
-
-                                       if(!$id)
-                                       {
-                                               $id=$receipt['id'];
-                                       }
-                               }
-                               else
-                               {
-                                       $receipt['error'][] = array('msg'       
=> lang('Attribute has NOT been saved'));
-                               }
-
-                       }
-
-                       if ($id)
-                       {
-                               $values = $this->bo->read_single_attrib($id);
-                               $function_msg = lang('edit attribute') . ': ' . 
lang($this->role);
-                               $action='edit';
-                       }
-                       else
-                       {
-                               $function_msg = lang('add attribute') . ': ' . 
lang($this->role);
-                               $action='add';
-                       }
-
-                       $link_data = array
-                       (
-                               'menuaction'    => 
$this->currentapp.'.uiactor.edit_attrib',
-                               'id'            => $id,
-                               'role'          => $this->role
-
-                       );
-//     _debug_array($values);
-
-                       if(isset($values['column_info']) && 
is_array($values['column_info']))
-                       {
-                               if($values['column_info']['type']=='R' || 
$values['column_info']['type']=='CH' || $values['column_info']['type']=='LB')
-                               {
-                                       $multiple_choice= True;
-                               }
-                               $column_type = $values['column_info']['type'];
-                               $column_precision = 
$values['column_info']['precision'];
-                               $column_scale  = 
$values['column_info']['scale'];
-                               $column_default  = 
$values['column_info']['default'];
-                               $column_nullable  = 
$values['column_info']['nullable'];
-                       }
-
-                       $msgbox_data = 
(isset($receipt)?$this->bocommon->msgbox_data($receipt):'');
-                       $data = array
-                       (
-                               'lang_choice'                                   
=> lang('Choice'),
-                               'lang_new_value'                                
=> lang('New value'),
-                               'lang_new_value_statustext'             => 
lang('New value for multiple choice'),
-                               'multiple_choice'                               
=> (isset($multiple_choice)?$multiple_choice:''),
-                               'value_choice'                                  
=> (isset($values['choice'])?$values['choice']:''),
-                               'lang_delete_value'                             
=> lang('Delete value'),
-                               'lang_value'                                    
=> lang('value'),
-                               'lang_delete_choice_statustext' => lang('Delete 
this value from the list of multiple choice'),
-                               '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.'.uiactor.list_attribute', 'role'=> $this->role)),
-                               'lang_id'                                       
        => lang('Attribute ID'),
-                               'lang_save'                                     
        => lang('save'),
-                               'lang_done'                                     
        => lang('done'),
-                               'value_id'                                      
        => $id,
-
-                               'lang_column_name'                              
=> lang('Column name'),
-                               'value_column_name'                             
=> (isset($values['column_name'])?$values['column_name']:''),
-                               'lang_column_name_statustext'   => lang('enter 
the name for the column'),
-
-                               'lang_input_text'                               
=> lang('input text'),
-                               'value_input_text'                              
=> (isset($values['input_text'])?$values['input_text']:''),
-                               'lang_input_name_statustext'    => lang('enter 
the input text for records'),
-
-                               'lang_id_attribtext'                    => 
lang('Enter the attribute ID'),
-                               'lang_entity_statustext'                => 
lang('Select a actor type'),
-
-                               'lang_statustext'                               
=> lang('Statustext'),
-                               'lang_statustext_attribtext'    => lang('Enter 
a statustext for the inputfield in forms'),
-                               'value_statustext'                              
=> (isset($values['statustext'])?$values['statustext']:''),
-
-                               'lang_done_attribtext'                  => 
lang('Back to the list'),
-                               'lang_save_attribtext'                  => 
lang('Save the attribute'),
-
-                               'lang_datatype'                                 
=> lang('Datatype'),
-                               'lang_datatype_statustext'              => 
lang('Select a datatype'),
-                               'lang_no_datatype'                              
=> lang('No datatype'),
-                               'datatype_list'                                 
=> 
$this->bocommon->select_datatype((isset($column_type)?$column_type:''),'actor'),
-
-                               'lang_precision'                                
=> lang('Precision'),
-                               'lang_precision_statustext'             => 
lang('enter the record length'),
-                               'value_precision'                               
=> (isset($column_precision)?$column_precision:''),
-
-                               'lang_scale'                                    
=> lang('scale'),
-                               'lang_scale_statustext'                 => 
lang('enter the scale if type is decimal'),
-                               'value_scale'                                   
=> (isset($column_scale)?$column_scale:''),
-
-                               'lang_default'                                  
=> lang('default'),
-                               'lang_default_statustext'               => 
lang('enter the default value'),
-                               'value_default'                                 
=> (isset($column_default)?$column_default:''),
-
-                               'lang_nullable'                                 
=> lang('Nullable'),
-                               'lang_nullable_statustext'              => 
lang('Chose if this column is nullable'),
-                               'lang_select_nullable'                  => 
lang('Select nullable'),
-                               'nullable_list'                                 
=> 
$this->bocommon->select_nullable((isset($column_nullable)?$column_nullable:'')),
-
-                               'value_list'                                    
=> (isset($values['list'])?$values['list']:''),
-                               'lang_list'                                     
        => lang('show in list'),
-                               'lang_list_statustext'                  => 
lang('check to show this attribute in location list'),
-
-                               'value_search'                                  
=> (isset($values['search'])?$values['search']:''),
-                               'lang_include_search'                   => 
lang('Include in search'),
-                               'lang_include_search_statustext'=> lang('check 
to show this attribute in location list'),
-                       );
-       //html_print_r($data);
-
-                       $appname = lang('actor');
-
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
-                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_attrib' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
-               }
        }
 ?>

Modified: trunk/property/inc/class.uiadmin.inc.php
===================================================================
--- trunk/property/inc/class.uiadmin.inc.php    2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.uiadmin.inc.php    2008-02-02 13:52:39 UTC (rev 
18466)
@@ -57,7 +57,8 @@
                function property_uiadmin()
                {
                        $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
'admin::property';
+               //      $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->nextmatchs                       = 
CreateObject('phpgwapi.nextmatchs');
                        $this->account                          = 
$GLOBALS['phpgw_info']['user']['account_id'];
 
@@ -217,7 +218,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'            => 
$this->currentapp.'.uiadmin.aclprefs',
+                               'menuaction'            => 
'property.uiadmin.aclprefs',
                                'sort'                          => $this->sort,
                                'order'                         => $this->order,
                                'cat_id'                        => 
$this->cat_id,
@@ -260,7 +261,7 @@
                                'record_limit'                                  
=> $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'],
                                'num_records'                                   
=> $num_records,
                                'all_records'                                   
=> (isset($this->bo->total_records)?$this->bo->total_records:''),
-                               'link_url'                                      
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin.aclprefs')),
+                               'link_url'                                      
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin.aclprefs')),
                                'img_path'                                      
        => $GLOBALS['phpgw']->common->get_image_path('phpgwapi','default'),
 
                                'lang_groups'                                   
=> lang('groups'),
@@ -297,7 +298,7 @@
                        $function_msg   = lang('set grants');
                        $owner_name = 
$GLOBALS['phpgw']->accounts->id2name($GLOBALS['phpgw']->accounts->account_id);  
          // get owner name for title
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg . ': ' . 
$owner_name;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg . ': ' . $owner_name;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_permission' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
@@ -306,7 +307,7 @@
 
                function list_acl()
                {
-
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] .= 
'::permissions';
                        
$GLOBALS['phpgw']->xslttpl->add_file(array('admin','nextmatchs',
                                                                                
'search_field'));
 
@@ -440,7 +441,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'account_lid',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uiadmin.list_acl',
+                                                                               
        'extra' => array('menuaction'   => 'property.uiadmin.list_acl',
                                                                                
                                'cat_id'                => $this->cat_id,
                                                                                
                                'query'                 => $this->query,
                                                                                
                                'module'                => $this->location,
@@ -451,7 +452,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'account_lastname',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uiadmin.list_acl',
+                                                                               
        'extra' => array('menuaction'   => 'property.uiadmin.list_acl',
                                                                                
                                'cat_id'                => $this->cat_id,
                                                                                
                                'query'                 => $this->query,
                                                                                
                                'module'                => $this->location,
@@ -462,7 +463,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'account_firstname',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uiadmin.list_acl',
+                                                                               
        'extra' => array('menuaction'   => 'property.uiadmin.list_acl',
                                                                                
                                'cat_id'                => $this->cat_id,
                                                                                
                                'query'                 => $this->query,
                                                                                
                                'module'                => $this->location,
@@ -484,7 +485,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'=> 
$this->currentapp.'.uiadmin.list_acl',
+                               'menuaction'=> 'property.uiadmin.list_acl',
                                'sort'          => $this->sort,
                                'order'         => $this->order,
                                'cat_id'        => $this->cat_id,
@@ -559,7 +560,7 @@
                        $appname        = lang('permission');
                        $function_msg   = lang('set permission');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_permission' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
@@ -567,6 +568,7 @@
 
                function edit_id()
                {
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] .= 
'::edit_id';
 
                        $GLOBALS['phpgw']->xslttpl->add_file(array('admin'));
 
@@ -604,7 +606,7 @@
                        $data = array
                        (
                                'msgbox_data'                   => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'form_action'                   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin.edit_id')),
+                               'form_action'                   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin.edit_id')),
                                'done_action'                   => 
$GLOBALS['phpgw']->link('/admin/index.php'),
                                'lang_submit'                   => 
lang('submit'),
                                'lang_save'                             => 
lang('Edit'),
@@ -622,7 +624,7 @@
                        $appname        = lang('ID');
                        $function_msg   = lang('edit ID');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_id' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
@@ -630,33 +632,36 @@
 
                function contact_info()
                {
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
'::contact_info';
+
                        $GLOBALS['phpgw']->xslttpl->add_file(array('admin'));
 
                        $values         = phpgw::get_var('values');
 
                        if ($values['save'])
                        {
+                               // this should use the contacts backend in the 
API - each account is already linked to a contact
                                
$GLOBALS['phpgw']->preferences->account_id=$this->filter;
                                
$GLOBALS['phpgw']->preferences->read_repository();
 
                                if ($values['old_email'] != $values['email'])
                                {
-                                       
$GLOBALS['phpgw']->preferences->add($this->currentapp,"email",$values['email'],'user');
+                                       
$GLOBALS['phpgw']->preferences->add('property',"email",$values['email'],'user');
                                        $receipt['message'][] = array('msg' => 
lang('Users email is updated'));
                                }
                                if ($values['old_phone'] != $values['phone'])
                                {
-                                       
$GLOBALS['phpgw']->preferences->add($this->currentapp,"cellphone",$values['phone'],'user');
+                                       
$GLOBALS['phpgw']->preferences->add('property',"cellphone",$values['phone'],'user');
                                        $receipt['message'][] = array('msg' => 
lang('Users phone is updated'));
                                }
                                if ($values['old_approval_from'] != 
$values['approval_from'])
                                {
-                                       
$GLOBALS['phpgw']->preferences->add($this->currentapp,"approval_from",$values['approval_from'],'user');
+                                       
$GLOBALS['phpgw']->preferences->add('property',"approval_from",$values['approval_from'],'user');
                                        $receipt['message'][] = array('msg' => 
lang('Approval from is updated'));
                                }
                                if ($values['old_default_vendor_category'] != 
$values['default_vendor_category'])
                                {
-                                       
$GLOBALS['phpgw']->preferences->add($this->currentapp,"default_vendor_category",$values['default_vendor_category'],'user');
+                                       
$GLOBALS['phpgw']->preferences->add('property',"default_vendor_category",$values['default_vendor_category'],'user');
                                        $receipt['message'][] = array('msg' => 
lang('default vendor category is updated'));
                                }
                                
$GLOBALS['phpgw']->preferences->save_repository();
@@ -664,7 +669,7 @@
 
                        if($this->filter)
                        {
-                               $prefs = 
$this->bocommon->create_preferences($this->currentapp,$this->filter);
+                               $prefs = 
$this->bocommon->create_preferences('property',$this->filter);
                        }
 
                        $cats           = CreateObject('phpgwapi.categories');
@@ -677,7 +682,7 @@
                        $data = array
                        (
                                'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'form_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin.contact_info')),
+                               'form_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin.contact_info')),
                                'done_action'                                   
=> $GLOBALS['phpgw']->link('/admin/index.php'),
                                'lang_submit'                                   
=> lang('submit'),
                                'lang_save'                                     
        => lang('Edit'),
@@ -721,7 +726,7 @@
                        $appname        = lang('User contact info');
                        $function_msg   = lang('edit info');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('contact_info' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();

Modified: trunk/property/inc/class.uiadmin_entity.inc.php
===================================================================
--- trunk/property/inc/class.uiadmin_entity.inc.php     2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/inc/class.uiadmin_entity.inc.php     2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -47,10 +47,8 @@
                var $public_functions = array
                (
                        'index'                 => True,
-                       'list_status'           => True,
                        'category'              => True,
                        'edit'                  => True,
-                       'edit_status'           => True,
                        'edit_category'         => True,
                        'view'                  => True,
                        'delete'                => True,
@@ -63,12 +61,12 @@
                function property_uiadmin_entity()
                {
                        $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
'admin::property::entity';
+               //      $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_entity',True);
                        $this->bocommon                         = 
CreateObject('property.bocommon');
-                       $this->menu                             = 
CreateObject('property.menu');
 
                        $this->acl                              = 
CreateObject('phpgwapi.acl');
                        $this->acl_location                     = 
'.admin.entity';
@@ -86,7 +84,6 @@
                        $this->cat_id                           = 
$this->bo->cat_id;
                        $this->allrows                          = 
$this->bo->allrows;
 
-                       $this->menu->sub                        ='admin_entity';
                }
 
                function save_sessiondata()
@@ -108,16 +105,14 @@
                {
                        if(!$this->acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>1, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
                        }
 
                        $this->bocommon->reset_fm_cache();
                        $GLOBALS['phpgw']->xslttpl->add_file(array(
                                                                'admin_entity',
                                                                'nextmatchs',
-                                                               'menu',
                                                                
'search_field'));
-                       $links = $this->menu->links();
 
                        $entity_list = $this->bo->read();
 
@@ -130,9 +125,9 @@
                                                'id'                            
=> $entry['id'],
                                                'name'                          
=> $entry['name'],
                                                'descr'                         
=> $entry['descr'],
-                                               'link_categories'               
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin_entity.category',' entity_id'=> $entry['id'])),
-                                               'link_edit'                     
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin_entity.edit', 'id'=> $entry['id'])),
-                                               'link_delete'                   
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin_entity.delete',' entity_id'=> $entry['id'])),
+                                               'link_categories'               
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_entity.category',' entity_id'=> $entry['id'])),
+                                               'link_edit'                     
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_entity.edit', 'id'=> $entry['id'])),
+                                               'link_delete'                   
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_entity.delete',' entity_id'=> $entry['id'])),
                                                'lang_view_standardtext'        
=> lang('view the standard'),
                                                'lang_category_text'            
=> lang('categories for the entity type'),
                                                'lang_edit_standardtext'        
=> lang('edit the entity'),
@@ -158,7 +153,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'id',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uiadmin_entity.index',
+                                                                               
        'extra' => array('menuaction'   => 'property.uiadmin_entity.index',
                                                                                
                                                'allrows'=> $this->allrows)
                                                                                
)),
                                'lang_id'               => lang('entity id'),
@@ -167,7 +162,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'name',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uiadmin_entity.index',
+                                                                               
        'extra' => array('menuaction'   => 'property.uiadmin_entity.index',
                                                                                
                                                'allrows'=> $this->allrows)
                                                                                
)),
                                'lang_name'             => lang('Name'),
@@ -177,7 +172,7 @@
                        (
                                'lang_add'              => lang('add'),
                                'lang_add_standardtext' => lang('add a 
standard'),
-                               'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin_entity.edit')),
+                               'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_entity.edit')),
                                'lang_done'             => lang('done'),
                                'lang_done_standardtext'=> lang('back to 
admin'),
                                'done_action'           => 
$GLOBALS['phpgw']->link('/admin/index.php')
@@ -194,7 +189,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiadmin_entity.index',
+                               'menuaction'    => 
'property.uiadmin_entity.index',
                                'sort'          =>$this->sort,
                                'order'         =>$this->order,
                                'query'         =>$this->query
@@ -202,7 +197,6 @@
 
                        $data = array
                        (
-                               'links'                                 => 
$links,
                                'allow_allrows'                         => True,
                                'allrows'                               => 
$this->allrows,
                                'start_record'                          => 
$this->start,
@@ -223,150 +217,27 @@
                        $appname        = lang('entity');
                        $function_msg   = lang('list entity type');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
                }
 
-               function list_status()
-               {
-                       if(!$this->acl_read)
-                       {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=> 1, 'acl_location'=> 
$this->acl_location));
-                       }
 
-                       $this->bo->reset_fm_cache();
-                       $GLOBALS['phpgw']->xslttpl->add_file(array(
-                                                               'admin_entity',
-                                                               'nextmatchs',
-                                                               'menu',
-                                                               
'search_field'));
-                       $links = $this->menu->links();
-
-                       $list = $this->bo->read_status();
-
-                       if (isSet($list) AND is_array($list))
-                       {
-                               foreach($list as $entry)
-                               {
-                                       $content[] = array
-                                       (
-                                               'id'                            
=> $entry['id'],
-                                               'descr'                         
=> $entry['descr'],
-                                               'link_edit'                     
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin_entity.edit_status', 'entity_id'=> 
$this->entity_id, 'cat_id'=> $this->cat_id, 'id'=> $entry['id'])),
-                                               'link_delete'                   
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin_entity.delete', 'entity_id'=> $this->entity_id, 
'cat_id'=> $this->cat_id, 'status_id'=> $entry['id'])),
-                                               'lang_edit_standardtext'        
=> lang('edit the entity'),
-                                               'lang_delete_standardtext'      
=> lang('delete the entity'),
-                                               'text_edit'                     
=> lang('edit'),
-                                               'text_delete'                   
=> lang('delete')
-                                       );
-                               }
-                       }
-
-//_debug_array($content);
-
-                       $table_header[] = array
-                       (
-
-                               'lang_descr'            => lang('Descr'),
-                               'lang_edit'             => lang('edit'),
-                               'lang_delete'           => lang('delete'),
-                               'sort_id'               => 
$this->nextmatchs->show_sort_order(array
-                                                                               
(
-                                                                               
        'sort'  => $this->sort,
-                                                                               
        'var'   => 'id',
-                                                                               
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uiadmin_entity.list_status',
-                                                                               
                                                        'entity_id'     => 
$this->entity_id,
-                                                                               
                                                        'cat_id'        => 
$this->cat_id
-                                                                               
                                                        )
-                                                                               
)),
-                               'lang_id'               => lang('status'),
-                       );
-
-                       $table_add[] = array
-                       (
-                               'lang_add'              => lang('add'),
-                               'lang_add_text'         => lang('add a 
standard'),
-                               'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin_entity.edit_status', 'entity_id'=> 
$this->entity_id, 'cat_id'=> $this->cat_id)),
-                               'lang_done'             => lang('done'),
-                               'lang_done_text'        => lang('back to 
admin'),
-                               'done_action'           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin_entity.category', 'entity_id'=> $this->entity_id, 
'cat_id'=> $this->cat_id)),
-                       );
-
-                       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_entity.list_status',
-                               'sort'          => $this->sort,
-                               'order'         => $this->order,
-                               'query'         => $this->query,
-                               'entity_id'     => $this->entity_id,
-                               'cat_id'        => $this->cat_id
-                       );
-
-                       $entity = 
$this->bo->read_single($this->entity_id,false);
-                       $category = 
$this->bo->read_single_category($this->entity_id,$this->cat_id);
-
-                       $msgbox_data = $this->bocommon->msgbox_data($receipt);
-
-                       $data = array
-                       (
-                               'lang_entity'                                   
=> lang('entity'),
-                               'entity_name'                                   
=> $entity['name'],
-                               'lang_category'                                 
=> lang('category'),
-                               'category_name'                                 
=> $category['name'],
-                               'links'                                         
=> $links,
-                               'allow_allrows'                                 
=> True,
-                               'allrows'                                       
=> $this->allrows,
-                               'start_record'                                  
=> $this->start,
-                               'record_limit'                                  
=> $record_limit,
-                               'num_records'                                   
=> count($entity_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_standardtext'                 
=> lang('Enter the search string. To show all entries, empty this field and 
press the SUBMIT button again'),
-                               'lang_searchbutton_standardtext'                
=> lang('Submit the search string'),
-                               'query'                                         
=> $this->query,
-                               'lang_search'                                   
=> lang('search'),
-                               'table_header_status'                           
=> $table_header,
-                               'values_status'                                 
=> $content,
-                               'table_add'                                     
=> $table_add
-                       );
-
-                       $appname        = lang('entity');
-                       $function_msg   = lang('list status');
-
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
-                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_status' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
-                       $this->save_sessiondata();
-               }
-
                function category()
                {
                        if(!$this->acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=> 1, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=> 1, 'acl_location'=> $this->acl_location));
                        }
 
                        $entity_id      = phpgw::get_var('entity_id', 'int');
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] .= 
"::entity_{$entity_id}";
 
                        $GLOBALS['phpgw']->xslttpl->add_file(array(
                                                                'admin_entity',
                                                                'nextmatchs',
-                                                               'menu',
                                                                
'search_field'));
-                       $links = $this->menu->links();
 
                        $category_list = $this->bo->read_category($entity_id);
 
@@ -380,11 +251,11 @@
                                                'name'                          
        => $entry['name'],
                                                'prefix'                        
        => $entry['prefix'],
                                                'descr'                         
        => $entry['descr'],
-//                                             'link_status'                   
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin_entity.list_status', 'cat_id'=> $entry['id'], 
'entity_id'=> $entity_id)),
-                                               'link_custom_function'          
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin_entity.list_custom_function', 'cat_id'=> 
$entry['id'], 'entity_id'=> $entity_id)),
-                                               'link_attribute'                
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin_entity.list_attribute', 'cat_id'=> $entry['id'], 
'entity_id'=> $entity_id)),
-                                               'link_edit'                     
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin_entity.edit_category','id'=> $entry['id'], 
'entity_id'=> $entity_id)),
-                                               'link_delete'                   
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin_entity.delete', 'cat_id'=> $entry['id'], 
'entity_id'=> $entity_id)),
+//                                             'link_status'                   
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_entity.list_status', 'cat_id'=> $entry['id'], 'entity_id'=> 
$entity_id)),
+                                               'link_custom_function'          
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_entity.list_custom_function', 'cat_id'=> $entry['id'], 
'entity_id'=> $entity_id)),
+                                               'link_attribute'                
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_entity.list_attribute', 'cat_id'=> $entry['id'], 
'entity_id'=> $entity_id)),
+                                               'link_edit'                     
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_entity.edit_category','id'=> $entry['id'], 'entity_id'=> 
$entity_id)),
+                                               'link_delete'                   
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_entity.delete', 'cat_id'=> $entry['id'], 'entity_id'=> 
$entity_id)),
                                                'lang_view_standardtext'        
        => lang('view the category'),
                                                'lang_status_standardtext'      
        => lang('Status for the entity category'),
                                                'lang_attribute_standardtext'   
        => lang('attributes for the entity category'),
@@ -417,7 +288,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'id',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uiadmin_entity.category',
+                                                                               
        'extra' => array('menuaction'   => 'property.uiadmin_entity.category',
                                                                                
                                                'entity_id' =>$entity_id,
                                                                                
                                                'allrows'=>$this->allrows)
                                                                                
)),
@@ -427,7 +298,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'name',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uiadmin_entity.category',
+                                                                               
        'extra' => array('menuaction'   => 'property.uiadmin_entity.category',
                                                                                
                                                'entity_id' =>$entity_id,
                                                                                
                                                'allrows'=>$this->allrows)
                                                                                
)),
@@ -438,10 +309,10 @@
                        (
                                'lang_add'                      => lang('add'),
                                'lang_add_standardtext'         => lang('add a 
category'),
-                               'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin_entity.edit_category', 'entity_id'=> $entity_id)),
+                               'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_entity.edit_category', 'entity_id'=> $entity_id)),
                                'lang_done'                     => lang('done'),
                                'lang_done_standardtext'        => lang('back 
to entity'),
-                               'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin_entity.index'))
+                               'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_entity.index'))
                        );
 
                        $entity = $this->bo->read_single($entity_id,false);
@@ -457,7 +328,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiadmin_entity.category',
+                               'menuaction'    => 
'property.uiadmin_entity.category',
                                'sort'          => $this->sort,
                                'order'         => $this->order,
                                'query'         => $this->query,
@@ -468,7 +339,6 @@
                        (
                                'lang_entity'                                   
=> lang('entity'),
                                'entity_name'                                   
=> $entity['name'],
-                               'links'                                         
=> $links,
                                'allow_allrows'                                 
=> True,
                                'allrows'                                       
=> $this->allrows,
                                'start_record'                                  
=> $this->start,
@@ -489,7 +359,7 @@
                        $appname        = lang('entity');
                        $function_msg   = lang('list entity type');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_category' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
@@ -499,12 +369,12 @@
                {
                        if(!$this->acl_add)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=> 2, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=> 2, 'acl_location'=> $this->acl_location));
                        }
 
                        $id     = phpgw::get_var('id', 'int');
                        $values                 = phpgw::get_var('values');
-                       $config = 
CreateObject('phpgwapi.config',$this->currentapp);
+                       $config = CreateObject('phpgwapi.config','property');
 
                        
$GLOBALS['phpgw']->xslttpl->add_file(array('admin_entity'));
 
@@ -575,7 +445,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiadmin_entity.edit',
+                               'menuaction'    => 
'property.uiadmin_entity.edit',
                                'id'            => $id
                        );
 //_debug_array($include_list);
@@ -587,7 +457,7 @@
                                'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
                                'lang_name_standardtext'                        
=> lang('Enter a name of the standard'),
                                'form_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'done_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin_entity.index')),
+                               'done_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_entity.index')),
                                'lang_id'                                       
=> lang('standard ID'),
                                'lang_name'                                     
=> lang('Name'),
                                'lang_descr'                                    
=> lang('Descr'),
@@ -621,112 +491,16 @@
 
                        $appname        = lang('entity');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
 
-               function edit_status()
-               {
-                       if(!$this->acl_edit)
-                       {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=> 4, 'acl_location'=> 
$this->acl_location));
-                       }
-
-                       $id     = phpgw::get_var('id', 'int');
-                       $values                 = phpgw::get_var('values');
-
-                       
$GLOBALS['phpgw']->xslttpl->add_file(array('admin_entity'));
-
-                       if ($values['save'])
-                       {
-                               if (!$values['id'])
-                               {
-                                       $receipt['error'][] = 
array('msg'=>lang('ID not entered!'));
-                               }
-
-                               if($id)
-                               {
-                                       $values['id']=$id;
-                                       $action='edit';
-                               }
-
-                               if (!$receipt['error'])
-                               {
-                                       $receipt = 
$this->bo->save_status($values,$action);
-                                       if(!$id)
-                                       {
-                                               $id=$receipt['id'];
-                                       }
-                               }
-                               else
-                               {
-                                       $receipt['error'][] = array('msg'=> 
lang('Status has NOT been saved'));
-                               }
-
-                       }
-
-                       if ($id)
-                       {
-                               $values = $this->bo->read_single_status($id);
-                               $function_msg = lang('edit status');
-                               $action='edit';
-                       }
-                       else
-                       {
-                               $function_msg = lang('add status');
-                               $action='add';
-                       }
-
-
-                       $link_data = array
-                       (
-                               'menuaction'    => 
$this->currentapp.'.uiadmin_entity.edit_status',
-                               'entity_id'     => $this->entity_id,
-                               'cat_id'        => $this->cat_id,
-                               'id'            => $id
-                       );
-//_debug_array($link_data);
-
-                       $entity = 
$this->bo->read_single($this->entity_id,false);
-                       $category = 
$this->bo->read_single_category($this->entity_id,$this->cat_id);
-
-                       $msgbox_data = $this->bocommon->msgbox_data($receipt);
-
-                       $data = array
-                       (
-                               'lang_entity'                                   
=> lang('entity'),
-                               'entity_name'                                   
=> $entity['name'],
-                               'lang_category'                                 
=> lang('category'),
-                               'category_name'                                 
=> $category['name'],
-                               'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'lang_name_standardtext'                        
=> lang('Enter a name of the standard'),
-                               'form_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'done_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin_entity.list_status', 'entity_id'=> 
$this->entity_id, 'cat_id'=> $this->cat_id)),
-                               'lang_id'                                       
=> lang('status ID'),
-                               'lang_descr'                                    
=> lang('Descr'),
-                               'lang_save'                                     
=> lang('save'),
-                               'lang_done'                                     
=> lang('done'),
-                               'value_id'                                      
=> $id,
-                               'lang_id_standardtext'                          
=> lang('Enter the status ID'),
-                               'lang_descr_standardtext'                       
=> lang('Enter a description of the status'),
-                               'lang_done_standardtext'                        
=> lang('Back to the list'),
-                               'lang_save_standardtext'                        
=> lang('Save the status'),
-                               'value_descr'                                   
=> $values['descr']
-                       );
-
-                       $appname        = lang('entity');
-
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
-                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_status' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
-               }
-
                function edit_category()
                {
                        if(!$this->acl_add)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=> 2, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=> 2, 'acl_location'=> $this->acl_location));
                        }
 
                        $entity_id      = phpgw::get_var('entity_id', 'int');
@@ -784,7 +558,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiadmin_entity.edit_category',
+                               'menuaction'    => 
'property.uiadmin_entity.edit_category',
                                'entity_id'     =>$entity_id,
                                'id'            => $id
                        );
@@ -803,7 +577,7 @@
                                'lang_name_standardtext'                        
=> lang('Enter a name of the standard'),
 
                                'form_action'                                   
        => $GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'done_action'                                   
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin_entity.category', 'entity_id'=> $entity_id)),
+                               'done_action'                                   
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_entity.category', 'entity_id'=> $entity_id)),
                                'lang_id'                                       
                => lang('Category'),
                                'lang_name'                                     
                => lang('Name'),
                                'lang_descr'                                    
        => lang('Descr'),
@@ -845,7 +619,7 @@
 
                        $appname = lang('entity');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -854,13 +628,12 @@
                {
                        if(!$this->acl_delete)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=> 8, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=> 8, 'acl_location'=> $this->acl_location));
                        }
 
                        $entity_id              = phpgw::get_var('entity_id', 
'int');
                        $cat_id                 = phpgw::get_var('cat_id', 
'int');
                        $attrib_id              = phpgw::get_var('attrib_id', 
'int');
-                       $status_id              = phpgw::get_var('status_id');
                        $acl_location           = 
phpgw::get_var('acl_location');
                        $custom_function_id     = 
phpgw::get_var('custom_function_id', 'int');
                        $confirm                = phpgw::get_var('confirm', 
'bool', 'POST');
@@ -884,15 +657,8 @@
                        {
                                if($cat_id)
                                {
-                                       if($status_id)
-                                       {
-                                               $function='list_status';
-                                       }
-                                       else
-                                       {
                                                $function='category';
                                        }
-                               }
                                else
                                {
                                        $function='index';
@@ -902,27 +668,25 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiadmin_entity.'.$function,
+                               'menuaction'    => 
'property.uiadmin_entity.'.$function,
                                'cat_id'        => $cat_id,
                                'entity_id'     => $entity_id,
-                               'attrib_id'     => $attrib_id,
-                               'status_id'     => $status_id
+                               'attrib_id'     => $attrib_id
                        );
 
                        $delete_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiadmin_entity.delete',
+                               'menuaction'    => 
'property.uiadmin_entity.delete',
                                'cat_id'        => $cat_id,
                                'entity_id'     => $entity_id,
                                'attrib_id'     => $attrib_id,
-                               'status_id'     => $status_id,
                                'acl_location'  => $acl_location,
                                'custom_function_id' => $custom_function_id
                        );
 
                        if (phpgw::get_var('confirm', 'bool', 'POST'))
                        {
-                               
$this->bo->delete($cat_id,$entity_id,$attrib_id,$status_id,$acl_location,$custom_function_id);
+                               
$this->bo->delete($cat_id,$entity_id,$attrib_id,$acl_location,$custom_function_id);
                                
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
                        }
 
@@ -942,7 +706,7 @@
                        $appname                = lang('entity');
                        $function_msg           = lang('delete entity type');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -952,11 +716,14 @@
                {
                        if(!$this->acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=> 1, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=> 1, 'acl_location'=> $this->acl_location));
                        }
 
                        $entity_id      = $this->entity_id;
                        $cat_id = $this->cat_id;
+
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] .= 
"::entity_{$entity_id}::entity_{$entity_id}_{$cat_id}";
+
                        $id     = phpgw::get_var('id', 'int');
                        $resort = phpgw::get_var('resort');
 
@@ -979,15 +746,15 @@
                                        $content[] = array
                                        (
                                                'name'                          
=> $entry['name'],
-                                               'datatype'                      
=> $entry['datatype'],
+                                               'datatype'                      
=> $entry['trans_datatype'],
                                                'column_name'                   
=> $entry['column_name'],
                                                'input_text'                    
=> $entry['input_text'],
                                                'sorting'                       
=> $entry['attrib_sort'],
                                                'search'                        
=> $entry['search'],
-                                               'link_up'                       
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin_entity.list_attribute', 'resort'=> 'up', 
'entity_id'=> $entity_id, 'cat_id'=> $cat_id, 'id'=> $entry['id'], 'allrows'=> 
$this->allrows)),
-                                               'link_down'                     
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin_entity.list_attribute', 'resort'=> 'down', 
'entity_id'=> $entity_id, 'cat_id'=> $cat_id, 'id'=> $entry['id'], 'allrows'=> 
$this->allrows)),
-                                               'link_edit'                     
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin_entity.edit_attrib', 'entity_id'=> $entity_id, 
'cat_id'=> $cat_id, 'id'=> $entry['id'])),
-                                               'link_delete'                   
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin_entity.delete', 'entity_id'=> $entity_id, 
'cat_id'=> $cat_id, 'attrib_id'=> $entry['id'])),
+                                               'link_up'                       
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_entity.list_attribute', 'resort'=> 'up', 'entity_id'=> 
$entity_id, 'cat_id'=> $cat_id, 'id'=> $entry['id'], 'allrows'=> 
$this->allrows)),
+                                               'link_down'                     
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_entity.list_attribute', 'resort'=> 'down', 'entity_id'=> 
$entity_id, 'cat_id'=> $cat_id, 'id'=> $entry['id'], 'allrows'=> 
$this->allrows)),
+                                               'link_edit'                     
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_entity.edit_attrib', 'entity_id'=> $entity_id, 'cat_id'=> 
$cat_id, 'id'=> $entry['id'])),
+                                               'link_delete'                   
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_entity.delete', 'entity_id'=> $entity_id, 'cat_id'=> $cat_id, 
'attrib_id'=> $entry['id'])),
                                                'lang_up_text'                  
=> lang('shift up'),
                                                'lang_down_text'                
=> lang('shift down'),
                                                'lang_edit_text'                
=> lang('edit the attrib'),
@@ -1016,7 +783,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'column_name',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uiadmin_entity.list_attribute',
+                                                                               
        'extra' => array('menuaction'   => 
'property.uiadmin_entity.list_attribute',
                                                                                
                                                'entity_id'     =>$entity_id,
                                                                                
                                                'cat_id'        =>$cat_id,
                                                                                
                                                'allrows'=>$this->allrows)
@@ -1026,7 +793,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'attrib_sort',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uiadmin_entity.list_attribute',
+                                                                               
        'extra' => array('menuaction'   => 
'property.uiadmin_entity.list_attribute',
                                                                                
                                                'entity_id'     =>$entity_id,
                                                                                
                                                'cat_id'        =>$cat_id,
                                                                                
                                                'allrows'=>$this->allrows)
@@ -1038,10 +805,10 @@
                        (
                                'lang_add'              => lang('add'),
                                'lang_add_attribtext'   => lang('add an 
attrib'),
-                               'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin_entity.edit_attrib', 'entity_id'=> $entity_id, 
'cat_id'=> $cat_id)),
+                               'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_entity.edit_attrib', 'entity_id'=> $entity_id, 'cat_id'=> 
$cat_id)),
                                'lang_done'             => lang('done'),
                                'lang_done_attribtext'  => lang('back to 
admin'),
-                               'done_action'           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin_entity.category', 'entity_id'=> $entity_id)),
+                               'done_action'           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_entity.category', 'entity_id'=> $entity_id)),
                        );
 
                        if(!$this->allrows)
@@ -1055,7 +822,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiadmin_entity.list_attribute',
+                               'menuaction'    => 
'property.uiadmin_entity.list_attribute',
                                'sort'          => $this->sort,
                                'order'         => $this->order,
                                'query'         => $this->query,
@@ -1093,7 +860,7 @@
                        $appname        = lang('attribute');
                        $function_msg   = lang('list entity attribute');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_attribute' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
@@ -1103,7 +870,7 @@
                {
                        if(!$this->acl_add)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=> 2, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=> 2, 'acl_location'=> $this->acl_location));
                        }
 
                        $entity_id      = phpgw::get_var('entity_id', 'int');
@@ -1201,7 +968,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiadmin_entity.edit_attrib',
+                               'menuaction'    => 
'property.uiadmin_entity.edit_attrib',
                                'entity_id'     => $entity_id,
                                'cat_id'        => $cat_id,
                                'id'            => $id
@@ -1235,7 +1002,7 @@
 
                                '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_entity.list_attribute', 'entity_id'=> $entity_id, 
'cat_id'=> $cat_id)),
+                               'done_action'                                   
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_entity.list_attribute', 'entity_id'=> $entity_id, 'cat_id'=> 
$cat_id)),
                                'lang_id'                                       
                => lang('Attribute ID'),
                                'lang_entity_type'                              
        => lang('Entity type'),
                                'lang_no_entity_type'                           
=> lang('No entity type'),
@@ -1308,7 +1075,7 @@
 
                        $appname = lang('entity');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_attrib' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -1317,7 +1084,7 @@
                {
                        if(!$this->acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=> 1, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=> 1, 'acl_location'=> $this->acl_location));
                        }
 
                        $entity_id      = $this->entity_id;
@@ -1347,10 +1114,10 @@
                                                'descr'                         
        => $entry['descr'],
                                                'sorting'                       
        => $entry['sorting'],
                                                'active'                        
        => $entry['active']?'X':'',
-                                               'link_up'                       
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin_entity.list_custom_function', 'resort'=>'up', 
'entity_id'=> $entity_id, 'cat_id'=> $cat_id, 'id'=> $entry['id'], 'allrows'=> 
$this->allrows)),
-                                               'link_down'                     
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin_entity.list_custom_function', 'resort'=>'down', 
'entity_id'=> $entity_id, 'cat_id'=> $cat_id, 'id'=> $entry['id'], 'allrows'=> 
$this->allrows)),
-                                               'link_edit'                     
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin_entity.edit_custom_function', 'entity_id'=> 
$entity_id, 'cat_id'=> $cat_id, 'id'=> $entry['id'])),
-                                               'link_delete'                   
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin_entity.delete', 'entity_id'=> $entity_id, 
'cat_id'=> $cat_id, 'custom_function_id'=> $entry['id'])),
+                                               'link_up'                       
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_entity.list_custom_function', 'resort'=>'up', 'entity_id'=> 
$entity_id, 'cat_id'=> $cat_id, 'id'=> $entry['id'], 'allrows'=> 
$this->allrows)),
+                                               'link_down'                     
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_entity.list_custom_function', 'resort'=>'down', 'entity_id'=> 
$entity_id, 'cat_id'=> $cat_id, 'id'=> $entry['id'], 'allrows'=> 
$this->allrows)),
+                                               'link_edit'                     
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_entity.edit_custom_function', 'entity_id'=> $entity_id, 
'cat_id'=> $cat_id, 'id'=> $entry['id'])),
+                                               'link_delete'                   
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_entity.delete', 'entity_id'=> $entity_id, 'cat_id'=> $cat_id, 
'custom_function_id'=> $entry['id'])),
                                                'lang_up_text'                  
        => lang('shift up'),
                                                'lang_down_text'                
        => lang('shift down'),
                                                'lang_edit_text'                
        => lang('edit the custom_function'),
@@ -1377,7 +1144,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'column_name',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uiadmin_entity.list_custom_function',
+                                                                               
        'extra' => array('menuaction'   => 
'property.uiadmin_entity.list_custom_function',
                                                                                
                                                'entity_id'     => $entity_id,
                                                                                
                                                'cat_id'        => $cat_id,
                                                                                
                                                'allrows'       => 
$this->allrows)
@@ -1387,7 +1154,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'custom_function_sort',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uiadmin_entity.list_custom_function',
+                                                                               
        'extra' => array('menuaction'   => 
'property.uiadmin_entity.list_custom_function',
                                                                                
                                                'entity_id'     =>$entity_id,
                                                                                
                                                'cat_id'        =>$cat_id,
                                                                                
                                                'allrows'       
=>$this->allrows)
@@ -1399,10 +1166,10 @@
                        (
                                '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_entity.edit_custom_function', 'entity_id'=> 
$entity_id, 'cat_id'=> $cat_id)),
+                               'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_entity.edit_custom_function', 'entity_id'=> $entity_id, 
'cat_id'=> $cat_id)),
                                'lang_done'                     => lang('done'),
                                'lang_done_custom_functiontext' => lang('back 
to admin'),
-                               'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin_entity.category', 'entity_id'=> $entity_id)),
+                               'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_entity.category', 'entity_id'=> $entity_id)),
                        );
 
                        if(!$this->allrows)
@@ -1416,7 +1183,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiadmin_entity.list_custom_function',
+                               'menuaction'    => 
'property.uiadmin_entity.list_custom_function',
                                'sort'          => $this->sort,
                                'order'         => $this->order,
                                'query'         => $this->query,
@@ -1454,7 +1221,7 @@
                        $appname        = lang('custom function');
                        $function_msg   = lang('list entity custom function');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_custom_function' => 
$data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
@@ -1464,7 +1231,7 @@
                {
                        if(!$this->acl_add)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=> 2, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=> 2, 'acl_location'=> $this->acl_location));
                        }
 
                        $entity_id      = phpgw::get_var('entity_id', 'int');
@@ -1529,7 +1296,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiadmin_entity.edit_custom_function',
+                               'menuaction'    => 
'property.uiadmin_entity.edit_custom_function',
                                'entity_id'     => $entity_id,
                                'cat_id'        => $cat_id,
                                'id'            => $id
@@ -1552,7 +1319,7 @@
 
                                '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_entity.list_custom_function', 'entity_id'=> 
$entity_id, 'cat_id'=> $cat_id)),
+                               'done_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_entity.list_custom_function', 'entity_id'=> $entity_id, 
'cat_id'=> $cat_id)),
                                'lang_id'                                       
=> lang('Custom function ID'),
                                'lang_entity_type'                              
=> lang('Entity type'),
                                'lang_no_entity_type'                           
=> lang('No entity type'),
@@ -1579,7 +1346,7 @@
 
                        $appname = lang('entity');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_custom_function' => 
$data));
                }
        }

Modified: trunk/property/inc/class.uiadmin_location.inc.php
===================================================================
--- trunk/property/inc/class.uiadmin_location.inc.php   2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/inc/class.uiadmin_location.inc.php   2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -57,12 +57,12 @@
                function property_uiadmin_location()
                {
                        $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
'admin::property::location';
+               //      $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_location',True);
                        $this->bocommon                         = 
CreateObject('property.bocommon');
-                       $this->menu                                     = 
CreateObject('property.menu');
 
                        $this->acl                                      = 
CreateObject('phpgwapi.acl');
                        $this->acl_location                     = 
'.admin.location';
@@ -78,7 +78,6 @@
                        $this->order                            = 
$this->bo->order;
                        $this->allrows                          = 
$this->bo->allrows;
 
-                       $this->menu->sub                        ='adm_loc';
                }
 
                function save_sessiondata()
@@ -97,16 +96,16 @@
                {
                        if(!$this->acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>1, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
                        }
 
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] .= 
'::location';
+
                        $this->bocommon->reset_fm_cache();
                        $GLOBALS['phpgw']->xslttpl->add_file(array(
                                                                
'admin_location',
                                                                'nextmatchs',
-                                                               'menu',
                                                                
'search_field'));
-                       $links = $this->menu->links('loc_type');
 
                        $standard_list = $this->bo->read();
 
@@ -117,10 +116,10 @@
                                        'id'                                    
                => $standard['id'],
                                        'name'                                  
                => $standard['name'],
                                        'first'                                 
                => $standard['descr'],
-                                       'link_categories'                       
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uicategory.index', 'type'=>'location', 'type_id'=> 
$standard['id'])),
-                                       'link_attribute'                        
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin_location.list_attribute', 'type_id'=> 
$standard['id'])),
-                                       'link_edit'                             
                => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin_location.edit' ,'id'=> $standard['id'])),
-                                       'link_delete'                           
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin_location.delete' ,'id'=> $standard['id'])),
+                                       'link_categories'                       
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uicategory.index', 'type'=>'location', 'type_id'=> $standard['id'])),
+                                       'link_attribute'                        
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_location.list_attribute', 'type_id'=> $standard['id'])),
+                                       'link_edit'                             
                => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_location.edit' ,'id'=> $standard['id'])),
+                                       'link_delete'                           
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_location.delete' ,'id'=> $standard['id'])),
                                        'lang_view_standardtext'                
=> lang('view the standard'),
                                        'lang_category_text'                    
=> lang('categories for the location type'),
                                        'lang_attribute_standardtext'   => 
lang('attributes for the location type'),
@@ -148,7 +147,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'id',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uiadmin_location.index')
+                                                                               
        'extra' => array('menuaction'   => 'property.uiadmin_location.index')
                                                                                
)),
                                'lang_id'                       => 
lang('standard id'),
                                'sort_name'                     => 
$this->nextmatchs->show_sort_order(array
@@ -156,7 +155,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'name',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uiadmin_location.index')
+                                                                               
        'extra' => array('menuaction'   => 'property.uiadmin_location.index')
                                                                                
)),
                                'lang_name'                     => lang('Name'),
                        );
@@ -165,26 +164,25 @@
                        (
                                'lang_add'                              => 
lang('add'),
                                'lang_add_standardtext' => lang('add a 
standard'),
-                               'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin_location.edit')),
+                               'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_location.edit')),
                                'lang_done'                             => 
lang('done'),
                                'lang_done_standardtext'=> lang('back to 
admin'),
                                'done_action'                   => 
$GLOBALS['phpgw']->link('/admin/index.php')
                        );
 
-                       $receipt = 
$GLOBALS['phpgw']->session->appsession('receipt',$this->currentapp);
-                       
$GLOBALS['phpgw']->session->appsession('receipt',$this->currentapp,'');
+                       $receipt = 
$GLOBALS['phpgw']->session->appsession('receipt','property');
+                       
$GLOBALS['phpgw']->session->appsession('receipt','property','');
                        $msgbox_data = $this->bocommon->msgbox_data($receipt);
 
                        $data = array
                        (
                                'msgbox_data'                                   
        => $msgbox_data,
-                               'links'                                         
                => $links,
                                'allow_allrows'                                 
        => False,
                                'start_record'                                  
        => $this->start,
                                'record_limit'                                  
        => $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'],
                                'num_records'                                   
        => count($standard_list),
                                'all_records'                                   
        => $this->bo->total_records,
-                               'link_url'                                      
                => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin_location.index')),
+                               'link_url'                                      
                => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_location.index')),
                                'img_path'                                      
                => 
$GLOBALS['phpgw']->common->get_image_path('phpgwapi','default'),
                                'lang_searchfield_standardtext'         => 
lang('Enter the search string. To show all entries, empty this field and press 
the SUBMIT button again'),
                                'lang_searchbutton_standardtext'        => 
lang('Submit the search string'),
@@ -198,7 +196,7 @@
                        $appname                = lang('location');
                        $function_msg           = lang('list location 
standard');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
@@ -208,7 +206,7 @@
                {
                        if(!$this->acl_add)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=> 2, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=> 2, 'acl_location'=> $this->acl_location));
                        }
 
                        $id             = phpgw::get_var('id', 'int');
@@ -255,7 +253,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiadmin_location.edit',
+                               'menuaction'    => 
'property.uiadmin_location.edit',
                                'id'            => $id
                        );
 //_debug_array($values);
@@ -267,7 +265,7 @@
                                'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
                                'lang_name_standardtext'                => 
lang('Enter a name of the standard'),
                                'form_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'done_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin_location.index')),
+                               'done_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_location.index')),
                                'lang_id'                                       
        => lang('standard ID'),
                                'lang_name'                                     
        => lang('Name'),
                                'lang_descr'                                    
=> lang('Descr'),
@@ -292,7 +290,7 @@
 
                        $appname        = lang('location');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -301,7 +299,7 @@
                {
                        if(!$this->acl_delete)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=> 8, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=> 8, 'acl_location'=> $this->acl_location));
                        }
 
                        $attrib         = phpgw::get_var('attrib');
@@ -319,7 +317,7 @@
                        }
                        $link_data = array
                        (
-                               'menuaction' => 
$this->currentapp.'.uiadmin_location.'.$function,
+                               'menuaction' => 
'property.uiadmin_location.'.$function,
                                'type_id' => $type_id
                        );
 
@@ -334,7 +332,7 @@
                        $data = array
                        (
                                'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'                         => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin_location.delete', 'id'=> $id, 'attrib'=> $attrib, 
'type_id'=> $type_id)),
+                               'delete_action'                         => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_location.delete', 'id'=> $id, 'attrib'=> $attrib, 'type_id'=> 
$type_id)),
                                'lang_confirm_msg'                      => 
lang('do you really want to delete this entry'),
                                'lang_yes'                                      
=> lang('yes'),
                                'lang_yes_standardtext'         => lang('Delete 
the entry'),
@@ -345,7 +343,7 @@
                        $appname                = lang('location');
                        $function_msg   = lang('delete location standard');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -355,12 +353,13 @@
                {
                        if(!$this->acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=> 1, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=> 1, 'acl_location'=> $this->acl_location));
                        }
 
                        $type_id        = phpgw::get_var('type_id', 'int');
                        $id     = phpgw::get_var('id', 'int');
                        $resort = phpgw::get_var('resort');
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] .= 
"::location::attribute_loc_{$type_id}";
 
                        $GLOBALS['phpgw']->xslttpl->add_file(array(
                                                                
'admin_location',
@@ -372,22 +371,22 @@
                                
$this->bo->resort_attrib(array('resort'=>$resort,'type_id' => 
$type_id,'id'=>$id));
                        }
 
+                       $type = $this->bo->read_single($type_id);
+                       
                        $attrib_list = $this->bo->read_attrib($type_id);
 
                        while (is_array($attrib_list) && list(,$attrib) = 
each($attrib_list))
                        {
                                $content[] = array
                                (
-               //                      'name'                                  
        => $attrib['name'],
-                                       'type_name'                             
        => $attrib['type_name'],
-                                       'datatype'                              
        => $attrib['datatype'],
+                                       'datatype'                              
        => $attrib['trans_datatype'],
                                        'column_name'                           
=> $attrib['column_name'],
                                        'input_text'                            
=> $attrib['input_text'],
                                        'sorting'                               
        => $attrib['attrib_sort'],
-                                       'link_up'                               
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin_location.list_attribute', 'resort'=> 'up', 'id'=> 
$attrib['id'], 'type_id'=> $type_id, 'allrows'=> $this->allrows)),
-                                       'link_down'                             
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin_location.list_attribute', 'resort'=> 'down', 'id'=> 
$attrib['id'], 'type_id'=> $type_id, 'allrows'=> $this->allrows)),
-                                       'link_edit'                             
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin_location.edit_attrib', 'id'=> $attrib['id'], 
'type_id'=> $type_id)),
-                                       'link_delete'                           
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin_location.delete', 'id'=> $attrib['id'], 'type_id'=> 
$type_id, 'attrib'=>true)),
+                                       'link_up'                               
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_location.list_attribute', 'resort'=> 'up', 'id'=> 
$attrib['id'], 'type_id'=> $type_id, 'allrows'=> $this->allrows)),
+                                       'link_down'                             
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_location.list_attribute', 'resort'=> 'down', 'id'=> 
$attrib['id'], 'type_id'=> $type_id, 'allrows'=> $this->allrows)),
+                                       'link_edit'                             
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_location.edit_attrib', 'id'=> $attrib['id'], 'type_id'=> 
$type_id)),
+                                       'link_delete'                           
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_location.delete', 'id'=> $attrib['id'], 'type_id'=> $type_id, 
'attrib'=>true)),
                                        'lang_view_attribtext'          => 
lang('view the attrib'),
                                        'lang_attribute_attribtext'     => 
lang('attributes for the attrib'). ' ' . lang('location'),
                                        'lang_edit_attribtext'          => 
lang('edit the attrib'),
@@ -404,7 +403,6 @@
 
                        $table_header[] = array
                        (
-                               'lang_type_name'        => lang('Type'),
                                'lang_descr'            => lang('Descr'),
                                'lang_datatype'         => lang('Datatype'),
                                'lang_sorting'          => lang('sorting'),
@@ -415,7 +413,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'attrib_sort',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uiadmin_location.list_attribute',
+                                                                               
        'extra' => array('menuaction'   => 
'property.uiadmin_location.list_attribute',
                                                                                
                                        'type_id'       => $type_id,
                                                                                
                                        'allrows'       => $this->allrows)
                                                                                
)),
@@ -425,7 +423,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'column_name',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uiadmin_location.list_attribute',
+                                                                               
        'extra' => array('menuaction'   => 
'property.uiadmin_location.list_attribute',
                                                                                
                                                'type_id'       =>$type_id,
                                                                                
                                                'allrows'       
=>$this->allrows)
                                                                                
)),
@@ -436,10 +434,10 @@
                        (
                                'lang_add'                              => 
lang('add'),
                                'lang_add_attribtext'   => lang('add an 
attrib'),
-                               'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin_location.edit_attrib', 'type_id'=> $type_id)),
+                               'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_location.edit_attrib', 'type_id'=> $type_id)),
                                'lang_done'                             => 
lang('done'),
                                'lang_done_attribtext'  => lang('back to 
admin'),
-                               'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin_location.index')),
+                               'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_location.index')),
                        );
 
                        if(!$this->allrows)
@@ -453,7 +451,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiadmin_location.list_attribute',
+                               'menuaction'    => 
'property.uiadmin_location.list_attribute',
                                'sort'                  => $this->sort,
                                'order'                 => $this->order,
                                'query'                 => $this->query,
@@ -462,6 +460,8 @@
 
                        $data = array
                        (
+                               'value_type_name'                               
=> $type['name'],
+                               'lang_type'                                     
        => lang('Location type'),
                                'allow_allrows'                                 
=> True,
                                'allrows'                                       
        => $this->allrows,
                                'start_record'                                  
=> $this->start,
@@ -482,7 +482,7 @@
                        $appname        = lang('attribute');
                        $function_msg   = lang('list location attribute');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_attribute' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
@@ -492,12 +492,15 @@
                {
                        if(!$this->acl_add)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=> 2, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=> 2, 'acl_location'=> $this->acl_location));
                        }
 
                        $type_id        = phpgw::get_var('type_id', 'int');
                        $id                     = phpgw::get_var('id', 'int');
                        $values         = phpgw::get_var('values');
+
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] .= 
"::location::attribute_loc_{$type_id}";
+
                        if(!$values)
                        {
                          $values = array();
@@ -589,7 +592,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiadmin_location.edit_attrib',
+                               'menuaction'    => 
'property.uiadmin_location.edit_attrib',
                                'id'            => $id
                        );
 //_debug_array($values);
@@ -616,7 +619,7 @@
 
                                '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_location.list_attribute', 'type_id'=> $type_id)),
+                               'done_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_location.list_attribute', 'type_id'=> $type_id)),
                                'lang_id'                                       
        => lang('Attribute ID'),
                                'lang_location_type'                    => 
lang('Type'),
                                'lang_no_location_type'                 => 
lang('No entity type'),
@@ -676,25 +679,24 @@
 
                        $appname = lang('location');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_attrib' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
 
                function config()
                {
-
                        if(!$this->acl_manage)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=> 16, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=> 16, 'acl_location'=> $this->acl_location));
                        }
 
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] .= 
'::config';
+
                        $GLOBALS['phpgw']->xslttpl->add_file(array(
                                                                
'admin_location',
                                                                'nextmatchs',
-                                                               'menu',
                                                                
'search_field'));
-                       $links = $this->menu->links('loc_config');
 
                        $standard_list = $this->bo->read_config();
 
@@ -704,7 +706,7 @@
                                (
                                        'column_name'                           
=> $standard['column_name'],
                                        'name'                                  
        => $standard['location_name'],
-                                       'link_edit'                             
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin_location.edit_config', 'column_name'=> 
$standard['column_name'])),
+                                       'link_edit'                             
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_location.edit_config', 'column_name'=> 
$standard['column_name'])),
                                        'lang_edit_standardtext'        => 
lang('edit the column relation'),
                                        'text_edit'                             
        => lang('edit')
                                );
@@ -723,7 +725,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'column_name',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uiadmin_location.config')
+                                                                               
        'extra' => array('menuaction'   => 'property.uiadmin_location.config')
                                                                                
)),
                                'lang_column_name'      => lang('column name'),
                                'sort_name'                     => 
$this->nextmatchs->show_sort_order(array
@@ -731,7 +733,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'name',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uiadmin_location.config')
+                                                                               
        'extra' => array('menuaction'   => 'property.uiadmin_location.config')
                                                                                
)),
                                'lang_name'                     => lang('Table 
Name'),
                        );
@@ -740,7 +742,7 @@
                        (
                                'lang_add'                              => 
lang('add'),
                                'lang_add_standardtext' => lang('add a 
standard'),
-                               'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin_location.edit')),
+                               'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_location.edit')),
                                'lang_done'                             => 
lang('done'),
                                'lang_done_standardtext'=> lang('back to 
admin'),
                                'done_action'                   => 
$GLOBALS['phpgw']->link('/admin/index.php')
@@ -749,13 +751,12 @@
 
                        $data = array
                        (
-                               'links'                                         
                => $links,
                                'allow_allrows'                                 
        => False,
                                'start_record'                                  
        => $this->start,
                                'record_limit'                                  
        => $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'],
                                'num_records'                                   
        => count($standard_list),
                                'all_records'                                   
        => $this->bo->total_records,
-                               'link_url'                                      
                => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiadmin_location.index')),
+                               'link_url'                                      
                => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_location.index')),
                                'img_path'                                      
                => 
$GLOBALS['phpgw']->common->get_image_path('phpgwapi','default'),
                                'lang_searchfield_standardtext'         => 
lang('Enter the search string. To show all entries, empty this field and press 
the SUBMIT button again'),
                                'lang_searchbutton_standardtext'        => 
lang('Submit the search string'),
@@ -769,7 +770,7 @@
                        $appname        = lang('location');
                        $function_msg   = lang('list config');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_config' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
@@ -779,9 +780,11 @@
                {
                        if(!$this->acl_manage)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=> 16, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=> 16, 'acl_location'=> $this->acl_location));
                        }
 
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] .= 
'::config';
+
                        $column_name    = phpgw::get_var('column_name');
                        $values                 = phpgw::get_var('values');
 
@@ -798,7 +801,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiadmin_location.edit_config',
+                               'menuaction'    => 
'property.uiadmin_location.edit_config',
                                'column_name'   => $column_name
                        );
 
@@ -809,7 +812,7 @@
                                '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_location.config')),
+                               'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiadmin_location.config')),
 
                                'lang_column_name'                      => 
lang('Column name'),
                                'lang_save'                                     
=> lang('save'),
@@ -829,7 +832,7 @@
                        $appname        = lang('location');
 
 //_debug_array($data);
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_config' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }

Modified: trunk/property/inc/class.uiagreement.inc.php
===================================================================
--- trunk/property/inc/class.uiagreement.inc.php        2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/inc/class.uiagreement.inc.php        2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -48,8 +48,6 @@
                        'view'                  => True,
                        'edit'                  => True,
                        'delete'                => True,
-                       'list_attribute'        => True,
-                       'edit_attrib'           => True,
                        'columns'               => True,
                        'edit_item'             => True,
                        'view_item'             => True,
@@ -61,13 +59,12 @@
                function property_uiagreement()
                {
                        $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->nextmatchs       = 
CreateObject('phpgwapi.nextmatchs');
                        $this->account          = 
$GLOBALS['phpgw_info']['user']['account_id'];
 
                        $this->bo               = 
CreateObject('property.boagreement',True);
                        $this->bocommon         = 
CreateObject('property.bocommon');
-                       $this->menu             = CreateObject('property.menu');
 
                        $this->role             = $this->bo->role;
 
@@ -127,7 +124,7 @@
 
                                
$GLOBALS['phpgw']->preferences->account_id=$this->account;
                                
$GLOBALS['phpgw']->preferences->read_repository();
-                               
$GLOBALS['phpgw']->preferences->add($this->currentapp,'agreement_columns',$values['columns'],'user');
+                               
$GLOBALS['phpgw']->preferences->add('property','agreement_columns',$values['columns'],'user');
                                
$GLOBALS['phpgw']->preferences->save_repository();
 
                                $receipt['message'][] = array('msg' => 
lang('columns is updated'));
@@ -137,7 +134,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiagreement.columns',
+                               'menuaction'    => 
'property.uiagreement.columns',
                                'role'          => $this->role
                        );
 
@@ -168,13 +165,13 @@
 
                        if(!$this->acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>1, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
                        }
 
                        $file_name      = 
urldecode(phpgw::get_var('file_name'));
                        $id             = phpgw::get_var('id', 'int');
 
-                       $file = $this->fakebase. SEP . 'agreement' . SEP . $id 
. SEP . $file_name;
+                       $file = 
"{$this->fakebase}/agreement/{$id}/{$file_name}";
 
                        if($this->bo->vfs->file_exists(array(
                                'string' => $file,
@@ -206,22 +203,18 @@
 
                function index()
                {
-                       $this->menu->sub        = 'agreement';
-
                        if(!$this->acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>1, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
                        }
 
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
'property::agreement::pricebook::agreement';
                        $GLOBALS['phpgw']->xslttpl->add_file(array('agreement',
-                                                                               
'menu',
                                                                                
'receipt',
                                                                                
'search_field',
                                                                                
'nextmatchs',
                                                                                
'filter_member_of'));
 
-                       $links = $this->menu->links('agreement','agreement');
-
                        $receipt = 
$GLOBALS['phpgw']->session->appsession('session_data','agreement_receipt');
                        
$GLOBALS['phpgw']->session->appsession('session_data','agreement_receipt','');
 
@@ -247,19 +240,19 @@
                                        {
                                                
$content[$j]['row'][$i]['statustext']           = lang('view the entity');
                                                $content[$j]['row'][$i]['text'] 
                = lang('view');
-                                               
$content[$j]['row'][$i++]['link']               = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiagreement.view','id'=> $entry['id'], 'role'=> 
$this->role));
+                                               
$content[$j]['row'][$i++]['link']               = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiagreement.view','id'=> $entry['id'], 'role'=> $this->role));
                                        }
                                        if($this->acl_edit)
                                        {
                                                
$content[$j]['row'][$i]['statustext']           = lang('edit the agreement');
                                                $content[$j]['row'][$i]['text'] 
                = lang('edit');
-                                               
$content[$j]['row'][$i++]['link']               = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiagreement.edit','id'=> $entry['id'], 'role'=> 
$this->role));
+                                               
$content[$j]['row'][$i++]['link']               = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiagreement.edit','id'=> $entry['id'], 'role'=> $this->role));
                                        }
                                        if($this->acl_delete)
                                        {
                                                
$content[$j]['row'][$i]['statustext']           = lang('delete the agreement');
                                                $content[$j]['row'][$i]['text'] 
                = lang('delete');
-                                               
$content[$j]['row'][$i++]['link']               = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiagreement.delete', 'agreement_id'=> $entry['id'], 
'role'=> $this->role));
+                                               
$content[$j]['row'][$i++]['link']               = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiagreement.delete', 'agreement_id'=> $entry['id'], 'role'=> 
$this->role));
                                        }
 
                                        $j++;
@@ -282,7 +275,7 @@
                                                                'sort'  => 
$this->sort,
                                                                'var'   => 
$uicols['name'][$i],
                                                                'order' => 
$this->order,
-                                                               'extra' => 
array('menuaction'   => $this->currentapp.'.uiagreement.index',
+                                                               'extra' => 
array('menuaction'   => 'property.uiagreement.index',
                                                                                
                        'query'         => $this->query,
                                                                                
                        'role'          => $this->role,
                                                                                
                        'member_id'     => $this->member_id,
@@ -322,13 +315,13 @@
                                (
                                        'lang_add'              => lang('add'),
                                        'lang_add_statustext'   => lang('add an 
agreement'),
-                                       'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiagreement.edit', 'role'=> $this->role))
+                                       'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiagreement.edit', 'role'=> $this->role))
                                );
                        }
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiagreement.index',
+                               'menuaction'    => 'property.uiagreement.index',
                                'sort'          =>$this->sort,
                                'order'         =>$this->order,
                                'cat_id'        =>$this->cat_id,
@@ -351,13 +344,13 @@
 
                        $link_columns = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiagreement.columns',
+                               'menuaction'    => 
'property.uiagreement.columns',
                                'role'          => $this->role
                        );
 
                        $member_of_data = 
$this->cats->formatted_xslt_list(array('selected' => $this->member_id,'globals' 
=> True,'link_data' =>$link_data));
 
-                       
$GLOBALS['phpgw']->js->validate_file('overlib','overlib',$this->currentapp);
+                       
$GLOBALS['phpgw']->js->validate_file('overlib','overlib','property');
 
                        $data = array
                        (
@@ -365,7 +358,6 @@
                                'link_columns'                                  
=> $GLOBALS['phpgw']->link('/index.php',$link_columns),
                                'lang_columns_help'                             
=> lang('Choose columns'),
                                'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'links'                                         
        => $links,
                                'allow_allrows'                                 
=> True,
                                'allrows'                                       
        => $this->allrows,
                                'start_record'                                  
=> $this->start,
@@ -434,19 +426,19 @@
                                        {
                                                
$content[$j]['row'][$i]['statustext']           = lang('view the entity');
                                                $content[$j]['row'][$i]['text'] 
                = lang('view');
-                                               
$content[$j]['row'][$i++]['link']               = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiagreement.view_item', 'agreement_id'=> 
$entry['agreement_id'], 'id'=> $entry['id']));
+                                               
$content[$j]['row'][$i++]['link']               = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiagreement.view_item', 'agreement_id'=> $entry['agreement_id'], 
'id'=> $entry['id']));
                                        }
                                        if($this->acl_edit && !$edit_item && 
!$view_only)
                                        {
                                                
$content[$j]['row'][$i]['statustext']           = lang('edit the agreement');
                                                $content[$j]['row'][$i]['text'] 
                = lang('edit');
-                                               
$content[$j]['row'][$i++]['link']               = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiagreement.edit_item', 'agreement_id'=> 
$entry['agreement_id'], 'id'=> $entry['id']));
+                                               
$content[$j]['row'][$i++]['link']               = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiagreement.edit_item', 'agreement_id'=> $entry['agreement_id'], 
'id'=> $entry['id']));
                                        }
                                        if($this->acl_delete && !$edit_item && 
!$view_only)
                                        {
                                                
$content[$j]['row'][$i]['statustext']           = lang('delete this item');
                                                $content[$j]['row'][$i]['text'] 
                = lang('delete');
-                                               
$content[$j]['row'][$i++]['link']               = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiagreement.edit','delete_item'=>1, 'agreement_id'=> 
$entry['agreement_id'], 'activity_id'=> $entry['id']));
+                                               
$content[$j]['row'][$i++]['link']               = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiagreement.edit','delete_item'=>1, 'agreement_id'=> 
$entry['agreement_id'], 'activity_id'=> $entry['id']));
                                        }
 
                                        $j++;
@@ -500,7 +492,7 @@
                {
                        if(!$this->acl_add)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>2, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>2, 'acl_location'=> $this->acl_location));
                        }
 
 
@@ -521,12 +513,12 @@
                                        if ($values['save'])
                                        {
                                                
$GLOBALS['phpgw']->session->appsession('session_data','agreement_receipt',$receipt);
-                                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiagreement.edit', 'id'=> $agreement_id));
+                                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uiagreement.edit', 'id'=> $agreement_id));
                                        }
                                }
                                else
                                {
-                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiagreement.edit', 'id'=> $agreement_id));
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uiagreement.edit', 'id'=> $agreement_id));
 
                                }
                        }
@@ -547,7 +539,7 @@
                                }
                        }
 
-                       
$GLOBALS['phpgw']->js->validate_file('core','check',$this->currentapp);
+                       
$GLOBALS['phpgw']->js->validate_file('core','check','property');
 
                        $data = array
                        (
@@ -558,8 +550,8 @@
                                'lang_descr'                            => 
lang('descr'),
                                'value_descr'                           => 
$agreement['descr'],
                                'lang_select_all'                       => 
lang('Select All'),
-                               'img_check'                             => 
$GLOBALS['phpgw']->common->get_image_path($this->currentapp).'/check.png',
-                               'add_action'                            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiagreement.add_activity', 'group_id'=> $group_id, 
'agreement_id'=> $agreement_id)),
+                               'img_check'                             => 
$GLOBALS['phpgw']->common->get_image_path('property').'/check.png',
+                               'add_action'                            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiagreement.add_activity', 'group_id'=> $group_id, 'agreement_id'=> 
$agreement_id)),
                                'agreement_id'                          => 
$agreement_id,
                                'table_header'                          => 
$table_header,
                                'values'                                => 
$content,
@@ -582,7 +574,7 @@
                {
                        if(!$this->acl_add)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>2, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>2, 'acl_location'=> $this->acl_location));
                        }
 
 
@@ -591,7 +583,7 @@
                        $delete_item    = phpgw::get_var('delete_item', 'bool');
                        $activity_id    = phpgw::get_var('activity_id', 'int');
 
-                       $config         = 
CreateObject('phpgwapi.config',$this->currentapp);
+                       $config         = 
CreateObject('phpgwapi.config','property');
                        $boalarm        = CreateObject('property.boalarm');
                        $receipt        = array();
 
@@ -602,7 +594,7 @@
 
                        $values_attribute  = phpgw::get_var('values_attribute');
 
-                       $insert_record_agreement = 
$GLOBALS['phpgw']->session->appsession('insert_record_agreement',$this->currentapp);
+                       $insert_record_agreement = 
$GLOBALS['phpgw']->session->appsession('insert_record_values.agreement','property');
 
 //_debug_array($insert_record_agreement);
                        if(isset($insert_record_agreement) && 
is_array($insert_record_agreement))
@@ -659,7 +651,7 @@
                                        }
 
                                        $values['file_name']=str_replace (' 
','_',$_FILES['file']['name']);
-                                       $to_file = $this->fakebase. SEP . 
'agreement' . SEP . $values['agreement_id'] . SEP . $values['file_name'];
+                                       $to_file = 
"{$this->fakebase}/agreement/{$values['agreement_id']}/{$values['file_name']}";
 
                                        if(!$values['document_name_orig'] && 
$this->bo->vfs->file_exists(array(
                                                        'string' => $to_file,
@@ -697,7 +689,7 @@
                                                if ($values['save'])
                                                {
                                                        
$GLOBALS['phpgw']->session->appsession('session_data','agreement_receipt',$receipt);
-                                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiagreement.index', 'role'=> $this->role));
+                                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uiagreement.index', 'role'=> $this->role));
                                                }
                                        }
                                }
@@ -749,7 +741,7 @@
                                }
                                else if ((!isset($values['save']) || 
!$values['save']) && (!isset($values['apply']) || !$values['apply']) && 
(!isset($values['update']) || !$values['update']))
                                {
-                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiagreement.index', 'role'=> $this->role));
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uiagreement.index', 'role'=> $this->role));
                                }
                        }
 
@@ -784,19 +776,19 @@
                                                {
                                                        
$content[$j]['lang_view_statustext']    = lang('view the entity');
                                                        
$content[$j]['text_view']               = lang('view');
-                                                       
$content[$j]['link_view']               = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiagreement.view_item', 'agreement_id'=> $id, 'id'=> 
$content[$j]['activity_id']));
+                                                       
$content[$j]['link_view']               = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiagreement.view_item', 'agreement_id'=> $id, 'id'=> 
$content[$j]['activity_id']));
                                                }
                                                if($this->acl_edit && 
(!isset($edit_item) || !$edit_item) && (!isset($view_only) || !$view_only))
                                                {
                                                        
$content[$j]['lang_edit_statustext']    = lang('edit the agreement');
                                                        
$content[$j]['text_edit']               = lang('edit');
-                                                       
$content[$j]['link_edit']               = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiagreement.edit_item', 'agreement_id'=> $id, 'id'=> 
$content[$j]['activity_id']));
+                                                       
$content[$j]['link_edit']               = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiagreement.edit_item', 'agreement_id'=> $id, 'id'=> 
$content[$j]['activity_id']));
                                                }
                                                if($this->acl_delete && 
(!isset($edit_item) || !$edit_item) && (!isset($view_only) || !$view_only))
                                                {
                                                        
$content[$j]['lang_delete_statustext']  = lang('delete this item');
                                                        
$content[$j]['text_delete']             = lang('delete');
-                                                       
$content[$j]['link_delete']             = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiagreement.edit', 'delete_item'=>1, 'id'=> $id, 
'activity_id'=> $content[$j]['activity_id']));
+                                                       
$content[$j]['link_delete']             = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiagreement.edit', 'delete_item'=>1, 'id'=> $id, 'activity_id'=> 
$content[$j]['activity_id']));
                                                }
 
                                                $content[$j]['acl_manage']      
                = $this->acl_manage;
@@ -877,7 +869,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiagreement.edit',
+                               'menuaction'    => 'property.uiagreement.edit',
                                'sort'          =>$this->sort,
                                'order'         =>$this->order,
                                'id'            => $id,
@@ -939,13 +931,13 @@
                        (
                                'lang_add'                              => 
lang('add detail'),
                                'lang_add_standardtext' => lang('add an item to 
the details'),
-                               'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiagreement.add_activity', 'agreement_id'=> $id, 
'group_id'=> $agreement['group_id']))
+                               'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiagreement.add_activity', 'agreement_id'=> $id, 'group_id'=> 
$agreement['group_id']))
                        );
 
 
                        $link_file_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiagreement.view_file',
+                               'menuaction'    => 
'property.uiagreement.view_file',
                                'id'            =>$id
                        );
 
@@ -960,7 +952,7 @@
 
                        $link_excel = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiagreement.excel',
+                               'menuaction'    => 'property.uiagreement.excel',
                                'id'            =>$id,
                                'allrows'       =>$this->allrows
                        );
@@ -975,9 +967,9 @@
                                $record_limit   = $this->bo->total_records;
                        }
 
-                       
$GLOBALS['phpgw']->js->validate_file('overlib','overlib',$this->currentapp);
-                       
$GLOBALS['phpgw']->js->validate_file('core','check',$this->currentapp);
-                       
$GLOBALS['phpgw']->js->validate_file('dateformat','dateformat',$this->currentapp);
+                       
$GLOBALS['phpgw']->js->validate_file('overlib','overlib','property');
+                       
$GLOBALS['phpgw']->js->validate_file('core','check','property');
+                       
$GLOBALS['phpgw']->js->validate_file('dateformat','dateformat','property');
 
                        $data = array
                        (
@@ -1064,9 +1056,9 @@
                                'values'                                        
                        => $content,
                                'table_header'                                  
                => $table_header,
                                'table_update'                                  
                => $table_update,
-                               'update_action'                                 
                => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiagreement.edit', 'id'=> $id)),
+                               'update_action'                                 
                => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiagreement.edit', 'id'=> $id)),
                                'lang_select_all'                               
                => lang('Select All'),
-                               'img_check'                                     
                        => 
$GLOBALS['phpgw']->common->get_image_path($this->currentapp).'/check.png',
+                               'img_check'                                     
                        => 
$GLOBALS['phpgw']->common->get_image_path('property').'/check.png',
                                'set_column'                                    
                => $set_column,
 
                                'lang_agreement_group'                          
        => lang('Agreement group'),
@@ -1077,7 +1069,8 @@
                                'status_list'                                   
                => $this->bo->select_status_list('select',$agreement['status']),
                                'status_name'                                   
                => 'values[status]',
                                'lang_no_status'                                
                => lang('Select status'),
-
+                               'textareacols'                                  
                => 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'])
 && $GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'] : 40,
+                               'textarearows'                                  
                => 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'])
 && $GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'] : 6
                        );
 
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('agreement') . ': ' . ($id?lang('edit') . ' ' . 
lang($this->role):lang('add') . ' ' . lang($this->role));
@@ -1098,7 +1091,7 @@
                {
                        if(!$this->acl_add)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>2, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>2, 'acl_location'=> $this->acl_location));
                        }
 
 
@@ -1133,7 +1126,7 @@
                                                if ($values['save'])
                                                {
                                                        
$GLOBALS['phpgw']->session->appsession('session_data','agreement_receipt',$receipt);
-                                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiagreement.edit', 'id'=> $agreement_id));
+                                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uiagreement.edit', 'id'=> $agreement_id));
                                                }
                                        }
                                }
@@ -1156,7 +1149,7 @@
                                }
                                elseif (!$values['save'] && !$values['apply'] 
&& !$values['update']):
                                {
-                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiagreement.edit', 'id'=> $agreement_id));
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uiagreement.edit', 'id'=> $agreement_id));
                                }
                                endif;
                        }
@@ -1166,7 +1159,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiagreement.edit_item',
+                               'menuaction'    => 
'property.uiagreement.edit_item',
                                'agreement_id'  => $agreement_id,
                                'id'            => $id,
                                'role'          => $this->role
@@ -1212,7 +1205,7 @@
                        (
                                'lang_add'                              => 
lang('add detail'),
                                'lang_add_standardtext' => lang('add an item to 
the details'),
-                               'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiagreement.edit_item', 'agreement_id'=> $agreement_id))
+                               'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiagreement.edit_item', 'agreement_id'=> $agreement_id))
                        );
 
                        if($id)
@@ -1242,8 +1235,8 @@
                                'lang_update_statustext'        => lang('update 
selected investments')
                        );
 
-                       
$GLOBALS['phpgw']->js->validate_file('core','check',$this->currentapp);
-                       
$GLOBALS['phpgw']->js->validate_file('dateformat','dateformat',$this->currentapp);
+                       
$GLOBALS['phpgw']->js->validate_file('core','check','property');
+                       
$GLOBALS['phpgw']->js->validate_file('dateformat','dateformat','property');
 
                        $data = array
                        (
@@ -1281,9 +1274,9 @@
                                'table_header'                          => 
$table_header,
                                'acl_manage'                            => 
$this->acl_manage,
                                'table_update'                          => 
$table_update,
-                               'update_action'                         => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiagreement.edit_item', 'agreement_id'=> $agreement_id, 
'id'=> $id)),
+                               'update_action'                         => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiagreement.edit_item', 'agreement_id'=> $agreement_id, 'id'=> $id)),
                                'lang_select_all'                       => 
lang('Select All'),
-                               'img_check'                             => 
$GLOBALS['phpgw']->common->get_image_path($this->currentapp).'/check.png',
+                               'img_check'                             => 
$GLOBALS['phpgw']->common->get_image_path('property').'/check.png',
 
                                'lang_m_cost'                           => 
lang('Material cost'),
                                'lang_m_cost_statustext'                => 
lang('Material cost'),
@@ -1299,8 +1292,9 @@
                                'set_column'                            => 
$set_column,
                                'lang_delete_last'                      => 
lang('delete last index'),
                                'lang_delete_last_statustext'           => 
lang('delete the last index'),
-                               'delete_action'                         => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiagreement.edit_item', 'delete_last'=>1, 'agreement_id'=> 
$agreement_id, 'id'=> $id)),
-
+                               'delete_action'                         => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiagreement.edit_item', 'delete_last'=>1, 'agreement_id'=> 
$agreement_id, 'id'=> $id)),
+                               'textareacols'                          => 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'])
 && $GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'] : 40,
+                               'textarearows'                          => 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'])
 && $GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'] : 6
                        );
 
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('agreement') . ': ' . ($values['id']?lang('edit item') . ' ' . 
$agreement['name']:lang('add item') . ' ' . $agreement['name']);
@@ -1313,7 +1307,7 @@
                {
                        if(!$this->acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>1, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
                        }
 
                        $agreement_id   = phpgw::get_var('agreement_id', 'int');
@@ -1326,7 +1320,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiagreement.edit',
+                               'menuaction'    => 'property.uiagreement.edit',
                                'id'            => $agreement_id
                        );
 
@@ -1350,7 +1344,7 @@
                        $content        = $list['content'];
                        $table_header=$list['table_header'];
 
-                       
$GLOBALS['phpgw']->js->validate_file('core','check',$this->currentapp);
+                       
$GLOBALS['phpgw']->js->validate_file('core','check','property');
 
                        $data = array
                        (
@@ -1385,6 +1379,8 @@
                                'lang_total_cost'                       => 
lang('Total cost'),
                                'value_total_cost'                      => 
$values['total_cost'],
                                'set_column'                            => 
$set_column,
+                               'textareacols'                          => 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'])
 && $GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'] : 40,
+                               'textarearows'                          => 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'])
 && $GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'] : 6
                        );
 
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('agreement') . ': ' . lang('view item') . ' ' . $agreement['name'];
@@ -1398,33 +1394,22 @@
                {
                        if(!$this->acl_delete)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>8, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>8, 'acl_location'=> $this->acl_location));
                        }
 
-                       $attrib         = phpgw::get_var('attrib');
-                       $id             = phpgw::get_var('id', 'int');
                        $agreement_id   = phpgw::get_var('agreement_id', 'int');
                        $delete         = phpgw::get_var('delete', 'bool', 
'POST');
                        $confirm        = phpgw::get_var('confirm', 'bool', 
'POST');
 
-
-                       if($attrib)
-                       {
-                               $function='list_attribute';
-                       }
-                       else
-                       {
-                               $function='index';
-                       }
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiagreement.'.$function,
+                               'menuaction'    => 'property.uiagreement.index',
                                'role'          => $this->role
                        );
 
                        if (phpgw::get_var('confirm', 'bool', 'POST'))
                        {
-                               $this->bo->delete($agreement_id,$id,$attrib);
+                               $this->bo->delete($agreement_id);
                                
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
                        }
 
@@ -1433,7 +1418,7 @@
                        $data = array
                        (
                                'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiagreement.delete', 'agreement_id'=> $agreement_id, 'id'=> 
$id, 'attrib'=> $attrib, 'role'=> $this->role)),
+                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiagreement.delete', 'agreement_id'=> $agreement_id, 'role'=> 
$this->role)),
                                'lang_confirm_msg'              => lang('do you 
really want to delete this entry'),
                                'lang_yes'                      => lang('yes'),
                                'lang_yes_statustext'           => lang('Delete 
the entry'),
@@ -1444,7 +1429,7 @@
                        $appname                = lang('agreement');
                        $function_msg           = lang('delete') . ' ' . 
lang($this->role);
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -1453,11 +1438,11 @@
                {
                        if(!$this->acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>1, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
                        }
 
                        $agreement_id   = phpgw::get_var('id', 'int');
-                       $config         = 
CreateObject('phpgwapi.config',$this->currentapp);
+                       $config         = 
CreateObject('phpgwapi.config','property');
 
                        
$GLOBALS['phpgw']->xslttpl->add_file(array('agreement','nextmatchs','attributes_view'));
 
@@ -1479,7 +1464,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiagreement.index',
+                               'menuaction'    => 'property.uiagreement.index',
                                'agreement_id'  => $agreement_id,
                        );
 
@@ -1514,7 +1499,7 @@
 
                        $link_file_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiagreement.view_file',
+                               'menuaction'    => 
'property.uiagreement.view_file',
                                'id'            =>$agreement_id
                        );
 
@@ -1540,7 +1525,7 @@
 
                        $link_data2 = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiagreement.view',
+                               'menuaction'    => 'property.uiagreement.view',
                                'id'            => $agreement_id,
                        );
 
@@ -1605,6 +1590,8 @@
 
                                'lang_status'                                   
=> lang('Status'),
                                'status_list'                                   
=> $this->bo->select_status_list('select',$agreement['status']),
+                               'textareacols'                                  
=> 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'])
 && $GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'] : 40,
+                               'textarearows'                                  
=> 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'])
 && $GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'] : 6
                        );
 
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('agreement') . ': ' . lang('view');
@@ -1612,332 +1599,5 @@
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
-
-
-               function list_attribute()
-               {
-                       if(!$this->acl_manage)
-                       {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>16, 'acl_location'=> 
$this->acl_location));
-                       }
-
-                       $id     = phpgw::get_var('id', 'int');
-                       $resort = phpgw::get_var('resort');
-
-                       $GLOBALS['phpgw']->xslttpl->add_file(array(
-                                                               'agreement',
-                                                               'nextmatchs',
-                                                               
'search_field'));
-
-                       if($resort)
-                       {
-                               
$this->bo->resort_attrib(array('resort'=>$resort,'id'=>$id));
-                       }
-
-                       $attrib_list = $this->bo->read_attrib();
-
-                       while (is_array($attrib_list) && list(,$attrib) = 
each($attrib_list))
-                       {
-                               $content[] = array
-                               (
-                                       'name'                                  
=> $attrib['name'],
-                                       'type_name'                             
=> $attrib['type_name'],
-                                       'datatype'                              
=> $attrib['datatype'],
-                                       'column_name'                           
=> $attrib['column_name'],
-                                       'input_text'                            
=> $attrib['input_text'],
-                                       'sorting'                               
=> $attrib['attrib_sort'],
-                                       'search'                                
=> $attrib['search'],
-                                       'link_up'                               
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiagreement.list_attribute', 'resort'=>'up', 'id'=> 
$attrib['id'], 'allrows'=> $this->allrows, 'role'=> $this->role)),
-                                       'link_down'                             
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiagreement.list_attribute', 'resort'=> 'down', 'id'=> 
$attrib['id'], 'allrows'=> $this->allrows, 'role'=> $this->role)),
-                                       'link_edit'                             
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiagreement.edit_attrib', 'id'=> $attrib['id'], 
'role'=>$this->role)),
-                                       'link_delete'                           
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiagreement.delete', 'id'=> $attrib['id'], 'attrib'=> true, 
'role'=> $this->role)),
-                                       'lang_view_attribtext'                  
=> lang('view the attrib'),
-                                       'lang_attribute_attribtext'             
=> lang('attributes for the attrib'). ' ' . lang('location'),
-                                       'lang_edit_attribtext'                  
=> lang('edit the attrib'),
-                                       'lang_delete_attribtext'                
=> lang('delete the attrib'),
-                                       'text_attribute'                        
=> lang('Attributes'),
-                                       'text_up'                               
=> lang('up'),
-                                       'text_down'                             
=> lang('down'),
-                                       'text_edit'                             
=> lang('edit'),
-                                       'text_delete'                           
=> lang('delete')
-                               );
-                       }
-
-       //html_print_r($content);
-
-                       $table_header[] = array
-                       (
-                               'lang_descr'            => lang('Descr'),
-                               'lang_datatype'         => lang('Datatype'),
-                               'lang_sorting'          => lang('sorting'),
-                               'lang_search'           => lang('search'),
-                               'lang_edit'                     => lang('edit'),
-                               'lang_delete'           => lang('delete'),
-                               'sort_sorting'  => 
$this->nextmatchs->show_sort_order(array
-                                                                               
(
-                                                                               
        'sort'  => $this->sort,
-                                                                               
        'var'   => 'attrib_sort',
-                                                                               
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uiagreement.list_attribute',
-                                                                               
                                                'allrows'=> $this->allrows,
-                                                                               
                                                'role'  => $this->role)
-                                                                               
)),
-
-                               'sort_name'     => 
$this->nextmatchs->show_sort_order(array
-                                                                               
(
-                                                                               
        'sort'  => $this->sort,
-                                                                               
        'var'   => 'column_name',
-                                                                               
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uiagreement.list_attribute',
-                                                                               
                                                'allrows'=> $this->allrows,
-                                                                               
                                                'role'  => $this->role)
-                                                                               
)),
-                               'lang_name'     => lang('Name'),
-                       );
-
-                       $table_add[] = array
-                       (
-                               'lang_add'                              => 
lang('add'),
-                               'lang_add_attribtext'   => lang('add an 
attrib'),
-                               'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiagreement.edit_attrib', 'role'=> $this->role)),
-                               'lang_done'                             => 
lang('done'),
-                               'lang_done_attribtext'  => 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.'.uiagreement.list_attribute',
-                               'sort'          =>$this->sort,
-                               'order'         =>$this->order,
-                               'query'         =>$this->query,
-                               'role'          => $this->role
-
-                       );
-
-                       $data = array
-                       (
-                               'allow_allrows'                         => True,
-                               'allrows'                               => 
$this->allrows,
-                               'start_record'                          => 
$this->start,
-                               'record_limit'                          => 
$record_limit,
-                               'num_records'                           => 
count($attrib_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_attribtext'           => 
lang('Enter the search string. To show all entries, empty this field and press 
the SUBMIT button again'),
-                               'lang_searchbutton_attribtext'          => 
lang('Submit the search string'),
-                               'query'                                 => 
$this->query,
-                               'lang_search'                           => 
lang('search'),
-                               'table_header_attrib'                   => 
$table_header,
-                               'values_attrib'                         => 
$content,
-                               'table_add2'                            => 
$table_add
-                       );
-
-                       $appname        = lang('agreement');
-                       $function_msg   = lang('list attribute') . ': ' . 
lang($this->role);
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
-                       //$this->save_sessiondata();
-                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_attribute' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
-               }
-
-               function edit_attrib()
-               {
-                       if(!$this->acl_manage)
-                       {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>16, 'acl_location'=> 
$this->acl_location));
-                       }
-
-                       $id                     = phpgw::get_var('id', 'int');
-                       $values         = phpgw::get_var('values');
-       //              $GLOBALS['phpgw']->common->msgbox(lang('Altering 
ColumnName OR Datatype  - deletes your data in this Column'));
-       //html_print_r($values);
-                       
$GLOBALS['phpgw']->xslttpl->add_file(array('agreement','choice',));
-
-                       if ($values['save'])
-                       {
-                               if($id)
-                               {
-                                       $values['id']=$id;
-                                       $action='edit';
-                               }
-                               $type_id                        = 
$values['type_id'];
-
-                               if (!$values['column_name'])
-                               {
-                                       $receipt['error'][] = 
array('msg'=>lang('Column name not entered!'));
-                               }
-
-                               if (!$values['input_text'])
-                               {
-                                       $receipt['error'][] = 
array('msg'=>lang('Input text not entered!'));
-                               }
-                               if (!$values['statustext'])
-                               {
-                                       $receipt['error'][] = 
array('msg'=>lang('Statustext not entered!'));
-                               }
-
-                               if (!$values['column_info']['type'])
-                               {
-                                       $receipt['error'][] = 
array('msg'=>lang('Datatype type not chosen!'));
-                               }
-
-                               
if(!ctype_digit($values['column_info']['precision']) && 
$values['column_info']['precision'])
-                               {
-                                       
$receipt['error'][]=array('msg'=>lang('Please enter precision as integer !'));
-                                       
unset($values['column_info']['precision']);
-                               }
-
-                               
if(!ctype_digit($values['column_info']['scale']) && 
$values['column_info']['scale'])
-                               {
-                                       
$receipt['error'][]=array('msg'=>lang('Please enter scale as integer !'));
-                                       unset($values['column_info']['scale']);
-                               }
-
-                               if (!$values['column_info']['nullable'])
-                               {
-                                       $receipt['error'][] = 
array('msg'=>lang('Nullable not chosen!'));
-                               }
-
-
-                               if (!$receipt['error'])
-                               {
-                                       $receipt = 
$this->bo->save_attrib($values,$action);
-
-                                       if(!$id)
-                                       {
-                                               $id=$receipt['id'];
-                                       }
-                               }
-                               else
-                               {
-                                       $receipt['error'][] = array('msg'       
=> lang('Attribute has NOT been saved'));
-                               }
-
-                       }
-
-                       if ($id)
-                       {
-                               $values = $this->bo->read_single_attrib($id);
-                               $function_msg = lang('edit attribute') . ': ' . 
lang($this->role);
-                               $action='edit';
-                       }
-                       else
-                       {
-                               $function_msg = lang('add attribute') . ': ' . 
lang($this->role);
-                               $action='add';
-                       }
-
-                       $link_data = array
-                       (
-                               'menuaction'    => 
$this->currentapp.'.uiagreement.edit_attrib',
-                               'id'            => $id,
-                               'role'          => $this->role
-
-                       );
-       //html_print_r($values);
-
-                       if(is_array($values['column_info']))
-                       {
-                               if($values['column_info']['type']=='R' || 
$values['column_info']['type']=='CH' || $values['column_info']['type']=='LB')
-                               {
-                                       $multiple_choice= True;
-                               }
-                               
-                               $column_type = $values['column_info']['type'];
-                               $column_precision 
=$values['column_info']['precision'];
-                               $column_scale =$values['column_info']['scale'];
-                               $column_default 
=$values['column_info']['default'];
-                               $column_nullable 
=$values['column_info']['nullable'];
-                       }
-
-                       $msgbox_data = $this->bocommon->msgbox_data($receipt);
-
-                       $data = array
-                       (
-                               'lang_choice'                           => 
lang('Choice'),
-                               'lang_new_value'                        => 
lang('New value'),
-                               'lang_new_value_statustext'             => 
lang('New value for multiple choice'),
-                               'multiple_choice'                       => 
$multiple_choice,
-                               'value_choice'                          => 
$values['choice'],
-                               'lang_delete_value'                     => 
lang('Delete value'),
-                               'lang_value'                            => 
lang('value'),
-                               'lang_delete_choice_statustext'         => 
lang('Delete this value from the list of multiple choice'),
-                               '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.'.uiagreement.list_attribute', 'type_id'=> $type_id, 'role'=> 
$this->role)),
-                               'lang_id'                               => 
lang('Attribute ID'),
-                               'lang_save'                             => 
lang('save'),
-                               'lang_done'                             => 
lang('done'),
-                               'value_id'                              => $id,
-
-                               'lang_column_name'                      => 
lang('Column name'),
-                               'value_column_name'                     => 
$values['column_name'],
-                               'lang_column_name_statustext'           => 
lang('enter the name for the column'),
-
-                               'lang_input_text'                       => 
lang('input text'),
-                               'value_input_text'                      => 
$values['input_text'],
-                               'lang_input_name_statustext'            => 
lang('enter the input text for records'),
-
-                               'lang_id_attribtext'                    => 
lang('Enter the attribute ID'),
-                               'lang_entity_statustext'                => 
lang('Select a agreement type'),
-
-                               'lang_statustext'                       => 
lang('Statustext'),
-                               'lang_statustext_attribtext'            => 
lang('Enter a statustext for the inputfield in forms'),
-                               'value_statustext'                      => 
$values['statustext'],
-
-                               'lang_done_attribtext'                  => 
lang('Back to the list'),
-                               'lang_save_attribtext'                  => 
lang('Save the attribute'),
-
-                               'lang_datatype'                         => 
lang('Datatype'),
-                               'lang_datatype_statustext'              => 
lang('Select a datatype'),
-                               'lang_no_datatype'                      => 
lang('No datatype'),
-                               'datatype_list'                         => 
$this->bocommon->select_datatype($column_type),
-
-                               'lang_precision'                        => 
lang('Precision'),
-                               'lang_precision_statustext'             => 
lang('enter the record length'),
-                               'value_precision'                       => 
$column_precision,
-
-                               'lang_scale'                            => 
lang('scale'),
-                               'lang_scale_statustext'                 => 
lang('enter the scale if type is decimal'),
-                               'value_scale'                           => 
$column_scale,
-
-                               'lang_default'                          => 
lang('default'),
-                               'lang_default_statustext'               => 
lang('enter the default value'),
-                               'value_default'                         => 
$column_default,
-
-                               'lang_nullable'                         => 
lang('Nullable'),
-                               'lang_nullable_statustext'              => 
lang('Chose if this column is nullable'),
-                               'lang_select_nullable'                  => 
lang('Select nullable'),
-                               'nullable_list'                         => 
$this->bocommon->select_nullable($column_nullable),
-
-                               'value_list'                            => 
$values['list'],
-                               'lang_list'                                     
=> lang('show in list'),
-                               'lang_list_statustext'                  => 
lang('check to show this attribute in location list'),
-
-                               'value_search'                          => 
$values['search'],
-                               'lang_include_search'                   => 
lang('Include in search'),
-                               'lang_include_search_statustext'        => 
lang('check to show this attribute in location list'),
-
-
-                       );
-       //html_print_r($data);
-
-                       $appname        = lang('agreement');
-
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
-                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_attrib' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
-               }
        }
 ?>

Modified: trunk/property/inc/class.uialarm.inc.php
===================================================================
--- trunk/property/inc/class.uialarm.inc.php    2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.uialarm.inc.php    2008-02-02 13:52:39 UTC (rev 
18466)
@@ -54,14 +54,15 @@
                function property_uialarm()
                {
                        $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
'admin::property::admin_async';
+
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->nextmatchs       = 
CreateObject('phpgwapi.nextmatchs');
                        $this->account          = 
$GLOBALS['phpgw_info']['user']['account_id'];
 
                        $this->bo               = 
CreateObject('property.boalarm',True);
                        $this->boasync          = 
CreateObject('property.boasync');
                        $this->bocommon         = 
CreateObject('property.bocommon');
-                       $this->menu             = CreateObject('property.menu');
 
                        $this->start            = $this->bo->start;
                        $this->query            = $this->bo->query;
@@ -90,13 +91,10 @@
                function index()
                {
                        $GLOBALS['phpgw']->xslttpl->add_file(array('alarm',
-                                                                               
'menu',
                                                                                
'receipt',
                                                                                
'search_field',
                                                                                
'nextmatchs'));
 
-                       $links = $this->menu->links();
-
                        $receipt = 
$GLOBALS['phpgw']->session->appsession('session_data','alarm_receipt');
                        
$GLOBALS['phpgw']->session->appsession('session_data','alarm_receipt','');
                        $values         = phpgw::get_var('values');
@@ -142,7 +140,7 @@
 
                                if (substr($alarm['id'],0,8)=='fm_async')
                                {
-                                       $link_edit                      = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uialarm.edit', 'async_id'=> urlencode($alarm['id'])));
+                                       $link_edit                      = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uialarm.edit', 'async_id'=> urlencode($alarm['id'])));
                                        $lang_edit_statustext           = 
lang('edit the alarm');
                                        $text_edit                      = 
lang('edit');
                                }
@@ -184,7 +182,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'account_lid',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => $this->currentapp.'.uialarm.index',
+                                                                               
        'extra' => array('menuaction'   => 'property.uialarm.index',
                                                                                
                                                        'cat_id'        => 
$this->cat_id,
                                                                                
                                                        'query'         => 
$this->query,
                                                                                
                                                        'allrows'       => 
$this->allrows)
@@ -194,7 +192,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'method',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => $this->currentapp.'.uialarm.index',
+                                                                               
        'extra' => array('menuaction'   => 'property.uialarm.index',
                                                                                
                                                        'cat_id'        => 
$this->cat_id,
                                                                                
                                                        'query'         => 
$this->query,
                                                                                
                                                        'allrows'       => 
$this->allrows)
@@ -204,7 +202,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'next',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => $this->currentapp.'.uialarm.index',
+                                                                               
        'extra' => array('menuaction'   => 'property.uialarm.index',
                                                                                
                                                        'cat_id'        => 
$this->cat_id,
                                                                                
                                                        'query'         => 
$this->query,
                                                                                
                                                        'allrows'       => 
$this->allrows)
@@ -214,7 +212,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'id',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => $this->currentapp.'.uialarm.index',
+                                                                               
        'extra' => array('menuaction'   => 'property.uialarm.index',
                                                                                
                                                        'cat_id'        => 
$this->cat_id,
                                                                                
                                                        'query'         => 
$this->query,
                                                                                
                                                        'allrows'       => 
$this->allrows)
@@ -233,12 +231,12 @@
                        (
                                'lang_add'              => lang('add'),
                                'lang_add_statustext'   => lang('add an alarm'),
-                               'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uialarm.edit'))
+                               'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uialarm.edit'))
                        );
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uialarm.index',
+                               'menuaction'    => 'property.uialarm.index',
                                'sort'          =>$this->sort,
                                'order'         =>$this->order,
                                'cat_id'        =>$this->cat_id,
@@ -260,7 +258,6 @@
                        $data = array
                        (
                                'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'links'                                         
=> $links,
                                'allow_allrows'                                 
=> true,
                                'allrows'                                       
=> $this->allrows,
                                'start_record'                                  
=> $this->start,
@@ -296,15 +293,12 @@
 
                function list_alarm()
                {
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
'property::agreement::alarm';
                        $GLOBALS['phpgw']->xslttpl->add_file(array('alarm',
-                                                                               
'menu',
                                                                                
'receipt',
                                                                                
'search_field',
                                                                                
'nextmatchs'));
 
-                       $this->menu->sub = 'agreement';
-                       $links = $this->menu->links('alarm');
-
                        $receipt = 
$GLOBALS['phpgw']->session->appsession('session_data','alarm_receipt');
                        
$GLOBALS['phpgw']->session->appsession('session_data','alarm_receipt','');
                        $values         = phpgw::get_var('values');
@@ -357,7 +351,7 @@
                                
                                if($id[0] == 's_agreement' || $id[0] == 
'agreement')
                                {
-                                       $link_edit                      = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.ui' .$id[0] .'.edit', 'id'=> $id[1]));
+                                       $link_edit                      = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 'property.ui' .$id[0] 
.'.edit', 'id'=> $id[1]));
                                        $lang_edit_statustext           = 
lang('edit the alarm');
                                        $text_edit                      = 
lang('edit');
 
@@ -400,7 +394,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'account_lid',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uialarm.list_alarm',
+                                                                               
        'extra' => array('menuaction'   => 'property.uialarm.list_alarm',
                                                                                
                                                        'cat_id'        => 
$this->cat_id,
                                                                                
                                                        'query'         => 
$this->query,
                                                                                
                                                        'allrows'       => 
$this->allrows)
@@ -410,7 +404,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'method',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uialarm.list_alarm',
+                                                                               
        'extra' => array('menuaction'   => 'property.uialarm.list_alarm',
                                                                                
                                                        'cat_id'        => 
$this->cat_id,
                                                                                
                                                        'query'         => 
$this->query,
                                                                                
                                                        'allrows'       => 
$this->allrows)
@@ -420,7 +414,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'next',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uialarm.list_alarm',
+                                                                               
        'extra' => array('menuaction'   => 'property.uialarm.list_alarm',
                                                                                
                                                        'cat_id'        => 
$this->cat_id,
                                                                                
                                                        'query'         => 
$this->query,
                                                                                
                                                        'allrows'       => 
$this->allrows)
@@ -430,7 +424,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'id',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uialarm.list_alarm',
+                                                                               
        'extra' => array('menuaction'   => 'property.uialarm.list_alarm',
                                                                                
                                                        'cat_id'        => 
$this->cat_id,
                                                                                
                                                        'query'         => 
$this->query,
                                                                                
                                                        'allrows'       => 
$this->allrows)
@@ -449,12 +443,12 @@
                        (
                                'lang_add'              => lang('add'),
                                'lang_add_statustext'   => lang('add an alarm'),
-                               'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uialarm.edit'))
+                               'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uialarm.edit'))
                        );
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uialarm.list_alarm',
+                               'menuaction'    => 
'property.uialarm.list_alarm',
                                'sort'          =>$this->sort,
                                'order'         =>$this->order,
                                'cat_id'        =>$this->cat_id,
@@ -476,7 +470,6 @@
                        $data = array
                        (
                                'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'links'                                         
=> $links,
                                'allow_allrows'                                 
=> true,
                                'allrows'                                       
=> $this->allrows,
                                'start_record'                                  
=> $this->start,
@@ -565,14 +558,14 @@
                                        if ($values['save'])
                                        {
                                                
$GLOBALS['phpgw']->session->appsession('session_data','alarm_receipt',$receipt);
-                                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uialarm.index'));
+                                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uialarm.index'));
                                        }
                                }
                        }
 
                        if ($values['cancel'])
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uialarm.index'));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uialarm.index'));
                        }
 
                        if ($async_id)
@@ -583,7 +576,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uialarm.edit',
+                               'menuaction'    => 'property.uialarm.edit',
                                'async_id'      => $async_id
                        );
 
@@ -642,7 +635,7 @@
 
                        $link_data = array
                        (
-                               'menuaction' => 
$this->currentapp.'.uiowner.index'
+                               'menuaction' => 'property.uiowner.index'
                        );
 
                        if (phpgw::get_var('confirm', 'bool', 'POST'))
@@ -656,7 +649,7 @@
                        $data = array
                        (
                                'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiowner.delete', 'owner_id'=> $owner_id)),
+                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiowner.delete', 'owner_id'=> $owner_id)),
                                'lang_confirm_msg'              => lang('do you 
really want to delete this entry'),
                                'lang_yes'                      => lang('yes'),
                                'lang_yes_statustext'           => lang('Delete 
the entry'),
@@ -667,7 +660,7 @@
                        $appname        = lang('owner');
                        $function_msg   = lang('delete owner');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -686,7 +679,7 @@
 
                        $data = array
                        (
-                               'done_action'           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiowner.index')),
+                               'done_action'           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiowner.index')),
                                'lang_name'             => lang('name'),
                                'lang_category'         => lang('category'),
                                'lang_time_created'     => lang('time created'),

Modified: trunk/property/inc/class.uiasync.inc.php
===================================================================
--- trunk/property/inc/class.uiasync.inc.php    2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.uiasync.inc.php    2008-02-02 13:52:39 UTC (rev 
18466)
@@ -53,7 +53,9 @@
                function property_uiasync()
                {
                        $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
'admin::property::async';
+
+               //      $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->nextmatchs                       = 
CreateObject('phpgwapi.nextmatchs');
                        $this->account                          = 
$GLOBALS['phpgw_info']['user']['account_id'];
                        $this->bo                               = 
CreateObject('property.boasync',True);
@@ -75,7 +77,7 @@
 
                        if(!$this->acl_manage)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>16, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>16, 'acl_location'=> $this->acl_location));
                        }
 
                }
@@ -120,9 +122,9 @@
                                        'first'                                 
=> $method['descr'],
                                        'data'                                  
=> @implode (',',$method_data),
                                        'link_run'                              
=> $GLOBALS['phpgw']->link('/index.php',$run_link_data),
-                                       'link_schedule'                         
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uialarm.edit', 'method_id'=> $method['id'])),
-                                       'link_edit'                             
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiasync.edit', 'id'=> $method['id'])),
-                                       'link_delete'                           
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiasync.delete', 'id'=> $method['id'])),
+                                       'link_schedule'                         
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uialarm.edit', 'method_id'=> $method['id'])),
+                                       'link_edit'                             
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiasync.edit', 'id'=> $method['id'])),
+                                       'link_delete'                           
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiasync.delete', 'id'=> $method['id'])),
                                        'lang_schedule_statustext'              
=> lang('schedule the method'),
                                        'lang_run_statustext'                   
=> lang('Run the method now'),
                                        'lang_view_statustext'                  
=> lang('view the method'),
@@ -152,7 +154,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'id',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => $this->currentapp.'.uiasync.index')
+                                                                               
        'extra' => array('menuaction'   => 'property.uiasync.index')
                                                                                
)),
                                'lang_id'               => lang('method id'),
                                'sort_name'             => 
$this->nextmatchs->show_sort_order(array
@@ -160,7 +162,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'name',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => $this->currentapp.'.uiasync.index')
+                                                                               
        'extra' => array('menuaction'   => 'property.uiasync.index')
                                                                                
)),
                                'lang_name'             => lang('Name'),
                        );
@@ -169,7 +171,7 @@
                        (
                                'lang_add'              => lang('add'),
                                'lang_add_statustext'   => lang('add a method'),
-                               'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiasync.edit')),
+                               'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiasync.edit')),
                                'lang_done'             => lang('done'),
                                'lang_done_statustext'  => lang('back to 
admin'),
                                'done_action'           => 
$GLOBALS['phpgw']->link('/admin/index.php')
@@ -183,7 +185,7 @@
                                'record_limit'                          => 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'],
                                'num_records'                           => 
count($method_list),
                                'all_records'                           => 
$this->bo->total_records,
-                               'link_url'                              => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiasync.index')),
+                               'link_url'                              => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiasync.index')),
                                'img_path'                              => 
$GLOBALS['phpgw']->common->get_image_path('phpgwapi','default'),
                                'lang_searchfield_statustext'           => 
lang('Enter the search string. To show all entries, empty this field and press 
the SUBMIT button again'),
                                'lang_searchbutton_statustext'          => 
lang('Submit the search string'),
@@ -197,7 +199,7 @@
                        $appname        = lang('method');
                        $function_msg   = lang('list async method');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
@@ -267,7 +269,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiasync.edit',
+                               'menuaction'    => 'property.uiasync.edit',
                                'id'            => $id
                        );
 
@@ -277,7 +279,7 @@
                        (
                                '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.'.uiasync.index')),
+                               'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiasync.index')),
                                'lang_id'                               => 
lang('method ID'),
                                'lang_name'                             => 
lang('Name'),
                                'lang_descr'                            => 
lang('Descr'),
@@ -299,7 +301,7 @@
 
                        $appname        = lang('async method');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -311,7 +313,7 @@
 
                        $link_data = array
                        (
-                               'menuaction' => 
$this->currentapp.'.uiasync.index'
+                               'menuaction' => 'property.uiasync.index'
                        );
 
                        if (phpgw::get_var('confirm', 'bool', 'POST'))
@@ -325,7 +327,7 @@
                        $data = array
                        (
                                'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiasync.delete', 'id'=> $id)),
+                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiasync.delete', 'id'=> $id)),
                                'lang_confirm_msg'              => lang('do you 
really want to delete this entry'),
                                'lang_yes'                      => lang('yes'),
                                'lang_yes_statustext'           => lang('Delete 
the entry'),
@@ -336,7 +338,7 @@
                        $appname                = lang('async method');
                        $function_msg           = lang('delete async method');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }

Modified: trunk/property/inc/class.uib_account.inc.php
===================================================================
--- trunk/property/inc/class.uib_account.inc.php        2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/inc/class.uib_account.inc.php        2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -52,16 +52,15 @@
                function property_uib_account()
                {
                        $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
'property::invoice::budget';
+
+               //      $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->nextmatchs               = 
CreateObject('phpgwapi.nextmatchs');
                        $this->account                  = 
$GLOBALS['phpgw_info']['user']['account_id'];
 
                        $this->bo                       = 
CreateObject('property.bob_account',true);
                        $this->bocommon                 = 
CreateObject('property.bocommon');
 
-                       $this->menu                     = 
CreateObject('property.menu');
-                       $this->menu->sub                ='invoice';
-
                        $this->acl                      = 
CreateObject('phpgwapi.acl');
                        $this->acl_location             = '.b_account';
                        $this->acl_read                 = 
$this->acl->check('.b_account',1);
@@ -93,26 +92,23 @@
                {
                        if(!$this->acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>1, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
                        }
 
-                       
$GLOBALS['phpgw']->xslttpl->add_file(array('b_account','nextmatchs','menu',
-                                                                               
'search_field'));
+                       $GLOBALS['phpgw']->xslttpl->add_file(array('b_account', 
'nextmatchs', 'search_field'));
 
-                       $links = $this->menu->links('b_account');
-
                        $b_account_list = $this->bo->read($type);
 
                        while (is_array($b_account_list) && list(,$b_account) = 
each($b_account_list))
                        {
                                if($this->acl_edit)
                                {
-                                       $link_edit      = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uib_account.edit', 'id'=> $b_account['id']));
+                                       $link_edit      = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uib_account.edit', 'id'=> $b_account['id']));
                                }
 
                                if($this->acl_delete)
                                {
-                                       $link_delete    = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uib_account.delete', 'id'=> $b_account['id']));
+                                       $link_delete    = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uib_account.delete', 'id'=> $b_account['id']));
                                }
 
                                $content[] = array
@@ -143,7 +139,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'id',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction' => $this->currentapp.'.uib_account.index')
+                                                                               
        'extra' => array('menuaction' => 'property.uib_account.index')
                                                                                
)),
                                'lang_id'       => lang('budget account'),
                        );
@@ -152,7 +148,7 @@
                        (
                                'lang_add'                      => lang('add'),
                                'lang_add_b_accounttext'        => lang('add a 
budget account'),
-                               'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uib_account.edit')),
+                               'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uib_account.edit')),
                                'lang_done'                     => lang('done'),
                                'lang_done_b_accounttext'       => lang('back 
to admin'),
                                'done_action'                   => 
$GLOBALS['phpgw']->link('/admin/index.php')
@@ -170,14 +166,13 @@
 
                        $data = array
                        (
-                               'links'                                 => 
$links,
                                'allow_allrows'                         => True,
                                'allrows'                               => 
$this->allrows,
                                'start_record'                          => 
$this->start,
                                'record_limit'                          => 
$record_limit,
                                'num_records'                           => 
count($b_account_list),
                                'all_records'                           => 
$this->bo->total_records,
-                               'link_url'                              => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uib_account.index', 'type'=> $type)),
+                               'link_url'                              => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uib_account.index', 'type'=> $type)),
                                'img_path'                              => 
$GLOBALS['phpgw']->common->get_image_path('phpgwapi','default'),
                                'lang_searchfield_b_accounttext'        => 
lang('Enter the search string. To show all entries, empty this field and press 
the SUBMIT button again'),
                                'lang_searchbutton_b_accounttext'       => 
lang('Submit the search string'),
@@ -191,7 +186,7 @@
                        $appname                = lang('budget account');
                        $function_msg           = lang('list budget account');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
@@ -201,7 +196,7 @@
                {
                        if(!$this->acl_add && !$this->acl_edit)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>2, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>2, 'acl_location'=> $this->acl_location));
                        }
 
                        $id     = phpgw::get_var('id', 'int');
@@ -253,7 +248,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uib_account.edit',
+                               'menuaction'    => 'property.uib_account.edit',
                                'id'            => $id
                        );
 //_debug_array($b_account);
@@ -264,7 +259,7 @@
                        (
                                '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.'.uib_account.index', 'type'=> $type)),
+                               'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uib_account.index', 'type'=> $type)),
                                'lang_id'                               => 
lang('budget account'),
                                'lang_descr'                            => 
lang('Descr'),
                                'lang_save'                             => 
lang('save'),
@@ -290,7 +285,7 @@
 
                        $appname                                                
= lang('budget account');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -299,7 +294,7 @@
                {
                        if(!$this->acl_delete)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>8, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>8, 'acl_location'=> $this->acl_location));
                        }
 
                        $id             = phpgw::get_var('id', 'int');
@@ -307,7 +302,7 @@
 
                        $link_data = array
                        (
-                               'menuaction' => 
$this->currentapp.'.uib_account.index'
+                               'menuaction' => 'property.uib_account.index'
                        );
 
                        if (phpgw::get_var('confirm', 'bool', 'POST'))
@@ -321,7 +316,7 @@
                        $data = array
                        (
                                'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uib_account.delete', 'id'=> $id)),
+                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uib_account.delete', 'id'=> $id)),
                                'lang_confirm_msg'              => lang('do you 
really want to delete this entry'),
                                'lang_yes'                      => lang('yes'),
                                'lang_yes_b_accounttext'        => lang('Delete 
the entry'),
@@ -332,7 +327,7 @@
                        $appname                = lang('budget account');
                        $function_msg           = lang('delete budget account');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }

Modified: trunk/property/inc/class.uibudget.inc.php
===================================================================
--- trunk/property/inc/class.uibudget.inc.php   2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.uibudget.inc.php   2008-02-02 13:52:39 UTC (rev 
18466)
@@ -58,13 +58,14 @@
                function property_uibudget()
                {
                        $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
'property::budget';
+
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->nextmatchs       = 
CreateObject('phpgwapi.nextmatchs');
                        $this->account          = 
$GLOBALS['phpgw_info']['user']['account_id'];
 
                        $this->bo               = 
CreateObject('property.bobudget',True);
                        $this->bocommon         = 
CreateObject('property.bocommon');
-                       $this->menu             = CreateObject('property.menu');
 
                        $this->start            = $this->bo->start;
                        $this->query            = $this->bo->query;
@@ -78,8 +79,6 @@
                        $this->grouping         = $this->bo->grouping;
                        $this->revision         = $this->bo->revision;
 
-                       $this->menu->sub        ='budget';
-
                        $this->acl              = CreateObject('phpgwapi.acl');
 
                }
@@ -103,6 +102,12 @@
                {
                        $acl_location   = '.budget';
                        $acl_read       = $this->acl->check($acl_location,1);
+                       
+                       if(!$acl_read)
+                       {
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $acl_location));
+                       }
+
                        $acl_add        = $this->acl->check($acl_location,2);
                        $acl_edit       = $this->acl->check($acl_location,4);
                        $acl_delete     = $this->acl->check($acl_location,8);
@@ -110,19 +115,13 @@
                        $this->year     = $this->bo->year;
                        $this->revision = $this->bo->revision;
 
-                       if(!$acl_read)
-                       {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>1, 'acl_location'=> 
$acl_location));
-                       }
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] .= 
'::budget';
 
                        $GLOBALS['phpgw']->xslttpl->add_file(array('budget',
-                                                                               
'menu',
                                                                                
'receipt',
                                                                                
'search_field',
                                                                                
'nextmatchs'));
 
-                       $links = $this->menu->links('budget');
-
                        $receipt = 
$GLOBALS['phpgw']->session->appsession('session_data','budget_receipt');
                        
$GLOBALS['phpgw']->session->appsession('session_data','budget_receipt','');
 
@@ -142,8 +141,8 @@
                                                'district_id'                   
=> $entry['district_id'],
                                                'revision'                      
=> $entry['revision'],
                                                'budget_cost'                   
=> $entry['budget_cost'],
-                                               'link_edit'                     
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uibudget.edit', 'budget_id'=> $entry['budget_id'])),
-                                               'link_delete'                   
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uibudget.delete', 'budget_id'=> $entry['budget_id'])),
+                                               'link_edit'                     
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uibudget.edit', 'budget_id'=> $entry['budget_id'])),
+                                               'link_delete'                   
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uibudget.delete', 'budget_id'=> $entry['budget_id'])),
                                                'lang_edit_text'                
=> lang('edit the budget record'),
                                                'lang_delete_text'              
=> lang('delete the budget record'),
                                                'text_edit'                     
=> lang('edit'),
@@ -170,7 +169,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'district_id',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => $this->currentapp.'.uibudget.index',
+                                                                               
        'extra' => array('menuaction'   => 'property.uibudget.index',
                                                                                
                                                'district_id'   
=>$this->district_id,
                                                                                
                                                'year'          =>$this->year,
                                                                                
                                                'period'        =>$this->period,
@@ -184,7 +183,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'b_account_id',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => $this->currentapp.'.uibudget.index',
+                                                                               
        'extra' => array('menuaction'   => 'property.uibudget.index',
                                                                                
                                                'district_id'   
=>$this->district_id,
                                                                                
                                                'year'          =>$this->year,
                                                                                
                                                'period'        =>$this->period,
@@ -198,7 +197,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'category',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => $this->currentapp.'.uibudget.index',
+                                                                               
        'extra' => array('menuaction'   => 'property.uibudget.index',
                                                                                
                                                'district_id'   
=>$this->district_id,
                                                                                
                                                'year'          =>$this->year,
                                                                                
                                                'period'        =>$this->period,
@@ -212,7 +211,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'budget_cost',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => $this->currentapp.'.uibudget.index',
+                                                                               
        'extra' => array('menuaction'   => 'property.uibudget.index',
                                                                                
                                                'district_id'   
=>$this->district_id,
                                                                                
                                                'year'          =>$this->year,
                                                                                
                                                'period'        =>$this->period,
@@ -228,13 +227,13 @@
                                (
                                        'lang_add'              => lang('add'),
                                        'lang_add_statustext'   => lang('add a 
budget query'),
-                                       'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uibudget.edit'))
+                                       'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uibudget.edit'))
                                );
                        }
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uibudget.index',
+                               'menuaction'    => 'property.uibudget.index',
                                'sort'          =>$this->sort,
                                'order'         =>$this->order,
                                'cat_id'        =>$this->cat_id,
@@ -263,7 +262,6 @@
                                'sum'                                           
=> $sum,
                                'lang_sum'                                      
=> lang('sum'),
                                'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'links'                                         
=> $links,
                                'allow_allrows'                                 
=> true,
                                'allrows'                                       
=> $this->allrows,
                                'start_record'                                  
=> $this->start,
@@ -308,6 +306,12 @@
                {
                        $acl_location   = '.budget';
                        $acl_read       = $this->acl->check($acl_location,1);
+
+                       if(!$acl_read)
+                       {
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $acl_location));
+                       }
+
                        $acl_add        = $this->acl->check($acl_location,2);
                        $acl_edit       = $this->acl->check($acl_location,4);
                        $acl_delete     = $this->acl->check($acl_location,8);
@@ -315,19 +319,14 @@
                        $this->year     = $this->bo->year;
                        $this->revision = $this->bo->revision;
 
-                       if(!$acl_read)
-                       {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>1, 'acl_location'=> 
$acl_location));
-                       }
 
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] .= 
'::basis';
+
                        $GLOBALS['phpgw']->xslttpl->add_file(array('budget',
-                                                                               
'menu',
                                                                                
'receipt',
                                                                                
'search_field',
                                                                                
'nextmatchs'));
 
-                       $links = $this->menu->links('budget.basis');
-
                        $receipt = 
$GLOBALS['phpgw']->session->appsession('session_basis_data','budget_receipt');
                        
$GLOBALS['phpgw']->session->appsession('session_data','budget_receipt','');
 
@@ -345,8 +344,8 @@
                                                'district_id'                   
=> $entry['district_id'],
                                                'revision'                      
=> $entry['revision'],
                                                'budget_cost'                   
=> $entry['budget_cost'],
-                                               'link_edit'                     
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uibudget.edit_basis', 'budget_id'=> $entry['budget_id'])),
-                                               'link_delete'                   
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uibudget.delete_basis', 'budget_id'=> $entry['budget_id'])),
+                                               'link_edit'                     
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uibudget.edit_basis', 'budget_id'=> $entry['budget_id'])),
+                                               'link_delete'                   
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uibudget.delete_basis', 'budget_id'=> $entry['budget_id'])),
                                                'lang_edit_text'                
=> lang('edit the budget record'),
                                                'lang_delete_text'              
=> lang('delete the budget record'),
                                                'text_edit'                     
=> lang('edit'),
@@ -371,7 +370,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'district_id',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => $this->currentapp.'.uibudget.basis',
+                                                                               
        'extra' => array('menuaction'   => 'property.uibudget.basis',
                                                                                
                                                'district_id'   
=>$this->district_id,
                                                                                
                                                'year'          =>$this->year,
                                                                                
                                                'period'        =>$this->period,
@@ -385,7 +384,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'b_account_id',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => $this->currentapp.'.uibudget.basis',
+                                                                               
        'extra' => array('menuaction'   => 'property.uibudget.basis',
                                                                                
                                                'district_id'   
=>$this->district_id,
                                                                                
                                                'year'          =>$this->year,
                                                                                
                                                'period'        =>$this->period,
@@ -399,7 +398,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'b_group',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => $this->currentapp.'.uibudget.basis',
+                                                                               
        'extra' => array('menuaction'   => 'property.uibudget.basis',
                                                                                
                                                'district_id'   
=>$this->district_id,
                                                                                
                                                'year'          =>$this->year,
                                                                                
                                                'period'        =>$this->period,
@@ -413,7 +412,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'budget_cost',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => $this->currentapp.'.uibudget.basis',
+                                                                               
        'extra' => array('menuaction'   => 'property.uibudget.basis',
                                                                                
                                                'district_id'   
=>$this->district_id,
                                                                                
                                                'year'          =>$this->year,
                                                                                
                                                'period'        =>$this->period,
@@ -431,13 +430,13 @@
                                (
                                        'lang_add'              => lang('add'),
                                        'lang_add_statustext'   => lang('add a 
budget query'),
-                                       'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uibudget.edit_basis'))
+                                       'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uibudget.edit_basis'))
                                );
                        }
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uibudget.basis',
+                               'menuaction'    => 'property.uibudget.basis',
                                'sort'          =>$this->sort,
                                'order'         =>$this->order,
                                'cat_id'        =>$this->cat_id,
@@ -466,7 +465,6 @@
                                'sum'                                           
=> $sum,
                                'lang_sum'                                      
=> lang('sum'),
                                'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'links'                                         
=> $links,
                                'allow_allrows'                                 
=> true,
                                'allrows'                                       
=> $this->allrows,
                                'start_record'                                  
=> $this->start,
@@ -511,22 +509,23 @@
                {
                        $acl_location   = '.budget.obligations';
                        $acl_read       = $this->acl->check($acl_location,1);
-                       $acl_add        = $this->acl->check($acl_location,2);
-                       $acl_edit       = $this->acl->check($acl_location,4);
-                       $acl_delete     = $this->acl->check($acl_location,8);
 
                        if(!$acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>1, 'acl_location'=> 
$acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $acl_location));
                        }
 
+                       $acl_add        = $this->acl->check($acl_location,2);
+                       $acl_edit       = $this->acl->check($acl_location,4);
+                       $acl_delete     = $this->acl->check($acl_location,8);
+
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] .= 
'::obligations';
+               
                        $GLOBALS['phpgw']->xslttpl->add_file(array('budget',
-                                                                               
'menu',
                                                                                
'receipt',
                                                                                
'search_field',
                                                                                
'nextmatchs'));
 
-                       $links = $this->menu->links('budget.obligations');
 
                        $receipt = 
$GLOBALS['phpgw']->session->appsession('session_obligations_data','budget_receipt');
                        
$GLOBALS['phpgw']->session->appsession('session_data','budget_receipt','');
@@ -546,9 +545,9 @@
                                                'grouping'                      
=> $entry['grouping'],
                                                'district_id'                   
=> $entry['district_id'],
                                                'obligation'                    
=> number_format($entry['obligation'], 0, ',', ' '),
-                                               'link_obligation'               
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiworkorder.index', 'filter'=>'all', 'paid'=>1, 
'district_id'=> $entry['district_id'], 'b_group'=> $entry['grouping'])),
+                                               'link_obligation'               
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiworkorder.index', 'filter'=>'all', 'paid'=>1, 'district_id'=> 
$entry['district_id'], 'b_group'=> $entry['grouping'])),
                                                'actual_cost'                   
=> number_format($entry['actual_cost'], 0, ',', ' '),
-                                               'link_actual_cost'              
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiinvoice.consume', 'district_id'=> $entry['district_id'], 
'b_account_class'=> $entry['grouping'], 'start_date'=> $start_date, 
'end_date'=> $end_date, 'submit_search'=>true)),
+                                               'link_actual_cost'              
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiinvoice.consume', 'district_id'=> $entry['district_id'], 
'b_account_class'=> $entry['grouping'], 'start_date'=> $start_date, 
'end_date'=> $end_date, 'submit_search'=>true)),
                                                'diff'                          
=> number_format($entry['budget_cost'] - $entry['actual_cost'] - 
$entry['obligation'], 0, ',', ' '),
                                                'hits'                          
=> number_format($entry['hits'], 0, ',', ' '),
 
@@ -581,7 +580,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'b_group',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uibudget.obligations',
+                                                                               
        'extra' => array('menuaction'   => 'property.uibudget.obligations',
                                                                                
                                                'district_id'   
=>$this->district_id,
                                                                                
                                                'year'          =>$this->year,
                                                                                
                                                'period'        =>$this->period,
@@ -596,13 +595,13 @@
                                (
                                        'lang_add'              => lang('add'),
                                        'lang_add_statustext'   => lang('add a 
budget query'),
-                                       'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uibudget.edit_obligations'))
+                                       'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uibudget.edit_obligations'))
                                );
                        }
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uibudget.obligations',
+                               'menuaction'    => 
'property.uibudget.obligations',
                                'sort'          =>$this->sort,
                                'order'         =>$this->order,
                                'cat_id'        =>$this->cat_id,
@@ -633,7 +632,6 @@
                                'sum_budget_cost'                               
        => $sum_budget_cost,
                                'lang_sum'                                      
                => lang('sum'),
                                'msgbox_data'                                   
        => $GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'links'                                         
                => $links,
                                'allow_allrows'                                 
        => false,
                                'allrows'                                       
                => $this->allrows,
                                'start_record'                                  
        => $this->start,
@@ -683,7 +681,7 @@
 
                        if(!$acl_add && !$acl_edit)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>2, 'acl_location'=> 
$acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>2, 'acl_location'=> $acl_location));
                        }
 
                        $budget_id      = phpgw::get_var('budget_id', 'int');
@@ -723,7 +721,7 @@
                                        if (isset($values['save']) && 
$values['save'])
                                        {
                                                
$GLOBALS['phpgw']->session->appsession('session_data','budget_receipt',$receipt);
-                                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uibudget.index'));
+                                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uibudget.index'));
                                        }
                                }
                                else
@@ -740,7 +738,7 @@
 
                        if (isset($values['cancel']) && $values['cancel'])
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uibudget.index'));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uibudget.index'));
                        }
 
 
@@ -751,7 +749,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uibudget.edit',
+                               'menuaction'    => 'property.uibudget.edit',
                                'budget_id'     => $budget_id
                        );
 
@@ -814,7 +812,7 @@
 
                        if(!$acl_add && !$acl_edit)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>2, 'acl_location'=> 
$acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>2, 'acl_location'=> $acl_location));
                        }
 
                        $budget_id      = phpgw::get_var('budget_id', 'int');
@@ -850,7 +848,7 @@
                                        if ($values['save'])
                                        {
                                                
$GLOBALS['phpgw']->session->appsession('session_data','budget_basis_receipt',$receipt);
-                                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uibudget.basis'));
+                                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uibudget.basis'));
                                        }
                                }
                                else
@@ -869,7 +867,7 @@
 
                        if ($values['cancel'])
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uibudget.basis'));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uibudget.basis'));
                        }
 
                        if ($budget_id)
@@ -879,7 +877,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uibudget.edit_basis',
+                               'menuaction'    => 
'property.uibudget.edit_basis',
                                'budget_id'     => $budget_id
                        );
 
@@ -954,7 +952,7 @@
 
                        $link_data = array
                        (
-                               'menuaction' => 
$this->currentapp.'.uibudget.index'
+                               'menuaction' => 'property.uibudget.index'
                        );
 
                        if (phpgw::get_var('confirm', 'bool', 'POST'))
@@ -968,7 +966,7 @@
                        $data = array
                        (
                                'done_action'           => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'         => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uibudget.delete', 'budget_id'=> $budget_id)),
+                               'delete_action'         => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uibudget.delete', 'budget_id'=> $budget_id)),
                                'lang_confirm_msg'      => lang('do you really 
want to delete this entry'),
                                'lang_yes'              => lang('yes'),
                                'lang_yes_statustext'   => lang('Delete the 
entry'),
@@ -979,7 +977,7 @@
                        $appname                = lang('budget');
                        $function_msg           = lang('delete budget');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
 
                }
@@ -991,7 +989,7 @@
 
                        $link_data = array
                        (
-                               'menuaction' => 
$this->currentapp.'.uibudget.basis'
+                               'menuaction' => 'property.uibudget.basis'
                        );
 
                        if (phpgw::get_var('confirm', 'bool', 'POST'))
@@ -1005,7 +1003,7 @@
                        $data = array
                        (
                                'done_action'           => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'         => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uibudget.delete_basis', 'budget_id'=> $budget_id)),
+                               'delete_action'         => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uibudget.delete_basis', 'budget_id'=> $budget_id)),
                                'lang_confirm_msg'      => lang('do you really 
want to delete this entry'),
                                'lang_yes'              => lang('yes'),
                                'lang_yes_statustext'   => lang('Delete the 
entry'),
@@ -1016,7 +1014,7 @@
                        $appname        = lang('budget');
                        $function_msg   = lang('delete budget');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
 
                }
@@ -1063,7 +1061,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uibudget.view',
+                               'menuaction'    => 'property.uibudget.view',
                                'sort'          =>$this->sort,
                                'order'         =>$this->order,
                                'budget_id'     =>$budget_id,
@@ -1083,7 +1081,7 @@
 
                        $link_excel = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uibudget.excel',
+                               'menuaction'    => 'property.uibudget.excel',
                                'sort'          =>$this->sort,
                                'order'         =>$this->order,
                                'filter'        =>$this->filter,
@@ -1092,7 +1090,7 @@
                                'allrows'       => $this->allrows
                        );
 
-                       
$GLOBALS['phpgw']->js->validate_file('overlib','overlib',$this->currentapp);
+                       
$GLOBALS['phpgw']->js->validate_file('overlib','overlib','property');
 
                        $data = array
                        (
@@ -1116,7 +1114,7 @@
                                'table_header'                          => 
$table_header,
                                'values'                                => 
$content,
 
-                               'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uibudget.index')),
+                               'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uibudget.index')),
                                'lang_done'                             => 
lang('done'),
                        );
 

Modified: trunk/property/inc/class.uicategory.inc.php
===================================================================
--- trunk/property/inc/class.uicategory.inc.php 2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.uicategory.inc.php 2008-02-02 13:52:39 UTC (rev 
18466)
@@ -53,7 +53,8 @@
                function property_uicategory()
                {
                        $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
phpgw::get_var('menu_selection');
+               //      $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->nextmatchs                       = 
CreateObject('phpgwapi.nextmatchs');
                        $this->account                          = 
$GLOBALS['phpgw_info']['user']['account_id'];
                        $this->bo                               = 
CreateObject('property.bocategory',true);
@@ -92,13 +93,13 @@
                {
                        if(!$this->acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>1, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
                        }
 
                        $type           = phpgw::get_var('type');
                        $type_id        = phpgw::get_var('type_id', 'int');
 
-                       $GLOBALS['phpgw_info']['apps']['manual']['section'] = 
'category.index.' . $type;
+                       $GLOBALS['phpgw_info']['apps']['manual']['section'] = 
"category.index.{$type}";
 
                        
$GLOBALS['phpgw']->xslttpl->add_file(array('category','nextmatchs',
                                                                                
'search_field'));
@@ -114,8 +115,8 @@
                                (
                                        'id'                            => 
$category['id'],
                                        'first'                         => 
$first,
-                                       'link_edit'                     => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uicategory.edit', 'id'=> $category['id'], 'type'=> $type, 
'type_id'=> $type_id)),
-                                       'link_delete'                   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uicategory.delete', 'id'=> $category['id'], 'type'=> $type, 
'type_id'=> $type_id)),
+                                       'link_edit'                     => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uicategory.edit', 'id'=> $category['id'], 'type'=> $type, 'type_id'=> 
$type_id, 'menu_selection' => 
$GLOBALS['phpgw_info']['flags']['menu_selection'])),
+                                       'link_delete'                   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uicategory.delete', 'id'=> $category['id'], 'type'=> $type, 
'type_id'=> $type_id, 'menu_selection' => 
$GLOBALS['phpgw_info']['flags']['menu_selection'])),
                                        'lang_view_categorytext'        => 
lang('view the category'),
                                        'lang_edit_categorytext'        => 
lang('edit the category'),
                                        'lang_delete_categorytext'      => 
lang('delete the category'),
@@ -138,9 +139,11 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'id',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uicategory.index',
+                                                                               
        'extra' => array('menuaction'   => 'property.uicategory.index',
                                                                                
                                                        'type'  => $type,
-                                                                               
                                                        'type_id' => $type_id)
+                                                                               
                                                        'type_id' => $type_id,
+                                                                               
                                                        'menu_selection' => 
$GLOBALS['phpgw_info']['flags']['menu_selection']
+                                                                               
                                        )
                                                                                
)),
                                'lang_id'               => lang('category id'),
                        );
@@ -149,7 +152,7 @@
                        (
                                'lang_add'              => lang('add'),
                                'lang_add_categorytext' => lang('add a 
category'),
-                               'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uicategory.edit', 'type'=> $type,  'type_id'=> $type_id)),
+                               'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uicategory.edit', 'type'=> $type,  'type_id'=> $type_id, 
'menu_selection' => $GLOBALS['phpgw_info']['flags']['menu_selection'])),
                                'lang_done'             => lang('done'),
                                'lang_done_categorytext'=> lang('back to 
admin'),
                                'done_action'           => 
$GLOBALS['phpgw']->link('/admin/index.php')
@@ -173,7 +176,7 @@
                                'record_limit'                                  
=> $record_limit,
                                'num_records'                                   
=> count($category_list),
                                'all_records'                                   
=> $this->bo->total_records,
-                               'link_url'                                      
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uicategory.index', 'type'=> $type, 'type_id'=> $type_id)),
+                               'link_url'                                      
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uicategory.index', 'type'=> $type, 'type_id'=> 
$type_id,'menu_selection' => 
$GLOBALS['phpgw_info']['flags']['menu_selection'])),
                                'img_path'                                      
=> $GLOBALS['phpgw']->common->get_image_path('phpgwapi','default'),
                                'lang_searchfield_categorytext'                 
=> lang('Enter the search string. To show all entries, empty this field and 
press the SUBMIT button again'),
                                'lang_searchbutton_categorytext'                
=> lang('Submit the search string'),
@@ -188,7 +191,7 @@
 ;
                        $function_msg   = lang('list %1 category',$type);
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
                        $this->save_sessiondata();
                }
@@ -197,7 +200,7 @@
                {
                        if(!$this->acl_add)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=> 2, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=> 2, 'acl_location'=> $this->acl_location));
                        }
 
                        $type   = phpgw::get_var('type');
@@ -248,10 +251,11 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uicategory.edit',
+                               'menuaction'    => 'property.uicategory.edit',
                                'id'            => $id,
                                'type'          => $type,
-                               'type_id'       => $type_id
+                               'type_id'       => $type_id,
+                               'menu_selection' => 
$GLOBALS['phpgw_info']['flags']['menu_selection']
                        );
 //_debug_array($link_data);
 
@@ -261,7 +265,7 @@
                        (
                                '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.'.uicategory.index', 'type'=> $type, 'type_id'=> $type_id)),
+                               'done_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uicategory.index', 'type'=> $type, 'type_id'=> 
$type_id,'menu_selection' => 
$GLOBALS['phpgw_info']['flags']['menu_selection'])),
                                'lang_id'                                       
=> lang('category ID'),
                                'lang_descr'                                    
=> lang('Descr'),
                                'lang_save'                                     
=> lang('save'),
@@ -277,7 +281,7 @@
 
                        $appname        = lang($type). ' ' . $type_id;
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
                }
 
@@ -285,7 +289,7 @@
                {
                        if(!$this->acl_delete)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=> 8, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=> 8, 'acl_location'=> $this->acl_location));
                        }
 
                        $type           = phpgw::get_var('type');
@@ -295,9 +299,10 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uicategory.index',
+                               'menuaction'    => 'property.uicategory.index',
                                'type'          => $type,
-                               'type_id'       => $type_id
+                               'type_id'       => $type_id,
+                               'menu_selection' => 
$GLOBALS['phpgw_info']['flags']['menu_selection']
                        );
 
                        if (phpgw::get_var('confirm', 'bool', 'POST'))
@@ -311,7 +316,7 @@
                        $data = array
                        (
                                'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uicategory.delete', 'id'=> $id, 'type'=> $type, 'type_id'=> 
$type_id)),
+                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uicategory.delete', 'id'=> $id, 'type'=> $type, 'type_id'=> 
$type_id,'menu_selection' => 
$GLOBALS['phpgw_info']['flags']['menu_selection'])),
                                'lang_confirm_msg'              => lang('do you 
really want to delete this entry'),
                                'lang_yes'                      => lang('yes'),
                                'lang_yes_categorytext'         => lang('Delete 
the entry'),
@@ -322,7 +327,7 @@
                        $appname        = lang($type). ' ' . $type_id;
                        $function_msg   = lang('delete '.$type.' category');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                }
        }

Modified: trunk/property/inc/class.uicustom.inc.php
===================================================================
--- trunk/property/inc/class.uicustom.inc.php   2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.uicustom.inc.php   2008-02-02 13:52:39 UTC (rev 
18466)
@@ -54,14 +54,14 @@
                function property_uicustom()
                {
                        $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
'property::custom';
+
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->nextmatchs       = 
CreateObject('phpgwapi.nextmatchs');
                        $this->account          = 
$GLOBALS['phpgw_info']['user']['account_id'];
 
                        $this->bo               = 
CreateObject('property.bocustom',True);
                        $this->bocommon         = 
CreateObject('property.bocommon');
-                       $this->menu             = CreateObject('property.menu');
-
                        $this->start            = $this->bo->start;
                        $this->query            = $this->bo->query;
                        $this->sort             = $this->bo->sort;
@@ -69,7 +69,6 @@
                        $this->filter           = $this->bo->filter;
                        $this->cat_id           = $this->bo->cat_id;
                        $this->allrows          = $this->bo->allrows;
-                       $this->menu->sub        ='custom';
 
                        $this->acl              = CreateObject('phpgwapi.acl');
                        $this->acl_location     = '.custom';
@@ -98,13 +97,10 @@
                function index()
                {
                        $GLOBALS['phpgw']->xslttpl->add_file(array('custom',
-                                                                               
'menu',
                                                                                
'receipt',
                                                                                
'search_field',
                                                                                
'nextmatchs'));
 
-                       $links = $this->menu->links();
-
                        $receipt = 
$GLOBALS['phpgw']->session->appsession('session_data','custom_receipt');
                        
$GLOBALS['phpgw']->session->appsession('session_data','custom_receipt','');
 
@@ -137,19 +133,19 @@
                                        {
                                                
$content[$j]['row'][$i]['statustext']                   = lang('view the 
entity');
                                                $content[$j]['row'][$i]['text'] 
                        = lang('view');
-                                               
$content[$j]['row'][$i++]['link']                       = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uicustom.view', 'custom_id'=> $entry['custom_id']));
+                                               
$content[$j]['row'][$i++]['link']                       = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'property.uicustom.view', 'custom_id'=> $entry['custom_id']));
                                        }
                                        if($this->acl_edit)
                                        {
                                                
$content[$j]['row'][$i]['statustext']                   = lang('edit the 
actor');
                                                $content[$j]['row'][$i]['text'] 
                        = lang('edit');
-                                               
$content[$j]['row'][$i++]['link']                       = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uicustom.edit', 'custom_id'=> $entry['custom_id']));
+                                               
$content[$j]['row'][$i++]['link']                       = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'property.uicustom.edit', 'custom_id'=> $entry['custom_id']));
                                        }
                                        if($this->acl_delete)
                                        {
                                                
$content[$j]['row'][$i]['statustext']                   = lang('delete the 
actor');
                                                $content[$j]['row'][$i]['text'] 
                        = lang('delete');
-                                               
$content[$j]['row'][$i++]['link']                       = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uicustom.delete', 'custom_id'=> $entry['custom_id']));
+                                               
$content[$j]['row'][$i++]['link']                       = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'property.uicustom.delete', 'custom_id'=> $entry['custom_id']));
                                        }
 
                                        $j++;
@@ -167,7 +163,7 @@
                                        'sort'  => $this->sort,
                                        'var'   => 'id',
                                        'order' => $this->order,
-                                       'extra' => array('menuaction'   => 
$this->currentapp.'.uicustom.index',
+                                       'extra' => array('menuaction'   => 
'property.uicustom.index',
                                                                                
'query' =>$this->query,
                                                                                
'start_date'    => $start_date,
                                                                                
'end_date'=>$end_date)
@@ -182,7 +178,7 @@
                                        'sort'  => $this->sort,
                                        'var'   => 'name',
                                        'order' => $this->order,
-                                       'extra' => array('menuaction'   => 
$this->currentapp.'.uicustom.index',
+                                       'extra' => array('menuaction'   => 
'property.uicustom.index',
                                                                                
'query'         => $this->query,
                                                                                
'start_date'    => $start_date,
                                                                                
'end_date'      => $end_date)
@@ -198,7 +194,7 @@
                                        'sort'  => $this->sort,
                                        'var'   => 'name',
                                        'order' => $this->order,
-                                       'extra' => array('menuaction'   => 
$this->currentapp.'.uicustom.index',
+                                       'extra' => array('menuaction'   => 
'property.uicustom.index',
                                                                                
'query'         => $this->query,
                                                                                
'start_date'    => $start_date,
                                                                                
'end_date'      => $end_date)
@@ -213,7 +209,7 @@
                                        'sort'  => $this->sort,
                                        'var'   => 'user_id',
                                        'order' => $this->order,
-                                       'extra' => array('menuaction'   => 
$this->currentapp.'.uicustom.index',
+                                       'extra' => array('menuaction'   => 
'property.uicustom.index',
                                                                                
'query'         => $this->query,
                                                                                
'start_date'    => $start_date,
                                                                                
'end_date'      => $end_date)
@@ -250,13 +246,13 @@
                                (
                                        'lang_add'              => lang('add'),
                                        'lang_add_statustext'   => lang('add a 
custom query'),
-                                       'add_action'            => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uicustom.edit'))
+                                       'add_action'            => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'property.uicustom.edit'))
                                );
                        }
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uicustom.index',
+                               'menuaction'    => 'property.uicustom.index',
                                'sort'          => $this->sort,
                                'order'         => $this->order,
                                'cat_id'        => $this->cat_id,
@@ -278,7 +274,6 @@
                        $data = array
                        (
                                'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'links'                                         
=> $links,
                                'allow_allrows'                                 
=> true,
                                'allrows'                                       
=> $this->allrows,
                                'start_record'                                  
=> $this->start,
@@ -307,7 +302,7 @@
                {
                        if(!$this->acl_add && !$this->acl_edit)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>2, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>2, 'acl_location'=> $this->acl_location));
                        }
 
                        $custom_id      = phpgw::get_var('custom_id', 'int');
@@ -344,14 +339,14 @@
                                        if ($values['save'])
                                        {
                                                
$GLOBALS['phpgw']->session->appsession('session_data','custom_receipt',$receipt);
-                                               
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction'=> 
$this->currentapp.'.uicustom.index'));
+                                               
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction'=> 
'property.uicustom.index'));
                                        }
                                }
                        }
 
                        if ($values['cancel'])
                        {
-                               $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction'=> $this->currentapp.'.uicustom.index'));
+                               $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction'=> 'property.uicustom.index'));
                        }
 
 
@@ -364,7 +359,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uicustom.edit',
+                               'menuaction'    => 'property.uicustom.edit',
                                'custom_id'     => $custom_id
                        );
 
@@ -379,8 +374,8 @@
                                        'sorting'       => $entry['sorting'],
                                        'text_up'       => lang('Up'),
                                        'text_down'     => lang('Down'),
-                                       'link_up'       => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uicustom.edit', 'resort'=> 'up', 'cols_id'=> $entry['id'], 
'custom_id'=> $custom_id)),
-                                       'link_down'     => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uicustom.edit', 'resort'=> 'down', 'cols_id'=> 
$entry['id'], 'custom_id'=> $custom_id)),
+                                       'link_up'       => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'property.uicustom.edit', 'resort'=> 'up', 'cols_id'=> $entry['id'], 
'custom_id'=> $custom_id)),
+                                       'link_down'     => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'property.uicustom.edit', 'resort'=> 'down', 'cols_id'=> $entry['id'], 
'custom_id'=> $custom_id)),
                                        );
                        }
 
@@ -432,7 +427,7 @@
 
                        $link_data = array
                        (
-                               'menuaction' => 
$this->currentapp.'.uicustom.index'
+                               'menuaction' => 'property.uicustom.index'
                        );
 
                        if (phpgw::get_var('confirm', 'bool', 'POST'))
@@ -446,7 +441,7 @@
                        $data = array
                        (
                                'done_action'           => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'         => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uicustom.delete', 'custom_id'=> $custom_id)),
+                               'delete_action'         => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'property.uicustom.delete', 'custom_id'=> $custom_id)),
                                'lang_confirm_msg'      => lang('do you really 
want to delete this entry'),
                                'lang_yes'              => lang('yes'),
                                'lang_yes_statustext'   => lang('Delete the 
entry'),
@@ -457,7 +452,7 @@
                        $appname        = lang('custom');
                        $function_msg   = lang('delete custom');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -502,7 +497,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uicustom.view',
+                               'menuaction'    => 'property.uicustom.view',
                                'sort'          => $this->sort,
                                'order'         => $this->order,
                                'custom_id'     => $custom_id,
@@ -522,7 +517,7 @@
 
                        $link_excel = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uicustom.excel',
+                               'menuaction'    => 'property.uicustom.excel',
                                'sort'          => $this->sort,
                                'order'         => $this->order,
                                'filter'        => $this->filter,
@@ -531,7 +526,7 @@
                                'allrows'       => $this->allrows
                        );
 
-                       
$GLOBALS['phpgw']->js->validate_file('overlib','overlib',$this->currentapp);
+                       
$GLOBALS['phpgw']->js->validate_file('overlib','overlib','property');
 
                        $data = array
                        (
@@ -555,7 +550,7 @@
                                'table_header'                          => 
$table_header,
                                'values'                                => 
$content,
 
-                               'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uicustom.index')),
+                               'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'property.uicustom.index')),
                                'lang_done'                             => 
lang('done'),
                        );
 

Modified: trunk/property/inc/class.uidocument.inc.php
===================================================================
--- trunk/property/inc/class.uidocument.inc.php 2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.uidocument.inc.php 2008-02-02 13:52:39 UTC (rev 
18466)
@@ -58,14 +58,15 @@
                function property_uidocument()
                {
                        $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
"property::documentation";
+
+               //      $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->nextmatchs                       = 
CreateObject('phpgwapi.nextmatchs');
                        $this->account                          = 
$GLOBALS['phpgw_info']['user']['account_id'];
                        $this->bo                                       = 
CreateObject('property.bodocument',True);
                        $this->bocommon                         = 
CreateObject('property.bocommon');
-                       $this->menu                                     = 
CreateObject('property.menu');
                        $this->bolocation                       = 
CreateObject('property.bolocation');
-                       $this->config                           = 
CreateObject('phpgwapi.config',$this->currentapp);
+                       $this->config                           = 
CreateObject('phpgwapi.config','property');
                        $this->boadmin_entity           = 
CreateObject('property.boadmin_entity');
 
                        $this->acl                                      = 
CreateObject('phpgwapi.acl');
@@ -88,7 +89,15 @@
                        $this->doc_type                         = 
$this->bo->doc_type;
                        $this->query_location                   = 
$this->bo->query_location;
 
-                       $this->menu->sub                        ='document';
+                       // FIXME: $this->entity_id always has a value set here 
- skwashd jan08
+                       if ( $this->entity_id )
+                       {
+                               
$GLOBALS['phpgw_info']['flags']['menu_selection'] .= 
"::entity_{$this->entity_id}";
+                       }
+                       else
+                       {
+                               
$GLOBALS['phpgw_info']['flags']['menu_selection'] .= '::location';
+                       }
                }
 
                function save_sessiondata()
@@ -113,21 +122,19 @@
                {
                        if(!$this->acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>1, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
                        }
 
                        $GLOBALS['phpgw']->xslttpl->add_file(array(
                                                                                
'document',
                                                                                
'values',
                                                                                
'table_header',
-                                                                               
'menu',
                                                                                
'nextmatchs',
                                                                                
'search_field'
                                                                                
)
                        );
 
                        $entity_id = phpgw::get_var('entity_id', 'int');
-                       $links = $this->menu->links('document_'.$entity_id);
 
                        $preserve = phpgw::get_var('preserve', 'bool');
 
@@ -159,14 +166,13 @@
                                {
                                        if($uicols['input_type'][$k]!='hidden')
                                        {
-
-                                               
if($document_entry['query_location'][$uicols['name'][$k]])
+                                               
if(isset($document_entry['query_location'][$uicols['name'][$k]]) && 
$document_entry['query_location'][$uicols['name'][$k]])
                                                {
 
                                                        $content[$j]['row'][]= 
array(
                                                                'statustext'    
=> lang('search'),
                                                                'text'          
=> $document_entry[$uicols['name'][$k]],
-                                                               'link'          
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uidocument.index', 'query'=> 
$document_entry['query_location'][$uicols['name'][$k]], 'entity_id'=> 
$document_entry['p_entity_id'], 'cat_id'=> $document_entry['p_cat_id']))
+                                                               'link'          
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'property.uidocument.index', 'query'=> 
$document_entry['query_location'][$uicols['name'][$k]], 'entity_id'=> 
isset($document_entry['p_entity_id'])?$document_entry['p_entity_id']:'', 
'cat_id'=> isset($document_entry['p_cat_id'])?$document_entry['p_cat_id']:''))
                                                                );
                                                }
                                                else
@@ -185,7 +191,7 @@
                                        $content[$j]['row'][]= array(
                                                'statustext'            => 
lang('view documents for this location/entity'),
                                                'text'                  => 
lang('documents'),
-                                               'link'                  => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uidocument.list_doc', 'location_code'=>  
$document_entry['location_code'], 'p_num'=> $document_entry['p_num'], 
'entity_id'=> $document_entry['p_entity_id'], 'cat_id'=> 
$document_entry['p_cat_id'], 'doc_type'=> $this->doc_type))
+                                               'link'                  => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'property.uidocument.list_doc', 'location_code'=>  
$document_entry['location_code'], 'p_num'=> isset($document_entry['p_num']) ? 
$document_entry['p_num'] :'', 'entity_id'=> 
isset($document_entry['p_entity_id']) ? $document_entry['p_entity_id'] : '', 
'cat_id'=> isset($document_entry['p_cat_id']) ? $document_entry['p_cat_id'] : 
'', 'doc_type'=> $this->doc_type))
                                                );
                                }
 
@@ -207,7 +213,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'location_code',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uidocument.index',
+                                                                               
        'extra' => array('menuaction'   => 'property.uidocument.index',
                                                                                
                                                        'query'         => 
$this->query,
                                                                                
                                                        'cat_id'        => 
$this->cat_id,
                                                                                
                                                        'doc_type'      => 
$this->doc_type,
@@ -222,7 +228,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'document_id',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uidocument.index',
+                                                                               
        'extra' => array('menuaction'   => 'property.uidocument.index',
                                                                                
                                                        'query'         => 
$this->query,
                                                                                
                                                        'cat_id'        => 
$this->cat_id,
                                                                                
                                                        'doc_type'      => 
$this->doc_type,
@@ -237,7 +243,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'address',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uidocument.index',
+                                                                               
        'extra' => array('menuaction'   => 'property.uidocument.index',
                                                                                
                                                        'query'         => 
$this->query,
                                                                                
                                                        'cat_id'        => 
$this->cat_id,
                                                                                
                                                        'doc_type'      => 
$this->doc_type,
@@ -261,14 +267,14 @@
                                (
                                        'lang_add'              => lang('add'),
                                        'lang_add_statustext'   => lang('add a 
document'),
-                                       'add_action'            => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uidocument.edit', 'entity_id'=> $this->entity_id, 
'cat_id'=> $this->cat_id))
+                                       'add_action'            => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'property.uidocument.edit', 'entity_id'=> $this->entity_id, 'cat_id'=> 
$this->cat_id))
 
                                );
                        }
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uidocument.index',
+                               'menuaction'    => 'property.uidocument.index',
                                'sort'          => $this->sort,
                                'order'         => $this->order,
                                'cat_id'        => $this->cat_id,
@@ -295,10 +301,9 @@
 
                        $data = array
                        (
-                               'link_history'                                  
                => $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uidocument.index', 'cat_id'=> $this->cat_id)),
+                               'link_history'                                  
                => $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'property.uidocument.index', 'cat_id'=> $this->cat_id)),
                                'lang_history_statustext'                       
        => lang('search for history at this location'),
                                'lang_select'                                   
                => lang('select'),
-                               'links'                                         
                        => $links,
                                'allow_allrows'                                 
                => false,
                                'start_record'                                  
                => $this->start,
                                'record_limit'                                  
                => 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'],
@@ -340,7 +345,7 @@
                        $appname        = lang('document');
                        $function_msg   = lang('list document');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg . ' - ' . 
$appname_sub;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg . ' - ' . 
$appname_sub;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
@@ -351,7 +356,7 @@
 
                        if(!$this->acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>1, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
                        }
 
                        $preserve = phpgw::get_var('preserve', 'bool');
@@ -372,7 +377,6 @@
 //_debug_array($this->cat_id);
 
                        $GLOBALS['phpgw']->xslttpl->add_file(array('document',
-                                                                               
'menu',
                                                                                
'receipt',
                                                                                
'nextmatchs',
                                                                                
'search_field'));
@@ -413,19 +417,17 @@
                        $this->config->read_repository();
                        $files_url = $this->config->config_data['files_url'];
 
-                       $links = $this->menu->links();
-
                        $document_list = 
$this->bo->read_at_location($location_code);
 
 //_debug_array($document_list);
 
                        if($this->cat_id)
                        {
-                               $directory = $this->fakebase. SEP . 'document' 
. SEP . $location['loc1'] . SEP . $entity['name'] . SEP . $category['name'] . 
SEP . $p_num;
+                               $directory = $this->fakebase. '/' . 'document' 
. '/' . $location['loc1'] . '/' . $entity['name'] . '/' . $category['name'] . 
'/' . $p_num;
                        }
                        else
                        {
-                               $directory = $this->fakebase. SEP . 'document' 
. SEP . $location['loc1'];
+                               $directory = $this->fakebase. '/' . 'document' 
. '/' . $location['loc1'];
                        }
 
                        while (is_array($document_list) && list(,$document) = 
each($document_list))
@@ -440,7 +442,7 @@
                                {
                                        if(!$link_to_files)
                                        {
-                                               $link_view_file = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uidocument.view_file', 'document_id'=> 
$document['document_id'], 'entity_id'=> $this->entity_id, 'cat_id'=> 
$this->cat_id, 'p_num'=> $p_num));
+                                               $link_view_file = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'property.uidocument.view_file', 'document_id'=> $document['document_id'], 
'entity_id'=> $this->entity_id, 'cat_id'=> $this->cat_id, 'p_num'=> $p_num));
                                                $link_to_files = $files_url;
                                        }
                                }
@@ -455,9 +457,9 @@
                                        'doc_type'                              
=> $document['doc_type'],
                                        'link_view_file'                        
=> $link_view_file,
                                        'link_to_files'                         
=> $link_to_files,
-                                       'link_view'                             
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uidocument.view', 'document_id'=> $document['document_id'], 
'from'=> 'list_doc')),
-                                       'link_edit'                             
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uidocument.edit', 'document_id'=> $document['document_id'], 
'from'=> 'list_doc')),
-                                       'link_delete'                           
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uidocument.delete', 'document_id'=> 
$document['document_id'], 'location_code'=> $location_code, 'p_num'=> $p_num)),
+                                       'link_view'                             
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'property.uidocument.view', 'document_id'=> $document['document_id'], 'from'=> 
'list_doc')),
+                                       'link_edit'                             
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'property.uidocument.edit', 'document_id'=> $document['document_id'], 'from'=> 
'list_doc')),
+                                       'link_delete'                           
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'property.uidocument.delete', 'document_id'=> $document['document_id'], 
'location_code'=> $location_code, 'p_num'=> $p_num)),
                                        'lang_view_file_statustext'             
=> lang('view the document'),
                                        'lang_view_statustext'                  
=> lang('view information about the document'),
                                        'lang_edit_statustext'                  
=> lang('edit information about the document'),
@@ -476,7 +478,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'document_name',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uidocument.list_doc',
+                                                                               
        'extra' => array('menuaction'   => 'property.uidocument.list_doc',
                                                                                
                                'entity_id'     => $this->entity_id,
                                                                                
                                'cat_id'        => $this->cat_id,
                                                                                
                                'doc_type'      => $this->doc_type,
@@ -499,7 +501,7 @@
 
                        $link_data_add = array
                        (
-                               'menuaction'            => 
$this->currentapp.'.uidocument.edit',
+                               'menuaction'            => 
'property.uidocument.edit',
                                'location_code'         => $location_code,
                                'p_entity_id'           => $this->entity_id,
                                'entity_id'             => $this->entity_id,
@@ -519,7 +521,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uidocument.list_doc',
+                               'menuaction'    => 
'property.uidocument.list_doc',
                                'sort'          => $this->sort,
                                'order'         => $this->order,
                                'entity_id'     => $this->entity_id,
@@ -554,12 +556,11 @@
                        (
                                'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
                                'location_data'                                 
=> $location_data,
-                               'link_history'                                  
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uidocument.list_doc', 'cat_id'=> $this->cat_id)),
+                               'link_history'                                  
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'property.uidocument.list_doc', 'cat_id'=> $this->cat_id)),
                                'lang_history_statustext'                       
=> lang('search for history at this location'),
                                'lang_select'                                   
=> lang('select'),
-                               'lookup_action'                                 
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uiworkorder.edit')),
+                               'lookup_action'                                 
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'property.uiworkorder.edit')),
                                'lookup'                                        
=> $lookup,
-                               'links'                                         
=> $links,
                                'allow_allrows'                                 
=> false,
                                'start_record'                                  
=> $this->start,
                                'record_limit'                                  
=> $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'],
@@ -592,7 +593,7 @@
                                'table_header_document'                         
=> $table_header,
                                'values_document'                               
=> $content,
                                'table_add'                                     
=> $table_add,
-                               'done_action'                                   
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uidocument.index', 'preserve'=> 1)),
+                               'done_action'                                   
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'property.uidocument.index', 'preserve'=> 1)),
                                'lang_done'                                     
=> lang('done'),
                                'lang_done_statustext'                          
=> lang('Back to the list')
                        );
@@ -600,7 +601,7 @@
                        $appname        = lang('document');
                        $function_msg   = lang('list document');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg . ' - ' . 
$appname_sub;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg . ' - ' . 
$appname_sub;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_document' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
@@ -614,7 +615,7 @@
 
                        if(!$this->acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>1, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
                        }
 
                        $document_id            = phpgw::get_var('document_id', 
'int');
@@ -627,11 +628,11 @@
                        {
                                $entity = 
$this->boadmin_entity->read_single($this->entity_id,false);
                                $category = 
$this->boadmin_entity->read_single_category($this->entity_id,$this->cat_id);
-                               $file   = $this->fakebase. SEP . 'document' . 
SEP . $values['location_data']['loc1'] . SEP . $entity['name'] . SEP . 
$category['name'] . SEP . $p_num . SEP . $values['document_name'];
+                               $file   = $this->fakebase. '/' . 'document' . 
'/' . $values['location_data']['loc1'] . '/' . $entity['name'] . '/' . 
$category['name'] . '/' . $p_num . '/' . $values['document_name'];
                        }
                        else
                        {
-                               $file   = $this->fakebase. SEP . 'document' . 
SEP .$values['location_data']['loc1'] . SEP . $values['document_name'];
+                               $file   = $this->fakebase. '/' . 'document' . 
'/' .$values['location_data']['loc1'] . '/' . $values['document_name'];
                        }
 
                        if($this->bo->vfs->file_exists(array(
@@ -668,7 +669,7 @@
                {
                        if(!$this->acl_add && !$this->acl_edit)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>2, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>2, 'acl_location'=> $this->acl_location));
                        }
 
                        $from                   = phpgw::get_var('from');
@@ -688,8 +689,8 @@
 
                        if($_POST && !$bypass)
                        {
-                               $insert_record          = 
$GLOBALS['phpgw']->session->appsession('insert_record',$this->currentapp);
-                               $insert_record_entity   = 
$GLOBALS['phpgw']->session->appsession('insert_record_entity',$this->currentapp);
+                               $insert_record          = 
$GLOBALS['phpgw']->session->appsession('insert_record','property');
+                               $insert_record_entity   = 
$GLOBALS['phpgw']->session->appsession('insert_record_entity','property');
 
                                for ($j=0;$j<count($insert_record_entity);$j++)
                                {
@@ -768,11 +769,11 @@
 
                                if($values['extra']['p_num'])
                                {
-                                       $to_file = $this->fakebase. SEP . 
'document' . SEP . $values['location']['loc1'] . SEP . $entity['name'] . SEP . 
$category['name'] . SEP . $values['extra']['p_num'] . SEP . 
$values['document_name'];
+                                       $to_file = $this->fakebase. '/' . 
'document' . '/' . $values['location']['loc1'] . '/' . $entity['name'] . '/' . 
$category['name'] . '/' . $values['extra']['p_num'] . '/' . 
$values['document_name'];
                                }
                                else
                                {
-                                       $to_file = $this->fakebase. SEP . 
'document' . SEP . $values['location']['loc1'] . SEP . $values['document_name'];
+                                       $to_file = $this->fakebase. '/' . 
'document' . '/' . $values['location']['loc1'] . '/' . $values['document_name'];
                                }
 
                                if(!$values['document_name_orig'] && 
$this->bo->vfs->file_exists(array(
@@ -808,7 +809,7 @@
                                                $receipt = 
$this->bo->save($values);
        //                                      
$document_id=$receipt['document_id'];
                                                
$GLOBALS['phpgw']->session->appsession('session_data','document_receipt',$receipt);
-                                               
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction'=> 
$this->currentapp.'.uidocument.list_doc', 'location_code'=> implode("-", 
$values['location']), 'entity_id'=> $this->entity_id, 'cat_id'=> $this->cat_id, 
'p_num'=> $values['extra']['p_num']));
+                                               
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction'=> 
'property.uidocument.list_doc', 'location_code'=> implode("-", 
$values['location']), 'entity_id'=> $this->entity_id, 'cat_id'=> $this->cat_id, 
'p_num'=> $values['extra']['p_num']));
                                        }
                                }
                                else
@@ -879,7 +880,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uidocument.edit',
+                               'menuaction'    => 'property.uidocument.edit',
                                'document_id'   => $document_id,
                                'from'          => $from,
                                'location_code' => $values['location_code'],
@@ -917,7 +918,7 @@
                                'lang_save'                                     
=> lang('save'),
                                'lang_save_statustext'                          
=> lang('Save the document'),
 
-                               'done_action'                                   
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uidocument.' .$from, 'location_code'=> $location_code, 
'entity_id'=> $this->entity_id, 'cat_id'=> $this->cat_id, 'p_num'=> $p_num, 
'preserve'=> 1)),
+                               'done_action'                                   
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'property.uidocument.' .$from, 'location_code'=> $location_code, 'entity_id'=> 
$this->entity_id, 'cat_id'=> $this->cat_id, 'p_num'=> $p_num, 'preserve'=> 1)),
                                'lang_done'                                     
=> lang('done'),
                                'lang_done_statustext'                          
=> lang('Back to the list'),
 
@@ -977,7 +978,7 @@
 
                        $appname                = lang('document');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -986,7 +987,7 @@
                {
                        if(!$this->acl_delete)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>8, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>8, 'acl_location'=> $this->acl_location));
                        }
 
                        $location_code = phpgw::get_var('location_code');
@@ -996,7 +997,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uidocument.list_doc',
+                               'menuaction'    => 
'property.uidocument.list_doc',
                                'location_code' => $location_code,
                                'p_num'         => $p_num
                        );
@@ -1012,7 +1013,7 @@
                        $data = array
                        (
                                'done_action'           => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'         => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uidocument.delete', 'document_id'=> $document_id, 
'location_code'=> $location_code, 'p_num'=> $p_num)),
+                               'delete_action'         => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'property.uidocument.delete', 'document_id'=> $document_id, 'location_code'=> 
$location_code, 'p_num'=> $p_num)),
                                'lang_confirm_msg'      => lang('do you really 
want to delete this entry'),
                                'lang_yes'              => lang('yes'),
                                'lang_yes_statustext'   => lang('Delete the 
entry'),
@@ -1023,7 +1024,7 @@
                        $appname        = lang('document');
                        $function_msg   = lang('delete document');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -1033,7 +1034,7 @@
 
                        if(!$this->acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>1, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
                        }
 
                        $from           = phpgw::get_var('from');
@@ -1082,7 +1083,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uidocument.edit',
+                               'menuaction'    => 'property.uidocument.edit',
                                'document_id'   => $document_id
                        );
 
@@ -1101,7 +1102,7 @@
                                'location_data'                                 
=> $location_data,
                                'location_type'                                 
=> 'form',
                                'form_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'done_action'                                   
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uidocument.' .$from, 'location_code'=> 
$values['location_code'], 'entity_id'=> $values['p_entity_id'], 'cat_id'=> 
$values['p_cat_id'], 'preserve'=> 1)),
+                               'done_action'                                   
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'property.uidocument.' .$from, 'location_code'=> $values['location_code'], 
'entity_id'=> $values['p_entity_id'], 'cat_id'=> $values['p_cat_id'], 
'preserve'=> 1)),
                                'lang_year'                                     
=> lang('Year'),
                                'lang_category'                                 
=> lang('category'),
                                'lang_save'                                     
=> lang('save'),
@@ -1157,14 +1158,14 @@
                                'lang_branch'                                   
=> lang('branch'),
                                'lang_branch_statustext'                        
=> lang('Select the branch for this document'),
 
-                               'edit_action'                                   
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uidocument.edit', 'document_id'=> $document_id, 'from'=> 
$from)),
+                               'edit_action'                                   
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'property.uidocument.edit', 'document_id'=> $document_id, 'from'=> $from)),
                                'lang_edit_statustext'                          
=> lang('Edit this entry'),
                                'lang_edit'                                     
=> lang('Edit')
                        );
 
                        $appname = lang('document');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }

Modified: trunk/property/inc/class.uientity.inc.php
===================================================================
--- trunk/property/inc/class.uientity.inc.php   2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.uientity.inc.php   2008-02-02 13:52:39 UTC (rev 
18466)
@@ -61,13 +61,12 @@
                function property_uientity()
                {
                        $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->nextmatchs                       = 
CreateObject('phpgwapi.nextmatchs');
                        $this->account                          = 
$GLOBALS['phpgw_info']['user']['account_id'];
 
                        $this->bo                               = 
CreateObject('property.boentity',True);
                        $this->bocommon                         = 
CreateObject('property.bocommon');
-                       $this->menu                             = 
CreateObject('property.menu');
 
                        $this->boadmin_entity                   = 
CreateObject('property.boadmin_entity',True);
 
@@ -97,12 +96,19 @@
                        $this->status                           = 
$this->bo->status;
                        $this->fakebase                         = 
$this->bo->fakebase;
                        $this->category_dir                     = 
$this->bo->category_dir;
-                       $this->menu->sub                        
='entity_'.$this->entity_id;
-                       
$GLOBALS['phpgw']->session->appsession('entity_id',$this->currentapp,$this->entity_id);
+                       
$GLOBALS['phpgw']->session->appsession('entity_id','property',$this->entity_id);
                        $this->start_date                       = 
$this->bo->start_date;
                        $this->end_date                         = 
$this->bo->end_date;
                        $this->allrows                          = 
$this->bo->allrows;
+
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
"property::entity_{$this->entity_id}";
+                       if($this->cat_id > 0)
+                       {
+                                
$GLOBALS['phpgw_info']['flags']['menu_selection'] .= 
"::entity_{$this->entity_id}_{$this->cat_id}";
                }
+               }
+               
+               
 
                function save_sessiondata()
                {
@@ -155,7 +161,7 @@
                        {
                                
$GLOBALS['phpgw']->preferences->account_id=$this->account;
                                
$GLOBALS['phpgw']->preferences->read_repository();
-                               
$GLOBALS['phpgw']->preferences->add($this->currentapp,"entity_columns_" . 
$this->entity_id . '_' . $this->cat_id,$values['columns'],'user');
+                               
$GLOBALS['phpgw']->preferences->add('property',"entity_columns_" . 
$this->entity_id . '_' . $this->cat_id,$values['columns'],'user');
                                
$GLOBALS['phpgw']->preferences->save_repository();
 
                                $receipt['message'][] = array('msg' => 
lang('columns is updated'));
@@ -169,7 +175,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uientity.columns',
+                               'menuaction'    => 'property.uientity.columns',
                                'entity_id'     => $this->entity_id,
                                'cat_id'        => $this->cat_id
                        );
@@ -201,14 +207,14 @@
 
                        if(!$this->acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>1, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
                        }
 
                        $file_name      = 
urldecode(phpgw::get_var('file_name'));
                        $loc1           = phpgw::get_var('loc1');
                        $id             = phpgw::get_var('id', 'int');
 
-                       $file = $this->fakebase. SEP . $this->category_dir . 
SEP . $loc1 . SEP . $id . SEP . $file_name;
+                       $file = 
"{$this->fakebase}/{$this->category_dir}/{$loc1}/{$id}/{$file_name}";
 
 //echo 'file: ' . $file . '<br>';
                        if($this->bo->vfs->file_exists(array(
@@ -243,15 +249,12 @@
                {
                        if(!$this->acl_read && $this->cat_id)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>1, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
                        }
 
                        $GLOBALS['phpgw']->xslttpl->add_file(array('entity',
-                                                                       'menu',
                                                                        
'nextmatchs'));
 
-                       $links = $this->menu->links();
-
                        $receipt = 
$GLOBALS['phpgw']->session->appsession('session_data','entity_receipt_' . 
$this->entity_id . '_' . $this->cat_id);
                        
$GLOBALS['phpgw']->session->appsession('session_data','entity_receipt_' . 
$this->entity_id . '_' . $this->cat_id,'');
 
@@ -277,13 +280,13 @@
                                                        {
                                                                
$content[$j]['row'][$i]['statustext']           = lang('search');
                                                                
$content[$j]['row'][$i]['text']                 = 
$entity_entry[$uicols['name'][$i]];
-                                                               
$content[$j]['row'][$i]['link']                 = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uientity.index', 'entity_id'=> $this->entity_id, 'cat_id'=> 
$this->cat_id, 'query'=> $entity_entry['query_location'][$uicols['name'][$i]]));
+                                                               
$content[$j]['row'][$i]['link']                 = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'property.uientity.index', 'entity_id'=> $this->entity_id, 'cat_id'=> 
$this->cat_id, 'query'=> $entity_entry['query_location'][$uicols['name'][$i]]));
                                                        }
                                                        else
                                                        {
                                                                
$content[$j]['row'][$i]['value']                = 
$entity_entry[$uicols['name'][$i]];
                                                                
$content[$j]['row'][$i]['name']                 = $uicols['name'][$i];
-                                                               
if($uicols['input_type'][$i]=='link' && $entity_entry[$uicols['name'][$i]])
+                                                               
if($uicols['datatype'][$i]=='link' && $entity_entry[$uicols['name'][$i]])
                                                                {
                                                                        
$content[$j]['row'][$i]['text']         = lang('link');
                                                                        
$content[$j]['row'][$i]['link']         = $entity_entry[$uicols['name'][$i]];
@@ -298,19 +301,19 @@
                                        {
                                                
$content[$j]['row'][$i]['statustext']                           = lang('view 
the entity');
                                                $content[$j]['row'][$i]['text'] 
                                = lang('view');
-                                               
$content[$j]['row'][$i++]['link']                               = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uientity.view', 'entity_id'=> $this->entity_id, 'cat_id'=> 
$this->cat_id, 'id'=> $entity_entry['id']));
+                                               
$content[$j]['row'][$i++]['link']                               = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'property.uientity.view', 'entity_id'=> $this->entity_id, 'cat_id'=> 
$this->cat_id, 'id'=> $entity_entry['id']));
                                        }
                                        if($this->acl_edit)
                                        {
                                                
$content[$j]['row'][$i]['statustext']                           = lang('edit 
the entity');
                                                $content[$j]['row'][$i]['text'] 
                                = lang('edit');
-                                               
$content[$j]['row'][$i++]['link']                               = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uientity.edit', 'entity_id'=> $this->entity_id, 'cat_id'=> 
$this->cat_id, 'id'=> $entity_entry['id']));
+                                               
$content[$j]['row'][$i++]['link']                               = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'property.uientity.edit', 'entity_id'=> $this->entity_id, 'cat_id'=> 
$this->cat_id, 'id'=> $entity_entry['id']));
                                        }
                                        if($this->acl_delete)
                                        {
                                                
$content[$j]['row'][$i]['statustext']                           = lang('delete 
the entity');
                                                $content[$j]['row'][$i]['text'] 
                                = lang('delete');
-                                               
$content[$j]['row'][$i++]['link']                               = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uientity.delete', 'entity_id'=> $this->entity_id, 
'cat_id'=> $this->cat_id, 'id'=> $entity_entry['id']));
+                                               
$content[$j]['row'][$i++]['link']                               = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'property.uientity.delete', 'entity_id'=> $this->entity_id, 'cat_id'=> 
$this->cat_id, 'id'=> $entity_entry['id']));
                                        }
 
                                        $j++;
@@ -332,7 +335,7 @@
                                                                'sort'  => 
$this->sort,
                                                                'var'   => 
$uicols['name'][$i],
                                                                'order' => 
$this->order,
-                                                               'extra' => 
array('menuaction'   => $this->currentapp.'.uientity.index',
+                                                               'extra' => 
array('menuaction'   => 'property.uientity.index',
                //                                                              
        'type_id'       => $type_id,
                                                                                
        'query'         => $this->query,
                                                                                
        'lookup'        => isset($lookup)?$lookup:'',
@@ -375,13 +378,13 @@
                                (
                                        'lang_add'              => lang('add'),
                                        'lang_add_statustext'   => lang('add a 
entity'),
-                                       'add_action'            => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uientity.edit', 'entity_id'=> $this->entity_id, 'cat_id'=> 
$this->cat_id))
+                                       'add_action'            => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'property.uientity.edit', 'entity_id'=> $this->entity_id, 'cat_id'=> 
$this->cat_id))
                                );
                        }
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uientity.index',
+                               'menuaction'    => 'property.uientity.index',
                                'sort'          => $this->sort,
                                'order'         => $this->order,
                                'cat_id'        => $this->cat_id,
@@ -395,7 +398,7 @@
 
                        $link_excel = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uientity.excel',
+                               'menuaction'    => 'property.uientity.excel',
                                'sort'          => $this->sort,
                                'order'         => $this->order,
                                'entity_id'     => $this->entity_id,
@@ -411,14 +414,14 @@
 
                        $link_columns = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uientity.columns',
+                               'menuaction'    => 'property.uientity.columns',
                                'entity_id'     =>$this->entity_id,
                                'cat_id'        =>$this->cat_id
                        );
 
-                       $link_date_search       = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uiproject.date_search'));
+                       $link_date_search       = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'property.uiproject.date_search'));
 
-                       
if(isset($GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['group_filters'])
 && 
$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['group_filters'])
+                       
if(isset($GLOBALS['phpgw_info']['user']['preferences']['property']['group_filters'])
 && $GLOBALS['phpgw_info']['user']['preferences']['property']['group_filters'])
                        {
                                $group_filters = 'select';
                                
$GLOBALS['phpgw']->xslttpl->add_file(array('search_field_grouped'));
@@ -450,20 +453,20 @@
                        {
                                $category = 
$this->boadmin_entity->read_single_category($this->entity_id,$this->cat_id);
                                $function_msg   = 'list ' . $category['name'];
-                               $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                               $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                                if (isset($category['location_level']) && 
$category['location_level']>0)
                                {
                                        $district_list  = 
$this->bocommon->select_district_list($group_filters,$this->district_id);
                                }
                        }
 
-                       
$GLOBALS['phpgw']->js->validate_file('overlib','overlib',$this->currentapp);
+                       
$GLOBALS['phpgw']->js->validate_file('overlib','overlib','property');
 
                        $msgbox_data = $this->bocommon->msgbox_data($receipt);
 
                        $data = array
                        (
-                               'group_filters'                         => 
isset($GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['group_filters'])?$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['group_filters']:'',
+                               'group_filters'                         => 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['group_filters'])?$GLOBALS['phpgw_info']['user']['preferences']['property']['group_filters']:'',
                                'lang_excel'                            => 
'excel',
                                'link_excel'                            => 
$GLOBALS['phpgw']->link('/index.php',$link_excel),
                                'lang_excel_help'                       => 
lang('Download table to MS Excel'),
@@ -481,7 +484,6 @@
                                'link_date_search'                      => 
$link_date_search,
                                'lang_date_search'                      => 
lang('Date search'),
 
-                               'links'                                         
=> $links,
                                'allow_allrows'                         => true,
                                'allrows'                                       
=> $this->allrows,
                                'start_record'                          => 
$this->start,
@@ -527,7 +529,7 @@
                                $receipt['error'][]=array('msg'=>lang('Please 
select type'));
                                $msgbox_data = 
$this->bocommon->msgbox_data($receipt);
 
-                               $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname;
+                               $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname;
                                
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('empty' => $data));
                        }
                        else
@@ -543,10 +545,10 @@
                {
                        if(!$this->acl_add && !$this->acl_edit)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>2, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>2, 'acl_location'=> $this->acl_location));
                        }
 
-               //      $config         = 
CreateObject('phpgwapi.config',$this->currentapp);
+               //      $config         = 
CreateObject('phpgwapi.config','property');
                        $bolocation     = CreateObject('property.bolocation');
 
                        $id                     = phpgw::get_var('id', 'int');
@@ -566,8 +568,8 @@
 
                        if($_POST && !$bypass)
                        {
-                               $insert_record          = 
$GLOBALS['phpgw']->session->appsession('insert_record',$this->currentapp);
-                               $insert_record_entity   = 
$GLOBALS['phpgw']->session->appsession('insert_record_entity',$this->currentapp);
+                               $insert_record          = 
$GLOBALS['phpgw']->session->appsession('insert_record','property');
+                               $insert_record_entity   = 
$GLOBALS['phpgw']->session->appsession('insert_record_values' . 
$this->acl_location,'property');
 
                                if(is_array($insert_record_entity))
                                {
@@ -642,7 +644,7 @@
 
                        if (isset($values['cancel']) && $values['cancel'])
                        {
-                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uientity.index', 'entity_id'=> $this->entity_id, 'cat_id'=> 
$this->cat_id));
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uientity.index', 'entity_id'=> $this->entity_id, 'cat_id'=> 
$this->cat_id));
                        }
 
                        if ((isset($values['save']) && $values['save']) || 
(isset($values['apply']) && $values['apply']))
@@ -663,7 +665,7 @@
                                {
                                        foreach ($values_attribute as 
$attribute )
                                        {
-                                               if($attribute['allow_null'] != 
'True' && !$attribute['value'])
+                                               if($attribute['nullable'] != 1 
&& !$attribute['value'])
                                                {
                                                        
$receipt['error'][]=array('msg'=>lang('Please enter value for attribute %1', 
$attribute['input_text']));
                                                }
@@ -683,7 +685,7 @@
                                if(isset($_FILES['file']['name']) && 
$_FILES['file']['name'])
                                {
                                        $values['file_name']=str_replace (' 
','_',$_FILES['file']['name']);
-                                       $to_file = $this->fakebase. SEP . 
$this->category_dir . SEP . $values['location']['loc1'] . SEP . $values['id'] . 
SEP . $values['file_name'];
+                                       $to_file = 
"{$this->fakebase}/{$this->category_dir}/{$values['location']['loc1']}/{$values['id']}/{$values['file_name']}";
 
                                        
if((!isset($values['document_name_orig']) || !$values['document_name_orig']) && 
$this->bo->vfs->file_exists(array(
                                                        'string' => $to_file,
@@ -719,7 +721,7 @@
                                        if (isset($values['save']) && 
$values['save'])
                                        {
                                                
$GLOBALS['phpgw']->session->appsession('session_data','entity_receipt_' . 
$this->entity_id . '_' . $this->cat_id,$receipt);
-                                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uientity.index', 'entity_id'=> $this->entity_id, 'cat_id'=> 
$this->cat_id));
+                                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uientity.index', 'entity_id'=> $this->entity_id, 'cat_id'=> 
$this->cat_id));
                                        }
                                }
                                else
@@ -836,7 +838,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uientity.edit',
+                               'menuaction'    => 'property.uientity.edit',
                                'id'            => $id,
                                'entity_id'     => $this->entity_id,
                                'cat_id'        => $this->cat_id
@@ -874,7 +876,7 @@
 
                        $link_file_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uientity.view_file',
+                               'menuaction'    => 
'property.uientity.view_file',
                                'loc1'          => 
$values['location_data']['loc1'],
                                'id'            => $id,
                                'cat_id'        => $this->cat_id,
@@ -895,7 +897,7 @@
 
                        $project_link_data = array
                        (
-                               'menuaction'            => 
$this->currentapp.'.uiproject.edit',
+                               'menuaction'            => 
'property.uiproject.edit',
                                'bypass'                        => true,
                                'location_code'         => 
$values['location_code'],
                                'p_num'                         => 
$values['p_num'],
@@ -908,7 +910,7 @@
 
                        $ticket_link_data = array
                        (
-                               'menuaction'            => 
$this->currentapp.'.uitts.add',
+                               'menuaction'            => 'property.uitts.add',
                                'bypass'                        => true,
                                'location_code'         => 
$values['location_code'],
                                'p_num'                         => 
$values['p_num'],
@@ -977,7 +979,7 @@
                                {
                                        $link_history_data = array
                                        (
-                                               'menuaction'    => 
$this->currentapp.'.uientity.attrib_history',
+                                               'menuaction'    => 
'property.uientity.attrib_history',
                                                'entity_id'     => 
$this->entity_id,
                                                'cat_id'        => 
$this->cat_id,
                                                'attrib_id'     => 
$values['attributes'][$i]['attrib_id'],
@@ -989,8 +991,8 @@
                                }
                        }
 
-                       
$GLOBALS['phpgw']->js->validate_file('overlib','overlib',$this->currentapp);
-                       
$GLOBALS['phpgw']->js->validate_file('dateformat','dateformat',$this->currentapp);
+                       
$GLOBALS['phpgw']->js->validate_file('overlib','overlib','property');
+                       
$GLOBALS['phpgw']->js->validate_file('dateformat','dateformat','property');
                        
                        $table_apply[] = array
                        (
@@ -1051,7 +1053,7 @@
                                'location_data'                                 
=> $location_data,
                                'lookup_type'                                   
=> $lookup_type,
                                'form_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'done_action'                                   
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uientity.index', 'entity_id'=> $this->entity_id, 'cat_id'=> 
$this->cat_id)),
+                               'done_action'                                   
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'property.uientity.index', 'entity_id'=> $this->entity_id, 'cat_id'=> 
$this->cat_id)),
                                'lang_id'                                       
        => lang('ID'),
                                'value_id'                                      
        => $values['id'],
                                'value_num'                                     
        => $values['num'],
@@ -1063,14 +1065,14 @@
 
                                'lang_history_date_statustext'  => lang('Enter 
the date for this reading'),
                                'lang_date'                                     
        => lang('date'),
-                               'help_url'                                      
        => $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uientity.attrib_help', 'entity_id'=> $this->entity_id, 
'cat_id'=> $this->cat_id)),
-                               'lang_help'                                     
        => lang('help'),
                                'table_apply'                                   
=> $table_apply,                                
+                               'textareacols'                                  
=> 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'])
 && $GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'] : 40,
+                               'textarearows'                                  
=> 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'])
 && $GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'] : 6
                        );
 
                        $appname        = $entity['name'];
 //_debug_array($attributes_values);
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -1117,7 +1119,7 @@
                {
                        if(!$this->acl_delete)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>8, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>8, 'acl_location'=> $this->acl_location));
                        }
 
                        $id = phpgw::get_var('id', 'int');
@@ -1125,7 +1127,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uientity.index',
+                               'menuaction'    => 'property.uientity.index',
                                'entity_id'     => $this->entity_id,
                                'cat_id'        => $this->cat_id
                        );
@@ -1141,7 +1143,7 @@
                        $data = array
                        (
                                'done_action'           => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'         => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uientity.delete', 'entity_id'=> $this->entity_id, 
'cat_id'=> $this->cat_id, 'id'=> $id)),
+                               'delete_action'         => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'property.uientity.delete', 'entity_id'=> $this->entity_id, 'cat_id'=> 
$this->cat_id, 'id'=> $id)),
                                'lang_confirm_msg'      => lang('do you really 
want to delete this entry'),
                                'lang_yes'              => lang('yes'),
                                'lang_yes_statustext'   => lang('Delete the 
entry'),
@@ -1152,7 +1154,7 @@
                        $appname                = lang('entity');
                        $function_msg           = lang('delete entity');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -1161,10 +1163,10 @@
                {
                        if(!$this->acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>1, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
                        }
 
-               //      $config         = 
CreateObject('phpgwapi.config',$this->currentapp);
+               //      $config         = 
CreateObject('phpgwapi.config','property');
                        $bolocation                     = 
CreateObject('property.bolocation');
 
                        $id     = phpgw::get_var('id', 'int');
@@ -1174,7 +1176,7 @@
 
                        if ($id)
                        {
-                               $values = 
$this->bo->read_single(array('entity_id'=>$this->entity_id,'cat_id'=>$this->cat_id,'id'=>$id));
+                               $values = 
$this->bo->read_single(array('entity_id'=>$this->entity_id,'cat_id'=>$this->cat_id,'id'=>$id,
 'view' => true));
                        }
 
                        $lookup_type='view';
@@ -1224,7 +1226,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uientity.edit',
+                               'menuaction'    => 'property.uientity.edit',
                                'id'            => $id,
                                'entity_id'     => $this->entity_id,
                                'cat_id'        => $this->cat_id
@@ -1241,7 +1243,7 @@
 
                        $link_file_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uientity.view_file',
+                               'menuaction'    => 
'property.uientity.view_file',
                                'loc1'          => 
$values['location_data']['loc1'],
                                'id'            => $id,
                                'cat_id'        => $this->cat_id,
@@ -1316,7 +1318,7 @@
                                {
                                        $link_history_data = array
                                        (
-                                               'menuaction'    => 
$this->currentapp.'.uientity.attrib_history',
+                                               'menuaction'    => 
'property.uientity.attrib_history',
                                                'entity_id'     => 
$this->entity_id,
                                                'cat_id'        => 
$this->cat_id,
                                                'attrib_id'     => 
$values['attributes'][$i]['attrib_id'],
@@ -1327,7 +1329,7 @@
                                }
                        }
 
-                       
$GLOBALS['phpgw']->js->validate_file('overlib','overlib',$this->currentapp);
+                       
$GLOBALS['phpgw']->js->validate_file('overlib','overlib','property');
 
                        $data = array
                        (
@@ -1357,7 +1359,7 @@
                                'location_data'                                 
=> $location_data,
                                'lookup_type'                                   
=> $lookup_type,
                                'edit_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'done_action'                                   
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uientity.index', 'entity_id'=> $this->entity_id, 'cat_id'=> 
$this->cat_id)),
+                               'done_action'                                   
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'property.uientity.index', 'entity_id'=> $this->entity_id, 'cat_id'=> 
$this->cat_id)),
                                'lang_category'                                 
=> lang('category'),
                                'lang_edit'                                     
=> lang('Edit'),
                                'lang_done'                                     
=> lang('done'),
@@ -1372,11 +1374,12 @@
                                'lang_history'                                  
=> lang('history'),
                                'lang_history_help'                             
=> lang('history of this attribute'),
                                'lang_history_date_statustext'  => lang('Enter 
the date for this reading'),
-
+                               'textareacols'                                  
=> 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'])
 && $GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'] : 40,
+                               'textarearows'                                  
=> 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'])
 && $GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'] : 6
                                );
 
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -1414,7 +1417,7 @@
                        {
                                $link_delete_history_data = array
                                        (
-                                               'menuaction'    => 
$this->currentapp.'.uientity.attrib_history',
+                                               'menuaction'    => 
'property.uientity.attrib_history',
                                                'entity_id'     => 
$data_lookup['entity_id'],
                                                'cat_id'        => 
$data_lookup['cat_id'],
                                                'id'            => 
$data_lookup['id'],
@@ -1452,7 +1455,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uientity.attrib_history',
+                               'menuaction'    => 
'property.uientity.attrib_history',
                                'id'                    => $id,
                                'entity_id'             => $entity_id,
                                'cat_id'                => $cat_id,
@@ -1477,7 +1480,7 @@
                        $appname        = $attrib_data['input_text'];
                        $function_msg   = lang('history');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
//_debug_array($GLOBALS['phpgw_info']['flags']['app_header']);
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('attrib_history' => $data));
                }

Modified: trunk/property/inc/class.uigab.inc.php
===================================================================
--- trunk/property/inc/class.uigab.inc.php      2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.uigab.inc.php      2008-02-02 13:52:39 UTC (rev 
18466)
@@ -58,12 +58,13 @@
                function property_uigab()
                {
                        $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
'property::location::gabnr';
+
+               //      $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->nextmatchs                       = 
CreateObject('phpgwapi.nextmatchs');
                        $this->account                          = 
$GLOBALS['phpgw_info']['user']['account_id'];
                        $this->bo                                       = 
CreateObject('property.bogab',True);
                        $this->bocommon                         = 
CreateObject('property.bocommon');
-                       $this->menu                                     = 
CreateObject('property.menu');
                        $this->bolocation                               = 
CreateObject('property.bolocation');
 
                        $this->config                           = 
CreateObject('phpgwapi.config');
@@ -83,7 +84,6 @@
                        $this->allrows                          = 
$this->bo->allrows;
                        $this->gab_insert_level                 = 
$this->bo->gab_insert_level;
 
-                       $this->menu->sub                        ='location';
                }
 
                function save_sessiondata()
@@ -114,7 +114,7 @@
 
                        if(!$this->acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop','perm'=>1, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop','perm'=>1, 'acl_location'=> $this->acl_location));
                        }
 
                        $gab_list = 
$this->bo->read($location_code,$gaards_nr,$bruksnr,$feste_nr,$seksjons_nr,$address,$check_payments,$allrows=True);
@@ -177,11 +177,10 @@
                {
                        if(!$this->acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>1, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
                        }
 
                        $GLOBALS['phpgw']->xslttpl->add_file(array('gab',
-                                                                               
'menu',
                                                                                
'nextmatchs'));
 
                        $address                = phpgw::get_var('address');
@@ -204,8 +203,6 @@
                                unset($seksjons_nr);
                        }
 
-                       $links = $this->menu->links('gab');
-
                        $gab_list = 
$this->bo->read($location_code,$gaards_nr,$bruksnr,$feste_nr,$seksjons_nr,$address,$check_payments);
 
                        if($this->acl_read)
@@ -214,7 +211,7 @@
                                $lang_view_statustext   = lang('view gab 
detail');
                        }
 
-                       $config         = 
CreateObject('phpgwapi.config',$this->currentapp);
+                       $config         = 
CreateObject('phpgwapi.config','property');
 
                        $config->read_repository();
                        
@@ -258,7 +255,7 @@
                                        'feste_nr'                      => 
$value_feste_nr,
                                        'seksjons_nr'                   => 
$value_seksjons_nr,
                                        'location_code'                 => 
$gab['location_code'],
-                                       'link_view'                     => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>$this->currentapp.'.uigab.list_detail','gab_id'=>$gab['gab_id'])),
+                                       'link_view'                     => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>'property.uigab.list_detail','gab_id'=>$gab['gab_id'])),
                                        'lang_view_statustext'          => 
$lang_view_statustext,
                                        'text_view'                     => 
$text_view,
                                        'link_map'                      => 
$link_to_map . '?maptype=Eiendomskart&gnr=' . (int)$value_gaards_nr . '&bnr=' . 
(int)$value_bruks_nr . '&fnr=' . (int)$value_feste_nr,
@@ -283,7 +280,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   =>      'gab_id',
                                                                                
        'order' =>      $this->order,
-                                                                               
        'extra' => array('menuaction'=> $this->currentapp.'.uigab.index',
+                                                                               
        'extra' => array('menuaction'=> 'property.uigab.index',
                                                                                
                                'cat_id'        =>$this->cat_id,
                                                                                
                        //      'district_id'   => $this->district_id,
                                                                                
                                'filter'        =>$this->filter,
@@ -303,7 +300,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   =>      'hits',
                                                                                
        'order' =>      $this->order,
-                                                                               
        'extra' => array('menuaction'=> $this->currentapp.'.uigab.index',
+                                                                               
        'extra' => array('menuaction'=> 'property.uigab.index',
                                                                                
                                'cat_id'        =>$this->cat_id,
                                                                                
                        //      'district_id'   => $this->district_id,
                                                                                
                                'filter'        =>$this->filter,
@@ -322,7 +319,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   =>      'location_code',
                                                                                
        'order' =>      $this->order,
-                                                                               
        'extra' => array('menuaction'=> $this->currentapp.'.uigab.index',
+                                                                               
        'extra' => array('menuaction'=> 'property.uigab.index',
                                                                                
                                'cat_id'        =>$this->cat_id,
                                                                                
                        //      'district_id'   => $this->district_id,
                                                                                
                                'filter'        =>$this->filter,
@@ -376,13 +373,13 @@
                                (
                                        'lang_add'              => lang('add'),
                                        'lang_add_statustext'   => lang('add a 
gab'),
-                                       'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>$this->currentapp.'.uigab.edit',
 'from'=>'index'))
+                                       'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>'property.uigab.edit', 
'from'=>'index'))
                                );
                        }
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uigab.index',
+                               'menuaction'    => 'property.uigab.index',
                                        'sort'          =>$this->sort,
                                        'order'         =>$this->order,
                                        'cat_id'        =>$this->cat_id,
@@ -399,7 +396,7 @@
 
                        $link_excel = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uigab.excel',
+                               'menuaction'    => 'property.uigab.excel',
                                        'sort'          =>$this->sort,
                                        'order'         =>$this->order,
                                        'cat_id'        =>$this->cat_id,
@@ -423,7 +420,7 @@
                                $record_limit   = $this->bo->total_records;
                        }
 
-                       
$GLOBALS['phpgw']->js->validate_file('overlib','overlib',$this->currentapp);
+                       
$GLOBALS['phpgw']->js->validate_file('overlib','overlib','property');
 
                        $data = array
                        (
@@ -432,7 +429,6 @@
                                'lang_excel_help'                       => 
lang('Download table to MS Excel'),
                                
                                'search_field_header'                   => 
$search_field_header,
-                               'links'                                 => 
$links,
                                'allrows'                               => 
$this->allrows,
                                'allow_allrows'                         => true,
                                'start_record'                          => 
$this->start,
@@ -468,7 +464,7 @@
                        $appname                = lang('gab');
                        $function_msg   = lang('list gab');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_gab' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
@@ -478,17 +474,13 @@
                {
                        if(!$this->acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>1, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
                        }
 
-                       
$GLOBALS['phpgw']->xslttpl->add_file(array('gab','values','table_header',
-                                                                               
'menu',
-                                                                               
'nextmatchs'));
+                       $GLOBALS['phpgw']->xslttpl->add_file(array('gab', 
'values', 'table_header', 'nextmatchs'));
 
                        $gab_id                 = phpgw::get_var('gab_id');
 
-                       $links = $this->menu->links('gab');
-
                        $gab_list = $this->bo->read_detail($gab_id);
 
                        $uicols = $this->bo->uicols;
@@ -511,7 +503,7 @@
                                        {
                                                
$content[$j]['row'][$k]['statustext']                   = lang('view the gab');
                                                $content[$j]['row'][$k]['text'] 
                                = lang('view');
-                                               $content[$j]['row'][$k]['link'] 
                                = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uigab.view', 'gab_id' => $gab_entry['gab_id'], 
'location_code'=>$gab_entry['location_code']));
+                                               $content[$j]['row'][$k]['link'] 
                                = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uigab.view', 'gab_id' => $gab_entry['gab_id'], 
'location_code'=>$gab_entry['location_code']));
                                                $k++;
                                        }
 
@@ -519,7 +511,7 @@
                                        {
                                                
$content[$j]['row'][$k]['statustext']                   = lang('edit the gab');
                                                $content[$j]['row'][$k]['text'] 
                                = lang('edit');
-                                               $content[$j]['row'][$k]['link'] 
                                = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uigab.edit', 'gab_id'=> $gab_entry['gab_id'], 
'location_code'=>$gab_entry['location_code'], 'from'=>'list_detail'));
+                                               $content[$j]['row'][$k]['link'] 
                                = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uigab.edit', 'gab_id'=> $gab_entry['gab_id'], 
'location_code'=>$gab_entry['location_code'], 'from'=>'list_detail'));
                                                $k++;
                                        }
 
@@ -527,7 +519,7 @@
                                        {
                                                
$content[$j]['row'][$k]['statustext']                   = lang('delete the 
gab');
                                                $content[$j]['row'][$k]['text'] 
                                = lang('delete');
-                                               $content[$j]['row'][$k]['link'] 
                                = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uigab.delete', 'gab_id'=> $gab_entry['gab_id'], 
'location_code'=> $gab_entry['location_code']));
+                                               $content[$j]['row'][$k]['link'] 
                                = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uigab.delete', 'gab_id'=> $gab_entry['gab_id'], 'location_code'=> 
$gab_entry['location_code']));
                                                $k++;
                                        }
                                }
@@ -550,7 +542,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   =>      'location_code',
                                                                                
        'order' =>      $this->order,
-                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uigab.index',
+                                                                               
        'extra'         => array('menuaction'   => 'property.uigab.index',
                                                                                
                                                        'type_id'       
=>$type_id,
                                                                                
                                                        'query'         
=>$this->query,
                                                                                
                                                        'lookup'        
=>$lookup,
@@ -566,7 +558,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   =>      'gab_id',
                                                                                
        'order' =>      $this->order,
-                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uigab.index',
+                                                                               
        'extra'         => array('menuaction'   => 'property.uigab.index',
                                                                                
                                                        'type_id'       
=>$type_id,
                                                                                
                                                        'query'         
=>$this->query,
                                                                                
                                                        'lookup'        
=>$lookup,
@@ -582,7 +574,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   =>      'address',
                                                                                
        'order' =>      $this->order,
-                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uigab.index',
+                                                                               
        'extra'         => array('menuaction'   => 'property.uigab.index',
                                                                                
                                                        'type_id'       
=>$type_id,
                                                                                
                                                        'query'         
=>$this->query,
                                                                                
                                                        'lookup'        
=>$lookup,
@@ -631,7 +623,7 @@
                                (
                                        'lang_add'              => lang('add'),
                                        'lang_add_statustext'   => lang('add a 
gab'),
-                                       'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uigab.edit', 'from' => 'list_detail', 'gab_id'=> $gab_id, 
'new'=>true))
+                                       'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uigab.edit', 'from' => 'list_detail', 'gab_id'=> $gab_id, 
'new'=>true))
 
                                );
                        }
@@ -641,12 +633,12 @@
                        (
                                'lang_done'             => lang('done'),
                                'lang_done_statustext'  => lang('back to list'),
-                               'done_action'           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uigab.index'))
+                               'done_action'           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uigab.index'))
                        );
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uigab.list_detail',
+                               'menuaction'    => 'property.uigab.list_detail',
                                                'sort'                  
=>$this->sort,
                                                'order'                 
=>$this->order,
                                                'cat_id'                
=>$this->cat_id,
@@ -677,7 +669,6 @@
                                'lang_feste_nr'                                 
=> lang('Feste nr'),
                                'lang_seksjons_nr'                              
=> lang('Seksjons nr'),
 
-                               'links'                                         
        => $links,
                                'allrows'                                       
        => $this->allrows,
                                'allow_allrows'                                 
=> true,
                                'start_record'                                  
=> $this->start,
@@ -695,7 +686,7 @@
                        $appname                = lang('gab');
                        $function_msg   = lang('list gab detail');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_gab_detail' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
@@ -706,7 +697,7 @@
                {
                        if(!$this->acl_add && !$this->acl_edit)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop','perm'=>2, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop','perm'=>2, 'acl_location'=> $this->acl_location));
                        }
 
                        $from                   = phpgw::get_var('from');
@@ -726,7 +717,7 @@
 
                        if ($values['save'])
                        {
-                               $insert_record          = 
$GLOBALS['phpgw']->session->appsession('insert_record',$this->currentapp);
+                               $insert_record          = 
$GLOBALS['phpgw']->session->appsession('insert_record','property');
                                $values = 
$this->bocommon->collect_locationdata($values,$insert_record);
 
                                $values['gab_id'] = $gab_id;
@@ -795,7 +786,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uigab.edit',
+                               'menuaction'    => 'property.uigab.edit',
                                'gab_id'                        => $gab_id,
                                'location_code'         => $location_code,
                                'from'                          => $from
@@ -803,7 +794,7 @@
 
 
                        
-                       $done_data = array('menuaction'=> 
$this->currentapp.'.uigab.'.$from);
+                       $done_data = array('menuaction'=> 
'property.uigab.'.$from);
                        if($from=='list_detail')
                        {
                                $done_data['gab_id'] = $gab_id;
@@ -855,7 +846,7 @@
 
                        $appname                = lang('gab');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -864,7 +855,7 @@
                {
                        if(!$this->acl_delete)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=> 8, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=> 8, 'acl_location'=> $this->acl_location));
                        }
 
                        $gab_id = phpgw::get_var('gab_id');
@@ -873,7 +864,7 @@
 
                        $link_data = array
                        (
-                               'menuaction' => 
$this->currentapp.'.uigab.list_detail',
+                               'menuaction' => 'property.uigab.list_detail',
                                        'gab_id' => $gab_id
                        );
 
@@ -888,7 +879,7 @@
                        $data = array
                        (
                                'done_action'           => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'         => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uigab.delete', 'gab_id'=> $gab_id, 
'location_code'=>$location_code)),
+                               'delete_action'         => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uigab.delete', 'gab_id'=> $gab_id, 'location_code'=>$location_code)),
                                'lang_confirm_msg'      => lang('do you really 
want to delete this entry'),
                                'lang_yes'              => lang('yes'),
                                'lang_yes_statustext'   => lang('Delete the 
entry'),
@@ -899,7 +890,7 @@
                        $appname                        = lang('gab');
                        $function_msg                   = lang('delete gab 
at:') . ' ' . $location_code;
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -908,7 +899,7 @@
                {
                        if(!$this->acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>1, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
                        }
 
                        $gab_id                 = phpgw::get_var('gab_id');
@@ -956,7 +947,7 @@
 
                                'location_type'                                 
=> $location_type,
                                'location_data'                                 
=> $location_data,
-                               'done_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uigab.list_detail','gab_id' => $gab_id)),
+                               'done_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uigab.list_detail','gab_id' => $gab_id)),
                                'lang_save'                                     
=> lang('save'),
                                'lang_done'                                     
=> lang('done'),
 
@@ -964,14 +955,14 @@
                                'value_remark'                                  
=> $values['remark'],
                                'lang_done_statustext'                          
=> lang('Back to the list'),
 
-                               'edit_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uigab.edit', 'from'=>'list_detail', 'gab_id'=> $gab_id, 
'location_code'=> $location_code)),
+                               'edit_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uigab.edit', 'from'=>'list_detail', 'gab_id'=> $gab_id, 
'location_code'=> $location_code)),
                                'lang_edit_statustext'                          
=> lang('Edit this entry'),
                                'lang_edit'                                     
=> lang('Edit')
                        );
 
                        $appname                = lang('gab');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }

Modified: trunk/property/inc/class.uiifc.inc.php
===================================================================
--- trunk/property/inc/class.uiifc.inc.php      2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.uiifc.inc.php      2008-02-02 13:52:39 UTC (rev 
18466)
@@ -55,13 +55,12 @@
                function uiifc()
                {
                        $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
'property::ifc';
+               //      $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->cats                             = 
CreateObject('phpgwapi.categories');
                        $this->nextmatchs               = 
CreateObject('phpgwapi.nextmatchs');
                        $this->account                  = 
$GLOBALS['phpgw_info']['user']['account_id'];
                        $this->bo                               = 
CreateObject('property.boifc',true);
-                       $this->menu                             = 
CreateObject('property.menu');
-                       $this->menu->sub                ='ifc';
                        $this->acl                              = & 
$GLOBALS['phpgw']->acl;
                        $this->acl_location     = '.ifc';
                        $this->acl_read                         = 
$this->acl->check($this->acl_location,PHPGW_ACL_READ);
@@ -100,16 +99,13 @@
                                $output = 'html';
                        }
                        
-                       $this->menu->sub = 'alternative';
-                       $links = $this->menu->links();
                        if(!$this->acl_read)
                        {
-                               $this->no_access($links);
+                               $this->no_access();
                                return;
                        }
 
-                       
$GLOBALS['phpgw']->xslttpl->add_file(array('ifc','nextmatchs','menu',
-                                                                               
'search_field'));
+                       
$GLOBALS['phpgw']->xslttpl->add_file(array('ifc','nextmatchs','search_field'));
 
                        $ifc_info = $this->bo->read();
 
@@ -140,19 +136,19 @@
                                        {
                                                
$content[$j]['row'][$i]['statustext']                   = lang('view the 
record');
                                                $content[$j]['row'][$i]['text'] 
                                = lang('view');
-                                               
$content[$j]['row'][$i++]['link']                               = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uiifc.view','ifc_id'=> $entry['id']));
+                                               
$content[$j]['row'][$i++]['link']                               = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'property.uiifc.view','ifc_id'=> $entry['id']));
                                        }
                                        if($this->acl_edit)
                                        {
                                                
$content[$j]['row'][$i]['statustext']                   = lang('edit the 
record');
                                                $content[$j]['row'][$i]['text'] 
                                = lang('edit');
-                                               
$content[$j]['row'][$i++]['link']                               = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uiifc.edit', 'ifc_id'=> $entry['id']));
+                                               
$content[$j]['row'][$i++]['link']                               = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'property.uiifc.edit', 'ifc_id'=> $entry['id']));
                                        }
                                        if($this->acl_delete)
                                        {
                                                
$content[$j]['row'][$i]['statustext']                   = lang('delete the 
record');
                                                $content[$j]['row'][$i]['text'] 
                                = lang('delete');
-                                               
$content[$j]['row'][$i++]['link']                               = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uiifc.delete', 'ifc_id'=> $entry['id']));
+                                               
$content[$j]['row'][$i++]['link']                               = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'property.uiifc.delete', 'ifc_id'=> $entry['id']));
                                        }
 
                                        $j++;
@@ -174,7 +170,7 @@
                                                                'sort'  => 
$this->sort,
                                                                'var'   => 
$uicols['name'][$i],
                                                                'order' => 
$this->order,
-                                                               'extra' => 
array('menuaction'   => $this->currentapp.'.uiifc.index',
+                                                               'extra' => 
array('menuaction'   => 'property.uiifc.index',
                                                                                
                'query'                 => $this->query,
                                                                                
                'cat_id'                => $this->cat_id,
                                                                                
                'filter'                => $this->filter,
@@ -215,7 +211,7 @@
                                (
                                        'lang_add'                              
=> lang('add'),
                                        'lang_add_statustext'   => lang('add a 
ifc'),
-                                       'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uiifc.edit','output'=>$output)),
+                                       'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'property.uiifc.edit','output'=>$output)),
                                );
                        }
 
@@ -230,7 +226,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiifc.index',
+                               'menuaction'    => 'property.uiifc.index',
                                'sort'                  => $this->sort,
                                'order'                 => $this->order,
                                'cat_id'                => $this->cat_id,
@@ -244,7 +240,6 @@
                        $data = array
                        (
                                'msgbox_data'                                   
                => $GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'links'                                         
                        => $links,
                                'cat_filter'                                    
                => $this->cats->formatted_xslt_list(array('select_name' => 
'cat_id','selected' => $this->cat_id,'globals' => True,'link_data' => 
$link_data)),
                                'filter_data'                                   
                => $this->nextmatchs->xslt_filter(array('filter' => 
$this->filter,'link_data' => $link_data)),
                                'allow_allrows'                                 
                => True,
@@ -267,7 +262,7 @@
 //_debug_array($data);
                        $function_msg= lang('list ifc values');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp). ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property'). ': ' . $function_msg;
                        
                        if($output == 'wml')
                        {
@@ -279,6 +274,7 @@
 
                function import()
                {
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] .= 
'::import';
                        $acl_location = '.ifc.import';
                        if(!$this->acl->check($acl_location,PHPGW_ACL_ADD))
                        {
@@ -295,7 +291,7 @@
                        {
                                if ((isset($values['save']) && $values['save']) 
|| (isset($values['apply']) && $values['apply']))
                                {
-                                       $insert_record = 
$GLOBALS['phpgw']->session->appsession('insert_record',$this->currentapp);
+                                       $insert_record = 
$GLOBALS['phpgw']->session->appsession('insert_record','property');
                                        $values = 
$this->bocommon->collect_locationdata($values,$insert_record);
 
                                        $ifcfile = 
$_FILES['ifcfile']['tmp_name'];
@@ -315,7 +311,7 @@
                                                if (isset($values['save']) && 
$values['save'])
                                                {
                                                        
$GLOBALS['phpgw']->session->appsession('session_data','ifc_receipt',$receipt);
-                                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiifc.index'));
+                                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uiifc.index'));
                                                }
                                        }
                                }
@@ -325,7 +321,7 @@
                                        {
                                                unlink ($ifcfile);
                                        }
-                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiifc.index'));
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uiifc.index'));
                                }
                        }                               
 
@@ -342,7 +338,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiifc.import'
+                               'menuaction'    => 'property.uiifc.import'
                        );
 
                        $msgbox_data = isset($msgbox_data) ? 
$GLOBALS['phpgw']->common->msgbox_data($receipt) : '';
@@ -408,7 +404,7 @@
                        {
                                if(!$this->acl_edit)
                                {
-                                       $this->no_access($links);
+                                       $this->no_access();
                                        return;
                                }
 
@@ -470,13 +466,13 @@
                                                if (isset($values['save']) && 
$values['save'])
                                                {
                                                        
$GLOBALS['phpgw']->session->appsession('session_data','hrm_training_receipt',$receipt);
-                                                       
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction'=> 
$this->currentapp.'.uiifc.index', 'output'=> $output));
+                                                       
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction'=> 
'property.uiifc.index', 'output'=> $output));
                                                }
                                        }
                                }
                                else
                                {
-                                       
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction'=> 
$this->currentapp.'.uiifc.index', 'output'=> $output));
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction'=> 
'property.uiifc.index', 'output'=> $output));
                                }
                        }
 
@@ -499,7 +495,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiifc.edit',
+                               'menuaction'    => 'property.uiifc.edit',
                                'ifc_id'                => $ifc_id,
                                'output'                => $output
                        );
@@ -541,12 +537,14 @@
                                'lang_access'                                   
=> lang('private'),
                                'value_access'                                  
=> (isset($values['access'])?$values['access']:''),
                                'lang_access_off_statustext'    => lang('The 
note is public. If the note should be private, check this box'),
-                               'lang_access_on_statustext'             => 
lang('The note is private. If the note should be public, uncheck this box')
+                               'lang_access_on_statustext'             => 
lang('The note is private. If the note should be public, uncheck this box'),
+                               'textareacols'                                  
=> 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'])
 && $GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'] : 40,
+                               'textarearows'                                  
=> 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'])
 && $GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'] : 6
                        );
 
                        $appname                = lang('ifc');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        if($output == 'wml')
                        {
                                $GLOBALS['phpgw']->xslttpl->set_output('wml');
@@ -601,19 +599,21 @@
                                'lang_town'                                     
=> lang('town'),
                                'lang_remark'                           => 
lang('remark'),
 
-                               'form_action'                           => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uiifc.index','output'=>$output)),
+                               'form_action'                           => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'property.uiifc.index','output'=>$output)),
                                'lang_cancel'                           => 
lang('cancel'),
                                'value_id'                                      
=> $ifc_id,
                                'lang_category'                         => 
lang('category'),
                                'value_cat'                                     
=> $this->cats->id2name($values['cat_id']),
                                'attributes_values'                     => 
$values['attributes'],
                                'lang_access'                           => 
lang('private'),
-                               'value_access'                          => 
(isset($values['access'])?lang($values['access']):'')
+                               'value_access'                          => 
(isset($values['access'])?lang($values['access']):''),
+                               'textareacols'                          => 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'])
 && $GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'] : 40,
+                               'textarearows'                          => 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'])
 && $GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'] : 6
                        );
 
                        $appname        = lang('ifc');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        if($output == 'wml')
                        {
                                $GLOBALS['phpgw']->xslttpl->set_output('wml');
@@ -642,7 +642,7 @@
 
                        $link_data = array
                        (
-                               'menuaction' => $this->currentapp.'.uiifc.index'
+                               'menuaction' => 'property.uiifc.index'
                        );
 
                        if (phpgw::get_var('confirm', 'bool', 'POST'))
@@ -656,7 +656,7 @@
                        $data = array
                        (
                                'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uiifc.delete', 'ifc_id'=> $ifc_id)),
+                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'property.uiifc.delete', 'ifc_id'=> $ifc_id)),
                                'lang_confirm_msg'              => lang('do you 
really want to delete this entry'),
                                'lang_yes'                              => 
lang('yes'),
                                'lang_yes_statustext'   => lang('Delete the 
entry'),
@@ -667,7 +667,7 @@
                        $appname                = lang('ifc');
                        $function_msg   = lang('delete');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
 
                        if($output == 'wml')
                        {
@@ -677,9 +677,9 @@
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                }
 
-               function no_access($links = '')
+               function no_access()
                {
-                       
$GLOBALS['phpgw']->xslttpl->add_file(array('no_access','menu'));
+                       
$GLOBALS['phpgw']->xslttpl->add_file(array('no_access'));
 
                        $receipt['error'][]=array('msg'=>lang('NO ACCESS'));
 
@@ -688,12 +688,11 @@
                        $data = array
                        (
                                'msgbox_data'   => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'links'                 => $links,
                        );
 
                        $appname        = lang('No access');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('no_access' => $data));
                }
        }

Modified: trunk/property/inc/class.uiinvestment.inc.php
===================================================================
--- trunk/property/inc/class.uiinvestment.inc.php       2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/inc/class.uiinvestment.inc.php       2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -55,12 +55,13 @@
                function property_uiinvestment()
                {
                        $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
'property::invoice::investment';
+
+               //      $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->account                  = 
$GLOBALS['phpgw_info']['user']['account_id'];
 
                        $this->bo                       = 
CreateObject('property.boinvestment',True);
                        $this->bocommon                 = 
CreateObject('property.bocommon');
-                       $this->menu                     = 
CreateObject('property.menu');
                        $this->bolocation               = 
CreateObject('property.bolocation');
                        $this->acl                      = 
CreateObject('phpgwapi.acl');
                        $this->acl_location             = '.invoice';
@@ -78,7 +79,6 @@
                        $this->part_of_town_id          = 
$this->bo->part_of_town_id;
                        $this->allrows                  = $this->bo->allrows;
                        $this->admin_invoice            = 
$this->acl->check('.invoice',16);
-                       $this->menu->sub                ='invoice';
                }
 
                function save_sessiondata()
@@ -101,14 +101,12 @@
                {
                        if(!$this->acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>1, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
                        }
 
                        $GLOBALS['phpgw']->xslttpl->add_file(array('investment',
-                                                                               
'menu',
                                                                                
'nextmatchs'));
 
-                       $links = $this->menu->links('investment');
                        $preserve       = phpgw::get_var('preserve', 'bool');
                        $values         = phpgw::get_var('values');
 
@@ -164,7 +162,7 @@
                                        'index_count'                           
=> $investment['index_count'],
                                        'entity_name'                           
=> $investment['entity_name'],
                                        'this_write_off'                        
=> number_format($investment['this_write_off'], 0, ',', ''),
-                                       'link_history'                          
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiinvestment.history', 'entity_id'=> 
$investment['entity_id'], 'investment_id'=> $investment['investment_id'], 
'entity_type'=> $this->cat_id)),
+                                       'link_history'                          
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiinvestment.history', 'entity_id'=> $investment['entity_id'], 
'investment_id'=> $investment['investment_id'], 'entity_type'=> $this->cat_id)),
                                        'lang_history'                          
=> lang('History'),
                                        'lang_history_statustext'               
=> lang('View/Edit the history'),
                                        'is_admin'                              
=> $this->admin_invoice
@@ -212,12 +210,12 @@
                        (
                                'lang_add'              => lang('Add'),
                                'lang_add_statustext'   => lang('add an 
investment'),
-                               'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiinvestment.add'))
+                               'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiinvestment.add'))
                        );
 
                        $link_data = array
                        (
-                               'menuaction'            => 
$this->currentapp.'.uiinvestment.index',
+                               'menuaction'            => 
'property.uiinvestment.index',
                                'order'                 => $this->order,
                                'sort'                  => $this->sort,
                                'cat_id'                => $this->cat_id,
@@ -239,18 +237,17 @@
 
                        $msgbox_data = $this->bocommon->msgbox_data($receipt);
 
-                       
$GLOBALS['phpgw']->js->validate_file('core','check',$this->currentapp);
+                       
$GLOBALS['phpgw']->js->validate_file('core','check','property');
 
                        $data = array
                        (
                                'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'links'                                         
=> $links,
                                'lang_search'                                   
=> lang('Search'),
                                'lang_search_statustext'                        
=> lang('Search for investment entries'),
 //                             'form_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'form_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiinvestment.index')),
+                               'form_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiinvestment.index')),
                                'lang_select_all'                               
=> lang('Select All'),
-                               'img_check'                                     
=> $GLOBALS['phpgw']->common->get_image_path($this->currentapp).'/check.png',
+                               'img_check'                                     
=> $GLOBALS['phpgw']->common->get_image_path('property').'/check.png',
                                'allow_allrows'                                 
=> true,
                                'allrows'                                       
=> $this->allrows,
                                'start_record'                                  
=> $this->start,
@@ -280,14 +277,14 @@
                                'sum_value'                                     
=> number_format($sum_value, 0, ',', ''),
 
                                'table_update'                                  
=> $table_update,
-                               'update_action'                                 
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiinvestment.index')),
+                               'update_action'                                 
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiinvestment.index')),
                                'table_add'                                     
=> $table_add
                        );
 
                        $appname                = lang('investment');
                        $function_msg           = lang('list investment');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
@@ -322,10 +319,8 @@
                function history()
                {
                        $GLOBALS['phpgw']->xslttpl->add_file(array('investment',
-                                                                               
'menu',
                                                                                
'nextmatchs'));
 
-                       $links = $this->menu->links();
                        $values         = phpgw::get_var('values');
                        $entity_type    = phpgw::get_var('entity_type');
                        $entity_id      = phpgw::get_var('entity_id', 'int');
@@ -364,7 +359,7 @@
                                        'current_index'                         
=> $investment['current_index'],
                                        'index_count'                           
=> $investment['index_count'],
                                        'this_write_off'                        
=> number_format($investment['this_write_off'], 0, ',', ''),
-                                       'link_delete'                           
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiinvestment.delete', 'entity_id'=> $entity_id, 
'investment_id'=> $investment_id, 'index_count'=> $investment['index_count'], 
'entity_type'=> $entity_type)),
+                                       'link_delete'                           
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiinvestment.delete', 'entity_id'=> $entity_id, 'investment_id'=> 
$investment_id, 'index_count'=> $investment['index_count'], 'entity_type'=> 
$entity_type)),
                                        'lang_delete'                           
=> lang('Delete'),
                                        'lang_delete_statustext'                
=> lang('Delete last entry'),
                                        'is_admin'                              
=> $this->admin_invoice
@@ -405,12 +400,12 @@
                        (
                                'lang_done'                             => 
lang('done'),
                                'lang_done_statustext'  => lang('Back to 
investment list '),
-                               'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiinvestment.index', 'preserve'=>1))
+                               'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiinvestment.index', 'preserve'=>1))
                        );
 
                        $link_data = array
                        (
-                               'menuaction'            => 
$this->currentapp.'.uiinvestment.index',
+                               'menuaction'            => 
'property.uiinvestment.index',
                                'order'                 => $this->order,
                                'sort'                  => $this->sort,
                                'cat_id'                => $this->cat_id,
@@ -443,7 +438,6 @@
                                'lang_investment_id'                            
=> lang('Investment Id'),
                                'entity_type'                                   
=> lang($entity_type),
                                'lang_entity_type'                              
=> lang('Entity Type'),
-                               'links'                                         
=> $links,
                                'form_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
                                'allow_allrows'                                 
=> true,
                                'allrows'                                       
=> $this->allrows,
@@ -451,21 +445,21 @@
                                'record_limit'                                  
=> $record_limit,
                                'num_records'                                   
=> count($investment_list),
                                'all_records'                                   
=> $this->bo->total_records,
-                               'link_url'                                      
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiinvestment.history', 'entity_id'=> $entity_id, 
'investment_id'=> $investment_id, 'entity_type'=> $entity_type)),
+                               'link_url'                                      
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiinvestment.history', 'entity_id'=> $entity_id, 'investment_id'=> 
$investment_id, 'entity_type'=> $entity_type)),
                                'img_path'                                      
=> $GLOBALS['phpgw']->common->get_image_path('phpgwapi','default'),
                                'entity_id'                                     
=> $entity_id,
                                'investment_id'                                 
=> $investment_id,
                                'table_header_history'                          
=> $table_header,
                                'values_history'                                
=> $content,
                                'table_update'                                  
=> $table_update,
-                               'update_action'                                 
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiinvestment.history', 'entity_id'=> $entity_id, 
'investment_id'=> $investment_id, 'entity_type'=> $entity_type)),
+                               'update_action'                                 
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiinvestment.history', 'entity_id'=> $entity_id, 'investment_id'=> 
$investment_id, 'entity_type'=> $entity_type)),
                                'table_done'                                    
=> $table_done
                        );
 
                        $appname        = lang('investment');
                        $function_msg   = lang('investment history');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('history' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
 //                     $this->save_sessiondata();
@@ -476,7 +470,7 @@
                {
                        if(!$this->acl_add && !$this->acl_edit)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>2, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>2, 'acl_location'=> $this->acl_location));
                        }
                        $values                                 = 
phpgw::get_var('values');
 
@@ -484,8 +478,8 @@
 
                        if (isset($values['save']) && $values['save'])
                        {
-                               $insert_record = 
$GLOBALS['phpgw']->session->appsession('insert_record',$this->currentapp);
-                               $insert_record_entity = 
$GLOBALS['phpgw']->session->appsession('insert_record_entity',$this->currentapp);
+                               $insert_record = 
$GLOBALS['phpgw']->session->appsession('insert_record','property');
+                               $insert_record_entity = 
$GLOBALS['phpgw']->session->appsession('insert_record_entity','property');
 
                                for ($j=0;$j<count($insert_record_entity);$j++)
                                {
@@ -555,7 +549,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiinvestment.add'
+                               'menuaction'    => 'property.uiinvestment.add'
                        );
 
                        $msgbox_data = $this->bocommon->msgbox_data($receipt);
@@ -579,7 +573,7 @@
                                'lang_select_location_statustext'       => 
lang('select either a location or an entity'),
 
                                'form_action'                           => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiinvestment.index', 'preserve'=>1)),
+                               'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiinvestment.index', 'preserve'=>1)),
 
                                'lang_write_off_period'                 => 
lang('Write off period'),
                                'lang_new'                              => 
lang('New'),
@@ -612,7 +606,7 @@
                        $appname                = lang('investment');
                        $function_msg           = lang('add investment');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        $GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('add' 
=> $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -628,7 +622,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiinvestment.history',
+                               'menuaction'    => 
'property.uiinvestment.history',
                                'entity_id'     => $entity_id,
                                'investment_id' => $investment_id,
                                'index_count'   => $index_count,
@@ -647,7 +641,7 @@
                        $data = array
                        (
                                'done_action'           => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'         => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiinvestment.delete', 'entity_id'=> $entity_id, 
'investment_id'=> $investment_id, 'index_count'=> $index_count, 'entity_type'=> 
$entity_type)),
+                               'delete_action'         => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiinvestment.delete', 'entity_id'=> $entity_id, 'investment_id'=> 
$investment_id, 'index_count'=> $index_count, 'entity_type'=> $entity_type)),
                                'lang_confirm_msg'      => lang('do you really 
want to delete this entry'),
                                'lang_yes'              => lang('yes'),
                                'lang_yes_statustext'   => lang('Delete the 
entry'),
@@ -658,7 +652,7 @@
                        $appname        = lang('investment');
                        $function_msg   = lang('delete investment history 
element');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }

Modified: trunk/property/inc/class.uiinvoice.inc.php
===================================================================
--- trunk/property/inc/class.uiinvoice.inc.php  2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.uiinvoice.inc.php  2008-02-02 13:52:39 UTC (rev 
18466)
@@ -64,13 +64,13 @@
                function property_uiinvoice()
                {
                        $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
'property::invoice';
+               //      $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->nextmatchs               = 
CreateObject('phpgwapi.nextmatchs');
                        $this->account                  = 
$GLOBALS['phpgw_info']['user']['account_id'];
 
                        $this->bo                       = 
CreateObject('property.boinvoice',True);
                        $this->bocommon                 = 
CreateObject('property.bocommon');
-                       $this->menu                     = 
CreateObject('property.menu');
 
                        $this->start                    = $this->bo->start;
                        $this->query                    = $this->bo->query;
@@ -90,7 +90,6 @@
                        $this->acl_edit                 = 
$this->acl->check('.invoice',4);
                        $this->acl_delete               = 
$this->acl->check('.invoice',8);
 
-                       $this->menu->sub                ='invoice';
                }
 
                function save_sessiondata()
@@ -193,10 +192,10 @@
                {
                        if(!$this->acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>1, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
                        }
 
-                       
$GLOBALS['phpgw']->xslttpl->add_file(array('invoice','menu',
+                       $GLOBALS['phpgw']->xslttpl->add_file(array('invoice',
                                                                                
'nextmatchs',
                                                                                
'search_field'));
 
@@ -210,6 +209,11 @@
                        $voucher_id     = phpgw::get_var('voucher_id', 'int');
                        $b_account_class= phpgw::get_var('b_account_class', 
'int');
                        
+                       if ( $paid )
+                       {
+                               
$GLOBALS['phpgw_info']['flags']['menu_selection'] .= '::paid';
+                       }
+               
                        $start_date=urldecode($start_date);
                        $end_date=urldecode($end_date);
 
@@ -219,8 +223,6 @@
                                $start_date = $end_date;
                        }
 
-                       $links = $this->menu->links('invoice_'.!!$paid);
-
                        $values  = phpgw::get_var('values');
                        $receipt = array();
                        
@@ -241,21 +243,21 @@
                                        $sum                                    
                        = $sum + $extra['amount'];
                                        $content[$i]['amount']                  
        = number_format($extra['amount'], 2, ',', ' ');
                                        $content[$i]['lang_payment_date']       
= lang('Payment Date');
-                                       $content[$i]['link_sub']                
        = $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiinvoice.list_sub', 'user_lid'=> $this->user_lid, 
'query'=> $this->query));
+                                       $content[$i]['link_sub']                
        = $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiinvoice.list_sub', 'user_lid'=> $this->user_lid, 'query'=> 
$this->query));
                                        $content[$i]['lang_sub']                
        = lang('Voucher ID');
                                        $content[$i]['lang_sub_help']           
= lang('Klick this link to enter the list of sub-invoices');
-                                       $content[$i]['link_period']             
= $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiinvoice.edit_period'));
+                                       $content[$i]['link_period']             
= $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiinvoice.edit_period'));
                                        $content[$i]['lang_period']             
= lang('Period');
                                        $content[$i]['lang_period_help']        
= lang('Klick this link to edit the period');
 
                                        if($this->acl_delete && !$paid)
                                        {
-                                               $content[$i]['link_delete']     
                        = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiinvoice.delete', 'voucher_id'=> $extra['voucher_id']));
+                                               $content[$i]['link_delete']     
                        = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiinvoice.delete', 'voucher_id'=> $extra['voucher_id']));
                                                
$content[$i]['lang_delete_statustext']  = lang('delete the voucher');
                                                $content[$i]['text_delete']     
                        = lang('delete');
                                        }
 
-                                       $content[$i]['link_front']              
                = $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiinvoice.receipt', 'voucher_id'=> $extra['voucher_id']));
+                                       $content[$i]['link_front']              
                = $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiinvoice.receipt', 'voucher_id'=> $extra['voucher_id']));
                                        $content[$i]['lang_front_statustext']   
= lang('A printout version of the frontpage');
                                        $content[$i]['text_front']              
                = 'F';
 
@@ -271,7 +273,7 @@
                                                                                
                        'var'   => 'bilagsnr',
                                                                                
                        'order' => $this->order,
                                                                                
                        'extra' => array(
-                                                                               
                                        'menuaction'            => 
$this->currentapp.'.uiinvoice.index',
+                                                                               
                                        'menuaction'            => 
'property.uiinvoice.index',
                                                                                
                                        'cat_id'                => 
$this->cat_id,
                                                                                
                                        'sub'                   => $this->sub,
                                                                                
                                        'paid'                  => $paid,
@@ -289,7 +291,7 @@
                                                                                
                        'sort'  => $this->sort,
                                                                                
                        'var'   => 'fakturadato',
                                                                                
                        'order' => $this->order,
-                                                                               
                        'extra' => array('menuaction' => 
$this->currentapp.'.uiinvoice.index',
+                                                                               
                        'extra' => array('menuaction' => 
'property.uiinvoice.index',
                                                                                
                                                        'cat_id'                
=> $this->cat_id,
                                                                                
                                                        'sub'                   
=> $this->sub,
                                                                                
                                                        'paid'                  
=> $paid,
@@ -309,7 +311,7 @@
                                                                                
                        'sort'  => $this->sort,
                                                                                
                        'var'   => 'spvend_code',
                                                                                
                        'order' => $this->order,
-                                                                               
                        'extra' => array('menuaction' => 
$this->currentapp.'.uiinvoice.index',
+                                                                               
                        'extra' => array('menuaction' => 
'property.uiinvoice.index',
                                                                                
                                                        'cat_id'                
=> $this->cat_id,
                                                                                
                                                        'sub'                   
=> $this->sub,
                                                                                
                                                        'paid'                  
=> $paid,
@@ -343,7 +345,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'            => 
$this->currentapp.'.uiinvoice.index',
+                               'menuaction'            => 
'property.uiinvoice.index',
                                'order'                         => $this->order,
                                'sort'                          => $this->sort,
                                'cat_id'                        => 
$this->cat_id,
@@ -367,7 +369,7 @@
                                (
                                        'lang_add'                              
=> lang('add'),
                                        'lang_add_statustext'   => lang('add an 
invoice'),
-                                       'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiinvoice.add'))
+                                       'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiinvoice.add'))
                                );
                        }
 
@@ -385,7 +387,7 @@
 
                        $link_excel = array
                        (
-                               'menuaction'            => 
$this->currentapp.'.uiinvoice.excel',
+                               'menuaction'            => 
'property.uiinvoice.excel',
                                'order'                         => $this->order,
                                'sort'                          => $this->sort,
                                'cat_id'                        => 
$this->cat_id,
@@ -404,8 +406,8 @@
                                'district_id'           => $this->district_id
                        );
 
-                       
$GLOBALS['phpgw']->js->validate_file('overlib','overlib',$this->currentapp);
-                       
$GLOBALS['phpgw']->js->validate_file('core','check',$this->currentapp);
+                       
$GLOBALS['phpgw']->js->validate_file('overlib','overlib','property');
+                       
$GLOBALS['phpgw']->js->validate_file('core','check','property');
 
                        $data['lang_excel']                                     
        = 'excel';
                        $data['link_excel']                                     
        = $GLOBALS['phpgw']->link('/index.php',$link_excel);
@@ -413,7 +415,6 @@
 
                        $data['msgbox_data']                                    
= $GLOBALS['phpgw']->common->msgbox($msgbox_data);
                        $data['sum']                                            
        = number_format($sum, 2, ',', '');
-                       $data['links']                                          
        = $links;
                        $data['allow_allrows']                                  
= true;
                        $data['allrows']                                        
        = $this->allrows;
                        $data['start_record']                                   
= $this->start;
@@ -439,7 +440,7 @@
                        $appname        = lang('invoice');
                        $function_msg   = lang('list voucher');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
 
                        if (isset($paid) && $paid)
                        {
@@ -463,10 +464,10 @@
                                $data['lang_workorder_statustext']              
= lang('enter the Workorder ID to search by workorder - at any date');
                                $data['workorder_id']                           
        = $workorder_id;
 
-                               $data['addressbook_link']                       
        = $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilookup.vendor'));
+                               $data['addressbook_link']                       
        = $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uilookup.vendor'));
                                $data['lang_select_vendor_statustext']  = 
lang('Select the vendor by klicking this link');
                                $data['lang_vendor']                            
        = lang('Vendor');
-                               $data['property_link']                          
        = $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.index', 'lookup'=> 1, 'type_id'=> 1, 
'lookup_name'=> 0));
+                               $data['property_link']                          
        = $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uilocation.index', 'lookup'=> 1, 'type_id'=> 1, 'lookup_name'=> 0));
                                $data['lang_select_property_statustext']= 
lang('Select the property by klicking this link');
                                $data['lang_property_statustext']               
= lang('Search by property');
                                $data['lang_property']                          
        = lang('property');
@@ -493,9 +494,9 @@
                                $data['user_list']                              
                = 
$this->bo->get_invoice_user_list('filter',$this->user_lid,array('all'),$default='none');
                                $data['cat_list']                               
                = $this->bo->select_category('filter',$this->cat_id);
                                $data['table_done']                             
                = $table_done;
-                               $data['img_check']                              
                = 
$GLOBALS['phpgw']->common->get_image_path($this->currentapp).'/check.png';
+                               $data['img_check']                              
                = 
$GLOBALS['phpgw']->common->get_image_path('property').'/check.png';
                                $data['lang_save']                              
                = lang('save');
-                               $data['done_action']                            
        = $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiinvoice.index'));
+                               $data['done_action']                            
        = $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiinvoice.index'));
                                $data['lang_done_statustext']                   
= lang('Back to the list');
                                $data['lang_save_statustext']                   
= lang('Save the voucher');
                                $data['lang_select_all']                        
        = lang('Select All');
@@ -514,13 +515,11 @@
 
                function list_sub()
                {
-                       
$GLOBALS['phpgw']->xslttpl->add_file(array('invoice','menu',
+                       $GLOBALS['phpgw']->xslttpl->add_file(array('invoice',
                                                                                
'nextmatchs'));
 
                        $paid = phpgw::get_var('paid', 'bool');
 
-                       $links = $this->menu->links('invoice_');
-
                        $values  = phpgw::get_var('values');
                        $voucher_id = phpgw::get_var('voucher_id', 'int');
 
@@ -553,10 +552,10 @@
                                        $content[$i]['dimb_list']               
                = $this->bo->select_dimb_list($content[$i]['dimb']);
                                        $content[$i]['tax_code_list']           
        = $this->bo->tax_code_list($content[$i]['tax_code']);
                                        $content[$i]['lang_remark']             
        = lang('Remark');
-                                       $content[$i]['link_remark']             
        = $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiinvoice.remark'));
+                                       $content[$i]['link_remark']             
        = $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiinvoice.remark'));
                                        $content[$i]['lang_remark_help']        
        = lang('Klick this link to view the remark');
-                                       $content[$i]['link_order']              
                = $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiinvoice.view_order'));
-                                       $content[$i]['link_claim']              
                = $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uitenant_claim.check'));
+                                       $content[$i]['link_order']              
                = $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiinvoice.view_order'));
+                                       $content[$i]['link_claim']              
                = $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uitenant_claim.check'));
                                        $i++;
                                }
                        }
@@ -569,7 +568,7 @@
                                                                                
                        'sort'  => $this->sort,
                                                                                
                        'var'   => 'pmwrkord_code',
                                                                                
                        'order' => $this->order,
-                                                                               
                        'extra' => array('menuaction'   => 
$this->currentapp.'.uiinvoice.list_sub',
+                                                                               
                        'extra' => array('menuaction'   => 
'property.uiinvoice.list_sub',
                                                                                
                                        'cat_id'        => $this->cat_id,
                                                                                
                                        'sub'           => $this->sub,
                                                                                
                                        'paid'          => $paid,
@@ -582,7 +581,7 @@
                                                                                
                        'sort'  => $this->sort,
                                                                                
                        'var'   => 'spbudact_code',
                                                                                
                        'order' => $this->order,
-                                                                               
                        'extra' => array('menuaction'   => 
$this->currentapp.'.uiinvoice.list_sub',
+                                                                               
                        'extra' => array('menuaction'   => 
'property.uiinvoice.list_sub',
                                                                                
                                        'cat_id'        => $this->cat_id,
                                                                                
                                        'sub'           => $this->sub,
                                                                                
                                        'paid'          => $paid,
@@ -596,7 +595,7 @@
                                                                                
                        'sort'  => $this->sort,
                                                                                
                        'var'   => 'belop',
                                                                                
                        'order' => $this->order,
-                                                                               
                        'extra' => array('menuaction'   => 
$this->currentapp.'.uiinvoice.list_sub',
+                                                                               
                        'extra' => array('menuaction'   => 
'property.uiinvoice.list_sub',
                                                                                
                                        'cat_id'        => $this->cat_id,
                                                                                
                                        'sub'           => $this->sub,
                                                                                
                                        'paid'          => $paid,
@@ -614,7 +613,7 @@
                                                                                
                        'sort'  => $this->sort,
                                                                                
                        'var'   =>      'dima',
                                                                                
                        'order' =>      $this->order,
-                                                                               
                        'extra'         => array('menuaction'   => 
$this->currentapp.'.uiinvoice.list_sub',
+                                                                               
                        'extra'         => array('menuaction'   => 
'property.uiinvoice.list_sub',
                                                                                
                                                'cat_id'        => 
$this->cat_id,
                                                                                
                                                'sub'           => $this->sub,
                                                                                
                                                'paid'          => $paid,
@@ -636,7 +635,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'            => 
$this->currentapp.'.uiinvoice.list_sub',
+                               'menuaction'            => 
'property.uiinvoice.list_sub',
                                'order'                 => $this->order,
                                'sort'                  => $this->sort,
                                'cat_id'                => $this->cat_id,
@@ -665,13 +664,13 @@
 
                        $link_excel = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiinvoice.excel_sub',
+                               'menuaction'    => 
'property.uiinvoice.excel_sub',
                                'voucher_id'    => $voucher_id,
                                'paid'          => $paid
                        );
 
-                       
$GLOBALS['phpgw']->js->validate_file('overlib','overlib',$this->currentapp);
-                       
$GLOBALS['phpgw']->js->validate_file('core','check',$this->currentapp);
+                       
$GLOBALS['phpgw']->js->validate_file('overlib','overlib','property');
+                       
$GLOBALS['phpgw']->js->validate_file('core','check','property');
 
                        $data = array
                        (
@@ -680,16 +679,15 @@
                                'link_excel'                                    
=> $GLOBALS['phpgw']->link('/index.php',$link_excel),
                                'lang_excel_help'                               
=> lang('Download table to MS Excel'),
 
-                               'img_check'                                     
=> $GLOBALS['phpgw']->common->get_image_path($this->currentapp).'/check.png',
+                               'img_check'                                     
=> $GLOBALS['phpgw']->common->get_image_path('property').'/check.png',
                                'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
                                'sum'                                           
=> number_format($sum, 2, ',', ''),
                                'form_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
                                'lang_save'                                     
=> lang('save'),
                                'lang_done'                                     
=> lang('Done'),
-                               'done_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiinvoice.index', 'user_lid'=> $this->user_lid, 'query'=> 
$this->query)),
+                               'done_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiinvoice.index', 'user_lid'=> $this->user_lid, 'query'=> 
$this->query)),
                                'lang_done_statustext'                          
=> lang('Back to the list'),
                                'lang_save_statustext'                          
=> lang('Save the voucher'),
-                               'links'                                         
=> $links,
                                'allow_allrows'                                 
=> false,
                                'start_record'                                  
=> $this->start,
                                'record_limit'                                  
=> 
count($content),//$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'],
@@ -713,7 +711,7 @@
 
                        $appname = lang('invoice');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_invoice_sub' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
@@ -740,7 +738,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiinvoice.edit_period',
+                               'menuaction'    => 
'property.uiinvoice.edit_period',
                                'voucher_id'    => $voucher_id);
 
 
@@ -782,14 +780,16 @@
                        $appname        = lang('invoice');
                        $function_msg   = lang('remark');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('remark' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
 
                function consume()
                {
-                       
$GLOBALS['phpgw']->xslttpl->add_file(array('invoice','menu',
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] .= 
'::consume';
+
+                       $GLOBALS['phpgw']->xslttpl->add_file(array('invoice',
                                                                                
'nextmatchs',
                                                                                
'search_field'));
 
@@ -821,8 +821,6 @@
                                }
                        }
 
-                       $links = $this->menu->links('consume');
-
                        $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
 //_debug_array($values);
                        if(!$submit_search)
@@ -846,7 +844,7 @@
                                        $p_end_date = 
$GLOBALS['phpgw']->common->show_date(mktime(0,0,0,($content[$i]['period']+1),0,$p_year),$dateformat);
                                        $sum                            = 
$sum+$content[$i]['consume'];
                                        $content[$i]['link_voucher']    = 
$GLOBALS['phpgw']->link('/index.php',array(
-                                                                               
                                'menuaction'    => 
$this->currentapp.'.uiinvoice.index',
+                                                                               
                                'menuaction'    => 'property.uiinvoice.index',
                                                                                
                                'paid'          => true,
                                                                                
                                'user_lid'      => 'all',
                                                                                
                                'district_id'   => $district_id,
@@ -877,7 +875,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'            => 
$this->currentapp.'.uiinvoice.consume',
+                               'menuaction'            => 
'property.uiinvoice.consume',
                                'order'                 => $this->order,
                                'sort'                  => $this->sort,
                                'cat_id'                => $this->cat_id,
@@ -888,11 +886,10 @@
                                'filter'                => $this->filter
                        );
 
-                       
$GLOBALS['phpgw']->js->validate_file('overlib','overlib',$this->currentapp);
+                       
$GLOBALS['phpgw']->js->validate_file('overlib','overlib','property');
 
                        $data['lang_sum']                               = 
lang('Sum');
                        $data['sum']                                    = 
number_format($sum, 0, ',', ' ');
-                       $data['links']                                  = 
$links;
                        $data['allow_allrows']                          = false;
                        $data['start_record']                           = 
$this->start;
                        $data['record_limit']                           = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
@@ -936,14 +933,14 @@
                        $data['lang_workorder_statustext']              = 
lang('enter the Workorder ID to search by workorder - at any date');
                        $data['workorder_id']                           = 
$workorder_id;
 
-                       $data['addressbook_link']                       = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilookup.vendor'));
+                       $data['addressbook_link']                       = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uilookup.vendor'));
                        $data['lang_select_vendor_statustext']          = 
lang('Select the vendor by klicking this link');
                        $data['lang_vendor']                            = 
lang('Vendor');
 
                        $bolocation                                     = 
CreateObject('property.bolocation');
                        $location_data                                  = 
$bolocation->initiate_ui_location(array('type_id'=> 1));
 
-                       $data['property_link']                          = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.index', 'lookup'=> 1, 'type_id'=> 1, 
'lookup_name'=> 0));
+                       $data['property_link']                          = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uilocation.index', 'lookup'=> 1, 'type_id'=> 1, 'lookup_name'=> 0));
 
                        $data['lang_select_property_statustext']        = 
lang('Select the property by klicking this link');
                        $data['lang_property_statustext']               = 
lang('Search by property');
@@ -959,7 +956,7 @@
                        $appname                                        = 
lang('consume');
                        $function_msg                                   = 
lang('list consume');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('consume' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
 
@@ -970,7 +967,7 @@
                {
                        if(!$this->acl_delete)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>8, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>8, 'acl_location'=> $this->acl_location));
                        }
 
                        $voucher_id = phpgw::get_var('voucher_id', 'int');
@@ -978,7 +975,7 @@
 
                        $link_data = array
                        (
-                               'menuaction' => 
$this->currentapp.'.uiinvoice.index'
+                               'menuaction' => 'property.uiinvoice.index'
                        );
 
                        if (phpgw::get_var('confirm', 'bool', 'POST'))
@@ -992,7 +989,7 @@
                        $data = array
                        (
                                'done_action'           => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'         => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiinvoice.delete', 'voucher_id'=> $voucher_id)),
+                               'delete_action'         => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiinvoice.delete', 'voucher_id'=> $voucher_id)),
                                'lang_confirm_msg'      => lang('do you really 
want to delete this entry'),
                                'lang_yes'              => lang('yes'),
                                'lang_yes_statustext'   => lang('Delete the 
entry'),
@@ -1003,7 +1000,7 @@
                        $appname        = lang('invoice');
                        $function_msg   = lang('delete voucher');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -1012,14 +1009,16 @@
                {
                        if(!$this->acl_add)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>2, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>2, 'acl_location'=> $this->acl_location));
                        }
 
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] .= 
'::add';
+
                        $receipt = 
$GLOBALS['phpgw']->session->appsession('session_data','add_receipt');
 
                        if(isset($receipt['voucher_id']) && 
$receipt['voucher_id'])
                        {
-                               $link_receipt = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiinvoice.receipt', 'voucher_id'=> $receipt['voucher_id']));
+                               $link_receipt = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiinvoice.receipt', 'voucher_id'=> $receipt['voucher_id']));
                        }
 
                        
$GLOBALS['phpgw']->session->appsession('session_data','add_receipt','');
@@ -1028,7 +1027,7 @@
 
                        $referer = parse_url($_SERVER['HTTP_REFERER']);
                        parse_str($referer['query']); // produce $menuaction
-                       if(phpgw::get_var('cancel', 'bool') || $menuaction != 
$this->currentapp.'.uiinvoice.add')
+                       if(phpgw::get_var('cancel', 'bool') || $menuaction != 
'property.uiinvoice.add')
                        {
                                
$GLOBALS['phpgw']->session->appsession('session_data','add_values','');
                        }
@@ -1061,7 +1060,7 @@
                                $values['amount']               = 
phpgw::get_var('amount', 'float');
                                $values['order_id']             = 
phpgw::get_var('order_id', 'int');
 
-                               $insert_record = 
$GLOBALS['phpgw']->session->appsession('insert_record',$this->currentapp);
+                               $insert_record = 
$GLOBALS['phpgw']->session->appsession('insert_record','property');
                                $values = 
$this->bocommon->collect_locationdata($values,$insert_record);
 
                                
$GLOBALS['phpgw']->session->appsession('session_data','add_values',$values);
@@ -1077,8 +1076,6 @@
                        $add_invoice                    = 
phpgw::get_var('add_invoice', 'bool');
 
 
-                       $links = $this->menu->links('add_inv');
-
                        if($location_code)
                        {
                                $values['location_data'] = 
$bolocation->read_single($location_code,array('tenant_id'=>$tenant_id,'p_num'=>$p_num));
@@ -1169,7 +1166,7 @@
                                        }
                                        unset($values);
                                        
$GLOBALS['phpgw']->session->appsession('session_data','add_receipt',$receipt);
-                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiinvoice.add'));
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uiinvoice.add'));
                                }
                                else
                                {
@@ -1198,7 +1195,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiinvoice.add',
+                               'menuaction'    => 'property.uiinvoice.add',
                                'debug'         => True
                        );
 
@@ -1220,16 +1217,15 @@
                        $data = array
                        (
                                'msgbox_data'                                   
        => $GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'links'                                         
                => $links,
 
                                'img_cal'                                       
                => $GLOBALS['phpgw']->common->image('phpgwapi','cal'),
                                'lang_datetitle'                                
        => lang('Select date'),
 
                                'form_action'                                   
        => $GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'cancel_action'                                 
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiinvoice.index')),
+                               'cancel_action'                                 
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiinvoice.index')),
                                'lang_cancel'                                   
        => lang('Cancel'),
                                'lang_cancel_statustext'                        
=> lang('cancel'),
-                               'action_url'                                    
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=>  
$this->currentapp .'.uiinvoice.add')),
+                               'action_url'                                    
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=>  
'property' .'.uiinvoice.add')),
                                'tsvfilename'                                   
        => '',
 
                                'lang_add'                                      
                => lang('add'),
@@ -1246,7 +1242,7 @@
                                'lang_kid_nr_statustext'                        
=> lang('Enter Kid nr'),
 
                                'lang_vendor'                                   
        => lang('Vendor'),
-                               'addressbook_link'                              
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilookup.vendor')),
+                               'addressbook_link'                              
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uilookup.vendor')),
 
                                'lang_invoice_date_statustext'          => 
lang('Enter the invoice date'),
                                'lang_num_days_statustext'                      
=> lang('Enter the payment date or the payment delay'),
@@ -1322,12 +1318,12 @@
 
 //_debug_array($data);
 
-                       
$GLOBALS['phpgw']->xslttpl->add_file(array('invoice','menu'));
+                       $GLOBALS['phpgw']->xslttpl->add_file(array('invoice'));
 
                        $appname                                                
= lang('Invoice');
                        $function_msg                                   = 
lang('Add invoice');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        $GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('add' 
=> $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -1337,7 +1333,7 @@
 
                        if(!$this->acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>1, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
                        }
 
                        $GLOBALS['phpgw_info']['flags'][noheader] = True;
@@ -1360,7 +1356,9 @@
                                $contacts->role='vendor';
                                if($values[0]['vendor_id'])
                                {
-                                       $vendor_data    = 
$contacts->read_single(array('actor_id'=>$values[0]['vendor_id']));
+                                       $custom                                 
        = createObject('phpgwapi.custom_fields');       
+                                       $vendor_data['attributes']      = 
$custom->get_attribs('property','.vendor', 0, '', 'ASC', 'attrib_sort', true, 
true);
+                                       $vendor_data                            
= $contacts->read_single($values[0]['vendor_id'],$vendor_data);
                                        if(is_array($vendor_data))
                                        {
                                                
foreach($vendor_data['attributes'] as $attribute)
@@ -1536,17 +1534,17 @@
                        $GLOBALS['phpgw_info']['flags'][nofooter] = True;
                        $GLOBALS['phpgw_info']['flags']['noframework'] = True;
 
-                       
$GLOBALS['phpgw']->xslttpl->add_file(array('invoice','menu','table_header'));
+                       
$GLOBALS['phpgw']->xslttpl->add_file(array('invoice','table_header'));
                        
                        $link_data_add = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiinvoice.add',
+                               'menuaction'    => 'property.uiinvoice.add',
                                'add_invoice'   => True
                        );
 
                        $link_data_cancel = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiinvoice.add'
+                               'menuaction'    => 'property.uiinvoice.add'
                        );
 
                        $post_data = array
@@ -1662,7 +1660,7 @@
                        $appname                                                
= lang('Invoice');
                        $function_msg                                   = 
lang('Add invoice: Debug');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('debug' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -1676,10 +1674,10 @@
                        switch($order_type)
                        {
                                case 'workorder':
-                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiwo_hour.view', 'no_email'=> true, 'show_cost'=> true, 
'workorder_id'=> $order_id));
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uiwo_hour.view', 'no_email'=> true, 'show_cost'=> true, 
'workorder_id'=> $order_id));
                                        break;
                                case 's_agreement':
-                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uis_agreement.view', 'id'=> $order_id));
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uis_agreement.view', 'id'=> $order_id));
                                        break;
                        }
                }

Modified: trunk/property/inc/class.uilocation.inc.php
===================================================================
--- trunk/property/inc/class.uilocation.inc.php 2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.uilocation.inc.php 2008-02-02 13:52:39 UTC (rev 
18466)
@@ -60,12 +60,11 @@
                function property_uilocation()
                {
                        $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
'property::location';
                        $this->nextmatchs                       = 
CreateObject('phpgwapi.nextmatchs');
                        $this->account                          = 
$GLOBALS['phpgw_info']['user']['account_id'];
                        $this->bo                                       = 
CreateObject('property.bolocation',True);
                        $this->bocommon                         = 
CreateObject('property.bocommon');
-                       $this->menu                                     = 
CreateObject('property.menu');
                        $this->soadmin_location         = 
CreateObject('property.soadmin_location');
 
                        $this->acl                                      = & 
$GLOBALS['phpgw']->acl;
@@ -91,8 +90,6 @@
                        $this->type_id                          = 
$this->bo->type_id;
                        $this->allrows                          = 
$this->bo->allrows;
                        $this->lookup                           = 
$this->bo->lookup;
-
-                       $this->menu->sub                        ='location';
                }
 
                function save_sessiondata()
@@ -149,7 +146,7 @@
                        {
                                
$GLOBALS['phpgw']->preferences->account_id=$this->account;
                                
$GLOBALS['phpgw']->preferences->read_repository();
-                               
$GLOBALS['phpgw']->preferences->add($this->currentapp,"location_columns_" . 
$this->type_id,$values['columns'],'user');
+                               
$GLOBALS['phpgw']->preferences->add('property',location_columns_ . 
$this->type_id . !!$this->lookup,$values['columns'],'user');
                                
$GLOBALS['phpgw']->preferences->save_repository();
 
                                $receipt['message'][] = array('msg' => 
lang('columns is updated'));
@@ -159,8 +156,9 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uilocation.columns',
-                               'type_id'       => $this->type_id
+                               'menuaction'    => 
'property.uilocation.columns',
+                               'type_id'               => $this->type_id,
+                               'lookup'                => $this->lookup
                        );
 
 
@@ -187,16 +185,14 @@
                        if(!$this->acl_read)
                        {
                                
$GLOBALS['phpgw']->redirect_link('/index.php',array(
-                                                                       
'menuaction'=> $this->currentapp.'.uilocation.stop',
+                                                                       
'menuaction'=> 'property.uilocation.stop',
                                                                        
'perm'=>1,
                                                                        
'acl_location'=> $this->acl_location
                                                                        )
                                                                );
                        }
 
-                       $GLOBALS['phpgw_info']['apps']['manual']['section'] = 
'location';
                        $GLOBALS['phpgw']->xslttpl->add_file(array('location',
-                                                                               
'menu',
                                                                                
'nextmatchs',
                                                                                
'search_field'));
 
@@ -205,19 +201,26 @@
                        $lookup_name    = phpgw::get_var('lookup_name');
                        $lookup_tenant  = phpgw::get_var('lookup_tenant', 
'bool');
 
-                       
$GLOBALS['phpgw']->js->validate_file('overlib','overlib',$this->currentapp);
+                       
$GLOBALS['phpgw']->js->validate_file('overlib','overlib','property');
                        
$GLOBALS['phpgw']->js->set_onload('document.search.query.focus();');
 
                        if(!$type_id)
                        {
-                               $type_id=1;
+                               $type_id = 1;
                        }
                        if($lookup)
                        {
                                $GLOBALS['phpgw_info']['flags']['noframework'] 
= True;
                        }
-                       $links = $this->menu->links('location'.$type_id . '_' . 
!!$lookup_tenant);
 
+                       if ( $type_id && !$lookup_tenant )
+                       {
+                               
$GLOBALS['phpgw_info']['flags']['menu_selection'] .= "::loc_$type_id";
+                       }
+                       else
+                       {
+                               
$GLOBALS['phpgw_info']['flags']['menu_selection'] .= '::tenant';
+                       }
 
                        $location_list = 
$this->bo->read(array('type_id'=>$type_id,'lookup_tenant'=>$lookup_tenant,'lookup'=>$lookup,'allrows'=>$this->allrows));
 
@@ -227,7 +230,7 @@
 
                        $content = array();
                        $j=0;
-                       if (isSet($location_list) AND is_array($location_list))
+                       if (isSet($location_list) && is_array($location_list))
                        {
                                foreach($location_list as $location)
                                {
@@ -241,7 +244,7 @@
                                                                
$content[$j]['row'][$i]['statustext']                   = lang('search');
                                                                
$content[$j]['row'][$i]['text']                         = 
$location[$uicols['name'][$i]];
                                                                
$content[$j]['row'][$i]['link']                         = 
$GLOBALS['phpgw']->link('/index.php',array(
-                                                                               
                                                                        
'menuaction'    => $this->currentapp.'.uilocation.index',
+                                                                               
                                                                        
'menuaction'    => 'property.uilocation.index',
                                                                                
                                                                        'query' 
        => $location['query_location'][$uicols['name'][$i]],
                                                                                
                                                                        
'lookup'        => $lookup,
                                                                                
                                                                        
'type_id'       => $type_id,
@@ -276,7 +279,7 @@
                                                        
$content[$j]['row'][$i]['statustext']                   = lang('view the 
location');
                                                        
$content[$j]['row'][$i]['text']                         = lang('view');
                                                        
$content[$j]['row'][$i]['link']                         = 
$GLOBALS['phpgw']->link('/index.php',array(
-                                                                               
                                                                'menuaction'=> 
$this->currentapp.'.uilocation.view',
+                                                                               
                                                                'menuaction'=> 
'property.uilocation.view',
                                                                                
                                                                
'location_code'=> $location['location_code'],
                                                                                
                                                                
'lookup_tenant'=>$lookup_tenant
                                                                                
                                                                )
@@ -289,7 +292,7 @@
                                                        
$content[$j]['row'][$i]['statustext']                   = lang('edit the 
location');
                                                        
$content[$j]['row'][$i]['text']                         = lang('edit');
                                                        
$content[$j]['row'][$i]['link']                         = 
$GLOBALS['phpgw']->link('/index.php',array(
-                                                                               
                                                                'menuaction'=> 
$this->currentapp.'.uilocation.edit',
+                                                                               
                                                                'menuaction'=> 
'property.uilocation.edit',
                                                                                
                                                                
'location_code'=> $location['location_code'],
                                                                                
                                                                
'lookup_tenant'=>$lookup_tenant
                                                                                
                                                                )
@@ -302,7 +305,7 @@
                                                        
$content[$j]['row'][$i]['statustext']                   = lang('delete the 
location');
                                                        
$content[$j]['row'][$i]['text']                         = lang('delete');
                                                        
$content[$j]['row'][$i]['link']                         = 
$GLOBALS['phpgw']->link('/index.php',array(
-                                                                               
                                                                'menuaction'=> 
$this->currentapp.'.uilocation.delete',
+                                                                               
                                                                'menuaction'=> 
'property.uilocation.delete',
                                                                                
                                                                
'location_code'=> $location['location_code'],
                                                                                
                                                                'type_id'=> 
$type_id,
                                                                                
                                                                
'lookup_tenant'=>$lookup_tenant
@@ -330,7 +333,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'fm_location1.loc1',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction' => $this->currentapp.'.uilocation.index',
+                                                                               
        'extra' => array('menuaction' => 'property.uilocation.index',
                                                                                
                                                        'type_id'               
=> $type_id,
                                                                                
                                                        'query'                 
=> $this->query,
                                                                                
                                                        'district_id'           
=> $this->district_id,
@@ -350,7 +353,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'street_name',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uilocation.index',
+                                                                               
        'extra' => array('menuaction'   => 'property.uilocation.index',
                                                                                
                                                        'type_id'               
=> $type_id,
                                                                                
                                                        'query'                 
=> $this->query,
                                                                                
                                                        'district_id'           
=> $this->district_id,
@@ -370,7 +373,7 @@
                                                                'sort'  => 
$this->sort,
                                                                'var'   => 
$uicols['name'][$i],
                                                                'order' => 
$this->order,
-                                                               'extra' => 
array('menuaction'   => $this->currentapp.'.uilocation.index',
+                                                               'extra' => 
array('menuaction'   => 'property.uilocation.index',
                                                                                
                                                        'type_id'               
=> $type_id,
                                                                                
                                                        'query'                 
=> $this->query,
                                                                                
                                                        'district_id'           
=> $this->district_id,
@@ -425,7 +428,7 @@
                                        'lang_add'              => lang('add'),
                                        'lang_add_statustext'   => lang('add a 
location'),
                                        'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array(
-                                                                               
                        'menuaction'=> $this->currentapp.'.uilocation.edit',
+                                                                               
                        'menuaction'=> 'property.uilocation.edit',
                                                                                
                        'type_id'=>$type_id
                                                                                
                        )
                                                                                
          )
@@ -434,7 +437,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'            => 
$this->currentapp.'.uilocation.index',
+                               'menuaction'            => 
'property.uilocation.index',
                                'sort'                  => $this->sort,
                                'order'                 => $this->order,
                                'cat_id'                => $this->cat_id,
@@ -449,7 +452,7 @@
                                'status'                => $this->status
                        );
 
-                       $input_name             = 
$GLOBALS['phpgw']->session->appsession('lookup_fields',$this->currentapp);
+                       $input_name             = 
$GLOBALS['phpgw']->session->appsession('lookup_fields','property');
 
                        $function_exchange_values = '';
                        if(is_array($input_name))
@@ -473,7 +476,7 @@
 //_debug_array($input_name);
                        $link_excel = array
                        (
-                               'menuaction'            => 
$this->currentapp.'.uilocation.excel',
+                               'menuaction'            => 
'property.uilocation.excel',
                                'sort'                  => $this->sort,
                                'order'                 => $this->order,
                                'cat_id'                => $this->cat_id,
@@ -491,8 +494,9 @@
 
                        $link_columns = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uilocation.columns',
-                               'type_id'               => $type_id
+                               'menuaction'    => 
'property.uilocation.columns',
+                               'type_id'               => $type_id,
+                               'lookup'                => $this->lookup
                        );
 
                        if(!$this->allrows)
@@ -504,7 +508,7 @@
                                $record_limit   = $this->bo->total_records;
                        }
 
-                       
if(isset($GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['property_filter'])
 && 
$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['property_filter']
 == 'owner')
+                       
if(isset($GLOBALS['phpgw_info']['user']['preferences']['property']['property_filter'])
 && 
$GLOBALS['phpgw_info']['user']['preferences']['property']['property_filter'] == 
'owner')
                        {
                                $owner_list = 
$this->bo->get_owner_list('filter', $this->filter);
                        }
@@ -531,7 +535,6 @@
                                'lang_select'                           => 
lang('select'),
                                'lookup'                                => 
$lookup,
                                'lang_property_name'                    => 
lang('Property name'),
-                               'links'                                 => 
$links,
                                'allow_allrows'                         => True,
                                'allrows'                               => 
$this->allrows,
                                'start_record'                          => 
$this->start,
@@ -578,7 +581,7 @@
 
                        if($lookup)
                        {
-                               $lookup_list    = 
$GLOBALS['phpgw']->session->appsession('lookup_name',$this->currentapp);
+                               $lookup_list    = 
$GLOBALS['phpgw']->session->appsession('lookup_name','property');
                                $function_msg   = $lookup_list[$lookup_name];
                        }
                        else
@@ -593,7 +596,7 @@
                                }
                        }
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
@@ -605,7 +608,7 @@
                        if(!$this->acl_add && !$this->acl_edit)
                        {
                                
$GLOBALS['phpgw']->redirect_link('/index.php',array(
-                                                                       
'menuaction'=> $this->currentapp.'.uilocation.stop',
+                                                                       
'menuaction'=> 'property.uilocation.stop',
                                                                        
'perm'=>2,
                                                                        
'acl_location'=>$this->acl_location
                                                                        )
@@ -617,12 +620,12 @@
                        $lookup_tenant          = 
phpgw::get_var('lookup_tenant', 'bool');
                        $location_code          = 
phpgw::get_var('location_code');
                        $values_attribute       = 
phpgw::get_var('values_attribute');
-                       $location = split('-',$location_code);
+                       $location                       = 
explode('-',$location_code);
 
-                       $insert_record = 
$GLOBALS['phpgw']->session->appsession('insert_record',$this->currentapp);
-                       
$GLOBALS['phpgw']->session->appsession('insert_record',$this->currentapp,'');
+                       $insert_record = 
$GLOBALS['phpgw']->session->appsession('insert_record','property');
+                       
$GLOBALS['phpgw']->session->appsession('insert_record','property','');
 
-                       $values = false;
+                       $values = array();
                        if(isset($_POST['save']))
                        {
                                if(isset($insert_record['location']) && 
is_array($insert_record['location']))
@@ -633,14 +636,36 @@
                                        }
                                }
 
+                               if(isset($insert_record['extra']) && 
is_array($insert_record['extra']))
+                               {
                                for ($i=0; $i<count($insert_record['extra']); 
$i++)
                                {
                                        $values[$insert_record['extra'][$i]]= 
$_POST[$insert_record['extra'][$i]];
                                }
                        }
 
+                               $insert_record_attributes       = 
$GLOBALS['phpgw']->session->appsession('insert_record_values' . '.location.' . 
$this->type_id,'property');
+
+                               if(is_array($insert_record_attributes))
+                               {
+                                       for 
($j=0;$j<count($insert_record_attributes);$j++)
+                                       {
+                                               
$insert_record['extra'][$insert_record_attributes[$j]]  = 
$insert_record_attributes[$j];
+                                       }
+                               }
+                       }
+
                        $type_id                = $this->type_id;
 
+                       if ( $type_id && !$lookup_tenant )
+                       {
+                               
$GLOBALS['phpgw_info']['flags']['menu_selection'] .= "::loc_$type_id";
+                       }
+                       else
+                       {
+                               
$GLOBALS['phpgw_info']['flags']['menu_selection'] .= '::tenant';
+                       }
+                       
                        if($location_code)
                        {
                                $type_id = count($location);
@@ -648,7 +673,7 @@
 
                        
$GLOBALS['phpgw']->xslttpl->add_file(array('location','attributes_form'));
 
-                       if (is_array($values) )
+                       if ($values)
                        {
                                for ($i=1; $i<($type_id+1); $i++)
                                {
@@ -671,15 +696,15 @@
                                        
$receipt['error'][]=array('msg'=>lang('Please select a category'));
                                }
 
-                               if 
(array_search('street_id',$insert_record['extra']) && 
(!isset($values['street_id']) || !$values['street_id']))
+                               if (isset($insert_record['extra']) && 
array_search('street_id',$insert_record['extra']) && 
(!isset($values['street_id']) || !$values['street_id']))
                                {
                                        
$receipt['error'][]=array('msg'=>lang('Please select a street'));
                                }
-                               if 
(array_search('part_of_town_id',$insert_record['extra']) && 
(!isset($values['part_of_town_id']) || !$values['part_of_town_id']))
+                               if (isset($insert_record['extra']) && 
array_search('part_of_town_id',$insert_record['extra']) && 
(!isset($values['part_of_town_id']) || !$values['part_of_town_id']))
                                {
                                        
$receipt['error'][]=array('msg'=>lang('Please select a part of town'));
                                }
-                               if 
(array_search('owner_id',$insert_record['extra']) && 
(!isset($values['owner_id']) || !$values['owner_id']))
+                               if (isset($insert_record['extra']) && 
array_search('owner_id',$insert_record['extra']) && 
(!isset($values['owner_id']) || !$values['owner_id']))
                                {
                                        
$receipt['error'][]=array('msg'=>lang('Please select an owner'));
                                }
@@ -723,6 +748,8 @@
                                                
$location_code_parent=implode("-", $location_parent);
                                                $values = 
$this->bo->read_single($location_code_parent);
                                                /* restore date from posting */
+                                               
if(isset($insert_record['extra']) && is_array($insert_record['extra']))
+                                               {
                                                for ($i=0; 
$i<count($insert_record['extra']); $i++)
                                                {
                                                        
$values[$insert_record['extra'][$i]]= $_POST[$insert_record['extra'][$i]];
@@ -730,10 +757,12 @@
                                        }
                                }
                        }
+                       }
 
                        if(!isset($error_id) && $location_code)
                        {
                                $values = 
$this->bo->read_single($location_code,array('tenant_id'=>'lookup'));
+
                                $check_history = 
$this->bo->check_history($location_code);
                                if($get_history)
                                {
@@ -741,7 +770,7 @@
                                        $uicols = $this->bo->uicols;
 
                                        $j=0;
-                                       if (isSet($history) AND 
is_array($history))
+                                       if (isSet($history) && 
is_array($history))
                                        {
                                                foreach($history as $entry)
                                                {
@@ -774,11 +803,17 @@
                                        }
                                }
                        }
-                       else
+                       /* Preserve attribute values from post */
+                       if(isset($receipt['error']) && (isset( 
$values_attribute) && is_array( $values_attribute)))
                        {
+                               $values = 
$this->bocommon->preserve_attribute_values($values,$values_attribute);
                                unset($values['location_code']);
                        }
 
+                       if(!$values)
+                       {
+                               $values['attributes'] = 
$this->bo->custom->get_attribs('property','.location.' . $this->type_id, 0, '', 
'ASC', 'attrib_sort', true, true);
+                       }
 
                        if ($values['cat_id'] > 0)
                        {
@@ -787,7 +822,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uilocation.edit',
+                               'menuaction'    => 'property.uilocation.edit',
                                'location_code' => $location_code,
                                'type_id'       => $type_id,
                                'lookup_tenant' => $lookup_tenant
@@ -817,8 +852,7 @@
 
                        $function_msg .= ' ' 
.$location_types[($type_id-1)]['name'];
 
-                       $custom_fields  = 
$this->soadmin_location->read_attrib(array('type_id'=>$type_id,'allrows'=>True));
-                       $insert_record = 
$GLOBALS['phpgw']->session->appsession('insert_record',$this->currentapp);
+                       $insert_record = 
$GLOBALS['phpgw']->session->appsession('insert_record','property');
 
                        if(!is_array($insert_record))
                        {
@@ -831,7 +865,7 @@
                        $additional_fields[$j]['datatype']              = 
'varchar';
                        $additional_fields[$j]['input_name']    = 'loc' . 
$type_id;
                        $additional_fields[$j]['name']                  = 'loc' 
. $type_id;
-                       $additional_fields[$j]['value']                 = 
(isset($values[$additional_fields[$j]['input_name']])?$values[$additional_fields[$j]['input_name']]:'');
+                       $additional_fields[$j]['value']                 = 
isset($values[$additional_fields[$j]['input_name']])?$values[$additional_fields[$j]['input_name']]:'';
                        $additional_fields[$j]['class']                 = 
'th_text';
                        $insert_record['extra'][]                               
= $additional_fields[$j]['input_name'];
 
@@ -841,145 +875,13 @@
                        $additional_fields[$j]['datatype']              = 
'varchar';
                        $additional_fields[$j]['input_name']    = 'loc' . 
$type_id . '_name';
                        $additional_fields[$j]['name']                  = 'loc' 
. $type_id . '_name';
-                       $additional_fields[$j]['value']                 = 
(isset($values[$additional_fields[$j]['input_name']])?$values[$additional_fields[$j]['input_name']]:'');
+                       $additional_fields[$j]['value']                 = 
isset($values[$additional_fields[$j]['input_name']])?$values[$additional_fields[$j]['input_name']]:'';
                        $insert_record['extra'][]                               
= $additional_fields[$j]['input_name'];
                        $j++;
 
 
-                       $contacts                       = 
CreateObject('phpgwapi.contacts');
 
-                       $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
-                       $sep = '/';
-                       $dlarr[strpos($dateformat,'Y')] = 'Y';
-                       $dlarr[strpos($dateformat,'m')] = 'm';
-                       $dlarr[strpos($dateformat,'d')] = 'd';
-                       ksort($dlarr);
-
-                       $dateformat= (implode($sep,$dlarr));
-
-                       $input_type_array = array(
-                               'R' => 'radio',
-                               'CH' => 'checkbox',
-                               'LB' => 'listbox'
-                       );
-
-                       $vendor = CreateObject('property.soactor');
-                       $vendor->role = 'vendor';
-
-                       $r=0;
-                       $m=0;
-                       while (is_array($custom_fields) && list(,$custom) = 
each($custom_fields))
-                       {
-                               $location_datatype[]= array(
-                                       'input_name'    => 
$custom['column_name'],
-                                       'datatype'      => $custom['datatype']
-                                       );
-
-                               $attributes_values[$r]['attrib_id']             
= $custom['id'];
-                               $attributes_values[$r]['id']                    
= $custom['id'];
-                               $attributes_values[$r]['input_text']    = 
$custom['input_text'];
-                               $attributes_values[$r]['statustext']    = 
$custom['statustext'];
-                               $attributes_values[$r]['datatype']              
= $custom['datatype'];
-                               $attributes_values[$r]['name']                  
= $custom['column_name'];
-                               $attributes_values[$r]['input_name']    = 
$custom['column_name'];
-                               $attributes_values[$r]['value']                 
= $values[$custom['column_name']];
-                               
-                               /* Preserve attribute values from post */
-                               if(isset($receipt['error']) && (isset( 
$values_attribute) && is_array( $values_attribute)))
-                               {
-                                       $attributes_values[$r]['value'] = 
$values_attribute[$r]['value'];
-                               }
-
-                               if($attributes_values[$r]['datatype']=='D' && 
$attributes_values[$r]['value'])
-                               {
-                                       $timestamp_date= 
mktime(0,0,0,date(m,strtotime($attributes_values[$r]['value'])),date(d,strtotime($attributes_values[$r]['value'])),date(y,strtotime($attributes_values[$r]['value'])));
-                                       $attributes_values[$r]['value'] = 
$GLOBALS['phpgw']->common->show_date($timestamp_date,$dateformat);
-                               }
-                               if($attributes_values[$r]['datatype']=='AB')
-                               {
-                                       if($attributes_values[$r]['value'])
-                                       {
-                                               $contact_data   = 
$contacts->read_single_entry($attributes_values[$r]['value'],array('n_given'=>'n_given','n_family'=>'n_family','email'=>'email'));
-                                               
$attributes_values[$r]['contact_name']  = $contact_data[0]['n_family'] . ', ' . 
$contact_data[0]['n_given'];
-                                       }
-
-                                       $functions[$m]['name'] = 'lookup_'. 
$attributes_values[$r]['name'] .'()';
-                                       $functions[$m]['link'] = "menuaction:'" 
. $this->currentapp.".uilookup.addressbook',"
-                                                                               
                        . "column:'" . $attributes_values[$r]['name'] . "'";
-                                       $functions[$m]['action'] = 
'Window1=window.open(strURL,"Search","width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");';
-                                       $m++;
-                               }
-
-                               if($attributes_values[$r]['datatype']=='VENDOR')
-                               {
-                                       if($attributes_values[$r]['value'])
-                                       {
-                                               $vendor_data    = 
$vendor->read_single(array('actor_id'=>$attributes_values[$r]['value']));
-
-                                               for 
($n=0;$n<count($vendor_data['attributes']);$n++)
-                                               {
-                                                       
if($vendor_data['attributes'][$n]['name'] == 'org_name')
-                                                       {
-                                                               
$attributes_values[$r]['vendor_name']= $vendor_data['attributes'][$n]['value'];
-                                                               $n 
=count($vendor_data['attributes']);
-                                                       }
-                                               }
-                                       }
-
-                                       $functions[$m]['name'] = 'lookup_'. 
$attributes_values[$r]['name'] .'()';
-                                       $functions[$m]['link'] = "menuaction:'" 
. $this->currentapp.".uilookup.vendor',"
-                                                                               
                        . "column:'" . $attributes_values[$r]['name'] . "'";    
                                                                                
        
-
-                                       $functions[$m]['action'] = 
'Window1=window.open(strURL,"Search","width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");';
-                                       $m++;
-                               }
-
-
-                               if($attributes_values[$r]['datatype']=='R' || 
$attributes_values[$r]['datatype']=='CH' || 
$attributes_values[$r]['datatype']=='LB')
-                               {
-                                       $attributes_values[$r]['choice'] = 
$this->soadmin_location->read_attrib_choice($type_id,$attributes_values[$r]['id']);
-                                       
$input_type=$input_type_array[$attributes_values[$r]['datatype']];
-
-                                       
if($attributes_values[$r]['datatype']=='CH')
-                                       {
-                                               
$attributes_values[$r]['value']=unserialize($attributes_values[$r]['value']);
-                                               
$attributes_values[$r]['choice'] = 
$this->bocommon->select_multi_list_2($attributes_values[$r]['value'],$attributes_values[$r]['choice'],$input_type);
-
-                                       }
-                                       else
-                                       {
-                                               for 
($j=0;$j<count($attributes_values[$r]['choice']);$j++)
-                                               {
-                                                       
$attributes_values[$r]['choice'][$j]['input_type']=$input_type;
-                                                       
if($attributes_values[$r]['choice'][$j]['id']==$attributes_values[$r]['value'])
-                                                       {
-                                                               
$attributes_values[$r]['choice'][$j]['checked']='checked';
-                                                       }
-                                               }
-                                       }
-                               }
-
-                               $attributes_values[$r]['datatype_text'] = 
$this->bocommon->translate_datatype($attributes_values[$r]['datatype']);
-                               $attributes_values[$r]['counter']       = $r;
-                               $attributes_values[$r]['type_id']       = 
$type_id;
-                               $r++;
-
-                               if(isset($functions) && is_array($functions))
-                               {
-                                       for ($j=0;$j<count($functions);$j++)
-                                       {
-                                               $lookup_functions .= 
"\t".'function ' . $functions[$j]['name'] ."\n";
-                                               $lookup_functions .= 
"\t".'{'."\n";
-                                               $lookup_functions .= "\t\tvar 
oArgs = {" . $functions[$j]['link'] ."};" . "\n";
-                                               $lookup_functions .= "\t\tvar 
strURL = phpGWLink('index.php', oArgs);\n";
-                                               $lookup_functions .= 
"\t\t".$functions[$j]['action'] ."\n";
-                                               $lookup_functions .= 
"\t".'}'."\n";
-                                       }
-                               }
-                       }
-
 //_debug_array($attributes_values);
-                       
$GLOBALS['phpgw']->session->appsession('location_datatype',$this->currentapp,$location_datatype);
 
                        $insert_record['extra'][]                               
                = 'cat_id';
 
@@ -1022,37 +924,8 @@
                                }
                        }
 
-                       
$GLOBALS['phpgw']->session->appsession('insert_record',$this->currentapp,$insert_record);
+                       
$GLOBALS['phpgw']->session->appsession('insert_record','property',$insert_record);
 
-
-                       $dateformat = 
strtolower($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
-                       $sep = '/';
-                       $dlarr[strpos($dateformat,'y')] = 'yyyy';
-                       $dlarr[strpos($dateformat,'m')] = 'MM';
-                       $dlarr[strpos($dateformat,'d')] = 'DD';
-                       ksort($dlarr);
-
-                       $dateformat= (implode($sep,$dlarr));
-
-                       switch(substr($dateformat,0,1))
-                       {
-                               case 'M':
-                                       $dateformat_validate= 
"javascript:vDateType='1'";
-                                       $onKeyUp        = 
"DateFormat(this,this.value,event,false,'1')";
-                                       $onBlur         = 
"DateFormat(this,this.value,event,true,'1')";
-                                       break;
-                               case 'y':
-                                       
$dateformat_validate="javascript:vDateType='2'";
-                                       $onKeyUp        = 
"DateFormat(this,this.value,event,false,'2')";
-                                       $onBlur         = 
"DateFormat(this,this.value,event,true,'2')";
-                                       break;
-                               case 'D':
-                                       
$dateformat_validate="javascript:vDateType='3'";
-                                       $onKeyUp        = 
"DateFormat(this,this.value,event,false,'3')";
-                                       $onBlur         = 
"DateFormat(this,this.value,event,true,'3')";
-                                       break;
-                       }
-
                        if(isset($receipt))
                        {
                                $msgbox_data = 
$this->bocommon->msgbox_data($receipt);
@@ -1073,7 +946,7 @@
                                                        $entities_link[] = array
                                                        (
                                                                'entity_link'   
                => $GLOBALS['phpgw']->link('/index.php',array(
-                                                                               
                                        'menuaction'=> 
$this->currentapp.'.uilocation.edit',
+                                                                               
                                        'menuaction'=> 
'property.uilocation.edit',
                                                                                
                                        
'location_code'=>implode('-',array_slice($location, 0, $location_type['id']))
                                                                                
                                        )
                                                                                
                                ),
@@ -1086,7 +959,7 @@
                                                        $entities_link[] = array
                                                        (
                                                                'entity_link'   
                => $GLOBALS['phpgw']->link('/index.php',array(
-                                                                               
                                        'menuaction'=> 
$this->currentapp.'.uilocation.index',
+                                                                               
                                        'menuaction'=> 
'property.uilocation.index',
                                                                                
                                        'type_id'=> $location_type['id'],
                                                                                
                                        
'query'=>implode('-',array_slice($location, 0, $location_type['id']))
                                                                                
                                        )
@@ -1100,7 +973,7 @@
 
                                $entities= 
$this->bo->read_entity_to_link($location_code);
 
-                               if (isset($entities) AND is_array($entities))
+                               if (isset($entities) && is_array($entities))
                                {
                                        foreach($entities as $entity_entry)
                                        {
@@ -1118,7 +991,7 @@
                                                        $entities_link[] = array
                                                        (
                                                                'entity_link'   
                => $GLOBALS['phpgw']->link('/index.php',array(
-                                                                               
                                                'menuaction'=> 
$this->currentapp.'.uientity.index',
+                                                                               
                                                'menuaction'=> 
'property.uientity.index',
                                                                                
                                                'entity_id'=> 
$entity_entry['entity_id'],
                                                                                
                                                'cat_id'=> 
$entity_entry['cat_id'],
                                                                                
                                                'query'=> $location_code
@@ -1132,8 +1005,6 @@
                                }
                        }
 
-                       
$GLOBALS['phpgw']->js->validate_file('dateformat','dateformat',$this->currentapp);
-
                        $data = array
                        (
                                'lang_change_type'                              
=> lang('Change type'),
@@ -1162,16 +1033,13 @@
                                'lang_select_owner'                             
=> (isset($lang_select_owner)?$lang_select_owner:''),
                                'lang_owner_statustext'                 => 
(isset($lang_owner_statustext)?$lang_owner_statustext:''),
                                'additional_fields'                             
=> $additional_fields,
-                               'attributes_values'                             
=> $attributes_values,
+                               'attributes_values'                             
=> $values['attributes'],
                                'lookup_functions'                              
=> (isset($lookup_functions)?$lookup_functions:''),
                                'lang_none'                                     
        => lang('None'),
 
                                'msgbox_data'                                   
=> (isset($msgbox_data)?$GLOBALS['phpgw']->common->msgbox($msgbox_data):''),
-                               'lang_dateformat'                               
=> lang(strtolower($dateformat)),
-                               'dateformat_validate'                   => 
$dateformat_validate,
-                               'onKeyUp'                                       
        => $onKeyUp,
-                               'onBlur'                                        
        => $onBlur,
-                               'street_link'                                   
=> "menuaction:'" . $this->currentapp.".uilookup.street'",
+
+                               'street_link'                                   
=> "menuaction:'" . 'property'.".uilookup.street'",
                                'lang_street'                                   
=> lang('Street'),
                                'lang_select_street_help'               => 
lang('Select the street name'),
                                'lang_street_num_statustext'    => lang('Enter 
the street number'),
@@ -1179,7 +1047,7 @@
                                'value_street_name'                             
=> (isset($values['street_name'])?$values['street_name']:''),
                                'value_street_number'                   => 
(isset($values['street_number'])?$values['street_number']:''),
 
-                               'tenant_link'                                   
=> "menuaction:'" . $this->currentapp.".uilookup.tenant'",
+                               'tenant_link'                                   
=> "menuaction:'" . 'property'.".uilookup.tenant'",
                                'lang_tenant'                                   
=> lang('tenant'),
                                'value_tenant_id'                               
=> (isset($values['tenant_id'])?$values['tenant_id']:''),
                                'value_last_name'                               
=> (isset($values['last_name'])?$values['last_name']:''),
@@ -1190,7 +1058,7 @@
                                'lookup_type'                                   
=> $lookup_type,
                                'location_data'                                 
=> $location_data,
                                'form_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'done_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.index','type_id'=> $type_id, 'lookup_tenant'=> 
$lookup_tenant)),
+                               'done_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uilocation.index','type_id'=> $type_id, 'lookup_tenant'=> 
$lookup_tenant)),
                                'lang_save'                                     
        => lang('save'),
                                'lang_done'                                     
        => lang('done'),
                                'lang_done_statustext'                  => 
lang('Back to the list'),
@@ -1200,13 +1068,14 @@
                                'lang_cat_statustext'                   => 
lang('Select the category the location belongs to. To do not use a category 
select NO CATEGORY'),
                                'select_name'                                   
=> 'cat_id',
                                'cat_list'                                      
        => 
$this->bocommon->select_category_list(array('format'=>'select','selected' => 
$values['cat_id'],'type' =>'location','type_id' =>$type_id,'order'=>'descr')),
+                               'textareacols'                                  
=> 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'])
 && $GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'] : 40,
+                               'textarearows'                                  
=> 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'])
 && $GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'] : 6
                        );
 
                        $appname        = lang('location');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
                }
 
 
@@ -1215,7 +1084,7 @@
                        if(!$this->acl_delete)
                        {
                                
$GLOBALS['phpgw']->redirect_link('/index.php',array(
-                                                                       
'menuaction'    => $this->currentapp.'.uilocation.stop',
+                                                                       
'menuaction'    => 'property.uilocation.stop',
                                                                        'perm'  
                => 8,
                                                                        
'acl_location'  => $this->acl_location
                                                                        )
@@ -1225,12 +1094,20 @@
                        $location_code          = 
phpgw::get_var('location_code', 'string', 'GET');
                        $type_id                = $this->type_id;
 
+                       if ( $type_id && !$lookup_tenant )
+                       {
+                               
$GLOBALS['phpgw_info']['flags']['menu_selection'] .= "::loc_$type_id";
+                       }
+                       else
+                       {
+                               
$GLOBALS['phpgw_info']['flags']['menu_selection'] .= '::tenant';
+                       }
 
                        $confirm        = phpgw::get_var('confirm', 'bool', 
'POST');
 
                        $link_data = array
                        (
-                               'menuaction' => 
$this->currentapp.'.uilocation.index',
+                               'menuaction' => 'property.uilocation.index',
                                'type_id'       =>$type_id
                        );
 
@@ -1245,7 +1122,7 @@
                        $data = array
                        (
                                'done_action'           => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'         => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.delete', 'location_code'=> $location_code, 
'type_id'=> $type_id)),
+                               'delete_action'         => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uilocation.delete', 'location_code'=> $location_code, 'type_id'=> 
$type_id)),
                                'lang_confirm_msg'      => lang('do you really 
want to delete this entry'),
                                'lang_yes'              => lang('yes'),
                                'lang_yes_statustext'   => lang('Delete the 
entry'),
@@ -1256,7 +1133,7 @@
                        $appname                        = lang('location');
                        $function_msg                   = lang('delete 
location');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -1266,7 +1143,7 @@
                        if(!$this->acl_read)
                        {
                                
$GLOBALS['phpgw']->redirect_link('/index.php',array(
-                                                                       
'menuaction'    => $this->currentapp.'.uilocation.stop',
+                                                                       
'menuaction'    => 'property.uilocation.stop',
                                                                        'perm'  
        => 1,
                                                                        
'acl_location'  => $this->acl_location
                                                                        )
@@ -1276,7 +1153,7 @@
                        $get_history            = phpgw::get_var('get_history', 
'bool', 'POST');
                        $lookup_tenant          = 
phpgw::get_var('lookup_tenant', 'bool');
                        $location_code          = 
phpgw::get_var('location_code');
-                       $location               = split('-',$location_code);
+                       $location                       = 
explode('-',$location_code);
 
                        $type_id                = $this->type_id;
 
@@ -1285,9 +1162,18 @@
                                $type_id = count($location);
                        }
 
+                       if ( $type_id && !$lookup_tenant )
+                       {
+                               
$GLOBALS['phpgw_info']['flags']['menu_selection'] .= "::loc_$type_id";
+                       }
+                       else
+                       {
+                               
$GLOBALS['phpgw_info']['flags']['menu_selection'] .= '::tenant';
+                       }
+                       
                        
$GLOBALS['phpgw']->xslttpl->add_file(array('location','attributes_view'));
 
-                       $values = 
$this->bo->read_single($location_code,array('tenant_id'=>'lookup'));
+                       $values = 
$this->bo->read_single($location_code,array('tenant_id'=>'lookup', 'view' => 
true));
 
                        $check_history = 
$this->bo->check_history($location_code);
                        if($get_history)
@@ -1296,7 +1182,7 @@
                                $uicols = $this->bo->uicols;
 
                                $j=0;
-                               if (isSet($history) AND is_array($history))
+                               if (isSet($history) && is_array($history))
                                {
                                        foreach($history as $entry)
                                        {
@@ -1345,8 +1231,6 @@
 
                        $function_msg .= ' ' 
.$location_types[($type_id-1)]['name'];
 
-                       $custom_fields  = 
$this->soadmin_location->read_attrib(array('type_id'=>$type_id,'allrows'=>True));
-
                        $j=0;
                        $additional_fields[$j]['input_text']    = 
$location_types[($type_id-1)]['name'];
                        $additional_fields[$j]['input_name']    = 'loc' . 
$type_id;
@@ -1362,8 +1246,6 @@
                        $j++;
 
 
-                       $contacts                       = 
CreateObject('phpgwapi.contacts');
-
                        $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
                        $sep = '/';
                        $dlarr[strpos($dateformat,'Y')] = 'Y';
@@ -1373,105 +1255,7 @@
 
                        $dateformat= (implode($sep,$dlarr));
 
-                       $input_type_array = array(
-                               'R' => 'radio',
-                               'CH' => 'checkbox',
-                               'LB' => 'listbox'
-                       );
 
-                       $vendor = CreateObject('property.soactor');
-                       $vendor->role = 'vendor';
-
-                       $r=0;
-                       $m=0;
-
-                       while (is_array($custom_fields) && list(,$custom) = 
each($custom_fields))
-                       {
-                               $location_datatype[]= array(
-                                       'input_name'    => 
$custom['column_name'],
-                                       'datatype'      => $custom['datatype']
-                                       );
-
-                               $attributes_values[$r]['id']    = $custom['id'];
-                               $attributes_values[$r]['input_text']    = 
$custom['input_text'];
-                               $attributes_values[$r]['statustext']    = 
$custom['statustext'];
-                               $attributes_values[$r]['datatype']      = 
$custom['datatype'];
-                               $attributes_values[$r]['name']  = 
$custom['column_name'];
-                               $attributes_values[$r]['input_name']    = 
$custom['column_name'];
-                               $attributes_values[$r]['value']                 
= $values[$custom['column_name']];
-                               if($attributes_values[$r]['datatype']=='D' && 
$attributes_values[$r]['value'])
-                               {
-                                       $timestamp_date= 
mktime(0,0,0,date(m,strtotime($attributes_values[$r]['value'])),date(d,strtotime($attributes_values[$r]['value'])),date(y,strtotime($attributes_values[$r]['value'])));
-                                       $attributes_values[$r]['value'] = 
$GLOBALS['phpgw']->common->show_date($timestamp_date,$dateformat);
-                               }
-                               if($attributes_values[$r]['datatype']=='AB')
-                               {
-                                       if($attributes_values[$r]['value'])
-                                       {
-                                               $contact_data   = 
$contacts->read_single_entry($attributes_values[$r]['value'],array('n_given'=>'n_given','n_family'=>'n_family','email'=>'email'));
-                                               
$attributes_values[$r]['contact_name']  = $contact_data[0]['n_family'] . ', ' . 
$contact_data[0]['n_given'];
-                                       }
-
-                                       $functions[$m]['name'] = 'lookup_'. 
$attributes_values[$r]['name'] .'()';
-                                       $functions[$m]['link'] = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilookup.addressbook', 'column'=> 
$attributes_values[$r]['name']));
-                                       $functions[$m]['action'] = 
'Window1=window.open(link,"Search","width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");';
-                                       $m++;
-                               }
-
-                               if($attributes_values[$r]['datatype']=='VENDOR')
-                               {
-                                       if($attributes_values[$r]['value'])
-                                       {
-                                               $vendor_data    = 
$vendor->read_single(array('actor_id'=>$attributes_values[$r]['value']));
-
-                                               for 
($n=0;$n<count($vendor_data['attributes']);$n++)
-                                               {
-                                                       
if($vendor_data['attributes'][$n]['name'] == 'org_name')
-                                                       {
-                                                               
$attributes_values[$r]['vendor_name']= $vendor_data['attributes'][$n]['value'];
-                                                               $n 
=count($vendor_data['attributes']);
-                                                       }
-                                               }
-                                       }
-
-
-                                       $lookup_functions[$m]['name'] = 
'lookup_'. $attributes_values[$r]['name'] .'()';
-                                       $lookup_functions[$m]['link'] = 
"menuaction:'" . $this->currentapp.".uilookup.vendor',column:'" . 
$attributes_values[$r]['name'] . "'";
-                                       $lookup_functions[$m]['action'] = 
'Window1=window.open(strURL,"Search","width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");';
-                                       $m++;
-                               }
-
-                               if($attributes_values[$r]['datatype']=='R' || 
$attributes_values[$r]['datatype']=='CH' || 
$attributes_values[$r]['datatype']=='LB')
-                               {
-                                       $attributes_values[$r]['choice']        
= 
$this->soadmin_location->read_attrib_choice($type_id,$attributes_values[$r]['id']);
-                                       
$input_type=$input_type_array[$attributes_values[$r]['datatype']];
-
-                                       
if($attributes_values[$r]['datatype']=='CH')
-                                       {
-                                               
$attributes_values[$r]['value']=unserialize($attributes_values[$r]['value']);
-                                               
$attributes_values[$r]['choice'] = 
$this->bocommon->select_multi_list_2($attributes_values[$r]['value'],$attributes_values[$r]['choice'],$input_type);
-
-                                       }
-                                       else
-                                       {
-                                               for 
($j=0;$j<count($attributes_values[$r]['choice']);$j++)
-                                               {
-                                                       
$attributes_values[$r]['choice'][$j]['input_type']=$input_type;
-                                                       
if($attributes_values[$r]['choice'][$j]['id']==$attributes_values[$r]['value'])
-                                                       {
-                                                               
$attributes_values[$r]['choice'][$j]['checked']='checked';
-                                                       }
-                                               }
-                                       }
-                               }
-
-                               $attributes_values[$r]['datatype_text'] = 
$this->bocommon->translate_datatype($attributes_values[$r]['datatype']);
-                               $r++;
-                       }
-
-
-//     _debug_array($custom_fields);
-
                        for ($j=0;$j<count($config);$j++)
                        {
                                if($config[$j]['location_type'] == $type_id)
@@ -1528,7 +1312,7 @@
                                                $entities_link[] = array
                                                (
                                                        'entity_link'           
        => $GLOBALS['phpgw']->link('/index.php',array(
-                                                                               
                                'menuaction'=> 
$this->currentapp.'.uilocation.view',
+                                                                               
                                'menuaction'=> 'property.uilocation.view',
                                                                                
                                
'location_code'=>implode('-',array_slice($location, 0, $location_type['id']))
                                                                                
                                )
                                                                                
                        ),
@@ -1541,7 +1325,7 @@
                                                $entities_link[] = array
                                                (
                                                        'entity_link'           
        => $GLOBALS['phpgw']->link('/index.php',array(
-                                                                               
                                'menuaction'=> 
$this->currentapp.'.uilocation.index',
+                                                                               
                                'menuaction'=> 'property.uilocation.index',
                                                                                
                                'type_id'=> $location_type['id'],
                                                                                
                                'query'=>implode('-',array_slice($location, 0, 
$location_type['id']))
                                                                                
                                )
@@ -1555,7 +1339,7 @@
 
                        $entities= 
$this->bo->read_entity_to_link($location_code);
 
-                       if (isset($entities) AND is_array($entities))
+                       if (isset($entities) && is_array($entities))
                        {
                                foreach($entities as $entity_entry)
                                {
@@ -1573,7 +1357,7 @@
                                                $entities_link[] = array
                                                (
                                                        'entity_link'           
        => $GLOBALS['phpgw']->link('/index.php',array(
-                                                                               
                                                'menuaction'=> 
$this->currentapp.'.uientity.index',
+                                                                               
                                                'menuaction'=> 
'property.uientity.index',
                                                                                
                                                'entity_id'=> 
$entity_entry['entity_id'],
                                                                                
                                                'cat_id'=> 
$entity_entry['cat_id'],
                                                                                
                                                'query'=>$location_code
@@ -1621,7 +1405,8 @@
                                'value_street_name'                     => 
$values['street_name'],
                                'value_street_number'                   => 
$values['street_number'],
 
-                               'attributes_view'                       => 
$attributes_values,
+                               'attributes_view'                               
=> $values['attributes'],
+
                                'dateformat'                            => 
$dateformat,
                                'lang_dateformat'                       => 
strtolower($dateformat),
                                'lang_none'                             => 
lang('None'),
@@ -1635,35 +1420,38 @@
                                'size_first_name'                       => 
strlen($values['first_name']),
                                'lookup_type'                           => 
$lookup_type,
                                'location_data'                         => 
$location_data,
-                               'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>$this->currentapp.'.uilocation.index',
 'type_id'=> $type_id,'lookup_tenant'=> $lookup_tenant)),
+                               'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>'property.uilocation.index',
 'type_id'=> $type_id,'lookup_tenant'=> $lookup_tenant)),
                                'lang_save'                             => 
lang('save'),
                                'lang_done'                             => 
lang('done'),
                                'lang_done_statustext'                  => 
lang('Back to the list'),
                                'lang_save_statustext'                  => 
lang('Save the location'),
                                'lang_edit'                             => 
lang('Edit'),
-                               'edit_action'                           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>$this->currentapp.'.uilocation.edit',
 'location_code'=> $location_code, 'lookup_tenant'=> $lookup_tenant)),
+                               'edit_action'                           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>'property.uilocation.edit',
 'location_code'=> $location_code, 'lookup_tenant'=> $lookup_tenant)),
                                'lang_edit_statustext'                  => 
lang('Edit this entry'),
                                'lang_category'                         => 
lang('category'),
                                'lang_no_cat'                           => 
lang('no category'),
                                'lang_cat_statustext'                   => 
lang('Select the category the location belongs to. To do not use a category 
select NO CATEGORY'),
                                'select_name'                           => 
'cat_id',
                                'cat_list'                              => 
$this->bocommon->select_category_list(array('format'=>'select','selected' => 
$values['cat_id'],'type' =>'location','type_id' =>$type_id,'order'=>'descr')),
+                               'textareacols'                          => 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'])
 && $GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'] : 40,
+                               'textarearows'                          => 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'])
 && $GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'] : 6
                        );
 
                        $appname                                        = 
lang('location');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
 
                function update_cat()
                {
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
'admin::property::inactive_cats';
                        $confirm        = phpgw::get_var('confirm', 'bool', 
'POST');
 
                        $link_data = array
                        (
-                               'menuaction' => 
$this->currentapp.'.uilocation.index'
+                               'menuaction' => 'property.uilocation.index'
                        );
 
                        if (phpgw::get_var('confirm', 'bool', 'POST'))
@@ -1686,7 +1474,7 @@
                        (
                                'msgbox_data'                   => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
                                'done_action'                   => 
$GLOBALS['phpgw']->link('/admin/index.php'),
-                               'update_action'                 => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.update_cat')),
+                               'update_action'                 => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uilocation.update_cat')),
                                'message'                       => 
$receipt['message'],
                                'lang_confirm_msg'              => 
$lang_confirm_msg,
                                'lang_yes'                      => $lang_yes,
@@ -1697,7 +1485,7 @@
 
                        $appname                = lang('location');
                        $function_msg   = lang('Update the not active category 
for locations');
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('update_cat' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -1707,41 +1495,44 @@
                        $perm                   = phpgw::get_var('perm', 'int');
                        $location               = 
phpgw::get_var('acl_location');
 
-                       $right          = 
array(1=>'read',2=>'add',4=>'edit',8=>'delete',16=>'manage');
+                       $right = array
+                       (
+                               PHPGW_ACL_READ          => 'read',
+                               PHPGW_ACL_ADD           => 'add',
+                               PHPGW_ACL_EDIT          => 'edit',
+                               PHPGW_ACL_DELETE        => 'delete',
+                               PHPGW_ACL_PRIVATE       => 'manage'
+                       );
 
-                       $links = $this->menu->links();
+                       $GLOBALS['phpgw']->xslttpl->add_file(array('location'));
 
-                       
$GLOBALS['phpgw']->xslttpl->add_file(array('location','menu'));
+                       $receipt['error'][] = array('msg' => lang('You need the 
right "%1" for this application at "%2" to access this function', 
lang($right[$perm]), $location));
 
-                       $receipt['error'][]=array('msg'=>lang('You need the 
right "%1" for this application at "%2" to access this 
function',lang($right[$perm]),$location));
-
                        $msgbox_data = $this->bocommon->msgbox_data($receipt);
 
                        $data = array
                        (
                                'msgbox_data'   => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'links'                 => $links
                        );
 
                        $appname                = lang('Access error');
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' : ' . $appname;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' : ' . $appname;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('stop' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
 
                function summary()
                {
-                       $links = $this->menu->links('summary');
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] .= 
'::summary';
+                       $GLOBALS['phpgw']->xslttpl->add_file(array('location'));
 
-                       
$GLOBALS['phpgw']->xslttpl->add_file(array('location','menu'));
+                       
$GLOBALS['phpgw']->js->validate_file('overlib','overlib','property');
 
-                       
$GLOBALS['phpgw']->js->validate_file('overlib','overlib',$this->currentapp);
-
                        $summary_list= $this->bo->read_summary();
                        $uicols = $this->bo->uicols;
 
                        $j=0;
-                       if (isSet($summary_list) AND is_array($summary_list))
+                       if (isSet($summary_list) && is_array($summary_list))
                        {
                                foreach($summary_list as $summary)
                                {
@@ -1771,7 +1562,7 @@
 
                        $link_excel = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uilocation.excel',
+                               'menuaction'    => 'property.uilocation.excel',
                                                'district_id'           
=>$this->district_id,
                                                'part_of_town_id'       
=>$this->part_of_town_id,
                                                'filter'                
=>$this->filter,
@@ -1782,7 +1573,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uilocation.summary',
+                               'menuaction'    => 
'property.uilocation.summary',
                                                'district_id'           
=>$this->district_id,
                                                'part_of_town_id'       
=>$this->part_of_town_id,
                                                'filter'                
=>$this->filter,
@@ -1791,7 +1582,7 @@
 
 
 
-                       
if(isset($GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['property_filter'])
 && 
$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['property_filter']
 == 'owner')
+                       
if(isset($GLOBALS['phpgw_info']['user']['preferences']['property']['property_filter'])
 && 
$GLOBALS['phpgw_info']['user']['preferences']['property']['property_filter'] == 
'owner')
                        {
                                $owner_list = 
$this->bo->get_owner_list('filter', $this->filter);
                        }
@@ -1802,7 +1593,6 @@
 
                        $data = array
                        (
-                               'links'                                 => 
$links,
                                'select_action'                         => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
                                'owner_name'                            => 
'filter',
                                'owner_list'                            => 
$owner_list,
@@ -1827,7 +1617,7 @@
 //_debug_array($data);
 
                        $appname                = lang('Summary');
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' : ' . $appname;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' : ' . $appname;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('summary' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }

Modified: trunk/property/inc/class.uilookup.inc.php
===================================================================
--- trunk/property/inc/class.uilookup.inc.php   2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.uilookup.inc.php   2008-02-02 13:52:39 UTC (rev 
18466)
@@ -64,7 +64,7 @@
                        $GLOBALS['phpgw_info']['flags']['noframework'] = True;
                        $GLOBALS['phpgw_info']['flags']['headonly']=true;
                        $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->nextmatchs                       = 
CreateObject('phpgwapi.nextmatchs');
                        $this->bo                                       = 
CreateObject('property.bolookup',True);
 
@@ -138,7 +138,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   =>      'last_name',
                                                                                
        'order' =>      $this->order,
-                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uilookup.addressbook',
+                                                                               
        'extra'         => array('menuaction'   => 
'property.uilookup.addressbook',
                                                                                
                                                        'cat_id'        => 
$this->cat_id,
                                                                                
                                                        'column'        => 
$column)
                                                                                
)),
@@ -148,7 +148,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   =>      'person_id',
                                                                                
        'order' =>      $this->order,
-                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uilookup.addressbook',
+                                                                               
        'extra'         => array('menuaction'   => 
'property.uilookup.addressbook',
                                                                                
                                                        'cat_id'        
=>$this->cat_id,
                                                                                
                                                        'column'        => 
$column)
                                                                                
)),
@@ -164,7 +164,7 @@
 
                        $link_select = array
                        (
-                               'menuaction'            => 
$this->currentapp.'.uilookup.addressbook',
+                               'menuaction'            => 
'property.uilookup.addressbook',
                                'second_display'        => true,
                                'order'                         => $this->order,
                                'sort'                          => $this->sort,
@@ -216,7 +216,7 @@
                        $appname                                                
= lang('addressbook');
                        $function_msg                                   = 
lang('list vendors');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_contact' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
@@ -237,7 +237,7 @@
                        $column = phpgw::get_var('column');
 
 
-                       $default_category = 
$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['default_vendor_category'];
+                       $default_category = 
$GLOBALS['phpgw_info']['user']['preferences']['property']['default_vendor_category'];
 
                        if ($default_category && !$second_display)
                        {
@@ -265,7 +265,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   =>      'org_name',
                                                                                
        'order' =>      $this->order,
-                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uilookup.vendor',
+                                                                               
        'extra'         => array('menuaction'   => 'property.uilookup.vendor',
                                                                                
                                                        'cat_id'        => 
$this->cat_id,
                                                                                
                                                        'column'        => 
$column)
                                                                                
)),
@@ -275,7 +275,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   =>      'id',
                                                                                
        'order' =>      $this->order,
-                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uilookup.vendor',
+                                                                               
        'extra'         => array('menuaction'   => 'property.uilookup.vendor',
                                                                                
                                                        'cat_id'        
=>$this->cat_id,
                                                                                
                                                        'column'        => 
$column)
                                                                                
)),
@@ -291,7 +291,7 @@
 
                        $link_select = array
                        (
-                               'menuaction'            => 
$this->currentapp.'.uilookup.vendor',
+                               'menuaction'            => 
'property.uilookup.vendor',
                                'second_display'        => true,
                                'order'                         => $this->order,
                                'sort'                          => $this->sort,
@@ -343,7 +343,7 @@
                        $appname                                                
= lang('vendor');
                        $function_msg                                   = 
lang('list vendors');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_vendor' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
@@ -376,7 +376,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   =>      'descr',
                                                                                
        'order' =>      $this->order,
-                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uilookup.b_account',
+                                                                               
        'extra'         => array('menuaction'   => 
'property.uilookup.b_account',
                                                                                
                                                        'cat_id'        
=>$this->cat_id)
                                                                                
)),
                                'lang_name'             => lang('Name'),
@@ -385,7 +385,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   =>      'id',
                                                                                
        'order' =>      $this->order,
-                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uilookup.b_account',
+                                                                               
        'extra'         => array('menuaction'   => 
'property.uilookup.b_account',
                                                                                
                                                        'cat_id'        
=>$this->cat_id)
                                                                                
)),
                                'lang_id'               => lang('ID'),
@@ -400,7 +400,7 @@
 
                        $link_select = array
                        (
-                               'menuaction'            => 
$this->currentapp.'.uilookup.b_account',
+                               'menuaction'            => 
'property.uilookup.b_account',
                                'second_display'        => true,
                                'order'                         => $this->order,
                                'sort'                          => $this->sort,
@@ -434,7 +434,7 @@
                        $appname                                                
= lang('budget account');
                        $function_msg                                   = 
lang('list budget account');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_b_account' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
@@ -468,7 +468,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   =>      'descr',
                                                                                
        'order' =>      $this->order,
-                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uilookup.street',
+                                                                               
        'extra'         => array('menuaction'   => 'property.uilookup.street',
                                                                                
                                                        'cat_id'        
=>$this->cat_id)
                                                                                
)),
                                'lang_name'             => lang('Street name'),
@@ -477,7 +477,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   =>      'id',
                                                                                
        'order' =>      $this->order,
-                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uilookup.street',
+                                                                               
        'extra'         => array('menuaction'   => 'property.uilookup.street',
                                                                                
                                                        'cat_id'        
=>$this->cat_id)
                                                                                
)),
                                'lang_id'               => lang('ID'),
@@ -492,7 +492,7 @@
 
                        $link_select = array
                        (
-                               'menuaction'            => 
$this->currentapp.'.uilookup.street',
+                               'menuaction'            => 
'property.uilookup.street',
                                'second_display'        => true,
                                'order'                         => $this->order,
                                'sort'                          => $this->sort,
@@ -529,7 +529,7 @@
                        $appname                                                
= lang('street');
                        $function_msg                                   = 
lang('list street');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_street' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
@@ -563,7 +563,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   =>      'last_name',
                                                                                
        'order' =>      $this->order,
-                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uilookup.tenant',
+                                                                               
        'extra'         => array('menuaction'   => 'property.uilookup.tenant',
                                                                                
                                                        'cat_id'        
=>$this->cat_id)
                                                                                
)),
                                'sort_first_name'       => 
$this->nextmatchs->show_sort_order(array
@@ -571,7 +571,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   =>      'first_name',
                                                                                
        'order' =>      $this->order,
-                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uilookup.tenant',
+                                                                               
        'extra'         => array('menuaction'   => 'property.uilookup.tenant',
                                                                                
                                                        'cat_id'        
=>$this->cat_id)
                                                                                
)),
                                'lang_last_name'                => lang('last 
name'),
@@ -581,7 +581,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   =>      'id',
                                                                                
        'order' =>      $this->order,
-                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uilookup.tenant',
+                                                                               
        'extra'         => array('menuaction'   => 'property.uilookup.tenant',
                                                                                
                                                        'cat_id'        
=>$this->cat_id)
                                                                                
)),
                                'lang_id'               => lang('ID'),
@@ -596,7 +596,7 @@
 
                        $link_select = array
                        (
-                               'menuaction'            => 
$this->currentapp.'.uilookup.tenant',
+                               'menuaction'            => 
'property.uilookup.tenant',
                                'second_display'        => true,
                                'order'                         => $this->order,
                                'sort'                          => $this->sort,
@@ -631,7 +631,7 @@
                        $appname                                                
= lang('tenant');
                        $function_msg                                   = 
lang('list tenant');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_tenant' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
@@ -664,7 +664,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   =>      'tekst1',
                                                                                
        'order' =>      $this->order,
-                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uilookup.ns3420',
+                                                                               
        'extra'         => array('menuaction'   => 'property.uilookup.ns3420',
                                                                                
                                                        'query' =>$this->query)
                                                                                
)),
                                'lang_descr'            => lang('ns3420 
description'),
@@ -673,7 +673,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   =>      'id',
                                                                                
        'order' =>      $this->order,
-                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uilookup.ns3420',
+                                                                               
        'extra'         => array('menuaction'   => 'property.uilookup.ns3420',
                                                                                
                                                        'query' =>$this->query)
                                                                                
)),
                                'lang_id'               => lang('ID'),
@@ -688,7 +688,7 @@
 
                        $link_select = array
                        (
-                               'menuaction'            => 
$this->currentapp.'.uilookup.ns3420',
+                               'menuaction'            => 
'property.uilookup.ns3420',
                                'second_display'        => true,
                                'order'                         => $this->order,
                                'sort'                          => $this->sort,
@@ -720,7 +720,7 @@
                        $appname                                                
= lang('standard description');
                        $function_msg                                   = 
lang('list standard description');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_ns3420' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
@@ -748,7 +748,7 @@
 
                        $entity_list = $boentity->read(array('lookup'=>True));
 
-                       $input_name = 
$GLOBALS['phpgw']->session->appsession('lookup_fields',$this->currentapp);
+                       $input_name = 
$GLOBALS['phpgw']->session->appsession('lookup_fields','property');
 //_debug_array($input_name);
 
                        $uicols = $boentity->uicols;
@@ -797,7 +797,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   =>      'loc1',
                                                                                
        'order' =>      $this->order,
-                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uilookup.entity',
+                                                                               
        'extra'         => array('menuaction'   => 'property.uilookup.entity',
                                                                                
                                                        'type_id'       
=>$type_id,
                                                                                
                                                        'query'         
=>$this->query,
                                                                                
                                                        'district_id'   => 
$this->district_id,
@@ -814,7 +814,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   =>      'num',
                                                                                
        'order' =>      $this->order,
-                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uilookup.entity',
+                                                                               
        'extra'         => array('menuaction'   => 'property.uilookup.entity',
                                                                                
                                                        'type_id'       
=>$type_id,
                                                                                
                                                        'query'         
=>$this->query,
                                                                                
                                                        'lookup'        
=>$lookup,
@@ -842,7 +842,7 @@
 
                        $link_select = array
                        (
-                               'menuaction'            => 
$this->currentapp.'.uilookup.entity',
+                               'menuaction'            => 
'property.uilookup.entity',
                                'order'                         => $this->order,
                                'sort'                          => $this->sort,
                                'cat_id'                        => 
$this->cat_id,
@@ -906,10 +906,10 @@
                        {
                                $category = 
$boadmin_entity->read_single_category($this->entity_id,$this->cat_id);
                                $function_msg                                   
= lang('lookup') . ' ' . $category['name'];
-                               $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                               $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        }
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_entity' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
@@ -946,7 +946,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   =>      'account_lid',
                                                                                
        'order' =>      $this->order,
-                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uilookup.phpgw_user',
+                                                                               
        'extra'         => array('menuaction'   => 
'property.uilookup.phpgw_user',
                                                                                
                                                        'cat_id'        
=>$this->cat_id,
                                                                                
                                                        'column'        => 
$column)
                                                                                
)),
@@ -955,7 +955,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   =>      'account_lastname',
                                                                                
        'order' =>      $this->order,
-                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uilookup.phpgw_user',
+                                                                               
        'extra'         => array('menuaction'   => 
'property.uilookup.phpgw_user',
                                                                                
                                                        'cat_id'        
=>$this->cat_id,
                                                                                
                                                        'column'        => 
$column)
                                                                                
)),
@@ -964,7 +964,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   =>      'account_firstname',
                                                                                
        'order' =>      $this->order,
-                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uilookup.phpgw_user',
+                                                                               
        'extra'         => array('menuaction'   => 
'property.uilookup.phpgw_user',
                                                                                
                                                        'cat_id'        
=>$this->cat_id,
                                                                                
                                                        'column'        => 
$column)
                                                                                
)),
@@ -975,7 +975,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   =>      'account_id',
                                                                                
        'order' =>      $this->order,
-                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uilookup.phpgw_user',
+                                                                               
        'extra'         => array('menuaction'   => 
'property.uilookup.phpgw_user',
                                                                                
                                                        'cat_id'        
=>$this->cat_id,
                                                                                
                                                        'column'        => 
$column)
                                                                                
)),
@@ -991,7 +991,7 @@
 
                        $link_select = array
                        (
-                               'menuaction'            => 
$this->currentapp.'.uilookup.phpgw_user',
+                               'menuaction'            => 
'property.uilookup.phpgw_user',
                                'order'                         => $this->order,
                                'sort'                          => $this->sort,
                                'cat_id'                        => 
$this->cat_id,
@@ -1040,7 +1040,7 @@
                        $appname                                                
= lang('phpgw_user');
                        $function_msg                                   = 
lang('list phpgw_user');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_phpgw_user' => $data));
                        $this->save_sessiondata();
                }

Modified: trunk/property/inc/class.uip_of_town.inc.php
===================================================================
--- trunk/property/inc/class.uip_of_town.inc.php        2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/inc/class.uip_of_town.inc.php        2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -53,13 +53,13 @@
                function property_uip_of_town()
                {
                        $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
'admin::property::location::town';
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->nextmatchs       = 
CreateObject('phpgwapi.nextmatchs');
                        $this->account          = 
$GLOBALS['phpgw_info']['user']['account_id'];
 
                        $this->bo               = 
CreateObject('property.bop_of_town',True);
                        $this->bocommon         = 
CreateObject('property.bocommon');
-                       $this->menu             = CreateObject('property.menu');
 
                        $this->acl              = CreateObject('phpgwapi.acl');
                        $this->acl_location     = '.admin';
@@ -97,17 +97,14 @@
                {
                        if(!$this->acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>1, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
                        }
 
                        $GLOBALS['phpgw']->xslttpl->add_file(array('p_of_town',
-                                                                               
'menu',
                                                                                
'receipt',
                                                                                
'search_field',
                                                                                
'nextmatchs'));
 
-                       $links = $this->menu->links();
-
                        $receipt = 
$GLOBALS['phpgw']->session->appsession('session_data','p_of_town_receipt');
                        
$GLOBALS['phpgw']->session->appsession('session_data','p_of_town_receipt','');
 
@@ -122,9 +119,9 @@
                                                'part_of_town_id'               
=> $p_of_town['part_of_town_id'],
                                                'name'                          
=> $p_of_town['name'],
                                                'category'                      
=> $p_of_town['category'],
-                                               'link_view'                     
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uip_of_town.view', 'part_of_town_id'=> 
$p_of_town['part_of_town_id'])),
-                                               'link_edit'                     
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uip_of_town.edit', 'part_of_town_id'=> 
$p_of_town['part_of_town_id'])),
-                                               'link_delete'                   
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uip_of_town.delete', 'part_of_town_id'=> 
$p_of_town['part_of_town_id'])),
+                                               'link_view'                     
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uip_of_town.view', 'part_of_town_id'=> 
$p_of_town['part_of_town_id'])),
+                                               'link_edit'                     
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uip_of_town.edit', 'part_of_town_id'=> 
$p_of_town['part_of_town_id'])),
+                                               'link_delete'                   
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uip_of_town.delete', 'part_of_town_id'=> 
$p_of_town['part_of_town_id'])),
                                                'lang_view_statustext'          
=> lang('view the part of town'),
                                                'lang_edit_statustext'          
=> lang('edit the part of town'),
                                                'lang_delete_statustext'        
=> lang('delete the part of town'),
@@ -148,7 +145,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'name',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uip_of_town.index',
+                                                                               
        'extra' => array('menuaction'   => 'property.uip_of_town.index',
                                                                                
                                                        'district_id'   => 
$this->district_id,
                                                                                
                                                        'query'         => 
$this->query,
                                                                                
                                                        'allrows'       => 
$this->allrows)
@@ -158,7 +155,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'part_of_town_id',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uip_of_town.index',
+                                                                               
        'extra' => array('menuaction'   => 'property.uip_of_town.index',
                                                                                
                                                        'district_id'   => 
$this->district_id,
                                                                                
                                                        'query'         => 
$this->query,
                                                                                
                                                        'allrows'       => 
$this->allrows)
@@ -168,7 +165,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'descr',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uip_of_town.index',
+                                                                               
        'extra' => array('menuaction'   => 'property.uip_of_town.index',
                                                                                
                                                        'district_id'   => 
$this->district_id,
                                                                                
                                                        'query'         => 
$this->query,
                                                                                
                                                        'allrows'       => 
$this->allrows)
@@ -180,12 +177,12 @@
                        (
                                'lang_add'              => lang('add'),
                                'lang_add_statustext'   => lang('add a part of 
town'),
-                               'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uip_of_town.edit'))
+                               'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uip_of_town.edit'))
                        );
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uip_of_town.index',
+                               'menuaction'    => 'property.uip_of_town.index',
                                'sort'          => $this->sort,
                                'order'         => $this->order,
                                'district_id'   => $this->district_id,
@@ -207,7 +204,6 @@
                        $data = array
                        (
                                'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'links'                                         
=> $links,
                                'allow_allrows'                                 
=> true,
                                'allrows'                                       
=> $this->allrows,
                                'start_record'                                  
=> $this->start,
@@ -242,7 +238,7 @@
                {
                        if(!$this->acl_add)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=> 2, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=> 2, 'acl_location'=> $this->acl_location));
                        }
 
                        $part_of_town_id        = 
phpgw::get_var('part_of_town_id', 'int');
@@ -277,14 +273,14 @@
                                        if ($values['save'])
                                        {
                                                
$GLOBALS['phpgw']->session->appsession('session_data','p_of_town_receipt',$receipt);
-                                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uip_of_town.index'));
+                                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uip_of_town.index'));
                                        }
                                }
                        }
 
                        if ($values['cancel'])
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uip_of_town.index'));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uip_of_town.index'));
                        }
 
 
@@ -296,7 +292,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'            => 
$this->currentapp.'.uip_of_town.edit',
+                               'menuaction'            => 
'property.uip_of_town.edit',
                                'part_of_town_id'       => $part_of_town_id
                        );
 
@@ -333,7 +329,7 @@
                {
                        if(!$this->acl_delete)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=> 8, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=> 8, 'acl_location'=> $this->acl_location));
                        }
 
                        $part_of_town_id        = 
phpgw::get_var('part_of_town_id', 'int');
@@ -342,7 +338,7 @@
 
                        $link_data = array
                        (
-                               'menuaction' => 
$this->currentapp.'.uip_of_town.index'
+                               'menuaction' => 'property.uip_of_town.index'
                        );
 
                        if (phpgw::get_var('confirm', 'bool', 'POST'))
@@ -356,7 +352,7 @@
                        $data = array
                        (
                                'done_action'           => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'         => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uip_of_town.delete', 'part_of_town_id'=> $part_of_town_id)),
+                               'delete_action'         => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uip_of_town.delete', 'part_of_town_id'=> $part_of_town_id)),
                                'lang_confirm_msg'      => lang('do you really 
want to delete this entry'),
                                'lang_yes'              => lang('yes'),
                                'lang_yes_statustext'   => lang('Delete the 
entry'),
@@ -367,7 +363,7 @@
                        $appname        = lang('part of town');
                        $function_msg   = lang('delete part of town');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -376,7 +372,7 @@
                {
                        if(!$this->acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>1, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
                        }
 
                        $part_of_town_id        = 
phpgw::get_var('part_of_town_id', 'int', 'GET');
@@ -388,7 +384,7 @@
                        $p_of_town = $this->bo->read_single($part_of_town_id);
                        $data = array
                        (
-                               'done_action'           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uip_of_town.index')),
+                               'done_action'           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uip_of_town.index')),
                                'lang_id'               => lang('ID'),
                                'lang_name'             => lang('name'),
                                'lang_district'         => lang('District'),

Modified: trunk/property/inc/class.uipricebook.inc.php
===================================================================
--- trunk/property/inc/class.uipricebook.inc.php        2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/inc/class.uipricebook.inc.php        2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -62,12 +62,11 @@
                function property_uipricebook()
                {
                        $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->nextmatchs                       = 
CreateObject('phpgwapi.nextmatchs');
 
                        $this->bo                               = 
CreateObject('property.bopricebook',True);
                        $this->bocommon                         = 
CreateObject('property.bocommon');
-                       $this->menu                             = 
CreateObject('property.menu');
                        $this->contacts                         = 
CreateObject('property.soactor');
                        $this->contacts->role                   = 'vendor';
 
@@ -86,8 +85,6 @@
                        $this->filter                           = 
$this->bo->filter;
                        $this->cat_id                           = 
$this->bo->cat_id;
                        $this->allrows                          = 
$this->bo->allrows;
-
-                       $this->menu->sub                        ='agreement';
                }
 
                function save_sessiondata()
@@ -132,15 +129,12 @@
                                
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
                        }
 
-                       
$GLOBALS['phpgw']->session->appsession('referer',$this->currentapp,'');
+                       
$GLOBALS['phpgw']->session->appsession('referer','property','');
 
                        $GLOBALS['phpgw']->xslttpl->add_file(array('pricebook',
-                                                                               
'menu',
                                                                                
'nextmatchs',
                                                                                
'search_field'));
 
-                       $links = $this->menu->links('price_vendor');
-
                        $values                 = phpgw::get_var('values');
 
 //_debug_array($values);
@@ -280,7 +274,7 @@
                                'start'         => $this->start
                        );
 
-                       
$GLOBALS['phpgw']->js->validate_file('core','check',$this->currentapp);
+                       
$GLOBALS['phpgw']->js->validate_file('core','check','property');
 
                        $data = array
                        (
@@ -289,7 +283,6 @@
                                'lang_excel_help'                               
=> lang('Download table to MS Excel'),
 
                                'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'links'                                         
=> $links,
                                'allrows'                                       
=> $this->allrows,
                                'allow_allrows'                                 
=> true,
                                'start_record'                                  
=> $this->start,
@@ -297,7 +290,7 @@
                                'num_records'                                   
=> count($pricebook_list),
                                'all_records'                                   
=> $this->bo->total_records,
                                'lang_select_all'                               
=> lang('Select All'),
-                               'img_check'                                     
=> $GLOBALS['phpgw']->common->get_image_path($this->currentapp).'/check.png',
+                               'img_check'                                     
=> $GLOBALS['phpgw']->common->get_image_path('property').'/check.png',
                                'link_url'                                      
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
                                'img_path'                                      
=> $GLOBALS['phpgw']->common->get_image_path('phpgwapi','default'),
                                'lang_no_cat'                                   
=> lang('no category'),
@@ -319,7 +312,7 @@
                        $appname        = lang('pricebook');
                        $function_msg   = lang('list pricebook per vendor');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
@@ -332,15 +325,14 @@
                                
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>16, 'acl_location'=> $this->acl_location));
                        }
 
-                       
$GLOBALS['phpgw']->session->appsession('referer',$this->currentapp,'');
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
'property::agreement::pricebook::group';
 
+                       
$GLOBALS['phpgw']->session->appsession('referer','property','');
+
                        $GLOBALS['phpgw']->xslttpl->add_file(array('pricebook',
-                                                                               
'menu',
                                                                                
'nextmatchs',
                                                                                
'search_field'));
 
-                       $links = 
$this->menu->links('agreement','agreement_group');
-
                        $agreement_list = $this->bo->read_agreement_group();
 
                        while (is_array($agreement_list) && list(,$agreement) = 
each($agreement_list))
@@ -404,11 +396,10 @@
                                $record_limit   = $this->bo->total_records;
                        }
 
-                       
$GLOBALS['phpgw']->js->validate_file('core','check',$this->currentapp);
+                       
$GLOBALS['phpgw']->js->validate_file('core','check','property');
 
                        $data = array
                        (
-                               'links'                                         
=> $links,
                                'allrows'                                       
=> $this->allrows,
                                'allow_allrows'                                 
=> true,
                                'start_record'                                  
=> $this->start,
@@ -416,7 +407,7 @@
                                'num_records'                                   
=> count($agreement_list),
                                'all_records'                                   
=> $this->bo->total_records,
                                'lang_select_all'                               
=> lang('Select All'),
-                               'img_check'                                     
=> $GLOBALS['phpgw']->common->get_image_path($this->currentapp).'/check.png',
+                               'img_check'                                     
=> $GLOBALS['phpgw']->common->get_image_path('property').'/check.png',
                                'link_url'                                      
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
                                'img_path'                                      
=> $GLOBALS['phpgw']->common->get_image_path('phpgwapi','default'),
                                'lang_status_statustext'                        
=> lang('Select the status the agreement group belongs to. To do not use a 
category select NO STATUS'),
@@ -439,7 +430,7 @@
                        $appname        = lang('pricebook');
                        $function_msg   = lang('list agreement group');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('agreement_group' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
@@ -569,7 +560,7 @@
 
                        $appname        = lang('pricebook');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_agreement_group' => 
$data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -583,24 +574,21 @@
                        }
 
                        $GLOBALS['phpgw']->xslttpl->add_file(array('pricebook',
-                                                                               
'menu',
                                                                                
'nextmatchs',
                                                                                
'search_field'));
 
-                       $links = $this->menu->links();
-
                        $cat_id                 = phpgw::get_var('cat_id', 
'int', 'GET');
                        $activity_id    = phpgw::get_var('activity_id', 'int');
                        $vendor_id      = phpgw::get_var('vendor_id', 'int', 
'GET');
                        $agreement_id   = phpgw::get_var('agreement_id', 'int', 
'GET');
                        $values                 = phpgw::get_var('values');
 
-                       $referer        = 
$GLOBALS['phpgw']->session->appsession('referer',$this->currentapp);
+                       $referer        = 
$GLOBALS['phpgw']->session->appsession('referer','property');
                        if(!$referer)
                        {
                                $referer = 
$GLOBALS['HTTP_SERVER_VARS']['HTTP_REFERER'] ? 
$GLOBALS['HTTP_SERVER_VARS']['HTTP_REFERER'] : $GLOBALS['HTTP_REFERER'];
                                $referer = $referer . '&cat_id=' . $cat_id;
-                               
$GLOBALS['phpgw']->session->appsession('referer',$this->currentapp,$referer);
+                               
$GLOBALS['phpgw']->session->appsession('referer','property',$referer);
                        }
 
                        if($values['submit_update'])
@@ -757,7 +745,6 @@
                                'done_action'                                   
=> $referer,
                                'lang_done'                                     
=> lang('done'),
                                'lang_done_statustext'                          
=> lang('Back to the list'),
-                               'links'                                         
=> $links,
                                'allrows'                                       
=> $this->allrows,
                                'allow_allrows'                                 
=> true,
                                'start_record'                                  
=> $this->start,
@@ -786,7 +773,7 @@
                        $appname        = lang('pricebook');
                        $function_msg   = lang('edit pricing');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('prizing' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
@@ -832,13 +819,12 @@
                                
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>16, 'acl_location'=> $this->acl_location));
                        }
 
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
'property::agreement::pricebook::activities';
+
                        $GLOBALS['phpgw']->xslttpl->add_file(array('pricebook',
-                                                                               
'menu',
                                                                                
'nextmatchs',
                                                                                
'search_field'));
 
-                       $links = $this->menu->links('agreement','activity');
-
                        $pricebook_list = 
$this->bo->read_activities_pr_agreement_group();
 //_debug_array($pricebook_list);
                        while (is_array($pricebook_list) && list(,$pricebook) = 
each($pricebook_list))
@@ -931,7 +917,6 @@
                                'lang_excel'                                    
=> 'excel',
                                'link_excel'                                    
=> $GLOBALS['phpgw']->link('/index.php',$link_excel),
                                'lang_excel_help'                               
=> lang('Download table to MS Excel'),
-                               'links'                                         
=> $links,
                                'allrows'                                       
=> $this->allrows,
                                'allow_allrows'                                 
=> true,
                                'start_record'                                  
=> $this->start,
@@ -960,7 +945,7 @@
                        $appname        = lang('pricebook');
                        $function_msg   = lang('list activities per 
agreement_group');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_activities' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
@@ -973,15 +958,12 @@
                                
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>16, 'acl_location'=> $this->acl_location));
                        }
 
-                       
$GLOBALS['phpgw']->session->appsession('referer',$this->currentapp,'');
+                       
$GLOBALS['phpgw']->session->appsession('referer','property','');
 
                        $GLOBALS['phpgw']->xslttpl->add_file(array('pricebook',
-                                                                               
'menu',
                                                                                
'nextmatchs',
                                                                                
'search_field'));
 
-                       $links = $this->menu->links('agreement','activity');
-
                        $activity_id            = phpgw::get_var('activity_id', 
'int');
                        $values                         = 
phpgw::get_var('values');
                        $values['vendor_id']            = 
phpgw::get_var('vendor_id', 'int', 'POST');
@@ -1068,7 +1050,6 @@
                                'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
                                'activity_id'                                   
=> $activity_id,
                                'vendor_data'                                   
=> $vendor_data,
-                               'links'                                         
=> $links,
                                'allrows'                                       
=> $this->allrows,
                                'allow_allrows'                                 
=> true,
                                'start_record'                                  
=> $this->start,
@@ -1098,7 +1079,7 @@
                        $appname        = lang('pricebook');
                        $function_msg   = lang('list vendors per activity');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_activity_vendor' => 
$data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
@@ -1260,7 +1241,7 @@
 
                        $appname = lang('pricebook');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_activity' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -1363,7 +1344,7 @@
 
                        $appname                                                
= lang('pricebook');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }

Modified: trunk/property/inc/class.uiproject.inc.php
===================================================================
--- trunk/property/inc/class.uiproject.inc.php  2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.uiproject.inc.php  2008-02-02 13:52:39 UTC (rev 
18466)
@@ -59,13 +59,14 @@
                function property_uiproject()
                {
                        $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
'property::project';
+
+               //      $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->nextmatchs               = 
CreateObject('phpgwapi.nextmatchs');
                        $this->account                  = 
$GLOBALS['phpgw_info']['user']['account_id'];
 
                        $this->bo                       = 
CreateObject('property.boproject',True);
                        $this->bocommon                 = 
CreateObject('property.bocommon');
-                       $this->menu                     = 
CreateObject('property.menu');
 
                        $this->acl                      = 
CreateObject('phpgwapi.acl');
                        $this->acl_location             = '.project';
@@ -82,9 +83,6 @@
                        $this->cat_id                   = $this->bo->cat_id;
                        $this->status_id                = $this->bo->status_id;
                        $this->wo_hour_cat_id           = 
$this->bo->wo_hour_cat_id;
-
-
-                       $this->menu->sub                ='project';
                }
 
                function save_sessiondata()
@@ -114,13 +112,13 @@
 
                function index()
                {
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] .= 
'::project';
                        if(!$this->acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>1,'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1,'acl_location'=> $this->acl_location));
                        }
 
                        
$GLOBALS['phpgw']->xslttpl->add_file(array('project','values','table_header',
-                                                                               
'menu',
                                                                                
'nextmatchs',
                                                                                
'search_field',
                                                                                
'wo_hour_cat_filter'));
@@ -130,8 +128,6 @@
                        $start_date             = 
urldecode(phpgw::get_var('start_date'));
                        $end_date               = 
urldecode(phpgw::get_var('end_date'));
 
-                       $links = $this->menu->links('project');
-
                        $project_list = $this->bo->read($start_date,$end_date);
                        $uicols = $this->bo->uicols;
                        $count_uicols_name=count($uicols['name']);
@@ -151,7 +147,7 @@
                                                                
$content[$j]['row'][]= array(
                                                                        
'statustext' => lang('search'),
                                                                        'text'  
        => $project_entry[$uicols['name'][$k]],
-                                                                       'link'  
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiproject.index', 'query'=> 
$project_entry['query_location'][$uicols['name'][$k]], 'lookup'=> $lookup, 
'from'=> $from, 'filter'=> $this->filter))
+                                                                       'link'  
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiproject.index', 'query'=> 
$project_entry['query_location'][$uicols['name'][$k]], 'lookup'=> $lookup, 
'from'=> $from, 'filter'=> $this->filter))
                                                                );
                                                        }
                                                        else
@@ -167,14 +163,14 @@
                                                                
$content[$j]['row'][]= array(
                                                                'statustext'    
=> lang('search'),
                                                                'text'          
=> $project_entry[$uicols['name'][$k]],
-                                                               'link'          
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uitts.view', 'id'=> $project_entry[$uicols['name'][$k]]))
+                                                               'link'          
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uitts.view', 'id'=> $project_entry[$uicols['name'][$k]]))
                                                                );
                                                }
 
                                                if($lookup && 
$k==($count_uicols_name-1))
                                                {
                                                        $content[$j]['row'][]= 
array(
-                                                       'lookup_action' => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.ui' . $from . '.edit', 'project_id'=> 
$project_entry['project_id']))
+                                                       'lookup_action' => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 'property.ui' . $from 
. '.edit', 'project_id'=> $project_entry['project_id']))
                                                        );
                                                }
                                        }
@@ -186,7 +182,7 @@
                                                        $content[$j]['row'][]= 
array(
                                                        'statustext'    => 
lang('view the project'),
                                                        'text'          => 
lang('view'),
-                                                       'link'          => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiproject.view', 'id'=> $project_entry['project_id']))
+                                                       'link'          => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiproject.view', 'id'=> $project_entry['project_id']))
                                                        );
                                                }
                                                else
@@ -199,7 +195,7 @@
                                                        $content[$j]['row'][]= 
array(
                                                        'statustext'    => 
lang('edit the project'),
                                                        'text'          => 
lang('edit'),
-                                                       'link'          => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiproject.edit','id'=> $project_entry['project_id']))
+                                                       'link'          => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiproject.edit','id'=> $project_entry['project_id']))
                                                        );
                                                }
                                                else
@@ -212,7 +208,7 @@
                                                        $content[$j]['row'][]= 
array(
                                                        'statustext'    => 
lang('delete the project'),
                                                        'text'          => 
lang('delete'),
-                                                       'link'          => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiproject.delete', 'project_id'=> 
$project_entry['project_id']))
+                                                       'link'          => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiproject.delete', 'project_id'=> $project_entry['project_id']))
                                                        );
                                                }
                                                else
@@ -241,7 +237,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'location_code',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction' => $this->currentapp.'.uiproject.index',
+                                                                               
        'extra' => array('menuaction' => 'property.uiproject.index',
                                                                                
                                                //      'type_id'       => 
$type_id,
                                                                                
                                                        'query'         => 
$this->query,
                                                                                
                                                        'lookup'        => 
$lookup,
@@ -262,7 +258,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'project_id',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction' => $this->currentapp.'.uiproject.index',
+                                                                               
        'extra' => array('menuaction' => 'property.uiproject.index',
                                                                                
                                                //      'type_id'       => 
$type_id,
                                                                                
                                                        'query'         => 
$this->query,
                                                                                
                                                        'lookup'        => 
$lookup,
@@ -283,7 +279,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'address',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction' => $this->currentapp.'.uiproject.index',
+                                                                               
        'extra' => array('menuaction' => 'property.uiproject.index',
                                                                                
                                                //      'type_id'       => 
$type_id,
                                                                                
                                                        'query'         => 
$this->query,
                                                                                
                                                        'lookup'        => 
$lookup,
@@ -337,13 +333,13 @@
                                (
                                        'lang_add'                      => 
lang('add'),
                                        'lang_add_statustext'           => 
lang('add a project'),
-                                       'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiproject.edit'))
+                                       'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiproject.edit'))
                                );
                        }
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiproject.index',
+                               'menuaction'    => 'property.uiproject.index',
                                                'sort'                  
=>$this->sort,
                                                'order'                 
=>$this->order,
                                                'cat_id'                
=>$this->cat_id,
@@ -358,11 +354,11 @@
                                                'wo_hour_cat_id'        
=>$this->wo_hour_cat_id,
                        );
 
-                       $link_date_search = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiproject.date_search'));
+                       $link_date_search = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiproject.date_search'));
 
                        $link_excel = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiproject.excel',
+                               'menuaction'    => 'property.uiproject.excel',
                                                'sort'                  
=>$this->sort,
                                                'order'                 
=>$this->order,
                                                'cat_id'                
=>$this->cat_id,
@@ -378,7 +374,7 @@
                                                'wo_hour_cat_id'        
=>$this->wo_hour_cat_id,
                        );
 
-                       
$GLOBALS['phpgw']->js->validate_file('overlib','overlib',$this->currentapp);
+                       
$GLOBALS['phpgw']->js->validate_file('overlib','overlib','property');
 
                        $data = array
                        (
@@ -394,9 +390,8 @@
                                'link_date_search'              => 
$link_date_search,
 
                                'lang_select'                   => 
lang('select'),
-                               'lookup_action'                 => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiworkorder.edit')),
+                               'lookup_action'                 => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiworkorder.edit')),
                                'lookup'                        => $lookup,
-                               'links'                         => $links,
                                'allow_allrows'                 => false,
                                'start_record'                  => $this->start,
                                'record_limit'                  => 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'],
@@ -440,7 +435,7 @@
                        $appname        = lang('Project');
                        $function_msg   = lang('list Project');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
 
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_project' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
@@ -486,7 +481,7 @@
                                'lang_submit'                   => 
lang('Submit')
                        );
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('date_search' => $data));
                }
 
@@ -494,7 +489,7 @@
                {
                        if(!$this->acl_add && !$this->acl_edit)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=> 2, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=> 2, 'acl_location'=> $this->acl_location));
                        }
                        $id                             = phpgw::get_var('id', 
'int');
                        $values                         = 
phpgw::get_var('values');
@@ -503,8 +498,8 @@
                        $config                         = 
CreateObject('phpgwapi.config');
                        $bolocation                     = 
CreateObject('property.bolocation');
 
-                       $insert_record = 
$GLOBALS['phpgw']->session->appsession('insert_record',$this->currentapp);
-                       $insert_record_entity = 
$GLOBALS['phpgw']->session->appsession('insert_record_entity',$this->currentapp);
+                       $insert_record = 
$GLOBALS['phpgw']->session->appsession('insert_record','property');
+                       $insert_record_entity = 
$GLOBALS['phpgw']->session->appsession('insert_record_entity','property');
 
                        if(isset($insert_record_entity) && 
is_array($insert_record_entity))
                        {
@@ -651,7 +646,7 @@
                                                if ($values['approval'] && 
$values['mail_address'])
                                                {
                                                        
$from_name=$GLOBALS['phpgw_info']['user']['fullname'];
-                                                       
$from_email=$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['email'];
+                                                       
$from_email=$GLOBALS['phpgw_info']['user']['preferences']['property']['email'];
                                                        $headers = 
"Return-Path: <". $from_email .">\r\n";
                                                        $headers .= "From: " . 
$from_name . "<" . $from_email .">\r\n";
                                                        $headers .= "Bcc: " . 
$from_name . "<" . $from_email .">\r\n";
@@ -659,7 +654,7 @@
                                                        $headers .= 
"MIME-Version: 1.0\r\n";
 
                                                        $subject = 
lang(Approval).": ". $values['project_id'];
-                                                       $message = '<a href 
="http://' . $GLOBALS['phpgw_info']['server']['hostname'] . 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiproject.edit','id'=> $values['project_id'])).'">' . 
lang(Project) . " " . $values['project_id'] ." ". lang('needs approval') 
.'</a>';
+                                                       $message = '<a href 
="http://' . $GLOBALS['phpgw_info']['server']['hostname'] . 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiproject.edit','id'=> $values['project_id'])).'">' . lang(Project) . 
" " . $values['project_id'] ." ". lang('needs approval') .'</a>';
 
                                                        $bcc = $from_email;
 
@@ -681,13 +676,13 @@
                                                {
                                                        
if($this->account!=$values['coordinator'] && 
$config->config_data['workorder_approval'])
                                                        {
-                                                               
$prefs_coordinator = 
$this->bocommon->create_preferences($this->currentapp,$values['coordinator']);
+                                                               
$prefs_coordinator = 
$this->bocommon->create_preferences('property',$values['coordinator']);
                                                                $to = 
$prefs_coordinator['email'];
 
                                                                
$from_name=$GLOBALS['phpgw_info']['user']['fullname'];
-                                                               
$from_email=$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['email'];
+                                                               
$from_email=$GLOBALS['phpgw_info']['user']['preferences']['property']['email'];
 
-                                                               $body = '<a 
href ="http://' . $GLOBALS['phpgw_info']['server']['hostname'] . 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiproject.edit', 'id'=> $values['project_id'])).'">' . 
lang('project %1 has been edited',$id) .'</a>' . "\n";
+                                                               $body = '<a 
href ="http://' . $GLOBALS['phpgw_info']['server']['hostname'] . 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiproject.edit', 'id'=> $values['project_id'])).'">' . lang('project 
%1 has been edited',$id) .'</a>' . "\n";
                                                                
foreach($receipt['notice_owner'] as $notice)
                                                                {
                                                                        $body 
.= $notice . "\n";
@@ -750,14 +745,14 @@
 
                                if(!isset($values['workorder_budget']) && $save)
                                {
-                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiworkorder.edit', 'project_id'=> $id));
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uiworkorder.edit', 'project_id'=> $id));
                                }
 
                                if 
(!$this->bocommon->check_perms($values['grants'],PHPGW_ACL_EDIT))
                                {
                                        
$receipt['error'][]=array('msg'=>lang('You have no edit right for this 
project'));
-                                       
$GLOBALS['phpgw']->session->appsession('receipt',$this->currentapp,$receipt);
-                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=>$this->currentapp.'.uiproject.view',
 'id'=> $id));
+                                       
$GLOBALS['phpgw']->session->appsession('receipt','property',$receipt);
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=>'property.uiproject.view',
 'id'=> $id));
                                }
                                else
                                {
@@ -822,22 +817,22 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiproject.edit',
+                               'menuaction'    => 'property.uiproject.edit',
                                'id'            => $id
                        );
 
                        $link_request_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uirequest.index',
+                               'menuaction'    => 'property.uirequest.index',
                                'query'         => 
(isset($values['location_data']['loc1'])?$values['location_data']['loc1']:''),
                                'project_id'    => 
(isset($values['project_id'])?$values['project_id']:'')
                        );
 
-                       $supervisor_id= 
(isset($GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['approval_from'])?$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['approval_from']:'');
+                       $supervisor_id= 
(isset($GLOBALS['phpgw_info']['user']['preferences']['property']['approval_from'])?$GLOBALS['phpgw_info']['user']['preferences']['property']['approval_from']:'');
                        $need_approval = 
(isset($config->config_data['workorder_approval'])?$config->config_data['workorder_approval']:'');
 
-                       
$project_status=(isset($GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['project_status'])?$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['project_status']:'');
-                       
$project_category=(isset($GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['project_category'])?$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['project_category']:'');
+                       
$project_status=(isset($GLOBALS['phpgw_info']['user']['preferences']['property']['project_status'])?$GLOBALS['phpgw_info']['user']['preferences']['property']['project_status']:'');
+                       
$project_category=(isset($GLOBALS['phpgw_info']['user']['preferences']['property']['project_category'])?$GLOBALS['phpgw_info']['user']['preferences']['property']['project_category']:'');
                        if(!isset($values['status']))
                        {
                                $values['status']=$project_status;
@@ -855,7 +850,7 @@
 
                        if ($supervisor_id && $need_approval=='yes')
                        {
-                               $prefs = 
$this->bocommon->create_preferences($this->currentapp,$supervisor_id);
+                               $prefs = 
$this->bocommon->create_preferences('property',$supervisor_id);
                                $supervisor_email = $prefs['email'];
                        }
 
@@ -943,15 +938,15 @@
                                'lang_request_statustext'                       
=> lang('Link to the request for this project'),
                                'lang_delete_request_statustext'                
=> lang('Check to delete this request from this project'),
                                'link_select_request'                           
=> $GLOBALS['phpgw']->link('/index.php',$link_request_data),
-                               'link_request'                                  
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uirequest.view')),
+                               'link_request'                                  
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uirequest.view')),
 
-                               'add_workorder_action'                          
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiworkorder.edit')),
+                               'add_workorder_action'                          
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiworkorder.edit')),
                                'lang_add_workorder'                            
=> lang('Add workorder'),
                                'lang_add_workorder_statustext'                 
=> lang('Add a workorder to this project'),
 
                                'table_header_workorder_budget'                 
=> $table_header_workorder_budget,
                                'lang_no_workorders'                            
=> lang('No workorder budget'),
-                               'workorder_link'                                
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiworkorder.edit')),
+                               'workorder_link'                                
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiworkorder.edit')),
                                'record_history'                                
=> $record_history,
                                'table_header_history'                          
=> $table_header_history,
                                'lang_history'                                  
=> lang('History'),
@@ -996,7 +991,7 @@
                                'location_data'                                 
=> $location_data,
                                'location_type'                                 
=> 'form',
                                'form_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'done_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiproject.index')),
+                               'done_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiproject.index')),
                                'lang_year'                                     
=> lang('Year'),
                                'lang_category'                                 
=> lang('category'),
                                'lang_save'                                     
=> lang('save'),
@@ -1076,7 +1071,7 @@
                        );
 
                        $appname                = lang('project');
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -1085,7 +1080,7 @@
                {
                        if(!$this->acl_delete)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>8, 
'acl_location'=>$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>8, 'acl_location'=>$this->acl_location));
                        }
 
                        $project_id = phpgw::get_var('project_id', 'int');
@@ -1093,7 +1088,7 @@
 
                        $link_data = array
                        (
-                               'menuaction' => 
$this->currentapp.'.uiproject.index',
+                               'menuaction' => 'property.uiproject.index',
                                'project_id'    => $project_id
                        );
 
@@ -1108,7 +1103,7 @@
                        $data = array
                        (
                                'done_action'           => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'         => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiproject.delete', 'project_id'=> $project_id)),
+                               'delete_action'         => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiproject.delete', 'project_id'=> $project_id)),
                                'lang_confirm_msg'      => lang('do you really 
want to delete this entry'),
                                'lang_yes'              => lang('yes'),
                                'lang_yes_statustext'   => lang('Delete the 
entry'),
@@ -1119,7 +1114,7 @@
                        $appname                        = lang('project');
                        $function_msg                   = lang('delete 
project');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -1128,11 +1123,11 @@
                {
                        if(!$this->acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>1, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
                        }
 
-                       $receipt = 
$GLOBALS['phpgw']->session->appsession('receipt',$this->currentapp);
-                       
$GLOBALS['phpgw']->session->appsession('receipt',$this->currentapp,'');
+                       $receipt = 
$GLOBALS['phpgw']->session->appsession('receipt','property');
+                       
$GLOBALS['phpgw']->session->appsession('receipt','property','');
                        $bolocation                     = 
CreateObject('property.bolocation');
 
                        $id     = phpgw::get_var('id', 'int');
@@ -1234,7 +1229,7 @@
 
                                'table_header_workorder_budget'         => 
$table_header_workorder_budget,
                                'lang_no_workorders'                    => 
lang('No workorder budget'),
-                               'workorder_link'                        => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiworkorder.view')),
+                               'workorder_link'                        => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiworkorder.view')),
                                'record_history'                        => 
$record_history,
                                'table_header_history'                  => 
$table_header_history,
                                'lang_history'                          => 
lang('History'),
@@ -1267,7 +1262,7 @@
                                'vendor_data'                           => 
isset($vendor_data)?$vendor_data:'',
                                'location_data'                         => 
$location_data,
                                'location_type'                         => 
'view',
-                               'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiproject.index')),
+                               'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiproject.index')),
                                'lang_year'                             => 
lang('Year'),
                                'lang_category'                         => 
lang('category'),
                                'lang_save'                             => 
lang('save'),
@@ -1315,7 +1310,7 @@
                                'key_deliver_list'                      => 
$this->bo->select_key_location_list($values['key_deliver']),
                                'lang_key_deliver'                      => 
lang('key deliver location'),
 
-                               'edit_action'                           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiproject.edit', 'id'=> $id)),
+                               'edit_action'                           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiproject.edit', 'id'=> $id)),
                                'lang_edit_statustext'                  => 
lang('Edit this entry project'),
                                'lang_edit'                             => 
lang('Edit'),
                                'currency'                              => 
$GLOBALS['phpgw_info']['user']['preferences']['common']['currency'],
@@ -1325,7 +1320,7 @@
                        );
 
                        $appname                = lang('project');
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }

Modified: trunk/property/inc/class.uir_agreement.inc.php
===================================================================
--- trunk/property/inc/class.uir_agreement.inc.php      2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/inc/class.uir_agreement.inc.php      2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -48,8 +48,6 @@
                        'view'                  => True,
                        'edit'                  => True,
                        'delete'                => True,
-                       'list_attribute'        => True,
-                       'edit_attrib'           => True,
                        'columns'               => True,
                        'edit_item'             => True,
                        'view_item'             => True,
@@ -62,13 +60,12 @@
                function property_uir_agreement()
                {
                        $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
'property::agreement::rental';
                        $this->nextmatchs       = 
CreateObject('phpgwapi.nextmatchs');
                        $this->account          = 
$GLOBALS['phpgw_info']['user']['account_id'];
 
                        $this->bo               = 
CreateObject('property.bor_agreement',True);
                        $this->bocommon         = 
CreateObject('property.bocommon');
-                       $this->menu             = CreateObject('property.menu');
 
                        $this->role             = $this->bo->role;
 
@@ -76,7 +73,7 @@
                        $this->cats->app_name = 'fm_tenant';
 
                        $this->acl              = CreateObject('phpgwapi.acl');
-                       $this->acl_location= '.r_agreement';
+                       $this->acl_location             = '.r_agreement';
 
                        $this->acl_read         = 
$this->acl->check($this->acl_location,1);
                        $this->acl_add          = 
$this->acl->check($this->acl_location,2);
@@ -130,7 +127,7 @@
 
                                
$GLOBALS['phpgw']->preferences->account_id=$this->account;
                                
$GLOBALS['phpgw']->preferences->read_repository();
-                               
$GLOBALS['phpgw']->preferences->add($this->currentapp,'r_agreement_columns',$values['columns'],'user');
+                               
$GLOBALS['phpgw']->preferences->add('property','r_agreement_columns',$values['columns'],'user');
                                
$GLOBALS['phpgw']->preferences->save_repository();
 
                                $receipt['message'][] = array('msg' => 
lang('columns is updated'));
@@ -140,7 +137,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uir_agreement.columns',
+                               'menuaction'    => 
'property.uir_agreement.columns',
                                'role'          => $this->role
                        );
 
@@ -167,7 +164,7 @@
                {
                        if(!$this->acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>1, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
                        }
 
                        $GLOBALS['phpgw_info']['flags'][noheader] = True;
@@ -177,7 +174,7 @@
                        $file_name      = 
urldecode(phpgw::get_var('file_name'));
                        $id             = phpgw::get_var('id', 'int');
 
-                       $file = $this->fakebase. SEP . 'rental_agreement' . SEP 
. $id . SEP . $file_name;
+                       $file = 
"{$this->fakebase}/rental_agreement/{$id}/{$file_name}";
 
                        if($this->bo->vfs->file_exists(array(
                                'string' => $file,
@@ -209,22 +206,17 @@
 
                function index()
                {
-                       $this->menu->sub        = 'agreement';
-
                        if(!$this->acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>1, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
                        }
 
                        
$GLOBALS['phpgw']->xslttpl->add_file(array('r_agreement',
-                                                                               
'menu',
                                                                                
'receipt',
                                                                                
'search_field_grouped',
                                                                                
'nextmatchs',
                                                                                
));
 
-                       $links = $this->menu->links('r_agreement');
-
                        $receipt = 
$GLOBALS['phpgw']->session->appsession('session_data','r_agreement_receipt');
                        
$GLOBALS['phpgw']->session->appsession('session_data','r_agreement_receipt','');
 
@@ -251,19 +243,19 @@
                                        {
                                                
$content[$j]['row'][$i]['statustext']           = lang('view the entity');
                                                $content[$j]['row'][$i]['text'] 
                = lang('view');
-                                               
$content[$j]['row'][$i++]['link']               = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uir_agreement.view', 'id'=> $entry['id'], 'role'=> 
$this->role));
+                                               
$content[$j]['row'][$i++]['link']                       = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uir_agreement.view', 'id'=> $entry['id'], 'role'=> $this->role));
                                        }
                                        if($this->acl_edit)
                                        {
                                                
$content[$j]['row'][$i]['statustext']           = lang('edit the r_agreement');
                                                $content[$j]['row'][$i]['text'] 
                = lang('edit');
-                                               
$content[$j]['row'][$i++]['link']               = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uir_agreement.edit', 'id'=> $entry['id'], 'role'=> 
$this->role));
+                                               
$content[$j]['row'][$i++]['link']                       = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uir_agreement.edit', 'id'=> $entry['id'], 'role'=> $this->role));
                                        }
                                        if($this->acl_delete)
                                        {
                                                
$content[$j]['row'][$i]['statustext']           = lang('delete the 
r_agreement');
                                                $content[$j]['row'][$i]['text'] 
                = lang('delete');
-                                               
$content[$j]['row'][$i++]['link']               = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uir_agreement.delete', 'r_agreement_id'=> $entry['id'], 
'role'=> $this->role));
+                                               
$content[$j]['row'][$i++]['link']                       = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uir_agreement.delete', 'r_agreement_id'=> $entry['id'], 'role'=> 
$this->role));
                                        }
 
                                        $j++;
@@ -286,7 +278,7 @@
                                                                'sort'  => 
$this->sort,
                                                                'var'   =>      
$uicols['name'][$i],
                                                                'order' =>      
$this->order,
-                                                               'extra'         
=> array('menuaction'   => $this->currentapp.'.uir_agreement.index',
+                                                               'extra'         
=> array('menuaction'   => 'property.uir_agreement.index',
                                                                                
                        'query'         => $this->query,
                                                                                
                        'lookup'        => $lookup,
                                                                                
                        'district_id'   => $this->district_id,
@@ -330,18 +322,18 @@
                                (
                                        'lang_add'              => lang('add'),
                                        'lang_add_statustext'   => lang('add a 
rental agreement'),
-                                       'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uir_agreement.edit', 'role'=> $this->role))
+                                       'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uir_agreement.edit', 'role'=> $this->role))
                                );
                        }
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uir_agreement.index',
-                               'sort'          =>$this->sort,
-                               'order'         =>$this->order,
-                               'cat_id'        =>$this->cat_id,
-                               'filter'        =>$this->filter,
-                               'query'         =>$this->query,
+                               'menuaction'    => 
'property.uir_agreement.index',
+                               'sort'                  => $this->sort,
+                               'order'                 => $this->order,
+                               'cat_id'                => $this->cat_id,
+                               'filter'                => $this->filter,
+                               'query'                 => $this->query,
                                'role'          => $this->role,
                                'member_id'     => $this->member_id,
                                'customer_id'   => $this->customer_id,
@@ -362,13 +354,13 @@
 
                        $link_columns = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uir_agreement.columns',
+                               'menuaction'    => 
'property.uir_agreement.columns',
                                'role'          => $this->role
                        );
 
                        $member_of_data = 
$this->cats->formatted_xslt_list(array('selected' => $this->member_id,'globals' 
=> True,link_data => $link_data));
 
-                       
$GLOBALS['phpgw']->js->validate_file('overlib','overlib',$this->currentapp);
+                       
$GLOBALS['phpgw']->js->validate_file('overlib','overlib','property');
 
 //_debug_array($member_of_data);
                        $data = array
@@ -377,7 +369,6 @@
                                'link_columns'                                  
=> $GLOBALS['phpgw']->link('/index.php',$link_columns),
                                'lang_columns_help'                             
=> lang('Choose columns'),
                                'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'links'                                         
=> $links,
                                'allow_allrows'                                 
=> True,
                                'allrows'                                       
=> $this->allrows,
                                'start_record'                                  
=> $this->start,
@@ -411,11 +402,11 @@
                                'values'                                        
=> $content,
                                'table_add'                                     
=> $table_add,
 
-                               'tenant_link'                                   
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilookup.tenant')),
+                               'tenant_link'                                   
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uilookup.tenant')),
                                'lang_select_tenant_statustext'                 
=> lang('Select the customer by klicking this link'),
                                'lang_tenant'                                   
=> lang('customer'),
-                               'property_link'                                 
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.index', 'lookup'=>1, 'type_id'=>1, 
'lookup_name'=>0)),
-                               'lang_select_property_statustext'               
=> lang('Select the property by klicking this link'),
+                               'property_link'                                 
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uilocation.index', 'lookup'=>1, 'type_id'=>1, 'lookup_name'=>0)),
+                               'lang_select_property_statustext'=> 
lang('Select the property by klicking this link'),
                                'lang_property_statustext'                      
=> lang('Search by property'),
                                'lang_property'                                 
=> lang('property'),
                                'customer_id'                                   
=> $this->customer_id,
@@ -461,19 +452,19 @@
                                        {
                                                
$content[$j]['row'][$i]['statustext']                   = lang('view the 
entity');
                                                $content[$j]['row'][$i]['text'] 
                                = lang('view');
-                                               
$content[$j]['row'][$i++]['link']                               = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uir_agreement.view_item', 'r_agreement_id'=> 
$entry['agreement_id'], 'id'=> $entry['id']));
+                                               
$content[$j]['row'][$i++]['link']                               = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uir_agreement.view_item', 'r_agreement_id'=> $entry['agreement_id'], 
'id'=> $entry['id']));
                                        }
                                        if($this->acl_edit && !$edit_item && 
!$view_only)
                                        {
                                                
$content[$j]['row'][$i]['statustext']                   = lang('edit the 
r_agreement');
                                                $content[$j]['row'][$i]['text'] 
                                = lang('edit');
-                                               
$content[$j]['row'][$i++]['link']                               = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uir_agreement.edit_item', 'r_agreement_id'=> 
$entry['agreement_id'], 'id'=> $entry['id']));
+                                               
$content[$j]['row'][$i++]['link']                               = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uir_agreement.edit_item', 'r_agreement_id'=> $entry['agreement_id'], 
'id'=> $entry['id']));
                                        }
                                        if($this->acl_delete && !$edit_item && 
!$view_only)
                                        {
                                                
$content[$j]['row'][$i]['statustext']                   = lang('delete this 
item');
                                                $content[$j]['row'][$i]['text'] 
                                = lang('delete');
-                                               
$content[$j]['row'][$i++]['link']                               = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uir_agreement.edit', 'delete_item'=>1, 'id'=> 
$entry['agreement_id'], 'item_id'=> $entry['id']));
+                                               
$content[$j]['row'][$i++]['link']                               = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uir_agreement.edit', 'delete_item'=>1, 'id'=> $entry['agreement_id'], 
'item_id'=> $entry['id']));
                                        }
 
                                        $j++;
@@ -531,7 +522,7 @@
                        $delete_item    = phpgw::get_var('delete_item', 'bool');
                        $item_id        = phpgw::get_var('item_id', 'int', 
'GET');
 
-                       $config         = 
CreateObject('phpgwapi.config',$this->currentapp);
+                       $config         = 
CreateObject('phpgwapi.config','property');
                        $boalarm                = 
CreateObject('property.boalarm');
 
                        if($delete_item && $id && $item_id)
@@ -541,7 +532,7 @@
 
                        $values_attribute  = phpgw::get_var('values_attribute');
 
-                       $insert_record_r_agreement = 
$GLOBALS['phpgw']->session->appsession('insert_record_r_agreement',$this->currentapp);
+                       $insert_record_r_agreement = 
$GLOBALS['phpgw']->session->appsession('insert_record_values.r_agreement','property');
 
 //_debug_array($insert_record_r_agreement);
                        for ($j=0;$j<count($insert_record_r_agreement);$j++)
@@ -564,7 +555,7 @@
 
 //_debug_array($values);
 
-                               if ($values['save'] || $values['apply']):
+                               if ($values['save'] || $values['apply'])
                                {
                                        $values['customer_id']          = 
phpgw::get_var('tenant_id', 'int', 'POST');
                                        $values['customer_name']        = 
phpgw::get_var('last_name', 'string', 'POST');
@@ -601,7 +592,7 @@
                                        if(isset($_FILES['file']['name']) && 
$_FILES['file']['name'])
                                        {
                                                
$values['file_name']=str_replace (' ','_',$_FILES['file']['name']);
-                                               $to_file = $this->fakebase. SEP 
. 'rental_agreement' . SEP . $values['r_agreement_id'] . SEP . 
$values['file_name'];
+                                               $to_file = 
"{$this->fakebase}/rental_agreement/{$values['r_agreement_id']}/{$values['file_name']}";
 
                                                
if(!$values['document_name_orig'] && $this->bo->vfs->file_exists(array(
                                                                'string' => 
$to_file,
@@ -640,11 +631,11 @@
                                                if ($values['save'])
                                                {
                                                        
$GLOBALS['phpgw']->session->appsession('session_data','r_agreement_receipt',$receipt);
-                                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uir_agreement.index', 'role'=> $this->role));
+                                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uir_agreement.index', 'role'=> $this->role));
                                                }
                                        }
                                }
-                               elseif($values['update']):
+                               else if($values['update'])
                                {
                                        if(!$values['date'])
                                        {
@@ -661,7 +652,7 @@
                                        }
 
                                }
-                               elseif($values['delete_alarm'] && 
count($values['alarm'])):
+                               else if($values['delete_alarm'] && 
count($values['alarm']))
                                {
 
                                        if(!$receipt['error'])
@@ -670,7 +661,7 @@
                                        }
 
                                }
-                               elseif(($values['enable_alarm'] || 
$values['disable_alarm']) && count($values['alarm'])):
+                               else if(($values['enable_alarm'] || 
$values['disable_alarm']) && count($values['alarm']))
                                {
 
                                        if(!$receipt['error'])
@@ -679,7 +670,7 @@
                                        }
 
                                }
-                               elseif($values['add_alarm']):
+                               else if($values['add_alarm'])
                                {
                                        $time = 
intval($values['time']['days'])*24*3600 +
                                                
intval($values['time']['hours'])*3600 +
@@ -690,11 +681,10 @@
                                                $receipt = 
$boalarm->add_alarm('r_agreement',$this->bo->read_event(array('r_agreement_id'=>$id)),$time,$values['user_id']);
                                        }
                                }
-                               elseif (!$values['save'] && !$values['apply'] 
&& !$values['update']):
+                               else if (!$values['save'] && !$values['apply'] 
&& !$values['update'])
                                {
-                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uir_agreement.index', 'role'=> $this->role));
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uir_agreement.index', 'role'=> $this->role));
                                }
-                               endif;
                        }
 
                        $r_agreement = 
$this->bo->read_single(array('r_agreement_id'=>$id));
@@ -709,10 +699,10 @@
                        $jscal->add_listener('values_start_date');
                        $jscal->add_listener('values_end_date');
                        $jscal->add_listener('values_termination_date');
-                       $jscal->add_listener('values_date');
                        
                        if ($id)
                        {
+                               $jscal->add_listener('values_date');
                                $this->cat_id = 
($r_agreement['cat_id']?$r_agreement['cat_id']:$this->cat_id);
                                $this->member_id = 
($r_agreement['member_of']?$r_agreement['member_of']:$this->member_id);
                                $list = $this->bo->read_details($id);
@@ -750,12 +740,12 @@
 
                                                if($this->acl_edit)
                                                {
-                                                       $link_edit = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uir_agreement.edit_common', 'r_agreement_id'=> 
$common_entry['agreement_id'], 'c_id'=> $common_entry['c_id']));
+                                                       $link_edit = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uir_agreement.edit_common', 'r_agreement_id'=> 
$common_entry['agreement_id'], 'c_id'=> $common_entry['c_id']));
                                                        $text_edit              
        = lang('edit');
                                                }
                                                if($this->acl_delete)
                                                {
-                                                       $link_delete = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uir_agreement.delete_common', 'r_agreement_id'=> 
$common_entry['agreement_id'], 'c_id'=> $common_entry['c_id']));
+                                                       $link_delete = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uir_agreement.delete_common', 'r_agreement_id'=> 
$common_entry['agreement_id'], 'c_id'=> $common_entry['c_id']));
                                                        $text_delete            
=lang('delete');
                                                }
 
@@ -771,7 +761,7 @@
                                                        'fraction'              
                => $common_entry['fraction'],
                                                        'override_fraction'     
                => $common_entry['override_fraction'],
                                                        'remark'                
                => $common_entry['remark'],
-                                                       'link_view'             
                => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uir_agreement.view', 'agreement_id'=> 
$common_entry['agreement_id'], 'c_id'=> $common_entry['c_id'])),
+                                                       'link_view'             
                        => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uir_agreement.view', 'agreement_id'=> $common_entry['agreement_id'], 
'c_id'=> $common_entry['c_id'])),
                                                        'link_edit'             
                => $link_edit,
                                                        'link_delete'           
                => $link_delete,
                                                        'lang_view_statustext'  
                => lang('view the part of town'),
@@ -799,7 +789,7 @@
                                        'lang_budget_cost'              => 
lang('budget cost'),
                                        'lang_actual_cost'              => 
lang('actual cost'),
                                        'lang_fraction'                 => 
lang('fraction'),
-                                       'lang_override_fraction'        => 
lang('override fraction'),
+                                       'lang_override_fraction'=> 
lang('override fraction'),
                                        'lang_view'                     => 
lang('view'),
                                        'lang_edit'                     => 
lang('edit'),
                                        'lang_delete'                   => 
lang('delete')
@@ -811,7 +801,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uir_agreement.edit',
+                               'menuaction'    => 
'property.uir_agreement.edit',
                                'id'            => $id,
                                'role'          => $this->role
                        );
@@ -876,27 +866,27 @@
                        (
                                'lang_add'              => lang('add space'),
                                'lang_add_standardtext' => lang('add an item to 
the details'),
-                               'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uir_agreement.edit_item', 'r_agreement_id'=> $id))
+                               'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uir_agreement.edit_item', 'r_agreement_id'=> $id))
                        );
 
                        $table_add_service[] = array
                        (
                                'lang_add'              => lang('add service'),
                                'lang_add_standardtext' => lang('add an item to 
the details'),
-                               'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uis_agreement.edit_item', 'r_agreement_id'=> $id))
+                               'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uis_agreement.edit_item', 'r_agreement_id'=> $id))
                        );
 
                        $table_add_common[] = array
                        (
                                'lang_add'              => lang('add common'),
                                'lang_add_standardtext' => lang('add an item to 
the details'),
-                               'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uir_agreement.edit_common', 'r_agreement_id'=> $id))
+                               'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uir_agreement.edit_common', 'r_agreement_id'=> $id))
                        );
 
 
                        $link_file_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uir_agreement.view_file',
+                               'menuaction'    => 
'property.uir_agreement.view_file',
                                'id'            =>$id
                        );
 
@@ -911,13 +901,13 @@
 
                        $link_excel = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uir_agreement.excel',
+                               'menuaction'    => 
'property.uir_agreement.excel',
                                'id'            =>$id
                        );
 
-                       
$GLOBALS['phpgw']->js->validate_file('overlib','overlib',$this->currentapp);
-                       
$GLOBALS['phpgw']->js->validate_file('core','check',$this->currentapp);
-                       
$GLOBALS['phpgw']->js->validate_file('dateformat','dateformat',$this->currentapp);
+                       
$GLOBALS['phpgw']->js->validate_file('overlib','overlib','property');
+                       
$GLOBALS['phpgw']->js->validate_file('core','check','property');
+                       
$GLOBALS['phpgw']->js->validate_file('dateformat','dateformat','property');
 
                        $data = array
                        (
@@ -1001,9 +991,9 @@
                                'table_header'                          => 
$table_header,
                                'acl_manage'                            => 
$this->acl_manage,
                                'table_update'                          => 
$table_update,
-                               'update_action'                         => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uir_agreement.edit', 'id'=> $id)),
+                               'update_action'                                 
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uir_agreement.edit', 'id'=> $id)),
                                'lang_select_all'                       => 
lang('Select All'),
-                               'img_check'                             => 
$GLOBALS['phpgw']->common->get_image_path($this->currentapp).'/check.png',
+                               'img_check'                                     
        => $GLOBALS['phpgw']->common->get_image_path('property').'/check.png',
                                'check_all_script'                      => 
$check_all_script,
                                'set_column'                            => 
$set_column,
                                'lang_space'                            => 
lang('space'),
@@ -1011,7 +1001,8 @@
                                'lang_common_costs'                     => 
lang('common costs'),
                                'values_common'                         => 
$content_common,
                                'table_header_common'                   => 
$table_header_common,
-                               
+                               'textareacols'                                  
=> 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'])
 && $GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'] : 40,
+                               'textarearows'                                  
=> 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'])
 && $GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'] : 6
                        );
 
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('rental agreement') . ': ' . ($id?lang('edit') . ' ' . 
lang($this->role):lang('add') . ' ' . lang($this->role));
@@ -1050,9 +1041,9 @@
 
                        if (is_array($values))
                        {
-                               $insert_record = 
$GLOBALS['phpgw']->session->appsession('insert_record',$this->currentapp);
-                               $insert_record_entity = 
$GLOBALS['phpgw']->session->appsession('insert_record_entity',$this->currentapp);
-                               $insert_record_r_agreement1 = 
$GLOBALS['phpgw']->session->appsession('insert_record_r_agreement1',$this->currentapp);
+                               $insert_record = 
$GLOBALS['phpgw']->session->appsession('insert_record','property');
+                               $insert_record_entity = 
$GLOBALS['phpgw']->session->appsession('insert_record_entity','property');
+                               $insert_record_r_agreement1 = 
$GLOBALS['phpgw']->session->appsession('insert_record_values.r_agreement.detail','property');
 
 //_debug_array($insert_record_r_agreement1);
 
@@ -1085,7 +1076,7 @@
                                                if ($values['save'])
                                                {
                                                        
$GLOBALS['phpgw']->session->appsession('session_data','r_agreement_receipt',$receipt);
-                                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uir_agreement.edit', 'id'=> $r_agreement_id));
+                                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uir_agreement.edit', 'id'=> $r_agreement_id));
                                                }
                                        }
                                        else
@@ -1123,7 +1114,7 @@
                                }
                                elseif (!$values['save'] && !$values['apply'] 
&& !$values['update']):
                                {
-                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uir_agreement.edit', 'id'=> $r_agreement_id));
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uir_agreement.edit', 'id'=> $r_agreement_id));
                                }
                                endif;
                        }
@@ -1135,7 +1126,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'            => 
$this->currentapp.'.uir_agreement.edit_item',
+                               'menuaction'            => 
'property.uir_agreement.edit_item',
                                'r_agreement_id'        => $r_agreement_id,
                                'id'                    => $id,
                                'role'                  => $this->role
@@ -1182,7 +1173,7 @@
                        (
                                'lang_add'                              => 
lang('add detail'),
                                'lang_add_standardtext' => lang('add an item to 
the details'),
-                               'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uir_agreement.edit_item','r_agreement_id'=> 
$r_agreement_id))
+                               'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uir_agreement.edit_item','r_agreement_id'=> $r_agreement_id))
                        );
 
 
@@ -1247,8 +1238,8 @@
                                                'entity_data'   => 
False,//$values['p']
                                                ));
 
-                       
$GLOBALS['phpgw']->js->validate_file('core','check',$this->currentapp);
-                       
$GLOBALS['phpgw']->js->validate_file('dateformat','dateformat',$this->currentapp);
+                       
$GLOBALS['phpgw']->js->validate_file('core','check','property');
+                       
$GLOBALS['phpgw']->js->validate_file('dateformat','dateformat','property');
 
                        $data = array
                        (
@@ -1286,9 +1277,9 @@
                                'table_header'                                  
=> $table_header,
                                'acl_manage'                                    
=> $this->acl_manage,
                                'table_update_item'                             
=> $table_update,
-                               'update_action'                                 
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uir_agreement.edit_item', 'r_agreement_id'=> 
$r_agreement_id, 'id'=> $id)),
+                               'update_action'                                 
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uir_agreement.edit_item', 'r_agreement_id'=> $r_agreement_id, 'id'=> 
$id)),
                                'lang_select_all'                               
=> lang('Select All'),
-                               'img_check'                                     
=> $GLOBALS['phpgw']->common->get_image_path($this->currentapp).'/check.png',
+                               'img_check'                                     
                => 
$GLOBALS['phpgw']->common->get_image_path('property').'/check.png',
                                'location_data'                                 
=> $location_data,
 
                                'lang_cost'                                     
=> lang('cost'),
@@ -1297,7 +1288,7 @@
                                'set_column'                                    
=> $set_column,
                                'lang_delete_last'                              
=> lang('delete last index'),
                                'lang_delete_last_statustext'                   
=> lang('delete the last index'),
-                               'delete_action'                                 
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uir_agreement.edit_item', 'delete_last'=>1, 
'r_agreement_id'=> $r_agreement_id, 'id'=> $id)),
+                               'delete_action'                                 
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uir_agreement.edit_item', 'delete_last'=>1, 'r_agreement_id'=> 
$r_agreement_id, 'id'=> $id)),
                                'tenant_data'                                   
=> $tenant_data,
                                'rental_type_list'                              
=> $this->bo->get_rental_type_list($values['rental_type_id']),
                                'lang_rental_type_statustext'                   
=> lang('Select rental type'),
@@ -1311,7 +1302,8 @@
 //                             'value_end_date'                                
=> $r_agreement['start_date'],
                                'main_form_name'                                
=> $main_form_name,
                                'update_form_name'                              
=> $update_form_name,
-
+                               'textareacols'                                  
        => 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'])
 && $GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'] : 40,
+                               'textarearows'                                  
        => 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'])
 && $GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'] : 6
                        );
 
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('rental agreement') . ': ' . ($values['id']?lang('edit item') . ' ' . 
$r_agreement['name']:lang('add item') . ' ' . $r_agreement['name']);
@@ -1334,7 +1326,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uir_agreement.edit',
+                               'menuaction'    => 
'property.uir_agreement.edit',
                                'id'            => $r_agreement_id
                        );
 
@@ -1377,7 +1369,7 @@
                                                'type'          => 'view')
                                                );
 
-                       
$GLOBALS['phpgw']->js->validate_file('core','check',$this->currentapp);
+                       
$GLOBALS['phpgw']->js->validate_file('core','check','property');
 
                        $data = array
                        (
@@ -1407,7 +1399,10 @@
                                'set_column'                                    
=> $set_column,
                                'tenant_data'                                   
=> $tenant_data,
                                'rental_type_list'                              
=> $this->bo->get_rental_type_list($values['rental_type_id']),
-                               'lang_rental_type'                              
=> lang('Rental type'),                 );
+                               'lang_rental_type'                              
=> lang('Rental type'),
+                               'textareacols'                                  
=> 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'])
 && $GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'] : 40,
+                               'textarearows'                                  
=> 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'])
 && $GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'] : 6
+                       );
 
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('rental agreement') . ': ' . lang('view item') . ' ' . 
$r_agreement['name'];
 
@@ -1418,30 +1413,19 @@
 
                function delete()
                {
-                       $attrib         = phpgw::get_var('attrib');
-                       $id             = phpgw::get_var('id', 'int');
                        $r_agreement_id = phpgw::get_var('r_agreement_id', 
'int');
                        $delete         = phpgw::get_var('delete', 'bool', 
'POST');
                        $confirm        = phpgw::get_var('confirm', 'bool', 
'POST');
 
-
-                       if($attrib)
-                       {
-                               $function='list_attribute';
-                       }
-                       else
-                       {
-                               $function='index';
-                       }
                        $link_data = array
                        (
-                               'menuaction' => 
$this->currentapp.'.uir_agreement.'.$function,
+                               'menuaction' => 'property.uir_agreement.index',
                                'role'                  => $this->role
                        );
 
                        if (phpgw::get_var('confirm', 'bool', 'POST'))
                        {
-                               $this->bo->delete($r_agreement_id,$id,$attrib);
+                               $this->bo->delete($r_agreement_id);
                                
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
                        }
 
@@ -1450,7 +1434,7 @@
                        $data = array
                        (
                                'done_action'           => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'         => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uir_agreement.delete', 'r_agreement_id'=> $r_agreement_id, 
'id'=> $id, 'attrib'=> $attrib, 'role'=> $this->role)),
+                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uir_agreement.delete', 'r_agreement_id'=> $r_agreement_id, 'role'=> 
$this->role)),
                                'lang_confirm_msg'      => lang('do you really 
want to delete this entry'),
                                'lang_yes'              => lang('yes'),
                                'lang_yes_statustext'   => lang('Delete the 
entry'),
@@ -1461,7 +1445,7 @@
                        $appname        = lang('rental agreement');
                        $function_msg   = lang('delete') . ' ' . 
lang($this->role);
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -1471,7 +1455,7 @@
                function view()
                {
                        $r_agreement_id = phpgw::get_var('id', 'int');
-                       $config         = 
CreateObject('phpgwapi.config',$this->currentapp);
+                       $config         = 
CreateObject('phpgwapi.config','property');
 
                        
$GLOBALS['phpgw']->xslttpl->add_file(array('r_agreement','attributes_view'));
 
@@ -1494,7 +1478,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'            => 
$this->currentapp.'.uir_agreement.index',
+                               'menuaction'            => 
'property.uir_agreement.index',
                                'r_agreement_id'        => $r_agreement_id,
                        );
 
@@ -1517,15 +1501,15 @@
 
 
                        $alarm_data=$this->bocommon->initiate_ui_alarm(array(
-                                               
'acl_location'=>$this->acl_location,
-                                               'alarm_type'=> 'r_agreement',
+                                               'acl_location'  => 
$this->acl_location,
+                                               'alarm_type'    => 
'r_agreement',
                                                'type'          => 'view',
                                                'text'          => 'Email 
notification',
                                                'times'         => $times,
                                                'id'            => 
$r_agreement_id,
                                                'method'        => $method,
                                                'data'          => $data,
-                                               'account_id'=> $account_id
+                                               'account_id'    => $account_id
                                                ));
 
 
@@ -1542,7 +1526,7 @@
 
                        $link_file_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uir_agreement.view_file',
+                               'menuaction'    => 
'property.uir_agreement.view_file',
                                'id'            =>$r_agreement_id
                        );
 
@@ -1607,6 +1591,8 @@
                                'table_add'                                     
=> $table_add,
                                'values'                                        
=> $content,
                                'table_header'                                  
=> $table_header,
+                               'textareacols'                                  
        => 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'])
 && $GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'] : 40,
+                               'textarearows'                                  
        => 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'])
 && $GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'] : 6
                        );
 
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('rental agreement') . ': ' . lang('view');
@@ -1616,320 +1602,6 @@
                }
 
 
-               function list_attribute()
-               {
-                       $id     = phpgw::get_var('id', 'int');
-                       $resort = phpgw::get_var('resort');
-
-                       $GLOBALS['phpgw']->xslttpl->add_file(array(
-                                                               'r_agreement',
-                                                               'nextmatchs',
-                                                               
'search_field'));
-
-                       if($resort)
-                       {
-                               
$this->bo->resort_attrib(array('resort'=>$resort,'id'=>$id));
-                       }
-
-                       $attrib_list = $this->bo->read_attrib();
-
-                       while (is_array($attrib_list) && list(,$attrib) = 
each($attrib_list))
-                       {
-                               $content[] = array
-                               (
-                                       'name'                                  
=> $attrib['name'],
-                                       'type_name'                             
=> $attrib['type_name'],
-                                       'datatype'                              
=> $attrib['datatype'],
-                                       'column_name'                           
=> $attrib['column_name'],
-                                       'input_text'                            
=> $attrib['input_text'],
-                                       'sorting'                               
=> $attrib['attrib_sort'],
-                                       'search'                                
=> $attrib['search'],
-                                       'link_up'                               
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uir_agreement.list_attribute', 'resort'=>'up', 'id'=> 
$attrib['id'], 'allrows'=> $this->allrows, 'role'=> $this->role)),
-                                       'link_down'                             
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uir_agreement.list_attribute', 'resort'=>'down', 'id'=> 
$attrib['id'], 'allrows'=> $this->allrows, 'role'=> $this->role)),
-                                       'link_edit'                             
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uir_agreement.edit_attrib', 'id'=> $attrib['id'], 'role'=> 
$this->role)),
-                                       'link_delete'                           
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uir_agreement.delete', 'id'=> $attrib['id'], 
'attrib'=>true, 'role'=> $this->role)),
-                                       'lang_view_attribtext'                  
=> lang('view the attrib'),
-                                       'lang_attribute_attribtext'             
=> lang('attributes for the attrib'). ' ' . lang('location'),
-                                       'lang_edit_attribtext'                  
=> lang('edit the attrib'),
-                                       'lang_delete_attribtext'                
=> lang('delete the attrib'),
-                                       'text_attribute'                        
=> lang('Attributes'),
-                                       'text_up'                               
=> lang('up'),
-                                       'text_down'                             
=> lang('down'),
-                                       'text_edit'                             
=> lang('edit'),
-                                       'text_delete'                           
=> lang('delete')
-                               );
-                       }
-
-       //html_print_r($content);
-
-                       $table_header[] = array
-                       (
-                               'lang_descr'            => lang('Descr'),
-                               'lang_datatype'         => lang('Datatype'),
-                               'lang_sorting'          => lang('sorting'),
-                               'lang_search'           => lang('search'),
-                               'lang_edit'             => lang('edit'),
-                               'lang_delete'           => lang('delete'),
-                               'sort_sorting'  => 
$this->nextmatchs->show_sort_order(array
-                                                                               
(
-                                                                               
        'sort'  => $this->sort,
-                                                                               
        'var'   => 'attrib_sort',
-                                                                               
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uir_agreement.list_attribute',
-                                                                               
                                                'allrows'=>$this->allrows,
-                                                                               
                                                'role'  => $this->role)
-                                                                               
)),
-
-                               'sort_name'     => 
$this->nextmatchs->show_sort_order(array
-                                                                               
(
-                                                                               
        'sort'  => $this->sort,
-                                                                               
        'var'   => 'column_name',
-                                                                               
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uir_agreement.list_attribute',
-                                                                               
                                                'allrows'=>$this->allrows,
-                                                                               
                                                'role'  => $this->role)
-                                                                               
)),
-                               'lang_name'     => lang('Name'),
-                       );
-
-                       $table_add[] = array
-                       (
-                               'lang_add'              => lang('add'),
-                               'lang_add_attribtext'   => lang('add an 
attrib'),
-                               'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uir_agreement.edit_attrib', 'role'=> $this->role)),
-                               'lang_done'             => lang('done'),
-                               'lang_done_attribtext'  => 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.'.uir_agreement.list_attribute',
-                               'sort'          =>$this->sort,
-                               'order'         =>$this->order,
-                               'query'         =>$this->query,
-                               'role'          => $this->role
-
-                       );
-
-                       $data = array
-                       (
-                               'allow_allrows'                                 
=> True,
-                               'allrows'                                       
=> $this->allrows,
-                               'start_record'                                  
=> $this->start,
-                               'record_limit'                                  
=> $record_limit,
-                               'num_records'                                   
=> count($attrib_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_attribtext'                   
=> lang('Enter the search string. To show all entries, empty this field and 
press the SUBMIT button again'),
-                               'lang_searchbutton_attribtext'                  
=> lang('Submit the search string'),
-                               'query'                                         
=> $this->query,
-                               'lang_search'                                   
=> lang('search'),
-                               'table_header_attrib'                           
=> $table_header,
-                               'values_attrib'                                 
=> $content,
-                               'table_add2'                                    
=> $table_add
-                       );
-
-                       $appname        = lang('rental agreement');
-                       $function_msg   = lang('list attribute') . ': ' . 
lang($this->role);
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
-                       //$this->save_sessiondata();
-                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_attribute' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
-               }
-
-               function edit_attrib()
-               {
-                       $id                     = phpgw::get_var('id', 'int');
-                       $values         = phpgw::get_var('values');
-       //              $GLOBALS['phpgw']->common->msgbox(lang('Altering 
ColumnName OR Datatype  - deletes your data in this Column'));
-       //html_print_r($values);
-                       
$GLOBALS['phpgw']->xslttpl->add_file(array('r_agreement','choice',));
-
-                       if ($values['save'])
-                       {
-                               if($id)
-                               {
-                                       $values['id']=$id;
-                                       $action='edit';
-                               }
-                               $type_id                        = 
$values['type_id'];
-
-                               if (!$values['column_name'])
-                               {
-                                       $receipt['error'][] = 
array('msg'=>lang('Column name not entered!'));
-                               }
-
-                               if (!$values['input_text'])
-                               {
-                                       $receipt['error'][] = 
array('msg'=>lang('Input text not entered!'));
-                               }
-                               if (!$values['statustext'])
-                               {
-                                       $receipt['error'][] = 
array('msg'=>lang('Statustext not entered!'));
-                               }
-
-                               if (!$values['column_info']['type'])
-                               {
-                                       $receipt['error'][] = 
array('msg'=>lang('Datatype type not chosen!'));
-                               }
-
-                               
if(!ctype_digit($values['column_info']['precision']) && 
$values['column_info']['precision'])
-                               {
-                                       
$receipt['error'][]=array('msg'=>lang('Please enter precision as integer !'));
-                                       
unset($values['column_info']['precision']);
-                               }
-
-                               if($values['column_info']['scale'] && 
!ctype_digit($values['column_info']['scale']))
-                               {
-                                       
$receipt['error'][]=array('msg'=>lang('Please enter scale as integer !'));
-                                       unset($values['column_info']['scale']);
-                               }
-
-                               if (!$values['column_info']['nullable'])
-                               {
-                                       $receipt['error'][] = 
array('msg'=>lang('Nullable not chosen!'));
-                               }
-
-
-                               if (!$receipt['error'])
-                               {
-                                       $receipt = 
$this->bo->save_attrib($values,$action);
-
-                                       if(!$id)
-                                       {
-                                               $id=$receipt['id'];
-                                       }
-                               }
-                               else
-                               {
-                                       $receipt['error'][] = array('msg'       
=> lang('Attribute has NOT been saved'));
-                               }
-                       }
-
-                       if ($id)
-                       {
-                               $values = $this->bo->read_single_attrib($id);
-                               $function_msg = lang('edit attribute') . ': ' . 
lang($this->role);
-                               $action='edit';
-                       }
-                       else
-                       {
-                               $function_msg = lang('add attribute') . ': ' . 
lang($this->role);
-                               $action='add';
-                       }
-
-                       $link_data = array
-                       (
-                               'menuaction'    => 
$this->currentapp.'.uir_agreement.edit_attrib',
-                               'id'            => $id,
-                               'role'          => $this->role
-
-                       );
-       //html_print_r($values);
-
-                       if(is_array($values['column_info']))
-                       {
-                               if($values['column_info']['type']=='R' || 
$values['column_info']['type']=='CH' || $values['column_info']['type']=='LB')
-                               {
-                                       $multiple_choice= True;
-                               }
-                               
-                               $column_type = $values['column_info']['type'];
-                               $column_precision 
=$values['column_info']['precision'];
-                               $column_scale =$values['column_info']['scale'];
-                               $column_default 
=$values['column_info']['default'];
-                               $column_nullable 
=$values['column_info']['nullable'];
-                       }
-
-
-                       $msgbox_data = $this->bocommon->msgbox_data($receipt);
-
-                       $data = array
-                       (
-                               'lang_choice'                           => 
lang('Choice'),
-                               'lang_new_value'                        => 
lang('New value'),
-                               'lang_new_value_statustext'             => 
lang('New value for multiple choice'),
-                               'multiple_choice'                       => 
$multiple_choice,
-                               'value_choice'                          => 
$values['choice'],
-                               'lang_delete_value'                     => 
lang('Delete value'),
-                               'lang_value'                            => 
lang('value'),
-                               'lang_delete_choice_statustext'         => 
lang('Delete this value from the list of multiple choice'),
-                               '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.'.uir_agreement.list_attribute', 'type_id'=> $type_id, 
'role'=> $this->role)),
-                               'lang_id'                               => 
lang('Attribute ID'),
-                               'lang_save'                             => 
lang('save'),
-                               'lang_done'                             => 
lang('done'),
-                               'value_id'                              => $id,
-
-                               'lang_column_name'                      => 
lang('Column name'),
-                               'value_column_name'                     => 
$values['column_name'],
-                               'lang_column_name_statustext'           => 
lang('enter the name for the column'),
-
-                               'lang_input_text'                       => 
lang('input text'),
-                               'value_input_text'                      => 
$values['input_text'],
-                               'lang_input_name_statustext'            => 
lang('enter the input text for records'),
-
-                               'lang_id_attribtext'                    => 
lang('Enter the attribute ID'),
-                               'lang_entity_statustext'                => 
lang('Select a rental agreement type'),
-
-                               'lang_statustext'                       => 
lang('Statustext'),
-                               'lang_statustext_attribtext'            => 
lang('Enter a statustext for the inputfield in forms'),
-                               'value_statustext'                      => 
$values['statustext'],
-
-                               'lang_done_attribtext'                  => 
lang('Back to the list'),
-                               'lang_save_attribtext'                  => 
lang('Save the attribute'),
-
-                               'lang_datatype'                         => 
lang('Datatype'),
-                               'lang_datatype_statustext'              => 
lang('Select a datatype'),
-                               'lang_no_datatype'                      => 
lang('No datatype'),
-                               'datatype_list'                         => 
$this->bocommon->select_datatype($column_type),
-
-                               'lang_precision'                        => 
lang('Precision'),
-                               'lang_precision_statustext'             => 
lang('enter the record length'),
-                               'value_precision'                       => 
$column_precision,
-
-                               'lang_scale'                            => 
lang('scale'),
-                               'lang_scale_statustext'                 => 
lang('enter the scale if type is decimal'),
-                               'value_scale'                           => 
$column_scale,
-
-                               'lang_default'                          => 
lang('default'),
-                               'lang_default_statustext'               => 
lang('enter the default value'),
-                               'value_default'                         => 
$column_default,
-
-                               'lang_nullable'                         => 
lang('Nullable'),
-                               'lang_nullable_statustext'              => 
lang('Chose if this column is nullable'),
-                               'lang_select_nullable'                  => 
lang('Select nullable'),
-                               'nullable_list'                         => 
$this->bocommon->select_nullable($column_nullable),
-
-                               'value_list'                            => 
$values['list'],
-                               'lang_list'                             => 
lang('show in list'),
-                               'lang_list_statustext'                  => 
lang('check to show this attribute in location list'),
-
-                               'value_search'                          => 
$values['search'],
-                               'lang_include_search'                   => 
lang('Include in search'),
-                               'lang_include_search_statustext'        => 
lang('check to show this attribute in location list'),
-                       );
-       //html_print_r($data);
-
-                       $appname                                                
= lang('rental agreement');
-
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
-                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_attrib' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
-               }
-               
                function edit_common()
                {
                        $r_agreement_id = phpgw::get_var('r_agreement_id', 
'int');
@@ -1962,7 +1634,7 @@
                                                if ($values['save'])
                                                {
                                                        
$GLOBALS['phpgw']->session->appsession('session_data','r_agreement_receipt',$receipt);
-                                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uir_agreement.edit', 'id'=> $r_agreement_id));
+                                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uir_agreement.edit', 'id'=> $r_agreement_id));
                                                }
                                        }
                                }
@@ -1987,7 +1659,7 @@
                                }
                                elseif (!$values['save'] && !$values['apply'] 
&& !$values['update']):
                                {
-                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uir_agreement.edit', 'id'=> $r_agreement_id));
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uir_agreement.edit', 'id'=> $r_agreement_id));
                                }
                                endif;
                        }
@@ -2010,12 +1682,12 @@
 
                                                if($this->acl_edit)
                                                {
-                                                       $link_edit = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uir_agreement.edit_common_h', 'r_agreement_id'=> 
$r_agreement_id, 'c_id'=> $common_entry['c_id'], 'id'=> $common_entry['id']));
+                                                       $link_edit = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uir_agreement.edit_common_h', 'r_agreement_id'=> $r_agreement_id, 
'c_id'=> $common_entry['c_id'], 'id'=> $common_entry['id']));
                                                        $text_edit              
        = lang('edit');
                                                }
                                                if($this->acl_delete)
                                                {
-                                                       $link_delete = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uir_agreement.delete_common_h', 'r_agreement_id'=> 
$r_agreement_id, 'c_id'=> $common_entry['c_id'], 'id'=> $common_entry['id']));
+                                                       $link_delete = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uir_agreement.delete_common_h', 'r_agreement_id'=> $r_agreement_id, 
'c_id'=> $common_entry['c_id'], 'id'=> $common_entry['id']));
                                                        $text_delete            
=lang('delete');
                                                }
 
@@ -2030,7 +1702,7 @@
                                                        'fraction'              
                => $common_entry['fraction'],
                                                        'override_fraction'     
                => $common_entry['override_fraction'],
                                                        'remark'                
                => $common_entry['remark'],
-                                                       'link_view'             
                => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uir_agreement.view_common_h', 'agreement_id'=> 
$r_agreement_id, 'c_id'=> $common_entry['c_id'], 'id'=> $common_entry['id'])),
+                                                       'link_view'             
                        => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uir_agreement.view_common_h', 'agreement_id'=> $r_agreement_id, 
'c_id'=> $common_entry['c_id'], 'id'=> $common_entry['id'])),
                                                        'link_edit'             
                => $link_edit,
                                                        'link_delete'           
                => $link_delete,
                                                        'lang_view_statustext'  
                => lang('view the part of town'),
@@ -2059,15 +1731,12 @@
                                        'lang_budget_cost'              => 
lang('budget cost'),
                                        'lang_actual_cost'              => 
lang('actual cost'),
                                        'lang_fraction'                 => 
lang('fraction'),
-                                       'lang_override_fraction'        => 
lang('override fraction'),
+                                       'lang_override_fraction'=> 
lang('override fraction'),
                                        'lang_view'                     => 
lang('view'),
                                        'lang_edit'                     => 
lang('edit'),
                                        'lang_delete'                   => 
lang('delete')
                                );
 
-
-
-
                                $lookup_type='view';
 
                                $default_next_date = 
date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'],$this->bocommon->date_to_timestamp($default_next_date)
 + 3600*24);
@@ -2075,7 +1744,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'            => 
$this->currentapp.'.uir_agreement.edit_common',
+                               'menuaction'            => 
'property.uir_agreement.edit_common',
                                'r_agreement_id'        => $r_agreement_id,
                                'c_id'                  => $c_id,
                        );
@@ -2120,7 +1789,7 @@
                                                'b_account_name'        => 
$values['b_account_name'],
                                                'type'                  
=>$lookup_type));
 
-                       
$GLOBALS['phpgw']->js->validate_file('dateformat','dateformat',$this->currentapp);
+                       
$GLOBALS['phpgw']->js->validate_file('dateformat','dateformat','property');
 
                        $data = array
                        (
@@ -2186,7 +1855,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'            => 
$this->currentapp.'.uir_agreement.edit_common',
+                               'menuaction'            => 
'property.uir_agreement.edit_common',
                                'r_agreement_id'        => $r_agreement_id,
                                'c_id'                  => $c_id
                        );
@@ -2203,7 +1872,7 @@
                        $data = array
                        (
                                'done_action'           => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'         => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uir_agreement.delete_common_h', 'r_agreement_id'=> 
$r_agreement_id, 'c_id'=> $c_id, 'id'=> $id)),
+                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uir_agreement.delete_common_h', 'r_agreement_id'=> $r_agreement_id, 
'c_id'=> $c_id, 'id'=> $id)),
                                'lang_confirm_msg'      => lang('do you really 
want to delete this entry'),
                                'lang_yes'              => lang('yes'),
                                'lang_yes_statustext'   => lang('Delete the 
entry'),
@@ -2214,10 +1883,8 @@
                        $appname        = lang('rental agreement');
                        $function_msg   = lang('delete') . ' ' . lang('common 
history element');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
-
                }
-               
        }
 ?>

Modified: trunk/property/inc/class.uirequest.inc.php
===================================================================
--- trunk/property/inc/class.uirequest.inc.php  2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.uirequest.inc.php  2008-02-02 13:52:39 UTC (rev 
18466)
@@ -59,13 +59,13 @@
                function property_uirequest()
                {
                        $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
'property::project::request';
+               //      $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->nextmatchs                       = 
CreateObject('phpgwapi.nextmatchs');
                        $this->account                          = 
$GLOBALS['phpgw_info']['user']['account_id'];
                        $this->bo                               = 
CreateObject('property.borequest',True);
                        $this->boproject                        = 
CreateObject('property.boproject');
                        $this->bocommon                         = 
CreateObject('property.bocommon');
-                       $this->menu                             = 
CreateObject('property.menu');
                        $this->bolocation                       = 
CreateObject('property.bolocation');
                        $this->config                           = 
CreateObject('phpgwapi.config');
 
@@ -85,7 +85,6 @@
                        $this->cat_id                           = 
$this->bo->cat_id;
                        $this->status_id                        = 
$this->bo->status_id;
 
-                       $this->menu->sub                        ='project';
                        $this->fakebase                         = 
$this->bo->fakebase;
                        $this->allrows                          = 
$this->bo->allrows;
                }
@@ -114,14 +113,14 @@
 
                        if(!$this->acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>1, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
                        }
 
                        $file_name      = 
urldecode(phpgw::get_var('file_name'));
                        $location_code  = phpgw::get_var('location_code');
                        $id             = phpgw::get_var('id', 'int');
 
-                       $file = $this->fakebase. SEP . 'request' . SEP . 
$location_code . SEP . $id . SEP . $file_name;
+                       $file = $this->fakebase. '/' . 'request' . '/' . 
$location_code . '/' . $id . '/' . $file_name;
 
                        if($this->bo->vfs->file_exists(array(
                                'string' => $file,
@@ -164,11 +163,10 @@
                {
                        if(!$this->acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>1, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
                        }
 
                        
$GLOBALS['phpgw']->xslttpl->add_file(array('request','table_header',
-                                                                               
'menu',
                                                                                
'nextmatchs',
                                                                                
'search_field'));
 
@@ -178,7 +176,6 @@
                        {
                                $lookup = True;
                        }
-                       $links = $this->menu->links('request');
 
                        $request_list = $this->bo->read(array('project_id' => 
1,'allrows'=>$this->allrows));
 
@@ -199,7 +196,7 @@
                                                {
                                                        
$content[$j]['row'][$k]['statustext']           = lang('search');
                                                        
$content[$j]['row'][$k]['text']                 = 
$request_entry[$uicols['name'][$k]];
-                                                       
$content[$j]['row'][$k]['link']                 = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uirequest.index', 'query'=> 
$request_entry['query_location'][$uicols['name'][$k]], 'project_id'=> 
$project_id));
+                                                       
$content[$j]['row'][$k]['link']                 = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uirequest.index', 'query'=> 
$request_entry['query_location'][$uicols['name'][$k]], 'project_id'=> 
$project_id));
                                                }
                                                else
                                                {
@@ -217,7 +214,7 @@
                                        {
                                                
$content[$j]['row'][$k]['statustext']                   = lang('view the 
request');
                                                $content[$j]['row'][$k]['text'] 
                        = lang('view');
-                                               $content[$j]['row'][$k]['link'] 
                        = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uirequest.view', 'id'=> $request_entry['request_id']));
+                                               $content[$j]['row'][$k]['link'] 
                        = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uirequest.view', 'id'=> $request_entry['request_id']));
                                                $k++;
                                        }
 
@@ -225,7 +222,7 @@
                                        {
                                                
$content[$j]['row'][$k]['statustext']                   = lang('edit the 
request');
                                                $content[$j]['row'][$k]['text'] 
                        = lang('edit');
-                                               $content[$j]['row'][$k]['link'] 
                        = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uirequest.edit', 'id'=> $request_entry['request_id']));
+                                               $content[$j]['row'][$k]['link'] 
                        = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uirequest.edit', 'id'=> $request_entry['request_id']));
                                                $k++;
                                        }
 
@@ -233,7 +230,7 @@
                                        {
                                                
$content[$j]['row'][$k]['statustext']                   = lang('delete the 
request');
                                                $content[$j]['row'][$k]['text'] 
                        = lang('delete');
-                                               $content[$j]['row'][$k]['link'] 
                        = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uirequest.delete', 'id'=> $request_entry['request_id']));
+                                               $content[$j]['row'][$k]['link'] 
                        = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uirequest.delete', 'id'=> $request_entry['request_id']));
                                                $k++;
                                        }
 
@@ -245,7 +242,7 @@
                                                
$content[$j]['row'][$k]['statustext']                   = lang('view the 
request');
                                                $content[$j]['row'][$k]['text'] 
                        = lang('view');
                                                
$content[$j]['row'][$k]['target']                       = '_blank';
-                                               $content[$j]['row'][$k]['link'] 
                        = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uirequest.view', 'id'=> $request_entry['request_id']));
+                                               $content[$j]['row'][$k]['link'] 
                        = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uirequest.view', 'id'=> $request_entry['request_id']));
                                                
$content[$j]['row'][$k]['request_id']                   = 
$request_entry['request_id'];
                                                $k++;
                                        }
@@ -270,7 +267,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'location_code',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction' => $this->currentapp.'.uirequest.index',
+                                                                               
        'extra' => array('menuaction' => 'property.uirequest.index',
                                                                                
                                                        'type_id'       
=>$type_id,
                                                                                
                                                        'query'         
=>$this->query,
                                                                                
                                                        'project_id'    
=>$project_id,
@@ -286,7 +283,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'request_id',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction' => $this->currentapp.'.uirequest.index',
+                                                                               
        'extra' => array('menuaction' => 'property.uirequest.index',
                                                                                
                                                        'type_id'       
=>$type_id,
                                                                                
                                                        'query'         
=>$this->query,
                                                                                
                                                        'project_id'    
=>$project_id,
@@ -302,7 +299,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'score',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction' => $this->currentapp.'.uirequest.index',
+                                                                               
        'extra' => array('menuaction' => 'property.uirequest.index',
                                                                                
                                                        'type_id'       
=>$type_id,
                                                                                
                                                        'query'         
=>$this->query,
                                                                                
                                                        'project_id'    
=>$project_id,
@@ -318,7 +315,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'budget',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction' => $this->currentapp.'.uirequest.index',
+                                                                               
        'extra' => array('menuaction' => 'property.uirequest.index',
                                                                                
                                                        'type_id'       
=>$type_id,
                                                                                
                                                        'query'         
=>$this->query,
                                                                                
                                                        'project_id'    
=>$project_id,
@@ -334,7 +331,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'address',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction' => $this->currentapp.'.uirequest.index',
+                                                                               
        'extra' => array('menuaction' => 'property.uirequest.index',
                                                                                
                                                        'type_id'       
=>$type_id,
                                                                                
                                                        'query'         
=>$this->query,
                                                                                
                                                        'project_id'    
=>$project_id,
@@ -384,13 +381,13 @@
                                (
                                        'lang_add'              => lang('add'),
                                        'lang_add_statustext'   => lang('add a 
request'),
-                                       'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uirequest.edit'))
+                                       'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uirequest.edit'))
                                );
                        }
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uirequest.index',
+                               'menuaction'    => 'property.uirequest.index',
                                                'sort'          => $this->sort,
                                                'order'         => $this->order,
                                                'cat_id'        => 
$this->cat_id,
@@ -404,7 +401,7 @@
 
                        $link_excel = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uirequest.excel',
+                               'menuaction'    => 'property.uirequest.excel',
                                                'sort'          => $this->sort,
                                                'order'         => $this->order,
                                                'cat_id'        => 
$this->cat_id,
@@ -417,7 +414,7 @@
 
                        if($this->acl_manage)
                        {
-                               $link_priority_key = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uirequest.priority_key'));
+                               $link_priority_key = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uirequest.priority_key'));
                        }
 
                        if(!$this->allrows)
@@ -429,7 +426,7 @@
                                $record_limit   = $this->bo->total_records;
                        }
 
-                       
$GLOBALS['phpgw']->js->validate_file('overlib','overlib',$this->currentapp);
+                       
$GLOBALS['phpgw']->js->validate_file('overlib','overlib','property');
 
                        $data = array
                        (
@@ -444,11 +441,10 @@
 
                                'lang_update_project'                   => 
lang('Update project'),
                                'lang_add_to_project_statustext'        => 
lang('add selected request to project'),
-                               'add_to_project_action'                 => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiproject.edit', 'id'=> $project_id)),
+                               'add_to_project_action'                 => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiproject.edit', 'id'=> $project_id)),
                                'project_id'                            => 
$project_id,
 
                                'lookup'                                => 
$lookup,
-                               'links'                                 => 
$links,
                                'allow_allrows'                         => true,
                                'allrows'                               => 
$this->allrows,
 
@@ -492,7 +488,7 @@
                        $appname                                        = 
lang('request');
                        $function_msg                                   = 
lang('list request');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
@@ -503,7 +499,7 @@
                {
                        if(!$this->acl_manage)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>16, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>16, 'acl_location'=> $this->acl_location));
                        }
                        $GLOBALS['phpgw']->xslttpl->add_file(array('request'));
                        $GLOBALS['phpgw_info']['flags'][noheader] = True;
@@ -519,7 +515,7 @@
                        $function_msg   = lang('Edit priority key');
                        $link_data = array
                        (
-                               'menuaction' => 
$this->currentapp.'.uirequest.priority_key');
+                               'menuaction' => 
'property.uirequest.priority_key');
 
                        $priority_key = $this->bo->read_priority_key();
 
@@ -544,7 +540,7 @@
                {
                        if(!$this->acl_add && !$this->acl_edit)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>2, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>2, 'acl_location'=> $this->acl_location));
                        }
                        $id     = phpgw::get_var('id', 'int');
                        $values = phpgw::get_var('values');
@@ -555,8 +551,8 @@
 
                        if($_POST && !$bypass)
                        {
-                               $insert_record = 
$GLOBALS['phpgw']->session->appsession('insert_record',$this->currentapp);
-                               $insert_record_entity = 
$GLOBALS['phpgw']->session->appsession('insert_record_entity',$this->currentapp);
+                               $insert_record = 
$GLOBALS['phpgw']->session->appsession('insert_record','property');
+                               $insert_record_entity = 
$GLOBALS['phpgw']->session->appsession('insert_record_entity','property');
 
                                for ($j=0;$j<count($insert_record_entity);$j++)
                                {
@@ -650,7 +646,7 @@
                                }
 
                                $values['file_name']=str_replace(" 
","_",$_FILES['file']['name']);
-                               $to_file = $this->fakebase. SEP . 'request' . 
SEP . implode("-",$values['location']) . SEP . $values['request_id'] . SEP . 
$values['file_name'];
+                               $to_file = $this->fakebase. '/' . 'request' . 
'/' . implode("-",$values['location']) . '/' . $values['request_id'] . '/' . 
$values['file_name'];
 
                                if(!$values['document_name_orig'] && 
$this->bo->vfs->file_exists(array(
                                                'string' => $to_file,
@@ -694,7 +690,7 @@
                                        if ($values['notify'])
                                        {
                                                
$coordinator_name=$GLOBALS['phpgw_info']['user']['fullname'];
-                                               
$coordinator_email=$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['email'];
+                                               
$coordinator_email=$GLOBALS['phpgw_info']['user']['preferences']['property']['email'];
                                                $headers = "Return-Path: <". 
$coordinator_email .">\r\n";
                                                $headers .= "From: " . 
$coordinator_name . "<" . $coordinator_email .">\r\n";
                                                $headers .= "Bcc: " . 
$coordinator_name . "<" . $coordinator_email .">\r\n";
@@ -795,7 +791,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uirequest.edit',
+                               'menuaction'    => 'property.uirequest.edit',
                                'id'                    => $id
                        );
 
@@ -804,13 +800,13 @@
                                $values['coordinator']=$this->account;
                        }
 
-                       
$supervisor_id=$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['approval_from'];
+                       
$supervisor_id=$GLOBALS['phpgw_info']['user']['preferences']['property']['approval_from'];
 
                        $notify = 
$this->config->config_data['workorder_approval'];
 
                        if ($supervisor_id && ($notify=='yes'))
                        {
-                               $prefs = 
$this->bocommon->create_preferences($this->currentapp,$supervisor_id);
+                               $prefs = 
$this->bocommon->create_preferences('property',$supervisor_id);
                                $supervisor_email = $prefs['email'];
                        }
 
@@ -829,7 +825,7 @@
                        {
                                $project_lookup_data = array
                                (
-                                       'menuaction'    => 
$this->currentapp.'.uiproject.view'
+                                       'menuaction'    => 
'property.uiproject.view'
                                );
                        }
 
@@ -841,7 +837,7 @@
 
                        $link_file_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uirequest.view_file',
+                               'menuaction'    => 
'property.uirequest.view_file',
                                                'location_code' 
=>$values['location_data']['location_code'],
                                                'id'            =>$id
                                                );
@@ -900,7 +896,7 @@
                                'value_origin_id'                       => 
$origin_id,
                                'lang_origin_statustext'                => 
lang('Link to the origin for this request'),
 
-                               'generate_project_action'               => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiproject.edit')),
+                               'generate_project_action'               => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiproject.edit')),
                                'lang_generate_project'                 => 
lang('Generate project'),
                                'lang_generate_project_statustext'      => 
lang('Generate a project from this request'),
                                'location_code'                         => 
$values['location_code'],
@@ -914,7 +910,7 @@
                                'importance_weight'                     => 
$importance_weight,
 
                                'lang_no_workorders'                    => 
lang('No workorder budget'),
-                               'workorder_link'                        => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiworkorder.edit')),
+                               'workorder_link'                        => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiworkorder.edit')),
                                'record_history'                        => 
$record_history,
                                'table_header_history'                  => 
$table_header_history,
                                'lang_history'                          => 
lang('History'),
@@ -945,7 +941,7 @@
                                'location_data'                         => 
$location_data,
                                'location_type'                         => 
'form',
                                'form_action'                           => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uirequest.index')),
+                               'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uirequest.index')),
                                'lang_category'                         => 
lang('category'),
                                'lang_save'                             => 
lang('save'),
                                'lang_done'                             => 
lang('done'),
@@ -1004,7 +1000,7 @@
 
                        $appname        = lang('request');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -1013,7 +1009,7 @@
                {
                        if(!$this->acl_delete)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>8, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>8, 'acl_location'=> $this->acl_location));
                        }
 
                        $id = phpgw::get_var('id', 'int');
@@ -1021,7 +1017,7 @@
 
                        $link_data = array
                        (
-                               'menuaction' => 
$this->currentapp.'.uirequest.index'
+                               'menuaction' => 'property.uirequest.index'
                        );
 
                        if (phpgw::get_var('confirm', 'bool', 'POST'))
@@ -1035,7 +1031,7 @@
                        $data = array
                        (
                                'done_action'           => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'         => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uirequest.delete', 'id'=> $id)),
+                               'delete_action'         => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uirequest.delete', 'id'=> $id)),
                                'lang_confirm_msg'      => lang('do you really 
want to delete this entry'),
                                'lang_yes'              => lang('yes'),
                                'lang_yes_statustext'   => lang('Delete the 
entry'),
@@ -1046,7 +1042,7 @@
                        $appname        = lang('request');
                        $function_msg   = lang('delete request');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -1055,7 +1051,7 @@
                {
                        if(!$this->acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>1, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
                        }
 
                        $id     = phpgw::get_var('id', 'int');
@@ -1105,7 +1101,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uirequest.edit',
+                               'menuaction'    => 'property.uirequest.edit',
                                'id'                    => $id
                        );
 
@@ -1133,7 +1129,7 @@
                        {
                                $origin_data = array
                                (
-                                       'menuaction'    => 
$this->currentapp.'.uitts.view',
+                                       'menuaction'    => 
'property.uitts.view',
                                        'id'            => $values['origin_id']
                                );
                        }
@@ -1142,13 +1138,13 @@
                        {
                                $project_lookup_data = array
                                (
-                                       'menuaction'    => 
$this->currentapp.'.uiproject.view'
+                                       'menuaction'    => 
'property.uiproject.view'
                                );
                        }
 
                        $link_file_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uirequest.view_file',
+                               'menuaction'    => 
'property.uirequest.view_file',
                                'location_code' 
=>$values['location_data']['location_code'],
                                'id'            =>$id
                        );
@@ -1209,7 +1205,7 @@
                                'table_header_importance'                       
=> $table_header_importance,
                                'importance_weight_view'                        
=> $importance_weight,
 
-                               'workorder_link'                                
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiworkorder.edit')),
+                               'workorder_link'                                
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiworkorder.edit')),
                                'record_history'                                
=> $record_history,
                                'table_header_history'                          
=> $table_header_history,
                                'lang_history'                                  
=> lang('History'),
@@ -1229,7 +1225,7 @@
 
                                'location_data'                                 
=> $location_data,
                                'location_type'                                 
=> 'view',
-                               'done_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uirequest.index')),
+                               'done_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uirequest.index')),
                                'lang_category'                                 
=> lang('category'),
                                'lang_save'                                     
=> lang('save'),
                                'lang_done'                                     
=> lang('done'),
@@ -1258,7 +1254,7 @@
                                'branch_list'                                   
=> $this->boproject->select_branch_list($values['branch_id']),
                                'lang_branch'                                   
=> lang('branch'),
 
-                               'edit_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uirequest.edit', 'id'=> $id)),
+                               'edit_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uirequest.edit', 'id'=> $id)),
                                'lang_edit_statustext'                          
=> lang('Edit this entry request'),
                                'lang_edit'                                     
=> lang('Edit'),
                                'currency'                                      
=> $GLOBALS['phpgw_info']['user']['preferences']['common']['currency'],
@@ -1273,7 +1269,7 @@
 
                        $appname        = lang('request');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }

Modified: trunk/property/inc/class.uis_agreement.inc.php
===================================================================
--- trunk/property/inc/class.uis_agreement.inc.php      2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/inc/class.uis_agreement.inc.php      2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -48,8 +48,6 @@
                        'view'                  => True,
                        'edit'                  => True,
                        'delete'                => True,
-                       'list_attribute'        => True,
-                       'edit_attrib'           => True,
                        'columns'               => True,
                        'edit_item'             => True,
                        'view_item'             => True,
@@ -62,13 +60,12 @@
                function property_uis_agreement()
                {
                        $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
'property::agreement::service';
                        $this->nextmatchs       = 
CreateObject('phpgwapi.nextmatchs');
                        $this->account          = 
$GLOBALS['phpgw_info']['user']['account_id'];
 
                        $this->bo               = 
CreateObject('property.bos_agreement',True);
                        $this->bocommon         = 
CreateObject('property.bocommon');
-                       $this->menu             = CreateObject('property.menu');
 
                        $this->role             = $this->bo->role;
 
@@ -128,7 +125,7 @@
 
                                
$GLOBALS['phpgw']->preferences->account_id=$this->account;
                                
$GLOBALS['phpgw']->preferences->read_repository();
-                               
$GLOBALS['phpgw']->preferences->add($this->currentapp,'s_agreement_columns',$values['columns'],'user');
+                               
$GLOBALS['phpgw']->preferences->add('property','s_agreement_columns',$values['columns'],'user');
                                
$GLOBALS['phpgw']->preferences->save_repository();
 
                                $receipt['message'][] = array('msg' => 
lang('columns is updated'));
@@ -175,7 +172,7 @@
                        $file_name      = 
urldecode(phpgw::get_var('file_name'));
                        $id             = phpgw::get_var('id', 'int');
 
-                       $file = $this->fakebase. SEP . 'service_agreement' . 
SEP . $id . SEP . $file_name;
+                       $file = $this->fakebase. '/' . 'service_agreement' . 
'/' . $id . '/' . $file_name;
 
                        if($this->bo->vfs->file_exists(array(
                                'string' => $file,
@@ -207,22 +204,17 @@
 
                function index()
                {
-                       $this->menu->sub        = 'agreement';
-
                        if(!$this->acl_read)
                        {
                                
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
                        }
 
                        
$GLOBALS['phpgw']->xslttpl->add_file(array('s_agreement',
-                                                                               
'menu',
                                                                                
'receipt',
                                                                                
'search_field',
                                                                                
'nextmatchs',
                                                                                
'filter_member_of'));
 
-                       $links = $this->menu->links('s_agreement');
-
                        $receipt = 
$GLOBALS['phpgw']->session->appsession('session_data','s_agreement_receipt');
                        
$GLOBALS['phpgw']->session->appsession('session_data','s_agreement_receipt','');
 
@@ -364,7 +356,7 @@
 
                        $member_of_data = 
$this->cats->formatted_xslt_list(array('selected' => $this->member_id,'globals' 
=> True,link_data => $link_data));
 
-                       
$GLOBALS['phpgw']->js->validate_file('overlib','overlib',$this->currentapp);
+                       
$GLOBALS['phpgw']->js->validate_file('overlib','overlib','property');
 
 //_debug_array($member_of_data);
                        $data = array
@@ -373,7 +365,6 @@
                                'link_columns'                                  
=> $GLOBALS['phpgw']->link('/index.php',$link_columns),
                                'lang_columns_help'                             
=> lang('Choose columns'),
                                'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'links'                                         
=> $links,
                                'allow_allrows'                                 
=> True,
                                'allrows'                                       
=> $this->allrows,
                                'start_record'                                  
=> $this->start,
@@ -559,7 +550,7 @@
 
                        $values_attribute  = phpgw::get_var('values_attribute');
 
-                       $insert_record_s_agreement = 
$GLOBALS['phpgw']->session->appsession('insert_record_s_agreement',$this->currentapp);
+                       $insert_record_s_agreement = 
$GLOBALS['phpgw']->session->appsession('insert_record_values.s_agreement','property');
 
 //_debug_array($insert_record_s_agreement);
                        for ($j=0;$j<count($insert_record_s_agreement);$j++)
@@ -611,7 +602,7 @@
                                        }
 
                                        $values['file_name'] = str_replace (' 
','_',$_FILES['file']['name']);
-                                       $to_file = $this->fakebase. SEP . 
'service_agreement' . SEP . $values['s_agreement_id'] . SEP . 
$values['file_name'];
+                                       $to_file = $this->fakebase. '/' . 
'service_agreement' . '/' . $values['s_agreement_id'] . '/' . 
$values['file_name'];
 
                                        if(!$values['document_name_orig'] && 
$this->bo->vfs->file_exists(array(
                                                        'string' => $to_file,
@@ -842,9 +833,9 @@
                                'id'            => $id
                        );
 
-                       
$GLOBALS['phpgw']->js->validate_file('overlib','overlib',$this->currentapp);
-                       
$GLOBALS['phpgw']->js->validate_file('core','check',$this->currentapp);
-                       
$GLOBALS['phpgw']->js->validate_file('dateformat','dateformat',$this->currentapp);
+                       
$GLOBALS['phpgw']->js->validate_file('overlib','overlib','property');
+                       
$GLOBALS['phpgw']->js->validate_file('core','check','property');
+                       
$GLOBALS['phpgw']->js->validate_file('dateformat','dateformat','property');
 
                        $data = array
                        (
@@ -928,11 +919,13 @@
                                'table_update'                          => 
$table_update,
                                'update_action'                         => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uis_agreement.edit', 'id'=> $id)),
                                'lang_select_all'                       => 
lang('Select All'),
-                               'img_check'                             => 
$GLOBALS['phpgw']->common->get_image_path($this->currentapp).'/check.png',
+                               'img_check'                             => 
$GLOBALS['phpgw']->common->get_image_path('property').'/check.png',
                                'set_column'                            => 
$set_column,
                                'lang_import_detail'            => lang('import 
detail'),
                                'lang_detail_import_statustext'=> lang('import 
details to this agreement from spreadsheet'),
-                               'lang_import'                           => 
lang('import')
+                               'lang_import'                           => 
lang('import'),
+                               'textareacols'                          => 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'])
 && $GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'] : 40,
+                               'textarearows'                          => 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'])
 && $GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'] : 6
                        );
 
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('service agreement') . ': ' . ($id?lang('edit') . ' ' . 
lang($this->role):lang('add') . ' ' . lang($this->role));
@@ -968,9 +961,10 @@
 
                        if (is_array($values))
                        {
-                               $insert_record = 
$GLOBALS['phpgw']->session->appsession('insert_record',$this->currentapp);
-                               $insert_record_entity = 
$GLOBALS['phpgw']->session->appsession('insert_record_entity',$this->currentapp);
-                               $insert_record_s_agreement1 = 
$GLOBALS['phpgw']->session->appsession('insert_record_s_agreement1',$this->currentapp);
+                               $insert_record = 
$GLOBALS['phpgw']->session->appsession('insert_record','property');
+                               $insert_record_entity = 
$GLOBALS['phpgw']->session->appsession('insert_record_entity','property');
+
+                               $insert_record_s_agreement1 = 
$GLOBALS['phpgw']->session->appsession('insert_record_values.s_agreement.detail','property');
 //_debug_array($insert_record_s_agreement1);
 
                                for ($j=0;$j<count($insert_record_entity);$j++)
@@ -1043,7 +1037,7 @@
                                endif;
                        }
 
-                       $s_agreement = 
$this->bo->read_single(array('s_agreement_id'=>$s_agreement_id));
+                       $s_agreement = 
$this->bo->read_single(array('s_agreement_id'=>$s_agreement_id, 'view' => 
true));
                        $values = 
$this->bo->read_single_item(array('s_agreement_id'=>$s_agreement_id,'id'=>$id));
 
                        $link_data = array
@@ -1147,7 +1141,7 @@
                                        (
                                                'menuaction'    => 
'property.uis_agreement.attrib_history',
                                                's_agreement_id'        => 
$s_agreement_id,
-                                               'attrib_id'     => 
$values['attributes'][$i]['attrib_id'],
+                                               'attrib_id'     => 
$values['attributes'][$i]['id'],
                                                'item_id'       => $id,
                                                'edit'          => True,
                                                'role'          =>'detail'
@@ -1157,9 +1151,9 @@
                                }
                        }
 
-                       
$GLOBALS['phpgw']->js->validate_file('overlib','overlib',$this->currentapp);
-                       
$GLOBALS['phpgw']->js->validate_file('core','check',$this->currentapp);
-                       
$GLOBALS['phpgw']->js->validate_file('dateformat','dateformat',$this->currentapp);
+                       
$GLOBALS['phpgw']->js->validate_file('overlib','overlib','property');
+                       
$GLOBALS['phpgw']->js->validate_file('core','check','property');
+                       
$GLOBALS['phpgw']->js->validate_file('dateformat','dateformat','property');
 
                        $data = array
                        (
@@ -1199,7 +1193,7 @@
                                'table_update'                                  
=> $table_update,
                                'update_action'                                 
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uis_agreement.edit_item', 's_agreement_id'=> $s_agreement_id, 'id'=> 
$id)),
                                'lang_select_all'                               
=> lang('Select All'),
-                               'img_check'                                     
=> $GLOBALS['phpgw']->common->get_image_path($this->currentapp).'/check.png',
+                               'img_check'                                     
=> $GLOBALS['phpgw']->common->get_image_path('property').'/check.png',
                                'location_data'                                 
=> $location_data,
 
                                'lang_cost'                                     
=> lang('cost'),
@@ -1213,7 +1207,8 @@
                                'lang_history'                                  
=> lang('history'),
                                'lang_history_help'                             
=> lang('history of this attribute'),
                                'lang_history_date_statustext'  => lang('Enter 
the date for this reading'),
-
+                               'textareacols'                                  
=> 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'])
 && $GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'] : 40,
+                               'textarearows'                                  
=> 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'])
 && $GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'] : 6
                        );
 
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('service agreement') . ': ' . ($values['id']?lang('edit item') . ' ' . 
$s_agreement['name']:lang('add item') . ' ' . $s_agreement['name']);
@@ -1233,7 +1228,7 @@
 
                        
$GLOBALS['phpgw']->xslttpl->add_file(array('s_agreement','attributes_view'));
 
-                       $s_agreement = 
$this->bo->read_single(array('s_agreement_id'=>$s_agreement_id));
+                       $s_agreement = 
$this->bo->read_single(array('s_agreement_id'=>$s_agreement_id, 'view' => 
true));
                        $values = 
$this->bo->read_single_item(array('s_agreement_id'=>$s_agreement_id,'id'=>$id));
 
                        $link_data = array
@@ -1282,7 +1277,7 @@
                                        (
                                                'menuaction'    => 
'property.uis_agreement.attrib_history',
                                                's_agreement_id'        => 
$s_agreement_id,
-                                               'attrib_id'     => 
$values['attributes'][$i]['attrib_id'],
+                                               'attrib_id'     => 
$values['attributes'][$i]['id'],
                                                'item_id'       => $id,
                                                'edit'          => False,
                                                'role'          =>'detail'
@@ -1292,8 +1287,8 @@
                                }
                        }
 
-                       
$GLOBALS['phpgw']->js->validate_file('overlib','overlib',$this->currentapp);
-                       
$GLOBALS['phpgw']->js->validate_file('core','check',$this->currentapp);
+                       
$GLOBALS['phpgw']->js->validate_file('overlib','overlib','property');
+                       
$GLOBALS['phpgw']->js->validate_file('core','check','property');
 
                        $data = array
                        (
@@ -1323,6 +1318,8 @@
 
                                'lang_history'                                  
=> lang('history'),
                                'lang_history_help'                             
=> lang('history of this attribute'),
+                               'textareacols'                                  
=> 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'])
 && $GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'] : 40,
+                               'textarearows'                                  
=> 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'])
 && $GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'] : 6
                        );
 
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('service agreement') . ': ' . lang('view item') . ' ' . 
$s_agreement['name'];
@@ -1334,28 +1331,18 @@
 
                function delete()
                {
-                       $attrib         = phpgw::get_var('attrib');
-                       $id             = phpgw::get_var('id', 'int');
                        $s_agreement_id = phpgw::get_var('s_agreement_id', 
'int');
                        $confirm        = phpgw::get_var('confirm', 'bool', 
'POST');
 
-                       if($attrib)
-                       {
-                               $function='list_attribute';
-                       }
-                       else
-                       {
-                               $function='index';
-                       }
                        $link_data = array
                        (
-                               'menuaction'    => 
'property.uis_agreement.'.$function,
+                               'menuaction'    => 
'property.uis_agreement.index',
                                'role'          => $this->role
                        );
 
                        if (phpgw::get_var('confirm', 'bool', 'POST'))
                        {
-                               $this->bo->delete($s_agreement_id,$id,$attrib);
+                               $this->bo->delete($s_agreement_id);
                                
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
                        }
 
@@ -1364,7 +1351,7 @@
                        $data = array
                        (
                                'done_action'           => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'         => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uis_agreement.delete', 's_agreement_id'=> $s_agreement_id, 'id'=> 
$id, 'attrib'=> $attrib, 'role'=> $this->role)),
+                               'delete_action'         => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uis_agreement.delete', 's_agreement_id'=> $s_agreement_id, 'role'=> 
$this->role)),
                                'lang_confirm_msg'      => lang('do you really 
want to delete this entry'),
                                'lang_yes'              => lang('yes'),
                                'lang_yes_statustext'   => lang('Delete the 
entry'),
@@ -1375,7 +1362,7 @@
                        $appname                = lang('service agreement');
                        $function_msg           = lang('delete') . ' ' . 
lang($this->role);
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -1385,7 +1372,7 @@
                function view()
                {
                        $s_agreement_id = phpgw::get_var('id', 'int');
-                       $config         = 
CreateObject('phpgwapi.config',$this->currentapp);
+                       $config         = 
CreateObject('phpgwapi.config','property');
 
                        
$GLOBALS['phpgw']->xslttpl->add_file(array('s_agreement','attributes_view'));
 
@@ -1401,7 +1388,7 @@
                                $total_records = count($list);
 
                                $uicols         = $this->bo->uicols;
-                               $list           = 
$this->list_content($list,$uicols,$edit_item=False,$view_only=True);
+                               $list           = 
$this->list_content($list,$uicols,$edit_item=False,$view_only='view');
                                $content        = $list['content'];
                                $table_header=$list['table_header'];
                        }
@@ -1514,6 +1501,8 @@
                                'table_add'                                     
=> $table_add,
                                'values'                                        
=> $content,
                                'table_header'                                  
=> $table_header,
+                               'textareacols'                          => 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'])
 && $GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'] : 40,
+                               'textarearows'                          => 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'])
 && $GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'] : 6
                        );
 
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('service agreement') . ': ' . lang('view');
@@ -1523,325 +1512,6 @@
                }
 
 
-               function list_attribute()
-               {
-                       $id     = phpgw::get_var('id', 'int');
-                       $resort = phpgw::get_var('resort');
-
-                       $GLOBALS['phpgw']->xslttpl->add_file(array(
-                                                               's_agreement',
-                                                               'nextmatchs',
-                                                               
'search_field'));
-
-                       if($resort)
-                       {
-                               
$this->bo->resort_attrib(array('resort'=>$resort,'id'=>$id));
-                       }
-
-                       $attrib_list = $this->bo->read_attrib();
-
-                       while (is_array($attrib_list) && list(,$attrib) = 
each($attrib_list))
-                       {
-                               $content[] = array
-                               (
-                                       'name'                                  
=> $attrib['name'],
-                                       'type_name'                             
=> $attrib['type_name'],
-                                       'datatype'                              
=> $attrib['datatype'],
-                                       'column_name'                           
=> $attrib['column_name'],
-                                       'input_text'                            
=> $attrib['input_text'],
-                                       'sorting'                               
=> $attrib['attrib_sort'],
-                                       'search'                                
=> $attrib['search'],
-                                       'link_up'                               
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uis_agreement.list_attribute', 'resort'=>'up', 'id'=> $attrib['id'], 
'allrows'=> $this->allrows, 'role'=> $this->role)),
-                                       'link_down'                             
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uis_agreement.list_attribute', 'resort'=>'down', 'id'=> 
$attrib['id'], 'allrows'=> $this->allrows, 'role'=> $this->role)),
-                                       'link_edit'                             
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uis_agreement.edit_attrib', 'id'=> $attrib['id'], 'role'=> 
$this->role)),
-                                       'link_delete'                           
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uis_agreement.delete', 'id'=> $attrib['id'], 'attrib'=>true, 'role'=> 
$this->role)),
-                                       'lang_view_attribtext'                  
=> lang('view the attrib'),
-                                       'lang_attribute_attribtext'             
=> lang('attributes for the attrib'). ' ' . lang('location'),
-                                       'lang_edit_attribtext'                  
=> lang('edit the attrib'),
-                                       'lang_delete_attribtext'                
=> lang('delete the attrib'),
-                                       'text_attribute'                        
=> lang('Attributes'),
-                                       'text_up'                               
=> lang('up'),
-                                       'text_down'                             
=> lang('down'),
-                                       'text_edit'                             
=> lang('edit'),
-                                       'text_delete'                           
=> lang('delete')
-                               );
-                       }
-
-       //html_print_r($content);
-
-                       $table_header[] = array
-                       (
-                               'lang_descr'            => lang('Descr'),
-                               'lang_datatype'         => lang('Datatype'),
-                               'lang_sorting'          => lang('sorting'),
-                               'lang_search'           => lang('search'),
-                               'lang_edit'                     => lang('edit'),
-                               'lang_delete'           => lang('delete'),
-                               'sort_sorting'  => 
$this->nextmatchs->show_sort_order(array
-                                                                               
(
-                                                                               
        'sort'  => $this->sort,
-                                                                               
        'var'   => 'attrib_sort',
-                                                                               
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
'property.uis_agreement.list_attribute',
-                                                                               
                        'allrows'=>$this->allrows,
-                                                                               
                        'role'  => $this->role)
-                                                                               
)),
-
-                               'sort_name'     => 
$this->nextmatchs->show_sort_order(array
-                                                                               
(
-                                                                               
        'sort'  => $this->sort,
-                                                                               
        'var'   => 'column_name',
-                                                                               
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
'property.uis_agreement.list_attribute',
-                                                                               
                                'allrows'=>$this->allrows,
-                                                                               
                                'role'  => $this->role)
-                                                                               
)),
-                               'lang_name'     => lang('Name'),
-                       );
-
-                       $table_add[] = array
-                       (
-                               'lang_add'                              => 
lang('add'),
-                               'lang_add_attribtext'   => lang('add an 
attrib'),
-                               'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uis_agreement.edit_attrib', 'role'=> $this->role)),
-                               'lang_done'                             => 
lang('done'),
-                               'lang_done_attribtext'  => 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'    => 
'property.uis_agreement.list_attribute',
-                               'sort'          =>$this->sort,
-                               'order'         =>$this->order,
-                               'query'         =>$this->query,
-                               'role'          => $this->role
-
-                       );
-
-                       $data = array
-                       (
-                               'allow_allrows'                                 
=> True,
-                               'allrows'                                       
=> $this->allrows,
-                               'start_record'                                  
=> $this->start,
-                               'record_limit'                                  
=> $record_limit,
-                               'num_records'                                   
=> count($attrib_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_attribtext'                   
=> lang('Enter the search string. To show all entries, empty this field and 
press the SUBMIT button again'),
-                               'lang_searchbutton_attribtext'                  
=> lang('Submit the search string'),
-                               'query'                                         
=> $this->query,
-                               'lang_search'                                   
=> lang('search'),
-                               'table_header_attrib'                           
=> $table_header,
-                               'values_attrib'                                 
=> $content,
-                               'table_add2'                                    
=> $table_add
-                       );
-
-                       $appname        = lang('service agreement');
-                       $function_msg   = lang('list attribute') . ': ' . 
lang($this->role);
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
-                       //$this->save_sessiondata();
-                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_attribute' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
-               }
-
-               function edit_attrib()
-               {
-                       $id             = phpgw::get_var('id', 'int');
-                       $values         = phpgw::get_var('values');
-       //              $GLOBALS['phpgw']->common->msgbox(lang('Altering 
ColumnName OR Datatype  - deletes your data in this Column'));
-       //html_print_r($values);
-                       
$GLOBALS['phpgw']->xslttpl->add_file(array('s_agreement','choice',));
-
-                       if ($values['save'])
-                       {
-                               if($id)
-                               {
-                                       $values['id']=$id;
-                                       $action='edit';
-                               }
-                               $type_id                        = 
$values['type_id'];
-
-                               if (!$values['column_name'])
-                               {
-                                       $receipt['error'][] = 
array('msg'=>lang('Column name not entered!'));
-                               }
-
-                               if (!$values['input_text'])
-                               {
-                                       $receipt['error'][] = 
array('msg'=>lang('Input text not entered!'));
-                               }
-                               if (!$values['statustext'])
-                               {
-                                       $receipt['error'][] = 
array('msg'=>lang('Statustext not entered!'));
-                               }
-
-                               if (!$values['column_info']['type'])
-                               {
-                                       $receipt['error'][] = 
array('msg'=>lang('Datatype type not chosen!'));
-                               }
-
-                               
if(!ctype_digit($values['column_info']['precision']) && 
$values['column_info']['precision'])
-                               {
-                                       
$receipt['error'][]=array('msg'=>lang('Please enter precision as integer !'));
-                                       
unset($values['column_info']['precision']);
-                               }
-
-                               if($values['column_info']['scale'] && 
!ctype_digit($values['column_info']['scale']))
-                               {
-                                       
$receipt['error'][]=array('msg'=>lang('Please enter scale as integer !'));
-                                       unset($values['column_info']['scale']);
-                               }
-
-                               if (!$values['column_info']['nullable'])
-                               {
-                                       $receipt['error'][] = 
array('msg'=>lang('Nullable not chosen!'));
-                               }
-
-
-                               if (!$receipt['error'])
-                               {
-                                       $receipt = 
$this->bo->save_attrib($values,$action);
-
-                                       if(!$id)
-                                       {
-                                               $id=$receipt['id'];
-                                       }
-                               }
-                               else
-                               {
-                                       $receipt['error'][] = array('msg'       
=> lang('Attribute has NOT been saved'));
-                               }
-
-                       }
-
-                       if ($id)
-                       {
-                               $values = $this->bo->read_single_attrib($id);
-                               $function_msg = lang('edit attribute') . ': ' . 
lang($this->role);
-                               $action='edit';
-                       }
-                       else
-                       {
-                               $function_msg = lang('add attribute') . ': ' . 
lang($this->role);
-                               $action='add';
-                       }
-
-                       $link_data = array
-                       (
-                               'menuaction'    => 
'property.uis_agreement.edit_attrib',
-                               'id'            => $id,
-                               'role'          => $this->role
-
-                       );
-       //html_print_r($values);
-
-                       if(is_array($values['column_info']))
-                       {
-                               if($values['column_info']['type']=='R' || 
$values['column_info']['type']=='CH' || $values['column_info']['type']=='LB')
-                               {
-                                       $multiple_choice= True;
-                               }
-                               
-                               $column_type = $values['column_info']['type'];
-                               $column_precision 
=$values['column_info']['precision'];
-                               $column_scale =$values['column_info']['scale'];
-                               $column_default 
=$values['column_info']['default'];
-                               $column_nullable 
=$values['column_info']['nullable'];
-                       }
-
-
-                       $msgbox_data = $this->bocommon->msgbox_data($receipt);
-
-                       $data = array
-                       (
-                               'lang_choice'                           => 
lang('Choice'),
-                               'lang_new_value'                        => 
lang('New value'),
-                               'lang_new_value_statustext'             => 
lang('New value for multiple choice'),
-                               'multiple_choice'                       => 
$multiple_choice,
-                               'value_choice'                          => 
$values['choice'],
-                               'lang_delete_value'                     => 
lang('Delete value'),
-                               'lang_value'                            => 
lang('value'),
-                               'lang_delete_choice_statustext'         => 
lang('Delete this value from the list of multiple choice'),
-                               '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'=> 
'property.uis_agreement.list_attribute', 'type_id'=> $type_id, 'role'=> 
$this->role)),
-                               'lang_id'                               => 
lang('Attribute ID'),
-                               'lang_save'                             => 
lang('save'),
-                               'lang_done'                             => 
lang('done'),
-                               'value_id'                              => $id,
-
-                               'lang_column_name'                      => 
lang('Column name'),
-                               'value_column_name'                     => 
$values['column_name'],
-                               'lang_column_name_statustext'           => 
lang('enter the name for the column'),
-
-                               'lang_input_text'                       => 
lang('input text'),
-                               'value_input_text'                      => 
$values['input_text'],
-                               'lang_input_name_statustext'            => 
lang('enter the input text for records'),
-
-                               'lang_id_attribtext'                    => 
lang('Enter the attribute ID'),
-                               'lang_entity_statustext'                => 
lang('Select a service agreement type'),
-
-                               'lang_statustext'                       => 
lang('Statustext'),
-                               'lang_statustext_attribtext'            => 
lang('Enter a statustext for the inputfield in forms'),
-                               'value_statustext'                      => 
$values['statustext'],
-
-                               'lang_done_attribtext'                  => 
lang('Back to the list'),
-                               'lang_save_attribtext'                  => 
lang('Save the attribute'),
-
-                               'lang_datatype'                         => 
lang('Datatype'),
-                               'lang_datatype_statustext'              => 
lang('Select a datatype'),
-                               'lang_no_datatype'                      => 
lang('No datatype'),
-                               'datatype_list'                         => 
$this->bocommon->select_datatype($column_type),
-
-                               'lang_precision'                        => 
lang('Precision'),
-                               'lang_precision_statustext'             => 
lang('enter the record length'),
-                               'value_precision'                       => 
$column_precision,
-
-                               'lang_scale'                            => 
lang('scale'),
-                               'lang_scale_statustext'                 => 
lang('enter the scale if type is decimal'),
-                               'value_scale'                           => 
$column_scale,
-
-                               'lang_default'                          => 
lang('default'),
-                               'lang_default_statustext'               => 
lang('enter the default value'),
-                               'value_default'                         => 
$column_default,
-
-                               'lang_nullable'                         => 
lang('Nullable'),
-                               'lang_nullable_statustext'              => 
lang('Chose if this column is nullable'),
-                               'lang_select_nullable'                  => 
lang('Select nullable'),
-                               'nullable_list'                         => 
$this->bocommon->select_nullable($column_nullable),
-
-                               'value_list'                            => 
$values['list'],
-                               'lang_list'                                     
=> lang('show in list'),
-                               'lang_list_statustext'                  => 
lang('check to show this attribute in location list'),
-
-                               'value_search'                          => 
$values['search'],
-                               'lang_include_search'                   => 
lang('Include in search'),
-                               'lang_include_search_statustext'        => 
lang('check to show this attribute in location list'),
-
-                               'value_history'                                 
        => $values['history'],
-                               'lang_history'                                  
        => lang('history'),
-                               'lang_history_statustext'                       
=> lang('Enable history for this attribute'),
-                       );
-       //html_print_r($data);
-
-                       $appname        = lang('service agreement');
-
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
-                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_attrib' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
-               }
-
                function attrib_history()
                {
                        
$GLOBALS['phpgw']->xslttpl->add_file(array('attrib_history','nextmatchs'));
@@ -1882,6 +1552,7 @@
                                                'edit'          => true,
                                                'role'          => 
$this->bo->role
                                        );
+
                                if($edit)
                                {
                                        $text_delete    = lang('delete');
@@ -1931,12 +1602,12 @@
                                'table_header'          => $table_header,
                        );
 //_debug_array($data);
-                       $this->bo->role='detail';
-                       $attrib_data    = 
$this->bo->read_single_attrib($attrib_id);
+                       $attrib_data    = 
$this->bo->custom->get_attrib_single('property', '.s_agreement.detail', 
$attrib_id);
                        $appname        = $attrib_data['input_text'];
+
                        $function_msg   = lang('history');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;      
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;     
 
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('attrib_history' => $data));
                }

Modified: trunk/property/inc/class.uistandard_2.inc.php
===================================================================
--- trunk/property/inc/class.uistandard_2.inc.php       2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/inc/class.uistandard_2.inc.php       2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -53,7 +53,11 @@
                function property_uistandard_2()
                {
                        $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       
+                       $type   = phpgw::get_var('type');
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
"admin::property::{$type}";
+
+               //      $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->nextmatchs                       = 
CreateObject('phpgwapi.nextmatchs');
                        $this->account                          = 
$GLOBALS['phpgw_info']['user']['account_id'];
                        $this->bo                                       = 
CreateObject('property.bostandard_2',True);
@@ -91,7 +95,7 @@
                {
                        if(!$this->acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>1, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
                        }
 
                        $type   = phpgw::get_var('type');
@@ -110,8 +114,8 @@
                                (
                                        'id'                                    
=> $standard['id'],
                                        'first'                                 
=> $first,
-                                       'link_edit'                             
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uistandard_2.edit', 'id'=> $standard['id'], 'type'=> 
$type)),
-                                       'link_delete'                           
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uistandard_2.delete', 'id'=> $standard['id'], 'type'=> 
$type)),
+                                       'link_edit'                             
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uistandard_2.edit', 'id'=> $standard['id'], 'type'=> $type)),
+                                       'link_delete'                           
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uistandard_2.delete', 'id'=> $standard['id'], 'type'=> $type)),
                                        'lang_view_standardtext'                
=> lang('view the standard'),
                                        'lang_edit_standardtext'                
=> lang('edit the standard'),
                                        'lang_delete_standardtext'              
=> lang('delete the standard'),
@@ -134,7 +138,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'id',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uistandard_2.index',
+                                                                               
        'extra' => array('menuaction'   => 'property.uistandard_2.index',
                                                                                
                                'type'  =>$type)
                                                                                
)),
                                'lang_id'               => lang('standard id'),
@@ -144,7 +148,7 @@
                        (
                                'lang_add'              => lang('add'),
                                'lang_add_standardtext' => lang('add a 
standard'),
-                               'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uistandard_2.edit', 'type'=> $type)),
+                               'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uistandard_2.edit', 'type'=> $type)),
                                'lang_done'             => lang('done'),
                                'lang_done_standardtext'=> lang('back to 
admin'),
                                'done_action'           => 
$GLOBALS['phpgw']->link('/admin/index.php')
@@ -168,7 +172,7 @@
                                'record_limit'                          => 
$record_limit,
                                'num_records'                           => 
count($standard_list),
                                'all_records'                           => 
$this->bo->total_records,
-                               'link_url'                              => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uistandard_2.index', 'type'=> $type)),
+                               'link_url'                              => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uistandard_2.index', 'type'=> $type)),
                                'img_path'                              => 
$GLOBALS['phpgw']->common->get_image_path('phpgwapi','default'),
                                'lang_searchfield_standardtext'         => 
lang('Enter the search string. To show all entries, empty this field and press 
the SUBMIT button again'),
                                'lang_searchbutton_standardtext'        => 
lang('Submit the search string'),
@@ -182,7 +186,7 @@
                        $appname        = lang($type);
                        $function_msg   = lang('list '.$type.' standard');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
@@ -192,7 +196,7 @@
                {
                        if(!$this->acl_add)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=> 2, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=> 2, 'acl_location'=> $this->acl_location));
                        }
 
                        $type           = phpgw::get_var('type');
@@ -231,7 +235,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uistandard_2.edit',
+                               'menuaction'    => 'property.uistandard_2.edit',
                                'id'            => $id,
                                'type'          => $type
                        );
@@ -242,7 +246,7 @@
                        (
                                '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.'.uistandard_2.index', 'type'=> $type)),
+                               'done_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uistandard_2.index', 'type'=> $type)),
                                'lang_id'                                       
=> lang('standard ID'),
                                'lang_name'                                     
=> lang('name'),
                                'lang_descr'                                    
=> lang('Descr'),
@@ -263,7 +267,7 @@
 
                        $appname        = lang($type);
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -272,7 +276,7 @@
                {
                        if(!$this->acl_delete)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=> 8, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=> 8, 'acl_location'=> $this->acl_location));
                        }
 
                        $type   = phpgw::get_var('type');
@@ -281,7 +285,7 @@
 
                        $link_data = array
                        (
-                               'menuaction' => 
$this->currentapp.'.uistandard_2.index',
+                               'menuaction' => 'property.uistandard_2.index',
                                'type' => $type
                        );
 
@@ -296,7 +300,7 @@
                        $data = array
                        (
                                'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uistandard_2.delete', 'id'=> $id, 'type'=>$type)),
+                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uistandard_2.delete', 'id'=> $id, 'type'=>$type)),
                                'lang_confirm_msg'              => lang('do you 
really want to delete this entry'),
                                'lang_yes'                      => lang('yes'),
                                'lang_yes_standardtext'         => lang('Delete 
the entry'),
@@ -307,7 +311,7 @@
                        $appname        = lang($type);
                        $function_msg   = lang('delete '.$type.' standard');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }

Modified: trunk/property/inc/class.uistandard_3.inc.php
===================================================================
--- trunk/property/inc/class.uistandard_3.inc.php       2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/inc/class.uistandard_3.inc.php       2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -53,7 +53,7 @@
                function property_uistandard_3()
                {
                        $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->nextmatchs                       = 
CreateObject('phpgwapi.nextmatchs');
                        $this->account                          = 
$GLOBALS['phpgw_info']['user']['account_id'];
                        $this->bo                               = 
CreateObject('property.bostandard_3',True);
@@ -91,7 +91,7 @@
                {
                        if(!$this->acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>1, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
                        }
 
                        $type   = phpgw::get_var('type');
@@ -111,8 +111,8 @@
                                        'id'                            => 
$standard['id'],
                                        'num'                           => 
$standard['num'],
                                        'first'                         => 
$first,
-                                       'link_edit'                     => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uistandard_3.edit', 'id'=> $standard['id'], 'type'=> 
$type)),
-                                       'link_delete'                   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uistandard_3.delete', 'id'=> $standard['id'], 'type'=> 
$type)),
+                                       'link_edit'                     => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uistandard_3.edit', 'id'=> $standard['id'], 'type'=> $type)),
+                                       'link_delete'                   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uistandard_3.delete', 'id'=> $standard['id'], 'type'=> $type)),
                                        'lang_view_standardtext'        => 
lang('view the standard'),
                                        'lang_edit_standardtext'        => 
lang('edit the standard'),
                                        'lang_delete_standardtext'      => 
lang('delete the standard'),
@@ -135,7 +135,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'id',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uistandard_3.index',
+                                                                               
        'extra' => array('menuaction'   => 'property.uistandard_3.index',
                                                                                
                                                        'type'  =>$type)
                                                                                
)),
                                'lang_id'               => lang('standard id'),
@@ -144,7 +144,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'num',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uistandard_3.index',
+                                                                               
        'extra' => array('menuaction'   => 'property.uistandard_3.index',
                                                                                
                                                        'type'  =>$type)
                                                                                
)),
                                'lang_num'              => lang('Name'),
@@ -154,7 +154,7 @@
                        (
                                'lang_add'                      => lang('add'),
                                'lang_add_standardtext'         => lang('add a 
standard'),
-                               'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uistandard_3.edit', 'type'=> $type)),
+                               'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uistandard_3.edit', 'type'=> $type)),
                                'lang_done'                     => lang('done'),
                                'lang_done_standardtext'        => lang('back 
to admin'),
                                'done_action'                   => 
$GLOBALS['phpgw']->link('/admin/index.php')
@@ -168,7 +168,7 @@
                                'record_limit'                                  
=> $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'],
                                'num_records'                                   
=> count($standard_list),
                                'all_records'                                   
=> $this->bo->total_records,
-                               'link_url'                                      
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uistandard_3.index', 'type'=> $type)),
+                               'link_url'                                      
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uistandard_3.index', 'type'=> $type)),
                                'img_path'                                      
=> $GLOBALS['phpgw']->common->get_image_path('phpgwapi','default'),
                                'lang_searchfield_standardtext'                 
=> lang('Enter the search string. To show all entries, empty this field and 
press the SUBMIT button again'),
                                'lang_searchbutton_standardtext'                
=> lang('Submit the search string'),
@@ -182,7 +182,7 @@
                        $appname        = lang('Standard');
                        $function_msg   = lang('list '.$type.' attribute');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
@@ -192,7 +192,7 @@
                {
                        if(!$this->acl_add)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=> 2, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=> 2, 'acl_location'=> $this->acl_location));
                        }
 
                        $type   = phpgw::get_var('type');
@@ -229,7 +229,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uistandard_3.edit',
+                               'menuaction'    => 'property.uistandard_3.edit',
                                'id'            => $id,
                                'type'          => $type
                        );
@@ -240,7 +240,7 @@
                        (
                                '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.'.uistandard_3.index', 'type'=> $type)),
+                               'done_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uistandard_3.index', 'type'=> $type)),
                                'lang_id'                                       
=> lang('standard ID'),
                                'lang_num'                                      
=> lang('Name'),
                                'lang_descr'                                    
=> lang('Descr'),
@@ -260,7 +260,7 @@
 
                        $appname        = lang($type);
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -269,7 +269,7 @@
                {
                        if(!$this->acl_delete)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=> 8, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=> 8, 'acl_location'=> $this->acl_location));
                        }
 
                        $type           = phpgw::get_var('type');
@@ -278,7 +278,7 @@
 
                        $link_data = array
                        (
-                               'menuaction' => 
$this->currentapp.'.uistandard_3.index',
+                               'menuaction' => 'property.uistandard_3.index',
                                'type' => $type
                        );
 
@@ -293,7 +293,7 @@
                        $data = array
                        (
                                'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uistandard_3.delete', 'id'=> $id, 'type'=> $type)),
+                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uistandard_3.delete', 'id'=> $id, 'type'=> $type)),
                                'lang_confirm_msg'              => lang('do you 
really want to delete this entry'),
                                'lang_yes'                      => lang('yes'),
                                'lang_yes_standardtext'         => lang('Delete 
the entry'),
@@ -304,7 +304,7 @@
                        $appname        = lang($type);
                        $function_msg   = lang('delete '.$type.' standard');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }

Modified: trunk/property/inc/class.uitemplate.inc.php
===================================================================
--- trunk/property/inc/class.uitemplate.inc.php 2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.uitemplate.inc.php 2008-02-02 13:52:39 UTC (rev 
18466)
@@ -56,12 +56,13 @@
                function property_uitemplate()
                {
                        $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
'property::project::template';
+
+               //      $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->nextmatchs                       = 
CreateObject('phpgwapi.nextmatchs');
                        $this->bo                               = 
CreateObject('property.botemplate',True);
                        $this->bowo_hour                        = 
CreateObject('property.bowo_hour');
                        $this->bocommon                         = 
CreateObject('property.bocommon');
-                       $this->menu                             = 
CreateObject('property.menu');
 
                        $this->start                            = 
$this->bo->start;
                        $this->query                            = 
$this->bo->query;
@@ -71,8 +72,6 @@
                        $this->cat_id                           = 
$this->bo->cat_id;
                        $this->chapter_id                       = 
$this->bo->chapter_id;
                        $this->allrows                          = 
$this->bo->allrows;
-
-                       $this->menu->sub                        ='project';
                }
 
                function save_sessiondata()
@@ -95,15 +94,12 @@
                {
                        $GLOBALS['phpgw']->xslttpl->add_file(array(
                                                                'template',
-                                                               'menu',
                                                                'nextmatchs',
                                                                
'search_field'));
 
                        $workorder_id = phpgw::get_var('workorder_id', 'int');
                        $lookup         = phpgw::get_var('lookup', 'bool');
 
-                       $links = $this->menu->links('template');
-
                        $template_list  = $this->bo->read();
 
                        while (is_array($template_list) && list(,$template) = 
each($template_list))
@@ -118,11 +114,11 @@
                                        'entry_date'                    => 
$template['entry_date'],
                                        'chapter'                       => 
$template['chapter'],
                                        'lang_select'                   => 
lang('Select'),
-                                       'form_action_select'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiwo_hour.template')),
+                                       'form_action_select'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiwo_hour.template')),
                                        'lang_select_statustext'        => 
lang('Select this template to view the details'),
-                                       'link_view'                     => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uitemplate.hour','template_id'=> $template['template_id'])),
-                                       'link_edit'                     => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uitemplate.edit_template','template_id'=> 
$template['template_id'])),
-                                       'link_delete'                   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uitemplate.delete', 'id'=> $template['template_id'])),
+                                       'link_view'                     => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uitemplate.hour','template_id'=> $template['template_id'])),
+                                       'link_edit'                     => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uitemplate.edit_template','template_id'=> $template['template_id'])),
+                                       'link_delete'                   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uitemplate.delete', 'id'=> $template['template_id'])),
                                        'lang_view_statustext'          => 
lang('view the template'),
                                        'lang_edit_statustext'          => 
lang('edit the template'),
                                        'lang_delete_statustext'        => 
lang('delete the template'),
@@ -142,7 +138,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'fm_template.id',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction' => $this->currentapp.'.uitemplate.index',
+                                                                               
        'extra' => array('menuaction' => 'property.uitemplate.index',
                                                                                
                                                        'chapter_id'    
=>$this->chapter_id,
                                                                                
                                                        'query'                 
=>$this->query,
                                                                                
                                                        'workorder_id'  
=>$workorder_id,
@@ -155,7 +151,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'name',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction' => $this->currentapp.'.uitemplate.index',
+                                                                               
        'extra' => array('menuaction' => 'property.uitemplate.index',
                                                                                
                                                        'chapter_id'    
=>$this->chapter_id,
                                                                                
                                                        'query'                 
=>$this->query,
                                                                                
                                                        'workorder_id'  
=>$workorder_id,
@@ -174,7 +170,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uitemplate.index',
+                               'menuaction'    => 'property.uitemplate.index',
                                'sort'          => $this->sort,
                                'order'         => $this->order,
                                'chapter_id'    => $this->chapter_id,
@@ -195,14 +191,14 @@
                        (
                                'lang_add'              => lang('add'),
                                'lang_add_statustext'   => lang('add a 
template'),
-                               'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uitemplate.edit_template'))
+                               'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uitemplate.edit_template'))
                        );
 
                        $table_done[] = array
                        (
                                'lang_done'             => lang('Done'),
                                'lang_done_statustext'  => lang('Back to list'),
-                               'done_action'           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiwo_hour.index','workorder_id'=> $workorder_id))
+                               'done_action'           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiwo_hour.index','workorder_id'=> $workorder_id))
                        );
 
                        $data = array
@@ -219,7 +215,6 @@
 
                                'lookup'                        => $lookup,
                                'function'                      => 'template',
-                               'links'                         => $links,
                                'allrows'                       => 
$this->allrows,
                                'allow_allrows'                 => true,
                                'start_record'                  => $this->start,
@@ -248,7 +243,7 @@
                        $appname        = lang('template');
                        $function_msg   = lang('list template');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
@@ -257,7 +252,6 @@
                function hour()
                {
                        $GLOBALS['phpgw']->xslttpl->add_file(array('template',
-                                                                               
'menu',
                                                                                
'nextmatchs',
                                                                                
'search_field'));
 
@@ -271,7 +265,6 @@
                                $receipt = 
$this->bo->delete_hour($hour_id,$template_id);
                        }
 
-                       $links = $this->menu->links();
 
                        $template_list  = 
$this->bo->read_template_hour($template_id);
 
@@ -322,8 +315,8 @@
                                        'billperae'                     => 
$template['billperae'],
                                        'building_part'                 => 
$template['building_part'],
                                        'dim_d'                         => 
$template['dim_d'],
-                                       'link_edit'                     => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uitemplate.edit_hour','hour_id'=> $template['hour_id'], 
'template_id'=> $template_id)),
-                                       'link_delete'                   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uitemplate.hour','delete'=>true, 'template_id'=> 
$template_id, 'hour_id'=> $template['hour_id'])),
+                                       'link_edit'                     => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uitemplate.edit_hour','hour_id'=> $template['hour_id'], 
'template_id'=> $template_id)),
+                                       'link_delete'                   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uitemplate.hour','delete'=>true, 'template_id'=> $template_id, 
'hour_id'=> $template['hour_id'])),
                                        'lang_edit_statustext'          => 
lang('edit the template'),
                                        'lang_delete_statustext'        => 
lang('delete the template'),
                                        'text_edit'                     => 
lang('edit'),
@@ -348,7 +341,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'billperae',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction' => $this->currentapp.'.uitemplate.hour',
+                                                                               
        'extra' => array('menuaction' => 'property.uitemplate.hour',
                                                                                
                                                        'workorder_id'  
=>$workorder_id,
                                                                                
                                                        'template_id'   
=>$template_id,
                                                                                
                                                        'query'                 
=>$this->query,
@@ -360,7 +353,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'building_part',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction' => $this->currentapp.'.uitemplate.hour',
+                                                                               
        'extra' => array('menuaction' => 'property.uitemplate.hour',
                                                                                
                                                        'workorder_id'  
=>$workorder_id,
                                                                                
                                                        'template_id'   
=>$template_id,
                                                                                
                                                        'query'                 
=>$this->query,
@@ -376,12 +369,12 @@
                        (
                                'lang_done'             => lang('Done'),
                                'lang_done_statustext'  => lang('Back to list'),
-                               'done_action'           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uitemplate.index'))
+                               'done_action'           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uitemplate.index'))
                        );
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uitemplate.hour',
+                               'menuaction'    => 'property.uitemplate.hour',
                                'sort'          => $this->sort,
                                'order'         => $this->order,
                                'workorder_id'  => $workorder_id,
@@ -392,7 +385,7 @@
 
                        $link_data_nextmatch = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uitemplate.hour',
+                               'menuaction'    => 'property.uitemplate.hour',
                                'sort'          => $this->sort,
                                'order'         => $this->order,
                                'workorder_id'  => $workorder_id,
@@ -402,7 +395,7 @@
 
                        $link_data_delete = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uitemplate.hour',
+                               'menuaction'    => 'property.uitemplate.hour',
                                'sort'          => $this->sort,
                                'order'         => $this->order,
                                'workorder_id'  => $workorder_id,
@@ -415,7 +408,7 @@
                        (
                                'lang_add'      => lang('add'),
                                'lang_add_statustext'   => lang('add a hour'),
-                               'add_action'    => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uitemplate.edit_hour','template_id'=> $template_id))
+                               'add_action'    => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uitemplate.edit_hour','template_id'=> $template_id))
                        );
 
                        if(!$this->allrows)
@@ -439,7 +432,6 @@
                                'link_delete'                           => 
$GLOBALS['phpgw']->link('/index.php',$link_data_delete),
 
                                'function'                              => 
'template',
-                               'links'                                 => 
$links,
                                'allrows'                               => 
$this->allrows,
                                'allow_allrows'                         => true,
                                'start_record'                          => 
$this->start,
@@ -463,7 +455,7 @@
                        $appname                                        = 
lang('template');
                        $function_msg                                   = 
lang('view template detail');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
 
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_template_hour' => 
$data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
@@ -507,7 +499,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uitemplate.edit_template',
+                               'menuaction'    => 
'property.uitemplate.edit_template',
                                'template_id'   => $template_id
                        );
 
@@ -517,7 +509,7 @@
                        (
                                '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.'.uitemplate.index', 'template_id'=> $template_id)),
+                               'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uitemplate.index', 'template_id'=> $template_id)),
 
                                'lang_template_id'                      => 
lang('Template ID'),
                                'value_template_id'                     => 
$template_id,
@@ -544,13 +536,13 @@
                                'lang_chapter_statustext'               => 
lang('Select the chapter (for tender) for this activity.'),
                                'lang_add'                              => 
lang('add a hour'),
                                'lang_add_statustext'                   => 
lang('add a hour to this template'),
-                               'add_action'                            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uitemplate.edit_hour', 'template_id'=> $template_id))
+                               'add_action'                            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uitemplate.edit_hour', 'template_id'=> $template_id))
                        );
 
                        $appname        = lang('Workorder template');
                        $function_msg   = lang('view ticket detail');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_template' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -608,7 +600,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uitemplate.edit_hour',
+                               'menuaction'    => 
'property.uitemplate.edit_hour',
                                'template_id'   => $template_id,
                                'hour_id'       => $hour_id
                        );
@@ -619,7 +611,7 @@
                        (
                                '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.'.uitemplate.hour', 'template_id'=> $template_id)),
+                               'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uitemplate.hour', 'template_id'=> $template_id)),
                                'lang_template'                         => 
lang('template'),
                                'value_template_id'                     => 
$template['template_id'],
                                'value_template_name'                   => 
$template['name'],
@@ -699,7 +691,7 @@
                                'lang_building_part_statustext'         => 
lang('Select the building part for this activity.'),
 
 
-                               'ns3420_link'                           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilookup.ns3420')),
+                               'ns3420_link'                           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uilookup.ns3420')),
                                'lang_ns3420'                           => 
lang('NS3420'),
                                'value_ns3420_id'                       => 
$values['ns3420_id'],
                                'lang_ns3420_statustext'                => 
lang('Select a standard-code from the norwegian standard'),
@@ -709,7 +701,7 @@
 
                        $appname        = lang('Workorder template');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_hour' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -721,7 +713,7 @@
 
                        $link_data = array
                        (
-                               'menuaction' => 
$this->currentapp.'.uitemplate.index'
+                               'menuaction' => 'property.uitemplate.index'
                        );
 
                        if (phpgw::get_var('confirm', 'bool', 'POST'))
@@ -735,7 +727,7 @@
                        $data = array
                        (
                                'done_action'           => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'         => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uitemplate.delete', 'id'=> $id)),
+                               'delete_action'         => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uitemplate.delete', 'id'=> $id)),
                                'lang_confirm_msg'      => lang('do you really 
want to delete this entry'),
                                'lang_yes'              => lang('yes'),
                                'lang_yes_statustext'   => lang('Delete the 
entry'),
@@ -746,7 +738,7 @@
                        $appname                = lang('Workorder template');
                        $function_msg           = lang('delete template');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }

Modified: trunk/property/inc/class.uitenant_claim.inc.php
===================================================================
--- trunk/property/inc/class.uitenant_claim.inc.php     2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/inc/class.uitenant_claim.inc.php     2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -55,14 +55,13 @@
                function property_uitenant_claim()
                {
                        $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
'property::project::claim';
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->nextmatchs       = 
CreateObject('phpgwapi.nextmatchs');
                        $this->account          = 
$GLOBALS['phpgw_info']['user']['account_id'];
 
                        $this->bo               = 
CreateObject('property.botenant_claim',True);
                        $this->bocommon         = 
CreateObject('property.bocommon');
-                       $this->menu             = CreateObject('property.menu');
-
                        $this->acl              = CreateObject('phpgwapi.acl');
                        $this->acl_location     = '.tenant_claim';
 
@@ -101,20 +100,16 @@
                function index($project_id='')
                {
                        
$GLOBALS['phpgw']->xslttpl->add_file(array('tenant_claim',
-                                                                               
'menu',
                                                                                
'receipt',
                                                                                
'search_field',
                                                                                
'nextmatchs'));
 
                        if(!$this->acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>1, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
                        }
 
 
-                       $this->menu->sub        = 'project';
-                       $links = $this->menu->links('tenant_claim');
-
                        $receipt = 
$GLOBALS['phpgw']->session->appsession('session_data','tenant_claim_receipt');
                        
$GLOBALS['phpgw']->session->appsession('session_data','tenant_claim_receipt','');
 
@@ -136,9 +131,9 @@
                                        'name'                                  
=> $name,
                                        'entry_date'                            
=> $claim['entry_date'],
                                        'category'                              
=> $claim['category'],
-                                       'link_view'                             
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uitenant_claim.view', 'claim_id'=> $claim['claim_id'])),
-                                       'link_edit'                             
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uitenant_claim.edit', 'claim_id'=> $claim['claim_id'])),
-                                       'link_delete'                           
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uitenant_claim.delete', 'claim_id'=> $claim['claim_id'])),
+                                       'link_view'                             
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uitenant_claim.view', 'claim_id'=> $claim['claim_id'])),
+                                       'link_edit'                             
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uitenant_claim.edit', 'claim_id'=> $claim['claim_id'])),
+                                       'link_delete'                           
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uitenant_claim.delete', 'claim_id'=> $claim['claim_id'])),
                                        'lang_view_statustext'                  
=> lang('view the claim'),
                                        'lang_edit_statustext'                  
=> lang('edit the claim'),
                                        'lang_delete_statustext'                
=> lang('delete the claim'),
@@ -165,7 +160,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'project_id',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction' => 
$this->currentapp.'.uitenant_claim.index',
+                                                                               
        'extra' => array('menuaction' => 'property.uitenant_claim.index',
                                                                                
                                                        'cat_id'        => 
$this->cat_id,
                                                                                
                                                        'query'         
=>$this->query,
                                                                                
                                                        'status'        
=>$this->status,
@@ -176,7 +171,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'org_name',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction' => 
$this->currentapp.'.uitenant_claim.index',
+                                                                               
        'extra' => array('menuaction' => 'property.uitenant_claim.index',
                                                                                
                                                        'cat_id'        => 
$this->cat_id,
                                                                                
                                                        'query'         
=>$this->query,
                                                                                
                                                        'status'        
=>$this->status,
@@ -187,7 +182,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'claim_id',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction' => 
$this->currentapp.'.uitenant_claim.index',
+                                                                               
        'extra' => array('menuaction' => 'property.uitenant_claim.index',
                                                                                
                                                        'cat_id'        => 
$this->cat_id,
                                                                                
                                                        'query'         
=>$this->query,
                                                                                
                                                        'status'        
=>$this->status,
@@ -198,7 +193,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'entry_date',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction' => 
$this->currentapp.'.uitenant_claim.index',
+                                                                               
        'extra' => array('menuaction' => 'property.uitenant_claim.index',
                                                                                
                                                        'cat_id'        
=>$this->cat_id,
                                                                                
                                                        'query'         
=>$this->query,
                                                                                
                                                        'status'        
=>$this->status,
@@ -209,7 +204,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'descr',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction' => 
$this->currentapp.'.uitenant_claim.index',
+                                                                               
        'extra' => array('menuaction' => 'property.uitenant_claim.index',
                                                                                
                                                        'cat_id'        
=>$this->cat_id,
                                                                                
                                                        'query'         
=>$this->query,
                                                                                
                                                        'status'        
=>$this->status,
@@ -221,12 +216,12 @@
                        if ($project_id)
                        {
                                $lang_add = lang('add another');
-                               $add_action     = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uitenant_claim.edit', 'project_id'=> $project_id));
+                               $add_action     = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uitenant_claim.edit', 'project_id'=> $project_id));
                        }
                        else
                        {
                                $lang_add = lang('add');
-                               $add_action     = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiproject.index', 'lookup'=>true, 'from'=>'tenant_claim'));
+                               $add_action     = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiproject.index', 'lookup'=>true, 'from'=>'tenant_claim'));
 
                        }
 
@@ -239,7 +234,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uitenant_claim.index',
+                               'menuaction'    => 
'property.uitenant_claim.index',
                                'sort'          => $this->sort,
                                'order'         => $this->order,
                                'cat_id'        => $this->cat_id,
@@ -262,7 +257,6 @@
                        $data = array
                        (
                                'msgbox_data'                           => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'links'                                 => 
$links,
                                'allow_allrows'                         => true,
                                'allrows'                               => 
$this->allrows,
                                'start_record'                          => 
$this->start,
@@ -330,7 +324,7 @@
                {
                        if(!$this->acl_add && !$this->acl_edit)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>2, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>2, 'acl_location'=> $this->acl_location));
                        }
 
                        $claim_id = phpgw::get_var('claim_id', 'int');
@@ -379,14 +373,14 @@
                                        if ($values['save'])
                                        {
                                                
$GLOBALS['phpgw']->session->appsession('session_data','tenant_claim_receipt',$receipt);
-                                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uitenant_claim.index'));
+                                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uitenant_claim.index'));
                                        }
                                }
                        }
 
                        if ($values['cancel'])
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uitenant_claim.index'));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uitenant_claim.index'));
                        }
 
 
@@ -484,7 +478,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uitenant_claim.edit',
+                               'menuaction'    => 
'property.uitenant_claim.edit',
                                'claim_id'              => $claim_id,
                                'project_id'    => $values['project_id']
                        );
@@ -495,7 +489,7 @@
                        (
                                'table_header_workorder'                => 
$table_header_workorder,
                                'lang_no_workorders'                    => 
lang('No workorder budget'),
-                               'workorder_link'                        => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiworkorder.view')),
+                               'workorder_link'                        => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiworkorder.view')),
                                'lang_start_date'                       => 
lang('Project start date'),
                                'value_start_date'                      => 
$project_values['start_date'],
 
@@ -568,7 +562,7 @@
                                'lang_amount_statustext'                => 
lang('The total amount to claim'),
                                'value_amount'                          => 
$values['amount'],
 
-                               'tenant_link'                           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilookup.tenant')),
+                               'tenant_link'                           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uilookup.tenant')),
                                'lang_tenant'                           => 
lang('tenant'),
                                'value_tenant_id'                       => 
$values['tenant_id'],
                                'value_last_name'                       => 
$values['last_name'],
@@ -609,7 +603,7 @@
 
                        if(!$this->acl_delete)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>8, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>8, 'acl_location'=> $this->acl_location));
                        }
 
 
@@ -619,7 +613,7 @@
 
                        $link_data = array
                        (
-                               'menuaction' => 
$this->currentapp.'.uitenant_claim.index'
+                               'menuaction' => 'property.uitenant_claim.index'
                        );
 
                        if (phpgw::get_var('confirm', 'bool', 'POST'))
@@ -633,7 +627,7 @@
                        $data = array
                        (
                                'done_action'           => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'         => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uitenant_claim.delete', 'claim_id'=> $claim_id)),
+                               'delete_action'         => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uitenant_claim.delete', 'claim_id'=> $claim_id)),
                                'lang_confirm_msg'      => lang('do you really 
want to delete this entry'),
                                'lang_yes'              => lang('yes'),
                                'lang_yes_statustext'   => lang('Delete the 
entry'),
@@ -644,7 +638,7 @@
                        $appname        = lang('Tenant claim');
                        $function_msg   = lang('delete claim');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -653,7 +647,7 @@
                {
                        if(!$this->acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>1, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
                        }
 
                        $claim_id       = phpgw::get_var('claim_id', 'int');
@@ -753,7 +747,7 @@
                        (
                                'table_header_workorder'                => 
$table_header_workorder,
                                'lang_no_workorders'                    => 
lang('No workorder budget'),
-                               'workorder_link'                        => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiworkorder.view')),
+                               'workorder_link'                        => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiworkorder.view')),
                                'lang_start_date'                       => 
lang('Project start date'),
                                'value_start_date'                      => 
$project_values['start_date'],
 
@@ -837,7 +831,7 @@
                                'value_cat'                             => 
$values['cat'],
                                'cat_list'                              => 
$this->bocommon->select_category_list(array('format'=>'select','selected' => 
$values['cat_id'],'type' =>'tenant_claim','order'=>'descr')),
 
-                               'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uitenant_claim.index')),
+                               'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uitenant_claim.index')),
                                'lang_done'                             => 
lang('done'),
                                'value_date'                            => 
$GLOBALS['phpgw']->common->show_date($tenant_claim['entry_date'])
 

Modified: trunk/property/inc/class.uitts.inc.php
===================================================================
--- trunk/property/inc/class.uitts.inc.php      2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.uitts.inc.php      2008-02-02 13:52:39 UTC (rev 
18466)
@@ -48,8 +48,9 @@
                        'view_file'     => True
                );
 
-               function property_uitts()
+               public function __construct()
                {
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
'property::helpdesk';
                        if($this->tenant_id     = 
$GLOBALS['phpgw']->session->appsession('tenant_id','property'))
                        {
                                $GLOBALS['phpgw_info']['flags']['noframework'] 
= True;
@@ -59,12 +60,11 @@
 
                        $this->account                          = 
$GLOBALS['phpgw_info']['user']['account_id'];
                        $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->nextmatchs                       = 
CreateObject('phpgwapi.nextmatchs');
 
                        $this->bo                                       = 
CreateObject('property.botts',True);
                        $this->bocommon                         = 
CreateObject('property.bocommon');
-                       $this->menu                                     = 
CreateObject('property.menu');
 
                //      $this->acl                                      = 
CreateObject('phpgwapi.acl');
                        $this->acl                                      = & 
$GLOBALS['phpgw']->acl;
@@ -88,8 +88,6 @@
                        $this->start_date                       = 
$this->bo->start_date;
                        $this->end_date                         = 
$this->bo->end_date;
                        $this->fakebase                         = 
$this->bo->fakebase;
-
-                       $this->menu->sub                        ='ticket';
                }
 
                function save_sessiondata()
@@ -115,7 +113,7 @@
                {
                        if(!$this->acl->check('.ticket.external',1))
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=> 1, 'acl_location'=> 
'.ticket.external'));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=> 1, 'acl_location'=> '.ticket.external'));
                        }
                        
                        $this->excel($external = true);
@@ -201,12 +199,12 @@
                {
                        if($this->tenant_id)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uitts.index2'));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uitts.index2'));
                        }
                        
                        if(!$this->acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=> 1, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=> 1, 'acl_location'=> $this->acl_location));
                        }
 
                        
$GLOBALS['phpgw']->js->set_onload('document.search.query.focus();');
@@ -215,25 +213,24 @@
                        {
                                if(!$this->acl_edit)
                                {
-                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop','perm'=> 4, 'acl_location'=> 
$this->acl_location));
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop','perm'=> 4, 'acl_location'=> $this->acl_location));
                                }
 
                                $new_status = phpgw::get_var('new_status', 
'string', 'GET');
                                $id = phpgw::get_var('id', 'int');
                                $so2    = CreateObject('property.sotts2');
                                $receipt = 
$so2->update_status(array('status'=>$new_status),$id);
-                               
$GLOBALS['phpgw']->session->appsession('receipt',$this->currentapp,$receipt);
+                               
$GLOBALS['phpgw']->session->appsession('receipt','property',$receipt);
                        }
 
                        $GLOBALS['phpgw']->xslttpl->add_file(array('tts',
-                                                                               
'menu',
                                                                                
'nextmatchs'));
 
 
                        $second_display = phpgw::get_var('second_display', 
'bool');
 
-                       $default_category = 
(isset($GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['default_district'])?$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['default_district']:'');
-                       $default_status = 
(isset($GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['tts_status'])?$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['tts_status']:'');
+                       $default_category = 
(isset($GLOBALS['phpgw_info']['user']['preferences']['property']['default_district'])?$GLOBALS['phpgw_info']['user']['preferences']['property']['default_district']:'');
+                       $default_status = 
(isset($GLOBALS['phpgw_info']['user']['preferences']['property']['tts_status'])?$GLOBALS['phpgw_info']['user']['preferences']['property']['tts_status']:'');
                        $start_date     = urldecode($this->start_date);
                        $end_date       = urldecode($this->end_date);
 
@@ -261,8 +258,6 @@
                        $bgcolor_array[10]      = '#da7a7a';
 
 
-                       $links = $this->menu->links();
-
                        $ticket_list = $this->bo->read($start_date,$end_date);
 
                        $uicols=$this->bo->uicols;
@@ -304,7 +299,7 @@
 
                                $link_status_data = array
                                (
-                                       'menuaction'                    => 
$this->currentapp.'.uitts.index',
+                                       'menuaction'                    => 
'property.uitts.index',
                                                        'id'                    
=> $ticket['id'],
                                                        'edit_status'   => true,
                                                        'new_status'    => 
$new_status,
@@ -334,7 +329,7 @@
                                        'user'                                  
=> $ticket['user'],
                                        'assignedto'                    => 
$ticket['assignedto'],
                                        'child_date'                    => 
$ticket['child_date'],
-                                       'link_view'                             
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uitts.view', 'id'=> $ticket['id'])),
+                                       'link_view'                             
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uitts.view', 'id'=> $ticket['id'])),
                                        'lang_view_statustext'  => lang('view 
the ticket'),
                                        'text_view'                             
=> lang('view'),
                                        'status'                                
=> $status,
@@ -351,7 +346,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'priority',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction' => $this->currentapp.'.uitts.index',
+                                                                               
        'extra' => array('menuaction' => 'property.uitts.index',
                                                                                
                                                        'cat_id'        
=>$this->cat_id,
                                                                                
                                                        'filter'        
=>$this->filter,
                                                                                
                                                        'user_filter'   
=>$this->user_filter,
@@ -372,7 +367,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'fm_tts_tickets.id',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction' => $this->currentapp.'.uitts.index',
+                                                                               
        'extra' => array('menuaction' => 'property.uitts.index',
                                                                                
                                                        'cat_id'        
=>$this->cat_id,
                                                                                
                                                        'filter'        
=>$this->filter,
                                                                                
                                                        'user_filter'   
=>$this->user_filter,
@@ -399,7 +394,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'assignedto',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction' => $this->currentapp.'.uitts.index',
+                                                                               
        'extra' => array('menuaction' => 'property.uitts.index',
                                                                                
                                                        'cat_id'        
=>$this->cat_id,
                                                                                
                                                        'filter'        
=>$this->filter,
                                                                                
                                                        'user_filter'   
=>$this->user_filter,
@@ -417,7 +412,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'user_lid',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => $this->currentapp.'.uitts.index',
+                                                                               
        'extra' => array('menuaction'   => 'property.uitts.index',
                                                                                
                                                        'cat_id'        
=>$this->cat_id,
                                                                                
                                                        'filter'        
=>$this->filter,
                                                                                
                                                        'user_filter'   
=>$this->user_filter,
@@ -434,7 +429,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'fm_tts_tickets.entry_date',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => $this->currentapp.'.uitts.index',
+                                                                               
        'extra' => array('menuaction'   => 'property.uitts.index',
                                                                                
                                                        'cat_id'        
=>$this->cat_id,
                                                                                
                                                        'filter'        
=>$this->filter,
                                                                                
                                                        'user_filter'   
=>$this->user_filter,
@@ -451,7 +446,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'finnish_date',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => $this->currentapp.'.uitts.index',
+                                                                               
        'extra' => array('menuaction'   => 'property.uitts.index',
                                                                                
                                                        'cat_id'        => 
$this->cat_id,
                                                                                
                                                        'filter'        => 
$this->filter,
                                                                                
                                                        'user_filter'   => 
$this->user_filter,
@@ -479,12 +474,12 @@
                        (
                                'lang_add'              => lang('add'),
                                'lang_add_statustext'   => lang('add a ticket'),
-                               'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uitts.add'))
+                               'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 'property.uitts.add'))
                        );
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uitts.index',
+                               'menuaction'    => 'property.uitts.index',
                                'second_display'=> true,
                                'sort'          => $this->sort,
                                'order'         => $this->order,
@@ -498,14 +493,14 @@
                                'allrows'       => $this->allrows
                        );
 
-                       $receipt = 
$GLOBALS['phpgw']->session->appsession('receipt',$this->currentapp);
-                       
$GLOBALS['phpgw']->session->appsession('receipt',$this->currentapp,'');
+                       $receipt = 
$GLOBALS['phpgw']->session->appsession('receipt','property');
+                       
$GLOBALS['phpgw']->session->appsession('receipt','property','');
 
                        $GLOBALS['phpgw']->preferences->read_repository();
                        $autorefresh ='';
-                       if 
(isset($GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['refreshinterval']))
+                       if 
(isset($GLOBALS['phpgw_info']['user']['preferences']['property']['refreshinterval']))
                        {
-                               $autorefresh = 
$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['refreshinterval'].';
 URL='.$GLOBALS['phpgw']->link('/index.php',$link_data);
+                               $autorefresh = 
$GLOBALS['phpgw_info']['user']['preferences']['property']['refreshinterval'].'; 
URL='.$GLOBALS['phpgw']->link('/index.php',$link_data);
                        }
 
 
@@ -521,11 +516,11 @@
 
                        $msgbox_data = $this->bocommon->msgbox_data($receipt);
 
-                       $link_date_search       = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiproject.date_search'));
+                       $link_date_search       = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiproject.date_search'));
 
                        $link_excel = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uitts.excel',
+                               'menuaction'    => 'property.uitts.excel',
                                'second_display'=> true,
                                'sort'          => $this->sort,
                                'order'         => $this->order,
@@ -541,7 +536,7 @@
                        );
 
                        $pref_group_filters = '';
-                       
if(isset($GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['group_filters']))
+                       
if(isset($GLOBALS['phpgw_info']['user']['preferences']['property']['group_filters']))
                        {
                                $pref_group_filters = true;
                                $group_filters = 'select';
@@ -553,7 +548,7 @@
                                
$GLOBALS['phpgw']->xslttpl->add_file(array('search_field'));
                        }
 
-                       
$GLOBALS['phpgw']->js->validate_file('overlib','overlib',$this->currentapp);
+                       
$GLOBALS['phpgw']->js->validate_file('overlib','overlib','property');
 
                        $data = array
                        (
@@ -571,7 +566,6 @@
 
                                'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
                                'autorefresh'                                   
=> $autorefresh,
-                               'links'                                         
        => $links,
                                'allow_allrows'                                 
=> True,
                                'allrows'                                       
        => $this->allrows,
                                'start_record'                                  
=> $this->start,
@@ -607,13 +601,13 @@
                                'select_user_name'                              
=> 'user_filter',
                                'lang_no_user'                                  
=> lang('No user'),
                                'user_list'                                     
        => 
$this->bocommon->get_user_list_right2($group_filters,4,$this->user_filter,$this->acl_location,'',$default=''),
-                               'allow_edit_status'                             
=> 
isset($GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['tts_status_link'])
 && 
$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['tts_status_link']
 ? 
$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['tts_status_link']:''
+                               'allow_edit_status'                             
=> 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['tts_status_link'])
 && 
$GLOBALS['phpgw_info']['user']['preferences']['property']['tts_status_link'] ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['tts_status_link']:''
                        );
 
                        $appname                                        = 
lang('helpdesk');
                        $function_msg                                   = 
lang('list ticket');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
@@ -623,18 +617,17 @@
                {       
                        if(!$this->acl->check('.ticket.external',1))
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=> 1, 'acl_location'=> 
'.ticket.external'));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=> 1, 'acl_location'=> '.ticket.external'));
                        }
 
                        $GLOBALS['phpgw']->xslttpl->add_file(array('tts',
-                                                                               
'menu',
                                                                                
'nextmatchs'));
 
 
                        $second_display = phpgw::get_var('second_display', 
'bool');
 
-                       $default_category = 
(isset($GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['default_district'])?$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['default_district']:'');
-                       $default_status = 
(isset($GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['tts_status'])?$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['tts_status']:'');
+                       $default_category = 
(isset($GLOBALS['phpgw_info']['user']['preferences']['property']['default_district'])?$GLOBALS['phpgw_info']['user']['preferences']['property']['default_district']:'');
+                       $default_status = 
(isset($GLOBALS['phpgw_info']['user']['preferences']['property']['tts_status'])?$GLOBALS['phpgw_info']['user']['preferences']['property']['tts_status']:'');
                        $start_date     = urldecode($this->start_date);
                        $end_date       = urldecode($this->end_date);
 
@@ -662,8 +655,6 @@
                        $bgcolor['10']  = '#da7a7a';
 
 
-                       $links = $this->menu->links();
-
                        $ticket_list = 
$this->bo->read($start_date,$end_date,$external=true);
 
                        $uicols=$this->bo->uicols;
@@ -705,7 +696,7 @@
                                        'user'                                  
=> $ticket['user'],
                                        'assignedto'                    => 
$ticket['assignedto'],
                                        'child_date'                    => 
$ticket['child_date'],
-                                       'link_view'                             
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uitts.view2', 'id'=> $ticket['id'])),
+                                       'link_view'                             
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uitts.view2', 'id'=> $ticket['id'])),
                                        'lang_view_statustext'  => lang('view 
the ticket'),
                                        'text_view'                             
=> lang('view'),
                                        'status'                                
=> $status,
@@ -719,7 +710,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'priority',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction' => $this->currentapp.'.uitts.index',
+                                                                               
        'extra' => array('menuaction' => 'property.uitts.index',
                                                                                
                                                        'cat_id'        
=>$this->cat_id,
                                                                                
                                                        'filter'        
=>$this->filter,
                                                                                
                                                        'user_filter'   
=>$this->user_filter,
@@ -740,7 +731,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'fm_tts_tickets.id',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction' => $this->currentapp.'.uitts.index',
+                                                                               
        'extra' => array('menuaction' => 'property.uitts.index',
                                                                                
                                                        'cat_id'        
=>$this->cat_id,
                                                                                
                                                        'filter'        
=>$this->filter,
                                                                                
                                                        'user_filter'   
=>$this->user_filter,
@@ -767,7 +758,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'assignedto',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction' => $this->currentapp.'.uitts.index',
+                                                                               
        'extra' => array('menuaction' => 'property.uitts.index',
                                                                                
                                                        'cat_id'        
=>$this->cat_id,
                                                                                
                                                        'filter'        
=>$this->filter,
                                                                                
                                                        'user_filter'   
=>$this->user_filter,
@@ -785,7 +776,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'user_lid',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => $this->currentapp.'.uitts.index',
+                                                                               
        'extra' => array('menuaction'   => 'property.uitts.index',
                                                                                
                                                        'cat_id'        
=>$this->cat_id,
                                                                                
                                                        'filter'        
=>$this->filter,
                                                                                
                                                        'user_filter'   
=>$this->user_filter,
@@ -802,7 +793,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'fm_tts_tickets.entry_date',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => $this->currentapp.'.uitts.index',
+                                                                               
        'extra' => array('menuaction'   => 'property.uitts.index',
                                                                                
                                                        'cat_id'        
=>$this->cat_id,
                                                                                
                                                        'filter'        
=>$this->filter,
                                                                                
                                                        'user_filter'   
=>$this->user_filter,
@@ -819,7 +810,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'finnish_date',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => $this->currentapp.'.uitts.index',
+                                                                               
        'extra' => array('menuaction'   => 'property.uitts.index',
                                                                                
                                                        'cat_id'        => 
$this->cat_id,
                                                                                
                                                        'filter'        => 
$this->filter,
                                                                                
                                                        'user_filter'   => 
$this->user_filter,
@@ -847,12 +838,12 @@
                        (
                                'lang_add'                              => 
lang('add'),
                                'lang_add_statustext'   => lang('add a ticket'),
-                               'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uitts.add2'))
+                               'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uitts.add2'))
                        );
 
                        $link_data = array
                        (
-                               'menuaction'            => 
$this->currentapp.'.uitts.index2',
+                               'menuaction'            => 
'property.uitts.index2',
                                'second_display'        => true,
                                'sort'                          => $this->sort,
                                'order'                         => $this->order,
@@ -866,14 +857,14 @@
                                'allrows'                       => 
$this->allrows
                        );
 
-                       $receipt = 
$GLOBALS['phpgw']->session->appsession('receipt',$this->currentapp);
-                       
$GLOBALS['phpgw']->session->appsession('receipt',$this->currentapp,'');
+                       $receipt = 
$GLOBALS['phpgw']->session->appsession('receipt','property');
+                       
$GLOBALS['phpgw']->session->appsession('receipt','property','');
 
                        $GLOBALS['phpgw']->preferences->read_repository();
                        $autorefresh ='';
-                       if 
(isset($GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['refreshinterval']))
+                       if 
(isset($GLOBALS['phpgw_info']['user']['preferences']['property']['refreshinterval']))
                        {
-                               $autorefresh = 
$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['refreshinterval'].';
 URL='.$GLOBALS['phpgw']->link('/index.php',$link_data);
+                               $autorefresh = 
$GLOBALS['phpgw_info']['user']['preferences']['property']['refreshinterval'].'; 
URL='.$GLOBALS['phpgw']->link('/index.php',$link_data);
                        }
 
                        if(!$this->allrows)
@@ -887,11 +878,11 @@
 
                        $msgbox_data = $this->bocommon->msgbox_data($receipt);
 
-                       $link_date_search       = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiproject.date_search'));
+                       $link_date_search       = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiproject.date_search'));
 
                        $link_excel = array
                        (
-                               'menuaction'            => 
$this->currentapp.'.uitts.excel2',
+                               'menuaction'            => 
'property.uitts.excel2',
                                'second_display'        => true,
                                'sort'                          => $this->sort,
                                'order'                         => $this->order,
@@ -908,7 +899,7 @@
 
                        
$GLOBALS['phpgw']->xslttpl->add_file(array('search_field'));
 
-                       
$GLOBALS['phpgw']->js->validate_file('overlib','overlib',$this->currentapp);
+                       
$GLOBALS['phpgw']->js->validate_file('overlib','overlib','property');
 
                        $data = array
                        (
@@ -925,7 +916,6 @@
 
                                'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
                                'autorefresh'                                   
=> $autorefresh,
-                               'links'                                         
        => $links,
                                'allow_allrows'                                 
=> True,
                                'allrows'                                       
        => $this->allrows,
                                'start_record'                                  
=> $this->start,
@@ -952,7 +942,7 @@
                        $appname                                        = 
lang('helpdesk');
                        $function_msg                                   = 
lang('list ticket');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list2' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
@@ -962,7 +952,7 @@
                {
                        if(!$this->acl_add)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=> 2, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=> 2, 'acl_location'=> $this->acl_location));
                        }
 
                        $bolocation             = 
CreateObject('property.bolocation');
@@ -1048,8 +1038,8 @@
 //_debug_array($insert_record);
                        if (isset($values['save']))
                        {
-                               $insert_record = 
$GLOBALS['phpgw']->session->appsession('insert_record',$this->currentapp);
-                               $insert_record_entity = 
$GLOBALS['phpgw']->session->appsession('insert_record_entity',$this->currentapp);
+                               $insert_record = 
$GLOBALS['phpgw']->session->appsession('insert_record','property');
+                               $insert_record_entity = 
$GLOBALS['phpgw']->session->appsession('insert_record_entity','property');
 
                                if(isset($insert_record_entity) && 
is_array($insert_record_entity))
                                {
@@ -1094,7 +1084,7 @@
 
                                        if($values['file_name'])
                                        {
-                                               $to_file = $this->fakebase. SEP 
. 'fmticket' . SEP . $receipt['id'] . SEP . $values['file_name'];
+                                               $to_file = $this->fakebase. '/' 
. 'fmticket' . '/' . $receipt['id'] . '/' . $values['file_name'];
        
                                                
if($this->bo->vfs->file_exists(array(
                                                                'string' => 
$to_file,
@@ -1119,9 +1109,9 @@
                                                }
                                        }
 
-                                       
$GLOBALS['phpgw']->session->appsession('receipt',$this->currentapp,$receipt);
+                                       
$GLOBALS['phpgw']->session->appsession('receipt','property',$receipt);
                                        
$GLOBALS['phpgw']->session->appsession('session_data','fm_tts','');
-                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uitts.index'));
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uitts.index'));
                                }
                                else
                                {
@@ -1153,21 +1143,21 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uitts.add'
+                               'menuaction'    => 'property.uitts.add'
                        );
 
                        if(!isset($values['assignedto']))
                        {
-                               $values['assignedto']= 
(isset($GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['assigntodefault'])?$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['assigntodefault']:'');
+                               $values['assignedto']= 
(isset($GLOBALS['phpgw_info']['user']['preferences']['property']['assigntodefault'])?$GLOBALS['phpgw_info']['user']['preferences']['property']['assigntodefault']:'');
                        }
                        if(!isset($values['group_id']))
                        {
-                               $values['group_id']= 
(isset($GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['groupdefault'])?$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['groupdefault']:'');
+                               $values['group_id']= 
(isset($GLOBALS['phpgw_info']['user']['preferences']['property']['groupdefault'])?$GLOBALS['phpgw_info']['user']['preferences']['property']['groupdefault']:'');
                        }
 
                        if(!isset($values['cat_id']))
                        {
-                               $this->cat_id = 
(isset($GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['tts_category'])?$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['tts_category']:'');
+                               $this->cat_id = 
(isset($GLOBALS['phpgw_info']['user']['preferences']['property']['tts_category'])?$GLOBALS['phpgw_info']['user']['preferences']['property']['tts_category']:'');
                        }
                        else
                        {
@@ -1204,7 +1194,7 @@
 
                        $msgbox_data = 
(isset($receipt)?$this->bocommon->msgbox_data($receipt):'');
 
-                       
$GLOBALS['phpgw']->js->validate_file('dateformat','dateformat',$this->currentapp);
+                       
$GLOBALS['phpgw']->js->validate_file('dateformat','dateformat','property');
 
                        $data = array
                        (
@@ -1235,7 +1225,7 @@
                                'priority_list'                         => 
$this->bo->get_priority_list((isset($values['priority'])?$values['priority']:'')),
 
                                'form_action'                           => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uitts.index')),
+                               'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uitts.index')),
                                'lang_subject'                          => 
lang('Subject'),
                                'lang_subject_statustext'               => 
lang('Enter the subject of this ticket'),
 
@@ -1263,7 +1253,7 @@
                                'mailnotification'                      => 
(isset($this->bo->config->config_data['mailnotification'])?$this->bo->config->config_data['mailnotification']:''),
                                'lang_mailnotification'                 => 
lang('Send e-mail'),
                                'lang_mailnotification_statustext'      => 
lang('Choose to send mailnotification'),
-                               'pref_send_mail'                        => 
(isset($GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['tts_user_mailnotification'])?$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['tts_user_mailnotification']:''),
+                               'pref_send_mail'                        => 
(isset($GLOBALS['phpgw_info']['user']['preferences']['property']['tts_user_mailnotification'])?$GLOBALS['phpgw_info']['user']['preferences']['property']['tts_user_mailnotification']:''),
                                'fileupload'                            => 
(isset($this->bo->config->config_data['fmttsfileupload'])?$this->bo->config->config_data['fmttsfileupload']:''),
                        );
 
@@ -1271,7 +1261,7 @@
                        $appname                                        = 
lang('helpdesk');
                        $function_msg                                   = 
lang('add ticket');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        $GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('add' 
=> $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -1280,7 +1270,7 @@
                {
                        if(!$this->acl->check('.ticket.external',2))
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=> 1, 'acl_location'=> 
'.ticket.external'));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=> 1, 'acl_location'=> '.ticket.external'));
                        }
 
                        $bolocation             = 
CreateObject('property.bolocation');
@@ -1326,15 +1316,15 @@
                        $values['street_number'] = 
$values['location_data']['street_number'];
 
                        
-                       $values['assignedto']= 
(isset($GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['assigntodefault'])?$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['assigntodefault']:'');
+                       $values['assignedto']= 
(isset($GLOBALS['phpgw_info']['user']['preferences']['property']['assigntodefault'])?$GLOBALS['phpgw_info']['user']['preferences']['property']['assigntodefault']:'');
                        if(!$values['assignedto'])
                        {
                                $receipt['error'][]=array('msg'=>lang('Please 
set default assign to in preferences for user %1!', 
$GLOBALS['phpgw']->accounts->id2name($this->account)));
                        }
 
-                       $values['group_id']= 
(isset($GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['groupdefault'])?$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['groupdefault']:'');
                     
+                       $values['group_id']= 
(isset($GLOBALS['phpgw_info']['user']['preferences']['property']['groupdefault'])?$GLOBALS['phpgw_info']['user']['preferences']['property']['groupdefault']:'');
                   
                        
-                       $values['cat_id'] = 
(isset($GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['tts_category'])?$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['tts_category']:'');
+                       $values['cat_id'] = 
(isset($GLOBALS['phpgw_info']['user']['preferences']['property']['tts_category'])?$GLOBALS['phpgw_info']['user']['preferences']['property']['tts_category']:'');
                        
                        if(!$values['cat_id'])
                        {
@@ -1345,7 +1335,7 @@
                        {
 
 // FIX this : relevant?
-/*                             $insert_record_entity = 
$GLOBALS['phpgw']->session->appsession('insert_record_entity',$this->currentapp);
+/*                             $insert_record_entity = 
$GLOBALS['phpgw']->session->appsession('insert_record_entity','property');
 
                                if(isset($insert_record_entity) && 
is_array($insert_record_entity))
                                {
@@ -1376,9 +1366,9 @@
                                if(!isset($receipt['error']))
                                {
                                        $receipt = $this->bo->add($values);
-                                       
$GLOBALS['phpgw']->session->appsession('receipt',$this->currentapp,$receipt);
+                                       
$GLOBALS['phpgw']->session->appsession('receipt','property',$receipt);
                                        
$GLOBALS['phpgw']->session->appsession('session_data','fm_tts','');
-                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uitts.index2'));
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uitts.index2'));
                                }
                                else
                                {
@@ -1404,7 +1394,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uitts.add2'
+                               'menuaction'    => 'property.uitts.add2'
                        );
 
                        $dateformat = 
strtolower($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
@@ -1438,7 +1428,7 @@
 
                        $msgbox_data = 
(isset($receipt)?$this->bocommon->msgbox_data($receipt):'');
 
-                       
$GLOBALS['phpgw']->js->validate_file('dateformat','dateformat',$this->currentapp);
+                       
$GLOBALS['phpgw']->js->validate_file('dateformat','dateformat','property');
 
                        $data = array
                        (
@@ -1465,7 +1455,7 @@
                                'priority_list'                                 
        => 
$this->bo->get_priority_list((isset($values['priority'])?$values['priority']:'')),
 
                                'form_action'                                   
        => $GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'done_action'                                   
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uitts.index2')),
+                               'done_action'                                   
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uitts.index2')),
                                'lang_subject'                                  
        => lang('Subject'),
                                'lang_subject_statustext'                       
=> lang('Enter the subject of this ticket'),
 
@@ -1493,7 +1483,7 @@
                                'mailnotification'                              
        => 
(isset($this->bo->config->config_data['mailnotification'])?$this->bo->config->config_data['mailnotification']:''),
                                'lang_mailnotification'                         
=> lang('Send e-mail'),
                                'lang_mailnotification_statustext'      => 
lang('Choose to send mailnotification'),
-                               'pref_send_mail'                                
        => 
(isset($GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['tts_user_mailnotification'])?$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['tts_user_mailnotification']:''),
+                               'pref_send_mail'                                
        => 
(isset($GLOBALS['phpgw_info']['user']['preferences']['property']['tts_user_mailnotification'])?$GLOBALS['phpgw_info']['user']['preferences']['property']['tts_user_mailnotification']:''),
                                'lang_contact_phone'                            
=> lang('contact phone'),
                                'lang_contact_phone_statustext'         => 
lang('contact phone'),
                                'value_contact_phone'                           
=> (isset($values['contact_phone'])?$values['contact_phone']:''),
@@ -1507,7 +1497,7 @@
                        $appname                                        = 
lang('helpdesk');
                        $function_msg                                   = 
lang('add ticket');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('add2' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -1517,7 +1507,7 @@
                {
                        if(!$this->acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>1, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
                        }
 
                        $bolocation     = CreateObject('property.bolocation');
@@ -1532,7 +1522,7 @@
                        {
                                if(!$this->acl_edit)
                                {
-                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>4, 'acl_location'=> 
$this->acl_location));
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>4, 'acl_location'=> $this->acl_location));
                                }
 
                                $so2    = CreateObject('property.sotts2');
@@ -1547,7 +1537,7 @@
 
                                if($values['file_name'])
                                {
-                                       $to_file = $this->fakebase. SEP . 
'fmticket' . SEP . $id . SEP . $values['file_name'];
+                                       $to_file = $this->fakebase. '/' . 
'fmticket' . '/' . $id . '/' . $values['file_name'];
        
                                        if($this->bo->vfs->file_exists(array(
                                                        'string' => $to_file,
@@ -1580,7 +1570,7 @@
 
                        $request_link_data = array
                        (
-                               'menuaction'            => 
$this->currentapp.'.uirequest.edit',
+                               'menuaction'            => 
'property.uirequest.edit',
                                'bypass'                => true,
                                'location_code'         => 
$ticket['location_code'],
                                'p_num'                 => $ticket['p_num'],
@@ -1594,7 +1584,7 @@
 
                        $order_link_data = array
                        (
-                               'menuaction'            => 
$this->currentapp.'.uiproject.edit',
+                               'menuaction'            => 
'property.uiproject.edit',
                                'bypass'                => true,
                                'location_code'         => 
$ticket['location_code'],
                                'p_num'                 => $ticket['p_num'],
@@ -1607,7 +1597,7 @@
 
                        $form_link = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uitts.view',
+                               'menuaction'    => 'property.uitts.view',
                                'id'            => $id
                        );
 
@@ -1667,7 +1657,7 @@
                                {
                                        $link_entity[$i]['link'] = 
$GLOBALS['phpgw']->link('/index.php',array
                                        (
-                                               'menuaction'            => 
$this->currentapp.'.uientity.edit',
+                                               'menuaction'            => 
'property.uientity.edit',
                                                'bypass'                => true,
                                                'location_code'         => 
$ticket['location_code'],
                                                'entity_id'             => 
$entry['id'],
@@ -1767,11 +1757,11 @@
                                }
                        }
 
-                       
$GLOBALS['phpgw']->js->validate_file('dateformat','dateformat',$this->currentapp);
+                       
$GLOBALS['phpgw']->js->validate_file('dateformat','dateformat','property');
 
                        $link_file_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uitts.view_file',
+                               'menuaction'    => 'property.uitts.view_file',
                                'id'            => $id
                        );
 
@@ -1835,7 +1825,7 @@
                                'value_category_name'                   => 
$ticket['category_name'],
 
                                'form_action'                           => 
$GLOBALS['phpgw']->link('/index.php',$form_link),
-                               'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>$this->currentapp.'.uitts.index')),
+                               'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>'property.uitts.index')),
                                'value_subject'                         => 
$ticket['subject'],
                                'lang_subject_statustext'               => 
lang('update subject'),
                                'value_id'                              => '[ 
#'. $id . ' ] - ',
@@ -1876,7 +1866,7 @@
                                'mailnotification'                      => 
(isset($this->bo->config->config_data['mailnotification'])?true:''),
                                'lang_mailnotification'                 => 
lang('Send e-mail'),
                                'lang_mailnotification_statustext'      => 
lang('Choose to send mailnotification'),
-                               'pref_send_mail'                        => 
(isset($GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['tts_user_mailnotification'])?$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['tts_user_mailnotification']:''),
+                               'pref_send_mail'                        => 
(isset($GLOBALS['phpgw_info']['user']['preferences']['property']['tts_user_mailnotification'])?$GLOBALS['phpgw_info']['user']['preferences']['property']['tts_user_mailnotification']:''),
                                'fileupload'                            => 
(isset($this->bo->config->config_data['fmttsfileupload'])?$this->bo->config->config_data['fmttsfileupload']:''),
                                'link_view_file'                                
=> $GLOBALS['phpgw']->link('/index.php',$link_file_data),
                                'link_to_files'                                 
=> 
(isset($this->bo->config->config_data['files_url'])?$this->bo->config->config_data['files_url']:''),
@@ -1894,7 +1884,7 @@
                        $appname                                        = 
lang('helpdesk');
                        $function_msg                                   = 
lang('view ticket detail');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -1903,7 +1893,7 @@
                {
                        if(!$this->acl->check('.ticket.external',1))
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=> 1, 'acl_location'=> 
'.ticket.external'));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=> 1, 'acl_location'=> '.ticket.external'));
                        }
 
                        $bolocation     = CreateObject('property.bolocation');
@@ -1918,7 +1908,7 @@
                        {
                                if(!$this->acl->check('.ticket.external',2))
                                {
-                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>4, 'acl_location'=> 
'.ticket.external'));
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>4, 'acl_location'=> '.ticket.external'));
                                }
 
                                $values['assignedto'] = 'ignore';
@@ -1937,7 +1927,7 @@
 
                        $form_link = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uitts.view2',
+                               'menuaction'    => 'property.uitts.view2',
                                'id'            => $id
                        );
 
@@ -2043,7 +2033,7 @@
                                }
                        }
 
-                       
$GLOBALS['phpgw']->js->validate_file('dateformat','dateformat',$this->currentapp);
+                       
$GLOBALS['phpgw']->js->validate_file('dateformat','dateformat','property');
 
                        $data = array
                        (
@@ -2093,7 +2083,7 @@
                                'value_category_name'                   => 
$ticket['category_name'],
 
                                'form_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',$form_link),
-                               'done_action'                                   
=> 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>$this->currentapp.'.uitts.index2')),
+                               'done_action'                                   
=> 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>'property.uitts.index2')),
                                'value_subject'                                 
=> $ticket['subject'],
                                'lang_subject_statustext'               => 
lang('update subject'),
                                'value_id'                                      
        => '[ #'. $id . ' ] - ',
@@ -2129,7 +2119,7 @@
                        $appname                = lang('helpdesk');
                        $function_msg   = lang('view ticket detail');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view2' => $data));
                }
 
@@ -2141,13 +2131,13 @@
 
                        if(!$this->acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>1, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
                        }
 
                        $file_name      = 
urldecode(phpgw::get_var('file_name'));
                        $id             = phpgw::get_var('id', 'int');
 
-                       $file = $this->fakebase. SEP . 'fmticket' . SEP . $id . 
SEP . $file_name;
+                       $file = $this->fakebase. '/' . 'fmticket' . '/' . $id . 
'/' . $file_name;
 
                        if($this->bo->vfs->file_exists(array(
                                'string' => $file,

Modified: trunk/property/inc/class.uiwo_hour.inc.php
===================================================================
--- trunk/property/inc/class.uiwo_hour.inc.php  2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/class.uiwo_hour.inc.php  2008-02-02 13:52:39 UTC (rev 
18466)
@@ -61,7 +61,7 @@
                function property_uiwo_hour()
                {
                        $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->nextmatchs                       = 
CreateObject('phpgwapi.nextmatchs');
                        $this->create_html                      = 
CreateObject('phpgwapi.xslttemplates');
                        $this->account                          = 
$GLOBALS['phpgw_info']['user']['account_id'];
@@ -72,7 +72,6 @@
                        $this->bopricebook                      = 
CreateObject('property.bopricebook');
 
                        $this->bocommon                         = 
CreateObject('property.bocommon');
-                       $this->menu                             = 
CreateObject('property.menu');
                        $this->config                           = 
CreateObject('phpgwapi.config');
 
                        $this->config->read_repository();
@@ -84,16 +83,14 @@
                        $this->acl_edit                         = 
$this->acl->check('.project',4);
                        $this->acl_delete                       = 
$this->acl->check('.project',8);
 
-                       $this->start                            = 
$this->bo->start;
-                       $this->query                            = 
$this->bo->query;
+                       $this->start                            = 
$this->bopricebook->start;
+                       $this->query                            = 
$this->bopricebook->query;
                        $this->sort                             = 
$this->bo->sort;
                        $this->order                            = 
$this->bo->order;
                        $this->filter                           = 
$this->bo->filter;
                        $this->cat_id                           = 
$this->bo->cat_id;
                        $this->chapter_id                       = 
$this->bo->chapter_id;
-                       $this->allrows                          = 
$this->bo->allrows;
-
-                       $this->menu->sub                        ='project';
+                       $this->allrows                          = 
$this->bopricebook->allrows;
                }
 
                function save_sessiondata()
@@ -137,10 +134,10 @@
                                                'amount'                        
=> $entry['amount'],
                                                'descr'                         
=> $entry['descr'],
                                                'entry_date'                    
=> $entry_date,
-                                               'link_edit'                     
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiwo_hour.edit_deviation', 'workorder_id'=> $workorder_id, 
'hour_id'=> $hour_id, 'id'=> $entry['id'])),
+                                               'link_edit'                     
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiwo_hour.edit_deviation', 'workorder_id'=> $workorder_id, 
'hour_id'=> $hour_id, 'id'=> $entry['id'])),
                                                'lang_edit_statustext'          
=> lang('edit the deviation'),
                                                'text_edit'                     
=> lang('edit'),
-                                               'link_delete'                   
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiwo_hour.delete', 'workorder_id'=> $workorder_id, 
'hour_id'=> $hour_id, 'deviation_id'=> $entry['id'])),
+                                               'link_delete'                   
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiwo_hour.delete', 'workorder_id'=> $workorder_id, 'hour_id'=> 
$hour_id, 'deviation_id'=> $entry['id'])),
                                                'lang_delete_statustext'        
=> lang('delete the deviation'),
                                                'text_delete'                   
=> lang('delete'),
                                        );
@@ -161,7 +158,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiwo_hour.edit_deviation',
+                               'menuaction'    => 
'property.uiwo_hour.edit_deviation',
                                                'workorder_id'  => 
$workorder_id,
                                                'hour_id'       => $hour_id
                        );
@@ -176,13 +173,13 @@
                                'lang_add_statustext'                   => 
lang('add a deviation'),
                                'add_action'                            => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
                                'lang_done'                             => 
lang('done'),
-                               'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiwo_hour.index', 'workorder_id'=> $workorder_id))
+                               'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiwo_hour.index', 'workorder_id'=> $workorder_id))
                        );
 
                        $appname                        = lang('Workorder');
                        $function_msg                   = lang('list 
deviation');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_deviation' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -241,7 +238,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiwo_hour.edit_deviation',
+                               'menuaction'    => 
'property.uiwo_hour.edit_deviation',
                                'entity_id'     => $this->entity_id,
                                'cat_id'        => $this->cat_id,
                                'id'            => $id
@@ -262,7 +259,7 @@
                                'lang_hour_id'                                  
=> lang('Post'),
                                '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.'.uiwo_hour.deviation', 'workorder_id'=> $workorder_id, 
'hour_id'=> $hour_id)),
+                               'done_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiwo_hour.deviation', 'workorder_id'=> $workorder_id, 'hour_id'=> 
$hour_id)),
                                'lang_id'                                       
=> lang('deviation ID'),
                                'lang_descr'                                    
=> lang('Descr'),
                                'lang_save'                                     
=> lang('save'),
@@ -283,7 +280,7 @@
 
                        $appname                                                
= lang('workorder');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_deviation' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -295,8 +292,8 @@
 /*                     if 
(!$this->bocommon->check_perms($workorder['grants'],PHPGW_ACL_EDIT))
                        {
                                $receipt['error'][]=array('msg'=>lang('You have 
no edit right for this project'));
-                               
$GLOBALS['phpgw']->session->appsession('receipt',$this->currentapp,$receipt);
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiworkorder.view','id'=> $workorder_id));
+                               
$GLOBALS['phpgw']->session->appsession('receipt','property',$receipt);
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uiworkorder.view','id'=> $workorder_id));
                        }
 */
                        $hour_list = $this->bo->read($workorder_id);
@@ -362,8 +359,8 @@
                                                'result'                        
        => ($hour['deviation']+$hour['cost']),
                                                'wo_hour_category'              
        => $hour['wo_hour_category'],
                                                'cat_per_cent'                  
        => $hour['cat_per_cent'],
-                                               'link_deviation'                
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiwo_hour.deviation', 'workorder_id'=> $workorder_id, 
'hour_id'=> $hour['hour_id'])),
-                                               'link_edit'                     
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiwo_hour.edit','workorder_id'=> $workorder_id, 'hour_id'=> 
$hour['hour_id'])),
+                                               'link_deviation'                
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiwo_hour.deviation', 'workorder_id'=> $workorder_id, 'hour_id'=> 
$hour['hour_id'])),
+                                               'link_edit'                     
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiwo_hour.edit','workorder_id'=> $workorder_id, 'hour_id'=> 
$hour['hour_id'])),
                                                'lang_edit_statustext'          
        => lang('edit/customise this hour'),
                                                'lang_delete_statustext'        
        => lang('delete this hour'),
                                                'text_edit'                     
        => lang('edit'),
@@ -422,7 +419,7 @@
                        );
 
                        $workorder_data = array(
-                               'link_workorder'                        => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiworkorder.edit', 'id'=> $workorder_id)),
+                               'link_workorder'                        => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiworkorder.edit', 'id'=> $workorder_id)),
                                'lang_vendor_name'                      => 
lang('Vendor'),
                                'vendor_name'                           => 
$workorder['vendor_name'],
                                'vendor_email'                          => 
$workorder['vendor_email'],
@@ -431,7 +428,7 @@
                                'lang_workorder_id'                     => 
lang('Workorder ID'),
                                'workorder_id'                          => 
$workorder['workorder_id'],
                                'lang_project_id'                       => 
lang('Project ID'),
-                               'link_project'                          => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>$this->currentapp.'.uiproject.edit',
 'id'=> $workorder['project_id'])),
+                               'link_project'                          => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>'property.uiproject.edit',
 'id'=> $workorder['project_id'])),
                                'project_id'                            => 
$workorder['project_id'],
 
                                'lang_workorder_title'                  => 
lang('Workorder title'),
@@ -455,8 +452,7 @@
                function save_template()
                {
 
-                       $GLOBALS['phpgw']->xslttpl->add_file(array('wo_hour',
-                                                                               
'menu'));
+                       $GLOBALS['phpgw']->xslttpl->add_file(array('wo_hour'));
 
                        $values                 = phpgw::get_var('values');
                        $workorder_id   = phpgw::get_var('workorder_id', 'int');
@@ -470,7 +466,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiwo_hour.index',
+                               'menuaction'    => 'property.uiwo_hour.index',
                                'workorder_id'  => $workorder_id
                        );
 
@@ -480,7 +476,7 @@
                        (
                                'msgbox_data'                           => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
                                'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'add_action'                            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiwo_hour.save_template', 'workorder_id'=> $workorder_id)),
+                               'add_action'                            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiwo_hour.save_template', 'workorder_id'=> $workorder_id)),
 
                                'lang_done_statustext'                  => 
lang('Back to the workorder list'),
                                'lang_add_statustext'                   => 
lang('Adds this workorders calculation as a template for later use'),
@@ -506,7 +502,7 @@
                        $appname        = lang('Workorder');
                        $function_msg   = lang('Add template');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('add_template' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -515,15 +511,14 @@
                {
                        if(!$this->acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>1, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
                        }
 
-                       
$GLOBALS['phpgw']->xslttpl->add_file(array('wo_hour','menu'));
+                       $GLOBALS['phpgw']->xslttpl->add_file(array('wo_hour'));
 
                        $delete = phpgw::get_var('delete', 'bool');
                        $hour_id = phpgw::get_var('hour_id', 'int');
                        $workorder_id = phpgw::get_var('workorder_id', 'int');
-                       $links = $this->menu->links();
 
                        if($delete && $hour_id)
                        {
@@ -536,27 +531,27 @@
                        (
                                'lang_add_prizebook'                    => 
lang('Add from prizebook'),
                                'lang_add_prizebook_statustext'         => 
lang('add items from this vendors prizebook'),
-                               'add_prizebook_action'                  => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiwo_hour.prizebook', 'workorder_id'=> $workorder_id)),
+                               'add_prizebook_action'                  => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiwo_hour.prizebook', 'workorder_id'=> $workorder_id)),
 
                                'lang_add_template'                     => 
lang('Add from template'),
                                'lang_add_template_statustext'          => 
lang('add items from a predefined template'),
-                               'add_template_action'                   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uitemplate.index','lookup'=> true, 'workorder_id'=> 
$workorder_id)),
+                               'add_template_action'                   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uitemplate.index','lookup'=> true, 'workorder_id'=> $workorder_id)),
 
                                'lang_add_custom'                       => 
lang('Add custom'),
                                'lang_add_custom_statustext'            => 
lang('Add single custom line'),
-                               'add_custom_action'                     => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiwo_hour.edit', 'from'=> 'index', 'workorder_id'=> 
$workorder_id)),
+                               'add_custom_action'                     => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiwo_hour.edit', 'from'=> 'index', 'workorder_id'=> $workorder_id)),
 
                                'lang_save_template'                    => 
lang('Save as template'),
                                'lang_save_template_statustext'         => 
lang('Save this workorder as a template for later use'),
-                               'save_template_action'                  => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiwo_hour.save_template', 'from'=> 'index', 
'workorder_id'=> $workorder_id)),
+                               'save_template_action'                  => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiwo_hour.save_template', 'from'=> 'index', 'workorder_id'=> 
$workorder_id)),
 
                                'lang_print_view'                       => 
lang('Print view'),
                                'lang_print_view_statustext'            => 
lang('View the complete workorder'),
-                               'print_view_action'                     => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiwo_hour.view', 'from'=> 'index', 'workorder_id'=> 
$workorder_id)),
+                               'print_view_action'                     => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiwo_hour.view', 'from'=> 'index', 'workorder_id'=> $workorder_id)),
 
                                'lang_view_tender'                      => 
lang('View tender'),
                                'lang_view_tender_statustext'           => 
lang('View the complete workorder as a tender for bidding'),
-                               'view_tender_action'                    => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiwo_hour.tender', 'from'=>'index', 'workorder_id'=> 
$workorder_id)),
+                               'view_tender_action'                    => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiwo_hour.tender', 'from'=>'index', 'workorder_id'=> $workorder_id)),
 
                                'lang_show_cost'                        => 
lang('Show calculated cost'),
                                'lang_show_cost_statustext'             => 
lang('Show calculated cost on the printview'),
@@ -574,9 +569,8 @@
                        $data = array
                        (
                                'msgbox_data'                           => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'link_delete'                           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiwo_hour.index', 'delete'=>true, 'workorder_id'=> 
$workorder_id)),
+                               'link_delete'                           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiwo_hour.index', 'delete'=>true, 'workorder_id'=> $workorder_id)),
                                'function'                              => 
'index',
-                               'links'                                 => 
$links,
                                'num_records'                           => 
count($hours_list),
                                'total_hours_records'                   => 
$common_data['total_hours_records'],
                                'lang_total_records'                    => 
lang('Total records'),
@@ -592,7 +586,7 @@
                        $appname        = lang('Workorder');
                        $function_msg   = lang('list hours');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_hour' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
@@ -602,10 +596,10 @@
                {
                        if(!$this->acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>1, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
                        }
 
-                       
$GLOBALS['phpgw']->xslttpl->add_file(array('wo_hour','menu'));
+                       $GLOBALS['phpgw']->xslttpl->add_file(array('wo_hour'));
 
                        $show_cost              = phpgw::get_var('show_cost', 
'bool');
                        $show_details           = 
phpgw::get_var('show_details', 'bool');
@@ -691,14 +685,14 @@
                        (
                                'lang_done'                     => lang('Done'),
                                'lang_done_statustext'          => lang('Back 
to calculation'),
-                               'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiwo_hour.index', 'workorder_id'=> $workorder_id))
+                               'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiwo_hour.index', 'workorder_id'=> $workorder_id))
                        );
 
                        $dateformat                             = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
                        $date                                   = 
$GLOBALS['phpgw']->common->show_date(time(),$dateformat);
 
                        $from_name =    
$GLOBALS['phpgw_info']['user']['fullname'];
-                       $from_email =   
$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['email'];
+                       $from_email =   
$GLOBALS['phpgw_info']['user']['preferences']['property']['email'];
 
                        if($this->config->config_data['wo_status_sms'])
                        {               
@@ -738,7 +732,7 @@
                                'lang_from'                                     
=> lang('From'),
                                'from_name'                                     
=> $from_name,
                                'from_email'                                    
=> $from_email,
-                               'from_phone'                                    
=> 
$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['cellphone'],
+                               'from_phone'                                    
=> $GLOBALS['phpgw_info']['user']['preferences']['property']['cellphone'],
                                'lang_district'                                 
=> lang('District'),
                                'district'                                      
=> $project['location_data']['district_id'],
 
@@ -794,18 +788,14 @@
 
                        if($to_email)
                        {
-                               
$this->create_html->add_file(array(PHPGW_SERVER_ROOT . SEP . $this->currentapp 
. SEP . 'templates' . SEP . 'base' . SEP . 'wo_hour'));
-                               
$this->create_html->add_file(array(PHPGW_SERVER_ROOT . SEP . $this->currentapp 
. SEP . 'templates' . SEP . 'base' . SEP . 'location_view'));
+                               
$this->create_html->add_file(array(PHPGW_SERVER_ROOT . '/' . 'property' . '/' . 
'templates' . '/' . 'base' . '/' . 'wo_hour'));
+                               
$this->create_html->add_file(array(PHPGW_SERVER_ROOT . '/' . 'property' . '/' . 
'templates' . '/' . 'base' . '/' . 'location_view'));
 
                                
$this->create_html->set_var('phpgw',array('email_data' => $email_data));
 
                                $this->create_html->xsl_parse();
                                $this->create_html->xml_parse();
 
-                               $minor = explode(".",phpversion());
-
-                               if ($minor[0] == 5)
-                               {
                                        $xml = new DOMDocument;
                                        
$xml->loadXML($this->create_html->xmldata);
 
@@ -817,20 +807,12 @@
                                        $proc->importStyleSheet($xsl); // 
attach the xsl rules
 
                                        $html =  $proc->transformToXML($xml);
-                               }
-                               else
-                               {
-                                       $xsltproc = xslt_create();
-                                       $arguments = array('/_xml' => 
$this->create_html->xmldata, '/_xsl' => $this->create_html->xsldata);
-                                       $html = 
xslt_process($xsltproc,'arg:/_xml','arg:/_xsl',NULL,$arguments);
-                                       xslt_free($xsltproc);
-                               }
 
 //                             print $html;
 
                                $headers = "Return-Path: <". $from_email 
.">\r\n";
                                $headers .= "From: " . $from_name . "<" . 
$from_email .">\r\n";
-                               
if($GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['order_email_rcpt']==1)
+                               
if($GLOBALS['phpgw_info']['user']['preferences']['property']['order_email_rcpt']==1)
                                {
                                        $headers .= "Bcc: " . $from_name . "<" 
. $from_email .">\r\n";
                                        $bcc = $from_email;
@@ -888,7 +870,7 @@
                                'to_email'                                      
=> $to_email,
                                'email_list'                                    
=> $email_list,
                                'lang_select_email'                             
=> lang('Select email'),
-                               'send_order_action'                             
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiwo_hour.view', 'send'=>true, 'workorder_id'=> 
$workorder_id, 'show_details'=> $show_details)),
+                               'send_order_action'                             
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiwo_hour.view', 'send'=>true, 'workorder_id'=> $workorder_id, 
'show_details'=> $show_details)),
 
                                'lang_no_history'                               
=> lang('No history'),
                                'lang_history'                                  
=> lang('History'),
@@ -905,7 +887,7 @@
                        $appname                = lang('Workorder');
                        $function_msg           = lang('Send order');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
 
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
@@ -923,7 +905,7 @@
                        $pdf                                    = 
CreateObject('phpgwapi.pdf');
                        if(!$this->acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>1, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
                        }
                        $show_cost = phpgw::get_var('show_cost', 'bool');
                        $mark_draft = phpgw::get_var('mark_draft', 'bool');
@@ -1046,11 +1028,10 @@
                {
                        if(!$this->acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>1, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
                        }
 
                        $GLOBALS['phpgw']->xslttpl->add_file(array('wo_hour',
-                                                                               
'menu',
                                                                                
'nextmatchs',
                                                                                
'search_field'));
 
@@ -1072,8 +1053,6 @@
                                
$receipt=$this->bo->add_hour($values,$workorder_id);
                        }
 
-                       $links = $this->menu->links();
-
                        $common_data=$this->common_data($workorder_id);
 
                        $workorder      = $common_data['workorder'];
@@ -1116,7 +1095,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'num',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction' => 
$this->currentapp.'.uiwo_hour.prizebook',
+                                                                               
        'extra' => array('menuaction' => 'property.uiwo_hour.prizebook',
                                                                                
                                                        'workorder_id'  
=>$workorder_id,
                                                                                
                                                        'allrows'       
=>$this->allrows)
                                                                                
)),
@@ -1139,7 +1118,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   =>      'total_cost',
                                                                                
        'order' =>      $this->order,
-                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uiwo_hour.prizebook',
+                                                                               
        'extra'         => array('menuaction'   => 
'property.uiwo_hour.prizebook',
                                                                                
                                                        'workorder_id'  
=>$workorder_id,
                                                                                
                                                        'allrows'       
=>$this->allrows)
                                                                                
)),
@@ -1152,12 +1131,12 @@
                        (
                                'lang_done'                             => 
lang('Done'),
                                'lang_done_statustext'  => lang('Back to list'),
-                               'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiwo_hour.index', 'workorder_id'=> $workorder_id))
+                               'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiwo_hour.index', 'workorder_id'=> $workorder_id))
                        );
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiwo_hour.prizebook',
+                               'menuaction'    => 
'property.uiwo_hour.prizebook',
                                                'sort'          =>$this->sort,
                                                'order'         =>$this->order,
                                                'workorder_id'  =>$workorder_id,
@@ -1167,7 +1146,7 @@
 
                        $link_data_nextmatch = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiwo_hour.prizebook',
+                               'menuaction'    => 
'property.uiwo_hour.prizebook',
                                                'sort'          =>$this->sort,
                                                'order'         =>$this->order,
                                                'workorder_id'  =>$workorder_id,
@@ -1176,7 +1155,7 @@
 
                        $link_data_delete = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiwo_hour.prizebook',
+                               'menuaction'    => 
'property.uiwo_hour.prizebook',
                                                'sort'          =>$this->sort,
                                                'order'         =>$this->order,
                                                'workorder_id'  =>$workorder_id,
@@ -1206,7 +1185,6 @@
                                'lang_add'                              => 
lang('Add'),
                                'link_delete'                           => 
$GLOBALS['phpgw']->link('/index.php',$link_data_delete),
                                'function'                              => 
'prizebook',
-                               'links'                                 => 
$links,
                                'allrows'                               => 
$this->allrows,
                                'allow_allrows'                         => true,
                                'start_record'                          => 
$this->start,
@@ -1239,7 +1217,7 @@
                        $appname        = lang('pricebook');
                        $function_msg   = lang('list pricebook');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('prizebook' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
@@ -1250,11 +1228,10 @@
                {
                        if(!$this->acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>1, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
                        }
 
                        $GLOBALS['phpgw']->xslttpl->add_file(array('wo_hour',
-                                                                       'menu',
                                                                        
'nextmatchs',
                                                                        
'search_field'));
 
@@ -1278,8 +1255,6 @@
                                
$receipt=$this->bo->add_hour_from_template($values,$workorder_id);
                        }
 
-                       $links = $this->menu->links();
-
                        $common_data=$this->common_data($workorder_id);
 
                        $workorder      = $common_data['workorder'];
@@ -1352,7 +1327,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'billperae',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction' => 
$this->currentapp.'.uiwo_hour.template',
+                                                                               
        'extra' => array('menuaction' => 'property.uiwo_hour.template',
                                                                                
                                                        'workorder_id'  
=>$workorder_id,
                                                                                
                                                        'template_id'   
=>$template_id,
                                                                                
                                                        'query'                 
=>$this->query,
@@ -1364,7 +1339,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'building_part',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction' => 
$this->currentapp.'.uiwo_hour.template',
+                                                                               
        'extra' => array('menuaction' => 'property.uiwo_hour.template',
                                                                                
                                                        'workorder_id'  
=>$workorder_id,
                                                                                
                                                        'template_id'   
=>$template_id,
                                                                                
                                                        'query'                 
=>$this->query,
@@ -1378,12 +1353,12 @@
                        (
                                'lang_done'             => lang('Done'),
                                'lang_done_statustext'  => lang('Back to list'),
-                               'done_action'           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiwo_hour.index', 'workorder_id'=> $workorder_id))
+                               'done_action'           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiwo_hour.index', 'workorder_id'=> $workorder_id))
                        );
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiwo_hour.template',
+                               'menuaction'    => 
'property.uiwo_hour.template',
                                'sort'          => $this->sort,
                                'order'         => $this->order,
                                'workorder_id'  => $workorder_id,
@@ -1394,7 +1369,7 @@
 
                        $link_data_nextmatch = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiwo_hour.template',
+                               'menuaction'    => 
'property.uiwo_hour.template',
                                'sort'          => $this->sort,
                                'order'         => $this->order,
                                'workorder_id'  => $workorder_id,
@@ -1404,7 +1379,7 @@
 
                        $link_data_delete = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiwo_hour.template',
+                               'menuaction'    => 
'property.uiwo_hour.template',
                                'sort'          => $this->sort,
                                'order'         => $this->order,
                                'workorder_id'  => $workorder_id,
@@ -1426,13 +1401,13 @@
 
                        $msgbox_data = $this->bocommon->msgbox_data($receipt);
 
-                       
$GLOBALS['phpgw']->js->validate_file('core','check',$this->currentapp);
+                       
$GLOBALS['phpgw']->js->validate_file('core','check','property');
 
                        $data = array
                        (
                                'msgbox_data'                           => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
                                'lang_select_all'                       => 
lang('Select All'),
-                               'img_check'                             => 
$GLOBALS['phpgw']->common->get_image_path($this->currentapp).'/check.png',
+                               'img_check'                             => 
$GLOBALS['phpgw']->common->get_image_path('property').'/check.png',
 
                                'template_id'                           => 
$template_id,
                                'form_action'                           => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
@@ -1441,7 +1416,6 @@
                                'link_delete'                           => 
$GLOBALS['phpgw']->link('/index.php',$link_data_delete),
 
                                'function'                              => 
'template',
-                               'links'                                 => 
$links,
                                'allrows'                               => 
$this->allrows,
                                'allow_allrows'                         => true,
                                'start_record'                          => 
$this->start,
@@ -1478,7 +1452,7 @@
                        $appname                = lang('Template');
                        $function_msg           = lang('list template');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_template_hour' => 
$data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
@@ -1488,7 +1462,7 @@
                {
                        if(!$this->acl_edit)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>2, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>2, 'acl_location'=> $this->acl_location));
                        }
                        $from                   = phpgw::get_var('from');
                        $template_id            = phpgw::get_var('template_id', 
'int');
@@ -1543,7 +1517,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiwo_hour.edit',
+                               'menuaction'    => 'property.uiwo_hour.edit',
                                'activity_id'   => $activity_id,
                                'workorder_id'  => $workorder_id,
                                'template_id'   => $template_id,
@@ -1557,7 +1531,7 @@
                        (
                                '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.'.uiwo_hour.' . $from, 'workorder_id'=> $workorder_id, 
'template_id'=> $template_id)),
+                               'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 'property.uiwo_hour.' 
. $from, 'workorder_id'=> $workorder_id, 'template_id'=> $template_id)),
                                'lang_workorder'                        => 
lang('Workorder'),
                                'value_workorder_id'                    => 
$workorder['workorder_id'],
                                'value_workorder_title'                 => 
$workorder['title'],
@@ -1641,7 +1615,7 @@
                                'lang_building_part_statustext'         => 
lang('Select the building part for this activity.'),
 
 
-                               'ns3420_link'                           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilookup.ns3420')),
+                               'ns3420_link'                           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uilookup.ns3420')),
                                'lang_ns3420'                           => 
lang('NS3420'),
                                'value_ns3420_id'                       => 
$values['ns3420_id'],
                                'lang_ns3420_statustext'                => 
lang('Select a standard-code from the norwegian standard'),
@@ -1656,7 +1630,7 @@
 
                        $appname = lang('Workorder');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_hour' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -1665,7 +1639,7 @@
                {
                        if(!$this->acl_edit)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop', 'perm'=>2, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>2, 'acl_location'=> $this->acl_location));
                        }
                        $id             = phpgw::get_var('id', 'int');
                        $workorder_id   = phpgw::get_var('workorder_id', 'int');
@@ -1678,13 +1652,13 @@
                        {
                                $link_data = array
                                (
-                                       'menuaction' => 
$this->currentapp.'.uiwo_hour.deviation',
+                                       'menuaction' => 
'property.uiwo_hour.deviation',
                                        'workorder_id'=>$workorder_id,
                                        'hour_id'=>$hour_id
                                );
                                $delete_link_data = array
                                (
-                                       'menuaction' => 
$this->currentapp.'.uiwo_hour.delete',
+                                       'menuaction' => 
'property.uiwo_hour.delete',
                                        'workorder_id'=>$workorder_id,
                                        'hour_id'=>$hour_id,
                                        'deviation_id'=>$deviation_id
@@ -1696,11 +1670,11 @@
                        {
                                $link_data = array
                                (
-                                       'menuaction' => 
$this->currentapp.'.uiwo_hour.index'
+                                       'menuaction' => 
'property.uiwo_hour.index'
                                );
                                $delete_link_data = array
                                (
-                                       'menuaction' => 
$this->currentapp.'.uiwo_hour.delete',
+                                       'menuaction' => 
'property.uiwo_hour.delete',
                                        'id'=>$id
                                );
                                $function_msg   = lang('delete hour');
@@ -1734,7 +1708,7 @@
 
                        $appname = lang('workorder');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }

Modified: trunk/property/inc/class.uiworkorder.inc.php
===================================================================
--- trunk/property/inc/class.uiworkorder.inc.php        2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/inc/class.uiworkorder.inc.php        2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -58,13 +58,14 @@
                function property_uiworkorder()
                {
                        $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
'property::project::workorder';
+
+               //      $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->nextmatchs                       = 
CreateObject('phpgwapi.nextmatchs');
                        $this->account                          = 
$GLOBALS['phpgw_info']['user']['account_id'];
 
                        $this->bo                               = 
CreateObject('property.boworkorder',True);
                        $this->bocommon                         = 
CreateObject('property.bocommon');
-                       $this->menu                             = 
CreateObject('property.menu');
                        $this->acl                              = 
CreateObject('phpgwapi.acl');
                        $this->acl_location                     = '.project';
                        $this->acl_read                         = 
$this->acl->check('.project',1);
@@ -85,8 +86,6 @@
                        $this->end_date                         = 
$this->bo->end_date;
                        $this->b_group                          = 
$this->bo->b_group;
                        $this->paid                             = 
$this->bo->paid;                      
-
-                       $this->menu->sub                        ='project';
                }
 
                function save_sessiondata()
@@ -124,16 +123,13 @@
                {
                        if(!$this->acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop','perm'=>1, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop','perm'=>1, 'acl_location'=> $this->acl_location));
                        }
 
                        
$GLOBALS['phpgw']->xslttpl->add_file(array('workorder','values','table_header',
-                                                                               
'menu',
                                                                                
'nextmatchs'));
                        $lookup = ''; //Fix this
 
-                       $links = $this->menu->links('workorder');
-
                        $start_date     = urldecode($this->start_date);
                        $end_date       = urldecode($this->end_date);
                        $workorder_list = 
$this->bo->read($start_date,$end_date);
@@ -141,6 +137,7 @@
                        $uicols = $this->bo->uicols;
                        $count_uicols_name=count($uicols['name']);
 
+                       $content = array();
                        $j=0;
                        if (isSet($workorder_list) AND 
is_array($workorder_list))
                        {
@@ -154,7 +151,7 @@
                                                        {
                                                                
$content[$j]['row'][$k]['statustext']                   = lang('search');
                                                                
$content[$j]['row'][$k]['text']                         = 
$workorder_entry[$uicols['name'][$k]];
-                                                               
$content[$j]['row'][$k]['link']                         = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiworkorder.index','query'=> 
$workorder_entry['query_location'][$uicols['name'][$k]],'lookup'=> $lookup, 
'filter'=> $this->filter));
+                                                               
$content[$j]['row'][$k]['link']                         = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiworkorder.index','query'=> 
$workorder_entry['query_location'][$uicols['name'][$k]],'lookup'=> $lookup, 
'filter'=> $this->filter));
                                                        }
                                                        else
                                                        {
@@ -169,7 +166,7 @@
                                                        }
                                                }
                                                if($lookup && 
$k==($count_uicols_name - 2))
-                                               
$content[$j]['row'][$k]['lookup_action']                                = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiworkorder.edit', 'workorder_id'=> 
$workorder_entry['workorder_id']));
+                                               
$content[$j]['row'][$k]['lookup_action']                                = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiworkorder.edit', 'workorder_id'=> 
$workorder_entry['workorder_id']));
                                        }
                                        if(!$lookup)
                                        {
@@ -178,7 +175,7 @@
                                                {
                                                        
$content[$j]['row'][$k]['statustext']                           = lang('view 
the workorder');
                                                        
$content[$j]['row'][$k]['text']                                 = lang('view');
-                                                       
$content[$j]['row'][$k]['link']                                 = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiworkorder.view','id'=> $workorder_entry['workorder_id']));
+                                                       
$content[$j]['row'][$k]['link']                                 = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiworkorder.view','id'=> $workorder_entry['workorder_id']));
                                                        $k++;
                                                }
                                                else
@@ -190,12 +187,12 @@
                                                {
                                                        
$content[$j]['row'][$k]['statustext']                           = lang('edit 
the workorder');
                                                        
$content[$j]['row'][$k]['text']                                 = lang('edit');
-                                                       
$content[$j]['row'][$k]['link']                                 = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiworkorder.edit', 'id' => 
$workorder_entry['workorder_id']));
+                                                       
$content[$j]['row'][$k]['link']                                 = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiworkorder.edit', 'id' => $workorder_entry['workorder_id']));
                                                        $k++;
 
                                                        
$content[$j]['row'][$k]['statustext']                           = 
lang('calculate the workorder');
                                                        
$content[$j]['row'][$k]['text']                                 = 
lang('calculate');
-                                                       
$content[$j]['row'][$k]['link']                                 = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>$this->currentapp.'.uiwo_hour.index',
 'workorder_id'=> $workorder_entry['workorder_id']));
+                                                       
$content[$j]['row'][$k]['link']                                 = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>'property.uiwo_hour.index',
 'workorder_id'=> $workorder_entry['workorder_id']));
                                                        $k++;
                                                }
                                                else
@@ -208,7 +205,7 @@
                                                {
                                                        
$content[$j]['row'][$k]['statustext']                           = lang('delete 
the workorder');
                                                        
$content[$j]['row'][$k]['text']                                 = 
lang('delete');
-                                                       
$content[$j]['row'][$k]['link']                                 = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiworkorder.delete', 'id'=> 
$workorder_entry['workorder_id']));
+                                                       
$content[$j]['row'][$k]['link']                                 = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiworkorder.delete', 'id'=> $workorder_entry['workorder_id']));
                                                        $k++;
                                                }
                                                else
@@ -236,7 +233,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   =>      'fm_location1.loc1',
                                                                                
        'order' =>      $this->order,
-                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uiworkorder.index',
+                                                                               
        'extra'         => array('menuaction'   => 'property.uiworkorder.index',
                                                                                
                                                //      'type_id'       
=>$type_id,
                                                                                
                                                        'query'         
=>$this->query,
                                                                                
                                                        'lookup'        
=>$lookup,
@@ -259,7 +256,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   =>      'project_id',
                                                                                
        'order' =>      $this->order,
-                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uiworkorder.index',
+                                                                               
        'extra'         => array('menuaction'   => 'property.uiworkorder.index',
                                                                                
                                        //              'type_id'       
=>$type_id,
                                                                                
                                                        'query'         
=>$this->query,
                                                                                
                                                        'lookup'        
=>$lookup,
@@ -282,7 +279,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   =>      'workorder_id',
                                                                                
        'order' =>      $this->order,
-                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uiworkorder.index',
+                                                                               
        'extra'         => array('menuaction'   => 'property.uiworkorder.index',
                                                                                
                                        //              'type_id'       
=>$type_id,
                                                                                
                                                        'query'         
=>$this->query,
                                                                                
                                                        'lookup'        
=>$lookup,
@@ -305,7 +302,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   =>      'address',
                                                                                
        'order' =>      $this->order,
-                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uiworkorder.index',
+                                                                               
        'extra'         => array('menuaction'   => 'property.uiworkorder.index',
                                                                                
                                        //              'type_id'       
=>$type_id,
                                                                                
                                                        'query'         
=>$this->query,
                                                                                
                                                        'lookup'        
=>$lookup,
@@ -367,13 +364,13 @@
                                (
                                        'lang_add'                      => 
lang('add'),
                                        'lang_add_statustext'           => 
lang('add a workorder'),
-                                       'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiworkorder.add'))
+                                       'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiworkorder.add'))
                                );
                        }
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiworkorder.index',
+                               'menuaction'    => 'property.uiworkorder.index',
                                                'sort'                  => 
$this->sort,
                                                'order'                 => 
$this->order,
                                                'cat_id'                => 
$this->cat_id,
@@ -389,11 +386,11 @@
                                                'paid'                  => 
$this->paid
                        );
 
-                       $link_date_search                               = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiproject.date_search'));
+                       $link_date_search                               = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiproject.date_search'));
 
                        $link_excel = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiworkorder.excel',
+                               'menuaction'    => 'property.uiworkorder.excel',
                                                'sort'                  => 
$this->sort,
                                                'order'                 => 
$this->order,
                                                'cat_id'                => 
$this->cat_id,
@@ -411,7 +408,7 @@
                        );
 
 
-                       
if(isset($GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['group_filters'])
 && 
$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['group_filters'])
+                       
if(isset($GLOBALS['phpgw_info']['user']['preferences']['property']['group_filters'])
 && $GLOBALS['phpgw_info']['user']['preferences']['property']['group_filters'])
                        {
                                $group_filters = 'select';
                                
$GLOBALS['phpgw']->xslttpl->add_file(array('wo_hour_cat_select'));
@@ -422,11 +419,11 @@
                                
$GLOBALS['phpgw']->xslttpl->add_file(array('wo_hour_cat_filter'));
                        }
 
-                       
$GLOBALS['phpgw']->js->validate_file('overlib','overlib',$this->currentapp);
+                       
$GLOBALS['phpgw']->js->validate_file('overlib','overlib','property');
 
                        $data = array
                        (
-                               'group_filters'                                 
=> 
isset($GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['group_filters'])?$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['group_filters']:'',
+                               'group_filters'                                 
=> 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['group_filters'])?$GLOBALS['phpgw_info']['user']['preferences']['property']['group_filters']:'',
                                'lang_excel'                                    
=> 'excel',
                                'link_excel'                                    
=> $GLOBALS['phpgw']->link('/index.php',$link_excel),
                                'lang_excel_help'                               
=> lang('Download table to MS Excel'),
@@ -438,9 +435,8 @@
                                'lang_date_search_help'                 => 
lang('Narrow the search by dates'),
                                'link_date_search'                              
=> $link_date_search,
 
-                               'link_history'                                  
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiworkorder.index')),
+                               'link_history'                                  
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiworkorder.index')),
                                'lang_history_statustext'               => 
lang('search for history at this location'),
-                               'links'                                         
        => $links,
                                'allow_allrows'                                 
=> false,
                                'start_record'                                  
=> $this->start,
                                'record_limit'                                  
=> $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'],
@@ -483,7 +479,7 @@
                        $appname                        = lang('Workorder');
                        $function_msg           = lang('list workorder');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_workorder' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                        $this->save_sessiondata();
@@ -493,7 +489,7 @@
                {
                        if(!$this->acl_add && !$this->acl_edit)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop','perm'=>2, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop','perm'=>2, 'acl_location'=> $this->acl_location));
                        }
                        $boproject                      = 
CreateObject('property.boproject');
                        $bolocation                     = 
CreateObject('property.bolocation');
@@ -559,7 +555,7 @@
                                        if ($values['approval'] && 
$values['mail_address'])
                                        {
                                                
$coordinator_name=$GLOBALS['phpgw_info']['user']['fullname'];
-                                               
$coordinator_email=$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['email'];
+                                               
$coordinator_email=$GLOBALS['phpgw_info']['user']['preferences']['property']['email'];
                                                $headers = "Return-Path: <". 
$coordinator_email .">\r\n";
                                                $headers .= "From: " . 
$coordinator_name . "<" . $coordinator_email .">\r\n";
                                                $headers .= "Bcc: " . 
$coordinator_name . "<" . $coordinator_email .">\r\n";
@@ -568,7 +564,7 @@
 
                                                $subject = lang(Approval).": ". 
$values['workorder_id'];
                                        //      $message = lang('Workorder %1 
needs approval',$values['workorder_id']);
-                                               $message = '<a href ="http://' 
. $GLOBALS['phpgw_info']['server']['hostname'] . 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiworkorder.edit', 'id'=> $values['project_id'])).'">' . 
lang('Workorder %1 needs approval',$values['workorder_id']) .'</a>';
+                                               $message = '<a href ="http://' 
. $GLOBALS['phpgw_info']['server']['hostname'] . 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiworkorder.edit', 'id'=> $values['project_id'])).'">' . 
lang('Workorder %1 needs approval',$values['workorder_id']) .'</a>';
 
                                                if 
(isset($GLOBALS['phpgw_info']['server']['smtp_server']) && 
$GLOBALS['phpgw_info']['server']['smtp_server'])
                                                {
@@ -619,18 +615,18 @@
                                if 
(!$this->bocommon->check_perms($project['grants'],PHPGW_ACL_EDIT))
                                {
                                        
$receipt['error'][]=array('msg'=>lang('You have no edit right for this 
project'));
-                                       
$GLOBALS['phpgw']->session->appsession('receipt',$this->currentapp,$receipt);
-                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiworkorder.view', 'id'=>$id));
+                                       
$GLOBALS['phpgw']->session->appsession('receipt','property',$receipt);
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uiworkorder.view', 'id'=>$id));
                                }
                                if (isset($receipt['notice_owner']) AND 
is_array($receipt['notice_owner']))
                                {
                                        
if($this->account!=$project['coordinator'] && 
$config->config_data['workorder_approval'])
                                        {
-                                               $prefs_coordinator = 
$this->bocommon->create_preferences($this->currentapp,$project['coordinator']);
+                                               $prefs_coordinator = 
$this->bocommon->create_preferences('property',$project['coordinator']);
                                                $to = 
$prefs_coordinator['email'];
                                                
$from_name=$GLOBALS['phpgw_info']['user']['fullname'];
-                                               
$from_email=$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['email'];
-                                               $body = '<a href ="http://' . 
$GLOBALS['phpgw_info']['server']['hostname'] . 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiworkorder.edit','id'=> $id)).'">' . lang('workorder %1 
has been edited',$id) .'</a>' . "\n";
+                                               
$from_email=$GLOBALS['phpgw_info']['user']['preferences']['property']['email'];
+                                               $body = '<a href ="http://' . 
$GLOBALS['phpgw_info']['server']['hostname'] . 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiworkorder.edit','id'=> $id)).'">' . lang('workorder %1 has been 
edited',$id) .'</a>' . "\n";
                                                
foreach($receipt['notice_owner'] as $notice)
                                                {
                                                        $body .= $notice . "\n";
@@ -766,7 +762,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiworkorder.edit',
+                               'menuaction'    => 'property.uiworkorder.edit',
                                'id'            => $id
                        );
 
@@ -780,10 +776,10 @@
                        $dateformat= (implode($sep,$dlarr));
 
 
-                       if ( 
isset($GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['approval_from'])
-                               && 
$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['approval_from']
 )
+                       if ( 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['approval_from'])
+                               && 
$GLOBALS['phpgw_info']['user']['preferences']['property']['approval_from'] )
                        {
-                               $supervisor_id = 
$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['approval_from'];
+                               $supervisor_id = 
$GLOBALS['phpgw_info']['user']['preferences']['property']['approval_from'];
                        }
                        else
                        {
@@ -794,7 +790,7 @@
 
                        if ($supervisor_id && ($need_approval=='yes'))
                        {
-                               $prefs = 
$this->bocommon->create_preferences($this->currentapp,$supervisor_id);
+                               $prefs = 
$this->bocommon->create_preferences('property',$supervisor_id);
                                $supervisor_email = $prefs['email'];
                        }
                        else
@@ -802,7 +798,7 @@
                                $supervisor_email = '';
                        }
 
-                       
$project_status=(isset($GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['project_status'])?$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['project_status']:'');
+                       
$project_status=(isset($GLOBALS['phpgw_info']['user']['preferences']['property']['project_status'])?$GLOBALS['phpgw_info']['user']['preferences']['property']['project_status']:'');
                        if(!$values['status'])
                        {
                                $values['status']=$project_status;
@@ -838,19 +834,19 @@
                                'lang_extra'                                    
=> lang('Extra'),
 
                                'msgbox_data'                           => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'calculate_action'                      => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiwo_hour.index')),
+                               'calculate_action'                      => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiwo_hour.index')),
                                'lang_calculate'                        => 
lang('Calculate Workorder'),
                                'lang_calculate_statustext'             => 
lang('Calculate workorder by adding items from vendors prizebook or adding 
general hours'),
 
-                               'send_action'                           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>$this->currentapp.'.uiwo_hour.view',
 'from'=>'index')),
+                               'send_action'                           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>'property.uiwo_hour.view',
 'from'=>'index')),
                                'lang_send'                             => 
lang('Send Workorder'),
                                'lang_send_statustext'                  => 
lang('send this workorder to vendor'),
 
-                               'project_link'                          => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiproject.edit')),
+                               'project_link'                          => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiproject.edit')),
                                'b_account_data'                        => 
$b_account_data,
                                'table_header_workorder_budget'         => 
$table_header_workorder_budget,
                                'lang_no_workorders'                    => 
lang('No workorder budget'),
-                               'workorder_link'                        => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiworkorder.w_edit')),
+                               'workorder_link'                        => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiworkorder.w_edit')),
                                'record_history'                        => 
$record_history,
                                'table_header_history'                  => 
$table_header_history,
                                'lang_history'                          => 
lang('History'),
@@ -904,7 +900,7 @@
                                'location_data'                         => 
$location_data,
                                'location_type'                         => 
'view',
                                'form_action'                           => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiworkorder.index')),
+                               'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiworkorder.index')),
                                'lang_year'                             => 
lang('Year'),
                                'lang_category'                         => 
lang('category'),
                                'lang_save'                             => 
lang('save'),
@@ -984,7 +980,7 @@
 
                        $appname                                                
= lang('Workorder');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
 
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
@@ -994,23 +990,22 @@
                {
                        if(!$this->acl_edit)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop','perm'=>2, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop','perm'=>2, 'acl_location'=> $this->acl_location));
                        }
 
                        $link_data = array
                        (
-                               'menuaction' => 
$this->currentapp.'.uiworkorder.index'
+                               'menuaction' => 'property.uiworkorder.index'
                        );
 
                        $GLOBALS['phpgw']->xslttpl->add_file(array('workorder',
-                                                                               
'menu',
                                                                                
'search_field'));
 
                        $data = array
                        (
                                'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiproject.edit')),
-                               'search_action'                 => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiproject.index', 'lookup'=> true, 'from'=> 'workorder')),
+                               'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiproject.edit')),
+                               'search_action'                 => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiproject.index', 'lookup'=> true, 'from'=> 'workorder')),
 
                                'lang_done_statustext'          => lang('Back 
to the workorder list'),
                                'lang_add_statustext'           => lang('Adds a 
new project - then a new workorder'),
@@ -1024,7 +1019,7 @@
                        $appname                                = 
lang('Workorder');
                        $function_msg                           = lang('Add 
workorder');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        $GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('add' 
=> $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -1033,14 +1028,14 @@
                {
                        if(!$this->acl_delete)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop','perm'=>8, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.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.'.uiworkorder.index'
+                               'menuaction' => 'property.uiworkorder.index'
                        );
 
                        if (phpgw::get_var('confirm', 'bool', 'POST'))
@@ -1054,7 +1049,7 @@
                        $data = array
                        (
                                'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiworkorder.delete', 'id'=> $id)),
+                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiworkorder.delete', 'id'=> $id)),
                                'lang_confirm_msg'              => lang('do you 
really want to delete this entry'),
                                'lang_yes'                      => lang('yes'),
                                'lang_yes_statustext'           => lang('Delete 
the entry'),
@@ -1065,7 +1060,7 @@
                        $appname                                = 
lang('workorder');
                        $function_msg                           = lang('delete 
workorder');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -1074,14 +1069,14 @@
                {
                        if(!$this->acl_read)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uilocation.stop','perm'=>1, 'acl_location'=> 
$this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop','perm'=>1, 'acl_location'=> $this->acl_location));
                        }
 
                        $boproject                      = 
CreateObject('property.boproject');
                        $bolocation                     = 
CreateObject('property.bolocation');
 
-                       $receipt = 
$GLOBALS['phpgw']->session->appsession('receipt',$this->currentapp);
-                       
$GLOBALS['phpgw']->session->appsession('receipt',$this->currentapp,'');
+                       $receipt = 
$GLOBALS['phpgw']->session->appsession('receipt','property');
+                       
$GLOBALS['phpgw']->session->appsession('receipt','property','');
 
                        $id     = phpgw::get_var('id', 'int');
 
@@ -1132,10 +1127,10 @@
 
                        $data = array
                        (
-                               'project_link'                          => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiproject.view')),
+                               'project_link'                          => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiproject.view')),
                                'table_header_workorder_budget'         => 
$table_header_workorder_budget,
                                'lang_no_workorders'                    => 
lang('No workorder budget'),
-                               'workorder_link'                        => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiworkorder.view')),
+                               'workorder_link'                        => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiworkorder.view')),
                                'record_history'                        => 
$record_history,
                                'table_header_history'                  => 
$table_header_history,
                                'lang_history'                          => 
lang('History'),
@@ -1180,7 +1175,7 @@
 
                                'location_data'                         => 
$location_data,
                                'location_type'                         => 
'view',
-                               'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiworkorder.index')),
+                               'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiworkorder.index')),
                                'lang_year'                             => 
lang('Year'),
                                'lang_category'                         => 
lang('category'),
                                'lang_save'                             => 
lang('save'),
@@ -1225,7 +1220,7 @@
                                'key_deliver_list'                      => 
$this->bo->select_key_location_list($values['key_deliver']),
                                'lang_key_deliver'                      => 
lang('key deliver location'),
 
-                               'edit_action'                           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction' => 
$this->currentapp.'.uiworkorder.edit', 'id' => $id)),
+                               'edit_action'                           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction' => 
'property.uiworkorder.edit', 'id' => $id)),
                                'lang_edit_statustext'                  => 
lang('Edit this entry workorder'),
                                'lang_edit'                             => 
lang('Edit'),
                                'currency'                              => 
$GLOBALS['phpgw_info']['user']['preferences']['common']['currency'],
@@ -1240,7 +1235,7 @@
 
                        $appname                                        = 
lang('Workorder');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }

Modified: trunk/property/inc/cron/export_info_as_files.php
===================================================================
--- trunk/property/inc/cron/export_info_as_files.php    2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/inc/cron/export_info_as_files.php    2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -38,7 +38,7 @@
 
                function export_info_as_files()
                {
-                       $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->bocommon                 = 
CreateObject('property.bocommon');
                        $this->db                       = & 
$GLOBALS['phpgw']->db;
                        $this->db2                              = 
clone($this->db);
@@ -84,7 +84,7 @@
                {
                        $link_data = array
                        (
-                               'menuaction' => 
$this->currentapp.'.custom_functions.index',
+                               'menuaction' => 
'property.custom_functions.index',
                                'function'      =>$this->function_name,
                                'execute'       => $execute,
                        );
@@ -119,7 +119,7 @@
 
                        $appname                = lang('location');
                        $function_msg   = lang('Export info as files');
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('confirm' => $data));
                        $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -271,7 +271,7 @@
                
                function export_as_excel($name,$descr,$filename, $sql)
                {
-                       $workbook       = 
CreateObject('phpgwapi.excel',$this->saveto . SEP . $filename . '.xls');
+                       $workbook       = CreateObject('phpgwapi.excel', 
"{$this->saveto}/{$filename}.xls");
 
                        $worksheet1 =& $workbook->add_worksheet('First One');
 
@@ -302,7 +302,7 @@
                function export_as_csv($name,$descr,$filename, $sql)
                {
 
-                       $fp = fopen($this->saveto . SEP . $filename . 
'.txt','wb');
+                       $fp = fopen("{$this->saveto}/{$filename}.txt",'wb');
                        
                    $descr[] = 'Dato';
                    fputcsv($fp, $descr, ';');
@@ -351,7 +351,7 @@
                        }
 
                        $xml = var2xml('PHPGW',$xmldata);
-                       $fp = fopen($this->saveto . SEP . $filename . 
'.xml','wb');
+                       $fp = fopen("{$this->saveto}/{$filename}.xml",'wb');
                        fwrite($fp,$xml);
                        fclose($fp);
                }

Modified: trunk/property/inc/cron/forward_mail_as_sms.php
===================================================================
--- trunk/property/inc/cron/forward_mail_as_sms.php     2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/inc/cron/forward_mail_as_sms.php     2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -23,7 +23,7 @@
 
                function forward_mail_as_sms()
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->bocommon         = 
CreateObject('property.bocommon');
                        $this->db                       = & 
$GLOBALS['phpgw']->db;
                }
@@ -63,7 +63,7 @@
                {
                        $link_data = array
                        (
-                               'menuaction' => 
$this->currentapp.'.custom_functions.index',
+                               'menuaction' => 
'property.custom_functions.index',
                                'function'      => $this->function_name,
                                'execute'       => $execute,
                        );
@@ -96,7 +96,7 @@
 
                        $appname                = lang('Async service');
                        $function_msg   = 'Forward email as SMS';
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('confirm' => $data));
                        $GLOBALS['phpgw']->xslttpl->pp();
                }

Modified: trunk/property/inc/cron/import_files.php
===================================================================
--- trunk/property/inc/cron/import_files.php    2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/cron/import_files.php    2008-02-02 13:52:39 UTC (rev 
18466)
@@ -38,7 +38,7 @@
 
                function import_files()
                {
-                       $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->bocommon                 = 
CreateObject('property.bocommon');
                        $this->db                       = & 
$GLOBALS['phpgw']->db;
                        $this->db2                              = 
clone($this->db);
@@ -84,7 +84,7 @@
                {
                        $link_data = array
                        (
-                               'menuaction' => 
$this->currentapp.'.custom_functions.index',
+                               'menuaction' => 
'property.custom_functions.index',
                                'function'      =>$this->function_name,
                                'execute'       => $execute,
                        );
@@ -119,7 +119,7 @@
 
                        $appname                = lang('location');
                        $function_msg   = lang('Export info as files');
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('confirm' => $data));
                        $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -157,7 +157,7 @@
                        $data = CreateObject('phpgwapi.excelreader');
                        
                        $data->setOutputEncoding('CP1251');
-                       $data->read(PHPGW_API_INC . SEP . 'excelreader' . SEP . 
'test' . SEP . $filename);
+                       $data->read(PHPGW_API_INC . 
"/excelreader/test/{$filename}");
 
                        for ($i = 1; $i <= $data->sheets[0]['numRows']; $i++) 
                        {

Modified: trunk/property/inc/cron/import_from_scanner.php
===================================================================
--- trunk/property/inc/cron/import_from_scanner.php     2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/inc/cron/import_from_scanner.php     2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -52,7 +52,7 @@
 
                function import_from_scanner()
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->bocommon         = 
CreateObject('property.bocommon');
                        $this->vfs                      = 
CreateObject('phpgwapi.vfs');
                        $this->rootdir          = $this->vfs->basedir;
@@ -113,7 +113,7 @@
                {
                        $link_data = array
                        (
-                               'menuaction' => 
$this->currentapp.'.custom_functions.index',
+                               'menuaction' => 
'property.custom_functions.index',
                                'function'      => $this->function_name,
                                'execute'       => $execute,
                                'dir'           => $this->dir,
@@ -154,7 +154,7 @@
 
                        $appname                = 'import from scanner';
                        $function_msg   = 'import files from 
scanner-drop-catalog';
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('confirm' => $data));
                        $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -186,7 +186,7 @@
                                                        {
                                                                
$this->bolocation->initiate_ui_location(array('type_id' => -1,'tenant'  => 
True));
 
-                                                               $insert_record 
= $GLOBALS['phpgw']->session->appsession('insert_record',$this->currentapp);
+                                                               $insert_record 
= $GLOBALS['phpgw']->session->appsession('insert_record','property');
 
                                                                $values = 
$this->bolocation->read_single($values['location_code'],array('tenant_id'=>'lookup'));
                                                                for ($i=0; 
$i<count($insert_record['location']); $i++)
@@ -224,7 +224,7 @@
                                                                {
                                                                        
$this->bolocation->initiate_ui_location(array('type_id' => -1,'tenant'  => 
True));
 
-                                                                       
$insert_record = 
$GLOBALS['phpgw']->session->appsession('insert_record',$this->currentapp);
+                                                                       
$insert_record = 
$GLOBALS['phpgw']->session->appsession('insert_record','property');
 
                                                                        $values 
= 
$this->bolocation->read_single($values['location_code'],array('tenant_id'=>'lookup'));
                                                                        for 
($i=0; $i<count($insert_record['location']); $i++)
@@ -237,10 +237,10 @@
 
                                                                        
$values['details']              = $file_entry['descr'];
                                                                        
$values['subject']              = $file_entry['descr'];
-                                                                       
$values['assignedto']   = 
(isset($GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['assigntodefault'])?$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['assigntodefault']:'');
                                                          
-                                                                       
$values['group_id']             = 
(isset($GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['groupdefault'])?$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['groupdefault']:'');
-                                                                       
$values['cat_id']               = 
(isset($GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['tts_category'])?$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['tts_category']:'');
-                                                                       
$values['priority']             = 
(isset($GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['prioritydefault'])?$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['prioritydefault']:'');
                                                          
+                                                                       
$values['assignedto']   = 
(isset($GLOBALS['phpgw_info']['user']['preferences']['property']['assigntodefault'])?$GLOBALS['phpgw_info']['user']['preferences']['property']['assigntodefault']:'');
                                                                
+                                                                       
$values['group_id']             = 
(isset($GLOBALS['phpgw_info']['user']['preferences']['property']['groupdefault'])?$GLOBALS['phpgw_info']['user']['preferences']['property']['groupdefault']:'');
+                                                                       
$values['cat_id']               = 
(isset($GLOBALS['phpgw_info']['user']['preferences']['property']['tts_category'])?$GLOBALS['phpgw_info']['user']['preferences']['property']['tts_category']:'');
+                                                                       
$values['priority']             = 
(isset($GLOBALS['phpgw_info']['user']['preferences']['property']['prioritydefault'])?$GLOBALS['phpgw_info']['user']['preferences']['property']['prioritydefault']:'');
                                                                
 
                                                                        
$receipt = $this->botts->add($values);
                                                                        
$this->add_file_to_ticket($receipt['id'],$file_entry['file_name']);
@@ -254,7 +254,7 @@
                                        
                                                if($this->mail_receipt)
                                                {                       
-                                                       $prefs = 
$this->bocommon->create_preferences($this->currentapp,$file_entry['user_id']);
+                                                       $prefs = 
$this->bocommon->create_preferences('property',$file_entry['user_id']);
                                                        if 
(strlen($prefs['email'])> (strlen($members[$i]['account_name'])+1))
                                                        {
                                                                $subject = 
'Resultat fra scanner';
@@ -272,8 +272,8 @@
                                                        }
                                                }
 
-                                               unlink($this->dir . SEP . 
$file_entry['file_name'] . $this->suffix);
-                                               unlink($this->dir . SEP . 
$file_entry['file_name'] . $this->meta_suffix);
+                                               
unlink("{$this->dir}/{$file_entry['file_name']}{$this->suffix}");
+                                               
unlink("{$this->dir}/{$file_entry['file_name']}{$this->meta_suffix}");
                                                                                
                
                                                $msgbox_data = 
$this->bocommon->msgbox_data($this->receipt);
 
@@ -307,7 +307,7 @@
                        $myfilearray = array();
                        while ($file = @readdir($dir_handle))
                        {
-                               if ((strtolower(substr($file, -3, 3)) == 
$this->meta_suffix) && is_file($this->dir . SEP . $file) )
+                               if ((strtolower(substr($file, -3, 3)) == 
$this->meta_suffix) && is_file("{$this->dir}/{$file}") )
                                {
                                        $myfilearray[] = $file;
                                }
@@ -321,7 +321,7 @@
                                $fname = $myfilearray[$i];
                                $file_list[$i]['file_name'] = substr($fname,0, 
strlen($fname)-strlen($this->meta_suffix));
 
-                               $fp = fopen($this->dir . SEP . $fname,'rb');
+                               $fp = fopen("{$this->dir}/{$fname}", 'rb');
 
                                $row = 1;
                                while ($data = 
fgetcsv($fp,8000,$this->delimiter))
@@ -348,7 +348,7 @@
 
                function add_file_to_ticket($id,$file_name)
                {
-                               $to_file = $this->fakebase. SEP . 'fmticket' . 
SEP . $id . SEP . $file_name . $this->suffix;
+                               $to_file = 
"{$this->fakebase}/fmticket/{$id}/{$file_name}{$this->suffix}";
        
                                if($this->botts->vfs->file_exists(array(
                                        'string' => $to_file,
@@ -363,7 +363,7 @@
                                        $this->botts->vfs->override_acl = 1;
 
                                        if(!$this->botts->vfs->cp (array (
-                                               'from'  => $this->dir . SEP . 
$file_name . $this->suffix,
+                                               'from'  => $this->dir . '/' . 
$file_name . $this->suffix,
                                                'to'    => $to_file,
                                                'relatives'     => array 
(RELATIVE_NONE|VFS_REAL, RELATIVE_ALL))))
                                        {
@@ -435,24 +435,24 @@
                function create_loc1_dir($loc1='')
                {
                        if(!$this->vfs->file_exists(array(
-                                       'string' => $this->fakebase . SEP . 
'document' . SEP . $loc1,
+                                       'string' => $this->fakebase . '/' . 
'document' . '/' . $loc1,
                                        'relatives' => Array(RELATIVE_NONE)
                                )))
                        {
                                $this->vfs->override_acl = 1;
 
                                if(!$this->vfs->mkdir (array(
-                                    'string' => $this->fakebase. SEP . 
'document' . SEP . $loc1,
+                                    'string' => $this->fakebase. '/' . 
'document' . '/' . $loc1,
                                     'relatives' => array(
                                          RELATIVE_NONE
                                     )
                                )))
                                {
-                                       
$this->receipt['error'][]=array('msg'=>lang('failed to create directory') . ' 
:'. $this->fakebase. SEP . 'document' . SEP . $loc1);
+                                       
$this->receipt['error'][]=array('msg'=>lang('failed to create directory') . ' 
:'. $this->fakebase. '/' . 'document' . '/' . $loc1);
                                }
                                else
                                {
-                                       
$this->receipt['message'][]=array('msg'=>lang('directory created') . ' :'. 
$this->fakebase. SEP . 'document' . SEP . $loc1);
+                                       
$this->receipt['message'][]=array('msg'=>lang('directory created') . ' :'. 
$this->fakebase. '/' . 'document' . '/' . $loc1);
                                }
                                $this->vfs->override_acl = 0;
                        }
@@ -460,8 +460,8 @@
 
                function copy_files($values)
                {
-                       $to_file = $this->fakebase . SEP . 'document' . SEP . 
$values['loc1'] . SEP . $values['file_name'] . $this->suffix;
-                       $from_file = $this->dir . SEP . $values['file_name'] . 
$this->suffix;
+                       $to_file = $this->fakebase . '/' . 'document' . '/' . 
$values['loc1'] . '/' . $values['file_name'] . $this->suffix;
+                       $from_file = $this->dir . '/' . $values['file_name'] . 
$this->suffix;
                        $this->vfs->override_acl = 1;
 
                        if($this->vfs->file_exists(array(

Modified: trunk/property/inc/cron/lag_lang_filer.php
===================================================================
--- trunk/property/inc/cron/lag_lang_filer.php  2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/cron/lag_lang_filer.php  2008-02-02 13:52:39 UTC (rev 
18466)
@@ -38,7 +38,7 @@
 
                function lag_lang_filer()
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->bocommon         = 
CreateObject('property.bocommon');
                        $this->db               = $this->bocommon->new_db();
                }
@@ -70,7 +70,7 @@
                {
                        $link_data = array
                        (
-                               'menuaction' => 
$this->currentapp.'.custom_functions.index',
+                               'menuaction' => 
'property.custom_functions.index',
                                'function'      =>$this->function_name,
                                'execute'       => $execute,
                        );
@@ -99,7 +99,7 @@
 
                        $appname                = lang('location');
                        $function_msg   = 'lag_lang_filer';
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('confirm' => $data));
                        $GLOBALS['phpgw']->xslttpl->pp();
                }

Modified: trunk/property/inc/cron/oppdater_antall_leieobjekt.php
===================================================================
--- trunk/property/inc/cron/oppdater_antall_leieobjekt.php      2008-02-02 
11:18:25 UTC (rev 18465)
+++ trunk/property/inc/cron/oppdater_antall_leieobjekt.php      2008-02-02 
13:52:39 UTC (rev 18466)
@@ -38,7 +38,7 @@
 
                function oppdater_antall_leieobjekt()
                {
-                       $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->bocommon                 = 
CreateObject('property.bocommon');
                        $this->db                       = & 
$GLOBALS['phpgw']->db;
                        $this->db2                              = 
clone($this->db);
@@ -73,7 +73,7 @@
                {
                        $link_data = array
                        (
-                               'menuaction' => 
$this->currentapp.'.custom_functions.index',
+                               'menuaction' => 
'property.custom_functions.index',
                                'function'      =>$this->function_name,
                                'execute'       => $execute,
                        );
@@ -108,7 +108,7 @@
 
                        $appname                = lang('location');
                        $function_msg   = 'Oppdater antall leieobjekter for 
tv-anlegg';
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('confirm' => $data));
                        $GLOBALS['phpgw']->xslttpl->pp();
                }

Modified: trunk/property/inc/cron/oppdater_namssakstatus_pr_leietaker.php
===================================================================
--- trunk/property/inc/cron/oppdater_namssakstatus_pr_leietaker.php     
2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/property/inc/cron/oppdater_namssakstatus_pr_leietaker.php     
2008-02-02 13:52:39 UTC (rev 18466)
@@ -38,7 +38,7 @@
 
                function oppdater_namssakstatus_pr_leietaker()
                {
-                       $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->bocommon                 = 
CreateObject('property.bocommon');
                        $this->db                       = & 
$GLOBALS['phpgw']->db;
                        $this->db2                              = 
clone($this->db);
@@ -97,7 +97,7 @@
                {
                        $link_data = array
                        (
-                               'menuaction' => 
$this->currentapp.'.custom_functions.index',
+                               'menuaction' => 
'property.custom_functions.index',
                                'function'      =>$this->function_name,
                                'execute'       => $execute,
                        );
@@ -132,7 +132,7 @@
 
                        $appname                = lang('location');
                        $function_msg   = 'Oppdatere namssaksstatus pr 
leietater';
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('confirm' => $data));
                        $GLOBALS['phpgw']->xslttpl->pp();
                }

Modified: trunk/property/inc/cron/oppdater_utgaatt_objekt.php
===================================================================
--- trunk/property/inc/cron/oppdater_utgaatt_objekt.php 2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/inc/cron/oppdater_utgaatt_objekt.php 2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -38,7 +38,7 @@
 
                function oppdater_utgaatt_objekt()
                {
-                       $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->bocommon                 = 
CreateObject('property.bocommon');
                        $this->db                       = & 
$GLOBALS['phpgw']->db;
                        $this->db2                              = 
clone($this->db);
@@ -78,7 +78,7 @@
                {
                        $link_data = array
                        (
-                               'menuaction' => 
$this->currentapp.'.custom_functions.index',
+                               'menuaction' => 
'property.custom_functions.index',
                                'function'      =>$this->function_name,
                                'execute'       => $execute,
                        );
@@ -113,7 +113,7 @@
 
                        $appname                = lang('location');
                        $function_msg   = lang('Update the not active category 
for locations');
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('confirm' => $data));
                        $GLOBALS['phpgw']->xslttpl->pp();
                }

Modified: trunk/property/inc/cron/organize_drawing.php
===================================================================
--- trunk/property/inc/cron/organize_drawing.php        2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/inc/cron/organize_drawing.php        2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -46,7 +46,7 @@
 
                function organize_drawing()
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->bocommon         = 
CreateObject('property.bocommon');
                        $this->vfs              = CreateObject('phpgwapi.vfs');
                        $this->rootdir          = $this->vfs->basedir;
@@ -105,7 +105,7 @@
                {
                        $link_data = array
                        (
-                               'menuaction' => 
$this->currentapp.'.custom_functions.index',
+                               'menuaction' => 
'property.custom_functions.index',
                                'function'      => $this->function_name,
                                'execute'       => $execute,
                                'dir'           => $this->dir,
@@ -147,7 +147,7 @@
 
                        $appname                = 'Organisere tegninger';
                        $function_msg   = 'Organisere tegninger i register og 
pa disk';
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('confirm' => $data));
                        $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -226,7 +226,7 @@
                        $i=0; $myfilearray = '';
                        while ($file = @readdir($dir_handle))
                        {
-                               if ((strtolower(substr($file, -3, 3)) == 
$this->suffix) && is_file($this->dir . SEP . $file) )
+                               if ((strtolower(substr($file, -3, 3)) == 
$this->suffix) && is_file($this->dir . '/' . $file) )
                                {
                                        $myfilearray[$i] = $file;
                                        $i++;
@@ -331,24 +331,24 @@
                function create_loc1_dir($loc1='')
                {
                        if(!$this->vfs->file_exists(array(
-                                       'string' => $this->fakebase . SEP . 
'document' . SEP . $loc1,
+                                       'string' => $this->fakebase . '/' . 
'document' . '/' . $loc1,
                                        'relatives' => Array(RELATIVE_NONE)
                                )))
                        {
                                $this->vfs->override_acl = 1;
 
                                if(!$this->vfs->mkdir (array(
-                                    'string' => $this->fakebase. SEP . 
'document' . SEP . $loc1,
+                                    'string' => $this->fakebase. '/' . 
'document' . '/' . $loc1,
                                     'relatives' => array(
                                          RELATIVE_NONE
                                     )
                                )))
                                {
-                                       
$this->receipt['error'][]=array('msg'=>lang('failed to create directory') . ' 
:'. $this->fakebase. SEP . 'document' . SEP . $loc1);
+                                       
$this->receipt['error'][]=array('msg'=>lang('failed to create directory') . ' 
:'. $this->fakebase. '/' . 'document' . '/' . $loc1);
                                }
                                else
                                {
-                                       
$this->receipt['message'][]=array('msg'=>lang('directory created') . ' :'. 
$this->fakebase. SEP . 'document' . SEP . $loc1);
+                                       
$this->receipt['message'][]=array('msg'=>lang('directory created') . ' :'. 
$this->fakebase. '/' . 'document' . '/' . $loc1);
                                }
                                $this->vfs->override_acl = 0;
                        }
@@ -358,8 +358,8 @@
 
                function copy_files($values)
                {
-                       $to_file = $this->fakebase . SEP . 'document' . SEP . 
$values['loc1'] . SEP . $values['file_name'];
-                       $from_file = $this->dir . SEP . $values['file_name'];
+                       $to_file = $this->fakebase . '/' . 'document' . '/' . 
$values['loc1'] . '/' . $values['file_name'];
+                       $from_file = $this->dir . '/' . $values['file_name'];
                        $this->vfs->override_acl = 1;
 
 

Modified: trunk/property/inc/cron/synkroniser_med_boei.php
===================================================================
--- trunk/property/inc/cron/synkroniser_med_boei.php    2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/inc/cron/synkroniser_med_boei.php    2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -38,7 +38,7 @@
 
                function synkroniser_med_boei()
                {
-                       $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->bocommon                 = 
CreateObject('property.bocommon');
                        $this->db                       = & 
$GLOBALS['phpgw']->db;
                        $this->join                             = 
$this->db->join;
@@ -98,7 +98,7 @@
                {
                        $link_data = array
                        (
-                               'menuaction' => 
$this->currentapp.'.custom_functions.index',
+                               'menuaction' => 
'property.custom_functions.index',
                                'function'      =>$this->function_name,
                                'execute'       => $execute,
                        );
@@ -133,7 +133,7 @@
 
                        $appname                = lang('location');
                        $function_msg   = 'synkroniser med BOEI';
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('confirm' => $data));
                        $GLOBALS['phpgw']->xslttpl->pp();
                }
@@ -167,6 +167,8 @@
                        $this->cron_log($receipt,$cron);
                        $receipt = $this->slett_feil_telefon();
                        $this->cron_log($receipt,$cron);
+                       $receipt = $this->update_tenant_name();
+                       $this->cron_log($receipt,$cron);
 
                        if(!$cron)
                        {
@@ -609,8 +611,8 @@
                        {
                                $leietaker_utf[]= array (
                                 'id'                           => 
$this->db_boei->f('leietaker_id'),
-                                'first_name'           => 
$this->bocommon->ascii2utf($this->db_boei->f('fornavn')),
-                                'last_name'            => 
$this->bocommon->ascii2utf($this->db_boei->f('etternavn')),
+                                'first_name'           => 
$this->db->db_addslashes($this->bocommon->ascii2utf($this->db_boei->f('fornavn'))),
+                                'last_name'            => 
$this->db->db_addslashes($this->bocommon->ascii2utf($this->db_boei->f('etternavn'))),
                                 'category'                     => 
$this->db_boei->f('kjonn_juridisk') + 1,
                                 'status_eco'           => 
$this->db_boei->f('namssakstatusokonomi_id'),
                                 'status_drift'         => 
$this->db_boei->f('namssakstatusdrift_id'),
@@ -619,8 +621,8 @@
                                 );
                                $leietaker_latin[]= array (
                                 'id'                           => 
$this->db_boei->f('leietaker_id'),
-                                'first_name'           => 
$this->db_boei->f('fornavn'),
-                                'last_name'            => 
$this->db_boei->f('etternavn'),
+                                'first_name'           => 
$this->db->db_addslashes($this->db_boei->f('fornavn')),
+                                'last_name'            => 
$this->db->db_addslashes($this->db_boei->f('etternavn')),
                                 'category'                     => 
$this->db_boei->f('kjonn_juridisk') + 1,
                                 'status_eco'           => 
$this->db_boei->f('namssakstatusokonomi_id'),
                                 'status_drift'         => 
$this->db_boei->f('namssakstatusdrift_id'),
@@ -659,16 +661,47 @@
 
                }
 
+               function update_tenant_name()
+               {
+                       $sql = " SELECT leietaker_id, fornavn, etternavn FROM 
v_Leietaker";
+                       $this->db_boei->query($sql,__LINE__,__FILE__);
+
+                       $i=0;
+                       while ($this->db_boei->next_record())
+                       {
+                               $sql2_utf = " UPDATE  fm_tenant SET "
+                               . " first_name          = '" . 
$this->db->db_addslashes($this->bocommon->ascii2utf($this->db_boei->f('fornavn')))
 . "',"
+                               . " last_name           = '" . 
$this->db->db_addslashes($this->bocommon->ascii2utf($this->db_boei->f('etternavn')))
 ."'"
+                               . " WHERE  id = " . 
(int)$this->db_boei->f('leietaker_id');
+
+                               $sql2_latin = " UPDATE  fm_tenant SET "
+                               . " first_name          = '" . 
$this->db->db_addslashes($this->db_boei->f('fornavn')) . "',"
+                               . " last_name           = '" . 
$this->db->db_addslashes($this->db_boei->f('etternavn')) ."'"
+                               . " WHERE  id = " . 
(int)$this->db_boei->f('leietaker_id');
+
+                               $this->db->query($sql2_latin,__LINE__,__FILE__);
+                               
$this->db_boei2->query($sql2_latin,__LINE__,__FILE__);
+                               $i++;
+                       }
+
+                       $msg = $i . ' Leietakere er oppdatert';
+                       $this->receipt['message'][]=array('msg'=> $msg);
+                       return $msg;
+               }
+
+
                function oppdater_leieobjekt()
                {                       
-                       $sql = " SELECT TOP 100 PERCENT 
objekt_id,leie_id,leietaker_id, boareal, formaal_id, gateadresse_id, gatenr, 
etasje,driftsstatus_id, flyttenr"
-                               . " FROM  v_Leieobjekt"; // WHERE 
v_Leieobjekt.formaal_id NOT IN (99)";
+                       $sql = " SELECT TOP 100 PERCENT 
v_Leieobjekt.objekt_id,v_Leieobjekt.leie_id,v_Leieobjekt.leietaker_id, boareal, 
formaal_id, gateadresse_id, gatenr, etasje,driftsstatus_id, 
v_Leieobjekt.flyttenr, innflyttetdato"
+                               . " FROM  v_Leieobjekt JOIN v_reskontro ON 
v_Leieobjekt.objekt_id=v_reskontro.objekt_id AND 
v_Leieobjekt.leie_id=v_reskontro.leie_id"
+                               . " AND 
v_Leieobjekt.flyttenr=v_reskontro.flyttenr AND 
v_Leieobjekt.leietaker_id=v_reskontro.leietaker_id";
 
                        $this->db_boei->query($sql,__LINE__,__FILE__);
 
                //      $this->db->transaction_begin();
                //      $this->db_boei2->transaction_begin();
 
+
                        $i=0;
                        while ($this->db_boei->next_record())
                        {
@@ -680,7 +713,8 @@
                                . " street_number = '" . 
$this->bocommon->ascii2utf($this->db_boei->f('gatenr')) . "',"
                                . " driftsstatus_id = '" . 
$this->db_boei->f('driftsstatus_id') . "',"
                                . " boareal = '" . $this->db_boei->f('boareal') 
. "',"
-                               . " flyttenr = '" . 
$this->db_boei->f('flyttenr') . "'"
+                               . " flyttenr = '" . 
$this->db_boei->f('flyttenr') . "',"
+                               . " innflyttetdato = '" . 
date($this->bocommon->dateformat,strtotime($this->db_boei->f('innflyttetdato')))
 . "'"
                                . " WHERE  loc1 = '" . 
$this->db_boei->f('objekt_id') . "'  AND  loc4= '" . 
$this->db_boei->f('leie_id') . "'";
                                $sql2_latin = " UPDATE  fm_location4 SET "
                                . " tenant_id = '" . 
$this->db_boei->f('leietaker_id') . "',"
@@ -690,7 +724,8 @@
                                . " street_number = '" . 
$this->db_boei->f('gatenr') . "',"
                                . " driftsstatus_id = '" . 
$this->db_boei->f('driftsstatus_id') . "',"
                                . " boareal = '" . $this->db_boei->f('boareal') 
. "',"
-                               . " flyttenr = '" . 
$this->db_boei->f('flyttenr') . "'"
+                               . " flyttenr = '" . 
$this->db_boei->f('flyttenr') . "',"
+                               . " innflyttetdato = '" . 
date($this->bocommon->dateformat,strtotime($this->db_boei->f('innflyttetdato')))
 . "'"
                                . " WHERE  loc1 = '" . 
$this->db_boei->f('objekt_id') . "'  AND  loc4= '" . 
$this->db_boei->f('leie_id') . "'";
 
                                $this->db->query($sql2_latin,__LINE__,__FILE__);

Modified: trunk/property/inc/cron/update_googlemap.php
===================================================================
--- trunk/property/inc/cron/update_googlemap.php        2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/inc/cron/update_googlemap.php        2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -24,7 +24,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage custom
-       * @version $Id: update_googlemap.php,v 1.9 2007/09/27 13:03:56 sigurdne 
Exp $
+       * @version $Id: update_googlemap.php 690 2008-02-02 10:11:33Z dave $
        */
 
        /**
@@ -38,7 +38,7 @@
 
                function update_googlemap()
                {
-                       $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp               = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->bocommon                 = 
CreateObject('property.bocommon');
                        $this->db                       = & 
$GLOBALS['phpgw']->db;
                        $this->db2                              = 
clone($this->db);
@@ -74,7 +74,7 @@
                {
                        $link_data = array
                        (
-                               'menuaction' => 
$this->currentapp.'.custom_functions.index',
+                               'menuaction' => 
'property.custom_functions.index',
                                'function'      =>$this->function_name,
                                'execute'       => $execute,
                        );
@@ -107,7 +107,7 @@
 
                        $appname                = lang('location');
                        $function_msg   = lang('Export info as files');
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('confirm' => $data));
                        $GLOBALS['phpgw']->xslttpl->pp();
                }

Modified: trunk/property/inc/cron/update_phpgw.php
===================================================================
--- trunk/property/inc/cron/update_phpgw.php    2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/cron/update_phpgw.php    2008-02-02 13:52:39 UTC (rev 
18466)
@@ -23,7 +23,7 @@
 
                function update_phpgw()
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->bocommon         = 
CreateObject('property.bocommon');
                        $this->db                       = & 
$GLOBALS['phpgw']->db;
                }
@@ -57,7 +57,7 @@
                {
                        $link_data = array
                        (
-                               'menuaction' => 
$this->currentapp.'.custom_functions.index',
+                               'menuaction' => 
'property.custom_functions.index',
                                'function'      => $this->function_name,
                                'execute'       => $execute,
                        );
@@ -90,7 +90,7 @@
 
                        $appname                = lang('Async service');
                        $function_msg   = 'Forward email as SMS';
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('confirm' => $data));
                        $GLOBALS['phpgw']->xslttpl->pp();
                }

Modified: trunk/property/inc/custom/hent_maaler_nr_til_besikt_rapport.php
===================================================================
--- trunk/property/inc/custom/hent_maaler_nr_til_besikt_rapport.php     
2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/property/inc/custom/hent_maaler_nr_til_besikt_rapport.php     
2008-02-02 13:52:39 UTC (rev 18466)
@@ -8,7 +8,7 @@
                
                $this->db = $this->bocommon->new_db();
                
-               //$this->currentapp     = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //'property'    = $GLOBALS['phpgw_info']['flags']['currentapp'];
                
                $sql = "SELECT ext_meter_id as maaler_nr FROM fm_entity_1_11 
WHERE location_code='" . $values['location_code'] . "'";
                $this->db->query($sql,__LINE__,__FILE__);
@@ -41,7 +41,7 @@
                                        case 'maaler_nr':
                                                if($entry['value'] && 
($entry['value'] != $maaler_nr))
                                                {
-                                                       $this->soproject = 
CreateObject($this->currentapp.'.soproject');
+                                                       $this->soproject = 
CreateObject('property.soproject');
                                                        if 
($values['street_name'])
                                                        {
                                                                $address = 
$this->db->db_addslashes($values['street_name'] . ' ' 
.$values['street_number']);
@@ -70,7 +70,7 @@
                                                                $attrib_id = 8;
                                                                if($new_value 
!= $old_value)
                                                                {
-                                                                       
$historylog     = CreateObject($this->currentapp.'.historylog','entity_1_11');
+                                                                       
$historylog     = CreateObject('property.historylog','entity_1_11');
                                                                        
$historylog->add('SO',$id,$new_value,False, $attrib_id,$besiktet_dato);
                                                                        
$this->db->query("UPDATE fm_entity_1_11 set maaler_stand = '$new_value' WHERE 
ext_meter_id = '$maaler_nr' AND location_code ='" . $values['location_code']. 
"'",__LINE__,__FILE__);                                                         
    
                                                                }

Added: trunk/property/inc/custom/innflyttetdato_entity_2_11_BBB.php
===================================================================
--- trunk/property/inc/custom/innflyttetdato_entity_2_11_BBB.php                
                (rev 0)
+++ trunk/property/inc/custom/innflyttetdato_entity_2_11_BBB.php        
2008-02-02 13:52:39 UTC (rev 18466)
@@ -0,0 +1,31 @@
+<?php
+
+//_debug_array($values);
+//_debug_array($values_attribute);
+//_debug_array($action);
+
+               // this routine will only work with the exact configuration of 
Bergen Bolig og Byfornyelse - but can serve as an example
+               
+               $db = $this->bocommon->new_db();
+
+               $sql = "SELECT innflyttet FROM fm_entity_2_11 WHERE 
location_code ='" . $values['location_code'] . "'";
+               $db->query($sql,__LINE__,__FILE__);
+               $db->next_record();
+               $innflyttetdato_old = $db->f('innflyttet');
+
+               $sql = "SELECT innflyttetdato, tenant_id FROM fm_location4 
WHERE location_code ='" . $values['location_code'] . "'";
+               $db->query($sql,__LINE__,__FILE__);
+               $db->next_record();
+               $innflyttetdato = $db->f('innflyttetdato');
+               $tenant_id = $db->f('tenant_id');
+
+               if($tenant_id == $values['extra']['tenant_id'] && 
!$innflyttetdato_old)
+               {
+                       $value_set['innflyttet']        = $innflyttetdato;
+                       $value_set      = 
$this->bocommon->validate_db_update($value_set);
+                       $db->transaction_begin();
+                       $db->query("UPDATE fm_entity_2_11 set $value_set WHERE 
id=" . $values['id'],__LINE__,__FILE__);
+                       $db->transaction_commit();
+               }                       
+
+

Modified: trunk/property/inc/export/Agresso
===================================================================
--- trunk/property/inc/export/Agresso   2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/property/inc/export/Agresso   2008-02-02 13:52:39 UTC (rev 18466)
@@ -452,7 +452,7 @@
                        {               
                                $fil_katalog = 
$this->config->config_data['export_path'];                       
                        
-                               if(unlink ($fil_katalog. SEP . $Filnavn))
+                               if(unlink ($fil_katalog. '/' . $Filnavn))
                                {
                                        $this->db->transaction_commit();
                                        $receipt['message'][]= array('msg' => 
$antall . ' ' . lang('bilag/underbilag rullet tilbake'));
@@ -791,7 +791,7 @@
                                                $oRsOverfBilag['dima'] = 9999;
                                        }
                                        
-                                       $Konto          = 
sprintf("%-8s",$oRsOverfBilag['spbudact_code']);// verdi: Art, type: c8, plass: 
21 - 28
+                                       $Konto          = 
sprintf("%08s",$oRsOverfBilag['spbudact_code']);// verdi: Art, type: c8, plass: 
21 - 28
                                        $Dim_1          = 
sprintf("%8s",$oRsOverfBilag['district_id']);// verdi: Ansvarssted, type: c8, 
plass: 29 - 36
                                        $Dim_2          = 
sprintf("%-8s",$oRsOverfBilag['kostra_id']);// verdi: Tjeneste, type: c8, 
plass: 37 - 44
                                        

Modified: trunk/property/inc/export/Ecolink
===================================================================
--- trunk/property/inc/export/Ecolink   2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/property/inc/export/Ecolink   2008-02-02 13:52:39 UTC (rev 18466)
@@ -366,7 +366,7 @@
                        {               
                                $fil_katalog = 
$this->config->config_data['export_path'];                       
                        
-                               if(unlink ($fil_katalog. SEP . $Filnavn))
+                               if(unlink ($fil_katalog. '/' . $Filnavn))
                                {
                                        $this->db->transaction_commit();
                                        $receipt['message'][]= array('msg' => 
$antall . ' ' . lang('bilag/underbilag rullet tilbake'));

Modified: trunk/property/inc/hook_admin.inc.php
===================================================================
--- trunk/property/inc/hook_admin.inc.php       2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/hook_admin.inc.php       2008-02-02 13:52:39 UTC (rev 
18466)
@@ -44,15 +44,15 @@
                                'Tenant Claim Categories'       => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uicategory.index', 'type' => 'tenant_claim') ),
                                'Tenant Categories'                     => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uicategory.index', 'type' => 'tenant') ),
                                'Tenant Global Categories'      => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.uicategories.index', 'appname' => 'fm_tenant', 'global_cats' => 'True') 
),
-                               'Tenant Attributes'                     => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uiactor.list_attribute', 'role' => 'tenant') ),
+                               'Tenant Attributes'                     => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.ui_custom.list_attribute', 'appname' => $appname, 'location' 
=>'.tenant')),
                                'Tenant'                                        
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uiactor.index', 'role' => 'tenant') ),
                                'Owner'                                         
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uiactor.index', 'role' => 'owner') ),
                                'Owner Categories'                      => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uicategory.index', 'type' => 'owner') ),
-                               'Owner Attributes'                      => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uiactor.list_attribute', 'role' => 'owner') ),
+                               'Owner Attributes'                      => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.ui_custom.list_attribute', 'appname' => $appname, 'location' 
=>'.owner')),
                                'Vendor'                                        
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uiactor.index', 'role' => 'vendor') ),
                                'Vendor Categories'                     => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uicategory.index', 'type' => 'vendor') ),
                                'Vendor Global Categories'      => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.uicategories.index', 'appname' => 'fm_vendor', 'global_cats' => 'True') 
),
-                               'Vendor Attributes'                     => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uiactor.list_attribute', 'role' => 'vendor') ),
+                               'Vendor Attributes'                     => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.ui_custom.list_attribute', 'appname' => $appname, 'location' 
=>'.vendor')),
                                'Document Categories'           => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uicategory.index', 'type' => 'document') ),
                                'Building Part'                         => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uistandard_2.index', 'type' => 'building_part') ),
                                'Tender chapter'                        => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uicategory.index', 'type' => 'tender_chapter') ),
@@ -63,13 +63,13 @@
                                'Request condition_type'        => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uicategory.index', 'type' => 'r_condition_type') ),
                                'Workorders status'                     => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uistandard_2.index', 'type' => 'workorder_status') ),
                                'Agreement status'                      => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uistandard_2.index', 'type' => 'agreement_status') ),
-                               'Agreement Attributes'          => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uiagreement.list_attribute') ),
+                               'Agreement Attributes'          => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.ui_custom.list_attribute', 'appname' => $appname, 'location' 
=>'.agreement')),
                                'service agreement categories'  => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uicategory.index', 'type' => 's_agreement') ),
-                               'service agreement Attributes'  => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uis_agreement.list_attribute') ),
-                               'service agreement item Attributes'     => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uis_agreement.list_attribute', 'role' => 'detail') ),
+                               'service agreement Attributes'          => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.ui_custom.list_attribute', 'appname' => $appname, 'location' 
=>'.s_agreement')),
+                               'service agreement item Attributes'             
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.ui_custom.list_attribute', 'appname' => $appname, 'location' 
=>'.s_agreement.detail')),
                                'rental agreement categories'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uicategory.index', 'type' => 'r_agreement') ),
-                               'rental agreement Attributes'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uir_agreement.list_attribute') ),
-                               'rental agreement item Attributes'      => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uir_agreement.list_attribute', 'role' => 'detail') ),
+                               'rental agreement Attributes'           => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.ui_custom.list_attribute', 'appname' => $appname, 'location' 
=>'.r_agreement')),
+                               'rental agreement item Attributes'              
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.ui_custom.list_attribute', 'appname' => $appname, 'location' 
=>'.r_agreement.detail')),
                                'Document Status'                       => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uistandard_2.index', 'type' => 'document_status') ),
                                'Unit'                                          
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uistandard_2.index', 'type' => 'unit') ),
                                'Key location'                          => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uistandard_3.index', 'type' => 'key_location') ),
@@ -89,6 +89,5 @@
                                'Admin custom functions'        => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uiadmin_custom.index') ),
        );
        $GLOBALS['phpgw']->common->display_mainscreen($appname,$file);
-
                }
 ?>

Modified: trunk/property/inc/hook_settings.inc.php
===================================================================
--- trunk/property/inc/hook_settings.inc.php    2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/inc/hook_settings.inc.php    2008-02-02 13:52:39 UTC (rev 
18466)
@@ -198,4 +198,7 @@
        }
 
        create_select_box('Default vendor 
type','default_vendor_category',$_categories_vendor,'which agreement');
+       create_input_box('With of textarea','textareacols','With of textarea in 
forms');
+       create_input_box('Height of textarea','textarearows','Height of 
textarea in forms');
+       
 

Modified: trunk/property/inc/hook_sidebox_menu.inc.php
===================================================================
--- trunk/property/inc/hook_sidebox_menu.inc.php        2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/inc/hook_sidebox_menu.inc.php        2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -8,6 +8,7 @@
                {
                        display_sidebox($appname,$menu['menu_title_2'] . ' ' . 
lang ('sub menu'),$menu['sub_menu'],$use_lang = false);  
                }
+
                if(isset($menu['menu_title_3']) && $menu['menu_title_3'])
                {
                display_sidebox($appname,$menu['menu_title_3'] . ' ' . lang 
('sub menu'),$menu['sub_menu_2'],$use_lang = false);

Modified: trunk/property/login.php
===================================================================
--- trunk/property/login.php    2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/property/login.php    2008-02-02 13:52:39 UTC (rev 18466)
@@ -287,7 +287,7 @@
                        $extra_vars['phpgw_forward'] =  $forward;
                        foreach($_GET as $name => $value)
                        {
-                               if (ereg('phpgw_',$name))
+                               if (preg_match('/phpgw_/',$name))
                                {
                                        $extra_vars[$name] = $value;
                                }
@@ -460,7 +460,7 @@
        $extra_vars = array();
        foreach($_GET as $name => $value)
        {
-               if (ereg('phpgw_',$name))
+               if (preg_match('/phpgw_/',$name))
                {
                        $extra_vars[$name] = urlencode($value);
                }
@@ -491,24 +491,24 @@
 
        $tmpl->set_var('template_set', 
$GLOBALS['phpgw_info']['login_template_set']);
        
-       if( is_file( PHPGW_SERVER_ROOT . SEP . 'property' . SEP . 'templates' 
-               . SEP . $GLOBALS['phpgw_info']['login_template_set'] . SEP . 
'css' . SEP . 'base.css') )
+       // This really should just use the API CSS, which would fix any 
conflicts
+       if( is_file(PHPGW_SERVER_ROOT . 
"/property/templates/{$GLOBALS['phpgw_info']['login_template_set']}/css/base.css")
 )
        {
-               $base_css = '../property/templates/' . 
$GLOBALS['phpgw_info']['login_template_set'] . '/css/base.css';
+               $base_css = 
"{$GLOBALS['phpgw_info']['server']['webserver_url']}/property/templates/{$GLOBALS['phpgw_info']['login_template_set']}/css/base.css";
        }
        else
        {
-               $base_css = '../property/templates/base/css/base.css';
+               $base_css = 
"{$GLOBALS['phpgw_info']['server']['webserver_url']}/property/templates/base/css/base.css";
        }
 
-       if( is_file( PHPGW_SERVER_ROOT . SEP . 'property' . SEP . 'templates' 
-               . SEP . $GLOBALS['phpgw_info']['login_template_set'] . SEP . 
'css' . SEP . 'login.css') )
+       // ditto
+       if( is_file(PHPGW_SERVER_ROOT . 
"/property/templates/{$GLOBALS['phpgw_info']['login_template_set']}/css/login.css")
 )
        {
-               $login_css = '../property/templates/' . 
$GLOBALS['phpgw_info']['login_template_set'] . '/css/login.css';
+               $login_css = 
"{$GLOBALS['phpgw_info']['server']['webserver_url']}/property/templates/{$GLOBALS['phpgw_info']['login_template_set']}/css/login.css";
        }
        else
        {
-               $login_css = '../property/templates/base/css/login.css';
+               $login_css = 
"{$GLOBALS['phpgw_info']['server']['webserver_url']}/property/templates/base/css/login.css";
        }
 
        $tmpl->set_var('base_css', $base_css);

Modified: trunk/property/setup/default_records.inc.php
===================================================================
--- trunk/property/setup/default_records.inc.php        2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/setup/default_records.inc.php        2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -16,6 +16,10 @@
         * Description
         * @package property
         */
+
+$GLOBALS['phpgw_setup']->oProc->query("DELETE FROM phpgw_cust_attribute WHERE 
appname='property'");
+$GLOBALS['phpgw_setup']->oProc->query("DELETE FROM phpgw_cust_choice WHERE 
appname='property'");
+
 #
 #fm_workorder_category
 #
@@ -63,12 +67,37 @@
 #fm_owner_attribute
 #
 
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_owner_attribute (id, 
list, column_name, input_text, statustext, size, datatype, attrib_sort, 
precision_, scale, default_value, nullable, search) VALUES (1, 1, 'abid', 
'Contact', 'Contakt person', NULL, 'AB', 1, 4, NULL, NULL, 'True', NULL)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_owner_attribute (id, 
list, column_name, input_text, statustext, size, datatype, attrib_sort, 
precision_, scale, default_value, nullable, search) VALUES (2, 1, 'org_name', 
'Name', 'The name of the owner', NULL, 'V', 2, 50, NULL, NULL, 'True', 1)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_owner_attribute (id, 
list, column_name, input_text, statustext, size, datatype, attrib_sort, 
precision_, scale, default_value, nullable, search) VALUES (3, 1, 'remark', 
'remark', 'remark', NULL, 'T', 3, NULL, NULL, NULL, 'True', NULL)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, list, column_name, input_text, statustext, size, 
datatype, attrib_sort, precision_, scale, default_value, nullable, search) 
VALUES ('property', '.owner', 1, 1, 'abid', 'Contact', 'Contakt person', NULL, 
'AB', 1, 4, NULL, NULL, 'True', NULL)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, list, column_name, input_text, statustext, size, 
datatype, attrib_sort, precision_, scale, default_value, nullable, search) 
VALUES ('property', '.owner', 2, 1, 'org_name', 'Name', 'The name of the 
owner', NULL, 'V', 2, 50, NULL, NULL, 'True', 1)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, list, column_name, input_text, statustext, size, 
datatype, attrib_sort, precision_, scale, default_value, nullable, search) 
VALUES ('property', '.owner', 3, 1, 'remark', 'remark', 'remark', NULL, 'T', 3, 
NULL, NULL, NULL, 'True', NULL)");
 
+#
+# Dumping data for table fm_location1_category
+#
 
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location1_category (id, 
descr) VALUES (1, 'SOMETHING')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location1_category (id, 
descr) VALUES (99, 'not active')");
 #
+# Dumping data for table fm_location2_category
+#
+
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location2_category (id, 
descr) VALUES (1, 'SOMETHING')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location2_category (id, 
descr) VALUES (99, 'not active')");
+#
+# Dumping data for table fm_location3_category
+#
+
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location3_category (id, 
descr) VALUES (1, 'SOMETHING')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location3_category (id, 
descr) VALUES (99, 'not active')");
+#
+# Dumping data for table fm_location4_category
+#
+
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location4_category (id, 
descr) VALUES (1, 'SOMETHING')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location4_category (id, 
descr) VALUES (99, 'not active')");
+
+
+#
 #fm_location1
 #
 
@@ -197,33 +226,36 @@
 $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname, id, descr) VALUES ('property', '.location.2', 'Building')");
 $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname, id, descr) VALUES ('property', '.location.3', 'Entrance')");
 $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname, id, descr) VALUES ('property', '.location.4', 'Apartment')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname, id, descr) VALUES ('property', '.tenant', 'Tenant')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname, id, descr) VALUES ('property', '.owner', 'Owner')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname, id, descr) VALUES ('property', '.vendor', 'Vendor')");
 $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname, id, descr) VALUES ('property', '.custom', 'custom queries')");
 $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname, id, descr, allow_grant) VALUES ('property', '.project', 'Demand -> 
Workorder', 1)");
 $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname, id, descr, allow_grant) VALUES ('property', '.ticket', 'Helpdesk', 
1)");
 $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname, id, descr) VALUES ('property', '.ticket.external', 'Helpdesk External 
user')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname, id, descr) VALUES ('property', '.agreement', 'Agreement')");
 $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname, id, descr) VALUES ('property', '.invoice', 'Invoice')");
 $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname, id, descr) VALUES ('property', '.document', 'Documents')");
 $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname, id, descr) VALUES ('property', '.drawing', 'Drawing')");
 $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname, id, descr, allow_grant) VALUES ('property', '.entity.1', 'Equipment', 
1)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname, id, descr, allow_grant) VALUES ('property', '.entity.1.1', 'Meter', 
1)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname, id, descr, allow_grant) VALUES ('property', '.entity.1.2', 
'Elevator', 1)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname, id, descr, allow_grant) VALUES ('property', '.entity.1.3', 'Fire 
alarm central', 1)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname, id, descr, allow_grant, allow_c_attrib,c_attrib_table) VALUES 
('property', '.entity.1.1', 'Meter', 1, 1, 'fm_entity_1_1')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname, id, descr, allow_grant, allow_c_attrib,c_attrib_table) VALUES 
('property', '.entity.1.2', 'Elevator', 1, 1, 'fm_entity_1_2')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname, id, descr, allow_grant, allow_c_attrib,c_attrib_table) VALUES 
('property', '.entity.1.3', 'Fire alarm central', 1, 1, 'fm_entity_1_3')");
 $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname, id, descr, allow_grant) VALUES ('property', '.entity.2', 'Report', 
1)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname, id, descr, allow_grant) VALUES ('property', '.entity.2.1', 'Report 
type 1', 1)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname, id, descr, allow_grant) VALUES ('property', '.entity.2.2', 'Report 
type 2', 1)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname, id, descr) VALUES ('property', '.s_agreement', 'Service agreement')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname, id, descr, allow_grant, allow_c_attrib,c_attrib_table) VALUES 
('property', '.entity.2.1', 'Report type 1', 1, 1, 'fm_entity_2_1')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname, id, descr, allow_grant, allow_c_attrib,c_attrib_table) VALUES 
('property', '.entity.2.2', 'Report type 2', 1, 1, 'fm_entity_2_2')");
 $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname, id, descr) VALUES ('property', '.b_account', 'Budget account')");
 $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname, id, descr) VALUES ('property', '.tenant_claim', 'Tenant claim')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname, id, descr) VALUES ('property', '.r_agreement', 'Rental agreement')");
 $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname, id, descr) VALUES ('property', '.budget', 'Budet')");
 $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname, id, descr) VALUES ('property', '.budget.obligations', 
'Obligations')");
 $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname, id, descr) VALUES ('property', '.ifc', 'ifc integration')");
 
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname,id, descr, allow_c_attrib,c_attrib_table) VALUES ('property', 
'.agreement', 'Agreement',1,'fm_agreement')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname,id, descr, allow_c_attrib,c_attrib_table) VALUES ('property', 
'.s_agreement', 'Service agreement',1,'fm_s_agreement')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname,id, descr, allow_c_attrib,c_attrib_table) VALUES ('property', 
'.s_agreement.detail', 'Service agreement detail',1,'fm_s_agreement_detail')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname,id, descr, allow_c_attrib,c_attrib_table) VALUES ('property', 
'.r_agreement', 'Rental agreement',1,'fm_r_agreement')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname,id, descr, allow_c_attrib,c_attrib_table) VALUES ('property', 
'.r_agreement.detail', 'Rental agreement detail',1,'fm_r_agreement_detail')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname,id, descr, allow_c_attrib,c_attrib_table) VALUES ('property', 
'.tenant', 'Tenant',1,'fm_tenant')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname,id, descr, allow_c_attrib,c_attrib_table) VALUES ('property', 
'.owner', 'Owner',1,'fm_owner')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname,id, descr, allow_c_attrib,c_attrib_table) VALUES ('property', 
'.vendor', 'Vendor',1,'fm_vendor')");
 
+
 #
 #  fm_ns3420
 #
@@ -259,23 +291,23 @@
 $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_tenant_category (id, 
descr) VALUES (3, 'organization')");
 
 #
-# Dumping data for table fm_tenant_attribute
+# Dumping data for table phpgw_cust_attribute
 #
 
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_tenant_attribute (id, 
list, search, lookup_form, column_name, input_text, statustext, size, datatype, 
attrib_sort, precision_, scale, default_value, nullable) VALUES (1, 1, 1, NULL, 
'first_name', 'First name', 'First name', NULL, 'V', 1, 50, NULL, NULL, 
'True')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_tenant_attribute (id, 
list, search, lookup_form, column_name, input_text, statustext, size, datatype, 
attrib_sort, precision_, scale, default_value, nullable) VALUES (2, 1, 1, NULL, 
'last_name', 'Last name', 'Last name', NULL, 'V', 2, 50, NULL, NULL, 'True')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_tenant_attribute (id, 
list, search, lookup_form, column_name, input_text, statustext, size, datatype, 
attrib_sort, precision_, scale, default_value, nullable) VALUES (3, 1, 1, NULL, 
'contact_phone', 'contact phone', 'contact phone', NULL, 'V', 3, 20, NULL, 
NULL, 'True')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_tenant_attribute (id, 
list, search, lookup_form, column_name, input_text, statustext, size, datatype, 
attrib_sort, precision_, scale, default_value, nullable) VALUES (4, NULL, NULL, 
NULL, 'phpgw_account_id', 'Mapped User', 'Mapped User', NULL, 'user', 4, 4, 
NULL, NULL, 'True')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_tenant_attribute (id, 
list, search, lookup_form, column_name, input_text, statustext, size, datatype, 
attrib_sort, precision_, scale, default_value, nullable) VALUES (5, NULL, NULL, 
NULL, 'account_lid', 'User Name', 'User name for login', NULL, 'V', 5, 25, 
NULL, NULL, 'True')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_tenant_attribute (id, 
list, search, lookup_form, column_name, input_text, statustext, size, datatype, 
attrib_sort, precision_, scale, default_value, nullable) VALUES (6, NULL, NULL, 
NULL, 'account_pwd', 'Password', 'Users Password', NULL, 'pwd', 6, 32, NULL, 
NULL, 'True')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_tenant_attribute (id, 
list, search, lookup_form, column_name, input_text, statustext, size, datatype, 
attrib_sort, precision_, scale, default_value, nullable) VALUES (7, NULL, NULL, 
NULL, 'account_status', 'account status', 'account status', NULL, 'LB', 7, 
NULL, NULL, NULL, 'True')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, list, search, column_name, input_text, statustext, 
size, datatype, attrib_sort, precision_, scale, default_value, nullable) VALUES 
('property', '.tenant', 1, 1, 1, 'first_name', 'First name', 'First name', 
NULL, 'V', 1, 50, NULL, NULL, 'True')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, list, search, column_name, input_text, statustext, 
size, datatype, attrib_sort, precision_, scale, default_value, nullable) VALUES 
('property', '.tenant', 2, 1, 1, 'last_name', 'Last name', 'Last name', NULL, 
'V', 2, 50, NULL, NULL, 'True')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, list, search, column_name, input_text, statustext, 
size, datatype, attrib_sort, precision_, scale, default_value, nullable) VALUES 
('property', '.tenant', 3, 1, 1, 'contact_phone', 'contact phone', 'contact 
phone', NULL, 'V', 3, 20, NULL, NULL, 'True')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, list, search, column_name, input_text, statustext, 
size, datatype, attrib_sort, precision_, scale, default_value, nullable) VALUES 
('property', '.tenant', 4, NULL, NULL, 'phpgw_account_id', 'Mapped User', 
'Mapped User', NULL, 'user', 4, 4, NULL, NULL, 'True')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, list, search, column_name, input_text, statustext, 
size, datatype, attrib_sort, precision_, scale, default_value, nullable) VALUES 
('property', '.tenant', 5, NULL, NULL, 'account_lid', 'User Name', 'User name 
for login', NULL, 'V', 5, 25, NULL, NULL, 'True')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, list, search, column_name, input_text, statustext, 
size, datatype, attrib_sort, precision_, scale, default_value, nullable) VALUES 
('property', '.tenant', 6, NULL, NULL, 'account_pwd', 'Password', 'Users 
Password', NULL, 'pwd', 6, 32, NULL, NULL, 'True')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, list, search, column_name, input_text, statustext, 
size, datatype, attrib_sort, precision_, scale, default_value, nullable) VALUES 
('property', '.tenant', 7, NULL, NULL, 'account_status', 'account status', 
'account status', NULL, 'LB', 7, NULL, NULL, NULL, 'True')");
 
 #
 # Dumping data for table fm_tenant_choice
 #
 
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_tenant_choice 
(attrib_id, id, value) VALUES (7, 1, 'Active')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_tenant_choice 
(attrib_id, id, value) VALUES (7, 2, 'Banned')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice (appname, 
location, attrib_id, id, value) VALUES ('property', '.tenant', 7, 1, 
'Active')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice (appname, 
location, attrib_id, id, value) VALUES ('property', '.tenant', 7, 2, 
'Banned')");
 
 #
 # Dumping data for table fm_tenant
@@ -318,31 +350,6 @@
 $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_ecomva (id, descr) 
VALUES (5, 'Mva 5')");
 
 #
-# Dumping data for table fm_location1_category
-#
-
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location1_category (id, 
descr) VALUES (1, 'SOMETHING')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location1_category (id, 
descr) VALUES (99, 'not active')");
-#
-# Dumping data for table fm_location2_category
-#
-
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location2_category (id, 
descr) VALUES (1, 'SOMETHING')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location2_category (id, 
descr) VALUES (99, 'not active')");
-#
-# Dumping data for table fm_location3_category
-#
-
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location3_category (id, 
descr) VALUES (1, 'SOMETHING')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location3_category (id, 
descr) VALUES (99, 'not active')");
-#
-# Dumping data for table fm_location4_category
-#
-
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location4_category (id, 
descr) VALUES (1, 'SOMETHING')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location4_category (id, 
descr) VALUES (99, 'not active')");
-
-#
 # Dumping data for table fm_entity
 #
 
@@ -364,69 +371,69 @@
 #
 # Dumping data for table fm_entity_attribute
 #
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_attribute 
(entity_id, cat_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES (1, 1, 1, 
'status', 'Status', 'Status', 'LB', NULL, 1, NULL, NULL, NULL, NULL, 'True')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_attribute 
(entity_id, cat_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES (1, 1, 2, 
'category', 'Category', 'Category statustext', 'LB', NULL, 2, NULL, NULL, NULL, 
NULL, 'True')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_attribute 
(entity_id, cat_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES (1, 1, 3, 
'ext_system_id', 'Ext system id', 'External system id', 'V', NULL, 3, NULL, 12, 
NULL, NULL, 'False')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_attribute 
(entity_id, cat_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES (1, 1, 4, 
'ext_meter_id', 'Ext meter id', 'External meter id', 'V', NULL, 4, NULL, 12, 
NULL, NULL, 'False')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_attribute 
(entity_id, cat_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES (1, 1, 5, 
'remark', 'Remark', 'Remark status text', 'T', NULL, 5, NULL, NULL, NULL, NULL, 
'True')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES 
('property', '.entity.1.1', 1, 'status', 'Status', 'Status', 'LB', NULL, 1, 
NULL, NULL, NULL, NULL, 'True')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES 
('property', '.entity.1.1', 2, 'category', 'Category', 'Category statustext', 
'LB', NULL, 2, NULL, NULL, NULL, NULL, 'True')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES 
('property', '.entity.1.1', 3, 'ext_system_id', 'Ext system id', 'External 
system id', 'V', NULL, 3, NULL, 12, NULL, NULL, 'False')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES 
('property', '.entity.1.1', 4, 'ext_meter_id', 'Ext meter id', 'External meter 
id', 'V', NULL, 4, NULL, 12, NULL, NULL, 'False')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES 
('property', '.entity.1.1', 5, 'remark', 'Remark', 'Remark status text', 'T', 
NULL, 5, NULL, NULL, NULL, NULL, 'True')");
 
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_attribute 
(entity_id, cat_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES (1, 2, 1, 
'status', 'Status', 'Status', 'LB', NULL, 1, NULL, NULL, NULL, NULL, 'True')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_attribute 
(entity_id, cat_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES (1, 2, 2, 
'attribute1', 'Attribute 1', 'Attribute 1 statustext', 'V', NULL, 2, NULL, 12, 
NULL, NULL, 'True')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_attribute 
(entity_id, cat_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES (1, 2, 3, 
'attribute2', 'Attribute 2', 'Attribute 2 status text', 'D', NULL, 3, NULL, 
NULL, NULL, NULL, 'True')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_attribute 
(entity_id, cat_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES (1, 2, 4, 
'attribute3', 'Attribute 3', 'Attribute 3 status text', 'R', NULL, 4, NULL, 
NULL, NULL, NULL, 'True')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_attribute 
(entity_id, cat_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES (1, 2, 5, 
'attribute4', 'Attribute 4', 'Attribute 4 statustext', 'CH', NULL, 5, NULL, 
NULL, NULL, NULL, 'True')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_attribute 
(entity_id, cat_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES (1, 2, 6, 
'attribute5', 'Attribute 5', 'Attribute 5 statustext', 'AB', NULL, 6, NULL, 
NULL, NULL, NULL, 'True')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_attribute 
(entity_id, cat_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES (1, 3, 1, 
'status', 'Status', 'Status', 'LB', NULL, 1, NULL, NULL, NULL, NULL, 'True')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_attribute 
(entity_id, cat_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES (1, 3, 2, 
'attribute1', 'Attribute 1', 'Attribute 1 statustext', 'V', NULL, 2, NULL, 12, 
NULL, NULL, 'True')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_attribute 
(entity_id, cat_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES (1, 3, 3, 
'attribute2', 'Attribute 2', 'Attribute 2 status text', 'D', NULL, 3, NULL, 
NULL, NULL, NULL, 'True')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_attribute 
(entity_id, cat_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES (1, 3, 4, 
'attribute3', 'Attribute 3', 'Attribute 3 status text', 'R', NULL, 4, NULL, 
NULL, NULL, NULL, 'True')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_attribute 
(entity_id, cat_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES (1, 3, 5, 
'attribute4', 'Attribute 4', 'Attribute 4 statustext', 'CH', NULL, 5, NULL, 
NULL, NULL, NULL, 'True')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_attribute 
(entity_id, cat_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES (1, 3, 6, 
'attribute5', 'Attribute 5', 'Attribute 5 statustext', 'AB', NULL, 6, NULL, 
NULL, NULL, NULL, 'True')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_attribute 
(entity_id, cat_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES (2, 1, 1, 
'status', 'Status', 'Status', 'LB', NULL, 1, NULL, NULL, NULL, NULL, 'True')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_attribute 
(entity_id, cat_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES (2, 1, 2, 
'attribute1', 'Attribute 1', 'Attribute 1 statustext', 'V', NULL, 2, NULL, 12, 
NULL, NULL, 'True')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_attribute 
(entity_id, cat_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES (2, 1, 3, 
'attribute2', 'Attribute 2', 'Attribute 2 status text', 'D', NULL, 3, NULL, 
NULL, NULL, NULL, 'True')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_attribute 
(entity_id, cat_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES (2, 1, 4, 
'attribute3', 'Attribute 3', 'Attribute 3 status text', 'R', NULL, 4, NULL, 
NULL, NULL, NULL, 'True')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_attribute 
(entity_id, cat_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES (2, 1, 5, 
'attribute4', 'Attribute 4', 'Attribute 4 statustext', 'CH', NULL, 5, NULL, 
NULL, NULL, NULL, 'True')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_attribute 
(entity_id, cat_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES (2, 1, 6, 
'attribute5', 'Attribute 5', 'Attribute 5 statustext', 'AB', NULL, 6, NULL, 
NULL, NULL, NULL, 'True')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_attribute 
(entity_id, cat_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES (2, 2, 1, 
'status', 'Status', 'Status', 'LB', NULL, 1, NULL, NULL, NULL, NULL, 'True')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_attribute 
(entity_id, cat_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES (2, 2, 2, 
'attribute1', 'Attribute 1', 'Attribute 1 statustext', 'V', NULL, 2, NULL, 12, 
NULL, NULL, 'True')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_attribute 
(entity_id, cat_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES (2, 2, 3, 
'attribute2', 'Attribute 2', 'Attribute 2 status text', 'D', NULL, 3, NULL, 
NULL, NULL, NULL, 'True')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_attribute 
(entity_id, cat_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES (2, 2, 4, 
'attribute3', 'Attribute 3', 'Attribute 3 status text', 'R', NULL, 4, NULL, 
NULL, NULL, NULL, 'True')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_attribute 
(entity_id, cat_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES (2, 2, 5, 
'attribute4', 'Attribute 4', 'Attribute 4 statustext', 'CH', NULL, 5, NULL, 
NULL, NULL, NULL, 'True')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_attribute 
(entity_id, cat_id, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES (2, 2, 6, 
'attribute5', 'Attribute 5', 'Attribute 5 statustext', 'AB', NULL, 6, NULL, 
NULL, NULL, NULL, 'True')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES 
('property', '.entity.1.2', 1, 'status', 'Status', 'Status', 'LB', NULL, 1, 
NULL, NULL, NULL, NULL, 'True')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES 
('property', '.entity.1.2', 2, 'attribute1', 'Attribute 1', 'Attribute 1 
statustext', 'V', NULL, 2, NULL, 12, NULL, NULL, 'True')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES 
('property', '.entity.1.2', 3, 'attribute2', 'Attribute 2', 'Attribute 2 status 
text', 'D', NULL, 3, NULL, NULL, NULL, NULL, 'True')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES 
('property', '.entity.1.2', 4, 'attribute3', 'Attribute 3', 'Attribute 3 status 
text', 'R', NULL, 4, NULL, NULL, NULL, NULL, 'True')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES 
('property', '.entity.1.2', 5, 'attribute4', 'Attribute 4', 'Attribute 4 
statustext', 'CH', NULL, 5, NULL, NULL, NULL, NULL, 'True')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES 
('property', '.entity.1.2', 6, 'attribute5', 'Attribute 5', 'Attribute 5 
statustext', 'AB', NULL, 6, NULL, NULL, NULL, NULL, 'True')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES 
('property', '.entity.1.3', 1, 'status', 'Status', 'Status', 'LB', NULL, 1, 
NULL, NULL, NULL, NULL, 'True')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES 
('property', '.entity.1.3', 2, 'attribute1', 'Attribute 1', 'Attribute 1 
statustext', 'V', NULL, 2, NULL, 12, NULL, NULL, 'True')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES 
('property', '.entity.1.3', 3, 'attribute2', 'Attribute 2', 'Attribute 2 status 
text', 'D', NULL, 3, NULL, NULL, NULL, NULL, 'True')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES 
('property', '.entity.1.3', 4, 'attribute3', 'Attribute 3', 'Attribute 3 status 
text', 'R', NULL, 4, NULL, NULL, NULL, NULL, 'True')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES 
('property', '.entity.1.3', 5, 'attribute4', 'Attribute 4', 'Attribute 4 
statustext', 'CH', NULL, 5, NULL, NULL, NULL, NULL, 'True')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES 
('property', '.entity.1.3', 6, 'attribute5', 'Attribute 5', 'Attribute 5 
statustext', 'AB', NULL, 6, NULL, NULL, NULL, NULL, 'True')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES 
('property', '.entity.2.1', 1, 'status', 'Status', 'Status', 'LB', NULL, 1, 
NULL, NULL, NULL, NULL, 'True')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES 
('property', '.entity.2.1', 2, 'attribute1', 'Attribute 1', 'Attribute 1 
statustext', 'V', NULL, 2, NULL, 12, NULL, NULL, 'True')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES 
('property', '.entity.2.1', 3, 'attribute2', 'Attribute 2', 'Attribute 2 status 
text', 'D', NULL, 3, NULL, NULL, NULL, NULL, 'True')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES 
('property', '.entity.2.1', 4, 'attribute3', 'Attribute 3', 'Attribute 3 status 
text', 'R', NULL, 4, NULL, NULL, NULL, NULL, 'True')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES 
('property', '.entity.2.1', 5, 'attribute4', 'Attribute 4', 'Attribute 4 
statustext', 'CH', NULL, 5, NULL, NULL, NULL, NULL, 'True')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES 
('property', '.entity.2.1', 6, 'attribute5', 'Attribute 5', 'Attribute 5 
statustext', 'AB', NULL, 6, NULL, NULL, NULL, NULL, 'True')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES 
('property', '.entity.2.2', 1, 'status', 'Status', 'Status', 'LB', NULL, 1, 
NULL, NULL, NULL, NULL, 'True')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES 
('property', '.entity.2.2', 2, 'attribute1', 'Attribute 1', 'Attribute 1 
statustext', 'V', NULL, 2, NULL, 12, NULL, NULL, 'True')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES 
('property', '.entity.2.2', 3, 'attribute2', 'Attribute 2', 'Attribute 2 status 
text', 'D', NULL, 3, NULL, NULL, NULL, NULL, 'True')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES 
('property', '.entity.2.2', 4, 'attribute3', 'Attribute 3', 'Attribute 3 status 
text', 'R', NULL, 4, NULL, NULL, NULL, NULL, 'True')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES 
('property', '.entity.2.2', 5, 'attribute4', 'Attribute 4', 'Attribute 4 
statustext', 'CH', NULL, 5, NULL, NULL, NULL, NULL, 'True')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable) VALUES 
('property', '.entity.2.2', 6, 'attribute5', 'Attribute 5', 'Attribute 5 
statustext', 'AB', NULL, 6, NULL, NULL, NULL, NULL, 'True')");
 
 #
 # Dumping data for table fm_entity_choice
 #
 
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_choice 
(entity_id, cat_id, attrib_id, id, value) VALUES (1, 1, 1, 1, 'status 1')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_choice 
(entity_id, cat_id, attrib_id, id, value) VALUES (1, 1, 1, 2, 'status 2')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_choice 
(entity_id, cat_id, attrib_id, id, value) VALUES (1, 1, 2, 1, 'Tenant power 
meter')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_choice 
(entity_id, cat_id, attrib_id, id, value) VALUES (1, 1, 2, 2, 'Joint power 
meter')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_choice 
(entity_id, cat_id, attrib_id, id, value) VALUES (1, 2, 1, 1, 'status 1')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_choice 
(entity_id, cat_id, attrib_id, id, value) VALUES (1, 2, 1, 2, 'status 2')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_choice 
(entity_id, cat_id, attrib_id, id, value) VALUES (1, 2, 4, 1, 'choice 1')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_choice 
(entity_id, cat_id, attrib_id, id, value) VALUES (1, 2, 4, 2, 'choice 2')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_choice 
(entity_id, cat_id, attrib_id, id, value) VALUES (1, 2, 5, 1, 'choice 1')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_choice 
(entity_id, cat_id, attrib_id, id, value) VALUES (1, 2, 5, 2, 'choice 2')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_choice 
(entity_id, cat_id, attrib_id, id, value) VALUES (1, 3, 1, 1, 'status 1')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_choice 
(entity_id, cat_id, attrib_id, id, value) VALUES (1, 3, 1, 2, 'status 2')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_choice 
(entity_id, cat_id, attrib_id, id, value) VALUES (1, 3, 4, 1, 'choice 1')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_choice 
(entity_id, cat_id, attrib_id, id, value) VALUES (1, 3, 4, 2, 'choice 2')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_choice 
(entity_id, cat_id, attrib_id, id, value) VALUES (1, 3, 5, 1, 'choice 1')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_choice 
(entity_id, cat_id, attrib_id, id, value) VALUES (1, 3, 5, 2, 'choice 2')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_choice 
(entity_id, cat_id, attrib_id, id, value) VALUES (2, 1, 1, 1, 'status 1')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_choice 
(entity_id, cat_id, attrib_id, id, value) VALUES (2, 1, 1, 2, 'status 2')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_choice 
(entity_id, cat_id, attrib_id, id, value) VALUES (2, 1, 4, 1, 'choice 1')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_choice 
(entity_id, cat_id, attrib_id, id, value) VALUES (2, 1, 4, 2, 'choice 2')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_choice 
(entity_id, cat_id, attrib_id, id, value) VALUES (2, 1, 5, 1, 'choice 1')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_choice 
(entity_id, cat_id, attrib_id, id, value) VALUES (2, 1, 5, 2, 'choice 2')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_choice 
(entity_id, cat_id, attrib_id, id, value) VALUES (2, 2, 1, 1, 'status 1')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_choice 
(entity_id, cat_id, attrib_id, id, value) VALUES (2, 2, 1, 2, 'status 2')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_choice 
(entity_id, cat_id, attrib_id, id, value) VALUES (2, 2, 4, 1, 'choice 1')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_choice 
(entity_id, cat_id, attrib_id, id, value) VALUES (2, 2, 4, 2, 'choice 2')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_choice 
(entity_id, cat_id, attrib_id, id, value) VALUES (2, 2, 5, 1, 'choice 1')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_entity_choice 
(entity_id, cat_id, attrib_id, id, value) VALUES (2, 2, 5, 2, 'choice 2')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice (appname, 
location, attrib_id, id, value) VALUES ('property', '.entity.1.1', 1, 1, 
'status 1')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice (appname, 
location, attrib_id, id, value) VALUES ('property', '.entity.1.1', 1, 2, 
'status 2')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice (appname, 
location, attrib_id, id, value) VALUES ('property', '.entity.1.1', 2, 1, 
'Tenant power meter')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice (appname, 
location, attrib_id, id, value) VALUES ('property', '.entity.1.1', 2, 2, 'Joint 
power meter')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice (appname, 
location, attrib_id, id, value) VALUES ('property', '.entity.1.2', 1, 1, 
'status 1')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice (appname, 
location, attrib_id, id, value) VALUES ('property', '.entity.1.2', 1, 2, 
'status 2')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice (appname, 
location, attrib_id, id, value) VALUES ('property', '.entity.1.2', 4, 1, 
'choice 1')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice (appname, 
location, attrib_id, id, value) VALUES ('property', '.entity.1.2', 4, 2, 
'choice 2')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice (appname, 
location, attrib_id, id, value) VALUES ('property', '.entity.1.2', 5, 1, 
'choice 1')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice (appname, 
location, attrib_id, id, value) VALUES ('property', '.entity.1.2', 5, 2, 
'choice 2')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice (appname, 
location, attrib_id, id, value) VALUES ('property', '.entity.1.3', 1, 1, 
'status 1')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice (appname, 
location, attrib_id, id, value) VALUES ('property', '.entity.1.3', 1, 2, 
'status 2')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice (appname, 
location, attrib_id, id, value) VALUES ('property', '.entity.1.3', 4, 1, 
'choice 1')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice (appname, 
location, attrib_id, id, value) VALUES ('property', '.entity.1.3', 4, 2, 
'choice 2')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice (appname, 
location, attrib_id, id, value) VALUES ('property', '.entity.1.3', 5, 1, 
'choice 1')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice (appname, 
location, attrib_id, id, value) VALUES ('property', '.entity.1.3', 5, 2, 
'choice 2')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice (appname, 
location, attrib_id, id, value) VALUES ('property', '.entity.2.1', 1, 1, 
'status 1')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice (appname, 
location, attrib_id, id, value) VALUES ('property', '.entity.2.1', 1, 2, 
'status 2')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice (appname, 
location, attrib_id, id, value) VALUES ('property', '.entity.2.1', 4, 1, 
'choice 1')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice (appname, 
location, attrib_id, id, value) VALUES ('property', '.entity.2.1', 4, 2, 
'choice 2')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice (appname, 
location, attrib_id, id, value) VALUES ('property', '.entity.2.1', 5, 1, 
'choice 1')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice (appname, 
location, attrib_id, id, value) VALUES ('property', '.entity.2.1', 5, 2, 
'choice 2')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice (appname, 
location, attrib_id, id, value) VALUES ('property', '.entity.2.2', 1, 1, 
'status 1')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice (appname, 
location, attrib_id, id, value) VALUES ('property', '.entity.2.2', 1, 2, 
'status 2')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice (appname, 
location, attrib_id, id, value) VALUES ('property', '.entity.2.2', 4, 1, 
'choice 1')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice (appname, 
location, attrib_id, id, value) VALUES ('property', '.entity.2.2', 4, 2, 
'choice 2')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice (appname, 
location, attrib_id, id, value) VALUES ('property', '.entity.2.2', 5, 1, 
'choice 1')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice (appname, 
location, attrib_id, id, value) VALUES ('property', '.entity.2.2', 5, 2, 
'choice 2')");
 
 #
 # Dumping data for table fm_entity_lookup
@@ -458,9 +465,9 @@
 # Dumping data for table fm_vendor_attribute
 #
 
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_vendor_attribute (id, 
list, column_name, input_text, statustext, size, datatype, attrib_sort, 
precision_, scale, default_value, nullable, search) VALUES (1, 1, 'org_name', 
'Name', 'The Name of the vendor', NULL, 'V', 1, 50, NULL, NULL, 'True', 1)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_vendor_attribute (id, 
list, column_name, input_text, statustext, size, datatype, attrib_sort, 
precision_, scale, default_value, nullable, search) VALUES (2, 1, 
'contact_phone', 'Contact phone', 'Contact phone', NULL, 'V', 2, 20, NULL, 
NULL, 'True', 1)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_vendor_attribute (id, 
list, column_name, input_text, statustext, size, datatype, attrib_sort, 
precision_, scale, default_value, nullable, search) VALUES (3, 1, 'email', 
'email', 'email', NULL, 'email', 3, 64, NULL, NULL, 'True', 1)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, list, column_name, input_text, statustext, size, 
datatype, attrib_sort, precision_, scale, default_value, nullable, search) 
VALUES ('property', '.vendor', 1, 1, 'org_name', 'Name', 'The Name of the 
vendor', NULL, 'V', 1, 50, NULL, NULL, 'True', 1)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, list, column_name, input_text, statustext, size, 
datatype, attrib_sort, precision_, scale, default_value, nullable, search) 
VALUES ('property', '.vendor', 2, 1, 'contact_phone', 'Contact phone', 'Contact 
phone', NULL, 'V', 2, 20, NULL, NULL, 'True', 1)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, list, column_name, input_text, statustext, size, 
datatype, attrib_sort, precision_, scale, default_value, nullable, search) 
VALUES ('property', '.vendor', 3, 1, 'email', 'email', 'email', NULL, 'email', 
3, 64, NULL, NULL, 'True', 1)");
 
 
 $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_vendor_category (id, 
descr) VALUES (1, 'kateogory 1')");
@@ -562,15 +569,17 @@
 
        for ($i=0;$i<count($default_attrib['id']);$i++)
        {
-               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
fm_location_attrib 
(type_id,id,column_name,datatype,precision_,input_text,statustext,nullable)"
-                       . " VALUES ( $location_type,"
+               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_cust_attribute (appname, location, 
id,column_name,datatype,precision_,input_text,statustext,nullable,custom)"
+                       . " VALUES ("
+                       . "'property',"
+                       . "'.location.$location_type',"
                        . $default_attrib['id'][$i] . ",'"
                        . $default_attrib['column_name'][$i] . "','"
                        . $default_attrib['type'][$i] . "',"
                        . $default_attrib['precision'][$i] . ",'"
                        . $default_attrib['input_text'][$i] . "','"
                        . $default_attrib['statustext'][$i] . "','"
-                       . $default_attrib['nullable'][$i] . "')");
+                       . $default_attrib['nullable'][$i] . "',NULL)");
        }
 
        unset($pk);
@@ -582,45 +591,45 @@
 # Dumping data for table fm_location_attrib
 #
 
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location_attrib ( 
type_id, id, column_name, input_text, statustext, datatype, list, attrib_sort, 
size, precision_, scale, default_value, nullable,custom) VALUES (1, 8, 
'status', 'Status', 'Status', 'LB', NULL, 1, NULL, NULL, NULL, NULL, 'True', 
1)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location_attrib ( 
type_id, id, column_name, input_text, statustext, datatype, list, attrib_sort, 
size, precision_, scale, default_value, nullable,custom) VALUES (1, 9, 
'remark', 'Remark', 'Remark', 'T', NULL, 2, NULL, NULL, NULL, NULL, 'True', 
1)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location_attrib ( 
type_id, id, column_name, input_text, statustext, datatype, list, attrib_sort, 
size, precision_, scale, default_value, nullable,custom) VALUES (1, 10, 'mva', 
'mva', 'Status', 'I', NULL, 3, NULL, 4, NULL, NULL, 'True', 1)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location_attrib ( 
type_id, id, column_name, input_text, statustext, datatype, list, attrib_sort, 
size, precision_, scale, default_value, nullable,custom) VALUES (1, 11, 
'kostra_id', 'kostra_id', 'kostra_id', 'I', NULL, 4, NULL, 4, NULL, NULL, 
'True', 1)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location_attrib ( 
type_id, id, column_name, input_text, statustext, datatype, list, attrib_sort, 
size, precision_, scale, default_value, nullable,custom) VALUES (1, 12, 
'part_of_town_id', 'part_of_town_id', 'part_of_town_id', 'I', NULL, NULL, NULL, 
4, NULL, NULL, 'True', NULL)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location_attrib ( 
type_id, id, column_name, input_text, statustext, datatype, list, attrib_sort, 
size, precision_, scale, default_value, nullable,custom) VALUES (1, 13, 
'owner_id', 'owner_id', 'owner_id', 'I', NULL, NULL, NULL, 4, NULL, NULL, 
'True', NULL)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location_attrib ( 
type_id, id, column_name, input_text, statustext, datatype, list, attrib_sort, 
size, precision_, scale, default_value, nullable,custom) VALUES (1, 14, 
'change_type', 'change_type', 'change_type', 'I', NULL, NULL, NULL, 4, NULL, 
NULL, 'True', NULL)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location_attrib ( 
type_id, id, column_name, input_text, statustext, datatype, list, attrib_sort, 
precision_, scale, default_value, nullable,custom) VALUES (1, 15, 
'rental_area', 'Rental area', 'Rental area', 'N', NULL, 5, 20, 2, NULL, 'True', 
1)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
('property', '.location.1', 8, 'status', 'Status', 'Status', 'LB', NULL, 1, 
NULL, NULL, NULL, NULL, 'True', 1)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
('property', '.location.1', 9, 'remark', 'Remark', 'Remark', 'T', NULL, 2, 
NULL, NULL, NULL, NULL, 'True', 1)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
('property', '.location.1', 10, 'mva', 'mva', 'Status', 'I', NULL, 3, NULL, 4, 
NULL, NULL, 'True', 1)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
('property', '.location.1', 11, 'kostra_id', 'kostra_id', 'kostra_id', 'I', 
NULL, 4, NULL, 4, NULL, NULL, 'True', 1)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
('property', '.location.1', 12, 'part_of_town_id', 'part_of_town_id', 
'part_of_town_id', 'I', NULL, NULL, NULL, 4, NULL, NULL, 'True', NULL)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
('property', '.location.1', 13, 'owner_id', 'owner_id', 'owner_id', 'I', NULL, 
NULL, NULL, 4, NULL, NULL, 'True', NULL)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
('property', '.location.1', 14, 'change_type', 'change_type', 'change_type', 
'I', NULL, NULL, NULL, 4, NULL, NULL, 'True', NULL)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, precision_, scale, default_value, nullable,custom) VALUES 
('property', '.location.1', 15, 'rental_area', 'Rental area', 'Rental area', 
'N', NULL, 5, 20, 2, NULL, 'True', 1)");
 
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location_attrib ( 
type_id, id, column_name, input_text, statustext, datatype, list, attrib_sort, 
size, precision_, scale, default_value, nullable,custom) VALUES (2, 9, 
'status', 'Status', 'Status', 'LB', NULL, 1, NULL, NULL, NULL, NULL, 'True', 
1)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location_attrib ( 
type_id, id, column_name, input_text, statustext, datatype, list, attrib_sort, 
size, precision_, scale, default_value, nullable,custom) VALUES (2, 10, 
'remark', 'Remark', 'Remark', 'T', NULL, 2, NULL, NULL, NULL, NULL, 'True', 
1)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location_attrib ( 
type_id, id, column_name, input_text, statustext, datatype, list, attrib_sort, 
size, precision_, scale, default_value, nullable,custom) VALUES (2, 11, 
'change_type', 'change_type', 'change_type', 'I', NULL, NULL, NULL, 4, NULL, 
NULL, 'True', NULL)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location_attrib ( 
type_id, id, column_name, input_text, statustext, datatype, list, attrib_sort, 
precision_, scale, default_value, nullable,custom) VALUES (2, 12, 
'rental_area', 'Rental area', 'Rental area', 'N', NULL, 3, 20, 2, NULL, 'True', 
1)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
('property', '.location.2', 9, 'status', 'Status', 'Status', 'LB', NULL, 1, 
NULL, NULL, NULL, NULL, 'True', 1)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
('property', '.location.2', 10, 'remark', 'Remark', 'Remark', 'T', NULL, 2, 
NULL, NULL, NULL, NULL, 'True', 1)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
('property', '.location.2', 11, 'change_type', 'change_type', 'change_type', 
'I', NULL, NULL, NULL, 4, NULL, NULL, 'True', NULL)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, precision_, scale, default_value, nullable,custom) VALUES 
('property', '.location.2', 12, 'rental_area', 'Rental area', 'Rental area', 
'N', NULL, 3, 20, 2, NULL, 'True', 1)");
 
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location_attrib ( 
type_id, id, column_name, input_text, statustext, datatype, list, attrib_sort, 
size, precision_, scale, default_value, nullable,custom) VALUES (3, 10, 
'status', 'Status', 'Status', 'LB', NULL, 1, NULL, NULL, NULL, NULL, 'True', 
1)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location_attrib ( 
type_id, id, column_name, input_text, statustext, datatype, list, attrib_sort, 
size, precision_, scale, default_value, nullable,custom) VALUES (3, 11, 
'remark', 'Remark', 'Remark', 'T', NULL, 2, NULL, NULL, NULL, NULL, 'True', 
1)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location_attrib ( 
type_id, id, column_name, input_text, statustext, datatype, list, attrib_sort, 
size, precision_, scale, default_value, nullable,custom) VALUES (3, 12, 
'change_type', 'change_type', 'change_type', 'I', NULL, NULL, NULL, 4, NULL, 
NULL, 'True', NULL)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location_attrib ( 
type_id, id, column_name, input_text, statustext, datatype, list, attrib_sort, 
precision_, scale, default_value, nullable,custom) VALUES (3, 13, 
'rental_area', 'Rental area', 'Rental area', 'N', NULL, 3, 20, 2, NULL, 'True', 
1)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
('property', '.location.3', 10, 'status', 'Status', 'Status', 'LB', NULL, 1, 
NULL, NULL, NULL, NULL, 'True', 1)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
('property', '.location.3', 11, 'remark', 'Remark', 'Remark', 'T', NULL, 2, 
NULL, NULL, NULL, NULL, 'True', 1)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
('property', '.location.3', 12, 'change_type', 'change_type', 'change_type', 
'I', NULL, NULL, NULL, 4, NULL, NULL, 'True', NULL)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, precision_, scale, default_value, nullable,custom) VALUES 
('property', '.location.3', 13, 'rental_area', 'Rental area', 'Rental area', 
'N', NULL, 3, 20, 2, NULL, 'True', 1)");
 
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location_attrib ( 
type_id, id, column_name, input_text, statustext, datatype, list, attrib_sort, 
size, precision_, scale, default_value, nullable,custom) VALUES (4, 11, 
'status', 'Status', 'Status', 'LB', NULL, 1, NULL, NULL, NULL, NULL, 'True', 
1)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location_attrib ( 
type_id, id, column_name, input_text, statustext, datatype, list, attrib_sort, 
size, precision_, scale, default_value, nullable,custom) VALUES (4, 12, 
'remark', 'Remark', 'Remark', 'T', NULL, 2, NULL, NULL, NULL, NULL, 'True', 
1)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location_attrib ( 
type_id, id, column_name, input_text, statustext, datatype, list, attrib_sort, 
size, precision_, scale, default_value, nullable,custom) VALUES (4, 13, 
'street_id', 'street_id', 'street_id', 'I', NULL, NULL, NULL, 4, NULL, NULL, 
'True', NULL)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location_attrib ( 
type_id, id, column_name, input_text, statustext, datatype, list, attrib_sort, 
size, precision_, scale, default_value, nullable,custom) VALUES (4, 14, 
'street_number', 'street_number', 'street_number', 'I', NULL, NULL, NULL, 4, 
NULL, NULL, 'True', NULL)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location_attrib ( 
type_id, id, column_name, input_text, statustext, datatype, list, attrib_sort, 
size, precision_, scale, default_value, nullable,custom) VALUES (4, 15, 
'tenant_id', 'tenant_id', 'tenant_id', 'I', NULL, NULL, NULL, 4, NULL, NULL, 
'True', NULL)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location_attrib ( 
type_id, id, column_name, input_text, statustext, datatype, list, attrib_sort, 
size, precision_, scale, default_value, nullable,custom) VALUES (4, 16, 
'change_type', 'change_type', 'change_type', 'I', NULL, NULL, NULL, 4, NULL, 
NULL, 'True', NULL)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location_attrib ( 
type_id, id, column_name, input_text, statustext, datatype, list, attrib_sort, 
precision_, scale, default_value, nullable,custom) VALUES (4, 17, 
'rental_area', 'Rental area', 'Rental area', 'N', NULL, 4, 20, 2, NULL, 'True', 
1)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
('property', '.location.4', 11, 'status', 'Status', 'Status', 'LB', NULL, 1, 
NULL, NULL, NULL, NULL, 'True', 1)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
('property', '.location.4', 12, 'remark', 'Remark', 'Remark', 'T', NULL, 2, 
NULL, NULL, NULL, NULL, 'True', 1)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
('property', '.location.4', 13, 'street_id', 'street_id', 'street_id', 'I', 
NULL, NULL, NULL, 4, NULL, NULL, 'True', NULL)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
('property', '.location.4', 14, 'street_number', 'street_number', 
'street_number', 'I', NULL, NULL, NULL, 4, NULL, NULL, 'True', NULL)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
('property', '.location.4', 15, 'tenant_id', 'tenant_id', 'tenant_id', 'I', 
NULL, NULL, NULL, 4, NULL, NULL, 'True', NULL)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, size, precision_, scale, default_value, nullable,custom) VALUES 
('property', '.location.4', 16, 'change_type', 'change_type', 'change_type', 
'I', NULL, NULL, NULL, 4, NULL, NULL, 'True', NULL)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_attribute 
(appname, location, id, column_name, input_text, statustext, datatype, list, 
attrib_sort, precision_, scale, default_value, nullable,custom) VALUES 
('property', '.location.4', 17, 'rental_area', 'Rental area', 'Rental area', 
'N', NULL, 4, 20, 2, NULL, 'True', 1)");
 
 #
 # Dumping data for table fm_location_choice
 #
 
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location_choice ( 
type_id, attrib_id, id, value) VALUES (1, 8, 1, 'OK')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location_choice ( 
type_id, attrib_id, id, value) VALUES (1, 8, 2, 'Not OK')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location_choice ( 
type_id, attrib_id, id, value) VALUES (2, 9, 1, 'OK')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location_choice ( 
type_id, attrib_id, id, value) VALUES (2, 9, 2, 'Not OK')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location_choice ( 
type_id, attrib_id, id, value) VALUES (3, 10, 1, 'OK')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location_choice ( 
type_id, attrib_id, id, value) VALUES (3, 10, 2, 'Not OK')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location_choice ( 
type_id, attrib_id, id, value) VALUES (4, 11, 1, 'OK')");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO fm_location_choice ( 
type_id, attrib_id, id, value) VALUES (4, 11, 2, 'Not OK')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice (appname, 
location, attrib_id, id, value) VALUES ('property', '.location.1', 8, 1, 
'OK')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice (appname, 
location, attrib_id, id, value) VALUES ('property', '.location.1', 8, 2, 'Not 
OK')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice (appname, 
location, attrib_id, id, value) VALUES ('property', '.location.2', 9, 1, 
'OK')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice (appname, 
location, attrib_id, id, value) VALUES ('property', '.location.2', 9, 2, 'Not 
OK')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice (appname, 
location, attrib_id, id, value) VALUES ('property', '.location.3', 10, 1, 
'OK')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice (appname, 
location, attrib_id, id, value) VALUES ('property', '.location.3', 10, 2, 'Not 
OK')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice (appname, 
location, attrib_id, id, value) VALUES ('property', '.location.4', 11, 1, 
'OK')");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_cust_choice (appname, 
location, attrib_id, id, value) VALUES ('property', '.location.4', 11, 2, 'Not 
OK')");
 
 
 ?>

Modified: trunk/property/setup/phpgw_en.lang
===================================================================
--- trunk/property/setup/phpgw_en.lang  2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/property/setup/phpgw_en.lang  2008-02-02 13:52:39 UTC (rev 18466)
@@ -1107,7 +1107,7 @@
 Project name   property        en      Project name
 Project start date     property        en      Project start date
 propagate      property        en      propagate
-property       property        en      property
+property       common  en      Facilities Management
 Property has been edited       property        en      Property has been edited
 Property has been saved        property        en      Property has been saved
 property id    property        en      property id

Modified: trunk/property/setup/setup.inc.php
===================================================================
--- trunk/property/setup/setup.inc.php  2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/property/setup/setup.inc.php  2008-02-02 13:52:39 UTC (rev 18466)
@@ -77,12 +77,8 @@
                'fm_streetaddress',
                'fm_tenant',
                'fm_tenant_category',
-               'fm_tenant_attribute',
-               'fm_tenant_choice',
                'fm_vendor',
                'fm_vendor_category',
-               'fm_vendor_attribute',
-               'fm_vendor_choice',
                'fm_district',
                'fm_location1',
                'fm_location1_category',
@@ -97,8 +93,6 @@
                'fm_location4_category',
                'fm_location4_history',
                'fm_location_type',
-               'fm_location_attrib',
-               'fm_location_choice',
                'fm_location_config',
                'fm_building_part',
                'fm_b_account',
@@ -111,8 +105,6 @@
                'fm_agreement_group',
                'fm_agreement',
                'fm_agreement_status',
-               'fm_agreement_attribute',
-               'fm_agreement_choice',
                'fm_activity_price_index',
                'fm_branch',
                'fm_wo_hours',
@@ -158,13 +150,9 @@
                'fm_standard_unit',
                'fm_owner',
                'fm_owner_category',
-               'fm_owner_attribute',
-               'fm_owner_choice',
                'fm_cache',
                'fm_entity',
-               'fm_entity_attribute',
                'fm_entity_category',
-               'fm_entity_choice',
                'fm_entity_lookup',
                'fm_entity_history',
                'fm_entity_1_1',
@@ -172,14 +160,11 @@
                'fm_entity_1_3',
                'fm_entity_2_1',
                'fm_entity_2_2',
-               'fm_custom_function',
                'fm_custom',
                'fm_custom_cols',
                'fm_orders',
                'fm_s_agreement',
-               'fm_s_agreement_attribute',
                'fm_s_agreement_category',
-               'fm_s_agreement_choice',
                'fm_s_agreement_detail',
                'fm_s_agreement_pricing',
                'fm_s_agreement_history',
@@ -189,9 +174,7 @@
                'fm_tenant_claim',
                'fm_tenant_claim_category',
                'fm_r_agreement',
-               'fm_r_agreement_attribute',
                'fm_r_agreement_category',
-               'fm_r_agreement_choice',
                'fm_r_agreement_item',
                'fm_r_agreement_item_history',
                'fm_r_agreement_common',
@@ -205,31 +188,29 @@
        /* The hooks this app includes, needed for hooks registration */
        $setup_info['property']['hooks'] = array
        (
-//             'home',
                'add_def_pref',
                'deleteaccount',
                'manual',
                'settings',
-               'preferences',
-               'admin',
                'help',
-               'sidebox_menu'
+               'menu'  => 'property.menu.get_menu'
        );
 
        /* Dependencies for this app to work */
        $setup_info['property']['depends'][] = array
        (
                'appname'  => 'phpgwapi',
-               'versions' => Array('0.9.15', '0.9.16', '0.9.17', '0.9.18')
+               'versions' => Array('0.9.17', '0.9.18')
        );
 
-       $setup_info['property']['depends'][] = array(
+       $setup_info['property']['depends'][] = array
+       (
                'appname'  => 'admin',
-               'versions' => Array('0.9.13', '0.9.14', '0.9.15', '0.9.16', 
'0.9.17', '0.9.18')
+               'versions' => Array('0.9.17', '0.9.18')
        );
 
-       $setup_info['property']['depends'][] = array(
+       $setup_info['property']['depends'][] = array
+       (
                'appname'  => 'preferences',
-               'versions' => Array('0.9.13', '0.9.14', '0.9.15', '0.9.16', 
'0.9.17', '0.9.18')
+               'versions' => Array('0.9.17', '0.9.18')
        );
-?>

Modified: trunk/property/setup/tables_current.inc.php
===================================================================
--- trunk/property/setup/tables_current.inc.php 2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/setup/tables_current.inc.php 2008-02-02 13:52:39 UTC (rev 
18466)
@@ -86,42 +86,7 @@
                        'ix' => array(),
                        'uc' => array()
                ),
-               'fm_tenant_attribute' => array(
-                       'fd' => array(
-                               'id' => array('type' => 'int','precision' => 
'4','nullable' => False),
-                               'column_name' => array('type' => 
'varchar','precision' => '20','nullable' => False),
-                               'input_text' => array('type' => 
'varchar','precision' => '50','nullable' => False),
-                               'list' => array('type' => 'int','precision' => 
'2','nullable' => True),
-                               'location_form' => array('type' => 
'int','precision' => '2','nullable' => True),
-                               'lookup_form' => array('type' => 
'int','precision' => '2','nullable' => True),
-                               'search' => array('type' => 'int','precision' 
=> '2','nullable' => True),
-                               'statustext' => array('type' => 
'varchar','precision' => '100','nullable' => False),
-                               'size' => array('type' => 'int','precision' => 
'4','nullable' => True),
-                               'datatype' => array('type' => 
'varchar','precision' => '10','nullable' => True),
-                               'attrib_sort' => array('type' => 
'int','precision' => '4','nullable' => True),
-                               'precision_' => array('type' => 
'int','precision' => '4','nullable' => True),
-                               'scale' => array('type' => 'int','precision' => 
'4','nullable' => True),
-                               'default_value' => array('type' => 
'varchar','precision' => '20','nullable' => True),
-                               'nullable' => array('type' => 
'varchar','precision' => '5','nullable' => False,'default' => 'True')
-                       ),
-                       'pk' => array('id'),
-                       'fk' => array(),
-                       'ix' => array(),
-                       'uc' => array()
-               ),
 
-               'fm_tenant_choice' => array(
-                       'fd' => array(
-                               'attrib_id' => array('type' => 
'int','precision' => '4','nullable' => False),
-                               'id' => array('type' => 'int','precision' => 
'4','nullable' => False),
-                               'value' => array('type' => 'text','nullable' => 
False)
-                       ),
-                       'pk' => array('attrib_id','id'),
-                       'fk' => array(),
-                       'ix' => array(),
-                       'uc' => array()
-               ),
-
                'fm_vendor' => array(
                        'fd' => array(
                                'id' => array('type' => 'int','precision' => 
'4','nullable' => False),
@@ -150,43 +115,7 @@
                        'ix' => array(),
                        'uc' => array()
                ),
-               'fm_vendor_attribute' => array(
-                       'fd' => array(
-                               'id' => array('type' => 'int','precision' => 
'4','nullable' => False),
-                               'column_name' => array('type' => 
'varchar','precision' => '20','nullable' => False),
-                               'input_text' => array('type' => 
'varchar','precision' => '50','nullable' => False),
-                               'list' => array('type' => 'int','precision' => 
'2','nullable' => True),
-                               'location_form' => array('type' => 
'int','precision' => '2','nullable' => True),
-                               'lookup_form' => array('type' => 
'int','precision' => '2','nullable' => True),
-                               'search' => array('type' => 'int','precision' 
=> '2','nullable' => True),
-                               'statustext' => array('type' => 
'varchar','precision' => '100','nullable' => False),
-                               'size' => array('type' => 'int','precision' => 
'4','nullable' => True),
-                               'datatype' => array('type' => 
'varchar','precision' => '10','nullable' => True),
-                               'attrib_sort' => array('type' => 
'int','precision' => '4','nullable' => True),
-                               'precision_' => array('type' => 
'int','precision' => '4','nullable' => True),
-                               'scale' => array('type' => 'int','precision' => 
'4','nullable' => True),
-                               'default_value' => array('type' => 
'varchar','precision' => '20','nullable' => True),
-                               'nullable' => array('type' => 
'varchar','precision' => '5','nullable' => False,'default' => 'True')
-                       ),
-                       'pk' => array('id'),
-                       'fk' => array(),
-                       'ix' => array(),
-                       'uc' => array()
-               ),
 
-               'fm_vendor_choice' => array(
-                       'fd' => array(
-                               'attrib_id' => array('type' => 
'int','precision' => '4','nullable' => False),
-                               'id' => array('type' => 'int','precision' => 
'4','nullable' => False),
-                               'value' => array('type' => 'text','nullable' => 
False)
-                       ),
-                       'pk' => array('attrib_id','id'),
-                       'fk' => array(),
-                       'ix' => array(),
-                       'uc' => array()
-               ),
-
-
                'fm_district' => array(
                        'fd' => array(
                                'id' => array('type' => 'int','precision' => 
'2','nullable' => False),
@@ -226,6 +155,16 @@
                        'uc' => array()
                ),
 
+               'fm_location1_category' => array(
+                       'fd' => array(
+                               'id' => array('type' => 'int','precision' => 
'4','nullable' => False),
+                               'descr' => array('type' => 
'varchar','precision' => '255','nullable' => False)
+                       ),
+                       'pk' => array('id'),
+                       'fk' => array(),
+                       'ix' => array(),
+                       'uc' => array()
+               ),
                'fm_location1' => array(
                        'fd' => array(
                                'location_code' => array('type' => 
'varchar','precision' => '16','nullable' => False),
@@ -244,7 +183,7 @@
                                'rental_area' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' => 
'0.00')
                        ),
                        'pk' => array('loc1'),
-                       'fk' => array(),
+                       'fk' => array('fm_location1_category' => 
array('category' => 'id')),
                        'ix' => array('location_code'),
                        'uc' => array()
                ),
@@ -271,7 +210,7 @@
                        'ix' => array(),
                        'uc' => array()
                ),
-               'fm_location1_category' => array(
+               'fm_location2_category' => array(
                        'fd' => array(
                                'id' => array('type' => 'int','precision' => 
'4','nullable' => False),
                                'descr' => array('type' => 
'varchar','precision' => '255','nullable' => False)
@@ -296,7 +235,10 @@
                                'rental_area' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' => 
'0.00')
                        ),
                        'pk' => array('loc1','loc2'),
-                       'fk' => array('loc1' => 'fm_location1.loc1'),
+                       'fk' => array(
+                               'fm_location1' => array('loc1' =>'loc1'),
+                               'fm_location2_category' => array('category' => 
'id')
+                       ),
                        'ix' => array('location_code'),
                        'uc' => array()
                ),
@@ -320,7 +262,7 @@
                        'ix' => array(),
                        'uc' => array()
                ),
-               'fm_location2_category' => array(
+               'fm_location3_category' => array(
                        'fd' => array(
                                'id' => array('type' => 'int','precision' => 
'4','nullable' => False),
                                'descr' => array('type' => 
'varchar','precision' => '255','nullable' => False)
@@ -346,7 +288,10 @@
                                'rental_area' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' => 
'0.00')
                        ),
                        'pk' => array('loc1','loc2','loc3'),
-                       'fk' => array('loc1' => 'fm_location2.loc1','loc2' => 
'fm_location2.loc2'),
+                       'fk' => array(
+                               'fm_location2' => array('loc1' => 'loc1', 
'loc2' => 'loc2'),
+                               'fm_location3_category' => array('category' => 
'id')
+                       ),
                        'ix' => array('location_code'),
                        'uc' => array()
                ),
@@ -371,7 +316,7 @@
                        'ix' => array(),
                        'uc' => array()
                ),
-               'fm_location3_category' => array(
+               'fm_location4_category' => array(
                        'fd' => array(
                                'id' => array('type' => 'int','precision' => 
'4','nullable' => False),
                                'descr' => array('type' => 
'varchar','precision' => '255','nullable' => False)
@@ -402,7 +347,10 @@
                                'rental_area' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' => 
'0.00')
                        ),
                        'pk' => array('loc1','loc2','loc3','loc4'),
-                       'fk' => array('loc1' => 'fm_location3.loc1','loc2' => 
'fm_location3.loc2','loc3' => 'fm_location3.loc3'),
+                       'fk' => array(
+                               'fm_location3' => array('loc1' => 'loc1', 
'loc2' => 'loc2', 'loc3' => 'loc3'),
+                               'fm_location4_category' => array('category' => 
'id')
+                       ),
                        'ix' => array('location_code'),
                        'uc' => array()
                ),
@@ -431,16 +379,6 @@
                        'ix' => array(),
                        'uc' => array()
                ),
-               'fm_location4_category' => array(
-                       'fd' => array(
-                               'id' => array('type' => 'int','precision' => 
'4','nullable' => False),
-                               'descr' => array('type' => 
'varchar','precision' => '255','nullable' => False)
-                       ),
-                       'pk' => array('id'),
-                       'fk' => array(),
-                       'ix' => array(),
-                       'uc' => array()
-               ),
 
                'fm_location_config' => array(
                        'fd' => array(
@@ -465,44 +403,6 @@
                        'uc' => array()
                ),
 
-               'fm_location_attrib' => array(
-                       'fd' => array(
-                               'type_id' => array('type' => 'int','precision' 
=> '4','nullable' => False),
-                               'id' => array('type' => 'int','precision' => 
'4','nullable' => False),
-                               'custom' => array('type' => 'int','precision' 
=> '4','nullable' => True),
-                               'column_name' => array('type' => 
'varchar','precision' => '20','nullable' => False),
-                               'input_text' => array('type' => 
'varchar','precision' => '50','nullable' => False),
-                               'list' => array('type' => 'int','precision' => 
'2','nullable' => True),
-                               'location_form' => array('type' => 
'int','precision' => '2','nullable' => True),
-                               'lookup_form' => array('type' => 
'int','precision' => '2','nullable' => True),
-                               'statustext' => array('type' => 
'varchar','precision' => '100','nullable' => False),
-                               'size' => array('type' => 'int','precision' => 
'4','nullable' => True),
-                               'datatype' => array('type' => 
'varchar','precision' => '10','nullable' => True),
-                               'attrib_sort' => array('type' => 
'int','precision' => '4','nullable' => True),
-                               'precision_' => array('type' => 
'int','precision' => '4','nullable' => True),
-                               'scale' => array('type' => 'int','precision' => 
'4','nullable' => True),
-                               'default_value' => array('type' => 
'varchar','precision' => '20','nullable' => True),
-                               'nullable' => array('type' => 
'varchar','precision' => '5','nullable' => False,'default' => 'True')
-                       ),
-                       'pk' => array('type_id','id'),
-                       'fk' => array(),
-                       'ix' => array(),
-                       'uc' => array()
-               ),
-
-               'fm_location_choice' => array(
-                       'fd' => array(
-                               'type_id' => array('type' => 'int','precision' 
=> '4','nullable' => False),
-                               'attrib_id' => array('type' => 
'int','precision' => '4','nullable' => False),
-                               'id' => array('type' => 'int','precision' => 
'4','nullable' => False),
-                               'value' => array('type' => 'text','nullable' => 
False)
-                       ),
-                       'pk' => array('type_id','attrib_id','id'),
-                       'fk' => array(),
-                       'ix' => array(),
-                       'uc' => array()
-               ),
-
                'fm_building_part' => array(
                        'fd' => array(
                                'id' => array('type' => 'varchar','precision' 
=> '4','nullable' => False),
@@ -657,44 +557,6 @@
                        'uc' => array()
                ),
 
-               'fm_agreement_attribute' => array(
-                       'fd' => array(
-                               'id' => array('type' => 'int', 'precision' => 
4,'nullable' => False,'default' => '0'),
-                               'attrib_detail' => array('type' => 'int', 
'precision' => 2,'nullable' => False,'default' => '0'),
-                               'list' => array('type' => 'int', 'precision' => 
2,'nullable' => True),
-                               'location_form' => array('type' => 'int', 
'precision' => 2,'nullable' => True),
-                               'lookup_form' => array('type' => 'int', 
'precision' => 4,'nullable' => True),
-                               'column_name' => array('type' => 'varchar', 
'precision' => 20,'nullable' => False),
-                               'input_text' => array('type' => 'varchar', 
'precision' => 50,'nullable' => False),
-                               'statustext' => array('type' => 'varchar', 
'precision' => 100,'nullable' => False),
-                               'size' => array('type' => 'int', 'precision' => 
4,'nullable' => True),
-                               'datatype' => array('type' => 'varchar', 
'precision' => 10,'nullable' => False),
-                               'attrib_sort' => array('type' => 'int', 
'precision' => 4,'nullable' => True),
-                               'precision_' => array('type' => 'int', 
'precision' => 4,'nullable' => True),
-                               'scale' => array('type' => 'int', 'precision' 
=> 4,'nullable' => True),
-                               'default_value' => array('type' => 'varchar', 
'precision' => 18,'nullable' => True),
-                               'nullable' => array('type' => 'varchar', 
'precision' => 5,'nullable' => False,'default' => 'True'),
-                               'search' => array('type' => 'int', 'precision' 
=> 2,'nullable' => True)
-                       ),
-                       'pk' => array('id','attrib_detail'),
-                       'fk' => array(),
-                       'ix' => array(),
-                       'uc' => array()
-               ),
-
-               'fm_agreement_choice' => array(
-                       'fd' => array(
-                               'attrib_id' => array('type' => 'int', 
'precision' => 4,'nullable' => False,'default' => '0'),
-                               'id' => array('type' => 'int', 'precision' => 
4,'nullable' => False,'default' => '0'),
-                               'value' => array('type' => 'varchar', 
'precision' => 255,'nullable' => True),
-                               'attrib_detail' => array('type' => 'int', 
'precision' => 2,'nullable' => False,'default' => '0')
-                       ),
-                       'pk' => array('attrib_id','id','attrib_detail'),
-                       'fk' => array(),
-                       'ix' => array(),
-                       'uc' => array()
-               ),
-
                'fm_activity_price_index' => array(
                        'fd' => array(
                                'activity_id' => array('type' => 
'int','precision' => '4','nullable' => False),
@@ -1463,42 +1325,7 @@
                        'ix' => array(),
                        'uc' => array()
                ),
-               'fm_owner_attribute' => array(
-                       'fd' => array(
-                               'id' => array('type' => 'int','precision' => 
'4','nullable' => False),
-                               'column_name' => array('type' => 
'varchar','precision' => '20','nullable' => False),
-                               'input_text' => array('type' => 
'varchar','precision' => '50','nullable' => False),
-                               'list' => array('type' => 'int','precision' => 
'2','nullable' => True),
-                               'location_form' => array('type' => 
'int','precision' => '2','nullable' => True),
-                               'lookup_form' => array('type' => 
'int','precision' => '2','nullable' => True),
-                               'search' => array('type' => 'int','precision' 
=> '2','nullable' => True),
-                               'statustext' => array('type' => 
'varchar','precision' => '100','nullable' => False),
-                               'size' => array('type' => 'int','precision' => 
'4','nullable' => True),
-                               'datatype' => array('type' => 
'varchar','precision' => '10','nullable' => True),
-                               'attrib_sort' => array('type' => 
'int','precision' => '4','nullable' => True),
-                               'precision_' => array('type' => 
'int','precision' => '4','nullable' => True),
-                               'scale' => array('type' => 'int','precision' => 
'4','nullable' => True),
-                               'default_value' => array('type' => 
'varchar','precision' => '20','nullable' => True),
-                               'nullable' => array('type' => 
'varchar','precision' => '5','nullable' => False,'default' => 'True')
-                       ),
-                       'pk' => array('id'),
-                       'fk' => array(),
-                       'ix' => array(),
-                       'uc' => array()
-               ),
 
-               'fm_owner_choice' => array(
-                       'fd' => array(
-                               'attrib_id' => array('type' => 
'int','precision' => '4','nullable' => False),
-                               'id' => array('type' => 'int','precision' => 
'4','nullable' => False),
-                               'value' => array('type' => 'text','nullable' => 
False)
-                       ),
-                       'pk' => array('attrib_id','id'),
-                       'fk' => array(),
-                       'ix' => array(),
-                       'uc' => array()
-               ),
-
                'fm_cache' => array(
                        'fd' => array(
                                'name' => array('type' => 'varchar','precision' 
=> '50','nullable' => False),
@@ -1523,32 +1350,6 @@
                        'ix' => array(),
                        'uc' => array()
                ),
-               'fm_entity_attribute' => array(
-                       'fd' => array(
-                               'entity_id' => array('type' => 
'int','precision' => '4','nullable' => False),
-                               'cat_id' => array('type' => 'int','precision' 
=> '4','nullable' => False),
-                               'id' => array('type' => 'int','precision' => 
'4','nullable' => False),
-                               'column_name' => array('type' => 
'varchar','precision' => '20','nullable' => False),
-                               'input_text' => array('type' => 
'varchar','precision' => '50','nullable' => False),
-                               'statustext' => array('type' => 
'varchar','precision' => '150','nullable' => False),
-                               'datatype' => array('type' => 
'varchar','precision' => '10','nullable' => False),
-                               'search' => array('type' => 'int','precision' 
=> '2','nullable' => True),
-                               'history' => array('type' => 'int','precision' 
=> '2','nullable' => True),
-                               'list' => array('type' => 'int','precision' => 
'4','nullable' => True),
-                               'attrib_sort' => array('type' => 
'int','precision' => '4','nullable' => True),
-                               'size' => array('type' => 'int','precision' => 
'4','nullable' => True),
-                               'precision_' => array('type' => 
'int','precision' => '4','nullable' => True),
-                               'scale' => array('type' => 'int','precision' => 
'4','nullable' => True),
-                               'default_value' => array('type' => 
'varchar','precision' => '20','nullable' => True),
-                               'nullable' => array('type' => 
'varchar','precision' => '5','nullable' => True),
-                               'disabled' => array('type' => 'int','precision' 
=> '4','nullable' => True),
-                               'helpmsg' => array('type' => 'text','nullable' 
=> True)
-                       ),
-                       'pk' => array('entity_id','cat_id','id'),
-                       'fk' => array(),
-                       'ix' => array(),
-                       'uc' => array()
-               ),
                'fm_entity_category' => array(
                        'fd' => array(
                                'entity_id' => array('type' => 
'int','precision' => '4','nullable' => False),
@@ -1569,19 +1370,6 @@
                        'ix' => array(),
                        'uc' => array()
                ),
-               'fm_entity_choice' => array(
-                       'fd' => array(
-                               'entity_id' => array('type' => 
'int','precision' => '4','nullable' => False),
-                               'cat_id' => array('type' => 'int','precision' 
=> '4','nullable' => False),
-                               'attrib_id' => array('type' => 
'int','precision' => '4','nullable' => False),
-                               'id' => array('type' => 'int','precision' => 
'4','nullable' => False),
-                               'value' => array('type' => 'text','nullable' => 
False)
-                       ),
-                       'pk' => array('entity_id','cat_id','attrib_id','id'),
-                       'fk' => array(),
-                       'ix' => array(),
-                       'uc' => array()
-               ),
                'fm_entity_lookup' => array(
                        'fd' => array(
                                'entity_id' => array('type' => 
'int','precision' => '4','nullable' => False),
@@ -1827,32 +1615,6 @@
                        'uc' => array()
                ),
 
-               'fm_s_agreement_attribute' => array(
-                       'fd' => array(
-                               'id' => array('type' => 'int', 'precision' => 
4,'nullable' => False,'default' => '0'),
-                               'attrib_detail' => array('type' => 'int', 
'precision' => 2,'nullable' => False,'default' => '0'),
-                               'list' => array('type' => 'int', 'precision' => 
2,'nullable' => True),
-                               'location_form' => array('type' => 'int', 
'precision' => 2,'nullable' => True),
-                               'lookup_form' => array('type' => 'int', 
'precision' => 4,'nullable' => True),
-                               'column_name' => array('type' => 'varchar', 
'precision' => 20,'nullable' => False),
-                               'input_text' => array('type' => 'varchar', 
'precision' => 50,'nullable' => False),
-                               'statustext' => array('type' => 'varchar', 
'precision' => 100,'nullable' => False),
-                               'size' => array('type' => 'int', 'precision' => 
4,'nullable' => True),
-                               'datatype' => array('type' => 'varchar', 
'precision' => 10,'nullable' => False),
-                               'attrib_sort' => array('type' => 'int', 
'precision' => 4,'nullable' => True),
-                               'precision_' => array('type' => 'int', 
'precision' => 4,'nullable' => True),
-                               'scale' => array('type' => 'int', 'precision' 
=> 4,'nullable' => True),
-                               'default_value' => array('type' => 'varchar', 
'precision' => 18,'nullable' => True),
-                               'nullable' => array('type' => 'varchar', 
'precision' => 5,'nullable' => False,'default' => 'True'),
-                               'search' => array('type' => 'int', 'precision' 
=> 2,'nullable' => True),
-                               'history' => array('type' => 'int','precision' 
=> '2','nullable' => True)
-                       ),
-                       'pk' => array('id','attrib_detail'),
-                       'fk' => array(),
-                       'ix' => array(),
-                       'uc' => array()
-               ),
-
                'fm_s_agreement_category' => array(
                        'fd' => array(
                                'id' => array('type' => 'int', 'precision' => 
4,'nullable' => False,'default' => '0'),
@@ -1864,19 +1626,6 @@
                        'uc' => array()
                ),
 
-               'fm_s_agreement_choice' => array(
-                       'fd' => array(
-                               'attrib_id' => array('type' => 'int', 
'precision' => 4,'nullable' => False,'default' => '0'),
-                               'id' => array('type' => 'int', 'precision' => 
4,'nullable' => False,'default' => '0'),
-                               'value' => array('type' => 'varchar', 
'precision' => 255,'nullable' => True),
-                               'attrib_detail' => array('type' => 'int', 
'precision' => 2,'nullable' => False,'default' => '0')
-                       ),
-                       'pk' => array('attrib_id','id','attrib_detail'),
-                       'fk' => array(),
-                       'ix' => array(),
-                       'uc' => array()
-               ),
-
                'fm_s_agreement_detail' => array(
                        'fd' => array(
                                'agreement_id' => array('type' => 'int', 
'precision' => 4,'nullable' => False,'default' => '0'),
@@ -1990,21 +1739,6 @@
                        'ix' => array(),
                        'uc' => array()
                ),
-               'fm_custom_function' => array(
-                       'fd' => array(
-                               'acl_location' => array('type' => 
'varchar','precision' => '50','nullable' => False),
-                               'id' => array('type' => 'int','precision' => 
'4','nullable' => False),
-                               'descr' => array('type' => 'text','nullable' => 
True),
-                               'file_name ' => array('type' => 
'varchar','precision' => '50','nullable' => False),
-                               'active' => array('type' => 'int','precision' 
=> '2','nullable' => True),
-                               'custom_sort' => array('type' => 
'int','precision' => '4','nullable' => True)
-                       ),
-                       'pk' => array('acl_location','id'),
-                       'fk' => array(),
-                       'ix' => array(),
-                       'uc' => array()
-               ),
-
                'fm_r_agreement' => array(
                        'fd' => array(
                                'id' => array('type' => 'int', 'precision' => 
4,'nullable' => False,'default' => '0'),
@@ -2029,30 +1763,6 @@
                        'uc' => array()
                ),
 
-               'fm_r_agreement_attribute' => array(
-                       'fd' => array(
-                               'id' => array('type' => 'int', 'precision' => 
4,'nullable' => False,'default' => '0'),
-                               'attrib_detail' => array('type' => 'int', 
'precision' => 2,'nullable' => False,'default' => '0'),
-                               'list' => array('type' => 'int', 'precision' => 
2,'nullable' => True),
-                               'location_form' => array('type' => 'int', 
'precision' => 2,'nullable' => True),
-                               'lookup_form' => array('type' => 'int', 
'precision' => 4,'nullable' => True),
-                               'column_name' => array('type' => 'varchar', 
'precision' => 20,'nullable' => False),
-                               'input_text' => array('type' => 'varchar', 
'precision' => 50,'nullable' => False),
-                               'statustext' => array('type' => 'varchar', 
'precision' => 100,'nullable' => False),
-                               'size' => array('type' => 'int', 'precision' => 
4,'nullable' => True),
-                               'datatype' => array('type' => 'varchar', 
'precision' => 10,'nullable' => False),
-                               'attrib_sort' => array('type' => 'int', 
'precision' => 4,'nullable' => True),
-                               'precision_' => array('type' => 'int', 
'precision' => 4,'nullable' => True),
-                               'scale' => array('type' => 'int', 'precision' 
=> 4,'nullable' => True),
-                               'default_value' => array('type' => 'varchar', 
'precision' => 18,'nullable' => True),
-                               'nullable' => array('type' => 'varchar', 
'precision' => 5,'nullable' => False,'default' => 'True'),
-                               'search' => array('type' => 'int', 'precision' 
=> 2,'nullable' => True)
-                       ),
-                       'pk' => array('id','attrib_detail'),
-                       'fk' => array(),
-                       'ix' => array(),
-                       'uc' => array()
-               ),
 
                'fm_r_agreement_category' => array(
                        'fd' => array(
@@ -2065,19 +1775,6 @@
                        'uc' => array()
                ),
 
-               'fm_r_agreement_choice' => array(
-                       'fd' => array(
-                               'attrib_id' => array('type' => 'int', 
'precision' => 4,'nullable' => False,'default' => '0'),
-                               'id' => array('type' => 'int', 'precision' => 
4,'nullable' => False,'default' => '0'),
-                               'value' => array('type' => 'varchar', 
'precision' => 255,'nullable' => True),
-                               'attrib_detail' => array('type' => 'int', 
'precision' => 2,'nullable' => False,'default' => '0')
-                       ),
-                       'pk' => array('attrib_id','id','attrib_detail'),
-                       'fk' => array(),
-                       'ix' => array(),
-                       'uc' => array()
-               ),
-
                'fm_r_agreement_item' => array(
                        'fd' => array(
                                'agreement_id' => array('type' => 'int', 
'precision' => 4,'nullable' => False,'default' => '0'),

Modified: trunk/property/setup/tables_update.inc.php
===================================================================
--- trunk/property/setup/tables_update.inc.php  2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/setup/tables_update.inc.php  2008-02-02 13:52:39 UTC (rev 
18466)
@@ -1852,3 +1852,423 @@
                        return $GLOBALS['setup_info']['property']['currentver'];
                }
        }
+
+       /**
+       * Update property version from 0.9.17.540 to 0.9.17.541
+       */
+
+       $test[] = '0.9.17.540';
+       function property_upgrade0_9_17_540()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+               $GLOBALS['phpgw_setup']->oProc->query("DELETE FROM 
phpgw_acl_location where appname = 'property' AND id = '.agreement'");
+               $GLOBALS['phpgw_setup']->oProc->query("DELETE FROM 
phpgw_acl_location where appname = 'property' AND id = '.s_agreement'");
+               $GLOBALS['phpgw_setup']->oProc->query("DELETE FROM 
phpgw_acl_location where appname = 'property' AND id = '.r_agreement'");
+               $GLOBALS['phpgw_setup']->oProc->query("DELETE FROM 
phpgw_acl_location where appname = 'property' AND id = '.tenant'");
+               $GLOBALS['phpgw_setup']->oProc->query("DELETE FROM 
phpgw_acl_location where appname = 'property' AND id = '.owner'");
+               $GLOBALS['phpgw_setup']->oProc->query("DELETE FROM 
phpgw_acl_location where appname = 'property' AND id = '.vendor'");
+
+               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_acl_location (appname,id, descr, allow_c_attrib,c_attrib_table) VALUES 
('property', '.agreement', 'Agreement',1,'fm_agreement')");
+               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_acl_location (appname,id, descr, allow_c_attrib,c_attrib_table) VALUES 
('property', '.s_agreement', 'Service agreement',1,'fm_s_agreement')");
+               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_acl_location (appname,id, descr, allow_c_attrib,c_attrib_table) VALUES 
('property', '.s_agreement.detail', 'Service agreement 
detail',1,'fm_s_agreement_detail')");
+               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_acl_location (appname,id, descr, allow_c_attrib,c_attrib_table) VALUES 
('property', '.r_agreement', 'Rental agreement',1,'fm_r_agreement')");
+               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_acl_location (appname,id, descr, allow_c_attrib,c_attrib_table) VALUES 
('property', '.r_agreement.detail', 'Rental agreement 
detail',1,'fm_r_agreement_detail')");
+               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_acl_location (appname,id, descr, allow_c_attrib,c_attrib_table) VALUES 
('property', '.tenant', 'Tenant',1,'fm_tenant')");
+               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_acl_location (appname,id, descr, allow_c_attrib,c_attrib_table) VALUES 
('property', '.owner', 'Owner',1,'fm_owner')");
+               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_acl_location (appname,id, descr, allow_c_attrib,c_attrib_table) VALUES 
('property', '.vendor', 'Vendor',1,'fm_vendor')");
+
+               $GLOBALS['phpgw_setup']->oProc->query("SELECT * FROM 
fm_agreement_attribute");
+               while ($GLOBALS['phpgw_setup']->oProc->next_record())
+               {
+                       $attrib[]=array(
+                                       'appname'               => 'property',
+                                       'location'              => 
$GLOBALS['phpgw_setup']->oProc->f('attrib_detail') == 1 ? 
'.agreement':'.agreement.detail',
+                                       'id'                    => 
$GLOBALS['phpgw_setup']->oProc->f('id'),
+                                       'column_name'   => 
$GLOBALS['phpgw_setup']->oProc->f('column_name'),
+                                       'input_text'    => 
$GLOBALS['phpgw_setup']->oProc->f('input_text'),
+                                       'statustext'    => 
$GLOBALS['phpgw_setup']->oProc->f('statustext'),
+                                       'datatype'              => 
$GLOBALS['phpgw_setup']->oProc->f('datatype'),
+                                       'search'                => 
$GLOBALS['phpgw_setup']->oProc->f('search'),
+                                       'history'               => 
$GLOBALS['phpgw_setup']->oProc->f('history'),
+                                       'list'                  => 
$GLOBALS['phpgw_setup']->oProc->f('list'),
+                                       'attrib_sort'   => 
$GLOBALS['phpgw_setup']->oProc->f('attrib_sort'),
+                                       'size'                  => 
$GLOBALS['phpgw_setup']->oProc->f('size'),
+                                       'precision_'    => 
$GLOBALS['phpgw_setup']->oProc->f('precision_'),
+                                       'scale'                 => 
$GLOBALS['phpgw_setup']->oProc->f('scale'),
+                                       'default_value' => 
$GLOBALS['phpgw_setup']->oProc->f('default_value'),
+                                       'nullable'              => 
$GLOBALS['phpgw_setup']->oProc->f('nullable'),
+                                       'custom'                => 1
+                       );
+               }
+
+               $GLOBALS['phpgw_setup']->oProc->query("SELECT * FROM 
fm_r_agreement_attribute");
+               while ($GLOBALS['phpgw_setup']->oProc->next_record())
+               {
+                       $attrib[]=array(
+                                       'appname'               => 'property',
+                                       'location'              => 
$GLOBALS['phpgw_setup']->oProc->f('attrib_detail') == 1 ? 
'.r_agreement':'.r_agreement.detail',
+                                       'id'                    => 
$GLOBALS['phpgw_setup']->oProc->f('id'),
+                                       'column_name'   => 
$GLOBALS['phpgw_setup']->oProc->f('column_name'),
+                                       'input_text'    => 
$GLOBALS['phpgw_setup']->oProc->f('input_text'),
+                                       'statustext'    => 
$GLOBALS['phpgw_setup']->oProc->f('statustext'),
+                                       'datatype'              => 
$GLOBALS['phpgw_setup']->oProc->f('datatype'),
+                                       'search'                => 
$GLOBALS['phpgw_setup']->oProc->f('search'),
+                                       'history'               => 
$GLOBALS['phpgw_setup']->oProc->f('history'),
+                                       'list'                  => 
$GLOBALS['phpgw_setup']->oProc->f('list'),
+                                       'attrib_sort'   => 
$GLOBALS['phpgw_setup']->oProc->f('attrib_sort'),
+                                       'size'                  => 
$GLOBALS['phpgw_setup']->oProc->f('size'),
+                                       'precision_'    => 
$GLOBALS['phpgw_setup']->oProc->f('precision_'),
+                                       'scale'                 => 
$GLOBALS['phpgw_setup']->oProc->f('scale'),
+                                       'default_value' => 
$GLOBALS['phpgw_setup']->oProc->f('default_value'),
+                                       'nullable'              => 
$GLOBALS['phpgw_setup']->oProc->f('nullable'),
+                                       'custom'                => 1
+                       );
+               }
+
+               $GLOBALS['phpgw_setup']->oProc->query("SELECT * FROM 
fm_s_agreement_attribute");
+               while ($GLOBALS['phpgw_setup']->oProc->next_record())
+               {
+                       $attrib[]=array(
+                                       'appname'               => 'property',
+                                       'location'              => 
$GLOBALS['phpgw_setup']->oProc->f('attrib_detail') == 1 ? 
'.s_agreement':'.s_agreement.detail',
+                                       'id'                    => 
$GLOBALS['phpgw_setup']->oProc->f('id'),
+                                       'column_name'   => 
$GLOBALS['phpgw_setup']->oProc->f('column_name'),
+                                       'input_text'    => 
$GLOBALS['phpgw_setup']->oProc->f('input_text'),
+                                       'statustext'    => 
$GLOBALS['phpgw_setup']->oProc->f('statustext'),
+                                       'datatype'              => 
$GLOBALS['phpgw_setup']->oProc->f('datatype'),
+                                       'search'                => 
$GLOBALS['phpgw_setup']->oProc->f('search'),
+                                       'history'               => 
$GLOBALS['phpgw_setup']->oProc->f('history'),
+                                       'list'                  => 
$GLOBALS['phpgw_setup']->oProc->f('list'),
+                                       'attrib_sort'   => 
$GLOBALS['phpgw_setup']->oProc->f('attrib_sort'),
+                                       'size'                  => 
$GLOBALS['phpgw_setup']->oProc->f('size'),
+                                       'precision_'    => 
$GLOBALS['phpgw_setup']->oProc->f('precision_'),
+                                       'scale'                 => 
$GLOBALS['phpgw_setup']->oProc->f('scale'),
+                                       'default_value' => 
$GLOBALS['phpgw_setup']->oProc->f('default_value'),
+                                       'nullable'              => 
$GLOBALS['phpgw_setup']->oProc->f('nullable'),
+                                       'custom'                => 1
+                       );
+               }
+
+               $GLOBALS['phpgw_setup']->oProc->query("SELECT * FROM 
fm_owner_attribute");
+               while ($GLOBALS['phpgw_setup']->oProc->next_record())
+               {
+                       $attrib[]=array(
+                                       'appname'               => 'property',
+                                       'location'              => '.owner',
+                                       'id'                    => 
$GLOBALS['phpgw_setup']->oProc->f('id'),
+                                       'column_name'   => 
$GLOBALS['phpgw_setup']->oProc->f('column_name'),
+                                       'input_text'    => 
$GLOBALS['phpgw_setup']->oProc->f('input_text'),
+                                       'statustext'    => 
$GLOBALS['phpgw_setup']->oProc->f('statustext'),
+                                       'datatype'              => 
$GLOBALS['phpgw_setup']->oProc->f('datatype'),
+                                       'search'                => 
$GLOBALS['phpgw_setup']->oProc->f('search'),
+                                       'history'               => 
$GLOBALS['phpgw_setup']->oProc->f('history'),
+                                       'list'                  => 
$GLOBALS['phpgw_setup']->oProc->f('list'),
+                                       'attrib_sort'   => 
$GLOBALS['phpgw_setup']->oProc->f('attrib_sort'),
+                                       'size'                  => 
$GLOBALS['phpgw_setup']->oProc->f('size'),
+                                       'precision_'    => 
$GLOBALS['phpgw_setup']->oProc->f('precision_'),
+                                       'scale'                 => 
$GLOBALS['phpgw_setup']->oProc->f('scale'),
+                                       'default_value' => 
$GLOBALS['phpgw_setup']->oProc->f('default_value'),
+                                       'nullable'              => 
$GLOBALS['phpgw_setup']->oProc->f('nullable'),
+                                       'custom'                => 1
+                       );
+               }
+
+               $GLOBALS['phpgw_setup']->oProc->query("SELECT * FROM 
fm_tenant_attribute");
+               while ($GLOBALS['phpgw_setup']->oProc->next_record())
+               {
+                       $attrib[]=array(
+                                       'appname'               => 'property',
+                                       'location'              => '.tenant',
+                                       'id'                    => 
$GLOBALS['phpgw_setup']->oProc->f('id'),
+                                       'column_name'   => 
$GLOBALS['phpgw_setup']->oProc->f('column_name'),
+                                       'input_text'    => 
$GLOBALS['phpgw_setup']->oProc->f('input_text'),
+                                       'statustext'    => 
$GLOBALS['phpgw_setup']->oProc->f('statustext'),
+                                       'datatype'              => 
$GLOBALS['phpgw_setup']->oProc->f('datatype'),
+                                       'search'                => 
$GLOBALS['phpgw_setup']->oProc->f('search'),
+                                       'history'               => 
$GLOBALS['phpgw_setup']->oProc->f('history'),
+                                       'list'                  => 
$GLOBALS['phpgw_setup']->oProc->f('list'),
+                                       'attrib_sort'   => 
$GLOBALS['phpgw_setup']->oProc->f('attrib_sort'),
+                                       'size'                  => 
$GLOBALS['phpgw_setup']->oProc->f('size'),
+                                       'precision_'    => 
$GLOBALS['phpgw_setup']->oProc->f('precision_'),
+                                       'scale'                 => 
$GLOBALS['phpgw_setup']->oProc->f('scale'),
+                                       'default_value' => 
$GLOBALS['phpgw_setup']->oProc->f('default_value'),
+                                       'nullable'              => 
$GLOBALS['phpgw_setup']->oProc->f('nullable'),
+                                       'custom'                => 1
+                       );
+               }
+
+               $GLOBALS['phpgw_setup']->oProc->query("SELECT * FROM 
fm_vendor_attribute");
+               while ($GLOBALS['phpgw_setup']->oProc->next_record())
+               {
+                       $attrib[]=array(
+                                       'appname'               => 'property',
+                                       'location'              => '.vendor',
+                                       'id'                    => 
$GLOBALS['phpgw_setup']->oProc->f('id'),
+                                       'column_name'   => 
$GLOBALS['phpgw_setup']->oProc->f('column_name'),
+                                       'input_text'    => 
$GLOBALS['phpgw_setup']->oProc->f('input_text'),
+                                       'statustext'    => 
$GLOBALS['phpgw_setup']->oProc->f('statustext'),
+                                       'datatype'              => 
$GLOBALS['phpgw_setup']->oProc->f('datatype'),
+                                       'search'                => 
$GLOBALS['phpgw_setup']->oProc->f('search'),
+                                       'history'               => 
$GLOBALS['phpgw_setup']->oProc->f('history'),
+                                       'list'                  => 
$GLOBALS['phpgw_setup']->oProc->f('list'),
+                                       'attrib_sort'   => 
$GLOBALS['phpgw_setup']->oProc->f('attrib_sort'),
+                                       'size'                  => 
$GLOBALS['phpgw_setup']->oProc->f('size'),
+                                       'precision_'    => 
$GLOBALS['phpgw_setup']->oProc->f('precision_'),
+                                       'scale'                 => 
$GLOBALS['phpgw_setup']->oProc->f('scale'),
+                                       'default_value' => 
$GLOBALS['phpgw_setup']->oProc->f('default_value'),
+                                       'nullable'              => 
$GLOBALS['phpgw_setup']->oProc->f('nullable'),
+                                       'custom'                => 1
+                       );
+               }
+
+               foreach ($attrib as $entry)
+               {
+                       $GLOBALS['phpgw_setup']->oProc->query('INSERT INTO 
phpgw_cust_attribute (' . implode(',',array_keys($entry)) . ') VALUES (' . 
$GLOBALS['phpgw_setup']->oProc->validate_insert(array_values($entry)) . ')');
+               }
+               
+               $GLOBALS['phpgw_setup']->oProc->query("SELECT * FROM 
fm_agreement_choice"); 
+               while ($GLOBALS['phpgw_setup']->oProc->next_record())
+               {
+                       $choice[]=array(
+                                       'appname'               => 'property',
+                                       'location'              => 
$GLOBALS['phpgw_setup']->oProc->f('attrib_detail') == 1 ? 
'.agreement':'.agreement.detail',
+                                       'attrib_id'             => 
$GLOBALS['phpgw_setup']->oProc->f('attrib_id'),
+                                       'id'                    => 
$GLOBALS['phpgw_setup']->oProc->f('id'),
+                                       'value'                 => 
$GLOBALS['phpgw_setup']->oProc->f('value')
+                       );
+               }
+                       
+               $GLOBALS['phpgw_setup']->oProc->query("SELECT * FROM 
fm_r_agreement_choice"); 
+               while ($GLOBALS['phpgw_setup']->oProc->next_record())
+               {
+                       $choice[]=array(
+                                       'appname'               => 'property',
+                                       'location'              => 
$GLOBALS['phpgw_setup']->oProc->f('attrib_detail') == 1 ? 
'.r_agreement':'.r_agreement.detail',
+                                       'attrib_id'             => 
$GLOBALS['phpgw_setup']->oProc->f('attrib_id'),
+                                       'id'                    => 
$GLOBALS['phpgw_setup']->oProc->f('id'),
+                                       'value'                 => 
$GLOBALS['phpgw_setup']->oProc->f('value')
+                       );
+               }
+
+               $GLOBALS['phpgw_setup']->oProc->query("SELECT * FROM 
fm_s_agreement_choice"); 
+               while ($GLOBALS['phpgw_setup']->oProc->next_record())
+               {
+                       $choice[]=array(
+                                       'appname'               => 'property',
+                                       'location'              => 
$GLOBALS['phpgw_setup']->oProc->f('attrib_detail') == 1 ? 
'.s_agreement':'.s_agreement.detail',
+                                       'attrib_id'             => 
$GLOBALS['phpgw_setup']->oProc->f('attrib_id'),
+                                       'id'                    => 
$GLOBALS['phpgw_setup']->oProc->f('id'),
+                                       'value'                 => 
$GLOBALS['phpgw_setup']->oProc->f('value')
+                       );
+               }
+
+               $GLOBALS['phpgw_setup']->oProc->query("SELECT * FROM 
fm_owner_choice"); 
+               while ($GLOBALS['phpgw_setup']->oProc->next_record())
+               {
+                       $choice[]=array(
+                                       'appname'               => 'property',
+                                       'location'              => '.owner',
+                                       'attrib_id'             => 
$GLOBALS['phpgw_setup']->oProc->f('attrib_id'),
+                                       'id'                    => 
$GLOBALS['phpgw_setup']->oProc->f('id'),
+                                       'value'                 => 
$GLOBALS['phpgw_setup']->oProc->f('value')
+                       );
+               }
+
+               $GLOBALS['phpgw_setup']->oProc->query("SELECT * FROM 
fm_tenant_choice"); 
+               while ($GLOBALS['phpgw_setup']->oProc->next_record())
+               {
+                       $choice[]=array(
+                                       'appname'               => 'property',
+                                       'location'              => '.tenant',
+                                       'attrib_id'             => 
$GLOBALS['phpgw_setup']->oProc->f('attrib_id'),
+                                       'id'                    => 
$GLOBALS['phpgw_setup']->oProc->f('id'),
+                                       'value'                 => 
$GLOBALS['phpgw_setup']->oProc->f('value')
+                       );
+               }
+
+               $GLOBALS['phpgw_setup']->oProc->query("SELECT * FROM 
fm_vendor_choice"); 
+               while ($GLOBALS['phpgw_setup']->oProc->next_record())
+               {
+                       $choice[]=array(
+                                       'appname'               => 'property',
+                                       'location'              => '.vendor',
+                                       'attrib_id'             => 
$GLOBALS['phpgw_setup']->oProc->f('attrib_id'),
+                                       'id'                    => 
$GLOBALS['phpgw_setup']->oProc->f('id'),
+                                       'value'                 => 
$GLOBALS['phpgw_setup']->oProc->f('value')
+                       );
+               }
+
+               foreach ($choice as $entry)
+               {
+                       $GLOBALS['phpgw_setup']->oProc->query('INSERT INTO 
phpgw_cust_choice (' . implode(',',array_keys($entry)) . ') VALUES (' . 
$GLOBALS['phpgw_setup']->oProc->validate_insert(array_values($entry)) . ')');
+               }
+
+               
$GLOBALS['phpgw_setup']->oProc->DropTable('fm_agreement_attribute');
+               
$GLOBALS['phpgw_setup']->oProc->DropTable('fm_r_agreement_attribute');
+               
$GLOBALS['phpgw_setup']->oProc->DropTable('fm_s_agreement_attribute');
+               $GLOBALS['phpgw_setup']->oProc->DropTable('fm_owner_attribute');
+               
$GLOBALS['phpgw_setup']->oProc->DropTable('fm_tenant_attribute');
+               
$GLOBALS['phpgw_setup']->oProc->DropTable('fm_vendor_attribute');
+               
$GLOBALS['phpgw_setup']->oProc->DropTable('fm_agreement_choice');
+               
$GLOBALS['phpgw_setup']->oProc->DropTable('fm_r_agreement_choice');
+               
$GLOBALS['phpgw_setup']->oProc->DropTable('fm_s_agreement_choice');
+               $GLOBALS['phpgw_setup']->oProc->DropTable('fm_owner_choice');
+               $GLOBALS['phpgw_setup']->oProc->DropTable('fm_tenant_choice');
+               $GLOBALS['phpgw_setup']->oProc->DropTable('fm_vendor_choice');
+
+//---------------entity
+               $attrib = array();
+               $GLOBALS['phpgw_setup']->oProc->query("SELECT * FROM 
fm_entity_attribute");
+               while ($GLOBALS['phpgw_setup']->oProc->next_record())
+               {
+                       $attrib[]=array(
+                                       'appname'               => 'property',
+                                       'location'              => '.entity.' . 
$GLOBALS['phpgw_setup']->oProc->f('entity_id') . '.' . 
$GLOBALS['phpgw_setup']->oProc->f('cat_id'),
+                                       'id'                    => 
$GLOBALS['phpgw_setup']->oProc->f('id'),
+                                       'column_name'   => 
$GLOBALS['phpgw_setup']->oProc->f('column_name'),
+                                       'input_text'    => 
$GLOBALS['phpgw_setup']->oProc->f('input_text'),
+                                       'statustext'    => 
$GLOBALS['phpgw_setup']->oProc->f('statustext'),
+                                       'datatype'              => 
$GLOBALS['phpgw_setup']->oProc->f('datatype'),
+                                       'search'                => 
$GLOBALS['phpgw_setup']->oProc->f('search'),
+                                       'history'               => 
$GLOBALS['phpgw_setup']->oProc->f('history'),
+                                       'list'                  => 
$GLOBALS['phpgw_setup']->oProc->f('list'),
+                                       'attrib_sort'   => 
$GLOBALS['phpgw_setup']->oProc->f('attrib_sort'),
+                                       'size'                  => 
$GLOBALS['phpgw_setup']->oProc->f('size'),
+                                       'precision_'    => 
$GLOBALS['phpgw_setup']->oProc->f('precision_'),
+                                       'scale'                 => 
$GLOBALS['phpgw_setup']->oProc->f('scale'),
+                                       'default_value' => 
$GLOBALS['phpgw_setup']->oProc->f('default_value'),
+                                       'nullable'              => 
$GLOBALS['phpgw_setup']->oProc->f('nullable'),
+                                       'helpmsg'               => 
$GLOBALS['phpgw_setup']->oProc->f('helpmsg'),
+                                       'custom'                => 1
+                       );
+               }
+
+               foreach ($attrib as $entry)
+               {
+                       $GLOBALS['phpgw_setup']->oProc->query('INSERT INTO 
phpgw_cust_attribute (' . implode(',',array_keys($entry)) . ') VALUES (' . 
$GLOBALS['phpgw_setup']->oProc->validate_insert(array_values($entry)) . ')');
+               }
+
+               $choice = array();
+               $GLOBALS['phpgw_setup']->oProc->query("SELECT * FROM 
fm_entity_choice"); 
+               while ($GLOBALS['phpgw_setup']->oProc->next_record())
+               {
+                       $choice[]=array(
+                                       'appname'               => 'property',
+                                       'location'              => '.entity.' . 
$GLOBALS['phpgw_setup']->oProc->f('entity_id') . '.' . 
$GLOBALS['phpgw_setup']->oProc->f('cat_id'),
+                                       'attrib_id'             => 
$GLOBALS['phpgw_setup']->oProc->f('attrib_id'),
+                                       'id'                    => 
$GLOBALS['phpgw_setup']->oProc->f('id'),
+                                       'value'                 => 
$GLOBALS['phpgw_setup']->oProc->f('value')
+                       );
+               }
+
+               foreach ($choice as $entry)
+               {
+                       $GLOBALS['phpgw_setup']->oProc->query('INSERT INTO 
phpgw_cust_choice (' . implode(',',array_keys($entry)) . ') VALUES (' . 
$GLOBALS['phpgw_setup']->oProc->validate_insert(array_values($entry)) . ')');
+               }
+
+               $location = array();
+               $GLOBALS['phpgw_setup']->oProc->query("SELECT * FROM 
phpgw_acl_location WHERE appname = 'property' AND id LIKE '.entity.%'");
+
+               while ($GLOBALS['phpgw_setup']->oProc->next_record())
+               {
+                       $location[]= $GLOBALS['phpgw_setup']->oProc->f('id');
+               }
+
+               foreach ($location as $entry)
+               {
+                       if (strlen($entry)>10)
+                       {
+                               $GLOBALS['phpgw_setup']->oProc->query("UPDATE 
phpgw_acl_location SET allow_c_attrib=1 ,c_attrib_table ='fm" . 
str_replace('.','_', $entry) ."' WHERE id = '$entry'");
+                       }
+               }
+
+               
$GLOBALS['phpgw_setup']->oProc->DropTable('fm_entity_attribute');
+               $GLOBALS['phpgw_setup']->oProc->DropTable('fm_entity_choice');
+
+//---------------
+//--------------- custom functions
+               $custom = array();
+               $GLOBALS['phpgw_setup']->oProc->query("SELECT * FROM 
fm_custom_function"); 
+               while ($GLOBALS['phpgw_setup']->oProc->next_record())
+               {
+                       $custom[]=array(
+                                       'appname'               => 'property',
+                                       'location'              => 
$GLOBALS['phpgw_setup']->oProc->f('acl_location'),
+                                       'id'                    => 
$GLOBALS['phpgw_setup']->oProc->f('id'),
+                                       'descr'                 => 
$GLOBALS['phpgw_setup']->oProc->f('descr'),
+                                       'file_name'             => 
$GLOBALS['phpgw_setup']->oProc->f('file_name'),
+                                       'active'                => 
$GLOBALS['phpgw_setup']->oProc->f('active'),
+                                       'custom_sort'   => 
$GLOBALS['phpgw_setup']->oProc->f('custom_sort')
+                       );
+               }
+               foreach ($custom as $entry)
+               {
+                       $GLOBALS['phpgw_setup']->oProc->query('INSERT INTO 
phpgw_cust_function (' . implode(',',array_keys($entry)) . ') VALUES (' . 
$GLOBALS['phpgw_setup']->oProc->validate_insert(array_values($entry)) . ')');
+               }
+
+               $GLOBALS['phpgw_setup']->oProc->DropTable('fm_custom_function');
+//----------------
+
+//--------------- locations
+
+               $attrib = array();
+               $GLOBALS['phpgw_setup']->oProc->query("SELECT * FROM 
fm_location_attrib");
+               while ($GLOBALS['phpgw_setup']->oProc->next_record())
+               {
+                       $attrib[]=array(
+                                       'appname'               => 'property',
+                                       'location'              => '.location.' 
. $GLOBALS['phpgw_setup']->oProc->f('type_id'),
+                                       'id'                    => 
$GLOBALS['phpgw_setup']->oProc->f('id'),
+                                       'column_name'   => 
$GLOBALS['phpgw_setup']->oProc->f('column_name'),
+                                       'input_text'    => 
$GLOBALS['phpgw_setup']->oProc->f('input_text'),
+                                       'statustext'    => 
$GLOBALS['phpgw_setup']->oProc->f('statustext'),
+                                       'datatype'              => 
$GLOBALS['phpgw_setup']->oProc->f('datatype'),
+                                       'search'                => 
$GLOBALS['phpgw_setup']->oProc->f('search'),
+                                       'history'               => 
$GLOBALS['phpgw_setup']->oProc->f('history'),
+                                       'list'                  => 
$GLOBALS['phpgw_setup']->oProc->f('list'),
+                                       'attrib_sort'   => 
$GLOBALS['phpgw_setup']->oProc->f('attrib_sort'),
+                                       'size'                  => 
$GLOBALS['phpgw_setup']->oProc->f('size'),
+                                       'precision_'    => 
$GLOBALS['phpgw_setup']->oProc->f('precision_'),
+                                       'scale'                 => 
$GLOBALS['phpgw_setup']->oProc->f('scale'),
+                                       'default_value' => 
$GLOBALS['phpgw_setup']->oProc->f('default_value'),
+                                       'nullable'              => 
$GLOBALS['phpgw_setup']->oProc->f('nullable'),
+                                       'helpmsg'               => 
$GLOBALS['phpgw_setup']->oProc->f('helpmsg'),
+                                       'lookup_form'   => 
$GLOBALS['phpgw_setup']->oProc->f('lookup_form'),
+                                       'custom'                => 
$GLOBALS['phpgw_setup']->oProc->f('custom'),
+                       );
+               }
+
+               foreach ($attrib as $entry)
+               {
+                       $GLOBALS['phpgw_setup']->oProc->query('INSERT INTO 
phpgw_cust_attribute (' . implode(',',array_keys($entry)) . ') VALUES (' . 
$GLOBALS['phpgw_setup']->oProc->validate_insert(array_values($entry)) . ')');
+               }
+
+               $choice = array();
+               $GLOBALS['phpgw_setup']->oProc->query("SELECT * FROM 
fm_location_choice"); 
+               while ($GLOBALS['phpgw_setup']->oProc->next_record())
+               {
+                       $choice[]=array(
+                                       'appname'               => 'property',
+                                       'location'              => '.location.' 
. $GLOBALS['phpgw_setup']->oProc->f('type_id'),
+                                       'attrib_id'             => 
$GLOBALS['phpgw_setup']->oProc->f('attrib_id'),
+                                       'id'                    => 
$GLOBALS['phpgw_setup']->oProc->f('id'),
+                                       'value'                 => 
$GLOBALS['phpgw_setup']->oProc->f('value')
+                       );
+               }
+
+               foreach ($choice as $entry)
+               {
+                       $GLOBALS['phpgw_setup']->oProc->query('INSERT INTO 
phpgw_cust_choice (' . implode(',',array_keys($entry)) . ') VALUES (' . 
$GLOBALS['phpgw_setup']->oProc->validate_insert(array_values($entry)) . ')');
+               }
+
+               $GLOBALS['phpgw_setup']->oProc->DropTable('fm_location_attrib');
+               $GLOBALS['phpgw_setup']->oProc->DropTable('fm_location_choice');
+               
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['property']['currentver'] = 
'0.9.17.541';
+                       return $GLOBALS['setup_info']['property']['currentver'];
+               }
+       }
+       
+

Modified: trunk/property/templates/base/actor.xsl
===================================================================
--- trunk/property/templates/base/actor.xsl     2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/templates/base/actor.xsl     2008-02-02 13:52:39 UTC (rev 
18466)
@@ -20,7 +20,6 @@
        </xsl:template>
 
        <xsl:template match="list">
-               <xsl:call-template name="menu"/>
                <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
                        <xsl:choose>
                                <xsl:when test="msgbox_data != ''">

Modified: trunk/property/templates/base/admin_entity.xsl
===================================================================
--- trunk/property/templates/base/admin_entity.xsl      2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/templates/base/admin_entity.xsl      2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -5,15 +5,9 @@
                        <xsl:when test="edit">
                                <xsl:apply-templates select="edit"/>
                        </xsl:when>
-                       <xsl:when test="edit_status">
-                               <xsl:apply-templates select="edit_status"/>
-                       </xsl:when>
                        <xsl:when test="list_attribute">
                                <xsl:apply-templates select="list_attribute"/>
                        </xsl:when>
-                       <xsl:when test="list_status">
-                               <xsl:apply-templates select="list_status"/>
-                       </xsl:when>
                        <xsl:when test="edit_attrib">
                                <xsl:apply-templates select="edit_attrib"/>
                        </xsl:when>
@@ -40,7 +34,6 @@
        
 
        <xsl:template match="list">             
-               <xsl:call-template name="menu"/> 
                <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
                        <tr>
                                <td align="right">
@@ -128,97 +121,7 @@
                        </tr>
        </xsl:template>
        
-       <xsl:template match="list_status">              
-               <xsl:call-template name="menu"/> 
-               <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
-                       <tr>
-                               <td align="right">
-                                       <xsl:call-template name="search_field"/>
-                               </td>
-                       </tr>
-                       <tr>
-                               <td class="th_text" align="left">
-                                       <xsl:value-of select="lang_entity"/>
-                                       <xsl:text>: </xsl:text>
-                                       <xsl:value-of select="entity_name"/>
-                               </td>
-                       </tr>
-                       <tr>
-                               <td class="th_text" align="left">
-                                       <xsl:value-of select="lang_category"/>
-                                       <xsl:text>: </xsl:text>
-                                       <xsl:value-of select="category_name"/>
-                               </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_status"/>
-                               <xsl:apply-templates select="values_status"/>
-                               <xsl:apply-templates select="table_add"/>
-               </table>
-       </xsl:template>
-
-       <xsl:template match="table_header_status">
-               <xsl:variable name="sort_id"><xsl:value-of 
select="sort_id"/></xsl:variable>
-               <xsl:variable name="sort_name"><xsl:value-of 
select="sort_name"/></xsl:variable>
-               <tr class="th">
-                       <td class="th_text" width="10%" align="right">
-                               <a href="{$sort_id}"><xsl:value-of 
select="lang_id"/></a>
-                       </td>
-                       <td class="th_text" width="20%" align="center">
-                               <xsl:value-of select="lang_descr"/>
-                       </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_status"> 
-               <xsl:variable name="lang_edit_standardtext"><xsl:value-of 
select="lang_edit_standardtext"/></xsl:variable>
-               <xsl:variable name="lang_delete_standardtext"><xsl:value-of 
select="lang_delete_standardtext"/></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="right">
-                                       <xsl:value-of select="id"/>
-                               </td>
-                               <td align="left">
-                                       <xsl:value-of select="descr"/>
-                               </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_standardtext}';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_standardtext}';return true;" 
onMouseout="window.status='';return true;"><xsl:value-of 
select="text_delete"/></a>
-                               </td>
-                       </tr>
-       </xsl:template>
-       
        <xsl:template match="list_category">            
-               <xsl:call-template name="menu"/> 
                <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
                        <tr>
                                <td align="right">
@@ -329,7 +232,6 @@
        
        
                <xsl:template match="list_config">              
-                       <xsl:call-template name="menu"/> 
                        <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
                                <tr>
                                        <td align="right">
@@ -840,111 +742,6 @@
                </div>
        </xsl:template>
 
-<!-- add_status / edit_status  -->
-       <xsl:template match="edit_status">
-               <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>
-                       <tr>
-                               <td valign="top">
-                                       <xsl:value-of select="lang_id"/>
-                               </td>
-                               <xsl:choose>
-                                       <xsl:when test="value_id != ''">
-                                               <td>
-                                                       <xsl:value-of 
select="value_id"/>
-                                                       <input type="hidden" 
name="values[id]" value="{value_id}"></input>
-                                               </td>
-                                       </xsl:when>
-                                       <xsl:otherwise>
-                                               <td>
-                                                       <input type="text" 
name="values[id]" value="{value_id}" onMouseout="window.status='';return true;">
-                                                               <xsl:attribute 
name="onMouseover">
-                                                                       
<xsl:text>window.status='</xsl:text>
-                                                                               
<xsl:value-of select="lang_id_standardtext"/>
-                                                                       
<xsl:text>'; return true;</xsl:text>
-                                                               </xsl:attribute>
-                                                       </input>
-                                               </td>
-                                       </xsl:otherwise>
-                               </xsl:choose>
-                       </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_standardtext"/>
-                                                       <xsl:text>'; return 
true;</xsl:text>
-                                               </xsl:attribute>
-                                               <xsl:value-of 
select="value_descr"/>            
-                                       </textarea>
-
-                               </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_standardtext"/>
-                                                       <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_standardtext"/>
-                                                               <xsl:text>'; 
return true;</xsl:text>
-                                                       </xsl:attribute>
-                                               </input>
-                                       </form>
-                               </td>
-                       </tr>
-               </table>
-               </div>
-       </xsl:template>
-
 <!-- list attribute -->
 
        <xsl:template match="list_attribute">

Modified: trunk/property/templates/base/admin_location.xsl
===================================================================
--- trunk/property/templates/base/admin_location.xsl    2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/templates/base/admin_location.xsl    2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -23,7 +23,6 @@
                </xsl:choose>
        </xsl:template>
        <xsl:template match="list">             
-               <xsl:call-template name="menu"/> 
                <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
                        <xsl:choose>
                                <xsl:when test="msgbox_data != ''">
@@ -131,7 +130,6 @@
        
        
                <xsl:template match="list_config">              
-                       <xsl:call-template name="menu"/> 
                        <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
                                <tr>
                                        <td align="right">
@@ -454,6 +452,13 @@
                
                <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
                        <tr>
+                               <td align="left">
+                                       <xsl:value-of select="lang_type"/>
+                                       <xsl:text>: </xsl:text>
+                                       <xsl:value-of select="value_type_name"/>
+                               </td>
+                       </tr>
+                       <tr>
                                <td align="right">
                                        <xsl:call-template name="search_field"/>
                                </td>
@@ -476,9 +481,6 @@
                <xsl:variable name="sort_name"><xsl:value-of 
select="sort_name"/></xsl:variable>
                <tr class="th">
                        <td class="th_text" width="10%" align="left">
-                               <xsl:value-of select="lang_type_name"/>
-                       </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="10%" align="left">
@@ -519,11 +521,7 @@
                                                </xsl:otherwise>
                                        </xsl:choose>
                                </xsl:attribute>
-
                                <td align="left">
-                                       <xsl:value-of select="type_name"/>
-                               </td>
-                               <td align="left">
                                        <xsl:value-of select="column_name"/>
                                </td>
                                <td align="left">

Modified: trunk/property/templates/base/agreement.xsl
===================================================================
--- trunk/property/templates/base/agreement.xsl 2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/templates/base/agreement.xsl 2008-02-02 13:52:39 UTC (rev 
18466)
@@ -29,7 +29,6 @@
        </xsl:template>
 
        <xsl:template match="list">
-               <xsl:call-template name="menu"/>
                <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
                        <xsl:choose>
                                <xsl:when test="msgbox_data != ''">

Modified: trunk/property/templates/base/alarm.xsl
===================================================================
--- trunk/property/templates/base/alarm.xsl     2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/templates/base/alarm.xsl     2008-02-02 13:52:39 UTC (rev 
18466)
@@ -17,7 +17,6 @@
        </xsl:template>
 
        <xsl:template match="list">
-               <xsl:call-template name="menu"/>
                <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
                        <xsl:choose>
                                <xsl:when test="msgbox_data != ''">
@@ -427,7 +426,6 @@
 
 
        <xsl:template match="list_alarm">
-               <xsl:call-template name="menu"/>
                <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
                        <xsl:choose>
                                <xsl:when test="msgbox_data != ''">

Modified: trunk/property/templates/base/attributes_form.xsl
===================================================================
--- trunk/property/templates/base/attributes_form.xsl   2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/templates/base/attributes_form.xsl   2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -22,21 +22,18 @@
                                </xsl:attribute>
 
                                <td class="{class}" align="left" valign="top" 
title="{$statustext}" style="cursor:help">
-                                       <xsl:value-of select="input_text"/>
                                        <xsl:choose>
                                                <xsl:when test="helpmsg=1">
-                                                       <xsl:variable 
name="help_url"><xsl:value-of select="//help_url"/>&amp;attrib_id=<xsl:value-of 
select="attrib_id"/></xsl:variable>
-                                                       <xsl:variable 
name="lang_help"><xsl:value-of select="//lang_help"/></xsl:variable>
+                                                       <xsl:variable 
name="help_url"><xsl:value-of select="help_url"/></xsl:variable>
                                                        <a href="javascript:var 
w=window.open('{$help_url}','','width=550,height=400,scrollbars')">
-                                                       <xsl:text> 
[</xsl:text><xsl:value-of select="$lang_help"/><xsl:text>]</xsl:text></a>
+                                                               
<xsl:text>[</xsl:text><xsl:value-of select="input_text"/><xsl:text>]</xsl:text>
+                                                       </a>
                                                </xsl:when>
+                                               <xsl:otherwise>
+                                                       <xsl:value-of 
select="input_text"/>
+                                               </xsl:otherwise>
                                        </xsl:choose>
                                        <xsl:choose>
-                                               <xsl:when test="datatype='D'">
-                                                       
<xsl:text>[</xsl:text><xsl:value-of 
select="//lang_dateformat"/><xsl:text>]</xsl:text>                  
-                                               </xsl:when>
-                                       </xsl:choose>
-                                       <xsl:choose>
                                                <xsl:when test="datatype='pwd'">
                                                        <br/>
                                                        <xsl:text>[ </xsl:text>
@@ -59,7 +56,7 @@
                                                        <input type="hidden" 
name="values_attribute[{counter}][datatype]" value="{datatype}"></input>
                                                        <input type="hidden" 
name="values_attribute[{counter}][history]" value="{history}"></input>
                                                        <input type="hidden" 
name="values_attribute[{counter}][attrib_id]" value="{attrib_id}"></input>
-                                                       <input type="hidden" 
name="values_attribute[{counter}][allow_null]" value="{allow_null}"></input>
+                                                       <input type="hidden" 
name="values_attribute[{counter}][nullable]" value="{nullable}"></input>
                                                        <input type="hidden" 
name="values_attribute[{counter}][input_text]" value="{input_text}"></input>
                                                        <xsl:choose>
                                                                <xsl:when 
test="datatype='R'">
@@ -187,7 +184,7 @@
                                                                                
</xsl:attribute>
                                                                        </input>
                                                                </xsl:when>
-                                                               <xsl:when 
test="datatype='D'">
+                                       <!--                    <xsl:when 
test="datatype='D'">
                                                                        <input 
type="text" name="values_attribute[{counter}][value]" value="{value}" 
onFocus="{//dateformat_validate}" onKeyUp="{//onKeyUp}" onBlur="{//onBlur}" 
size="12" maxlength="10"  onMouseout="window.status='';return true;" >
                                                                                
<xsl:choose>
                                                                                
        <xsl:when test="disabled!=''">
@@ -203,8 +200,31 @@
                                                                                
</xsl:attribute>
                                                                        </input>
                                                                </xsl:when>
+                                       -->
+                                                               <xsl:when 
test="datatype='D'">
+                                                                       <input 
type="text" id="values_attribute_{counter}" 
name="values_attribute[{counter}][value]" value="{value}"  size="12" 
maxlength="12"  onMouseout="window.status='';return true;" >
+                                                                               
<xsl:attribute name="readonly">
+                                                                               
        <xsl:text> readonly</xsl:text>
+                                                                               
</xsl:attribute>
+                                                                               
<xsl:attribute name="onMouseover">
+                                                                               
        <xsl:text>window.status='</xsl:text>
+                                                                               
                <xsl:value-of select="statustext"/>
+                                                                               
        <xsl:text>';return true;</xsl:text>
+                                                                               
</xsl:attribute>
+                                                                               
<xsl:choose>
+                                                                               
        <xsl:when test="disabled!=''">
+                                                                               
                <xsl:attribute name="disabled">
+                                                                               
                        <xsl:text> disabled</xsl:text>
+                                                                               
                </xsl:attribute>
+                                                                               
        </xsl:when>
+                                                                               
</xsl:choose>
+                                                                       </input>
+                                                                       <img 
id="values_attribute_{counter}-trigger" src="{img_cal}" alt="{lang_datetitle}" 
title="{lang_datetitle}" style="cursor:pointer; cursor:hand;" />
+                                                               </xsl:when>
+
+
                                                                <xsl:when 
test="datatype='T'">
-                                                                       
<textarea cols="40" rows="6" name="values_attribute[{counter}][value]" 
wrap="virtual" onMouseout="window.status='';return true;">
+                                                                       
<textarea cols="{//textareacols}" rows="{//textarearows}" 
name="values_attribute[{counter}][value]" wrap="virtual" 
onMouseout="window.status='';return true;">
                                                                                
<xsl:choose>
                                                                                
        <xsl:when test="disabled!=''">
                                                                                
                <xsl:attribute name="disabled">

Modified: trunk/property/templates/base/attributes_view.xsl
===================================================================
--- trunk/property/templates/base/attributes_view.xsl   2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/templates/base/attributes_view.xsl   2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -28,8 +28,6 @@
                                <td align="left">
                                        <xsl:choose>
                                                <xsl:when test="name!=''">
-                                                       <input type="hidden" 
name="values_attribute[{counter}][name]" value="{name}"></input>
-                                                       <input type="hidden" 
name="values_attribute[{counter}][datatype]" value="{datatype}"></input>
                                                        <xsl:choose>
                                                                <xsl:when 
test="datatype='R'">
                                                                        
<xsl:call-template name="choice_view"/>
@@ -38,20 +36,10 @@
                                                                        
<xsl:call-template name="choice_view"/>
                                                                </xsl:when>
                                                                <xsl:when 
test="datatype='LB'">
-                                                                       <select 
disabled="disabled" class="forms" onMouseover="window.status='{statustext}'; 
return true;" onMouseout="window.status='';return true;">
-                                                                               
<option value=""><xsl:value-of select="//lang_none"/></option>
-                                                                               
<xsl:for-each select="choice">  
-                                                                               
        <xsl:variable name="id"><xsl:value-of select="id"/></xsl:variable>
-                                                                               
        <xsl:choose>
-                                                                               
                <xsl:when test="checked='checked'">
-                                                                               
                        <option value="{$id}" selected="selected"><xsl:value-of 
disable-output-escaping="yes" select="value"/></option>
-                                                                               
                </xsl:when>
-                                                                               
                <xsl:otherwise>
-                                                                               
                        <option value="{$id}"><xsl:value-of 
disable-output-escaping="yes" select="value"/></option>
-                                                                               
                </xsl:otherwise>
-                                                                               
        </xsl:choose>                           
+                                                                       
<xsl:for-each select="choice[checked='checked']" >
+                                                                               
<xsl:value-of select="value"/>
+                                                                               
<xsl:if test="position() != last()">, </xsl:if>
                                                                                
</xsl:for-each>
-                                                                       
</select>
                                                                </xsl:when>
                                                                <xsl:when 
test="datatype='AB'">
                                                                        <input 
type="text" value="{value}" readonly="readonly" size="5" 
onMouseout="window.status='';return true;" >
@@ -86,32 +74,11 @@
                                                                        </input>
                                                                </xsl:when>
                                                                <xsl:when 
test="datatype='D'">
-                                                                       <input 
type="text" name="values_attribute[{counter}][value]" value="{value}" 
readonly="readonly" size="12" maxlength="10"  
onMouseout="window.status='';return true;" >
-                                                                               
<xsl:attribute name="onMouseover">
-                                                                               
        <xsl:text>window.status='</xsl:text>
-                                                                               
                <xsl:value-of select="statustext"/>
-                                                                               
        <xsl:text>';return true;</xsl:text>
-                                                                               
</xsl:attribute>
-                                                                       </input>
-                                                               </xsl:when>
-                                                               <xsl:when 
test="datatype='T'">
-                                                                       
<textarea cols="40" rows="6" name="values_attribute[{counter}][value]" 
wrap="virtual" readonly="readonly" onMouseout="window.status='';return true;">
-                                                                               
<xsl:attribute name="onMouseover">
-                                                                               
        <xsl:text>window.status='</xsl:text>
-                                                                               
                <xsl:value-of select="statustext"/>
-                                                                               
        <xsl:text>';return true;</xsl:text>
-                                                                               
</xsl:attribute>
                                                                                
<xsl:value-of select="value"/>          
-                                                                       
</textarea>
+                                                                       <img 
id="values_attribute_{counter}-trigger"/>
                                                                </xsl:when>
                                                                <xsl:otherwise>
-                                                                       <input 
type="text" name="values_attribute[{counter}][value]" value="{value}" 
readonly="readonly" size="30" onMouseout="window.status='';return true;" >
-                                                                               
<xsl:attribute name="onMouseover">
-                                                                               
        <xsl:text>window.status='</xsl:text>
-                                                                               
                <xsl:value-of select="statustext"/>
-                                                                               
        <xsl:text>';return true;</xsl:text>
-                                                                               
</xsl:attribute>
-                                                                       </input>
+                                                                       
<xsl:value-of select="value"/>
                                                                </xsl:otherwise>
                                                        </xsl:choose>
                                                        <xsl:choose>

Modified: trunk/property/templates/base/b_account.xsl
===================================================================
--- trunk/property/templates/base/b_account.xsl 2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/templates/base/b_account.xsl 2008-02-02 13:52:39 UTC (rev 
18466)
@@ -12,7 +12,6 @@
        </xsl:template>
        
        <xsl:template match="list">
-               <xsl:call-template name="menu"/> 
                <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
                        <tr>
                                <td align="right">

Modified: trunk/property/templates/base/budget.xsl
===================================================================
--- trunk/property/templates/base/budget.xsl    2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/templates/base/budget.xsl    2008-02-02 13:52:39 UTC (rev 
18466)
@@ -16,7 +16,6 @@
        </xsl:template>
 
        <xsl:template match="list_basis">
-               <xsl:call-template name="menu"/>
                <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
                        <xsl:choose>
                                <xsl:when test="msgbox_data != ''">
@@ -158,7 +157,6 @@
 
 
        <xsl:template match="list">
-               <xsl:call-template name="menu"/>
                <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
                        <xsl:choose>
                                <xsl:when test="msgbox_data != ''">
@@ -772,7 +770,6 @@
        
 
        <xsl:template match="list_obligations">
-               <xsl:call-template name="menu"/>
                <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
                        <xsl:choose>
                                <xsl:when test="msgbox_data != ''">

Modified: trunk/property/templates/base/css/base.css
===================================================================
--- trunk/property/templates/base/css/base.css  2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/templates/base/css/base.css  2008-02-02 13:52:39 UTC (rev 
18466)
@@ -1,3 +1,5 @@
+/*
+ * Conflicts with newdesign
 body, div, input, p, select, textarea
 {
        font-family: Verdana, Arial, Helvetica, sans-serif;
@@ -3,5 +5,5 @@
        font-size: 11px;
 }
-
+*/
 a
 {

Modified: trunk/property/templates/base/custom.xsl
===================================================================
--- trunk/property/templates/base/custom.xsl    2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/templates/base/custom.xsl    2008-02-02 13:52:39 UTC (rev 
18466)
@@ -14,7 +14,6 @@
        </xsl:template>
 
        <xsl:template match="list">
-               <xsl:call-template name="menu"/>
                <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
                        <xsl:choose>
                                <xsl:when test="msgbox_data != ''">

Modified: trunk/property/templates/base/document.xsl
===================================================================
--- trunk/property/templates/base/document.xsl  2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/templates/base/document.xsl  2008-02-02 13:52:39 UTC (rev 
18466)
@@ -20,7 +20,6 @@
 
 
        <xsl:template match="list">
-               <xsl:call-template name="menu"/> 
                <table width="100%"  cellpadding="2" cellspacing="2" 
align="center">
                        <tr>
                                <td align="left">
@@ -130,7 +129,6 @@
 
 
        <xsl:template match="list_document">
-               <xsl:call-template name="menu"/>
                <div align="left">
                <table width="100%"  cellpadding="2" cellspacing="2" 
align="center">
                        <xsl:choose>

Modified: trunk/property/templates/base/entity.xsl
===================================================================
--- trunk/property/templates/base/entity.xsl    2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/templates/base/entity.xsl    2008-02-02 13:52:39 UTC (rev 
18466)
@@ -18,7 +18,6 @@
        </xsl:template>
        
        <xsl:template match="list">
-               <xsl:call-template name="menu"/> 
                <xsl:choose>
                        <xsl:when test="msgbox_data != ''">
                                <table align = "center">
@@ -690,7 +689,6 @@
 <!-- emtpy -->
 
        <xsl:template match="empty">
-               <xsl:call-template name="menu"/> 
                <table width="100%"  cellpadding="2" cellspacing="2" 
align="center">
                        <tr>
                                <td>

Modified: trunk/property/templates/base/gab.xsl
===================================================================
--- trunk/property/templates/base/gab.xsl       2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/templates/base/gab.xsl       2008-02-02 13:52:39 UTC (rev 
18466)
@@ -155,7 +155,6 @@
        </xsl:template>
 
        <xsl:template match="list_gab">
-               <xsl:call-template name="menu"/> 
                <div align="center">
                <table width="100%"  cellpadding="2" cellspacing="2" 
align="center">
                <xsl:variable name="select_url"><xsl:value-of 
select="select_action"/></xsl:variable>
@@ -311,7 +310,6 @@
        </xsl:template>
 
        <xsl:template match="list_gab_detail">
-               <xsl:call-template name="menu"/> 
                <table width="100%"  cellpadding="2" cellspacing="2" 
align="center">
                        <tr>
                                <td class="th_text" width="5%" align="left">

Modified: trunk/property/templates/base/ifc.xsl
===================================================================
--- trunk/property/templates/base/ifc.xsl       2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/templates/base/ifc.xsl       2008-02-02 13:52:39 UTC (rev 
18466)
@@ -12,12 +12,6 @@
 <!-- import -->
 
        <xsl:template match="import">
-               
-               <xsl:choose>
-                       <xsl:when test="links !=''">
-                               <xsl:call-template name="menu"/> 
-                       </xsl:when>
-               </xsl:choose>
                <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
                        <xsl:choose>
                                <xsl:when test="msgbox_data != ''">

Modified: trunk/property/templates/base/investment.xsl
===================================================================
--- trunk/property/templates/base/investment.xsl        2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/templates/base/investment.xsl        2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -15,7 +15,6 @@
        </xsl:template>
        
        <xsl:template match="list">
-               <xsl:call-template name="menu"/> 
                <xsl:variable name="form_action"><xsl:value-of 
select="form_action"/></xsl:variable>
                <form method="post" name="form_search" action="{$form_action}">
                <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
@@ -303,7 +302,6 @@
 
        <xsl:template match="history">
                
-               <xsl:call-template name="menu"/> 
                <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
                        <xsl:choose>
                                <xsl:when test="msgbox_data != ''">

Modified: trunk/property/templates/base/invoice.xsl
===================================================================
--- trunk/property/templates/base/invoice.xsl   2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/templates/base/invoice.xsl   2008-02-02 13:52:39 UTC (rev 
18466)
@@ -125,7 +125,6 @@
 <!-- list_voucher -->
 
        <xsl:template match="list_voucher">
-               <xsl:call-template name="menu"/> 
                <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
                        <xsl:choose>
                                <xsl:when test="msgbox_data != ''">
@@ -574,7 +573,6 @@
                        }               
                </script>
 
-               <xsl:call-template name="menu"/> 
                <xsl:variable name="form_action"><xsl:value-of 
select="link_url"/></xsl:variable>
                <div align="left">
                <form method="post" name="form" action="{$form_action}">
@@ -863,7 +861,6 @@
                        }               
                </script>
 
-               <xsl:call-template name="menu"/> 
                <xsl:variable name="form_action"><xsl:value-of 
select="form_action"/></xsl:variable>
                <div align="left">
                <form method="post" name="form" action="{$form_action}">
@@ -1265,7 +1262,6 @@
                        }               
                </script>
 
-               <xsl:call-template name="menu"/>
                <div align="left">
                <table cellpadding="2" cellspacing="2" width="80%" 
align="center">
                        <tr>
@@ -1590,7 +1586,6 @@
                        }               
                </script>
 
-               <xsl:call-template name="menu"/>
                <div align="left">
                <table cellpadding="2" cellspacing="2" width="80%" 
align="center">
                        <tr>
@@ -2023,7 +2018,6 @@
 <!-- export -->
 
        <xsl:template match="export">
-               <xsl:call-template name="menu"/> 
                <div align="left">
                <table cellpadding="2" cellspacing="2" width="80%" 
align="center">
                        <xsl:choose>
@@ -2123,7 +2117,6 @@
 <!-- rollback -->
 
        <xsl:template match="rollback">
-               <xsl:call-template name="menu"/> 
                <div align="left">
                <table cellpadding="2" cellspacing="2" width="80%" 
align="center">
                        <xsl:choose>
@@ -2219,7 +2212,6 @@
 <!--list_invoice_sub-->
 
        <xsl:template match="list_invoice_sub">
-               <xsl:call-template name="menu"/> 
                <table width="80%" cellpadding="2" cellspacing="2" 
align="center">
                        <xsl:choose>
                                <xsl:when test="msgbox_data != ''">

Modified: trunk/property/templates/base/location.xsl
===================================================================
--- trunk/property/templates/base/location.xsl  2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/templates/base/location.xsl  2008-02-02 13:52:39 UTC (rev 
18466)
@@ -35,11 +35,6 @@
                        </xsl:when>
                </xsl:choose>
 
-               <xsl:choose>
-                       <xsl:when test="lookup=''">
-                               <xsl:call-template name="menu"/> 
-                       </xsl:when>
-               </xsl:choose>
                <table width="100%" cellpadding="0" cellspacing="1" 
align="center">
                        <tr>
                                <td>
@@ -778,7 +773,6 @@
 <!-- stop -->
 
        <xsl:template match="stop">
-                       <xsl:call-template name="menu"/> 
                        <table cellpadding="2" cellspacing="2" align="center">
                        <xsl:choose>
                                <xsl:when test="msgbox_data != ''">
@@ -805,7 +799,6 @@
 
 
        <xsl:template match="summary">
-               <xsl:call-template name="menu"/> 
                <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
                        <tr>
                                <td>

Modified: trunk/property/templates/base/no_access.xsl
===================================================================
--- trunk/property/templates/base/no_access.xsl 2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/templates/base/no_access.xsl 2008-02-02 13:52:39 UTC (rev 
18466)
@@ -10,11 +10,6 @@
        
        <xsl:template match="no_access">
                
-               <xsl:choose>
-                       <xsl:when test="links !=''">
-                               <xsl:call-template name="menu"/> 
-                       </xsl:when>
-               </xsl:choose>
                <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
                        <xsl:choose>
                                <xsl:when test="msgbox_data != ''">

Modified: trunk/property/templates/base/p_of_town.xsl
===================================================================
--- trunk/property/templates/base/p_of_town.xsl 2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/templates/base/p_of_town.xsl 2008-02-02 13:52:39 UTC (rev 
18466)
@@ -14,7 +14,6 @@
        </xsl:template>
 
        <xsl:template match="list">
-               <xsl:call-template name="menu"/>
                <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
                        <xsl:choose>
                                <xsl:when test="msgbox_data != ''">

Modified: trunk/property/templates/base/pricebook.xsl
===================================================================
--- trunk/property/templates/base/pricebook.xsl 2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/templates/base/pricebook.xsl 2008-02-02 13:52:39 UTC (rev 
18466)
@@ -30,7 +30,6 @@
        </xsl:template>
        
        <xsl:template match="list">
-               <xsl:call-template name="menu"/> 
                <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
                        <xsl:choose>
                                <xsl:when test="msgbox_data != ''">
@@ -235,7 +234,6 @@
        </xsl:template>
 
        <xsl:template match="agreement_group">
-               <xsl:call-template name="menu"/> 
                <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
                        <xsl:choose>
                                <xsl:when test="msgbox_data != ''">
@@ -342,7 +340,6 @@
 
        <xsl:template match="prizing">
                <div align="left">
-               <xsl:call-template name="menu"/> 
                <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
                        <xsl:choose>
                                <xsl:when test="msgbox_data != ''">
@@ -500,7 +497,6 @@
        </xsl:template>
 
        <xsl:template match="list_activities">          
-               <xsl:call-template name="menu"/> 
                <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
                        <xsl:choose>
                                <xsl:when test="msgbox_data != ''">
@@ -636,7 +632,6 @@
 
        <xsl:template match="list_activity_vendor">
                
-               <xsl:call-template name="menu"/> 
                <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
                        <xsl:choose>
                                <xsl:when test="msgbox_data != ''">

Modified: trunk/property/templates/base/project.xsl
===================================================================
--- trunk/property/templates/base/project.xsl   2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/templates/base/project.xsl   2008-02-02 13:52:39 UTC (rev 
18466)
@@ -16,7 +16,6 @@
        
        <xsl:template match="list_project">
 
-               <xsl:call-template name="menu"/> 
                <table width="100%"  cellpadding="2" cellspacing="2" 
align="center">
                        <tr>
                                <td>

Modified: trunk/property/templates/base/r_agreement.xsl
===================================================================
--- trunk/property/templates/base/r_agreement.xsl       2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/templates/base/r_agreement.xsl       2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -42,7 +42,6 @@
                        }               
                </script>
 
-               <xsl:call-template name="menu"/>
                <xsl:variable name="form_action"><xsl:value-of 
select="form_action"/></xsl:variable>
                <form method="post" name="form" action="{$form_action}">
 

Modified: trunk/property/templates/base/request.xsl
===================================================================
--- trunk/property/templates/base/request.xsl   2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/templates/base/request.xsl   2008-02-02 13:52:39 UTC (rev 
18466)
@@ -75,7 +75,6 @@
        </xsl:template>
 
        <xsl:template match="list">
-               <xsl:call-template name="menu"/> 
                <table width="100%"  cellpadding="2" cellspacing="2" 
align="center">
                        <tr>
                                <td>

Modified: trunk/property/templates/base/s_agreement.xsl
===================================================================
--- trunk/property/templates/base/s_agreement.xsl       2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/templates/base/s_agreement.xsl       2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -26,7 +26,6 @@
        </xsl:template>
 
        <xsl:template match="list">
-               <xsl:call-template name="menu"/>
                <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
                        <xsl:choose>
                                <xsl:when test="msgbox_data != ''">

Modified: trunk/property/templates/base/template.xsl
===================================================================
--- trunk/property/templates/base/template.xsl  2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/templates/base/template.xsl  2008-02-02 13:52:39 UTC (rev 
18466)
@@ -19,7 +19,6 @@
        
        <xsl:template match="list">
                
-               <xsl:call-template name="menu"/> 
                        <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
                                <tr>
                                        <td>
@@ -215,7 +214,6 @@
 
        <xsl:template match="list_template_hour">
                
-               <xsl:call-template name="menu"/> 
                <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
                        <xsl:choose>
                                <xsl:when test="msgbox_data != ''">

Modified: trunk/property/templates/base/tenant_claim.xsl
===================================================================
--- trunk/property/templates/base/tenant_claim.xsl      2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/property/templates/base/tenant_claim.xsl      2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -14,7 +14,6 @@
        </xsl:template>
 
        <xsl:template match="list">
-               <xsl:call-template name="menu"/>
                <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
                        <xsl:choose>
                                <xsl:when test="msgbox_data != ''">

Modified: trunk/property/templates/base/tts.xsl
===================================================================
--- trunk/property/templates/base/tts.xsl       2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/templates/base/tts.xsl       2008-02-02 13:52:39 UTC (rev 
18466)
@@ -25,8 +25,7 @@
        
        <xsl:template match="list">
                <xsl:variable name="autorefresh"><xsl:value-of 
select="autorefresh"/></xsl:variable>
-               <META HTTP-EQUIV="Refresh" CONTENT="{$autorefresh}"/>
-               <xsl:call-template name="menu"/> 
+               <meta http-equiv="refresh" content="{$autorefresh}"/>
                <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
                        <xsl:choose>
                                <xsl:when test="msgbox_data != ''">
@@ -238,8 +237,7 @@
 
        <xsl:template match="list2">
                <xsl:variable name="autorefresh"><xsl:value-of 
select="autorefresh"/></xsl:variable>
-               <META HTTP-EQUIV="Refresh" CONTENT="{$autorefresh}"/>           
-               <xsl:call-template name="menu"/> 
+               <meta http-equiv="refresh" content="{$autorefresh}"/>           
                <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
                        <xsl:choose>
                                <xsl:when test="msgbox_data != ''">

Modified: trunk/property/templates/base/wo_hour.xsl
===================================================================
--- trunk/property/templates/base/wo_hour.xsl   2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/templates/base/wo_hour.xsl   2008-02-02 13:52:39 UTC (rev 
18466)
@@ -145,7 +145,6 @@
        <xsl:template match="add_template">
                <div align="left">
                
-               <xsl:call-template name="menu"/> 
                <table cellpadding="2" cellspacing="2" width="80%" 
align="center">
                        <xsl:choose>
                                <xsl:when test="msgbox_data != ''">
@@ -245,7 +244,6 @@
 
        <xsl:template match="list_hour">
                
-               <xsl:call-template name="menu"/> 
                <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
                        <xsl:choose>
                                <xsl:when test="msgbox_data != ''">
@@ -740,7 +738,6 @@
 
        <xsl:template match="list_template">
                
-               <xsl:call-template name="menu"/> 
                <xsl:apply-templates select="workorder_data"/>
                        <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
                                <tr>
@@ -854,7 +851,6 @@
 
 
        <xsl:template match="list_template_hour">               
-               <xsl:call-template name="menu"/> 
                <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
                        <xsl:choose>
                                <xsl:when test="msgbox_data != ''">
@@ -1064,7 +1060,6 @@
 
 
        <xsl:template match="prizebook">        
-               <xsl:call-template name="menu"/> 
                <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
                        <xsl:choose>
                                <xsl:when test="msgbox_data != ''">

Modified: trunk/property/templates/base/workorder.xsl
===================================================================
--- trunk/property/templates/base/workorder.xsl 2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/property/templates/base/workorder.xsl 2008-02-02 13:52:39 UTC (rev 
18466)
@@ -19,7 +19,6 @@
        
        <xsl:template match="add">
                
-               <xsl:call-template name="menu"/> 
                <table width="50%"  cellpadding="2" cellspacing="2" 
align="center">
 
                        <tr height="50">
@@ -65,7 +64,6 @@
        </xsl:template>
 
        <xsl:template match="list_workorder">           
-               <xsl:call-template name="menu"/> 
                <table width="100%"  cellpadding="2" cellspacing="2" 
align="center">
                        <tr>
                        <xsl:choose>

Modified: trunk/registration/setup/phpgw_sv.lang
===================================================================
--- trunk/registration/setup/phpgw_sv.lang      2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/registration/setup/phpgw_sv.lang      2008-02-02 13:52:39 UTC (rev 
18466)
@@ -36,3 +36,4 @@
 you must fill in all of the required fields    registration    sv      Du 
m\xE5ste fylla i alla obligatoriska f\xE4lt
 you specified a value for      registration    sv      Du m\xE5ste ange ett 
v\xE4rde f\xF6r
 zip/postal     registration    sv      Postnummer
+

Modified: trunk/setup/applications.php
===================================================================
--- trunk/setup/applications.php        2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/setup/applications.php        2008-02-02 13:52:39 UTC (rev 18466)
@@ -24,19 +24,23 @@
                'noapi'                 => true
        );
        
+
        /**
         * Include setup functions
         */
        include ('./inc/functions.inc.php');
 
-       if ( isset($_POST['cancel']) && $_POST['cancel'] )
+       if ( phpgw::get_var('cancel', 'bool', 'POST') )
        {
-               Header("Location: index.php");
+               Header('Location: index.php');
                exit;
        }
 
        @set_time_limit(0);
 
+       $DEBUG = phpgw::get_var('debug', 'bool');
+
+
        // Check header and authentication
        if (!$GLOBALS['phpgw_setup']->auth('Config'))
        {
@@ -49,7 +53,8 @@
 
        $tpl_root = $GLOBALS['phpgw_setup']->html->setup_tpl_dir('setup');
        $setup_tpl = CreateObject('phpgwapi.Template',$tpl_root);
-       $setup_tpl->set_file(array(
+       $setup_tpl->set_file(array
+       (
                'T_head' => 'head.tpl',
                'T_footer' => 'footer.tpl',
                'T_alert_msg' => 'msg_alert_msg.tpl',
@@ -72,8 +77,6 @@
        $setup_tpl->set_block('T_setup_main','footer','footer');
        $setup_tpl->set_var('lang_cookies_must_be_enabled', lang('<b>NOTE:</b> 
You must have cookies enabled to use setup and header admin!') );
 
-       $bg_class = array('row_on', 'row_off');
-
        /**
         * Parse dependencies
         * 
@@ -139,29 +142,28 @@
                {
                        foreach($remove as $appname => $key)
                        {
-                               echo '<h3>' . lang('Processing: %1', $appname) 
. "</h3>\n<ul>";
-                               $terror = array();
-                               $terror[] = $setup_info[$appname];
+                               echo '<h3>' . lang('Processing: %1', 
lang($appname)) . "</h3>\n<ul>";
+                               $terror = array( $setup_info[$appname] );
 
                                if ( isset($setup_info[$appname]['tables'])
                                        && $setup_info[$appname]['tables'] )
                                {
-                                       
$GLOBALS['phpgw_setup']->process->droptables($terror,$DEBUG);
-                                       echo 
"<li>{$setup_info[$appname]['title']} " . lang('tables dropped') . ".</li>\n";
+                                       
$GLOBALS['phpgw_setup']->process->droptables($terror, $DEBUG);
+                                       echo '<li>' . lang('%1 tables dropped', 
lang($appname)) . ".</li>\n";
                                }
 
-                               
$GLOBALS['phpgw_setup']->deregister_app($setup_info[$appname]['name']);
-                               echo "<li>{$setup_info[$appname]['title']} " . 
lang('deregistered') . ".</li>\n";
+                               
$GLOBALS['phpgw_setup']->deregister_app($appname);
+                               echo '<li>' . lang('%1 deregistered', 
lang($appname)) . ".</li>\n";
 
                                if (isset($setup_info[$appname]['hooks'])
                                        && $setup_info[$appname]['hooks'] )
                                {
-                                       
$GLOBALS['phpgw_setup']->deregister_hooks($setup_info[$appname]['name']);
-                                       echo 
"<li>{$setup_info[$appname]['title']} " . lang('hooks deregistered') . 
".</li>\n";
+                                       
$GLOBALS['phpgw_setup']->deregister_hooks($appname);
+                                       echo '<li>' . lang('%1 hooks 
deregistered', lang($appname)) . ".</li>\n";
                                }
 
-                               $terror = 
$GLOBALS['phpgw_setup']->process->drop_langs($terror,$DEBUG);
-                               echo "<li>{$setup_info[$appname]['title']} " . 
lang('Translations removed') . ".</li>\n</ul>\n";
+                               $terror = 
$GLOBALS['phpgw_setup']->process->drop_langs($terror, $DEBUG);
+                               echo '<li>' . lang('%1 translations removed', 
$appname) . ".</li>\n</ul>\n";
                        }
                }
 
@@ -169,9 +171,8 @@
                {
                        foreach($install as $appname => $key)
                        {
-                               echo '<h3>' . lang('Processing: %1', $appname) 
. "</h3>\n<ul>";
-                               $terror = array();
-                               $terror[] = $setup_info[$appname];
+                               echo '<h3>' . lang('Processing: %1', 
lang($appname)) . "</h3>\n<ul>";
+                               $terror = array($setup_info[$appname]);
 
                                if ( isset($setup_info[$appname]['tables'])
                                        && 
is_array($setup_info[$appname]['tables']) )
@@ -183,21 +184,21 @@
                                }
                                else
                                {
-                                       if 
($GLOBALS['phpgw_setup']->app_registered($setup_info[$appname]['name']))
+                                       if 
($GLOBALS['phpgw_setup']->app_registered($appname))
                                        {
-                                               
$GLOBALS['phpgw_setup']->update_app($setup_info[$appname]['name']);
+                                               
$GLOBALS['phpgw_setup']->update_app($appname);
                                        }
                                        else
                                        {
-                                               
$GLOBALS['phpgw_setup']->register_app($setup_info[$appname]['name']);
+                                               
$GLOBALS['phpgw_setup']->register_app($appname);
                                        }
-                                       echo 
"<li>{$setup_info[$appname]['name']} " . lang('registered') . ".</li>\n";
+                                       echo '<li>' . lang('%1 registered', 
lang($appname)) . ".</li>\n";
 
                                        if ( 
isset($setup_info[$appname]['hooks'])
                                                && 
is_array($setup_info[$appname]['hooks']) )
                                        {
-                                               
$GLOBALS['phpgw_setup']->register_hooks($setup_info[$appname]['name']);
-                                               echo 
"<li>{$setup_info[$appname]['name']} " . lang('hooks registered') . ".</li>\n";
+                                               
$GLOBALS['phpgw_setup']->register_hooks($appname);
+                                               echo '<li>' . lang('%1 hooks 
registered', lang($appname)) . ".</li>\n";
                                        }
                                }
                                $force_en = False;
@@ -206,7 +207,7 @@
                                        $force_en = true;
                                }
                                $terror = 
$GLOBALS['phpgw_setup']->process->add_langs($terror,$DEBUG,$force_en);
-                               echo "<li>{$setup_info[$appname]['name']} " . 
lang('Translations added') . ".</li>\n</ul>\n";
+                               echo '<li>' . lang('%1 translations added', 
lang($appname)) . ".</li>\n</ul>\n";
                        }
                }
 
@@ -214,23 +215,23 @@
                {
                        foreach($upgrade as $appname => $key)
                        {
-                               echo '<h3>' . lang('Processing: %1', $appname) 
. "</h3>\n<ul>";
+                               echo '<h3>' . lang('Processing: %1', 
lang($appname)) . "</h3>\n<ul>";
                                $terror = array();
                                $terror[] = $setup_info[$appname];
 
                                
$GLOBALS['phpgw_setup']->process->upgrade($terror,$DEBUG);
                                if ($setup_info[$appname]['tables'])
                                {
-                                       echo 
"<li>{$setup_info[$appname]['name']} " . lang('tables upgraded') . ".</li>";
+                                       echo '<li>' . lang('%1 tables 
upgraded', lang($appname)) . ".</li>";
                                        // The process_upgrade() function also 
handles registration
                                }
                                else
                                {
-                                       echo 
"<li>{$setup_info[$appname]['name']} " . lang('upgraded') . ".</li>";
+                                       echo '<li>' . lang('%1 upgraded', 
lang($appname)) . ".</li>";
                                }
 
                                $terror = 
$GLOBALS['phpgw_setup']->process->upgrade_langs($terror,$DEBUG);
-                               echo "<li>{$setup_info[$appname]['name']} " . 
lang('Translations upgraded') . ".</li>\n</ul>\n";
+                               echo '<li>' . lang('%1 translations upgraded', 
lang($appname)) . ".</li>\n</ul>\n";
                        }
                }
 
@@ -248,56 +249,54 @@
        if($detail)
        {
                ksort($setup_info[$detail]);
-               $setup_tpl->set_var('description','<a 
href="applications.php?debug='.$DEBUG.'">' . lang('Go back') . '</a>');
+               $name = lang($setup_info[$detail]['name']);
+               $setup_tpl->set_var('description', "<h2>{$name}</h2>\n<ul>\n");
                $setup_tpl->pparse('out','header');
-
-               
-               $name = ($setup_info[$detail]['title'] ? 
$setup_info[$detail]['title'] 
-                        : lang($setup_info[$detail]['name']));
-               $setup_tpl->set_var('name',lang('application'));
-               $setup_tpl->set_var('details', $name);
-               $setup_tpl->set_var('bg_class', 'th');
                $setup_tpl->pparse('out','detail');
        
                $i = 1;
                foreach($setup_info[$detail] as $key => $val)
                {
-                       if($key != 'title' && $key != 'name')
+                       switch ($key)
                        {
-                               $i = $i % 2;
+                               // ignore these ones
+                               case 'application':
+                               case 'app_group':
+                               case 'app_order':
+                               case 'enable':
+                               case 'name':
+                               case 'title':
+                               case '':
+                                       continue 2; //switch is a looping 
structure in php - see php.net/continue - skwashd jan08
 
-                               if ($key == 'tables')
-                               {
+                               case 'tables':
                                        $tblcnt = 
count($setup_info[$detail][$key]);
                                        if(is_array($val))
                                        {
-                                               $key = '<a 
href="sqltoarray.php?appname=' . $detail . '&amp;submit=True">' . $key . '(' . 
$tblcnt . ')</a>' . "\n";
-                                               $val = implode(',' . "\n",$val);
-                                       }
+                                               $key = '<a 
href="sqltoarray.php?appname=' . $detail . '&amp;submit=True">' . $key . '(' . 
$tblcnt . ')</a>';
+                                               $val = implode(',<br>', $val);
                                }
+                                       break;
                                
-                               if ($key == 'hooks')
-                               {
-                                       $val = implode(',',$val);
-                               }
-                               
-                               if ($key == 'depends')
-                               {
+                               case 'depends':
                                        $val = parsedep($val);
-                               }
+                                       break;
                                
+                               case 'hooks':
+                               default:
                                if (is_array($val))
                                {
-                                       $val = implode(',',$val);
+                                               $val = implode(', ', $val);
+                                       }
                                }
 
-                               $setup_tpl->set_var('bg_class', $bg_class[$i]);
-                               $setup_tpl->set_var('name',$key);
-                               $setup_tpl->set_var('details',$val);
+                       $i = $i % 2;
+                       $setup_tpl->set_var('name', $key);
+                       $setup_tpl->set_var('details', $val);
                                $setup_tpl->pparse('out','detail');
-                       }
                        ++$i;
                }
+               $setup_tpl->set_var('footer_text', "</ul>\n<a 
href=\"applications.php?debug={$DEBUG}\">" . lang('Go back') . '</a>');
                $setup_tpl->pparse('out','footer');
                exit;
        }
@@ -431,7 +430,6 @@
                $setup_tpl->set_var('remove_all',lang('Remove All'));
                $setup_tpl->set_var('lang_debug',lang('enable debug messages'));
                $setup_tpl->set_var('debug','<input type="checkbox" 
name="debug" value="True"' .($DEBUG ? ' checked' : '') . '>');
-               $setup_tpl->set_var('bg_class',$bg_class[0]);
 
                $setup_tpl->pparse('out','app_header');
 
@@ -440,25 +438,26 @@
                {
                        if( isset($value['name']) && $value['name'] != 
'phpgwapi' && $value['name'] != 'notifywindow')
                        {
-                               $i = ++$i % 2;
+                               ++$i;
+                               $row = $i % 2 ? 'off' : 'on';
                                $value['title'] = !isset($value['title']) || 
!strlen($value['title']) ? str_replace('*', '', lang($value['name'])) : 
$value['title'];
                                $setup_tpl->set_var('apptitle',$value['title']);
                                $setup_tpl->set_var('currentver', 
isset($value['currentver']) ? $value['currentver'] : '');
                                
$setup_tpl->set_var('version',$value['version']);
-                               $setup_tpl->set_var('bg_class', $bg_class[$i]);
+                               $setup_tpl->set_var('bg_class',  "row_{$row}");
                                $setup_tpl->set_var('row_remove', '');
                         
                                switch($value['status'])
                                {
                                        case 'C':
-                                               
$setup_tpl->set_var('row_remove', 'row_remove_' . ($i ? 'off' : 'on') );
+                                               
$setup_tpl->set_var('row_remove', "row_remove_{$row}");
                                                
$setup_tpl->set_var('remove','<input type="checkbox" name="remove[' . 
$value['name'] . ']" />');
                                                
$setup_tpl->set_var('upgrade','&nbsp;');
                                                if 
(!$GLOBALS['phpgw_setup']->detection->check_app_tables($value['name']))
                                                {
                                                        // App installed and 
enabled, but some tables are missing
                                                        
$setup_tpl->set_var('instimg','stock_database.png');
-                                                       
$setup_tpl->set_var('bg_class','row_err_table_' . ( $i % 1 ? 'off' : 'on') );
+                                                       
$setup_tpl->set_var('bg_class', "row_err_table_{$row}");
                                                        
$setup_tpl->set_var('instalt',lang('Not Completed'));
                                                        
$setup_tpl->set_var('resolution','<a href="applications.php?resolve=' . 
$value['name'] . '&amp;badinstall=True">' . lang('Potential Problem') . '</a>');
                                                        $status = 
lang('Requires reinstall or manual repair') . ' - ' . $value['status'];
@@ -481,7 +480,7 @@
                                                                {
                                                                        
$notables = '&amp;notables=True';
                                                                }
-                                                               
$setup_tpl->set_var('bg_class','row_err_gen_' . ( $i % 1 ? 'off' : 'on') );
+                                                               
$setup_tpl->set_var('bg_class', "row_err_gen_{$row}");
                                                                
$setup_tpl->set_var('resolution',
                                                                        '<a 
href="applications.php?resolve=' . $value['name'] .  $notables . '">' . 
lang('Possible Reasons') . '</a>'
                                                                );
@@ -494,12 +493,12 @@
                                                
$setup_tpl->set_var('instalt',lang('Not Completed'));
                                                if ( 
!isset($value['currentver']) || !$value['currentver'] )
                                                {
-                                                       
$setup_tpl->set_var('bg_class','row_install_' . ( $i % 1 ? 'off' : 'on') );
+                                                       
$setup_tpl->set_var('bg_class', "row_install_{$row}");
                                                        $status = 
"[{$value['status']}] " . lang('Please install');
                                                        if ( 
isset($value['tables']) && is_array($value['tables']) && 
$GLOBALS['phpgw_setup']->detection->check_app_tables($value['name'],True))
                                                        {
                                                                // Some tables 
missing
-                                                               
$setup_tpl->set_var('bg_class', 'row_err_gen_' . ( $i % 1 ? 'off' : 'on') );
+                                                               
$setup_tpl->set_var('bg_class', "row_err_gen_{$row}");
                                                                
$setup_tpl->set_var('instimg','stock_database.png');
                                                                
$setup_tpl->set_var('row_remove', 'row_remove_' . ($i ? 'off' : 'on') );
                                                                
$setup_tpl->set_var('remove','<input type="checkbox" name="remove[' . 
$value['name'] . ']" />');
@@ -510,14 +509,14 @@
                                                        {
                                                                
$setup_tpl->set_var('remove','&nbsp;');
                                                                
$setup_tpl->set_var('resolution','');
-                                                               $status = 
"[{$value['status']}] " . lang('Requires upgrade');
+                                                               $status = 
"[{$value['status']}] " . lang('Available to install');
                                                        }
                                                        
$setup_tpl->set_var('install','<input type="checkbox" name="install[' . 
$value['name'] . ']" />');
                                                        
$setup_tpl->set_var('upgrade','&nbsp;');
                                                }
                                                else
                                                {
-                                                       
$setup_tpl->set_var('bg_class','row_upgrade_' . ( $i % 1 ? 'off' : 'on') );
+                                                       
$setup_tpl->set_var('bg_class', "row_upgrade_{$row}");
                                                        
$setup_tpl->set_var('install','&nbsp;');
                                                        // TODO display some 
info about breakage if you mess with this app
                                                        
$setup_tpl->set_var('upgrade','<input type="checkbox" name="upgrade[' . 
$value['name'] . ']">');
@@ -538,7 +537,7 @@
                                                $status = "[{$value['status']}] 
" . lang('Version Mismatch');
                                                break;
                                        case 'D':
-                                               $setup_tpl->set_var('bg_class', 
'row_err_gen_' . ( $i % 1 ? 'off' : 'on') );
+                                               $setup_tpl->set_var('bg_class', 
"row_err_gen_{$row}");
                                                $depstring = 
parsedep($value['depends']);
                                                $setup_tpl->set_var('instimg', 
'stock_no.png');
                                                
$setup_tpl->set_var('instalt',lang('Dependency Failure'));
@@ -549,7 +548,7 @@
                                                $status = "[{$value['status']}] 
" . lang('Dependency Failure') . $depstring;
                                                break;
                                        case 'P':
-                                               $setup_tpl->set_var('bg_class', 
'row_err_gen_' . ( $i % 1 ? 'off' : 'on') );
+                                               $setup_tpl->set_var('bg_class', 
"row_err_gen_{$row}");
                                                $depstring = 
parsedep($value['depends']);
                                                $setup_tpl->set_var('instimg', 
'stock_no.png');
                                                
$setup_tpl->set_var('instalt',lang('Post-install Dependency Failure'));
@@ -582,4 +581,3 @@
                $setup_tpl->pparse('out','footer');
                $GLOBALS['phpgw_setup']->html->show_footer();
        }
-?>

Modified: trunk/setup/config.php
===================================================================
--- trunk/setup/config.php      2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/setup/config.php      2008-02-02 13:52:39 UTC (rev 18466)
@@ -57,13 +57,13 @@
                        {
                                $rest = substr($path,$len);
 
-                               if (!strlen($rest) || $rest[0] == 
DIRECTORY_SEPARATOR)
+                               if (!strlen($rest) || $rest[0] == '/')
                                {
-                                       return True;
+                                       return true;
                                }
                        }
                }
-               return False;
+               return false;
        }
 
        $setup_tpl->set_file(array(

Modified: trunk/setup/inc/functions.inc.php
===================================================================
--- trunk/setup/inc/functions.inc.php   2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/setup/inc/functions.inc.php   2008-02-02 13:52:39 UTC (rev 18466)
@@ -50,9 +50,9 @@
                require_once('../header.inc.php');
        }
 
-       if (!function_exists('html_entity_decode'))//html_entity_decode() is 
only available in PHP4.3+
+       if ( !function_exists('filter_var') || !function_exists('json_encode') 
) // filter_var() and json_encode are only available in PHP 5.2+
        {
-               die('<h1>You appear to be using PHP ' . PHP_VERSION . " 
phpGroupWare requires 4.3.0 or later <br>\n"
+               die('<h1>You appear to be using PHP ' . PHP_VERSION . " 
phpGroupWare requires 5.2.0 or later <br>\n"
                        . 'Please contact your System Administrator</h1>');
        }
 
@@ -63,14 +63,12 @@
                define('PHPGW_INCLUDE_ROOT', realpath('..') );
        }
 
-       define('SEP', DIRECTORY_SEPARATOR);
-
-       if ( is_dir(PHPGW_INCLUDE_ROOT . SEP . 'phpgwapi') && 
is_dir(PHPGW_INCLUDE_ROOT . SEP . 'phpgwapi' . SEP . 'inc')
-               && is_file(PHPGW_INCLUDE_ROOT . SEP . 'phpgwapi' .  SEP . 'inc' 
. SEP . 'common_functions.inc.php') )
+       if ( is_dir(PHPGW_INCLUDE_ROOT . '/phpgwapi') && 
is_dir(PHPGW_INCLUDE_ROOT . '/phpgwapi/inc')
+               && is_file(PHPGW_INCLUDE_ROOT . 
'/phpgwapi/inc/common_functions.inc.php') )
        {
-               require_once(PHPGW_INCLUDE_ROOT . SEP . 'phpgwapi' .  SEP . 
'inc' . SEP . 'common_functions.inc.php');
+               require_once(PHPGW_INCLUDE_ROOT . 
'/phpgwapi/inc/common_functions.inc.php');
                $GLOBALS['phpgw'] = createObject('phpgwapi.phpgw');
-               require_once(PHPGW_INCLUDE_ROOT . SEP . 'phpgwapi' . SEP . 
'inc' . SEP . 'log_functions.inc.php');
+               require_once(PHPGW_INCLUDE_ROOT . 
'/phpgwapi/inc/log_functions.inc.php');
        }
        else
        {

Modified: trunk/setup/index.php
===================================================================
--- trunk/setup/index.php       2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/setup/index.php       2008-02-02 13:52:39 UTC (rev 18466)
@@ -180,10 +180,12 @@
                        switch 
($phpgw_domain[$GLOBALS['ConfigDomain']]['db_type'])
                        {
                                case 'mysql':
-                                       
$setup_tpl->set_var('instr',lang('mysqlinstr'));
+                                       
$setup_tpl->set_var('instr',lang('mysqlinstr %1', 
$phpgw_domain[$GLOBALS['ConfigDomain']]['db_name']));
+                                       $setup_tpl->set_var('db_root','root');
                                        break;
                                case 'postgres':
-                                       
$setup_tpl->set_var('instr',lang('pgsqlinstr'));
+                                       
$setup_tpl->set_var('instr',lang('pgsqlinstr %1', 
$phpgw_domain[$GLOBALS['ConfigDomain']]['db_name']));
+                                       
$setup_tpl->set_var('db_root','postgres');
                                        break;
                        }
                        $setup_tpl->parse('V_db_stage_1','B_db_stage_1');
@@ -258,7 +260,7 @@
 
                                        // Only process phpgwapi, admin and 
preferences.
                                        $setup_info = 
$GLOBALS['phpgw_setup']->detection->base_install($setup_info);
-                                       $setup_info = 
$GLOBALS['phpgw_setup']->process->pass($setup_info,'new',$GLOBALS['DEBUG'],True);
+                                       $setup_info = 
$GLOBALS['phpgw_setup']->process->pass($setup_info, 'new', false, true);
                                        $GLOBALS['included'] = True;
                                        include_once('lang.php');
                                        
$GLOBALS['phpgw_info']['setup']['currentver']['phpgwapi'] = 'oldversion';

Modified: trunk/setup/lang/phpgw_en.lang
===================================================================
--- trunk/setup/lang/phpgw_en.lang      2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/setup/lang/phpgw_en.lang      2008-02-02 13:52:39 UTC (rev 18466)
@@ -202,7 +202,7 @@
 modify setup   en      Modify
 modify an existing ldap account store for use with phpgroupware (for a new 
install using ldap accounts)        setup   en      Modify an existing LDAP 
account store for use with phpGroupWare (for a new install using LDAP accounts)
 multi-language support setup   setup   en      Multi-Language support setup
-mysqlinstr     setup   en      Instructions for creating the database in 
MySQL:<br>Login to mysql -<br><i>address@hidden user]# mysql -u root 
-p</i><br>Create the empty database and grant user permissions -<br><i>mysql> 
create database phpgroupware;</i><br><i>mysql> grant all on phpgroupware.* to 
address@hidden identified by 'password';</i>
+mysqlinstr %1  setup   en      Instructions for creating the database in 
MySQL:<br>Login to mysql -<br><i>address@hidden user]# mysql -u root 
-p</i><br>Create the empty database and grant user permissions -<br><i>mysql> 
create database %1;</i><br><i>mysql> grant all on %1.* to address@hidden 
identified by 'password';</i>
 name of database       setup   en      Name of database
 name of db user phpgroupware uses to connect   setup   en      Name of db user 
phpGroupWare uses to connect
 never  setup   en      never
@@ -238,7 +238,7 @@
 path information       setup   en      Path information
 path to user and group files has to be outside of the webservers 
document-root!!!      setup   en      Path to user and group files HAS TO BE 
OUTSIDE of the webservers document-root!!!
 persistent connections setup   en      Persistent connections
-pgsqlinstr     setup   en      Instructions for creating the database in 
PostgreSQL:<br>Start the postmaster<br><i>address@hidden user]# postmaster -i 
-D /home/[username]/[dataDir]</i><br>Create the empty database 
-<br><i>address@hidden user]# createdb phpgroupware</i>
+pgsqlinstr %1  setup   en      Instructions for creating the database in 
PostgreSQL:<br>Start the postmaster<br><i>address@hidden user]# postmaster -i 
-D /home/[username]/[dataDir]</i><br>Create the empty database 
-<br><i>address@hidden user]# createdb %1</i>
 phpgroupware administration manual     setup   en      phpGroupWare 
Administration Manual
 please check for sql scripts within the application's directory        setup   
en      Please check for sql scripts within the application's directory
 please check read/write permissions on directories, or back up and use another 
option. setup   en      Please check read/write permissions on directories, or 
back up and use another option.

Modified: trunk/setup/lang.php
===================================================================
--- trunk/setup/lang.php        2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/setup/lang.php        2008-02-02 13:52:39 UTC (rev 18466)
@@ -34,6 +34,7 @@
                        exit;
                }
                $GLOBALS['phpgw_setup']->loaddb();
+               $GLOBALS['phpgw']->db =& $GLOBALS['phpgw_setup']->db;
 
                /**
                 * Include API Common class
@@ -41,8 +42,6 @@
                include(PHPGW_API_INC.'/class.common.inc.php');
 
                $common = new phpgwapi_common;
-               // this is not used
-               //$sep = $common->filesystem_separator();
        }
        elseif ($included != 'from_login')
        {
@@ -51,147 +50,53 @@
                $submit = true;
        }
 
-       if (!defined('MAX_MESSAGE_ID_LENGTH'))
-       {
-               define('MAX_MESSAGE_ID_LENGTH',230);
-       }
-
        if (isset($_POST['submit']) && $_POST['submit'] )
        {
-               if ( !isset($GLOBALS['phpgw']->shm) 
-                       || !is_object($GLOBALS['phpgw']->shm) )
-               {
-                       $GLOBALS['phpgw']->shm = CreateObject('phpgwapi.shm');
-               }
-                               
                $lang_selected = $_POST['lang_selected'];
                $upgrademethod = $_POST['upgrademethod'];
-               if(!isset($GLOBALS['phpgw_info']['server']['lang_ctimes']))
-               {
-                       $GLOBALS['phpgw_info']['server']['lang_ctimes'] = 
array();
-               }
                
-               if (!isset($GLOBALS['phpgw_info']['server']) && $upgrademethod 
!= 'dumpold')
-               {
-                       $GLOBALS['phpgw_setup']->db->query("select * from 
phpgw_config WHERE config_app='phpgwapi' AND 
config_name='lang_ctimes'",__LINE__,__FILE__);
-                       if ($GLOBALS['phpgw_setup']->db->next_record())
-                       {
-                               $GLOBALS['phpgw_info']['server']['lang_ctimes'] 
= unserialize(stripslashes($GLOBALS['phpgw_setup']->db->f('config_value')));
-                       }
-               }
+               $error = 
$GLOBALS['phpgw']->translation->update_db($lang_selected, $upgrademethod);
                
-               $GLOBALS['phpgw_setup']->db->transaction_begin();
-               if (count($lang_selected))
-               {
-                       if ($upgrademethod == 'dumpold')
+               if ( $error )
                        {
-                               // dont delete the custom main- & loginscreen 
messages every time
-                               $GLOBALS['phpgw_setup']->db->query("DELETE FROM 
phpgw_lang where app_name != 'mainscreen' AND app_name != 
'loginscreen'",__LINE__,__FILE__);
-                               //echo '<br />Test: dumpold';
-                               $GLOBALS['phpgw_info']['server']['lang_ctimes'] 
= array();
-                       }
-                       foreach($lang_selected as $lang)
-                       {
-                               //echo '<br />Working on: ' . $lang;
-                               if(function_exists('sem_get') && 
function_exists('shmop_open'))
-                               {
-                                       
$GLOBALS['phpgw']->shm->delete_key('lang_' . $lang);
-                               }
-                               $addlang = False;
-                               if ($upgrademethod == 'addonlynew')
-                               {
-                                       //echo "<br />Test: addonlynew - select 
count(*) from phpgw_lang where lang='".$lang."'";
-                                       
$GLOBALS['phpgw_setup']->db->query("SELECT COUNT(*) FROM phpgw_lang WHERE 
lang='".$lang."'",__LINE__,__FILE__);
-                                       
$GLOBALS['phpgw_setup']->db->next_record();
+                       $error = <<<HTML
+                               <div class="err">
+                                       <h2>ERROR</h2>
+                                       $error
+                               </div>
 
-                                       if ($GLOBALS['phpgw_setup']->db->f(0) 
== 0)
+HTML;
+                       if( !$included )
                                        {
-                                               //echo '<br />Test: addonlynew 
- True';
-                                               $addlang = True;
-                                       }
-                               }
-                               if (($addlang && $upgrademethod == 
'addonlynew') || ($upgrademethod != 'addonlynew'))
-                               {
-                                       //echo '<br />Test: loop above file()';
-                                       $setup_info = 
$GLOBALS['phpgw_setup']->detection->get_versions();
-                                       $setup_info = 
$GLOBALS['phpgw_setup']->detection->get_db_versions($setup_info);
-                                       $raw = array();
-                                       // Visit each app/setup dir, look for a 
phpgw_lang file
-                                       while (list($key,$app) = 
each($setup_info))
-                                       {
-                                               if(!array_key_exists('name', 
$app))
-                                               {
-                                                       continue;
-                                               }
+                               $tpl_root = 
$GLOBALS['phpgw_setup']->html->setup_tpl_dir('setup');
+                               $setup_tpl = 
CreateObject('phpgwapi.Template',$tpl_root);
+                               $setup_tpl->set_file(array
+                               (
+                                       'T_head'                => 'head.tpl',
+                                       'T_footer'              => 'footer.tpl',
+                               ));
 
-                                               $appfile = PHPGW_SERVER_ROOT . 
SEP . $app['name'] . SEP . 'setup' . SEP . 'phpgw_' . strtolower($lang) . 
'.lang';
-                                               //echo '<br />Checking in: ' . 
$app['name'];
-                                               
if($GLOBALS['phpgw_setup']->app_registered($app['name']) && 
file_exists($appfile))
-                                               {
-                                                       //echo '<br 
/>Including: ' . $appfile;
-                                                       $lines = file($appfile);
-                                                       foreach($lines as $line)
-                                                       {
-                                                               
list($message_id,$app_name,$ignore,$content) = explode("\t",$line);
-                                                               /* XXX Caeies 
Get invalid lang files ...
-                                                               
if(empty($content))
-                                                               {
-                                                                       
_debug_array('Invalid lang line : '.$line);
-                                                                       
_debug_array('content 1 : -'.$message_id.'-');
-                                                                       
_debug_array('content 2 : -'.$app_name.'-');
-                                                                       
_debug_array('content 3 : -'.$content.'-');
-                                                               }
-                                                               */
-                                                               $message_id = 
$GLOBALS['phpgw_setup']->db->db_addslashes(substr(chop($message_id),0,MAX_MESSAGE_ID_LENGTH));
-                                                               $app_name = 
$GLOBALS['phpgw_setup']->db->db_addslashes(chop($app_name));
-                                                               $content = 
$GLOBALS['phpgw_setup']->db->db_addslashes(chop($content));
+                               $stage_title = lang('Multi-Language support 
setup');
+                               $stage_desc  = lang('ERROR');
                                                                
-                                                               
$raw[$app_name][$message_id] = $content;
-                                                       }
-                                                       
$GLOBALS['phpgw_info']['server']['lang_ctimes'][$lang][$app['name']] = 
filectime($appfile);
-                                               }
-                                       }
-                                       foreach($raw as $app_name => $ids)
-                                       {
-                                               foreach($ids as $message_id => 
$content)
-                                               {
-                                                       $addit = False;
-                                                       //echo '<br />APPNAME:' 
. $app_name . ' PHRASE:' . $message_id;
-                                                       if ($upgrademethod == 
'addmissing')
-                                                       {
-                                                               //echo '<br 
/>Test: addmissing';
-                                                               
$GLOBALS['phpgw_setup']->db->query("SELECT COUNT(*) FROM phpgw_lang WHERE 
message_id='$message_id' and lang='$lang' and (app_name='$app_name' or 
app_name='common')",__LINE__,__FILE__);
-                                                               
$GLOBALS['phpgw_setup']->db->next_record();
+                               
$GLOBALS['phpgw_setup']->html->show_header("$stage_title: $stage_desc", false, 
'config', $ConfigDomain . '(' . $phpgw_domain[$ConfigDomain]['db_type'] . ')');
+                               echo $error;
+                               $return = lang('Return to Multi-Language 
support setup');
+                               echo <<<HTML
+                               <div>
+                                       <a href="./lang.php">$return</a>
+                               </div>
 
-                                                               if 
($GLOBALS['phpgw_setup']->db->f(0) == 0)
-                                                               {
-                                                                       //echo 
'<br />Test: addmissing - True - Total: ' . $GLOBALS['phpgw_setup']->db->f(0);
-                                                                       $addit 
= True;
-                                                               }
+HTML;
+                               $GLOBALS['phpgw_setup']->html->show_footer();
+                               exit;
                                                        }
-
-                                                       if ($addit || 
(isset($newinstall) && $newinstall) || $upgrademethod == 'addonlynew' || 
$upgrademethod == 'dumpold')
-                                                       {
-                                                               if($message_id 
&& $content)
-                                                               {
-                                                                       //echo 
"<br />adding - insert into phpgw_lang values 
('$message_id','$app_name','$lang','$content')";
-                                                                       $result 
= $GLOBALS['phpgw_setup']->db->query("INSERT INTO phpgw_lang 
(message_id,app_name,lang,content) 
VALUES('$message_id','$app_name','$lang','$content')",__LINE__,__FILE__);
-                                                                       if 
(intval($result) <= 0)
+                       else 
                                                                        {
-                                                                               
echo "<br />Error inserting record: phpgw_lang values 
('$message_id','$app_name','$lang','$content')";
-                                                                       }
-                                                               }
-                                                       }
+                               echo $error;
                                                }
                                        }
-                               }
-                       }
-                       $GLOBALS['phpgw_setup']->db->transaction_commit();
                        
-                       $GLOBALS['phpgw_setup']->db->query("DELETE from 
phpgw_config WHERE config_app='phpgwapi' AND 
config_name='lang_ctimes'",__LINE__,__FILE__);
-                       $GLOBALS['phpgw_setup']->db->query("INSERT INTO 
phpgw_config(config_app,config_name,config_value) VALUES 
('phpgwapi','lang_ctimes','".
-                               
addslashes(serialize($GLOBALS['phpgw_info']['server']['lang_ctimes']))."')",__LINE__,__FILE__);
-               }
                if ( !$included )
                {
                        Header('Location: index.php');
@@ -293,4 +198,3 @@
                        $GLOBALS['phpgw_setup']->html->show_footer();
                }
        }
-?>

Modified: trunk/setup/manageheader.php
===================================================================
--- trunk/setup/manageheader.php        2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/setup/manageheader.php        2008-02-02 13:52:39 UTC (rev 18466)
@@ -355,10 +355,25 @@
                        }
                        else
                        {
-                               $detected .= '<li class="err">' . lang('No XSLT 
support found.') . "</li>\n";
+                               $lang_noxsl = lang('No XSL support found.');
+                               $lang_fix = lang('You must install the php-xsl 
extension to continue');
+                               $detected .= <<<HTML
+                                                       <li 
class="err">$lang_noxsl</li>
+                                               </ul>
+                                               <h2>$lang_fix</h2>
+                                       </b>
+                               <td>
+                       </tr>
+               </table>
+       </body>
+</html>
+
+HTML;
+                               die($detected);
+
                        }
                        
-                       $no_guess = False;
+                       $no_guess = false;
                        if(file_exists('../header.inc.php') && 
is_file('../header.inc.php') && is_readable('../header.inc.php'))
                        {
                                $detected .= '<li>' . lang('Found existing 
configuration file. Loading settings from the file...') . "</li>\n";

Modified: trunk/setup/schematoy.php
===================================================================
--- trunk/setup/schematoy.php   2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/setup/schematoy.php   2008-02-02 13:52:39 UTC (rev 18466)
@@ -132,7 +132,7 @@
                        $terror[$appname]['version'] = $version[$appname];
                        $terror[$appname]['status'] = 'U';
 
-                       $appdir  = PHPGW_SERVER_ROOT . SEP . $appname . SEP . 
'setup' . SEP;
+                       $appdir  = PHPGW_SERVER_ROOT . "/{$appname}/setup/";
 
                        // Drop newest tables
                        $terror[$appname]['tables'] = 
$GLOBALS['setup_info'][$appname]['tables'];

Modified: trunk/setup/setup_demo.php
===================================================================
--- trunk/setup/setup_demo.php  2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/setup/setup_demo.php  2008-02-02 13:52:39 UTC (rev 18466)
@@ -102,7 +102,7 @@
        $username       = '';
        $fname          = '';
        $lname          = '';
-       $create_demo = true;
+       $create_demo = false;
        
        $errors = array();
        $GLOBALS['phpgw_setup']->loaddb();
@@ -305,4 +305,3 @@
                $setup_tpl->pparse('out','T_setup_demo');
                $GLOBALS['phpgw_setup']->html->show_footer();
        }
-?>

Modified: trunk/setup/sqltoarray.php
===================================================================
--- trunk/setup/sqltoarray.php  2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/setup/sqltoarray.php  2008-02-02 13:52:39 UTC (rev 18466)
@@ -32,10 +32,10 @@
        $tpl_root = $GLOBALS['phpgw_setup']->html->setup_tpl_dir('setup');
        $setup_tpl = CreateObject('phpgwapi.Template',$tpl_root);
 
-       $download = get_var('download',Array('GET','POST'));
-       $submit   = get_var('submit',Array('GET','POST'));
-       $showall  = get_var('showall',Array('GET','POST'));
-       $appname  = get_var('appname',Array('GET','POST'));
+       $download = phpgw::get_var('download','bool');
+       $submit   = phpgw::get_var('submit','bool');
+       $showall  = phpgw::get_var('showall','bool');
+       $appname  = phpgw::get_var('appname','string');
        if ($download)
        {
                $setup_tpl->set_file(array(
@@ -101,11 +101,11 @@
 
                if (count($fk) > 1)
                {
-                       $GLOBALS['setup_tpl']->set_var('fks', "'" . 
implode("','",$fk) . "'");
+                       $GLOBALS['setup_tpl']->set_var('fks', "\n\t\t\t\t'" . 
implode(",\n\t\t\t\t'",$fk) );
                }
                elseif($fk && !empty($fk))
                {
-                       $GLOBALS['setup_tpl']->set_var('fks', "'" . $fk[0] . 
"'");
+                       $GLOBALS['setup_tpl']->set_var('fks', "'" . $fk[0]);
                }
                else
                {
@@ -114,11 +114,11 @@
 
                if (count($ix) > 1)
                {
-                       $GLOBALS['setup_tpl']->set_var('ixs', "'" . 
implode("','",$ix) . "'");
+                       $GLOBALS['setup_tpl']->set_var('ixs', implode(",",$ix));
                }
                elseif($ix && !empty($ix))
                {
-                       $GLOBALS['setup_tpl']->set_var('ixs', "'" . $ix[0] . 
"'");
+                       $GLOBALS['setup_tpl']->set_var('ixs', $ix[0]);
                }
                else
                {
@@ -148,6 +148,7 @@
        function printout($template)
        {
                global $download,$appname,$table,$showall;
+               $string = '';
 
                if ($download)
                {
@@ -197,7 +198,7 @@
                        $table = $appname = '';
                }
 
-               if(!$table && !$appname)
+               if((!isset($table) || !$table) && !$appname)
                {
                        $term = ',';
                        $dlstring .= printout('sqlheader');
@@ -218,7 +219,7 @@
                        $dlstring .= printout('sqlheader');
                        $term = ',';
 
-                       if(!$setup_info[$appname]['tables'])
+                       if(!isset($setup_info[$appname]['tables']) || 
!$setup_info[$appname]['tables'])
                        {
                                $f = PHPGW_SERVER_ROOT . '/' . $appname . 
'/setup/setup.inc.php';
                                if (file_exists ($f)) 

Modified: trunk/setup/templates/base/applications.tpl
===================================================================
--- trunk/setup/templates/base/applications.tpl 2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/setup/templates/base/applications.tpl 2008-02-02 13:52:39 UTC (rev 
18466)
@@ -33,16 +33,16 @@
                        <th>{app_status}</th>
                        <th>{app_currentver}</th>
                        <th>{app_version}</th>
-                       <th>
+                       <th class="checkcell">
                                {app_install}<br>
                                <a href="javascript:check_all('install')"><img 
src="../phpgwapi/templates/base/images/{check}" title="{install_all}" 
alt="{install_all}"></a>
                        </th>
-                       <th>
+                       <th class="checkcell">
                                {app_upgrade}<br>
                                <a href="javascript:check_all('upgrade')"><img 
src="../phpgwapi/templates/base/images/{check}" title="{install_all}" 
alt="{install_all}"></a>
                        </th>
                        <th>{app_resolve}</th>
-                       <th>
+                       <th class="checkcell">
                                {app_remove}<br>
                                <a href="javascript:check_all('remove')"><img 
src="../phpgwapi/templates/base/images/{check}" title="{install_all}" 
alt="{install_all}"></a>
                        </th>
@@ -58,18 +58,18 @@
                        <td>{appinfo}</td>
                        <td>{currentver}</td>
                        <td>{version}</td>
-                       <td class="{row_install} centered">{install}</td>
-                       <td class="{row_upgrade} centered">{upgrade}</td>
-                       <td class="centered">{resolution}&nbsp;</td>
-                       <td class="{row_remove} centered">{remove}</td>
+                       <td class="{row_install} checkcell">{install}</td>
+                       <td class="{row_upgrade} checkcell">{upgrade}</td>
+                       <td class="checkcell">{resolution}&nbsp;</td>
+                       <td class="{row_remove} checkcell">{remove}</td>
                </tr>
 <!-- END apps -->
 
 <!-- BEGIN detail -->
-  <tr class="{bg_color}">
-    <td>{name}&nbsp;</td>
-    <td>{details}&nbsp;</td>
-  </tr>
+               <li>
+                       <strong>{name}</strong><br>
+                       {details}
+               </li>
 <!-- END detail -->
 
 <!-- BEGIN table -->
@@ -104,14 +104,14 @@
   </tbody>
   <tr class="th">
     <td colspan="5">{debug} {lang_debug}</td>
-    <td align="center">
+    <td class="checkcell">
      <a href="javascript:check_all('install')"><img 
src="../phpgwapi/templates/base/images/{check}" title="{install_all}" 
alt="{install_all}"></a>
     </td>
-    <td align="center">
+    <td class="checkcell">
      <a href="javascript:check_all('upgrade')"><img 
src="../phpgwapi/templates/base/images/{check}" title="{upgrade_all}" 
alt="{upgrade_all}"></a>
     </td>
     <td>&nbsp;</td>
-    <td align="center">
+    <td class="checkcell">
       <a href="javascript:check_all('remove')"><img 
src="../phpgwapi/templates/base/images/{check}" title="{remove_all}" 
alt="{remove_all}"></a>
     </td>
   </tr>
@@ -124,6 +124,7 @@
 <!-- END app_footer -->
 
 <!-- BEGIN footer -->
+       {footer_text}
        <div class="banner"> </div>
 </div>
 <!-- END footer -->

Modified: trunk/setup/templates/base/head.tpl
===================================================================
--- trunk/setup/templates/base/head.tpl 2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/setup/templates/base/head.tpl 2008-02-02 13:52:39 UTC (rev 18466)
@@ -12,10 +12,11 @@
 
                <style type="text/css">
                <!-- 
+                       /* FIXME move this to an external CSS file */
                        a, body, tr, th, td, input, select
                        {
                                font-family: Verdana, Arial, Helvetica, 
sans-serif;
-                               font-size: 12px;
+                               font-size: 0.9em;
                                text-decoration: none;
                        }
 
@@ -49,7 +50,6 @@
                        thead, tfoot, .th
                        {
                                background: #486591;
-                               font-size: 14px;
                                font-weight: bold;
                                color: #fff;
                        }
@@ -140,7 +140,7 @@
                                color: #fff;
                        }
 
-                       .centered
+                       .checkcell
                        {
                                text-align: center;
                        }

Modified: trunk/setup/templates/base/setup_db_blocks.tpl
===================================================================
--- trunk/setup/templates/base/setup_db_blocks.tpl      2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/setup/templates/base/setup_db_blocks.tpl      2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -14,7 +14,7 @@
                {instr}<p>
                <form action="index.php" method="post">
                {createdb}<br>
-                   DB root username: <input type="text" name="db_root" 
value="root">
+                   DB root username: <input type="text" name="db_root" 
value="{db_root}">
                    DB root password: <input type="password" name="db_pass">
             <input type="hidden" name="action" value="Create Database">
                    <input type="submit" name="label" value="{create_database}">

Modified: trunk/sitemgr/inc/class.Content_BO.inc.php
===================================================================
--- trunk/sitemgr/inc/class.Content_BO.inc.php  2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/sitemgr/inc/class.Content_BO.inc.php  2008-02-02 13:52:39 UTC (rev 
18466)
@@ -1,6 +1,6 @@
 <?php
 
-require_once(PHPGW_INCLUDE_ROOT . SEP . 'sitemgr' . SEP . 'inc' . SEP . 
'class.module.inc.php');
+require_once(PHPGW_INCLUDE_ROOT . '/sitemgr/inc/class.module.inc.php');
 
 define('SITEMGR_STATE_DRAFT',0);
 define('SITEMGR_STATE_PREPUBLISH',1);
@@ -23,8 +23,7 @@
 
                function getContentAreas()
                {
-                       $templatefile =  
$GLOBALS['Common_BO']->sites->current_site['site_dir'] .  SEP . 'templates' . 
-                               SEP . 
$GLOBALS['Common_BO']->sites->current_site['themesel'] . SEP . 'main.tpl';
+                       $templatefile =  
"{$GLOBALS['Common_BO']->sites->current_site['site_dir']}/templates/{$GLOBALS['Common_BO']->sites->current_site['themesel']}/main.tpl";
 
                        if (file_exists($templatefile))
                        {

Modified: trunk/sitemgr/inc/class.Modules_BO.inc.php
===================================================================
--- trunk/sitemgr/inc/class.Modules_BO.inc.php  2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/sitemgr/inc/class.Modules_BO.inc.php  2008-02-02 13:52:39 UTC (rev 
18466)
@@ -1,6 +1,6 @@
 <?php
 
-require_once(PHPGW_INCLUDE_ROOT . SEP . 'sitemgr' . SEP . 'inc' . SEP . 
'class.module.inc.php');
+require_once(PHPGW_INCLUDE_ROOT '/sitemgr/inc/class.module.inc.php');
 
        class Modules_BO
        {

Modified: trunk/sitemgr/inc/class.Theme_BO.inc.php
===================================================================
--- trunk/sitemgr/inc/class.Theme_BO.inc.php    2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/sitemgr/inc/class.Theme_BO.inc.php    2008-02-02 13:52:39 UTC (rev 
18466)
@@ -10,7 +10,7 @@
                function getAvailableThemes()
                {
                        $sitemgr_dir = 
$GLOBALS['Common_BO']->sites->current_site['site_dir'];
-                       $dirname = $sitemgr_dir . SEP . 'templates' . SEP;
+                       $dirname = "{$sitemgr_dir}/templates/";
                        $result_array=array();
                        @$handle=opendir($dirname);
                
@@ -18,7 +18,7 @@
                        {
                                while (($file = readdir($handle)) !== false)
                                {
-                                       if (is_dir($dirname . $file) && 
file_exists($dirname . $file . SEP . 'main.tpl'))
+                                       if (is_dir($dirname . $file) && 
file_exists("{$dirname}{$file}/main.tpl"))
                                        {
                                                
$result_array[]=array('value'=>$file,'display'=>$file);
                                        }       

Modified: trunk/sitemgr/inc/class.module.inc.php
===================================================================
--- trunk/sitemgr/inc/class.module.inc.php      2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/sitemgr/inc/class.module.inc.php      2008-02-02 13:52:39 UTC (rev 
18466)
@@ -122,7 +122,7 @@
 
        function find_template_dir()
        {
-               $templaterootformat = $GLOBALS['sitemgr_info']['site_dir']. SEP 
. 'templates' . SEP . '%s' . SEP . 'modules' . SEP . $this->block->module_name;
+               $templaterootformat = 
"{$GLOBALS['sitemgr_info']['site_dir']}/templates/%s/modules/{$this->block->module_name}";
                $themetemplatedir = 
sprintf($templaterootformat,$GLOBALS['sitemgr_info']['themesel']);
                if (is_dir($themetemplatedir))
                {

Modified: trunk/sitemgr/modules/class.module_appdir.inc.php
===================================================================
--- trunk/sitemgr/modules/class.module_appdir.inc.php   2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/sitemgr/modules/class.module_appdir.inc.php   2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -110,8 +110,8 @@
 
                if ($produce)
                {
-                       require_once(PHPGW_INCLUDE_ROOT . SEP . 'sitemgr' . SEP 
. 'inc' . SEP . 'class.xslt_transform.inc.php');
-                       $this->add_transformer(new 
xslt_transform($this->find_template_dir() . SEP . 'list.xsl'));
+                       require_once(PHPGW_INCLUDE_ROOT . 
'/sitemgr/inc/class.xslt_transform.inc.php');
+                       $this->add_transformer(new 
xslt_transform($this->find_template_dir() . '/list.xsl'));
                }
        }
 

Modified: trunk/sitemgr/modules/class.module_bookmarks.inc.php
===================================================================
--- trunk/sitemgr/modules/class.module_bookmarks.inc.php        2008-02-02 
11:18:25 UTC (rev 18465)
+++ trunk/sitemgr/modules/class.module_bookmarks.inc.php        2008-02-02 
13:52:39 UTC (rev 18466)
@@ -39,9 +39,9 @@
 
                if ($produce)
                {
-                       require_once(PHPGW_INCLUDE_ROOT . SEP . 'sitemgr' . SEP 
. 'inc' . SEP . 'class.xslt_transform.inc.php');
+                       require_once(PHPGW_INCLUDE_ROOT . 
'sitemgr/inc/class.xslt_transform.inc.php');
                        $this->add_transformer(new xslt_transform(
-                               $this->find_template_dir() . SEP . 'xbel.xsl',
+                               $this->find_template_dir() . '/xbel.xsl',
                                array('blockid' => $this->block->id)
                        ));
                }

Modified: trunk/sitemgr/modules/class.module_galerie.inc.php
===================================================================
--- trunk/sitemgr/modules/class.module_galerie.inc.php  2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/sitemgr/modules/class.module_galerie.inc.php  2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -65,12 +65,12 @@
                                'type' => "array",
                                'i18n' => True
                        );
-                       while (file_exists($defaults['imagedirpath'] . SEP . 
$defaults['imagename'] . $i . '.' . $defaults['imagetype']))
+                       while 
(file_exists("{$defaults['imagedirpath']}/{$defaults['imagename']}{$i}.{$defaults['imagetype']}"))
                        {
                                $this->arguments['subtext'][$i-1] = array(
                                        'type' => 'textfield',
                                        'label' => 'Subtext for image ' . $i . 
'<br /><img src="' . 
-                                               $defaults['imagedirurl'] . SEP 
. $defaults['imagename'] . $i . '.' . $defaults['imagetype'] . '" />',
+                                               
"{$defaults['imagedirurl']}/{$defaults['imagename']}{$i}.{$defaults['imagetype']}\"
 />",
                                        'i18n' => True
                                );
                                $i++;
@@ -100,22 +100,20 @@
                        {
                                $this->block->arguments['filenumber']--;
                        }
-                       if ($this->block->arguments['filenumber'] < 1 || 
!file_exists(
-                                       $this->block->arguments['imagedirpath'] 
. SEP . $this->block->arguments['imagename'] . 
-                                       $this->block->arguments['filenumber'] . 
'.' . $this->block->arguments['imagetype']
-                               ))
+                       if ($this->block->arguments['filenumber'] < 1 
+                               || 
!file_exists("{$this->block->arguments['imagedirpath']}/{$this->block->arguments['imagename']}{$this->block->arguments['filenumber']}.{$this->block->arguments['imagetype']}"))
                        {
                                $this->block->arguments['filenumber'] = 1;
                        }
                        $prevlink = ($this->block->arguments['filenumber'] > 1) 
? $this->build_post_element('prev') : '';
                        $nextlink = 
                                (file_exists(
-                                       $this->block->arguments['imagedirpath'] 
. SEP . $this->block->arguments['imagename'] . 
+                                       
"{$this->block->arguments['imagedirpath']}/{$this->block->arguments['imagename']}"
 . 
                                        ($this->block->arguments['filenumber'] 
+ 1) . '.' . $this->block->arguments['imagetype']
                                )) ?
                                $this->build_post_element('next') : 
                                '';
-                       require_once(PHPGW_INCLUDE_ROOT . SEP . 'sitemgr' . SEP 
. 'inc' . SEP . 'class.browser_transform.inc.php');
+                       require_once(PHPGW_INCLUDE_ROOT . 
'/sitemgr/inc/class.browser_transform.inc.php');
                        $this->add_transformer(new 
browser_transform($prevlink,$nextlink));
                }
        }
@@ -124,7 +122,7 @@
        
        function get_content(&$arguments,$properties)
        {
-               $content .= '<div align="center"><img  hspace="20" 
align="absmiddle" src="'. $arguments['imagedirurl'] . SEP . 
$arguments['imagename'] . $arguments['filenumber'] . '.' . 
$arguments['imagetype'] . '" /></div>';
+               $content .= '<div align="center"><img  hspace="20" 
align="absmiddle" src="'. 
"{$arguments['imagedirurl']}/{$arguments['imagename']}{$arguments['filenumber']}.{$arguments['imagetype']}\"
 /></div>";
                $content .= '<div align="center" style="margin:5mm">' . 
$arguments['subtext'][$arguments['filenumber']-1] . '</div>';
                return $content;
        }

Modified: trunk/sitemgr/modules/class.module_xml.inc.php
===================================================================
--- trunk/sitemgr/modules/class.module_xml.inc.php      2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/sitemgr/modules/class.module_xml.inc.php      2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -50,31 +50,31 @@
                                $this->block->arguments['filenumber']--;
                        }
                        if ($this->block->arguments['filenumber'] < 1 || 
!file_exists(
-                                       $this->block->arguments['dirpath'] . 
SEP . $this->block->arguments['filename'] . 
+                                       
"{$this->block->arguments['dirpath']}/{$this->block->arguments['filename']}" . 
                                        $this->block->arguments['filenumber'] . 
'.xml'
                                ))
                        {
                                $this->block->arguments['filenumber'] = 1;
                        }
 
-                       require_once(PHPGW_INCLUDE_ROOT . SEP . 'sitemgr' . SEP 
. 'inc' . SEP . 'class.xslt_transform.inc.php');
+                       require_once(PHPGW_INCLUDE_ROOT . 
'/sitemgr/inc/class.xslt_transform.inc.php');
                        $this->add_transformer(new 
xslt_transform($this->block->arguments['xsltfile']));
 
                        $prevlink = ($this->block->arguments['filenumber'] > 1) 
? $this->build_post_element('prev') : '';
                        $nextlink = 
                                (file_exists(
-                                       $this->block->arguments['dirpath'] . 
SEP . $this->block->arguments['filename'] . 
+                                       
"{$this->block->arguments['dirpath']}/{$this->block->arguments['filename']}" .
                                        ($this->block->arguments['filenumber'] 
+ 1) . '.xml'
                                )) ?
                                $this->build_post_element('next') : 
                                '';
-                       require_once(PHPGW_INCLUDE_ROOT . SEP . 'sitemgr' . SEP 
. 'inc' . SEP . 'class.browser_transform.inc.php');
+                       require_once(PHPGW_INCLUDE_ROOT . 
'/sitemgr/inc/class.browser_transform.inc.php');
                        $this->add_transformer(new 
browser_transform($prevlink,$nextlink,$this->block->module_name));
                }
        }
 
        function get_content(&$arguments,$properties)
        {
-               return implode('',@file($arguments['dirpath'] . SEP . 
$arguments['filename'] . $arguments['filenumber'] . '.xml'));
+               return 
implode('',@file("{$arguments['dirpath']}/{$arguments['filename']}{$arguments['filenumber']}.xml"));
        }
 }

Modified: trunk/sitemgr/setup/default_records.inc.php
===================================================================
--- trunk/sitemgr/setup/default_records.inc.php 2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/sitemgr/setup/default_records.inc.php 2008-02-02 13:52:39 UTC (rev 
18466)
@@ -5,8 +5,8 @@
 
        $oProc->query("select config_value FROM phpgw_config WHERE 
config_name='webserver_url'");
        $oProc->next_record();
-       $siteurl = $oProc->f('config_value') . SEP . 'sitemgr' . SEP . 
'sitemgr-site' . SEP;
-       $sitedir = PHPGW_INCLUDE_ROOT . SEP . 'sitemgr' . SEP . 'sitemgr-site';
+       $siteurl = $oProc->f('config_value') . '/sitemgr/sitemgr-site/';
+       $sitedir = PHPGW_INCLUDE_ROOT . '/sitemgr/sitemgr-site';
        $oProc->query("INSERT INTO phpgw_sitemgr_sites 
(site_id,site_name,site_url,site_dir,themesel,site_languages,home_page_id,anonymous_user,anonymous_passwd)
 VALUES ($site_id,'Default 
Website','$siteurl','$sitedir','phpgroupware','en',0,'anonymous','anonymous')");
 
        foreach (array('html','index','toc') as $module)

Modified: trunk/sitemgr/setup/phpgw_en.lang
===================================================================
--- trunk/sitemgr/setup/phpgw_en.lang   2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/sitemgr/setup/phpgw_en.lang   2008-02-02 13:52:39 UTC (rev 18466)
@@ -232,6 +232,7 @@
 site setup     common  en      Site Setup
 site tree menu sitemgr en      Site Tree Menu
 site wide      sitemgr en      Site wide
+sitemgr        common  en      Content Manager
 sitemgr options        sitemgr en      SiteMgr Options
 sitemgr setup instructions     sitemgr en      SiteMgr Setup Instructions
 sitemgr setup page     sitemgr en      sitemgr setup page

Modified: trunk/sitemgr/setup/phpgw_sv.lang
===================================================================
--- trunk/sitemgr/setup/phpgw_sv.lang   2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/sitemgr/setup/phpgw_sv.lang   2008-02-02 13:52:39 UTC (rev 18466)
@@ -340,3 +340,4 @@
 you removed one ore more languages from your site languages.   sitemgr sv      
Du raderade ett eller flera spr\xE5k fr\xE5n dina site-spr\xE5k.
 your administrator has not yet setup the web content manager for public 
viewing.  go bug your administrator to get their butt in gear. sitemgr sv      
Din administrat\xF6r har inte konfiguererat webinneh\xE5llshanteraren f\xF6r 
publik visning. G\xE5 och st\xF6r din admininstrat\xF6r f\xF6r att han ska 
f\xE5 l\xF6s tummen.
 your calendar  sitemgr-site    sv      Din kalender
+

Modified: trunk/sitemgr/sitemgr-site/inc/class.Template3.inc.php
===================================================================
--- trunk/sitemgr/sitemgr-site/inc/class.Template3.inc.php      2008-02-02 
11:18:25 UTC (rev 18465)
+++ trunk/sitemgr/sitemgr-site/inc/class.Template3.inc.php      2008-02-02 
13:52:39 UTC (rev 18466)
@@ -1,7 +1,9 @@
 <?php
 
-require_once(PHPGW_INCLUDE_ROOT . SEP . 'sitemgr' . SEP . 'inc' . SEP . 
'class.module.inc.php');
+//FIXME - this should really extend the api tpl class
 
+require_once(PHPGW_INCLUDE_ROOT . '/sitemgr/inc/class.module.inc.php');
+
        class Template3
        {
                /* 'yes' => halt, 'report' => report error, continue, 'no' => 
ignore error quietly */
@@ -17,7 +19,7 @@
                function Template3($root)
                {
                        $this->set_root($root);
-                       $this->file = $this->root . SEP . 'main.tpl';
+                       $this->file = $this->root . '/main.tpl';
                        $this->loadfile();
                        $this->bo = &$GLOBALS['Common_BO']->content;
                        $this->modulebo = &$GLOBALS['Common_BO']->modules;
@@ -84,7 +86,7 @@
                {
                        if ($GLOBALS['sitemgr_info']['mode'] == 'Draft')
                        {
-                               $transformerfile = $this->root . SEP . 
'draft_transform.inc.php';
+                               $transformerfile = $this->root . 
'/draft_transform.inc.php';
                                if (file_exists($transformerfile))
                                {
                                        include($transformerfile);
@@ -96,7 +98,7 @@
                        }
                        elseif ($GLOBALS['sitemgr_info']['mode'] == 'Edit')
                        {
-                               $transformerfile = $this->root . SEP . 
'edit_transform.inc.php';
+                               $transformerfile = $this->root . 
'/edit_transform.inc.php';
                                if (file_exists($transformerfile))
                                {
                                        include($transformerfile);
@@ -143,7 +145,7 @@
 
                        $transformername = $areaname . '_bt';
 
-                       $transformerfile = $this->root . SEP . $transformername 
. '.inc.php';
+                       $transformerfile = 
"{$this->root}/{$transformername}.inc.php";
                        if (file_exists($transformerfile))
                        {
                                include($transformerfile);
@@ -153,7 +155,7 @@
                                }
                        }
                        //compatibility with former sideblocks template
-                       elseif (($areaname == "left" || $areaname == "right") 
&& file_exists($this->root . SEP . 'sideblock.tpl'))
+                       elseif (($areaname == "left" || $areaname == "right") 
&& file_exists("{$this->root}/sideblock.tpl"))
                        {
                                $t = Createobject('phpgwapi.Template');
                                $t->set_root($this->root);

Modified: trunk/sitemgr/sitemgr-site/inc/class.ui.inc.php
===================================================================
--- trunk/sitemgr/sitemgr-site/inc/class.ui.inc.php     2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/sitemgr/sitemgr-site/inc/class.ui.inc.php     2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -19,7 +19,7 @@
                function ui()
                {
                        $themesel = $GLOBALS['sitemgr_info']['themesel'];
-                       $templateroot = $GLOBALS['sitemgr_info']['site_dir'] . 
SEP . 'templates' . SEP . $themesel;
+                       $templateroot = 
"{$GLOBALS['sitemgr_info']['site_dir']}/templates/{$themesel}";
                        $this->t = new Template3($templateroot);
                }
 
@@ -58,4 +58,3 @@
                }
 
        }
-?>

Modified: trunk/sms/bin/config_BR
===================================================================
--- trunk/sms/bin/config_BR     2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/sms/bin/config_BR     2008-02-02 13:52:39 UTC (rev 18466)
@@ -17,14 +17,40 @@
         * Config values for SMS-command "BR" - (Br\xF8yting) "snow clearing" 
in Norwegian - as example - as it is configured at BBB 
         */
 
-       $agreement_id = '48089';
+       $agreement = array(48089,48329);
+
+       $limit = array
+                       (
+                               48089 => ' AND id > 0 AND id < 131',
+                               48329 => ' AND id > 0 AND id < 43'
+                       );
+
+       if(isset($param[0]) && $param[0])
+       {
+               $location_code = implode('',$param);
+
+               foreach ($agreement as $agreement_id)
+               {
+                       $sql = "SELECT id from fm_s_agreement_detail WHERE 
agreement_id = $agreement_id AND location_code ilike '" . $location_code . "%'";
+                       $this->db->query($sql,__LINE__,__FILE__);
+                       if($this->db->f('id'))
+                       {
+                               break;
+                       }
+                       else
+                       {
+                               $agreement_id = false;
+                       }
+               }
+       }
+
        $id_field = 'location_code';
        $target_field = 'kvittering';
 
        if($agreement_id && isset($param[0]) && $param[0])
        {
                $location_code = implode('',$param);
-               $filter = "WHERE agreement_id = $agreement_id AND location_code 
ilike '" . $location_code . "%' AND id > 0 AND id < 131";
+               $filter = "WHERE agreement_id = $agreement_id AND location_code 
ilike '" . $location_code . "%'" . $limit[$agreement_id];
        }
        
        $this->db->query("SELECT id FROM fm_s_agreement_attribute WHERE 
column_name = '$target_field' AND attrib_detail=2",__LINE__,__FILE__);

Modified: trunk/sms/bin/config_ST
===================================================================
--- trunk/sms/bin/config_ST     2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/sms/bin/config_ST     2008-02-02 13:52:39 UTC (rev 18466)
@@ -17,14 +17,40 @@
         * Config values for SMS-command "ST" - (Str\xF8ing) "sanding the ice" 
in Norwegian - as example - as it is configured at BBB 
         */
 
-       $agreement_id = '48089';
+       $agreement = array(48089,48329);
+
+       $limit = array
+                       (
+                               48089 => ' AND id > 0 AND id < 131',
+                               48329 => ' AND id > 0 AND id < 43'
+                       );
+
+       if(isset($param[0]) && $param[0])
+       {
+               $location_code = implode('',$param);
+
+               foreach ($agreement as $agreement_id)
+               {
+                       $sql = "SELECT id from fm_s_agreement_detail WHERE 
agreement_id = $agreement_id AND location_code ilike '" . $location_code . "%'";
+                       $this->db->query($sql,__LINE__,__FILE__);
+                       if($this->db->f('id'))
+                       {
+                               break;
+                       }
+                       else
+                       {
+                               $agreement_id = false;
+                       }
+               }
+       }
+
        $id_field = 'location_code';
        $target_field = 'kvittering';
 
        if($agreement_id && isset($param[0]) && $param[0])
        {
                $location_code = implode('',$param);
-               $filter = "WHERE agreement_id = $agreement_id AND location_code 
ilike '" . $location_code . "%' AND id > 0 AND id < 131";
+               $filter = "WHERE agreement_id = $agreement_id AND location_code 
ilike '" . $location_code . "%'" . $limit[$agreement_id];
        }
        
        $this->db->query("SELECT id FROM fm_s_agreement_attribute WHERE 
column_name = '$target_field' AND attrib_detail=2",__LINE__,__FILE__);

Modified: trunk/sms/bin/receipt_service_agreement.php
===================================================================
--- trunk/sms/bin/receipt_service_agreement.php 2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/sms/bin/receipt_service_agreement.php 2008-02-02 13:52:39 UTC (rev 
18466)
@@ -19,7 +19,7 @@
        $param          = explode(' ' , $command_param);
        $receipt ='';
 
-       include(PHPGW_SERVER_ROOT . SEP . 'sms' . SEP . 'bin'  . SEP .  
'config_' . strtoupper(basename($command_code)));
+       include(PHPGW_SERVER_ROOT . '/sms/bin/config_' . 
strtoupper(basename($command_code)));
        if(isset($filter) && $filter)
        {
                $sql = "SELECT id from fm_s_agreement_detail $filter";

Modified: trunk/sms/inc/class.boautoreply.inc.php
===================================================================
--- trunk/sms/inc/class.boautoreply.inc.php     2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/sms/inc/class.boautoreply.inc.php     2008-02-02 13:52:39 UTC (rev 
18466)
@@ -37,7 +37,7 @@
 
                function sms_boautoreply($session=False)
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->so               = 
CreateObject('sms.soautoreply');
                        $this->bocommon         = CreateObject('sms.bocommon');
 

Modified: trunk/sms/inc/class.bocommand.inc.php
===================================================================
--- trunk/sms/inc/class.bocommand.inc.php       2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/sms/inc/class.bocommand.inc.php       2008-02-02 13:52:39 UTC (rev 
18466)
@@ -36,7 +36,7 @@
 
                function sms_bocommand($session=False)
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->so               = CreateObject('sms.socommand');
                        $this->bocommon         = CreateObject('sms.bocommon');
 

Modified: trunk/sms/inc/class.bocommon.inc.php
===================================================================
--- trunk/sms/inc/class.bocommon.inc.php        2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/sms/inc/class.bocommon.inc.php        2008-02-02 13:52:39 UTC (rev 
18466)
@@ -54,7 +54,7 @@
 
                function sms_bocommon()
                {
-                       $this->currentapp               = 'sms';
+               //      $this->currentapp               = 'sms';
                        $this->socommon                 = 
createObject('sms.socommon');
                        $this->account                  = 
$GLOBALS['phpgw_info']['user']['account_id'];
 
@@ -470,7 +470,7 @@
 
                        $appname        = lang('No access');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('sms') . ' - ' . $appname;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('no_access' => $data));
                }
 

Modified: trunk/sms/inc/class.boconfig.inc.php
===================================================================
--- trunk/sms/inc/class.boconfig.inc.php        2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/sms/inc/class.boconfig.inc.php        2008-02-02 13:52:39 UTC (rev 
18466)
@@ -55,7 +55,7 @@
 
                function sms_boconfig($session=False)
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->so               = CreateObject('sms.soconfig');
                        $this->bocommon         = CreateObject('sms.bocommon');
 

Modified: trunk/sms/inc/class.bopoll.inc.php
===================================================================
--- trunk/sms/inc/class.bopoll.inc.php  2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/sms/inc/class.bopoll.inc.php  2008-02-02 13:52:39 UTC (rev 18466)
@@ -36,7 +36,7 @@
 
                function sms_bopoll($session=False)
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->so               = CreateObject('sms.sopoll');
                        $this->bocommon         = CreateObject('sms.bocommon');
 

Modified: trunk/sms/inc/class.bosms.inc.php
===================================================================
--- trunk/sms/inc/class.bosms.inc.php   2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/sms/inc/class.bosms.inc.php   2008-02-02 13:52:39 UTC (rev 18466)
@@ -38,7 +38,7 @@
 
                function bosms($session=False)
                {
-                       $this->currentapp       = 
'sms';//$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
'sms';//$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->sms              = CreateObject('sms.sms');
                        $this->so               = CreateObject('sms.sosms');
        //              $this->bocommon         = CreateObject('sms.bocommon');

Modified: trunk/sms/inc/class.menu.inc.php
===================================================================
--- trunk/sms/inc/class.menu.inc.php    2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/sms/inc/class.menu.inc.php    2008-02-02 13:52:39 UTC (rev 18466)
@@ -31,21 +31,26 @@
                        {
                                $this->sub              = $sub;
                        }
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                }
 
                function links($page='',$page_2='')
                {
-                       $currentapp=$this->currentapp;
+                       $currentapp='sms';
                        $sub = $this->sub;
 
+                       $menu = 
$GLOBALS['phpgw']->session->appsession('menu',substr(md5($currentapp.$sub . '_' 
. $page . '_' . $page_2),-20));
+
+                       if(!isset($menu) || !$menu)
+                       {
+                               $menu = array(); 
+
                        $i=0;
                        if($sub=='.inbox')
                        {
                                $menu['module'][$i]['this']=True;
                        }
-                       $menu['module'][$i]['link']             = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uisms.index'));
-                       $menu['module'][$i]['name']             = lang('Inbox');
+                               $menu['module'][$i]['url']              = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uisms.index'));
+                               $menu['module'][$i]['text']             = 
lang('Inbox');
                        $menu['module'][$i]['statustext']       = lang('Inbox');
                        $i++;
 
@@ -53,60 +58,62 @@
                        {
                                $menu['module'][$i]['this']=True;
                        }
-                       $menu['module'][$i]['link']                     =       
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uisms.outbox'));
-                       $menu['module'][$i]['name']                     =       
lang('outbox');
+                               $menu['module'][$i]['url']                      
=       $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uisms.outbox'));
+                               $menu['module'][$i]['text']                     
=       lang('outbox');
                        $menu['module'][$i]['statustext']       =       
lang('outbox');
                        $i++;
 
-
                        if($sub=='.autoreply')
                        {
                                $menu['module'][$i]['this']=True;
                        }
-                       $menu['module'][$i]['link']                     =       
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uiautoreply.index'));
-                       $menu['module'][$i]['name']                     =       
lang('autoreply');
+                               $menu['module'][$i]['url']                      
=       $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uiautoreply.index'));
+                               $menu['module'][$i]['text']                     
=       lang('autoreply');
                        $menu['module'][$i]['statustext']               =       
lang('autoreply');
                        $i++;
+
                        if($sub=='.board')
                        {
                                $menu['module'][$i]['this']=True;
                        }
-                       $menu['module'][$i]['link']                     =       
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uiboard.index'));
-                       $menu['module'][$i]['name']                     =       
lang('boards');
+                               $menu['module'][$i]['url']                      
=       $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uiboard.index'));
+                               $menu['module'][$i]['text']                     
=       lang('boards');
                        $menu['module'][$i]['statustext']               =       
lang('boards');
                        $i++;
+
                        if($sub=='.command')
                        {
                                $menu['module'][$i]['this']=True;
                        }
-                       $menu['module'][$i]['link']                     =       
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uicommand.index'));
-                       $menu['module'][$i]['name']                     =       
lang('commands');
+                               $menu['module'][$i]['url']                      
=       $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uicommand.index'));
+                               $menu['module'][$i]['text']                     
=       lang('commands');
                        $menu['module'][$i]['statustext']               =       
lang('commands');
                        $i++;
+
                        if($sub=='.custom')
                        {
                                $menu['module'][$i]['this']=True;
                        }
-                       $menu['module'][$i]['link']                     =       
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uicustom.index'));
-                       $menu['module'][$i]['name']                     =       
lang('customs');
+                               $menu['module'][$i]['url']                      
=       $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uicustom.index'));
+                               $menu['module'][$i]['text']                     
=       lang('customs');
                        $menu['module'][$i]['statustext']               =       
lang('customs');
                        $i++;
+
                        if($sub=='.poll')
                        {
                                $menu['module'][$i]['this']=True;
                        }
-                       $menu['module'][$i]['link']                     =       
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uipoll.index'));
-                       $menu['module'][$i]['name']                     =       
lang('polls');
+                               $menu['module'][$i]['url']                      
=       $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uipoll.index'));
+                               $menu['module'][$i]['text']                     
=       lang('polls');
                        $menu['module'][$i]['statustext']               =       
lang('polls');
                        $i++;
 
-
                        if($sub=='.config')
                        {
                                $menu['module'][$i]['this']=True;
                        }
-                       $menu['module'][$i]['link']                     =       
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uiconfig.index'));
-                       $menu['module'][$i]['name']                     =       
lang('config');
+                               $menu['module'][$i]['url']                      
=       $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uiconfig.index'));
+                               $menu['module'][$i]['text']                     
=       lang('config');
                        $menu['module'][$i]['statustext']               =       
lang('config');
                        $i++;
 
@@ -117,8 +124,8 @@
                                {
                                        $menu['sub_menu'][$j]['this']=True;
                                }
-                               $menu['sub_menu'][$j]['link']                   
=       $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uiconfig.index'));
-                               $menu['sub_menu'][$j]['name']                   
=       lang('config');
+                                       $menu['sub_menu'][$j]['url']            
        =       $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uiconfig.index'));
+                                       $menu['sub_menu'][$j]['text']           
        =       lang('config');
                                $menu['sub_menu'][$j]['statustext']             
=       lang('config');
                                $j++;
 
@@ -126,21 +133,20 @@
                                {
                                        $menu['sub_menu'][$j]['this']=True;
                                }
-                               $menu['sub_menu'][$j]['link']                   
=       $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uiconfig.daemon_manual'));
-                               $menu['sub_menu'][$j]['name']                   
=       lang('Daemon manual refresh');
+                                       $menu['sub_menu'][$j]['url']            
        =       $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uiconfig.daemon_manual'));
+                                       $menu['sub_menu'][$j]['text']           
        =       lang('Daemon manual refresh');
                                $menu['sub_menu'][$j]['statustext']             
=       lang('Daemon manual refresh');
                                $j++;
                        }
 
-
                        if ($sub == '.command')
                        {
                                if($page=='.command.list')
                                {
                                        $menu['sub_menu'][$j]['this']=True;
                                }
-                               $menu['sub_menu'][$j]['link']                   
=       $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uicommand.index'));
-                               $menu['sub_menu'][$j]['name']                   
=       lang('commands');
+                                       $menu['sub_menu'][$j]['url']            
        =       $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uicommand.index'));
+                                       $menu['sub_menu'][$j]['text']           
        =       lang('commands');
                                $menu['sub_menu'][$j]['statustext']             
=       lang('commands');
                                $j++;
 
@@ -148,13 +154,16 @@
                                {
                                        $menu['sub_menu'][$j]['this']=True;
                                }
-                               $menu['sub_menu'][$j]['link']                   
=       $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uicommand.log'));
-                               $menu['sub_menu'][$j]['name']                   
=       lang('log');
+                                       $menu['sub_menu'][$j]['url']            
        =       $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$currentapp.'.uicommand.log'));
+                                       $menu['sub_menu'][$j]['text']           
        =       lang('log');
                                $menu['sub_menu'][$j]['statustext']             
=       lang('log');
                                $j++;
                        }
 
+                               
$GLOBALS['phpgw']->session->appsession('menu',substr(md5($currentapp.$sub . '_' 
. $page . '_' . $page_2),-20),$menu);
+                       }
 
+                       
$GLOBALS['phpgw']->session->appsession('menu_sms','sidebox',$menu);
                        return $menu;
                }
        }

Modified: trunk/sms/inc/class.sms.inc.php
===================================================================
--- trunk/sms/inc/class.sms.inc.php     2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/sms/inc/class.sms.inc.php     2008-02-02 13:52:39 UTC (rev 18466)
@@ -19,10 +19,10 @@
 
 //     _debug_array ($GLOBALS['phpgw_info']['sms_config']);
 
-       $apps_path['base']      = PHPGW_SERVER_ROOT . SEP . 'sms';
-       $apps_path['libs']      = $apps_path['base'] . SEP . 'lib';
-       $apps_path['plug']      = $apps_path['base'] . SEP . 'inc' . SEP . 
'plugin';
-       $apps_path['inc']       = $apps_path['base'] . SEP . 'inc';
+       $apps_path['base']      = PHPGW_SERVER_ROOT . '/' . 'sms';
+       $apps_path['libs']      = $apps_path['base'] . '/' . 'lib';
+       $apps_path['plug']      = $apps_path['base'] . '/' . 'inc' . '/' . 
'plugin';
+       $apps_path['inc']       = $apps_path['base'] . '/' . 'inc';
        
        // SMS command security parameter
        $feat_command_path['bin']       = $apps_path['base']."/bin";
@@ -33,12 +33,12 @@
        {
                $path_to_sms = dirname(__FILE__);
 
-               include_once($path_to_sms . SEP . 'config.php');
+               include_once($path_to_sms . '/' . 'config.php');
        }
 
-       if (file_exists($apps_path['inc'] . SEP . 'plugin' . SEP . 'gateway' . 
SEP . $GLOBALS['phpgw_info']['sms_config']['common']['gateway_module']. 
"/fn.php"))
+       if (file_exists($apps_path['inc'] . '/' . 'plugin' . '/' . 'gateway' . 
'/' . $GLOBALS['phpgw_info']['sms_config']['common']['gateway_module']. 
"/fn.php"))
        {
-               include_once($apps_path['inc'] . SEP . 'plugin' . SEP . 
'gateway' . SEP. 
$GLOBALS['phpgw_info']['sms_config']['common']['gateway_module']. "/fn.php");
+               include_once($apps_path['inc'] . '/' . 'plugin' . '/' . 
'gateway' . '/'. 
$GLOBALS['phpgw_info']['sms_config']['common']['gateway_module']. "/fn.php");
        }
        else
        {
@@ -646,7 +646,7 @@
 
                        if($command_type == 'php')
                        {
-                               include(PHPGW_SERVER_ROOT . SEP . 'sms' . SEP . 
'bin'  . SEP .  basename($command_exec));
+                               include(PHPGW_SERVER_ROOT . '/' . 'sms' . '/' . 
'bin'  . '/' .  basename($command_exec));
                        }
                        else
                        {

Modified: trunk/sms/inc/class.soautoreply.inc.php
===================================================================
--- trunk/sms/inc/class.soautoreply.inc.php     2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/sms/inc/class.soautoreply.inc.php     2008-02-02 13:52:39 UTC (rev 
18466)
@@ -26,7 +26,7 @@
 
                function sms_soautoreply()
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->account          = 
$GLOBALS['phpgw_info']['user']['account_id'];
                        $this->bocommon         = CreateObject('sms.bocommon');
                        $this->db               = clone($GLOBALS['phpgw']->db);
@@ -87,8 +87,8 @@
 
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
                                $querymethod = " $where autoreply_code 
$this->like '%$query%'";
                        }
@@ -227,8 +227,8 @@
                        
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
                                $querymethod = " AND name $this->like 
'%$query%'";
                        }
@@ -421,8 +421,8 @@
 
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
                                $querymethod = " AND name $this->like 
'%$query%'";
                        }

Modified: trunk/sms/inc/class.socommand.inc.php
===================================================================
--- trunk/sms/inc/class.socommand.inc.php       2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/sms/inc/class.socommand.inc.php       2008-02-02 13:52:39 UTC (rev 
18466)
@@ -26,7 +26,7 @@
 
                function sms_socommand()
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->account          = 
$GLOBALS['phpgw_info']['user']['account_id'];
                        $this->bocommon         = CreateObject('sms.bocommon');
                        $this->db               = clone($GLOBALS['phpgw']->db);
@@ -87,8 +87,8 @@
 
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
                                $querymethod = " $where command_code 
$this->like '%$query%'";
                        }
@@ -164,8 +164,8 @@
                        
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
                                $querymethod = " $where command_log_code 
$this->like '%$query%' OR command_log_param $this->like '%$query%' OR 
sms_sender $this->like '%$query%'";
                        }
@@ -219,7 +219,7 @@
                {
                        $sql = 'SELECT * FROM phpgw_sms_featcommand WHERE 
command_id=' . intval($id);
                        $this->db->query($sql,__LINE__,__FILE__);
-                       $bin_path = PHPGW_SERVER_ROOT . SEP . 'sms' . SEP . 
'bin';
+                       $bin_path = PHPGW_SERVER_ROOT . 'sms/bin';
                        if ($this->db->next_record())
                        {
                                $values['id']           = $id;
@@ -236,7 +236,7 @@
                {
                        $this->db->transaction_begin();
 
-                       $values['exec'] = PHPGW_SERVER_ROOT . SEP . 'sms' . SEP 
. 'bin/' . $values['exec'];
+                       $values['exec'] = PHPGW_SERVER_ROOT . '/sms/bin/' . 
$values['exec'];
                        $values['exec'] = str_replace("//","/",$values['exec']);
                        $values['exec'] = str_replace("..",".",$values['exec']);
                        $values['exec'] = 
$this->db->db_addslashes($values['exec']);
@@ -268,7 +268,7 @@
                {
                        $this->db->transaction_begin();
 
-                       $values['exec'] = PHPGW_SERVER_ROOT . SEP . 'sms' . SEP 
. 'bin/' . $values['exec'];
+                       $values['exec'] = PHPGW_SERVER_ROOT . '/sms/bin/' . 
$values['exec'];
                        $values['exec'] = str_replace("//","/",$values['exec']);
                        $values['exec'] = str_replace("..",".",$values['exec']);
                        $value_set['command_type']      = 
$this->db->db_addslashes($values['type']);

Modified: trunk/sms/inc/class.socommon.inc.php
===================================================================
--- trunk/sms/inc/class.socommon.inc.php        2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/sms/inc/class.socommon.inc.php        2008-02-02 13:52:39 UTC (rev 
18466)
@@ -21,7 +21,7 @@
                function sms_socommon()
                {
 
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->db               = clone($GLOBALS['phpgw']->db);
                        $this->account          = 
$GLOBALS['phpgw_info']['user']['account_id'];
 

Modified: trunk/sms/inc/class.soconfig.inc.php
===================================================================
--- trunk/sms/inc/class.soconfig.inc.php        2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/sms/inc/class.soconfig.inc.php        2008-02-02 13:52:39 UTC (rev 
18466)
@@ -26,7 +26,7 @@
 
                function sms_soconfig()
                {
-                       $this->currentapp       = 'sms';
+               //      $this->currentapp       = 'sms';
                        $this->account          = 
$GLOBALS['phpgw_info']['user']['account_id'];
                        $this->bocommon         = CreateObject('sms.bocommon');
                        $this->db               = clone($GLOBALS['phpgw']->db);
@@ -95,8 +95,8 @@
 
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
                                $querymethod = " WHERE name $this->like 
'%$query%'";
                        }
@@ -234,8 +234,8 @@
                        
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
                                $querymethod = " AND name $this->like 
'%$query%'";
                        }
@@ -428,8 +428,8 @@
 
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
                                $querymethod = " AND name $this->like 
'%$query%'";
                        }

Modified: trunk/sms/inc/class.sopoll.inc.php
===================================================================
--- trunk/sms/inc/class.sopoll.inc.php  2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/sms/inc/class.sopoll.inc.php  2008-02-02 13:52:39 UTC (rev 18466)
@@ -26,7 +26,7 @@
 
                function sms_sopoll()
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->account          = 
$GLOBALS['phpgw_info']['user']['account_id'];
                        $this->bocommon         = CreateObject('sms.bocommon');
                        $this->db               = clone($GLOBALS['phpgw']->db);
@@ -87,8 +87,8 @@
 
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
                                $querymethod = " $where poll_code $this->like 
'%$query%'";
                        }
@@ -128,7 +128,7 @@
                {
                        $sql = 'SELECT * FROM phpgw_sms_featpoll WHERE 
poll_id=' . intval($id);
                        $this->db->query($sql,__LINE__,__FILE__);
-                       $bin_path = PHPGW_SERVER_ROOT . SEP . 'sms' . SEP . 
'bin';
+                       $bin_path = PHPGW_SERVER_ROOT . '/sms/bin';
                        if ($this->db->next_record())
                        {
                                $values['id']           = $id;
@@ -145,7 +145,7 @@
                {
                        $this->db->transaction_begin();
 
-                       $values['exec'] = PHPGW_SERVER_ROOT . SEP . 'sms' . SEP 
. 'bin/' . $values['exec'];
+                       $values['exec'] = PHPGW_SERVER_ROOT . '/sms/bin/' . 
$values['exec'];
                        $values['exec'] = str_replace("//","/",$values['exec']);
                        $values['exec'] = str_replace("..",".",$values['exec']);
                        $values['exec'] = 
$this->db->db_addslashes($values['exec']);
@@ -177,7 +177,7 @@
                {
                        $this->db->transaction_begin();
 
-                       $values['exec'] = PHPGW_SERVER_ROOT . SEP . 'sms' . SEP 
. 'bin/' . $values['exec'];
+                       $values['exec'] = PHPGW_SERVER_ROOT . '/sms/bin/' . 
$values['exec'];
                        $values['exec'] = str_replace("//","/",$values['exec']);
                        $values['exec'] = str_replace("..",".",$values['exec']);
                        $value_set['poll_type']         = 
$this->db->db_addslashes($values['type']);

Modified: trunk/sms/inc/class.sosms.inc.php
===================================================================
--- trunk/sms/inc/class.sosms.inc.php   2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/sms/inc/class.sosms.inc.php   2008-02-02 13:52:39 UTC (rev 18466)
@@ -25,7 +25,7 @@
 
                function sms_sosms()
                {
-                       $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->account          = 
$GLOBALS['phpgw_info']['user']['account_id'];
                        $this->bocommon = CreateObject('sms.bocommon');
                        $this->db               = clone($GLOBALS['phpgw']->db);
@@ -89,8 +89,8 @@
 */
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
                                $querymethod = " $where in_sender $this->like 
'%$query%' OR in_msg $this->like '%$query%'";
                                
@@ -182,8 +182,8 @@
                        $querymethod = '';
                        if($query)
                        {
-                               $query = ereg_replace("'",'',$query);
-                               $query = ereg_replace('"','',$query);
+                               $query = preg_replace("/'/",'',$query);
+                               $query = preg_replace('/"/','',$query);
 
                                $querymethod = " AND p_dst $this->like 
'%$query%' OR p_msg $this->like '%$query%'";
                        }

Modified: trunk/sms/inc/class.uiautoreply.inc.php
===================================================================
--- trunk/sms/inc/class.uiautoreply.inc.php     2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/sms/inc/class.uiautoreply.inc.php     2008-02-02 13:52:39 UTC (rev 
18466)
@@ -33,7 +33,7 @@
 
                function sms_uiautoreply()
                {
-                       $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->nextmatchs                       = 
CreateObject('phpgwapi.nextmatchs');
                        $this->account                          = 
$GLOBALS['phpgw_info']['user']['account_id'];
                        $this->bo                               = 
CreateObject('sms.boautoreply',true);
@@ -90,7 +90,7 @@
 
                                
if($this->bocommon->check_perms($entry['grants'], PHPGW_ACL_DELETE))
                                {
-                                       $link_delete            = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uiautoreply.delete', 'autoreply_id'=> $entry['id']));
+                                       $link_delete            = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'sms.uiautoreply.delete', 'autoreply_id'=> $entry['id']));
                                        $text_delete            = 
lang('delete');
                                        $lang_delete_text       = lang('delete 
the autoreply code');
                                }
@@ -99,9 +99,9 @@
                                (
                                        'code'                                  
=> $entry['code'],
                                        'user'                                  
=> $GLOBALS['phpgw']->accounts->id2name($entry['uid']),
-                                       'link_edit'                             
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uiautoreply.manage', 'autoreply_id'=> $entry['id'])),
+                                       'link_edit'                             
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'sms.uiautoreply.manage', 'autoreply_id'=> $entry['id'])),
                                        'link_delete'                           
=> $link_delete,
-//                                     'link_view'                             
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uiautoreply.view&', 'autoreply_id'=> $entry['id'])),
+//                                     'link_view'                             
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'sms.uiautoreply.view&', 'autoreply_id'=> $entry['id'])),
 //                                     'lang_view_config_text'                 
=> lang('view the config'),
                                        'lang_edit_config_text'                 
=> lang('manage the autoreply code'),
 //                                     'text_view'                             
=> lang('view'),
@@ -124,7 +124,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'autoreply_code',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => 
$this->currentapp.'.uiautoreply.index',
+                                                                               
        'extra' => array('menuaction'   => 'sms.uiautoreply.index',
                                                                                
                                'query'         => $this->query,
                                                                                
                                'cat_id'        => $this->cat_id,
                                                                                
                                'allrows'       => $this->allrows)
@@ -147,7 +147,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiautoreply.index',
+                               'menuaction'    => 'sms.uiautoreply.index',
                                'sort'          => $this->sort,
                                'order'         => $this->order,
                                'cat_id'        => $this->cat_id,
@@ -161,7 +161,7 @@
                                (
                                        'lang_add'              => lang('add'),
                                        'lang_add_statustext'   => lang('add a 
autoreply'),
-                                       'add_action'            => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uiautoreply.add')),
+                                       'add_action'            => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'sms.uiautoreply.add')),
                                );
                        }
 
@@ -191,7 +191,7 @@
                        $appname                                        = 
lang('autoreplies');
                        $function_msg                                   = 
lang('list SMS autoreplies');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('sms') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
                        $this->save_sessiondata();
                }
@@ -222,7 +222,7 @@
                        }
 
                        $add_data = array(
-                               'menuaction'    => 
$this->currentapp.'.uiautoreply.add_yes',
+                               'menuaction'    => 'sms.uiautoreply.add_yes',
                                'autoreply_id'  => $autoreply_id
                                );
                                
@@ -238,7 +238,7 @@
                        ";
 
 
-                       $done_data = array('menuaction' => 
$this->currentapp.'.uiautoreply.index');
+                       $done_data = array('menuaction' => 
'sms.uiautoreply.index');
                        $done_url = 
$GLOBALS['phpgw']->link('/index.php',$done_data);
 
                        $content .= "
@@ -303,7 +303,7 @@
                        }
                        
                        $add_data = array(
-                               'menuaction'    => 
$this->currentapp.'.uiautoreply.' . $target,
+                               'menuaction'    => 'sms.uiautoreply.' . $target,
                                'err'           => urlencode($error_string)
                                );
 
@@ -347,7 +347,7 @@
 
 
                        $add_data = array(
-                               'menuaction'    => 
$this->currentapp.'.uiautoreply.add_scenario_yes',
+                               'menuaction'    => 
'sms.uiautoreply.add_scenario_yes',
                                'autoreply_id'  => $autoreply_id
                                );
                                
@@ -373,7 +373,7 @@
                        ";
 
                        $done_data = array(
-                               'menuaction'    => 
$this->currentapp.'.uiautoreply.manage',
+                               'menuaction'    => 'sms.uiautoreply.manage',
                                'autoreply_id'  => $autoreply_id);
                                
                        $done_url = 
$GLOBALS['phpgw']->link('/index.php',$done_data);
@@ -446,7 +446,7 @@
                        $target = 'add_scenario';
                        
                        $add_data = array(
-                               'menuaction'                    => 
$this->currentapp.'.uiautoreply.' . $target,
+                               'menuaction'                    => 
'sms.uiautoreply.' . $target,
                                'autoreply_id'                  => 
$autoreply_id,
                                'err'                           => 
urlencode($error_string),
                                'add_autoreply_scenario_result' => 
$add_autoreply_scenario_result
@@ -497,7 +497,7 @@
 
 
                        $edit_data = array(
-                               'menuaction'            => 
$this->currentapp.'.uiautoreply.edit_scenario_yes',
+                               'menuaction'            => 
'sms.uiautoreply.edit_scenario_yes',
                                'autoreply_id'          => $autoreply_id,
                                'autoreply_scenario_id' => 
$autoreply_scenario_id
                                );
@@ -529,7 +529,7 @@
                            </form>
                        ";
                        $done_data = array(
-                               'menuaction'    => 
$this->currentapp.'.uiautoreply.manage',
+                               'menuaction'    => 'sms.uiautoreply.manage',
                                'autoreply_id'  => $autoreply_id);
                                
                        $done_url = 
$GLOBALS['phpgw']->link('/index.php',$done_data);
@@ -602,7 +602,7 @@
                        $target = 'edit_scenario';
                        
                        $add_data = array(
-                               'menuaction'                            => 
$this->currentapp.'.uiautoreply.' . $target,
+                               'menuaction'                            => 
'sms.uiautoreply.' . $target,
                                'autoreply_id'                          => 
$autoreply_id,
                                'autoreply_scenario_id'                 => 
$autoreply_scenario_id,
                                'err'                                   => 
urlencode($error_string),
@@ -656,7 +656,7 @@
                        }
 
                        $add_data = array(
-                               'menuaction'    => 
$this->currentapp.'.uiautoreply.add_scenario',
+                               'menuaction'    => 
'sms.uiautoreply.add_scenario',
                                'autoreply_id'  => $autoreply_id
                                );
                                
@@ -696,7 +696,7 @@
                        ";
 
                        $done_data = array(
-                               'menuaction'    => 
$this->currentapp.'.uiautoreply.index');
+                               'menuaction'    => 'sms.uiautoreply.index');
                                
                        $done_url = 
$GLOBALS['phpgw']->link('/index.php',$done_data);
 
@@ -724,7 +724,7 @@
 
                        $link_data = array
                        (
-                               'menuaction' => 
$this->currentapp.'.uiautoreply.index',
+                               'menuaction' => 'sms.uiautoreply.index',
                                'autoreply_id' => $autoreply_id
                        );
 
@@ -768,7 +768,7 @@
                        $data = array
                        (
                                'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uiautoreply.delete', 'autoreply_id'=> $autoreply_id)),
+                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'sms.uiautoreply.delete', 'autoreply_id'=> $autoreply_id)),
                                'lang_confirm_msg'              => lang('do you 
really want to delete this entry'),
                                'lang_yes'                      => lang('yes'),
                                'lang_yes_statustext'           => lang('Delete 
the entry'),
@@ -779,7 +779,7 @@
                        $appname        = lang('autoreply');
                        $function_msg   = lang('delete autoreply');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('sms') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                }
 
@@ -800,7 +800,7 @@
 
                        $link_data = array
                        (
-                               'menuaction' => 
$this->currentapp.'.uiautoreply.manage',
+                               'menuaction' => 'sms.uiautoreply.manage',
                                'autoreply_id' => $autoreply_id
                        );
 
@@ -838,7 +838,7 @@
                        $data = array
                        (
                                'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uiautoreply.delete_scenario', 'autoreply_id'=> 
$autoreply_id, 'autoreply_scenario_id'=> $autoreply_scenario_id)),
+                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'sms.uiautoreply.delete_scenario', 'autoreply_id'=> $autoreply_id, 
'autoreply_scenario_id'=> $autoreply_scenario_id)),
                                'lang_confirm_msg'              => lang('do you 
really want to delete this entry'),
                                'lang_yes'                      => lang('yes'),
                                'lang_yes_statustext'           => lang('Delete 
the entry'),
@@ -849,7 +849,7 @@
                        $appname        = lang('autoreply');
                        $function_msg   = lang('delete autoreply');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('sms') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                }
 

Modified: trunk/sms/inc/class.uiboard.inc.php
===================================================================
--- trunk/sms/inc/class.uiboard.inc.php 2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/sms/inc/class.uiboard.inc.php 2008-02-02 13:52:39 UTC (rev 18466)
@@ -33,7 +33,7 @@
                function sms_uiboard()
                {
 
-                       $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                //      $this->nextmatchs                       = 
CreateObject('phpgwapi.nextmatchs');
                        $this->account                          = 
$GLOBALS['phpgw_info']['user']['account_id'];
                //      $this->bo                               = 
CreateObject('sms.boconfig',true);
@@ -78,7 +78,7 @@
                        }
 
 
-                       $add_data = array('menuaction'  => 
$this->currentapp.'.uiboard.add');
+                       $add_data = array('menuaction'  => 'sms.uiboard.add');
                        $add_url = 
$GLOBALS['phpgw']->link('/index.php',$add_data);
 
                        $content .= "
@@ -109,7 +109,7 @@
                        ";
 
                                $done_data = array(
-                               'menuaction'    => 
$this->currentapp.'.uisms.index');
+                               'menuaction'    => 'sms.uisms.index');
                                
                                $done_url = 
$GLOBALS['phpgw']->link('/index.php',$done_data);
 
@@ -173,7 +173,7 @@
                            }
                        }
 
-                       $done_data = array('menuaction' => 
$this->currentapp.'.uiboard.index');
+                       $done_data = array('menuaction' => 'sms.uiboard.index');
                        $done_url = 
$GLOBALS['phpgw']->link('/index.php',$done_data);
 
                        $content = "
@@ -213,7 +213,7 @@
                        }
 
                        $add_data = array(
-                               'menuaction'    => 
$this->currentapp.'.uiboard.add_yes',
+                               'menuaction'    => 'sms.uiboard.add_yes',
                                'autoreply_id' => $autoreply_id
                                );
                                
@@ -231,7 +231,7 @@
                            </form>
                        ";
 
-                       $done_data = array('menuaction' => 
$this->currentapp.'.uiboard.index');
+                       $done_data = array('menuaction' => 'sms.uiboard.index');
                        $done_url = 
$GLOBALS['phpgw']->link('/index.php',$done_data);
 
                        $content .= "
@@ -304,7 +304,7 @@
                        }
 
                        $add_data = array(
-                               'menuaction'    => 
$this->currentapp.'.uiboard.' . $target,
+                               'menuaction'    => 'sms.uiboard.' . $target,
                                'err' => urlencode($error_string)
                                );
 
@@ -345,7 +345,7 @@
                        $template = $this->db->f('board_pref_template');
 
                        $add_data = array(
-                               'menuaction'    => 
$this->currentapp.'.uiboard.edit_yes',
+                               'menuaction'    => 'sms.uiboard.edit_yes',
                                'board_id'      => $board_id,
                                'board_code'    => $board_code,
                                );
@@ -364,7 +364,7 @@
                                <p><input type=submit class=button value=Save>
                                </form>";
 
-                       $done_data = array('menuaction' => 
$this->currentapp.'.uiboard.index');
+                       $done_data = array('menuaction' => 'sms.uiboard.index');
                        $done_url = 
$GLOBALS['phpgw']->link('/index.php',$done_data);
 
                        $content .= "
@@ -427,7 +427,7 @@
                        }
 
                        $add_data = array(
-                               'menuaction'    => 
$this->currentapp.'.uiboard.' . $target,
+                               'menuaction'    => 'sms.uiboard.' . $target,
                                'board_id'      => $board_id,
                                'err'           => urlencode($error_string)
                                );
@@ -451,7 +451,7 @@
 
                        $link_data = array
                        (
-                               'menuaction' => 
$this->currentapp.'.uiboard.index'
+                               'menuaction' => 'sms.uiboard.index'
                        );
 
                        if (phpgw::get_var('confirm', 'bool', 'POST'))
@@ -501,7 +501,7 @@
                        $data = array
                        (
                                'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uiboard.delete', 'board_id'=> $board_id)),
+                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'sms.uiboard.delete', 'board_id'=> $board_id)),
                                'lang_confirm_msg'              => lang('do you 
really want to delete this entry'),
                                'lang_yes'                      => lang('yes'),
                                'lang_yes_statustext'           => lang('Delete 
the entry'),
@@ -511,7 +511,7 @@
 
                        $function_msg   = lang('delete SMS board code');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('sms') . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                }
        }

Modified: trunk/sms/inc/class.uicommand.inc.php
===================================================================
--- trunk/sms/inc/class.uicommand.inc.php       2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/sms/inc/class.uicommand.inc.php       2008-02-02 13:52:39 UTC (rev 
18466)
@@ -30,7 +30,7 @@
                function sms_uicommand()
                {
 
-                       $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->nextmatchs                       = 
CreateObject('phpgwapi.nextmatchs');
                        $this->account                          = 
$GLOBALS['phpgw_info']['user']['account_id'];
                        $this->bo                               = 
CreateObject('sms.bocommand');
@@ -89,7 +89,7 @@
 
                                
if($this->bocommon->check_perms($entry['grants'], PHPGW_ACL_DELETE))
                                {
-                                       $link_delete            = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uicommand.delete', 'command_id'=> $entry['id']));
+                                       $link_delete            = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'sms.uicommand.delete', 'command_id'=> $entry['id']));
                                        $text_delete            = 
lang('delete');
                                        $lang_delete_text       = lang('delete 
the command code');
                                }
@@ -99,9 +99,9 @@
                                        'code'                                  
=> $entry['code'],
                                        'exec'                                  
=> $entry['exec'],
                                        'user'                                  
=> $GLOBALS['phpgw']->accounts->id2name($entry['uid']),
-                                       'link_edit'                             
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uicommand.edit_command', 'command_id'=> $entry['id'])),
+                                       'link_edit'                             
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'sms.uicommand.edit_command', 'command_id'=> $entry['id'])),
                                        'link_delete'                           
=> $link_delete,
-//                                     'link_view'                             
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uicommand.view', 'command_id'=> $entry['id'])),
+//                                     'link_view'                             
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'sms.uicommand.view', 'command_id'=> $entry['id'])),
 //                                     'lang_view_config_text'                 
=> lang('view the config'),
                                        'lang_edit_config_text'                 
=> lang('manage the command code'),
 //                                     'text_view'                             
=> lang('view'),
@@ -124,7 +124,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'command_code',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => $this->currentapp.'.uicommand.index',
+                                                                               
        'extra' => array('menuaction'   => 'sms.uicommand.index',
                                                                                
                                'query'         => $this->query,
                                                                                
                                'cat_id'        => $this->cat_id,
                                                                                
                                'allrows'       => $this->allrows)
@@ -148,7 +148,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uicommand.index',
+                               'menuaction'    => 'sms.uicommand.index',
                                'sort'          => $this->sort,
                                'order'         => $this->order,
                                'cat_id'        => $this->cat_id,
@@ -162,7 +162,7 @@
                                (
                                        'lang_add'              => lang('add'),
                                        'lang_add_statustext'   => lang('add a 
command'),
-                                       'add_action'            => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uicommand.edit_command')),
+                                       'add_action'            => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'sms.uicommand.edit_command')),
                                );
                        }
 
@@ -192,7 +192,7 @@
                        $appname        = lang('commands');
                        $function_msg   = lang('list SMS commands');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('sms') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
                        $this->save_sessiondata();
                }
@@ -270,13 +270,13 @@
                                                if ($values['save'])
                                                {
                                                        
$GLOBALS['phpgw']->session->appsession('session_data','sms_command_receipt',$receipt);
-                                                       
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction'=> 
$this->currentapp.'.uicommand.index', 'command_id'=> $command_id));
+                                                       
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction'=> 
'sms.uicommand.index', 'command_id'=> $command_id));
                                                }
                                        }
                                }
                                else
                                {
-                                       
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction'=> 
$this->currentapp.'.uicommand.index', 'command_id'=> $command_id));
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction'=> 
'sms.uicommand.index', 'command_id'=> $command_id));
                                }
                        }
 
@@ -298,7 +298,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uicommand.edit_command',
+                               'menuaction'    => 'sms.uicommand.edit_command',
                                'command_id'    => $command_id
                        );
 
@@ -317,7 +317,7 @@
                                'lang_help4'                    => 
lang('##COMMANDCODE## replaced by command code'),
                                'lang_help5'                    => 
lang('##COMMANDPARAM## replaced by command parameter passed to server from 
SMS'),
                                'lang_binary_path'              => lang('SMS 
command binary path'),
-                               'value_binary_path'             => 
PHPGW_SERVER_ROOT . SEP . 'sms' . SEP . 'bin',
+                               'value_binary_path'             => 
PHPGW_SERVER_ROOT . '/sms/bin',
 
                                'lang_type'                     => 
lang('command type'),                                
                                'type_list'                     => 
$this->bo->select_type_list($values['type']),
@@ -342,7 +342,7 @@
 
                        $appname        = lang('command');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('sms') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_command' => $data));
                }
 
@@ -367,7 +367,7 @@
 
                                
if($this->bocommon->check_perms($entry['grants'], PHPGW_ACL_DELETE))
                                {
-                                       $link_delete            = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uicommand.delete', 'command_id'=> $entry['id']));
+                                       $link_delete            = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'sms.uicommand.delete', 'command_id'=> $entry['id']));
                                        $text_delete            = 
lang('delete');
                                        $lang_delete_text       = lang('delete 
the command code');
                                }
@@ -398,7 +398,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'command_log_code',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => $this->currentapp.'.uicommand.log',
+                                                                               
        'extra' => array('menuaction'   => 'sms.uicommand.log',
                                                                                
                                'query'         =>$this->query,
                                                                                
                                'cat_id'        =>$this->cat_id,
                                                                                
                                'allrows'       => $this->allrows)
@@ -408,7 +408,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'sms_sender',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => $this->currentapp.'.uicommand.log',
+                                                                               
        'extra' => array('menuaction'   => 'sms.uicommand.log',
                                                                                
                                'query'         => $this->query,
                                                                                
                                'cat_id'        => $this->cat_id,
                                                                                
                                'allrows'       => $this->allrows)
@@ -419,7 +419,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'command_log_id',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => $this->currentapp.'.uicommand.log',
+                                                                               
        'extra' => array('menuaction'   => 'sms.uicommand.log',
                                                                                
                                'query'         => $this->query,
                                                                                
                                'cat_id'        => $this->cat_id,
                                                                                
                                'allrows'       => $this->allrows)
@@ -444,7 +444,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uicommand.log',
+                               'menuaction'    => 'sms.uicommand.log',
                                'sort'          => $this->sort,
                                'order'         => $this->order,
                                'cat_id'        => $this->cat_id,
@@ -482,7 +482,7 @@
                        $appname        = lang('commands');
                        $function_msg   = lang('list SMS command log');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('sms') . ' - ' . $appname . ': ' . $function_msg;
                        $GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('log' 
=> $data));
                        $this->save_sessiondata();
                }
@@ -503,7 +503,7 @@
 
                        $link_data = array
                        (
-                               'menuaction' => 
$this->currentapp.'.uicommand.index'
+                               'menuaction' => 'sms.uicommand.index'
                        );
 
                        if (phpgw::get_var('confirm', 'bool', 'POST'))
@@ -544,7 +544,7 @@
                        $data = array
                        (
                                'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uicommand.delete', 'command_id'=> $command_id)),
+                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'sms.uicommand.delete', 'command_id'=> $command_id)),
                                'lang_confirm_msg'              => lang('do you 
really want to delete this entry'),
                                'lang_yes'                      => lang('yes'),
                                'lang_yes_statustext'           => lang('Delete 
the entry'),
@@ -554,7 +554,7 @@
 
                        $function_msg   = lang('delete SMS command code');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('sms') . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                }
        }

Modified: trunk/sms/inc/class.uiconfig.inc.php
===================================================================
--- trunk/sms/inc/class.uiconfig.inc.php        2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/sms/inc/class.uiconfig.inc.php        2008-02-02 13:52:39 UTC (rev 
18466)
@@ -44,7 +44,7 @@
                function sms_uiconfig()
                {
                        $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->nextmatchs                       = 
CreateObject('phpgwapi.nextmatchs');
                        $this->account                          = 
$GLOBALS['phpgw_info']['user']['account_id'];
                        $this->bo                               = 
CreateObject('sms.boconfig',true);
@@ -95,10 +95,10 @@
                                $content[] = array
                                (
                                        'name'                                  
=> $entry['name'],
-                                       'link_attribute'                        
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiconfig.list_attrib', 'type_id'=> $entry['id'])),
-                                       'link_edit'                             
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiconfig.edit_type', 'type_id'=> $entry['id'])),
-                                       'link_delete'                           
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiconfig.delete_type', 'type_id'=> $entry['id'])),
-                                       'link_view'                             
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiconfig.view_type', 'type_id'=> $entry['id'])),
+                                       'link_attribute'                        
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'sms.uiconfig.list_attrib', 'type_id'=> $entry['id'])),
+                                       'link_edit'                             
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'sms.uiconfig.edit_type', 'type_id'=> $entry['id'])),
+                                       'link_delete'                           
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'sms.uiconfig.delete_type', 'type_id'=> $entry['id'])),
+                                       'link_view'                             
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'sms.uiconfig.view_type', 'type_id'=> $entry['id'])),
                                        'lang_view_config_text'                 
=> lang('view the config'),
                                        'lang_edit_config_text'                 
=> lang('edit the config'),
                                        'text_view'                             
=> lang('view'),
@@ -120,7 +120,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'name',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => $this->currentapp.'.uiconfig.index',
+                                                                               
        'extra' => array('menuaction'   => 'sms.uiconfig.index',
                                                                                
                                'query'         => $this->query,
                                                                                
                                'cat_id'        => $this->cat_id,
                                                                                
                                'allrows'       => $this->allrows)
@@ -143,7 +143,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiconfig.index',
+                               'menuaction'    => 'sms.uiconfig.index',
                                'sort'          => $this->sort,
                                'order'         => $this->order,
                                'cat_id'        => $this->cat_id,
@@ -155,7 +155,7 @@
                        (
                                'lang_add'              => lang('add'),
                                'lang_add_statustext'   => lang('add a type'),
-                               'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiconfig.edit_type')),
+                               'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'sms.uiconfig.edit_type')),
                        );
 
                        $msgbox_data = $this->bocommon->msgbox_data($receipt);
@@ -184,7 +184,7 @@
                        $appname        = lang('config');
                        $function_msg   = lang('list type');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('sms') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_type' => $data));
                        $this->save_sessiondata();
                }
@@ -228,13 +228,13 @@
                                                if ($values['save'])
                                                {
                                                        
$GLOBALS['phpgw']->session->appsession('session_data','sms_c_type_receipt',$receipt);
-                                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiconfig.index', 'type_id'=> $type_id));
+                                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'sms.uiconfig.index', 'type_id'=> $type_id));
                                                }
                                        }
                                }
                                else
                                {
-                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiconfig.index', 'type_id'=> $type_id));
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'sms.uiconfig.index', 'type_id'=> $type_id));
                                }
                        }
 
@@ -256,7 +256,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiconfig.edit_type',
+                               'menuaction'    => 'sms.uiconfig.edit_type',
                                'type_id'       => $type_id
                        );
 
@@ -285,7 +285,7 @@
 
                        $appname                                        = 
lang('config');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('sms') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_type' => $data));
                }
 
@@ -321,14 +321,14 @@
                                'lang_id'                       => lang('Type 
ID'),
                                'lang_name'                     => lang('name'),
                                'lang_descr'                    => 
lang('descr'),
-                               'form_action'                   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiconfig.index')),
+                               'form_action'                   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'sms.uiconfig.index')),
                                'lang_cancel'                   => 
lang('cancel'),
                                'value_id'                      => $type_id,
                        );
 
                        $appname                                        = 
lang('config');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('sms') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view_type' => $data));
                }
 
@@ -347,7 +347,7 @@
                        
                        if(!$type_id)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiconfig.index'));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'sms.uiconfig.index'));
                        }
                        
                        
$GLOBALS['phpgw']->xslttpl->add_file(array('config','nextmatchs','menu',
@@ -366,9 +366,9 @@
                                $content[] = array
                                (
                                        'name'                                  
=> $entry['name'],
-                                       'link_value'                            
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiconfig.edit_value', 'type_id'=> $type_id, 'attrib_id'=> 
$entry['id'], 'id'=> $entry['value_id'])),
-                                       'link_edit'                             
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiconfig.edit_attrib', 'type_id'=> $entry['type_id'], 
'attrib_id'=> $entry['id'])),
-                                       'link_delete'                           
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiconfig.delete_attrib', 'type_id'=> $entry['type_id'], 
'attrib_id'=> $entry['id'])),
+                                       'link_value'                            
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'sms.uiconfig.edit_value', 'type_id'=> $type_id, 'attrib_id'=> $entry['id'], 
'id'=> $entry['value_id'])),
+                                       'link_edit'                             
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'sms.uiconfig.edit_attrib', 'type_id'=> $entry['type_id'], 'attrib_id'=> 
$entry['id'])),
+                                       'link_delete'                           
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'sms.uiconfig.delete_attrib', 'type_id'=> $entry['type_id'], 'attrib_id'=> 
$entry['id'])),
                                        'lang_edit_config_text'                 
=> lang('edit the config'),
                                        'text_edit'                             
=> lang('edit'),
                                        'text_delete'                           
=> lang('delete'),
@@ -388,7 +388,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'name',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => $this->currentapp.'.uiconfig.index',
+                                                                               
        'extra' => array('menuaction'   => 'sms.uiconfig.index',
                                                                                
                                'query'         => $this->query,
                                                                                
                                'cat_id'        => $this->cat_id,
                                                                                
                                'allrows'       => $this->allrows)
@@ -412,7 +412,7 @@
                        
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiconfig.list_attrib',
+                               'menuaction'    => 'sms.uiconfig.list_attrib',
                                'sort'          => $this->sort,
                                'order'         => $this->order,
                                'cat_id'        => $this->cat_id,
@@ -425,7 +425,7 @@
                        (
                                'lang_add'              => lang('add'),
                                'lang_add_statustext'   => lang('add a value'),
-                               'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiconfig.edit_attrib', 'type_id'=> $type_id)),
+                               'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'sms.uiconfig.edit_attrib', 'type_id'=> $type_id)),
                        );
 
                        $msgbox_data = $this->bocommon->msgbox_data($receipt);
@@ -456,7 +456,7 @@
                        $appname        = lang('config');
                        $function_msg   = lang('list attribute');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('sms') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_attrib' => $data));
                        $this->save_sessiondata();
                }
@@ -503,13 +503,13 @@
                                                if ($values['save'])
                                                {
                                                        
$GLOBALS['phpgw']->session->appsession('session_data','sms_c_attrib_receipt',$receipt);
-                                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiconfig.list_attrib', 'type_id'=> $type_id));
+                                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'sms.uiconfig.list_attrib', 'type_id'=> $type_id));
                                                }
                                        }
                                }
                                else
                                {
-                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiconfig.list_attrib', 'type_id'=> $type_id));
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'sms.uiconfig.list_attrib', 'type_id'=> $type_id));
                                }
                        }
 
@@ -531,7 +531,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiconfig.edit_attrib',
+                               'menuaction'    => 'sms.uiconfig.edit_attrib',
                                'type_id'       => $type_id,
                                'attrib_id'     => $attrib_id
                        );
@@ -585,7 +585,7 @@
 
                        $appname        = lang('config');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('sms') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_attrib' => $data));
                }
 
@@ -605,7 +605,7 @@
                                                
                        if(!$type_id && !$attrib_id)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiconfig.index'));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'sms.uiconfig.index'));
                        }
                        
                        
$GLOBALS['phpgw']->xslttpl->add_file(array('config','nextmatchs','menu',
@@ -624,9 +624,9 @@
                                $content[] = array
                                (
                                        'value'                                 
=> $entry['value'],
-                                       'link_edit'                             
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiconfig.edit_value', 'type_id'=> $entry['type_id'], 
'attrib_id'=> $entry['attrib_id'], 'id'=> $entry['id'])),
-                                       'link_delete'                           
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiconfig.delete_value', 'type_id'=> $entry['type_id'], 
'attrib_id'=> $entry['attrib_id'], 'id'=> $entry['id'])),
-                                       'link_view'                             
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiconfig.view_value', 'type_id'=> $entry['type_id'], 
'attrib_id'=> $entry['attrib_id'], 'id'=> $entry['id'])),
+                                       'link_edit'                             
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'sms.uiconfig.edit_value', 'type_id'=> $entry['type_id'], 'attrib_id'=> 
$entry['attrib_id'], 'id'=> $entry['id'])),
+                                       'link_delete'                           
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'sms.uiconfig.delete_value', 'type_id'=> $entry['type_id'], 'attrib_id'=> 
$entry['attrib_id'], 'id'=> $entry['id'])),
+                                       'link_view'                             
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'sms.uiconfig.view_value', 'type_id'=> $entry['type_id'], 'attrib_id'=> 
$entry['attrib_id'], 'id'=> $entry['id'])),
                                        'lang_view_config_text'                 
=> lang('view the config'),
                                        'lang_edit_config_text'                 
=> lang('edit the config'),
                                        'text_view'                             
=> lang('view'),
@@ -648,7 +648,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'value',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => $this->currentapp.'.uiconfig.index',
+                                                                               
        'extra' => array('menuaction'   => 'sms.uiconfig.index',
                                                                                
                                'query'         => $this->query,
                                                                                
                                'cat_id'        => $this->cat_id,
                                                                                
                                'allrows'       => $this->allrows)
@@ -674,7 +674,7 @@
                                                
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiconfig.list_value',
+                               'menuaction'    => 'sms.uiconfig.list_value',
                                'sort'          => $this->sort,
                                'order'         => $this->order,
                                'cat_id'        => $this->cat_id,
@@ -690,7 +690,7 @@
                                (
                                        'lang_add'              => lang('add'),
                                        'lang_add_statustext'   => lang('add a 
value'),
-                                       'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiconfig.edit_value', 'type_id'=> $type_id, 'attrib_id'=> 
$attrib_id)),
+                                       'add_action'            => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'sms.uiconfig.edit_value', 'type_id'=> $type_id, 'attrib_id'=> $attrib_id)),
                                );
                        }
 
@@ -698,7 +698,7 @@
 
                        $data = array
                        (
-                               'link_type'                                     
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiconfig.list_attrib', 'type_id'=> $type_id)),
+                               'link_type'                                     
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'sms.uiconfig.list_attrib', 'type_id'=> $type_id)),
                                'lang_type'                                     
=> lang('type'),
                                'value_type_name'                               
=> $type['name'],
                                'lang_attrib'                                   
=> lang('attribute'),
@@ -727,7 +727,7 @@
 ;
                        $function_msg   = lang('list values');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('sms') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_value' => $data));
                        $this->save_sessiondata();
                }
@@ -776,13 +776,13 @@
                                                if ($values['save'])
                                                {
                                                        
$GLOBALS['phpgw']->session->appsession('session_data','sms_c_attrib_receipt',$receipt);
-                                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiconfig.list_attrib', 'type_id'=> $type_id, 'attrib_id'=> 
$attrib_id));
+                                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'sms.uiconfig.list_attrib', 'type_id'=> $type_id, 'attrib_id'=> $attrib_id));
                                                }
                                        }
                                }
                                else
                                {
-                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiconfig.list_attrib', 'type_id'=> $type_id, 'attrib_id'=> 
$attrib_id));
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'sms.uiconfig.list_attrib', 'type_id'=> $type_id, 'attrib_id'=> $attrib_id));
                                }
                        }
 
@@ -804,7 +804,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiconfig.edit_value',
+                               'menuaction'    => 'sms.uiconfig.edit_value',
                                'type_id'       => $type_id,
                                'attrib_id'     => $attrib_id,
                                'id'            => $id
@@ -853,7 +853,7 @@
 
                        $appname        = lang('config');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('sms') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_value' => $data));
                }
 
@@ -871,7 +871,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiconfig.index',
+                               'menuaction'    => 'sms.uiconfig.index',
                                'type_id'       => $type_id
                        );
 
@@ -886,7 +886,7 @@
                        $data = array
                        (
                                'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiconfig.delete_type', 'type_id'=> $type_id)),
+                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'sms.uiconfig.delete_type', 'type_id'=> $type_id)),
                                'lang_confirm_msg'              => lang('do you 
really want to delete this entry'),
                                'lang_yes'                      => lang('yes'),
                                'lang_yes_statustext'           => lang('Delete 
the entry'),
@@ -897,7 +897,7 @@
                        $appname        = lang('config');
                        $function_msg   = lang('delete type');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('sms') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                }
 
@@ -916,7 +916,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiconfig.index',
+                               'menuaction'    => 'sms.uiconfig.index',
                                'type_id'       => $type_id,
                                'attrib_id'     => $attrib_id
                        );
@@ -932,7 +932,7 @@
                        $data = array
                        (
                                'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiconfig.delete_type','type_id'=> $type_id, 'attrib_id'=> 
$attrib_id)),
+                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'sms.uiconfig.delete_type','type_id'=> $type_id, 'attrib_id'=> $attrib_id)),
                                'lang_confirm_msg'              => lang('do you 
really want to delete this entry'),
                                'lang_yes'                      => lang('yes'),
                                'lang_yes_statustext'           => lang('Delete 
the entry'),
@@ -943,7 +943,7 @@
                        $appname        = lang('config');
                        $function_msg   = lang('delete attribute');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('sms') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                }
 
@@ -964,7 +964,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uiconfig.index',
+                               'menuaction'    => 'sms.uiconfig.index',
                                'type_id'       => $type_id,
                                'attrib_id'     => $attrib_id,
                                'id'            => $id
@@ -981,7 +981,7 @@
                        $data = array
                        (
                                'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uiconfig.delete_type', 'type_id'=> $type_id, 'attrib_id'=> 
$attrib_id, 'id'=> $id)),
+                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'sms.uiconfig.delete_type', 'type_id'=> $type_id, 'attrib_id'=> $attrib_id, 
'id'=> $id)),
                                'lang_confirm_msg'              => lang('do you 
really want to delete this entry'),
                                'lang_yes'                      => lang('yes'),
                                'lang_yes_statustext'           => lang('Delete 
the entry'),
@@ -992,7 +992,7 @@
                        $appname        = lang('config');
                        $function_msg   = lang('delete value');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('sms') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                }
 
@@ -1024,7 +1024,7 @@
                        $appname        = lang('config');
                        $function_msg   = lang('Daemon manual refresh');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('sms') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('daemon_manual' => $data));
                }
        }

Modified: trunk/sms/inc/class.uicustom.inc.php
===================================================================
--- trunk/sms/inc/class.uicustom.inc.php        2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/sms/inc/class.uicustom.inc.php        2008-02-02 13:52:39 UTC (rev 
18466)
@@ -32,7 +32,7 @@
                function sms_uicustom()
                {
 
-                       $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                //      $this->nextmatchs                       = 
CreateObject('phpgwapi.nextmatchs');
                        $this->account                          = 
$GLOBALS['phpgw_info']['user']['account_id'];
                //      $this->bo                               = 
CreateObject('sms.boconfig',true);
@@ -77,7 +77,7 @@
                        }
 
 
-                       $add_data = array('menuaction'  => 
$this->currentapp.'.uicustom.add');
+                       $add_data = array('menuaction'  => 'sms.uicustom.add');
                        $add_url = 
$GLOBALS['phpgw']->link('/index.php',$add_data);
 
                        $content .= "
@@ -107,7 +107,7 @@
                        ";
 
                                $done_data = array(
-                               'menuaction'    => 
$this->currentapp.'.uisms.index');
+                               'menuaction'    => 'sms.uisms.index');
                                
                                $done_url = 
$GLOBALS['phpgw']->link('/index.php',$done_data);
 
@@ -146,7 +146,7 @@
                        }
 
                        $add_data = array(
-                               'menuaction'    => 
$this->currentapp.'.uicustom.add_yes',
+                               'menuaction'    => 'sms.uicustom.add_yes',
                                'autoreply_id' => $autoreply_id
                                );
                                
@@ -166,7 +166,7 @@
                            </form>
                        ";
 
-                       $done_data = array('menuaction' => 
$this->currentapp.'.uicustom.index');
+                       $done_data = array('menuaction' => 
'sms.uicustom.index');
                        $done_url = 
$GLOBALS['phpgw']->link('/index.php',$done_data);
 
                        $content .= "
@@ -229,7 +229,7 @@
                        }
 
                        $add_data = array(
-                               'menuaction'    => 
$this->currentapp.'.uicustom.' . $target,
+                               'menuaction'    => 'sms.uicustom.' . $target,
                                'err' => urlencode($error_string)
                                );
 
@@ -269,7 +269,7 @@
                        $custom_code = $this->db->f('custom_code');
 
                        $add_data = array(
-                               'menuaction'    => 
$this->currentapp.'.uicustom.edit_yes',
+                               'menuaction'    => 'sms.uicustom.edit_yes',
                                'custom_id' => $custom_id,
                                'custom_code' => $custom_code,
                                );
@@ -278,7 +278,7 @@
 
                        $custom_url = stripslashes($this->db->f('custom_url'));
 
-               //      PHPGW_SERVER_ROOT . SEP . 'sms' . SEP . 'bin';
+               //      PHPGW_SERVER_ROOT . '/sms/bin';
                //      $custom_url = 
str_replace($feat_custom_path['bin'],'',$custom_url);
 
                        $content .= "
@@ -295,7 +295,7 @@
                            </form>
                        ";
 
-                       $done_data = array('menuaction' => 
$this->currentapp.'.uicustom.index');
+                       $done_data = array('menuaction' => 
'sms.uicustom.index');
                        $done_url = 
$GLOBALS['phpgw']->link('/index.php',$done_data);
 
                        $content .= "
@@ -348,7 +348,7 @@
                        }
 
                        $add_data = array(
-                               'menuaction'    => 
$this->currentapp.'.uicustom.' . $target,
+                               'menuaction'    => 'sms.uicustom.' . $target,
                                'custom_id' => $custom_id,
                                'err' => urlencode($error_string)
                                );
@@ -372,7 +372,7 @@
 
                        $link_data = array
                        (
-                               'menuaction' => 
$this->currentapp.'.uicustom.index'
+                               'menuaction' => 'sms.uicustom.index'
                        );
 
                        if (phpgw::get_var('confirm', 'bool', 'POST'))
@@ -413,7 +413,7 @@
                        $data = array
                        (
                                'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uicustom.delete', 'custom_id'=> $custom_id)),
+                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'sms.uicustom.delete', 'custom_id'=> $custom_id)),
                                'lang_confirm_msg'              => lang('do you 
really want to delete this entry'),
                                'lang_yes'                      => lang('yes'),
                                'lang_yes_statustext'           => lang('Delete 
the entry'),
@@ -423,7 +423,7 @@
 
                        $function_msg   = lang('delete SMS custom code');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('sms') . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                }
        }

Modified: trunk/sms/inc/class.uipoll.inc.php
===================================================================
--- trunk/sms/inc/class.uipoll.inc.php  2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/sms/inc/class.uipoll.inc.php  2008-02-02 13:52:39 UTC (rev 18466)
@@ -35,7 +35,7 @@
                function sms_uipoll()
                {
 
-                       $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->nextmatchs                       = 
CreateObject('phpgwapi.nextmatchs');
                        $this->account                          = 
$GLOBALS['phpgw_info']['user']['account_id'];
                        $this->bo                               = 
CreateObject('sms.bopoll',true);
@@ -94,7 +94,7 @@
                        {
                                
if($this->bocommon->check_perms($entry['grants'], PHPGW_ACL_DELETE))
                                {
-                                       $link_delete            = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uipoll.delete', 'poll_id'=> $entry['id']));
+                                       $link_delete            = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 'sms.uipoll.delete', 
'poll_id'=> $entry['id']));
                                        $text_delete            = 
lang('delete');
                                        $lang_delete_text       = lang('delete 
the poll code');
                                }
@@ -114,9 +114,9 @@
                                        'title'                                 
=> $entry['title'],
                                        'status'                                
=> $status,
                                        'user'                                  
=> $GLOBALS['phpgw']->accounts->id2name($entry['uid']),
-                                       'link_edit'                             
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uipoll.edit', 'poll_id'=> $entry['id'])),
+                                       'link_edit'                             
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'sms.uipoll.edit', 'poll_id'=> $entry['id'])),
                                        'link_delete'                           
=> $link_delete,
-                                       'link_view'                             
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uipoll.view', 'poll_id'=> $entry['id'])),
+                                       'link_view'                             
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'sms.uipoll.view', 'poll_id'=> $entry['id'])),
                                        'lang_view_config_text'                 
=> lang('view the config'),
                                        'lang_edit_config_text'                 
=> lang('manage the poll code'),
                                        'text_view'                             
=> lang('view'),
@@ -139,7 +139,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'poll_code',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => $this->currentapp.'.uipoll.index',
+                                                                               
        'extra' => array('menuaction'   => 'sms.uipoll.index',
                                                                                
                                'query'         => $this->query,
                                                                                
                                'cat_id'        => $this->cat_id,
                                                                                
                                'allrows'       => $this->allrows)
@@ -164,7 +164,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uipoll.index',
+                               'menuaction'    => 'sms.uipoll.index',
                                'sort'          => $this->sort,
                                'order'         => $this->order,
                                'cat_id'        => $this->cat_id,
@@ -178,7 +178,7 @@
                                (
                                        'lang_add'              => lang('add'),
                                        'lang_add_statustext'   => lang('add a 
poll'),
-                                       'add_action'            => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uipoll.add')),
+                                       'add_action'            => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 'sms.uipoll.add')),
                                );
                        }
 
@@ -208,7 +208,7 @@
                        $appname                = lang('polls');
                        $function_msg           = lang('list SMS polls');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('sms') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
                        $this->save_sessiondata();
                }
@@ -238,7 +238,7 @@
                        }
 
                        $add_data = array(
-                               'menuaction'    => 
$this->currentapp.'.uipoll.add_yes',
+                               'menuaction'    => 'sms.uipoll.add_yes',
                                'autoreply_id'  => $autoreply_id
                                );
                                
@@ -254,7 +254,7 @@
                            </form>
                        ";
 
-                       $done_data = array('menuaction' => 
$this->currentapp.'.uipoll.index');
+                       $done_data = array('menuaction' => 'sms.uipoll.index');
                        $done_url = 
$GLOBALS['phpgw']->link('/index.php',$done_data);
 
                        $content .= "
@@ -318,7 +318,7 @@
 
                        $add_data = array
                        (
-                               'menuaction'    => $this->currentapp.'.uipoll.' 
. $target,
+                               'menuaction'    => 'sms.uipoll.' . $target,
                                'err'           => urlencode($error_string)
                        );
 
@@ -380,7 +380,7 @@
                        }
 
                        $add_data = array(
-                               'menuaction'    => $this->currentapp.'.uipoll.' 
. $target,
+                               'menuaction'    => 'sms.uipoll.' . $target,
                                'poll_id'       => $poll_id,
                                'err'           => urlencode($error_string)
                                );
@@ -415,7 +415,7 @@
                        $this->db->transaction_commit();
        
                        $add_data = array(
-                               'menuaction'    => 
$this->currentapp.'.uipoll.edit',
+                               'menuaction'    => 'sms.uipoll.edit',
                                'poll_id' => $poll_id,
                                'err' => urlencode($error_string)
                                );
@@ -460,7 +460,7 @@
 
 
                        $edit_data = array(
-                               'menuaction'    => 
$this->currentapp.'.uipoll.edit_yes',
+                               'menuaction'    => 'sms.uipoll.edit_yes',
                                'poll_id' => $poll_id,
                                'poll_code' => $poll_code,
                                );
@@ -494,7 +494,7 @@
                        }
 
                        $add_data = array(
-                               'menuaction'    => 
$this->currentapp.'.uipoll.add_choice',
+                               'menuaction'    => 'sms.uipoll.add_choice',
                                'poll_id'       => $poll_id,
                                );
                        
@@ -512,13 +512,13 @@
                        
                        echo $content;
 
-                       $enable_data = array('menuaction'       => 
$this->currentapp.'.uipoll.status',
+                       $enable_data = array('menuaction'       => 
'sms.uipoll.status',
                                        'poll_id' => $poll_id,
                                        'ps' => 1,
                                        );
                        $enable_url = 
$GLOBALS['phpgw']->link('/index.php',$enable_data);
 
-                       $disable_data = array('menuaction'      => 
$this->currentapp.'.uipoll.status',
+                       $disable_data = array('menuaction'      => 
'sms.uipoll.status',
                                        'poll_id' => $poll_id,
                                        'ps' => 0,
                                        );
@@ -548,7 +548,7 @@
                            <br>
                            ";
 
-                       $done_data = array('menuaction' => 
$this->currentapp.'.uipoll.index');
+                       $done_data = array('menuaction' => 'sms.uipoll.index');
                        $done_url = 
$GLOBALS['phpgw']->link('/index.php',$done_data);
 
                        $content .= "
@@ -598,7 +598,7 @@
                        }
 
                        $add_data = array(
-                               'menuaction'    => $this->currentapp.'.uipoll.' 
. $target,
+                               'menuaction'    => 'sms.uipoll.' . $target,
                                'poll_id' => $poll_id,
                                'err' => urlencode($error_string)
                                );
@@ -697,7 +697,7 @@
                            ";
 
                                $done_data = array(
-                               'menuaction'    => 
$this->currentapp.'.uipoll.index');
+                               'menuaction'    => 'sms.uipoll.index');
                                
                                $done_url = 
$GLOBALS['phpgw']->link('/index.php',$done_data);
 
@@ -726,7 +726,7 @@
 
                        $link_data = array
                        (
-                               'menuaction' => 
$this->currentapp.'.uipoll.index',
+                               'menuaction' => 'sms.uipoll.index',
                                'poll_id' => $poll_id
                        );
 
@@ -768,7 +768,7 @@
                        $data = array
                        (
                                'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uipoll.delete', 'poll_id'=> $poll_id)),
+                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 'sms.uipoll.delete', 
'poll_id'=> $poll_id)),
                                'lang_confirm_msg'              => lang('do you 
really want to delete this entry'),
                                'lang_yes'                              => 
lang('yes'),
                                'lang_yes_statustext'   => lang('Delete the 
entry'),
@@ -779,7 +779,7 @@
                        $appname                                        = 
lang('sms');
                        $function_msg                                   = 
lang('delete poll');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('sms') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                }
 
@@ -800,7 +800,7 @@
 
                        $link_data = array
                        (
-                               'menuaction' => 
$this->currentapp.'.uipoll.edit',
+                               'menuaction' => 'sms.uipoll.edit',
                                'poll_id' => $poll_id
                        );
 
@@ -840,7 +840,7 @@
                        $data = array
                        (
                                'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
$this->currentapp.'.uipoll.delete_choice', 'poll_id'=> $poll_id, 'choice_id'=> 
$choice_id)),
+                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'sms.uipoll.delete_choice', 'poll_id'=> $poll_id, 'choice_id'=> $choice_id)),
                                'lang_confirm_msg'              => lang('do you 
really want to delete this entry'),
                                'lang_yes'                      => lang('yes'),
                                'lang_yes_statustext'           => lang('Delete 
the entry'),
@@ -851,7 +851,7 @@
                        $appname                = lang('sms');
                        $function_msg           = lang('delete poll choice');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('sms') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                }
        }

Modified: trunk/sms/inc/class.uisms.inc.php
===================================================================
--- trunk/sms/inc/class.uisms.inc.php   2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/sms/inc/class.uisms.inc.php   2008-02-02 13:52:39 UTC (rev 18466)
@@ -39,7 +39,7 @@
                function sms_uisms()
                {
                        $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+               //      $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->nextmatchs                       = 
CreateObject('phpgwapi.nextmatchs');
                        $this->account                          = 
$GLOBALS['phpgw_info']['user']['account_id'];
                        $this->bocommon                         = 
CreateObject('sms.bocommon');
@@ -107,7 +107,7 @@
                        {
                                
if($this->bocommon->check_perms($entry['grants'], PHPGW_ACL_DELETE))
                                {
-                                       $link_delete            = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uisms.delete_in', 'id'=> $entry['id']));
+                                       $link_delete            = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'sms.uisms.delete_in', 'id'=> $entry['id']));
                                        $text_delete            = 
lang('delete');
                                        $lang_delete_sms_text   = lang('delete 
the sms from inbox');
                                }
@@ -120,7 +120,7 @@
 
                                if($add_right)
                                {
-                                       $link_answer            = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uisms.send' ,'p_num'=> $entry['sender']));
+                                       $link_answer            = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 'sms.uisms.send' 
,'p_num'=> $entry['sender']));
                                }
 
 
@@ -151,7 +151,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'in_datetime',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => $this->currentapp.'.uisms.index',
+                                                                               
        'extra' => array('menuaction'   => 'sms.uisms.index',
                                                                                
                                'query'         =>$this->query,
                                                                                
                                'cat_id'        =>$this->cat_id,
                                                                                
                                'allrows'       => $this->allrows)
@@ -161,7 +161,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'in_sender',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => $this->currentapp.'.uisms.index',
+                                                                               
        'extra' => array('menuaction'   => 'sms.uisms.index',
                                                                                
                                'query'         =>$this->query,
                                                                                
                                'cat_id'        =>$this->cat_id,
                                                                                
                                'allrows'       => $this->allrows)
@@ -187,7 +187,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uisms.index',
+                               'menuaction'    => 'sms.uisms.index',
                                'sort'          => $this->sort,
                                'order'         => $this->order,
                                'cat_id'        => $this->cat_id,
@@ -203,10 +203,10 @@
                                (
                                        'lang_send'                     => 
lang('Send text SMS'),
                                        'lang_send_statustext'          => 
lang('send single'),
-                                       'send_action'                   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uisms.send', 'from'=>'index')),
+                                       'send_action'                   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 'sms.uisms.send', 
'from'=>'index')),
                                        'lang_send_group'               => 
lang('Send broadcast SMS'),
                                        'lang_send_group_statustext'    => 
lang('send group'),
-                                       'send_group_action'             => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uisms.send_group', 'from'=>'index')),
+                                       'send_group_action'             => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'sms.uisms.send_group', 'from'=>'index')),
                                );
                        }
 
@@ -236,7 +236,7 @@
                        $appname        = lang('inbox');
                        $function_msg   = lang('list inbox');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('sms') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_inbox' => $data));
                        $this->save_sessiondata();
                }
@@ -268,7 +268,7 @@
                        {
                                
if($this->bocommon->check_perms($entry['grants'], PHPGW_ACL_DELETE))
                                {
-                                       $link_delete            = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uisms.delete_out', 'id'=> $entry['id']));
+                                       $link_delete            = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'sms.uisms.delete_out', 'id'=> $entry['id']));
                                        $text_delete            = 
lang('delete');
                                        $lang_delete_sms_text = lang('delete 
the sms from outbox');
                                }
@@ -303,7 +303,7 @@
                                                                                
        'sort'  => $this->sort,
                                                                                
        'var'   => 'p_datetime',
                                                                                
        'order' => $this->order,
-                                                                               
        'extra' => array('menuaction'   => $this->currentapp.'.uisms.outbox',
+                                                                               
        'extra' => array('menuaction'   => 'sms.uisms.outbox',
                                                                                
                                'query'         => $this->query,
                                                                                
                                'cat_id'        => $this->cat_id,
                                                                                
                                'allrows'       => $this->allrows)
@@ -329,7 +329,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uisms.outbox',
+                               'menuaction'    => 'sms.uisms.outbox',
                                'sort'          => $this->sort,
                                'order'         => $this->order,
                                'cat_id'        => $this->cat_id,
@@ -344,10 +344,10 @@
                                (
                                        'lang_send'                     => 
lang('Send text SMS'),
                                        'lang_send_statustext'          => 
lang('send single'),
-                                       'send_action'                   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uisms.send', 'from'=>'outbox')),
+                                       'send_action'                   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 'sms.uisms.send', 
'from'=>'outbox')),
                                        'lang_send_group'               => 
lang('Send broadcast SMS'),
                                        'lang_send_group_statustext'    => 
lang('send group'),
-                                       'send_group_action'             => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uisms.send_group', 'from'=>'outbox')),
+                                       'send_group_action'             => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'sms.uisms.send_group', 'from'=>'outbox')),
                                );
                        }
 
@@ -378,7 +378,7 @@
                        $appname        = lang('outbox');
                        $function_msg   = lang('list outbox');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('sms') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_outbox' => $data));
                        $this->save_sessiondata();
 
@@ -433,13 +433,13 @@
                                                if ($values['save'])
                                                {
                                                        
$GLOBALS['phpgw']->session->appsession('session_data','sms_send_receipt',$receipt);
-                                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uisms.' . $from));
+                                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 'sms.uisms.' 
. $from));
                                                }
                                        }
                                }
                                else
                                {
-                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
$this->currentapp.'.uisms.' . $from));
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 'sms.uisms.' 
. $from));
                                }
                        }
 
@@ -461,7 +461,7 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 
$this->currentapp.'.uisms.send',
+                               'menuaction'    => 'sms.uisms.send',
                                'sms_id'        => $sms_id,
                                'from'          => $from
                        );
@@ -537,7 +537,7 @@
 
                        $appname        = lang('send sms');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('sms') . ' - ' . $appname;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('send' => $data));
                }
 
@@ -556,7 +556,7 @@
 
                        $link_data = array
                        (
-                               'menuaction' => $this->currentapp.'.uisms.index'
+                               'menuaction' => 'sms.uisms.index'
                        );
 
                        if (phpgw::get_var('confirm', 'bool', 'POST'))
@@ -570,7 +570,7 @@
                        $data = array
                        (
                                'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uisms.delete_in', 'id'=> $id)),
+                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'sms.uisms.delete_in', 'id'=> $id)),
                                'lang_confirm_msg'              => lang('do you 
really want to delete this entry'),
                                'lang_yes'                      => lang('yes'),
                                'lang_yes_statustext'           => lang('Delete 
the entry'),
@@ -581,7 +581,7 @@
                        $appname                                = 
lang('outbox');
                        $function_msg                           = 
lang('delete');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('sms') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                }
 
@@ -600,7 +600,7 @@
 
                        $link_data = array
                        (
-                               'menuaction' => 
$this->currentapp.'.uisms.outbox'
+                               'menuaction' => 'sms.uisms.outbox'
                        );
 
                        if (phpgw::get_var('confirm', 'bool', 'POST'))
@@ -614,7 +614,7 @@
                        $data = array
                        (
                                'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
$this->currentapp.'.uisms.delete_out', 'id'=> $id)),
+                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'sms.uisms.delete_out', 'id'=> $id)),
                                'lang_confirm_msg'              => lang('do you 
really want to delete this entry'),
                                'lang_yes'                      => lang('yes'),
                                'lang_yes_statustext'           => lang('Delete 
the entry'),
@@ -625,7 +625,7 @@
                        $appname        = lang('outbox');
                        $function_msg   = lang('delete');
 
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('sms') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                }
        }

Modified: trunk/sms/inc/feedcreator.class.php
===================================================================
--- trunk/sms/inc/feedcreator.class.php 2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/sms/inc/feedcreator.class.php 2008-02-02 13:52:39 UTC (rev 18466)
@@ -726,7 +726,7 @@
                        $feed.= "Subject: 
".MBOXCreator::qp_enc(FeedCreator::iTrunc($this->items[$i]->title,100))."\n";
                        $feed.= "\n";
                        $body = 
chunk_split(MBOXCreator::qp_enc($this->items[$i]->description));
-                       $feed.= preg_replace("~\nFrom ([^\n]*)(\n?)~","\n>From 
$1$2\n",$body);
+                       $feed.= preg_replace("/~\nFrom 
([^\n]*)(\n?)~/","\n>From $1$2\n",$body);
                        $feed.= "\n";
                        $feed.= "\n";
                }

Added: trunk/sms/inc/hook_sidebox_menu.inc.php
===================================================================
--- trunk/sms/inc/hook_sidebox_menu.inc.php                             (rev 0)
+++ trunk/sms/inc/hook_sidebox_menu.inc.php     2008-02-02 13:52:39 UTC (rev 
18466)
@@ -0,0 +1,13 @@
+<?php
+
+       $menu_title = $GLOBALS['phpgw_info']['apps'][$appname]['title'] . ' '. 
lang('Menu');
+       $menu = $GLOBALS['phpgw']->session->appsession('menu_sms','sidebox');   
+       if(isset($menu) && is_array($menu))
+       {
+               display_sidebox($appname,$menu_title,$menu['module'],$use_lang 
= false);
+               if(isset($menu['sub_menu']) && $menu['sub_menu'])
+               {
+                       display_sidebox($appname,$menu['sub_menu'] . ' ' . lang 
('sub menu'),$menu['sub_menu'],$use_lang = false);      
+               }
+       }       
+?>

Modified: trunk/sms/inc/plugin/gateway/clickatell/fn.php
===================================================================
--- trunk/sms/inc/plugin/gateway/clickatell/fn.php      2008-02-02 11:18:25 UTC 
(rev 18465)
+++ trunk/sms/inc/plugin/gateway/clickatell/fn.php      2008-02-02 13:52:39 UTC 
(rev 18466)
@@ -187,7 +187,7 @@
     $handle = @opendir("$clktl_param[incoming_path]/cache/smsd");
     while ($sms_in_file = @readdir($handle))
     {
-       if (eregi("^ERR.in",$sms_in_file) && !eregi("^[.]",$sms_in_file))
+       if (preg_match("/^ERR.in/i",$sms_in_file) && 
!preg_match("/^[.]/",$sms_in_file))
        {
            $fn = "$clktl_param[incoming_path]/cache/smsd/$sms_in_file";
            $tobe_deleted = $fn;

Modified: trunk/sms/inc/plugin/gateway/gnokii/fn.php
===================================================================
--- trunk/sms/inc/plugin/gateway/gnokii/fn.php  2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/sms/inc/plugin/gateway/gnokii/fn.php  2008-02-02 13:52:39 UTC (rev 
18466)
@@ -98,7 +98,7 @@
                    $handle = @opendir($this->gnokii_param[path] . 
"/cache/smsd");
                    while ($sms_in_file = @readdir($handle))
                    {
-                       if (eregi("^ERR.in",$sms_in_file) && 
!eregi("^[.]",$sms_in_file))
+                       if (preg_match("/^ERR.in/i",$sms_in_file) && 
!preg_match("/^[.]/",$sms_in_file))
                        {
                            $fn = $this->gnokii_param[path] . 
"/cache/smsd/$sms_in_file";
                            $tobe_deleted = $fn;

Modified: trunk/sms/inc/plugin/gateway/kannel/fn.php
===================================================================
--- trunk/sms/inc/plugin/gateway/kannel/fn.php  2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/sms/inc/plugin/gateway/kannel/fn.php  2008-02-02 13:52:39 UTC (rev 
18466)
@@ -71,7 +71,7 @@
     $handle = @opendir($kannel_param['path']."/cache/smsd");
     while ($sms_in_file = @readdir($handle))
     {
-       if (eregi("^ERR.in",$sms_in_file) && !eregi("^[.]",$sms_in_file))
+       if (preg_match("/^ERR.in/i",$sms_in_file) && 
!preg_match("/^[.]/",$sms_in_file))
        {
            $fn = $kannel_param['path']."/cache/smsd/$sms_in_file";
            $tobe_deleted = $fn;

Modified: trunk/sms/inc/plugin/gateway/uplink/fn.php
===================================================================
--- trunk/sms/inc/plugin/gateway/uplink/fn.php  2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/sms/inc/plugin/gateway/uplink/fn.php  2008-02-02 13:52:39 UTC (rev 
18466)
@@ -138,7 +138,7 @@
     $handle = @opendir("$gnokii_param[path]/cache/smsd");
     while ($sms_in_file = @readdir($handle))
     {
-       if (eregi("^ERR.in",$sms_in_file) && !eregi("^[.]",$sms_in_file))
+       if (preg_match("/^ERR.in/i",$sms_in_file) && 
!preg_match("^[.]",$sms_in_file))
        {
            $fn = "$gnokii_param[path]/cache/smsd/$sms_in_file";
            $tobe_deleted = $fn;

Modified: trunk/sms/init.php
===================================================================
--- trunk/sms/init.php  2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/sms/init.php  2008-02-02 13:52:39 UTC (rev 18466)
@@ -17,6 +17,4 @@
        $apps_config['multilogin']      = 1; // 0 for single session login; 1 
for multi session login
        $GLOBALS['phpgw_info']['sms_config']['common']['apps_config'] = 
$apps_config;
 
-       include_once($path_to_phpgroupware . SEP . 'sms' . SEP . 'inc' . SEP . 
'config.php');
-
-?>
+       include_once($path_to_phpgroupware . '/sms/inc/config.php');

Modified: trunk/sms/setup/default_records.inc.php
===================================================================
--- trunk/sms/setup/default_records.inc.php     2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/sms/setup/default_records.inc.php     2008-02-02 13:52:39 UTC (rev 
18466)
@@ -97,9 +97,6 @@
 
 // -- end config
 
-
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_gwmodUplink (up_local_slid,up_remote_slid,up_status) VALUES 
(3,259,1)");
-
        $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_featautoreply (uid, autoreply_code) VALUES (1,'HELP')");
 
        $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_featautoreply_scenario 
(autoreply_id,autoreply_scenario_param1,autoreply_scenario_param2,autoreply_scenario_param3,autoreply_scenario_param4,autoreply_scenario_param5,autoreply_scenario_param6,autoreply_scenario_param7,autoreply_scenario_result)
 VALUES (1,'INTERNET','DOWN','','','','','','Please contact sysadmin via phone: 
+62 21 8613027')");

Modified: trunk/sms/setup/setup.inc.php
===================================================================
--- trunk/sms/setup/setup.inc.php       2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/sms/setup/setup.inc.php       2008-02-02 13:52:39 UTC (rev 18466)
@@ -71,7 +71,8 @@
 //             'help',
                'settings',
                'preferences',
-               'admin'
+               'admin',
+               'sidebox_menu'
        );
 
        /* Dependencies for this app to work */

Modified: trunk/sms/templates/base/menu.xsl
===================================================================
--- trunk/sms/templates/base/menu.xsl   2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/sms/templates/base/menu.xsl   2008-02-02 13:52:39 UTC (rev 18466)
@@ -12,10 +12,10 @@
                                                <xsl:text>  </xsl:text>
                                                <xsl:choose>
                                                        <xsl:when test="this=1">
-                                                               <a 
href="{link}" onMouseover="window.status='{statustext}';return true;" 
onMouseout="window.status='';return 
true;"><b><xsl:text>[</xsl:text><xsl:value-of 
select="name"/><xsl:text>]</xsl:text></b></a>                                   
     
+                                                               <a href="{url}" 
onMouseover="window.status='{statustext}';return true;" 
onMouseout="window.status='';return 
true;"><b><xsl:text>[</xsl:text><xsl:value-of 
select="text"/><xsl:text>]</xsl:text></b></a>                                 
                                                        </xsl:when>
                                                        <xsl:otherwise>
-                                                               <a 
href="{link}" onMouseover="window.status='{statustext}';return true;" 
onMouseout="window.status='';return true;"><xsl:value-of select="name"/></a>    
                               
+                                                               <a href="{url}" 
onMouseover="window.status='{statustext}';return true;" 
onMouseout="window.status='';return true;"><xsl:value-of select="text"/></a>    
                                
                                                        </xsl:otherwise>
                                                </xsl:choose>
 
@@ -31,10 +31,10 @@
                                                <xsl:text>  </xsl:text>
                                                <xsl:choose>
                                                        <xsl:when test="this=1">
-                                                               <a 
href="{link}" onMouseover="window.status='{statustext}';return true;" 
onMouseout="window.status='';return 
true;"><b><xsl:text>[</xsl:text><xsl:value-of 
select="name"/><xsl:text>]</xsl:text></b></a>                                   
     
+                                                               <a href="{url}" 
onMouseover="window.status='{statustext}';return true;" 
onMouseout="window.status='';return 
true;"><b><xsl:text>[</xsl:text><xsl:value-of 
select="text"/><xsl:text>]</xsl:text></b></a>                                 
                                                        </xsl:when>
                                                        <xsl:otherwise>
-                                                               <a 
href="{link}" onMouseover="window.status='{statustext}';return true;" 
onMouseout="window.status='';return true;"><xsl:value-of select="name"/></a>    
                               
+                                                               <a href="{url}" 
onMouseover="window.status='{statustext}';return true;" 
onMouseout="window.status='';return true;"><xsl:value-of select="text"/></a>    
                                
                                                        </xsl:otherwise>
                                                </xsl:choose>
                                        </xsl:for-each>
@@ -52,10 +52,10 @@
                                                                <xsl:text>  
</xsl:text>
                                                                <xsl:choose>
                                                                        
<xsl:when test="this=1">
-                                                                               
<a href="{link}" onMouseover="window.status='{statustext}';return true;" 
onMouseout="window.status='';return 
true;"><b><xsl:text>[</xsl:text><xsl:value-of 
select="name"/><xsl:text>]</xsl:text></b></a>                                   
     
+                                                                               
<a href="{url}" onMouseover="window.status='{statustext}';return true;" 
onMouseout="window.status='';return 
true;"><b><xsl:text>[</xsl:text><xsl:value-of 
select="text"/><xsl:text>]</xsl:text></b></a>                                 
                                                                        
</xsl:when>
                                                                        
<xsl:otherwise>
-                                                                               
<a href="{link}" onMouseover="window.status='{statustext}';return true;" 
onMouseout="window.status='';return true;"><xsl:value-of select="name"/></a>    
                               
+                                                                               
<a href="{url}" onMouseover="window.status='{statustext}';return true;" 
onMouseout="window.status='';return true;"><xsl:value-of select="text"/></a>    
                                
                                                                        
</xsl:otherwise>
                                                                </xsl:choose>
                                                        </xsl:for-each>

Modified: trunk/soap/setup/phpgw_sv.lang
===================================================================
--- trunk/soap/setup/phpgw_sv.lang      2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/soap/setup/phpgw_sv.lang      2008-02-02 13:52:39 UTC (rev 18466)
@@ -1,3 +1,4 @@
 interop tests  soap    sv      Interop tester
 soap test      common  sv      SOAP Test
 test suite     soap    sv      Testsvit
+

Modified: trunk/stocks/setup/phpgw_sv.lang
===================================================================
--- trunk/stocks/setup/phpgw_sv.lang    2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/stocks/setup/phpgw_sv.lang    2008-02-02 13:52:39 UTC (rev 18466)
@@ -11,3 +11,4 @@
 stock quotes   common  sv      Aktiekurser
 stocks common  sv      Aktiekurser
 symbol stocks  sv      Symbol
+

Modified: trunk/syncml/setup/phpgw_en.lang
===================================================================
--- trunk/syncml/setup/phpgw_en.lang    2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/syncml/setup/phpgw_en.lang    2008-02-02 13:52:39 UTC (rev 18466)
@@ -1 +1 @@
-syncml syncml  en      SyncML interface
+syncml common  en      SyncML interface

Modified: trunk/todo/inc/class.bopreferences.inc.php
===================================================================
--- trunk/todo/inc/class.bopreferences.inc.php  2008-02-02 11:18:25 UTC (rev 
18465)
+++ trunk/todo/inc/class.bopreferences.inc.php  2008-02-02 13:52:39 UTC (rev 
18466)
@@ -18,7 +18,7 @@
        *  
        * @package todo
        */
-       class bopreferences
+       class todo_bopreferences
        {
                var $public_functions = Array(
                        'preferences'  => True
@@ -27,7 +27,7 @@
                var $prefs;
                var $debug = False;
 
-               function bopreferences()
+               function __construct()
                {
                        $GLOBALS['phpgw']->nextmatchs = 
CreateObject('phpgwapi.nextmatchs');
                        $this->prefs['todo']    = 
$GLOBALS['phpgw_info']['user']['preferences']['todo'];

Added: trunk/todo/inc/class.menu.inc.php
===================================================================
--- trunk/todo/inc/class.menu.inc.php                           (rev 0)
+++ trunk/todo/inc/class.menu.inc.php   2008-02-02 13:52:39 UTC (rev 18466)
@@ -0,0 +1,119 @@
+<?php
+       /**
+        * todo - Menus
+        *
+        * @author Dave Hall <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 todo 
+        * @version $Id: class.menu.inc.php 690 2008-02-02 10:11:33Z dave $
+        */
+
+       /*
+          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/>.
+        */
+
+
+       /**
+        * Menus
+        *
+        * @package todo
+        */     
+       class todo_menu
+       {
+               /**
+                * Get the menus for the todo
+                *
+                * @return array available menus for the current user
+                */
+               function get_menu()
+               {
+                       $menus = array();
+
+                       $menus['navbar'] = array
+                       (
+                               'todo' => array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('todo', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'todo.uitodo.show_list') ),
+                                       'image' => array('todo', 'navbar'),
+                                       'order' => 10,
+                                       'group' => 'office'
+                               )
+                       );
+
+                       $menus['toolbar'] = array
+                       (
+                               array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('New', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 'todo.uitodo.add') ),
+                               )
+                       );
+
+                       if ( 
isset($GLOBALS['phpgw_info']['user']['apps']['admin']) )
+                       {
+                               $menus['admin'] = array
+                               (
+                                       array
+                                       (
+                                               'text'  => 
$GLOBALS['phpgw']->translation->translate('Global Categories', array(), true),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.uicategories.index', 'appname' => 'todo', 'global_cats' => 1) )
+                                       )
+                               );
+                       }
+
+                       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'      => 
'todo')),
+                                       ),
+                                       array
+                                       (
+                                               'text'  => 
$GLOBALS['phpgw']->translation->translate('Grant Access', array(), true),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'preferences.uiadmin_acl.aclprefs', 'acl_app' => 'todo'))
+                                       ),
+                                       array
+                                       (
+                                               'text'  => 
$GLOBALS['phpgw']->translation->translate('Edit categories', array(), true),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'preferences.uicategories.index', 'cats_app' => 'todo', 'cats_level' => 1, 
'global_cats'=> 1))
+                                       )
+                               );
+
+                               $menus['toolbar'][] = array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('Preferences', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/preferences/preferences.php', array('appname'      => 
'todo')),
+                                       'image' => array('todo', 'preferences')
+                               );
+                       }
+
+                       $menus['navigation'] =  array
+                       (
+                               array
+                               (
+                                       'text'  => 
$GLOBALS['phpgw']->translation->translate('New', array(), true),
+                                       'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 'todo.uitodo.add') ),
+                               )
+                       );
+
+                       $menus['folders'] = 
phpgwapi_menu::get_categories('todo');
+
+                       return $menus;
+               }
+       }

Modified: trunk/todo/setup/phpgw_sv.lang
===================================================================
--- trunk/todo/setup/phpgw_sv.lang      2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/todo/setup/phpgw_sv.lang      2008-02-02 13:52:39 UTC (rev 18466)
@@ -53,3 +53,4 @@
 you have entered an ending invalid date        todo    sv      Du har angett 
ett felaktigt slutdatum !
 you have entered an invailed date      todo    sv      du har skrivit in ett 
ogiltigt datum
 you have entered an starting invalid date      todo    sv      Du har angett 
ett felaktigt startdatum !
+

Modified: trunk/todo/setup/setup.inc.php
===================================================================
--- trunk/todo/setup/setup.inc.php      2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/todo/setup/setup.inc.php      2008-02-02 13:52:39 UTC (rev 18466)
@@ -48,8 +48,7 @@
                'home',
                'deleteaccount',
                'manual',
-               'preferences',
-               'admin'
+               'menu'  => 'todo.menu.get_menu'
        );
 
        /* Dependencies for this app to work */

Modified: trunk/tts/inc/class.uitts.inc.php
===================================================================
--- trunk/tts/inc/class.uitts.inc.php   2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/tts/inc/class.uitts.inc.php   2008-02-02 13:52:39 UTC (rev 18466)
@@ -140,8 +140,7 @@
                        $group_id = (int) $_GET['group_id'];
                        $accounts = createObject('phpgwapi.accounts');
                        $members = $accounts->member($group_id);
-                       $json = createObject('phpgwapi.Services_JSON');
-                       echo $json->encode($members);
+                       echo json_encode($members);
                        exit;
                }
                

Modified: trunk/tts/setup/phpgw_sv.lang
===================================================================
--- trunk/tts/setup/phpgw_sv.lang       2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/tts/setup/phpgw_sv.lang       2008-02-02 13:52:39 UTC (rev 18466)
@@ -61,3 +61,4 @@
 view all tickets       tts     sv      Visa alla anm\xE4lningar
 view job detail        tts     sv      Visa jobbdetalj
 view only open tickets tts     sv      Visa bara \xF6ppna anm\xE4lningar
+

Modified: trunk/wiki/setup/phpgw_sv.lang
===================================================================
--- trunk/wiki/setup/phpgw_sv.lang      2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/wiki/setup/phpgw_sv.lang      2008-02-02 13:52:39 UTC (rev 18466)
@@ -2,3 +2,4 @@
 wiki   common  sv      Wiki
 you have been denied access to this site.      wiki    sv      Du har nekats 
tilltr\xE4de till denna site.
 you have exeeded the number of pages you are allowed to visit in a given 
period of time.  please return later. wiki    sv      Du har \xF6vertr\xE4tt 
det antal sidor du till\xE5ts bes\xF6ka under viss tid. Var v\xE4nlig 
\xE5terkom senare.
+

Modified: trunk/xmlrpc/setup/phpgw_en.lang
===================================================================
--- trunk/xmlrpc/setup/phpgw_en.lang    2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/xmlrpc/setup/phpgw_en.lang    2008-02-02 13:52:39 UTC (rev 18466)
@@ -21,3 +21,4 @@
 system xmlrpc  en      System
 test suite     xmlrpc  en      Test Suite
 xmlrpc test    common  en      XMLRPC Test
+xmlrpc common  en      XMLRPC Test Suite

Modified: trunk/xmlrpc/setup/phpgw_sv.lang
===================================================================
--- trunk/xmlrpc/setup/phpgw_sv.lang    2008-02-02 11:18:25 UTC (rev 18465)
+++ trunk/xmlrpc/setup/phpgw_sv.lang    2008-02-02 13:52:39 UTC (rev 18466)
@@ -21,3 +21,4 @@
 system xmlrpc  sv      System
 test suite     xmlrpc  sv      Test svit
 xmlrpc test    common  sv      XMLRPC Test
+






reply via email to

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