From 674b4ebfd00c2ef94bb4a5d35c1ca4c98b91eb8f Mon Sep 17 00:00:00 2001 From: Bouzid Fergani Date: Fri, 6 Oct 2017 08:25:23 -0400 Subject: [PATCH] Bug11299 - Populated field for record when import authority in z3950 --- cataloguing/z3950_auth_search.pl | 4 ++++ 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 | 5 +++-- koha-tmpl/intranet-tmpl/prog/js/z3950_search.js | 7 ++++--- 5 files changed, 19 insertions(+), 6 deletions(-) diff --git a/cataloguing/z3950_auth_search.pl b/cataloguing/z3950_auth_search.pl index c808b7b..1cc5154 100755 --- a/cataloguing/z3950_auth_search.pl +++ b/cataloguing/z3950_auth_search.pl @@ -42,6 +42,8 @@ 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 +65,7 @@ $template->param( subjectsubdiv => $subjectsubdiv, srchany => $srchany, authid => $authid, + index => $index, ); if ( $op ne "do_search" ) { @@ -72,6 +75,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 d339b23..a307ebb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt @@ -20,8 +20,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 %]"+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 %]"+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 54e370a..18d10a9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt @@ -178,6 +178,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) { @@ -203,6 +204,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 6e6de65..d0f0f11 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 @@ -65,6 +65,7 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color :
+
@@ -120,12 +121,12 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : [% FOREACH breeding_loo IN breeding_loop %] [% IF ( breeding_loo.breedingid ) %] - [% breeding_loo.server %] + [% breeding_loo.server %] [% breeding_loo.heading %] [% breeding_loo.heading_code %] Show MARC - Import + Import [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/js/z3950_search.js b/koha-tmpl/intranet-tmpl/prog/js/z3950_search.js index 95ef673..986566d 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_headingcode, '', data_index ); } return false; }); -- 1.9.1