Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpidb
mpg_gfk
Commits
4e68f967
Commit
4e68f967
authored
Jun 13, 2016
by
Gerd Schachtschneider
Browse files
update sortierung
parent
71dc5d7f
Changes
1
Show whitespace changes
Inline
Side-by-side
conf/ApplicationDelegate.php
0 → 100644
View file @
4e68f967
<?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'
;
}
}
?>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment