Bug 17975 - TT syntax for notices - Prove that HOLD_SLIP is compatible
Summary: TT syntax for notices - Prove that HOLD_SLIP is compatible
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 17965
Blocks: 17961 17966
  Show dependency treegraph
 
Reported: 2017-01-23 17:23 UTC by Jonathan Druart
Modified: 2024-02-16 21:53 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 17975: TT syntax for notices - Prove that HOLD_SLIP is compatible (5.71 KB, patch)
2017-01-23 17:31 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 17975: Let C4::Letters manage today param substitution (1.37 KB, patch)
2017-02-27 09:02 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 17975: TT syntax for notices - Prove that HOLD_SLIP is compatible (5.92 KB, patch)
2017-02-27 15:22 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 17975: Let C4::Letters manage today param substitution (1.50 KB, patch)
2017-02-27 15:23 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 17975: TT syntax for notices - Prove that HOLD_SLIP is compatible (5.93 KB, patch)
2017-06-05 16:30 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 17975: Let C4::Letters manage today param substitution (1.57 KB, patch)
2017-06-05 16:30 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 17975: TT syntax for notices - Prove that HOLD_SLIP is compatible (6.02 KB, patch)
2017-06-05 16:40 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 17975: Let C4::Letters manage today param substitution (1.57 KB, patch)
2017-06-05 16:40 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 17975: TT syntax for notices - Prove that HOLD_SLIP is compatible (6.06 KB, patch)
2017-06-15 14:56 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 17975: Let C4::Letters manage today param substitution (1.62 KB, patch)
2017-06-15 14:57 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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