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