Bug 22015: Move DataTables CSS to global include
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / newordersubscription.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE KohaDates %]
4 [% USE Branches %]
5 [% USE Koha %]
6 [% SET footerjs = 1 %]
7 [% INCLUDE 'doc-head-open.inc' %]
8 <title>Koha &rsaquo; Serials [% biblionumber | html %]</title>
9 [% INCLUDE 'doc-head-close.inc' %]
10 </head>
11
12 <body id="acq_newordersubscription" class="acq">
13 [% INCLUDE 'header.inc' %]
14 [% INCLUDE 'acquisitions-search.inc' %]
15
16 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> &rsaquo; <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | html %]">[% booksellername | html %]</a> &rsaquo; <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno | html %]">Basket [% basketno | html %]</a> &rsaquo; Add order from a subscription</div>
17
18 <div class="main container-fluid">
19     <div class="row">
20         <div class="col-sm-10 col-sm-push-2">
21             <main>
22
23             <h2>Serials subscriptions</h2>
24             [% IF (done_searched) %]
25                 <label for="show_only_renewed">
26                     <input type="checkbox" style="vertical-align: middle;" id="show_only_renewed" />
27                     Show only renewed
28                 </label>
29                 [% IF (subs_loop) %]
30                     <table id="srlt">
31                         <thead>
32                             <tr>
33                                 <th>ISSN</th>
34                                 <th class="anti-the">Title</th>
35                                 <th> Notes </th>
36                                 <th>Vendor</th>
37                                 <th>Library</th>
38                                 <th>Call number</th>
39                                 <th class="title-string">Expiration date</th>
40                                 <th class="NoSort"></th>
41                             </tr>
42                         </thead>
43                         <tbody>
44                         [% FOREACH sub IN subs_loop %]
45                             <tr data-reneweddate="[% sub.reneweddate | html %]" >
46                                 <td>[% sub.issn | html %]</td>
47                                 <td><a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% sub.subscriptionid | uri %]" class="button" title="subscription detail">[% IF (sub.title) %][% sub.title | html %][% ELSE %]
48                                 ---
49                             [% END %][% IF (sub.unititle) %], [% sub.unititle | html %][% END %]</a>
50                                 </td>
51                                 <td>[% IF (sub.publicnotes) %][% sub.publicnotes | html %][% END %]
52                                     [% IF (sub.internalnotes) %]([% sub.internalnotes | html %])[% END %]
53                                 </td>
54                                 <td>
55                                     [% IF (sub.vendorname) %][% sub.vendorname | html %][% END %]
56                                 </td>
57                                 <td>
58                                     [% IF (sub.branchcode) %][% Branches.GetName( sub.branchcode ) | html %][% END %]
59                                 </td>
60                                 <td>
61                                     [% IF (sub.callnumber) %][% sub.callnumber | html %][% END %]
62                                 </td>
63                                 <td>
64                                     [% IF (sub.enddate) %]
65                                         <span title="[% sub.enddate | html %]">[% sub.enddate | $KohaDates %]</span>
66                                     [% ELSE %]
67                                         <span title="0000-00-00"></span>
68                                     [% END %]
69                                 </td>
70                                 <td class="actions">
71                                     [% IF (sub.alreadyOnOrder) %]
72                                         Outstanding order
73                                     [% END %]
74                                     [% IF not sub.aqbooksellerid || booksellerid == sub.aqbooksellerid %]
75                                         <a href="/cgi-bin/koha/acqui/neworderempty.pl?booksellerid=[% booksellerid | uri %]&amp;basketno=[% basketno | uri %]&amp;biblionumber=[% sub.biblionumber | uri %]&amp;from_subscriptionid=[% sub.subscriptionid | uri %]" title="Order this one" class="btn btn-default btn-xs">
76                                             <i class="fa fa-plus"></i> Order
77                                         </a>
78                                     [% ELSE %]
79                                         <a title="This subscription depends on another supplier" style="cursor:help">Cannot be ordered</a>
80                                     [% END %]
81                                 </td>
82                             </tr>
83                         [% END %]
84                         </tbody>
85                     </table>
86                 [% ELSE %]
87                     <p>Sorry, there is no result for your search.</p>
88                 [% END %]
89             [% ELSE %]
90                 <p>Use the search form on the left to find subscriptions.</p>
91             [% END %]
92         </main>
93     </div> <!-- /.col-sm-10.col-sm-push-2 -->
94
95 <div class="col-sm-2 col-sm-pull-10">
96     <aside>
97         [% INCLUDE 'subscriptions-search.inc' %]
98         [% INCLUDE 'acquisitions-menu.inc' %]
99     </aside>
100 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
101 </div> <!-- /.row -->
102
103 [% MACRO jsinclude BLOCK %]
104     [% Asset.js("js/acquisitions-menu.js") | $raw %]
105     [% INCLUDE 'datatables.inc' %]
106     <script>
107         function updateRowsVisibility(show_only_renewed) {
108             if ( show_only_renewed ) {
109                 $("#srlt [data-reneweddate='']").hide();
110             } else {
111                 $("#srlt > tbody > tr").show();
112             }
113         }
114
115         $(document).ready(function() {
116             $("#srlt").dataTable($.extend(true, {}, dataTablesDefaults, {
117                 "aoColumnDefs": [
118                     { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] },
119                     { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
120                     { "sType": "title-string", "aTargets" : [ "title-string" ] }
121                 ],
122                 "sPaginationType": "four_button"
123             }));
124
125             $("#show_only_renewed").click(function(){
126                 updateRowsVisibility( $(this).is(":checked") );
127             });
128             $("#show_only_renewed").prop('checked', false);
129             updateRowsVisibility(false);
130
131             $("#advsearch_form").show();
132         });
133     </script>
134 [% END %]
135
136 [% INCLUDE 'intranet-bottom.inc' %]