[Bug 17971] New: TT syntax for notices - Add support for plurals

classic Classic list List threaded Threaded
22 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 17971] New: TT syntax for notices - Add support for plurals

bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17971

            Bug ID: 17971
           Summary: TT syntax for notices - Add support for plurals
 Change sponsored?: ---
           Product: Koha
           Version: unspecified
          Hardware: All
                OS: All
            Status: ASSIGNED
          Severity: enhancement
          Priority: P5 - low
         Component: Architecture, internals, and plumbing
          Assignee: [hidden email]
          Reporter: [hidden email]
        QA Contact: [hidden email]

On of the awesome things we will be able to do with the TT syntax is the
support of plurals.

For instance we will be able to send a list of items, checkouts, etc. to the
notice template.
That way we will get rid of our custom syntax like <<items.content>> or
<item></item> for instance.

The existing code already has the playground for that but it is not used.

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 17971] TT syntax for notices - Add support for plurals

bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17971

Jonathan Druart <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Depends on|                            |17958, 17970


Referenced Bugs:

https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17958
[Bug 17958] Add the Koha::Notice::Template[s] packages (letter table)
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17970
[Bug 17970] GetPreparedLetter does not warn when expected
--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 17971] TT syntax for notices - Add support for plurals

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17971

Jonathan Druart <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |Needs Signoff

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 17971] TT syntax for notices - Add support for plurals

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17971

--- Comment #1 from Jonathan Druart <[hidden email]> ---
Created attachment 59426
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=59426&action=edit
Bug 17971: TT syntax for notices - Add support for plurals

On of the awesome things we will be able to do with the TT syntax is the
support of plurals.

For instance we will be able to send a list of items, checkouts, etc. to the
notice template.
That way we will get rid of our custom syntax like <<items.content>> or
<item></item> for instance.

The existing code already has the playground for that but it is not used.

Basically the idea is to add a "loops" key which can contain a list of
object to retrieve from the DB and send to the template.
For instance:
    loops => { overdues => [ $itemnumber_1, .., $itemnumber_N ] }

will send a variable "overdues" to the template. It will contain the
Koha::Checkout objects relative to the id passed.

There is one quite big inconvenient to this approach so far: since we
are still supporting the historical syntax, the objects can be fetch by
a script, then the script will send the id to GetPreparedLetter which
will refetch them.
This must be improved, but I suggest to do that later.

Test plan:
  prove t/db_dependent/Letters/TemplateToolkit.t
should return green

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 17971] TT syntax for notices - Add support for plurals

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17971

--- Comment #2 from Jonathan Druart <[hidden email]> ---
Created attachment 59427
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=59427&action=edit
Bug 17971: Add support for objects represented by fk

For instance an issue is not fetch from its fk but using the fk
itemnumber.
We need to support them.

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 17971] TT syntax for notices - Add support for plurals

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17971

Jonathan Druart <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |17966


Referenced Bugs:

https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17966
[Bug 17966] TT syntax for notices - Prove that ISSUESLIP is compatible
--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 17971] TT syntax for notices - Add support for plurals

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17971

Josef Moravec <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|Needs Signoff               |Signed Off

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 17971] TT syntax for notices - Add support for plurals

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17971

Josef Moravec <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #59426|0                           |1
        is obsolete|                            |

--- Comment #3 from Josef Moravec <[hidden email]> ---
Created attachment 59529
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=59529&action=edit
[SIGNED-OFF] Bug 17971: TT syntax for notices - Add support for plurals

On of the awesome things we will be able to do with the TT syntax is the
support of plurals.

For instance we will be able to send a list of items, checkouts, etc. to the
notice template.
That way we will get rid of our custom syntax like <<items.content>> or
<item></item> for instance.

The existing code already has the playground for that but it is not used.

Basically the idea is to add a "loops" key which can contain a list of
object to retrieve from the DB and send to the template.
For instance:
    loops => { overdues => [ $itemnumber_1, .., $itemnumber_N ] }

will send a variable "overdues" to the template. It will contain the
Koha::Checkout objects relative to the id passed.

There is one quite big inconvenient to this approach so far: since we
are still supporting the historical syntax, the objects can be fetch by
a script, then the script will send the id to GetPreparedLetter which
will refetch them.
This must be improved, but I suggest to do that later.

Test plan:
  prove t/db_dependent/Letters/TemplateToolkit.t
should return green

Signed-off-by: Josef Moravec <[hidden email]>

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 17971] TT syntax for notices - Add support for plurals

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17971

Josef Moravec <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #59427|0                           |1
        is obsolete|                            |

--- Comment #4 from Josef Moravec <[hidden email]> ---
Created attachment 59530
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=59530&action=edit
[SIGNED-OFF] Bug 17971: Add support for objects represented by fk

For instance an issue is not fetch from its fk but using the fk
itemnumber.
We need to support them.

Signed-off-by: Josef Moravec <[hidden email]>

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 17971] TT syntax for notices - Add support for plurals

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17971
Bug 17971 depends on bug 17958, which changed state.

Bug 17958 Summary: Add the Koha::Notice::Template[s] packages (letter table)
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17958

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|Pushed to Master            |RESOLVED
         Resolution|---                         |FIXED

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 17971] TT syntax for notices - Add support for plurals

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17971

Marcel de Rooy <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|Signed Off                  |Patch doesn't apply
                 CC|                            |[hidden email]

--- Comment #5 from Marcel de Rooy <[hidden email]> ---
Applying on top of 17970:

