Main Koha release repository
https://koha-community.org
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
379 lines
14 KiB
379 lines
14 KiB
[% INCLUDE 'doc-head-open.inc' %]
|
|
<title>Home › Tools › Tags › [% IF ( do_it ) %]Review › [% ELSE %]Review Tags[% END %]</title>
|
|
[% INCLUDE 'doc-head-close.inc' %]
|
|
[% INCLUDE 'calendar.inc' %]
|
|
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
|
|
<style type="text/css">
|
|
.setlabel {width: 6em; font-family: courier; background-color:#E8E8E8;}
|
|
.red {color:darkred; background-color: pink;}
|
|
.green {color:darkgreen; background-color: #D1EFD5; text-align: center;}
|
|
.pending {background-color: lightyellow;}
|
|
td input,td input[type="submit"] { font-size: 85%; padding: 1px; }
|
|
</style>
|
|
<script type="text/javascript">
|
|
//<![CDATA[
|
|
// [% script_name %]
|
|
$.ajaxSetup({
|
|
url: "/cgi-bin/koha/tags/review.pl",
|
|
type: "POST",
|
|
dataType: "script"
|
|
});
|
|
var ok_count = 0;
|
|
var nok_count = 0;
|
|
var rej_count = 0;
|
|
var alerted = 0;
|
|
function pull_counts () {
|
|
ok_count = parseInt(document.getElementById("terms_summary_approved_count" ).innerHTML);
|
|
nok_count = parseInt(document.getElementById("terms_summary_unapproved_count").innerHTML);
|
|
rej_count = parseInt(document.getElementById("terms_summary_rejected_count" ).innerHTML);
|
|
}
|
|
function count_approve () {
|
|
pull_counts();
|
|
if (nok_count > 0) {
|
|
$("#terms_summary_unapproved_count").html(nok_count -1);
|
|
$("#terms_summary_approved_count" ).html( ok_count +1);
|
|
}
|
|
}
|
|
function count_reject () {
|
|
pull_counts();
|
|
if (nok_count > 0) {
|
|
$("#terms_summary_unapproved_count").html(nok_count -1);
|
|
$("#terms_summary_rejected_count" ).html(rej_count +1);
|
|
}
|
|
}
|
|
function warn_once (evt) {
|
|
if (alerted <= 1 && ($(evt.target).is('.ok') || $(evt.target).is('.rej'))) {
|
|
alerted += 1;
|
|
window.alert("this is: " + this + "is '.ok': " + $(evt.target).is('.ok') + " is '.rej': " + $(evt.target).is('.rej'));
|
|
}
|
|
}
|
|
var success_approve = function(tag){
|
|
// window.alert(_('AJAX approved tag: ') + tag);
|
|
};
|
|
var failure_approve = function(tag){
|
|
window.alert(_("AJAX failed to approve tag: ") + tag);
|
|
};
|
|
var success_reject = function(tag){
|
|
// window.alert(_('AJAX rejected tag: ') + tag);
|
|
};
|
|
var failure_reject = function(tag){
|
|
window.alert(_("AJAX failed to reject tag: ") + tag);
|
|
};
|
|
var success_test = function(tag){
|
|
$('#verdict').html(tag + _(" is permitted!"));
|
|
};
|
|
var failure_test = function(tag){
|
|
$('#verdict').html(tag + _(" is prohibited!"));
|
|
};
|
|
var indeterminate_test = function(tag){
|
|
$('#verdict').html(tag + _(" is neither permitted nor prohibited!"));
|
|
};
|
|
|
|
var success_test_call = function() {
|
|
$('#test_button').removeAttr("disabled");
|
|
$('#test_button').attr("value","test");
|
|
};
|
|
function readCookie(name) { // from http://www.quirksmode.org/js/cookies.html
|
|
var nameEQ = name + "=";
|
|
var ca = document.cookie.split(';');
|
|
for(var i=0;i < ca.length;i++) {
|
|
var c = ca[i];
|
|
while (c.charAt(0)==' '){ c = c.substring(1,c.length); }
|
|
if (c.indexOf(nameEQ) == 0){ return c.substring(nameEQ.length,c.length); }
|
|
}
|
|
return null;
|
|
}
|
|
$(document).ready(function() {
|
|
$('.ajax_buttons' ).css({visibility:"visible"});
|
|
$("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>");
|
|
$("#CheckAll").click(function(){
|
|
$(".checkboxed").checkCheckboxes();
|
|
return false;
|
|
});
|
|
$("#CheckNone").click(function(){
|
|
$(".checkboxed").unCheckCheckboxes();
|
|
return false;
|
|
});
|
|
$("#CheckPending").click(function(){
|
|
$(".checkboxed").checkCheckboxes(".pending");
|
|
return false;
|
|
});
|
|
$('body').click(function(event) {
|
|
pull_counts();
|
|
// window.alert(_("Click detected on ") + event.target + ": " + $(event.target).html);
|
|
if ($(event.target).is('.ok')) {
|
|
$.ajax({
|
|
"data": {ok: $(event.target).attr("title"), CGISESSID: readCookie('CGISESSID')},
|
|
"success": count_approve // success_approve
|
|
});
|
|
$(event.target).next(".rej").removeAttr("disabled").attr("value","Reject").css("color","#000");
|
|
$(event.target).attr( "value",_("Approved")).attr("disabled","disabled").css("color","#666");
|
|
return false; // cancel submit
|
|
}
|
|
if ($(event.target).is('.rej')) {
|
|
$.ajax({
|
|
"data": {rej: $(event.target).attr("title"), CGISESSID: readCookie('CGISESSID')},
|
|
"success": count_reject // success_reject
|
|
});
|
|
$(event.target).prev(".ok").removeAttr("disabled").attr("value","Approve").css("color","#000");
|
|
$(event.target).attr( "value",_("Rejected")).attr("disabled","disabled").css("color","#666");
|
|
return false; // cancel submit
|
|
}
|
|
if ($(event.target).is('#test_button')) {
|
|
$(event.target).attr( "value",_("Testing...")).attr("disabled","disabled");
|
|
$.ajax({
|
|
"data": {test: $('#test').attr("value")},
|
|
"success": success_test_call // success_reject
|
|
});
|
|
return false; // cancel submit
|
|
}
|
|
});
|
|
$("*").ajaxError(function(evt, request, settings){
|
|
if ((alerted +=1) <= 1){ window.alert(_("AJAX error")+" (" + alerted + " alert)"); }
|
|
});
|
|
});
|
|
//]]>
|
|
</script>
|
|
</head>
|
|
<body>
|
|
[% INCLUDE 'header.inc' %]
|
|
[% INCLUDE 'cat-search.inc' %]
|
|
|
|
<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>
|
|
|
|
<div id="doc3" class="yui-t2">
|
|
<div id="bd">
|
|
<div id="yui-main">
|
|
<div class="yui-b">
|
|
|
|
<div class="yui-ge">
|
|
<div class="yui-u first">
|
|
<h1>Tags</h1>
|
|
<form method="post" action="/cgi-bin/koha/tags/review.pl" class="checkboxed">
|
|
<h4>Displaying
|
|
[% IF ( filter_approved_all ) %]ALL[% END %]
|
|
[% IF ( filter_approved_ok ) %]Approved[% END %]
|
|
[% IF ( filter_approved_pending ) %]Pending[% END %]
|
|
[% IF ( filter_approved_rej ) %]Rejected[% END %]
|
|
Terms
|
|
</h4>
|
|
|
|
[% IF ( op_count ) %]
|
|
<div class="dialog message" id="main_status">
|
|
[% IF ( op == 'approve' ) %] Approved
|
|
[% ELSIF ( op == 'reject' ) %] Rejected
|
|
[% ELSIF ( op == 'test' ) %] Tested
|
|
[% ELSE %]Unknown Operation ([% op %]) on
|
|
[% END %]
|
|
[% op_count %] Term(s).
|
|
</div>
|
|
[% END %]
|
|
[% IF ( message_loop ) %]
|
|
<div class="dialog alert" id="main_error">
|
|
[% FOREACH message_loo IN message_loop %]
|
|
[% IF ( message_loo.date_from ) %]ERROR: <em>Date from</em> is not a legal value ("[% message_loo.date_from %]").
|
|
[% ELSIF ( message_loo.date_to ) %]ERROR: <em>Date to</em> is not a legal value ("[% message_loo.date_to %]").
|
|
[% ELSIF ( message_loo.failed_ok ) %]ERROR: Failed to approve term ([% message_loo.failed_ok %]).
|
|
[% ELSIF ( message_loo.failed_rej ) %]ERROR: Failed to reject term ([% message_loo.failed_rej %]).
|
|
[% ELSIF ( message_loo.approver ) %]ERROR: No match for user ([% message_loo.approver %]). FILTER REQUIRES BORROWERNUMBER (not name).
|
|
[% ELSIF ( message_loo.approved_by ) %]ERROR: No match for borrowernumber ([% message_loo.approved_by %]).
|
|
[% ELSIF ( message_loo.op_zero ) %]ERROR: The root koha user in your KOHA_CONF file
|
|
(default: kohaadmin) is not a valid tag moderator. These actions are logged
|
|
by borrowernumber, so the moderator must exist in your borrowers table.
|
|
Please login as a different authorized staff user to moderate tags.
|
|
[% ELSE %] Unrecognized error!
|
|
[% END %]
|
|
<br />
|
|
[% END %]
|
|
</div>
|
|
[% END %]
|
|
[% IF ( pagination_bar ) %]
|
|
<div class="pages" id="pagination_top">
|
|
[% pagination_bar %]
|
|
</div>
|
|
[% END %]
|
|
[% IF ( tagloop ) %]
|
|
<p class="check"></p>
|
|
<table>
|
|
<tr>
|
|
<th> </th>
|
|
<th> </th>
|
|
<th>Status</th>
|
|
<th>Term</th>
|
|
<th>Weight</th>
|
|
<th>Actions</th>
|
|
[% UNLESS ( filter_approved_pending ) %]<th>Reviewer</th>[% END %]
|
|
<th>Date</th>
|
|
</tr>
|
|
[% FOREACH tagloo IN tagloop %]
|
|
<tr>
|
|
<td class="count">[% offset + loop.count %]
|
|
</td>
|
|
[% IF ( approved == 0 ) %]<td><span><input type="checkbox" value="[% tagloo.term %]" name="tags" class="pending" /></span>
|
|
[% ELSE %]<td><span><input type="checkbox" value="[% tagloo.term %]" name="tags" /></span>[% END %]
|
|
</td>
|
|
[% IF ( tagloo.approved == -1 ) %]<td class="red">rejected
|
|
[% ELSIF ( tagloo.approved == 1 ) %]<td class="green"><img alt="OK" src="/intranet-tmpl/prog/img/approve.gif" />
|
|
[% ELSE %]<td class="pending">
|
|
[% END %]
|
|
</td>
|
|
<td><a href="/cgi-bin/koha/tags/list.pl?tag=[% tagloo.term %]">[% tagloo.term %]</a>
|
|
</td>
|
|
<td>[% tagloo.weight_total %]
|
|
</td>
|
|
[% IF ( tagloo.approved ) %]
|
|
<td><span class="ajax_buttons" style="visibility:hidden">
|
|
[% IF ( approved == -1 ) %]
|
|
<input class="ok" type="submit" title="[% tagloo.term %]" value="Approve" name="approve" />
|
|
<input class="rej" disabled="disabled" type="submit" title="[% tagloo.term %]" value="Rejected" name="reject" />
|
|
[% ELSE %]
|
|
<input class="ok" disabled="disabled" type="submit" title="[% tagloo.term %]" value="Approved" name="approve" />
|
|
<input class="rej" type="submit" title="[% tagloo.term %]" value="Reject" name="reject" />
|
|
[% END %]
|
|
</span>
|
|
</td>
|
|
<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 %]
|
|
</td>
|
|
[% ELSE %]
|
|
<td><span class="ajax_buttons" style="visibility:hidden">
|
|
<input class="ok" type="submit" title="[% tagloo.term %]" value="Approve" name="approve" />
|
|
<input class="rej" type="submit" title="[% tagloo.term %]" value="Reject" name="reject" />
|
|
</span>
|
|
</td>
|
|
[% UNLESS ( filter_approved_pending ) %]<td> </td>[% END %]
|
|
[% END %]
|
|
<td>[% tagloo.date_approved %]
|
|
</td>
|
|
</tr>
|
|
[% END %]
|
|
</table>
|
|
[% END %]
|
|
[% IF ( tagloop ) %]<fieldset class="action">
|
|
<input type="submit" value="Approve" id="approve_button" name="op" />
|
|
<input type="submit" value="Reject" id="reject_button" name="op" />
|
|
</fieldset>[% END %]
|
|
</form>
|
|
</div>
|
|
<div class="yui-u">
|
|
<fieldset class="brief">
|
|
<h4>Terms Summary</h4>
|
|
<ul>
|
|
<li><a href="/cgi-bin/koha/tags/review.pl?approved=1">Approved</a>:
|
|
<span id="terms_summary_approved_count">[% approved_count %]</span>
|
|
</li>
|
|
<li><a href="/cgi-bin/koha/tags/review.pl?approved=-1">Rejected</a>:
|
|
<span id="terms_summary_rejected_count">[% rejected_count %]</span>
|
|
</li>
|
|
<li><a href="/cgi-bin/koha/tags/review.pl?approved=0">Pending</a>:
|
|
<span id="terms_summary_unapproved_count">[% unapproved_count %]</span>
|
|
</li>
|
|
<li><a href="/cgi-bin/koha/tags/review.pl?approved=all">Total</a>:
|
|
<span id="terms_summary_approved_total">[% approved_total %]</span>
|
|
</li>
|
|
</ul>
|
|
<span id="terms_summary_status"> </span>
|
|
</fieldset>
|
|
<fieldset class="brief">
|
|
<h4>Check lists</h4>
|
|
<div class="description">Enter a word or phrase to check against approved/rejected lists: </div>
|
|
<form method="post" action="/cgi-bin/koha/tags/review.pl">
|
|
<input type="text" size="14" name="test" id="test" />
|
|
<fieldset class="action"><input type="submit" value="Test" id="test_button" name="op" /></fieldset>
|
|
<div id="verdict">
|
|
[% IF ( test_term ) %]
|
|
[% IF ( verdict_ok ) %]
|
|
"[% test_term %]" is permitted.
|
|
[% ELSIF ( verdict_rej ) %]
|
|
"[% test_term %]" is prohibited.
|
|
[% ELSIF ( verdict_indeterminate ) %]
|
|
"[% test_term %]" is neither permitted nor prohibited.
|
|
[% END %]
|
|
[% END %]
|
|
</div>
|
|
</form>
|
|
</fieldset>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="yui-b">
|
|
<form method="post" action="/cgi-bin/koha/tags/review.pl">
|
|
<fieldset class="brief">
|
|
<h4>Filters</h4>
|
|
<ol>
|
|
<li><label for="tag">Term</label> <input type="text" name="tag" id="tag" value="[% filter_tag %]" />
|
|
</li>
|
|
<li><label for="approved">Status</label>
|
|
<select name="approved" id="approved">
|
|
[% IF ( filter_approved_all ) %]<option selected="selected" value="all">all</option>
|
|
[% ELSE %]<option value="all">all</option>[% END %]
|
|
[% IF ( filter_approved_ok ) %]<option selected="selected" value="1">approved</option>
|
|
[% ELSE %]<option value="1">approved</option>[% END %]
|
|
[% IF ( filter_approved_pending ) %]<option selected="selected" value="0">pending</option>
|
|
[% ELSE %]<option value="0">pending</option>[% END %]
|
|
[% IF ( filter_approved_rej ) %]<option selected="selected" value="-1">rejected</option>
|
|
[% ELSE %]<option value="-1">rejected</option>[% END %]
|
|
</select>
|
|
</li>
|
|
<li><label for="approver">Reviewer</label> <input type="text" name="approver" id="approver" value="[% filter_approver %]" />
|
|
</li>
|
|
<li>
|
|
<label for="from">Date: from </label>
|
|
<input type="text" size="10" id="from" name="from" value="[% filter_date_approved_from %]" />
|
|
<img src="[% themelang %]/lib/calendar/cal.gif" border="0" alt="Show Calendar" style="cursor: pointer;" id="openCalendarFrom" />
|
|
<div class="hint">[% INCLUDE 'date-format.inc' %]</div>
|
|
|
|
<label for="to">...to </label>
|
|
<input type="text" size="10" id="to" name="to" value="[% filter_date_approved_to %]" />
|
|
<img src="[% themelang %]/lib/calendar/cal.gif" border="0" alt="Show Calendar" style="cursor: pointer;" id="openCalendarTo" />
|
|
<div class="hint">[% INCLUDE 'date-format.inc' %]</div>
|
|
</li>
|
|
</ol>
|
|
<fieldset class="action"><input type="submit" value="Apply Filter(s)" /></fieldset>
|
|
</fieldset>
|
|
</form>
|
|
<script type="text/javascript">
|
|
//<![CDATA[
|
|
// function submit_check (from_id,to_id) {
|
|
// var dateFrom = Date_from_syspref(document.getElementById(from_id).value);
|
|
// var dateTo = Date_from_syspref(document.getElementById( to_id).value);
|
|
// var today = new Date();
|
|
// if (dateFrom < dateTo) {
|
|
// alert("The starting date cannot be after the ending date.");
|
|
// document.getElementById(to_id).select();
|
|
// return false;
|
|
// }
|
|
// if (dateFrom > today) {
|
|
// alert("The starting date cannot be in the future.");
|
|
// document.getElementById(from_id).select();
|
|
// return false;
|
|
// }
|
|
// }
|
|
|
|
// return true if the date is blocked.
|
|
function disable_from(date) {var limit = get_Calendar_limit(date,'to' ); return (limit && limit < date);}
|
|
function disable_to (date) {var limit = get_Calendar_limit(date,'from'); return (limit && limit > date);}
|
|
|
|
Calendar.setup({
|
|
inputField : "from",
|
|
ifFormat : "[% DHTMLcalendar_dateformat %]",
|
|
button : "openCalendarFrom",
|
|
disableFunc : disable_from,
|
|
dateStatusFunc : disable_from
|
|
});
|
|
Calendar.setup({
|
|
inputField : "to",
|
|
ifFormat : "[% DHTMLcalendar_dateformat %]",
|
|
button : "openCalendarTo",
|
|
disableFunc : disable_to,
|
|
dateStatusFunc : disable_to
|
|
});
|
|
//]]>
|
|
</script>
|
|
|
|
</div>
|
|
</div>
|
|
[% INCLUDE 'intranet-bottom.inc' %]
|
|
|
|
|