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' : '/' });
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').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').empty();
31 $('#merge_in_progress').empty();
35 function confirm_deletion(id) {
36 var is_confirmed = confirm(_("Are you sure you want to delete this authority?"));
38 id = "[% authid | html %]";
41 window.location="authorities-home.pl?op=delete"
44 + "&authtypecode=[% authtypecode | html %]"
45 + "&marclist=[% marclist | html %]"
46 + "&and_or=[% and_or | html %]"
47 + "&excluding=[% excluding | html %]"
48 + "&operator=[% operator | html %]"
49 + "&orderby=[% orderby | html %]"
50 + "&value=[% value |uri %]"
51 + "&startfrom=[% startfrom | html %]"
52 + "&resultsperpage=[% resultsperpage | html %]"
53 + "&csrf_token=[% csrf_token | html %]";
57 $(document).ready(function () {
58 showMergingInProgress();
59 $('.merge_auth').click(function (event) {
60 event.preventDefault();
61 mergeAuth($(this).parents('tr').attr('data-authid'), $(this).parents('tr').find('div.authorizedheading').text());
64 $("#delAuth").click(function(){
69 $("#z3950_new").click(function(e){
71 window.open("/cgi-bin/koha/cataloguing/z3950_auth_search.pl","z3950search",'width=800,height=500,location=yes,toolbar=no,scrollbars=yes,resize=yes');
74 $("#z3950_replace").click(function(e){
76 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');
79 var searchType = '[% marclist | html %]';
81 if ('mainmainentry' == searchType) {
82 $("#header_search").tabs( "option", "active", 0 );
83 } else if ('mainentry' == searchType) {
84 $("#header_search").tabs( "option", "active", 1 );
85 } else if ('match' == searchType) {
86 $("#header_search").tabs( "option", "active", 2 );
87 } else if ('all' == searchType) {
88 $("#header_search").tabs( "option", "active", 3 );
95 <!-- / authorities_js.inc -->