Bugzilla – Attachment 171211 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), 5.91 KB, created by
Matt Blenkinsop
on 2024-09-09 15:39:44 UTC
(
hide
)
Description:
Bug 37116: Redirect to serial modification when modifying an item
Filename:
MIME Type:
Creator:
Matt Blenkinsop
Created:
2024-09-09 15:39:44 UTC
Size:
5.91 KB
patch
obsolete
>From 8f32635a74e366bbb833381c3c24d59bd6a6cc97 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 >--- > cataloguing/additem.pl | 12 +++++++++++ > .../en/includes/modals/edit_serial_issues.inc | 20 +++++++++++++++++++ > .../prog/en/modules/cataloguing/additem.tt | 8 +++++++- > .../prog/js/cataloging_additem.js | 17 ++++++++++++++++ > 4 files changed, 56 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..53a1c03e1a5 >--- /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> >\ No newline at end of file >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 42b29b9787b..318ef1b6e71 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >@@ -372,7 +372,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> >@@ -385,6 +390,7 @@ > [%# 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 f37f95d1f34..6d5fab58987 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js >@@ -155,6 +155,18 @@ $(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(); >+ }); > }); > > function CheckTemplateForm(f) { >@@ -220,3 +232,8 @@ function Dopop(link,i) { > var defaultvalue=document.forms[0].field_value[i].value; > var newin=window.open(link+"&result=" + defaultvalue,"valuebuilder",'width=500,height=400,toolbar=false,scrollbars=yes'); > } >+ >+function ShowSerialEditingConfirmation(form) { >+ $('#edit-serial-issues-modal').modal(); >+ return false; >+} >-- >2.39.3 (Apple Git-146)
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