View | Details | Raw Unified | Return to bug 10190
Collapse All | Expand All

(-)a/admin/circulation_triggers.pl (-6 / +4 lines)
Lines 33-44 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
33
    }
33
    }
34
);
34
);
35
35
36
my $letters = C4::Letters::GetLettersAvailableForALibrary(
36
my $letters = Koha::Notice::Templates->search(
37
    {
37
    { module  => "circulation", lang => 'default' },
38
        branchcode => undef,
38
    { columns => [ 'module', 'code', 'branchcode', 'name' ] }
39
        module     => "circulation",
39
)->unblessed;
40
    }
41
);
42
40
43
$template->param( letters => $letters );
41
$template->param( letters => $letters );
44
42
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/CirculationTriggers/CirculationTriggersFormAdd.vue (-3 / +27 lines)
Lines 109-115 Link Here
109
                            :modal="true"
109
                            :modal="true"
110
                            :ruleBeingEdited="ruleBeingEdited"
110
                            :ruleBeingEdited="ruleBeingEdited"
111
                            :triggerBeingEdited="triggerBeingEdited"
111
                            :triggerBeingEdited="triggerBeingEdited"
112
                            :letters="letters"
112
                            :letters="filteredLetters"
113
                        />
113
                        />
114
                    </div>
114
                    </div>
115
                </fieldset>
115
                </fieldset>
Lines 185-191 Link Here
185
                                v-model="newRule.notice"
185
                                v-model="newRule.notice"
186
                                label="name"
186
                                label="name"
187
                                :reduce="type => type.code"
187
                                :reduce="type => type.code"
188
                                :options="letters"
188
                                :options="filteredLetters"
189
                            >
189
                            >
190
                                <template #search="{ attributes, events }">
190
                                <template #search="{ attributes, events }">
191
                                    <input
191
                                    <input
Lines 360-365 export default { Link Here
360
            triggerBeingEdited: null,
360
            triggerBeingEdited: null,
361
            minDelay: 0,
361
            minDelay: 0,
362
            maxDelay: Infinity,
362
            maxDelay: Infinity,
363
            filteredLetters: [],
363
        }
364
        }
364
    },
365
    },
365
    beforeRouteEnter(to, from, next) {
366
    beforeRouteEnter(to, from, next) {
Lines 528-533 export default { Link Here
528
529
529
                    this.setMinDelay()
530
                    this.setMinDelay()
530
                    this.setMaxDelay()
531
                    this.setMaxDelay()
532
                    this.setFilteredLetters()
531
                },
533
                },
532
                error => {}
534
                error => {}
533
            )
535
            )
Lines 707-712 export default { Link Here
707
                  ) - 1
709
                  ) - 1
708
                : Infinity
710
                : Infinity
709
        },
711
        },
712
        setFilteredLetters() {
713
            let library = this.newRule.library_id
714
            const branchcodeMatches = letters.filter(
715
                letter => letter.branchcode === library
716
            )
717
            const emptyBranchcodeMatches = letters.filter(
718
                letter => letter.branchcode === ""
719
            )
720
721
            const uniqueCodes = [
722
                ...new Set(
723
                    [...branchcodeMatches, ...emptyBranchcodeMatches].map(
724
                        letter => letter.code
725
                    )
726
                ),
727
            ]
728
729
            this.filteredLetters = letters.filter(
730
                letter =>
731
                    uniqueCodes.includes(letter.code) &&
732
                    (letter.branchcode === library || letter.branchcode === "")
733
            )
734
        },
710
        incrementDelay() {
735
        incrementDelay() {
711
            // Check for minDelay and maxDelay
736
            // Check for minDelay and maxDelay
712
            const min = this.minDelay !== undefined ? this.minDelay : 1
737
            const min = this.minDelay !== undefined ? this.minDelay : 1
713
- 

Return to bug 10190