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.
 
 
 
 
 
 

243 lines
12 KiB

[% USE raw %]
[% USE Asset %]
[% USE KohaDates %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Tools &rsaquo; Tags &rsaquo; [% IF ( do_it ) %]Review &rsaquo; [% ELSE %]Review tags[% END %]</title>
[% INCLUDE 'doc-head-close.inc' %]
<style>
.setlabel {width: 6em; font-family: courier; background-color:#E8E8E8;}
.rejected { color: #CC0033; }
.approved { color: #339900; }
.pending { color: #CCC; font-style: italic; }
tr > td input,td input[type="submit"] { font-size: 85%; padding: 1px; }
</style>
</head>
<body id="tags_review" class="tools">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo; Tags</div>
<div class="main container-fluid">
<div class="row">
<div class="col-sm-12">
<main>
<div class="row">
<div class="col-sm-8 col-sm-push-2">
<h1>Tags</h1>
<form method="post" action="/cgi-bin/koha/tags/review.pl">
<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 | html %]) on
[% END %]
[% op_count | html %] 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 ) %]<strong>Error: </strong>"Date from" is not a legal value ("[% message_loo.date_from | html %]").
[% ELSIF ( message_loo.date_to ) %]<strong>Error: </strong>"Date to" is not a legal value ("[% message_loo.date_to | html %]").
[% ELSIF ( message_loo.failed_ok ) %]<strong>Error: </strong>Failed to approve term ([% message_loo.failed_ok | html %]).
[% ELSIF ( message_loo.failed_rej ) %]<strong>Error: </strong>Failed to reject term ([% message_loo.failed_rej | html %]).
[% ELSIF ( message_loo.approver ) %]No match for user ([% message_loo.approver | html %]). FILTER REQUIRES BORROWERNUMBER (not name).
[% ELSIF ( message_loo.approved_by ) %]<strong>Error: </strong>No match for borrowernumber ([% message_loo.approved_by | html %]).
[% ELSIF ( message_loo.op_zero ) %]<strong>Error: </strong> 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 log in 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 | $raw %]
</div>
[% END %]
[% IF ( tagloop ) %]
<p class="check"></p>
<table id="tagst">
<thead>
<tr>
<th class="NoSort">&nbsp;</th>
<th>Status</th>
<th>Term</th>
<th>Weight</th>
<th class="NoSort noExport">Actions</th>
[% UNLESS ( filter_approved_pending ) %]<th>Reviewer</th>[% END %]
<th class="title-string">Date</th>
</tr>
</thead>
<tbody>
[% FOREACH tagloo IN tagloop %]
<tr>
<td>
[% IF ( tagloo.approved == 0 ) %]
<input id="checkbox[% offset + loop.count | html %]" type="checkbox" value="[% tagloo.term | html %]" name="tags" class="pending" />
[% ELSIF ( tagloo.approved == 1 ) %]
<input id="checkbox[% offset + loop.count | html %]" type="checkbox" value="[% tagloo.term | html %]" name="tags" class="approved" />
[% ELSE %]
<input id="checkbox[% offset + loop.count | html %]" type="checkbox" value="[% tagloo.term | html %]" name="tags" class="rejected" />
[% END %]
</td>
<td>
[% IF ( tagloo.approved == -1 ) %]
<label for="checkbox[% offset + loop.count | html %]">
<span class="rejected status[% offset + loop.count | html %]">Rejected</span>
</label>
[% ELSIF ( tagloo.approved == 1 ) %]
<label for="checkbox[% offset + loop.count | html %]">
<span class="approved status[% offset + loop.count | html %]">Approved</span>
</label>
[% ELSE %]
<label for="checkbox[% offset + loop.count | html %]">
<span class="pending status[% offset + loop.count | html %]">Pending</span>
</label>
[% END %]
</td>
<td><a href="/cgi-bin/koha/tags/list.pl?tag=[% tagloo.term|uri %]">[% tagloo.term | html %]</a>
</td>
<td>[% tagloo.weight_total | html %]
</td>
[% IF ( tagloo.approved ) %]
<td class="actions"><span class="ajax_buttons" style="visibility:hidden">
[% IF ( tagloo.approved == -1 ) %]
<button data-num="[% offset + loop.count | html %]" class="approval_btn ok btn btn-default btn-xs" type="submit" title="[% tagloo.term | html %]" value="Approve" name="approve"><i class="fa fa-check"></i> Approve</button>
<button data-num="[% offset + loop.count | html %]" class="approval_btn rej btn btn-default btn-xs" disabled="disabled" type="submit" title="[% tagloo.term | html %]" value="Rejected" name="reject"><i class="fa fa-remove"></i> Rejected</button>
[% ELSE %]
<button data-num="[% offset + loop.count | html %]" class="approval_btn ok btn btn-default btn-xs" disabled="disabled" type="submit" title="[% tagloo.term | html %]" value="Approved" name="approve"><i class="fa fa-check"></i> Approved</button>
<button data-num="[% offset + loop.count | html %]" class="approval_btn rej btn btn-default btn-xs" type="submit" title="[% tagloo.term | html %]" value="Reject" name="reject"><i class="fa fa-remove"></i> Reject</button>
[% END %]
</span>
</td>
<td>[% IF ( tagloo.approved_by_name ) %]<a href="/cgi-bin/koha/tags/review.pl?approved_by=[% tagloo.approved_by | uri %]&amp;approved=all">[% tagloo.approved_by_name | html %]</a>[% ELSE %]&nbsp;[% END %]
</td>
[% ELSE %]
<td class="actions"><span class="ajax_buttons" style="visibility:hidden">
<button data-num="[% offset + loop.count | html %]" class="approval_btn ok btn btn-default btn-xs" type="submit" title="[% tagloo.term | html %]" value="Approve" name="approve"><i class="fa fa-check"></i> Approve</button>
<button data-num="[% offset + loop.count | html %]" class="approval_btn rej btn btn-default btn-xs" type="submit" title="[% tagloo.term | html %]" value="Reject" name="reject"><i class="fa fa-remove"></i> Reject</button>
</span>
</td>
[% UNLESS ( filter_approved_pending ) %]<td>&nbsp;</td>[% END %]
[% END %]
<td>
<span title="[% tagloo.date_approved | html %]">[% tagloo.date_approved | $KohaDates %]</span>
</td>
</tr>
[% END %]
</tbody>
</table>
[% END %]
[% IF ( tagloop ) %]<fieldset class="action">
<button type="submit" value="Approve" class="btn btn-default" id="approve_button" name="op-approve"><i class="fa fa-check"></i> Approve</button>
<button type="submit" value="Reject" class="btn btn-default" id="reject_button" name="op-reject"><i class="fa fa-remove"></i> Reject</button>
</fieldset>[% END %]
</form>
</div>
<div class="col-sm-2 col-sm-push-2">
<aside>
<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 | html %]</span>
</li>
<li><a href="/cgi-bin/koha/tags/review.pl?approved=-1">Rejected</a>:
<span id="terms_summary_rejected_count">[% rejected_count | html %]</span>
</li>
<li><a href="/cgi-bin/koha/tags/review.pl?approved=0">Pending</a>:
<span id="terms_summary_unapproved_count">[% unapproved_count | html %]</span>
</li>
<li><a href="/cgi-bin/koha/tags/review.pl?approved=all">Total</a>:
<span id="terms_summary_approved_total">[% approved_total | html %]</span>
</li>
</ul>
<span id="terms_summary_status">&nbsp;</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"><button type="submit" value="Test" class="approval_btn btn btn-default btn-sm" id="test_button" name="op-test"><i class="fa fa-check-square-o" aria-hidden="true"></i> Test</button></fieldset>
<div id="verdict">
[% IF ( test_term ) %]
[% IF ( verdict_ok ) %]
&quot;[% test_term | html %]&quot; is permitted.
[% ELSIF ( verdict_rej ) %]
&quot;[% test_term | html %]&quot; is prohibited.
[% ELSIF ( verdict_indeterminate ) %]
&quot;[% test_term | html %]&quot; is neither permitted nor prohibited.
[% END %]
[% END %]
</div>
</form>
</fieldset>
</aside>
</div>
<div class="col-sm-2 col-sm-pull-10">
<aside>
<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 | html %]" />
</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 | html %]" />
</li>
<li>
<label for="from">Date: from </label>
<input type="text" size="10" id="from" name="from" value="[% filter_date_approved_from | html %]" class="datepickerfrom" />
<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 | html %]" class="datepickerto" />
<div class="hint">[% INCLUDE 'date-format.inc' %]</div>
</li>
</ol>
<fieldset class="action"><button type="submit" class="btn btn-default btn-sm"><i class="fa fa-filter" aria-hidden="true"></i> Apply filter(s)</button></fieldset>
</fieldset>
</form>
</aside>
</div>
</div>
</main>
</div>
</div>
[% MACRO jsinclude BLOCK %]
[% INCLUDE 'datatables.inc' %]
[% INCLUDE 'calendar.inc' %]
[% Asset.js("js/pages/tags-review.js") | $raw %]
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]