Bugzilla – Attachment 49905 Details for
Bug 10347
Deactivate "Add item" button when "Add multiple copies" was activated
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 10347 - Deactivate "Add item" button when "Add multiple copies" was activated
SIGNED-OFF-Bug-10347---Deactivate-Add-item-button-.patch (text/plain), 4.82 KB, created by
Bernardo Gonzalez Kriegel
on 2016-04-05 11:21:52 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 10347 - Deactivate "Add item" button when "Add multiple copies" was activated
Filename:
MIME Type:
Creator:
Bernardo Gonzalez Kriegel
Created:
2016-04-05 11:21:52 UTC
Size:
4.82 KB
patch
obsolete
>From aa17933031e583ef06dec370ea0b5f150192531c Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Thu, 15 Aug 2013 14:53:26 -0400 >Subject: [PATCH] [SIGNED-OFF] Bug 10347 - Deactivate "Add item" button when > "Add multiple copies" was activated > >When the "Add multiple items" button is pressed the other submit buttons >should be hidden in order to eliminate confusion about which button >submits the form at that stage in the process. > >This patch alters the form so that clicking the "add multiple" button >hides the other two buttons and displays form for submitting the number >of copies to add. > >This patch also makes changes to accompanying text in order to make >things (hopefully) clearer. The button text has been changed (again, see >Bug 10346) to "Add multiple copies of this item." > >Explanatory text has been added "The barcode you enter will be >incremented for each additional item," because that seemed non-obvious >about the process. > >Unrelated change: a section of obsolete JavaScript has been removed. > >To test, go to the add/edit items page for a new or existing record. >Test adding a single item, adding & duplicating, and adding multiple. >The add multiple form should be shown upon clicking 'add multiple,' and >hidden when 'cancel' is clicked. > >Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> > >Work as described, tried adding one, one & dup, multiple and cancel multiple >No errors >--- > .../prog/en/modules/cataloguing/additem.tt | 36 +++++++++++++++++----- > 1 file changed, 29 insertions(+), 7 deletions(-) > >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 1de8960..5ef7851 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >@@ -62,7 +62,24 @@ $(document).ready(function(){ > "bKohaColumnsUseNames": true > }, columns_settings); > >+ var multiCopyControl = $("#add_multiple_copies_span"); >+ var addMultipleBlock = $("#addmultiple"); >+ var addSingleBlock = $("#addsingle"); >+ multiCopyControl.hide(); >+ $("#add_multiple_copies").on("click",function(e){ >+ e.preventDefault; >+ addMultipleBlock.toggle(); >+ addSingleBlock.toggle(); >+ multiCopyControl.toggle(); >+ }); >+ $("#cancel_add_multiple").on("click",function(e){ >+ e.preventDefault(); >+ addMultipleBlock.toggle(); >+ addSingleBlock.toggle(); >+ multiCopyControl.toggle(); >+ }); > }); >+ > function Check(f) { > var total_errors = CheckMandatorySubfields(f); > if (total_errors==0) { >@@ -288,14 +305,19 @@ function confirm_deletion() { > 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. > It is a bit tricky, but necessary in the sake of UI correctness. > --> >- >- <input type="submit" name="add_submit" value="Add item" onclick="return Check(this.form)" /> >- <input type="submit" name="add_duplicate_submit" value="Add & duplicate" onclick="return Check(this.form)" /> >- <input type="submit" name="add_multiple_copies" value="Add multiple items" onclick="javascript:this.nextSibling.style.visibility='visible';document.f.number_of_copies.focus(); return false;" /><span id="add_multiple_copies_span" style="visibility:hidden"> >- <label for="number_of_copies">Number of items to add : </label> >- <input type="text" id="number_of_copies" name="number_of_copies" value="" /> >- <input type="submit" id="add_multiple_copies_submit" name="add_multiple_copies_submit" value="Add" onclick="javascript:return Check(this.form) && CheckMultipleAdd(this.form.number_of_copies.value);" /> >+ <span id="addsingle"> >+ <input type="submit" name="add_submit" value="Add item" onclick="return Check(this.form)" /> >+ <input type="submit" name="add_duplicate_submit" value="Add & duplicate" onclick="return Check(this.form)" /> > </span> >+ <span id="addmultiple"> >+ <input type="button" name="add_multiple_copies" id="add_multiple_copies" value="Add multiple copies of this item" /> >+ </span> >+ <fieldset id="add_multiple_copies_span"> >+ <label for="number_of_copies">Number of copies of this item to add: </label> >+ <input type="text" id="number_of_copies" name="number_of_copies" value="" size="2" /> >+ <input type="submit" id="add_multiple_copies_submit" name="add_multiple_copies_submit" value="Add" onclick="javascript:return Check(this.form) && CheckMultipleAdd(this.form.number_of_copies.value);" /> <a href="#" id="cancel_add_multiple" class="cancel">Cancel</a> >+ <div class="hint"><p>The barcode you enter will be incremented for each additional item.</p></div> >+ </fieldset> > > [% ELSE %] > <input type="hidden" name="tag" value="[% itemtagfield %]" /> >-- >1.9.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 10347
:
20378
|
20384
|
20394
|
25463
|
25464
|
48732
|
48733
|
49905
|
49906
|
49934
|
49935