[ postfixadmin-Patches-3383236 ] preliminary code to merge vacation
Brought to you by:
christian_boltz,
gingerdog
|
From: SourceForge.net <no...@so...> - 2011-08-06 21:17:54
|
Patches item #3383236, was opened at 2011-07-31 14:38 Message generated for change (Comment added) made by jan-kruis You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3383236&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: SVN (please specify revision!) Status: Open Resolution: None Priority: 5 Private: No Submitted By: J.Kruis (jan-kruis) Assigned to: Nobody/Anonymous (nobody) Summary: preliminary code to merge vacation Initial Comment: this patch i use to get code in to sync toget later one template and one code voor edit-vacation and user-vacation regarde Jan Kruis ---------------------------------------------------------------------- Comment By: J.Kruis (jan-kruis) Date: 2011-08-06 23:17 Message: Hi Christian, I used your vacation.tpl adjustment. Q1 I wonder whether it is advisable to rename the languages of [pUsersVacation] change to [pVacation] It clearness would clearly benefit, but I think it will generate lot of translation work . I like to hear your opinion. Q2 Flash_Message I wanted to use the email user to be added to the flash_info / flash_error () I try it now via% s see question below. Another question relates to sprintf () and% s $ PALANG text? where can I find an example of the use of it. I found something in footer.php but did not it dn't call the function with flash or flash error information. when i try it it dn't repleace the %s but show it. The adjustment that I will make in the long file *. I will make in the NL and EN version. Q3 I run into another problem. Depending on the role (admin or user) I set the variable $ return_url = 'list-virtual.php? fDomain $ domain ='; or $ return_url = 'main.php'; I like the following line ... insert vaction.php they do not work. I get a blank screen. header ("Location:". "return_url $ '.) question: How do I header () returns the location if I want to define as a variable. This is the code I currently use. [code] // only allow admins to change someone else's 'stuff' if(authentication_has_role('admin')) { $Admin_Role = 1 ; $Return_url = 'list-virtual.php?domain=$fDomain'; if (isset($_GET['username'])) $fUsername = escape_string ($_GET['username']); if (isset($_GET['domain'])) $fDomain = escape_string ($_GET['domain']); } else { $Admin_Role = 0 ; $Return_url = 'main.php'; // authentication_require_role('user'); $fUsername = $SESSID_USERNAME; $fDomain = $USERID_DOMAIN; } // is vacation support enabled in $CONF ? if($CONF['vacation'] == 'NO') { if ($Admin_Role == 1) { header ("Location: list-virtual.php?domain=$fDomain"); } else { header ("Location: main.php"); } exit(0); } [/code] Regards, Jan Kruis ---------------------------------------------------------------------- Comment By: Christian Boltz (christian_boltz) Date: 2011-08-05 22:18 Message: Some small notes on vacation-3.patch: edit.vacation.php + users/vacation.php: - The fChange and fBack POST variables are only used with empty() - that means escape_string() is superfluous (but doesn't hurt) - I don't see a real need for using $Flash_Message - you can use flash_info()/flash_error() with a $PALANG text directly vacation.tpl: - displaying the mail address in users/ is superfluous IMHO - I'd propose to wrap this table row in {if !$authentication_has_role.user} ... {/if} I nevertheless commited your patch to SVN r1163 (without changes to avoid merge conflicts for you). About your TODO list: > - remove entry in the language with are not used any more. Just tell me which $PALANG texts are no longer needed, I will handle the changes in *.lang > - add useremail to flash-message sure for admin if coming back to > list-virtual.php. Sounds like a good idea. You can use sprintf() and '%s' in the $PALANG text to make the text a valid sentense. Feel free to modify the existing text in the languages you understand. For the others, we can just append '(%s)' to the text and add a comment to the translators that they should make the translation nicer. Again, I can help with updating *.lang if you want - doing this with language-update.sh might be faster than manual editing. ---------------------------------------------------------------------- Comment By: Christian Boltz (christian_boltz) Date: 2011-08-04 13:38 Message: Translation update commited to SVN r1162. I'll review the vacation-related parts of your patch tonight. ---------------------------------------------------------------------- Comment By: J.Kruis (jan-kruis) Date: 2011-08-01 22:02 Message: Hi Christian, I have upload new patch. In this one i replaced eidt-vaction.tpl and user_vacation.tpl with a new template vacation.tpl as a frist step to merge the two module into one. what a like to do is put the of the email for with the vacation is change into header somethink link auto response for : us...@do... as well user setting as for the admin setting. as you can see i also make a patch voor the languages/nl.lang If you like the patch sofar you may commit vacatiion-3.patch thing i have todo. - remove entry in the language with are not used any more. - merge edit-vacation.php and user/vaction.php into one file. - add useremail to flash-message sure for admin if coming back to list-virtual.php. BTW I had a look a the $smarty->assign remark, and you were right. It is change in vacation-3.patch. if you have any comments or recommendations please let me know Regards Jan Kruis ---------------------------------------------------------------------- Comment By: J.Kruis (jan-kruis) Date: 2011-08-01 22:02 Message: Hi Christian, I have upload new patch. In this one i replaced eidt-vaction.tpl and user_vacation.tpl with a new template vacation.tpl as a frist step to merge the two module into one. what a like to do is put the of the email for with the vacation is change into header somethink link auto response for : us...@do... as well user setting as for the admin setting. as you can see i also make a patch voor the languages/nl.lang If you like the patch sofar you may commit vacatiion-3.patch thing i have todo. - remove entry in the language with are not used any more. - merge edit-vacation.php and user/vaction.php into one file. - add useremail to flash-message sure for admin if coming back to list-virtual.php. BTW I had a look a the $smarty->assign remark, and you were right. It is change in vacation-3.patch. if you have any comments or recommendations please let me know Regards Jan Kruis ---------------------------------------------------------------------- Comment By: J.Kruis (jan-kruis) Date: 2011-08-01 10:51 Message: Christian, In my attempt to merge edit-vacation and user-vacation vacation together into one file (meaning to get the preliminary code and templates as much in sync as possible to obtain unambiguous) I noticed something strange. In the template edit vacation.tpl I particularly "control" and "name" changed from activeform to fActiveForm. I open edit-vacation.php through the edit-list-virtual.php window; everything works well, now I open a second window and open user-vacation everything this still works well, until I reload window 1 (edit vacation). Now change the window in the window of user-vacation but call the right url in the browser, that of edit-vacation.php (with the right name and domain). Could this be the result of my changes of that review, and particularly name? Regards, Jan Kruis ---------------------------------------------------------------------- Comment By: J.Kruis (jan-kruis) Date: 2011-08-01 10:44 Message: Hi Christian, dont commit the patch it nown i upload a second patch with handel the return and removed some unused code in templates please have a look and i see up to remarks i have a look at the $smarty->assign remark reards jan ---------------------------------------------------------------------- Comment By: Christian Boltz (christian_boltz) Date: 2011-08-01 02:23 Message: I just had a quick look at your patch - looks good :-) - but as usual, I found "a hair in the soup" (as we germans say) ;-) In edit-vacation.php, you use (for $tSubject and $tBody) $smarty->assign ('tSubject', htmlentities ($tSubject, ENT_QUOTES, 'UTF-8'), false); You can most probably use this instead: $smarty->assign ('tSubject', $tSubject); (without the "false" as third parameter, $smarty->assign does the htmlentities() call itsself - see assign() and sanitize() in smarty.inc.php) Or did I overlook something? What's your preferred way to continue? Shall I commit your preliminary patch to SVN now or should I wait until you provide a non-preliminary patch? (I'd prefer to commit now, but it's your choice.) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3383236&group_id=191583 |