All notices in Koha are created to be a default ALL libraries notice, however, with branch systems, there is also the ability to create a library specific notice that can be used instead. However, the notice AUTO_RENEWALS is not currently capable of being library specific - instead, the ALL Library Notice for AUTO_RENEWALS is the only one that Koha send. To adjust this, it would be recommended that a library specific notice like all the others in Koha can be created. Following circ control, would be the suggested way to go as with most notices in Koha.
Until this is fixed here is a workaround. Edit the (All libraries) AUTO_RENEWALS notice like so: [% whichbranch = borrower.branchcode %] [% IF whichbranch == "BRANCHCODE" %] some specific branch notice stuff about auto renewal [% ELSE %] some generic notice stuff about auto renewal [% END %]
Lucas examples uses the patron's homebranch and I think this is also the behaviour I would expect. The patron's homebranch is a singular value, we will end up with one notice, either default or a branch specific one. The CircControl preference states it's used for determining how to calculate fines and for which circulation rule to use, it doesn't state anything about notices. It also has an option for "where you are logged in" that doesn't apply well to automatically send notices. And last, if it was set to "where the item is from" and you have items from multiple branches, we'd have to split into multiple notices to follow that preference. ... and we really should document somewhere how the multiple notices work regarding to who the notices are sent from and which templates are used. It's not only about the template, but also about the email addresses that appear as sender etc.
Hm, was discussing this at length with Putti on IRC, but it's quite confusing still. Bug 7001, comment 44 points to the use of CircControl for the notices too. > You will be happy to know that with CircControl set to "the library you are > logged in at" the notices all work the way one would expect. But what would is the expected behaviour in this case? I think the least we should do is clear this up, document and amend the text of the system preference. I am always pro consistency ... and documentation :)
I think this should be consistent with the behavior of the digest version of the notice. So we should send the notice based on the patron's branch.
Created attachment 161469 [details] [review] Bug 23296: Set patron branchcode when preparing non-digest version To test: 1. APPLY PATCH 2. Set up circ rules to allow for auto renewals. 3. Set AutoRenewalNotices to 'according to message prefs' 4. Make a branch specific version of the the AUTO_RENEWAL notice. 5. Find a patron belonging to that branch and set the message prefs to allow for a AUTO_RENEWAL. But no digest option! 6. Check some things out and make sure they are eligble for auto renewal. 7. Run the cron. 8. Make sure the patron gets the branch specific notice. 9. Delete the branch specific notice. 10. DO 6-7 again. 11. Make sure they now get the all library notice.
Created attachment 162127 [details] [review] Bug 23296: Set patron branchcode when preparing non-digest version To test: 1. APPLY PATCH 2. Set up circ rules to allow for auto renewals. 3. Set AutoRenewalNotices to 'according to message prefs' 4. Make a branch specific version of the the AUTO_RENEWAL notice. 5. Find a patron belonging to that branch and set the message prefs to allow for a AUTO_RENEWAL. But no digest option! 6. Check some things out and make sure they are eligble for auto renewal. 7. Run the cron. 8. Make sure the patron gets the branch specific notice. 9. Delete the branch specific notice. 10. DO 6-7 again. 11. Make sure they now get the all library notice. Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Some notes to make testing autorenewals easier: In circulation and fine rules loan period: 3 renewal period: 3 No automatic renewal before: 3 Automatic renewal : yes In system preferences NoRenewalBeforePrecision: date after checking out items run ./misc/cronjobs/automatic_renewals.pl to confirm items would be renewed then run again with options -c -v before checking the notices tab for the patron
Created attachment 164452 [details] [review] Bug 23296: Set patron branchcode when preparing non-digest version To test: 1. APPLY PATCH 2. Set up circ rules to allow for auto renewals. 3. Set AutoRenewalNotices to 'according to message prefs' 4. Make a branch specific version of the the AUTO_RENEWAL notice. 5. Find a patron belonging to that branch and set the message prefs to allow for a AUTO_RENEWAL. But no digest option! 6. Check some things out and make sure they are eligble for auto renewal. 7. Run the cron. 8. Make sure the patron gets the branch specific notice. 9. Delete the branch specific notice. 10. DO 6-7 again. 11. Make sure they now get the all library notice. Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> [EDIT] Tidied one line.
Pushed for 24.05! Well done everyone, thank you!
Might this be backported to 23.11 or 23.05?
Pushed to 23.11.x for 23.11.06
Backported to 23.05.x for upcoming 23.05.12