Bug 28514: Remove getletter
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 3 Jun 2021 11:01:43 +0000 (13:01 +0200)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 21 Jun 2021 11:49:58 +0000 (13:49 +0200)
commitb82c91d8cb99e10da8e78477de4a68352b562955
tree254a8ac5ec30b0f418799c7cac82027b5a608d0b
parentd785a5536f52da2d48dd681ce5bd1276b5e0d7b8
Bug 28514: Remove getletter

The way we handle notice templates is confusing (see bug 27660, bug 26787, bug 28487).

This patch remove C4::Letters::getletter and use either Koha::Notice::Templates->find
or the newly created methods ->find_effective_template that will do
all necessary to return the correct template.

Test plan:
- Create and modify notice templates
- Make sure you have TranslateNotices turned on and that some notices
templates have a translated version
- Use holds_reminder.pl and overdue_notices.pl cronjobs and confirm that
the generated notices are the expected ones
- Test also pos/printreceipt.pl
- And finally test some other notices (CHECKIN, RENEWAL for instance)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Amended by removing comment for $params={%$params}

JD amended patch:
* Add missing POD
* Fix spelling (dont  ==> don't)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
C4/Letters.pm
Koha/Notice/Templates.pm
misc/cronjobs/holds/holds_reminder.pl
misc/cronjobs/overdue_notices.pl
pos/printreceipt.pl
t/db_dependent/Koha/Notices.t
t/db_dependent/Letters.t
tools/letter.pl