Bugzilla – Attachment 160707 Details for
Bug 35714
Clicking Print slips when no letter template selected causes error
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35714: Prevent items not linked with processing with a letter code a to be printed
Bug-35714-Prevent-items-not-linked-with-processing.patch (text/plain), 4.32 KB, created by
Jonathan Druart
on 2024-01-09 15:52:25 UTC
(
hide
)
Description:
Bug 35714: Prevent items not linked with processing with a letter code a to be printed
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2024-01-09 15:52:25 UTC
Size:
4.32 KB
patch
obsolete
>From a4973a507a1058bc4d788878d00687d96a6e20db Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 9 Jan 2024 16:47:56 +0100 >Subject: [PATCH] Bug 35714: Prevent items not linked with processing with a > letter code a to be printed > >Items linked with a processing which does not have a letter code are not >supposed to be printed. >Currently the code is allowing to "print slip" for items when using the >link on top of the table. It results in an error "No letter_code at >/kohadevbox/koha/preservation/print_slip.pl line 45." > >Test plan: >Create a processing without a letter code >Add 2 items to the waiting list then add them to a train >Go to the "show train" view >=> notice that you cannot print slip for those items >Create another processing with a letter code >Edit one of the item and set it the new processing >=> A slip for this item can be printed >Edit the other item and the train to make them use the new processing >=> A slip for those items can be printed >--- > .../components/Preservation/TrainsShow.vue | 26 +++++++++++++++---- > 1 file changed, 21 insertions(+), 5 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/TrainsShow.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/TrainsShow.vue >index f3d2ca2ef09..5c7bc5c9dd5 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/TrainsShow.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Preservation/TrainsShow.vue >@@ -183,10 +183,18 @@ > v-bind:key="counter" > > > <input >+ :disabled="!item.processing.letter_code" > v-model="selected_items" > type="checkbox" > name="user_train_item_id" > :value="item.train_item_id" >+ :title=" >+ !item.processing.letter_code >+ ? $__( >+ 'Cannot print slip, this item does not have a processing with a letter template defined.' >+ ) >+ : '' >+ " > /> > <label > >{{ item.user_train_item_id }} >@@ -527,15 +535,17 @@ export default { > selectAll() { > if (this.item_table.display) { > $("#" + this.table_id) >- .find("input[name='user_train_item_id'][type='checkbox']") >+ .find( >+ "input[name='user_train_item_id'][type='checkbox']:not(:disabled)" >+ ) > .each((i, input) => { > this.selected_items.push($(input).val()) > $(input).prop("checked", true) > }) > } else { >- this.selected_items = this.train.items.map( >- item => item.train_item_id >- ) >+ this.selected_items = this.train.items >+ .filter(i => i.processing.letter_code) >+ .map(item => item.train_item_id) > } > }, > printSelected() { >@@ -579,6 +589,12 @@ export default { > let train_item_id = train_item.train_item_id > > let checkbox = createVNode("input", { >+ ...(!train_item.processing.letter_code && { >+ disabled: "disabled", >+ title: __( >+ "Cannot print slip, this item does not have a processing with a letter template defined." >+ ), >+ }), > type: "checkbox", > name: "user_train_item_id", > value: train_item_id, >@@ -660,7 +676,7 @@ export default { > ) > } > >- if (train_item.processing.letter_code !== null) { >+ if (train_item.processing.letter_code) { > let printButton = createVNode( > "a", > { >-- >2.34.1
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 35714
:
160707
|
162350
|
164292