1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Home › Tools › Tags › [% IF ( do_it ) %]Review › [% ELSE %]Review Tags[% END %]</title>
3 [% INCLUDE 'doc-head-close.inc' %]
4 [% INCLUDE 'calendar.inc' %]
5 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.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">
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 [% INCLUDE 'header.inc' %]
140 [% INCLUDE '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">
150 <div class="yui-u first">
152 <form method="post" action="/cgi-bin/koha/tags/review.pl" class="checkboxed">
154 [% IF ( filter_approved_all ) %]ALL[% END %]
155 [% IF ( filter_approved_ok ) %]Approved[% END %]
156 [% IF ( filter_approved_pending ) %]Pending[% END %]
157 [% IF ( filter_approved_rej ) %]Rejected[% END %]
161 [% IF ( op_count ) %]
162 <div class="dialog message" id="main_status">
163 [% IF ( op == 'approve' ) %] Approved
164 [% ELSIF ( op == 'reject' ) %] Rejected
165 [% ELSIF ( op == 'test' ) %] Tested
166 [% ELSE %]Unknown Operation ([% op %]) on
168 [% op_count %] Term(s).
171 [% IF ( message_loop ) %]
172 <div class="dialog alert" id="main_error">
173 [% FOREACH message_loo IN message_loop %]
174 [% IF ( message_loo.date_from ) %]ERROR: <em>Date from</em> is not a legal value ("[% message_loo.date_from %]").
175 [% ELSIF ( message_loo.date_to ) %]ERROR: <em>Date to</em> is not a legal value ("[% message_loo.date_to %]").
176 [% ELSIF ( message_loo.failed_ok ) %]ERROR: Failed to approve term ([% message_loo.failed_ok %]).
177 [% ELSIF ( message_loo.failed_rej ) %]ERROR: Failed to reject term ([% message_loo.failed_rej %]).
178 [% ELSIF ( message_loo.approver ) %]ERROR: No match for user ([% message_loo.approver %]). FILTER REQUIRES BORROWERNUMBER (not name).
179 [% ELSIF ( message_loo.approved_by ) %]ERROR: No match for borrowernumber ([% message_loo.approved_by %]).
180 [% ELSIF ( message_loo.op_zero ) %]ERROR: The root koha user in your KOHA_CONF file
181 (default: kohaadmin) is not a valid tag moderator. These actions are logged
182 by borrowernumber, so the moderator must exist in your borrowers table.
183 Please login as a different authorized staff user to moderate tags.
184 [% ELSE %] Unrecognized error!
190 [% IF ( pagination_bar ) %]
191 <div class="pagination" id="pagination_top">
196 <p class="check"></p>
205 [% UNLESS ( filter_approved_pending ) %]<th>Reviewer</th>[% END %]
208 [% FOREACH tagloo IN tagloop %]
210 <td class="count">[% offset + __counter__ %]
212 <td><span><input type="checkbox" value="[% tagloo.term %]" name="tags" [% IF ( approved == 0 ) %] class="pending"[% END %] /></span>
214 [% IF ( approved == -1 ) %]<td class="red">rejected
215 [% ELSIF ( approved == 1 ) %]<td class="green"><img alt="OK" src="/intranet-tmpl/prog/img/approve.gif" />
216 [% ELSE %]<td class="pending">
219 <td>[% tagloo.term %]
221 <td>[% tagloo.weight_total %]
223 [% IF ( tagloo.approved ) %]
224 <td><span class="ajax_buttons" style="visibility:hidden">
225 [% IF ( approved == -1 ) %]
226 <input class="ok" type="submit" title="[% tagloo.term %]" value="Approve" name="approve" />
227 <input class="rej" disabled="disabled" type="submit" title="[% tagloo.term %]" value="Rejected" name="reject" />
229 <input class="ok" disabled="disabled" type="submit" title="[% tagloo.term %]" value="Approved" name="approve" />
230 <input class="rej" type="submit" title="[% tagloo.term %]" value="Reject" name="reject" />
234 <td>[% IF ( tagloo.approved_by_name ) %]<a href="/cgi-bin/koha/tags/review.pl?approved_by=[% tagloo.approved_by %]&approved=all">[% tagloo.approved_by_name %]</a>[% ELSE %] [% END %]
237 <td><span class="ajax_buttons" style="visibility:hidden">
238 <input class="ok" type="submit" title="[% tagloo.term %]" value="Approve" name="approve" />
239 <input class="rej" type="submit" title="[% tagloo.term %]" value="Reject" name="reject" />
242 [% UNLESS ( tagloo.filter_approved_pending ) %]<td> </td>[% END %]
244 <td>[% tagloo.date_approved %]
250 [% IF ( tagloop ) %]<fieldset class="action">
251 <input type="submit" value="Approve" id="approve_button" name="op" />
252 <input type="submit" value="Reject" id="reject_button" name="op" />
257 <fieldset class="brief">
258 <h4>Terms Summary</h4>
260 <li><a href="/cgi-bin/koha/tags/review.pl?approved=1">Approved</a>:
261 <span id="terms_summary_approved_count">[% approved_count %]</span>
263 <li><a href="/cgi-bin/koha/tags/review.pl?approved=-1">Rejected</a>:
264 <span id="terms_summary_rejected_count">[% rejected_count %]</span>
266 <li><a href="/cgi-bin/koha/tags/review.pl?approved=0">Pending</a>:
267 <span id="terms_summary_unapproved_count">[% unapproved_count %]</span>
269 <li><a href="/cgi-bin/koha/tags/review.pl?approved=all">Total</a>:
270 <span id="terms_summary_approved_total">[% approved_total %]</span>
273 <span id="terms_summary_status"> </span>
275 <fieldset class="brief">
277 <div class="description">Enter a word or phrase to check against approved/rejected lists: </div>
278 <form method="post" action="/cgi-bin/koha/tags/review.pl">
279 <input type="text" size="14" name="test" id="test" />
280 <fieldset class="action"><input type="submit" value="Test" id="test_button" name="op" /></fieldset>
282 [% IF ( test_term ) %]
283 [% IF ( verdict_ok ) %]
284 "[% test_term %]" is permitted.
285 [% ELSIF ( verdict_rej ) %]
286 "[% test_term %]" is prohibited.
287 [% ELSIF ( verdict_indeterminate ) %]
288 "[% test_term %]" is neither permitted nor prohibited.
301 <form method="post" action="/cgi-bin/koha/tags/review.pl">
302 <fieldset class="brief">
305 <li><label for="tag">Term</label> <input type="text" name="tag" id="tag" value="[% filter_tag %]" />
307 <li><label for="approved">Status</label> <select name="approved" id="approved">
308 <option [% IF ( filter_approved_all ) %]selected="selected" [% END %]value="all">all</option>
309 <option [% IF ( filter_approved_ok ) %]selected="selected" [% END %]value="1">approved</option>
310 <option [% IF ( filter_approved_pending ) %]selected="selected" [% END %]value="0">pending</option>
311 <option [% IF ( filter_approved_rej ) %]selected="selected" [% END %]value="-1">rejected</option>
314 <li><label for="approver">Reviewer</label> <input type="text" name="approver" id="approver" value="[% filter_approver %]" />
317 <label for="from">Date: from </label>
318 <input type="text" size="10" id="from" name="from" value="[% filter_date_approved_from %]" />
319 <img src="[% themelang %]/lib/calendar/cal.gif" border="0" alt="Show Calendar" style="cursor: pointer;" id="openCalendarFrom" />
320 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
322 <label for="to">...to </label>
323 <input type="text" size="10" id="to" name="to" value="[% filter_date_approved_to %]" />
324 <img src="[% themelang %]/lib/calendar/cal.gif" border="0" alt="Show Calendar" style="cursor: pointer;" id="openCalendarTo" />
325 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
328 <fieldset class="action"><input type="submit" value="Apply Filter(s)" /></fieldset>
331 <script type="text/javascript">
333 // function submit_check (from_id,to_id) {
334 // var dateFrom = Date_from_syspref(document.getElementById(from_id).value);
335 // var dateTo = Date_from_syspref(document.getElementById( to_id).value);
336 // var today = new Date();
337 // if (dateFrom < dateTo) {
338 // alert("The starting date cannot be after the ending date.");
339 // document.getElementById(to_id).select();
342 // if (dateFrom > today) {
343 // alert("The starting date cannot be in the future.");
344 // document.getElementById(from_id).select();
349 // return true if the date is blocked.
350 function disable_from(date) {var limit = get_Calendar_limit(date,'to' ); return (limit && limit < date);}
351 function disable_to (date) {var limit = get_Calendar_limit(date,'from'); return (limit && limit > date);}
355 ifFormat : "[% DHTMLcalendar_dateformat %]",
356 button : "openCalendarFrom",
357 disableFunc : disable_from,
358 dateStatusFunc : disable_from
362 ifFormat : "[% DHTMLcalendar_dateformat %]",
363 button : "openCalendarTo",
364 disableFunc : disable_to,
365 dateStatusFunc : disable_to
372 [% INCLUDE 'intranet-bottom.inc' %]