Swapping tablesorter version. GZipped version may have been responsible for errors...
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / suggestion / acceptorreject.tmpl
1 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
2 <title>Koha &rsaquo; Acquisitions &rsaquo; Suggestions Management</title>
3 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
4 <script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
5 <script type="text/JavaScript">
6  // <![CDATA[
7         $.tablesorter.addParser({
8             id: 'articles', 
9             is: function(s) {return false;  }, 
10             format: function(s) { return s.toLowerCase().replace(/^(the|an|a) /,''); }, 
11             type: 'text' 
12         });
13         /**
14          *  displayOther.
15          *  This function display the select or an textaera to write a reason.
16          */
17         function displayOther(id,show,hide) {$("#"+hide+id).hide(); $("#"+show+id).show(); }
18         $(document).ready(function() {
19             $('#suggestiontabs > ul').tabs({
20                         select: function(ui) {
21                         $("#loadingtab").show();
22                     },
23                 show: function(ui) {
24                         $("#loadingtab").hide();
25                     }
26                 });
27                 $.tablesorter.defaults.widgets = ['zebra'];
28                 $("#acceptedt").tablesorter({<!-- TMPL_IF EXPR="dateformat eq 'metric'" -->
29                 dateFormat: 'uk',<!-- /TMPL_IF -->
30                         headers: { 0: { sorter: 'articles' },3:{sorter: false},4:{sorter: false},5:{sorter: false},6:{sorter: false},7:{sorter: false}}
31                 });
32                 $("#acceptedt").bind("sortStart",function() {
33                         $("#sorting").show();
34                 }).bind("sortEnd",function() {
35                         $("#sorting").hide();
36                 });
37                 $("#pendingt").tablesorter({<!-- TMPL_IF EXPR="dateformat eq 'metric'" -->
38                 dateFormat: 'uk',<!-- /TMPL_IF -->
39             headers: { 0: { sorter: 'articles' },3:{sorter: false},4:{sorter: false},5:{sorter: false},6:{sorter: false},7:{sorter: false}}
40                 });
41                 $("#pendingt").bind("sortStart",function() {
42                         $("#sorting").show();
43                 }).bind("sortEnd",function() {
44                         $("#sorting").hide();
45                 });
46                 $("#rejectedt").tablesorter({<!-- TMPL_IF EXPR="dateformat eq 'metric'" -->
47                 dateFormat: 'uk',<!-- /TMPL_IF -->
48             headers: { 0: { sorter: 'articles' },3:{sorter: false},4:{sorter: false},5:{sorter: false},6:{sorter: false},7:{sorter: false}}
49                 });
50                 $("#rejectedt").bind("sortStart",function() {
51                         $("#sorting").show();
52                 }).bind("sortEnd",function() {
53                         $("#sorting").hide();
54                 });
55                         
56                 $("div[id*=other-reason]").hide();
57                 $("input[name*=other-reason]").focus(function(){ $(this).val(""); });
58                 $("select[name*=reason]").change(function(){
59                         if($(this).children("[@selected]").val() == "other"){
60                         displayOther($(this).attr("name").replace(/reason/,""),"other-reason","select-reason");
61                         }
62                 });
63                 $("a[href*=back]").click(function(){
64                         var sid = $(this).attr("href").replace(/#back/,"");
65                         displayOther(sid,"select-reason","other-reason");
66                         $("#reason"+sid).find("option[value='']").attr("selected","selected");
67                 });
68                 $("a[href=#markall]").click(function(){
69                         if($(this).attr("id").indexOf("markallop") > -1){
70                                 // select each identical option, clear each input
71                                 var selectedOp = $(this).prev().find("option:selected").val();
72                                 var container = $(this).attr("id").replace(/markallop/,"");
73                                 $("#"+container+" div[id*=other-reason]").hide();
74                                 $("#"+container+" div[id*=select-reason]").show();
75                                 $("#"+container+" select[name*=reason]").not("select[name*=all]").children().each(function(){
76                                         if($(this).val() == selectedOp){ $(this).attr("selected","selected"); }
77                                 });
78                         } else {
79                                 // set each input value, deselect options
80                                 var inputText = $(this).prev().val();
81                                 var container = $(this).attr("id").replace(/markalltext/,"");
82                                 // hide all selects
83                                 $("#"+container+" input[name*=other-reason]").not("input[name*=all]").each(function(){
84                                         // show all text inputs and populate
85                                         $(this).val(inputText).parent("div").show();
86                                         $("div[class=select"+container+"]").hide();
87                                 });
88                                 
89                         }
90                 });
91         }); 
92 // ]]>
93 </script>
94 <style type="text/css">
95 .overlay { top: 180px; left: 50%; position: absolute; margin-left: -100px; width: 200px; text-align: center; display: none; margin-top: -10px; background: #eeffd4; padding : .5em; color: #000; }
96 </style>
97 </head>
98 <body>
99 <!-- TMPL_INCLUDE NAME="header.inc" -->
100 <!-- TMPL_INCLUDE NAME="cat-search.inc" -->
101
102 <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; <!-- TMPL_IF NAME="op_accepted"--> <a href="/cgi-bin/koha/suggestion/acceptorreject.pl">Suggestions Management</a> &rsaquo; Accepted<!-- /TMPL_IF --><!-- TMPL_IF NAME="op_else"--> Suggestions Management<!-- /TMPL_IF --><!-- TMPL_IF NAME="op_rejected"--> <a href="/cgi-bin/koha/suggestion/acceptorreject.pl">Suggestions Management</a> &rsaquo; Rejected<!-- /TMPL_IF --></div>
103
104 <div id="doc" class="yui-t7">
105    
106    <div id="bd">
107         <div id="yui-main">
108         <div class="yui-b">
109
110     <h1>Suggestions</h1>
111   <div id="sorting" class="overlay">Sorting...</div>
112   <div id="loadingtab" class="overlay">Loading tab...</div>
113   <div id="suggestiontabs" class="toptabs">
114         <ul class="ui-tabs-nav">
115       <li><a href="/cgi-bin/koha/suggestion/acceptorreject.pl#accepted">Accepted</a></li>
116       <li class="ui-tabs-selected"><a href="/cgi-bin/koha/suggestion/acceptorreject.pl#pending">Pending</a></li>
117       <li><a href="/cgi-bin/koha/suggestion/acceptorreject.pl#rejected">Rejected</a></li>
118                 </ul>
119         
120  <!--TMPL_LOOP Name="suggestions"-->
121   <div id="<!--TMPL_VAR Name="suggestiontype"-->">
122 <form name="f<!--TMPL_VAR Name="suggestiontype"-->" method="post" action="/cgi-bin/koha/suggestion/acceptorreject.pl#<!--TMPL_VAR Name="suggestiontype"-->">
123  <input type="hidden" name="op" value="aorr_confirm" />
124  <input type="hidden" name="suggestiontype" value="<!--TMPL_VAR Name="suggestiontype"-->" />
125
126     <!-- TMPL_IF NAME="suggestions_loop" -->
127         <!--TMPL_IF EXPR="suggestiontype eq 'accepted'"-->
128     <table id="acceptedt">
129         <!-- TMPL_ELSIF EXPR="suggestiontype eq 'pending'" -->
130         <table id="pendingt">
131         <!-- TMPL_ELSE -->
132         <table id="rejectedt">
133         <!-- /TMPL_IF -->
134         <thead><tr>
135             <th>Suggestion</th>
136             <th>Suggested by</th>
137             <th>Date</th>
138     <!--TMPL_IF EXPR="suggestiontype ne 'pending'"-->
139             <th>Reason</th>
140             <th>Reason Update</th>
141     <!--TMPL_ELSE-->
142             <th>Reason</th>
143     <!--/TMPL_IF -->         
144             <th>Accept</th>
145             <th>Reject</th>
146             <th>Delete</th>
147     </tr></thead>
148         <tbody><!-- TMPL_LOOP NAME="suggestions_loop" -->
149             <!-- TMPL_IF name="even" --><tr class="highlight"><!-- TMPL_ELSE --><tr><!-- /TMPL_IF -->
150                 <td>
151     <!-- TMPL_VAR NAME="title" --><!-- TMPL_IF NAME="author" -->, by <!-- TMPL_VAR NAME="author" --><!-- /TMPL_IF --><br />
152                     <!-- TMPL_IF name="copyrightdate" -->&copy; <!-- TMPL_VAR name="copyrightdate" --> <!-- /TMPL_IF -->
153                         <!-- TMPL_IF name="volumedesc" -->; Volume:<i><!-- TMPL_VAR name="volumedesc" --></i> <!-- /TMPL_IF -->
154                         <!-- TMPL_IF name="isbn" -->; ISBN :<i><!-- TMPL_VAR name="isbn" --></i> <!-- /TMPL_IF --><!-- TMPL_IF name="publishercode" -->; Published by <!-- TMPL_VAR name="publishercode" --> <!-- /TMPL_IF --><!-- TMPL_IF name="publicationyear" --> in <i><!-- TMPL_VAR name="publicationyear" --></i> <!-- /TMPL_IF --><!-- TMPL_IF name="place" --> in <i><!-- TMPL_VAR name="place" --></i> <!-- /TMPL_IF --><br /><!-- TMPL_IF name="note" --><!-- TMPL VAR NAME="note" --><!-- /TMPL_IF -->
155                 </td>
156                 <td>
157                     <!-- TMPL_VAR name="surnamesuggestedby" -->
158                     <!-- TMPL_IF name="firstnamesuggestedby" -->,<!-- /TMPL_IF -->
159                     <!-- TMPL_VAR name="firstnamesuggestedby" -->
160                 </td>
161                 <td>
162                     <!-- TMPL_VAR name="date" -->
163                 </td>
164   
165     <!--TMPL_IF EXPR="suggestiontype ne 'pending'"-->
166                 <td>
167                 <!--TMPL_VAR Name="reason"-->
168       <input type="hidden" name="initial-reason<!-- TMPL_VAR name="suggestionid" -->" value="<!--TMPL_VAR Name="reason" ESCAPE="HTML"-->"  />
169       
170                 </td>
171     <!--/TMPL_IF -->
172                 <td>
173                             <div id="select-reason<!-- TMPL_VAR NAME="suggestionid" -->" class="select<!-- TMPL_VAR NAME="suggestiontype" -->">
174                         <!-- TMPL_IF NAME="reasonsloop" --><select id="reason<!-- TMPL_VAR NAME="suggestionid" -->" name="reason<!-- TMPL_VAR NAME="suggestionid" -->">
175                                         <option value=""> -- Choose a reason -- </option>
176                             <!-- TMPL_LOOP NAME="reasonsloop" -->
177                                 <option value="<!-- TMPL_VAR NAME="lib" -->"><!-- TMPL_VAR NAME="lib" --></option>
178                             <!-- /TMPL_LOOP -->
179                                         <option value="other">Others...</option>
180                         </select><!-- TMPL_ELSE --><span class="problem">No reasons defined in <a href="/cgi-bin/koha/admin/authorised_values.pl">authorised values</a></span><!-- /TMPL_IF -->
181                     </div>
182                     <div id="other-reason<!-- TMPL_VAR NAME="suggestionid" -->">
183                         <input type="text" size="31" name="other-reason<!-- TMPL_VAR name="suggestionid" -->" value="please note your reason here..." />
184                         <p><a href="#back<!-- TMPL_VAR NAME="suggestionid" -->">back to list</a></p>
185                     </div>
186                         
187                 </td>
188                 <td>
189     <!--TMPL_IF EXPR="suggestiontype eq 'accepted'"-->
190                         <input id="a<!--TMPL_VAR name="suggestionid" -->" name="<!--TMPL_VAR name="suggestionid" -->" type="radio" value="ACCEPTED" readonly="readonly" checked="checked"  />
191     
192     <!--TMPL_ELSE-->  
193                         <input id="a<!--TMPL_VAR name="suggestionid" -->" name="<!--TMPL_VAR name="suggestionid" -->" type="radio" value="ACCEPTED" />
194     <!--/TMPL_IF-->            
195             </td>
196             <td>
197     <!--TMPL_IF EXPR="suggestiontype eq 'rejected'"-->
198                         <input id="r<!--TMPL_VAR name="suggestionid" -->" name="<!--TMPL_VAR name="suggestionid" -->" type="radio" value="REJECTED" readonly="readonly" checked="checked" />
199     
200     <!--TMPL_ELSE-->  
201                         <input id="r<!--TMPL_VAR name="suggestionid" -->"  name="<!--TMPL_VAR name="suggestionid" -->" type="radio" value="REJECTED" />
202     <!--/TMPL_IF-->            
203                 
204             </td>
205             <td>
206                         <input id="d<!--TMPL_VAR name="suggestionid" -->" name="<!--TMPL_VAR name="suggestionid" -->" type="radio" value="delete" />
207             </td>
208          </tr>
209         <!-- /TMPL_LOOP --></tbody>
210         </table>  <fieldset>
211   <div id="select-reason<!-- TMPL_VAR NAME="suggestiontype" -->all">
212      <label for="reason<!-- TMPL_VAR NAME="suggestiontype" -->all">Choose a reason for all marked entries:</label>                 <select id="reason<!-- TMPL_VAR NAME="suggestiontype" -->all" name="reason<!-- TMPL_VAR NAME="suggestiontype" -->all">
213                       <option value=""> -- Choose a reason -- </option>
214                         <!--TMPL_LOOP Name="reasonsloop"-->
215                         <option value="<!--TMPL_VAR Name="lib" -->"><!--TMPL_VAR Name="lib" --></option>
216                         <!--/TMPL_LOOP-->
217                       <option value="other">Others...</option>
218                       </select>  <a href="#markall" id="markallop<!-- TMPL_VAR NAME="suggestiontype" -->">Mark all with this reason</a> 
219       </div>
220         
221         <div id="other-reason<!-- TMPL_VAR NAME="suggestiontype" -->all">
222                 <label for="other-reason<!-- TMPL_VAR NAME="suggestiontype" -->all">Enter a reason for all marked entries:</label>
223                         <input type="text" size="31" id="select-other-reason<!-- TMPL_VAR NAME="suggestiontype" -->all" name="other-reason<!-- TMPL_VAR NAME="suggestiontype" -->all" value="please note your reason here..." /> <a href="#markall" id="markalltext<!-- TMPL_VAR NAME="suggestiontype" -->">Mark all with this reason</a> <a href="#back<!-- TMPL_VAR NAME="suggestiontype" -->all">Cancel</a>
224                 </div>
225   </fieldset>
226         <fieldset class="action"><input type="submit" value="Change Status" /></fieldset>
227 </form>
228 <!-- TMPL_ELSE -->
229     <!--TMPL_IF EXPR="suggestiontype eq 'pending'"-->
230     <b>No pending suggestions.</b>
231     <!--/TMPL_IF-->  
232     <!--TMPL_IF EXPR="suggestiontype eq 'accepted'"-->
233     <b>No accepted suggestions.</b>
234     <!--/TMPL_IF-->  
235     <!--TMPL_IF EXPR="suggestiontype eq 'rejected'"-->
236     <b>No rejected suggestions.</b>
237     <!--/TMPL_IF-->  
238 <!-- /TMPL_IF -->
239
240 </div>
241 <!--/TMPL_LOOP-->
242
243 </div>  
244 </div></div>
245
246 </div>
247 </div>
248 </div>
249 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->