vacation:

restrict reply type to a list of options ($CONF[vacation_choice_of_reply]),
remove input field for custom interval


config.inc.php:
- change $CONF['vacation_choice_of_reply'] to [seconds] => [$PALANG label]
  (note: reply to every mail is commented by default because it can be
  annoying. Admins will have to explicitely add/enable it in their config.)
- remove $CONF[vacation_replytype_default]
- update comment about dovecot:* for $CONF[encrypt]

*.lang:
- add texts for reply types

VacationHandler.php:
- remove reply_type at various places
- set_away(): remove reply_type from list of function parameters

templates/vacation.tpl:
- update reply type dropdown for the changed $CONF['vacation_choice_of_reply']
- remove the input fields for custom reply delay

vacation.php:
- restrict reply type to a list of options ($CONF[vacation_choice_of_reply])
- if vacation is disabled, but old values are stored in the database,
  change the activeFrom and activeUntil date to today to avoid users
  have to scroll through the calendar a lot

xmlrpc.php:
- update set_away() call to match the removed parameter

upgrade.php:
- comment out upgrade_1345_mysql() which created the reply_type and 
  interval_time fields in the vacation table in mysql
- add upgrade_1610() to add the vacation.interval_time field


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1610 a1433add-5e2c-0410-b055-b7f2511e0802
pull/2/head
Christian Boltz 11 years ago
parent 99f871d45d
commit 8c139c95d6

@ -131,7 +131,7 @@ $CONF['smtp_port'] = '25';
// mysql_encrypt = useful for PAM integration
// authlib = support for courier-authlib style passwords
// dovecot:CRYPT-METHOD = use dovecotpw -s 'CRYPT-METHOD'. Example: dovecot:CRAM-MD5
// (WARNING: do not use a dovecot:* method that includes a salt - you won't be able to login to PostfixAdmin in this case)
// (WARNING: don't use dovecot:* methods that include the username in the hash - you won't be able to login to PostfixAdmin in this case)
$CONF['encrypt'] = 'md5crypt';
// In what flavor should courier-authlib style passwords be encrypted?
@ -337,16 +337,17 @@ $CONF['vacation_allow_user_reply'] = 'YES';
// ReplyType options
// If you want to define additional reply options put them in array below.
// The array has the format seconds between replies => $PALANG text
// Special values for seconds are:
// 0 => only reply to the first mail while on vacation
// 1 => reply on every mail
$CONF['vacation_choice_of_reply'] = array (
'One Reply', // Sends only Once the message during Out of Office
'Auto Reply', // Reply on every email but not within autoreplydelay
'Interval Reply' // Reply on every email but not within intervaldelay_default
0 => 'reply_once', // Sends only Once the message during Out of Office
# considered annoying - only send a reply on every mail if you really need it
# 1 => 'reply_every_mail', // Reply on every email
60*60 *24*7 => 'reply_once_per_week' // Reply if last autoreply was at least a week ago
);
// ReplyType default
// You should define default replytype. It must be in array above.
$CONF['vacation_replytype_default'] = 'One Reply';
// autoreplydelay
// You should define autodefaultdelay is seconds
// if a new message comes in within this delay it most likely that that the sender is

@ -167,6 +167,9 @@ $PALANG['pVacation_result_added'] = 'Auto response for %s has been enabled!'; #
$PALANG['pVacation_reply_type'] = 'Choice of reply'; # XXX
$PALANG['pVacation_reply_delay_time'] = 'Interval time'; # XXX
$PALANG['pVacation_reply_delay_time_text'] = 'Time in seconds'; # XXX
$PALANG['reply_once'] = 'Reply once'; # XXX
$PALANG['reply_every_mail'] = 'Reply on every mail'; # XXX
$PALANG['reply_once_per_week'] = 'Reply once per week'; # XXX
$PALANG['pViewlog_welcome'] = 'Разглеждане на последните 10 действия за ';
$PALANG['pViewlog_timestamp'] = 'Дата';

@ -165,6 +165,9 @@ $PALANG['pVacation_result_added'] = 'Auto response for %s has been enabled!'; #
$PALANG['pVacation_reply_type'] = 'Choice of reply'; # XXX
$PALANG['pVacation_reply_delay_time'] = 'Interval time'; # XXX
$PALANG['pVacation_reply_delay_time_text'] = 'Time in seconds'; # XXX
$PALANG['reply_once'] = 'Reply once'; # XXX
$PALANG['reply_every_mail'] = 'Reply on every mail'; # XXX
$PALANG['reply_once_per_week'] = 'Reply once per week'; # XXX
$PALANG['pViewlog_welcome'] = 'Veure les últimes 10 accions per ';
$PALANG['pViewlog_timestamp'] = 'Data/Hora';

