Bugzilla – Attachment 172626 Details for
Bug 10190
Overdue notice triggers based on item type
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10190: Only display default and library specific letters
Bug-10190-Only-display-default-and-library-specifi.patch (text/plain), 4.03 KB, created by
Martin Renvoize (ashimema)
on 2024-10-10 14:41:10 UTC
(
hide
)
Description:
Bug 10190: Only display default and library specific letters
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-10-10 14:41:10 UTC
Size:
4.03 KB
patch
obsolete
>From 04643788a615d189f0ccfe39e1c5eeb406e05891 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >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" > /> > </div> > </fieldset> >@@ -185,7 +185,7 @@ > v-model="newRule.notice" > label="name" > :reduce="type => type.code" >- :options="letters" >+ :options="filteredLetters" > > > <template #search="{ attributes, events }"> > <input >@@ -360,6 +360,7 @@ export default { > triggerBeingEdited: null, > minDelay: 0, > maxDelay: Infinity, >+ filteredLetters: [], > } > }, > beforeRouteEnter(to, from, next) { >@@ -528,6 +529,7 @@ export default { > > this.setMinDelay() > this.setMaxDelay() >+ this.setFilteredLetters() > }, > error => {} > ) >@@ -707,6 +709,29 @@ export default { > ) - 1 > : Infinity > }, >+ setFilteredLetters() { >+ let library = this.newRule.library_id >+ const branchcodeMatches = letters.filter( >+ letter => letter.branchcode === library >+ ) >+ const emptyBranchcodeMatches = letters.filter( >+ letter => letter.branchcode === "" >+ ) >+ >+ const uniqueCodes = [ >+ ...new Set( >+ [...branchcodeMatches, ...emptyBranchcodeMatches].map( >+ letter => letter.code >+ ) >+ ), >+ ] >+ >+ this.filteredLetters = letters.filter( >+ letter => >+ uniqueCodes.includes(letter.code) && >+ (letter.branchcode === library || letter.branchcode === "") >+ ) >+ }, > incrementDelay() { > // Check for minDelay and maxDelay > const min = this.minDelay !== undefined ? this.minDelay : 1 >-- >2.47.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 10190
:
170357
|
170358
|
170359
|
170360
|
170361
|
170362
|
170363
|
170364
|
170365
|
170366
|
170367
|
170368
|
170369
|
170370
|
170371
|
170372
|
170373
|
170374
|
170375
|
170376
|
170380
|
170449
|
171727
|
171728
|
171729
|
171730
|
171731
|
171732
|
171733
|
171734
|
171735
|
171736
|
171737
|
171738
|
171739
|
171740
|
171741
|
171742
|
171743
|
171744
|
171745
|
171746
|
171747
|
171748
|
171749
|
171750
|
171751
|
171752
|
171753
|
171754
|
171755
|
172588
|
172589
|
172590
|
172591
|
172592
|
172593
|
172594
|
172595
|
172596
|
172597
|
172598
|
172599
|
172600
|
172601
|
172602
|
172603
|
172604
|
172605
|
172606
|
172607
|
172608
|
172609
|
172612
|
172614
|
172617
|
172619
|
172621
|
172622
|
172623
|
172624
|
172625
|
172626
|
172630
|
172631
|
172632
|
172633
|
172634
|
172635
|
172636
|
172637
|
172638
|
172639
|
172640
|
172641
|
172642
|
172643
|
172644
|
172645
|
172646
|
172647
|
172648
|
172649
|
172650
|
172651
|
172652
|
172653
|
172654
|
172655
|
172656
|
172657
|
172658
|
172659
|
172660
|
172661
|
172662
|
172663