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