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