Bug 11425 [Template follow-up] Search form for items
This template followup makes several changes to markup and text: - Replace "Bibliographic reference" with "Title" - Replace "Callnumber" with "Call number" - Replace "Home branch" with "Home library" - Replace "Holding branch" with "Current location" - Replace "Location" with "Shelving location" - Replace "Issues" with "Checkouts" - Replace "Indifferent" with "Ignore" - Replace "&" with "&" where necessary - Correct page title and breadcrumbs - Remove label "for" attribute from labels which do not directly target a form field - Correct label "for" attribute on labels which should target a form field - Correct date format hint This patch also makes one change to the way the page display works: The search results section is now in a separate div which uses a different grid rule, allowing it to take up the full width of the screen. To keep the page headers from looking weird I've changed the markup so that each section has its own header. To test, perform a variety of searches and confirm that the output in both Screen and CSV views looks correct. Confirm that search results which are output to the screen are formatted nicely and that the "edit search" links work correctly to show the search form. Submitting a new search after editing a search should hide the form and redisplay the search results table. Followed test plan, works as expected. Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Works as described, improves display.
This commit is contained in:
parent
643a9cd0ca
commit
dc85139da2
4 changed files with 46 additions and 44 deletions
|
@ -19,5 +19,5 @@
|
|||
<td>[% item.stocknumber %]</td>
|
||||
<td>[% item.status %]</td>
|
||||
<td>[% item.issues || 0 %]</td>
|
||||
<td><a href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=[% item.biblionumber %]&itemnumber=[% item.itemnumber %]">Edit</a></td>
|
||||
<td><a href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=[% item.biblionumber %]&itemnumber=[% item.itemnumber %]">Edit</a></td>
|
||||
</tr>
|
||||
|
|
|
@ -26,18 +26,18 @@
|
|||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
[% INCLUDE itemsearch_header name='title' label='title' text='Bibliographic reference' %]
|
||||
[% INCLUDE itemsearch_header name='title' label='title' text='Title' %]
|
||||
[% INCLUDE itemsearch_header name='publicationyear' label='publication date' text='Publication date' %]
|
||||
[% INCLUDE itemsearch_header name='publishercode' label='publisher' text='Publisher' %]
|
||||
[% INCLUDE itemsearch_header name='collectiontitle' label='collection' text='Collection' %]
|
||||
[% INCLUDE itemsearch_header name='barcode' label='barcode' text='Barcode' %]
|
||||
[% INCLUDE itemsearch_header name='itemcallnumber' label='callnumber' text='Callnumber' %]
|
||||
[% INCLUDE itemsearch_header name='homebranch' label='home branch' text='Home branch' %]
|
||||
[% INCLUDE itemsearch_header name='holdingbranch' label='holding branch' text='Holding branch' %]
|
||||
[% INCLUDE itemsearch_header name='location' label='location' text='Location' %]
|
||||
[% INCLUDE itemsearch_header name='itemcallnumber' label='callnumber' text='Call number' %]
|
||||
[% INCLUDE itemsearch_header name='homebranch' label='home branch' text='Home library' %]
|
||||
[% INCLUDE itemsearch_header name='holdingbranch' label='holding branch' text='Current location' %]
|
||||
[% INCLUDE itemsearch_header name='location' label='location' text='Shelving location' %]
|
||||
[% INCLUDE itemsearch_header name='stocknumber' label='stock number' text='Stock number' %]
|
||||
[% INCLUDE itemsearch_header name='notforloan' label='status' text='Status' %]
|
||||
[% INCLUDE itemsearch_header name='issues' label='issues' text='Issues' %]
|
||||
[% INCLUDE itemsearch_header name='issues' label='issues' text='Checkouts' %]
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Bibliographic reference, Publication Date, Publisher, Collection, Barcode, Callnumber, Home branch, Holding branch, Location, Stock number, Status, Issues
|
||||
Title, Publication Date, Publisher, Collection, Barcode, Call number, Home library, Current location, Shelving location, Stock number, Status, Checkouts
|
||||
[% FOREACH item IN results -%]
|
||||
[%- INCLUDE 'catalogue/itemsearch_item.csv.inc' item = item -%]
|
||||
[%- END -%]
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
[% END %]
|
||||
<select name="f" class="form-field-column">
|
||||
[% INCLUDE form_field_select_option value='barcode' label='Barcode' %]
|
||||
[% INCLUDE form_field_select_option value='itemcallnumber' label='Callnumber' %]
|
||||
[% INCLUDE form_field_select_option value='itemcallnumber' label='Call number' %]
|
||||
[% INCLUDE form_field_select_option value='stocknumber' label='Stock number' %]
|
||||
[% INCLUDE form_field_select_option value='title' label='Title' %]
|
||||
[% INCLUDE form_field_select_option value='author' label='Author' %]
|
||||
|
@ -117,9 +117,9 @@
|
|||
|
||||
[% BLOCK form_field_radio_yes_no %]
|
||||
<div class="form-field">
|
||||
<label class="form-field-label" for="[% name %]">[% label %]:</label>
|
||||
<label class="form-field-label">[% label %]:</label>
|
||||
<input type="radio" name="[% name %]" id="[% name %]_indifferent" value="" checked="checked"/>
|
||||
<label for="[% name %]_indifferent">Indifferent</label>
|
||||
<label for="[% name %]_indifferent">Ignore</label>
|
||||
<input type="radio" name="[% name %]" id="[% name %]_yes" value="yes" />
|
||||
<label for="[% name %]_yes">Yes</label>
|
||||
<input type="radio" name="[% name %]" id="[% name %]_no" value="no" />
|
||||
|
@ -130,11 +130,11 @@
|
|||
[%# Page starts here %]
|
||||
|
||||
[% INCLUDE 'doc-head-open.inc' %]
|
||||
<title>Koha › Catalog › Advanced search</title>
|
||||
<title>Koha › Catalog › Item search</title>
|
||||
[% INCLUDE 'doc-head-close.inc' %]
|
||||
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
|
||||
[% INCLUDE 'datatables.inc' %]
|
||||
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.dataTables.columnFilter.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
|
||||
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/itemsearchform.css" />
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
|
@ -178,18 +178,18 @@
|
|||
function submitForm($form) {
|
||||
var tr = ''
|
||||
+ ' <tr>'
|
||||
+ ' <th>' + _("Bibliographic reference") + '</th>'
|
||||
+ ' <th>' + _("Title") + '</th>'
|
||||
+ ' <th>' + _("Publication date") + '</th>'
|
||||
+ ' <th>' + _("Publisher") + '</th>'
|
||||
+ ' <th>' + _("Collection") + '</th>'
|
||||
+ ' <th>' + _("Barcode") + '</th>'
|
||||
+ ' <th>' + _("Callnumber") + '</th>'
|
||||
+ ' <th>' + _("Home branch") + '</th>'
|
||||
+ ' <th>' + _("Holding branch") + '</th>'
|
||||
+ ' <th>' + _("Location") + '</th>'
|
||||
+ ' <th>' + _("Call number") + '</th>'
|
||||
+ ' <th>' + _("Home library") + '</th>'
|
||||
+ ' <th>' + _("Current location") + '</th>'
|
||||
+ ' <th>' + _("Shelving location") + '</th>'
|
||||
+ ' <th>' + _("Stock number") + '</th>'
|
||||
+ ' <th>' + _("Status") + '</th>'
|
||||
+ ' <th>' + _("Issues") + '</th>'
|
||||
+ ' <th>' + _("Checkouts") + '</th>'
|
||||
+ ' <th></th>'
|
||||
+ ' </tr>'
|
||||
var table = ''
|
||||
|
@ -197,7 +197,10 @@
|
|||
+ ' <thead>' + tr + tr + '</thead>'
|
||||
+ ' <tbody></tbody>'
|
||||
+ '</table>';
|
||||
$('#results-wrapper').empty().html(table);
|
||||
var results_heading = "<h1>" + _("Item search results") + "</h1>";
|
||||
results_heading += "<p><a href=\"/cgi-bin/koha/catalogue/search.pl\">" + _("Go to advanced search") + "</a></p>";
|
||||
results_heading += "<p><a class=\"editsearchlink\" href=\"#\">" + _("Edit search") + "</a></p>";
|
||||
$('#results-wrapper').empty().html(results_heading + table);
|
||||
|
||||
var params = [];
|
||||
$form.find('select,input[type="text"],input[type="hidden"]').not('[disabled]').each(function () {
|
||||
|
@ -254,9 +257,9 @@
|
|||
});
|
||||
}
|
||||
|
||||
function hideForm($form) {
|
||||
$form.hide();
|
||||
$('#editsearchlink').show();
|
||||
function hideForm() {
|
||||
$("#item-search-block").hide();
|
||||
$('.editsearchlink').show();
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
|
@ -289,16 +292,18 @@
|
|||
});
|
||||
|
||||
$('#itemsearchform').submit(function() {
|
||||
var format = $(this).find('input[name="format"]:checked').val();
|
||||
var searchform = $(this);
|
||||
var format = searchform.find('input[name="format"]:checked').val();
|
||||
if (format == 'html') {
|
||||
submitForm($(this));
|
||||
hideForm($(this));
|
||||
submitForm(searchform);
|
||||
hideForm();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
$('#editsearchlink').click(function() {
|
||||
$('#itemsearchform').show();
|
||||
$("body").on("click",".editsearchlink",function(e) {
|
||||
e.preventDefault();
|
||||
$('#item-search-block').show();
|
||||
$(this).hide();
|
||||
return false;
|
||||
});
|
||||
|
@ -309,26 +314,24 @@
|
|||
<body id="catalog_itemsearch" class="catalog">
|
||||
[% INCLUDE 'header.inc' %]
|
||||
<div id="breadcrumbs">
|
||||
<a href="/cgi-bin/koha/mainpage.pl">Home</a> › Item search
|
||||
<a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a> › Item search
|
||||
</div>
|
||||
|
||||
<div id="doc" class="yui-t7">
|
||||
<div id="bd">
|
||||
<div id="item-search-block">
|
||||
<h1>Item search</h1>
|
||||
<a href="/cgi-bin/koha/catalogue/search.pl">Go to advanced search</a>
|
||||
<form action="" method="get" id="itemsearchform">
|
||||
<fieldset>
|
||||
<legend>Item search</legend>
|
||||
<p><a href="/cgi-bin/koha/catalogue/search.pl">Go to advanced search</a></p>
|
||||
<form action="/cgi-bin/koha/catalogue/itemsearch.pl" method="get" id="itemsearchform">
|
||||
<fieldset>
|
||||
[% INCLUDE form_field_select
|
||||
name="homebranch"
|
||||
label="Home branch"
|
||||
label="Home library"
|
||||
options = branches
|
||||
empty_option = "All branches"
|
||||
empty_option = "All libraries"
|
||||
%]
|
||||
[% INCLUDE form_field_select
|
||||
name="location"
|
||||
label="Location"
|
||||
label="Shelving location"
|
||||
options = locations
|
||||
empty_option = "All locations"
|
||||
%]
|
||||
|
@ -375,7 +378,7 @@
|
|||
[% INCLUDE form_field_radio_yes_no name="damaged" label="Damaged" %]
|
||||
[% INCLUDE form_field_radio_yes_no name="itemlost" label="Lost" %]
|
||||
<div class="form-field">
|
||||
<label class="form-field-label" for="issues">Issues count:</label>
|
||||
<label class="form-field-label" for="issues_op">Checkout count:</label>
|
||||
<select id="issues_op" name="issues_op">
|
||||
<option value=">">></option>
|
||||
<option value="<"><</option>
|
||||
|
@ -385,14 +388,14 @@
|
|||
<input type="text" name="issues" />
|
||||
</div>
|
||||
<div class="form-field">
|
||||
<label class="form-field-label" for="datelastborrowed">Last issue date:</label>
|
||||
<label class="form-field-label" for="datelastborrowed_op">Last checkout date:</label>
|
||||
<select id="datelastborrowed_op" name="datelastborrowed_op">
|
||||
<option value=">">After</option>
|
||||
<option value="<">Before</option>
|
||||
<option value="=">On</option>
|
||||
</select>
|
||||
<input type="text" name="datelastborrowed" />
|
||||
<span class="hint">ISO Format (AAAA-MM-DD)</span>
|
||||
<span class="hint">ISO Format (YYYY-MM-DD)</span>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
|
@ -405,14 +408,14 @@
|
|||
<input type="submit" value="Search" />
|
||||
</div>
|
||||
</fieldset>
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
<p><a id="editsearchlink" href="#" style="display:none">Edit search</a></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div id="doc3" class="yui-t7">
|
||||
<div id="results-wrapper">
|
||||
[% IF search_done %]
|
||||
|
||||
[% IF total_rows > 0 %]
|
||||
<p>Found [% total_rows %] results.</p>
|
||||
[% ELSE %]
|
||||
|
@ -429,6 +432,5 @@
|
|||
|
||||
[% END %]
|
||||
</div>
|
||||
</div>
|
||||
|
||||
[% INCLUDE 'intranet-bottom.inc' %]
|
||||
|
|
Loading…
Reference in a new issue