1 <!-- authorities_js.inc -->
4 function mergeAuth(authid, summary) {
5 var alreadySelected = Cookies.get('auth_to_merge');
6 if (alreadySelected !== undefined) {
7 alreadySelected = JSON.parse(alreadySelected);
8 Cookies.remove('auth_to_merge');
10 if (typeof alreadySelected.mergereference !== 'undefined') {
11 refstring = "&mergereference=" + alreadySelected.mergereference;
13 window.location.href = "/cgi-bin/koha/authorities/merge.pl?authid=" + authid + "&authid=" + alreadySelected.authid + refstring;
15 Cookies.set('auth_to_merge', JSON.stringify({ 'authid': authid, 'summary': summary }), { 'path' : '/', sameSite: 'Lax' });
16 showMergingInProgress();
20 function showMergingInProgress() {
21 var alreadySelected = Cookies.get('auth_to_merge');
22 if (alreadySelected !== undefined) {
23 alreadySelected = JSON.parse(alreadySelected);
24 $('#merge_in_progress').show().html(_("Merging with authority: ") + "<a href='detail.pl?authid=" + alreadySelected.authid + "'><span class='authorizedheading'>" + alreadySelected.summary + "</span> (" + alreadySelected.authid + ")</a> <a href='#' id='cancel_merge'>" + _("Cancel merge") + "</a>");
25 $('#cancel_merge').click(function(event) {
26 event.preventDefault();
27 Cookies.remove('auth_to_merge');
28 $('#merge_in_progress').hide().empty();
31 $('#merge_in_progress').hide().empty();
35 $(document).ready(function () {
36 showMergingInProgress();
38 $('.form_delete').submit(function() {
39 if ( confirm(_("Are you sure you want to delete this authority?")) ) {
42 // FIXME Close the dropdown $(this).closest('ul.dropdown-menu').dropdown('toggle');
46 $('.merge_auth').click(function (event) {
47 event.preventDefault();
48 mergeAuth($(this).parents('tr').attr('data-authid'), $(this).parents('tr').find('div.authorizedheading').text());
51 $("#delAuth").click(function(){
52 $('.form_delete').submit();
55 $("#z3950_new").click(function(e){
57 window.open("/cgi-bin/koha/cataloguing/z3950_auth_search.pl","z3950search",'width=800,height=550,location=yes,toolbar=no,scrollbars=yes,resize=yes');
60 $("#z3950_replace").click(function(e){
62 window.open("/cgi-bin/koha/cataloguing/z3950_auth_search.pl?authid=[% authid | html %]","z3950search",'width=800,height=500,location=yes,toolbar=no,scrollbars=yes,resize=yes');
65 var searchType = '[% marclist | html %]';
67 if ('mainmainentry' == searchType) {
68 $("#header_search a[href='#mainmain_heading']").tab("show");
69 } else if ('mainentry' == searchType) {
70 $("#header_search a[href='#main_heading']").tab("show");
71 } else if ('match' == searchType) {
72 $("#header_search a[href='#matchheading_search']").tab("show");
73 } else if ('all' == searchType) {
74 $("#header_search a[href='#entire_record']").tab("show");
78 const template_path = "[% interface | html %]/[% theme | html %]";
81 <!-- / authorities_js.inc -->