[Top][All Lists]
[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> </td>
<td> </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> </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"/>&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"/>&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):
{SERVER_NAME:PORT}FOLDERNAME
- For Example:
- {some.server.com:143}Trash AND
- {some.server.com:143}Archives/Letters
- (inline docparser repeat):
- {some.server.com:143}Trash AND
- {some.server.com:143}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):
- {some.server.com:143}INBOX AND
- {some.server.com:143}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; \"> </th>\n";
- }
- $output_text .= "\t\t" . '<th
class="tablast"> </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"> <strong><a href="'
- . $tab[1]['link'] . '"
class="tablink">' . $fs . $tab[1]['label']
- . $fse .
'</a></strong> </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"> <strong><a href="'
- . $tab[1]['link'] . '"
class="tablink">' . $fs . $tab[1]['label'] . $fse
- . '</a></strong> </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\\xE7 bKGD \xFF \xFF \xFF\xA0\xBD\xA7\x93
pHYs \xD2\xDD~\xFC SIDATx\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=\xF8 bKGD \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{\xFC IEND\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\xFFa bKGD \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\xA1f