@ -166,6 +166,9 @@ $PALANG['pVacation_result_added'] = 'Auto response for %s has been enabled!'; #
$PALANG['pVacation_reply_type'] = 'Choice of reply'; # XXX
$PALANG['pVacation_reply_delay_time'] = 'Interval time'; # XXX
$PALANG['pVacation_reply_delay_time_text'] = 'Time in seconds'; # XXX
$PALANG['reply_once'] = 'Reply once'; # XXX
$PALANG['reply_every_mail'] = 'Reply on every mail'; # XXX
$PALANG['reply_once_per_week'] = 'Reply once per week'; # XXX
$PALANG['pViewlog_welcome'] = '查看最新的10项操作日志 域名: ';
$PALANG['pViewlog_timestamp'] = '时间';

@ -173,6 +173,9 @@ $PALANG['pVacation_result_added'] = 'Automatická odpověd byla zapnuta! (%s)';
$PALANG['pVacation_reply_type'] = 'Choice of reply'; # XXX
$PALANG['pVacation_reply_delay_time'] = 'Interval time'; # XXX
$PALANG['pVacation_reply_delay_time_text'] = 'Time in seconds'; # XXX
$PALANG['reply_once'] = 'Reply once'; # XXX
$PALANG['reply_every_mail'] = 'Reply on every mail'; # XXX
$PALANG['reply_once_per_week'] = 'Reply once per week'; # XXX
$PALANG['pViewlog_welcome'] = 'Prohlížet 10 posledních akcí pro ';
$PALANG['pViewlog_timestamp'] = 'Časová značka';

@ -173,6 +173,9 @@ $PALANG['pVacation_result_added'] = 'Autosvar er aktiveret! (%s)'; # XXX Text ch
$PALANG['pVacation_reply_type'] = 'Choice of reply'; # XXX
$PALANG['pVacation_reply_delay_time'] = 'Interval time'; # XXX
$PALANG['pVacation_reply_delay_time_text'] = 'Time in seconds'; # XXX
$PALANG['reply_once'] = 'Reply once'; # XXX
$PALANG['reply_every_mail'] = 'Reply on every mail'; # XXX
$PALANG['reply_once_per_week'] = 'Reply once per week'; # XXX
$PALANG['pViewlog_welcome'] = 'Vis de sidste 10 poster for ';
$PALANG['pViewlog_timestamp'] = 'Tidsstempel';

@ -170,6 +170,9 @@ $PALANG['pVacation_result_added'] = 'Automatische Antwort für %s wurde aktivier
$PALANG['pVacation_reply_type'] = 'Choice of reply'; # XXX
$PALANG['pVacation_reply_delay_time'] = 'Interval time'; # XXX
$PALANG['pVacation_reply_delay_time_text'] = 'Zeit in Sekunden';
$PALANG['reply_once'] = 'Einmal antworten';
$PALANG['reply_every_mail'] = 'Jede Mail beantworten';
$PALANG['reply_once_per_week'] = 'Einmal pro Woche antworten';
$PALANG['pViewlog_welcome'] = 'Zeigt die letzten 10 Aktionen für ';
$PALANG['pViewlog_timestamp'] = 'Zeitpunkt';

@ -171,6 +171,9 @@ $PALANG['pVacation_result_added'] = 'Auto response for %s has been enabled!';
$PALANG['pVacation_reply_type'] = 'Choice of reply';
$PALANG['pVacation_reply_delay_time'] = 'Interval time';
$PALANG['pVacation_reply_delay_time_text'] = 'Time in seconds';
$PALANG['reply_once'] = 'Reply once';
$PALANG['reply_every_mail'] = 'Reply on every mail';
$PALANG['reply_once_per_week'] = 'Reply once per week';
$PALANG['pViewlog_welcome'] = 'View the last 10 actions for ';
$PALANG['pViewlog_timestamp'] = 'Timestamp';

@ -167,6 +167,9 @@ $PALANG['pVacation_result_added'] = '¡Autorespuesta habilitada! (%s)'; # XXX Te
$PALANG['pVacation_reply_type'] = 'Choice of reply'; # XXX
$PALANG['pVacation_reply_delay_time'] = 'Interval time'; # XXX
$PALANG['pVacation_reply_delay_time_text'] = 'Time in seconds'; # XXX
$PALANG['reply_once'] = 'Reply once'; # XXX
$PALANG['reply_every_mail'] = 'Reply on every mail'; # XXX
$PALANG['reply_once_per_week'] = 'Reply once per week'; # XXX
$PALANG['pViewlog_welcome'] = 'Ver las últimas 10 acciones para ';
$PALANG['pViewlog_timestamp'] = 'Fecha/Hora';

