* Mail/Sieve: require a vacation notice text on vacationnotice edit and save.

This commit is contained in:
Klaus Leithoff 2015-04-21 11:17:49 +00:00
parent a627dea3d6
commit a238407182
4 changed files with 11 additions and 4 deletions

View File

@ -538,7 +538,7 @@ class mail_sieve
{
$ByDate = array('by_date' => lang('By date'));
}
if (!is_array($content) || ($content['acc_id'] && !isset($content['button'])))
if (!is_array($content) || ($content['acc_id'] && !isset($content['button'])) || (strlen(trim($content['text']))==0 && in_array($content['status'],array('on','by_date'))))
{
$content = $vacation = $vacRules['vacation'];
if (!empty($profileID)) $content['acc_id'] = $profileID;
@ -554,7 +554,12 @@ class mail_sieve
{
$content['forwards'] = '';
}
if (empty($vacation['text']) && $this->mailConfig['default_vacation_text']) $content['text'] = $this->mailConfig['default_vacation_text'];
if (strlen(trim($vacation['text']))==0 && $this->mailConfig['default_vacation_text']) $content['text'] = $this->mailConfig['default_vacation_text'];
if (strlen(trim($content['text']))==0)
{
$content['msg'] = $msg = lang('error').': '.lang('No vacation notice text provided. Please enter a message.');
egw_framework::refresh_opener($msg, 'mail');
}
//Set default value for days new entry
if (empty($content['days']))
{
@ -575,7 +580,7 @@ class mail_sieve
if ($GLOBALS['egw_info']['user']['apps']['admin'])
{
// store text as default
if ($content['set_as_default'] == 1)
if ($content['set_as_default'] == 1 && $content['text'])
{
config::save_value('default_vacation_text', $content['text'], 'mail');
}

View File

@ -283,6 +283,7 @@ no signature mail de keine Signatur
no subject given! mail de Kein Betreff angegeben!
no subject supplied mail de Kein Betreff angegeben!
no text body supplied, check attachments for message text mail de Keine Text vorhanden, bitte sehen Sie sich die Anlagen dieser E-Mail an.
no vacation notice text provided. Please enter a message. mail de Kein Nachrichtentext vorhanden. Sie müssen einen Nachrichtentext eingeben um Ihre Abwesendheitsnotiz speichern (ändern, aktivieren oder deaktivieren) zu können.
no valid %1 folder configured! mail de Kein gültiger %1 Ordner eingestellt!
non mail de Kein
none, create all mail de keine, erstellt alle

View File

@ -283,6 +283,7 @@ no signature mail en no signature
no subject given! mail en No subject given!
no subject supplied mail en no subject supplied
no text body supplied, check attachments for message text mail en no text body supplied, check attachments for message text
no vacation notice text provided. Please enter a message. mail en No vacation notice text provided. Please enter a message.
no valid %1 folder configured! mail en No valid %1 folder configured!
non mail en Non
none, create all mail en none, create all

View File

@ -46,7 +46,7 @@
<row>
<description value="With message:"/>
<vbox span="all">
<textbox multiline="true" id="text" width="99%" height="150px" needed="true" class="et2_required"/>
<textbox multiline="true" id="text" width="99%" height="150px" needed="1" class="et2_required"/>
<description id="by_date_label" value="You can use $$start$$ for the above start date and $$end$$ for the end date."/>
</vbox>
</row>