From b0911e50d409016454f1139998b4cd9e9b185374 Mon Sep 17 00:00:00 2001 From: Matt Blenkinsop Date: Thu, 6 Jun 2024 12:53:08 +0000 Subject: [PATCH] Bug 37116: Redirect to serial modification when modifying an item --- cataloguing/additem.pl | 6 ++++++ .../en/includes/modals/edit_serial_issues.inc | 20 +++++++++++++++++++ .../prog/en/modules/cataloguing/additem.tt | 8 +++++++- .../prog/js/cataloging_additem.js | 17 ++++++++++++++++ 4 files changed, 50 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 279de91077..6489778273 100755 --- a/cataloguing/additem.pl +++ b/cataloguing/additem.pl @@ -624,6 +624,12 @@ if ($op eq "cud-additem") { $item->store; } + if ( $input->param('edit-serial-issue') ) { + my $serialid = $item->serial_item->serialid; + print $input->redirect("/cgi-bin/koha/serials/serials-edit.pl?serialid=$serialid"); + 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 0000000000..53a1c03e1a --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/modals/edit_serial_issues.inc @@ -0,0 +1,20 @@ +[% USE Item %] + + + + \ 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 fdb94c80d8..28494f3379 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt @@ -359,7 +359,12 @@ [% IF op != 'add_item' %] [% END %] - + [% IF Item.HasSerialItem(itemnumber) == 0 %] + + [% ELSE %] + + + [% END %] Cancel [% END %] @@ -372,6 +377,7 @@ [%# End fields for fast cataloging %] + [% INCLUDE 'modals/edit_serial_issues.inc' %] [% 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 a9e6cf955d..50c39cc3e3 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)