3 function mergeAuth(authid, summary) {
4 var alreadySelected = $.cookie('auth_to_merge');
5 if (alreadySelected !== undefined) {
6 alreadySelected = JSON.parse(alreadySelected);
7 $.cookie('auth_to_merge', '', { 'path': '/', 'expires': -1 });
9 if (typeof alreadySelected.mergereference !== 'undefined') {
10 refstring = "&mergereference=" + alreadySelected.mergereference;
12 window.location.href = "/cgi-bin/koha/authorities/merge.pl?authid=" + authid + "&authid=" + alreadySelected.authid + refstring;
14 $.cookie('auth_to_merge', JSON.stringify({ 'authid': authid, 'summary': summary }), { 'path' : '/' });
15 showMergingInProgress();
19 function showMergingInProgress() {
20 var alreadySelected = $.cookie('auth_to_merge');
21 if (alreadySelected !== undefined) {
22 alreadySelected = JSON.parse(alreadySelected);
23 $('#merge_in_progress').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>");
24 $('#cancel_merge').click(function(event) {
25 event.preventDefault();
26 $.cookie('auth_to_merge', '', { 'path': '/', 'expires': -1 });
27 $('#merge_in_progress').empty();
30 $('#merge_in_progress').empty();
34 function confirm_deletion(id) {
35 var is_confirmed = confirm(_("Are you sure you want to delete this authority?"));
37 id = "[% authid | html %]";
40 window.location="authorities-home.pl?op=delete"
43 + "&authtypecode=[% authtypecode | html %]"
44 + "&marclist=[% marclist | html %]"
45 + "&and_or=[% and_or | html %]"
46 + "&excluding=[% excluding | html %]"
47 + "&operator=[% operator | html %]"
48 + "&orderby=[% orderby | html %]"
49 + "&value=[% value |url %]"
50 + "&startfrom=[% startfrom | html %]"
51 + "&resultsperpage=[% resultsperpage | html %]"
52 + "&csrf_token=[% csrf_token | html %]";
56 $(document).ready(function () {
57 showMergingInProgress();
58 $('.merge_auth').click(function (event) {
59 event.preventDefault();
60 mergeAuth($(this).parents('tr').attr('data-authid'), $(this).parents('tr').find('div.authorizedheading').text());
63 $("#delAuth").click(function(){
68 $("#z3950_new").click(function(e){
70 window.open("/cgi-bin/koha/cataloguing/z3950_auth_search.pl","z3950search",'width=800,height=500,location=yes,toolbar=no,scrollbars=yes,resize=yes');
73 $("#z3950_replace").click(function(e){
75 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');
78 var searchType = '[% marclist | html %]';
80 if ('mainentry' == searchType) {
81 $("#header_search").tabs( "option", "selected", 0 );
82 } else if ('match' == searchType) {
83 $("#header_search").tabs( "option", "selected", 1 );
84 } else if ('all' == searchType) {
85 $("#header_search").tabs( "option", "selected", 2 );