[Bug 17971] New: TT syntax for notices - Add support for plurals
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: jonathan.druart@bugs.koha-community.org Reporter: jonathan.druart@bugs.koha-community.org QA Contact: testopia@bugs.koha-community.org 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.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17971 Jonathan Druart <jonathan.druart@bugs.koha-community.org> 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.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17971 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17971 --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- 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.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17971 --- Comment #2 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- 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.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17971 Jonathan Druart <jonathan.druart@bugs.koha-community.org> 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.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17971 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17971 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #59426|0 |1 is obsolete| | --- Comment #3 from Josef Moravec <josef.moravec@gmail.com> --- 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 <josef.moravec@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17971 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #59427|0 |1 is obsolete| | --- Comment #4 from Josef Moravec <josef.moravec@gmail.com> --- 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 <josef.moravec@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
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.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17971 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Patch doesn't apply CC| |m.de.rooy@rijksmuseum.nl --- Comment #5 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- 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.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17971 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17971 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #59529|0 |1 is obsolete| | Attachment #59530|0 |1 is obsolete| | --- Comment #6 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- 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 <josef.moravec@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17971 --- Comment #7 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- 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 <josef.moravec@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17971 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17971 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #60987|0 |1 is obsolete| | Attachment #60988|0 |1 is obsolete| | --- Comment #8 from Nick Clemens <nick@bywatersolutions.com> --- 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 <josef.moravec@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17971 --- Comment #9 from Nick Clemens <nick@bywatersolutions.com> --- 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 <josef.moravec@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17971 --- Comment #10 from Nick Clemens <nick@bywatersolutions.com> --- 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.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17971 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |kyle@bywatersolutions.com --- Comment #11 from Kyle M Hall <kyle@bywatersolutions.com> --- Pushed to master for 17.05, thanks Jonathan, Nick! -- You are receiving this mail because: You are watching all bug changes.
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.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17971 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |RESOLVED CC| |katrin.fischer@bsz-bw.de Resolution|--- |FIXED --- Comment #12 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- 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.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17971 Nick Clemens <nick@bywatersolutions.com> 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.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org