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

(-)a/cataloguing/addbiblio.pl (-3 / +9 lines)
Lines 510-517 $op = $input->param('op') // q{}; Link Here
510
$frameworkcode = &GetFrameworkCode($biblionumber)
510
$frameworkcode = &GetFrameworkCode($biblionumber)
511
    if ( $biblionumber and not( defined $frameworkcode ) and $op ne 'cud-addbiblio' );
511
    if ( $biblionumber and not( defined $frameworkcode ) and $op ne 'cud-addbiblio' );
512
512
513
my $is_fast_add =
514
    defined $frameworkcode && $frameworkcode ne ''
515
    ? Koha::BiblioFrameworks->find($frameworkcode)->is_fast_add
516
    : 0;
517
513
my $userflags =
518
my $userflags =
514
    $frameworkcode eq 'FA'
519
    $frameworkcode eq 'FA' || $is_fast_add
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 ( $frameworkcode eq 'FA' || $is_fast_add ) {
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 720-726 if ( $op eq "cud-addbiblio" ) { Link Here
720
        if ( $redirect eq "items"
725
        if ( $redirect eq "items"
721
            || ( $mode ne "popup" && !$is_a_modif && $redirect ne "view" && $redirect ne "just_save" ) )
726
            || ( $mode ne "popup" && !$is_a_modif && $redirect ne "view" && $redirect ne "just_save" ) )
722
        {
727
        {
723
            if ( $frameworkcode eq 'FA' ) {
728
            if ( $frameworkcode eq 'FA' || $is_fast_add ) {
724
                print $input->redirect( '/cgi-bin/koha/cataloguing/additem.pl?'
729
                print $input->redirect( '/cgi-bin/koha/cataloguing/additem.pl?'
725
                        . 'biblionumber='
730
                        . 'biblionumber='
726
                        . $biblionumber
731
                        . $biblionumber
Lines 874-879 if ( $record ne '-1' ) { Link Here
874
$template->param(
879
$template->param(
875
    popup          => $mode,
880
    popup          => $mode,
876
    frameworkcode  => $frameworkcode,
881
    frameworkcode  => $frameworkcode,
882
    is_fast_add    => $is_fast_add,
877
    itemtype       => $frameworkcode,
883
    itemtype       => $frameworkcode,
878
    borrowernumber => $loggedinuser,
884
    borrowernumber => $loggedinuser,
879
    tab            => scalar $input->param('tab')
885
    tab            => scalar $input->param('tab')
(-)a/cataloguing/additem.pl (-7 / +12 lines)
Lines 33-42 use C4::Members; Link Here
33
use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers );
33
use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers );
34
use C4::Search qw( enabled_staff_search_views );
34
use C4::Search qw( enabled_staff_search_views );
35
use Koha::Biblios;
35
use Koha::Biblios;
36
use Koha::BiblioFrameworks;
36
use Koha::Item::Templates;
37
use Koha::Item::Templates;
37
use Koha::ItemTypes;
38
use Koha::ItemTypes;
38
use Koha::Items;
39
use Koha::Items;
39
use Koha::Items;
40
use Koha::Libraries;
40
use Koha::Libraries;
41
use Koha::Patrons;
41
use Koha::Patrons;
42
use Koha::SearchEngine::Indexer;
42
use Koha::SearchEngine::Indexer;
Lines 143-156 my $display_order = $input->param('item_group_display_order'); Link Here
143
143
144
our $frameworkcode = &GetFrameworkCode($biblionumber);
144
our $frameworkcode = &GetFrameworkCode($biblionumber);
145
145
146
my $is_fast_add =
147
    defined $frameworkcode && $frameworkcode ne ''
148
    ? Koha::BiblioFrameworks->find($frameworkcode)->is_fast_add
149
    : 0;
150
146
# Defining which userflag is needing according to the framework currently used
151
# Defining which userflag is needing according to the framework currently used
147
my $userflags;
152
my $userflags;
148
if ( defined $input->param('frameworkcode') ) {
153
if ( defined $input->param('frameworkcode') ) {
149
    $userflags = ( $input->param('frameworkcode') eq 'FA' ) ? "fast_cataloging" : "edit_items";
154
    $userflags = ( $input->param('frameworkcode') eq 'FA' || $is_fast_add ) ? "fast_cataloging" : "edit_items";
150
}
155
}
151
156
152
if ( not defined $userflags ) {
157
if ( not defined $userflags ) {
153
    $userflags = ( $frameworkcode eq 'FA' ) ? "fast_cataloging" : "edit_items";
158
    $userflags = ( $frameworkcode eq 'FA' || $is_fast_add ) ? "fast_cataloging" : "edit_items";
154
}
159
}
155
160
156
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
161
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
Lines 188-194 $restrictededition = 0 if ( $restrictededition != 0 && C4::Context->IsSuperLibra Link Here
188
# In case user has fast cataloging permission (and we're in fast cataloging), editing is not restricted
193
# In case user has fast cataloging permission (and we're in fast cataloging), editing is not restricted
189
$restrictededition = 0
194
$restrictededition = 0
190
    if ( $restrictededition != 0
195
    if ( $restrictededition != 0
191
    && $frameworkcode eq 'FA'
196
    && ( $frameworkcode eq 'FA' || $is_fast_add )
192
    && haspermission( $uid, { 'editcatalogue' => 'fast_cataloging' } ) );
197
    && haspermission( $uid, { 'editcatalogue' => 'fast_cataloging' } ) );
193
198
194
our $tagslib = &GetMarcStructure( 1, $frameworkcode );
199
our $tagslib = &GetMarcStructure( 1, $frameworkcode );
Lines 488-494 if ( $op eq "cud-additem" ) { Link Here
488
            undef($current_item);
493
            undef($current_item);
489
        }
494
        }
490
    }
495
    }
491
    if ( $frameworkcode eq 'FA' && $fa_circborrowernumber ) {
496
    if ( ( $frameworkcode eq 'FA' || $is_fast_add ) && $fa_circborrowernumber ) {
492
        print $input->redirect( '/cgi-bin/koha/circ/circulation.pl?'
497
        print $input->redirect( '/cgi-bin/koha/circ/circulation.pl?'
493
                . 'borrowernumber='
498
                . 'borrowernumber='
494
                . $fa_circborrowernumber
499
                . $fa_circborrowernumber
Lines 781-787 my $subfields = Link Here
781
    }
786
    }
782
    );
787
    );
783
788
784
if ( $frameworkcode eq 'FA' ) {
789
if ( $frameworkcode eq 'FA' || $is_fast_add ) {
785
    my ($barcode_field) = grep { $_->{kohafield} eq 'items.barcode' } @$subfields;
790
    my ($barcode_field) = grep { $_->{kohafield} eq 'items.barcode' } @$subfields;
786
    $barcode_field->{marc_value}->{value} ||= $input->param('barcode');
791
    $barcode_field->{marc_value}->{value} ||= $input->param('barcode');
787
}
792
}
Lines 811-817 $template->param( Link Here
811
);
816
);
812
$template->{'VARS'}->{'searchid'} = $searchid;
817
$template->{'VARS'}->{'searchid'} = $searchid;
813
818
814
if ( $frameworkcode eq 'FA' ) {
819
if ( $frameworkcode eq 'FA' || $is_fast_add ) {
815
820
816
    # fast cataloguing datas
821
    # fast cataloguing datas
817
    $template->param(
822
    $template->param(
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt (-2 / +1 lines)
Lines 918-924 Link Here
918
                [% END %]
918
                [% END %]
919
919
920
                <div id="toolbar" class="btn-toolbar sticky">
920
                <div id="toolbar" class="btn-toolbar sticky">
921
                    [% IF CAN_user_editcatalogue_edit_items or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) %]
921
                    [% IF CAN_user_editcatalogue_edit_items or ( frameworkcode == 'FA' || is_fast_add and CAN_user_editcatalogue_fast_cataloging ) %]
922
                        [% IF (circborrowernumber) %][%# fast cataloging must lead to items %]
922
                        [% IF (circborrowernumber) %][%# fast cataloging must lead to items %]
923
                            <!-- Action is under fast cataloging - Save button redirecting to items -->
923
                            <!-- Action is under fast cataloging - Save button redirecting to items -->
924
                            <div class="btn-group"><a href="#" id="saveanditems" class="btn btn-primary"><i class="fa fa-save"></i> Save</a></div>
924
                            <div class="btn-group"><a href="#" id="saveanditems" class="btn btn-primary"><i class="fa fa-save"></i> Save</a></div>
925
- 

Return to bug 32773