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

(-)a/authorities/detail.pl (+9 lines)
Lines 51-56 use Koha::Authorities; Link Here
51
51
52
use Koha::Authority::Types;
52
use Koha::Authority::Types;
53
use Koha::Token;
53
use Koha::Token;
54
use Koha::Z3950Servers;
54
55
55
our ($tagslib);
56
our ($tagslib);
56
57
Lines 214-219 chop $biblio_fields if $biblio_fields; Link Here
214
215
215
build_tabs ($template, $record, $dbh,"",$query);
216
build_tabs ($template, $record, $dbh,"",$query);
216
217
218
my $servers = Koha::Z3950Servers->search(
219
    {
220
        recordtype => 'authority',
221
        servertype => ['zed', 'sru'],
222
    },
223
);
224
217
my $type = $authority_types->find($authtypecode);
225
my $type = $authority_types->find($authtypecode);
218
$template->param(
226
$template->param(
219
    authid          => $authid,
227
    authid          => $authid,
Lines 223-228 $template->param( Link Here
223
    authtypecode    => $authtypecode,
231
    authtypecode    => $authtypecode,
224
    authority_types => $authority_types,
232
    authority_types => $authority_types,
225
    csrf_token      => Koha::Token->new->generate_csrf({ session_id => scalar $query->cookie('CGISESSID') }),
233
    csrf_token      => Koha::Token->new->generate_csrf({ session_id => scalar $query->cookie('CGISESSID') }),
234
    servers => $servers,
226
);
235
);
227
236
228
$template->{VARS}->{marcflavour} = C4::Context->preference("marcflavour");
237
$template->{VARS}->{marcflavour} = C4::Context->preference("marcflavour");
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-toolbar.inc (-38 / +47 lines)
Lines 1-47 Link Here
1
[% INCLUDE 'blocking_errors.inc' %]
1
[% INCLUDE 'blocking_errors.inc' %]
2
[% IF ( authid || CAN_user_editauthorities) %]
2
[% IF ( authid || CAN_user_editauthorities) %]
3
3
4
<div id="toolbar" class="btn-toolbar">
4
    <div id="toolbar" class="btn-toolbar">
5
5
        [% IF ( CAN_user_editauthorities ) %]
6
[% IF ( authid ) %]
6
            <div class="btn-group">
7
    [% IF ( CAN_user_editauthorities ) %]
7
                <a class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown" href="#">
8
        <div class="btn-group"><a class="btn btn-default btn-sm" id="editAuth" href="authorities.pl?authid=[% authid %]"><i class="fa fa-pencil"></i> Edit</a></div>
8
                    <i class="fa fa-plus"></i> New authority
9
        <div class="btn-group"><a class="btn btn-default btn-sm" id="dupAuth" href="authorities.pl?authid=[% authid %]&amp;op=duplicate"><i class="fa fa-copy"></i> Duplicate</a></div>
9
                    <span class="caret"></span>
10
        [% UNLESS ( count ) %]
10
                </a>
11
            <div class="btn-group"><a href="#" class="btn btn-default btn-sm" id="delAuth"><i class="fa fa-trash"></i> Delete</a></div>
11
                <ul class="dropdown-menu">
12
                    [% IF servers.count > 0 %]
13
                        <li><a id="z3950_new" href="#">New from Z39.50</a></li>
14
                        <li role="separator" class="divider"></li>
15
                    [% END %]
16
                    [% FOREACH authority_type IN authority_types %]
17
                        <li><a href="/cgi-bin/koha/authorities/authorities.pl?authtypecode=[% authority_type.authtypecode %]">[% authority_type.authtypetext %]</a></li>
18
                    [% END %]
19
                </ul>
20
            </div>
12
        [% END %]
21
        [% END %]
13
    [% END %]
14
15
    <div class="btn-group">
16
        <a class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown" href="#"><i class="fa fa-download"></i> Save
17
        <span class="caret"></span>
18
        </a>
19
        <ul class="dropdown-menu">
20
            <li><a href="/cgi-bin/koha/authorities/export.pl?format=mads&amp;op=export&amp;authid=[% authid %]">MADS (XML)</a></li>
21
            <li><a href="/cgi-bin/koha/authorities/export.pl?format=marcxml&amp;op=export&amp;authid=[% authid %]">MARCXML</a></li>
22
            <li><a href="/cgi-bin/koha/authorities/export.pl?format=marc8&amp;op=export&amp;authid=[% authid %]">MARC (non-Unicode/MARC-8)</a></li>
23
            <li><a href="/cgi-bin/koha/authorities/export.pl?format=utf8&amp;op=export&amp;authid=[% authid %]">MARC (Unicode/UTF-8)</a></li>
24
        </ul>
25
    </div>
26
[% END %]
27
22
28
[% IF ( CAN_user_editauthorities ) %]
23
        [% IF ( authid ) %]
29
    <div class="btn-group">
24
            [% IF ( CAN_user_editauthorities ) %]
30
        <a class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown" href="#"><i class="fa fa-plus"></i> New authority
25
                <div class="btn-group">
31
        <span class="caret"></span>
26
                    <button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown">
32
        </a>
27
                        <i class="fa fa-pencil"></i> Edit <span class="caret"></span>
33
        <ul class="dropdown-menu">
28
                    </button>
34
            [% FOREACH authority_type IN authority_types %]
29
                    <ul class="dropdown-menu">
35
                <li><a href="/cgi-bin/koha/authorities/authorities.pl?authtypecode=[% authority_type.authtypecode %]">[% authority_type.authtypetext %]</a></li>
30
                        <li><a id="editAuth" href="/cgi-bin/koha/authorities/authorities.pl?authid=[% authid %]">Edit record</a></li>
31
                        <li><a id="dupAuth" href="/cgi-bin/koha/authorities/authorities.pl?authid=[% authid %]&amp;op=duplicate">Edit as new (duplicate)</a></li>
32
                        [% IF servers.count > 0 %]
33
                            <li><a id="z3950_replace" href="#">Replace record via Z39.50/SRU</a></li>
34
                        [% END %]
35
                        [% UNLESS ( count ) %]
36
                            <li><a href="#" id="delAuth">Delete record</a></li>
37
                        [% END %]
38
                    </ul>
39
                </div>
36
            [% END %]
40
            [% END %]
37
        </ul>
41
42
            <div class="btn-group">
43
                <a class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown" href="#"><i class="fa fa-download"></i> Save
44
                <span class="caret"></span>
45
                </a>
46
                <ul class="dropdown-menu">
47
                    <li><a href="/cgi-bin/koha/authorities/export.pl?format=mads&amp;op=export&amp;authid=[% authid %]">MADS (XML)</a></li>
48
                    <li><a href="/cgi-bin/koha/authorities/export.pl?format=marcxml&amp;op=export&amp;authid=[% authid %]">MARCXML</a></li>
49
                    <li><a href="/cgi-bin/koha/authorities/export.pl?format=marc8&amp;op=export&amp;authid=[% authid %]">MARC (non-Unicode/MARC-8)</a></li>
50
                    <li><a href="/cgi-bin/koha/authorities/export.pl?format=utf8&amp;op=export&amp;authid=[% authid %]">MARC (Unicode/UTF-8)</a></li>
51
                </ul>
52
            </div>
53
        [% END %]
38
    </div>
54
    </div>
39
    [% IF servers.count > 0 %]
40
        <div class="btn-group">
41
            <a class="btn btn-default btn-sm" id="z3950submit" href="#"><i class="fa fa-search"></i> New from Z39.50</a>
42
        </div>
43
    [% END %]
44
[% END %]
45
</div>
46
55
47
[% END %]
56
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities_js.inc (-12 / +10 lines)
Lines 1-4 Link Here
1
<script type="text/javascript">
1
<script>
2
2
3
function mergeAuth(authid, summary) {
3
function mergeAuth(authid, summary) {
4
    var alreadySelected = $.cookie('auth_to_merge');
4
    var alreadySelected = $.cookie('auth_to_merge');
Lines 65-79 $(document).ready(function () { Link Here
65
        return false;
65
        return false;
66
    });
66
    });
67
67
68
    $("#z3950submit").click(function(){
68
    $("#z3950_new").click(function(e){
69
        [% IF ( authid ) %]
69
        e.preventDefault();
70
            if (confirm(_("Please note that this Z39.50 search could replace the current record."))){
70
        window.open("/cgi-bin/koha/cataloguing/z3950_auth_search.pl","z3950search",'width=800,height=500,location=yes,toolbar=no,scrollbars=yes,resize=yes');
71
                window.open("/cgi-bin/koha/cataloguing/z3950_auth_search.pl?authid=[% authid %]","z3950search",'width=800,height=500,location=yes,toolbar=no,scrollbars=yes,resize=yes');
71
    });
72
            }
72
73
        [% ELSE %]
73
    $("#z3950_replace").click(function(e){
74
            window.open("/cgi-bin/koha/cataloguing/z3950_auth_search.pl","z3950search",'width=800,height=500,location=yes,toolbar=no,scrollbars=yes,resize=yes');
74
        e.preventDefault();
75
        [% END %]
75
        window.open("/cgi-bin/koha/cataloguing/z3950_auth_search.pl?authid=[% authid %]","z3950search",'width=800,height=500,location=yes,toolbar=no,scrollbars=yes,resize=yes');
76
        return false;
77
    });
76
    });
78
77
79
    var searchType = '[% marclist %]';
78
    var searchType = '[% marclist %]';
Lines 89-92 $(document).ready(function () { Link Here
89
88
90
});
89
});
91
90
92
</script>
91
</script>
93
- 

Return to bug 15360