Bug 37873: Unable to delete user from routing list or preview/print routing list slip

This patch restores the ability to delete a recipient from a serials routing list.
It also fixes the slip preview when using the "Save and preview slip", and removes
	the koha staff intranet head from the slip when using 'Print list' from the
	Serial collection information screen.

To test:
1) Login to the staff client.
2) Open the Serials module.
3) + New subscription to add a new serial.
4) Create a new subscription.
	a) Search for a record (I searched for 'dog') and chose that record.
	b) Under 'When receiving this serial', select 'Create an item record'
	c) Under the 'Item type' dropdown, select anything.
	d) Click Next -> (and confirm the popup).
	e) Select any 'First issue date'.
	f) Select any 'Frequency'.
	g) Enter a number larger than 5 in the 'Subscription length'.
	h) Select any 'Subscription start date'.
	i) Select your favorite numbering pattern.
	j) Verify your prediction pattern using "Test prediction pattern".
	k) Click "Save subscription".
5) On the 'Subscription details' screen, click "Receive".
6) Under the first volume, click "Add item" then "Save".
7) Repeat step 6 to receive one more issue.
8) On the 'Serial collection information' page click "+ Create routing list"
9) Click "+ Add recipients".
10) Search for and add several recipients.
11) Click "Close" to exit the 'Add recipients' page.
12) Click "Delete" next to any recipient.
	*Note that the recipient is not deleted.
13) Click "Save" on the 'Modify routing list for ...' page.
14) Click "Save and preview routing slip" button.
	*Note you are redirected to the Subscription details page, but no routing
	slip preview appears.
15) Click "Serial collection" from the left-side menu.
16) Click "Print list" on either of the issues you previously received.
	*Note the routing slip includes the staff intranet header, menu, etc.

17) Apply patch.
18) Return to the 'Serial collection information' screen for your subscription.
19) Click "Edit routing list".
20) Repeat steps 12-16 and verify the issues are fixed.
	-"Delete" button works to remove a recipient from a list.
	-"Save and preview routing list" button pops-up a preview before redirecting.
	-"Print list" pops-up a vanilla routing list to print.

Sponsored-by: Westlake Porter Public Library
Signed-off-by: Olivier V <olivier.vezina@inLibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
CJ Lynce 2024-09-10 18:12:04 +00:00 committed by Katrin Fischer
parent 7b713e5acf
commit f74a3304e1
Signed by: kfischer
GPG key ID: 0EF6E2C03357A834
3 changed files with 53 additions and 16 deletions

View file

@ -52,7 +52,7 @@
</fieldset>
<fieldset class="action">
<form method="post" action="routing-preview.pl">
<form method="post" id="save_and_preview_form" action="routing-preview.pl">
[% INCLUDE 'csrf-token.inc' %]
<input type="hidden" id="subscriptionid" name="subscriptionid" value="[% subscriptionid | html %]" />
<input type="hidden" id="issue_escaped" name="issue_escaped" value="[% issue_escaped | html %]" />
@ -88,6 +88,23 @@
</div> <!-- /.row -->
[% MACRO jsinclude BLOCK %]
<script>
$(document).ready(function(){
$("#save_and_preview_form").on("submit",function(e){
var myurl = 'routing-preview.pl?op=print&subscriptionid='+$("#subscriptionid").val()+'&issue='+$("#issue_escaped").val();
window.open(myurl,'PrintSlip','width=500,height=500,toolbar=no,scrollbars=yes');
});
/* e.preventDefault();
print_slip( $("#subscriptionid").val(), $("#issue_escaped").val() );
});
});
function print_slip(subscriptionid,issue){
var myurl = 'routing-preview.pl?op=print&subscriptionid='+subscriptionid+'&issue='+issue;
window.open(myurl,'PrintSlip','width=500,height=500,toolbar=no,scrollbars=yes');
window.location.href='subscription-detail.pl?subscriptionid=' + subscriptionid;
*/
});
</script>
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]

View file

