Bug 17975

Summary: TT syntax for notices - Prove that HOLD_SLIP is compatible
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Architecture, internals, and plumbingAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: fridolin.somers, kyle, veron
Version: unspecified   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36125
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 17965    
Bug Blocks: 17961, 17966    
Attachments: Bug 17975: TT syntax for notices - Prove that HOLD_SLIP is compatible
Bug 17975: Let C4::Letters manage today param substitution
Bug 17975: TT syntax for notices - Prove that HOLD_SLIP is compatible
Bug 17975: Let C4::Letters manage today param substitution
Bug 17975: TT syntax for notices - Prove that HOLD_SLIP is compatible
Bug 17975: Let C4::Letters manage today param substitution
Bug 17975: TT syntax for notices - Prove that HOLD_SLIP is compatible
Bug 17975: Let C4::Letters manage today param substitution
Bug 17975: TT syntax for notices - Prove that HOLD_SLIP is compatible
Bug 17975: Let C4::Letters manage today param substitution

Description Jonathan Druart 2017-01-23 17:23:32 UTC

    
Comment 1 Jonathan Druart 2017-01-23 17:31:20 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
Comment 2 Marc Véron 2017-02-25 22:02:35 UTC
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)
Comment 3 Jonathan Druart 2017-02-27 09:02:02 UTC
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.
Comment 4 Jonathan Druart 2017-02-27 09:02:41 UTC
Nice catch Marc!
Comment 5 Marc Véron 2017-02-27 15:22:22 UTC
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>
Comment 6 Marc Véron 2017-02-27 15:23:58 UTC
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>
Comment 7 Jonathan Druart 2017-06-05 16:30:35 UTC
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>
Comment 8 Jonathan Druart 2017-06-05 16:30:39 UTC
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>
Comment 9 Jonathan Druart 2017-06-05 16:40:06 UTC
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>
Comment 10 Jonathan Druart 2017-06-05 16:40:11 UTC
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>
Comment 11 Kyle M Hall 2017-06-15 14:56:58 UTC
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>
Comment 12 Kyle M Hall 2017-06-15 14:57:22 UTC
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>
Comment 13 Jonathan Druart 2017-06-15 19:08:25 UTC
Pushed to master for 17.11, thanks to everybody involved!
Comment 14 Fridolin Somers 2017-06-20 08:48:30 UTC
Enhancement not pushed to 17.05.x