Koha/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing.tt
Jonathan Druart a77a9a70a2 Bug 13891: DataTables server-side processing - Serial recipients
This second patch removes the previous way to search for serial recipients.

Test plan:
1/ Edit the routing list for a subscription (serials/routing.pl?subscriptionid=X)
2/ Add 1+ recipients
3/ Confirm there is no regression on the add/delete/search actions

QA note: This search does not use a clean way to interact with the
window opener. Indeed the opener is reloaded to display the new item.
This patch does not change this behavior, but note the trick in the
template (common/patron_search.tt) to wait for the opener in order not
to get a JS error.
This is also used by the next patch (patron card).

Tested together with other patches.
Signed-off-by: Marc Veron <veron@veron.ch>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2015-04-13 10:55:21 -03:00

111 lines
4 KiB
Text

[% 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' %]
<script type="text/javascript">
<!--
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 %]+"&borrowernumber="+borrowernumber+"&op=add";
window.location.href = myurl;
}
//-->
</script>
</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 %]"><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 %]" />
<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 %] ([% date.publisheddate %])" selected="selected">[% date.serialseq %] ([% date.publisheddate %])</option>[% ELSE %]<option value="[% date.serialseq %] ([% date.publisheddate %])">[% date.serialseq %] ([% date.publisheddate %])</option>[% END %]
[% END %]
</select> [% issue %]</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 %]</td>
<td>
<select name="itemrank" onchange="reorder_item([%- subscriptionid -%], [%- member.routingid -%], this.value)">
[% rankings = [1 .. m_loop.size] %]
[% FOREACH r IN rankings %]
[% IF r == member.ranking %]
<option selected="selected" value="[% r %]">[% r %]</option>
[% ELSE %]
<option value="[% r %]">[% r %]</option>
[% END %]
[% END %]
</select>
</td>
<td><a href="/cgi-bin/koha/serials/routing.pl?routingid=[% member.routingid %]&amp;subscriptionid=[% subscriptionid %]&amp;op=delete">Delete</a></td>
</tr>
[% END %]
</table>
[% END %]
<p style="margin-left:10em;">
<input type="button" onclick="userPopup()" value="Add recipients" />
[% IF memberloop %]
<a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscriptionid %]&amp;op=delete" class="button">Delete all</a>
[% END %]
</p>
</li>
<li><label for="notes">Notes:</label><textarea name="notes" id="notes" rows="3" cols="50">[% routingnotes %]</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>
[% INCLUDE 'intranet-bottom.inc' %]