Bugzilla – Attachment 90443 Details for
Bug 22927
Item improperly marked returned when changing damaged or withdrawn status
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22927: Do not check an already lost item when marked as withdrawn or damaged
Bug-22927-Do-not-check-an-already-lost-item-when-m.patch (text/plain), 7.03 KB, created by
Jonathan Druart
on 2019-06-08 20:37:04 UTC
(
hide
)
Description:
Bug 22927: Do not check an already lost item when marked as withdrawn or damaged
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2019-06-08 20:37:04 UTC
Size:
7.03 KB
patch
obsolete
>From 7c09ee2dfc33891f3e520db6dab76be3101b62f8 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Sat, 8 Jun 2019 15:34:24 -0500 >Subject: [PATCH] Bug 22927: Do not check an already lost item when marked as > withdrawn or damaged > >Due to how moredetail.pl was written it was hard to know which action >was triggered. > >Test plan: >- Set MarkLostItemsAsReturned to "from the items tab of the catalog >module." >- Check an item out to a patron >- Use additem.pl to set that item to a lost status without returning it >- go to moredetail.pl for that item >- mark item as either damaged or withdrawn without interacting with the >lost dropdown >- note that item has not been returned > >Note for QA: Maybe we could have just tested if exists $item_changes->{'itemlost'} >to call LostItem >--- > catalogue/updateitem.pl | 13 +++++++------ > .../intranet-tmpl/prog/en/modules/catalogue/moredetail.tt | 11 +++++------ > 2 files changed, 12 insertions(+), 12 deletions(-) > >diff --git a/catalogue/updateitem.pl b/catalogue/updateitem.pl >index 7924b2b85e..6c6bd29fb4 100755 >--- a/catalogue/updateitem.pl >+++ b/catalogue/updateitem.pl >@@ -31,6 +31,7 @@ my $cgi= new CGI; > > checkauth($cgi, 0, {circulate => 'circulate_remaining_permissions'}, 'intranet'); > >+my $op = $cgi->param('op') || ""; > my $biblionumber=$cgi->param('biblionumber'); > my $itemnumber=$cgi->param('itemnumber'); > my $biblioitemnumber=$cgi->param('biblioitemnumber'); >@@ -55,22 +56,22 @@ for ($damaged,$itemlost,$withdrawn) { > > # modify MARC item if input differs from items table. > my $item_changes = {}; >-if (defined $itemnotes_nonpublic) { # i.e., itemnotes_nonpublic parameter passed from form >+if ( $op eq "set_non_public_note" ) { > checkauth($cgi, 0, {editcatalogue => 'edit_items'}, 'intranet'); > if ((not defined $item_data_hashref->{'itemnotes_nonpublic'}) or $itemnotes_nonpublic ne $item_data_hashref->{'itemnotes_nonpublic'}) { > $item_changes->{'itemnotes_nonpublic'} = $itemnotes_nonpublic; > } > } >-elsif (defined $itemnotes) { # i.e., itemnotes parameter passed from form >+elsif ( $op eq "set_public_note" ) { # i.e., itemnotes parameter passed from form > checkauth($cgi, 0, {editcatalogue => 'edit_items'}, 'intranet'); > if ((not defined $item_data_hashref->{'itemnotes'}) or $itemnotes ne $item_data_hashref->{'itemnotes'}) { > $item_changes->{'itemnotes'} = $itemnotes; > } >-} elsif ($itemlost ne $item_data_hashref->{'itemlost'}) { >+} elsif ( $op eq "set_lost" && $itemlost ne $item_data_hashref->{'itemlost'}) { > $item_changes->{'itemlost'} = $itemlost; >-} elsif ($withdrawn ne $item_data_hashref->{'withdrawn'}) { >+} elsif ( $op eq "set_withdrawn" && $withdrawn ne $item_data_hashref->{'withdrawn'}) { > $item_changes->{'withdrawn'} = $withdrawn; >-} elsif ($damaged ne $item_data_hashref->{'damaged'}) { >+} elsif ( $op eq "set_damaged" && $damaged ne $item_data_hashref->{'damaged'}) { > $item_changes->{'damaged'} = $damaged; > } else { > #nothings changed, so do nothing. >@@ -80,6 +81,6 @@ elsif (defined $itemnotes) { # i.e., itemnotes parameter passed from form > > ModItem($item_changes, $biblionumber, $itemnumber); > >-LostItem($itemnumber, 'moredetail') if $itemlost; >+LostItem($itemnumber, 'moredetail') if $op eq "set_lost"; > > print $cgi->redirect("moredetail.pl?biblionumber=$biblionumber&itemnumber=$itemnumber#item$itemnumber"); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt >index 28066ce1ad..9bf3da2ebc 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt >@@ -113,8 +113,7 @@ > [% END %] > [% END %] > </select> >- <input type="hidden" name="withdrawn" value="[% ITEM_DAT.withdrawn | html %]" /> >- <input type="hidden" name="damaged" value="[% ITEM_DAT.damaged | html %]" /> >+ <input type="hidden" name="op" value="set_lost" /> > <input type="submit" name="submit" class="submit" value="Set status" /></form> > [% ELSE %] > [% FOREACH itemlostloo IN itemlostloop %] >@@ -146,8 +145,7 @@ > [% END %] > [% END %] > </select> >- <input type="hidden" name="withdrawn" value="[% ITEM_DAT.withdrawn | html %]" /> >- <input type="hidden" name="itemlost" value="[% ITEM_DAT.itemlost | html %]" /> >+ <input type="hidden" name="op" value="set_damaged" /> > <input type="submit" name="submit" class="submit" value="Set status" /></form> > [% ELSE %] > [% FOREACH itemdamagedloo IN itemdamagedloop %] >@@ -180,8 +178,7 @@ > [% END %] > [% END %] > </select> >- <input type="hidden" name="itemlost" value="[% ITEM_DAT.itemlost | html %]" /> >- <input type="hidden" name="damaged" value="[% ITEM_DAT.damaged | html %]" /> >+ <input type="hidden" name="op" value="set_withdrawn" /> > <input type="submit" name="submit" class="submit" value="Set status" /></form> > [% ELSE %] > [% FOREACH itemwithdrawn IN itemwithdrawnloop %] >@@ -249,6 +246,7 @@ > [% IF ( CAN_user_editcatalogue_edit_items ) %] > <form class="inline" action="updateitem.pl" method="post"><input type="hidden" name="biblionumber" value="[% ITEM_DAT.biblionumber | html %]" /> > <input type="hidden" name="biblioitemnumber" value="[% ITEM_DAT.biblioitemnumber | html %]" /><input type="hidden" name="itemnumber" value="[% ITEM_DAT.itemnumber | html %]" /> >+ <input type="hidden" name="op" value="set_public_note" /> > <textarea name="itemnotes" rows="2" cols="30">[% ITEM_DAT.itemnotes | html %]</textarea><input type="submit" name="submit" class="submit" value="Update" /> > </form> > [% ELSE %] >@@ -262,6 +260,7 @@ > [% IF ( CAN_user_editcatalogue_edit_items ) %] > <form class="inline" action="updateitem.pl" method="post"><input type="hidden" name="biblionumber" value="[% ITEM_DAT.biblionumber | html %]" /> > <input type="hidden" name="biblioitemnumber" value="[% ITEM_DAT.biblioitemnumber | html %]" /><input type="hidden" name="itemnumber" value="[% ITEM_DAT.itemnumber | html %]" /> >+ <input type="hidden" name="op" value="set_non_public_note" /> > <textarea name="itemnotes_nonpublic" rows="2" cols="30">[% ITEM_DAT.itemnotes_nonpublic | html %]</textarea><input type="submit" name="submit" class="submit" value="Update" /> > </form> > [% ELSE %] >-- >2.11.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 22927
:
90443
|
93355
|
93896