Bug 27631: reports and serials folders
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / serials / routing.tt
1 [% USE KohaDates %]
2 [% SET footerjs = 1 %]
3 [% INCLUDE 'doc-head-open.inc' %]
4 <title>[% IF ( op ) %]Create routing list[% ELSE %]Edit routing list[% END %] &rsaquo; [% title | html %] &rsaquo; Serials &rsaquo; Koha</title>
5 [% INCLUDE 'doc-head-close.inc' %]
6 </head>
7 <body id="ser_routing" class="ser">
8 [% INCLUDE 'header.inc' %]
9 [% INCLUDE 'serials-search.inc' %]
10
11 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
12     <ol>
13         <li>
14             <a href="/cgi-bin/koha/mainpage.pl">Home</a>
15         </li>
16
17         [% IF blocking_error %]
18             <li>
19                 <a href="#" aria-current="page">
20                     Serials
21                 </a>
22             </li>
23
24         [% ELSE %]
25             <li>
26                 <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a>
27             </li>
28             <li>
29                 <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscriptionid | uri %]"><em>[% title | html %]</em></a>
30             </li>
31             <li>
32                 <a href="#" aria-current="page">
33                     [% IF ( op ) %]
34                         Create routing list
35                     [% ELSE %]
36                         Edit routing list
37                     [% END %]
38                 </a>
39             </li>
40         [% END %]
41     </ol>
42 </nav>
43
44 <div class="main container-fluid">
45     <div class="row">
46         <div class="col-sm-10 col-sm-push-2">
47             <main>
48
49 [% IF ( op ) %]
50 <h1>Create routing list for <em>[% title | html %]</em></h1>
51 [% ELSE %]
52 <h1>Edit routing list for <em>[% title | html %]</em></h1>
53 [% END %]
54
55 [% INCLUDE 'blocking_errors.inc' %]
56 <form method="post" action="routing.pl">
57 <input type="hidden" name="op" value="save" />
58 <input type="hidden" name="subscriptionid" value="[% subscriptionid | html %]" />
59 <fieldset class="rows">
60         <ol>
61                 <li><label for="date_selected">Issue: </label>
62 <select name="date_selected" id="date_selected">
63     [% FOREACH date IN dates %]
64         [% IF ( date.selected ) %]
65             <option value="[% date.serialseq | html %] ([% date.publisheddate | html %])" selected="selected">[% date.serialseq | html %] ([% date.publisheddate | $KohaDates %])</option>
66         [% ELSE %]
67             <option value="[% date.serialseq | html %] ([% date.publisheddate | html %])">[% date.serialseq | html %] ([% date.publisheddate | $KohaDates %])</option>
68         [% END %]
69 [% END %]
70 </select> [% issue | html %]</li>
71
72 <li>
73     <span class="label">Recipients:</span>
74     [% IF memberloop %]
75         <table style="clear:none;margin:0;">
76             <tr><th>Name</th>
77                 <th>Rank</th>
78                 <th>Delete</th>
79             </tr>
80             [% USE m_loop = iterator(memberloop) %]
81             [% FOREACH member IN m_loop %]
82             <tr><td>[% member.name | html %]</td>
83                 <td>
84                     <select name="itemrank" class="itemrank" data-subscriptionid="[% subscriptionid | html %]" data-routingid="[% member.routingid | html %]">
85                     [% rankings = [1 .. m_loop.size] %]
86                     [% SET cur_rank = loop.count() %]
87                     [% FOREACH r IN rankings %]
88                         [% IF r == cur_rank %]
89                           <option selected="selected" value="[% r | html %]">[% r | html %]</option>
90                         [% ELSE %]
91                           <option value="[% r | html %]">[% r | html %]</option>
92                         [% END %]
93                     [% END %]
94                     </select>
95                 </td>
96                 <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>
97             </tr>
98             [% END %]
99         </table>
100     [% END %]
101
102     <p style="margin-left:10em;">
103         <a href="#" id="add_recipients"><i class="fa fa-plus"></i> Add recipients</a>
104         [% IF memberloop %]
105             <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscriptionid | uri %]&amp;op=delete"><i class="fa fa-trash"></i> Delete all</a>
106         [% END %]
107     </p>
108 </li>
109
110         <li><label for="notes">Notes:</label><textarea name="notes" id="notes" rows="3" cols="50">[% routingnotes | html %]</textarea></li>
111         </ol>
112
113 </fieldset>
114 <fieldset class="action"><input type="submit" name="submit" value="Save" /></fieldset>
115 </form>
116
117             </main>
118         </div> <!-- /.col-sm-10.col-sm-push-2 -->
119
120         <div class="col-sm-2 col-sm-pull-10">
121             <aside>
122                 [% INCLUDE 'serials-menu.inc' %]
123             </aside>
124         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
125      </div> <!-- /.row -->
126 [% MACRO jsinclude BLOCK %]
127     <script>
128         $(document).ready(function(){
129             $("#add_recipients").on("click",function(e){
130                 e.preventDefault();
131                 userPopup();
132             });
133             $(".itemrank").on("change",function(){
134                 var subscriptionid = $(this).data("subscriptionid");
135                 var routingid = $(this).data("routingid");
136                 reorder_item( subscriptionid, routingid, $(this).val());
137             });
138         });
139         function reorder_item(sid,rid,rank){
140             var mylocation = 'reorder_members.pl?subscriptionid='+sid+'&routingid='+rid+'&rank='+rank;
141             window.location.href=mylocation;
142         }
143
144         function userPopup() {
145             window.open("/cgi-bin/koha/members/search.pl?columns=cardnumber,name,category,branch,action&selection_type=add",
146                 'PatronPopup',
147                 'width=1024,height=768,scrollbars=yes,toolbar=no,'
148                 + 'scrollbars=yes,resize=yes'
149             );
150         }
151
152         function add_user(borrowernumber) {
153             var myurl = "/cgi-bin/koha/serials/routing.pl?subscriptionid="+[% subscriptionid | html %]+"&borrowernumber="+borrowernumber+"&op=add";
154             window.location.href = myurl;
155         }
156     </script>
157 [% END %]
158
159 [% INCLUDE 'intranet-bottom.inc' %]