Bugzilla – Attachment 152847 Details for
Bug 34146
Add confirmation question when more than 99 items are to be added
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34146: Counterpart for serials-edit
Bug-34146-Counterpart-for-serials-edit.patch (text/plain), 3.89 KB, created by
Marcel de Rooy
on 2023-06-29 06:26:17 UTC
(
hide
)
Description:
Bug 34146: Counterpart for serials-edit
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2023-06-29 06:26:17 UTC
Size:
3.89 KB
patch
obsolete
>From 087ec3027457a80b218843224b0fb7afe9b7b00c Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 29 Jun 2023 06:18:04 +0000 >Subject: [PATCH] Bug 34146: Counterpart for serials-edit >Content-Type: text/plain; charset=utf-8 > >Not only additem suffers from it. We can do the same with serials-edit. >This patch adds a server-side and client-side check as we did for additem. > >Test plan: >Receive serial with adding items. >Try to add more than 999 items in number of copies. >--- > .../intranet-tmpl/prog/en/modules/serials/serials-edit.tt | 4 ++-- > serials/serials-edit.pl | 3 ++- > 2 files changed, 4 insertions(+), 3 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt >index 8c5ba5d8db..172a015e6e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt >@@ -307,7 +307,7 @@ $(document).ready(function() { > > <hr> > <div class="subfield_line"> >- <label for="number_of_copies">Number of copies to be made of this item </label> <input type="text" id="number_of_copies[% newserialloo.serialid | html %][% newserialloo.countitems | html %][% iteminformatio.subfield | html %][% iteminformatio.random | html %]" name="number_of_copies" value="1" size="2"> <span class="hint">The barcode you enter will be incremented for each additional item.</p> >+ <label for="number_of_copies">Number of copies to be made of this item </label> <input type="text" id="number_of_copies[% newserialloo.serialid | html %][% newserialloo.countitems | html %][% iteminformatio.subfield | html %][% iteminformatio.random | html %]" name="number_of_copies" value="1" maxlength="3" size="2"> <span class="hint">Number of copies limited to under 1000. The barcode you enter will be incremented for each additional item.</p> > </div> > > <input type="hidden" name="moditem" value="" /> >@@ -458,7 +458,7 @@ $(document).ready(function() { > > <hr> > <div class="subfield_line"> >- <label for="number_of_copies">Number of copies to be made of this item </label> <input type="text" id="number_of_copies[% newserialloo.serialid | html %][% newserialloo.countitems | html %][% iteminformatio.subfield | html %][% iteminformatio.random | html %]" name="number_of_copies" value="1" size="2"> <span class="hint">The barcode you enter will be incremented for each additional item.</p> >+ <label for="number_of_copies">Number of copies to be made of this item </label> <input type="text" id="number_of_copies[% newserialloo.serialid | html %][% newserialloo.countitems | html %][% iteminformatio.subfield | html %][% iteminformatio.random | html %]" name="number_of_copies" value="1" maxlength="3" size="2"> <span class="hint">Number of copies limited to under 1000. The barcode you enter will be incremented for each additional item.</p> > </div> > > <input type="hidden" name="moditem" value="" /> >diff --git a/serials/serials-edit.pl b/serials/serials-edit.pl >index b80fa46f21..060bfbb19f 100755 >--- a/serials/serials-edit.pl >+++ b/serials/serials-edit.pl >@@ -77,6 +77,7 @@ use Koha::Items; > use Koha::Serial::Items; > > use List::MoreUtils qw( uniq ); >+use List::Util qw( min ); > > my $query = CGI->new(); > my $dbh = C4::Context->dbh; >@@ -277,7 +278,7 @@ if ( $op and $op eq 'serialchangestatus' ) { > my @serials = $query->multi_param('serial'); > my @bibnums = $query->multi_param('bibnum'); > my @itemid = $query->multi_param('itemid'); >- my @num_copies = $query->multi_param('number_of_copies'); >+ my @num_copies = map { min($_, 1000); } $query->multi_param('number_of_copies'); > > #Rebuilding ALL the data for items into a hash > # parting them on $itemid. >-- >2.30.2
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 34146
:
152807
|
152808
|
152843
|
152844
|
152845
|
152846
|
152847
|
152849
|
152850
|
152851