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 | * This is an 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 | |
---|
27 | /** |
---|
28 | * the base dir must be relative to this file location because |
---|
29 | * the root directory is not the some in every call. |
---|
30 | */ |
---|
31 | $base = dirname(dirname(dirname(__FILE__))); |
---|
32 | |
---|
33 | /* including expresso's header.inc.php */ |
---|
34 | require_once ($base . '/header.inc.php'); |
---|
35 | |
---|
36 | /* restoring old flags */ |
---|
37 | $GLOBALS['phpgw_info']['flags'] = $old; |
---|
38 | |
---|
39 | |
---|
40 | /* assure that the correct encoding will be used (e.g string functions) */ |
---|
41 | setlocale(LC_CTYPE, 'pt_BR', 'pt_BR.iso-8859-1', 'pt_BR.utf-8'); |
---|
42 | |
---|
43 | |
---|
44 | /* define o umask para a criação de arquivos por parte do Workflow */ |
---|
45 | umask(007); |
---|
46 | |
---|
47 | |
---|
48 | /** |
---|
49 | * Server base path. In this module, we should only use |
---|
50 | * constants defined here. PHPGW_SERVER_ROOT is defined |
---|
51 | * on 'header.inc.php' which is always included by this |
---|
52 | * file. |
---|
53 | * @name EGW_SERVER_ROOT |
---|
54 | */ |
---|
55 | define('EGW_SERVER_ROOT', PHPGW_SERVER_ROOT); |
---|
56 | |
---|
57 | /** |
---|
58 | * Server include base path. We must define our own constants |
---|
59 | * because there are several cases in which workflow is called |
---|
60 | * directly, thus PHPGW constants are not defined. |
---|
61 | * @name EGW_INC_ROOT |
---|
62 | */ |
---|
63 | define('EGW_INC_ROOT', EGW_SERVER_ROOT . '/phpgwapi/inc/'); |
---|
64 | |
---|
65 | /** |
---|
66 | * Workflow base path. |
---|
67 | * @name WF_SERVER_ROOT |
---|
68 | */ |
---|
69 | define('WF_SERVER_ROOT', EGW_SERVER_ROOT.'/workflow/'); |
---|
70 | |
---|
71 | /** |
---|
72 | * Workflow include path. |
---|
73 | * @name WF_INC_ROOT |
---|
74 | */ |
---|
75 | define('WF_INC_ROOT', WF_SERVER_ROOT.'/inc/'); |
---|
76 | |
---|
77 | /** |
---|
78 | * Workflow lib base dir. |
---|
79 | * @name WF_LIB_ROOT |
---|
80 | */ |
---|
81 | define('WF_LIB_ROOT', WF_SERVER_ROOT.'/lib/'); |
---|
82 | |
---|
83 | |
---|
84 | /* including common classes */ |
---|
85 | require_once WF_LIB_ROOT . 'security/Security.php'; |
---|
86 | require_once WF_LIB_ROOT . 'factory/Factory.php'; |
---|
87 | require_once WF_LIB_ROOT . 'factory/BaseFactory.php'; |
---|
88 | require_once WF_LIB_ROOT . 'factory/WorkflowFactory.php'; |
---|
89 | require_once WF_LIB_ROOT . 'factory/ProcessFactory.php'; |
---|
90 | require_once WF_LIB_ROOT . 'settings/Settings.php'; |
---|
91 | |
---|
92 | /** |
---|
93 | * Expresso base url. |
---|
94 | * @name EGW_BASE_URL |
---|
95 | */ |
---|
96 | define('EGW_BASE_URL', Settings::get('expresso', 'webserver_url')); |
---|
97 | |
---|
98 | /** |
---|
99 | * Workflow base url. |
---|
100 | * @name WF_BASE_URL |
---|
101 | */ |
---|
102 | define('WF_BASE_URL', EGW_BASE_URL . "/workflow/"); |
---|
103 | ?> |
---|