@ -166,6 +166,9 @@ $PALANG['pVacation_result_added'] = 'Auto response for %s has been enabled!'; #
$PALANG['pVacation_reply_type'] = 'Choice of reply'; # XXX
$PALANG['pVacation_reply_delay_time'] = 'Interval time'; # XXX
$PALANG['pVacation_reply_delay_time_text'] = 'Time in seconds'; # XXX
$PALANG['reply_once'] = 'Reply once'; # XXX
$PALANG['reply_every_mail'] = 'Reply on every mail'; # XXX
$PALANG['reply_once_per_week'] = 'Reply once per week'; # XXX
$PALANG['pViewlog_welcome'] = 'Vaata 10 viimast muudatust domeeniga ';
$PALANG['pViewlog_timestamp'] = 'Ajatempel';

@ -164,6 +164,9 @@ $PALANG['pVacation_result_added'] = 'Auto response for %s has been enabled!'; #
$PALANG['pVacation_reply_type'] = 'Choice of reply'; # XXX
$PALANG['pVacation_reply_delay_time'] = 'Interval time'; # XXX
$PALANG['pVacation_reply_delay_time_text'] = 'Time in seconds'; # XXX
$PALANG['reply_once'] = 'Reply once'; # XXX
$PALANG['reply_every_mail'] = 'Reply on every mail'; # XXX
$PALANG['reply_once_per_week'] = 'Reply once per week'; # XXX
$PALANG['pViewlog_welcome'] = 'Honen azken 10 ekintzak ikusi ';
$PALANG['pViewlog_timestamp'] = 'Data/ordua';

@ -166,6 +166,9 @@ $PALANG['pVacation_result_added'] = 'Automaattivastaus päällä! (%s)'; # XXX T
$PALANG['pVacation_reply_type'] = 'Choice of reply'; # XXX
$PALANG['pVacation_reply_delay_time'] = 'Interval time'; # XXX
$PALANG['pVacation_reply_delay_time_text'] = 'Time in seconds'; # XXX
$PALANG['reply_once'] = 'Reply once'; # XXX
$PALANG['reply_every_mail'] = 'Reply on every mail'; # XXX
$PALANG['reply_once_per_week'] = 'Reply once per week'; # XXX
$PALANG['pViewlog_welcome'] = 'Näytä viimeiset kymmenen tapahtumaa domainille ';
$PALANG['pViewlog_timestamp'] = 'Aikaleima';

@ -166,6 +166,9 @@ $PALANG['pVacation_result_added'] = 'Auto response for %s has been enabled!'; #
$PALANG['pVacation_reply_type'] = 'Choice of reply'; # XXX
$PALANG['pVacation_reply_delay_time'] = 'Interval time'; # XXX
$PALANG['pVacation_reply_delay_time_text'] = 'Time in seconds'; # XXX
$PALANG['reply_once'] = 'Reply once'; # XXX
$PALANG['reply_every_mail'] = 'Reply on every mail'; # XXX
$PALANG['reply_once_per_week'] = 'Reply once per week'; # XXX
$PALANG['pViewlog_welcome'] = 'Vís seinastu 10 hendingarnar fyri ';
$PALANG['pViewlog_timestamp'] = 'Tíðarstempul';

@ -167,6 +167,9 @@ $PALANG['pVacation_result_added'] = 'Le répondeur a été activé! (%s)'; # XXX
$PALANG['pVacation_reply_type'] = 'Choice of reply'; # XXX
$PALANG['pVacation_reply_delay_time'] = 'Interval time'; # XXX
$PALANG['pVacation_reply_delay_time_text'] = 'Time in seconds'; # XXX
$PALANG['reply_once'] = 'Reply once'; # XXX
$PALANG['reply_every_mail'] = 'Reply on every mail'; # XXX
$PALANG['reply_once_per_week'] = 'Reply once per week'; # XXX
$PALANG['pViewlog_welcome'] = 'Visualiser les 10 dernières action pour ';
$PALANG['pViewlog_timestamp'] = 'Date/Heure';

@ -165,6 +165,9 @@ $PALANG['pVacation_result_added'] = 'Auto response for %s has been enabled!'; #
$PALANG['pVacation_reply_type'] = 'Choice of reply'; # XXX
$PALANG['pVacation_reply_delay_time'] = 'Interval time'; # XXX
$PALANG['pVacation_reply_delay_time_text'] = 'Time in seconds'; # XXX
$PALANG['reply_once'] = 'Reply once'; # XXX
$PALANG['reply_every_mail'] = 'Reply on every mail'; # XXX
$PALANG['reply_once_per_week'] = 'Reply once per week'; # XXX
$PALANG['pViewlog_welcome'] = 'Pogledaj zadnjih 10 akcija za ';
$PALANG['pViewlog_timestamp'] = 'Vrijeme';

