source: trunk/workflow/inc/hook_sidebox_menu.inc.php @ 5307

Revision 5307, 3.6 KB checked in by pereira.jair, 12 years ago (diff)

Ticket #2416 - Inclusao da nova ferramenta de relatorios do workflow.

  • 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,0) || $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                $file['Reports']= $GLOBALS['phpgw']->link('/index.php','menuaction=workflow.reports.form');     
56        }
57
58        /* every user can access the preference area */
59        $file['Workflow Preferences'] = $GLOBALS['phpgw']->link('/preferences/preferences.php','appname=workflow');
60
61        /* display the current sidebox */
62        display_sidebox($appname,$menu_title,$file);
63
64        /* check if the user can monitor at least one process */
65        if ($workflowACL->checkUserGroupAccessToType('MON', $userID) || $isWorkflowAdmin)
66        {
67                $file = array();
68                $menu_title             = lang('%1 Monitoring', $apptitle);
69                $file['Monitors']       = $GLOBALS['phpgw']->link('/index.php','menuaction=workflow.ui_monitors.form');
70                display_sidebox($appname,$menu_title,$file);
71        }
72
73        /* link to the main page of the Workflow module */
74        $file = array();
75        $menu_title = lang('%1 Menu', $apptitle);
76        $file['User Interface']      = $GLOBALS['phpgw']->link('/workflow/index.php','');
77
78        /* display the current sidebox */
79        display_sidebox($appname,$menu_title,$file);
80}
81?>
Note: See TracBrowser for help on using the repository browser.