+[% PROCESS 'form-blocks.inc' %]
<script type="text/javascript">
//<![CDATA[
-YAHOO.util.Event.onContentReady("header_search", function() {
- new function() {
- // Define a custom formatter function
- this.fnCustomFormatter = function(oResultItem, sQuery) {
- var name = oResultItem[0];
- var aMarkup = [
- "<div class=\"sample-result\">",
- name,
- "<\/div>"];
- return (aMarkup.join(""));
- };
+$(document).ready(function(){
+ $("#clear").on("click",function(e){
+ e.preventDefault();
+ finderjumpfull('blinddetail-biblio-search.pl?authid=0&index=[% index %]');
+ });
+ $("#createnew").on("click",function(e){
+ e.preventDefault();
+ finderjumpfull('authorities.pl?index=[% index %]&authtypecode=[% authtypecode %]');
+ });
// marclist
- this.marclistDS = new YAHOO.widget.DS_XHR("/cgi-bin/koha/authorities/ysearch.pl", ["\n", "\t"]);
- this.marclistDS.scriptQueryAppend = "op=do_search&type=intranet&and_or=and&operator=contains&orderby=HeadingAsc&querytype=marclist";
- this.marclistDS.responseType = YAHOO.widget.DS_XHR.TYPE_FLAT;
- this.marclistDS.maxCacheEntries = 60;
- this.marclistDS.queryMatchSubset = false;
-
- var myInput = document.getElementById('value_any');
- var myContainer = document.getElementById('yvaluecontainermarclist');
- this.oAutoComp = new YAHOO.widget.AutoComplete(myInput,myContainer,this.marclistDS);
- this.oAutoComp.queryDelay = 1;
- this.oAutoComp.formatResult = this.fnCustomFormatter;
- this.oAutoComp.maxResultsDisplayed = 1000;
-
-
+ $( "#value_any" ).autocomplete({
+ source: function(request, response) {
+ $.ajax({
+ url: "/cgi-bin/koha/authorities/ysearch.pl",
+ dataType: "json",
+ data: {
+ term: request.term,
+ op: "do_search",
+ type: "intranet",
+ and_or: "and",
+ operator: "contains",
+ orderby: "HeadingAsc",
+ querytype: "marclist"
+ },
+ success: function(data) {
+ response( $.map( data, function( item ) {
+ return {
+ label: item.summary,
+ value: item.summary
+ }
+ }));
+ }
+ });
+ },
+ minLength: 3,
+ });
// mainentry
- this.mainentryDS = new YAHOO.widget.DS_XHR("/cgi-bin/koha/authorities/ysearch.pl", ["\n", "\t"]);
- this.mainentryDS.scriptQueryAppend = "op=do_search&type=intranet&and_or=and&operator=contains&orderby=HeadingAsc&querytype=mainentry";
- this.mainentryDS.responseType = YAHOO.widget.DS_XHR.TYPE_FLAT;
- this.mainentryDS.maxCacheEntries = 60;
- this.mainentryDS.queryMatchSubset = false;
-
- var myInput = document.getElementById('value_main');
- var myContainer = document.getElementById('yvaluecontainermainentry');
- this.oAutoComp = new YAHOO.widget.AutoComplete(myInput,myContainer,this.mainentryDS);
- this.oAutoComp.queryDelay = 1;
- this.oAutoComp.formatResult = this.fnCustomFormatter;
- this.oAutoComp.maxResultsDisplayed = 1000;
-
-
+ $( "#value_main" ).autocomplete({
+ source: function(request, response) {
+ $.ajax({
+ url: "/cgi-bin/koha/authorities/ysearch.pl",
+ dataType: "json",
+ data: {
+ term: request.term,
+ op: "do_search",
+ type: "intranet",
+ and_or: "and",
+ operator: "contains",
+ orderby: "HeadingAsc",
+ querytype: "mainentry"
+ },
+ success: function(data) {
+ response( $.map( data, function( item ) {
+ return {
+ label: item.summary,
+ value: item.summary
+ }
+ }));
+ }
+ });
+ },
+ minLength: 3,
+ });
// mainmainentry
- this.mainentryDS = new YAHOO.widget.DS_XHR("/cgi-bin/koha/authorities/ysearch.pl", ["\n", "\t"]);
- this.mainentryDS.scriptQueryAppend = "op=do_search&type=intranet&and_or=and&operator=contains&orderby=HeadingAsc&querytype=mainmainentry";
- this.mainentryDS.responseType = YAHOO.widget.DS_XHR.TYPE_FLAT;
- this.mainentryDS.maxCacheEntries = 60;
- this.mainentryDS.queryMatchSubset = false;
-
- var myInput = document.getElementById('value_mainstr');
- var myContainer = document.getElementById('yvaluecontainermainmainentry');
- this.oAutoComp = new YAHOO.widget.AutoComplete(myInput,myContainer,this.mainentryDS);
- this.oAutoComp.queryDelay = 1;
- this.oAutoComp.formatResult = this.fnCustomFormatter;
- this.oAutoComp.maxResultsDisplayed = 1000;
-
+ $( "#value_mainstr" ).autocomplete({
+ source: function(request, response) {
+ $.ajax({
+ url: "/cgi-bin/koha/authorities/ysearch.pl",
+ dataType: "json",
+ data: {
+ term: request.term,
+ op: "do_search",
+ type: "intranet",
+ and_or: "and",
+ operator: "contains",
+ orderby: "HeadingAsc",
+ querytype: "mainmainentry"
+ },
+ success: function(data) {
+ response( $.map( data, function( item ) {
+ return {
+ label: item.summary,
+ value: item.summary
+ }
+ }));
+ }
+ });
+ },
+ minLength: 3,
+ });
+});
+function finderjumpfull(page)
+{
+ window.open(page,'','fullscreen,scrollbars');
}
-});
+
//]]>
</script>
-
-<span id="header_search">
+<div id="toolbar" class="btn-toolbar">
+ <div class="btn-group"><a href="#" id="clear" class="btn btn-small"><i class="icon-remove-sign"></i> Clear field</a></div>
+ <div class="btn-group"><a href="#" id="createnew" class="btn btn-small"><i class="icon-plus"></i> Create new authority</a></div>
+</div>
<form name="f" method="get" action="auth_finder.pl">
+ <input type="hidden" name="source" value="[% source %]" />
<input type="hidden" name="op" value="do_search" />
<input type="hidden" name="type" value="intranet" />
<input type="hidden" name="index" value="[% index %]" />
- <fieldset class="rows"><ol><li>
+ <fieldset class="rows"><legend>Search options</legend>
+ <ol><li>
<span class="label">Authority type</span>
[% authtypecode %]
<input type="hidden" name="authtypecode" value="[% authtypecode %]" />
</li>
<li>
- <label for="marclist">Anywhere</label>
+ <label for="marclistanywhere">Anywhere</label>
<input type="hidden" name="marclist" value="any" />
<input type="hidden" name="and_or" value="and" />
<input type="hidden" name="excluding" value="" />
- <select name="operator" id="marclist">
+ <select name="operator" id="marclistanywhere">
<option value="contains">contains</option>
<option value="start">starts with</option>
<option value="is">is exactly</option>
<div id="yvaluecontainermarclist"></div>
</li>
<li>
- <label for="marclist">Heading match</label>
+ <label for="marclistheading">Heading match</label>
<input type="hidden" name="marclist" value="match" />
<input type="hidden" name="and_or" value="and" />
<input type="hidden" name="excluding" value="" />
- <select name="operator" id="marclist">
+ <select name="operator" id="marclistheading">
<option value="contains">contains</option>
<option value="start">starts with</option>
<option value="is">is exactly</option>
<option value="HeadingDsc">Heading descendant</option>
</select>
</li></ol></fieldset>
- <fieldset class="action"> <input type="submit" value="Start search" class="submit" /> <a class="cancel close" href="#">Cancel</a></fieldset>
+ [% IF source == 'auth' %]
+ <fieldset class="rows"><legend>Relationship information</legend>
+ <ol>
+ <li>
+ <label for="relationship">Special relationship: </label>
+ <select name="relationship" id="relationship">
+ [% selected=relationship %]
+ [% PROCESS selectoptionopen value='' %]None specified</option>
+ [% PROCESS selectoptionopen value='a' %]a - Earlier heading</option>
+ [% PROCESS selectoptionopen value='b' %]b - Later heading</option>
+ [% PROCESS selectoptionopen value='d' %]d - Acronym</option>
+ [% PROCESS selectoptionopen value='f' %]f - Musical composition</option>
+ [% PROCESS selectoptionopen value='g' %]g - Broader term</option>
+ [% PROCESS selectoptionopen value='h' %]h - Narrower term</option>
+ [% PROCESS selectoptionopen value='i' %]i - Reference instruction phrase in subfield $i</option>
+ [% PROCESS selectoptionopen value='n' %]n - Not applicable</option>
+ [% PROCESS selectoptionopen value='r' %]r - Relationship designation in $i or $4</option>
+ [% PROCESS selectoptionopen value='t' %]t - Immediate parent body</option>
+ </select>
+ </li>
+ </ol>
+ </fieldset>
+ [% END %]
+ <fieldset class="action"> <input type="submit" value="Search" class="submit" id="search" /> <a id="cancel" class="cancel close" href="#">Cancel</a>
+ </fieldset>
</form>
-</span>