Bugzilla – Attachment 88756 Details for
Bug 22669
Cannot edit received item in acquisitions with acqcreateitem set to "when placing an order"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22669: Fix item editing on receiving an order
Bug-22669-Fix-item-editing-on-receiving-an-order.patch (text/plain), 5.76 KB, created by
Kyle M Hall (khall)
on 2019-04-25 11:46:48 UTC
(
hide
)
Description:
Bug 22669: Fix item editing on receiving an order
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2019-04-25 11:46:48 UTC
Size:
5.76 KB
patch
obsolete
>From b764f826a7f76312bcbff7fbe135e2ce5af7aa82 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 23 Apr 2019 23:48:35 -0400 >Subject: [PATCH] Bug 22669: Fix item editing on receiving an order > >Since > commit 1253975389975a8ff11a9bb2ef84582aeb6bd08b > Bug 21091: Move add item template JavaScript to a separate file > >items cannot longer be edited when receiving an order. >When moving the code to the JS file, the JS variable "opisadd" was >always set to "true": > var opisadd = '[% opisadd | html %]'; >Even if the TT variable is 0, opisadd will be "0", which is evaluated to >true in Javascript > >To clean the situation it is easier to remove this variable and use "op" >instead. > >Test plan: >- Make sure acqcreateitem is set to "when placing an order" >- Create a basket with some orders >- Close the basket >- Go to your vendor and receive an order >- On the receive page, try to edit your item >=> Without the patch, the pop up page will open and then close, not allowing the item to be edited. >=> With this patch applied you will see the item edit form. Save and >confirm that the parent window is updated with the new value (actually >it's refreshed) > >Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > cataloguing/additem.pl | 1 - > .../prog/en/includes/str/cataloging_additem.inc | 2 +- > .../prog/en/modules/cataloguing/additem.tt | 4 ++-- > koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js | 10 ++++------ > 4 files changed, 7 insertions(+), 10 deletions(-) > >diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl >index 48417aac5d..062d335107 100755 >--- a/cataloguing/additem.pl >+++ b/cataloguing/additem.pl >@@ -931,7 +931,6 @@ $template->param( > itemtagfield => $itemtagfield, > itemtagsubfield => $itemtagsubfield, > op => $nextop, >- opisadd => ($nextop eq "saveitem") ? 0 : 1, > popup => scalar $input->param('popup') ? 1: 0, > C4::Search::enabled_staff_search_views, > ); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/str/cataloging_additem.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/str/cataloging_additem.inc >index 0a14c10faa..97cadb9148 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/str/cataloging_additem.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/str/cataloging_additem.inc >@@ -4,7 +4,7 @@ > var biblionumber = '[% biblionumber | html %]'; > var frameworkcode = '[% frameworkcode | html %]'; > var popup = '[% popup | html %]'; >- var opisadd = '[% opisadd | html %]'; >+ var op = '[% op | html %]'; > var LABEL_EDIT_ITEM = _("Edit item"); > var LABEL_DELETE_ITEM = _("Delete item"); > var MSG_FORM_NOT_SUBMITTED = _("Form not submitted because of the following problem(s)"); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >index 4782d23977..121ffc63b2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >@@ -127,7 +127,7 @@ > <input type="hidden" name="popup" value="1" /> > [% END %] > <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" /> >- [% IF ( opisadd ) %] >+ [% IF op != 'saveitem' %] > <h2 id="additema">Add item [% IF (circborrowernumber) %]<em>(fast cataloging)</em>[% END %]</h2> > [% ELSE %] > <h2 id="edititem">Edit Item #[% itemnumber | html %][% IF ( barcode ) %] / Barcode [% barcode | html %][% END %]</h2> >@@ -210,7 +210,7 @@ > <input type="hidden" name="indicator" value=" " /> > <input type="hidden" name="itemnumber" value="[% itemnumber | html %]" /> > >-<fieldset class="action"> [% IF ( opisadd ) %] >+<fieldset class="action"> [% IF op != 'saveitem' %] > <input type="submit" name="phony_submit" value="phony_submit" id="phony_submit" style="display:none;" onclick="return false;" /> > <!-- Note : We use here a false submit button because we have several submit buttons and we don't want the user to believe they validated the adding of multiple items > when pressing the enter key, while in fact it is the first submit button that is validated, in our case the "add (single) item" button. >diff --git a/koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js b/koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js >index f4a5dc1383..8c28e8398d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js >@@ -1,4 +1,4 @@ >-/* global KOHA searchid biblionumber frameworkcode popup opisadd LABEL_EDIT_ITEM LABEL_DELETE_ITEM MSG_FORM_NOT_SUBMITTED MSG_MANDATORY_FIELDS_EMPTY MSG_ADD_MULTIPLE_ITEMS MSG_ENTER_NUM_ITEMS MSG_CONFIRM_DELETE_ITEM MSG_CONFIRM_ADD_ITEM columns_settings CheckMandatorySubfields CheckMultipleAdd */ >+/* global KOHA searchid biblionumber frameworkcode popup op LABEL_EDIT_ITEM LABEL_DELETE_ITEM MSG_FORM_NOT_SUBMITTED MSG_MANDATORY_FIELDS_EMPTY MSG_ADD_MULTIPLE_ITEMS MSG_ENTER_NUM_ITEMS MSG_CONFIRM_DELETE_ITEM MSG_CONFIRM_ADD_ITEM columns_settings CheckMandatorySubfields CheckMultipleAdd */ > > var browser = KOHA.browser(searchid, parseInt(biblionumber, 10)); > browser.show(); >@@ -9,10 +9,8 @@ $(document).ready(function(){ > // otherwise the deletion confirmation will not work correctly > $('a[href*="biblionumber="]').off('click'); > >- if( popup ){ >- if( opisadd ){ >- window.close(); >- } >+ if( popup && op != 'saveitem' ){ >+ window.close(); > } > > $("fieldset.rows input, fieldset.rows select").addClass("noEnterSubmit"); >@@ -116,4 +114,4 @@ function Dopop(link,i) { > > function confirm_deletion() { > return confirm( MSG_CONFIRM_DELETE_ITEM ); >-} >\ No newline at end of file >+} >-- >2.20.1 (Apple Git-117)
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 22669
:
88586
|
88746
| 88756