1 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
2 <title>Home › Tools › Tags › <!-- TMPL_IF NAME="do_it" -->Review › <!-- TMPL_ELSE -->Review Tags<!-- /TMPL_IF --></title>
3 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
4 <!-- TMPL_INCLUDE NAME="calendar.inc" -->
5 <script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.checkboxes.pack.js"></script>
6 <style type="text/css">
7 .setlabel {width: 6em; font-family: courier; background-color:#E8E8E8;}
8 .red {color:darkred; background-color: pink;}
9 .green {color:darkgreen; background-color: #D1EFD5; text-align: center;}
10 .pending {background-color: lightyellow;}
11 td input,td input[type="submit"] { font-size: 85%; padding: 1px; }
13 <script type="text/javascript">
15 // <!-- TMPL_VAR NAME="script_name" -->
17 url: "/cgi-bin/koha/tags/review.pl",
25 function pull_counts () {
26 ok_count = parseInt(document.getElementById("terms_summary_approved_count" ).innerHTML);
27 nok_count = parseInt(document.getElementById("terms_summary_unapproved_count").innerHTML);
28 rej_count = parseInt(document.getElementById("terms_summary_rejected_count" ).innerHTML);
30 function count_approve () {
33 $("#terms_summary_unapproved_count").html(nok_count -1);
34 $("#terms_summary_approved_count" ).html( ok_count +1);
37 function count_reject () {
40 $("#terms_summary_unapproved_count").html(nok_count -1);
41 $("#terms_summary_rejected_count" ).html(rej_count +1);
44 function warn_once (evt) {
45 if (alerted <= 1 && ($(evt.target).is('.ok') || $(evt.target).is('.rej'))) {
47 window.alert("this is: " + this + "is '.ok': " + $(evt.target).is('.ok') + " is '.rej': " + $(evt.target).is('.rej'));
50 var success_approve = function(tag){
51 // window.alert('AJAX approved tag: ' + tag);
53 var failure_approve = function(tag){
54 window.alert('AJAX failed to approve tag: ' + tag);
56 var success_reject = function(tag){
57 // window.alert('AJAX rejected tag: ' + tag);
59 var failure_reject = function(tag){
60 window.alert('AJAX failed to reject tag: ' + tag);
62 var success_test = function(tag){
63 $('#verdict').html(tag + ' is permitted!');
65 var failure_test = function(tag){
66 $('#verdict').html(tag + ' is prohibited!');
68 var indeterminate_test = function(tag){
69 $('#verdict').html(tag + ' is neither permitted nor prohibited!');
72 var success_test_call = function() {
73 $('#test_button').removeAttr("disabled");
74 $('#test_button').attr("value","test");
76 function readCookie(name) { // from http://www.quirksmode.org/js/cookies.html
77 var nameEQ = name + "=";
78 var ca = document.cookie.split(';');
79 for(var i=0;i < ca.length;i++) {
81 while (c.charAt(0)==' '){ c = c.substring(1,c.length); }
82 if (c.indexOf(nameEQ) == 0){ return c.substring(nameEQ.length,c.length); }
86 $(document).ready(function() {
87 $('.ajax_buttons' ).css({visibility:"visible"});
88 $("p.check").html("<strong>Select: </strong><a id=\"CheckAll\" href=\"/cgi-bin/koha/tags/review.pl\">All</a> <a id=\"CheckPending\" href=\"/cgi-bin/koha/tags/review.pl\">Pending</a> <a id=\"CheckNone\" href=\"/cgi-bin/koha/tags/review.pl\">None</a>");
89 $("#CheckAll").click(function(){
90 $(".checkboxed").checkCheckboxes();
93 $("#CheckNone").click(function(){
94 $(".checkboxed").unCheckCheckboxes();
97 $("#CheckPending").click(function(){
98 $(".checkboxed").checkCheckboxes(".pending");
101 $('body').click(function(event) {
103 // window.alert("Click detected on " + event.target + ": " + $(event.target).html);
104 if ($(event.target).is('.ok')) {
106 "data": {ok: $(event.target).attr("title"), CGISESSID: readCookie('CGISESSID')},
107 "success": count_approve // success_approve
109 $(event.target).next(".rej").removeAttr("disabled").attr("value","Reject").css("color","#000");
110 $(event.target).attr( "value","Approved").attr("disabled","disabled").css("color","#666");
111 return false; // cancel submit
113 if ($(event.target).is('.rej')) {
115 "data": {rej: $(event.target).attr("title"), CGISESSID: readCookie('CGISESSID')},
116 "success": count_reject // success_reject
118 $(event.target).prev(".ok").removeAttr("disabled").attr("value","Approve").css("color","#000");
119 $(event.target).attr( "value","Rejected").attr("disabled","disabled").css("color","#666");
120 return false; // cancel submit
122 if ($(event.target).is('#test_button')) {
123 $(event.target).attr( "value","Testing...").attr("disabled","disabled");
125 "data": {test: $('#test').attr("value")},
126 "success": success_test_call // success_reject
128 return false; // cancel submit
131 $("*").ajaxError(function(evt, request, settings){
132 if ((alerted +=1) <= 1){ window.alert("AJAX error (" + alerted + " alert)"); }
139 <!-- TMPL_INCLUDE NAME="header.inc" -->
140 <!-- TMPL_INCLUDE NAME="cat-search.inc" -->
142 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> › Tags</div>
144 <div id="doc3" class="yui-t2">
151 <form method="post" action="/cgi-bin/koha/tags/review.pl">
153 <legend>Filters</legend>
162 <td><input type="text" name="tag" value="<!-- TMPL_VAR NAME="filter_tag" -->" />
164 <td><select name="approved">
165 <option <!-- TMPL_IF NAME="filter_approved_all" -->selected="selected" <!-- /TMPL_IF -->value="all">all</option>
166 <option <!-- TMPL_IF NAME="filter_approved_ok" -->selected="selected" <!-- /TMPL_IF -->value="1">approved</option>
167 <option <!-- TMPL_IF NAME="filter_approved_pending" -->selected="selected" <!-- /TMPL_IF -->value="0">pending</option>
168 <option <!-- TMPL_IF NAME="filter_approved_rej" -->selected="selected" <!-- /TMPL_IF -->value="-1">rejected</option>
171 <td><input type="text" name="approver" value="<!-- TMPL_VAR NAME="filter_approver" -->" />
174 <label for="from" class="setlabel">from </label>
175 <input type="text" size="10" id="from" name="from" value="<!-- TMPL_VAR NAME="filter_date_approved_from" -->" />
176 <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" border="0" alt="Show Calendar" style="cursor: pointer;" id="openCalendarFrom" />
178 <label for="to" class="setlabel"> to </label>
179 <input type="text" size="10" id="to" name="to" value="<!-- TMPL_VAR NAME="filter_date_approved_to" -->" />
180 <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" border="0" alt="Show Calendar" style="cursor: pointer;" id="openCalendarTo" />
184 <fieldset class="action"><input type="submit" value="Apply Filter(s)" /></fieldset>
187 <script type="text/javascript">
189 // function submit_check (from_id,to_id) {
190 // var dateFrom = Date_from_syspref(document.getElementById(from_id).value);
191 // var dateTo = Date_from_syspref(document.getElementById( to_id).value);
192 // var today = new Date();
193 // if (dateFrom < dateTo) {
194 // alert("The starting date cannot be after the ending date.");
195 // document.getElementById(to_id).select();
198 // if (dateFrom > today) {
199 // alert("The starting date cannot be in the future.");
200 // document.getElementById(from_id).select();
205 // return true if the date is blocked.
206 function disable_from(date) {var limit = get_Calendar_limit(date,'to' ); return (limit && limit < date);}
207 function disable_to (date) {var limit = get_Calendar_limit(date,'from'); return (limit && limit > date);}
211 ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
212 button : "openCalendarFrom",
213 disableFunc : disable_from,
214 dateStatusFunc : disable_from
218 ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
219 button : "openCalendarTo",
220 disableFunc : disable_to,
221 dateStatusFunc : disable_to
225 <form method="post" action="/cgi-bin/koha/tags/review.pl" class="checkboxed">
227 <!-- TMPL_IF NAME="filter_approved_all" -->ALL<!-- /TMPL_IF -->
228 <!-- TMPL_IF NAME="filter_approved_ok" -->Approved<!-- /TMPL_IF -->
229 <!-- TMPL_IF NAME="filter_approved_pending" -->Pending<!-- /TMPL_IF -->
230 <!-- TMPL_IF NAME="filter_approved_rej" -->Rejected<!-- /TMPL_IF -->
234 <!-- TMPL_IF NAME="op_count" -->
235 <div class="message" id="main_status">
236 <!-- TMPL_IF EXPR="op eq 'approve'" --> Approved
237 <!-- TMPL_ELSIF EXPR="op eq 'reject'" --> Rejected
238 <!-- TMPL_ELSIF EXPR="op eq 'test'" --> Tested
239 <!-- TMPL_ELSE --> Unkown Operation (<!-- TMPL_VAR NAME="op" -->) on
241 <!-- TMPL_VAR NAME="op_count" --> Term(s).
244 <!-- TMPL_IF NAME="message_loop" -->
245 <div class="error" id="main_error">
246 <!-- TMPL_LOOP NAME="message_loop" -->
247 <!-- TMPL_IF NAME="date_from" -->ERROR: Date from is not a legal value (<!-- TMPL_VAR NAME="date_from" -->).
248 <!-- TMPL_ELSIF NAME="date_to" -->ERROR: Date to is not a legal value (<!-- TMPL_VAR NAME="date_to" -->).
249 <!-- TMPL_ELSIF NAME="failed_ok" -->ERROR: Failed to approve term (<!-- TMPL_VAR NAME="failed_ok" -->).
250 <!-- TMPL_ELSIF NAME="failed_rej" -->ERROR: Failed to reject term (<!-- TMPL_VAR NAME="failed_rej" -->).
251 <!-- TMPL_ELSIF NAME="approver" -->ERROR: No match for user (<!-- TMPL_VAR NAME="approver" -->). FILTER REQUIRES BORROWERNUMBER (not name).
252 <!-- TMPL_ELSIF NAME="approved_by"-->ERROR: No match for borrowernumber (<!-- TMPL_VAR NAME="approved_by" -->).
253 <!-- TMPL_ELSIF NAME="op_zero" -->ERROR: The root koha user in your KOHA_CONF file
254 (default: kohaadmin) is not a valid tag moderator. These actions are logged
255 by borrowernumber, so the moderator must exist in your borrowers table.
256 Please login as a different authorized staff user to moderate tags.
257 <!-- TMPL_ELSE --> Unrecognized error!
263 <!-- TMPL_IF NAME="pagination_bar" -->
264 <div class="pagination" id="pagination_top">
265 <!-- TMPL_VAR NAME="pagination_bar" -->
268 <!-- TMPL_IF NAME="tagloop" -->
269 <p class="check"></p>
281 <!-- TMPL_LOOP NAME="tagloop" -->
283 <td class="count"><!-- TMPL_VAR EXPR="offset + __counter__" -->
285 <td><span><input type="checkbox" value="<!-- TMPL_VAR NAME="term"-->" name="tags" <!-- TMPL_IF EXPR="approved == 0" --> class="pending"<!-- /TMPL_IF --> /></span>
287 <!-- TMPL_IF EXPR="approved == -1" --><td class="red">rejected
288 <!-- TMPL_ELSIF EXPR="approved == 1" --><td class="green"><img alt="OK" src="/intranet-tmpl/prog/img/approve.gif" />
289 <!-- TMPL_ELSE --><td class="pending">
292 <td><!-- TMPL_VAR NAME="term" -->
294 <td><!-- TMPL_VAR NAME="weight_total" -->
296 <!-- TMPL_IF NAME="approved" -->
297 <td><span class="ajax_buttons" style="visibility:hidden">
298 <!-- TMPL_IF EXPR="approved == -1" -->
299 <input class="ok" type="submit" title="<!-- TMPL_VAR NAME="term"-->" value="Approve" name="approve" />
300 <input class="rej" disabled="disabled" type="submit" title="<!-- TMPL_VAR NAME="term"-->" value="Rejected" name="reject" />
302 <input class="ok" disabled="disabled" type="submit" title="<!-- TMPL_VAR NAME="term"-->" value="Approved" name="approve" />
303 <input class="rej" type="submit" title="<!-- TMPL_VAR NAME="term"-->" value="Reject" name="reject" />
307 <td><!-- TMPL_IF NAME="approved_by_name" --><a href="/cgi-bin/koha/tags/review.pl?approved_by=<!-- TMPL_VAR NAME="approved_by" -->&approved=all"><!-- TMPL_VAR NAME="approved_by_name" --></a><!-- TMPL_ELSE --> <!-- /TMPL_IF -->
310 <td><span class="ajax_buttons" style="visibility:hidden">
311 <input class="ok" type="submit" title="<!-- TMPL_VAR NAME="term"-->" value="Approve" name="approve" />
312 <input class="rej" type="submit" title="<!-- TMPL_VAR NAME="term"-->" value="Reject" name="reject" />
317 <td><!-- TMPL_VAR NAME="date_approved"-->
323 <!-- TMPL_IF NAME="tagloop" --><fieldset class="action">
324 <input type="submit" value="Approve" id="approve_button" name="op" />
325 <input type="submit" value="Reject" id="reject_button" name="op" />
326 </fieldset><!-- /TMPL_IF -->
332 <fieldset class="brief">
333 <h4>Terms Summary</h4>
335 <li><a href="/cgi-bin/koha/tags/review.pl?approved=1">Approved</a>:
336 <span id="terms_summary_approved_count"><!-- TMPL_VAR NAME="approved_count" --></span>
338 <li><a href="/cgi-bin/koha/tags/review.pl?approved=-1">Rejected</a>:
339 <span id="terms_summary_rejected_count"><!-- TMPL_VAR NAME="rejected_count" --></span>
341 <li><a href="/cgi-bin/koha/tags/review.pl?approved=0">Pending</a>:
342 <span id="terms_summary_unapproved_count"><!-- TMPL_VAR NAME="unapproved_count" --></span>
344 <li><a href="/cgi-bin/koha/tags/review.pl?approved=all">Total</a>:
345 <span id="terms_summary_approved_total"><!-- TMPL_VAR NAME="approved_total" --></span>
348 <span id="terms_summary_status"> </span>
350 <fieldset class="brief">
351 <h4>Test Blacklist</h4>
352 <div class="description">Enter a word or phrase here to test against your whitelist/blacklist: </div>
353 <form method="post" action="/cgi-bin/koha/tags/review.pl">
354 <input type="text" size="14" name="test" id="test" />
355 <fieldset class="action"><input type="submit" value="Test" id="test_button" name="op" /></fieldset>
357 <!-- TMPL_IF NAME="test_term" -->
358 <!-- TMPL_IF NAME="verdict_ok" -->
359 "<!-- TMPL_VAR NAME="test_term" -->" is permitted.
360 <!-- TMPL_ELSIF NAME="verdict_rej" -->
361 "<!-- TMPL_VAR NAME="test_term" -->" is prohibited.
362 <!-- TMPL_ELSIF NAME="verdict_indeterminate" -->
363 "<!-- TMPL_VAR NAME="test_term" -->" is neither permitted nor prohibited.
371 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->