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