[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] [18482] Another merge from resight, here is a brief c
From: |
Dave Hall |
Subject: |
[Phpgroupware-cvs] [18482] Another merge from resight, here is a brief changelog |
Date: |
Thu, 14 Feb 2008 11:54:41 +0000 |
Revision: 18482
http://svn.sv.gnu.org/viewvc/?view=rev&root=phpgroupware&revision=18482
Author: skwashd
Date: 2008-02-14 11:54:40 +0000 (Thu, 14 Feb 2008)
Log Message:
-----------
Another merge from resight, here is a brief changelog
* Fix acl/frant icons in admin user groups
* Improve menus support in various places
* Fix db::get_last_insert_id()
* Consilidate translation code - make it easier to maintain
* ensure shm id is unique
* Use transactions in phpgwapi upgrade scripts to reduce the chance of broken
upgrades
Modified Paths:
--------------
trunk/addressbook/inc/class.menu.inc.php
trunk/admin/inc/class.menu.inc.php
trunk/admin/inc/class.uiaccounts.inc.php
trunk/admin/inc/class.uimainscreen.inc.php
trunk/calendar/inc/class.menu.inc.php
trunk/demo/inc/class.menu.inc.php
trunk/demo/inc/class.uidemo.inc.php
trunk/demo/setup/setup.inc.php
trunk/demo/templates/base/demo.xsl
trunk/demo/templates/base/no_access.xsl
trunk/felamimail/inc/class.menu.inc.php
trunk/hrm/inc/class.bouser.inc.php
trunk/hrm/inc/class.menu.inc.php
trunk/hrm/inc/class.souser.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/inc/hook_settings.inc.php
trunk/hrm/setup/setup.inc.php
trunk/hrm/templates/base/job.xsl
trunk/hrm/templates/base/menu.xsl
trunk/hrm/templates/base/place.xsl
trunk/hrm/templates/base/sarissa_test.xsl
trunk/hrm/templates/base/user.xsl
trunk/notes/inc/class.menu.inc.php
trunk/phpgwapi/inc/class.db.inc.php
trunk/phpgwapi/inc/class.menu.inc.php
trunk/phpgwapi/inc/class.setup_translation.inc.php
trunk/phpgwapi/inc/class.shm.inc.php
trunk/phpgwapi/inc/class.translation.inc.php
trunk/phpgwapi/inc/functions.inc.php
trunk/phpgwapi/setup/setup.inc.php
trunk/phpgwapi/setup/tables_update.inc.php
trunk/preferences/inc/class.menu.inc.php
trunk/preferences/inc/class.uiadmin_acl.inc.php
trunk/property/inc/class.bocommon.inc.php
trunk/property/inc/class.bolocation.inc.php
trunk/property/inc/class.solocation.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.uiagreement.inc.php
trunk/property/inc/class.uialarm.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.uiinvestment.inc.php
trunk/property/inc/class.uiinvoice.inc.php
trunk/property/inc/class.uilocation.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.uiworkorder.inc.php
trunk/property/inc/hook_settings.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/b_account.xsl
trunk/property/templates/base/budget.xsl
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/property/tutorials/property/examples/install.apache.sh
trunk/sms/inc/class.bocommon.inc.php
trunk/sms/inc/class.menu.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/hook_settings.inc.php
trunk/sms/index.php
trunk/sms/setup/setup.inc.php
trunk/sms/templates/base/autoreply.xsl
trunk/sms/templates/base/command.xsl
trunk/sms/templates/base/config.xsl
trunk/sms/templates/base/menu.xsl
trunk/sms/templates/base/no_access.xsl
trunk/sms/templates/base/poll.xsl
trunk/sms/templates/base/sms.xsl
trunk/todo/inc/class.menu.inc.php
Added Paths:
-----------
trunk/demo/templates/base/config.tpl
trunk/hrm/templates/base/config.tpl
trunk/property/templates/base/menu.xsl
trunk/sms/bin/config_BR_log
trunk/sms/bin/config_SD_log
trunk/sms/bin/config_STATUS_log
trunk/sms/bin/config_ST_log
trunk/sms/bin/config_VASK_log
trunk/sms/templates/base/config.tpl
Removed Paths:
-------------
trunk/demo/inc/hook_sidebox_menu.inc.php
trunk/demo/templates/base/menu.xsl
trunk/hrm/inc/hook_sidebox_menu.inc.php
trunk/sms/inc/hook_sidebox_menu.inc.php
Modified: trunk/addressbook/inc/class.menu.inc.php
===================================================================
--- trunk/addressbook/inc/class.menu.inc.php 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/addressbook/inc/class.menu.inc.php 2008-02-14 11:54:40 UTC (rev
18482)
@@ -6,7 +6,7 @@
* @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 $
+ * @version $Id: class.menu.inc.php 727 2008-02-08 04:13:28Z dave $
*/
/*
Modified: trunk/admin/inc/class.menu.inc.php
===================================================================
--- trunk/admin/inc/class.menu.inc.php 2008-02-10 09:33:46 UTC (rev 18481)
+++ trunk/admin/inc/class.menu.inc.php 2008-02-14 11:54:40 UTC (rev 18482)
@@ -6,7 +6,7 @@
* @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 $
+ * @version $Id: class.menu.inc.php 727 2008-02-08 04:13:28Z dave $
*/
/*
Modified: trunk/admin/inc/class.uiaccounts.inc.php
===================================================================
--- trunk/admin/inc/class.uiaccounts.inc.php 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/admin/inc/class.uiaccounts.inc.php 2008-02-14 11:54:40 UTC (rev
18482)
@@ -425,9 +425,12 @@
$img_acl = $GLOBALS['phpgw']->common->image('admin',
'share', '.png', false);
$img_acl_grey =
$GLOBALS['phpgw']->common->image('admin', 'share-grey', '.png', false);
+ $lang_acl = lang('Set general permissions');
$img_grants = $GLOBALS['phpgw']->common->image('admin',
'dot', '.png', false);
$img_grants_grey =
$GLOBALS['phpgw']->common->image('admin', 'dot-grey', '.png', false);
+ $lang_grants = lang('grant access');
+
foreach ( $apps as $app )
{
if
($GLOBALS['phpgw_info']['apps'][$app]['enabled'] &&
$GLOBALS['phpgw_info']['apps'][$app]['status'] != 3)
@@ -445,10 +448,10 @@
'acl_app' => $app,
'cat_id'=>'groups',
'module'=>'.')) : '',
- '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'),
+ 'acl_img' =>
$grants_enabled ? $img_grants : $img_grants_grey,
+ 'acl_img_name' => $lang_acl,
+ 'grant_img' =>
$grants_enabled ? $img_acl : $img_acl_grey,
+ 'grant_img_name'=> $lang_grants,
'grant_url' =>
$grants_enabled
? $GLOBALS['phpgw']->link('/index.php',array('menuaction' =>
'preferences.uiadmin_acl.aclprefs',
'acl_app' => $app,
Modified: trunk/admin/inc/class.uimainscreen.inc.php
===================================================================
--- trunk/admin/inc/class.uimainscreen.inc.php 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/admin/inc/class.uimainscreen.inc.php 2008-02-14 11:54:40 UTC (rev
18482)
@@ -24,6 +24,7 @@
$menuaction = phpgw::get_var('menuaction', 'location');
$GLOBALS['phpgw_info']['flags']['xslt_app'] = false;
//$menuaction == 'admin.uimainscreen.mainscreen';
$GLOBALS['phpgw']->nextmatchs =
CreateObject('phpgwapi.nextmatchs');
+ $GLOBALS['phpgw_info']['flags']['menu_selection'] =
'admin';
}
public function mainscreen()
@@ -62,7 +63,7 @@
$GLOBALS['phpgw']->redirect_link('/index.php',
array('menuaction' => 'admin.uimainscreen.mainscreen'));
}
- $GLOBALS['phpgw_info']['flags']['menu_selection'] =
'admin::admin::mainscreen';
+ $GLOBALS['phpgw_info']['flags']['menu_selection'] .=
'::admin::mainscreen';
$GLOBALS['phpgw']->template->set_file(array('message'
=> 'mainscreen_message.tpl'));
$GLOBALS['phpgw']->template->set_block('message','form','form');
@@ -166,4 +167,3 @@
$GLOBALS['phpgw']->template->pfp('out','form');
}
}
-?>
Modified: trunk/calendar/inc/class.menu.inc.php
===================================================================
--- trunk/calendar/inc/class.menu.inc.php 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/calendar/inc/class.menu.inc.php 2008-02-14 11:54:40 UTC (rev
18482)
@@ -6,7 +6,7 @@
* @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 $
+ * @version $Id: class.menu.inc.php 727 2008-02-08 04:13:28Z dave $
*/
/*
Modified: trunk/demo/inc/class.menu.inc.php
===================================================================
--- trunk/demo/inc/class.menu.inc.php 2008-02-10 09:33:46 UTC (rev 18481)
+++ trunk/demo/inc/class.menu.inc.php 2008-02-14 11:54:40 UTC (rev 18482)
@@ -34,62 +34,101 @@
class demo_menu
{
/**
- * @var string $sub the currently selected menu option??
+ * Get the menus for the demo
+ *
+ * @return array available menus for the current user
*/
- private $sub;
-
- /**
- * Constructor
- */
- public function __construct($sub = null)
+ public function get_menu()
{
- $this->sub = $sub;
+ $start_page = 'demo';
+ if (
isset($GLOBALS['phpgw_info']['user']['preferences']['demo']['default_start_page'])
+ &&
$GLOBALS['phpgw_info']['user']['preferences']['demo']['default_start_page'] )
+ {
+ $start_page =
$GLOBALS['phpgw_info']['user']['preferences']['demo']['default_start_page'];
}
- /**
- * Generate a menu
- *
- * @param ??? $page ???
- * @param ??? $page2 ???
- */
- public function links($page = '', $page_2 = '')
- {
- $menu['module'][] = array
+ $menus['navbar'] = array
(
- 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'demo.uidemo.index', 'output' => 'html')),
- 'text' => 'HTML',
- 'statustext' => 'HTML',
- 'this' => $this->sub == 'html'
+ 'demo' => array
+ (
+ 'text' => lang('demo'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
"demo.ui{$start_page}.index") ),
+ 'image' => array('demo', 'navbar'),
+ 'order' => 35,
+ 'group' => 'office'
+ ),
);
- $menu['module'][] = array
+ $menus['toolbar'] = array();
+ if (
isset($GLOBALS['phpgw_info']['user']['apps']['admin']) )
+ {
+ $menus['admin'] = array
(
- 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'demo.uidemo.index', 'output' => 'wml')),
- 'text' => 'WML',
- 'statustext' => 'WML',
- 'this' => $this->sub == 'wml'
+ 'categories' => array
+ (
+ 'text' =>
$GLOBALS['phpgw']->translation->translate('Global Categories', array(), true),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'admin.uicategories.index', 'appname' => 'demo'))
+ ),
+ 'acl' => array
+ (
+ 'text' =>
$GLOBALS['phpgw']->translation->translate('Configure Access Permissions',
array(), true),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'preferences.uiadmin_acl.list_acl', 'acl_app' => 'demo'))
+ ),
+ 'list_atrribs' => array
+ (
+ 'text' =>
$GLOBALS['phpgw']->translation->translate('custom fields', array(), true),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'admin.ui_custom.list_attribute', 'appname' => 'demo'))
+ ),
+ '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' => 'demo'))
+ )
);
+ }
- $menu['module'][] = array
+ 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' =>
'demo', 'type'=> 'user') )
+ ),
+ array
(
- 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'demo.uidemo.index2', 'output' => 'html')),
- 'text' => 'Alternative',
- 'statustext' => 'Alternative list',
- 'this' => $this->sub ==
'alternative'
+ 'text' =>
$GLOBALS['phpgw']->translation->translate('Grant Access', array(), true),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
'preferences.uiadmin_acl.aclprefs', 'acl_app'=> 'demo') )
+ )
);
- $GLOBALS['phpgw']->session->appsession('menu_demo',
'sidebox', $menu);
- return $menu;
+ $menus['toolbar'][] = array
+ (
+ 'text' =>
$GLOBALS['phpgw']->translation->translate('Preferences', array(), true),
+ 'url' =>
$GLOBALS['phpgw']->link('/preferences/preferences.php', array('appname' =>
'demo')),
+ 'image' => array('demo', 'preferences')
+ );
}
-
- /**
- * Set the submenu value
- *
- * @param string $sub the current sub menu selection
- */
- public function set_sub($sub)
- {
- $this->sub = phpgw::clean_value($sub, 'string');
+ $menus['navigation'] = array
+ (
+ 'html' => array
+ (
+ 'text' => 'HTML',
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'demo.uidemo.index', 'output' => 'html'))
+ ),
+ 'wml' => array
+ (
+ 'text' => 'WML',
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'demo.uidemo.index', 'output' => 'wml'))
+ ),
+ 'alternative' => array
+ (
+ 'text' => lang('Alternative'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'demo.uidemo.index2', 'output' => 'html'))
+ )
+ );
+ return $menus;
}
}
Modified: trunk/demo/inc/class.uidemo.inc.php
===================================================================
--- trunk/demo/inc/class.uidemo.inc.php 2008-02-10 09:33:46 UTC (rev 18481)
+++ trunk/demo/inc/class.uidemo.inc.php 2008-02-14 11:54:40 UTC (rev 18482)
@@ -79,11 +79,6 @@
private $bo;
/**
- * @var object $menu application menu handler
- */
- private $menu;
-
- /**
* @var object $acl reference to global access control list
manager
*/
private $acl;
@@ -143,8 +138,6 @@
$this->nextmatches =
CreateObject('phpgwapi.nextmatchs');
$this->account =&
$GLOBALS['phpgw_info']['user']['account_id'];
$this->bo =
CreateObject('demo.bodemo',true);
- $this->menu =
CreateObject('demo.menu');
- $this->menu->set_sub('demo');
$this->acl =&
$GLOBALS['phpgw']->acl;
$this->acl_location = $this->bo->get_acl_location();
$this->acl_read =
$this->acl->check($this->acl_location, PHPGW_ACL_READ);
@@ -159,6 +152,7 @@
$this->allrows = $this->bo->allrows;
$this->cat_id = $this->bo->cat_id;
$this->filter = $this->bo->filter;
+ $GLOBALS['phpgw_info']['flags']['menu_selection'] =
'demo';
}
private function save_sessiondata()
@@ -177,16 +171,15 @@
{
$output = self::get_output();
- $this->menu->set_sub($output);
- $links = $this->menu->links();
+ $GLOBALS['phpgw_info']['flags']['menu_selection'] .=
"::{$output}";
if(!$this->acl_read)
{
- $this->no_access($links);
+ $this->no_access();
return;
}
-
$GLOBALS['phpgw']->xslttpl->add_file(array('demo','nextmatchs','menu',
+
$GLOBALS['phpgw']->xslttpl->add_file(array('demo','nextmatchs',
'search_field'));
$demo_info = $this->bo->read();
@@ -296,7 +289,6 @@
$data = array
(
'msgbox_data'
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
- 'links'
=> $links,
'cat_filter'
=> $this->cats->formatted_xslt_list(array('select_name' =>
'cat_id','selected' => $this->cat_id,'globals' => true,'link_data' =>
$link_data)),
'filter_data'
=> $this->nextmatches->xslt_filter(array('filter' =>
$this->filter,'link_data' => $link_data)),
'allow_allrows'
=> true,
@@ -328,15 +320,14 @@
{
$output = self::get_output();
- $this->menu->set_sub('alternative');
- $links = $this->menu->links();
+ $GLOBALS['phpgw_info']['flags']['menu_selection'] .=
'::alternative';
if(!$this->acl_read)
{
- $this->no_access($links);
+ $this->no_access();
return;
}
-
$GLOBALS['phpgw']->xslttpl->add_file(array('demo','nextmatchs','menu',
+
$GLOBALS['phpgw']->xslttpl->add_file(array('demo','nextmatchs',
'search_field'));
$demo_info = $this->bo->read2();
@@ -474,7 +465,6 @@
$data = array
(
'msgbox_data'
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
- 'links'
=> $links,
'cat_filter'
=> $this->cats->formatted_xslt_list(array('select_name' =>
'cat_id','selected' => $this->cat_id,'globals' => true,'link_data' =>
$link_data)),
'filter_data'
=> $this->nextmatches->xslt_filter(array('filter' =>
$this->filter,'link_data' => $link_data)),
'allow_allrows'
=> true,
@@ -535,7 +525,7 @@
{
if(!$this->acl_edit)
{
- $this->no_access($links);
+ $this->no_access();
return;
}
@@ -782,7 +772,7 @@
public function no_access($links = '')
{
-
$GLOBALS['phpgw']->xslttpl->add_file(array('no_access','menu'));
+
$GLOBALS['phpgw']->xslttpl->add_file(array('no_access'));
$receipt['error'][]=array('msg'=>lang('NO ACCESS'));
Deleted: trunk/demo/inc/hook_sidebox_menu.inc.php
===================================================================
--- trunk/demo/inc/hook_sidebox_menu.inc.php 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/demo/inc/hook_sidebox_menu.inc.php 2008-02-14 11:54:40 UTC (rev
18482)
@@ -1,13 +0,0 @@
-<?php
- $menu_title = $GLOBALS['phpgw_info']['apps'][$appname]['title'] . ' '.
lang('Menu');
- $menu = $GLOBALS['phpgw']->session->appsession('menu_demo','sidebox');
- display_sidebox($appname,$menu_title,$menu['module'],$use_lang = false);
- if(isset($menu['menu_title_2']) && $menu['menu_title_2'])
- {
- display_sidebox($appname,$menu['menu_title_2'] . ' ' . lang
('sub menu'),$menu['sub_menu'],$use_lang = false);
- }
- if(isset($menu['menu_title_3']) && $menu['menu_title_3'])
- {
- display_sidebox($appname,$menu['menu_title_3'] . ' ' . lang
('sub menu'),$menu['sub_menu_2'],$use_lang = false);
- }
-?>
Modified: trunk/demo/setup/setup.inc.php
===================================================================
--- trunk/demo/setup/setup.inc.php 2008-02-10 09:33:46 UTC (rev 18481)
+++ trunk/demo/setup/setup.inc.php 2008-02-14 11:54:40 UTC (rev 18482)
@@ -62,7 +62,7 @@
'preferences',
'admin',
'help',
- 'sidebox_menu'
+ 'menu' => 'demo.menu.get_menu'
);
/* Dependencies for this app to work */
Added: trunk/demo/templates/base/config.tpl
===================================================================
--- trunk/demo/templates/base/config.tpl (rev 0)
+++ trunk/demo/templates/base/config.tpl 2008-02-14 11:54:40 UTC (rev
18482)
@@ -0,0 +1,30 @@
+<!-- BEGIN header -->
+<form method="POST" action="{action_url}">
+<table border="0" align="center" width="85%">
+<!--
+ <tr class="th">
+ <td colspan="2"><font color="{th_text}"> <b>{title}</b></font></td>
+ </tr>
+-->
+<!-- END header -->
+<!-- BEGIN body -->
+
+<!-- END body -->
+<!-- BEGIN footer -->
+<!--
+ <tr class="th">
+ <td colspan="2">
+
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2" align="center">
+ <input type="submit" name="submit" value="{lang_submit}">
+ <input type="submit" name="cancel" value="{lang_cancel}">
+ </td>
+ </tr>
+-->
+</table>
+</form>
+<!-- END footer -->
Modified: trunk/demo/templates/base/demo.xsl
===================================================================
--- trunk/demo/templates/base/demo.xsl 2008-02-10 09:33:46 UTC (rev 18481)
+++ trunk/demo/templates/base/demo.xsl 2008-02-14 11:54:40 UTC (rev 18482)
@@ -24,7 +24,6 @@
</xsl:template>
<xsl:template match="list_html">
- <xsl:call-template name="menu"/>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<xsl:choose>
<xsl:when test="msgbox_data != ''">
@@ -144,12 +143,9 @@
</tr>
</xsl:template>
-
<xsl:template match="list_wml">
-
<wml>
<card id = "card1" title = "list demo">
- <xsl:call-template name="menu"/>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<xsl:choose>
<xsl:when test="msgbox_data != ''">
@@ -190,9 +186,7 @@
</wml>
</xsl:template>
-
<xsl:template match="list2_html">
- <xsl:call-template name="menu"/>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<xsl:choose>
<xsl:when test="msgbox_data != ''">
Deleted: trunk/demo/templates/base/menu.xsl
===================================================================
--- trunk/demo/templates/base/menu.xsl 2008-02-10 09:33:46 UTC (rev 18481)
+++ trunk/demo/templates/base/menu.xsl 2008-02-14 11:54:40 UTC (rev 18482)
@@ -1,69 +0,0 @@
- <xsl:template name="menu">
- <xsl:apply-templates select="links"/>
- </xsl:template>
- <xsl:template match="links">
- <table width="100%" align="center">
- <tr >
- <xsl:attribute name="class">
- <xsl:text>row_on</xsl:text>
- </xsl:attribute>
- <td align="left">
- <xsl:for-each select="module" >
- <xsl:text> </xsl:text>
- <xsl:choose>
- <xsl:when test="this=1">
- <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="{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>
- </td>
- </tr>
- <tr>
- <xsl:attribute name="class">
- <xsl:text>row_off</xsl:text>
- </xsl:attribute>
- <td align="left">
- <xsl:for-each select="sub_menu" >
- <xsl:text> </xsl:text>
- <xsl:choose>
- <xsl:when test="this=1">
- <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="{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>
- </td>
- </tr>
-
- <xsl:choose>
- <xsl:when test="sub_menu_2!=''">
- <tr>
- <xsl:attribute name="class">
-
<xsl:text>row_off</xsl:text>
- </xsl:attribute>
- <td align="left">
- <xsl:for-each
select="sub_menu_2" >
- <xsl:text>
</xsl:text>
- <xsl:choose>
-
<xsl:when test="this=1">
-
<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="{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>
- </td>
- </tr>
- </xsl:when>
- </xsl:choose>
-
- </table>
- <hr noshade="noshade" width="100%" align="center" size="1"/>
- </xsl:template>
Modified: trunk/demo/templates/base/no_access.xsl
===================================================================
--- trunk/demo/templates/base/no_access.xsl 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/demo/templates/base/no_access.xsl 2008-02-14 11:54:40 UTC (rev
18482)
@@ -9,12 +9,6 @@
</xsl:template>
<xsl:template match="no_access">
-
- <xsl:choose>
- <xsl:when test="links !=''">
- <xsl:call-template name="menu"/>
- </xsl:when>
- </xsl:choose>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<xsl:choose>
<xsl:when test="msgbox_data != ''">
Modified: trunk/felamimail/inc/class.menu.inc.php
===================================================================
--- trunk/felamimail/inc/class.menu.inc.php 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/felamimail/inc/class.menu.inc.php 2008-02-14 11:54:40 UTC (rev
18482)
@@ -6,7 +6,7 @@
* @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 $
+ * @version $Id: class.menu.inc.php 727 2008-02-08 04:13:28Z dave $
*/
/*
Modified: trunk/hrm/inc/class.bouser.inc.php
===================================================================
--- trunk/hrm/inc/class.bouser.inc.php 2008-02-10 09:33:46 UTC (rev 18481)
+++ trunk/hrm/inc/class.bouser.inc.php 2008-02-14 11:54:40 UTC (rev 18482)
@@ -222,4 +222,108 @@
$place_list =
$this->bocommon->select_list($selected,$places);
return $place_list;
}
+
+ function get_user_data($user_id)
+ {
+ $account =
CreateObject('phpgwapi.accounts',$user_id,'u');
+ $account_info = $account->read_repository();
+ $membership = $account->membership($user_id);
+ $contacts = CreateObject('phpgwapi.contacts');
+
+ $qcols = array
+ (
+ 'n_given' => 'n_given',
+ 'n_family' => 'n_family',
+ 'tel_work' => 'tel_work',
+ 'tel_home' => 'tel_home',
+ 'tel_cell' => 'tel_cell',
+ 'title' => 'title',
+ 'email' => 'email',
+ 'email_home' => 'email_home',
+ );
+
+ $fields =
$contacts->are_users($account_info['person_id'], $qcols);
+
+ $this->boaddressbook =
CreateObject('addressbook.boaddressbook');
+ $comms =
$this->boaddressbook->get_comm_contact_data($fields[0]['contact_id']);
+
+ if(is_array($comms) &&
isset($comms[$fields[0]['contact_id']]) )
+ {
+ $fields[0]['tel_work'] =
$comms[$fields[0]['contact_id']]['work phone'];
+ $fields[0]['tel_home'] =
$comms[$fields[0]['contact_id']]['home phone'];
+ $fields[0]['tel_cell'] =
$comms[$fields[0]['contact_id']]['mobile (cell) phone'];
+ $fields[0]['email_home'] =
$comms[$fields[0]['contact_id']]['home email'];
+ }
+
+ if(!$account_info['person_id'])
+ {
+ $sfields = rawurlencode(serialize($fields[0]));
+ $contact_link =
$GLOBALS['phpgw']->link('/index.php',
+ array
+ (
+ 'menuaction' =>
'addressbook.uiaddressbook.add_person',
+ 'entry' =>
$sfields,
+ )
+ );
+ }
+ else
+ {
+ $contact_link =
$GLOBALS['phpgw']->link('/index.php',
+ array
+ (
+ 'menuaction' =>
'addressbook.uiaddressbook.view_person',
+ 'ab_id' =>
$fields[0]['contact_id']
+ )
+ );
+ }
+
+ $prefs_user =
$this->bocommon->create_preferences('email',$user_id);
+
+ $email_work = '';
+ if($fields[0]['email'] || $prefs_user['address'])
+ {
+ if(isset($prefs_user['address']) &&
$prefs_user['address'])
+ {
+ $email_work = $prefs_user['address'];
+ }
+ else
+ {
+ $email_work = $fields[0]['email'];
+ }
+ }
+
+ $email_home = '';
+ if($fields[0]['email_home'])
+ {
+ $email_home = $fields[0]['email_home'];
+ }
+
+ $qcols_extra = array
+ (
+ array('name' =>lang('first name'), 'type' =>
'link', 'link_value' =>$contact_link),
+ array('name' =>lang('last name'), 'type' =>
'text'),
+ array('name' =>lang('work phone'), 'type' =>
'text'),
+ array('name' =>lang('home phone'), 'type' =>
'text'),
+ array('name' =>lang('cellular phone'), 'type'
=> 'text'),
+ array('name' =>lang('title'), 'type' => 'text'),
+ array('name' =>lang('work email'), 'type' =>
'mail', 'link_value' => $email_work),
+ array('name' =>lang('home email'), 'type' =>
'mail', 'link_value' => $email_home),
+ );
+
+ if(is_array($fields))
+ {
+ $qcols = array_keys($qcols);
+ $j=0;
+ for ($i=0;$i<count($qcols);$i++)
+ {
+ $user_values[$j]['value'] =
$fields[0][$qcols[$i]];
+ $user_values[$j]['name'] =
$qcols_extra[$i]['name'];
+ $user_values[$j]['type'] =
$qcols_extra[$i]['type'];
+ $user_values[$j]['link_value'] =
isset($qcols_extra[$i]['link_value']) ? $qcols_extra[$i]['link_value'] : '';
+ $j++;
+ }
+ }
+
+ return $user_values;
+ }
}
Modified: trunk/hrm/inc/class.menu.inc.php
===================================================================
--- trunk/hrm/inc/class.menu.inc.php 2008-02-10 09:33:46 UTC (rev 18481)
+++ trunk/hrm/inc/class.menu.inc.php 2008-02-14 11:54:40 UTC (rev 18482)
@@ -30,70 +30,172 @@
$this->sub = $sub;
}
- function links($page='',$page_2='')
+ /**
+ * Get the menus for the hrm
+ *
+ * @return array available menus for the current user
+ */
+ public function get_menu()
{
- $currentapp='hrm';
- $sub = $this->sub;
+ $incoming_app =
$GLOBALS['phpgw_info']['flags']['currentapp'];
+ $GLOBALS['phpgw_info']['flags']['currentapp'] = 'hrm';
- $menu =
$GLOBALS['phpgw']->session->appsession('menu',substr(md5($currentapp.$sub . '_'
. $page . '_' . $page_2),-20));
-
- if(!isset($menu) || !$menu)
+ $start_page = 'user';
+ if (
isset($GLOBALS['phpgw_info']['user']['preferences']['hrm']['default_start_page'])
+ &&
$GLOBALS['phpgw_info']['user']['preferences']['hrm']['default_start_page'] )
{
- $menu = array();
+ $start_page =
$GLOBALS['phpgw_info']['user']['preferences']['hrm']['default_start_page'];
+ }
- $i=0;
- if($sub=='user')
+ $menus['navbar'] = array
+ (
+ 'hrm' => array
+ (
+ 'text' => lang('hrm'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
"hrm.ui{$start_page}.index") ),
+ 'image' => array('hrm', 'navbar'),
+ 'order' => 35,
+ 'group' => 'facilities management'
+ ),
+ );
+
+ $menus['toolbar'] = array();
+
+ if (
isset($GLOBALS['phpgw_info']['user']['apps']['admin']) )
{
- $menu['module'][$i]['this']=True;
+ $menus['admin'] = array
+ (
+ 'categories' => array
+ (
+ 'text' =>
$GLOBALS['phpgw']->translation->translate('Global Categories', array(), true),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'admin.uicategories.index', 'appname' => 'hrm') )
+ ),
+ 'training' => array
+ (
+ 'text' => lang('training
category'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'hrm.uicategory.index', 'type' => 'training') )
+ ),
+ 'skill_level' => array
+ (
+ 'text' => lang('skill level'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'hrm.uicategory.index', 'type' => 'skill_level') )
+ ),
+ 'experience' => array
+ (
+ 'text' => lang('experience
category'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'hrm.uicategory.index', 'type' => 'experience') )
+ ),
+ 'qualification' => array
+ (
+ 'text' => lang('qualification
category'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'hrm.uicategory.index', 'type' => 'qualification') )
+ ),
+ 'acl' => array
+ (
+ 'text' => lang('Configure
Access Permissions'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'preferences.uiadmin_acl.list_acl', 'acl_app' => 'hrm') )
+ )
+ );
}
- $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++;
- if($sub=='job')
+ if (
isset($GLOBALS['phpgw_info']['user']['apps']['preferences']) )
{
- $menu['module'][$i]['this']=True;
+ $menus['preferences'] = array
+ (
+ array
+ (
+ 'text' =>
$GLOBALS['phpgw']->translation->translate('Preferences', array(), true),
+ 'url' =>
$GLOBALS['phpgw']->link('/preferences/preferences.php', array('appname' =>
'hrm', 'type'=> 'user') )
+ ),
+ array
+ (
+ 'text' =>
$GLOBALS['phpgw']->translation->translate('Grant Access', array(), true),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
'preferences.uiadmin_acl.aclprefs', 'acl_app'=> 'hrm') )
+ )
+ );
+
+ $menus['toolbar'][] = array
+ (
+ 'text' =>
$GLOBALS['phpgw']->translation->translate('Preferences', array(), true),
+ 'url' =>
$GLOBALS['phpgw']->link('/preferences/preferences.php', array('appname' =>
'hrm')),
+ 'image' => array('hrm', 'preferences')
+ );
}
- $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++;
+ $job_children = array
+ (
+ 'job_type' => array
+ (
+ 'text' => lang('Job type'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 'hrm.uijob.index'))
+ ),
+ 'organisation' => array
+ (
+ 'text' => lang('Organisation'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=>
'hrm.uijob.hierarchy'))
+ )
+ );
- if($sub=='place')
+ $menus['navigation'] = array
+ (
+ 'user' => array
+ (
+ 'text' => lang('User'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 'hrm.uiuser.index'))
+ ),
+ 'job' => array
+ (
+ 'text' => lang('Job type'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 'hrm.uijob.index')),
+ 'children' => $job_children
+ ),
+ 'place' => array
+ (
+ 'text' => lang('PLace'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 'hrm.uiplace.index'))
+ )
+ );
+ $GLOBALS['phpgw_info']['flags']['currentapp'] =
$incoming_app;
+ return $menus;
+ }
+
+ function links()
+ {
+
if(!isset($GLOBALS['phpgw_info']['user']['preferences']['hrm']['horisontal_menus'])
|| $GLOBALS['phpgw_info']['user']['preferences']['hrm']['horisontal_menus'] ==
'no')
{
- $menu['module'][$i]['this']=True;
+ return;
}
- $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++;
+ $GLOBALS['phpgw']->xslttpl->add_file(array('menu'));
+ $menu_brutto = execMethod('hrm.menu.get_menu');
+ $selection =
explode('::',$GLOBALS['phpgw_info']['flags']['menu_selection']);
+ $level=0;
+ $menu['navigation'] =
$this->get_sub_menu($menu_brutto['navigation'],$selection,$level);
+ return $menu;
+ }
- $j=0;
- if ($sub == 'job')
+ function get_sub_menu($children = array(),
$selection=array(),$level='')
+ {
+ $level++;
+ $i=0;
+ foreach($children as $key => $vals)
{
- if($page=='job_type')
+ $menu[] = $vals;
+ if($key == $selection[$level])
{
- $menu['sub_menu'][$j]['this']=True;
+ $menu[$i]['this'] = true;
+ if(isset($menu[$i]['children']))
+ {
+ $menu[$i]['children'] =
$this->get_sub_menu($menu[$i]['children'],$selection,$level);
+ }
}
- $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++;
-
- if($page=='hierarchy')
+ else
{
- $menu['sub_menu'][$j]['this']=True;
- }
- $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++;
+ if(isset($menu[$i]['children']))
+ {
+ unset($menu[$i]['children']);
+ }
+ }
+ $i++;
}
-
-
$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.souser.inc.php
===================================================================
--- trunk/hrm/inc/class.souser.inc.php 2008-02-10 09:33:46 UTC (rev 18481)
+++ trunk/hrm/inc/class.souser.inc.php 2008-02-14 11:54:40 UTC (rev 18482)
@@ -105,10 +105,10 @@
{
$start=0;
}
- $query =
(isset($data['query'])?$data['query']:'');
- $sort =
(isset($data['sort'])?$data['sort']:'DESC');
- $order =
(isset($data['order'])?$data['order']:'');
- $allrows =
(isset($data['allrows'])?$data['allrows']:'');
+ $query = isset($data['query']) ?
$data['query'] : '';
+ $sort = isset($data['sort']) &&
$data['sort'] ? $data['sort'] : 'ASC';
+ $order = isset($data['order']) &&
$data['order'] ? $data['order'] : 'category DESC, start_date';
+ $allrows = isset($data['allrows']) ?
$data['allrows'] : '';
}
$user_id = $data['user_id'];
Modified: trunk/hrm/inc/class.uicategory.inc.php
===================================================================
--- trunk/hrm/inc/class.uicategory.inc.php 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/hrm/inc/class.uicategory.inc.php 2008-02-14 11:54:40 UTC (rev
18482)
@@ -48,6 +48,8 @@
$this->sort =
$this->bo->sort;
$this->order =
$this->bo->order;
$this->allrows =
$this->bo->allrows;
+ $type =
phpgw::get_var('type');
+ $GLOBALS['phpgw_info']['flags']['menu_selection'] =
"admin::hrm::$type";
}
function save_sessiondata()
Modified: trunk/hrm/inc/class.uijob.inc.php
===================================================================
--- trunk/hrm/inc/class.uijob.inc.php 2008-02-10 09:33:46 UTC (rev 18481)
+++ trunk/hrm/inc/class.uijob.inc.php 2008-02-14 11:54:40 UTC (rev 18482)
@@ -67,14 +67,13 @@
$this->bocommon =
CreateObject('hrm.bocommon');
$this->bocategory =
CreateObject('hrm.bocategory');
$this->acl =
CreateObject('phpgwapi.acl');
- $this->menu =
CreateObject('hrm.menu');
- $this->menu->sub ='job';
$this->start =
$this->bo->start;
$this->query =
$this->bo->query;
$this->sort =
$this->bo->sort;
$this->order =
$this->bo->order;
$this->allrows =
$this->bo->allrows;
+ $GLOBALS['phpgw_info']['flags']['menu_selection'] =
'hrm::job';
}
function save_sessiondata()
@@ -93,14 +92,15 @@
function index()
{
- $links = $this->menu->links('job_type');
if(!$this->acl->check('.job', PHPGW_ACL_READ))
{
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
+ $GLOBALS['phpgw_info']['flags']['menu_selection'] .=
'::job_type';
+
if ( !isset($GLOBALS['phpgw']->js) ||
!is_object($GLOBALS['phpgw']->js) )
{
$GLOBALS['phpgw']->js =
createObject('phpgwapi.javascript');
@@ -218,7 +218,7 @@
$data = array
(
'msgbox_data'
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
- 'links'
=> $links,
+ 'menu'
=> execMethod('hrm.menu.links'),
'allow_allrows'
=> True,
'allrows'
=> $this->allrows,
'start_record'
=> $this->start,
@@ -252,7 +252,7 @@
{
if(!$this->acl->check('.job', PHPGW_ACL_READ))
{
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
$GLOBALS['phpgw_info']['flags'][noheader] = True;
@@ -352,10 +352,12 @@
{
if(!$this->acl->check('.job', PHPGW_ACL_READ))
{
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
+ $GLOBALS['phpgw_info']['flags']['menu_selection'] .=
'::job_type';
+
$job_id = phpgw::get_var('job_id', 'int');
$id = phpgw::get_var('id', 'int');
$resort = phpgw::get_var('resort');
@@ -503,10 +505,12 @@
{
if(!$this->acl->check('.job', PHPGW_ACL_READ))
{
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
+ $GLOBALS['phpgw_info']['flags']['menu_selection'] .=
'::job_type';
+
$job_id = phpgw::get_var('job_id', 'int');
$id = phpgw::get_var('id', 'int');
$resort = phpgw::get_var('resort');
@@ -650,11 +654,13 @@
$parent_id = phpgw::get_var('parent_id', 'int');
$values = phpgw::get_var('values');
+ $GLOBALS['phpgw_info']['flags']['menu_selection'] .=
'::job_type';
+
if(!$id)
{
if(!$this->acl->check('.job', PHPGW_ACL_ADD))
{
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
}
@@ -662,7 +668,7 @@
{
if(!$this->acl->check('.job', PHPGW_ACL_EDIT))
{
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
}
@@ -776,10 +782,12 @@
if(!$this->acl->check('.job', PHPGW_ACL_READ))
{
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
+ $GLOBALS['phpgw_info']['flags']['menu_selection'] .=
'::job_type';
+
$GLOBALS['phpgw']->xslttpl->add_file(array('job'));
if ($id)
@@ -837,10 +845,11 @@
{
if(!$this->acl->check('.job', PHPGW_ACL_ADD))
{
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
+ $GLOBALS['phpgw_info']['flags']['menu_selection'] .=
'::job_type';
$GLOBALS['phpgw_info']['flags']['noframework'] = True;
$GLOBALS['phpgw_info']['flags']['headonly']=true;
@@ -1116,7 +1125,7 @@
{
if(!$this->acl->check('.job', PHPGW_ACL_ADD))
{
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
}
@@ -1124,11 +1133,12 @@
{
if(!$this->acl->check('.job', PHPGW_ACL_EDIT))
{
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
}
+ $GLOBALS['phpgw_info']['flags']['menu_selection'] .=
'::job_type';
$GLOBALS['phpgw']->xslttpl->add_file(array('job'));
@@ -1240,10 +1250,11 @@
if(!$this->acl->check('.job', PHPGW_ACL_READ))
{
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
+ $GLOBALS['phpgw_info']['flags']['menu_selection'] .=
'::job_type';
$GLOBALS['phpgw']->xslttpl->add_file(array('job'));
@@ -1312,7 +1323,7 @@
{
if(!$this->acl->check('.job', PHPGW_ACL_ADD))
{
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
}
@@ -1320,11 +1331,13 @@
{
if(!$this->acl->check('.job', PHPGW_ACL_EDIT))
{
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
}
+ $GLOBALS['phpgw_info']['flags']['menu_selection'] .=
'::job_type';
+
$values = phpgw::get_var('values');
$GLOBALS['phpgw']->xslttpl->add_file(array('job'));
@@ -1474,10 +1487,12 @@
if(!$this->acl->check('.job', PHPGW_ACL_READ))
{
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
+ $GLOBALS['phpgw_info']['flags']['menu_selection'] .=
'::job_type';
+
$GLOBALS['phpgw']->xslttpl->add_file(array('job'));
$values =
$this->bo->read_single_qualification($quali_id);
@@ -1543,10 +1558,12 @@
{
if(!$this->acl->check('.job', PHPGW_ACL_DELETE))
{
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
+ $GLOBALS['phpgw_info']['flags']['menu_selection'] .=
'::job_type';
+
$job_id = phpgw::get_var('job_id', 'int');
$confirm = phpgw::get_var('confirm',
'bool', 'POST');
$link_data = array
@@ -1584,10 +1601,12 @@
{
if(!$this->acl->check('.job', PHPGW_ACL_DELETE))
{
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
+ $GLOBALS['phpgw_info']['flags']['menu_selection'] .=
'::job_type';
+
$id = phpgw::get_var('id', 'int');
$job_id = phpgw::get_var('job_id', 'int');
$confirm = phpgw::get_var('confirm',
'bool', 'POST');
@@ -1628,10 +1647,12 @@
{
if(!$this->acl->check('.job', PHPGW_ACL_DELETE))
{
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
+ $GLOBALS['phpgw_info']['flags']['menu_selection'] .=
'::job_type';
+
$quali_id = phpgw::get_var('quali_id', 'int');
$job_id = phpgw::get_var('job_id', 'int');
$confirm = phpgw::get_var('confirm', 'bool',
'POST');
@@ -1672,10 +1693,12 @@
{
if(!$this->acl->check('.job', PHPGW_ACL_DELETE))
{
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
+ $GLOBALS['phpgw_info']['flags']['menu_selection'] .=
'::job_type';
+
$confirm = phpgw::get_var('confirm',
'bool', 'POST');
$link_data = array
(
@@ -1709,6 +1732,7 @@
function hierarchy()
{
+ $GLOBALS['phpgw_info']['flags']['menu_selection'] .=
'::organisation';
$GLOBALS['phpgw_info']['flags']['xslt_app'] = false;
$GLOBALS['phpgw']->common->phpgw_header(true);
echo '<div class="msg">FIXME: Implement something
here!</div>';
Modified: trunk/hrm/inc/class.uiplace.inc.php
===================================================================
--- trunk/hrm/inc/class.uiplace.inc.php 2008-02-10 09:33:46 UTC (rev 18481)
+++ trunk/hrm/inc/class.uiplace.inc.php 2008-02-14 11:54:40 UTC (rev 18482)
@@ -43,14 +43,13 @@
$this->account =
$GLOBALS['phpgw_info']['user']['account_id'];
$this->bo =
CreateObject('hrm.boplace',true);
$this->bocommon =
CreateObject('hrm.bocommon');
- $this->menu =
CreateObject('hrm.menu');
- $this->menu->sub ='place';
$this->start = $this->bo->start;
$this->query = $this->bo->query;
$this->sort = $this->bo->sort;
$this->order = $this->bo->order;
$this->allrows = $this->bo->allrows;
+ $GLOBALS['phpgw_info']['flags']['menu_selection'] =
'hrm::place';
}
function save_sessiondata()
@@ -70,8 +69,6 @@
$GLOBALS['phpgw']->xslttpl->add_file(array('place','nextmatchs','menu',
'search_field'));
- $links = $this->menu->links();
-
$place_info = $this->bo->read();
while (is_array($place_info) && list(,$entry) =
each($place_info))
@@ -143,7 +140,7 @@
$data = array
(
'msgbox_data'
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
- 'links'
=> $links,
+ 'menu'
=> execMethod('hrm.menu.links'),
'allow_allrows'
=> True,
'allrows'
=> $this->allrows,
'start_record'
=> $this->start,
Modified: trunk/hrm/inc/class.uiuser.inc.php
===================================================================
--- trunk/hrm/inc/class.uiuser.inc.php 2008-02-10 09:33:46 UTC (rev 18481)
+++ trunk/hrm/inc/class.uiuser.inc.php 2008-02-14 11:54:40 UTC (rev 18482)
@@ -44,14 +44,13 @@
$this->bo =
CreateObject('hrm.bouser',False);
$this->bocommon =
CreateObject('hrm.bocommon');
$this->bocategory =
CreateObject('hrm.bocategory');
- $this->menu =
CreateObject('hrm.menu');
- $this->menu->sub ='user';
$this->grants =
$this->bo->grants;
$this->start =
$this->bo->start;
$this->query =
$this->bo->query;
$this->sort =
$this->bo->sort;
$this->order =
$this->bo->order;
$this->allrows =
$this->bo->allrows;
+ $GLOBALS['phpgw_info']['flags']['menu_selection'] =
'hrm::user';
}
function save_sessiondata()
@@ -69,11 +68,9 @@
function index()
{
-
$GLOBALS['phpgw']->xslttpl->add_file(array('user','nextmatchs','menu',
+
$GLOBALS['phpgw']->xslttpl->add_file(array('user','nextmatchs',
'search_field'));
- $links = $this->menu->links();
-
$account_info = $this->bo->read();
$content = array();
@@ -156,7 +153,7 @@
$data = array
(
- 'links'
=> $links,
+ 'menu'
=> execMethod('hrm.menu.links'),
'allow_allrows'
=> True,
'allrows'
=> $this->allrows,
'start_record'
=> $this->start,
@@ -181,111 +178,6 @@
$this->save_sessiondata();
}
- // FIXME this really belongs in the bo layer
- function get_user_data($user_id)
- {
- $account =
CreateObject('phpgwapi.accounts',$user_id,'u');
- $account_info = $account->read_repository();
- $membership = $account->membership($user_id);
- $contacts = CreateObject('phpgwapi.contacts');
-
- $qcols = array
- (
- 'n_given' => 'n_given',
- 'n_family' => 'n_family',
- 'tel_work' => 'tel_work',
- 'tel_home' => 'tel_home',
- 'tel_cell' => 'tel_cell',
- 'title' => 'title',
- 'email' => 'email',
- 'email_home' => 'email_home',
- );
-
- $fields =
$contacts->are_users($account_info['person_id'], $qcols);
-
- $this->boaddressbook =
CreateObject('addressbook.boaddressbook');
- $comms =
$this->boaddressbook->get_comm_contact_data($fields[0]['contact_id']);
-
- if(is_array($comms) &&
isset($comms[$fields[0]['contact_id']]) )
- {
- $fields[0]['tel_work'] =
$comms[$fields[0]['contact_id']]['work phone'];
- $fields[0]['tel_home'] =
$comms[$fields[0]['contact_id']]['home phone'];
- $fields[0]['tel_cell'] =
$comms[$fields[0]['contact_id']]['mobile (cell) phone'];
- $fields[0]['email_home'] =
$comms[$fields[0]['contact_id']]['home email'];
- }
-
- if(!$account_info['person_id'])
- {
- $sfields = rawurlencode(serialize($fields[0]));
- $contact_link =
$GLOBALS['phpgw']->link('/index.php',
- array
- (
- 'menuaction' =>
'addressbook.uiaddressbook.add_person',
- 'entry' =>
$sfields,
- )
- );
- }
- else
- {
- $contact_link =
$GLOBALS['phpgw']->link('/index.php',
- array
- (
- 'menuaction' =>
'addressbook.uiaddressbook.view_person',
- 'ab_id' =>
$fields[0]['contact_id']
- )
- );
- }
-
- $prefs_user =
$this->bocommon->create_preferences('email',$user_id);
-
- $email_work = '';
- if($fields[0]['email'] || $prefs_user['address'])
- {
- if(isset($prefs_user['address']) &&
$prefs_user['address'])
- {
- $email_work = $prefs_user['address'];
- }
- else
- {
- $email_work = $fields[0]['email'];
- }
- }
-
- $email_home = '';
- if($fields[0]['email_home'])
- {
- $email_home = $fields[0]['email_home'];
- }
-
- $qcols_extra = array
- (
- array('name' =>lang('first name'), 'type' =>
'link', 'link_value' =>$contact_link),
- array('name' =>lang('last name'), 'type' =>
'text'),
- array('name' =>lang('work phone'), 'type' =>
'text'),
- array('name' =>lang('home phone'), 'type' =>
'text'),
- array('name' =>lang('cellular phone'), 'type'
=> 'text'),
- array('name' =>lang('title'), 'type' => 'text'),
- array('name' =>lang('work email'), 'type' =>
'mail', 'link_value' => $email_work),
- array('name' =>lang('home email'), 'type' =>
'mail', 'link_value' => $email_home),
- );
-
- if(is_array($fields))
- {
- $qcols = array_keys($qcols);
- $j=0;
- for ($i=0;$i<count($qcols);$i++)
- {
- $user_values[$j]['value'] =
$fields[0][$qcols[$i]];
- $user_values[$j]['name'] =
$qcols_extra[$i]['name'];
- $user_values[$j]['type'] =
$qcols_extra[$i]['type'];
- $user_values[$j]['link_value'] =
isset($qcols_extra[$i]['link_value']) ? $qcols_extra[$i]['link_value'] : '';
- $j++;
- }
- }
-
- return $user_values;
- }
-
function training()
{
$user_id = phpgw::get_var('user_id', 'int');
@@ -305,7 +197,7 @@
if ($user_id)
{
- $user_values = $this->get_user_data($user_id);
+ $user_values =
$this->bo->get_user_data($user_id);
$training = $this->bo->read_training($user_id);
}
//_debug_array($training);
@@ -839,7 +731,7 @@
if($user_id)
{
- $user_values = $this->get_user_data($user_id);
+ $user_values =
$this->bo->get_user_data($user_id);
$training = $this->bo->read_training($user_id);
}
else
Modified: trunk/hrm/inc/hook_settings.inc.php
===================================================================
--- trunk/hrm/inc/hook_settings.inc.php 2008-02-10 09:33:46 UTC (rev 18481)
+++ trunk/hrm/inc/hook_settings.inc.php 2008-02-14 11:54:40 UTC (rev 18482)
@@ -13,8 +13,4 @@
$this->currentapp =
$GLOBALS['phpgw_info']['flags']['currentapp'];
- $yes_and_no = array(
- 'True' => 'Yes',
- '' => 'No'
- );
-
+ create_select_box('show horisontal
menues','horisontal_menus',array('no' => 'No','yes' => 'Yes'),'Horisontal
menues are shown in top of page');
Deleted: trunk/hrm/inc/hook_sidebox_menu.inc.php
===================================================================
--- trunk/hrm/inc/hook_sidebox_menu.inc.php 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/hrm/inc/hook_sidebox_menu.inc.php 2008-02-14 11:54:40 UTC (rev
18482)
@@ -1,13 +0,0 @@
-<?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/setup.inc.php
===================================================================
--- trunk/hrm/setup/setup.inc.php 2008-02-10 09:33:46 UTC (rev 18481)
+++ trunk/hrm/setup/setup.inc.php 2008-02-14 11:54:40 UTC (rev 18482)
@@ -74,9 +74,8 @@
'manual',
'settings',
'preferences',
- 'admin',
'help',
- 'sidebox_menu'
+ 'menu' => 'hrm.menu.get_menu'
);
/* Dependencies for this app to work */
Added: trunk/hrm/templates/base/config.tpl
===================================================================
--- trunk/hrm/templates/base/config.tpl (rev 0)
+++ trunk/hrm/templates/base/config.tpl 2008-02-14 11:54:40 UTC (rev 18482)
@@ -0,0 +1,30 @@
+<!-- BEGIN header -->
+<form method="POST" action="{action_url}">
+<table border="0" align="center" width="85%">
+<!--
+ <tr class="th">
+ <td colspan="2"><font color="{th_text}"> <b>{title}</b></font></td>
+ </tr>
+-->
+<!-- END header -->
+<!-- BEGIN body -->
+
+<!-- END body -->
+<!-- BEGIN footer -->
+<!--
+ <tr class="th">
+ <td colspan="2">
+
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2" align="center">
+ <input type="submit" name="submit" value="{lang_submit}">
+ <input type="submit" name="cancel" value="{lang_cancel}">
+ </td>
+ </tr>
+-->
+</table>
+</form>
+<!-- END footer -->
Modified: trunk/hrm/templates/base/job.xsl
===================================================================
--- trunk/hrm/templates/base/job.xsl 2008-02-10 09:33:46 UTC (rev 18481)
+++ trunk/hrm/templates/base/job.xsl 2008-02-14 11:54:40 UTC (rev 18482)
@@ -39,7 +39,11 @@
</xsl:template>
<xsl:template match="list">
- <xsl:call-template name="menu"/>
+ <xsl:choose>
+ <xsl:when test="menu != ''">
+ <xsl:apply-templates select="menu"/>
+ </xsl:when>
+ </xsl:choose>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<xsl:choose>
<xsl:when test="msgbox_data != ''">
Modified: trunk/hrm/templates/base/menu.xsl
===================================================================
--- trunk/hrm/templates/base/menu.xsl 2008-02-10 09:33:46 UTC (rev 18481)
+++ trunk/hrm/templates/base/menu.xsl 2008-02-14 11:54:40 UTC (rev 18482)
@@ -1,61 +1,60 @@
- <xsl:template name="menu">
- <xsl:apply-templates select="links"/>
- </xsl:template>
- <xsl:template match="links">
- <table width="100%" align="center">
+ <xsl:template match="menu">
+ <table width="100%" align="center" id="legacy-menu">
<tr >
<xsl:attribute name="class">
<xsl:text>row_on</xsl:text>
</xsl:attribute>
<td align="left">
- <xsl:for-each select="module" >
+ <xsl:for-each select="navigation" >
<xsl:text> </xsl:text>
<xsl:choose>
<xsl:when test="this=1">
- <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>
+ <a
href="{url}"><b><xsl:text>[</xsl:text><xsl:value-of
select="text"/><xsl:text>]</xsl:text></b></a>
</xsl:when>
<xsl:otherwise>
- <a href="{url}"
onMouseover="window.status='{statustext}';return true;"
onMouseout="window.status='';return true;"><xsl:value-of select="text"/></a>
+ <a
href="{url}"><xsl:value-of select="text"/></a>
</xsl:otherwise>
</xsl:choose>
-
</xsl:for-each>
</td>
</tr>
- <tr>
+ <xsl:for-each select="navigation" >
+ <xsl:choose>
+ <xsl:when test="children">
+ <tr >
<xsl:attribute name="class">
<xsl:text>row_off</xsl:text>
</xsl:attribute>
<td align="left">
- <xsl:for-each select="sub_menu" >
+ <xsl:for-each
select = "children" >
<xsl:text> </xsl:text>
<xsl:choose>
<xsl:when test="this=1">
- <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>
+
<a href="{url}"><b><xsl:text>[</xsl:text><xsl:value-of
select="text"/><xsl:text>]</xsl:text></b></a>
</xsl:when>
<xsl:otherwise>
- <a href="{url}"
onMouseover="window.status='{statustext}';return true;"
onMouseout="window.status='';return true;"><xsl:value-of select="text"/></a>
+
<a href="{url}"><xsl:value-of select="text"/></a>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</td>
</tr>
-
+ <xsl:for-each select =
"children" >
<xsl:choose>
- <xsl:when test="sub_menu_2!=''">
- <tr>
+ <xsl:when
test="children">
+ <tr >
<xsl:attribute name="class">
-
<xsl:text>row_off</xsl:text>
+
<xsl:text>row_on</xsl:text>
</xsl:attribute>
<td align="left">
- <xsl:for-each
select="sub_menu_2" >
+
<xsl:for-each select = "children" >
<xsl:text>
</xsl:text>
<xsl:choose>
<xsl:when test="this=1">
-
<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>
+
<a
href="{url}"><b><xsl:text>[</xsl:text><xsl:value-of
select="text"/><xsl:text>]</xsl:text></b></a>
</xsl:when>
<xsl:otherwise>
-
<a href="{url}" onMouseover="window.status='{statustext}';return true;"
onMouseout="window.status='';return true;"><xsl:value-of select="text"/></a>
+
<a href="{url}"><xsl:value-of
select="text"/></a>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
@@ -63,7 +62,9 @@
</tr>
</xsl:when>
</xsl:choose>
-
+ </xsl:for-each>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:for-each>
</table>
- <hr noshade="noshade" width="100%" align="center" size="1"/>
</xsl:template>
Modified: trunk/hrm/templates/base/place.xsl
===================================================================
--- trunk/hrm/templates/base/place.xsl 2008-02-10 09:33:46 UTC (rev 18481)
+++ trunk/hrm/templates/base/place.xsl 2008-02-14 11:54:40 UTC (rev 18482)
@@ -18,8 +18,11 @@
</xsl:template>
<xsl:template match="list">
-
- <xsl:call-template name="menu"/>
+ <xsl:choose>
+ <xsl:when test="menu != ''">
+ <xsl:apply-templates select="menu"/>
+ </xsl:when>
+ </xsl:choose>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<xsl:choose>
<xsl:when test="msgbox_data != ''">
Modified: trunk/hrm/templates/base/sarissa_test.xsl
===================================================================
--- trunk/hrm/templates/base/sarissa_test.xsl 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/hrm/templates/base/sarissa_test.xsl 2008-02-14 11:54:40 UTC (rev
18482)
@@ -5,7 +5,11 @@
</xsl:template>
<xsl:template match="list">
- <xsl:call-template name="menu"/>
+ <xsl:choose>
+ <xsl:when test="menu != ''">
+ <xsl:apply-templates select="menu"/>
+ </xsl:when>
+ </xsl:choose>
<div style="width: 100%; height: 65px; background-color:
#EEEEEE; font-family: Arial, Helvetica, Sans-Serif; font-size: 9pt;">
This example demonstrates a simple Hello World example
</div>
Modified: trunk/hrm/templates/base/user.xsl
===================================================================
--- trunk/hrm/templates/base/user.xsl 2008-02-10 09:33:46 UTC (rev 18481)
+++ trunk/hrm/templates/base/user.xsl 2008-02-14 11:54:40 UTC (rev 18482)
@@ -18,8 +18,11 @@
</xsl:template>
<xsl:template match="list">
-
- <xsl:call-template name="menu"/>
+ <xsl:choose>
+ <xsl:when test="menu != ''">
+ <xsl:apply-templates select="menu"/>
+ </xsl:when>
+ </xsl:choose>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<xsl:choose>
<xsl:when test="msgbox_data != ''">
Modified: trunk/notes/inc/class.menu.inc.php
===================================================================
--- trunk/notes/inc/class.menu.inc.php 2008-02-10 09:33:46 UTC (rev 18481)
+++ trunk/notes/inc/class.menu.inc.php 2008-02-14 11:54:40 UTC (rev 18482)
@@ -6,7 +6,7 @@
* @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 $
+ * @version $Id: class.menu.inc.php 727 2008-02-08 04:13:28Z dave $
*/
/*
Modified: trunk/phpgwapi/inc/class.db.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.db.inc.php 2008-02-10 09:33:46 UTC (rev 18481)
+++ trunk/phpgwapi/inc/class.db.inc.php 2008-02-14 11:54:40 UTC (rev 18482)
@@ -429,9 +429,9 @@
*/
public function get_last_insert_id($table, $field)
{
- // This looks like a pretty ugly hack to me, is it
really needed? skwashd nov07
- if($GLOBALS['phpgw_info']['server']['db_type'] ==
'postgres')
+ switch ( $GLOBALS['phpgw_info']['server']['db_type'] )
{
+ case 'postgres':
$params = explode('.',$this->adodb->pgVersion);
if ($params[0] < 8 || ($params[0] == 8 &&
$params[1] ==0))
@@ -462,9 +462,26 @@
return -1;
}
return $Record[0];
+ break;
+ case 'mssql':
+ /* MSSQL uses a query to retrieve the
last
+ * identity on the connection, so
table and field are ignored here as well.
+ */
+ if(!isset($table) || $table == '' ||
!isset($field) || $field == '')
+ {
+ return -1;
}
+ $result = @mssql_query("select
@@identity", $this->adodb->_queryID);
+ if(!$result)
+ {
+ return -1;
+ }
+ return mssql_result($result, 0, 0);
+ break;
+ default:
return $this->adodb->Insert_ID($table, $field);
}
+ }
/**
* Lock a table
Modified: trunk/phpgwapi/inc/class.menu.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.menu.inc.php 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/phpgwapi/inc/class.menu.inc.php 2008-02-14 11:54:40 UTC (rev
18482)
@@ -7,7 +7,7 @@
* @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 $
+ * @version $Id: class.menu.inc.php 727 2008-02-08 04:13:28Z dave $
*/
/*
Modified: trunk/phpgwapi/inc/class.setup_translation.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.setup_translation.inc.php 2008-02-10 09:33:46 UTC
(rev 18481)
+++ trunk/phpgwapi/inc/class.setup_translation.inc.php 2008-02-14 11:54:40 UTC
(rev 18482)
@@ -25,7 +25,7 @@
* @package phpgwapi
* @subpackage application
*/
- class phpgwapi_setup_translation
+ class phpgwapi_setup_translation extends phpgwapi_translation
{
var $langarray;
@@ -34,72 +34,63 @@
*
* @param $lang user lang variable (defaults to en)
*/
- function __construct()
+ public function __construct()
{
$ConfigLang = phpgw::get_var('ConfigLang');
+ $this->set_userlang($ConfigLang);
- if($ConfigLang)
- {
- $this->userlang = $ConfigLang;
- }
-
- $fn = "./lang/phpgw_{$lang}.lang";
+ $fn = "./lang/phpgw_{$this->userlang}.lang";
if (!file_exists($fn))
{
$fn = './lang/phpgw_en.lang';
}
- if (file_exists($fn))
- {
- $fp = fopen($fn,'r');
- while ($data = fgets($fp,8000))
- {
-
list($message_id,$app_name,$null,$content) = explode("\t",$data);
- if ($app_name == 'setup' || $app_name
== 'common' || $app_name == 'all')
+ $strings = $this->parse_lang_file($fn, $this->userlang);
+
+ if ( !is_array($strings) || !count($strings) )
{
- $this->langarray[] = array(
- 'message_id' =>
$message_id,
- 'content' =>
trim($content)
- );
+ echo "Unable to load lang file: {$fn}<br>String
won't be translated";
+ return;
}
- }
- fclose($fp);
+ foreach ( $strings as $string )
+ {
+ $this->lang[strtolower($string['message_id'])]
= $string['content'];
}
}
/**
+ * Populate shared memory with the available translation strings
- disabled for setup
+ */
+ public function populate_shm()
+ {}
+
+ /**
* Translate phrase to user selected lang
*
* @param $key phrase to translate
* @param $vars vars sent to lang function, passed to us
*/
- function translate($key, $vars=False)
+ public function translate($key, $vars = array(), $only_common =
false )
{
- if (!$vars)
+ if ( !is_array($vars) )
{
$vars = array();
}
$ret = $key;
- @reset($this->langarray);
- while(list($null,$data) = @each($this->langarray))
+ if ( isset($this->lang[strtolower($key)]) )
{
- $lang[strtolower($data['message_id'])] =
$data['content'];
+ $ret = $this->lang[strtolower($key)];
}
-
- if (isset($lang[strtolower ($key)]) && $lang[strtolower
($key)])
- {
- $ret = $lang[strtolower ($key)];
- }
else
{
- $ret = $key.'*';
+ $ret = "!{$key}";
}
$ndx = 1;
- while( list($key,$val) = each( $vars ) )
+ foreach ( $vars as $var )
{
- $ret = preg_replace( "/%$ndx/", $val, $ret );
+ $ret = preg_replace( "/%$ndx/", $var, $ret );
++$ndx;
}
return $ret;
@@ -186,50 +177,48 @@
_debug_array($langs);
}
- while (list($null,$lang) = each($langs))
+ foreach ( $langs as $lang )
{
+ // escape it here - that will increase the
string length
+ $lang =
$GLOBALS['phpgw_setup']->db->db_addslashes($lang);
+ if ( strlen($lang) != 2 )
+ {
+ continue; // invalid lang
+ }
+
+ $lang = strtolower($lang);
+
if($DEBUG)
{
echo '<br>add_langs(): Working on: ' .
$lang . ' for ' . $appname;
}
- $appfile = PHPGW_SERVER_ROOT .
"/{$appname}/setup/phpgw_" . strtolower($lang) . '.lang';
+ $appfile = PHPGW_SERVER_ROOT .
"/{$appname}/setup/phpgw_{$lang}.lang";
if(file_exists($appfile))
{
if($DEBUG)
{
echo '<br>add_langs():
Including: ' . $appfile;
}
- $raw_file = file($appfile);
+ $raw_file =
$this->parse_lang_file($appfile);
foreach ( $raw_file as $line )
{
-
list($message_id,$app_name,$GLOBALS['phpgw_setup']->db_lang,$content) =
explode("\t",$line);
- if ( !strlen($content) )
- {
- echo "ERROR: Invalid
translation entry: '$line'\n in
/path/to/phpgroupware/$appname/setup/phpgw_$lang.lang<br>\n";
- }
-
- $message_id =
$GLOBALS['phpgw_setup']->db->db_addslashes(chop(substr($message_id,0,MAX_MESSAGE_ID_LENGTH)));
+ $message_id =
$GLOBALS['phpgw_setup']->db->db_addslashes(strtolower(substr($line['message_id'],
0, self::MAX_MESSAGE_ID_LENGTH)));
/* echo '<br>APPNAME:' .
$app_name . ' PHRASE:' . $message_id; */
- $app_name =
$GLOBALS['phpgw_setup']->db->db_addslashes(chop($app_name));
-
$GLOBALS['phpgw_setup']->db_lang =
$GLOBALS['phpgw_setup']->db->db_addslashes(chop($GLOBALS['phpgw_setup']->db_lang));
- $content =
$GLOBALS['phpgw_setup']->db->db_addslashes(chop($content));
+ $app_name =
$GLOBALS['phpgw_setup']->db->db_addslashes($line['app_name']);
+ $content =
$GLOBALS['phpgw_setup']->db->db_addslashes($line['content']);
-
$GLOBALS['phpgw_setup']->db->query("SELECT COUNT(*) FROM phpgw_lang WHERE
message_id='$message_id' and lang='"
- .
$GLOBALS['phpgw_setup']->db_lang . "'",__LINE__,__FILE__);
+
$GLOBALS['phpgw_setup']->db->query("SELECT COUNT(*) FROM phpgw_lang WHERE
message_id='$message_id' and lang='{$lang}' ", __LINE__, __FILE__);
$GLOBALS['phpgw_setup']->db->next_record();
-
if
($GLOBALS['phpgw_setup']->db->f(0) == 0)
{
if($message_id &&
$content)
{
if($DEBUG)
{
- echo
"<br>add_langs(): adding - INSERT INTO phpgw_lang VALUES
('$message_id','$app_name','"
-
. $GLOBALS['phpgw_setup']->db_lang . "','$content')";
+ echo
"<br>add_langs(): adding - INSERT INTO phpgw_lang VALUES
('{$message_id}','{$app_name}','{$lang}','{$content}')";
}
-
$GLOBALS['phpgw_setup']->db->query("INSERT INTO phpgw_lang VALUES
('$message_id','$app_name','"
- .
$GLOBALS['phpgw_setup']->db_lang . "','$content')",__LINE__,__FILE__);
+
$GLOBALS['phpgw_setup']->db->query("INSERT INTO phpgw_lang VALUES
('{$message_id}','{$app_name}','{$lang}','{$content}')", __LINE__, __FILE__);
}
}
}
Modified: trunk/phpgwapi/inc/class.shm.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.shm.inc.php 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/phpgwapi/inc/class.shm.inc.php 2008-02-14 11:54:40 UTC (rev
18482)
@@ -71,7 +71,7 @@
{
if ( substr(PHP_OS, 3) == 'WIN' )
{
- $GLOBALS['phpgw_info']['server']['temp_dir'] =
'C:\\temp';
+ $GLOBALS['phpgw_info']['server']['temp_dir'] =
'c:/temp';
}
else
{
@@ -102,12 +102,12 @@
/**
* The path to store the lock files
*/
- define('PHPGW_SHM_LOCK', PHPGW_SERVER_ROOT);
+ define('PHPGW_SHM_LOCK', $GLOBALS['phpgw_info']['server']['temp_dir']);
/**
* Shared memory handler class
*/
- class shm
+ class phpgwapi_shm
{
/**
* @var string $hashid the hash_table_key - example: 'lang_en'
@@ -117,7 +117,7 @@
/**
* Constructor
*/
- function shm()
+ function __construct()
{}
/**
@@ -449,4 +449,14 @@
$this->garbage_collection();
ob_start("cache_end"); // callback
}
+
+ /**
+ * Check if shared memeory is enabled
+ *
+ * @return bool is it enabled?
+ */
+ public static function is_enabled()
+ {
+ return function_exists('sem_get');
+ }
}
Modified: trunk/phpgwapi/inc/class.translation.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.translation.inc.php 2008-02-10 09:33:46 UTC
(rev 18481)
+++ trunk/phpgwapi/inc/class.translation.inc.php 2008-02-14 11:54:40 UTC
(rev 18482)
@@ -1,19 +1,390 @@
-<?php
+<?php
/**
- * Translation class loader
- * @copyright Copyright (C) 2003,2004 Free Software Foundation, Inc.
http://www.fsf.org/
+ * Handles multi-language support
+ * @author Dave Hall <address@hidden>
+ * @author Joseph Engo <address@hidden>
+ * @author Dan Kuykendall <address@hidden>
+ * @copyright Portions Copyright (C) 2000-2008 Free Software Foundation,
Inc. http://www.fsf.org/
* @license http://www.fsf.org/licenses/lgpl.html GNU Lesser General
Public License
* @package phpgwapi
* @subpackage application
* @version $Id$
*/
- if (empty($GLOBALS['phpgw_info']['server']['translation_system']))
+ /**
+ * Handles multi-language support use SQL tables
+ *
+ * @package phpgwapi
+ * @subpackage application
+ */
+ class phpgwapi_translation
{
- $GLOBALS['phpgw_info']['server']['translation_system'] = 'sql';
+ /**
+ * @var string $userlang user's prefered language
+ * @internal this should probably be private and probably will
become private
+ */
+ public $userlang = 'en';
+
+ /**
+ * @var bool $loaded_from_shm was the lang data loaded from
shared memory?
+ */
+ private $loaded_from_shm;
+
+ /**
+ * @var array $lang the translated strings - speeds look up
+ */
+ private $lang = array();
+
+ /**
+ * @var array $errors errors returned from function calls
+ */
+ public $errors = array();
+
+ /**
+ * Maxiumum length of a translation string
+ */
+ const MAX_MESSAGE_ID_LENGTH = 230;
+
+ /**
+ * Constructor
+ *
+ * @param bool $reset reload the translations
+ */
+ public function __construct($reset = false)
+ {
+ if ( $GLOBALS['phpgw']->shm->is_enabled()
+ &&
isset($GLOBALS['phpgw_info']['server']['shm_lang']) &&
$GLOBALS['phpgw_info']['server']['shm_lang'] )
+ {
+
$this->set_userlang($GLOBALS['phpgw_info']['user']['preferences']['common']['lang']);
+ $this->reset_lang($reset);
+ }
+ }
+
+ /**
+ * Reset the current user's language settings
+ */
+ protected function reset_lang()
+ {
+ $this->loaded_from_shm = false;
+ if ( $GLOBALS['phpgw']->shm->is_enabled()
+ && $this->lang =
$GLOBALS['phpgw']->shm->get_value("lang_{$this->userlang}") )
+ {
+ $this->loaded_from_shm = true;
+ }
+ else
+ {
+ $this->lang = array();
+ }
+ }
+
+ /**
+ * Set the user's selected language
+ */
+ public function set_userlang($lang, $reset = true)
+ {
+ if ( strlen($lang) != 2 )
+ {
+ $lang = 'en';
+ }
+ $this->userlang = $lang;
+ if ( $reset )
+ {
+ $this->reset_lang();
+ }
+ }
+
+ /**
+ * Read a lang file and return it as an array
+ *
+ * @param $fn the filename parse
+ * @param $lang the lang to be parsed - used for validation
+ * @return the array of translation string - empty array on
failure
+ */
+ protected function parse_lang_file($fn, $lang)
+ {
+ if ( !file_exists($fn) )
+ {
+ $this->errors[] = "Failed load lang file: $fn";
+ return array();
+ }
+
+ $entries = array();
+ $lines = file($fn);
+ foreach ( $lines as $cnt => $line )
+ {
+ $entry = explode("\t", $line);
+ //Make sure the lang files only have valid
entries
+ if ( count($entry) != 4 || $entry[2] != $lang )
+ {
+ $err_line = $cnt + 1;
+ $this->errors[] = "Invalid entry in $fn
@ line {$err_line}: <code>" . htmlspecialchars(preg_replace('/\t/', '\\t',
$line)) . "</code> - skipping";
+ continue;
+ }
+
+ //list($message_id,$app_name,$ignore,$content)
= $entry;
+ $entries[] = array
+ (
+ 'message_id' => trim($entry[0]),
+ 'app_name' =>
trim($entry[1]),
+ 'lang' =>
trim($entry[2]),
+ 'content' =>
trim($entry[3])
+ );
+ }
+ return $entries;
+ }
+
+ /**
+ * Populate shared memory with the available translation strings
+ */
+ public function populate_shm()
+ {
+ $sql = "SELECT * from phpgw_lang ORDER BY app_name
desc";
+ $GLOBALS['phpgw']->db->query($sql,__LINE__,__FILE__);
+ while ($GLOBALS['phpgw']->db->next_record())
+ {
+
$lang_set[$GLOBALS['phpgw']->db->f('lang')][$GLOBALS['phpgw']->db->f('message_id',
true)] = $GLOBALS['phpgw']->db->f('content', true);
+ }
+
+ $language = array_keys($lang_set);
+ if (isset($language) && is_array($language))
+ {
+ foreach($language as $lang)
+ {
+
$GLOBALS['phpgw']->shm->store_value("lang_{$lang}", $lang_set[$lang]);
+ }
+ }
+ }
+
+ /**
+ * Translate a string
+ *
+ * @param string $key the string to translate - truncates at 230
chars
+ * @param array $vars substitutions to apply to string
"%$array_key" must be present in $key
+ * @param bool $only_common only use the "common" translation,
should be used when calling this from non module contexts
+ * @return string the translated string - when unable to be
translated, the string is returned as "!$key"
+ */
+ public function translate($key, $vars = array(), $only_common =
false )
+ {
+ $ret = $key;
+ if ( !$userlang = $this->userlang )
+ {
+ $userlang = 'en';
+ }
+
+ $lookup_key = strtolower(trim(substr($key, 0,
self::MAX_MESSAGE_ID_LENGTH)));
+
+ if ( !is_array($this->lang)
+ || (!isset($this->lang[$lookup_key]) &&
!$this->loaded_from_shm) )
+ {
+ $applist = "'common', 'all'";
+ $order = ' ORDER BY app_name ASC';
+ if ( !$only_common )
+ {
+ $applist .= ",
'{$GLOBALS['phpgw_info']['flags']['currentapp']}'";
+ if (
strcasecmp($GLOBALS['phpgw_info']['flags']['currentapp'], 'common') <= 1 )
+ {
+ $order = 'ORDER BY app_name
DESC';
+ }
+ }
+
+ $sql = 'SELECT message_id, content'
+ . " FROM phpgw_lang WHERE lang =
'{$userlang}' AND message_id = '" .
$GLOBALS['phpgw']->db->db_addslashes($lookup_key) . '\''
+ . " AND app_name IN({$applist})
{$order}";
+
+
$GLOBALS['phpgw']->db->query($sql,__LINE__,__FILE__);
+ while ($GLOBALS['phpgw']->db->next_record())
+ {
+ $this->lang[$lookup_key] =
$GLOBALS['phpgw']->db->f('content', true);
+ }
+ }
+ $ret = "!{$key}"; // save key if we dont find a
translation
+ $key = $lookup_key;
+
+ if ( isset($this->lang[$key]) )
+ {
+ $ret = $this->lang[$key];
+ }
+ $ndx = 1;
+ foreach ( $vars as $key => $val )
+ {
+ $ret = preg_replace( "/%$ndx/", $val, $ret );
+ ++$ndx;
+ }
+ return $ret;
+ }
+
+ /**
+ * Add an applications translation strings to the available list
+ *
+ * @param string $app the application's strings to add
+ */
+ public function add_app($app)
+ {
+ if ( !is_array($this->lang) )
+ {
+ $this->lang = array();
+ }
+
+ $userlang = 'en';
+ if (
$GLOBALS['phpgw_info']['user']['preferences']['common']['lang'] )
+ {
+ $userlang =
$GLOBALS['phpgw_info']['user']['preferences']['common']['lang'];
+ }
+
+ $sql = "SELECT message_id,content FROM phpgw_lang WHERE
lang like '{$userlang}' AND app_name like '{$app}'";
+ $GLOBALS['phpgw']->db->query($sql,__LINE__,__FILE__);
+ while ( $GLOBALS['phpgw']->db->next_record() )
+ {
+
$this->lang[strtolower(trim(substr($GLOBALS['phpgw']->db->f('message_id',
true), 0, self::MAX_MESSAGE_ID_LENGTH)))] = $GLOBALS['phpgw']->db->f('content',
true);
+ }
+ }
+
+ /**
+ * Get a list of installed languages
+ *
+ * @return array list of languages - count() == 0 none installed
(shouldn't happen - EVER!)
+ */
+ public function get_installed_langs()
+ {
+ $langs = array();
+ $GLOBALS['phpgw']->db->query('SELECT DISTINCT l.lang,
ln.lang_name'
+ . ' FROM phpgw_lang l, phpgw_languages ln'
+ . ' WHERE l.lang = ln.lang_id', __LINE__,
__FILE__);
+ while ($GLOBALS['phpgw']->db->next_record())
+ {
+ $langs[$GLOBALS['phpgw']->db->f('lang')] =
$GLOBALS['phpgw']->db->f('lang_name');
+ }
+ return $langs;
+ }
+
+ /**
+ * Update the currently available translation strings stored in
the db
+ *
+ * @param array $lang_selected the languages to update
+ * @param string $upgrademethod the way to upgrade the
translations
+ * @return string any error messages - empty string means it
worked perfectly
+ */
+ public function update_db($lang_selected, $upgrademethod)
+ {
+ $error = '';
+
+ $GLOBALS['phpgw']->db->transaction_begin();
+
+
if(!isset($GLOBALS['phpgw_info']['server']['lang_ctimes']))
+ {
+ $GLOBALS['phpgw_info']['server']['lang_ctimes']
= array();
+ }
+
+ if (!isset($GLOBALS['phpgw_info']['server']) &&
$upgrademethod != 'dumpold')
+ {
+ $GLOBALS['phpgw']->db->query("select * from
phpgw_config WHERE config_app='phpgwapi' AND
config_name='lang_ctimes'",__LINE__,__FILE__);
+ if ($GLOBALS['phpgw']->db->next_record())
+ {
+
$GLOBALS['phpgw_info']['server']['lang_ctimes'] =
unserialize($GLOBALS['phpgw']->db->f('config_value', true));
+ }
+ }
+
+ if (count($lang_selected))
+ {
+ if ($upgrademethod == 'dumpold')
+ {
+ // dont delete the custom main- &
loginscreen messages every time
+ $GLOBALS['phpgw']->db->query("DELETE
FROM phpgw_lang where app_name != 'mainscreen' AND app_name !=
'loginscreen'",__LINE__,__FILE__);
+
$GLOBALS['phpgw_info']['server']['lang_ctimes'] = array();
+ }
+
+ foreach($lang_selected as $lang)
+ {
+ $lang = strtolower($lang);
+
+ if ( strlen($lang) != 2 )
+ {
+ $error .= "Invalid lang code '"
. htmlspecialchars($lang) . "': skipping<br>\n";
+ continue;
+ }
+
+ //echo '<br />Working on: ' . $lang;
+ if (
$GLOBALS['phpgw']->shm->is_enabled() )
+ {
+
$GLOBALS['phpgw']->shm->delete_key('lang_' . $lang);
+ }
+
+ if ($upgrademethod == 'addonlynew')
+ {
+
$GLOBALS['phpgw']->db->query("SELECT COUNT(*) FROM phpgw_lang WHERE
lang='".$lang."'",__LINE__,__FILE__);
+
$GLOBALS['phpgw']->db->next_record();
+
+ if ($GLOBALS['phpgw']->db->f(0)
!= 0)
+ {
+ $error .= "Lang code
'{$lang}' already installed: skipping<br>\n";
+ continue;
+ }
+ }
+
+ $raw = array();
+ // this populates
$GLOBALS['phpgw_info']['apps']
+
$GLOBALS['phpgw']->applications->read_installed_apps();
+
+ // Visit each app/setup dir, look for a
phpgw_lang file
+ foreach (
array_keys($GLOBALS['phpgw_info']['apps']) as $app )
+ {
+ $appfile = PHPGW_SERVER_ROOT .
"/{$app}/setup/phpgw_{$lang}.lang";
+ if ( !is_file($appfile) )
+ {
+ // make sure file
exists before trying to load it
+ continue;
+ }
+
+ $lines =
$this->parse_lang_file($appfile, $lang);
+ if ( !count($lines) )
+ {
+ echo "<div
class=\"error\">" . implode("<br>\n", $this->errors) . "</div>\n";
+ $this->errors = array();
+ continue;
+ }
+
+ foreach ( $lines as $line )
+ {
+ $message_id =
$GLOBALS['phpgw']->db->db_addslashes(strtolower(trim(substr($line['message_id'],
0, self::MAX_MESSAGE_ID_LENGTH))));
+ $app_name =
$GLOBALS['phpgw']->db->db_addslashes(trim($line['app_name']));
+ $content =
$GLOBALS['phpgw']->db->db_addslashes(trim($line['content']));
+
+
$raw[$app_name][$message_id] = $content;
+ }
+
$GLOBALS['phpgw_info']['server']['lang_ctimes'][$lang][$app['name']] =
filectime($appfile);
+ }
+
+ foreach($raw as $app_name => $ids)
+ {
+ foreach($ids as $message_id =>
$content)
+ {
+ if ($upgrademethod ==
'addmissing')
+ {
+ //echo '<br
/>Test: addmissing';
+
$GLOBALS['phpgw']->db->query("SELECT COUNT(*) FROM phpgw_lang WHERE
message_id='$message_id' AND lang='$lang' AND
app_name='$app_name'",__LINE__,__FILE__);
+
$GLOBALS['phpgw']->db->next_record();
+
+ if (
$GLOBALS['phpgw']->db->f(0) != 0)
+ {
+
continue;
+ }
+ }
+
+ $result =
$GLOBALS['phpgw']->db->query("INSERT INTO phpgw_lang
(message_id,app_name,lang,content)
VALUES('$message_id','$app_name','$lang','$content')",__LINE__,__FILE__);
+ if ( !$result )
+ {
+ $error .=
"Error inserting record: phpgw_lang values
('$message_id','$app_name','$lang','$content')<br>";
+ }
+ }
+ }
+ }
+
+ $GLOBALS['phpgw']->db->query("DELETE from
phpgw_config WHERE config_app='phpgwapi' AND
config_name='lang_ctimes'",__LINE__,__FILE__);
+ $GLOBALS['phpgw']->db->query("INSERT INTO
phpgw_config(config_app,config_name,config_value) VALUES
('phpgwapi','lang_ctimes','".
+
$GLOBALS['phpgw']->db->db_addslashes(serialize($GLOBALS['phpgw_info']['server']['lang_ctimes']))."')",__LINE__,__FILE__);
+
+ $GLOBALS['phpgw']->db->transaction_commit();
+ }
+ return $error;
+ }
}
- /**
- * Include translation class
- */
- include(PHPGW_API_INC.'/class.translation_sql.inc.php');
-?>
Modified: trunk/phpgwapi/inc/functions.inc.php
===================================================================
--- trunk/phpgwapi/inc/functions.inc.php 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/phpgwapi/inc/functions.inc.php 2008-02-14 11:54:40 UTC (rev
18482)
@@ -488,7 +488,7 @@
{
if (! $GLOBALS['phpgw']->session->verify())
{
- if( isset($_GET['menuaction']) && $_GET['menuaction'])
+ if ( phpgw::get_var('menuaction', 'string', 'GET') )
{
unset($_GET['click_history']);
unset($_GET['sessionid']);
@@ -505,8 +505,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->__construct($reset =
True);
+
$GLOBALS['phpgw']->translation->set_userlang($GLOBALS['phpgw_info']['user']['preferences']['common']['lang']);
}
$redirect = unserialize(phpgw::get_var('redirect','raw',
'COOKIE'));
Modified: trunk/phpgwapi/setup/setup.inc.php
===================================================================
--- trunk/phpgwapi/setup/setup.inc.php 2008-02-10 09:33:46 UTC (rev 18481)
+++ trunk/phpgwapi/setup/setup.inc.php 2008-02-14 11:54:40 UTC (rev 18482)
@@ -12,7 +12,7 @@
// Basic information about this app
$setup_info['phpgwapi']['name'] = 'phpgwapi';
$setup_info['phpgwapi']['title'] = 'phpgwapi';
- $setup_info['phpgwapi']['version'] = '0.9.17.512';
+ $setup_info['phpgwapi']['version'] = '0.9.17.513';
$setup_info['phpgwapi']['versions']['current_header'] = '1.28';
$setup_info['phpgwapi']['enable'] = 3;
$setup_info['phpgwapi']['app_order'] = 1;
Modified: trunk/phpgwapi/setup/tables_update.inc.php
===================================================================
--- trunk/phpgwapi/setup/tables_update.inc.php 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/phpgwapi/setup/tables_update.inc.php 2008-02-14 11:54:40 UTC (rev
18482)
@@ -1656,7 +1656,7 @@
$GLOBALS['phpgw_setup']->oProc->DropTable('phpgw_cust_fields');
$GLOBALS['phpgw_setup']->oProc->DropTable('phpgw_cust_field_types');
- $GLOBALS['phpgw_setup']->oProc->DropTable('phpgw_field_values');
+
$GLOBALS['phpgw_setup']->oProc->DropTable('phpgw_cust_field_values');
$GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit();
Modified: trunk/preferences/inc/class.menu.inc.php
===================================================================
--- trunk/preferences/inc/class.menu.inc.php 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/preferences/inc/class.menu.inc.php 2008-02-14 11:54:40 UTC (rev
18482)
@@ -6,7 +6,7 @@
* @copyright Copyright (C) 2007 Free Software Foundation, Inc.
http://www.fsf.org/
* @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
* @package preferences
- * @version $Id: class.menu.inc.php 690 2008-02-02 10:11:33Z dave $
+ * @version $Id: class.menu.inc.php 727 2008-02-08 04:13:28Z dave $
*/
/*
Modified: trunk/preferences/inc/class.uiadmin_acl.inc.php
===================================================================
--- trunk/preferences/inc/class.uiadmin_acl.inc.php 2008-02-10 09:33:46 UTC
(rev 18481)
+++ trunk/preferences/inc/class.uiadmin_acl.inc.php 2008-02-14 11:54:40 UTC
(rev 18482)
@@ -63,6 +63,7 @@
// Add top location if used for first time
$GLOBALS['phpgw']->acl->verify_location(array($this->acl_app =>
array('top_grant' =>True)));
+ $GLOBALS['phpgw_info']['flags']['menu_selection'] =
"admin::{$this->acl_app}::acl";
}
function save_sessiondata()
Modified: trunk/property/inc/class.bocommon.inc.php
===================================================================
--- trunk/property/inc/class.bocommon.inc.php 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/property/inc/class.bocommon.inc.php 2008-02-14 11:54:40 UTC (rev
18482)
@@ -1568,5 +1568,49 @@
}
return $values;
}
+
+ function get_menu()
+ {
+
if(!isset($GLOBALS['phpgw_info']['user']['preferences']['property']['horisontal_menus'])
||
$GLOBALS['phpgw_info']['user']['preferences']['property']['horisontal_menus']
== 'no')
+ {
+ return;
+ }
+ $GLOBALS['phpgw']->xslttpl->add_file(array('menu'));
+ $menu_brutto = execMethod('property.menu.get_menu');
+ $selection =
explode('::',$GLOBALS['phpgw_info']['flags']['menu_selection']);
+ $level=0;
+ $menu['navigation'] =
$this->get_sub_menu($menu_brutto['navigation'],$selection,$level);
+//_debug_array($GLOBALS['phpgw_info']['flags']['menu_selection']);
+//_debug_array($selection);
+//_debug_array($menu);
+ return $menu;
+ }
+
+ function get_sub_menu($children = array(),
$selection=array(),$level='')
+ {
+ $level++;
+ $i=0;
+ foreach($children as $key => $vals)
+ {
+ $menu[] = $vals;
+ if($key == $selection[$level])
+ {
+ $menu[$i]['this'] = true;
+ if(isset($menu[$i]['children']))
+ {
+ $menu[$i]['children'] =
$this->get_sub_menu($menu[$i]['children'],$selection,$level);
+ }
+ }
+ else
+ {
+ if(isset($menu[$i]['children']))
+ {
+ unset($menu[$i]['children']);
+ }
+ }
+ $i++;
+ }
+ return $menu;
+ }
}
?>
Modified: trunk/property/inc/class.bolocation.inc.php
===================================================================
--- trunk/property/inc/class.bolocation.inc.php 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/property/inc/class.bolocation.inc.php 2008-02-14 11:54:40 UTC (rev
18482)
@@ -314,7 +314,7 @@
for ($j=0;$j<$location_cols_count;$j++)
{
//FIXME: location_type is currently empty -
should'nt be...
- if(($fm_location_cols[$j]['location_type'] <=
$data['type_id']) && $fm_location_cols[$j]['lookup_form'])
+
if((isset($fm_location_cols[$j]['location_type']) &&
$fm_location_cols[$j]['location_type'] <= $data['type_id']) &&
$fm_location_cols[$j]['lookup_form'])
{
$location['location'][$i]['input_type']
= 'text';
$location['location'][$i]['input_name']
= $fm_location_cols[$j]['column_name'];
Modified: trunk/property/inc/class.solocation.inc.php
===================================================================
--- trunk/property/inc/class.solocation.inc.php 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/property/inc/class.solocation.inc.php 2008-02-14 11:54:40 UTC (rev
18482)
@@ -708,7 +708,7 @@
if (($config[$i]['location_type'] <= $type_id)
&& ($config[$i]['f_key'] ==1))
{
-
if($config[$i]['column_name']=='tenant_id')
+
if($config[$i]['column_name']=='tenant_id' ||
$config[$i]['column_name']=='street_id')
{
$join=$this->left_join;
}
Modified: trunk/property/inc/class.uiXport.inc.php
===================================================================
--- trunk/property/inc/class.uiXport.inc.php 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/property/inc/class.uiXport.inc.php 2008-02-14 11:54:40 UTC (rev
18482)
@@ -284,6 +284,7 @@
$data = array
(
+ 'menu'
=> $this->bocommon->get_menu(),
'msgbox_data'
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
'img_cal'
=> $GLOBALS['phpgw']->common->image('phpgwapi','cal'),
@@ -562,6 +563,7 @@
$data = array
(
+ 'menu'
=> $this->bocommon->get_menu(),
'msgbox_data' =>
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
'force_period_year' =>
$force_period_year,
'lang_force_period_year' =>
lang('Force year for period'),
Modified: trunk/property/inc/class.uiactor.inc.php
===================================================================
--- trunk/property/inc/class.uiactor.inc.php 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/property/inc/class.uiactor.inc.php 2008-02-14 11:54:40 UTC (rev
18482)
@@ -99,8 +99,15 @@
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=>
'property.uilocation.index'));
}
+ if (phpgw::get_var('admin', 'bool'))
+ {
+
$GLOBALS['phpgw_info']['flags']['menu_selection'] =
"admin::property::{$this->role}";
+ }
+ else
+ {
$GLOBALS['phpgw_info']['flags']['menu_selection'] =
"property::invoice::{$this->role}";
}
+ }
function save_sessiondata()
{
@@ -320,6 +327,7 @@
$data = array
(
+ 'menu'
=> $this->bocommon->get_menu(),
'lang_columns'
=> lang('columns'),
'link_columns'
=> $GLOBALS['phpgw']->link('/index.php',$link_columns),
'lang_columns_help'
=> lang('Choose columns'),
Modified: trunk/property/inc/class.uiadmin.inc.php
===================================================================
--- trunk/property/inc/class.uiadmin.inc.php 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/property/inc/class.uiadmin.inc.php 2008-02-14 11:54:40 UTC (rev
18482)
@@ -568,7 +568,7 @@
function edit_id()
{
- $GLOBALS['phpgw_info']['flags']['menu_selection'] .=
'::edit_id';
+ $GLOBALS['phpgw_info']['flags']['menu_selection'] .=
'::id_control';
$GLOBALS['phpgw']->xslttpl->add_file(array('admin'));
@@ -632,7 +632,7 @@
function contact_info()
{
- $GLOBALS['phpgw_info']['flags']['menu_selection'] =
'::contact_info';
+ $GLOBALS['phpgw_info']['flags']['menu_selection'] .=
'::user_contact';
$GLOBALS['phpgw']->xslttpl->add_file(array('admin'));
Modified: trunk/property/inc/class.uiagreement.inc.php
===================================================================
--- trunk/property/inc/class.uiagreement.inc.php 2008-02-10 09:33:46 UTC
(rev 18481)
+++ trunk/property/inc/class.uiagreement.inc.php 2008-02-14 11:54:40 UTC
(rev 18482)
@@ -354,6 +354,7 @@
$data = array
(
+ 'menu'
=> $this->bocommon->get_menu(),
'lang_columns'
=> lang('columns'),
'link_columns'
=> $GLOBALS['phpgw']->link('/index.php',$link_columns),
'lang_columns_help'
=> lang('Choose columns'),
Modified: trunk/property/inc/class.uialarm.inc.php
===================================================================
--- trunk/property/inc/class.uialarm.inc.php 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/property/inc/class.uialarm.inc.php 2008-02-14 11:54:40 UTC (rev
18482)
@@ -469,6 +469,7 @@
$data = array
(
+ 'menu'
=> $this->bocommon->get_menu(),
'msgbox_data'
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
'allow_allrows'
=> true,
'allrows'
=> $this->allrows,
Modified: trunk/property/inc/class.uib_account.inc.php
===================================================================
--- trunk/property/inc/class.uib_account.inc.php 2008-02-10 09:33:46 UTC
(rev 18481)
+++ trunk/property/inc/class.uib_account.inc.php 2008-02-14 11:54:40 UTC
(rev 18482)
@@ -166,6 +166,7 @@
$data = array
(
+ 'menu'
=> $this->bocommon->get_menu(),
'allow_allrows' => True,
'allrows' =>
$this->allrows,
'start_record' =>
$this->start,
Modified: trunk/property/inc/class.uibudget.inc.php
===================================================================
--- trunk/property/inc/class.uibudget.inc.php 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/property/inc/class.uibudget.inc.php 2008-02-14 11:54:40 UTC (rev
18482)
@@ -259,6 +259,7 @@
$data = array
(
+ 'menu'
=> $this->bocommon->get_menu(),
'sum'
=> $sum,
'lang_sum'
=> lang('sum'),
'msgbox_data'
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
@@ -462,6 +463,7 @@
$data = array
(
+ 'menu'
=> $this->bocommon->get_menu(),
'sum'
=> $sum,
'lang_sum'
=> lang('sum'),
'msgbox_data'
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
@@ -625,6 +627,7 @@
$data = array
(
+ 'menu'
=> $this->bocommon->get_menu(),
'sum_actual_cost'
=> $sum_actual_cost,
'sum_diff'
=> $sum_diff,
'sum_obligation'
=> $sum_obligation,
Modified: trunk/property/inc/class.uicategory.inc.php
===================================================================
--- trunk/property/inc/class.uicategory.inc.php 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/property/inc/class.uicategory.inc.php 2008-02-14 11:54:40 UTC (rev
18482)
@@ -108,13 +108,10 @@
while (is_array($category_list) && list(,$category) =
each($category_list))
{
- $words = split(' ',$category['descr']);
- $first = "$words[0] $words[1] $words[2]
$words[3]";
-
$content[] = array
(
'id' =>
$category['id'],
- 'first' =>
$first,
+ 'first' =>
$category['descr'],
'link_edit' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
'property.uicategory.edit', 'id'=> $category['id'], 'type'=> $type, 'type_id'=>
$type_id, 'menu_selection' =>
$GLOBALS['phpgw_info']['flags']['menu_selection'])),
'link_delete' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
'property.uicategory.delete', 'id'=> $category['id'], 'type'=> $type,
'type_id'=> $type_id, 'menu_selection' =>
$GLOBALS['phpgw_info']['flags']['menu_selection'])),
'lang_view_categorytext' =>
lang('view the category'),
Modified: trunk/property/inc/class.uicustom.inc.php
===================================================================
--- trunk/property/inc/class.uicustom.inc.php 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/property/inc/class.uicustom.inc.php 2008-02-14 11:54:40 UTC (rev
18482)
@@ -273,6 +273,7 @@
$data = array
(
+ 'menu'
=> $this->bocommon->get_menu(),
'msgbox_data'
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
'allow_allrows'
=> true,
'allrows'
=> $this->allrows,
Modified: trunk/property/inc/class.uidocument.inc.php
===================================================================
--- trunk/property/inc/class.uidocument.inc.php 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/property/inc/class.uidocument.inc.php 2008-02-14 11:54:40 UTC (rev
18482)
@@ -301,6 +301,7 @@
$data = array
(
+ 'menu'
=> $this->bocommon->get_menu(),
'link_history'
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=>
'property.uidocument.index', 'cat_id'=> $this->cat_id)),
'lang_history_statustext'
=> lang('search for history at this location'),
'lang_select'
=> lang('select'),
@@ -554,6 +555,7 @@
$data = array
(
+ 'menu'
=> $this->bocommon->get_menu(),
'msgbox_data'
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
'location_data'
=> $location_data,
'link_history'
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=>
'property.uidocument.list_doc', 'cat_id'=> $this->cat_id)),
Modified: trunk/property/inc/class.uientity.inc.php
===================================================================
--- trunk/property/inc/class.uientity.inc.php 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/property/inc/class.uientity.inc.php 2008-02-14 11:54:40 UTC (rev
18482)
@@ -466,6 +466,7 @@
$data = array
(
+ 'menu'
=> $this->bocommon->get_menu(),
'group_filters' =>
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['group_filters'])?$GLOBALS['phpgw_info']['user']['preferences']['property']['group_filters']:'',
'lang_excel' =>
'excel',
'link_excel' =>
$GLOBALS['phpgw']->link('/index.php',$link_excel),
Modified: trunk/property/inc/class.uigab.inc.php
===================================================================
--- trunk/property/inc/class.uigab.inc.php 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/property/inc/class.uigab.inc.php 2008-02-14 11:54:40 UTC (rev
18482)
@@ -424,6 +424,7 @@
$data = array
(
+ 'menu'
=> $this->bocommon->get_menu(),
'lang_excel' =>
'excel',
'link_excel' =>
$GLOBALS['phpgw']->link('/index.php',$link_excel),
'lang_excel_help' =>
lang('Download table to MS Excel'),
Modified: trunk/property/inc/class.uiinvestment.inc.php
===================================================================
--- trunk/property/inc/class.uiinvestment.inc.php 2008-02-10 09:33:46 UTC
(rev 18481)
+++ trunk/property/inc/class.uiinvestment.inc.php 2008-02-14 11:54:40 UTC
(rev 18482)
@@ -241,6 +241,7 @@
$data = array
(
+ 'menu'
=> $this->bocommon->get_menu(),
'msgbox_data'
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
'lang_search'
=> lang('Search'),
'lang_search_statustext'
=> lang('Search for investment entries'),
Modified: trunk/property/inc/class.uiinvoice.inc.php
===================================================================
--- trunk/property/inc/class.uiinvoice.inc.php 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/property/inc/class.uiinvoice.inc.php 2008-02-14 11:54:40 UTC (rev
18482)
@@ -409,6 +409,7 @@
$GLOBALS['phpgw']->js->validate_file('overlib','overlib','property');
$GLOBALS['phpgw']->js->validate_file('core','check','property');
+ $data['menu']
= $this->bocommon->get_menu();
$data['lang_excel']
= 'excel';
$data['link_excel']
= $GLOBALS['phpgw']->link('/index.php',$link_excel);
$data['lang_excel_help']
= lang('Download table to MS Excel');
@@ -674,7 +675,7 @@
$data = array
(
-
+ 'menu'
=> $this->bocommon->get_menu(),
'lang_excel'
=> 'excel',
'link_excel'
=> $GLOBALS['phpgw']->link('/index.php',$link_excel),
'lang_excel_help'
=> lang('Download table to MS Excel'),
@@ -887,7 +888,7 @@
);
$GLOBALS['phpgw']->js->validate_file('overlib','overlib','property');
-
+ $data['menu']
= $this->bocommon->get_menu();
$data['lang_sum'] =
lang('Sum');
$data['sum'] =
number_format($sum, 0, ',', ' ');
$data['allow_allrows'] = false;
@@ -1216,6 +1217,7 @@
$data = array
(
+ 'menu'
=> $this->bocommon->get_menu(),
'msgbox_data'
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
'img_cal'
=> $GLOBALS['phpgw']->common->image('phpgwapi','cal'),
Modified: trunk/property/inc/class.uilocation.inc.php
===================================================================
--- trunk/property/inc/class.uilocation.inc.php 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/property/inc/class.uilocation.inc.php 2008-02-14 11:54:40 UTC (rev
18482)
@@ -259,7 +259,7 @@
$content[$j]['row'][$i]['name'] = $uicols['name'][$i];
$content[$j]['row'][$i]['lookup'] = $lookup;
$content[$j]['row'][$i]['align'] =
(isset($uicols['align'][$i])?$uicols['align'][$i]:'center');
-
if($uicols['input_type'][$i]=='link' && $location[$uicols['name'][$i]])
+
if($uicols['datatype'][$i]=='link' && $location[$uicols['name'][$i]])
{
$content[$j]['row'][$i]['text'] = lang('link');
$content[$j]['row'][$i]['link'] = $location[$uicols['name'][$i]];
@@ -521,6 +521,7 @@
$data = array
(
+ 'menu' =>
$this->bocommon->get_menu(),
'colspan' =>
$uicols_count+1,
'lang_excel' =>
'excel',
'link_excel' =>
$GLOBALS['phpgw']->link('/index.php',$link_excel),
Modified: trunk/property/inc/class.uipricebook.inc.php
===================================================================
--- trunk/property/inc/class.uipricebook.inc.php 2008-02-10 09:33:46 UTC
(rev 18481)
+++ trunk/property/inc/class.uipricebook.inc.php 2008-02-14 11:54:40 UTC
(rev 18482)
@@ -278,6 +278,7 @@
$data = array
(
+ 'menu'
=> $this->bocommon->get_menu(),
'lang_excel'
=> 'excel',
'link_excel'
=> $GLOBALS['phpgw']->link('/index.php',$link_excel),
'lang_excel_help'
=> lang('Download table to MS Excel'),
@@ -400,6 +401,7 @@
$data = array
(
+ 'menu'
=> $this->bocommon->get_menu(),
'allrows'
=> $this->allrows,
'allow_allrows'
=> true,
'start_record'
=> $this->start,
@@ -914,6 +916,7 @@
$data = array
(
+ 'menu'
=> $this->bocommon->get_menu(),
'lang_excel'
=> 'excel',
'link_excel'
=> $GLOBALS['phpgw']->link('/index.php',$link_excel),
'lang_excel_help'
=> lang('Download table to MS Excel'),
Modified: trunk/property/inc/class.uiproject.inc.php
===================================================================
--- trunk/property/inc/class.uiproject.inc.php 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/property/inc/class.uiproject.inc.php 2008-02-14 11:54:40 UTC (rev
18482)
@@ -378,6 +378,7 @@
$data = array
(
+ 'menu'
=> $this->bocommon->get_menu(),
'lang_excel' => 'excel',
'link_excel' =>
$GLOBALS['phpgw']->link('/index.php',$link_excel),
'lang_excel_help' =>
lang('Download table to MS Excel'),
@@ -550,7 +551,7 @@
if($location_code)
{
- $values['location_data'] =
$bolocation->read_single($location_code,array('tenant_id'=>$tenant_id,'p_num'=>$p_num));
+ $values['location_data'] =
$bolocation->read_single($location_code,array('tenant_id'=>$tenant_id,'p_num'=>$p_num,
'view' => true));
}
}
Modified: trunk/property/inc/class.uir_agreement.inc.php
===================================================================
--- trunk/property/inc/class.uir_agreement.inc.php 2008-02-10 09:33:46 UTC
(rev 18481)
+++ trunk/property/inc/class.uir_agreement.inc.php 2008-02-14 11:54:40 UTC
(rev 18482)
@@ -365,6 +365,7 @@
//_debug_array($member_of_data);
$data = array
(
+ 'menu'
=> $this->bocommon->get_menu(),
'lang_columns'
=> lang('columns'),
'link_columns'
=> $GLOBALS['phpgw']->link('/index.php',$link_columns),
'lang_columns_help'
=> lang('Choose columns'),
Modified: trunk/property/inc/class.uirequest.inc.php
===================================================================
--- trunk/property/inc/class.uirequest.inc.php 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/property/inc/class.uirequest.inc.php 2008-02-14 11:54:40 UTC (rev
18482)
@@ -430,6 +430,7 @@
$data = array
(
+ 'menu'
=> $this->bocommon->get_menu(),
'lang_excel' =>
'excel',
'link_excel' =>
$GLOBALS['phpgw']->link('/index.php',$link_excel),
'lang_excel_help' =>
lang('Download table to MS Excel'),
Modified: trunk/property/inc/class.uis_agreement.inc.php
===================================================================
--- trunk/property/inc/class.uis_agreement.inc.php 2008-02-10 09:33:46 UTC
(rev 18481)
+++ trunk/property/inc/class.uis_agreement.inc.php 2008-02-14 11:54:40 UTC
(rev 18482)
@@ -361,6 +361,7 @@
//_debug_array($member_of_data);
$data = array
(
+ 'menu'
=> $this->bocommon->get_menu(),
'lang_columns'
=> lang('columns'),
'link_columns'
=> $GLOBALS['phpgw']->link('/index.php',$link_columns),
'lang_columns_help'
=> lang('Choose columns'),
Modified: trunk/property/inc/class.uistandard_2.inc.php
===================================================================
--- trunk/property/inc/class.uistandard_2.inc.php 2008-02-10 09:33:46 UTC
(rev 18481)
+++ trunk/property/inc/class.uistandard_2.inc.php 2008-02-14 11:54:40 UTC
(rev 18482)
@@ -55,7 +55,7 @@
$GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
$type = phpgw::get_var('type');
- $GLOBALS['phpgw_info']['flags']['menu_selection'] =
"admin::property::{$type}";
+ $GLOBALS['phpgw_info']['flags']['menu_selection'] =
phpgw::get_var('menu_selection');
// $this->currentapp =
$GLOBALS['phpgw_info']['flags']['currentapp'];
$this->nextmatchs =
CreateObject('phpgwapi.nextmatchs');
@@ -107,15 +107,13 @@
while (is_array($standard_list) && list(,$standard) =
each($standard_list))
{
- $words = split(' ',$standard['descr']);
- $first = "$words[0] $words[1] $words[2]
$words[3]";
$content[] = array
(
'id'
=> $standard['id'],
- 'first'
=> $first,
- 'link_edit'
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
'property.uistandard_2.edit', 'id'=> $standard['id'], 'type'=> $type)),
- 'link_delete'
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
'property.uistandard_2.delete', 'id'=> $standard['id'], 'type'=> $type)),
+ 'first'
=> $standard['descr'],
+ 'link_edit'
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
'property.uistandard_2.edit', 'id'=> $standard['id'], 'type'=> $type,
'menu_selection' => $GLOBALS['phpgw_info']['flags']['menu_selection'])),
+ 'link_delete'
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
'property.uistandard_2.delete', 'id'=> $standard['id'], 'type'=> $type,
'menu_selection' => $GLOBALS['phpgw_info']['flags']['menu_selection'])),
'lang_view_standardtext'
=> lang('view the standard'),
'lang_edit_standardtext'
=> lang('edit the standard'),
'lang_delete_standardtext'
=> lang('delete the standard'),
@@ -139,7 +137,9 @@
'var' => 'id',
'order' => $this->order,
'extra' => array('menuaction' => 'property.uistandard_2.index',
-
'type' =>$type)
+
'type' =>$type,
+
'menu_selection' =>
$GLOBALS['phpgw_info']['flags']['menu_selection']
+
)
)),
'lang_id' => lang('standard id'),
);
@@ -148,7 +148,7 @@
(
'lang_add' => lang('add'),
'lang_add_standardtext' => lang('add a
standard'),
- 'add_action' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
'property.uistandard_2.edit', 'type'=> $type)),
+ 'add_action' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
'property.uistandard_2.edit', 'type'=> $type, 'menu_selection' =>
$GLOBALS['phpgw_info']['flags']['menu_selection'])),
'lang_done' => lang('done'),
'lang_done_standardtext'=> lang('back to
admin'),
'done_action' =>
$GLOBALS['phpgw']->link('/admin/index.php')
@@ -237,7 +237,8 @@
(
'menuaction' => 'property.uistandard_2.edit',
'id' => $id,
- 'type' => $type
+ 'type' => $type,
+ 'menu_selection' =>
$GLOBALS['phpgw_info']['flags']['menu_selection']
);
//_debug_array($link_data);
$msgbox_data = $this->bocommon->msgbox_data($receipt);
@@ -246,7 +247,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'=>
'property.uistandard_2.index', 'type'=> $type)),
+ 'done_action'
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
'property.uistandard_2.index', 'type'=> $type, 'menu_selection' =>
$GLOBALS['phpgw_info']['flags']['menu_selection'])),
'lang_id'
=> lang('standard ID'),
'lang_name'
=> lang('name'),
'lang_descr'
=> lang('Descr'),
@@ -286,7 +287,8 @@
$link_data = array
(
'menuaction' => 'property.uistandard_2.index',
- 'type' => $type
+ 'type' => $type,
+ 'menu_selection' =>
$GLOBALS['phpgw_info']['flags']['menu_selection']
);
if (phpgw::get_var('confirm', 'bool', 'POST'))
@@ -300,7 +302,7 @@
$data = array
(
'done_action' =>
$GLOBALS['phpgw']->link('/index.php',$link_data),
- 'delete_action' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
'property.uistandard_2.delete', 'id'=> $id, 'type'=>$type)),
+ 'delete_action' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
'property.uistandard_2.delete', 'id'=> $id, 'type'=>$type, 'menu_selection' =>
$GLOBALS['phpgw_info']['flags']['menu_selection'])),
'lang_confirm_msg' => lang('do you
really want to delete this entry'),
'lang_yes' => lang('yes'),
'lang_yes_standardtext' => lang('Delete
the entry'),
Modified: trunk/property/inc/class.uistandard_3.inc.php
===================================================================
--- trunk/property/inc/class.uistandard_3.inc.php 2008-02-10 09:33:46 UTC
(rev 18481)
+++ trunk/property/inc/class.uistandard_3.inc.php 2008-02-14 11:54:40 UTC
(rev 18482)
@@ -53,7 +53,7 @@
function property_uistandard_3()
{
$GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
- // $this->currentapp =
$GLOBALS['phpgw_info']['flags']['currentapp'];
+
$this->nextmatchs =
CreateObject('phpgwapi.nextmatchs');
$this->account =
$GLOBALS['phpgw_info']['user']['account_id'];
$this->bo =
CreateObject('property.bostandard_3',True);
@@ -72,6 +72,8 @@
$this->sort =
$this->bo->sort;
$this->order =
$this->bo->order;
$this->allrows =
$this->bo->allrows;
+ $type = phpgw::get_var('type');
+ $GLOBALS['phpgw_info']['flags']['menu_selection'] =
"admin::property::{$type}";
}
function save_sessiondata()
@@ -103,14 +105,12 @@
while (is_array($standard_list) && list(,$standard) =
each($standard_list))
{
- $words = split(' ',$standard['descr']);
- $first = "$words[0] $words[1] $words[2]
$words[3]";
$content[] = array
(
'id' =>
$standard['id'],
'num' =>
$standard['num'],
- 'first' =>
$first,
+ 'first' =>
$standard['descr'],
'link_edit' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
'property.uistandard_3.edit', 'id'=> $standard['id'], 'type'=> $type)),
'link_delete' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
'property.uistandard_3.delete', 'id'=> $standard['id'], 'type'=> $type)),
'lang_view_standardtext' =>
lang('view the standard'),
Modified: trunk/property/inc/class.uitemplate.inc.php
===================================================================
--- trunk/property/inc/class.uitemplate.inc.php 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/property/inc/class.uitemplate.inc.php 2008-02-14 11:54:40 UTC (rev
18482)
@@ -203,6 +203,7 @@
$data = array
(
+ 'menu'
=> $this->bocommon->get_menu(),
'form_action' =>
$GLOBALS['phpgw']->link('/index.php',$link_data),
'lang_add_statustext' => lang('Add
the selected items'),
'lang_add' => lang('Add'),
Modified: trunk/property/inc/class.uitenant_claim.inc.php
===================================================================
--- trunk/property/inc/class.uitenant_claim.inc.php 2008-02-10 09:33:46 UTC
(rev 18481)
+++ trunk/property/inc/class.uitenant_claim.inc.php 2008-02-14 11:54:40 UTC
(rev 18482)
@@ -256,6 +256,7 @@
$data = array
(
+ 'menu'
=> $this->bocommon->get_menu(),
'msgbox_data' =>
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
'allow_allrows' => true,
'allrows' =>
$this->allrows,
Modified: trunk/property/inc/class.uitts.inc.php
===================================================================
--- trunk/property/inc/class.uitts.inc.php 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/property/inc/class.uitts.inc.php 2008-02-14 11:54:40 UTC (rev
18482)
@@ -552,6 +552,7 @@
$data = array
(
+ 'menu'
=> $this->bocommon->get_menu(),
'group_filters'
=> $pref_group_filters,
'lang_excel'
=> 'excel',
'link_excel'
=> $GLOBALS['phpgw']->link('/index.php',$link_excel),
Modified: trunk/property/inc/class.uiworkorder.inc.php
===================================================================
--- trunk/property/inc/class.uiworkorder.inc.php 2008-02-10 09:33:46 UTC
(rev 18481)
+++ trunk/property/inc/class.uiworkorder.inc.php 2008-02-14 11:54:40 UTC
(rev 18482)
@@ -423,6 +423,7 @@
$data = array
(
+ 'menu'
=> $this->bocommon->get_menu(),
'group_filters'
=>
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['group_filters'])?$GLOBALS['phpgw_info']['user']['preferences']['property']['group_filters']:'',
'lang_excel'
=> 'excel',
'link_excel'
=> $GLOBALS['phpgw']->link('/index.php',$link_excel),
Modified: trunk/property/inc/hook_settings.inc.php
===================================================================
--- trunk/property/inc/hook_settings.inc.php 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/property/inc/hook_settings.inc.php 2008-02-14 11:54:40 UTC (rev
18482)
@@ -131,7 +131,7 @@
'project' => lang('Project'),
'tts' => lang('Ticket'),
'invoice' => lang('Invoice'),
- 'document'=> lang(Document)
+ 'document'=> lang('Document')
);
create_select_box('Default start
page','default_start_page',$default_start_page,'Select your start-submodule');
@@ -201,4 +201,4 @@
create_input_box('With of textarea','textareacols','With of textarea in
forms');
create_input_box('Height of textarea','textarearows','Height of
textarea in forms');
-
+ create_select_box('show horisontal
menues','horisontal_menus',array('no' => 'No','yes' => 'Yes'),'Horisontal
menues are shown in top of page');
Modified: trunk/property/setup/tables_update.inc.php
===================================================================
--- trunk/property/setup/tables_update.inc.php 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/property/setup/tables_update.inc.php 2008-02-14 11:54:40 UTC (rev
18482)
@@ -18,6 +18,7 @@
$test[] = '0.9.17.500';
function property_upgrade0_9_17_500()
{
+ $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
$GLOBALS['phpgw_setup']->oProc->CreateTable(
'fm_origin', array(
'fd' => array(
@@ -90,9 +91,12 @@
$GLOBALS['phpgw_setup']->oProc->DropTable('fm_project_origin');
$GLOBALS['phpgw_setup']->oProc->DropTable('fm_entity_origin');
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
$GLOBALS['setup_info']['property']['currentver'] = '0.9.17.501';
return $GLOBALS['setup_info']['property']['currentver'];
}
+ }
/**
* Update property version from 0.9.17.501 to 0.9.17.502
@@ -101,10 +105,14 @@
$test[] = '0.9.17.501';
function property_upgrade0_9_17_501()
{
+ $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
$GLOBALS['phpgw_setup']->oProc->AlterColumn('fm_request','descr',array('type'
=> 'text','nullable' => True));
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
$GLOBALS['setup_info']['property']['currentver'] = '0.9.17.502';
return $GLOBALS['setup_info']['property']['currentver'];
}
+ }
/**
* Update property version from 0.9.17.502 to 0.9.17.503
@@ -113,6 +121,7 @@
$test[] = '0.9.17.502';
function property_upgrade0_9_17_502()
{
+ $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
$GLOBALS['phpgw_setup']->oProc->AlterColumn('fm_acl_location','id',array('type'
=> 'varchar','precision' => '20','nullable' => False));
$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO
fm_acl_location (id, descr) VALUES ('.tenant_claim', 'Tenant claim')");
@@ -155,9 +164,12 @@
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_workorder','claim_issued',array('type'
=> 'int','precision' => 2,'nullable' => True));
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
$GLOBALS['setup_info']['property']['currentver'] = '0.9.17.503';
return $GLOBALS['setup_info']['property']['currentver'];
}
+ }
/**
* Update property version from 0.9.17.503 to 0.9.17.504
@@ -166,6 +178,7 @@
$test[] = '0.9.17.503';
function property_upgrade0_9_17_503()
{
+ $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_location_type','pk',array('type'
=> 'text','nullable' => True));
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_location_type','ix',array('type'
=> 'text','nullable' => True));
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_location_type','uc',array('type'
=> 'text','nullable' => True));
@@ -338,9 +351,12 @@
unset($default_attrib);
}
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
$GLOBALS['setup_info']['property']['currentver'] = '0.9.17.504';
return $GLOBALS['setup_info']['property']['currentver'];
}
+ }
/**
* Update property version from 0.9.17.504 to 0.9.17.505
*/
@@ -348,6 +364,7 @@
$test[] = '0.9.17.504';
function property_upgrade0_9_17_504()
{
+ $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
$GLOBALS['phpgw_setup']->oProc->query("UPDATE
fm_location_attrib SET custom = 1, input_text = 'Remark', statustext='Remark'
WHERE column_name = 'remark'");
$GLOBALS['phpgw_setup']->oProc->query("UPDATE
fm_location_attrib SET input_text = column_name, statustext = column_name WHERE
custom IS NULL");
@@ -484,9 +501,12 @@
unset($fd);
}
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
$GLOBALS['setup_info']['property']['currentver'] = '0.9.17.505';
return $GLOBALS['setup_info']['property']['currentver'];
}
+ }
/**
* Update property version from 0.9.17.505 to 0.9.17.506
@@ -495,6 +515,7 @@
$test[] = '0.9.17.505';
function property_upgrade0_9_17_505()
{
+ $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_wo_hours','category',array('type'
=> 'int','precision' => 4,'nullable' => True));
$GLOBALS['phpgw_setup']->oProc->CreateTable(
@@ -510,9 +531,12 @@
)
);
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
$GLOBALS['setup_info']['property']['currentver'] = '0.9.17.506';
return $GLOBALS['setup_info']['property']['currentver'];
}
+ }
/**
* Update property version from 0.9.17.506 to 0.9.17.507
*/
@@ -520,6 +544,7 @@
$test[] = '0.9.17.506';
function property_upgrade0_9_17_506()
{
+ $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
$GLOBALS['phpgw_setup']->oProc->AlterColumn('fm_request','d_safety',array('type'
=> 'int','precision' => '4','default' => '0','nullable' => True));
$GLOBALS['phpgw_setup']->oProc->AlterColumn('fm_request','d_aesthetics',array('type'
=> 'int','precision' => '4','default' => '0','nullable' => True));
$GLOBALS['phpgw_setup']->oProc->AlterColumn('fm_request','d_indoor_climate',array('type'
=> 'int','precision' => '4','default' => '0','nullable' => True));
@@ -564,9 +589,12 @@
$GLOBALS['phpgw_setup']->oProc->query("UPDATE fm_workorder SET
act_mtrl_cost = 0 WHERE act_mtrl_cost IS NULL ");
$GLOBALS['phpgw_setup']->oProc->query("UPDATE fm_workorder SET
act_vendor_cost = 0 WHERE act_vendor_cost IS NULL ");
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
$GLOBALS['setup_info']['property']['currentver'] = '0.9.17.507';
return $GLOBALS['setup_info']['property']['currentver'];
}
+ }
/**
* Update property version from 0.9.17.507 to 0.9.17.508
*/
@@ -574,6 +602,7 @@
$test[] = '0.9.17.507';
function property_upgrade0_9_17_507()
{
+ $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
$GLOBALS['phpgw_setup']->oProc->CreateTable(
'fm_request_condition_type', array(
'fd' => array(
@@ -721,9 +750,12 @@
$GLOBALS['phpgw_setup']->oProc->DropTable('fm_request_priority_key');
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
$GLOBALS['setup_info']['property']['currentver'] = '0.9.17.508';
return $GLOBALS['setup_info']['property']['currentver'];
}
+ }
/**
* Update property version from 0.9.17.508 to 0.9.17.509
@@ -732,6 +764,7 @@
$test[] = '0.9.17.508';
function property_upgrade0_9_17_508()
{
+ $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
$GLOBALS['phpgw_setup']->oProc->CreateTable(
'fm_custom_function', array(
'fd' => array(
@@ -749,9 +782,12 @@
)
);
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
$GLOBALS['setup_info']['property']['currentver'] = '0.9.17.509';
return $GLOBALS['setup_info']['property']['currentver'];
}
+ }
/**
* Update property version from 0.9.17.509 to 0.9.17.510
@@ -760,14 +796,18 @@
$test[] = '0.9.17.509';
function property_upgrade0_9_17_509()
{
+ $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_ecobilag','item_type',array('type'
=> 'int','precision' => 4,'nullable' => True));
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_ecobilag','item_id',array('type'
=> 'varchar','precision' => 20,'nullable' => True));
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_ecobilagoverf','item_type',array('type'
=> 'int','precision' => 4,'nullable' => True));
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_ecobilagoverf','item_id',array('type'
=> 'varchar','precision' => 20,'nullable' => True));
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
$GLOBALS['setup_info']['property']['currentver'] = '0.9.17.510';
return $GLOBALS['setup_info']['property']['currentver'];
}
+ }
/**
* Update property version from 0.9.17.510 to 0.9.17.511
@@ -798,10 +838,12 @@
$GLOBALS['phpgw_setup']->oProc->RenameColumn('fm_custom','sql','sql_text');
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
$GLOBALS['setup_info']['property']['currentver'] = '0.9.17.511';
- $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit();
return $GLOBALS['setup_info']['property']['currentver'];
}
+ }
/**
* Update property version from 0.9.17.511 to 0.9.17.512
@@ -833,10 +875,12 @@
)
);
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
$GLOBALS['setup_info']['property']['currentver'] = '0.9.17.512';
- $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit();
return $GLOBALS['setup_info']['property']['currentver'];
}
+ }
/**
* Update property version from 0.9.17.512 to 0.9.17.513
@@ -1022,10 +1066,12 @@
$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO
fm_acl_location (id, descr) VALUES ('.r_agreement', 'Rental agreement')");
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
$GLOBALS['setup_info']['property']['currentver'] = '0.9.17.513';
- $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit();
return $GLOBALS['setup_info']['property']['currentver'];
}
+ }
/**
* Update property version from 0.9.17.513 to 0.9.17.514
@@ -1092,11 +1138,12 @@
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_wo_hours','cat_per_cent',array('type'
=> 'int','precision' => 4,'nullable' => True));
- $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit();
-
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
$GLOBALS['setup_info']['property']['currentver'] = '0.9.17.516';
return $GLOBALS['setup_info']['property']['currentver'];
}
+ }
/**
* Update property version from 0.9.17.516 to 0.9.17.517
@@ -1186,11 +1233,12 @@
)
);
- $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit();
-
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
$GLOBALS['setup_info']['property']['currentver'] = '0.9.17.517';
return $GLOBALS['setup_info']['property']['currentver'];
}
+ }
/**
@@ -1246,10 +1294,12 @@
}
- $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit();
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
$GLOBALS['setup_info']['property']['currentver'] = '0.9.17.518';
return $GLOBALS['setup_info']['property']['currentver'];
}
+ }
/**
* Update property version from 0.9.17.518 to 0.9.17.519
@@ -1262,10 +1312,12 @@
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_template_hours','entry_date',array('type'
=> 'int','precision' => 4,'nullable' => True));
- $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit();
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
$GLOBALS['setup_info']['property']['currentver'] = '0.9.17.519';
return $GLOBALS['setup_info']['property']['currentver'];
}
+ }
/**
@@ -1280,10 +1332,12 @@
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_request','start_date',array('type'
=> 'int','precision' => 4,'nullable' => True));
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_request','end_date',array('type'
=> 'int','precision' => 4,'nullable' => True));
- $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit();
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
$GLOBALS['setup_info']['property']['currentver'] = '0.9.17.520';
return $GLOBALS['setup_info']['property']['currentver'];
}
+ }
/**
@@ -1297,10 +1351,12 @@
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_budget_basis','distribute_year',array('type'
=> 'text','nullable' => True));
- $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit();
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
$GLOBALS['setup_info']['property']['currentver'] = '0.9.17.521';
return $GLOBALS['setup_info']['property']['currentver'];
}
+ }
/**
* Update property version from 0.9.17.521 to 0.9.17.522
@@ -1309,7 +1365,7 @@
$test[] = '0.9.17.521';
function property_upgrade0_9_17_521()
{
- $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+// $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
transaction have problem with nested db-objects
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_workorder','combined_cost',
array('type' => 'decimal','precision' => '20','scale' => '2','nullable' =>
True,'default' => '0.00'));
@@ -1342,10 +1398,12 @@
}
}
- $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit();
+// if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
$GLOBALS['setup_info']['property']['currentver'] = '0.9.17.522';
return $GLOBALS['setup_info']['property']['currentver'];
}
+ }
/**
* Update property version from 0.9.17.522 to 0.9.17.523
@@ -1358,10 +1416,12 @@
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_workorder','paid', array('type'
=> 'int','precision' => '2','nullable' => True,'default' => '1'));
- $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit();
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
$GLOBALS['setup_info']['property']['currentver'] = '0.9.17.523';
return $GLOBALS['setup_info']['property']['currentver'];
}
+ }
/**
* Update property version from 0.9.17.523 to 0.9.17.524
@@ -1374,10 +1434,12 @@
$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO
fm_acl_location (id, descr) VALUES ('.admin', 'Admin')");
$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO
fm_acl_location (id, descr) VALUES ('.admin.entity', 'Admin entity')");
$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO
fm_acl_location (id, descr) VALUES ('.admin.location', 'Admin location')");
- $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit();
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
$GLOBALS['setup_info']['property']['currentver'] = '0.9.17.524';
return $GLOBALS['setup_info']['property']['currentver'];
}
+ }
/**
* Update property version from 0.9.17.524 to 0.9.17.525
@@ -1386,7 +1448,7 @@
$test[] = '0.9.17.524';
function property_upgrade0_9_17_524()
{
- $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+// $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
transaction have problem with nested db-objects
$GLOBALS['phpgw_setup']->oProc->query("delete from phpgw_acl
where acl_appname = 'property' AND acl_location !='run' ");
@@ -1425,10 +1487,12 @@
$GLOBALS['phpgw_setup']->oProc->DropTable('fm_acl_location');
$GLOBALS['phpgw_setup']->oProc->DropTable('fm_acl2');
- $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit();
+// if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
$GLOBALS['setup_info']['property']['currentver'] = '0.9.17.525';
return $GLOBALS['setup_info']['property']['currentver'];
}
+ }
/**
* Update property version from 0.9.17.525 to 0.9.17.526
@@ -1442,10 +1506,12 @@
$GLOBALS['phpgw_setup']->oProc->AlterColumn('fm_vendor_attribute','input_text',array('type'
=> 'varchar','precision' => '50','nullable' => False));
$GLOBALS['phpgw_setup']->oProc->AlterColumn('fm_location_attrib','input_text',array('type'
=> 'varchar','precision' => '50','nullable' => False));
$GLOBALS['phpgw_setup']->oProc->AlterColumn('fm_owner_attribute','input_text',array('type'
=> 'varchar','precision' => '50','nullable' => False));
- $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit();
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
$GLOBALS['setup_info']['property']['currentver'] = '0.9.17.526';
return $GLOBALS['setup_info']['property']['currentver'];
}
+ }
/**
* Update property version from 0.9.17.526 to 0.9.17.527
@@ -1458,11 +1524,12 @@
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_entity_attribute','disabled',
array('type' => 'int','precision' => '4','nullable' => True));
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_entity_attribute','helpmsg',
array('type' => 'text','nullable' => True));
-
- $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit();
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
$GLOBALS['setup_info']['property']['currentver'] = '0.9.17.527';
return $GLOBALS['setup_info']['property']['currentver'];
}
+ }
/**
* Update property version from 0.9.17.527 to 0.9.17.528
@@ -1496,10 +1563,12 @@
$GLOBALS['phpgw_setup']->oProc->query("UPDATE
fm_location_attrib set precision_ = '6' where column_name = 'loc1'");
- $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit();
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
$GLOBALS['setup_info']['property']['currentver'] = '0.9.17.528';
return $GLOBALS['setup_info']['property']['currentver'];
}
+ }
/**
@@ -1514,10 +1583,12 @@
$GLOBALS['phpgw_setup']->oProc->query("UPDATE
phpgw_acl_location set id = '.agreement', descr = 'Agreement' where id =
'.pricebook' AND appname = 'property'");
$GLOBALS['phpgw_setup']->oProc->query("UPDATE phpgw_acl set
acl_location = '.agreement' where acl_location = '.pricebook' AND acl_appname =
'property'");
- $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit();
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
$GLOBALS['setup_info']['property']['currentver'] = '0.9.17.529';
return $GLOBALS['setup_info']['property']['currentver'];
}
+ }
/**
* Update property version from 0.9.17.529 to 0.9.17.530
@@ -1534,10 +1605,12 @@
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_tenant','account_pwd',
array('type' => 'varchar','precision' => '32','nullable' => True));
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_tenant','account_status',
array('type' => 'char','precision' => '1','nullable' => True,'default' => 'A'));
- $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit();
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
$GLOBALS['setup_info']['property']['currentver'] = '0.9.17.530';
return $GLOBALS['setup_info']['property']['currentver'];
}
+ }
/**
* Update property version from 0.9.17.530 to 0.9.17.531
@@ -1618,10 +1691,12 @@
unset($id);
unset($attrib_sort);
- $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit();
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
$GLOBALS['setup_info']['property']['currentver'] = '0.9.17.531';
return $GLOBALS['setup_info']['property']['currentver'];
}
+ }
/**
* Update property version from 0.9.17.531 to 0.9.17.532
@@ -1648,10 +1723,12 @@
$GLOBALS['phpgw_setup']->oProc->query("DELETE FROM phpgw_acl
WHERE acl_appname = 'property' AND acl_location = '.vendor' AND acl_grantor IS
NOT NULL");
$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl
(acl_appname, acl_location, acl_account, acl_rights, acl_grantor, acl_type)
VALUES ('property', '.vendor', '1', '1', '6', '0')");
- $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit();
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
$GLOBALS['setup_info']['property']['currentver'] = '0.9.17.532';
return $GLOBALS['setup_info']['property']['currentver'];
}
+ }
/**
* Update property version from 0.9.17.532 to 0.9.17.533
@@ -1662,10 +1739,12 @@
{
$GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
$GLOBALS['phpgw_setup']->oProc->AlterColumn('fm_template_hours','hours_descr',array('type'
=> 'text','nullable' => True));
- $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit();
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
$GLOBALS['setup_info']['property']['currentver'] = '0.9.17.533';
return $GLOBALS['setup_info']['property']['currentver'];
}
+ }
/**
* Update property version from 0.9.17.533 to 0.9.17.534
@@ -1682,10 +1761,12 @@
$GLOBALS['phpgw_setup']->oProc->query("UPDATE fm_location_type
set list_info = '" . 'a:2:{i:1;s:1:"1";i:2;s:1:"2";}' ."' WHERE id = '2'");
$GLOBALS['phpgw_setup']->oProc->query("UPDATE fm_location_type
set list_info = '" . 'a:3:{i:1;s:1:"1";i:2;s:1:"2";i:3;s:1:"3";}' ."' WHERE id
= '3'");
$GLOBALS['phpgw_setup']->oProc->query("UPDATE fm_location_type
set list_info = '" . 'a:1:{i:1;s:1:"1";}' ."' WHERE id = '4'");
- $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit();
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
$GLOBALS['setup_info']['property']['currentver'] = '0.9.17.534';
return $GLOBALS['setup_info']['property']['currentver'];
}
+ }
/**
* Update property version from 0.9.17.534 to 0.9.17.535
@@ -1699,10 +1780,12 @@
$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO
phpgw_acl_location (appname, id, descr) VALUES ('property', '.location.2',
'Building')");
$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO
phpgw_acl_location (appname, id, descr) VALUES ('property', '.location.3',
'Entrance')");
$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO
phpgw_acl_location (appname, id, descr) VALUES ('property', '.location.4',
'Apartment')");
- $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit();
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
$GLOBALS['setup_info']['property']['currentver'] = '0.9.17.535';
return $GLOBALS['setup_info']['property']['currentver'];
}
+ }
/**
Modified: trunk/property/templates/base/actor.xsl
===================================================================
--- trunk/property/templates/base/actor.xsl 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/property/templates/base/actor.xsl 2008-02-14 11:54:40 UTC (rev
18482)
@@ -20,6 +20,7 @@
</xsl:template>
<xsl:template match="list">
+ <xsl:apply-templates select="menu"/>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<xsl:choose>
<xsl:when test="msgbox_data != ''">
Modified: trunk/property/templates/base/admin_entity.xsl
===================================================================
--- trunk/property/templates/base/admin_entity.xsl 2008-02-10 09:33:46 UTC
(rev 18481)
+++ trunk/property/templates/base/admin_entity.xsl 2008-02-14 11:54:40 UTC
(rev 18482)
@@ -34,6 +34,7 @@
<xsl:template match="list">
+ <xsl:apply-templates select="menu"/>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<tr>
<td align="right">
@@ -122,6 +123,7 @@
</xsl:template>
<xsl:template match="list_category">
+ <xsl:apply-templates select="menu"/>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<tr>
<td align="right">
@@ -232,6 +234,7 @@
<xsl:template match="list_config">
+ <xsl:apply-templates select="menu"/>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<tr>
<td align="right">
Modified: trunk/property/templates/base/admin_location.xsl
===================================================================
--- trunk/property/templates/base/admin_location.xsl 2008-02-10 09:33:46 UTC
(rev 18481)
+++ trunk/property/templates/base/admin_location.xsl 2008-02-14 11:54:40 UTC
(rev 18482)
@@ -23,6 +23,7 @@
</xsl:choose>
</xsl:template>
<xsl:template match="list">
+ <xsl:apply-templates select="menu"/>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<xsl:choose>
<xsl:when test="msgbox_data != ''">
@@ -130,6 +131,7 @@
<xsl:template match="list_config">
+ <xsl:apply-templates select="menu"/>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<tr>
<td align="right">
Modified: trunk/property/templates/base/agreement.xsl
===================================================================
--- trunk/property/templates/base/agreement.xsl 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/property/templates/base/agreement.xsl 2008-02-14 11:54:40 UTC (rev
18482)
@@ -29,6 +29,7 @@
</xsl:template>
<xsl:template match="list">
+ <xsl:apply-templates select="menu"/>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<xsl:choose>
<xsl:when test="msgbox_data != ''">
Modified: trunk/property/templates/base/alarm.xsl
===================================================================
--- trunk/property/templates/base/alarm.xsl 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/property/templates/base/alarm.xsl 2008-02-14 11:54:40 UTC (rev
18482)
@@ -17,6 +17,7 @@
</xsl:template>
<xsl:template match="list">
+ <xsl:apply-templates select="menu"/>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<xsl:choose>
<xsl:when test="msgbox_data != ''">
@@ -426,6 +427,7 @@
<xsl:template match="list_alarm">
+ <xsl:apply-templates select="menu"/>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<xsl:choose>
<xsl:when test="msgbox_data != ''">
Modified: trunk/property/templates/base/b_account.xsl
===================================================================
--- trunk/property/templates/base/b_account.xsl 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/property/templates/base/b_account.xsl 2008-02-14 11:54:40 UTC (rev
18482)
@@ -12,6 +12,7 @@
</xsl:template>
<xsl:template match="list">
+ <xsl:apply-templates select="menu"/>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<tr>
<td align="right">
Modified: trunk/property/templates/base/budget.xsl
===================================================================
--- trunk/property/templates/base/budget.xsl 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/property/templates/base/budget.xsl 2008-02-14 11:54:40 UTC (rev
18482)
@@ -16,6 +16,7 @@
</xsl:template>
<xsl:template match="list_basis">
+ <xsl:apply-templates select="menu"/>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<xsl:choose>
<xsl:when test="msgbox_data != ''">
@@ -157,6 +158,7 @@
<xsl:template match="list">
+ <xsl:apply-templates select="menu"/>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<xsl:choose>
<xsl:when test="msgbox_data != ''">
@@ -770,6 +772,7 @@
<xsl:template match="list_obligations">
+ <xsl:apply-templates select="menu"/>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<xsl:choose>
<xsl:when test="msgbox_data != ''">
Modified: trunk/property/templates/base/custom.xsl
===================================================================
--- trunk/property/templates/base/custom.xsl 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/property/templates/base/custom.xsl 2008-02-14 11:54:40 UTC (rev
18482)
@@ -14,6 +14,7 @@
</xsl:template>
<xsl:template match="list">
+ <xsl:apply-templates select="menu"/>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<xsl:choose>
<xsl:when test="msgbox_data != ''">
Modified: trunk/property/templates/base/document.xsl
===================================================================
--- trunk/property/templates/base/document.xsl 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/property/templates/base/document.xsl 2008-02-14 11:54:40 UTC (rev
18482)
@@ -20,6 +20,7 @@
<xsl:template match="list">
+ <xsl:apply-templates select="menu"/>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<tr>
<td align="left">
@@ -129,6 +130,7 @@
<xsl:template match="list_document">
+ <xsl:apply-templates select="menu"/>
<div align="left">
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<xsl:choose>
Modified: trunk/property/templates/base/entity.xsl
===================================================================
--- trunk/property/templates/base/entity.xsl 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/property/templates/base/entity.xsl 2008-02-14 11:54:40 UTC (rev
18482)
@@ -18,6 +18,7 @@
</xsl:template>
<xsl:template match="list">
+ <xsl:apply-templates select="menu"/>
<xsl:choose>
<xsl:when test="msgbox_data != ''">
<table align = "center">
@@ -689,6 +690,7 @@
<!-- emtpy -->
<xsl:template match="empty">
+ <xsl:apply-templates select="menu"/>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<tr>
<td>
Modified: trunk/property/templates/base/gab.xsl
===================================================================
--- trunk/property/templates/base/gab.xsl 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/property/templates/base/gab.xsl 2008-02-14 11:54:40 UTC (rev
18482)
@@ -155,6 +155,7 @@
</xsl:template>
<xsl:template match="list_gab">
+ <xsl:apply-templates select="menu"/>
<div align="center">
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<xsl:variable name="select_url"><xsl:value-of
select="select_action"/></xsl:variable>
@@ -310,6 +311,7 @@
</xsl:template>
<xsl:template match="list_gab_detail">
+ <xsl:apply-templates select="menu"/>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<tr>
<td class="th_text" width="5%" align="left">
Modified: trunk/property/templates/base/ifc.xsl
===================================================================
--- trunk/property/templates/base/ifc.xsl 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/property/templates/base/ifc.xsl 2008-02-14 11:54:40 UTC (rev
18482)
@@ -12,6 +12,12 @@
<!-- import -->
<xsl:template match="import">
+
+ <xsl:choose>
+ <xsl:when test="links !=''">
+ <xsl:apply-templates select="menu"/>
+ </xsl:when>
+ </xsl:choose>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<xsl:choose>
<xsl:when test="msgbox_data != ''">
Modified: trunk/property/templates/base/investment.xsl
===================================================================
--- trunk/property/templates/base/investment.xsl 2008-02-10 09:33:46 UTC
(rev 18481)
+++ trunk/property/templates/base/investment.xsl 2008-02-14 11:54:40 UTC
(rev 18482)
@@ -15,6 +15,7 @@
</xsl:template>
<xsl:template match="list">
+ <xsl:apply-templates select="menu"/>
<xsl:variable name="form_action"><xsl:value-of
select="form_action"/></xsl:variable>
<form method="post" name="form_search" action="{$form_action}">
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
@@ -302,6 +303,7 @@
<xsl:template match="history">
+ <xsl:apply-templates select="menu"/>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<xsl:choose>
<xsl:when test="msgbox_data != ''">
Modified: trunk/property/templates/base/invoice.xsl
===================================================================
--- trunk/property/templates/base/invoice.xsl 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/property/templates/base/invoice.xsl 2008-02-14 11:54:40 UTC (rev
18482)
@@ -125,6 +125,7 @@
<!-- list_voucher -->
<xsl:template match="list_voucher">
+ <xsl:apply-templates select="menu"/>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<xsl:choose>
<xsl:when test="msgbox_data != ''">
@@ -573,6 +574,7 @@
}
</script>
+ <xsl:apply-templates select="menu"/>
<xsl:variable name="form_action"><xsl:value-of
select="link_url"/></xsl:variable>
<div align="left">
<form method="post" name="form" action="{$form_action}">
@@ -861,6 +863,7 @@
}
</script>
+ <xsl:apply-templates select="menu"/>
<xsl:variable name="form_action"><xsl:value-of
select="form_action"/></xsl:variable>
<div align="left">
<form method="post" name="form" action="{$form_action}">
@@ -1262,6 +1265,7 @@
}
</script>
+ <xsl:apply-templates select="menu"/>
<div align="left">
<table cellpadding="2" cellspacing="2" width="80%"
align="center">
<tr>
@@ -1586,6 +1590,7 @@
}
</script>
+ <xsl:apply-templates select="menu"/>
<div align="left">
<table cellpadding="2" cellspacing="2" width="80%"
align="center">
<tr>
@@ -2018,6 +2023,7 @@
<!-- export -->
<xsl:template match="export">
+ <xsl:apply-templates select="menu"/>
<div align="left">
<table cellpadding="2" cellspacing="2" width="80%"
align="center">
<xsl:choose>
@@ -2117,6 +2123,7 @@
<!-- rollback -->
<xsl:template match="rollback">
+ <xsl:apply-templates select="menu"/>
<div align="left">
<table cellpadding="2" cellspacing="2" width="80%"
align="center">
<xsl:choose>
@@ -2212,6 +2219,7 @@
<!--list_invoice_sub-->
<xsl:template match="list_invoice_sub">
+ <xsl:apply-templates select="menu"/>
<table width="80%" cellpadding="2" cellspacing="2"
align="center">
<xsl:choose>
<xsl:when test="msgbox_data != ''">
Modified: trunk/property/templates/base/location.xsl
===================================================================
--- trunk/property/templates/base/location.xsl 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/property/templates/base/location.xsl 2008-02-14 11:54:40 UTC (rev
18482)
@@ -35,6 +35,11 @@
</xsl:when>
</xsl:choose>
+ <xsl:choose>
+ <xsl:when test="lookup=''">
+ <xsl:apply-templates select="menu"/>
+ </xsl:when>
+ </xsl:choose>
<table width="100%" cellpadding="0" cellspacing="1"
align="center">
<tr>
<td>
@@ -773,6 +778,7 @@
<!-- stop -->
<xsl:template match="stop">
+ <xsl:apply-templates select="menu"/>
<table cellpadding="2" cellspacing="2" align="center">
<xsl:choose>
<xsl:when test="msgbox_data != ''">
@@ -799,6 +805,7 @@
<xsl:template match="summary">
+ <xsl:apply-templates select="menu"/>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<tr>
<td>
Added: trunk/property/templates/base/menu.xsl
===================================================================
--- trunk/property/templates/base/menu.xsl (rev 0)
+++ trunk/property/templates/base/menu.xsl 2008-02-14 11:54:40 UTC (rev
18482)
@@ -0,0 +1,70 @@
+ <xsl:template match="menu">
+ <table width="100%" align="center" id="legacy-menu">
+ <tr >
+ <xsl:attribute name="class">
+ <xsl:text>row_on</xsl:text>
+ </xsl:attribute>
+ <td align="left">
+ <xsl:for-each select="navigation" >
+ <xsl:text> </xsl:text>
+ <xsl:choose>
+ <xsl:when test="this=1">
+ <a
href="{url}"><b><xsl:text>[</xsl:text><xsl:value-of
select="text"/><xsl:text>]</xsl:text></b></a>
+ </xsl:when>
+ <xsl:otherwise>
+ <a
href="{url}"><xsl:value-of select="text"/></a>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </td>
+ </tr>
+ <xsl:for-each select="navigation" >
+ <xsl:choose>
+ <xsl:when test="children">
+ <tr >
+ <xsl:attribute
name="class">
+
<xsl:text>row_off</xsl:text>
+ </xsl:attribute>
+ <td align="left">
+ <xsl:for-each
select = "children" >
+
<xsl:text> </xsl:text>
+
<xsl:choose>
+
<xsl:when test="this=1">
+
<a href="{url}"><b><xsl:text>[</xsl:text><xsl:value-of
select="text"/><xsl:text>]</xsl:text></b></a>
+
</xsl:when>
+
<xsl:otherwise>
+
<a href="{url}"><xsl:value-of select="text"/></a>
+
</xsl:otherwise>
+
</xsl:choose>
+ </xsl:for-each>
+ </td>
+ </tr>
+ <xsl:for-each select =
"children" >
+ <xsl:choose>
+ <xsl:when
test="children">
+ <tr >
+
<xsl:attribute name="class">
+
<xsl:text>row_on</xsl:text>
+
</xsl:attribute>
+
<td align="left">
+
<xsl:for-each select = "children" >
+
<xsl:text> </xsl:text>
+
<xsl:choose>
+
<xsl:when test="this=1">
+
<a
href="{url}"><b><xsl:text>[</xsl:text><xsl:value-of
select="text"/><xsl:text>]</xsl:text></b></a>
+
</xsl:when>
+
<xsl:otherwise>
+
<a href="{url}"><xsl:value-of
select="text"/></a>
+
</xsl:otherwise>
+
</xsl:choose>
+
</xsl:for-each>
+
</td>
+ </tr>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:for-each>
+ </table>
+ </xsl:template>
Modified: trunk/property/templates/base/no_access.xsl
===================================================================
--- trunk/property/templates/base/no_access.xsl 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/property/templates/base/no_access.xsl 2008-02-14 11:54:40 UTC (rev
18482)
@@ -10,6 +10,11 @@
<xsl:template match="no_access">
+ <xsl:choose>
+ <xsl:when test="links !=''">
+ <xsl:apply-templates select="menu"/>
+ </xsl:when>
+ </xsl:choose>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<xsl:choose>
<xsl:when test="msgbox_data != ''">
Modified: trunk/property/templates/base/p_of_town.xsl
===================================================================
--- trunk/property/templates/base/p_of_town.xsl 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/property/templates/base/p_of_town.xsl 2008-02-14 11:54:40 UTC (rev
18482)
@@ -14,6 +14,7 @@
</xsl:template>
<xsl:template match="list">
+ <xsl:apply-templates select="menu"/>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<xsl:choose>
<xsl:when test="msgbox_data != ''">
Modified: trunk/property/templates/base/pricebook.xsl
===================================================================
--- trunk/property/templates/base/pricebook.xsl 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/property/templates/base/pricebook.xsl 2008-02-14 11:54:40 UTC (rev
18482)
@@ -30,6 +30,7 @@
</xsl:template>
<xsl:template match="list">
+ <xsl:apply-templates select="menu"/>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<xsl:choose>
<xsl:when test="msgbox_data != ''">
@@ -234,6 +235,7 @@
</xsl:template>
<xsl:template match="agreement_group">
+ <xsl:apply-templates select="menu"/>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<xsl:choose>
<xsl:when test="msgbox_data != ''">
@@ -340,6 +342,7 @@
<xsl:template match="prizing">
<div align="left">
+ <xsl:apply-templates select="menu"/>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<xsl:choose>
<xsl:when test="msgbox_data != ''">
@@ -497,6 +500,7 @@
</xsl:template>
<xsl:template match="list_activities">
+ <xsl:apply-templates select="menu"/>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<xsl:choose>
<xsl:when test="msgbox_data != ''">
@@ -632,6 +636,7 @@
<xsl:template match="list_activity_vendor">
+ <xsl:apply-templates select="menu"/>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<xsl:choose>
<xsl:when test="msgbox_data != ''">
Modified: trunk/property/templates/base/project.xsl
===================================================================
--- trunk/property/templates/base/project.xsl 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/property/templates/base/project.xsl 2008-02-14 11:54:40 UTC (rev
18482)
@@ -16,6 +16,7 @@
<xsl:template match="list_project">
+ <xsl:apply-templates select="menu"/>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<tr>
<td>
Modified: trunk/property/templates/base/r_agreement.xsl
===================================================================
--- trunk/property/templates/base/r_agreement.xsl 2008-02-10 09:33:46 UTC
(rev 18481)
+++ trunk/property/templates/base/r_agreement.xsl 2008-02-14 11:54:40 UTC
(rev 18482)
@@ -42,6 +42,7 @@
}
</script>
+ <xsl:apply-templates select="menu"/>
<xsl:variable name="form_action"><xsl:value-of
select="form_action"/></xsl:variable>
<form method="post" name="form" action="{$form_action}">
Modified: trunk/property/templates/base/request.xsl
===================================================================
--- trunk/property/templates/base/request.xsl 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/property/templates/base/request.xsl 2008-02-14 11:54:40 UTC (rev
18482)
@@ -75,6 +75,7 @@
</xsl:template>
<xsl:template match="list">
+ <xsl:apply-templates select="menu"/>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<tr>
<td>
Modified: trunk/property/templates/base/s_agreement.xsl
===================================================================
--- trunk/property/templates/base/s_agreement.xsl 2008-02-10 09:33:46 UTC
(rev 18481)
+++ trunk/property/templates/base/s_agreement.xsl 2008-02-14 11:54:40 UTC
(rev 18482)
@@ -26,6 +26,7 @@
</xsl:template>
<xsl:template match="list">
+ <xsl:apply-templates select="menu"/>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<xsl:choose>
<xsl:when test="msgbox_data != ''">
Modified: trunk/property/templates/base/template.xsl
===================================================================
--- trunk/property/templates/base/template.xsl 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/property/templates/base/template.xsl 2008-02-14 11:54:40 UTC (rev
18482)
@@ -19,6 +19,7 @@
<xsl:template match="list">
+ <xsl:apply-templates select="menu"/>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<tr>
<td>
@@ -214,6 +215,7 @@
<xsl:template match="list_template_hour">
+ <xsl:apply-templates select="menu"/>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<xsl:choose>
<xsl:when test="msgbox_data != ''">
Modified: trunk/property/templates/base/tenant_claim.xsl
===================================================================
--- trunk/property/templates/base/tenant_claim.xsl 2008-02-10 09:33:46 UTC
(rev 18481)
+++ trunk/property/templates/base/tenant_claim.xsl 2008-02-14 11:54:40 UTC
(rev 18482)
@@ -14,6 +14,7 @@
</xsl:template>
<xsl:template match="list">
+ <xsl:apply-templates select="menu"/>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<xsl:choose>
<xsl:when test="msgbox_data != ''">
Modified: trunk/property/templates/base/tts.xsl
===================================================================
--- trunk/property/templates/base/tts.xsl 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/property/templates/base/tts.xsl 2008-02-14 11:54:40 UTC (rev
18482)
@@ -25,7 +25,8 @@
<xsl:template match="list">
<xsl:variable name="autorefresh"><xsl:value-of
select="autorefresh"/></xsl:variable>
- <meta http-equiv="refresh" content="{$autorefresh}"/>
+ <META HTTP-EQUIV="Refresh" CONTENT="{$autorefresh}"/>
+ <xsl:apply-templates select="menu"/>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<xsl:choose>
<xsl:when test="msgbox_data != ''">
@@ -237,7 +238,8 @@
<xsl:template match="list2">
<xsl:variable name="autorefresh"><xsl:value-of
select="autorefresh"/></xsl:variable>
- <meta http-equiv="refresh" content="{$autorefresh}"/>
+ <META HTTP-EQUIV="Refresh" CONTENT="{$autorefresh}"/>
+ <xsl:apply-templates select="menu"/>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<xsl:choose>
<xsl:when test="msgbox_data != ''">
Modified: trunk/property/templates/base/wo_hour.xsl
===================================================================
--- trunk/property/templates/base/wo_hour.xsl 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/property/templates/base/wo_hour.xsl 2008-02-14 11:54:40 UTC (rev
18482)
@@ -145,6 +145,7 @@
<xsl:template match="add_template">
<div align="left">
+ <xsl:apply-templates select="menu"/>
<table cellpadding="2" cellspacing="2" width="80%"
align="center">
<xsl:choose>
<xsl:when test="msgbox_data != ''">
@@ -244,6 +245,7 @@
<xsl:template match="list_hour">
+ <xsl:apply-templates select="menu"/>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<xsl:choose>
<xsl:when test="msgbox_data != ''">
@@ -738,6 +740,7 @@
<xsl:template match="list_template">
+ <xsl:apply-templates select="menu"/>
<xsl:apply-templates select="workorder_data"/>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<tr>
@@ -851,6 +854,7 @@
<xsl:template match="list_template_hour">
+ <xsl:apply-templates select="menu"/>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<xsl:choose>
<xsl:when test="msgbox_data != ''">
@@ -1060,6 +1064,7 @@
<xsl:template match="prizebook">
+ <xsl:apply-templates select="menu"/>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<xsl:choose>
<xsl:when test="msgbox_data != ''">
Modified: trunk/property/templates/base/workorder.xsl
===================================================================
--- trunk/property/templates/base/workorder.xsl 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/property/templates/base/workorder.xsl 2008-02-14 11:54:40 UTC (rev
18482)
@@ -19,6 +19,7 @@
<xsl:template match="add">
+ <xsl:apply-templates select="menu"/>
<table width="50%" cellpadding="2" cellspacing="2"
align="center">
<tr height="50">
@@ -64,6 +65,7 @@
</xsl:template>
<xsl:template match="list_workorder">
+ <xsl:apply-templates select="menu"/>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<tr>
<xsl:choose>
Modified: trunk/property/tutorials/property/examples/install.apache.sh
===================================================================
--- trunk/property/tutorials/property/examples/install.apache.sh
2008-02-10 09:33:46 UTC (rev 18481)
+++ trunk/property/tutorials/property/examples/install.apache.sh
2008-02-14 11:54:40 UTC (rev 18482)
@@ -41,8 +41,8 @@
# *
# * @var string APACHE, APACHETAR
# */
-APACHETAR="httpd-2.2.6.tar.gz"
-APACHE="httpd-2.2.6"
+APACHETAR="httpd-2.2.8.tar.gz"
+APACHE="httpd-2.2.8"
#/**
# * Name of the PHP tarball e.g php-5.2.tar.gz
Added: trunk/sms/bin/config_BR_log
===================================================================
--- trunk/sms/bin/config_BR_log (rev 0)
+++ trunk/sms/bin/config_BR_log 2008-02-14 11:54:40 UTC (rev 18482)
@@ -0,0 +1,43 @@
+<?php
+ /**
+ * phpGroupWare - sms: A SMS Gateway
+ *
+ * @author Sigurd Nes <address@hidden>
+ * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc.
http://www.fsf.org/
+ * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
+ * @package sms
+ * @subpackage sms
+ * @version $Id: config_VASK 18297 2007-10-03 13:34:09Z sigurdne $
+ */
+
+ /**
+ * Description
+ * @package sms
+ * Config values for SMS-command "BR" - (Br\xF8yting) "snow clearing"
in Norwegian - as example - as it is configured at BBB
+ * This file is for redirecting from log items to the subject of the
log
+ */
+
+ $agreement = array(48089,48329);
+
+ foreach ($agreement as $agreement_id)
+ {
+ $sql = "SELECT id from fm_s_agreement_detail WHERE agreement_id
= $agreement_id AND location_code ilike '" . $param . "%'";
+ $this->db->query($sql,__LINE__,__FILE__);
+ if($this->db->f('id'))
+ {
+ break;
+ }
+ else
+ {
+ $agreement_id = 0;
+ }
+ }
+
+ $link_data = array
+ (
+ 'menuaction' => 'property.uis_agreement.view',
+ 'id' => $agreement_id
+ );
+
+?>
Added: trunk/sms/bin/config_SD_log
===================================================================
--- trunk/sms/bin/config_SD_log (rev 0)
+++ trunk/sms/bin/config_SD_log 2008-02-14 11:54:40 UTC (rev 18482)
@@ -0,0 +1,29 @@
+<?php
+ /**
+ * phpGroupWare - sms: A SMS Gateway
+ *
+ * @author Sigurd Nes <address@hidden>
+ * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc.
http://www.fsf.org/
+ * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
+ * @package sms
+ * @subpackage sms
+ * @version $Id: config_VASK 18297 2007-10-03 13:34:09Z sigurdne $
+ */
+
+ /**
+ * Description
+ * @package sms
+ * Config values for SMS-command "SD" - short for "noxious animal in
Norwegian" - as example - as it is configured at BBB
+ * This file is for redirecting from log items to the subject of the
log
+ */
+
+ $agreement_id = '31793';
+
+ $link_data = array
+ (
+ 'menuaction' => 'property.uis_agreement.view',
+ 'id' => $agreement_id
+ );
+
+?>
Added: trunk/sms/bin/config_STATUS_log
===================================================================
--- trunk/sms/bin/config_STATUS_log (rev 0)
+++ trunk/sms/bin/config_STATUS_log 2008-02-14 11:54:40 UTC (rev 18482)
@@ -0,0 +1,29 @@
+<?php
+ /**
+ * phpGroupWare - sms: A SMS Gateway
+ *
+ * @author Sigurd Nes <address@hidden>
+ * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc.
http://www.fsf.org/
+ * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
+ * @package sms
+ * @subpackage sms
+ * @version $Id: config_VASK 18297 2007-10-03 13:34:09Z sigurdne $
+ */
+
+ /**
+ * Description
+ * @package sms
+ * Config values for SMS-command "STATUS" - (setting status of
workorders) as example - as it is configured at BBB
+ * This file is for redirecting from log items to the subject of the
log
+ */
+
+ $param = explode(' ' , $param);
+
+ $link_data = array
+ (
+ 'menuaction' => 'property.uiworkorder.view',
+ 'id' => $param[0]
+ );
+
+?>
Added: trunk/sms/bin/config_ST_log
===================================================================
--- trunk/sms/bin/config_ST_log (rev 0)
+++ trunk/sms/bin/config_ST_log 2008-02-14 11:54:40 UTC (rev 18482)
@@ -0,0 +1,43 @@
+<?php
+ /**
+ * phpGroupWare - sms: A SMS Gateway
+ *
+ * @author Sigurd Nes <address@hidden>
+ * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc.
http://www.fsf.org/
+ * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
+ * @package sms
+ * @subpackage sms
+ * @version $Id: config_VASK 18297 2007-10-03 13:34:09Z sigurdne $
+ */
+
+ /**
+ * Description
+ * @package sms
+ * Config values for SMS-command "ST" - (Str\xF8ing) "sanding the ice"
in Norwegian - as example - as it is configured at BBB
+ * This file is for redirecting from log items to the subject of the
log
+ */
+
+ $agreement = array(48089,48329);
+
+ foreach ($agreement as $agreement_id)
+ {
+ $sql = "SELECT id from fm_s_agreement_detail WHERE agreement_id
= $agreement_id AND location_code ilike '" . $param . "%'";
+ $this->db->query($sql,__LINE__,__FILE__);
+ if($this->db->f('id'))
+ {
+ break;
+ }
+ else
+ {
+ $agreement_id = 0;
+ }
+ }
+
+ $link_data = array
+ (
+ 'menuaction' => 'property.uis_agreement.view',
+ 'id' => $agreement_id
+ );
+
+?>
Added: trunk/sms/bin/config_VASK_log
===================================================================
--- trunk/sms/bin/config_VASK_log (rev 0)
+++ trunk/sms/bin/config_VASK_log 2008-02-14 11:54:40 UTC (rev 18482)
@@ -0,0 +1,29 @@
+<?php
+ /**
+ * phpGroupWare - sms: A SMS Gateway
+ *
+ * @author Sigurd Nes <address@hidden>
+ * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc.
http://www.fsf.org/
+ * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
+ * @package sms
+ * @subpackage sms
+ * @version $Id: config_VASK 18297 2007-10-03 13:34:09Z sigurdne $
+ */
+
+ /**
+ * Description
+ * @package sms
+ * Config values for SMS-command "VASK" - cleaning in Norwegian - as
example - as it is configured at BBB
+ * This file is for redirecting from log items to the subject of the
log
+ */
+
+ $agreement_id = '22331';
+
+ $link_data = array
+ (
+ 'menuaction' => 'property.uis_agreement.view',
+ 'id' => $agreement_id
+ );
+
+?>
Modified: trunk/sms/inc/class.bocommon.inc.php
===================================================================
--- trunk/sms/inc/class.bocommon.inc.php 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/sms/inc/class.bocommon.inc.php 2008-02-14 11:54:40 UTC (rev
18482)
@@ -454,18 +454,22 @@
}
- function no_access($links = '')
+ function no_access($message = '')
{
-
$GLOBALS['phpgw']->xslttpl->add_file(array('no_access','menu'));
+
$GLOBALS['phpgw']->xslttpl->add_file(array('no_access'));
$receipt['error'][]=array('msg'=>lang('NO ACCESS'));
+ if($message)
+ {
+ $receipt['error'][] = array('msg'=>$message);
+ }
$msgbox_data = $this->msgbox_data($receipt);
$data = array
(
'msgbox_data' =>
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
- 'links' => $links,
+ 'message' => $message,
);
$appname = lang('No access');
Modified: trunk/sms/inc/class.menu.inc.php
===================================================================
--- trunk/sms/inc/class.menu.inc.php 2008-02-10 09:33:46 UTC (rev 18481)
+++ trunk/sms/inc/class.menu.inc.php 2008-02-14 11:54:40 UTC (rev 18482)
@@ -13,7 +13,7 @@
/**
* Description
- * @package hrm
+ * @package sms
*/
class sms_menu
@@ -33,137 +33,171 @@
}
}
- function links($page='',$page_2='')
+ /**
+ * Get the menus for the sms
+ *
+ * @return array available menus for the current user
+ */
+ public function get_menu()
{
- $currentapp='sms';
- $sub = $this->sub;
+ $incoming_app =
$GLOBALS['phpgw_info']['flags']['currentapp'];
+ $GLOBALS['phpgw_info']['flags']['currentapp'] = 'sms';
- $menu =
$GLOBALS['phpgw']->session->appsession('menu',substr(md5($currentapp.$sub . '_'
. $page . '_' . $page_2),-20));
+ $acl = CreateObject('phpgwapi.acl');
+ $menus = array();
- if(!isset($menu) || !$menu)
+ $start_page = 'sms.index';
+ if (
isset($GLOBALS['phpgw_info']['user']['preferences']['sms']['default_start_page'])
+ &&
$GLOBALS['phpgw_info']['user']['preferences']['sms']['default_start_page'] )
{
- $menu = array();
-
- $i=0;
- if($sub=='.inbox')
- {
- $menu['module'][$i]['this']=True;
+ $start_page =
$GLOBALS['phpgw_info']['user']['preferences']['sms']['default_start_page'];
}
- $menu['module'][$i]['url'] =
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
$currentapp.'.uisms.index'));
- $menu['module'][$i]['text'] =
lang('Inbox');
- $menu['module'][$i]['statustext'] = lang('Inbox');
- $i++;
- if($sub=='.outbox')
- {
- $menu['module'][$i]['this']=True;
- }
- $menu['module'][$i]['url']
= $GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
$currentapp.'.uisms.outbox'));
- $menu['module'][$i]['text']
= lang('outbox');
- $menu['module'][$i]['statustext'] =
lang('outbox');
- $i++;
+ $menus['navbar'] = array
+ (
+ 'sms' => array
+ (
+ 'text' => lang('sms'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
"sms.ui{$start_page}") ),
+ 'image' => array('sms', 'navbar'),
+ 'order' => 35,
+ 'group' => 'facilities management'
+ ),
+ );
- if($sub=='.autoreply')
+ $menus['toolbar'] = array();
+ if (
isset($GLOBALS['phpgw_info']['user']['apps']['admin']) )
{
- $menu['module'][$i]['this']=True;
- }
- $menu['module'][$i]['url']
= $GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
$currentapp.'.uiautoreply.index'));
- $menu['module'][$i]['text']
= lang('autoreply');
- $menu['module'][$i]['statustext'] =
lang('autoreply');
- $i++;
- if($sub=='.board')
- {
- $menu['module'][$i]['this']=True;
+ $menus['admin'] = array
+ (
+ 'config' => array
+ (
+ 'text' => lang('config'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 'sms.uiconfig.index'))
+ ),
+ 'refresh' => array
+ (
+ 'text' => lang('Daemon manual
refresh'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
'sms.uiconfig.daemon_manual'))
+ )
+ );
}
- $menu['module'][$i]['url']
= $GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
$currentapp.'.uiboard.index'));
- $menu['module'][$i]['text']
= lang('boards');
- $menu['module'][$i]['statustext'] =
lang('boards');
- $i++;
- if($sub=='.command')
+ if (
isset($GLOBALS['phpgw_info']['user']['apps']['preferences']) )
{
- $menu['module'][$i]['this']=True;
- }
- $menu['module'][$i]['url']
= $GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
$currentapp.'.uicommand.index'));
- $menu['module'][$i]['text']
= lang('commands');
- $menu['module'][$i]['statustext'] =
lang('commands');
- $i++;
+ $menus['preferences'] = array
+ (
+ array
+ (
+ 'text' =>
$GLOBALS['phpgw']->translation->translate('Preferences', array(), true),
+ 'url' =>
$GLOBALS['phpgw']->link('/preferences/preferences.php', array('appname' =>
'sms', 'type'=> 'user') )
+ ),
+ array
+ (
+ 'text' =>
$GLOBALS['phpgw']->translation->translate('Grant Access', array(), true),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
'preferences.uiadmin_acl.aclprefs', 'acl_app'=> 'sms') )
+ )
+ );
- if($sub=='.custom')
- {
- $menu['module'][$i]['this']=True;
+ $menus['toolbar'][] = array
+ (
+ 'text' =>
$GLOBALS['phpgw']->translation->translate('Preferences', array(), true),
+ 'url' =>
$GLOBALS['phpgw']->link('/preferences/preferences.php', array('appname' =>
'sms')),
+ 'image' => array('sms', 'preferences')
+ );
}
- $menu['module'][$i]['url']
= $GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
$currentapp.'.uicustom.index'));
- $menu['module'][$i]['text']
= lang('customs');
- $menu['module'][$i]['statustext'] =
lang('customs');
- $i++;
- if($sub=='.poll')
- {
- $menu['module'][$i]['this']=True;
- }
- $menu['module'][$i]['url']
= $GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
$currentapp.'.uipoll.index'));
- $menu['module'][$i]['text']
= lang('polls');
- $menu['module'][$i]['statustext'] =
lang('polls');
- $i++;
+ $command_children = array
+ (
+ 'log' => array
+ (
+ 'text' => lang('log'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 'sms.uicommand.log'))
+ )
+ );
- if($sub=='.config')
- {
- $menu['module'][$i]['this']=True;
- }
- $menu['module'][$i]['url']
= $GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
$currentapp.'.uiconfig.index'));
- $menu['module'][$i]['text']
= lang('config');
- $menu['module'][$i]['statustext'] =
lang('config');
- $i++;
+ $menus['navigation'] = array
+ (
+ 'inbox' => array
+ (
+ 'text' => lang('Inbox'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 'sms.uisms.index'))
+ ),
+ 'outbox' => array
+ (
+ 'text' => lang('Outbox'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 'sms.uisms.outbox'))
+ ),
+ 'autoreply' => array
+ (
+ 'text' => lang('Autoreply'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
'sms.uiautoreply.index'))
+ ),
+ 'board' => array
+ (
+ 'text' => lang('Boards'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 'sms.uiboard.index'))
+ ),
+ 'command' => array
+ (
+ 'text' => lang('Command'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
'sms.uicommand.index')),
+ 'children' => $command_children
+ ),
+ 'custom' => array
+ (
+ 'text' => lang('Custom'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 'sms.uicustom.index'))
+ ),
+ 'poll' => array
+ (
+ 'text' => lang('Polls'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 'sms.uipoll.index'))
+ )
+ );
+ $GLOBALS['phpgw_info']['flags']['currentapp'] =
$incoming_app;
+ return $menus;
+ }
- $j=0;
- if ($sub == '.config')
+ function links()
+ {
+
if(!isset($GLOBALS['phpgw_info']['user']['preferences']['sms']['horisontal_menus'])
|| $GLOBALS['phpgw_info']['user']['preferences']['sms']['horisontal_menus'] ==
'no')
{
- if($page=='.config.type')
- {
- $menu['sub_menu'][$j]['this']=True;
- }
- $menu['sub_menu'][$j]['url']
= $GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
$currentapp.'.uiconfig.index'));
- $menu['sub_menu'][$j]['text']
= lang('config');
- $menu['sub_menu'][$j]['statustext']
= lang('config');
- $j++;
-
- if($page=='.config.daemon_manual')
- {
- $menu['sub_menu'][$j]['this']=True;
- }
- $menu['sub_menu'][$j]['url']
= $GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
$currentapp.'.uiconfig.daemon_manual'));
- $menu['sub_menu'][$j]['text']
= lang('Daemon manual refresh');
- $menu['sub_menu'][$j]['statustext']
= lang('Daemon manual refresh');
- $j++;
+ return;
}
+ $GLOBALS['phpgw']->xslttpl->add_file(array('menu'));
+ $menu_brutto = execMethod('sms.menu.get_menu');
+ $selection =
explode('::',$GLOBALS['phpgw_info']['flags']['menu_selection']);
+ $level=0;
+ $menu['navigation'] =
$this->get_sub_menu($menu_brutto['navigation'],$selection,$level);
+ return $menu;
+ }
- if ($sub == '.command')
+ function get_sub_menu($children = array(),
$selection=array(),$level='')
+ {
+ $level++;
+ $i=0;
+ foreach($children as $key => $vals)
{
- if($page=='.command.list')
+ $menu[] = $vals;
+ if($key == $selection[$level])
{
- $menu['sub_menu'][$j]['this']=True;
+ $menu[$i]['this'] = true;
+ if(isset($menu[$i]['children']))
+ {
+ $menu[$i]['children'] =
$this->get_sub_menu($menu[$i]['children'],$selection,$level);
+ }
}
- $menu['sub_menu'][$j]['url']
= $GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
$currentapp.'.uicommand.index'));
- $menu['sub_menu'][$j]['text']
= lang('commands');
- $menu['sub_menu'][$j]['statustext']
= lang('commands');
- $j++;
-
- if($page=='.command.log')
+ else
{
- $menu['sub_menu'][$j]['this']=True;
- }
- $menu['sub_menu'][$j]['url']
= $GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
$currentapp.'.uicommand.log'));
- $menu['sub_menu'][$j]['text']
= lang('log');
- $menu['sub_menu'][$j]['statustext']
= lang('log');
- $j++;
+ if(isset($menu[$i]['children']))
+ {
+ unset($menu[$i]['children']);
+ }
+ }
+ $i++;
}
-
-
$GLOBALS['phpgw']->session->appsession('menu',substr(md5($currentapp.$sub . '_'
. $page . '_' . $page_2),-20),$menu);
- }
-
-
$GLOBALS['phpgw']->session->appsession('menu_sms','sidebox',$menu);
return $menu;
}
}
Modified: trunk/sms/inc/class.uiautoreply.inc.php
===================================================================
--- trunk/sms/inc/class.uiautoreply.inc.php 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/sms/inc/class.uiautoreply.inc.php 2008-02-14 11:54:40 UTC (rev
18482)
@@ -38,7 +38,6 @@
$this->account =
$GLOBALS['phpgw_info']['user']['account_id'];
$this->bo =
CreateObject('sms.boautoreply',true);
$this->bocommon =
CreateObject('sms.bocommon');
- $this->menu =
CreateObject('sms.menu');
$this->sms =
CreateObject('sms.sms');
$this->acl =
CreateObject('phpgwapi.acl');
$this->acl_location = '.autoreply';
@@ -50,6 +49,7 @@
$this->allrows =
$this->bo->allrows;
$this->db = clone($GLOBALS['phpgw']->db);
+ $GLOBALS['phpgw_info']['flags']['menu_selection'] .=
'sms::autoreply';
}
function save_sessiondata()
@@ -68,15 +68,14 @@
function index()
{
$GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
- $links = $this->menu->links();
if(!$this->acl->check($this->acl_location,
PHPGW_ACL_READ))
{
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
-
$GLOBALS['phpgw']->xslttpl->add_file(array('autoreply','nextmatchs','menu',
+
$GLOBALS['phpgw']->xslttpl->add_file(array('autoreply','nextmatchs',
'search_field'));
$receipt =
$GLOBALS['phpgw']->session->appsession('session_data','sms_reply_receipt');
@@ -170,7 +169,7 @@
$data = array
(
'msgbox_data'
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
- 'links'
=> $links,
+ 'menu'
=> execMethod('sms.menu.links'),
'allow_allrows'
=> True,
'allrows'
=> $this->allrows,
'start_record'
=> $this->start,
@@ -201,9 +200,8 @@
if(!$this->acl->check($this->acl_location,
PHPGW_ACL_ADD))
{
- $links = $this->menu->links();
$GLOBALS['phpgw_info']['flags']['xslt_app'] =
True;
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
@@ -257,9 +255,8 @@
if(!$this->acl->check($this->acl_location,
PHPGW_ACL_ADD))
{
- $links = $this->menu->links();
$GLOBALS['phpgw_info']['flags']['xslt_app'] =
True;
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
@@ -316,9 +313,8 @@
if(!$this->acl->check($this->acl_location,
PHPGW_ACL_ADD))
{
- $links = $this->menu->links();
$GLOBALS['phpgw_info']['flags']['xslt_app'] =
True;
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
@@ -391,9 +387,8 @@
if(!$this->acl->check($this->acl_location,
PHPGW_ACL_ADD))
{
- $links = $this->menu->links();
$GLOBALS['phpgw_info']['flags']['xslt_app'] =
True;
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
@@ -466,9 +461,8 @@
if(!$this->acl->check($this->acl_location,
PHPGW_ACL_EDIT))
{
- $links = $this->menu->links();
$GLOBALS['phpgw_info']['flags']['xslt_app'] =
True;
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
@@ -549,9 +543,8 @@
if(!$this->acl->check($this->acl_location,
PHPGW_ACL_EDIT))
{
- $links = $this->menu->links();
$GLOBALS['phpgw_info']['flags']['xslt_app'] =
True;
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
@@ -623,9 +616,8 @@
{
if(!$this->acl->check($this->acl_location, 16))
{
- $links = $this->menu->links();
$GLOBALS['phpgw_info']['flags']['xslt_app'] =
True;
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
@@ -714,8 +706,7 @@
$GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
if(!$this->acl->check($this->acl_location,
PHPGW_ACL_DELETE))
{
- $links = $this->menu->links();
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
@@ -788,8 +779,7 @@
$GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
if(!$this->acl->check($this->acl_location,
PHPGW_ACL_DELETE))
{
- $links = $this->menu->links();
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
Modified: trunk/sms/inc/class.uiboard.inc.php
===================================================================
--- trunk/sms/inc/class.uiboard.inc.php 2008-02-10 09:33:46 UTC (rev 18481)
+++ trunk/sms/inc/class.uiboard.inc.php 2008-02-14 11:54:40 UTC (rev 18482)
@@ -38,11 +38,9 @@
$this->account =
$GLOBALS['phpgw_info']['user']['account_id'];
// $this->bo =
CreateObject('sms.boconfig',true);
$this->bocommon =
CreateObject('sms.bocommon');
- $this->menu =
CreateObject('sms.menu');
$this->sms =
CreateObject('sms.sms');
$this->acl =
CreateObject('phpgwapi.acl');
$this->acl_location = '.board';
- $this->menu->sub
=$this->acl_location;
$this->start =
$this->bo->start;
$this->query =
$this->bo->query;
$this->sort =
$this->bo->sort;
@@ -51,6 +49,7 @@
$this->db =
clone($GLOBALS['phpgw']->db);
$this->db2 =
clone($GLOBALS['phpgw']->db);
+ $GLOBALS['phpgw_info']['flags']['menu_selection'] =
'sms::board';
}
function index()
@@ -58,9 +57,8 @@
if(!$this->acl->check($this->acl_location,
PHPGW_ACL_READ))
{
- $links = $this->menu->links();
$GLOBALS['phpgw_info']['flags']['xslt_app'] =
True;
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
@@ -129,9 +127,8 @@
if(!$this->acl->check($this->acl_location,
PHPGW_ACL_READ))
{
- $links = $this->menu->links();
$GLOBALS['phpgw_info']['flags']['xslt_app'] =
True;
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
@@ -190,9 +187,8 @@
if(!$this->acl->check($this->acl_location,
PHPGW_ACL_ADD))
{
- $links = $this->menu->links();
$GLOBALS['phpgw_info']['flags']['xslt_app'] =
True;
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
@@ -248,9 +244,8 @@
if(!$this->acl->check($this->acl_location,
PHPGW_ACL_ADD))
{
- $links = $this->menu->links();
$GLOBALS['phpgw_info']['flags']['xslt_app'] =
True;
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
@@ -317,9 +312,8 @@
if(!$this->acl->check($this->acl_location,
PHPGW_ACL_EDIT))
{
- $links = $this->menu->links();
$GLOBALS['phpgw_info']['flags']['xslt_app'] =
True;
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
@@ -380,9 +374,8 @@
{
if(!$this->acl->check($this->acl_location,
PHPGW_ACL_EDIT))
{
- $links = $this->menu->links();
$GLOBALS['phpgw_info']['flags']['xslt_app'] =
True;
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
@@ -441,8 +434,7 @@
$GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
if(!$this->acl->check($this->acl_location,
PHPGW_ACL_DELETE))
{
- $links = $this->menu->links();
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
Modified: trunk/sms/inc/class.uicommand.inc.php
===================================================================
--- trunk/sms/inc/class.uicommand.inc.php 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/sms/inc/class.uicommand.inc.php 2008-02-14 11:54:40 UTC (rev
18482)
@@ -21,25 +21,21 @@
var $public_functions = array(
'index' => True,
'log' => True,
+ 'redirect' => True,
'edit' => True,
'edit_command' => True,
'delete' => True,
);
-
function sms_uicommand()
{
-
- // $this->currentapp =
$GLOBALS['phpgw_info']['flags']['currentapp'];
$this->nextmatchs =
CreateObject('phpgwapi.nextmatchs');
$this->account =
$GLOBALS['phpgw_info']['user']['account_id'];
$this->bo =
CreateObject('sms.bocommand');
$this->bocommon =
CreateObject('sms.bocommon');
- $this->menu =
CreateObject('sms.menu');
$this->sms =
CreateObject('sms.sms');
$this->acl =
CreateObject('phpgwapi.acl');
$this->acl_location = '.command';
- $this->menu->sub
=$this->acl_location;
$this->cat_id =
$this->bo->cat_id;
$this->start =
$this->bo->start;
$this->query =
$this->bo->query;
@@ -49,6 +45,7 @@
$this->db =
clone($GLOBALS['phpgw']->db);
$this->db2 =
clone($GLOBALS['phpgw']->db);
+ $GLOBALS['phpgw_info']['flags']['menu_selection'] =
'sms::command';
}
function save_sessiondata()
@@ -66,16 +63,15 @@
function index()
{
- $links = $this->menu->links($this->acl_location .
'.list');
$GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
if(!$this->acl->check($this->acl_location,
PHPGW_ACL_READ))
{
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
-
$GLOBALS['phpgw']->xslttpl->add_file(array('command','nextmatchs','menu',
+
$GLOBALS['phpgw']->xslttpl->add_file(array('command','nextmatchs',
'search_field'));
$receipt =
$GLOBALS['phpgw']->session->appsession('session_data','sms_command_receipt');
@@ -171,7 +167,7 @@
$data = array
(
'msgbox_data'
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
- 'links'
=> $links,
+ 'menu'
=> execMethod('sms.menu.links'),
'allow_allrows'
=> True,
'allrows'
=> $this->allrows,
'start_record'
=> $this->start,
@@ -201,13 +197,12 @@
{
$GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
- $links = $this->menu->links();
$command_id = phpgw::get_var('command_id', 'int');
if($command_id)
{
if(!$this->acl->check($this->acl_location,
PHPGW_ACL_EDIT))
{
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
}
@@ -215,7 +210,7 @@
{
if(!$this->acl->check($this->acl_location,
PHPGW_ACL_ADD))
{
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
}
@@ -346,18 +341,37 @@
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_command' => $data));
}
+ function redirect()
+ {
+ $code = phpgw::get_var('code');
+ $param = urldecode(phpgw::get_var('param'));
+
+ if(is_file(PHPGW_SERVER_ROOT . '/sms/bin/config_' .
strtoupper(basename($code)) . '_log'))
+ {
+ include(PHPGW_SERVER_ROOT . '/sms/bin/config_'
. strtoupper(basename($code)) . '_log');
+
+
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
+ }
+ else
+ {
+ $GLOBALS['phpgw_info']['flags']['xslt_app'] =
True;
+
$GLOBALS['phpgw_info']['flags']['menu_selection'] .= '::log';
+ $this->bocommon->no_access(lang('target not
configured'));
+ }
+
+ }
function log()
{
- $links = $this->menu->links($this->acl_location .
'.log');
+ $GLOBALS['phpgw_info']['flags']['menu_selection'] .=
'::log';
$GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
if(!$this->acl->check($this->acl_location,
PHPGW_ACL_READ))
{
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
-
$GLOBALS['phpgw']->xslttpl->add_file(array('command','nextmatchs','menu',
+
$GLOBALS['phpgw']->xslttpl->add_file(array('command','nextmatchs',
'search_field'));
$command_info = $this->bo->read_log();
@@ -379,6 +393,7 @@
'success' =>
$entry['success'],
'datetime' =>
$entry['datetime'],
'code' =>
$entry['code'],
+ 'link_redirect' => $entry['success'] ==
1 ? $GLOBALS['phpgw']->link('/index.php', array('menuaction'=>
'sms.uicommand.redirect','code' => $entry['code'], 'param'=>
urlencode($entry['param']))) : '',
'param' =>
$entry['param'],
'link_delete' => $link_delete,
'text_delete' => $text_delete,
@@ -457,7 +472,7 @@
$data = array
(
'msgbox_data'
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
- 'links'
=> $links,
+ 'menu'
=> execMethod('sms.menu.links'),
'allow_allrows'
=> True,
'allrows'
=> $this->allrows,
'start_record'
=> $this->start,
@@ -493,8 +508,7 @@
$GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
if(!$this->acl->check($this->acl_location,
PHPGW_ACL_DELETE))
{
- $links = $this->menu->links();
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
Modified: trunk/sms/inc/class.uiconfig.inc.php
===================================================================
--- trunk/sms/inc/class.uiconfig.inc.php 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/sms/inc/class.uiconfig.inc.php 2008-02-14 11:54:40 UTC (rev
18482)
@@ -49,7 +49,6 @@
$this->account =
$GLOBALS['phpgw_info']['user']['account_id'];
$this->bo =
CreateObject('sms.boconfig',true);
$this->bocommon =
CreateObject('sms.bocommon');
- $this->menu =
CreateObject('sms.menu');
$this->acl =
CreateObject('phpgwapi.acl');
$this->acl_location = '.config';
$this->menu->sub
=$this->acl_location;
@@ -58,6 +57,7 @@
$this->sort =
$this->bo->sort;
$this->order =
$this->bo->order;
$this->allrows =
$this->bo->allrows;
+ $GLOBALS['phpgw_info']['flags']['menu_selection'] =
'admin::sms::config';
}
function save_sessiondata()
@@ -74,15 +74,13 @@
function index()
{
- $links = $this->menu->links('.config.type');
-
if(!$this->acl->check('run', PHPGW_ACL_READ,'admin'))
{
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
-
$GLOBALS['phpgw']->xslttpl->add_file(array('config','nextmatchs','menu',
+
$GLOBALS['phpgw']->xslttpl->add_file(array('config','nextmatchs',
'search_field'));
$receipt =
$GLOBALS['phpgw']->session->appsession('session_data','sms_c_type_receipt');
@@ -163,7 +161,7 @@
$data = array
(
'msgbox_data'
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
- 'links'
=> $links,
+ 'menu'
=> execMethod('sms.menu.links'),
'allow_allrows'
=> True,
'allrows'
=> $this->allrows,
'start_record'
=> $this->start,
@@ -194,8 +192,7 @@
{
if(!$this->acl->check('run', PHPGW_ACL_READ,'admin'))
{
- $links = $this->menu->links('.config.type');
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
@@ -293,8 +290,7 @@
{
if(!$this->acl->check('run', PHPGW_ACL_READ,'admin'))
{
- $links = $this->menu->links('.config.type');
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
@@ -332,14 +328,11 @@
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view_type' => $data));
}
-
-
function list_attrib()
{
if(!$this->acl->check('run', PHPGW_ACL_READ,'admin'))
{
- $links = $this->menu->links('.config.type');
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
@@ -350,14 +343,12 @@
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=>
'sms.uiconfig.index'));
}
-
$GLOBALS['phpgw']->xslttpl->add_file(array('config','nextmatchs','menu',
+
$GLOBALS['phpgw']->xslttpl->add_file(array('config','nextmatchs',
'search_field'));
$receipt =
$GLOBALS['phpgw']->session->appsession('session_data','sms_c_attrib_receipt');
$GLOBALS['phpgw']->session->appsession('session_data','sms_c_attrib_receipt','');
- $links = $this->menu->links();
-
$config_info = $this->bo->read_attrib($type_id);
while (is_array($config_info) && list(,$entry) =
each($config_info))
@@ -435,7 +426,7 @@
'lang_type'
=> lang('type'),
'value_type_name'
=> $type['name'],
'msgbox_data'
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
- 'links'
=> $links,
+ 'menu'
=> execMethod('sms.menu.links'),
'allow_allrows'
=> True,
'allrows'
=> $this->allrows,
'start_record'
=> $this->start,
@@ -461,13 +452,11 @@
$this->save_sessiondata();
}
-
function edit_attrib()
{
if(!$this->acl->check('run', PHPGW_ACL_READ,'admin'))
{
- $links = $this->menu->links('.config.type');
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
@@ -595,8 +584,7 @@
{
if(!$this->acl->check('run', PHPGW_ACL_READ,'admin'))
{
- $links = $this->menu->links('.config.type');
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
@@ -608,14 +596,12 @@
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=>
'sms.uiconfig.index'));
}
-
$GLOBALS['phpgw']->xslttpl->add_file(array('config','nextmatchs','menu',
+
$GLOBALS['phpgw']->xslttpl->add_file(array('config','nextmatchs',
'search_field'));
$receipt =
$GLOBALS['phpgw']->session->appsession('session_data','sms_c_value_receipt');
$GLOBALS['phpgw']->session->appsession('session_data','sms_c_attrib_value','');
- $links = $this->menu->links();
-
$config_info =
$this->bo->read_value($type_id,$attrib_id);
while (is_array($config_info) && list(,$entry) =
each($config_info))
@@ -705,7 +691,7 @@
'value_attrib_name'
=> $attrib['name'],
'msgbox_data'
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
- 'links'
=> $links,
+ 'menu'
=> execMethod('sms.menu.links'),
'allow_allrows'
=> True,
'allrows'
=> $this->allrows,
'start_record'
=> $this->start,
@@ -737,8 +723,7 @@
{
if(!$this->acl->check('run', PHPGW_ACL_READ,'admin'))
{
- $links = $this->menu->links('.config.type');
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
@@ -861,8 +846,7 @@
{
if(!$this->acl->check('run', PHPGW_ACL_READ,'admin'))
{
- $links = $this->menu->links('.config.type');
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
@@ -905,8 +889,7 @@
{
if(!$this->acl->check('run', PHPGW_ACL_READ,'admin'))
{
- $links = $this->menu->links('.config.type');
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
@@ -952,8 +935,7 @@
{
if(!$this->acl->check('run', PHPGW_ACL_READ,'admin'))
{
- $links = $this->menu->links('.config.type');
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
@@ -998,14 +980,14 @@
function daemon_manual()
{
- $links = $this->menu->links('.config.daemon_manual');
+ $GLOBALS['phpgw_info']['flags']['menu_selection'] =
'admin::sms::refresh';
if(!$this->acl->check('run', PHPGW_ACL_READ,'admin'))
{
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
-
$GLOBALS['phpgw']->xslttpl->add_file(array('config','menu',));
+ $GLOBALS['phpgw']->xslttpl->add_file(array('config'));
$sms = CreateObject('sms.sms');
$sms->getsmsinbox();
@@ -1018,7 +1000,7 @@
$data = array
(
'msgbox_data' =>
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
- 'links' => $links
+ 'menu'
=> execMethod('sms.menu.links'),
);
$appname = lang('config');
Modified: trunk/sms/inc/class.uicustom.inc.php
===================================================================
--- trunk/sms/inc/class.uicustom.inc.php 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/sms/inc/class.uicustom.inc.php 2008-02-14 11:54:40 UTC (rev
18482)
@@ -37,7 +37,6 @@
$this->account =
$GLOBALS['phpgw_info']['user']['account_id'];
// $this->bo =
CreateObject('sms.boconfig',true);
$this->bocommon =
CreateObject('sms.bocommon');
- $this->menu =
CreateObject('sms.menu');
$this->sms =
CreateObject('sms.sms');
$this->acl =
CreateObject('phpgwapi.acl');
$this->acl_location = '.custom';
@@ -50,6 +49,7 @@
$this->db =
clone($GLOBALS['phpgw']->db);
$this->db2 =
clone($GLOBALS['phpgw']->db);
+ $GLOBALS['phpgw_info']['flags']['menu_selection'] =
'sms::custom';
}
function index()
@@ -57,9 +57,8 @@
if(!$this->acl->check($this->acl_location,
PHPGW_ACL_READ))
{
- $links = $this->menu->links();
$GLOBALS['phpgw_info']['flags']['xslt_app'] =
True;
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
@@ -124,9 +123,8 @@
{
if(!$this->acl->check($this->acl_location,
PHPGW_ACL_ADD))
{
- $links = $this->menu->links();
$GLOBALS['phpgw_info']['flags']['xslt_app'] =
True;
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
@@ -182,9 +180,8 @@
{
if(!$this->acl->check($this->acl_location,
PHPGW_ACL_ADD))
{
- $links = $this->menu->links();
$GLOBALS['phpgw_info']['flags']['xslt_app'] =
True;
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
@@ -241,9 +238,8 @@
{
if(!$this->acl->check($this->acl_location,
PHPGW_ACL_EDIT))
{
- $links = $this->menu->links();
$GLOBALS['phpgw_info']['flags']['xslt_app'] =
True;
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
@@ -311,9 +307,8 @@
{
if(!$this->acl->check($this->acl_location,
PHPGW_ACL_EDIT))
{
- $links = $this->menu->links();
$GLOBALS['phpgw_info']['flags']['xslt_app'] =
True;
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
@@ -362,8 +357,7 @@
$GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
if(!$this->acl->check($this->acl_location,
PHPGW_ACL_DELETE))
{
- $links = $this->menu->links();
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
Modified: trunk/sms/inc/class.uipoll.inc.php
===================================================================
--- trunk/sms/inc/class.uipoll.inc.php 2008-02-10 09:33:46 UTC (rev 18481)
+++ trunk/sms/inc/class.uipoll.inc.php 2008-02-14 11:54:40 UTC (rev 18482)
@@ -40,7 +40,6 @@
$this->account =
$GLOBALS['phpgw_info']['user']['account_id'];
$this->bo =
CreateObject('sms.bopoll',true);
$this->bocommon =
CreateObject('sms.bocommon');
- $this->menu =
CreateObject('sms.menu');
$this->sms =
CreateObject('sms.sms');
$this->acl =
CreateObject('phpgwapi.acl');
$this->acl_location = '.poll';
@@ -53,6 +52,7 @@
$this->db =
clone($GLOBALS['phpgw']->db);
$this->db2 =
clone($GLOBALS['phpgw']->db);
+ $GLOBALS['phpgw_info']['flags']['menu_selection'] =
'sms::poll';
}
function save_sessiondata()
@@ -70,18 +70,15 @@
function index()
{
-
- $links = $this->menu->links();
$GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
if(!$this->acl->check($this->acl_location,
PHPGW_ACL_READ))
{
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
-
-
$GLOBALS['phpgw']->xslttpl->add_file(array('poll','nextmatchs','menu',
+
$GLOBALS['phpgw']->xslttpl->add_file(array('poll','nextmatchs',
'search_field'));
$receipt =
$GLOBALS['phpgw']->session->appsession('session_data','sms_poll_receipt');
@@ -187,7 +184,7 @@
$data = array
(
'msgbox_data'
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
- 'links'
=> $links,
+ 'menu'
=> execMethod('sms.menu.links'),
'allow_allrows'
=> True,
'allrows'
=> $this->allrows,
'start_record'
=> $this->start,
@@ -215,16 +212,13 @@
function add()
{
-
if(!$this->acl->check($this->acl_location,
PHPGW_ACL_READ))
{
- $links = $this->menu->links();
$GLOBALS['phpgw_info']['flags']['xslt_app'] =
True;
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
-
$GLOBALS['phpgw_info']['flags']['app_header'] =
lang('SMS').' - '.lang('Add SMS poll');
$GLOBALS['phpgw']->common->phpgw_header();
@@ -270,12 +264,10 @@
function add_yes()
{
-
if(!$this->acl->check($this->acl_location,
PHPGW_ACL_READ))
{
- $links = $this->menu->links();
$GLOBALS['phpgw_info']['flags']['xslt_app'] =
True;
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
@@ -325,16 +317,12 @@
$GLOBALS['phpgw']->redirect_link('/index.php',$add_data);
}
-
-
function add_choice()
{
-
if(!$this->acl->check($this->acl_location,
PHPGW_ACL_READ))
{
- $links = $this->menu->links();
$GLOBALS['phpgw_info']['flags']['xslt_app'] =
True;
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
@@ -390,12 +378,10 @@
function status()
{
-
if(!$this->acl->check($this->acl_location,
PHPGW_ACL_READ))
{
- $links = $this->menu->links();
$GLOBALS['phpgw_info']['flags']['xslt_app'] =
True;
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
@@ -427,16 +413,13 @@
function edit()
{
-
if(!$this->acl->check($this->acl_location,
PHPGW_ACL_READ))
{
- $links = $this->menu->links();
$GLOBALS['phpgw_info']['flags']['xslt_app'] =
True;
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
-
$GLOBALS['phpgw_info']['flags']['app_header'] =
lang('SMS').' - '.lang('Edit SMS poll');
$GLOBALS['phpgw']->common->phpgw_header();
@@ -561,12 +544,10 @@
function edit_yes()
{
-
if(!$this->acl->check($this->acl_location,
PHPGW_ACL_READ))
{
- $links = $this->menu->links();
$GLOBALS['phpgw_info']['flags']['xslt_app'] =
True;
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
@@ -610,13 +591,11 @@
{
if(!$this->acl->check($this->acl_location,
PHPGW_ACL_READ))
{
- $links = $this->menu->links();
$GLOBALS['phpgw_info']['flags']['xslt_app'] =
True;
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
-
$poll_id = phpgw::get_var('poll_id', 'int');
$sql = "SELECT poll_title FROM phpgw_sms_featpoll WHERE
poll_id='$poll_id'";
@@ -716,8 +695,7 @@
$GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
if(!$this->acl->check($this->acl_location,
PHPGW_ACL_READ))
{
- $links = $this->menu->links();
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
@@ -789,8 +767,7 @@
$GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
if(!$this->acl->check($this->acl_location,
PHPGW_ACL_READ))
{
- $links = $this->menu->links();
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
Modified: trunk/sms/inc/class.uisms.inc.php
===================================================================
--- trunk/sms/inc/class.uisms.inc.php 2008-02-10 09:33:46 UTC (rev 18481)
+++ trunk/sms/inc/class.uisms.inc.php 2008-02-14 11:54:40 UTC (rev 18482)
@@ -49,13 +49,13 @@
$this->gateway_number =
$this->config->config_data['common']['gateway_number'];
$this->bo =
CreateObject('sms.bosms',False);
$this->acl =
CreateObject('phpgwapi.acl');
- $this->menu =
CreateObject('sms.menu');
$this->grants =
$this->bo->grants;
$this->start =
$this->bo->start;
$this->query =
$this->bo->query;
$this->sort =
$this->bo->sort;
$this->order =
$this->bo->order;
$this->allrows =
$this->bo->allrows;
+ $GLOBALS['phpgw_info']['flags']['menu_selection'] =
'sms';
}
function save_sessiondata()
@@ -73,18 +73,17 @@
function index()
{
+ $GLOBALS['phpgw_info']['flags']['menu_selection'] .=
'::inbox';
$acl_location = '.inbox';
-
$GLOBALS['phpgw']->xslttpl->add_file(array('sms','nextmatchs','menu',
+
$GLOBALS['phpgw']->xslttpl->add_file(array('sms','nextmatchs',
'search_field'));
$this->bo->acl_location = $acl_location;
- $this->menu->sub = $acl_location;
- $links = $this->menu->links();
if(!$this->acl->check($acl_location, PHPGW_ACL_READ))
{
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
@@ -215,7 +214,7 @@
$data = array
(
'msgbox_data'
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
- 'links'
=> $links,
+ 'menu'
=> execMethod('sms.menu.links'),
'allow_allrows'
=> True,
'allrows'
=> $this->allrows,
'start_record'
=> $this->start,
@@ -244,18 +243,17 @@
function outbox()
{
+ $GLOBALS['phpgw_info']['flags']['menu_selection'] .=
'::outbox';
$acl_location = '.outbox';
$GLOBALS['phpgw']->xslttpl->add_file(array('sms','nextmatchs','menu',
'search_field'));
$this->bo->acl_location = $acl_location;
- $this->menu->sub = $acl_location;
- $links = $this->menu->links();
if(!$this->acl->check($acl_location, PHPGW_ACL_READ))
{
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
@@ -357,7 +355,7 @@
$data = array
(
'msgbox_data'
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
- 'links'
=> $links,
+ 'menu'
=> execMethod('sms.menu.links'),
'allow_allrows'
=> True,
'allrows'
=> $this->allrows,
'start_record'
=> $this->start,
@@ -387,10 +385,11 @@
function send()
{
+ $GLOBALS['phpgw_info']['flags']['menu_selection'] .=
'::outbox';
$acl_location = '.outbox';
if(!$this->acl->check($acl_location, PHPGW_ACL_ADD))
{
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
@@ -544,10 +543,11 @@
function delete_in()
{
+ $GLOBALS['phpgw_info']['flags']['menu_selection'] .=
'::inbox';
$acl_location = '.inbox';
if(!$this->acl->check($acl_location, PHPGW_ACL_DELETE))
{
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
@@ -588,10 +588,11 @@
function delete_out()
{
+ $GLOBALS['phpgw_info']['flags']['menu_selection'] .=
'::outbox';
$acl_location = '.outbox';
if(!$this->acl->check($acl_location, PHPGW_ACL_DELETE))
{
- $this->bocommon->no_access($links);
+ $this->bocommon->no_access();
return;
}
Modified: trunk/sms/inc/hook_settings.inc.php
===================================================================
--- trunk/sms/inc/hook_settings.inc.php 2008-02-10 09:33:46 UTC (rev 18481)
+++ trunk/sms/inc/hook_settings.inc.php 2008-02-14 11:54:40 UTC (rev 18482)
@@ -13,3 +13,16 @@
create_input_box('Your Cellphone','cellphone','help text','',15);
create_input_box('Your signature','signature','Signature to be appended
to your sms-messages','',15);
+ create_select_box('show horisontal
menues','horisontal_menus',array('no' => 'No','yes' => 'Yes'),'Horisontal
menues are shown in top of page');
+ $default_start_page = array
+ (
+ 'sms.index' => lang('inbox'),
+ 'uisms.outbox' => lang('outbox'),
+ 'autoreply.index' => lang('autoreply'),
+ 'board.index' => lang('boards'),
+ 'command.index'=> lang('command'),
+ 'command.log'=> lang('command.log'),
+ 'custom.index'=> lang('custom'),
+ 'poll.index'=> lang('polls')
+ );
+ create_select_box('Default start
page','default_start_page',$default_start_page,'Select your start-submodule');
Deleted: trunk/sms/inc/hook_sidebox_menu.inc.php
===================================================================
--- trunk/sms/inc/hook_sidebox_menu.inc.php 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/sms/inc/hook_sidebox_menu.inc.php 2008-02-14 11:54:40 UTC (rev
18482)
@@ -1,13 +0,0 @@
-<?php
-
- $menu_title = $GLOBALS['phpgw_info']['apps'][$appname]['title'] . ' '.
lang('Menu');
- $menu = $GLOBALS['phpgw']->session->appsession('menu_sms','sidebox');
- if(isset($menu) && is_array($menu))
- {
- display_sidebox($appname,$menu_title,$menu['module'],$use_lang
= false);
- if(isset($menu['sub_menu']) && $menu['sub_menu'])
- {
- display_sidebox($appname,$menu['sub_menu'] . ' ' . lang
('sub menu'),$menu['sub_menu'],$use_lang = false);
- }
- }
-?>
Modified: trunk/sms/index.php
===================================================================
--- trunk/sms/index.php 2008-02-10 09:33:46 UTC (rev 18481)
+++ trunk/sms/index.php 2008-02-14 11:54:40 UTC (rev 18482)
@@ -28,12 +28,12 @@
include('../header.inc.php');
- $start_page = 'sms';
+ $start_page = 'sms.index';
- if (
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['default_start_page'])
- &&
$GLOBALS['phpgw_info']['user']['preferences']['property']['default_start_page']
)
+ if (
isset($GLOBALS['phpgw_info']['user']['preferences']['sms']['default_start_page'])
+ &&
$GLOBALS['phpgw_info']['user']['preferences']['sms']['default_start_page'] )
{
- $start_page =
$GLOBALS['phpgw_info']['user']['preferences']['property']['default_start_page'];
+ $start_page =
$GLOBALS['phpgw_info']['user']['preferences']['sms']['default_start_page'];
}
- $GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction' =>
"sms.ui{$start_page}.index"));
+ $GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction' =>
"sms.ui{$start_page}"));
Modified: trunk/sms/setup/setup.inc.php
===================================================================
--- trunk/sms/setup/setup.inc.php 2008-02-10 09:33:46 UTC (rev 18481)
+++ trunk/sms/setup/setup.inc.php 2008-02-14 11:54:40 UTC (rev 18482)
@@ -72,7 +72,7 @@
'settings',
'preferences',
'admin',
- 'sidebox_menu'
+ 'menu' => 'sms.menu.get_menu'
);
/* Dependencies for this app to work */
Modified: trunk/sms/templates/base/autoreply.xsl
===================================================================
--- trunk/sms/templates/base/autoreply.xsl 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/sms/templates/base/autoreply.xsl 2008-02-14 11:54:40 UTC (rev
18482)
@@ -13,7 +13,11 @@
</xsl:template>
<xsl:template match="list">
- <xsl:call-template name="menu"/>
+ <xsl:choose>
+ <xsl:when test="menu != ''">
+ <xsl:apply-templates select="menu"/>
+ </xsl:when>
+ </xsl:choose>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<xsl:choose>
<xsl:when test="msgbox_data != ''">
Modified: trunk/sms/templates/base/command.xsl
===================================================================
--- trunk/sms/templates/base/command.xsl 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/sms/templates/base/command.xsl 2008-02-14 11:54:40 UTC (rev
18482)
@@ -14,7 +14,11 @@
</xsl:template>
<xsl:template match="list">
- <xsl:call-template name="menu"/>
+ <xsl:choose>
+ <xsl:when test="menu != ''">
+ <xsl:apply-templates select="menu"/>
+ </xsl:when>
+ </xsl:choose>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<xsl:choose>
<xsl:when test="msgbox_data != ''">
@@ -285,7 +289,11 @@
<xsl:template match="log">
- <xsl:call-template name="menu"/>
+ <xsl:choose>
+ <xsl:when test="menu != ''">
+ <xsl:apply-templates select="menu"/>
+ </xsl:when>
+ </xsl:choose>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<tr>
<td>
@@ -364,7 +372,14 @@
<xsl:value-of select="sender"/>
</td>
<td align="left">
+ <xsl:choose>
+ <xsl:when test="link_redirect != ''">
+ <a href="{link_redirect}"
><xsl:value-of select="param"/></a>
+ </xsl:when>
+ <xsl:otherwise>
<xsl:value-of select="param"/>
+ </xsl:otherwise>
+ </xsl:choose>
</td>
<td align="left">
<xsl:value-of select="datetime"/>
Added: trunk/sms/templates/base/config.tpl
===================================================================
--- trunk/sms/templates/base/config.tpl (rev 0)
+++ trunk/sms/templates/base/config.tpl 2008-02-14 11:54:40 UTC (rev 18482)
@@ -0,0 +1,30 @@
+<!-- BEGIN header -->
+<form method="POST" action="{action_url}">
+<table border="0" align="center" width="85%">
+<!--
+ <tr class="th">
+ <td colspan="2"><font color="{th_text}"> <b>{title}</b></font></td>
+ </tr>
+-->
+<!-- END header -->
+<!-- BEGIN body -->
+
+<!-- END body -->
+<!-- BEGIN footer -->
+<!--
+ <tr class="th">
+ <td colspan="2">
+
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2" align="center">
+ <input type="submit" name="submit" value="{lang_submit}">
+ <input type="submit" name="cancel" value="{lang_cancel}">
+ </td>
+ </tr>
+-->
+</table>
+</form>
+<!-- END footer -->
Modified: trunk/sms/templates/base/config.xsl
===================================================================
--- trunk/sms/templates/base/config.xsl 2008-02-10 09:33:46 UTC (rev 18481)
+++ trunk/sms/templates/base/config.xsl 2008-02-14 11:54:40 UTC (rev 18482)
@@ -15,7 +15,11 @@
</xsl:template>
<xsl:template match="list_type">
- <xsl:call-template name="menu"/>
+ <xsl:choose>
+ <xsl:when test="menu != ''">
+ <xsl:apply-templates select="menu"/>
+ </xsl:when>
+ </xsl:choose>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<xsl:choose>
<xsl:when test="msgbox_data != ''">
@@ -111,7 +115,11 @@
<xsl:template match="list_attrib">
- <xsl:call-template name="menu"/>
+ <xsl:choose>
+ <xsl:when test="menu != ''">
+ <xsl:apply-templates select="menu"/>
+ </xsl:when>
+ </xsl:choose>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<xsl:choose>
<xsl:when test="msgbox_data != ''">
@@ -204,7 +212,11 @@
<xsl:template match="list_value">
- <xsl:call-template name="menu"/>
+ <xsl:choose>
+ <xsl:when test="menu != ''">
+ <xsl:apply-templates select="menu"/>
+ </xsl:when>
+ </xsl:choose>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<xsl:choose>
<xsl:when test="msgbox_data != ''">
@@ -792,7 +804,11 @@
</xsl:template>
<xsl:template match="daemon_manual">
- <xsl:call-template name="menu"/>
+ <xsl:choose>
+ <xsl:when test="menu != ''">
+ <xsl:apply-templates select="menu"/>
+ </xsl:when>
+ </xsl:choose>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<xsl:choose>
<xsl:when test="msgbox_data != ''">
Modified: trunk/sms/templates/base/menu.xsl
===================================================================
--- trunk/sms/templates/base/menu.xsl 2008-02-10 09:33:46 UTC (rev 18481)
+++ trunk/sms/templates/base/menu.xsl 2008-02-14 11:54:40 UTC (rev 18482)
@@ -1,61 +1,60 @@
- <xsl:template name="menu">
- <xsl:apply-templates select="links"/>
- </xsl:template>
- <xsl:template match="links">
- <table width="100%" align="center">
+ <xsl:template match="menu">
+ <table width="100%" align="center" id="legacy-menu">
<tr >
<xsl:attribute name="class">
<xsl:text>row_on</xsl:text>
</xsl:attribute>
<td align="left">
- <xsl:for-each select="module" >
+ <xsl:for-each select="navigation" >
<xsl:text> </xsl:text>
<xsl:choose>
<xsl:when test="this=1">
- <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>
+ <a
href="{url}"><b><xsl:text>[</xsl:text><xsl:value-of
select="text"/><xsl:text>]</xsl:text></b></a>
</xsl:when>
<xsl:otherwise>
- <a href="{url}"
onMouseover="window.status='{statustext}';return true;"
onMouseout="window.status='';return true;"><xsl:value-of select="text"/></a>
+ <a
href="{url}"><xsl:value-of select="text"/></a>
</xsl:otherwise>
</xsl:choose>
-
</xsl:for-each>
</td>
</tr>
- <tr>
+ <xsl:for-each select="navigation" >
+ <xsl:choose>
+ <xsl:when test="children">
+ <tr >
<xsl:attribute name="class">
<xsl:text>row_off</xsl:text>
</xsl:attribute>
<td align="left">
- <xsl:for-each select="sub_menu" >
+ <xsl:for-each
select = "children" >
<xsl:text> </xsl:text>
<xsl:choose>
<xsl:when test="this=1">
- <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>
+
<a href="{url}"><b><xsl:text>[</xsl:text><xsl:value-of
select="text"/><xsl:text>]</xsl:text></b></a>
</xsl:when>
<xsl:otherwise>
- <a href="{url}"
onMouseover="window.status='{statustext}';return true;"
onMouseout="window.status='';return true;"><xsl:value-of select="text"/></a>
+
<a href="{url}"><xsl:value-of select="text"/></a>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</td>
</tr>
-
+ <xsl:for-each select =
"children" >
<xsl:choose>
- <xsl:when test="sub_menu_2!=''">
- <tr>
+ <xsl:when
test="children">
+ <tr >
<xsl:attribute name="class">
-
<xsl:text>row_off</xsl:text>
+
<xsl:text>row_on</xsl:text>
</xsl:attribute>
<td align="left">
- <xsl:for-each
select="sub_menu_2" >
+
<xsl:for-each select = "children" >
<xsl:text>
</xsl:text>
<xsl:choose>
<xsl:when test="this=1">
-
<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>
+
<a
href="{url}"><b><xsl:text>[</xsl:text><xsl:value-of
select="text"/><xsl:text>]</xsl:text></b></a>
</xsl:when>
<xsl:otherwise>
-
<a href="{url}" onMouseover="window.status='{statustext}';return true;"
onMouseout="window.status='';return true;"><xsl:value-of select="text"/></a>
+
<a href="{url}"><xsl:value-of
select="text"/></a>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
@@ -63,7 +62,9 @@
</tr>
</xsl:when>
</xsl:choose>
-
+ </xsl:for-each>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:for-each>
</table>
- <hr noshade="noshade" width="100%" align="center" size="1"/>
</xsl:template>
Modified: trunk/sms/templates/base/no_access.xsl
===================================================================
--- trunk/sms/templates/base/no_access.xsl 2008-02-10 09:33:46 UTC (rev
18481)
+++ trunk/sms/templates/base/no_access.xsl 2008-02-14 11:54:40 UTC (rev
18482)
@@ -1,10 +1,9 @@
<!-- $Id$ -->
<xsl:template match="no_access">
-
<xsl:choose>
- <xsl:when test="links !=''">
- <xsl:call-template name="menu"/>
+ <xsl:when test="menu != ''">
+ <xsl:apply-templates select="menu"/>
</xsl:when>
</xsl:choose>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
Modified: trunk/sms/templates/base/poll.xsl
===================================================================
--- trunk/sms/templates/base/poll.xsl 2008-02-10 09:33:46 UTC (rev 18481)
+++ trunk/sms/templates/base/poll.xsl 2008-02-14 11:54:40 UTC (rev 18482)
@@ -12,7 +12,11 @@
</xsl:template>
<xsl:template match="list">
- <xsl:call-template name="menu"/>
+ <xsl:choose>
+ <xsl:when test="menu != ''">
+ <xsl:apply-templates select="menu"/>
+ </xsl:when>
+ </xsl:choose>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<xsl:choose>
<xsl:when test="msgbox_data != ''">
Modified: trunk/sms/templates/base/sms.xsl
===================================================================
--- trunk/sms/templates/base/sms.xsl 2008-02-10 09:33:46 UTC (rev 18481)
+++ trunk/sms/templates/base/sms.xsl 2008-02-14 11:54:40 UTC (rev 18482)
@@ -18,8 +18,11 @@
</xsl:template>
<xsl:template match="list_inbox">
-
- <xsl:call-template name="menu"/>
+ <xsl:choose>
+ <xsl:when test="menu != ''">
+ <xsl:apply-templates select="menu"/>
+ </xsl:when>
+ </xsl:choose>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<xsl:choose>
<xsl:when test="msgbox_data != ''">
@@ -130,7 +133,11 @@
</xsl:template>
<xsl:template match="list_outbox">
- <xsl:call-template name="menu"/>
+ <xsl:choose>
+ <xsl:when test="menu != ''">
+ <xsl:apply-templates select="menu"/>
+ </xsl:when>
+ </xsl:choose>
<table width="100%" cellpadding="2" cellspacing="2"
align="center">
<xsl:choose>
<xsl:when test="msgbox_data != ''">
Modified: trunk/todo/inc/class.menu.inc.php
===================================================================
--- trunk/todo/inc/class.menu.inc.php 2008-02-10 09:33:46 UTC (rev 18481)
+++ trunk/todo/inc/class.menu.inc.php 2008-02-14 11:54:40 UTC (rev 18482)
@@ -6,7 +6,7 @@
* @copyright Copyright (C) 2007 Free Software Foundation, Inc.
http://www.fsf.org/
* @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
* @package todo
- * @version $Id: class.menu.inc.php 690 2008-02-02 10:11:33Z dave $
+ * @version $Id: class.menu.inc.php 727 2008-02-08 04:13:28Z dave $
*/
/*
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] [18482] Another merge from resight, here is a brief changelog,
Dave Hall <=