@ -170,6 +170,9 @@ $PALANG['pVacation_result_added'] = 'Az automatikus válasz engedélyezve! (%s)'
$PALANG['pVacation_reply_type'] = 'Choice of reply'; # XXX
$PALANG['pVacation_reply_delay_time'] = 'Interval time'; # XXX
$PALANG['pVacation_reply_delay_time_text'] = 'Time in seconds'; # XXX
$PALANG['reply_once'] = 'Reply once'; # XXX
$PALANG['reply_every_mail'] = 'Reply on every mail'; # XXX
$PALANG['reply_once_per_week'] = 'Reply once per week'; # XXX
$PALANG['pViewlog_welcome'] = 'Az utolsó 10 esemény megtekintése: ';
$PALANG['pViewlog_timestamp'] = 'Idõbélyeg';

@ -166,6 +166,9 @@ $PALANG['pVacation_result_added'] = 'Auto response for %s has been enabled!'; #
$PALANG['pVacation_reply_type'] = 'Choice of reply'; # XXX
$PALANG['pVacation_reply_delay_time'] = 'Interval time'; # XXX
$PALANG['pVacation_reply_delay_time_text'] = 'Time in seconds'; # XXX
$PALANG['reply_once'] = 'Reply once'; # XXX
$PALANG['reply_every_mail'] = 'Reply on every mail'; # XXX
$PALANG['reply_once_per_week'] = 'Reply once per week'; # XXX
$PALANG['pViewlog_welcome'] = 'Skoða síðustu 10 aðgerðir fyrir ';
$PALANG['pViewlog_timestamp'] = 'Tími';

@ -167,6 +167,9 @@ $PALANG['pVacation_result_added'] = 'Autorisponditore abilitato! (%s)'; # XXX Te
$PALANG['pVacation_reply_type'] = 'Choice of reply'; # XXX
$PALANG['pVacation_reply_delay_time'] = 'Interval time'; # XXX
$PALANG['pVacation_reply_delay_time_text'] = 'Time in seconds'; # XXX
$PALANG['reply_once'] = 'Reply once'; # XXX
$PALANG['reply_every_mail'] = 'Reply on every mail'; # XXX
$PALANG['reply_once_per_week'] = 'Reply once per week'; # XXX
$PALANG['pViewlog_welcome'] = 'Elenca gli ultimi dieci eventi per ';
$PALANG['pViewlog_timestamp'] = 'Orario';

@ -170,6 +170,9 @@ $PALANG['pVacation_result_added'] = '自動応答を設定しました。 (%s)';
$PALANG['pVacation_reply_type'] = 'Choice of reply'; # XXX
$PALANG['pVacation_reply_delay_time'] = 'Interval time'; # XXX
$PALANG['pVacation_reply_delay_time_text'] = 'Time in seconds'; # XXX
$PALANG['reply_once'] = 'Reply once'; # XXX
$PALANG['reply_every_mail'] = 'Reply on every mail'; # XXX
$PALANG['reply_once_per_week'] = 'Reply once per week'; # XXX
$PALANG['pViewlog_welcome'] = '過去10個のアクション ';
$PALANG['pViewlog_timestamp'] = 'タイムスタンプ';

@ -167,6 +167,9 @@ $PALANG['pVacation_result_added'] = 'Atostogų pranešimas įjungtas!';
$PALANG['pVacation_reply_type'] = 'Atsakymo tipas';
$PALANG['pVacation_reply_delay_time'] = 'Intervalas';
$PALANG['pVacation_reply_delay_time_text'] = 'Laikas sekundėmis';
$PALANG['reply_once'] = 'Reply once'; # XXX
$PALANG['reply_every_mail'] = 'Reply on every mail'; # XXX
$PALANG['reply_once_per_week'] = 'Reply once per week'; # XXX
$PALANG['pViewlog_welcome'] = 'Peržiūrėti paskutinius 10 vartotojo veiksmų ';
$PALANG['pViewlog_timestamp'] = 'Laikas';

@ -166,6 +166,9 @@ $PALANG['pVacation_result_added'] = 'Auto response for %s has been enabled!'; #
$PALANG['pVacation_reply_type'] = 'Choice of reply'; # XXX
$PALANG['pVacation_reply_delay_time'] = 'Interval time'; # XXX
$PALANG['pVacation_reply_delay_time_text'] = 'Time in seconds'; # XXX
$PALANG['reply_once'] = 'Reply once'; # XXX
$PALANG['reply_every_mail'] = 'Reply on every mail'; # XXX
$PALANG['reply_once_per_week'] = 'Reply once per week'; # XXX
$PALANG['pViewlog_welcome'] = 'Преглед на последните 10 операции за: ';
$PALANG['pViewlog_timestamp'] = 'Маркер (Timestamp)';

