Description
Jonathan Druart
2017-01-23 17:23:32 UTC
Created attachment 59449 [details] [review] Bug 17975: TT syntax for notices - Prove that HOLD_SLIP is compatible Here we need to test <<today>>. We already pass a value, but it was wrong. We must pass a string, not a DateTime object, otherwise the KohaDates plugin will not display the hours part if we need it. Test plan: Define a HOLD_SLIP notice template to match your need. Do not forget to use [% today | $KohaDates %] or [% today | $KohaDates with_hours => 1 %] To access data from the reserves table, use the 'hold' variable I run into following problem: Syspref dateformat is dd/mm/yyy Notice HOLD contains: [% today | $KohaDates %] Result: Internal Software Error with: undef error - The given date (25/02/2017) does not match the date format (iso) at (...) DateUtils.pm No error if: HOLD contains [% today %] (it displays the date formated following syspref) No error if: HOLD contains [% today | $KohaDates %] and syspref dateformat is changed to iso (yyy-mm-dd) Created attachment 60691 [details] [review] Bug 17975: Let C4::Letters manage today param substitution The today parameter is properly handled from C4::Letters subroutines, we do not need to pass it from callers. Nice catch Marc! Created attachment 60717 [details] [review] Bug 17975: TT syntax for notices - Prove that HOLD_SLIP is compatible Here we need to test <<today>>. We already pass a value, but it was wrong. We must pass a string, not a DateTime object, otherwise the KohaDates plugin will not display the hours part if we need it. Test plan: Define a HOLD_SLIP notice template to match your need. Do not forget to use [% today | $KohaDates %] or [% today | $KohaDates with_hours => 1 %] To access data from the reserves table, use the 'hold' variable Tested both patches together with several date formats, works as expected. Signed-off-by: Marc Véron <veron@veron.ch> Created attachment 60720 [details] [review] Bug 17975: Let C4::Letters manage today param substitution The today parameter is properly handled from C4::Letters subroutines, we do not need to pass it from callers. Signed-off-by: Marc Véron <veron@veron.ch> Created attachment 63968 [details] [review] Bug 17975: TT syntax for notices - Prove that HOLD_SLIP is compatible Here we need to test <<today>>. We already pass a value, but it was wrong. We must pass a string, not a DateTime object, otherwise the KohaDates plugin will not display the hours part if we need it. Test plan: Define a HOLD_SLIP notice template to match your need. Do not forget to use [% today | $KohaDates %] or [% today | $KohaDates with_hours => 1 %] To access data from the reserves table, use the 'hold' variable Tested both patches together with several date formats, works as expected. Signed-off-by: Marc Véron <veron@veron.ch> Created attachment 63969 [details] [review] Bug 17975: Let C4::Letters manage today param substitution The today parameter is properly handled from C4::Letters subroutines, we do not need to pass it from callers. Signed-off-by: Marc Véron <veron@veron.ch> Created attachment 63973 [details] [review] Bug 17975: TT syntax for notices - Prove that HOLD_SLIP is compatible Here we need to test <<today>>. We already pass a value, but it was wrong. We must pass a string, not a DateTime object, otherwise the KohaDates plugin will not display the hours part if we need it. Test plan: Define a HOLD_SLIP notice template to match your need. Do not forget to use [% today | $KohaDates %] or [% today | $KohaDates with_hours => 1 %] To access data from the reserves table, use the 'hold' variable Tested both patches together with several date formats, works as expected. Signed-off-by: Marc Véron <veron@veron.ch> Created attachment 63974 [details] [review] Bug 17975: Let C4::Letters manage today param substitution The today parameter is properly handled from C4::Letters subroutines, we do not need to pass it from callers. Signed-off-by: Marc Véron <veron@veron.ch> Created attachment 64334 [details] [review] Bug 17975: TT syntax for notices - Prove that HOLD_SLIP is compatible Here we need to test <<today>>. We already pass a value, but it was wrong. We must pass a string, not a DateTime object, otherwise the KohaDates plugin will not display the hours part if we need it. Test plan: Define a HOLD_SLIP notice template to match your need. Do not forget to use [% today | $KohaDates %] or [% today | $KohaDates with_hours => 1 %] To access data from the reserves table, use the 'hold' variable Tested both patches together with several date formats, works as expected. Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 64335 [details] [review] Bug 17975: Let C4::Letters manage today param substitution The today parameter is properly handled from C4::Letters subroutines, we do not need to pass it from callers. Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Pushed to master for 17.11, thanks to everybody involved! Enhancement not pushed to 17.05.x |