[795] | 1 | <?php |
---|
[2372] | 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 | \**************************************************************************/ |
---|
[1468] | 11 | |
---|
[2372] | 12 | /** |
---|
[2418] | 13 | * This is other big workaround. In ajax calls, we use controller.php |
---|
| 14 | * directly, which do not includes header.inc for performance issues. |
---|
| 15 | * However, for phpgwAPI to work properly we need to set several |
---|
| 16 | * constants and objects, which are created in this file (header.inc). |
---|
| 17 | * As much as this problem still unsolved (by phpAPI group), this potencially |
---|
| 18 | * problematic and ugly code must still here.. =( |
---|
| 19 | */ |
---|
| 20 | $old = $GLOBALS['phpgw_info']['flags']; |
---|
| 21 | $GLOBALS['phpgw_info']['flags'] = array( |
---|
| 22 | 'noheader' => True, |
---|
| 23 | 'nonavbar' => True, |
---|
| 24 | 'currentapp' => 'workflow' |
---|
| 25 | ); |
---|
| 26 | /* TODO TODO TODO TODO */ |
---|
| 27 | $base = dirname(dirname(dirname(__FILE__))); |
---|
| 28 | require_once ($base . '/header.inc.php'); |
---|
| 29 | $GLOBALS['phpgw_info']['flags'] = $old; |
---|
| 30 | |
---|
| 31 | |
---|
| 32 | /** |
---|
| 33 | * Server base path. In this module, we should only use |
---|
| 34 | * constants defined here. PHPGW_SERVER_ROOT is defined |
---|
| 35 | * on 'header.inc.php' which is always included by this |
---|
| 36 | * file. |
---|
[2372] | 37 | * @name EGW_SERVER_ROOT |
---|
[795] | 38 | */ |
---|
[2418] | 39 | define('EGW_SERVER_ROOT', PHPGW_SERVER_ROOT); |
---|
[795] | 40 | |
---|
[2372] | 41 | /** |
---|
| 42 | * Server include base path. We must define our own constants |
---|
| 43 | * because there are several cases in which workflow is called |
---|
| 44 | * directly, thus PHPGW constants are not defined. |
---|
| 45 | * @name EGW_INC_ROOT |
---|
| 46 | */ |
---|
| 47 | define('EGW_INC_ROOT', EGW_SERVER_ROOT . '/phpgwapi/inc/'); |
---|
[795] | 48 | |
---|
[2372] | 49 | /** |
---|
| 50 | * Workflow base path. |
---|
| 51 | * @name WF_SERVER_ROOT |
---|
| 52 | */ |
---|
| 53 | define('WF_SERVER_ROOT', EGW_SERVER_ROOT.'/workflow/'); |
---|
[795] | 54 | |
---|
| 55 | /** |
---|
[2372] | 56 | * Workflow include path. |
---|
| 57 | * @name WF_INC_ROOT |
---|
[795] | 58 | */ |
---|
[2372] | 59 | define('WF_INC_ROOT', WF_SERVER_ROOT.'/inc/'); |
---|
[795] | 60 | |
---|
| 61 | /** |
---|
[2372] | 62 | * Workflow lib base dir. |
---|
| 63 | * @name WF_LIB_ROOT |
---|
[795] | 64 | */ |
---|
[2372] | 65 | define('WF_LIB_ROOT', WF_SERVER_ROOT.'/lib/'); |
---|
| 66 | |
---|
| 67 | |
---|
| 68 | |
---|
| 69 | /* assure that the correct encondig will be used (e.g string functions) */ |
---|
| 70 | setlocale(LC_CTYPE, 'pt_BR', 'pt_BR.iso-8859-1', 'pt_BR.utf-8'); |
---|
| 71 | |
---|
| 72 | |
---|
| 73 | /* define o umask para a criação de arquivos por parte do Workflow */ |
---|
| 74 | umask(007); |
---|
| 75 | |
---|
| 76 | |
---|
| 77 | /* including common classes */ |
---|
| 78 | require_once WF_LIB_ROOT . 'security/Security.php'; |
---|
| 79 | require_once WF_LIB_ROOT . 'factory/Factory.php'; |
---|
| 80 | require_once WF_LIB_ROOT . 'factory/BaseFactory.php'; |
---|
| 81 | require_once WF_LIB_ROOT . 'factory/WorkflowFactory.php'; |
---|
| 82 | require_once WF_LIB_ROOT . 'factory/ProcessFactory.php'; |
---|
[2418] | 83 | require_once WF_LIB_ROOT . 'settings/Settings.php'; |
---|
[2372] | 84 | |
---|
[2418] | 85 | Settings::load(); |
---|
| 86 | |
---|
[2372] | 87 | $GLOBALS['workflow']['workflowObjects'] = Factory::getInstance('WorkflowObjects'); |
---|
[795] | 88 | ?> |
---|