1 | <?php |
---|
2 | |
---|
3 | class uiconfiguration |
---|
4 | { |
---|
5 | |
---|
6 | var $public_functions = array |
---|
7 | ( |
---|
8 | 'index' => True |
---|
9 | ); |
---|
10 | |
---|
11 | var $functions; |
---|
12 | var $boconfiguration; |
---|
13 | |
---|
14 | function uiconfiguration() |
---|
15 | { |
---|
16 | |
---|
17 | |
---|
18 | |
---|
19 | if (function_exists('CreateObject')) |
---|
20 | { |
---|
21 | $this->functions = CreateObject('expressoAdmin1_2.functions'); |
---|
22 | $this->boconfiguration = CreateObject('expressoAdmin1_2.boconfiguration'); |
---|
23 | |
---|
24 | if(!@is_object($GLOBALS['phpgw']->js)) |
---|
25 | { |
---|
26 | $GLOBALS['phpgw']->js = CreateObject('phpgwapi.javascript'); |
---|
27 | } |
---|
28 | $GLOBALS['phpgw']->js->validate_file('jscode','connector','expressoAdmin1_2');#diretorio, arquivo.js, aplicacao |
---|
29 | $GLOBALS['phpgw']->js->validate_file('jscode','finder','expressoAdmin1_2'); |
---|
30 | $GLOBALS['phpgw']->js->validate_file('jscode','configurations','expressoAdmin1_2'); |
---|
31 | $GLOBALS['phpgw']->js->validate_file('modal','modal','expressoAdmin1_2'); |
---|
32 | $GLOBALS['phpgw']->js->validate_file('jscode','expressoadmin','expressoAdmin1_2'); |
---|
33 | } |
---|
34 | } |
---|
35 | |
---|
36 | |
---|
37 | function index() |
---|
38 | { |
---|
39 | |
---|
40 | |
---|
41 | /* Begin: Check manager access */ |
---|
42 | $account_lid = $GLOBALS['phpgw']->accounts->data['account_lid']; |
---|
43 | $acl = $this->functions->read_acl($account_lid); |
---|
44 | $contexts = $acl['contexts']; |
---|
45 | foreach ($acl['contexts_display'] as $index=>$tmp_context) { |
---|
46 | $context_display .= '<br>'.$tmp_context; |
---|
47 | } |
---|
48 | |
---|
49 | |
---|
50 | if (!$this->functions->check_acl($account_lid,'configurations')) { |
---|
51 | $GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/expressoAdmin1_2/inc/access_denied.php')); |
---|
52 | } |
---|
53 | /* End: Check manager access */ |
---|
54 | |
---|
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('Configurations'); |
---|
59 | $GLOBALS['phpgw']->common->phpgw_header(); |
---|
60 | |
---|
61 | |
---|
62 | $template = CreateObject('phpgwapi.Template',PHPGW_APP_TPL); |
---|
63 | |
---|
64 | $template->set_file( |
---|
65 | Array( |
---|
66 | 'configurationTPL' => 'configuration.tpl', |
---|
67 | 'limitByUserModal' => 'configuration_limit_by_user_modal.tpl', |
---|
68 | 'limitByGroupModal' => 'configuration_limit_by_group_modal.tpl', |
---|
69 | 'blockEmailForInstitutionalAccountModal' => 'configuration_block_email_for_institutional_account.tpl' |
---|
70 | ) |
---|
71 | ); |
---|
72 | |
---|
73 | $template->set_var($this->functions->make_dinamic_lang($template, 'limitByUserModal')); |
---|
74 | $template->set_var($this->functions->make_dinamic_lang($template, 'limitByGroupModal')); |
---|
75 | $template->set_var($this->functions->make_dinamic_lang($template, 'blockEmailForInstitutionalAccountModal')); |
---|
76 | $template->set_block('configurationTPL','body'); |
---|
77 | |
---|
78 | $configsGlobais = $this->boconfiguration->getGlobalConfiguratons(); |
---|
79 | |
---|
80 | foreach ($contexts as $index=>$context) |
---|
81 | $comboOrganizations .= $this->boconfiguration->getSelectOrganizations($context); |
---|
82 | |
---|
83 | if($configsGlobais['expressoMail_block_institutional_comunication'] == 'true') |
---|
84 | $template->set_var('checkedBlockCommunication', 'checked = "true"'); |
---|
85 | |
---|
86 | $template->set_var('valueMaximumRecipient', $configsGlobais['expressoAdmin_maximum_recipients']); |
---|
87 | $template->set_var('optionsOrganizations', $comboOrganizations); |
---|
88 | |
---|
89 | if($this->functions->check_acl($account_lid,'edit_and_remove_maximum_number_of_recipients_by_user')) |
---|
90 | $template->set_var('tableLimitRecipientsByUser', $this->boconfiguration->getTableRulesLimitRecipientsByUser(true)); |
---|
91 | else |
---|
92 | $template->set_var('tableLimitRecipientsByUser', $this->boconfiguration->getTableRulesLimitRecipientsByUser()); |
---|
93 | |
---|
94 | if($this->functions->check_acl($account_lid,'edit_and_remove_maximum_number_of_recipients_by_group')) |
---|
95 | $template->set_var('tableLimitRecipientsByGroup', $this->boconfiguration->getTableRulesLimitRecipientsByGroup(true)); |
---|
96 | else |
---|
97 | $template->set_var('tableLimitRecipientsByGroup', $this->boconfiguration->getTableRulesLimitRecipientsByGroup()); |
---|
98 | |
---|
99 | $template->set_var('optionsBlockEmailForInstitutionalAcounteExeption', $this->boconfiguration->getOptionsBlockEmailForInstitutionalAcounteExeption()); |
---|
100 | |
---|
101 | $template->set_var($this->functions->make_dinamic_lang($template, 'body')); |
---|
102 | |
---|
103 | //Inicio validando acls |
---|
104 | if(!$this->functions->check_acl($account_lid,'add_blocking_sending_email_to_shared_accounts_exception')) |
---|
105 | $template->set_var('acl_add_exception_for_the_blocking', 'disabled = true'); |
---|
106 | else |
---|
107 | $template->set_var('acl_add_exception_for_the_blocking', ''); |
---|
108 | |
---|
109 | if(!$this->functions->check_acl($account_lid,'active_blocking_sending_email_to_shared_accounts')) |
---|
110 | $template->set_var('acl_inputCheckAllUserBlockCommunication', 'disabled = true'); |
---|
111 | else |
---|
112 | $template->set_var('acl_inputCheckAllUserBlockCommunication', ''); |
---|
113 | |
---|
114 | if(!$this->functions->check_acl($account_lid,'edit_and_remove_blocking_sending_email_to_shared_accounts_exception')) |
---|
115 | $template->set_var('acl_edit_and_remove_blocking_sending_email', 'disabled = true'); |
---|
116 | else |
---|
117 | $template->set_var('acl_edit_and_remove_blocking_sending_email', ''); |
---|
118 | |
---|
119 | if(!$this->functions->check_acl($account_lid,'add_maximum_number_of_recipients_by_group')) |
---|
120 | $template->set_var('acl_Limit_by_group', 'disabled = true'); |
---|
121 | else |
---|
122 | $template->set_var('acl_Limit_by_group', ''); |
---|
123 | |
---|
124 | if(!$this->functions->check_acl($account_lid,'add_maximum_number_of_recipients_by_user')) |
---|
125 | $template->set_var('acl_Limit_by_user', 'disabled = true'); |
---|
126 | else |
---|
127 | $template->set_var('acl_Limit_by_user', ''); |
---|
128 | |
---|
129 | if(!$this->functions->check_acl($account_lid,'edit_maximum_number_of_recipients_generally')) |
---|
130 | $template->set_var('acl_inputTextMaximumRecipientGenerally', 'disabled = true'); |
---|
131 | else |
---|
132 | $template->set_var('acl_inputTextMaximumRecipientGenerally', ''); |
---|
133 | |
---|
134 | //Fim validando acls |
---|
135 | |
---|
136 | |
---|
137 | $limitByUserModalId = 'limitByUserModal'; |
---|
138 | $template->set_var('limitByUserModalId', $limitByUserModalId); |
---|
139 | $limitByUserModalTpl = $template->fp('out','limitByUserModal'); |
---|
140 | |
---|
141 | $limitByGroupModalId = 'limitByGroupModal'; |
---|
142 | $template->set_var('limitByGroupModalId', $limitByGroupModalId); |
---|
143 | $limitByGroupModalTpl = $template->fp('out','limitByGroupModal'); |
---|
144 | |
---|
145 | $blockEmailForInstitutionalAccountId = 'blockEmailForInstitutionalAccountModal'; |
---|
146 | $template->set_var('blockEmailForInstitutionalAccountId', $blockEmailForInstitutionalAccountId); |
---|
147 | $blockEmailForInstitutionalAccountModalTpl = $template->fp('out','blockEmailForInstitutionalAccountModal'); |
---|
148 | |
---|
149 | |
---|
150 | |
---|
151 | $var = Array( |
---|
152 | 'th_bg' => $GLOBALS['phpgw_info']['theme']['th_bg'], |
---|
153 | 'back_url' => $GLOBALS['phpgw']->link('/expressoAdmin1_2/index.php'), |
---|
154 | 'context_display' => $context_display, |
---|
155 | 'limitByUserModal' => $limitByUserModalTpl, |
---|
156 | 'onclickLimitByUserModal' => "modal(\"$limitByUserModalId\",\"create\")", |
---|
157 | 'limitByGroupModal' => $limitByGroupModalTpl, |
---|
158 | 'onclickLimitByGroupModal' => "modal(\"$limitByGroupModalId\",\"create\")", |
---|
159 | 'blockEmailForInstitutionalAccountModal' => $blockEmailForInstitutionalAccountModalTpl, |
---|
160 | 'onclickBlockEmailForInstitutionalAccountModal' => "modal(\"$blockEmailForInstitutionalAccountId\",\"create\")", |
---|
161 | ); |
---|
162 | |
---|
163 | $template->set_var($var); |
---|
164 | |
---|
165 | |
---|
166 | $template->pfp('out','body'); |
---|
167 | |
---|
168 | } |
---|
169 | |
---|
170 | |
---|
171 | |
---|
172 | |
---|
173 | } |
---|
174 | |
---|
175 | |
---|
176 | ?> |
---|