Bug 11299: Add a button to the biblio edition page to automatically add authority...
[koha-ffzg.git] / koha-tmpl / intranet-tmpl / prog / js / auth-finder-search.js
index ab1d394..2f47c29 100644 (file)
@@ -3,11 +3,11 @@
 $(document).ready(function(){
     $("#clear").on("click",function(e){
         e.preventDefault();
-        finderjumpfull('blinddetail-biblio-search.pl?authid=0&index=' + index );
+        finderjump('blinddetail-biblio-search.pl?authid=0&index=' + index );
     });
     $("#createnew").on("click",function(e){
         e.preventDefault();
-        finderjumpfull('authorities.pl?index=' + index + '&authtypecode=' + authtypecode );
+        finderjump('authorities.pl?index=' + index + '&authtypecode=' + authtypecode, 'full' );
     });
     // marclist
     $( "#value_any" ).autocomplete({
@@ -21,9 +21,9 @@ $(document).ready(function(){
                     op: "do_search",
                     type: "intranet",
                     and_or: "and",
-                    operator: "contains",
+                    operator: "start",
                     orderby: "HeadingAsc",
-                    querytype: "marclist"
+                    querytype: "all"
                 },
                 success: function(data) {
                     response( $.map( data, function( item ) {
@@ -49,7 +49,7 @@ $(document).ready(function(){
                     op: "do_search",
                     type: "intranet",
                     and_or: "and",
-                    operator: "contains",
+                    operator: "start",
                     orderby: "HeadingAsc",
                     querytype: "mainentry"
                 },
@@ -77,7 +77,7 @@ $(document).ready(function(){
                     op: "do_search",
                     type: "intranet",
                     and_or: "and",
-                    operator: "contains",
+                    operator: "start",
                     orderby: "HeadingAsc",
                     querytype: "mainmainentry"
                 },
@@ -95,6 +95,10 @@ $(document).ready(function(){
     });
 });
 
-function finderjumpfull(page){
-    window.open(page,'','width=100,height=100,resizable=yes,toolbar=false,scrollbars=yes,top');
+function finderjump(page, full){
+    var window_size = '';
+    if( full != "full"){
+        window_size = 'width=100,height=100,';
+    }
+    window.open(page,'', window_size + 'resizable=yes,toolbar=false,scrollbars=yes,top');
 }