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