@ -167,6 +167,9 @@ $PALANG['pVacation_result_added'] = 'Automatisk svar har blitt aktivert! (%s)';
$PALANG['pVacation_reply_type'] = 'Choice of reply'; # XXX
$PALANG['pVacation_reply_delay_time'] = 'Interval time'; # XXX
$PALANG['pVacation_reply_delay_time_text'] = 'Time in seconds'; # XXX
$PALANG['reply_once'] = 'Reply once'; # XXX
$PALANG['reply_every_mail'] = 'Reply on every mail'; # XXX
$PALANG['reply_once_per_week'] = 'Reply once per week'; # XXX
$PALANG['pViewlog_welcome'] = 'Vis de 10 siste handlingene for ';
$PALANG['pViewlog_timestamp'] = 'Klokkeslett';

@ -168,6 +168,9 @@ $PALANG['pVacation_result_added'] = 'Automatisch beantwoorden is voor %s geactiv
$PALANG['pVacation_reply_type'] = 'Keuze van beantwoording';
$PALANG['pVacation_reply_delay_time'] = 'Interval tijd';
$PALANG['pVacation_reply_delay_time_text'] = 'Tijd in seconds';
$PALANG['reply_once'] = 'Reply once'; # XXX
$PALANG['reply_every_mail'] = 'Reply on every mail'; # XXX
$PALANG['reply_once_per_week'] = 'Reply once per week'; # XXX
$PALANG['pViewlog_welcome'] = 'Laat de laatste 10 actie\'s zien van ';
$PALANG['pViewlog_timestamp'] = 'Tijd';

@ -165,6 +165,9 @@ $PALANG['pVacation_result_added'] = 'Auto response for %s has been enabled!'; #
$PALANG['pVacation_reply_type'] = 'Choice of reply'; # XXX
$PALANG['pVacation_reply_delay_time'] = 'Interval time'; # XXX
$PALANG['pVacation_reply_delay_time_text'] = 'Time in seconds'; # XXX
$PALANG['reply_once'] = 'Reply once'; # XXX
$PALANG['reply_every_mail'] = 'Reply on every mail'; # XXX
$PALANG['reply_once_per_week'] = 'Reply once per week'; # XXX
$PALANG['pViewlog_welcome'] = 'Vis de 10 siste handlingene ';
$PALANG['pViewlog_timestamp'] = 'Klokkeslett';

@ -169,6 +169,9 @@ $PALANG['pVacation_result_added'] = 'Auto odpowiedź została dodana! (%s)'; # X
$PALANG['pVacation_reply_type'] = 'Choice of reply'; # XXX
$PALANG['pVacation_reply_delay_time'] = 'Interval time'; # XXX
$PALANG['pVacation_reply_delay_time_text'] = 'Time in seconds'; # XXX
$PALANG['reply_once'] = 'Reply once'; # XXX
$PALANG['reply_every_mail'] = 'Reply on every mail'; # XXX
$PALANG['reply_once_per_week'] = 'Reply once per week'; # XXX
$PALANG['pViewlog_welcome'] = 'Pokaż 10 ostatnich działań dla ';
$PALANG['pViewlog_timestamp'] = 'Data';

@ -172,6 +172,9 @@ $PALANG['pVacation_result_added'] = 'Resposta automática habilitada! (%s)'; # X
$PALANG['pVacation_reply_type'] = 'Choice of reply'; # XXX
$PALANG['pVacation_reply_delay_time'] = 'Interval time'; # XXX
$PALANG['pVacation_reply_delay_time_text'] = 'Time in seconds'; # XXX
$PALANG['reply_once'] = 'Reply once'; # XXX
$PALANG['reply_every_mail'] = 'Reply on every mail'; # XXX
$PALANG['reply_once_per_week'] = 'Reply once per week'; # XXX
$PALANG['pViewlog_welcome'] = 'Últimas 10 ações para ';
$PALANG['pViewlog_timestamp'] = 'Data/Hora';

@ -172,6 +172,9 @@ $PALANG['pVacation_result_added'] = 'Автоответчик для %s вклю
$PALANG['pVacation_reply_type'] = 'Choice of reply'; # XXX
$PALANG['pVacation_reply_delay_time'] = 'Interval time'; # XXX
$PALANG['pVacation_reply_delay_time_text'] = 'Time in seconds'; # XXX
$PALANG['reply_once'] = 'Reply once'; # XXX
$PALANG['reply_every_mail'] = 'Reply on every mail'; # XXX
$PALANG['reply_once_per_week'] = 'Reply once per week'; # XXX
$PALANG['pViewlog_welcome'] = 'Просмотреть 10 последних действий для ';
$PALANG['pViewlog_timestamp'] = 'Время создания/модификации';

