From 04643788a615d189f0ccfe39e1c5eeb406e05891 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 10 Oct 2024 15:37:10 +0100 Subject: [PATCH] Bug 10190: Only display default and library specific letters This patch filters the list of letter templates available to use by only those available for the context the rule is being added for (i.e. the correct library relation) --- admin/circulation_triggers.pl | 10 +++---- .../CirculationTriggersFormAdd.vue | 29 +++++++++++++++++-- 2 files changed, 31 insertions(+), 8 deletions(-) diff --git a/admin/circulation_triggers.pl b/admin/circulation_triggers.pl index a8db14f9981..6a09f5b86c2 100755 --- a/admin/circulation_triggers.pl +++ b/admin/circulation_triggers.pl @@ -33,12 +33,10 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( } ); -my $letters = C4::Letters::GetLettersAvailableForALibrary( - { - branchcode => undef, - module => "circulation", - } -); +my $letters = Koha::Notice::Templates->search( + { module => "circulation", lang => 'default' }, + { columns => [ 'module', 'code', 'branchcode', 'name' ] } +)->unblessed; $template->param( letters => $letters ); diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/CirculationTriggers/CirculationTriggersFormAdd.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/CirculationTriggers/CirculationTriggersFormAdd.vue index b624484def2..a6ca52a43e0 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/CirculationTriggers/CirculationTriggersFormAdd.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/CirculationTriggers/CirculationTriggersFormAdd.vue @@ -109,7 +109,7 @@ :modal="true" :ruleBeingEdited="ruleBeingEdited" :triggerBeingEdited="triggerBeingEdited" - :letters="letters" + :letters="filteredLetters" /> @@ -185,7 +185,7 @@ v-model="newRule.notice" label="name" :reduce="type => type.code" - :options="letters" + :options="filteredLetters" >