If you add borrowers.borrowernotes and borrowers.opacnote fields in the HOLD_SLIP template, Koha won’t print out the patron account notes on the slip. Test 1. Add borrowers.borrowernotes and borrowers.opacnote fields in the HOLD_SLIP template (Tools > Notices & slips) 2. Add a borrowernotes, then an opacnote in a patron account 3. Place an item on hold 4. Check-in the item 5. Select the «print slip…» option to confirm the hold Unfortunately, these two fields are not displayed on the slip. It would be nice to see the borrowernotes since some libraries use this field to add details about patron special needs.
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