@ -167,6 +167,9 @@ $PALANG['pVacation_result_added'] = 'Automatická odpoveď bola nastavená! (%s)
$PALANG['pVacation_reply_type'] = 'Choice of reply'; # XXX
$PALANG['pVacation_reply_delay_time'] = 'Interval time'; # XXX
$PALANG['pVacation_reply_delay_time_text'] = 'Time in seconds'; # XXX
$PALANG['reply_once'] = 'Reply once'; # XXX
$PALANG['reply_every_mail'] = 'Reply on every mail'; # XXX
$PALANG['reply_once_per_week'] = 'Reply once per week'; # XXX
$PALANG['pViewlog_welcome'] = 'Prehľad 10 posledných akcií pre ';
$PALANG['pViewlog_timestamp'] = 'Časová značka';

@ -166,6 +166,9 @@ $PALANG['pVacation_result_added'] = 'Auto response for %s has been enabled!'; #
$PALANG['pVacation_reply_type'] = 'Choice of reply'; # XXX
$PALANG['pVacation_reply_delay_time'] = 'Interval time'; # XXX
$PALANG['pVacation_reply_delay_time_text'] = 'Time in seconds'; # XXX
$PALANG['reply_once'] = 'Reply once'; # XXX
$PALANG['reply_every_mail'] = 'Reply on every mail'; # XXX
$PALANG['reply_once_per_week'] = 'Reply once per week'; # XXX
$PALANG['pViewlog_welcome'] = 'Seznam zadnjih 10 operacij za ';
$PALANG['pViewlog_timestamp'] = 'Čas';

@ -168,6 +168,9 @@ $PALANG['pVacation_result_added'] = 'Autosvar meddelande har aktiverats! (%s)';
$PALANG['pVacation_reply_type'] = 'Choice of reply'; # XXX
$PALANG['pVacation_reply_delay_time'] = 'Interval time'; # XXX
$PALANG['pVacation_reply_delay_time_text'] = 'Time in seconds'; # XXX
$PALANG['reply_once'] = 'Reply once'; # XXX
$PALANG['reply_every_mail'] = 'Reply on every mail'; # XXX
$PALANG['reply_once_per_week'] = 'Reply once per week'; # XXX
$PALANG['pViewlog_welcome'] = 'Visa dom senaste 10 åtgärderna för ';
$PALANG['pViewlog_timestamp'] = 'Tidpunkt';

@ -166,6 +166,9 @@ $PALANG['pVacation_result_added'] = 'Auto response for %s has been enabled!'; #
$PALANG['pVacation_reply_type'] = 'Choice of reply'; # XXX
$PALANG['pVacation_reply_delay_time'] = 'Interval time'; # XXX
$PALANG['pVacation_reply_delay_time_text'] = 'Time in seconds'; # XXX
$PALANG['reply_once'] = 'Reply once'; # XXX
$PALANG['reply_every_mail'] = 'Reply on every mail'; # XXX
$PALANG['reply_once_per_week'] = 'Reply once per week'; # XXX
$PALANG['pViewlog_welcome'] = 'Son 10 hareket:';
$PALANG['pViewlog_timestamp'] = 'Timestamp';

@ -166,6 +166,9 @@ $PALANG['pVacation_result_added'] = 'Auto response for %s has been enabled!'; #
$PALANG['pVacation_reply_type'] = 'Choice of reply'; # XXX
$PALANG['pVacation_reply_delay_time'] = 'Interval time'; # XXX
$PALANG['pVacation_reply_delay_time_text'] = 'Time in seconds'; # XXX
$PALANG['reply_once'] = 'Reply once'; # XXX
$PALANG['reply_every_mail'] = 'Reply on every mail'; # XXX
$PALANG['reply_once_per_week'] = 'Reply once per week'; # XXX
$PALANG['pViewlog_welcome'] = '查看最新的10項操作日誌 網域名: ';
$PALANG['pViewlog_timestamp'] = '時間';

