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

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

Return to bug 11299