Changeset 1227


Ignore:
Timestamp:
07/30/09 14:55:33 (15 years ago)
Author:
viani
Message:

Ticket #593 - Verificação de ambiente na entrada do workflow.

Location:
trunk/workflow
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/workflow/inc/class.ui_userinterface.inc.php

    r795 r1227  
    2727                'printArea' => true 
    2828        ); 
    29          
     29 
    3030        /** 
    3131         * Constructor 
     
    3636 
    3737        } 
    38          
     38 
    3939        /** 
    4040         * Draw the user interface 
    41          * @param int $tabIndex  
     41         * @param int $tabIndex 
    4242         */ 
    4343        function draw($tabIndex = null) 
    4444        { 
    45                 $this->set_wf_session(); 
    46  
    47                 if (is_null($tabIndex)) 
    48                         $tabIndex = 1; 
    49  
    5045                $GLOBALS['phpgw_info']['flags']['app_header'] = $GLOBALS['phpgw_info']['apps']['workflow']['title']; 
    5146                $GLOBALS['phpgw_info']['flags'] = array('noheader' => false, 'nonavbar' => false, 'currentapp' => 'workflow'); 
    5247                $smarty = CreateObject('workflow.workflow_smarty'); 
     48 
     49                // Check if workflow config is ok 
     50                if (count($errors = $this->_checkWorkflowConfig())) 
     51                { 
     52                        $smarty->assign('header', $smarty->expressoHeader); 
     53                        $smarty->assign('footer', $smarty->expressoFooter); 
     54                        $smarty->assign('errors', $errors); 
     55                        $smarty->display('notworking.tpl'); 
     56                        return false; 
     57                } 
     58 
     59                $this->set_wf_session(); 
     60 
     61                if (is_null($tabIndex)) 
     62                        $tabIndex = 1; 
    5363 
    5464                $javaScripts = $this->get_common_js(); 
     
    8999                $smarty->assign('tabs', $tabs); 
    90100                $smarty->assign('startTab', $tabIndex); 
     101 
    91102                $smarty->display('userinterface.tpl'); 
     103        } 
     104 
     105        /** 
     106         * Check if workflow config is ok 
     107         * @param void 
     108         * @access private 
     109         * @return array Errors that were found 
     110         */ 
     111        private function _checkWorkflowConfig() 
     112        { 
     113                $errors = array(); 
     114 
     115                // Get a connection to db workflow and galaxia (module) 
     116                if ($GLOBALS['workflow']['workflowObjects']->getDBWorkflow()->Error) 
     117                        $errors[] = 'Unable to connect to database Workflow'; 
     118 
     119                if ($errormsg = $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Error) 
     120                        $errors[] = 'Unable to connect to database Galaxia'; 
     121 
     122                return $errors; 
    92123        } 
    93124 
  • trunk/workflow/inc/class.workflow_smarty.inc.php

    r795 r1227  
    8080 
    8181                /* define some directories */ 
    82                 $smartyDirectory = isset($_SESSION['phpgw_info']['workflow']['vfs_basedir']) ? 
    83                         $_SESSION['phpgw_info']['workflow']['vfs_basedir'] . '/workflow/smarty': 
    84                         $GLOBALS['phpgw_info']['server']['files_dir'] . '/workflow/smarty'; 
     82                $workflowHomeDirectory = isset($_SESSION['phpgw_info']['workflow']['vfs_basedir']) ? 
     83                        $_SESSION['phpgw_info']['workflow']['vfs_basedir'] . '/workflow': 
     84                        $GLOBALS['phpgw_info']['server']['files_dir'] . '/workflow'; 
     85                $smartyDirectory = $workflowHomeDirectory . '/smarty'; 
    8586                $templateSet = isset($_SESSION['phpgw_info']['workflow']['server']['template_set']) ? 
    8687                        $_SESSION['phpgw_info']['workflow']['server']['template_set'] : 
     
    9293                /* list of directories used by the Smarty Template Engine */ 
    9394                $directories = array( 
     95                        'home' => $workflowHomeDirectory, 
    9496                        'main' => $smartyDirectory, 
    9597                        'template' => array( 
Note: See TracChangeset for help on using the changeset viewer.