source: sandbox/workflow/trunk/inc/hook_sidebox_menu.inc.php @ 2372

Revision 2372, 3.5 KB checked in by pedroerp, 14 years ago (diff)

Ticket #609 - Merged 2197:2356 /sandbox/workflow/branches/609/ em /sandbox/workflow/trunk.

  • Property svn:executable set to *
Line 
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
16require_once 'common.inc.php';
17require_once 'engine/config.egw.inc.php';
18
19{
20        $workflowACL = Factory::getInstance('workflow_acl');
21        $userID = $GLOBALS['phpgw_info']['user']['account_id'];
22        $apptitle = $GLOBALS['phpgw_info']['apps'][$appname]['title'];
23        $isWorkflowAdmin = $workflowACL->checkWorkflowAdmin($userID);
24        $isEgroupwareAdmin = $GLOBALS['phpgw']->acl->check('run',1,'admin');
25
26        // Configuration
27        $file = array();
28        $menu_title = lang('%1 Configuration', $apptitle);
29
30        // checking for workflow admin acl
31        /* check if the user can administrate processes */
32        if (($GLOBALS['phpgw']->acl->check('admin_workflow',1,'workflow')) || ($isWorkflowAdmin))
33                $file['Admin Processes']        = $GLOBALS['phpgw']->link('/index.php','menuaction=workflow.ui_adminprocesses.form');
34
35        /* check if the user can administrate at least on process (this is required for him to move instances) */
36        if ($workflowACL->checkUserGroupAccessToType('PRO', $userID) || $isWorkflowAdmin)
37                $file['Move Instances'] = $GLOBALS['phpgw']->link('/index.php','menuaction=workflow.ui_move_instances.form');
38
39        /* check if the user can administrate the orgchart */
40        if ($workflowACL->checkUserGroupAccessToType('ORG', $userID) || $isWorkflowAdmin)
41                $file['Organization Chart']     = $GLOBALS['phpgw']->link('/index.php','menuaction=workflow.ui_orgchart.draw');
42
43        if ($isWorkflowAdmin)
44                $file['External Applications'] = $GLOBALS['phpgw']->link('/index.php','menuaction=workflow.ui_external_applications.draw');
45
46        /* if the user is the egroupware admin, he can access some privileged areas */
47        if ($isEgroupwareAdmin)
48                $file['Default config values']  = $GLOBALS['phpgw']->link('/index.php',array(
49                        'menuaction'    => 'admin.uiconfig.index',
50                        'appname'       => $appname,
51                ));
52
53        if ($isWorkflowAdmin)
54                $file['Access Control List']= $GLOBALS['phpgw']->link('/index.php','menuaction=workflow.ui_adminaccess.form');
55
56        /* every user can access the preference area */
57        $file['Workflow Preferences'] = $GLOBALS['phpgw']->link('/preferences/preferences.php','appname=workflow');
58
59        /* display the current sidebox */
60        display_sidebox($appname,$menu_title,$file);
61
62        /* check if the user can monitor at least one process */
63        if ($workflowACL->checkUserGroupAccessToType('MON', $userID) || $isWorkflowAdmin)
64        {
65                $file = array();
66                $menu_title             = lang('%1 Monitoring', $apptitle);
67                $file['Monitors']       = $GLOBALS['phpgw']->link('/index.php','menuaction=workflow.ui_monitors.form');
68                display_sidebox($appname,$menu_title,$file);
69        }
70
71        /* link to the main page of the Workflow module */
72        $file = array();
73        $menu_title = lang('%1 Menu', $apptitle);
74        $file['User Interface']      = $GLOBALS['phpgw']->link('/workflow/index.php','');
75
76        /* display the current sidebox */
77        display_sidebox($appname,$menu_title,$file);
78}
79?>
Note: See TracBrowser for help on using the repository browser.