Commit 78011656 authored by Jean-Paul Saman's avatar Jean-Paul Saman

Update index.php for web2project

parent b4dd270f
<?php
/*
* Copyright (C) 2007-2008, M2X
* Copyright (C) 2007-2014, M2X BV
*
* Authors: Jean-Paul Saman
*
......@@ -19,30 +19,32 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
$perms =& $AppUI->acl();
if (!defined('W2P_BASE_DIR')) {
die('You should not access this file directly.');
}
global $AppUI;
$perms = $AppUI->acl();
if (!$perms->checkModuleItem('timesheet', 'access')) {
$AppUI->redirect(ACCESS_DENIED);
}
// Which tab do we need to show?
$tab = $AppUI->processIntState('timesheetIdxTab', $_GET, 'tab', 0);
// we check for permissions on this module
$canRead = !getDenyRead( $m );
$canEdit = !getDenyEdit( $m );
$canRead = $perms->checkModule( $m, 'view' );
$canEdit = $perms->checkModule( $m, 'edit' );
$canDelete = $perms->checkModule( $m, 'delete' );
// lock out users that do not have at least readPermission on this module
if (!$canRead) {
$AppUI->redirect( "m=public&a=access_denied" );
}
//save the workplace state (have a footprint on this site)
$AppUI->savePlace();
// saves the current tab box state
if (isset( $_GET['tab'] )) {
$AppUI->setState( 'TimesheetIdxTab', $_GET['tab'] );
}
$tab = $AppUI->getState( 'TimesheetIdxTab' ) !== NULL ? $AppUI->getState( 'TimesheetIdxTab' ) : 0;
$active = intval( !$AppUI->getState( 'TimesheetIdxTab' ) );
// we prepare the User Interface Design with the dPFramework
// setup the title block with Name, Icon and Help
$titleBlock = new CTitleBlock( 'Timesheet', 'timesheet.png', $m, "$m.$a" );
$titleBlock = new w2p_Theme_TitleBlock( 'Timesheet', 'timesheet.png', $m, "$m.$a" );
$titleBlock->addCell();
// adding the 'add'-Button if user has writePermissions
......@@ -54,13 +56,13 @@ if ($canEdit) {
}
$titleBlock->show();
// now prepare and show the tabbed information boxes with the dPFramework
// now prepare and show the tabbed information boxes
// The Period default for the timesheets (month,week)
// $period = $AppUI->getPref('TIMESHEET_PERIOD');
// build new tab box object
$tabBox = new CTabBox( "?m=timesheet", dPgetConfig('root_dir') . "/modules/timesheet/", $tab );
$tabBox = new CTabBox( "?m=$m", W2P_BASE_DIR . "/modules/$m/", $tab );
$tabBox->add( 'vw_idx_timesheets', 'All timesheets' );
$tabBox->add( 'vw_idx_open', 'Open timesheets' );
$tabBox->add( 'vw_idx_submitted', 'Submitted timesheets' );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment