Koha/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing.tt
Jonathan Druart 22ab4ba524 Bug 13618: Remove filter when assigning array
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2018-08-17 16:53:56 +00:00

123 lines
4.9 KiB
Text

[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Serials &rsaquo; [% title | html %] &rsaquo; [% IF ( op ) %]Create routing list[% ELSE %]Edit routing list[% END %]</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
<body id="ser_routing" class="ser">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'serials-search.inc' %]
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a> &rsaquo; <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscriptionid | html %]"><i>[% title | html %]</i></a> &rsaquo; [% IF ( op ) %]Create routing list[% ELSE %]Edit routing list[% END %]</div>
<div id="doc3" class="yui-t2">
<div id="bd">
<div id="yui-main">
<div class="yui-b">
[% IF ( op ) %]
<h1>Create routing list for <i>[% title | html %]</i></h1>
[% ELSE %]
<h1>Edit routing list for <i>[% title | html %]</i></h1>
[% END %]
<form method="post" action="routing.pl">
<input type="hidden" name="op" value="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">
[% FOREACH date IN dates %]
[% IF ( date.selected ) %]<option value="[% date.serialseq | html %] ([% date.publisheddate | html %])" selected="selected">[% date.serialseq | html %] ([% date.publisheddate | html %])</option>[% ELSE %]<option value="[% date.serialseq | html %] ([% date.publisheddate | html %])">[% date.serialseq | html %] ([% date.publisheddate | html %])</option>[% END %]
[% END %]
</select> [% issue | html %]</li>
<li>
<span class="label">Recipients:</span>
[% IF memberloop %]
<table style="clear:none;margin:0;">
<tr><th>Name</th>
<th>Rank</th>
<th>Delete</th>
</tr>
[% USE m_loop = iterator(memberloop) %]
[% FOREACH member IN m_loop %]
<tr><td>[% member.name | html %]</td>
<td>
<select name="itemrank" class="itemrank" data-subscriptionid="[% subscriptionid | html %]" data-routingid="[% member.routingid | html %]">
[% rankings = [1 .. m_loop.size] %]
[% FOREACH r IN rankings %]
[% IF r == member.ranking %]
<option selected="selected" value="[% r | html %]">[% r | html %]</option>
[% ELSE %]
<option value="[% r | html %]">[% r | html %]</option>
[% END %]
[% 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"></i> Delete</a></td>
</tr>
[% END %]
</table>
[% END %]
<p style="margin-left:10em;">
<a href="#" id="add_recipients"><i class="fa fa-plus"></i> Add recipients</a>
[% IF memberloop %]
<a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscriptionid | html %]&amp;op=delete"><i class="fa fa-trash"></i> Delete all</a>
[% END %]
</p>
</li>
<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" value="Save" /></fieldset>
</form>
</div>
</div>
<div class="yui-b">
[% INCLUDE 'serials-menu.inc' %]
</div>
</div>
[% MACRO jsinclude BLOCK %]
<script type="text/javascript">
$(document).ready(function(){
$("#add_recipients").on("click",function(e){
e.preventDefault();
userPopup();
});
$(".itemrank").on("change",function(){
var subscriptionid = $(this).data("subscriptionid");
var routingid = $(this).data("routingid");
reorder_item( subscriptionid, routingid, $(this).val());
});
});
function reorder_item(sid,rid,rank){
var mylocation = 'reorder_members.pl?subscriptionid='+sid+'&routingid='+rid+'&rank='+rank;
window.location.href=mylocation;
}
function userPopup() {
window.open("/cgi-bin/koha/serials/add_user_search.pl",
'PatronPopup',
'width=740,height=450,location=yes,toolbar=no,'
+ 'scrollbars=yes,resize=yes'
);
}
function add_user(borrowernumber) {
var myurl = "routing.pl?subscriptionid="+[% subscriptionid | html %]+"&borrowernumber="+borrowernumber+"&op=add";
window.location.href = myurl;
}
</script>
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]