Bugzilla – Attachment 179642 Details for
Bug 37116
Add the option to edit linked serials when editing items
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37116: Redirect to serial modification when modifying an item
Bug-37116-Redirect-to-serial-modification-when-mod.patch (text/plain), 6.59 KB, created by
Matt Blenkinsop
on 2025-03-24 15:30:33 UTC
(
hide
)
Description:
Bug 37116: Redirect to serial modification when modifying an item
Filename:
MIME Type:
Creator:
Matt Blenkinsop
Created:
2025-03-24 15:30:33 UTC
Size:
6.59 KB
patch
obsolete
>From 02dce003e99fdadec9425140c7b35a43b26fb19f Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >Date: Thu, 6 Jun 2024 12:53:08 +0000 >Subject: [PATCH] Bug 37116: Redirect to serial modification when modifying an > item > >Test plan: >- Add a new subscription to a serial record (with option 'When receiving the serial --> create an item record') >- Receive one issue and create the item linked >- Back to bibliographic record >- Edit item and modifying data >- Save changes >- A box opens indicating that an issue is linked to the item. >- Click on "Edit serial issue" >- We switch to the issue >- Modifying data of the issue and save >- Both modifications (item and issue) are validated > >Signed-off-by: Nathalie <nathalie.savarit@univ-amu.fr> >--- > cataloguing/additem.pl | 12 +++++++++ > .../en/includes/modals/edit_serial_issues.inc | 20 +++++++++++++++ > .../prog/en/modules/cataloguing/additem.tt | 9 ++++++- > .../prog/js/cataloging_additem.js | 25 +++++++++++++++++++ > 4 files changed, 65 insertions(+), 1 deletion(-) > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/modals/edit_serial_issues.inc > >diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl >index 84a0bfc0dc0..81c8b07befc 100755 >--- a/cataloguing/additem.pl >+++ b/cataloguing/additem.pl >@@ -648,6 +648,18 @@ if ( $op eq "cud-additem" ) { > $item->store; > } > >+ if ( $input->param('edit-serial-issue') ) { >+ my $serialid = $item->serial_item->serialid; >+ my $serial = Koha::Serials->find($serialid); >+ >+ my $redirect = "/cgi-bin/koha/serials/serials-edit.pl?serialid=$serialid"; >+ if ($serial) { >+ $redirect .= "&subscriptionid=" . $serial->subscriptionid; >+ } >+ print $input->redirect($redirect); >+ exit; >+ } >+ > $nextop = "cud-additem"; > } elsif ( $op eq "delinkitem" ) { > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/modals/edit_serial_issues.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/modals/edit_serial_issues.inc >new file mode 100644 >index 00000000000..11af56e5a94 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/modals/edit_serial_issues.inc >@@ -0,0 +1,20 @@ >+[% USE Item %] >+ >+<!-- edit_serial_issues.inc --> >+<!-- Edit serials confirmation dialog --> >+<div class="modal fade" id="edit-serial-issues-modal" tabindex="-1" role="dialog" aria-labelledby="edit-serial-issues-modal-label"> >+ <div class="modal-dialog" role="document"> >+ <div class="modal-content"> >+ <div class="modal-header"> >+ <h4 class="modal-title" id="edit-serial-issues-modal-label">Edit serial issues</h4> >+ </div> >+ <div class="modal-body"> >+ <h5 style="margin-bottom: 15px;">This item has a serial issue linked to it, would you like to edit this as well?</h5> >+ </div> >+ <div class="modal-footer"> >+ <button id="edit-serial-issues-modal-btn-submit" type="button" class="btn btn-primary"><i class="fa fa-exclamation-circle"></i> Edit serial issue</button> >+ <button id="no-edit-serial-issues-modal-btn-submit" class="btn btn-default deny cancel" href="#" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i> Save item without editing serial issue</button> >+ </div> >+ </div> >+ </div> >+</div> >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 9cfb5583c5b..ba668a48075 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >@@ -409,7 +409,12 @@ > [% IF op != 'add_item' %] > <input type="hidden" name="itemnumber" value="[% itemnumber | html %]" /> > [% END %] >- <input type="submit" value="Save changes" onclick="return Check(this.form)" /> >+ [% IF Item.HasSerialItem(itemnumber) == 0 %] >+ <input type="submit" value="Save changes" onclick="return Check(this.form)" /> >+ [% ELSE %] >+ <input type="button" class="submit" value="Save changes" onclick="return ShowSerialEditingConfirmation(this.form)" /> >+ <input type="hidden" name="edit-serial-issue" id="edit-serial-issue" value /> >+ [% END %] > <input type="button" id="addnewitem" value="Add a new item" /> > <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.biblionumber | uri %]">Cancel</a> > [% END %]</fieldset >@@ -421,6 +426,8 @@ > <input type="hidden" name="barcode" value="[% barcode | html %]" /> > <input type="hidden" name="duedatespec" value="[% duedatespec | html %]" /> > [%# End fields for fast cataloging %] >+ >+ [% INCLUDE 'modals/edit_serial_issues.inc' %] > </form> > > [% INCLUDE 'modals/cataloguing_create_av.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js b/koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js >index 26576f6adc0..3648690416f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js >@@ -181,6 +181,26 @@ $(document).ready(function () { > return $("#" + $(this).data("item") + "-delete-item-form").submit(); > }); > >+ $(document).on( >+ "click", >+ "#edit-serial-issues-modal-btn-submit", >+ function (e) { >+ e.preventDefault(); >+ $("#edit-serial-issues-modal").modal("hide"); >+ $("#edit-serial-issue").val("1"); >+ return $("#f").submit(); >+ } >+ ); >+ $(document).on( >+ "click", >+ "#no-edit-serial-issues-modal-btn-submit", >+ function (e) { >+ e.preventDefault(); >+ $("#edit-serial-issues-modal").modal("hide"); >+ return $("#f").submit(); >+ } >+ ); >+ > /* On page load, check for location.hash in the page URL */ > /* If present the location hash will be used to scroll to the relevant anchor */ > var hash = location.hash; >@@ -267,3 +287,8 @@ function Dopop(link, i) { > "width=500,height=400,toolbar=false,scrollbars=yes" > ); > } >+ >+function ShowSerialEditingConfirmation(form) { >+ $("#edit-serial-issues-modal").modal("show"); >+ return false; >+} >-- >2.48.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 37116
:
167849
|
167850
|
167881
|
167882
|
168135
|
168136
|
168137
|
168138
|
168375
|
168376
|
168498
|
168499
|
168500
|
168501
|
171211
|
171212
|
171942
|
171943
|
174882
|
174883
|
176438
|
176439
| 179642 |
179643