source: branches/2.2/workflow/inc/class.ui_adminsource.inc.php @ 3167

Revision 3167, 3.7 KB checked in by viani, 14 years ago (diff)

Ticket #1135 - Merged r1990:3166 from /trunk/workflow into /branches/2.2/workflow

  • Property svn:executable set to *
Line 
1<?php
2        /**************************************************************************\
3* eGroupWare                                                               *
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/**
13 * @package Workflow
14 * @license http://www.gnu.org/copyleft/gpl.html GPL
15 * @author Rodrigo Daniel C de Lira - rodrigo.lira@gmail.com
16 * @author Sidnei Augusto Drovetto Jr. - drovetto@gmail.com
17 */
18require_once dirname(__FILE__) . SEP . 'class.ui_ajaxinterface.inc.php';
19require_once 'engine' . SEP . 'config.ajax.inc.php';
20
21class ui_adminsource extends ui_ajaxinterface
22{
23        /**
24         * @var array $public_functions
25         * @access public
26         */
27        var $public_functions = array(
28                'form'  => true,
29        );
30
31        /**
32         * @var array $workflow_acl
33         * @access public
34         */
35        var $workflow_acl;
36
37        /**
38         * Constructor
39         * @access public
40         * @return object
41         */
42        function ui_adminsource()
43        {
44                $this->workflow_acl = Factory::getInstance('workflow_acl');
45                $denyAccess = true;
46                if ($this->workflow_acl->checkWorkflowAdmin($_SESSION['phpgw_info']['workflow']['account_id']))
47                {
48                        /* the user is an Expresso/Workflow admin */
49                        $denyAccess = false;
50                }
51                else
52                {
53                        if ($GLOBALS['phpgw']->acl->check('admin_workflow', 1, 'workflow'))
54                        {
55                                $pid = (int) $_GET['p_id'];
56                                /* check if the user can admin the informed process */
57                                $denyAccess = !$this->workflow_acl->check_process_access($_SESSION['phpgw_info']['workflow']['account_id'], $pid);
58                        }
59                }
60
61                if ($denyAccess)
62                {
63                        $GLOBALS['phpgw']->common->phpgw_header();
64                        echo parse_navbar();
65                        echo lang('access not permitted');
66                        $GLOBALS['phpgw']->log->message('F-Abort, Unauthorized access to workflow.ui_adminprocesses');
67                        $GLOBALS['phpgw']->log->commit();
68                        $GLOBALS['phpgw']->common->phpgw_exit();
69                }
70        }
71
72        /**
73         * Show user interface admin source form
74         * @access public
75         * @return object
76         */
77        function form()
78        {
79                $smarty = Factory::getInstance('workflow_smarty', false);
80                $smarty->setHeader(workflow_smarty::SHOW_HEADER | workflow_smarty::SHOW_NAVIGATION_BAR | workflow_smarty::SHOW_FOOTER, $GLOBALS['phpgw_info']['apps']['workflow']['title'] . ' - ' . lang('Admin Processes Sources'));
81
82                $javaScripts = $this->get_common_js();
83                $javaScripts .= $this->get_js_link('workflow','jscode', 'prototype');
84                $javaScripts .= $this->get_js_link('workflow','adminsource', 'php_folder');
85                $javaScripts .= $this->get_js_link('workflow','adminsource', 'templates_folder');
86                $javaScripts .= $this->get_js_link('workflow','adminsource', 'resources_folder');
87                $javaScripts .= $this->get_js_link('workflow','adminsource', 'includes_folder');
88                $javaScripts .= $this->get_js_link('workflow','jscode', 'lightbox');
89                $javaScripts .= $this->get_js_link('workflow','adminsource', 'main');
90
91                $css = $this->get_common_css();
92                $css .=  $this->get_css_link('lb');
93
94                $tabs = array(
95                        'Atividades',
96                        'Includes',
97                        'Templates',
98                        'Resources'
99                );
100
101                $smarty->assign('header', $smarty->expressoHeader);
102                $smarty->assign('footer', $smarty->expressoFooter);
103                $smarty->assign('txt_loading', lang('loading'));
104                $smarty->assign('javaScripts', $javaScripts);
105                $smarty->assign('css', $css);
106                $smarty->assign('tabs', $tabs);
107                $smarty->assign('processID', $_GET['p_id']);
108                $smarty->display('adminsource.tpl');
109        }
110}
111?>
Note: See TracBrowser for help on using the repository browser.