True
);
var $functions;
var $current_config;
var $bo;
/**
* Construtor
*/
function uimessages_size()
{
$this->bo = CreateObject('expressoAdmin1_2.bomessages_size');
if (function_exists('CreateObject'))
{
$this->functions = CreateObject('expressoAdmin1_2.functions');
if(!@is_object($GLOBALS['phpgw']->js))
{
$GLOBALS['phpgw']->js = CreateObject('phpgwapi.javascript');
}
$GLOBALS['phpgw']->js->validate_file('jscode','connector','expressoAdmin1_2'); #diretorio, arquivo.js, aplicacao
$GLOBALS['phpgw']->js->validate_file('jscode','finder','expressoAdmin1_2');
$GLOBALS['phpgw']->js->validate_file('jscode','messages_size','expressoAdmin1_2');
$GLOBALS['phpgw']->js->validate_file('modal','modal','expressoAdmin1_2');
$GLOBALS['phpgw']->js->validate_file('jscode','expressoadmin','expressoAdmin1_2');
$c = CreateObject('phpgwapi.config','expressoAdmin1_2');
$c->read_repository();
$this->current_config = $c->config_data;
}
}
/**
* @abstract Cria a página principal da funcionalidade.
*/
function index()
{
$p = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
$p->set_file(
Array(
'messages_size' => 'messages_size.tpl',
'messages_size_modal' => 'messages_size_modal.tpl'
)
);
$p->set_block('messages_size','body');
$p->set_var($this->functions->make_dinamic_lang($p, 'body'));
$p->set_var($this->functions->make_dinamic_lang($p, 'messages_size_modal'));
/* Início da verificação ACL */
$account_lid = $GLOBALS['phpgw']->accounts->data['account_lid'];
$acl = $this->functions->read_acl($account_lid);
$contexts = $acl['contexts'];
foreach ($acl['contexts_display'] as $index=>$tmp_context) {
$context_display .= '
'.$tmp_context;
}
if (!$this->functions->check_acl($account_lid,'messages_size')) {
$GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/expressoAdmin1_2/inc/access_denied.php'));
}
/* Fim da verificação ACL */
unset($GLOBALS['phpgw_info']['flags']['noheader']);
unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
$GLOBALS['phpgw_info']['flags']['app_header'] = $GLOBALS['phpgw_info']['apps']['expressoAdmin1_2']['title'].' - '.lang('Messages Size');
$GLOBALS['phpgw']->common->phpgw_header();
/* Begin: set modal */
$functions = CreateObject('expressoAdmin1_2.functions');
foreach ($contexts as $index=>$context)
$combo_manager_org .= $this->functions->get_organizations($context);
$combo_all_orgs = $this->functions->get_organizations($GLOBALS['phpgw_info']['server']['ldap_context']);
$p->set_var('manager_organizations', $combo_manager_org);
$p->set_var('all_organizations', $combo_all_orgs);
$modal_id = 'messages_size_modal';
$p->set_var('modal_id', $modal_id);
$messages_size_modal_tpl = $p->fp('out','messages_size_modal');
/* End: set modal */
$var = Array(
'th_bg' => $GLOBALS['phpgw_info']['theme']['th_bg'],
'back_url' => $GLOBALS['phpgw']->link('/expressoAdmin1_2/index.php'),
'context_display' => $context_display,
'messages_size_modal' => $messages_size_modal_tpl,
'onclick_create_messages_size' => "modal(\"$modal_id\",\"create\")"
);
$p->set_var($var);
$default_value = '';
$rules = '';
$all_rules = $this->bo->get_all_rules();
$all_rules_count = count($all_rules);
for ($i = 0; $i<$all_rules_count; ++$i)
{
/* Verificação para não listar a regra default */
if($all_rules[$i]['email_recipient'] != 'default')
{
$name_link = (string)str_replace(" ", "%", $all_rules[$i]['email_recipient']);
$rules .= "