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

(-)a/Koha/Biblio.pm (-1 / +7 lines)
Lines 42-47 use Koha::Biblio::Metadatas; Link Here
42
use Koha::Biblio::Metadata::Extractor;
42
use Koha::Biblio::Metadata::Extractor;
43
use Koha::Biblio::ItemGroups;
43
use Koha::Biblio::ItemGroups;
44
use Koha::Biblioitems;
44
use Koha::Biblioitems;
45
use Koha::BiblioFrameworks;
45
use Koha::Cache::Memory::Lite;
46
use Koha::Cache::Memory::Lite;
46
use Koha::Bookings;
47
use Koha::Bookings;
47
use Koha::Checkouts;
48
use Koha::Checkouts;
Lines 329-336 sub can_be_edited { Link Here
329
    Koha::Exceptions::MissingParameter->throw( error => "The patron parameter is missing or invalid" )
330
    Koha::Exceptions::MissingParameter->throw( error => "The patron parameter is missing or invalid" )
330
        unless $patron && ref($patron) eq 'Koha::Patron';
331
        unless $patron && ref($patron) eq 'Koha::Patron';
331
332
333
    my $is_fast_add =
334
        defined $self->frameworkcode && $self->frameworkcode ne ''
335
        ? Koha::BiblioFrameworks->find( $self->frameworkcode )->is_fast_add
336
        : 0;
337
332
    my $editcatalogue =
338
    my $editcatalogue =
333
        $self->frameworkcode eq 'FA'
339
        $is_fast_add
334
        ? [ 'fast_cataloging', 'edit_catalogue' ]
340
        ? [ 'fast_cataloging', 'edit_catalogue' ]
335
        : 'edit_catalogue';
341
        : 'edit_catalogue';
336
342
(-)a/catalogue/detail.pl (-3 / +10 lines)
Lines 47-52 use Koha::AuthorisedValues; Link Here
47
use Koha::Biblios;
47
use Koha::Biblios;
48
use Koha::Biblio::ItemGroup::Items;
48
use Koha::Biblio::ItemGroup::Items;
49
use Koha::Biblio::ItemGroups;
49
use Koha::Biblio::ItemGroups;
50
use Koha::BiblioFrameworks;
50
use Koha::CoverImages;
51
use Koha::CoverImages;
51
use Koha::DateUtils;
52
use Koha::DateUtils;
52
use Koha::Database::DataInconsistency;
53
use Koha::Database::DataInconsistency;
Lines 91-101 if ( C4::Context->config('enable_plugins') ) { Link Here
91
my $activetab    = $query->param('activetab');
92
my $activetab    = $query->param('activetab');
92
my $biblionumber = $query->param('biblionumber');
93
my $biblionumber = $query->param('biblionumber');
93
$biblionumber = HTML::Entities::encode($biblionumber);
94
$biblionumber = HTML::Entities::encode($biblionumber);
94
my $biblio = Koha::Biblios->find($biblionumber);
95
my $biblio        = Koha::Biblios->find($biblionumber);
96
my $frameworkcode = $biblio->frameworkcode;
97
my $is_fast_add =
98
    $frameworkcode eq ''
99
    ? 0
100
    : Koha::BiblioFrameworks->find($frameworkcode)->is_fast_add;
95
101
96
$template->param(
102
$template->param(
97
    biblio    => $biblio,
103
    biblio      => $biblio,
98
    activetab => $activetab,
104
    activetab   => $activetab,
105
    is_fast_add => $is_fast_add,
99
);
106
);
100
107
101
unless ($biblio) {
108
unless ($biblio) {
(-)a/catalogue/moredetail.pl (-1 / +7 lines)
Lines 32-37 use C4::Search qw( enabled_staff_search_views z3950_search_args ); Link Here
32
use Koha::Acquisition::Booksellers;
32
use Koha::Acquisition::Booksellers;
33
use Koha::AuthorisedValues;
33
use Koha::AuthorisedValues;
34
use Koha::Biblios;
34
use Koha::Biblios;
35
use Koha::BiblioFrameworks;
35
use Koha::Items;
36
use Koha::Items;
36
use Koha::Patrons;
37
use Koha::Patrons;
37
38
Lines 106-112 my $record = $biblio ? $biblio->metadata->record : undef; Link Here
106
output_and_exit( $query, $cookie, $template, 'unknown_biblio' )
107
output_and_exit( $query, $cookie, $template, 'unknown_biblio' )
107
    unless $biblio && $record;
108
    unless $biblio && $record;
108
109
109
my $fw        = GetFrameworkCode($biblionumber);
110
my $fw = $biblio->frameworkcode;
111
my $is_fast_add =
112
    $fw eq ''
113
    ? 0
114
    : Koha::BiblioFrameworks->find($fw)->is_fast_add;
110
my $all_items = $biblio->items->search_ordered;
115
my $all_items = $biblio->items->search_ordered;
111
116
112
my @items;
117
my @items;
Lines 335-340 $template->param( Link Here
335
    itemnumber          => $itemnumber,
340
    itemnumber          => $itemnumber,
336
    z3950_search_params => C4::Search::z3950_search_args( GetBiblioData($biblionumber) ),
341
    z3950_search_params => C4::Search::z3950_search_args( GetBiblioData($biblionumber) ),
337
    biblio              => $biblio,
342
    biblio              => $biblio,
343
    is_fast_add         => $is_fast_add,
338
);
344
);
339
$template->param( ONLY_ONE => 1 ) if ( $itemnumber && $showncount != @items );
345
$template->param( ONLY_ONE => 1 ) if ( $itemnumber && $showncount != @items );
340
$template->{'VARS'}->{'searchid'} = $query->param('searchid');
346
$template->{'VARS'}->{'searchid'} = $query->param('searchid');
(-)a/cataloguing/addbiblio.pl (-3 / +8 lines)
Lines 510-517 $frameworkcode = &GetFrameworkCode($biblionumber) Link Here
510
    if ( $biblionumber and not( defined $frameworkcode ) and $op ne 'cud-addbiblio' );
510
    if ( $biblionumber and not( defined $frameworkcode ) and $op ne 'cud-addbiblio' );
511
$frameworkcode //= '';
511
$frameworkcode //= '';
512
512
513
my $fast_cataloging_mode =
514
    $frameworkcode eq ''
515
    ? 0
516
    : Koha::BiblioFrameworks->find($frameworkcode)->is_fast_add;
517
513
my $userflags =
518
my $userflags =
514
    $frameworkcode eq 'FA'
519
    $fast_cataloging_mode
515
    ? [ 'fast_cataloging', 'edit_catalogue' ]
520
    ? [ 'fast_cataloging', 'edit_catalogue' ]
516
    : 'edit_catalogue';
521
    : 'edit_catalogue';
517
522
Lines 558-564 if ($biblionumber) { Link Here
558
    }
563
    }
559
}
564
}
560
565
561
if ( $frameworkcode eq 'FA' ) {
566
if ($fast_cataloging_mode) {
562
567
563
    # We need to grab and set some variables in the template for use on the additems screen
568
    # We need to grab and set some variables in the template for use on the additems screen
564
    $template->param(
569
    $template->param(
Lines 722-728 if ( $op eq "cud-addbiblio" ) { Link Here
722
        if ( $redirect eq "items"
727
        if ( $redirect eq "items"
723
            || ( $mode ne "popup" && !$is_a_modif && $redirect ne "view" && $redirect ne "just_save" ) )
728
            || ( $mode ne "popup" && !$is_a_modif && $redirect ne "view" && $redirect ne "just_save" ) )
724
        {
729
        {
725
            if ( $frameworkcode eq 'FA' ) {
730
            if ($fast_cataloging_mode) {
726
                print $input->redirect( '/cgi-bin/koha/cataloguing/additem.pl?'
731
                print $input->redirect( '/cgi-bin/koha/cataloguing/additem.pl?'
727
                        . 'biblionumber='
732
                        . 'biblionumber='
728
                        . $biblionumber
733
                        . $biblionumber
(-)a/cataloguing/additem.pl (-8 / +8 lines)
Lines 142-154 my $item_group = $input->param('item_group'); Link Here
142
my $item_group_description = $input->param('item_group_description');
142
my $item_group_description = $input->param('item_group_description');
143
my $display_order          = $input->param('item_group_display_order');
143
my $display_order          = $input->param('item_group_display_order');
144
144
145
our $frameworkcode = &GetFrameworkCode($biblionumber);
145
our $frameworkcode = $biblio->frameworkcode;
146
146
147
# Defining which userflag is needing according to the framework currently used
147
# Defining which userflag is needing according to the framework currently used
148
my $fast_cataloging_mode =
148
my $fast_cataloging_mode =
149
    defined $input->param('frameworkcode')
149
    $frameworkcode eq ''
150
    ? $input->param('frameworkcode') eq 'FA'
150
    ? 0
151
    : $frameworkcode eq 'FA';
151
    : Koha::BiblioFrameworks->find($frameworkcode)->is_fast_add;
152
152
153
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
153
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
154
    {
154
    {
Lines 186-192 $restrictededition = 0 if ( $restrictededition != 0 && C4::Context->IsSuperLibra Link Here
186
# In case user has fast cataloging permission (and we're in fast cataloging), editing is not restricted
186
# In case user has fast cataloging permission (and we're in fast cataloging), editing is not restricted
187
$restrictededition = 0
187
$restrictededition = 0
188
    if ( $restrictededition != 0
188
    if ( $restrictededition != 0
189
    && $frameworkcode eq 'FA'
189
    && $fast_cataloging_mode
190
    && haspermission( $uid, { 'editcatalogue' => 'fast_cataloging' } ) );
190
    && haspermission( $uid, { 'editcatalogue' => 'fast_cataloging' } ) );
191
191
192
our $tagslib = &GetMarcStructure( 1, $frameworkcode );
192
our $tagslib = &GetMarcStructure( 1, $frameworkcode );
Lines 486-492 if ( $op eq "cud-additem" ) { Link Here
486
            undef($current_item);
486
            undef($current_item);
487
        }
487
        }
488
    }
488
    }
489
    if ( $frameworkcode eq 'FA' && $fa_circborrowernumber ) {
489
    if ( $fast_cataloging_mode && $fa_circborrowernumber ) {
490
        print $input->redirect( '/cgi-bin/koha/circ/circulation.pl?'
490
        print $input->redirect( '/cgi-bin/koha/circ/circulation.pl?'
491
                . 'borrowernumber='
491
                . 'borrowernumber='
492
                . $fa_circborrowernumber
492
                . $fa_circborrowernumber
Lines 796-802 my $subfields = Link Here
796
    }
796
    }
797
    );
797
    );
798
798
799
if ( $frameworkcode eq 'FA' ) {
799
if ($fast_cataloging_mode) {
800
    my ($barcode_field) = grep { $_->{kohafield} eq 'items.barcode' } @$subfields;
800
    my ($barcode_field) = grep { $_->{kohafield} eq 'items.barcode' } @$subfields;
801
    $barcode_field->{marc_value}->{value} ||= $input->param('barcode');
801
    $barcode_field->{marc_value}->{value} ||= $input->param('barcode');
802
}
802
}
Lines 826-832 $template->param( Link Here
826
);
826
);
827
$template->{'VARS'}->{'searchid'} = $searchid;
827
$template->{'VARS'}->{'searchid'} = $searchid;
828
828
829
if ( $frameworkcode eq 'FA' ) {
829
if ($fast_cataloging_mode) {
830
830
831
    # fast cataloguing datas
831
    # fast cataloguing datas
832
    $template->param(
832
    $template->param(
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc (-5 / +5 lines)
Lines 33-43 Link Here
33
        </div>
33
        </div>
34
    [% END %]
34
    [% END %]
35
35
36
    [% IF ( CAN_user_editcatalogue_edit_catalogue || CAN_user_editcatalogue_edit_items || CAN_user_tools_items_batchmod || CAN_user_tools_items_batchdel ) or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) %]
36
    [% IF ( CAN_user_editcatalogue_edit_catalogue || CAN_user_editcatalogue_edit_items || CAN_user_tools_items_batchmod || CAN_user_tools_items_batchdel ) || ( CAN_user_editcatalogue_fast_cataloging && is_fast_add ) %]
37
        <div class="btn-group">
37
        <div class="btn-group">
38
            <button class="btn btn-default dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</button>
38
            <button class="btn btn-default dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</button>
39
            <ul class="dropdown-menu">
39
            <ul class="dropdown-menu">
40
                [% IF CAN_user_editcatalogue_edit_catalogue or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) %]
40
                [% IF CAN_user_editcatalogue_edit_catalogue || ( CAN_user_editcatalogue_fast_cataloging && is_fast_add ) %]
41
                    [% IF biblio.can_be_edited(logged_in_user) %]
41
                    [% IF biblio.can_be_edited(logged_in_user) %]
42
                        <li><a class="dropdown-item" id="editbiblio" href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber | html %]">Edit record</a></li>
42
                        <li><a class="dropdown-item" id="editbiblio" href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber | html %]">Edit record</a></li>
43
                    [% ELSE %]
43
                    [% ELSE %]
Lines 57-63 Link Here
57
                    </li>
57
                    </li>
58
                [% END %]
58
                [% END %]
59
59
60
                [% IF CAN_user_editcatalogue_edit_items or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) %]
60
                [% IF CAN_user_editcatalogue_edit_items || ( CAN_user_editcatalogue_fast_cataloging && is_fast_add ) %]
61
                    <li><a class="dropdown-item" id="manageitems" href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblionumber | html %]">Manage items</a></li>
61
                    <li><a class="dropdown-item" id="manageitems" href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblionumber | html %]">Manage items</a></li>
62
                [% END %]
62
                [% END %]
63
63
Lines 126-132 Link Here
126
                    <li><a class="dropdown-item" href="#" id="z3950copy">Replace record via Z39.50/SRU</a></li>
126
                    <li><a class="dropdown-item" href="#" id="z3950copy">Replace record via Z39.50/SRU</a></li>
127
                [% END %]
127
                [% END %]
128
128
129
                [% IF CAN_user_editcatalogue_edit_catalogue or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) %]
129
                [% IF CAN_user_editcatalogue_edit_catalogue || ( CAN_user_editcatalogue_fast_cataloging && is_fast_add ) %]
130
                    [% IF ( count ) %]
130
                    [% IF ( count ) %]
131
                        <li
131
                        <li
132
                            data-bs-toggle="tooltip"
132
                            data-bs-toggle="tooltip"
Lines 157-163 Link Here
157
                    [% END %]
157
                    [% END %]
158
                [% END %]
158
                [% END %]
159
159
160
                [% IF CAN_user_editcatalogue_delete_all_items or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) %]
160
                [% IF CAN_user_editcatalogue_delete_all_items || ( CAN_user_editcatalogue_fast_cataloging && is_fast_add ) %]
161
                    [% IF ( count ) %]
161
                    [% IF ( count ) %]
162
                        <li>
162
                        <li>
163
                            <form action="/cgi-bin/koha/cataloguing/additem.pl" method="post">
163
                            <form action="/cgi-bin/koha/cataloguing/additem.pl" method="post">
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc (-2 / +2 lines)
Lines 43-49 Link Here
43
                [% IF ( analyze ) %]<th id="[% tab | html %]_usedin" data-colname="usedin">Used in</th><th></th>[% END %]
43
                [% IF ( analyze ) %]<th id="[% tab | html %]_usedin" data-colname="usedin">Used in</th><th></th>[% END %]
44
                [% IF Koha.Preference('UseCourseReserves') %]<th id="[% tab | html %]_course_reserves" data-colname="course_reserves">Course reserves</th>[% END %]
44
                [% IF Koha.Preference('UseCourseReserves') %]<th id="[% tab | html %]_course_reserves" data-colname="course_reserves">Course reserves</th>[% END %]
45
                [% IF ( SpineLabelShowPrintOnBibDetails ) %]<th id="[% tab | html %]_spinelabel" data-colname="spinelabel" class="no-sort">Spine label</th>[% END %]
45
                [% IF ( SpineLabelShowPrintOnBibDetails ) %]<th id="[% tab | html %]_spinelabel" data-colname="spinelabel" class="no-sort">Spine label</th>[% END %]
46
                [% IF ( CAN_user_editcatalogue_edit_items ) %]<th id="[% tab | html %]_actions" data-colname="actions" class="no-sort no-export">&nbsp;</th>[% END %]
46
                [% IF ( CAN_user_editcatalogue_edit_items || CAN_user_editcatalogue_fast_cataloging && is_fast_add ) %]<th id="[% tab | html %]_actions" data-colname="actions" class="no-sort no-export">&nbsp;</th>[% END %]
47
            </tr>
47
            </tr>
48
        </thead>
48
        </thead>
49
    </table>
49
    </table>
Lines 851-857 Link Here
851
                    }
851
                    }
852
                },
852
                },
853
                [% END %]
853
                [% END %]
854
                [% IF CAN_user_editcatalogue_edit_items %]
854
                [% IF CAN_user_editcatalogue_edit_items || CAN_user_editcatalogue_fast_cataloging && is_fast_add %]
855
                {
855
                {
856
                    data: function( row, type, val, meta ) {
856
                    data: function( row, type, val, meta ) {
857
                        let nodes = '';
857
                        let nodes = '';
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt (-1 / +1 lines)
Lines 166-172 Link Here
166
                        <h4>
166
                        <h4>
167
                            Item information
167
                            Item information
168
                            [% UNLESS ( ITEM_DAT.nomod ) %]
168
                            [% UNLESS ( ITEM_DAT.nomod ) %]
169
                                [% IF ( CAN_user_editcatalogue_edit_items ) %]
169
                                [% IF ( CAN_user_editcatalogue_edit_items || CAN_user_editcatalogue_fast_cataloging && is_fast_add ) %]
170
                                    <a href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&amp;biblionumber=[% ITEM_DAT.biblionumber | uri %]&amp;itemnumber=[% ITEM_DAT.itemnumber | uri %]"
170
                                    <a href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&amp;biblionumber=[% ITEM_DAT.biblionumber | uri %]&amp;itemnumber=[% ITEM_DAT.itemnumber | uri %]"
171
                                        ><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit item</a
171
                                        ><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit item</a
172
                                    >
172
                                    >
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt (-4 / +3 lines)
Lines 906-912 Link Here
906
                [% END %]
906
                [% END %]
907
907
908
                <div id="toolbar" class="btn-toolbar sticky">
908
                <div id="toolbar" class="btn-toolbar sticky">
909
                    [% IF CAN_user_editcatalogue_edit_items or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) %]
909
                    [% IF CAN_user_editcatalogue_edit_items || ( CAN_user_editcatalogue_fast_cataloging && is_fast_add ) %]
910
                        [% IF (circborrowernumber) %][%# fast cataloging must lead to items %]
910
                        [% IF (circborrowernumber) %][%# fast cataloging must lead to items %]
911
                            <!-- Action is under fast cataloging - Save button redirecting to items -->
911
                            <!-- Action is under fast cataloging - Save button redirecting to items -->
912
                            <div class="btn-group"><a href="#" id="saveanditems" class="btn btn-primary"><i class="fa fa-save"></i> Save</a></div>
912
                            <div class="btn-group"><a href="#" id="saveanditems" class="btn btn-primary"><i class="fa fa-save"></i> Save</a></div>
Lines 961-967 Link Here
961
                                        [% ELSE %]
961
                                        [% ELSE %]
962
                                            <i class="fa fa-fw">&nbsp;</i>
962
                                            <i class="fa fa-fw">&nbsp;</i>
963
                                        [% END %]
963
                                        [% END %]
964
                                        [% !framework ? 'Default' : framework.frameworktext | html %]
964
                                        [% ( !framework ? 'Default' : framework.frameworktext ) | html %]
965
                                    </a>
965
                                    </a>
966
                                </li>
966
                                </li>
967
                            [% END %]
967
                            [% END %]
Lines 973-979 Link Here
973
                                [% END %]
973
                                [% END %]
974
                            [% END %]
974
                            [% END %]
975
                            [% IF CAN_user_editcatalogue_fast_cataloging %]
975
                            [% IF CAN_user_editcatalogue_fast_cataloging %]
976
                                <li><h6 class="dropdown-header">Change Fast Add framework</h6></li>
976
                                <li><h6 class="dropdown-header">Change Fast add framework</h6></li>
977
                                [% FOREACH framework IN frameworks %]
977
                                [% FOREACH framework IN frameworks %]
978
                                    [% IF framework.is_fast_add %][% INCLUDE framework_link %][% END %]
978
                                    [% IF framework.is_fast_add %][% INCLUDE framework_link %][% END %]
979
                                [% END %]
979
                                [% END %]
980
- 

Return to bug 32773