Bug 23448: (follow-up) Add comments on markup structure
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / serials / checkexpiration.tt
1 [% USE Branches %]
2 [% USE KohaDates %]
3 [% SET footerjs = 1 %]
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Koha &rsaquo; Serials &rsaquo; Check expiration</title>
6 [% INCLUDE 'doc-head-close.inc' %]
7 </head>
8
9 <body id="ser_checkexpiration" class="ser">
10 [% INCLUDE 'header.inc' %]
11 [% INCLUDE 'serials-search.inc' %]
12
13 <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; Check expiration </div>
14
15 <div class="main container-fluid">
16     <div class="row">
17         <div class="col-sm-10 col-sm-push-2">
18             <main>
19
20 <h1>Check expiration</h1>
21
22     <form name="f" action="/cgi-bin/koha/serials/checkexpiration.pl" method="get" class="validated">
23 <fieldset class="rows">
24     <legend>Filter results:</legend>
25     
26          <ol>
27         <li><label for="title">Title:</label>
28         <input id="title" type="text" name="title" size="15" value="[% title | html %]" /></li>
29
30         <li><label for="issn">ISSN:</label>
31         <input id="issn" type="text" name="issn" size="15" value="[% issn | html %]" /></li>
32         [% IF can_change_library %]
33         <li><label for="branch">Library:</label>
34         <select id="branch" name="branch">
35             <option value="">All</option>
36             [% PROCESS options_for_libraries libraries => Branches.all( selected => branch ) %]
37         </select>
38         </li>
39         [% END %]
40
41         <li><label for="date" class="required">Expiring before:</label>
42             <input id="date" type="text" name="date" size="10" value="[% date | $KohaDates %]" class="required focus datepicker" required="required" />
43         <span class="required">Required</span>
44                         <div class="hint">[% INCLUDE 'date-format.inc' %]</div></li>
45                         </ol>
46         
47 </fieldset>
48 <fieldset class="action"><input type="submit" value="Search" /></fieldset>
49 </form>
50
51 [% IF ( subscriptions_loop ) %]
52 <p>
53     <b>[% numsubscription | html %]</b> subscription(s)
54         [% IF ( title ) %]
55         with title matching <span class="title">[% title | html %]</class>
56         [% IF ( issn ) %]and [% END %]
57     [% END %]
58     [% IF ( issn ) %]
59         with ISSN matching <b>[% issn | html %]</b>
60     [% END %]
61         will expire before <b>[% date | $KohaDates %]</b>
62 </p>
63
64 <div class="checkexpiration-table_table_controls">
65     <a href="#" class="SelectAll"><i class="fa fa-check"></i> Select all</a> |
66     <a href="#" class="ClearAll"><i class="fa fa-remove"></i> Clear all</a>
67     <span class="itemselection_actions">
68       | Actions:
69           <a class="itemselection_action_renew" title="Renew selected subscriptions"><i class="fa fa-refresh"></i> Renew selected subscriptions</a>
70     </span>
71 </div>
72
73
74 <table>
75         <tr>
76             <th></th>
77             <th>ISSN</th>
78             <th>Title</th>
79             [% IF can_change_library %]<th>Library</th>[% END %]
80             <th>OPAC note</th>
81             <th>Nonpublic note</th>
82             <th>Expiration date</th>
83             <th>Actions</th>
84         </tr>
85     [% FOREACH subscriptions_loo IN subscriptions_loop %]
86         <tr>
87             <td style="text-align:center;vertical-align:middle">
88                 <input type="checkbox" value="[% subscriptions_loo.subscriptionid | html %]" name="subscriptionid" />
89             </td>
90             <td>
91                 [% subscriptions_loo.issn | html %]
92             </td>
93             <td><a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscriptions_loo.subscriptionid |url %]">[% IF ( subscriptions_loo.title ) %]
94                     [% subscriptions_loo.title | html %]
95                 [% ELSE %]
96                     |
97                 [% END %]
98                 </a>
99             </td>
100             [% IF can_change_library %]<td>
101                 [% Branches.GetName( subscriptions_loo.branchcode ) | html %]
102             </td>[% END %]
103             <td>
104                 [% subscriptions_loo.notes | html %]
105             </td>
106             <td>
107                 [% subscriptions_loo.internalnotes | html %]
108             </td>
109             <td>
110                 [% subscriptions_loo.expirationdate | $KohaDates %]
111             </td>
112             <td class="actions">
113                 <a href="/cgi-bin/koha/serials/subscription-add.pl?op=modify&amp;subscriptionid=[% subscriptions_loo.subscriptionid | uri %]" class="btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a>
114                 <a href="/cgi-bin/koha/serials/subscription-renew.pl?subscriptionid=[% subscriptions_loo.subscriptionid | uri %]" data-subscriptionid="[% subscriptions_loo.subscriptionid | html %]" class="btn btn-default btn-xs renew_subscription"><i class="fa fa-refresh"></i> Renew</a>
115             </td>
116         </tr>
117     [% END %]
118     </table>
119 [% ELSIF searched %]
120     <p>No results for your query</p>
121 [% END %]
122
123             </main>
124         </div> <!-- /.col-sm-10.col-sm-push-2 -->
125
126         <div class="col-sm-2 col-sm-pull-10">
127             <aside>
128                 [% INCLUDE 'serials-menu.inc' %]
129             </aside>
130         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
131      </div> <!-- /.row -->
132
133 [% MACRO jsinclude BLOCK %]
134     [% INCLUDE 'calendar.inc' %]
135     <script>
136         $(document).ready(function(){
137             $(".renew_subscription").on("click",function(e){
138                 e.preventDefault();
139                 var subscriptionid = $(this).data("subscriptionid");
140                 newin=window.open("/cgi-bin/koha/serials/subscription-renew.pl?mode=popup&subscriptionid="+subscriptionid,'popup','width=590,height=440,toolbar=false,scrollbars=yes,resize=yes');
141             });
142             $('a.itemselection_action_renew').on("click", function(e){
143                 e.preventDefault();
144                 newin=window.open($(this).attr('href'),'popup','width=590,height=440,toolbar=false,scrollbars=yes,resize=yes');
145             });
146             function itemSelectionBuildRenewLink() {
147                 var subscription_ids= new Array();
148                 $("input[name='subscriptionid'][type='checkbox']:checked").each(function() {
149                     subscription_ids.push($(this).val());
150                 });
151                 if (subscription_ids.length > 0) {
152                     var url = '/cgi-bin/koha/serials/subscription-renew.pl?op=multi_renew';
153                     url += '&subscriptionid=' + subscription_ids.join('&subscriptionid=');
154                     $('a.itemselection_action_renew').attr('href', url);
155                 } else {
156                     return false;
157                 }
158                 return true;
159             }
160
161             function itemSelectionBuildActionLinks() {
162                 var export_link_ok = itemSelectionBuildRenewLink();
163                 if (export_link_ok) {
164                     $('.itemselection_actions').show();
165                 } else {
166                     $('.itemselection_actions').hide();
167                 }
168             }
169
170             itemSelectionBuildActionLinks();
171
172             $("input[name='subscriptionid'][type='checkbox']").change(function() {
173                 itemSelectionBuildActionLinks();
174             });
175
176             $(".SelectAll, .ClearAll").on("click",function(e){
177                 e.preventDefault();
178                 var checkboxes = $(this).parent().siblings('table').first().find('input[type="checkbox"]');
179                 checkboxes.prop('checked', $(this).hasClass('SelectAll'));
180                 itemSelectionBuildActionLinks();
181             });
182
183         });
184     </script>
185 [% END %]
186
187 [% INCLUDE 'intranet-bottom.inc' %]