Commit d097c76b authored by choongii's avatar choongii
Browse files

Implemented checkboxes in Interface Config to enable showing/hiding the tabs...

Implemented checkboxes in Interface Config to enable showing/hiding the tabs Mail Filters, Autoresponders and Custom Rules for mailboxes.

See also http://www.howtoforge.com/forums/showthread.php?t=59539
parent 43b345ca
...@@ -174,12 +174,30 @@ $form["tabs"]['mail'] = array ( ...@@ -174,12 +174,30 @@ $form["tabs"]['mail'] = array (
################################## ##################################
# Begin Datatable fields # Begin Datatable fields
################################## ##################################
'enable_custom_login' => array( 'enable_custom_login' => array(
'datatype' => 'VARCHAR', 'datatype' => 'VARCHAR',
'formtype' => 'CHECKBOX', 'formtype' => 'CHECKBOX',
'default' => 'n', 'default' => 'n',
'value' => array(0 => 'n', 1 => 'y') 'value' => array(0 => 'n', 1 => 'y')
), ),
'mailbox_show_autoresponder_tab' => array (
'datatype' => 'VARCHAR',
'formtype' => 'CHECKBOX',
'default' => 'y',
'value' => array(0 => 'n',1 => 'y')
),
'mailbox_show_mail_filter_tab' => array (
'datatype' => 'VARCHAR',
'formtype' => 'CHECKBOX',
'default' => 'y',
'value' => array(0 => 'n',1 => 'y')
),
'mailbox_show_custom_rules_tab' => array (
'datatype' => 'VARCHAR',
'formtype' => 'CHECKBOX',
'default' => 'y',
'value' => array(0 => 'n',1 => 'y')
),
'mailboxlist_webmail_link' => array ( 'mailboxlist_webmail_link' => array (
'datatype' => 'VARCHAR', 'datatype' => 'VARCHAR',
'formtype' => 'CHECKBOX', 'formtype' => 'CHECKBOX',
......
...@@ -23,6 +23,9 @@ $wb["webdavuser_prefix_error_regex"] = 'Char not allowed in webdav user prefix.' ...@@ -23,6 +23,9 @@ $wb["webdavuser_prefix_error_regex"] = 'Char not allowed in webdav user prefix.'
$wb["dblist_phpmyadmin_link_txt"] = 'Link to phpmyadmin in DB list'; $wb["dblist_phpmyadmin_link_txt"] = 'Link to phpmyadmin in DB list';
$wb['enable_custom_login_txt'] = 'Allow custom login name'; $wb['enable_custom_login_txt'] = 'Allow custom login name';
$wb["mailboxlist_webmail_link_txt"] = 'Link to webmail in Mailbox list'; $wb["mailboxlist_webmail_link_txt"] = 'Link to webmail in Mailbox list';
$wb['mailbox_show_autoresponder_tab_txt'] = 'Show Autoresponder tab in Mailbox detail';
$wb['mailbox_show_mail_filter_tab_txt'] = 'Show Mail Filter tab in Mailbox detail';
$wb['mailbox_show_custom_rules_tab_txt'] = 'Show Custom Rules tab in Mailbox detail';
$wb["webmail_url_txt"] = 'Webmail URL'; $wb["webmail_url_txt"] = 'Webmail URL';
$wb["mailmailinglist_link_txt"] = 'Link to mailing list in Mailing list list'; $wb["mailmailinglist_link_txt"] = 'Link to mailing list in Mailing list list';
$wb["mailmailinglist_url_txt"] = 'Mailing list URL'; $wb["mailmailinglist_url_txt"] = 'Mailing list URL';
......
...@@ -16,6 +16,9 @@ $wb['shelluser_prefix_error_regex'] = 'Char niet toegestaan in shell gebruiker v ...@@ -16,6 +16,9 @@ $wb['shelluser_prefix_error_regex'] = 'Char niet toegestaan in shell gebruiker v
$wb['webdavuser_prefix_error_regex'] = 'Char niet toegestaan in webdav gebruiker voorvoegsel.'; $wb['webdavuser_prefix_error_regex'] = 'Char niet toegestaan in webdav gebruiker voorvoegsel.';
$wb['dblist_phpmyadmin_link_txt'] = 'Link naar phpmyadmin in DB lijst'; $wb['dblist_phpmyadmin_link_txt'] = 'Link naar phpmyadmin in DB lijst';
$wb['mailboxlist_webmail_link_txt'] = 'Link naar webmail in Mailbox lijst'; $wb['mailboxlist_webmail_link_txt'] = 'Link naar webmail in Mailbox lijst';
$wb['mailbox_show_autoresponder_tab_txt'] = 'Toon Autoresponder tabblad in Mailbox detail';
$wb['mailbox_show_mail_filter_tab_txt'] = 'Toon Mail Filter tabblad in Mailbox detail';
$wb['mailbox_show_custom_rules_tab_txt'] 'Toon Custom Rules tabblad in Mailbox detail';
$wb['webmail_url_txt'] = 'Webmail URL'; $wb['webmail_url_txt'] = 'Webmail URL';
$wb['phpmyadmin_url_txt'] = 'PHPMyAdmin URL'; $wb['phpmyadmin_url_txt'] = 'PHPMyAdmin URL';
$wb['use_domain_module_txt'] = 'Gebruik de domein-module om nieuwe domeinen toe te voegen'; $wb['use_domain_module_txt'] = 'Gebruik de domein-module om nieuwe domeinen toe te voegen';
......
...@@ -11,6 +11,24 @@ ...@@ -11,6 +11,24 @@
{tmpl_var name='enable_custom_login'} {tmpl_var name='enable_custom_login'}
</div> </div>
</div> </div>
<div class="ctrlHolder">
<p class="label">{tmpl_var name='mailbox_show_autoresponder_tab_txt'}</p>
<div class="multiField">
{tmpl_var name='mailbox_show_autoresponder_tab'}
</div>
</div>
<div class="ctrlHolder">
<p class="label">{tmpl_var name='mailbox_show_mail_filter_tab_txt'}</p>
<div class="multiField">
{tmpl_var name='mailbox_show_mail_filter_tab'}
</div>
</div>
<div class="ctrlHolder">
<p class="label">{tmpl_var name='mailbox_show_custom_rules_tab_txt'}</p>
<div class="multiField">
{tmpl_var name='mailbox_show_custom_rules_tab'}
</div>
</div>
<div class="ctrlHolder"> <div class="ctrlHolder">
<p class="label">{tmpl_var name='mailboxlist_webmail_link_txt'}</p> <p class="label">{tmpl_var name='mailboxlist_webmail_link_txt'}</p>
<div class="multiField"> <div class="multiField">
...@@ -77,4 +95,4 @@ ...@@ -77,4 +95,4 @@
</div> </div>
</div> </div>
</div> </div>
\ No newline at end of file
...@@ -38,6 +38,8 @@ ...@@ -38,6 +38,8 @@
*/ */
global $app; global $app;
$app->uses('getconf');
$global_config = $app->getconf->get_global_config();
$form["title"] = "Mailbox"; $form["title"] = "Mailbox";
$form["description"] = ""; $form["description"] = "";
...@@ -230,115 +232,118 @@ $form["tabs"]['mailuser'] = array ( ...@@ -230,115 +232,118 @@ $form["tabs"]['mailuser'] = array (
) )
); );
$form["tabs"]['autoresponder'] = array ( if ($global_config['mail']['mailbox_show_autoresponder_tab'] === 'y') {
'title' => "Autoresponder", $form["tabs"]['autoresponder'] = array (
'width' => 100, 'title' => "Autoresponder",
'template' => "templates/mail_user_autoresponder_edit.htm", 'width' => 100,
'fields' => array ( 'template' => "templates/mail_user_autoresponder_edit.htm",
################################## 'fields' => array (
# Begin Datatable fields ##################################
################################## # Begin Datatable fields
'autoresponder_subject' => array ( ##################################
'datatype' => 'VARCHAR', 'autoresponder_subject' => array (
'formtype' => 'TEXT', 'datatype' => 'VARCHAR',
'default' => 'Out of office reply', 'formtype' => 'TEXT',
'value' => '', 'default' => 'Out of office reply',
'width' => '30', 'value' => '',
'maxlength' => '255' 'width' => '30',
), 'maxlength' => '255'
'autoresponder_text' => array ( ),
'datatype' => 'TEXT', 'autoresponder_text' => array (
'formtype' => 'TEXTAREA', 'datatype' => 'TEXT',
'default' => '', 'formtype' => 'TEXTAREA',
'value' => '', 'default' => '',
'cols' => '30', 'value' => '',
'rows' => '15' 'cols' => '30',
), 'rows' => '15'
'autoresponder' => array ( ),
'datatype' => 'VARCHAR', 'autoresponder' => array (
'formtype' => 'CHECKBOX', 'datatype' => 'VARCHAR',
'default' => 'n', 'formtype' => 'CHECKBOX',
'value' => array(1 => 'y',0 => 'n') 'default' => 'n',
), 'value' => array(1 => 'y',0 => 'n')
'autoresponder_start_date' => array ( ),
'datatype' => 'DATETIME', 'autoresponder_start_date' => array (
'formtype' => 'DATETIME', 'datatype' => 'DATETIME',
'validators'=> array ( 0 => array ( 'type' => 'CUSTOM', 'formtype' => 'DATETIME',
'class' => 'validate_autoresponder', 'validators'=> array ( 0 => array ( 'type' => 'CUSTOM',
'function' => 'start_date', 'class' => 'validate_autoresponder',
'errmsg'=> 'autoresponder_start_date_is_required'), 'function' => 'start_date',
) 'errmsg'=> 'autoresponder_start_date_is_required'),
), )
'autoresponder_end_date' => array ( ),
'datatype' => 'DATETIME', 'autoresponder_end_date' => array (
'formtype' => 'DATETIME', 'datatype' => 'DATETIME',
'validators'=> array ( 0 => array ( 'type' => 'CUSTOM', 'formtype' => 'DATETIME',
'class' => 'validate_autoresponder', 'validators'=> array ( 0 => array ( 'type' => 'CUSTOM',
'function' => 'end_date', 'class' => 'validate_autoresponder',
'errmsg'=> 'autoresponder_end_date_isgreater'), 'function' => 'end_date',
), 'errmsg'=> 'autoresponder_end_date_isgreater'),
), ),
################################## ),
# END Datatable fields ##################################
################################## # END Datatable fields
) ##################################
); )
);
}
$form["tabs"]['filter_records'] = array (
'title' => "Mail Filter", if ($global_config['mail']['mailbox_show_mail_filter_tab'] === 'y') {
'width' => 100, $form["tabs"]['filter_records'] = array (
'template' => "templates/mail_user_mailfilter_edit.htm", 'title' => "Mail Filter",
'fields' => array ( 'width' => 100,
################################## 'template' => "templates/mail_user_mailfilter_edit.htm",
# Begin Datatable fields 'fields' => array (
################################## ##################################
'move_junk' => array ( # Begin Datatable fields
'datatype' => 'VARCHAR', ##################################
'formtype' => 'CHECKBOX', 'move_junk' => array (
'default' => 'n', 'datatype' => 'VARCHAR',
'value' => array(0 => 'n',1 => 'y') 'formtype' => 'CHECKBOX',
'default' => 'n',
'value' => array(0 => 'n',1 => 'y')
),
##################################
# END Datatable fields
##################################
), ),
################################## 'plugins' => array (
# END Datatable fields 'filter_records' => array (
################################## 'class' => 'plugin_listview',
), 'options' => array(
'plugins' => array ( 'listdef' => 'list/mail_user_filter.list.php',
'filter_records' => array ( 'sqlextwhere' => "mailuser_id = ".@$app->functions->intval(@$_REQUEST['id']),
'class' => 'plugin_listview', 'sql_order_by' => "ORDER BY rulename"
'options' => array( )
'listdef' => 'list/mail_user_filter.list.php',
'sqlextwhere' => "mailuser_id = ".@$app->functions->intval(@$_REQUEST['id']),
'sql_order_by' => "ORDER BY rulename"
) )
) )
) );
); }
if($_SESSION["s"]["user"]["typ"] == 'admin') {
$form["tabs"]['mailfilter'] = array (
'title' => "Custom Rules",
'width' => 100,
'template' => "templates/mail_user_custom_rules_edit.htm",
'fields' => array (
##################################
# Begin Datatable fields
##################################
'custom_mailfilter' => array (
'datatype' => 'TEXT',
'formtype' => 'TEXTAREA',
'default' => '',
'value' => '',
'cols' => '30',
'rows' => '15'
),
##################################
# END Datatable fields
##################################
)
);
if ($_SESSION["s"]["user"]["typ"] == 'admin' && $global_config['mail']['mailbox_show_custom_rules_tab'] === 'y') {
$form["tabs"]['mailfilter'] = array (
'title' => "Custom Rules",
'width' => 100,
'template' => "templates/mail_user_custom_rules_edit.htm",
'fields' => array (
##################################
# Begin Datatable fields
##################################
'custom_mailfilter' => array (
'datatype' => 'TEXT',
'formtype' => 'TEXTAREA',
'default' => '',
'value' => '',
'cols' => '30',
'rows' => '15'
),
##################################
# END Datatable fields
##################################
)
);
} }
?>
?>
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment