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

(-)a/Koha/Template/Plugin/Biblio.pm (+6 lines)
Lines 65-68 sub RecallsCount { Link Here
65
    return $recalls->count;
65
    return $recalls->count;
66
}
66
}
67
67
68
sub DefaultFramework {
69
    my ($self) = @_;
70
71
    return Koha::BiblioFrameworks->get_default;
72
}
73
68
1;
74
1;
(-)a/cataloguing/addbiblio.pl (-7 lines)
Lines 807-819 if ( $record ne '-1' ) { Link Here
807
    my $title = C4::Context->preference('marcflavour') eq "UNIMARC" ? $record->subfield('200', 'a') : $record->title;
807
    my $title = C4::Context->preference('marcflavour') eq "UNIMARC" ? $record->subfield('200', 'a') : $record->title;
808
    $template->param( title => $title );
808
    $template->param( title => $title );
809
}
809
}
810
my $default_framework = Koha::BiblioFrameworks->get_default;
811
if (   defined $default_framework
812
    && defined $frameworkcode
813
    && $frameworkcode eq '' )
814
{
815
    $frameworkcode = $default_framework->frameworkcode;
816
}
817
$template->param(
810
$template->param(
818
    popup => $mode,
811
    popup => $mode,
819
    frameworkcode => $frameworkcode,
812
    frameworkcode => $frameworkcode,
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc (-1 / +6 lines)
Lines 1-4 Link Here
1
[% USE Context %]
1
[% USE Context %]
2
[% USE Biblio %]
2
[% INCLUDE 'blocking_errors.inc' %]
3
[% INCLUDE 'blocking_errors.inc' %]
3
<div id="toolbar" class="btn-toolbar">
4
<div id="toolbar" class="btn-toolbar">
4
5
Lines 7-13 Link Here
7
    <button class="btn btn-default dropdown-toggle" data-toggle="dropdown"><i class="fa fa-plus"></i> New <span class="caret"></span></button>
8
    <button class="btn btn-default dropdown-toggle" data-toggle="dropdown"><i class="fa fa-plus"></i> New <span class="caret"></span></button>
8
        <ul class="dropdown-menu">
9
        <ul class="dropdown-menu">
9
            [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
10
            [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
10
             <li><a id="newbiblio" href="/cgi-bin/koha/cataloguing/addbiblio.pl">New record</a></li>
11
                [% IF Biblio.DefaultFramework %]
12
                    <li><a id="newbiblio" href="/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=[% Biblio.DefaultFramework.frameworkcode | html %]">New record</a></li>
13
                [% ELSE %]
14
                    <li><a id="newbiblio" href="/cgi-bin/koha/cataloguing/addbiblio.pl">New record</a></li>
15
                [% END %]
11
            [% END %]
16
            [% END %]
12
17
13
            [% IF ( CAN_user_editcatalogue_edit_items ) %]
18
            [% IF ( CAN_user_editcatalogue_edit_items ) %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/cataloging-home.tt (-3 / +6 lines)
Lines 39-45 Link Here
39
                        <ul class="dropdown-menu">
39
                        <ul class="dropdown-menu">
40
                            <li><a id="newRecordDefault" href="/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=">Default framework</a></li>
40
                            <li><a id="newRecordDefault" href="/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=">Default framework</a></li>
41
                            [% FOREACH framework IN frameworks %]
41
                            [% FOREACH framework IN frameworks %]
42
                            <li><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=[% framework.frameworkcode | uri %]">[% framework.frameworktext | html %]</a></li>
42
                                [% IF framework.is_default %]
43
                                    <li><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=[% framework.frameworkcode | uri %]" id="default-framework">[% framework.frameworktext | html %]</a></li>
44
                                [% ELSE %]
45
                                    <li><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=[% framework.frameworkcode | uri %]">[% framework.frameworktext | html %]</a></li>
46
                                [% END %]
43
                            [% END %]
47
                            [% END %]
44
                        </ul>
48
                        </ul>
45
                    </div>
49
                    </div>
Lines 233-239 Link Here
233
    $(document).ready(function() {
237
    $(document).ready(function() {
234
238
235
        $("#newRecord").click(function(){
239
        $("#newRecord").click(function(){
236
            var url = $("a#newRecordDefault").prop("href");
240
            var url = $("#default-framework") ? $("#default-framework").prop("href") : $("a#newRecordDefault").prop("href");
237
            window.location.href = url;
241
            window.location.href = url;
238
            return false;
242
            return false;
239
        });
243
        });
240
- 

Return to bug 23111