Bugzilla – Attachment 188477 Details for
Bug 41108
Scroll to form when using "Add and duplicate" button to duplicate the item
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41108: Scroll to form on use of "Add and duplicate" button
Bug-41108-Scroll-to-form-on-use-of-Add-and-duplica.patch (text/plain), 2.65 KB, created by
Peter Vashchuk
on 2025-10-27 14:47:53 UTC
(
hide
)
Description:
Bug 41108: Scroll to form on use of "Add and duplicate" button
Filename:
MIME Type:
Creator:
Peter Vashchuk
Created:
2025-10-27 14:47:53 UTC
Size:
2.65 KB
patch
obsolete
>From 4e65e7ca4ae2082a67efcedcbfecf584b88d01f5 Mon Sep 17 00:00:00 2001 >From: Petro Vashchuk <stalkernoid@gmail.com> >Date: Mon, 27 Oct 2025 16:46:54 +0200 >Subject: [PATCH] Bug 41108: Scroll to form on use of "Add and duplicate" > button > >This patch gets you to the Add item form directly after you press "Add and duplicate" button to duplicate the item. > >Steps to reproduce: >1. Find a biblio with many items or make one yourself. >2. Use the "New" dropdown and go to the add item interface. >3. Use "Add and duplicate" button to duplicate the item. >4. Apply the patch. >5. Reload the page and use "Add and duplicate" button to duplicate the item again. It should take you to the Add item form directly. >--- > .../intranet-tmpl/prog/en/modules/cataloguing/additem.tt | 2 +- > koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js | 5 +++++ > 2 files changed, 6 insertions(+), 1 deletion(-) > >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 76758d3deb6..14eff94bd11 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >@@ -342,7 +342,7 @@ > --> > <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 and duplicate" onclick="return Check(this.form)" /> >+ <input type="submit" id="add_duplicate_submit" name="add_duplicate_submit" value="Add and 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" /> >diff --git a/koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js b/koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js >index 1de2bda6e12..f23f1edff35 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js >@@ -55,6 +55,11 @@ $(document).ready(function () { > } > }); > >+ $("#add_duplicate_submit").click(function () { >+ // force to scroll to form if we're in duplicate action >+ $("#f").attr('action', $("#f").attr('action').replace(/(#\w+)?$/g, '#additema')); >+ }); >+ > // Skip the first column > table_settings["columns"].unshift({ cannot_be_toggled: "1" }); > >-- >2.51.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 41108
: 188477