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

(-)a/cataloguing/addbiblio.pl (-3 / +9 lines)
Lines 519-526 $op = $input->param('op') // q{}; Link Here
519
$frameworkcode = &GetFrameworkCode($biblionumber)
519
$frameworkcode = &GetFrameworkCode($biblionumber)
520
  if ( $biblionumber and not( defined $frameworkcode) and $op ne 'cud-addbiblio' );
520
  if ( $biblionumber and not( defined $frameworkcode) and $op ne 'cud-addbiblio' );
521
521
522
my $is_fast_add = 
523
    defined $frameworkcode && $frameworkcode ne ''
524
    ? Koha::BiblioFrameworks->find($frameworkcode)->is_fast_add
525
    : 0;
526
522
my $userflags =
527
my $userflags =
523
    $frameworkcode eq 'FA'
528
    $frameworkcode eq 'FA' || $is_fast_add
524
    ? [ 'fast_cataloging', 'edit_catalogue' ]
529
    ? [ 'fast_cataloging', 'edit_catalogue' ]
525
    : 'edit_catalogue';
530
    : 'edit_catalogue';
526
531
Lines 567-573 if ($biblionumber) { Link Here
567
    }
572
    }
568
}
573
}
569
574
570
if ($frameworkcode eq 'FA'){
575
if ($frameworkcode eq 'FA' || $is_fast_add){
571
    # We need to grab and set some variables in the template for use on the additems screen
576
    # We need to grab and set some variables in the template for use on the additems screen
572
    $template->param(
577
    $template->param(
573
        'circborrowernumber' => $fa_circborrowernumber,
578
        'circborrowernumber' => $fa_circborrowernumber,
Lines 721-727 if ( $op eq "cud-addbiblio" ) { Link Here
721
            ( $biblionumber, $oldbibitemnum ) = AddBiblio( $record, $frameworkcode );
726
            ( $biblionumber, $oldbibitemnum ) = AddBiblio( $record, $frameworkcode );
722
        }
727
        }
723
        if ($redirect eq "items" || ($mode ne "popup" && !$is_a_modif && $redirect ne "view" && $redirect ne "just_save")){
728
        if ($redirect eq "items" || ($mode ne "popup" && !$is_a_modif && $redirect ne "view" && $redirect ne "just_save")){
724
	    if ($frameworkcode eq 'FA'){
729
        if ($frameworkcode eq 'FA' || $is_fast_add){
725
		print $input->redirect(
730
		print $input->redirect(
726
            '/cgi-bin/koha/cataloguing/additem.pl?'
731
            '/cgi-bin/koha/cataloguing/additem.pl?'
727
            .'biblionumber='.$biblionumber
732
            .'biblionumber='.$biblionumber
Lines 861-866 if ( $record ne '-1' ) { Link Here
861
$template->param(
866
$template->param(
862
    popup => $mode,
867
    popup => $mode,
863
    frameworkcode => $frameworkcode,
868
    frameworkcode => $frameworkcode,
869
    is_fast_add => $is_fast_add,
864
    itemtype => $frameworkcode,
870
    itemtype => $frameworkcode,
865
    borrowernumber => $loggedinuser,
871
    borrowernumber => $loggedinuser,
866
    tab => scalar $input->param('tab')
872
    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 912-918 $(document).ready(function(){ Link Here
912
                [% END %]
912
                [% END %]
913
913
914
                <div id="toolbar" class="btn-toolbar sticky">
914
                <div id="toolbar" class="btn-toolbar sticky">
915
                    [% IF CAN_user_editcatalogue_edit_items or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) %]
915
                    [% IF CAN_user_editcatalogue_edit_items or ( frameworkcode == 'FA' || is_fast_add and CAN_user_editcatalogue_fast_cataloging ) %]
916
                        [% IF (circborrowernumber) %][%# fast cataloging must lead to items %]
916
                        [% IF (circborrowernumber) %][%# fast cataloging must lead to items %]
917
                            <!-- Action is under fast cataloging - Save button redirecting to items -->
917
                            <!-- Action is under fast cataloging - Save button redirecting to items -->
918
                            <div class="btn-group"><a href="#" id="saveanditems" class="btn btn-primary"><i class="fa fa-save"></i> Save</a></div>
918
                            <div class="btn-group"><a href="#" id="saveanditems" class="btn btn-primary"><i class="fa fa-save"></i> Save</a></div>
919
- 

Return to bug 32773