fixing SQL error (' is the string separator, and must be doubled when in the string)
[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}, 8:{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}, 8:{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}, 8:{sorter: false}}
49                 });
50                 $("#rejectedt").bind("sortStart",function() {
51                         $("#sorting").show();
52                 }).bind("sortEnd",function() {
53                         $("#sorting").hide();
54                 });
55     $("#checkedt").tablesorter({<!-- TMPL_IF EXPR="dateformat eq 'metric'" -->
56     dateFormat: 'uk',<!-- /TMPL_IF -->
57       headers: { 0: { sorter: 'articles' },3:{sorter: false},4:{sorter: false},5:{sorter: false},6:{sorter: false},7:{sorter: false}, 8:{sorter: false}}
58     });
59     $("#checkedt").bind("sortStart",function() {
60       $("#sorting").show();
61     }).bind("sortEnd",function() {
62       $("#sorting").hide();
63     });
64                         
65                 $("div[id*=other-reason]").hide();
66                 $("input[name*=other-reason]").focus(function(){ $(this).val(""); });
67                 $("select[name*=reason]").change(function(){
68                         if($(this).children("[selected]").val() == "other"){
69                         displayOther($(this).attr("name").replace(/reason/,""),"other-reason","select-reason");
70                         }
71                 });
72                 $("a[href*=back]").click(function(){
73                         var sid = $(this).attr("href").replace(/#back/,"");
74                         displayOther(sid,"select-reason","other-reason");
75                         $("#reason"+sid).find("option[value='']").attr("selected","selected");
76                 });
77                 $("a[href=#markall]").click(function(){
78                         if($(this).attr("id").indexOf("markallop") > -1){
79                                 // select each identical option, clear each input
80                                 var selectedOp = $(this).prev().find("option:selected").val();
81                                 var container = $(this).attr("id").replace(/markallop/,"");
82                                 $("#"+container+" div[id*=other-reason]").hide();
83                                 $("#"+container+" div[id*=select-reason]").show();
84                                 $("#"+container+" select[name*=reason]").not("select[name*=all]").children().each(function(){
85                                         if($(this).val() == selectedOp){ $(this).attr("selected","selected"); }
86                                 });
87                         } else {
88                                 // set each input value, deselect options
89                                 var inputText = $(this).prev().val();
90                                 var container = $(this).attr("id").replace(/markalltext/,"");
91                                 // hide all selects
92                                 $("#"+container+" input[name*=other-reason]").not("input[name*=all]").each(function(){
93                                         // show all text inputs and populate
94                                         $(this).val(inputText).parent("div").show();
95                                         $("div[class=select"+container+"]").hide();
96                                 });
97                                 
98                         }
99                 });
100         }); 
101 // ]]>
102 </script>
103 <style type="text/css">
104 .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; }
105 </style>
106 </head>
107 <body>
108 <!-- TMPL_INCLUDE NAME="header.inc" -->
109 <!-- TMPL_INCLUDE NAME="cat-search.inc" -->
110
111 <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>
112
113 <div id="doc" class="yui-t7">
114    
115    <div id="bd">
116         <div id="yui-main">
117         <div class="yui-b">
118
119     <h1>Suggestions</h1>
120   <div id="sorting" class="overlay">Sorting...</div>
121   <div id="loadingtab" class="overlay">Loading tab...</div>
122   <div id="suggestiontabs" class="toptabs">
123         <ul class="ui-tabs-nav">
124       <li class="ui-tabs-selected"><a href="/cgi-bin/koha/suggestion/acceptorreject.pl#pending">Pending</a></li>
125       <li><a href="/cgi-bin/koha/suggestion/acceptorreject.pl#checked">Checked</a></li>
126       <li><a href="/cgi-bin/koha/suggestion/acceptorreject.pl#accepted">Accepted</a></li>
127       <li><a href="/cgi-bin/koha/suggestion/acceptorreject.pl#rejected">Rejected</a></li>
128                 </ul>
129         
130  <!--TMPL_LOOP Name="suggestions"-->
131   <div id="<!--TMPL_VAR Name="suggestiontype"-->">
132 <form name="f<!--TMPL_VAR Name="suggestiontype"-->" method="post" action="/cgi-bin/koha/suggestion/acceptorreject.pl#<!--TMPL_VAR Name="suggestiontype"-->">
133  <input type="hidden" name="op" value="aorr_confirm" />
134  <input type="hidden" name="suggestiontype" value="<!--TMPL_VAR Name="suggestiontype"-->" />
135
136 <!-- TMPL_IF NAME="suggestions_loop" -->
137     <table id="<!--TMPL_VAR Name="suggestiontype"-->t">
138         <thead><tr>
139             <th>Suggestion</th>
140             <th>Notes</th>
141             <th>Suggested by</th>
142             <th>Date</th>
143             <th>Reason</th>
144     <!--TMPL_IF EXPR="suggestiontype ne 'pending'"-->
145             <th>Reason Update</th>
146     <!--/TMPL_IF -->         
147             <th>Checked</th>
148             <th>Accept</th>
149             <th>Reject</th>
150             <th>Delete</th>
151     </tr></thead>
152         <tbody><!-- TMPL_LOOP NAME="suggestions_loop" -->
153             <!-- TMPL_IF name="even" --><tr class="highlight"><!-- TMPL_ELSE --><tr><!-- /TMPL_IF -->
154                 <td>
155     <!-- TMPL_IF NAME="title" --><a href="/cgi-bin/koha/catalogue/search.pl?q=<!-- TMPL_VAR NAME="title" ESCAPE="URL" -->"><!-- TMPL_VAR NAME="title" escape="html" --></a><!-- /TMPL_IF --><!-- TMPL_IF NAME="author" -->, by <a href="/cgi-bin/koha/catalogue/search.pl?q=au:<!-- TMPL_VAR NAME="author" ESCAPE="URL" -->"><!-- TMPL_VAR NAME="author" --></a><!-- /TMPL_IF --><br />
156                     <!-- TMPL_IF name="copyrightdate" -->&copy; <!-- TMPL_VAR name="copyrightdate" --> <!-- /TMPL_IF -->
157                         <!-- TMPL_IF name="volumedesc" -->; Volume:<i><!-- TMPL_VAR name="volumedesc" --></i> <!-- /TMPL_IF -->
158                         <!-- 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 /></td>
159                         <td><!-- TMPL_VAR NAME="note" --></td>
160                 <td>
161                     <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrnumsuggestedby" -->"><!-- TMPL_VAR name="surnamesuggestedby" --><!-- TMPL_IF name="firstnamesuggestedby" -->,<!-- /TMPL_IF -->
162                     <!-- TMPL_VAR name="firstnamesuggestedby" --></a><br />
163                     <!-- TMPL_VAR name="categorydescriptionsuggestedby" --> (<!-- TMPL_VAR name="categorycodesuggestedby" -->)<br />
164                     <!-- TMPL_VAR name="branchnamesuggestedby" --> (<!-- TMPL_VAR name="branchcodesuggestedby" -->)
165                 </td>
166                 <td>
167                     <!-- TMPL_VAR name="suggestioncreatedon" -->
168                 </td>
169   
170     <!--TMPL_IF EXPR="suggestiontype ne 'pending'"-->
171                 <td>
172                 <!--TMPL_VAR Name="reason"-->
173       <input type="hidden" name="initial-reason<!-- TMPL_VAR name="ordernumber" -->" value="<!--TMPL_VAR Name="reason" ESCAPE="HTML"-->"  />
174                 </td>
175     <!--/TMPL_IF -->
176                 <td>
177                             <div id="select-reason<!-- TMPL_VAR NAME="ordernumber" -->" class="select<!-- TMPL_VAR NAME="suggestiontype" -->">
178                         <!-- TMPL_IF NAME="reasonsloop" --><select id="reason<!-- TMPL_VAR NAME="ordernumber" -->" name="reason<!-- TMPL_VAR NAME="ordernumber" -->">
179                                         <option value=""> -- Choose a reason -- </option>
180                             <!-- TMPL_LOOP NAME="reasonsloop" -->
181                                 <option value="<!-- TMPL_VAR NAME="lib" -->"><!-- TMPL_VAR NAME="lib" --></option>
182                             <!-- /TMPL_LOOP -->
183                                         <option value="other">Others...</option>
184                         </select><!-- TMPL_ELSE --><span class="problem">No reasons defined in <a href="/cgi-bin/koha/admin/authorised_values.pl">authorized values</a></span><!-- /TMPL_IF -->
185                     </div>
186                     <div id="other-reason<!-- TMPL_VAR NAME="ordernumber" -->">
187                         <input type="text" size="31" name="other-reason<!-- TMPL_VAR name="ordernumber" -->" value="please note your reason here..." />
188                         <p><a href="#back<!-- TMPL_VAR NAME="ordernumber" -->">back to list</a></p>
189                     </div>
190                         
191                 </td>
192                 <td>
193     <!--TMPL_IF Name="CHECKED"-->
194                         <input id="c<!--TMPL_VAR name="ordernumber" -->" name="<!--TMPL_VAR name="ordernumber" -->" type="radio" value="CHECKED" readonly="readonly" checked="checked"  />  
195     <!--TMPL_ELSE-->  
196                         <input id="c<!--TMPL_VAR name="ordernumber" -->" name="<!--TMPL_VAR name="ordernumber" -->" type="radio" value="CHECKED" />
197     <!--/TMPL_IF-->            
198             </td>
199                 <td>
200     <!--TMPL_IF Name="ACCEPTED"-->
201                         <input id="a<!--TMPL_VAR name="ordernumber" -->" name="<!--TMPL_VAR name="ordernumber" -->" type="radio" value="ACCEPTED" readonly="readonly" checked="checked"  />
202     <!--TMPL_ELSE-->  
203                         <input id="a<!--TMPL_VAR name="ordernumber" -->" name="<!--TMPL_VAR name="ordernumber" -->" type="radio" value="ACCEPTED" />
204     <!--/TMPL_IF-->            
205             </td>
206             <td>
207     <!--TMPL_IF Name="REJECTED"-->
208                         <input id="r<!--TMPL_VAR name="ordernumber" -->" name="<!--TMPL_VAR name="ordernumber" -->" type="radio" value="REJECTED" readonly="readonly" checked="checked" />
209     <!--TMPL_ELSE-->  
210                         <input id="r<!--TMPL_VAR name="ordernumber" -->"  name="<!--TMPL_VAR name="ordernumber" -->" type="radio" value="REJECTED" />
211     <!--/TMPL_IF-->            
212             </td>
213             <td>
214                         <input id="d<!--TMPL_VAR name="ordernumber" -->" name="<!--TMPL_VAR name="ordernumber" -->" type="radio" value="delete" />
215             </td>
216          </tr>
217         <!-- /TMPL_LOOP --></tbody>
218         </table>  <fieldset>
219   <div id="select-reason<!-- TMPL_VAR NAME="suggestiontype" -->all">
220      <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">
221                       <option value=""> -- Choose a reason -- </option>
222                         <!--TMPL_LOOP Name="reasonsloop"-->
223                         <option value="<!--TMPL_VAR Name="lib" -->"><!--TMPL_VAR Name="lib" --></option>
224                         <!--/TMPL_LOOP-->
225                       <option value="other">Others...</option>
226                       </select>  <a href="#markall" id="markallop<!-- TMPL_VAR NAME="suggestiontype" -->">Mark all with this reason</a> 
227       </div>
228         
229         <div id="other-reason<!-- TMPL_VAR NAME="suggestiontype" -->all">
230                 <label for="other-reason<!-- TMPL_VAR NAME="suggestiontype" -->all">Enter a reason for all marked entries:</label>
231                         <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>
232 <!--Add feature : choose librarian Choose supplier if accepted and allow order, Choose Budget Choose Branchcode-->          </div>
233   </fieldset>
234         <fieldset class="action"><input type="submit" value="Change Status" /></fieldset>
235 </form>
236 <!-- TMPL_ELSE -->
237     <b>No <!--TMPL_VAR Name="suggestiontype"--> suggestions.</b>
238 <!-- /TMPL_IF -->
239 </div>
240 <!--/TMPL_LOOP-->
241
242 </div>  
243 </div></div>
244
245 </div>
246 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->