1 | <?php |
---|
2 | /**************************************************************************\ |
---|
3 | * eGroupWare - Knowledge Base * |
---|
4 | * http://www.egroupware.org * |
---|
5 | * ----------------------------------------------- * |
---|
6 | * This program is free software; you can redistribute it and/or modify it * |
---|
7 | * under the terms of the GNU General Public License as published by the * |
---|
8 | * Free Software Foundation; either version 2 of the License, or (at your * |
---|
9 | * option) any later version. * |
---|
10 | \**************************************************************************/ |
---|
11 | /** |
---|
12 | * @package Workflow |
---|
13 | * @license http://www.gnu.org/copyleft/gpl.html GPL |
---|
14 | */ |
---|
15 | |
---|
16 | require_once 'engine/config.egw.inc.php'; |
---|
17 | |
---|
18 | { |
---|
19 | $workflowACL = CreateObject('workflow.workflow_acl'); |
---|
20 | $userID = $GLOBALS['phpgw_info']['user']['account_id']; |
---|
21 | $apptitle = $GLOBALS['phpgw_info']['apps'][$appname]['title']; |
---|
22 | $isWorkflowAdmin = $workflowACL->checkWorkflowAdmin($userID); |
---|
23 | $isEgroupwareAdmin = $GLOBALS['phpgw']->acl->check('run',1,'admin'); |
---|
24 | |
---|
25 | // Configuration |
---|
26 | $file = array(); |
---|
27 | $menu_title = lang('%1 Configuration', $apptitle); |
---|
28 | |
---|
29 | // checking for workflow admin acl |
---|
30 | /* check if the user can administrate processes */ |
---|
31 | if (($GLOBALS['phpgw']->acl->check('admin_workflow',1,'workflow')) || ($isWorkflowAdmin)) |
---|
32 | $file['Admin Processes'] = $GLOBALS['phpgw']->link('/index.php','menuaction=workflow.ui_adminprocesses.form'); |
---|
33 | |
---|
34 | /* check if the user can administrate at least on process (this is required for him to move instances) */ |
---|
35 | if ($workflowACL->checkUserGroupAccessToType('PRO', $userID) || $isWorkflowAdmin) |
---|
36 | $file['Move Instances'] = $GLOBALS['phpgw']->link('/index.php','menuaction=workflow.ui_move_instances.form'); |
---|
37 | |
---|
38 | /* check if the user can administrate the orgchart */ |
---|
39 | if ($workflowACL->checkUserGroupAccessToType('ORG', $userID) || $isWorkflowAdmin) |
---|
40 | $file['Organization Chart'] = $GLOBALS['phpgw']->link('/index.php','menuaction=workflow.ui_orgchart.draw'); |
---|
41 | |
---|
42 | if ($isWorkflowAdmin) |
---|
43 | $file['External Applications'] = $GLOBALS['phpgw']->link('/index.php','menuaction=workflow.ui_external_applications.draw'); |
---|
44 | |
---|
45 | /* if the user is the egroupware admin, he can access some privileged areas */ |
---|
46 | if ($isEgroupwareAdmin) |
---|
47 | $file['Default config values'] = $GLOBALS['phpgw']->link('/index.php',array( |
---|
48 | 'menuaction' => 'admin.uiconfig.index', |
---|
49 | 'appname' => $appname, |
---|
50 | )); |
---|
51 | |
---|
52 | if ($isWorkflowAdmin) |
---|
53 | $file['Access Control List']= $GLOBALS['phpgw']->link('/index.php','menuaction=workflow.ui_adminaccess.form'); |
---|
54 | |
---|
55 | /* every user can access the preference area */ |
---|
56 | $file['Workflow Preferences'] = $GLOBALS['phpgw']->link('/preferences/preferences.php','appname=workflow'); |
---|
57 | |
---|
58 | /* display the current sidebox */ |
---|
59 | display_sidebox($appname,$menu_title,$file); |
---|
60 | |
---|
61 | /* check if the user can monitor at least one process */ |
---|
62 | if ($workflowACL->checkUserGroupAccessToType('MON', $userID) || $isWorkflowAdmin) |
---|
63 | { |
---|
64 | $file = array(); |
---|
65 | $menu_title = lang('%1 Monitoring', $apptitle); |
---|
66 | $file['Monitors'] = $GLOBALS['phpgw']->link('/index.php','menuaction=workflow.ui_monitors.form'); |
---|
67 | display_sidebox($appname,$menu_title,$file); |
---|
68 | } |
---|
69 | |
---|
70 | /* link to the main page of the Workflow module */ |
---|
71 | $file = array(); |
---|
72 | $menu_title = lang('%1 Menu', $apptitle); |
---|
73 | $file['User Interface'] = $GLOBALS['phpgw']->link('/workflow/index.php',''); |
---|
74 | |
---|
75 | /* display the current sidebox */ |
---|
76 | display_sidebox($appname,$menu_title,$file); |
---|
77 | } |
---|
78 | ?> |
---|