Bugzilla – Attachment 79449 Details for
Bug 11299
Add a button to automatically link authority records in cataloguing (AJAX)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug11299 - Fix problems when authority is not found and i want add it
Bug11299---Fix-problems-when-authority-is-not-foun.patch (text/plain), 4.15 KB, created by
Bouzid Fergani
on 2018-09-26 19:31:33 UTC
(
hide
)
Description:
Bug11299 - Fix problems when authority is not found and i want add it
Filename:
MIME Type:
Creator:
Bouzid Fergani
Created:
2018-09-26 19:31:33 UTC
Size:
4.15 KB
patch
obsolete
>From d7f4e1fbfe128073f427305971b21848ed3f6506 Mon Sep 17 00:00:00 2001 >From: Bouzid Fergani <bouzid.fergani@inlibro.com> >Date: Tue, 9 May 2017 15:39:10 -0400 >Subject: [PATCH] Bug11299 - Fix problems when authority is not found and i > want add it > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > C4/Biblio.pm | 4 +- > .../prog/en/modules/cataloguing/addbiblio.tt | 53 +++------------------- > 2 files changed, 9 insertions(+), 48 deletions(-) > >diff --git a/C4/Biblio.pm b/C4/Biblio.pm >index f0b1a8d..ded62ad 100644 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -617,12 +617,12 @@ sub LinkBibHeadingsToAuthorities { > $field->delete_subfield( code => '9' ); > $num_headings_changed++; > $results{'unlinked'}->{ $heading->display_form() }++; >- push(@{$results{'details'}}, { tag => $field->tag(), authid => undef, status => 'NONE_FOUND'}) if $verbose; >+ push(@{$results{'details'}}, { tag => $field->tag(), authid => undef, status => 'NONE_FOUND', auth_type => $heading->auth_type()}) if $verbose; > } > } > else { > $results{'unlinked'}->{ $heading->display_form() }++; >- push(@{$results{'details'}}, { tag => $field->tag(), authid => undef, status => 'NONE_FOUND'}) if $verbose; >+ push(@{$results{'details'}}, { tag => $field->tag(), authid => undef, status => 'NONE_FOUND', auth_type => $heading->auth_type()}) if $verbose; > } > } > >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 96112d7..dc81a41 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt >@@ -167,54 +167,15 @@ function PopupZ3950() { > } > } > >-function addCreateAuthorityButton(tag_subfield_line, tag, index) { >+/** >+* this function append button for create new authority if not found >+*/ >+ >+function addCreateAuthorityButton(tag_subfield_line, auth_type) { > var title = _("Create authority"); > var elem = $('<a class="subfield_status" href="#"><img src="[% interface %]/[% theme %]/img/edit-tag.png" title="' + title + '" /></a>'); >+ elem.attr("onclick","window.open('../authorities/authorities.pl?authtypecode=" + auth_type + "','','fullscreen','scrollbars')"); > tag_subfield_line.append(elem); >- >- elem.click(function() { >- var biblioindex = $(this).parents('.subfield_line').find('input').eq(1).attr('id'); >- var popup = window.open("", "new_auth_popup",'width=700,height=550,toolbar=false,scrollbars=yes'); >- >- if(popup !== null) { >- // Create a new form that will be POSTed in the new window >- var form = $('<form>').attr({ >- method: 'post', >- action: "../authorities/authorities.pl", >- target: "new_auth_popup" >- }); >- >- // Add the biblioindex >- form.append($('<input>').attr({ >- type: 'hidden', >- name: 'biblioindex', >- value: biblioindex >- })); >- //add the authtypecode >- form.append($('<input>').attr({ >- type: 'hidden', >- name: 'authtypecode', >- value: $("#authtypecode").val() >- })); >- >- >- // Get all form datas for the current heading field >- $('.tag[id^=tag_' + tag + '_]').eq(index).find(':input').each(function(){ >- form.append($('<input>').attr({ >- type: 'hidden', >- name: this.name, >- value: $(this).val() >- })); >- }); >- >- // We need to add the temporary form to the body so we can submit it >- $('body').append(form); >- form.submit(); >- form.remove(); >- } >- >- return false; >- }); > } > > /** >@@ -291,7 +252,7 @@ function updateHeadingLinks(links) { > > // Add a link to create a new authority if none was found > if(heading.status == 'NONE_FOUND') { >- addCreateAuthorityButton(tag_subfield_line, heading.tag, tag_index); >+ addCreateAuthorityButton(tag_subfield_line, heading.auth_type); > } > }); > >-- >2.7.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 11299
:
23146
|
26715
|
33074
|
37912
|
37913
|
37972
|
38737
|
39477
|
39478
|
39479
|
40831
|
41229
|
45218
|
56440
|
56508
|
56509
|
58307
|
60998
|
63311
|
63312
|
63313
|
64075
|
67162
|
67708
|
67709
|
67710
|
67712
|
67713
|
67714
|
67824
|
67825
|
67826
|
67827
|
67828
|
67829
|
79385
|
79386
|
79387
|
79388
|
79389
|
79390
|
79391
|
79392
|
79393
|
79394
|
79395
|
79396
|
79397
|
79398
|
79399
|
79447
|
79448
|
79449
|
79450
|
79451
|
79452
|
79545
|
94818
|
95126
|
95152
|
98571
|
98572
|
99249
|
108091
|
108309
|
108310
|
108396
|
108552
|
108834
|
108835
|
109062
|
109063
|
109069
|
109181
|
110553
|
110554
|
110555
|
110556
|
110557
|
110568
|
110569
|
110570
|
110571
|
110572
|
111706
|
111707
|
111708
|
111709
|
111710
|
112125
|
112126
|
112127
|
112128
|
112129
|
112130
|
112131
|
112132
|
112133
|
112134
|
112135
|
113562
|
113563
|
113564
|
113565
|
113566
|
113567
|
113568
|
114803
|
114924
|
114925
|
114926
|
114927
|
114928
|
114929
|
114930
|
114931
|
114932