From afd6e60a67b2081a985db6d197cad393a3ed40d6 Mon Sep 17 00:00:00 2001 From: Bouzid Fergani Date: Fri, 21 Sep 2018 14:55:31 -0400 Subject: [PATCH] Bug11299 - Populated field for record when import authority in z3950 --- cataloguing/z3950_auth_search.pl | 3 +++ koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt | 3 ++- koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt | 6 ++++++ .../intranet-tmpl/prog/en/modules/cataloguing/z3950_auth_search.tt | 3 ++- koha-tmpl/intranet-tmpl/prog/js/z3950_search.js | 7 ++++--- 5 files changed, 17 insertions(+), 5 deletions(-) diff --git a/cataloguing/z3950_auth_search.pl b/cataloguing/z3950_auth_search.pl index e65b8aa..c066441 100755 --- a/cataloguing/z3950_auth_search.pl +++ b/cataloguing/z3950_auth_search.pl @@ -42,6 +42,7 @@ my $subjectsubdiv = $input->param('subjectsubdiv'); my $srchany = $input->param('srchany'); my $op = $input->param('op')||''; my $page = $input->param('current_page') || 1; +my $index =$input->param('index'); $page = $input->param('goto_page') if $input->param('changepage_goto'); my ( $template, $loggedinuser, $cookie ) = get_template_and_user({ @@ -63,6 +64,7 @@ $template->param( subjectsubdiv => $subjectsubdiv, srchany => $srchany, authid => $authid, + index => $index, ); if ( $op ne "do_search" ) { @@ -72,6 +74,7 @@ if ( $op ne "do_search" ) { $template->param( serverloop => $serverloop, opsearch => "search", + index => $index, ); output_html_with_http_headers $input, $cookie, $template->output; exit; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt index ec97bf4..3b969c2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt @@ -22,8 +22,9 @@ $("#z3950submit").click(function(){ if (confirm(_("Please note that this Z39.50 search could replace the current record."))){ var strQuery = GetZ3950Terms(); + var index = "&index=[% index %]"; if(strQuery){ - window.open("/cgi-bin/koha/cataloguing/z3950_auth_search.pl?authid=[% authid | html %]"+strQuery,"z3950search",'width=740,height=450,location=yes,toolbar=no,scrollbars=yes,resize=yes'); + window.open("/cgi-bin/koha/cataloguing/z3950_auth_search.pl?authid=[% authid | html %]"+strQuery+index,"z3950search",'width=740,height=450,location=yes,toolbar=no,scrollbars=yes,resize=yes'); } } return false; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt index 7335c5f..9bffa19 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt @@ -177,6 +177,7 @@ function addCreateAuthorityButton(tag_subfield_line, heading, tag_index) { tag_subfield_line.append(elem); var tag_subfield_line_a = $('.subfield_line[id^=subfield' + heading.tag + 'a]').eq(tag_index); var subfield_a = tag_subfield_line_a.children('.input_marceditor').eq(0); + var index = subfield_a.attr('id'); elem.click(function() { var popup = window.open("", "new_auth_popup",'fullscreen,toolbar=false,scrollbars=yes'); if(popup !== null) { @@ -202,6 +203,11 @@ function addCreateAuthorityButton(tag_subfield_line, heading, tag_index) { name: 'tagbiblio', value: heading.tag })); + form.append($('').attr({ + type: 'hidden', + name: 'index', + value: index + })); $('.tag[id^=tag_' + heading.tag + '_]').eq(tag_index).find(':input').each(function(){ form.append($('').attr({ type: 'hidden', diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_auth_search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_auth_search.tt index 7a4a279..5971aa5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_auth_search.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_auth_search.tt @@ -21,6 +21,7 @@
+
@@ -94,7 +95,7 @@
diff --git a/koha-tmpl/intranet-tmpl/prog/js/z3950_search.js b/koha-tmpl/intranet-tmpl/prog/js/z3950_search.js index 95ef673..4c02a26 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/z3950_search.js +++ b/koha-tmpl/intranet-tmpl/prog/js/z3950_search.js @@ -1,10 +1,10 @@ //z3950_search.js for Authorities, Bib records and Acquisitions module -function Import(Breeding, recordid, AuthType, FrameworkCode) { +function Import(Breeding, recordid, AuthType, FrameworkCode, index) { if ( AuthType == false ) { opener.document.location="../cataloguing/addbiblio.pl?biblionumber="+recordid+"&z3950=1&frameworkcode="+FrameworkCode+"&breedingid="+Breeding; } else { - opener.document.location="../authorities/authorities.pl?breedingid="+Breeding+"&authtypecode="+AuthType+"&authid="+recordid; + opener.document.location="../authorities/authorities.pl?breedingid="+Breeding+"&authtypecode="+AuthType+"&authid="+recordid+"&index="+index; } window.close(); return false; @@ -87,10 +87,11 @@ $( document ).ready( function() { var data_authid = $( this ).data( "authid" ); var data_biblionumber = $( this ).data( "biblionumber" ); var data_frameworkcode = $( this ).data( "frameworkcode" ); + var data_index = $( this ).data( "index" ); if ( data_headingcode == undefined ) { Import( data_breedingid, data_biblionumber, false , data_frameworkcode ); } else { - Import( data_breedingid, data_authid, data_headingcode ); + Import( data_breedingid, data_authid, data_headingcodei, "", data_index ); } return false; }); -- 2.7.4