ca5440933a195f0399068101037d0a246ac035c1
[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             <th>Reason</th>
139     <!--TMPL_IF EXPR="suggestiontype ne 'pending'"-->
140             <th>Reason Update</th>
141     <!--/TMPL_IF -->         
142             <th>Accept</th>
143             <th>Reject</th>
144             <th>Delete</th>
145     </tr></thead>
146         <tbody><!-- TMPL_LOOP NAME="suggestions_loop" -->
147             <!-- TMPL_IF name="even" --><tr class="highlight"><!-- TMPL_ELSE --><tr><!-- /TMPL_IF -->
148                 <td>
149     <!-- TMPL_VAR NAME="title" escape="html" --><!-- TMPL_IF NAME="author" -->, by <!-- TMPL_VAR NAME="author" --><!-- /TMPL_IF --><br />
150                     <!-- TMPL_IF name="copyrightdate" -->&copy; <!-- TMPL_VAR name="copyrightdate" --> <!-- /TMPL_IF -->
151                         <!-- TMPL_IF name="volumedesc" -->; Volume:<i><!-- TMPL_VAR name="volumedesc" --></i> <!-- /TMPL_IF -->
152                         <!-- 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 -->
153                 </td>
154                 <td>
155                     <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrnumsuggestedby" -->"><!-- TMPL_VAR name="surnamesuggestedby" -->
156                     <!-- TMPL_IF name="firstnamesuggestedby" -->,<!-- /TMPL_IF -->
157                     <!-- TMPL_VAR name="firstnamesuggestedby" --></a>
158                     (<!-- TMPL_VAR name="branchcodesuggestedby" -->)
159                 </td>
160                 <td>
161                     <!-- TMPL_VAR name="date" -->
162                 </td>
163   
164     <!--TMPL_IF EXPR="suggestiontype ne 'pending'"-->
165                 <td>
166                 <!--TMPL_VAR Name="reason"-->
167       <input type="hidden" name="initial-reason<!-- TMPL_VAR name="suggestionid" -->" value="<!--TMPL_VAR Name="reason" ESCAPE="HTML"-->"  />
168                 </td>
169     <!--/TMPL_IF -->
170                 <td>
171                             <div id="select-reason<!-- TMPL_VAR NAME="suggestionid" -->" class="select<!-- TMPL_VAR NAME="suggestiontype" -->">
172                         <!-- TMPL_IF NAME="reasonsloop" --><select id="reason<!-- TMPL_VAR NAME="suggestionid" -->" name="reason<!-- TMPL_VAR NAME="suggestionid" -->">
173                                         <option value=""> -- Choose a reason -- </option>
174                             <!-- TMPL_LOOP NAME="reasonsloop" -->
175                                 <option value="<!-- TMPL_VAR NAME="lib" -->"><!-- TMPL_VAR NAME="lib" --></option>
176                             <!-- /TMPL_LOOP -->
177                                         <option value="other">Others...</option>
178                         </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 -->
179                     </div>
180                     <div id="other-reason<!-- TMPL_VAR NAME="suggestionid" -->">
181                         <input type="text" size="31" name="other-reason<!-- TMPL_VAR name="suggestionid" -->" value="please note your reason here..." />
182                         <p><a href="#back<!-- TMPL_VAR NAME="suggestionid" -->">back to list</a></p>
183                     </div>
184                         
185                 </td>
186                 <td>
187     <!-- These EXPR are NOT doing what the author thinks they are -->
188     <!--TMPL_IF EXPR="suggestiontype eq 'accepted'"-->
189                         <input id="a<!--TMPL_VAR name="suggestionid" -->" name="<!--TMPL_VAR name="suggestionid" -->" type="radio" value="ACCEPTED" readonly="readonly" checked="checked"  />
190     <!--TMPL_ELSE-->  
191                         <input id="a<!--TMPL_VAR name="suggestionid" -->" name="<!--TMPL_VAR name="suggestionid" -->" type="radio" value="ACCEPTED" />
192     <!--/TMPL_IF-->            
193             </td>
194             <td>
195     <!--TMPL_IF EXPR="suggestiontype eq 'rejected'"-->
196                         <input id="r<!--TMPL_VAR name="suggestionid" -->" name="<!--TMPL_VAR name="suggestionid" -->" type="radio" value="REJECTED" readonly="readonly" checked="checked" />
197     <!--TMPL_ELSE-->  
198                         <input id="r<!--TMPL_VAR name="suggestionid" -->"  name="<!--TMPL_VAR name="suggestionid" -->" type="radio" value="REJECTED" />
199     <!--/TMPL_IF-->            
200                 
201             </td>
202             <td>
203                         <input id="d<!--TMPL_VAR name="suggestionid" -->" name="<!--TMPL_VAR name="suggestionid" -->" type="radio" value="delete" />
204             </td>
205          </tr>
206         <!-- /TMPL_LOOP --></tbody>
207         </table>  <fieldset>
208   <div id="select-reason<!-- TMPL_VAR NAME="suggestiontype" -->all">
209      <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">
210                       <option value=""> -- Choose a reason -- </option>
211                         <!--TMPL_LOOP Name="reasonsloop"-->
212                         <option value="<!--TMPL_VAR Name="lib" -->"><!--TMPL_VAR Name="lib" --></option>
213                         <!--/TMPL_LOOP-->
214                       <option value="other">Others...</option>
215                       </select>  <a href="#markall" id="markallop<!-- TMPL_VAR NAME="suggestiontype" -->">Mark all with this reason</a> 
216       </div>
217         
218         <div id="other-reason<!-- TMPL_VAR NAME="suggestiontype" -->all">
219                 <label for="other-reason<!-- TMPL_VAR NAME="suggestiontype" -->all">Enter a reason for all marked entries:</label>
220                         <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>
221                 </div>
222   </fieldset>
223         <fieldset class="action"><input type="submit" value="Change Status" /></fieldset>
224 </form>
225 <!-- TMPL_ELSE -->
226     <!--TMPL_IF EXPR="suggestiontype eq 'pending'"-->
227     <b>No pending suggestions.</b>
228     <!--/TMPL_IF-->  
229     <!--TMPL_IF EXPR="suggestiontype eq 'accepted'"-->
230     <b>No accepted suggestions.</b>
231     <!--/TMPL_IF-->  
232     <!--TMPL_IF EXPR="suggestiontype eq 'rejected'"-->
233     <b>No rejected suggestions.</b>
234     <!--/TMPL_IF-->  
235 </form>
236 <!-- /TMPL_IF -->
237
238 </div>
239 <!--/TMPL_LOOP-->
240
241 </div>  
242 </div></div>
243
244 </div>
245 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->