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>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 8e83c5c3d9)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
This commit is contained in:
parent
d69271f3fa
commit
42c7153e0d
|
|
@ -650,6 +650,18 @@ if ( $op eq "cud-additem" ) {
|
|||
}
|
||||
}
|
||||
|
||||
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" ) {
|
||||
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
@ -411,7 +411,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
|
||||
|
|
@ -423,6 +428,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' %]
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue