View | Details | Raw Unified | Return to bug 11299
Collapse All | Expand All

(-)a/C4/Biblio.pm (-2 / +2 lines)
Lines 617-628 sub LinkBibHeadingsToAuthorities { Link Here
617
                    $field->delete_subfield( code => '9' );
617
                    $field->delete_subfield( code => '9' );
618
                    $num_headings_changed++;
618
                    $num_headings_changed++;
619
                    $results{'unlinked'}->{ $heading->display_form() }++;
619
                    $results{'unlinked'}->{ $heading->display_form() }++;
620
                    push(@{$results{'details'}}, { tag => $field->tag(), authid => undef, status => 'NONE_FOUND'}) if $verbose;
620
                    push(@{$results{'details'}}, { tag => $field->tag(), authid => undef, status => 'NONE_FOUND', auth_type => $heading->auth_type()}) if $verbose;
621
                }
621
                }
622
            }
622
            }
623
            else {
623
            else {
624
                $results{'unlinked'}->{ $heading->display_form() }++;
624
                $results{'unlinked'}->{ $heading->display_form() }++;
625
                push(@{$results{'details'}}, { tag => $field->tag(), authid => undef, status => 'NONE_FOUND'}) if $verbose;
625
                push(@{$results{'details'}}, { tag => $field->tag(), authid => undef, status => 'NONE_FOUND', auth_type => $heading->auth_type()}) if $verbose;
626
            }
626
            }
627
        }
627
        }
628
628
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt (-47 / +7 lines)
Lines 167-220 function PopupZ3950() { Link Here
167
    } 
167
    } 
168
}
168
}
169
169
170
function addCreateAuthorityButton(tag_subfield_line, tag, index) {
170
/**
171
* this function append button for create new authority if not found
172
*/
173
174
function addCreateAuthorityButton(tag_subfield_line, auth_type) {
171
    var title = _("Create authority");
175
    var title = _("Create authority");
172
    var elem = $('<a class="subfield_status" href="#"><img src="[% interface %]/[% theme %]/img/edit-tag.png" title="' + title + '" /></a>');
176
    var elem = $('<a class="subfield_status" href="#"><img src="[% interface %]/[% theme %]/img/edit-tag.png" title="' + title + '" /></a>');
177
    elem.attr("onclick","window.open('../authorities/authorities.pl?authtypecode=" + auth_type  + "','','fullscreen','scrollbars')");
173
    tag_subfield_line.append(elem);
178
    tag_subfield_line.append(elem);
174
175
    elem.click(function() {
176
        var biblioindex = $(this).parents('.subfield_line').find('input').eq(1).attr('id');
177
        var popup = window.open("", "new_auth_popup",'width=700,height=550,toolbar=false,scrollbars=yes');
178
179
    if(popup !== null) {
180
        // Create a new form that will be POSTed in the new window
181
        var form = $('<form>').attr({
182
        method: 'post',
183
        action: "../authorities/authorities.pl",
184
        target: "new_auth_popup"
185
        });
186
187
        // Add the biblioindex
188
        form.append($('<input>').attr({
189
        type: 'hidden',
190
        name: 'biblioindex',
191
        value: biblioindex
192
        }));
193
        //add the authtypecode
194
        form.append($('<input>').attr({
195
        type: 'hidden',
196
        name: 'authtypecode',
197
        value: $("#authtypecode").val()
198
        }));
199
200
201
    // Get all form datas for the current heading field
202
        $('.tag[id^=tag_' + tag + '_]').eq(index).find(':input').each(function(){
203
        form.append($('<input>').attr({
204
            type: 'hidden',
205
            name: this.name,
206
            value: $(this).val()
207
        }));
208
        });
209
210
        // We need to add the temporary form to the body so we can submit it
211
        $('body').append(form);
212
        form.submit();
213
        form.remove();
214
    }
215
216
    return false;
217
    });
218
}
179
}
219
180
220
/**
181
/**
Lines 291-297 function updateHeadingLinks(links) { Link Here
291
252
292
        // Add a link to create a new authority if none was found
253
        // Add a link to create a new authority if none was found
293
        if(heading.status == 'NONE_FOUND') {
254
        if(heading.status == 'NONE_FOUND') {
294
            addCreateAuthorityButton(tag_subfield_line, heading.tag, tag_index);
255
            addCreateAuthorityButton(tag_subfield_line, heading.auth_type);
295
        }
256
        }
296
    });
257
    });
297
258
298
- 

Return to bug 11299