Bug 14675: Don't update details if no changes made
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-topissues.tt
1 [% USE Koha %]
2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Most popular titles</title>
4 [% INCLUDE 'doc-head-close.inc' %]
5 [% BLOCK cssinclude %]
6     <style type="text/css">
7         #search-facets fieldset { border: 0; margin: 0;padding:.3em;}#search-facets ol{padding:.3em;}#search-facets li {list-style-type:none;padding:4px 4px;}#search-facets label{font-weight:bold;display:block;margin:.2em 0;}#search-facets fieldset.action {padding-left:4px;margin:.3em;};
8     </style>
9 [% END %]
10 </head>
11 [% INCLUDE 'bodytag.inc' bodyid='opac-topissues' bodyclass='scrollto' %]
12 [% INCLUDE 'masthead.inc' %]
13
14     <div class="main">
15         <ul class="breadcrumb">
16             <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
17             <li><a href="#">Most popular titles</a></li>
18         </ul>
19
20         <div class="container-fluid">
21             <div class="row-fluid">
22                 <div class="span2">
23                     [% IF ( results_loop ) %]
24                         <div id="usertopissues">
25                             [% INCLUDE 'opac-topissues.inc' %]
26                             [% IF ( OpacNav || OpacNavBottom ) %]
27                                 [% INCLUDE 'navigation.inc' %]
28                             [% END %]
29                         </div>
30                     [% ELSE %]
31                         [% IF ( OpacNav || OpacNavBottom ) %]
32                             <div id="leftmenus">
33                                 [% INCLUDE 'navigation.inc' %]
34                             </div>
35                         [% END %]
36                     [% END %]
37                 </div>
38                 <div class="span10">
39                     <div id="topissues" class="maincontent">
40
41                         [% IF ( results_loop ) %]
42                             <table id="topissuest" class="table table-bordered table-striped">
43                                 <caption>
44                                     The [% limit %] most checked-out
45                                     [% IF ( itemtype ) %]
46                                         [% itemtype %]
47                                     [% END %]
48                                     [% IF ( branch ) %]
49                                     at
50                                     [% branch %]
51                                     [% END %]
52                                     [% IF ( timeLimitFinite ) %]
53                                     in the past [% timeLimitFinite |html %] months
54                                     [% ELSE %] of all time[% END %]
55                                 </caption>
56                                 <thead>
57                                     <tr>
58                                         <th>Title</th>
59                                         <th>[% IF ( ccodesearch ) %]Collection[% ELSE %]Item type[% END %]</th>
60                                         <th>Checkouts</th>
61                                         [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]<th>&nbsp;</th>[% END %]
62                                     </tr>
63                                 </thead>
64                                 <tbody>
65                                     [% FOREACH results_loo IN results_loop %]
66                                         <tr>
67                                             <td><a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% results_loo.biblionumber %]">[% results_loo.title |html %]</a><p>[% results_loo.author %]
68                                             [% IF ( results_loo.publishercode ) %]- [% results_loo.publishercode %][% END %] [% IF ( results_loo.seriestitle ) %]([% results_loo.seriestitle %])[% END %]
69                                             [% IF ( results_loo.place ) %][% results_loo.place %][% END %]
70                                             [% IF ( results_loo.publicationyear ) %]
71                                                 [% results_loo.publicationyear %]
72                                             [% ELSIF ( results_loo.copyrightdate ) %]
73                                                 [% results_loo.copyrightdate %]
74                                             [% END %]
75                                             [% IF ( results_loo.pages ) %] - [% results_loo.pages %][% END %]
76                                             [% IF ( results_loo.item('size') ) %][% results_loo.item('size') %][% END %]</p>
77                                             </td>
78                                             <td>
79                                                 [% IF ( results_loo.description ) %]
80                                                     <span class="tdlabel">
81                                                         [% IF ( ccodesearch ) %]
82                                                             Collection
83                                                         [% ELSE %]
84                                                             Item type
85                                                         [% END %]:
86                                                     </span>
87                                                     [% results_loo.description %]
88                                                 [% END %]
89                                             </td>
90                                             <td><span class="tdlabel">Checkouts: </span> [% results_loo.tot %]</td>
91                                             [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]<td>[% IF Koha.Preference( 'RequestOnOpac' ) == 1 %][% UNLESS ( results_loo.norequests ) %]<a href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% results_loo.biblionumber %]">Place hold</a>[% END %][% END %]</td>[% END %]
92                                             </tr>
93                                     [% END %]
94                                 </tbody>
95                             </table>
96                         [% ELSE %]
97                             <form method="post" action="/cgi-bin/koha/opac-topissues.pl">
98                                 <fieldset class="rows">
99                                 <legend>See the most popular titles</legend>
100                                     <ol>
101                                         <li><label for="limit">Show the top </label> <select name="limit" id="limit">
102                                                     [% IF ( limit == 10 ) %]<option value ="10" selected="selected">10 titles</option>[% ELSE %]<option value="10">10 titles</option>[% END %]
103                                                     [% IF ( limit == 15 ) %]<option value ="15" selected="selected">15 titles</option>[% ELSE %]<option value="15">15 titles</option>[% END %]
104                                                     [% IF ( limit == 20 ) %]<option value ="20" selected="selected">20 titles</option>[% ELSE %]<option value="20">20 titles</option>[% END %]
105                                                     [% IF ( limit == 30 ) %]<option value ="30" selected="selected">30 titles</option>[% ELSE %]<option value="30">30 titles</option>[% END %]
106                                                     [% IF ( limit == 40 ) %]<option value ="40" selected="selected">40 titles</option>[% ELSE %]<option value="40">40 titles</option>[% END %]
107                                                     [% IF ( limit == 50 ) %]<option value ="50" selected="selected">50 titles</option>[% ELSE %]<option value="50">50 titles</option>[% END %]
108                                                     [% IF ( limit == 100 ) %]<option value ="100" selected="selected">100 titles</option>[% ELSE %]<option value="100">100 titles</option>[% END %]
109                                                 </select>
110                                         </li>
111                                         <li>
112                                             <label for="branch">From: </label>
113                                             <select name="branch" id="branch">
114                                             <option value="">All libraries</option>
115                                             [% FOREACH branchloo IN branchloop %]
116                                                 [% IF ( branchloo.selected ) %]
117                                                     <option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>
118                                                 [% ELSE %]
119                                                     <option value="[% branchloo.value %]">[% branchloo.branchname %]</option>
120                                                 [% END %]
121                                             [% END %]
122                                             </select>
123                                         </li>
124                                         <li>
125                                             <label for="itemtype">Limit to: </label>
126                                             <select name="itemtype" id="itemtype">
127                                                 [% IF ( ccodesearch ) %]
128                                                     <option value="">All collections</option>
129                                                 [% ELSE %]
130                                                     <option value="">All item types</option>
131                                                 [% END %]
132                                                 [% FOREACH itemtypeloo IN itemtypeloop %]
133                                                     [% IF ( itemtypeloo.selected ) %]<option value="[% itemtypeloo.value %]" selected="selected">[% ELSE %]<option value="[% itemtypeloo.value %]">[% END %]
134                                                         [% itemtypeloo.description %]
135                                                     </option>
136                                                 [% END %]
137                                             </select>
138                                         </li>
139                                         <li>
140                                             <label for="timeLimit">of the last:</label>
141                                             <select name="timeLimit" id="timeLimit">
142                                                 [% IF ( timeLimit == 3 ) %]<option value="3" selected="selected">3 months</option>[% ELSE %]<option value="3">3 months</option>[% END %]
143                                                  [% IF ( timeLimit == 6 ) %]<option value="6" selected="selected">6 months</option>[% ELSE %]<option value="6">6 months</option>[% END %]
144                                                  [% IF ( timeLimit == 12 ) %]<option value="12" selected="selected">12 months</option>[% ELSE %]<option value="12">12 months</option>[% END %]
145                                                  [% IF ( timeLimit == 999 ) %]<option value="999" selected="selected">No limit</option>[% ELSE %]<option value="999">No limit</option>[% END %]
146                                             </select>
147                                         </li>
148                                     </ol>
149                                     <input type="hidden" name="do_it" value="1" />
150                                 </fieldset>
151                                 <fieldset class="action">
152                                     <input type="submit" class="btn" value="Submit" />
153                                 </fieldset>
154                             </form>
155                        [% END # / IF results_loop %]
156                     </div> <!-- / #topissues -->
157                 </div> <!-- / .span10 -->
158             </div> <!-- / .row-fluid -->
159         </div> <!-- / .container-fluid -->
160     </div> <!-- / .main -->
161
162 [% INCLUDE 'opac-bottom.inc' %]
163 [% BLOCK jsinclude %]
164 [% INCLUDE 'datatables.inc' %]
165 <script type="text/javascript">
166 //<![CDATA[
167     $(function() {
168         $("#topissuest").dataTable($.extend(true, {}, dataTablesDefaults, {
169             "aaSorting": [ [2, "desc"], [0, "asc"] ],
170             "aoColumnDefs": [
171               [% IF ( opacuserlogin ) %]{ "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }[% END %]
172             ],
173             "aoColumns": [
174                 { "sType": "anti-the" },
175                 null,
176                 null,
177                 [% IF ( opacuserlogin ) %]null,[% END %]
178             ]
179         }));
180     });
181 function Dopop(link) {
182     newin=window.open(link,'width=500,height=400,toolbar=false,scrollbars=yes');
183 }
184 //]]>
185 </script>
186 [% END %]