@ -149,7 +149,6 @@ class VacationHandler extends PFAHandler {
'subject' => $row['subject'],
'body' => $row['body'],
'active' => $boolean ,
'reply_type' => $row['reply_type'],
'interval_time' => $row['interval_time'],
'activeFrom' => $row['activefrom'],
'activeUntil' => $row['activeuntil'],
@ -158,12 +157,11 @@ class VacationHandler extends PFAHandler {
/**
* @param string $subject
* @param string $body
* @param string $reply_type
* @param string $interval_time
* @param date $activeFrom
* @param date $activeUntil
*/
function set_away($subject, $body, $reply_type, $interval_time, $activeFrom, $activeUntil) {
function set_away($subject, $body, $interval_time, $activeFrom, $activeUntil) {
$this->remove(); // clean out any notifications that might already have been sent.
$E_username = escape_string($this->username);
@ -176,7 +174,6 @@ class VacationHandler extends PFAHandler {
'domain' => $domain,
'subject' => $subject,
'body' => $body,
'reply_type' => $reply_type,
'interval_time' => $interval_time,
'active' => db_get_boolean(true),
'activefrom' => $activeFrom,

@ -45,16 +45,13 @@
<tr>
<td class="label"><label>{$PALANG.pVacation_reply_type}:</label></td>
<td><select class="flat" name="fReply_Type">{$select_options}</select></td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="label"><label>{$PALANG.pVacation_reply_delay_time}:</label></td>
<td><input class="flat" type="text" name="fInterval_Time" value="{$tInterval_Time}" /></td>
<td>{$PALANG.pVacation_reply_delay_time_text}</td>
<td>
<select class="flat" name="fInterval_Time">
{html_options options=$select_options selected=$tInterval_Time}
</select>
</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="label"><label>{$PALANG.subject}:</label></td>
<td><textarea class="flat" rows="3" cols="60" name="fSubject" >{$tSubject}</textarea></td>

@ -1329,9 +1329,11 @@ function upgrade_1284() {
}
function upgrade_1345_mysql() {
$table_vacation = table_by_key('vacation');
db_query_parsed("ALTER TABLE `$table_vacation` ADD `reply_type` VARCHAR( 20 ) NOT NULL AFTER `domain` ");
db_query_parsed("ALTER TABLE `$table_vacation` ADD `interval_time` INT NOT NULL DEFAULT '0' AFTER `reply_type` ");
# $table_vacation = table_by_key('vacation');
# adding and usage of reply_type field removed in r1610
# db_query_parsed("ALTER TABLE `$table_vacation` ADD `reply_type` VARCHAR( 20 ) NOT NULL AFTER `domain` ");
# obsoleted by upgrade_1610()
# db_query_parsed("ALTER TABLE `$table_vacation` ADD `interval_time` INT NOT NULL DEFAULT '0' AFTER `reply_type` ");
}
function upgrade_1519() {
@ -1340,6 +1342,10 @@ function upgrade_1519() {
_db_add_field('fetchmail', 'sslfingerprint', "VARCHAR(255) {LATIN1} DEFAULT ''", 'sslcertpath');
}
function upgrade_1610() {
# obsoletes upgrade_1345_mysql() - which means debug mode could print "field already exists"
_db_add_field('vacation', 'interval_time', '{INT}', 'domain');
}
# TODO MySQL:
# - various varchar fields do not have a default value

@ -68,6 +68,10 @@ date_default_timezone_set(@date_default_timezone_get()); # Suppress date.timezon
$vh = new VacationHandler($fUsername);
$choice_of_reply = Config::read('vacation_choice_of_reply');
foreach (array_keys($choice_of_reply) as $key) {
$choice_of_reply[$key] = Config::Lang($choice_of_reply[$key]);
}
if ($_SERVER['REQUEST_METHOD'] == "GET") {
$tSubject = '';
@ -75,14 +79,12 @@ if ($_SERVER['REQUEST_METHOD'] == "GET") {
$tActiveFrom = '';
$tActiveUntil = '';
$tUseremail = $fUsername;
$tReply_Type = '';
$tInterval_Time = '';
$details = $vh->get_details();
if($details != false) {
$tSubject = $details['subject'];
$tBody = $details['body'];
$tReply_Type = $details['reply_type'];
$tInterval_Time = $details['interval_time'];
$tActiveFrom = $details['activeFrom'];
$tActiveUntil = $details['activeUntil'];
@ -97,12 +99,6 @@ if ($_SERVER['REQUEST_METHOD'] == "GET") {
if ($tSubject == '') { $tSubject = html_entity_decode($PALANG['pUsersVacation_subject_text'], ENT_QUOTES, 'UTF-8'); }
if ($tBody == '') { $tBody = html_entity_decode($PALANG['pUsersVacation_body_text'], ENT_QUOTES, 'UTF-8'); }
if ($tReply_Type =='') { $tReply_Type = $CONF['vacation_replytype_default'];}
if ($tReply_Type =='One Reply') { $tInterval_Time = '0';}
if ($tReply_Type =='Auto Reply') { $tInterval_Time = $CONF['vacation_autoreplydelay_default'];}
if (($tReply_Type =='Interval Reply') and ($tInterval_Time =='')) { $tInterval_Time = $CONF['vacation_intervaldelay_default'];}
if (($tReply_Type =='Interval Reply') and ($tInterval_Time <= $CONF['vacation_autoreplydelay_default'])) { $tInterval_Time = $CONF['vacation_intervaldelay_default'];}
}
if ($_SERVER['REQUEST_METHOD'] == "POST")
@ -120,7 +116,6 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
$tBody = safepost('fBody');
$fBody = $tBody;
$tReply_Type = safepost('fReply_Type');
$tInterval_Time = safepost('fInterval_Time');
$fChange = escape_string (safepost('fChange'));
@ -131,14 +126,12 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
//set a default, reset fields for coming back selection
if ($tSubject == '') { $tSubject = html_entity_decode($PALANG['pUsersVacation_subject_text'], ENT_QUOTES, 'UTF-8'); }
if ($tBody == '') { $tBody = html_entity_decode($PALANG['pUsersVacation_body_text'], ENT_QUOTES, 'UTF-8'); }
if ($tReply_Type =='') { $tReply_Type = $CONF['vacation_replytype_default'];}
if ($tReply_Type =='One Reply') { $tInterval_Time = '0';}
if ($tReply_Type =='Auto Reply') { $tInterval_Time = $CONF['vacation_autoreplydelay_default'];}
if (($tReply_Type =='Interval Reply') and ($tInterval_Time =='')) { $tInterval_Time = $CONF['vacation_intervaldelay_default'];}
if (($tReply_Type =='Interval Reply') and ($tInterval_Time <= $CONF['vacation_autoreplydelay_default'])) { $tInterval_Time = $CONF['vacation_intervaldelay_default'];}
$fReply_Type = $tReply_Type ;
$fInterval_Time = $tInterval_Time;
if (isset($choice_of_reply[$tInterval_Time])) {
$fInterval_Time = $tInterval_Time;
} else {
$fInterval_Time = 0;
}
// if they've set themselves change OR back, delete any record of vacation emails.
// the user is going away - set the goto alias and vacation table as necessary.
@ -146,7 +139,7 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
//Set the vacation data for $fUsername
if (!empty ($fChange))
{
if(!$vh->set_away($fSubject, $fBody, $fReply_Type, $fInterval_Time, $tActiveFrom, $tActiveUntil)) {
if(!$vh->set_away($fSubject, $fBody, $fInterval_Time, $tActiveFrom, $tActiveUntil)) {
$error = 1;
}
}
@ -176,17 +169,25 @@ if($error == 0) {
else {
flash_error($PALANG['pVacation_result_error']);
}
if (empty ($tActiveFrom))
$tActiveFrom = date ("Y-m-d");
if (empty ($tActiveUntil))
$tActiveUntil = date ("Y-m-d");
$today = date ("Y-m-d");
if (empty ($tActiveFrom)) $tActiveFrom = $today;
if (empty ($tActiveUntil)) $tActiveUntil = $today;
if ( ! $details['active']) {
# if vacation is disabled, there's no point in displaying the date of the last vacation ;-)
# (which also means users would have to scroll in the calendar a lot)
# so let's be user-friendly and set today's date (but only if the last vacation is in the past)
if ($tActiveFrom < $today) $tActiveFrom = $today;
if ($tActiveUntil < $today) $tActiveUntil = $today;
}
$smarty->assign ('tUseremail', $tUseremail);
$smarty->assign ('tSubject', $tSubject);
$smarty->assign ('tBody', $tBody);
$smarty->assign ('tActiveFrom', date ("d.m.Y", strtotime ($tActiveFrom)));
$smarty->assign ('tActiveUntil', date ("d.m.Y", strtotime ($tActiveUntil)));
$smarty->assign ('select_options', select_options ( $CONF ['vacation_choice_of_reply'], array ($tReply_Type)),false);
$smarty->assign ('select_options', $choice_of_reply);
$smarty->assign ('tInterval_Time', $tInterval_Time);
$smarty->assign ('smarty_template', 'vacation');
$smarty->display ('index.tpl');

@ -137,7 +137,7 @@ class VacationProxy {
*/
public function setAway($subject, $body, $interval_time = 0, $activeFrom = '2000-01-01', $activeUntil = '2099-12-31') {
$vh = new VacationHandler($_SESSION['sessid']['username']);
return $vh->set_away($subject, $body, '', $interval_time, $activeFrom, $activeUntil);
return $vh->set_away($subject, $body, $interval_time, $activeFrom, $activeUntil);
}

Loading…
Cancel
Save