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 | * Caracter separador |
---|
14 | * @name SEP |
---|
15 | */ |
---|
16 | if (!defined('PHPGW_SERVER_ROOT')) |
---|
17 | { |
---|
18 | define('SEP', '/'); |
---|
19 | /** |
---|
20 | * Raiz do servidor |
---|
21 | * @name PHPGW_SERVER_ROOT |
---|
22 | */ |
---|
23 | define('PHPGW_SERVER_ROOT' , $_SESSION['phpgw_info']['workflow']['server_root']); |
---|
24 | /** |
---|
25 | * Caminho para o diretorio INCLUDE |
---|
26 | * @name PHPGW_INCLUDE_ROOT |
---|
27 | */ |
---|
28 | |
---|
29 | define('PHPGW_INCLUDE_ROOT', $_SESSION['phpgw_info']['workflow']['phpgw_include_root']); |
---|
30 | /** |
---|
31 | * Caminho para a PHPGW_API |
---|
32 | * @name PHPGW_API_INC |
---|
33 | */ |
---|
34 | define('PHPGW_API_INC' , $_SESSION['phpgw_info']['workflow']['phpgw_api_inc']); |
---|
35 | } |
---|
36 | |
---|
37 | require_once(PHPGW_SERVER_ROOT . SEP . 'workflow' . SEP . 'inc' . SEP . 'common.inc.php'); |
---|
38 | require_once(PHPGW_SERVER_ROOT . SEP . 'workflow' . SEP . 'inc' . SEP . 'engine' . SEP . 'class.ajax_config.inc.php'); |
---|
39 | require_once(PHPGW_SERVER_ROOT . SEP . 'workflow' . SEP . 'inc' . SEP . 'engine' . SEP . 'config.ajax.inc.php'); |
---|
40 | |
---|
41 | /** |
---|
42 | * Implementa o suporte básico para execução de métodos requisitados via AJAX |
---|
43 | * Cria objetos globais para bancos de dados, ldap, config do eGroupware e |
---|
44 | * acl do workflow |
---|
45 | * |
---|
46 | * @package Workflow |
---|
47 | * @author Mauricio Luiz Viani - viani@celepar.pr.gov.br |
---|
48 | * @author Sidnei Augusto C Drovetto - drovetto@gmail.com |
---|
49 | * @license http://www.gnu.org/copyleft/gpl.html GPL |
---|
50 | * @access public |
---|
51 | */ |
---|
52 | class bo_ajaxinterface |
---|
53 | { |
---|
54 | /** |
---|
55 | * Cria objetos globais para o ldap, banco do expresso, banco do workflow, |
---|
56 | * e acl do workflow |
---|
57 | * |
---|
58 | * @return void |
---|
59 | * @access public |
---|
60 | */ |
---|
61 | function bo_ajaxinterface() |
---|
62 | { |
---|
63 | if (isset($_SESSION['phpgw_info']['workflow']['account_id'])) |
---|
64 | { |
---|
65 | $GLOBALS['ajax']->ldap = &Factory::getInstance('ajax_ldap'); |
---|
66 | $GLOBALS['ajax']->db =& Factory::getInstance('WorkflowObjects')->getDBExpresso(); |
---|
67 | $GLOBALS['ajax']->db->Halt_On_Error = 'no'; |
---|
68 | |
---|
69 | $GLOBALS['ajax']->db_workflow =& Factory::getInstance('WorkflowObjects')->getDBWorkflow(); |
---|
70 | $GLOBALS['ajax']->db_workflow->Halt_On_Error = 'no'; |
---|
71 | |
---|
72 | $GLOBALS['phpgw']->ADOdb = &$GLOBALS['ajax']->db->Link_ID; |
---|
73 | $GLOBALS['ajax']->acl = &Factory::getInstance('so_adminaccess', Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); |
---|
74 | } |
---|
75 | else |
---|
76 | { |
---|
77 | die("Impossível executar a operação solicitada."); |
---|
78 | } |
---|
79 | } |
---|
80 | |
---|
81 | /** |
---|
82 | * Fecha a conexão com os objetos globais |
---|
83 | * |
---|
84 | * @return void |
---|
85 | * @access public |
---|
86 | */ |
---|
87 | function disconnect_all() |
---|
88 | { |
---|
89 | $GLOBALS['ajax']->db->Link_ID->Close(); |
---|
90 | $GLOBALS['ajax']->db_workflow->Link_ID->Close(); |
---|
91 | $GLOBALS['ajax']->ldap->close(); |
---|
92 | } |
---|
93 | } |
---|
94 | ?> |
---|