Bug 37116: Redirect to batch serial modification when batch modifying items
Test plan: - Add a new subscription to a serial record (with option 'When receiving the serial --> create an item record') - Receive several issues and create the items linked - Back to bibliographic record - Select several items and click to 'Modify selected items' - Modify data (like add a public note) - A box opens indicating that 'some of the items have linked serial issues, would you like to edit these as well ?' - Click on "Edit serial issue" - We switch to the issues - Modify data of the issues (add a note for example like for the items) 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>
This commit is contained in:
parent
8e83c5c3d9
commit
3aa675795b
|
|
@ -9,11 +9,23 @@
|
|||
<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>
|
||||
[% IF batch %]
|
||||
<h5 style="margin-bottom: 15px;">Some of these items have linked serial issues, would you like to edit these as well?</h5>
|
||||
[% ELSE %]
|
||||
<h5 style="margin-bottom: 15px;">This item has a serial issue linked to it, would you like to edit this as well?</h5>
|
||||
[% END %]
|
||||
</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>
|
||||
[% IF batch %]
|
||||
<button id="edit-serial-issues-modal-btn-submit" type="button" class="btn btn-primary"><i class="fa fa-exclamation-circle"></i> Edit serial issues</button>
|
||||
[% ELSE %]
|
||||
<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>
|
||||
[% END %]
|
||||
[% IF batch %]
|
||||
<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 items without editing serial issues</button>
|
||||
[% ELSE %]
|
||||
<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>
|
||||
[% END %]
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -168,6 +168,9 @@
|
|||
<input type="hidden" name="searchid" value="[% searchid | html %]" />
|
||||
<input type="hidden" name="uploadedfileid" id="uploadedfileid" value="" />
|
||||
<input type="hidden" name="src" id="src" value="[% src | html %]" />
|
||||
[% FOREACH linked_serial_id IN linked_serial_ids %]
|
||||
<input type="hidden" name="linked_serial_id" id="linked_serial_id" value="[% linked_serial_id | html %]" />
|
||||
[% END %]
|
||||
[% IF biblionumber %]
|
||||
<input type="hidden" name="biblionumber" id="biblionumber" value="[% biblionumber | html %]" />
|
||||
[% END %]
|
||||
|
|
@ -252,7 +255,12 @@
|
|||
</fieldset>
|
||||
|
||||
<fieldset class="action">
|
||||
<input type="submit" id="mainformsubmit" class="btn btn-primary" value="Save" />
|
||||
[% IF linked_serials %]
|
||||
<input type="button" class="submit" value="Save" onclick="return ShowSerialEditingConfirmation(this.form)" />
|
||||
<input type="hidden" name="edit-serial-issues" id="edit-serial-issues" value />
|
||||
[% ELSE %]
|
||||
<input type="submit" id="mainformsubmit" class="btn btn-primary" value="Save" />
|
||||
[% END %]
|
||||
<a href="/cgi-bin/koha/tools/batchMod.pl" class="cancel">Cancel</a>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
|
@ -277,6 +285,7 @@
|
|||
<!-- /.action -->
|
||||
[% END %]
|
||||
</form>
|
||||
[% INCLUDE 'modals/edit_serial_issues.inc' batch=1 %]
|
||||
</div>
|
||||
<!-- /.main.container-fluid -->
|
||||
|
||||
|
|
|
|||
|
|
@ -169,6 +169,11 @@ function hideAllColumns() {
|
|||
});
|
||||
}
|
||||
|
||||
function ShowSerialEditingConfirmation(form) {
|
||||
$("#edit-serial-issues-modal").modal("show");
|
||||
return false;
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
var items_table = $("#itemst").kohaTable({
|
||||
columnDefs: [
|
||||
|
|
@ -219,4 +224,23 @@ $(document).ready(function () {
|
|||
}
|
||||
}
|
||||
});
|
||||
$(document).on(
|
||||
"click",
|
||||
"#edit-serial-issues-modal-btn-submit",
|
||||
function (e) {
|
||||
e.preventDefault();
|
||||
$("#edit-serial-issues-modal").modal("hide");
|
||||
$("#edit-serial-issues").val("1");
|
||||
return $("form[name='f'").submit();
|
||||
}
|
||||
);
|
||||
$(document).on(
|
||||
"click",
|
||||
"#no-edit-serial-issues-modal-btn-submit",
|
||||
function (e) {
|
||||
e.preventDefault();
|
||||
$("#edit-serial-issues-modal").modal("hide");
|
||||
return $("form[name='f'").submit();
|
||||
}
|
||||
);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -187,6 +187,18 @@ if ( $op eq "cud-action" ) {
|
|||
my $job_id = Koha::BackgroundJob::BatchUpdateItem->new->enqueue($params);
|
||||
$nextop = 'enqueued';
|
||||
$template->param( job_id => $job_id, );
|
||||
|
||||
if ( $input->param('edit-serial-issues') ) {
|
||||
my @linked_serial_ids = $input->multi_param('linked_serial_id');
|
||||
my $subscriptionid = Koha::Serials->find( $linked_serial_ids[0] )->subscriptionid;
|
||||
my $redirect_url = "/cgi-bin/koha/serials/serials-edit.pl?";
|
||||
for my $serial_id (@linked_serial_ids) {
|
||||
$redirect_url .= "serialid=$serial_id&";
|
||||
}
|
||||
$redirect_url .= "subscriptionid=$subscriptionid";
|
||||
print $input->redirect($redirect_url);
|
||||
exit;
|
||||
}
|
||||
} catch {
|
||||
push @messages,
|
||||
{
|
||||
|
|
@ -283,6 +295,15 @@ if ( $op eq "cud-show" || $op eq "show" ) {
|
|||
$template->param( itemnumbers_array => \@itemnumbers );
|
||||
}
|
||||
|
||||
my @linked_serial_ids;
|
||||
foreach my $itemnumber (@itemnumbers) {
|
||||
my $item = Koha::Items->find($itemnumber);
|
||||
my $serial_item = $item->serial_item;
|
||||
push( @linked_serial_ids, $serial_item->serialid ) if $serial_item;
|
||||
}
|
||||
$template->param( linked_serial_ids => \@linked_serial_ids );
|
||||
$template->param( linked_serials => 1 ) if scalar(@linked_serial_ids) > 0;
|
||||
|
||||
# now, build the item form for entering a new item
|
||||
|
||||
# Getting list of subfields to keep when restricted batchmod edit is enabled
|
||||
|
|
|
|||
Loading…
Reference in New Issue