Commit 4e68f967 authored by Gerd Schachtschneider's avatar Gerd Schachtschneider
Browse files

update sortierung

parent 71dc5d7f
<?php
/**
* A delegate class for the entire application to handle custom handling of
* some functions such as permissions and preferences.
*/
class conf_ApplicationDelegate {
/**
* Returns permissions array. This method is called every time an action is
* performed to make sure that the user has permission to perform the action.
* @param record A Dataface_Record object (may be null) against which we check
* permissions.
* @see Dataface_PermissionsTool
* @see Dataface_AuthenticationTool
*/
function getPermissions(&$record) {
$auth =& Dataface_AuthenticationTool::getInstance();
$user =& $auth->getLoggedInUser();
// if the user is null then nobody is logged in... no access. This will force a login prompt.
if ( !isset($user) ) return Dataface_PermissionsTool::getRolePermissions('NO ACCESS');
$role = $user->val('role');
// specially role with lower permissions as READ ONLY
if ( strpos($role,'VIEW GROUP ') !== false) return Dataface_PermissionsTool::getRolePermissions('NO ACCESS');
return Dataface_PermissionsTool::getRolePermissions($role);
// Returns all of the permissions for the user's current role.
}
function block__custom_javascripts() {
echo '<script src="custom.js" type="text/javascript" language="javascript"></script>';
}
// Sortierung erfolgt fuer das erste Mal nicht uber sort in index.php,
// daher die Einstellung besser hier. Aber dann ist diese nicht mehr global und
// sollte dann nicht mehr verlinkt werden
// Nachteil: Aenderungen muessen immer wieder nachgezogen werden
function beforeHandleRequest() {
$app = Dataface_Application::getInstance();
$query =& $app->getQuery();
// Sortierung aendern Common
if ( !$_POST AND $query['-table'] == 'list_reiter' AND !@$query['-sort'] ) $query['-sort'] = 'reiter';
if ( !$_POST AND $query['-table'] == 'mpi_ablage' AND !@$query['-sort'] ) $query['-sort'] = 'zeitstempel DESC';
if ( !$_POST and $query['-table'] == 'mpi_users' AND !@$query['-sort'] ) $query['-sort'] = 'zeitstempel DESC';
// Sortierung aendern individuell
if ( !$_POST AND $query['-table'] == 'list_gefahr' AND !@$query['-sort'] ) $query['-sort'] = 'hsatz';
if ( !$_POST AND $query['-table'] == 'list_lgk' AND !@$query['-sort'] ) $query['-sort'] = 'priority';
if ( !$_POST AND $query['-table'] == 'view_gefahr' AND !@$query['-sort'] ) $query['-sort'] = 'kategorie, substanz';
if ( !$_POST AND $query['-table'] == 'view_chemAll' AND !@$query['-sort'] ) $query['-sort'] = 'substanz, gruppe';
if ( !$_POST AND $query['-table'] == 'view_ablageAll' AND !@$query['-sort'] ) $query['-sort'] = 'zeitstempel DESC';
}
}
?>
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