source: sandbox/workflow/branches/609/inc/class.bo_ajaxinterface.inc.php @ 2311

Revision 2311, 3.1 KB checked in by pedroerp, 14 years ago (diff)

Ticket #609 - Migrando instanciação das classes da engine para a factory.

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