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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities_js.inc (-6 / +5 lines)
Lines 1-29 Link Here
1
<script>
1
<script>
2
2
3
function mergeAuth(authid, summary) {
3
function mergeAuth(authid, summary) {
4
    var alreadySelected = $.cookie('auth_to_merge');
4
    var alreadySelected = Cookies.get('auth_to_merge');
5
    if (alreadySelected !== undefined) {
5
    if (alreadySelected !== undefined) {
6
        alreadySelected = JSON.parse(alreadySelected);
6
        alreadySelected = JSON.parse(alreadySelected);
7
        $.cookie('auth_to_merge', '', { 'path': '/', 'expires': -1 });
7
        Cookies.remove('auth_to_merge');
8
        var refstring = "";
8
        var refstring = "";
9
        if (typeof alreadySelected.mergereference !== 'undefined') {
9
        if (typeof alreadySelected.mergereference !== 'undefined') {
10
            refstring = "&mergereference=" + alreadySelected.mergereference;
10
            refstring = "&mergereference=" + alreadySelected.mergereference;
11
        }
11
        }
12
        window.location.href = "/cgi-bin/koha/authorities/merge.pl?authid=" + authid + "&authid=" + alreadySelected.authid + refstring;
12
        window.location.href = "/cgi-bin/koha/authorities/merge.pl?authid=" + authid + "&authid=" + alreadySelected.authid + refstring;
13
    } else {
13
    } else {
14
        $.cookie('auth_to_merge', JSON.stringify({ 'authid': authid, 'summary': summary }), { 'path' : '/' });
14
        Cookies.set('auth_to_merge', JSON.stringify({ 'authid': authid, 'summary': summary }), { 'path' : '/' });
15
        showMergingInProgress();
15
        showMergingInProgress();
16
    }
16
    }
17
}
17
}
18
18
19
function showMergingInProgress() {
19
function showMergingInProgress() {
20
    var alreadySelected = $.cookie('auth_to_merge');
20
    var alreadySelected = Cookies.get('auth_to_merge');
21
    if (alreadySelected !== undefined) {
21
    if (alreadySelected !== undefined) {
22
        alreadySelected = JSON.parse(alreadySelected);
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>");
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) {
24
        $('#cancel_merge').click(function(event) {
25
            event.preventDefault();
25
            event.preventDefault();
26
            $.cookie('auth_to_merge', '', { 'path': '/', 'expires': -1 });
26
            Cookies.remove('auth_to_merge');
27
            $('#merge_in_progress').empty();
27
            $('#merge_in_progress').empty();
28
        });
28
        });
29
    } else {
29
    } else {
30
- 

Return to bug 23947