@ -54,14 +54,10 @@
<h1>Modify routing list for <em>[% title | html %]</em></h1>
[% END %]
<form method="post" action="routing.pl">
[% INCLUDE 'csrf-token.inc' %]
<input type="hidden" name="op" value="cud-save" />
<input type="hidden" name="subscriptionid" value="[% subscriptionid | html %]" />
<fieldset class="rows">
<ol>
<li><label for="date_selected">Issue: </label>
<select name="date_selected" id="date_selected">
<select name="date_selected_top" id="date_selected_top" class="date_selected_top">
[% FOREACH date IN dates %]
[% IF ( date.selected ) %]
<option value="[% date.serialseq | html %] ([% date.publisheddate | html %])" selected="selected">[% date.serialseq | html %] ([% date.publisheddate | $KohaDates %])</option>
@ -95,23 +91,43 @@
[% END %]
</select>
</td>
<td><a class="btn btn-default btn-xs" href="/cgi-bin/koha/serials/routing.pl?routingid=[% member.routingid | html %]&amp;subscriptionid=[% subscriptionid | html %]&amp;op=delete"><i class="fa fa-trash-can"></i> Delete</a></td>
<td>
<form method="post" action="routing.pl">
[% INCLUDE 'csrf-token.inc' %]
<input type="hidden" name="op" value="cud-delete" />
<input type="hidden" name="subscriptionid" value="[% subscriptionid | html %]" />
<input type="hidden" name="routingid" value="[% member.routingid | html %]" />
<button type="submit" class="btn btn-default btn-xs"><i class="fa fa-trash-can"></i> Delete</button>
</form>
</td>
</tr>
[% END %]
</table>
[% END %]
<input type="hidden" id="new_recipients" name="new_recipients" value="">
<p style="margin-left:10em;">
<a href="#patron_search_modal" id="add_recipients" data-bs-toggle="modal"><i class="fa fa-plus"></i> Add recipients</a>
[% IF memberloop %]
<a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscriptionid | uri %]&amp;op=delete"><i class="fa fa-trash-can"></i> Delete all</a>
[% END %]
</p>
<form method="post" action="routing.pl">
[% INCLUDE 'csrf-token.inc' %]
<input type="hidden" name="op" value="cud-delete" />
<input type="hidden" name="subscriptionid" value="[% subscriptionid | html %]" />
<p style="margin-left:10em;">
<a href="#patron_search_modal" id="add_recipients" data-bs-toggle="modal"><i class="fa fa-plus"></i> Add recipients</a>
[% IF memberloop %]
<button type="submit" class="btn"><i class="fa fa-trash-can"></i> Delete all</button>
[% END %]
</p>
</form>
</li>
<li><label for="notes">Notes:</label><textarea name="notes" id="notes" rows="3" cols="50">[% routingnotes | html %]</textarea></li>
</ol>
<form method="post" action="routing.pl">
[% INCLUDE 'csrf-token.inc' %]
<input type="hidden" name="op" value="cud-save" />
<input type="hidden" name="subscriptionid" value="[% subscriptionid | html %]" />
<input type="hidden" id="date_selected" name="date_selected" value="" />
<li><label for="notes">Notes:</label><textarea name="notes" id="notes" rows="3" cols="50">[% routingnotes | html %]</textarea></li>
</ol>
</fieldset>
<fieldset class="action"><input type="submit" name="submit" class="btn btn-primary" value="Save" /></fieldset>
@ -134,6 +150,10 @@
var routingid = $(this).data("routingid");
reorder_item( subscriptionid, routingid, $(this).val());
});
$("#date_selected").val( $("#date_selected_top").find("option:selected").val() );
$(".date_selected_top").on("change",function(){
$("#date_selected").val( $(this).val() );
});
});
function reorder_item(sid,rid,rank){
var mylocation = 'reorder_members.pl?subscriptionid='+sid+'&routingid='+rid+'&rank='+rank;

View file

@ -314,7 +314,7 @@
</td>
[% IF ( routing ) %]
<td class="actions">
<a href="/cgi-bin/koha/serials/routing-preview.pl?ok=1&amp;subscriptionid=[% serial.subscriptionid | uri %]&amp;issue=[% serial.serialseq.replace("'", "\\'") | uri %]%20([% serial.publisheddate | $KohaDates %])" class="btn btn-default btn-xs print_list"><i class="fa fa-print"></i> Print list</a>
<a href="/cgi-bin/koha/serials/routing-preview.pl?op=print&amp;subscriptionid=[% serial.subscriptionid | uri %]&amp;issue=[% serial.serialseq.replace("'", "\\'") | uri %]%20([% serial.publisheddate | $KohaDates %])" class="btn btn-default btn-xs print_list"><i class="fa fa-print"></i> Print list</a>
</td>
[% END %]
</tr>