[ postfixadmin-Patches-3508083 ] vacation with choice of reply
Brought to you by:
christian_boltz,
gingerdog
From: SourceForge.net <no...@so...> - 2012-08-04 20:16:58
|
Patches item #3508083, was opened at 2012-03-18 14:16 Message generated for change (Comment added) made by jan-kruis You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3508083&group_id=191583 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Vacation Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: J.Kruis (jan-kruis) Assigned to: Nobody/Anonymous (nobody) Summary: vacation with choice of reply Initial Comment: This patch provides users and administrators the ability to choose between three types of reply. one reply autoreply reply with delay ---------------------------------------------------------------------- Comment By: J.Kruis (jan-kruis) Date: 2012-08-04 13:16 Message: Hi Christian, You are right $ CONF ['usercontol'] and $ CONFIG ['users_domain_controle'] which are not used yet also $ CONF ['vacation_replytype_control'] and $ CONFIG ['vacation_allow_user_reply'] are not used yet These items should not have been included in this patch but I was already working on Patch 352593 [UserControl] I have With concern to $ CONF ['choice_of_reply'] i also agree with you. I would like to change in the form of an array and applying with the language files, but my knowledge of programming in PHP is somewhat limited so help is welcome I am thinking of adding this into config.inc.php [Code] // Get the user or Admin a choice of reply // If you want to add a extra type of reply you MUST add this choice to the interval_time arry below // as well to add a entry pReplychoice_xxxxxx to the the [postfixhomedir]/languages/en.lang and your onw contry file $CONF['choice_of_reply'] = array ( 'One Reply' => 'pReplychoice_ones', // Only Reply ones on a email 'Auto Reply' => 'pReplychoice_auto_reply', // Send no email if last email was send within 10 sec. see interval_time [Auto Reply] 'One Hour' => 'PReplychoice_one_hour', // Send only a reply to a email if the last 1 hour ago. see interval_time [One Hour] 'One Day' => 'pReplychoice_one_day', // Send only a reply to a email if the last 1 day ago. see interval_time [One Day] 'One Week' => 'pReplychoice_one_week' // Send only a reply to a email if the last 1 week ago. see interval_time [One Week] ); // Get the time according to choice of reply (see above entry) // If your have add a extra choice add that choice also below in this array $CONF['interval_time'] = array ( 'One Reply' => '0', // 0 means only one reply this value MUST be Zero en may not be change 'Auto Reply' => '10', // This is your autoreplydelay time adjust this value to your needs 'One Hour' => '3600', // one hour = 60 * 60 seconds 'One Day' => '86400', // One day = 60 * 60 * 24 seconds 'One Week' => '604800' // One week = 60 * 60 * 24 * 7 seconds ); [/CODE] or is it better to place this array I vacation.php Question 1 Can i work with a array of 3 items like $CONF['choice_of_reply'] = array ( //type of reply interval time translation string 'one reply', '0', 'pReplychoice_ones', 'auto reply', '10', 'pReplychoice_autoreply', … ); Questing 2 how can display a list using the above array type of reply and interval should by stored in the database and the translation string referred by pReplychoice… should be displayed as a list. I have make change to upgrade.php and now used _db_add_field() Regards Jan Kruis ---------------------------------------------------------------------- Comment By: Christian Boltz (christian_boltz) Date: 2012-08-01 15:02 Message: I know I'm late ;-) but unfortunately your patch contains several issues :-( (and you are lucky that David already commited it - I would have rejected it in the current state ;-) The patch introduces two unrelated (and unused?) config options: $CONF['usercontol'] and $CONF['users_domain_controle'] which aren't used. $CONF['vacation_replytype_control'] and $CONF['vacation_allow_user_reply'] aren't used/checked (the fields are always displayed) the texts for $CONF['choice_of_reply'] are hardcoded in several places - does it really make sense to make them configurable? (Besides that, I'd prefer to have them translateable.) if I get the comment in vacation.pl right, only the reply interval is checked ( 0 = onereply, 1 = autoreply, >1 = Delay reply ) - what's the reason for storing the "reply_type" as text in the database? It looks superfluous to me. (BTW: Does it really make sense to let the user enter the interval? IMHO providing the dropdown with some options would be enough, but I don't know your usecase.) upgrade_1345_mysql should use the _db_add_field() function of upgrade.php the upgrade for postgresql users is missing (hint: _db_add_field() can cover both) in vacation.pl, the interval stored in the database silently overrides the config option $interval - this might make sense, but it should at least be documented (and/or the config option removed) Can you please provide an additional patch to solve those issues? ---------------------------------------------------------------------- Comment By: GingerDog (gingerdog) Date: 2012-04-19 14:56 Message: Thank you for the patch; I've not tested it yet. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3508083&group_id=191583 |