Summary: | Patron's messages not accessible from template notices | ||
---|---|---|---|
Product: | Koha | Reporter: | Marie-Luce Laflamme <marie-luce.laflamme> |
Component: | Notices | Assignee: | Jonathan Druart <jonathan.druart> |
Status: | CLOSED FIXED | QA Contact: | Marcel de Rooy <m.de.rooy> |
Severity: | minor | ||
Priority: | P5 - low | CC: | andrew, jonathan.druart, kyle, m.de.rooy, stina.hallin, tomascohen |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
22.05.00,21.11.03
|
|
Circulation function: | |||
Bug Depends on: | 29785 | ||
Bug Blocks: | 30099 | ||
Attachments: |
Bug 29230: Add Koha::Patron->messages
Bug 29230: Add Koha::Patron->messages Bug 29230: Add Koha::Patron->messages Bug 29230: Add Koha::Patron->messages Bug 29230: Add Koha::Patron->messages |
Description
Marie-Luce Laflamme
2021-10-13 16:17:38 UTC
I've tried right now on master with <<borrowers.borrowernotes>> and it's working. Which version of Koha are you using? Did you confirm the problem on a sandbox? (In reply to Jonathan Druart from comment #1) I've tried the master, the branch 20.05 and the PTFS-E Sandboxes. Unfortunately, none of them could print the borrowers.borrowernotes and borrowers.opacnote fields. Prior to my test, I did add the following terms in the HOLD_SLIP template email and print tabs: intranet notes: <<borrowers.borrowernotes>> opac notes: <<borrowers.opacnote>> The reserves.notes works fine, but the other note fields aren't showing up on the slip. Go to http://staff-flame.sandboxes.ptfs-europe.co.uk/cgi-bin/koha/circ/returns.pl Check in 39999000004731, click "print slip, transfer, and confirm" => You see the note What did you try? (In reply to Jonathan Druart from comment #3) > Go to > http://staff-flame.sandboxes.ptfs-europe.co.uk/cgi-bin/koha/circ/returns.pl > > Check in 39999000004731, click "print slip, transfer, and confirm" > > => You see the note > > What did you try? Hi Jonathan, You're right, I can see your notes. My mistakes. After a recheck, I was testing with the intranet_message or opac_message fields, not the borrowers.*notes. sorry for the confusion Is there a way to add a borrowers message on the hold slip? thanks in the same sandboxe try to return 39999000003154 for this patron 23529000120056 Created attachment 126641 [details] [review] Bug 29230: Add Koha::Patron->messages Add methods to return the messages attached to a patron. It will add the capability to access them from notice templates. Test plan: Define some messages for a given patron Go to the circulation page of the patron and confirm that they are still displayed Test the notice templates: Add to HOLD_SLIP the following content """ [% SET messages = borrower.messages %] [% IF messages.count %] Messages: <ul> [% FOR m IN messages.search( message_type => 'L' ) %] <li>[% m.message %]</li> [% END %] </ul> [% END %] """ To display all the messages from staff ('L') Adapt following your needs. This patch adds what's needed to access the messages from notice templates. Created attachment 127678 [details] [review] Bug 29230: Add Koha::Patron->messages Add methods to return the messages attached to a patron. It will add the capability to access them from notice templates. Test plan: Define some messages for a given patron Go to the circulation page of the patron and confirm that they are still displayed Test the notice templates: Add to HOLD_SLIP the following content """ [% SET messages = borrower.messages %] [% IF messages.count %] Messages: <ul> [% FOR m IN messages.search( message_type => 'L' ) %] <li>[% m.message %]</li> [% END %] </ul> [% END %] """ To display all the messages from staff ('L') Adapt following your needs. Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Created attachment 128162 [details] [review] Bug 29230: Add Koha::Patron->messages Add methods to return the messages attached to a patron. It will add the capability to access them from notice templates. Test plan: Define some messages for a given patron Go to the circulation page of the patron and confirm that they are still displayed Test the notice templates: Add to HOLD_SLIP the following content """ [% SET messages = borrower.messages %] [% IF messages.count %] Messages: <ul> [% FOR m IN messages.search( message_type => 'L' ) %] <li>[% m.message %]</li> [% END %] </ul> [% END %] """ To display all the messages from staff ('L') Adapt following your needs. Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Stina Hallin <stina.hallin@ub.lu.se> Signed off using a sandbox. Although it looks good to me on itself, we have a clash with Koha::Object::messages. cc: Tomas (In reply to Marcel de Rooy from comment #10) > Although it looks good to me on itself, we have a clash with > Koha::Object::messages. > > cc: Tomas In my opinion Koha::Object->messages should be renamed. ->_messages maybe? (In reply to Jonathan Druart from comment #11) > (In reply to Marcel de Rooy from comment #10) > > Although it looks good to me on itself, we have a clash with > > Koha::Object::messages. > > > > cc: Tomas > > In my opinion Koha::Object->messages should be renamed. ->_messages maybe? Maybe, but you need to think of an accessor? Or maybe bug 29746 is the way to avoid it completely? I opened bug 29785 to rename it. Marcel, let me know if you are not going to work on this one in a short term, please. Thanks! (In reply to Tomás Cohen Arazi from comment #14) > Marcel, let me know if you are not going to work on this one in a short > term, please. Thanks! Thanks for your patience. I will have another look. Back to blocked: base report fails qa. Created attachment 130044 [details] [review] Bug 29230: Add Koha::Patron->messages Add methods to return the messages attached to a patron. It will add the capability to access them from notice templates. Test plan: Define some messages for a given patron Go to the circulation page of the patron and confirm that they are still displayed Test the notice templates: Add to HOLD_SLIP the following content """ [% SET messages = borrower.messages %] [% IF messages.count %] Messages: <ul> [% FOR m IN messages.search( message_type => 'L' ) %] <li>[% m.message %]</li> [% END %] </ul> [% END %] """ To display all the messages from staff ('L') Adapt following your needs. Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Stina Hallin <stina.hallin@ub.lu.se> Created attachment 130097 [details] [review] Bug 29230: Add Koha::Patron->messages Add methods to return the messages attached to a patron. It will add the capability to access them from notice templates. Test plan: Define some messages for a given patron Go to the circulation page of the patron and confirm that they are still displayed Test the notice templates: Add to HOLD_SLIP the following content """ [% SET messages = borrower.messages %] [% IF messages.count %] Messages: <ul> [% FOR m IN messages.search( message_type => 'L' ) %] <li>[% m.message %]</li> [% END %] </ul> [% END %] """ To display all the messages from staff ('L') Adapt following your needs. Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Stina Hallin <stina.hallin@ub.lu.se> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Do we actually have a rule for empty test descriptions? :) # Subtest: messages 1..4 ok 1 - No message yet ok 2 - There are two messages for this patron ok 3 ok 4 ok 14 - messages (In reply to Marcel de Rooy from comment #19) > Do we actually have a rule for empty test descriptions? :) IMO the descriptions are like comments, they should be there when it's not obvious. Pushed to master for 22.05, thanks to everybody involved [U+1F984] Pushed to 21.11.x for 21.11.03 Doesn't apply cleanly to 21.05, please rebase if needed |