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

(-)a/C4/Auth.pm (-3 / +37 lines)
Lines 72-80 BEGIN { Link Here
72
    @ISA = qw(Exporter);
72
    @ISA = qw(Exporter);
73
73
74
    @EXPORT_OK = qw(
74
    @EXPORT_OK = qw(
75
      checkauth check_api_auth get_session check_cookie_auth checkpw checkpw_internal checkpw_hash
75
        checkauth check_api_auth get_session check_cookie_auth checkpw checkpw_internal checkpw_hash
76
      get_all_subpermissions get_user_subpermissions track_login_daily in_iprange
76
        get_all_subpermissions get_cataloguing_page_permissions get_user_subpermissions track_login_daily in_iprange
77
      get_template_and_user haspermission create_basic_session
77
        get_template_and_user haspermission create_basic_session
78
    );
78
    );
79
79
80
    $ldap      = C4::Context->config('useldapserver') || 0;
80
    $ldap      = C4::Context->config('useldapserver') || 0;
Lines 471-477 sub get_template_and_user { Link Here
471
        minPasswordLength  => $minPasswordLength,
471
        minPasswordLength  => $minPasswordLength,
472
    );
472
    );
473
    if ( $in->{'type'} eq "intranet" ) {
473
    if ( $in->{'type'} eq "intranet" ) {
474
474
        $template->param(
475
        $template->param(
476
            can_see_cataloguing_module => haspermission( $user, get_cataloguing_page_permissions() ) ? 1 : 0,
475
            AmazonCoverImages                                                          => C4::Context->preference("AmazonCoverImages"),
477
            AmazonCoverImages                                                          => C4::Context->preference("AmazonCoverImages"),
476
            AutoLocation                                                               => C4::Context->preference("AutoLocation"),
478
            AutoLocation                                                               => C4::Context->preference("AutoLocation"),
477
            PatronAutoComplete                                                         => C4::Context->preference("PatronAutoComplete"),
479
            PatronAutoComplete                                                         => C4::Context->preference("PatronAutoComplete"),
Lines 2185-2190 sub get_all_subpermissions { Link Here
2185
    return $all_perms;
2187
    return $all_perms;
2186
}
2188
}
2187
2189
2190
=head2 get_cataloguing_page_permissions
2191
2192
    my $required_permissions = get_cataloguing_page_permissions();
2193
2194
Returns the required permissions to access the main cataloguing page. Useful for building
2195
the global I<can_see_cataloguing_module> template variable, and also for reusing in
2196
I<cataloging-home.pl>.
2197
2198
=cut
2199
2200
sub get_cataloguing_page_permissions {
2201
2202
    my @cataloguing_tools_subperms = qw(
2203
        inventory
2204
        items_batchdel
2205
        items_batchmod
2206
        items_batchmod
2207
        label_creator
2208
        manage_staged_marc
2209
        marc_modification_templates
2210
        records_batchdel
2211
        records_batchmod
2212
        stage_marc_import
2213
        upload_cover_images
2214
    );
2215
2216
    return [
2217
        { editcatalogue => '*' }, { tools => \@cataloguing_tools_subperms },
2218
        C4::Context->preference('StockRotation') ? { stockrotation => 'manage_rotas' } : ()
2219
    ];
2220
}
2221
2188
=head2 haspermission
2222
=head2 haspermission
2189
2223
2190
  $flagsrequired = '*';                                 # Any permission at all
2224
  $flagsrequired = '*';                                 # Any permission at all
(-)a/cataloguing/cataloging-home.pl (-6 / +6 lines)
Lines 18-24 Link Here
18
18
19
use Modern::Perl;
19
use Modern::Perl;
20
use CGI qw ( -utf8 );
20
use CGI qw ( -utf8 );
21
use C4::Auth qw( get_template_and_user );
21
use C4::Auth qw( get_cataloguing_page_permissions get_template_and_user );
22
use C4::Output qw( output_html_with_http_headers );
22
use C4::Output qw( output_html_with_http_headers );
23
use C4::Context;
23
use C4::Context;
24
24
Lines 26-37 use Koha::BiblioFrameworks; Link Here
26
use Koha::Z3950Servers;
26
use Koha::Z3950Servers;
27
27
28
my $query = CGI->new;
28
my $query = CGI->new;
29
my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user(
29
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
30
    {
30
    {
31
        template_name   => "cataloguing/cataloging-home.tt",
31
        template_name => "cataloguing/cataloging-home.tt",
32
        query           => $query,
32
        query         => $query,
33
        type            => "intranet",
33
        type          => "intranet",
34
        flagsrequired   => { editcatalogue => '*' },
34
        flagsrequired => get_cataloguing_page_permissions(),
35
    }
35
    }
36
);
36
);
37
37
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc (-1 / +1 lines)
Lines 30-36 Link Here
30
                <a href="/cgi-bin/koha/mainpage.pl" class="dropdown-toggle" data-toggle="dropdown">More <b class="caret"></b></a>
30
                <a href="/cgi-bin/koha/mainpage.pl" class="dropdown-toggle" data-toggle="dropdown">More <b class="caret"></b></a>
31
                <ul class="dropdown-menu dropdown-menu-right">
31
                <ul class="dropdown-menu dropdown-menu-right">
32
                    <li><a href="/cgi-bin/koha/virtualshelves/shelves.pl">Lists</a></li>
32
                    <li><a href="/cgi-bin/koha/virtualshelves/shelves.pl">Lists</a></li>
33
                    [% IF ( CAN_user_editcatalogue_edit_catalogue || CAN_user_editcatalogue_edit_items ) %]
33
                    [% IF ( CAN_user_editcatalogue_edit_catalogue || CAN_user_editcatalogue_edit_items || can_see_cataloguing_module ) %]
34
                        <li><a href="/cgi-bin/koha/cataloguing/cataloging-home.pl">Cataloging</a></li>
34
                        <li><a href="/cgi-bin/koha/cataloguing/cataloging-home.pl">Cataloging</a></li>
35
                    [% END %]
35
                    [% END %]
36
                    [% IF ( CAN_user_acquisition ) %]
36
                    [% IF ( CAN_user_acquisition ) %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt (-2 / +1 lines)
Lines 124-130 Link Here
124
                            </li>
124
                            </li>
125
                            [% END %]
125
                            [% END %]
126
126
127
                            [% IF ( CAN_user_editcatalogue_edit_catalogue || CAN_user_editcatalogue_edit_items || ( fast_cataloging && CAN_user_editcatalogue_fast_cataloging ) ) %]
127
                            [% IF ( CAN_user_editcatalogue_edit_catalogue || CAN_user_editcatalogue_edit_items || ( fast_cataloging && CAN_user_editcatalogue_fast_cataloging || can_see_cataloguing_module ) ) %]
128
                            <li>
128
                            <li>
129
                                <a class="icon_general icon_cataloging" href="/cgi-bin/koha/cataloguing/cataloging-home.pl"><i class="fa fa-fw fa-tag"></i>Cataloging</a>
129
                                <a class="icon_general icon_cataloging" href="/cgi-bin/koha/cataloguing/cataloging-home.pl"><i class="fa fa-fw fa-tag"></i>Cataloging</a>
130
                            </li>
130
                            </li>
131
- 

Return to bug 34288