Implements #6582 Autoresponder in HTML format
Changes to implement autoresponder mail in html format.
To complete this feature there are 2 missing changes:
-
extend the dbispconfig database structure in order to save the status of HTML switch. I've done that manually via commands like: USE dbispconfig; ALTER TABLE
mail_user
ADDautoresponder_html
enum('n','y') NOT NULL DEFAULT 'n'; (I don't know how to save this change in ISPConfig3 project) -
modify the roundcube plugin to implement the main changes to the code handling Settings->Account->Autoreply page. The file I changed is the following: /usr/share/roundcube/plugins/ispconfig3_autoreply/ispconfig3_autoreply.php Unfortunately it isn't into ispconfig3 project, so I can describe changes here only:
62c62,63
< $body = rcube_utils::get_input_value('_autoreplybody', rcube_utils::INPUT_POST);
---
> $htmlenabled = rcube_utils::get_input_value('_htmlenabled', rcube_utils::INPUT_POST);
> $body = rcube_utils::get_input_value('_autoreplybody', rcube_utils::INPUT_POST, true);
82a84,89
> if(!$htmlenabled)
> $htmlenabled = 'n';
> else
> $htmlenabled = 'y';
>
>
114a122
> $params['autoresponder_html'] = $htmlenabled;
134a143
>
160a170
> $htmlenabled = $mail_user[0]['autoresponder_html'];
167a178,179
> $htmlenabled = ($htmlenabled == 'y') ? 1 : 0;
> if($htmlenabled == 1) $this->include_script('../../program/js/tinymce/tinymce.min.js');
220a233,237
>
> $field_id = 'htmlenabled';
> $input_htmlenabled = new html_checkbox(array('name' => '_' . $field_id, 'id' => $field_id, 'value' => 1, onchange => "triggerSave()"));
> $table->add('title', html::label($field_id, 'HTML'));
> $table->add('', $input_htmlenabled->show($htmlenabled));
223a241,242
> $out .= "<script>function triggerSave(){ $('#rcmbtnfrm100').click(); }</script>\n";
> if($htmlenabled == 1) $out .= "<script>tinymce.init({ selector: 'textarea#autoreplybody', menubar: false });</script>\n";
Nel file /usr/local/ispconfig/server/plugins-available/maildeliver_plugin.inc.php :
diff /usr/local/ispconfig/server/plugins-available/maildeliver_plugin.inc.php_save /usr/local/ispconfig/server/plugins-available/maildeliver_plugin.inc.php
91a92
> or $data["old"]["autoresponder_html"] != $data["new"]["autoresponder_html"]
155a157,159
>
> // Autoresponder_html
> $tpl->setVar('autoresponder_html', $data["new"]["autoresponder_html"]);
- Nel file /usr/local/ispconfig/interface/web/mailuser/templates/mail_user_autoresponder_edit.htm :
diff /usr/local/ispconfig/interface/web/mailuser/templates/mail_user_autoresponder_edit.htm_save /usr/local/ispconfig/interface/web/mailuser/templates/mail_user_autoresponder_edit.htm
13a14,17
> <label for="autoresponder_html" class="col-sm-3 control-label">{tmpl_var name='autoresponder_html'}</label>
> <div class="col-sm-9"><input type="checkbox" value="n" id="autoresponder_html" name="autoresponder_html" onclick="AR_ResetDates();" {tmpl_var name='autoresponder_html'} /></div>
> </div>
> <div class="form-group">
Unfortunately I'm a sysadmin, not a developer... So please let me know how to do this part, thanks.