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

(-)a/cataloguing/addbiblio.pl (-1 / +1 lines)
Lines 734-740 if ($frameworkcode eq 'FA'){ Link Here
734
        'stickyduedate'      => $fa_stickyduedate,
734
        'stickyduedate'      => $fa_stickyduedate,
735
        'duedatespec'        => $fa_duedatespec,
735
        'duedatespec'        => $fa_duedatespec,
736
    );
736
    );
737
} elsif ( $op ne "delete" && C4::Context->preference('EnableAdvancedCatalogingEditor') && $input->cookie( 'catalogue_editor_' . $loggedinuser ) eq 'advanced' && !$breedingid ) {
737
} elsif ( $op ne "delete" && C4::Context->preference('EnableAdvancedCatalogingEditor') && C4::Auth::haspermission($loggedinuser,{'editcatalogue'=>'advanced_editor'}) && $input->cookie( 'catalogue_editor_' . $loggedinuser ) eq 'advanced' && !$breedingid ) {
738
    # Only use the advanced editor for non-fast-cataloging.
738
    # Only use the advanced editor for non-fast-cataloging.
739
    # breedingid is not handled because those would only come off a Z39.50
739
    # breedingid is not handled because those would only come off a Z39.50
740
    # search initiated by the basic editor.
740
    # search initiated by the basic editor.
(-)a/cataloguing/editor.pl (-1 / +3 lines)
Lines 40-46 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
40
        query           => $input,
40
        query           => $input,
41
        type            => 'intranet',
41
        type            => 'intranet',
42
        authnotrequired => 0,
42
        authnotrequired => 0,
43
        flagsrequired   => { editcatalogue => 'edit_catalogue' },
43
        flagsrequired   => {
44
            editcatalogue => ['edit_catalogue','advanced_editor'],
45
        }
44
    }
46
    }
45
);
47
);
46
48
(-)a/installer/data/mysql/atomicupdate/bug20128_add_permission_for_advanced_editor.perl (+16 lines)
Line 0 Link Here
1
$DBversion = 'XXX';
2
if( CheckVersion( $DBversion ) ) {
3
    $dbh->do(q{
4
        INSERT IGNORE permissions (module_bit, code, description)
5
        VALUES
6
        (9,'advanced_editor','Use the advanced cataloging editor')
7
    });
8
    if( C4::Context->preference('EnableAdvancedCatalogingEditor') ){
9
        $dbh->do(q{
10
            INSERT INTO user_permissions (borrowernumber, module_bit, code)
11
            SELECT borrowernumber, 9, 'advanced_editor' FROM borrowers WHERE borrowernumber IN (SELECT DISTINCT borrowernumber FROM user_permissions WHERE code = 'edit_catalogue');
12
        });
13
    }
14
    SetVersion( $DBversion );
15
    print "Upgrade to $DBversion done (Bug 20128: Add permission for Advanced Cataloging Editor)\n";
16
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc (+1 lines)
Lines 65-70 Link Here
65
    [%- CASE 'place_holds' -%]<span>Place holds for patrons</span>
65
    [%- CASE 'place_holds' -%]<span>Place holds for patrons</span>
66
    [%- CASE 'delete_all_items' -%]<span>Delete all items at once</span>
66
    [%- CASE 'delete_all_items' -%]<span>Delete all items at once</span>
67
    [%- CASE 'edit_catalogue' -%]<span>Edit catalog (Modify bibliographic/holdings data)</span>
67
    [%- CASE 'edit_catalogue' -%]<span>Edit catalog (Modify bibliographic/holdings data)</span>
68
    [%- CASE 'advanced_editor' -%]<span>Use the advanced cataloging editor (requires edit_catalogue)</span>
68
    [%- CASE 'edit_items' -%]<span>Edit items</span>
69
    [%- CASE 'edit_items' -%]<span>Edit items</span>
69
    [%- CASE 'edit_items_restricted' -%]<span>Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEditing preference (please note that edit_item is still required)</span>
70
    [%- CASE 'edit_items_restricted' -%]<span>Limit item modification to subfields defined in the SubfieldsToAllowForRestrictedEditing preference (please note that edit_item is still required)</span>
70
    [%- CASE 'fast_cataloging' -%]<span>Fast cataloging</span>
71
    [%- CASE 'fast_cataloging' -%]<span>Fast cataloging</span>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt (-1 / +1 lines)
Lines 488-494 function Changefwk() { Link Here
488
    <div class="btn-group">
488
    <div class="btn-group">
489
        <button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown"><i class="fa fa-cog"></i> Settings <span class="caret"></span></button>
489
        <button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown"><i class="fa fa-cog"></i> Settings <span class="caret"></span></button>
490
        <ul id="settings-menu" class="dropdown-menu">
490
        <ul id="settings-menu" class="dropdown-menu">
491
            [% IF Koha.Preference( 'EnableAdvancedCatalogingEditor' ) == 1 %]
491
            [% IF Koha.Preference( 'EnableAdvancedCatalogingEditor' ) == 1 && CAN_user_editcatalogue_advanced_editor %]
492
                <li><a href="#" id="switcheditor">Switch to advanced editor</a></li>
492
                <li><a href="#" id="switcheditor">Switch to advanced editor</a></li>
493
            [% END %]
493
            [% END %]
494
            [% IF marcflavour != 'NORMARC' AND NOT advancedMARCEditor %]
494
            [% IF marcflavour != 'NORMARC' AND NOT advancedMARCEditor %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt (-2 / +1 lines)
Lines 18-24 Link Here
18
18
19
[% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
19
[% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
20
  <div id="toolbar" class="btn-toolbar">
20
  <div id="toolbar" class="btn-toolbar">
21
        [% IF Koha.Preference( 'EnableAdvancedCatalogingEditor' ) == 1 %]
21
        [% IF Koha.Preference( 'EnableAdvancedCatalogingEditor' ) == 1 && CAN_user_editcatalogue_advanced_editor %]
22
            <a id="useadvanced" href="/cgi-bin/koha/cataloguing/editor.pl" class="btn btn-default btn-sm"><i class="fa fa-pencil"></i> Advanced editor</a>
22
            <a id="useadvanced" href="/cgi-bin/koha/cataloguing/editor.pl" class="btn btn-default btn-sm"><i class="fa fa-pencil"></i> Advanced editor</a>
23
        [% END %]
23
        [% END %]
24
        <div class="btn-group">
24
        <div class="btn-group">
25
- 

Return to bug 20128