@@ -, +, @@
Authorities, part 2
- Cataloging -> Add or edit bibliographic record in a framework which
has authorities linked to a tag
-> Click authorities plugin link
-> Create new authority button
-> Autocomplete on text inputs (except "Search all headings")
-> Search
-> Select authority record ("choose")
-> Click authorities plugin link again
-> Clear field
---
.../prog/en/includes/auth-finder-search.inc | 105 ----------
.../prog/en/modules/authorities/auth_finder.tt | 12 +-
.../authorities/blinddetail-biblio-search.tt | 230 +++++++++++----------
.../modules/authorities/searchresultlist-auth.tt | 49 +++--
.../intranet-tmpl/prog/js/auth-finder-search.js | 100 +++++++++
5 files changed, 256 insertions(+), 240 deletions(-)
create mode 100644 koha-tmpl/intranet-tmpl/prog/js/auth-finder-search.js
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/auth-finder-search.inc
+++ a/koha-tmpl/intranet-tmpl/prog/en/includes/auth-finder-search.inc
@@ -1,109 +1,4 @@
[% PROCESS 'form-blocks.inc' %]
-
-[% INCLUDE 'popup-bottom.inc' %]
+
+[% MACRO jsinclude BLOCK %]
+
+
+[% END %]
+
+[% INCLUDE 'intranet-bottom.inc' popup_window = 1 %]
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/blinddetail-biblio-search.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/blinddetail-biblio-search.tt
@@ -1,129 +1,131 @@
+[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
Koha › Authority details
[% INCLUDE 'doc-head-close.inc' %]
-
+
-
+
Loading
-[% INCLUDE 'popup-bottom.inc' %]
+[% MACRO jsinclude BLOCK %]
+
+[% END %]
+
+[% INCLUDE 'intranet-bottom.inc' popup_window = 1 %]
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist-auth.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist-auth.tt
@@ -1,3 +1,4 @@
+[% SET footerjs = 1 %]
[% PROCESS 'authorities-search-results.inc' %]
[% INCLUDE 'doc-head-open.inc' %]
Koha › Cataloging authority plugin
@@ -5,26 +6,8 @@
-
+
@@ -111,4 +94,30 @@ function doauth(authid, index, repet)
-[% INCLUDE 'popup-bottom.inc' %]
+
+[% MACRO jsinclude BLOCK %]
+
+
+
+[% END %]
+
+[% INCLUDE 'intranet-bottom.inc' popup_window = 1 %]
--- a/koha-tmpl/intranet-tmpl/prog/js/auth-finder-search.js
+++ a/koha-tmpl/intranet-tmpl/prog/js/auth-finder-search.js
@@ -0,0 +1,100 @@
+/* global index authtypecode */
+
+$(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
+ $( "#value_any" ).autocomplete({
+ source: function(request, response) {
+ $.ajax({
+ url: "/cgi-bin/koha/authorities/ysearch.pl",
+ dataType: "json",
+ data: {
+ authtypecode : authtypecode,
+ 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
+ $( "#value_main" ).autocomplete({
+ source: function(request, response) {
+ $.ajax({
+ url: "/cgi-bin/koha/authorities/ysearch.pl",
+ dataType: "json",
+ data: {
+ authtypecode : authtypecode,
+ 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
+ $( "#value_mainstr" ).autocomplete({
+ source: function(request, response) {
+ $.ajax({
+ url: "/cgi-bin/koha/authorities/ysearch.pl",
+ dataType: "json",
+ data: {
+ authtypecode : authtypecode,
+ 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,'','width=100,height=100,resizable=yes,toolbar=false,scrollbars=yes,top');
+}
--