From ef43b9e8a7d968b07e674929703528d17f15bc84 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 | 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 84a0bfc0dc..81c8b07bef 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 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 c4e59b96b7..9c90366e5c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt @@ -367,7 +367,12 @@ [% IF op != 'add_item' %] [% END %] - + [% IF Item.HasSerialItem(itemnumber) == 0 %] + + [% ELSE %] + + + [% END %] Cancel [% END %] @@ -380,6 +385,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)