Applying: Bug 17971: TT syntax for notices - Add support for plurals
fatal: sha1 information is lacking or useless (C4/Letters.pm).
Repository lacks necessary blobs to fall back on 3-way merge.
Cannot fall back to three-way merge.

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 17971] TT syntax for notices - Add support for plurals

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17971

Jonathan Druart <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|Patch doesn't apply         |Signed Off

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 17971] TT syntax for notices - Add support for plurals

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17971

Jonathan Druart <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #59529|0                           |1
        is obsolete|                            |
  Attachment #59530|0                           |1
        is obsolete|                            |

--- Comment #6 from Jonathan Druart <[hidden email]> ---
Created attachment 60987
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=60987&action=edit
Bug 17971: TT syntax for notices - Add support for plurals

On of the awesome things we will be able to do with the TT syntax is the
support of plurals.

For instance we will be able to send a list of items, checkouts, etc. to the
notice template.
That way we will get rid of our custom syntax like <<items.content>> or
<item></item> for instance.

The existing code already has the playground for that but it is not used.

Basically the idea is to add a "loops" key which can contain a list of
object to retrieve from the DB and send to the template.
For instance:
    loops => { overdues => [ $itemnumber_1, .., $itemnumber_N ] }

will send a variable "overdues" to the template. It will contain the
Koha::Checkout objects relative to the id passed.

There is one quite big inconvenient to this approach so far: since we
are still supporting the historical syntax, the objects can be fetch by
a script, then the script will send the id to GetPreparedLetter which
will refetch them.
This must be improved, but I suggest to do that later.

Test plan:
  prove t/db_dependent/Letters/TemplateToolkit.t
should return green

Signed-off-by: Josef Moravec <[hidden email]>

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 17971] TT syntax for notices - Add support for plurals

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17971

--- Comment #7 from Jonathan Druart <[hidden email]> ---
Created attachment 60988
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=60988&action=edit
Bug 17971: Add support for objects represented by fk

For instance an issue is not fetch from its fk but using the fk
itemnumber.
We need to support them.

Signed-off-by: Josef Moravec <[hidden email]>

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 17971] TT syntax for notices - Add support for plurals

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17971

Nick Clemens <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|Signed Off                  |Passed QA

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 17971] TT syntax for notices - Add support for plurals

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17971

Nick Clemens <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #60987|0                           |1
        is obsolete|                            |
  Attachment #60988|0                           |1
        is obsolete|                            |

--- Comment #8 from Nick Clemens <[hidden email]> ---
Created attachment 61710
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=61710&action=edit
Bug 17971: TT syntax for notices - Add support for plurals

On of the awesome things we will be able to do with the TT syntax is the
support of plurals.

For instance we will be able to send a list of items, checkouts, etc. to the
notice template.
That way we will get rid of our custom syntax like <<items.content>> or
<item></item> for instance.

The existing code already has the playground for that but it is not used.

Basically the idea is to add a "loops" key which can contain a list of
object to retrieve from the DB and send to the template.
For instance:
    loops => { overdues => [ $itemnumber_1, .., $itemnumber_N ] }

will send a variable "overdues" to the template. It will contain the
Koha::Checkout objects relative to the id passed.

There is one quite big inconvenient to this approach so far: since we
are still supporting the historical syntax, the objects can be fetch by
a script, then the script will send the id to GetPreparedLetter which
will refetch them.
This must be improved, but I suggest to do that later.

Test plan:
  prove t/db_dependent/Letters/TemplateToolkit.t
should return green

Signed-off-by: Josef Moravec <[hidden email]>

Signed-off-by: Nick Clemens <[hidden email]>

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 17971] TT syntax for notices - Add support for plurals

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17971

--- Comment #9 from Nick Clemens <[hidden email]> ---
Created attachment 61711
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=61711&action=edit
Bug 17971: Add support for objects represented by fk

For instance an issue is not fetch from its fk but using the fk
itemnumber.
We need to support them.

Signed-off-by: Josef Moravec <[hidden email]>

Signed-off-by: Nick Clemens <[hidden email]>

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 17971] TT syntax for notices - Add support for plurals

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17971

--- Comment #10 from Nick Clemens <[hidden email]> ---
Created attachment 61712
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=61712&action=edit
Bug 17971 (QA Followup) Clarify comment

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 17971] TT syntax for notices - Add support for plurals

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17971

Kyle M Hall <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|Passed QA                   |Pushed to Master
                 CC|                            |[hidden email]

--- Comment #11 from Kyle M Hall <[hidden email]> ---
Pushed to master for 17.05, thanks Jonathan, Nick!

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 17971] TT syntax for notices - Add support for plurals

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17971
Bug 17971 depends on bug 17970, which changed state.

Bug 17970 Summary: GetPreparedLetter does not warn when expected
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17970

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|Pushed to Master            |RESOLVED
         Resolution|---                         |FIXED

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 17971] TT syntax for notices - Add support for plurals

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17971

Katrin Fischer <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|Pushed to Master            |RESOLVED
                 CC|                            |[hidden email]
         Resolution|---                         |FIXED

--- Comment #12 from Katrin Fischer <[hidden email]> ---
This won't get ported back to 16.11.x as it is an enhancement.

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 17971] TT syntax for notices - Add support for plurals

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17971

Nick Clemens <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |18620


Referenced Bugs:

https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18620
[Bug 18620] t/db_dependent/Letters.t failing on master
--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/