Commit 902a5843 authored by Jean-Paul Saman's avatar Jean-Paul Saman

Cleanup tabs and reformat

parent e8afdac0
......@@ -27,7 +27,7 @@ $timesheet_id = intval( dPgetParam( $_GET, "timesheet_id", 0 ) );
// check permissions for this record
$canEdit = !getDenyEdit( $m, $timesheet_id );
if (!$canEdit) {
$AppUI->redirect( "m=public&a=access_denied" );
$AppUI->redirect( "m=public&a=access_denied" );
}
$canDelete = $perms->checkModule( $m, 'delete' );
......@@ -53,12 +53,12 @@ $obj = new CTimesheet();
// load the record data in case of that this script is used to edit the timesheet qith timesheet_id (transmitted via GET)
if (!$obj->load( $timesheet_id, false ) && ($timesheet_id > 0) ) {
// show some error messages using the dPFramework if loadOperation failed
// these error messages are nicely integrated with the frontend of dP
// use detailed error messages as often as possible
$AppUI->setMsg( 'Timesheet' );
$AppUI->setMsg( "invalidID", UI_MSG_ERROR, true );
$AppUI->redirect(); // go back to the calling location
// show some error messages using the dPFramework if loadOperation failed
// these error messages are nicely integrated with the frontend of dP
// use detailed error messages as often as possible
$AppUI->setMsg( 'Timesheet' );
$AppUI->setMsg( "invalidID", UI_MSG_ERROR, true );
$AppUI->redirect(); // go back to the calling location
}
// setup the title block
......@@ -68,7 +68,7 @@ $ttl = ( $timesheet_id > 0 ) ? "Edit Timesheet" : "New Timesheet";
$titleBlock = new CTitleBlock( $ttl, 'timesheet.png', $m, "$m.$a" );
$titleBlock->addCrumb( "?m=timesheet", "view all timesheets" );
if ($canDelete && ($timesheet_id > 0) ) {
$titleBlock->addCrumbDelete( 'delete timesheet', $canDelete, $msg );
$titleBlock->addCrumbDelete( 'delete timesheet', $canDelete, $msg );
}
$titleBlock->show();
......
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