SF.net SVN: postfixadmin:[1610] trunk
Brought to you by:
christian_boltz,
gingerdog
From: <chr...@us...> - 2013-12-22 16:51:00
|
Revision: 1610 http://sourceforge.net/p/postfixadmin/code/1610 Author: christian_boltz Date: 2013-12-22 16:50:55 +0000 (Sun, 22 Dec 2013) Log Message: ----------- 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 Modified Paths: -------------- trunk/config.inc.php trunk/languages/bg.lang trunk/languages/ca.lang trunk/languages/cn.lang trunk/languages/cs.lang trunk/languages/da.lang trunk/languages/de.lang trunk/languages/en.lang trunk/languages/es.lang trunk/languages/et.lang trunk/languages/eu.lang trunk/languages/fi.lang trunk/languages/fo.lang trunk/languages/fr.lang trunk/languages/hr.lang trunk/languages/hu.lang trunk/languages/is.lang trunk/languages/it.lang trunk/languages/ja.lang trunk/languages/lt.lang trunk/languages/mk.lang trunk/languages/nb.lang trunk/languages/nl.lang trunk/languages/nn.lang trunk/languages/pl.lang trunk/languages/pt-br.lang trunk/languages/ru.lang trunk/languages/sk.lang trunk/languages/sl.lang trunk/languages/sv.lang trunk/languages/tr.lang trunk/languages/tw.lang trunk/model/VacationHandler.php trunk/templates/vacation.tpl trunk/upgrade.php trunk/vacation.php trunk/xmlrpc.php Modified: trunk/config.inc.php =================================================================== --- trunk/config.inc.php 2013-12-15 21:36:00 UTC (rev 1609) +++ trunk/config.inc.php 2013-12-22 16:50:55 UTC (rev 1610) @@ -131,7 +131,7 @@ // 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 @@ // 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 Modified: trunk/languages/bg.lang =================================================================== --- trunk/languages/bg.lang 2013-12-15 21:36:00 UTC (rev 1609) +++ trunk/languages/bg.lang 2013-12-22 16:50:55 UTC (rev 1610) @@ -167,6 +167,9 @@ $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'] = 'Дата'; Modified: trunk/languages/ca.lang =================================================================== --- trunk/languages/ca.lang 2013-12-15 21:36:00 UTC (rev 1609) +++ trunk/languages/ca.lang 2013-12-22 16:50:55 UTC (rev 1610) @@ -165,6 +165,9 @@ $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'; Modified: trunk/languages/cn.lang =================================================================== --- trunk/languages/cn.lang 2013-12-15 21:36:00 UTC (rev 1609) +++ trunk/languages/cn.lang 2013-12-22 16:50:55 UTC (rev 1610) @@ -166,6 +166,9 @@ $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'] = '时间'; Modified: trunk/languages/cs.lang =================================================================== --- trunk/languages/cs.lang 2013-12-15 21:36:00 UTC (rev 1609) +++ trunk/languages/cs.lang 2013-12-22 16:50:55 UTC (rev 1610) @@ -173,6 +173,9 @@ $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'; Modified: trunk/languages/da.lang =================================================================== --- trunk/languages/da.lang 2013-12-15 21:36:00 UTC (rev 1609) +++ trunk/languages/da.lang 2013-12-22 16:50:55 UTC (rev 1610) @@ -173,6 +173,9 @@ $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'; Modified: trunk/languages/de.lang =================================================================== --- trunk/languages/de.lang 2013-12-15 21:36:00 UTC (rev 1609) +++ trunk/languages/de.lang 2013-12-22 16:50:55 UTC (rev 1610) @@ -170,6 +170,9 @@ $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'; Modified: trunk/languages/en.lang =================================================================== --- trunk/languages/en.lang 2013-12-15 21:36:00 UTC (rev 1609) +++ trunk/languages/en.lang 2013-12-22 16:50:55 UTC (rev 1610) @@ -171,6 +171,9 @@ $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'; Modified: trunk/languages/es.lang =================================================================== --- trunk/languages/es.lang 2013-12-15 21:36:00 UTC (rev 1609) +++ trunk/languages/es.lang 2013-12-22 16:50:55 UTC (rev 1610) @@ -167,6 +167,9 @@ $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'; Modified: trunk/languages/et.lang =================================================================== --- trunk/languages/et.lang 2013-12-15 21:36:00 UTC (rev 1609) +++ trunk/languages/et.lang 2013-12-22 16:50:55 UTC (rev 1610) @@ -166,6 +166,9 @@ $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'; Modified: trunk/languages/eu.lang =================================================================== --- trunk/languages/eu.lang 2013-12-15 21:36:00 UTC (rev 1609) +++ trunk/languages/eu.lang 2013-12-22 16:50:55 UTC (rev 1610) @@ -164,6 +164,9 @@ $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'; Modified: trunk/languages/fi.lang =================================================================== --- trunk/languages/fi.lang 2013-12-15 21:36:00 UTC (rev 1609) +++ trunk/languages/fi.lang 2013-12-22 16:50:55 UTC (rev 1610) @@ -166,6 +166,9 @@ $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'; Modified: trunk/languages/fo.lang =================================================================== --- trunk/languages/fo.lang 2013-12-15 21:36:00 UTC (rev 1609) +++ trunk/languages/fo.lang 2013-12-22 16:50:55 UTC (rev 1610) @@ -166,6 +166,9 @@ $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'; Modified: trunk/languages/fr.lang =================================================================== --- trunk/languages/fr.lang 2013-12-15 21:36:00 UTC (rev 1609) +++ trunk/languages/fr.lang 2013-12-22 16:50:55 UTC (rev 1610) @@ -167,6 +167,9 @@ $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'; Modified: trunk/languages/hr.lang =================================================================== --- trunk/languages/hr.lang 2013-12-15 21:36:00 UTC (rev 1609) +++ trunk/languages/hr.lang 2013-12-22 16:50:55 UTC (rev 1610) @@ -165,6 +165,9 @@ $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'; Modified: trunk/languages/hu.lang =================================================================== --- trunk/languages/hu.lang 2013-12-15 21:36:00 UTC (rev 1609) +++ trunk/languages/hu.lang 2013-12-22 16:50:55 UTC (rev 1610) @@ -170,6 +170,9 @@ $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'; Modified: trunk/languages/is.lang =================================================================== --- trunk/languages/is.lang 2013-12-15 21:36:00 UTC (rev 1609) +++ trunk/languages/is.lang 2013-12-22 16:50:55 UTC (rev 1610) @@ -166,6 +166,9 @@ $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'; Modified: trunk/languages/it.lang =================================================================== --- trunk/languages/it.lang 2013-12-15 21:36:00 UTC (rev 1609) +++ trunk/languages/it.lang 2013-12-22 16:50:55 UTC (rev 1610) @@ -167,6 +167,9 @@ $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'; Modified: trunk/languages/ja.lang =================================================================== --- trunk/languages/ja.lang 2013-12-15 21:36:00 UTC (rev 1609) +++ trunk/languages/ja.lang 2013-12-22 16:50:55 UTC (rev 1610) @@ -170,6 +170,9 @@ $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'] = 'タイムスタンプ'; Modified: trunk/languages/lt.lang =================================================================== --- trunk/languages/lt.lang 2013-12-15 21:36:00 UTC (rev 1609) +++ trunk/languages/lt.lang 2013-12-22 16:50:55 UTC (rev 1610) @@ -167,6 +167,9 @@ $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'; Modified: trunk/languages/mk.lang =================================================================== --- trunk/languages/mk.lang 2013-12-15 21:36:00 UTC (rev 1609) +++ trunk/languages/mk.lang 2013-12-22 16:50:55 UTC (rev 1610) @@ -166,6 +166,9 @@ $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)'; Modified: trunk/languages/nb.lang =================================================================== --- trunk/languages/nb.lang 2013-12-15 21:36:00 UTC (rev 1609) +++ trunk/languages/nb.lang 2013-12-22 16:50:55 UTC (rev 1610) @@ -167,6 +167,9 @@ $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'; Modified: trunk/languages/nl.lang =================================================================== --- trunk/languages/nl.lang 2013-12-15 21:36:00 UTC (rev 1609) +++ trunk/languages/nl.lang 2013-12-22 16:50:55 UTC (rev 1610) @@ -168,6 +168,9 @@ $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'; Modified: trunk/languages/nn.lang =================================================================== --- trunk/languages/nn.lang 2013-12-15 21:36:00 UTC (rev 1609) +++ trunk/languages/nn.lang 2013-12-22 16:50:55 UTC (rev 1610) @@ -165,6 +165,9 @@ $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'; Modified: trunk/languages/pl.lang =================================================================== --- trunk/languages/pl.lang 2013-12-15 21:36:00 UTC (rev 1609) +++ trunk/languages/pl.lang 2013-12-22 16:50:55 UTC (rev 1610) @@ -169,6 +169,9 @@ $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'; Modified: trunk/languages/pt-br.lang =================================================================== --- trunk/languages/pt-br.lang 2013-12-15 21:36:00 UTC (rev 1609) +++ trunk/languages/pt-br.lang 2013-12-22 16:50:55 UTC (rev 1610) @@ -172,6 +172,9 @@ $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'; Modified: trunk/languages/ru.lang =================================================================== --- trunk/languages/ru.lang 2013-12-15 21:36:00 UTC (rev 1609) +++ trunk/languages/ru.lang 2013-12-22 16:50:55 UTC (rev 1610) @@ -172,6 +172,9 @@ $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'] = 'Время создания/модификации'; Modified: trunk/languages/sk.lang =================================================================== --- trunk/languages/sk.lang 2013-12-15 21:36:00 UTC (rev 1609) +++ trunk/languages/sk.lang 2013-12-22 16:50:55 UTC (rev 1610) @@ -167,6 +167,9 @@ $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'; Modified: trunk/languages/sl.lang =================================================================== --- trunk/languages/sl.lang 2013-12-15 21:36:00 UTC (rev 1609) +++ trunk/languages/sl.lang 2013-12-22 16:50:55 UTC (rev 1610) @@ -166,6 +166,9 @@ $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'; Modified: trunk/languages/sv.lang =================================================================== --- trunk/languages/sv.lang 2013-12-15 21:36:00 UTC (rev 1609) +++ trunk/languages/sv.lang 2013-12-22 16:50:55 UTC (rev 1610) @@ -168,6 +168,9 @@ $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'; Modified: trunk/languages/tr.lang =================================================================== --- trunk/languages/tr.lang 2013-12-15 21:36:00 UTC (rev 1609) +++ trunk/languages/tr.lang 2013-12-22 16:50:55 UTC (rev 1610) @@ -166,6 +166,9 @@ $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'; Modified: trunk/languages/tw.lang =================================================================== --- trunk/languages/tw.lang 2013-12-15 21:36:00 UTC (rev 1609) +++ trunk/languages/tw.lang 2013-12-22 16:50:55 UTC (rev 1610) @@ -166,6 +166,9 @@ $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'] = '時間'; Modified: trunk/model/VacationHandler.php =================================================================== --- trunk/model/VacationHandler.php 2013-12-15 21:36:00 UTC (rev 1609) +++ trunk/model/VacationHandler.php 2013-12-22 16:50:55 UTC (rev 1610) @@ -149,7 +149,6 @@ '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 @@ /** * @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 @@ 'domain' => $domain, 'subject' => $subject, 'body' => $body, - 'reply_type' => $reply_type, 'interval_time' => $interval_time, 'active' => db_get_boolean(true), 'activefrom' => $activeFrom, Modified: trunk/templates/vacation.tpl =================================================================== --- trunk/templates/vacation.tpl 2013-12-15 21:36:00 UTC (rev 1609) +++ trunk/templates/vacation.tpl 2013-12-22 16:50:55 UTC (rev 1610) @@ -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> + <select class="flat" name="fInterval_Time"> + {html_options options=$select_options selected=$tInterval_Time} + </select> + </td> <td> </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> </td> - </tr> - <tr> <td class="label"><label>{$PALANG.subject}:</label></td> <td><textarea class="flat" rows="3" cols="60" name="fSubject" >{$tSubject}</textarea></td> Modified: trunk/upgrade.php =================================================================== --- trunk/upgrade.php 2013-12-15 21:36:00 UTC (rev 1609) +++ trunk/upgrade.php 2013-12-22 16:50:55 UTC (rev 1610) @@ -1329,9 +1329,11 @@ } 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 @@ _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 Modified: trunk/vacation.php =================================================================== --- trunk/vacation.php 2013-12-15 21:36:00 UTC (rev 1609) +++ trunk/vacation.php 2013-12-22 16:50:55 UTC (rev 1610) @@ -68,6 +68,10 @@ $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 @@ $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 ($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 @@ $tBody = safepost('fBody'); $fBody = $tBody; - $tReply_Type = safepost('fReply_Type'); $tInterval_Time = safepost('fInterval_Time'); $fChange = escape_string (safepost('fChange')); @@ -131,14 +126,12 @@ //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 @@ //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 @@ 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'); Modified: trunk/xmlrpc.php =================================================================== --- trunk/xmlrpc.php 2013-12-15 21:36:00 UTC (rev 1609) +++ trunk/xmlrpc.php 2013-12-22 16:50:55 UTC (rev 1610) @@ -137,7 +137,7 @@ */ 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); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |