Koha/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/acceptorreject.tmpl
Joe Atzberger 4a1333c544 Factor common element out of both sides of conditional.
Add placeholder complaint about misuse of TMPL EXPR statements.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
2009-04-08 12:30:33 -05:00

245 lines
12 KiB
Cheetah

<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
<title>Koha &rsaquo; Acquisitions &rsaquo; Suggestions Management</title>
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
<script type="text/JavaScript">
// <![CDATA[
$.tablesorter.addParser({
id: 'articles',
is: function(s) {return false; },
format: function(s) { return s.toLowerCase().replace(/^(the|an|a) /,''); },
type: 'text'
});
/**
* displayOther.
* This function display the select or an textaera to write a reason.
*/
function displayOther(id,show,hide) {$("#"+hide+id).hide(); $("#"+show+id).show(); }
$(document).ready(function() {
$('#suggestiontabs > ul').tabs({
select: function(ui) {
$("#loadingtab").show();
},
show: function(ui) {
$("#loadingtab").hide();
}
});
$.tablesorter.defaults.widgets = ['zebra'];
$("#acceptedt").tablesorter({<!-- TMPL_IF EXPR="dateformat eq 'metric'" -->
dateFormat: 'uk',<!-- /TMPL_IF -->
headers: { 0: { sorter: 'articles' },3:{sorter: false},4:{sorter: false},5:{sorter: false},6:{sorter: false},7:{sorter: false}}
});
$("#acceptedt").bind("sortStart",function() {
$("#sorting").show();
}).bind("sortEnd",function() {
$("#sorting").hide();
});
$("#pendingt").tablesorter({<!-- TMPL_IF EXPR="dateformat eq 'metric'" -->
dateFormat: 'uk',<!-- /TMPL_IF -->
headers: { 0: { sorter: 'articles' },3:{sorter: false},4:{sorter: false},5:{sorter: false},6:{sorter: false},7:{sorter: false}}
});
$("#pendingt").bind("sortStart",function() {
$("#sorting").show();
}).bind("sortEnd",function() {
$("#sorting").hide();
});
$("#rejectedt").tablesorter({<!-- TMPL_IF EXPR="dateformat eq 'metric'" -->
dateFormat: 'uk',<!-- /TMPL_IF -->
headers: { 0: { sorter: 'articles' },3:{sorter: false},4:{sorter: false},5:{sorter: false},6:{sorter: false},7:{sorter: false}}
});
$("#rejectedt").bind("sortStart",function() {
$("#sorting").show();
}).bind("sortEnd",function() {
$("#sorting").hide();
});
$("div[id*=other-reason]").hide();
$("input[name*=other-reason]").focus(function(){ $(this).val(""); });
$("select[name*=reason]").change(function(){
if($(this).children("[@selected]").val() == "other"){
displayOther($(this).attr("name").replace(/reason/,""),"other-reason","select-reason");
}
});
$("a[href*=back]").click(function(){
var sid = $(this).attr("href").replace(/#back/,"");
displayOther(sid,"select-reason","other-reason");
$("#reason"+sid).find("option[value='']").attr("selected","selected");
});
$("a[href=#markall]").click(function(){
if($(this).attr("id").indexOf("markallop") > -1){
// select each identical option, clear each input
var selectedOp = $(this).prev().find("option:selected").val();
var container = $(this).attr("id").replace(/markallop/,"");
$("#"+container+" div[id*=other-reason]").hide();
$("#"+container+" div[id*=select-reason]").show();
$("#"+container+" select[name*=reason]").not("select[name*=all]").children().each(function(){
if($(this).val() == selectedOp){ $(this).attr("selected","selected"); }
});
} else {
// set each input value, deselect options
var inputText = $(this).prev().val();
var container = $(this).attr("id").replace(/markalltext/,"");
// hide all selects
$("#"+container+" input[name*=other-reason]").not("input[name*=all]").each(function(){
// show all text inputs and populate
$(this).val(inputText).parent("div").show();
$("div[class=select"+container+"]").hide();
});
}
});
});
// ]]>
</script>
<style type="text/css">
.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; }
</style>
</head>
<body>
<!-- TMPL_INCLUDE NAME="header.inc" -->
<!-- TMPL_INCLUDE NAME="cat-search.inc" -->
<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>
<div id="doc" class="yui-t7">
<div id="bd">
<div id="yui-main">
<div class="yui-b">
<h1>Suggestions</h1>
<div id="sorting" class="overlay">Sorting...</div>
<div id="loadingtab" class="overlay">Loading tab...</div>
<div id="suggestiontabs" class="toptabs">
<ul class="ui-tabs-nav">
<li><a href="/cgi-bin/koha/suggestion/acceptorreject.pl#accepted">Accepted</a></li>
<li class="ui-tabs-selected"><a href="/cgi-bin/koha/suggestion/acceptorreject.pl#pending">Pending</a></li>
<li><a href="/cgi-bin/koha/suggestion/acceptorreject.pl#rejected">Rejected</a></li>
</ul>
<!--TMPL_LOOP Name="suggestions"-->
<div id="<!--TMPL_VAR Name="suggestiontype"-->">
<form name="f<!--TMPL_VAR Name="suggestiontype"-->" method="post" action="/cgi-bin/koha/suggestion/acceptorreject.pl#<!--TMPL_VAR Name="suggestiontype"-->">
<input type="hidden" name="op" value="aorr_confirm" />
<input type="hidden" name="suggestiontype" value="<!--TMPL_VAR Name="suggestiontype"-->" />
<!-- TMPL_IF NAME="suggestions_loop" -->
<!--TMPL_IF EXPR="suggestiontype eq 'accepted'"-->
<table id="acceptedt">
<!-- TMPL_ELSIF EXPR="suggestiontype eq 'pending'" -->
<table id="pendingt">
<!-- TMPL_ELSE -->
<table id="rejectedt">
<!-- /TMPL_IF -->
<thead><tr>
<th>Suggestion</th>
<th>Suggested by</th>
<th>Date</th>
<th>Reason</th>
<!--TMPL_IF EXPR="suggestiontype ne 'pending'"-->
<th>Reason Update</th>
<!--/TMPL_IF -->
<th>Accept</th>
<th>Reject</th>
<th>Delete</th>
</tr></thead>
<tbody><!-- TMPL_LOOP NAME="suggestions_loop" -->
<!-- TMPL_IF name="even" --><tr class="highlight"><!-- TMPL_ELSE --><tr><!-- /TMPL_IF -->
<td>
<!-- TMPL_VAR NAME="title" escape="html" --><!-- TMPL_IF NAME="author" -->, by <!-- TMPL_VAR NAME="author" --><!-- /TMPL_IF --><br />
<!-- TMPL_IF name="copyrightdate" -->&copy; <!-- TMPL_VAR name="copyrightdate" --> <!-- /TMPL_IF -->
<!-- TMPL_IF name="volumedesc" -->; Volume:<i><!-- TMPL_VAR name="volumedesc" --></i> <!-- /TMPL_IF -->
<!-- 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 -->
</td>
<td>
<!-- TMPL_VAR name="surnamesuggestedby" -->
<!-- TMPL_IF name="firstnamesuggestedby" -->,<!-- /TMPL_IF -->
<!-- TMPL_VAR name="firstnamesuggestedby" -->
(<!-- TMPL_VAR name="branchcode" -->)
</td>
<td>
<!-- TMPL_VAR name="date" -->
</td>
<!--TMPL_IF EXPR="suggestiontype ne 'pending'"-->
<td>
<!--TMPL_VAR Name="reason"-->
<input type="hidden" name="initial-reason<!-- TMPL_VAR name="suggestionid" -->" value="<!--TMPL_VAR Name="reason" ESCAPE="HTML"-->" />
</td>
<!--/TMPL_IF -->
<td>
<div id="select-reason<!-- TMPL_VAR NAME="suggestionid" -->" class="select<!-- TMPL_VAR NAME="suggestiontype" -->">
<!-- TMPL_IF NAME="reasonsloop" --><select id="reason<!-- TMPL_VAR NAME="suggestionid" -->" name="reason<!-- TMPL_VAR NAME="suggestionid" -->">
<option value=""> -- Choose a reason -- </option>
<!-- TMPL_LOOP NAME="reasonsloop" -->
<option value="<!-- TMPL_VAR NAME="lib" -->"><!-- TMPL_VAR NAME="lib" --></option>
<!-- /TMPL_LOOP -->
<option value="other">Others...</option>
</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 -->
</div>
<div id="other-reason<!-- TMPL_VAR NAME="suggestionid" -->">
<input type="text" size="31" name="other-reason<!-- TMPL_VAR name="suggestionid" -->" value="please note your reason here..." />
<p><a href="#back<!-- TMPL_VAR NAME="suggestionid" -->">back to list</a></p>
</div>
</td>
<td>
<!-- These EXPR are NOT doing what the author thinks they are -->
<!--TMPL_IF EXPR="suggestiontype eq 'accepted'"-->
<input id="a<!--TMPL_VAR name="suggestionid" -->" name="<!--TMPL_VAR name="suggestionid" -->" type="radio" value="ACCEPTED" readonly="readonly" checked="checked" />
<!--TMPL_ELSE-->
<input id="a<!--TMPL_VAR name="suggestionid" -->" name="<!--TMPL_VAR name="suggestionid" -->" type="radio" value="ACCEPTED" />
<!--/TMPL_IF-->
</td>
<td>
<!--TMPL_IF EXPR="suggestiontype eq 'rejected'"-->
<input id="r<!--TMPL_VAR name="suggestionid" -->" name="<!--TMPL_VAR name="suggestionid" -->" type="radio" value="REJECTED" readonly="readonly" checked="checked" />
<!--TMPL_ELSE-->
<input id="r<!--TMPL_VAR name="suggestionid" -->" name="<!--TMPL_VAR name="suggestionid" -->" type="radio" value="REJECTED" />
<!--/TMPL_IF-->
</td>
<td>
<input id="d<!--TMPL_VAR name="suggestionid" -->" name="<!--TMPL_VAR name="suggestionid" -->" type="radio" value="delete" />
</td>
</tr>
<!-- /TMPL_LOOP --></tbody>
</table> <fieldset>
<div id="select-reason<!-- TMPL_VAR NAME="suggestiontype" -->all">
<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">
<option value=""> -- Choose a reason -- </option>
<!--TMPL_LOOP Name="reasonsloop"-->
<option value="<!--TMPL_VAR Name="lib" -->"><!--TMPL_VAR Name="lib" --></option>
<!--/TMPL_LOOP-->
<option value="other">Others...</option>
</select> <a href="#markall" id="markallop<!-- TMPL_VAR NAME="suggestiontype" -->">Mark all with this reason</a>
</div>
<div id="other-reason<!-- TMPL_VAR NAME="suggestiontype" -->all">
<label for="other-reason<!-- TMPL_VAR NAME="suggestiontype" -->all">Enter a reason for all marked entries:</label>
<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>
</div>
</fieldset>
<fieldset class="action"><input type="submit" value="Change Status" /></fieldset>
</form>
<!-- TMPL_ELSE -->
<!--TMPL_IF EXPR="suggestiontype eq 'pending'"-->
<b>No pending suggestions.</b>
<!--/TMPL_IF-->
<!--TMPL_IF EXPR="suggestiontype eq 'accepted'"-->
<b>No accepted suggestions.</b>
<!--/TMPL_IF-->
<!--TMPL_IF EXPR="suggestiontype eq 'rejected'"-->
<b>No rejected suggestions.</b>
<!--/TMPL_IF-->
</form>
<!-- /TMPL_IF -->
</div>
<!--/TMPL_LOOP-->
</div>
</div></div>
</div>
<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->