</title>
[% INCLUDE 'doc-head-close.inc' %]
[% INCLUDE 'calendar.inc' %]
-[% IF ( op_else ) %] <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
+[% IF ( op_else ) %]
+<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
+<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
+[% INCLUDE 'datatables-strings.inc' %]
+<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
<script type="text/javascript">
// <![CDATA[
-
- function yuiToolbar() {
- new YAHOO.widget.Button("newsuggestion");
- }
-$.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.
$("#"+show+id).show();
}
$(document).ready(function() {
- yuiToolbar();
$('#suggestiontabs').tabs({
- select: function(ui) {
- $("#loadingtab").show();
- },
- show: function(ui) {
- $("#loadingtab").hide();
+ // Correct table sizing for tables hidden in tabs
+ // http://www.datatables.net/examples/api/tabs_and_scrolling.html
+ "show": function(event, ui) {
+ var oTable = $('div.dataTables_wrapper>table', ui.panel).dataTable();
+ if ( oTable.length > 0 ) {
+ oTable.fnAdjustColumnSizing();
+ }
}
- });
- $.tablesorter.defaults.widgets = ['zebra'];
-
+ });
+ $(".sorted").dataTable($.extend(true, {}, dataTablesDefaults, {
+ "aoColumnDefs": [
+ { "aTargets": [ 0, -1, -2 ], "bSortable": false, "bSearchable": false },
+ ],
+ "aLengthMenu": [[10, 20, 50, 100, -1], [10, 20, 50, 100, "All"]],
+ "iDisplayLength": 20,
+ "sPaginationType": "four_button"
+ }));
[% FOREACH suggestion IN suggestions %]
// functions for [% suggestion.suggestiontype %] interactions
- $("#[% suggestion.suggestiontype %]t").tablesorter({[% IF ( dateformat == 'metric' ) %]
- dateFormat: 'uk',[% END %]
- headers: {0:{sorter: false}, 1: { sorter: 'articles' },5:{sorter: false},6:{sorter: false},7:{sorter: false}, 8:{sorter: false},9:{sorter: false},10:{sorter: false}}
- });
- $("#CheckAll[% suggestion.suggestiontype %]").click(function(){
+ $("#CheckAll[% suggestion.suggestiontype %]").click(function(e){
$("#[% suggestion.suggestiontype %]t").checkCheckboxes();
+ e.preventDefault();
});
- $("#UncheckAll[% suggestion.suggestiontype %]").click(function(){
+ $("#UncheckAll[% suggestion.suggestiontype %]").click(function(e){
$("#[% suggestion.suggestiontype %]t").unCheckCheckboxes();
+ e.preventDefault();
});
$("#other_reason[% suggestion.suggestiontype %]").hide();
$("input[name*=other_reason[% suggestion.suggestiontype %]]").focus(function(){ $(this).val(""); });
$("#reason"+sid).show().find("option[value='']").attr("selected","selected");
$("#other_reason"+sid).hide();
});
- $("h4.collapse a").click(function(){
- $(this).parent().parent().find("ol").toggle();
+ $("h4.local_collapse a").click(function(){
+ $(this).parent().parent().find("ol").toggle();
+ return false;
});
// http://jqueryui.com/demos/datepicker/#date-range
var dates = $( "#suggesteddate_from, #suggesteddate_to" ).datepicker({
// ]]>
</script>
<style type="text/css">
-h4.collapse a { font-size : 80%; text-decoration: none; } fieldset.brief ol { display : none; }
+h4.local_collapse a { font-size : 80%; text-decoration: none; } fieldset.brief ol { display : none; }
.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; } .note { -moz-border-radius: 3px; border-radius:3px; background: transparent url("/intranet-tmpl/prog/img/famfamfam/silk/comment.png") top left no-repeat; padding : 1px 3px 1px 18px; font-size : 90%; }
</style>[% ELSE %]
<script type="text/javascript">
<fieldset class="rows"> <legend>Acquisition information</legend><ol>
<li><label for="branchcode">Library:</label>
<select name="branchcode" id="branchcode">
- <option value="">Any</option>[% FOREACH branchloo IN branchloop %]
+ <option value="__ANY__">Any</option>[% FOREACH branchloo IN branchloop %]
[% IF ( branchloo.selected ) %]<option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>[% ELSE %]<option value="[% branchloo.value %]">[% branchloo.branchname %]</option>[% END %][% END %]
</select>
</li>
[% END %]
[% IF ( op_else ) %]
- <div id="toolbar">
- <ul class="toolbar">
- <li> <a id="newsuggestion" href="suggestion.pl?op=add">New purchase suggestion</a></li>
- </ul></div>
+<div id="toolbar" class="btn-toolbar">
+ <a class="btn btn-small" id="newsuggestion" href="suggestion.pl?op=add"><i class="icon-plus"></i> New purchase suggestion</a>
+</div>
<h1>Suggestions management</h1>
[% UNLESS ( notabs ) %]
-<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">
[% FOREACH suggestion IN suggestions %]
[% IF ( suggestion.suggestions_loop ) %]
<p><a id="CheckAll[% suggestion.suggestiontype %]" href="#">Check all</a> | <a id="UncheckAll[% suggestion.suggestiontype %]" href="#">Uncheck all</a></p>
- <table id="[% suggestion.suggestiontype %]t">
+ <table id="[% suggestion.suggestiontype %]t" class="sorted">
<thead>
<tr><th> </th>
<th>Suggestion</th>
- <th>Suggested by /on</th>
- <th>Managed by /on</th>
+ <th>Suggested by - on</th>
+ <th>Managed by - on</th>
<th>Library</th>
<th>Budget</th>
<th>Status</th></tr>
</td>
<td>
[% IF ( suggestions_loo.emailsuggestedby ) %]<a href="mailto:[% suggestions_loo.emailsuggestedby %]">[% END %][% suggestions_loo.surnamesuggestedby %][% IF ( suggestions_loo.firstnamesuggestedby ) %], [% suggestions_loo.firstnamesuggestedby %][% END %] [% IF ( suggestions_loo.emailsuggestedby ) %]</a>[% END %]
- [% IF ( suggestions_loo.suggesteddate ) %] / [% suggestions_loo.suggesteddate %][% END %]
+ [% IF ( suggestions_loo.suggesteddate ) %] - [% suggestions_loo.suggesteddate %][% END %]
</td>
<td>
[% IF ( suggestions_loo.emailmanagedby ) %]<a href="mailto:[% suggestions_loo.emailmanagedby %]">[% END %][% suggestions_loo.surnamemanagedby %][% IF ( suggestions_loo.firstnamemanagedby ) %], [% suggestions_loo.firstnamemanagedby %][% END %] [% IF ( suggestions_loo.emailmanagedby ) %]</a>[% END %]
- [% IF ( suggestions_loo.manageddate ) %], [% suggestions_loo.manageddate %][% END %]
+ [% IF ( suggestions_loo.manageddate ) %] - [% suggestions_loo.manageddate %][% END %]
</td>
<td>
[% suggestions_loo.branchcode %]
<h4>Filter by: <a style="font-size:80%;font-weight:normal;" href="/cgi-bin/koha/suggestion/suggestion.pl">[clear]</a></h4>
<div style="display:block;" id="limits">
- <fieldset class="brief"><h4 class="collapse"><a href="#">Bibliographic information</a></h4>
+ <fieldset class="brief"><h4 class="local_collapse"><a href="#">Bibliographic information</a></h4>
<ol> <li><label for="title"> Title:</label><input type="text" id="title" name="title" value="[% title |html %]" /></li>
<li><label for="author"> Author:</label><input type="text" id="author" name="author" value="[% author %]" /></li>
<li><label for="isbn"> ISBN:</label><input type="text" id="isbn" name="isbn" value="[% isbn %]" /></li>
<li><label for="publishercode"> Publisher:</label><input type="text" id="publishercode" name="publishercode" value="[% publishercode %]" /></li>
- <li><label for="publicationyear"> Publication year:</label><input type="text" id="publicationyear" name="publicationyear" value="[% publicationyear %]" /></li>
+ <li><label for="copyrightdate_filter"> Copyright date:</label><input type="text" id="copyrightdate_filter" name="copyrightdate" value="[% copyrightdate %]" /></li>
<li><label for="collectiontitle"> Collection title:</label><input type="text" id="collectiontitle" name="collectiontitle" value="[% collectiontitle %]" /></li><li><input type="submit" value="Go" /></li></ol>
</fieldset>
- <fieldset class="brief"><h4 class="collapse"><a href="#">Suggestion information</a></h4>
+ <fieldset class="brief"><h4 class="local_collapse"><a href="#">Suggestion information</a></h4>
<ol>
<li><label for="STATUS"> Status:</label><select name="STATUS" id="STATUS"><option value="">Any</option>
[% IF (statusselected_ASKED ) %]<option value="ASKED" selected="selected">Pending</option>
<li><label for="suggestedby"> Suggested by:</label><select id="suggestedby" name="suggestedby"><option value="">Any</option>
[% FOREACH suggestedby_loo IN suggestedby_loop %][% IF ( suggestedby_loo.selected ) %]<option value="[% suggestedby_loo.code %]" selected="selected">[% suggestedby_loo.desc %]</option>[% ELSE %]<option value="[% suggestedby_loo.code %]">[% suggestedby_loo.desc %]</option>[% END %][% END %]
</select></li>
- <li><label for="suggesteddate_from"> Suggested on:</label>[% suggesteddate %]
+ <li><label for="suggesteddate_from"> Suggested on:</label>
<table class="invis">
<tr>
- <td><label for="suggesteddate_from">from:</label></td><td><input type="text" id="suggesteddate_from" name="suggesteddate_from" style="width:80px;" /></td>
+ <td><label for="suggesteddate_from">from:</label></td><td><input type="text" id="suggesteddate_from" name="suggesteddate_from" value="[% suggesteddate_from %]" style="width:76px;" /></td>
</tr>
<tr>
- <td><label for="suggesteddate_to">to:</label></td><td><input type="text" id="suggesteddate_to" name="suggesteddate_to" style="width:80px;" /></td>
+ <td><label for="suggesteddate_to">to:</label></td><td><input type="text" id="suggesteddate_to" name="suggesteddate_to" value="[% suggesteddate_to %]" style="width:76px;" /></td>
</tr>
</table>
</li>
<li><label for="managedby"> Managed by:</label><select id="managedby" name="managedby"><option value="">Any</option>
[% FOREACH managedby_loo IN managedby_loop %][% IF ( managedby_loo.selected ) %]<option value="[% managedby_loo.code %]" selected="selected">[% managedby_loo.desc %]</option>[% ELSE %]<option value="[% managedby_loo.code %]">[% managedby_loo.desc %]</option>[% END %][% END %]
</select></li>
- <li><label for="manageddate_from"> Management date:</label>[% manageddate %]
+ <li><label for="manageddate_from"> Management date:</label>
<table class="invis">
<tr>
- <td><label for="manageddate_from">from:</label></td><td><input type="text" id="manageddate_from" name="manageddate_from" style="width:80px;" /></td>
+ <td><label for="manageddate_from">from:</label></td><td><input type="text" id="manageddate_from" name="manageddate_from" value="[% manageddate_from %]" style="width:76px;" /></td>
</tr>
<tr>
- <td><label for="manageddate_to">to:</label></td><td><input type="text" id="manageddate_to" name="manageddate_to" style="width:80px;" /></td>
+ <td><label for="manageddate_to">to:</label></td><td><input type="text" id="manageddate_to" name="manageddate_to" value="[% manageddate_to %]" style="width:76px;" /></td>
</tr>
</table>
</li>
<li><label for="acceptedby"> Accepted by:</label><select id="acceptedby" name="acceptedby"><option value="">Any</option>
[% FOREACH acceptedby_loo IN acceptedby_loop %][% IF ( acceptedby_loo.selected ) %] <option value="[% acceptedby_loo.code %]" selected="selected">[% acceptedby_loo.desc %]</option>[% ELSE %]<option value="[% acceptedby_loo.code %]">[% acceptedby_loo.desc %]</option>[% END %][% END %]
</select></li>
- <li><label for="accepteddate_from"> Accepted on:</label>[% accepteddate %]
+ <li><label for="accepteddate_from"> Accepted on:</label>
<table class="invis">
<tr>
- <td><label for="accepteddate_from">from:</label></td><td><input type="text" id="accepteddate_from" name="accepteddate_from" style="width:80px;" /></td>
+ <td><label for="accepteddate_from">from:</label></td><td><input type="text" id="accepteddate_from" name="accepteddate_from" value="[% accepteddate_from %]" style="width:76px;" /></td>
</tr>
<tr>
- <td><label for="accepteddate_to">to:</label></td><td><input type="text" id="accepteddate_to" name="accepteddate_to" style="width:80px;" /></td>
+ <td><label for="accepteddate_to">to:</label></td><td><input type="text" id="accepteddate_to" name="accepteddate_to" value="[% accepteddate_to %]" style="width:76px;" /></td>
</tr>
</table>
</li>
<li><input type="submit" value="Go" /></li></ol>
</fieldset>
- <fieldset class="brief"><h4 class="collapse"><a href="#">Acquisition information</a></h4>
+ <fieldset class="brief"><h4 class="local_collapse"><a href="#">Acquisition information</a></h4>
<ol><li><label for="budgetid"> Book fund:</label>
<select name="budgetid" id="budgetid"><option value="">Any</option>[% FOREACH budgetid_loo IN budgetid_loop %]
[% IF ( budgetid_loo.selected ) %] <option value="[% budgetid_loo.code %]" selected="selected">[% budgetid_loo.desc %]</option>[% ELSE %]<option value="[% budgetid_loo.code %]">[% budgetid_loo.desc %]</option>[% END %]
</select></li>
<li><label for="branchcode"> For:</label>
<select name="branchcode" id="branchcode">
- <option value="">Any</option>[% FOREACH branchloo IN branchloop %]
+ <option value="__ANY__">Any</option>[% FOREACH branchloo IN branchloop %]
[% IF ( branchloo.selected ) %] <option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>[% ELSE %] <option value="[% branchloo.value %]">[% branchloo.branchname %]</option>[% END %]
[% END %]
</select></li><li><input type="submit" value="Go" /></li></ol>