source: trunk/expressoAdmin1_2/inc/class.institutional_accounts.inc.php @ 5133

Revision 5133, 4.0 KB checked in by wmerlotto, 12 years ago (diff)

Ticket #2305 - Enviando alteracoes, desenvolvidas internamente na Prognus, do modulo ExpressoAdmin.

Line 
1<?php
2        /***********************************************************************************\
3        * Expresso Administração                                                                                                                        *
4        * by Joao Alfredo Knopik Junior (joao.alfredo@gmail.com, jakjr@celepar.pr.gov.br)       *
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        define('PHPGW_API_INC','../phpgwapi/inc');
13
14        class institutional_accounts
15        {
16                var $public_functions = array
17                (
18                        'index' => True
19                );
20               
21                var $functions;
22
23                function institutional_accounts()
24                {                       
25                        if (function_exists('CreateObject'))
26                        {
27                                $this->functions = CreateObject('expressoAdmin1_2.functions');
28                               
29                                if(!@is_object($GLOBALS['phpgw']->js))
30                                {
31                                        $GLOBALS['phpgw']->js = CreateObject('phpgwapi.javascript');
32                                }
33                                $GLOBALS['phpgw']->js->validate_file('jscode','connector','expressoAdmin1_2');#diretorio, arquivo.js, aplicacao
34                                $GLOBALS['phpgw']->js->validate_file('jscode','finder','expressoAdmin1_2');
35                                $GLOBALS['phpgw']->js->validate_file('jscode','institutional_accounts','expressoAdmin1_2');
36                                $GLOBALS['phpgw']->js->validate_file('modal','modal','expressoAdmin1_2');
37                                $GLOBALS['phpgw']->js->validate_file('jscode','expressoadmin','expressoAdmin1_2');
38                        }
39                }
40
41                function index()
42                {
43                        /* Begin:  Check manager access */
44                        $account_lid = $GLOBALS['phpgw']->accounts->data['account_lid'];
45                        $acl = $this->functions->read_acl($account_lid);
46                        $contexts = $acl['contexts'];
47                        foreach ($acl['contexts_display'] as $index=>$tmp_context) {
48                                $context_display .= '<br>'.$tmp_context;
49                        }
50                       
51                        if (!$this->functions->check_acl($account_lid,'list_institutional_accounts')) {
52                                $GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/expressoAdmin1_2/inc/access_denied.php'));
53                        }
54                        /* End: Check manager access */
55
56                        unset($GLOBALS['phpgw_info']['flags']['noheader']);
57                        unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
58                        $GLOBALS['phpgw_info']['flags']['app_header'] = $GLOBALS['phpgw_info']['apps']['expressoAdmin1_2']['title'].' - '.lang('Institutional accounts');
59                        $GLOBALS['phpgw']->common->phpgw_header();
60
61                        $p = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
62
63                        $p->set_file(
64                                                Array(
65                                                                'institutional_accounts'                => 'institutional_accounts.tpl',
66                                                                'institutional_accounts_modal'  =>'institutional_accounts_modal.tpl'
67                                                        )
68                                                );
69                        $p->set_block('institutional_accounts','body');
70                       
71                        /* dinamic load lang */
72                        $p->set_var($this->functions->make_dinamic_lang($p, 'body'));
73                        $p->set_var($this->functions->make_dinamic_lang($p, 'institutional_accounts_modal'));
74
75
76                        /* Begin: set modal */
77
78                        $functions = CreateObject('expressoAdmin1_2.functions');
79                       
80                        //$organizations = $functions->get_organizations($GLOBALS['phpgw_info']['server']['ldap_context']);
81                       
82                        foreach ($contexts as $index=>$context)
83                                $combo_manager_org .= $this->functions->get_organizations($context);
84                        $combo_all_orgs = $this->functions->get_organizations($GLOBALS['phpgw_info']['server']['ldap_context']);
85                       
86                        $p->set_var('manager_organizations', $combo_manager_org);
87                        $p->set_var('all_organizations', $combo_all_orgs);
88                       
89                        $modal_id = 'institutional_accounts_modal';
90                        $p->set_var('modal_id', $modal_id);
91                        $institutional_accounts_modal_tpl = $p->fp('out','institutional_accounts_modal');
92                        /* End: set modal */
93                       
94                        $var = Array(
95                                'th_bg'                                         => $GLOBALS['phpgw_info']['theme']['th_bg'],
96                                'back_url'                                      => $GLOBALS['phpgw']->link('/expressoAdmin1_2/index.php'),
97                                'context_display'                       => $context_display,
98                                'institutional_accounts_modal' => $institutional_accounts_modal_tpl,
99                                'onclick_create_institutional_account' => "modal(\"$modal_id\",\"create\")"
100                        );
101                        $p->set_var($var);
102                        $p->pfp('out','body');
103                }
104
105        }
106?>
Note: See TracBrowser for help on using the repository browser.