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

(-)a/Koha/UI/Form/Builder/Item.pm (+4 lines)
Lines 81-86 sub generate_subfield_form { Link Here
81
    my $restricted_edition = $params->{restricted_editition};
81
    my $restricted_edition = $params->{restricted_editition};
82
    my $prefill_with_default_values = $params->{prefill_with_default_values};
82
    my $prefill_with_default_values = $params->{prefill_with_default_values};
83
    my $branch_limit = $params->{branch_limit};
83
    my $branch_limit = $params->{branch_limit};
84
    my $default_branches_empty = $params->{default_branches_empty};
84
85
85
    my $item         = $self->{item};
86
    my $item         = $self->{item};
86
    my $subfield     = $tagslib->{$tag}{$subfieldtag};
87
    my $subfield     = $tagslib->{$tag}{$subfieldtag};
Lines 189-194 sub generate_subfield_form { Link Here
189
            }
190
            }
190
        }
191
        }
191
        elsif ( $subfield->{authorised_value} eq "branches" ) {
192
        elsif ( $subfield->{authorised_value} eq "branches" ) {
193
            push @authorised_values, "" if $default_branches_empty;
192
            foreach my $thisbranch (@$libraries) {
194
            foreach my $thisbranch (@$libraries) {
193
                push @authorised_values, $thisbranch->{branchcode};
195
                push @authorised_values, $thisbranch->{branchcode};
194
                $authorised_lib{ $thisbranch->{branchcode} } =
196
                $authorised_lib{ $thisbranch->{branchcode} } =
Lines 470-475 sub edit_form { Link Here
470
    my $subfields_to_ignore= $params->{subfields_to_ignore} || [];
472
    my $subfields_to_ignore= $params->{subfields_to_ignore} || [];
471
    my $prefill_with_default_values = $params->{prefill_with_default_values};
473
    my $prefill_with_default_values = $params->{prefill_with_default_values};
472
    my $branch_limit = $params->{branch_limit};
474
    my $branch_limit = $params->{branch_limit};
475
    my $default_branches_empty = $params->{default_branches_empty};
473
476
474
    my $libraries =
477
    my $libraries =
475
      Koha::Libraries->search( {}, { order_by => ['branchname'] } )->unblessed;
478
      Koha::Libraries->search( {}, { order_by => ['branchname'] } )->unblessed;
Lines 541-546 sub edit_form { Link Here
541
                        restricted_edition => $restricted_edition,
544
                        restricted_edition => $restricted_edition,
542
                        prefill_with_default_values => $prefill_with_default_values,
545
                        prefill_with_default_values => $prefill_with_default_values,
543
                        branch_limit       => $branch_limit,
546
                        branch_limit       => $branch_limit,
547
                        default_branches_empty => $default_branches_empty,
544
                    }
548
                    }
545
                );
549
                );
546
                push @subfields, $subfield_data;
550
                push @subfields, $subfield_data;
(-)a/tools/batchMod.pl (-9 / +2 lines)
Lines 405-420 if ($op eq "show"){ Link Here
405
        # Even if we do not display the items, we need the itemnumbers
405
        # Even if we do not display the items, we need the itemnumbers
406
        $template->param(itemnumbers_array => \@itemnumbers);
406
        $template->param(itemnumbers_array => \@itemnumbers);
407
    }
407
    }
408
408
    # now, build the item form for entering a new item
409
    # now, build the item form for entering a new item
409
    my @loop_data =();
410
    my @loop_data =();
410
    my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : "";
411
    my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : "";
411
412
412
    my $libraries = Koha::Libraries->search({}, { order_by => ['branchname'] })->unblessed;# build once ahead of time, instead of multiple times later.
413
414
    # Adding a default choice, in case the user does not want to modify the branch
415
    my $nochange_branch = { branchname => '', value => '', selected => 1 };
416
    unshift (@$libraries, $nochange_branch);
417
418
    my $pref_itemcallnumber = C4::Context->preference('itemcallnumber');
413
    my $pref_itemcallnumber = C4::Context->preference('itemcallnumber');
419
414
420
    # Getting list of subfields to keep when restricted batchmod edit is enabled
415
    # Getting list of subfields to keep when restricted batchmod edit is enabled
Lines 430-440 if ($op eq "show"){ Link Here
430
            ),
425
            ),
431
            subfields_to_ignore         => ['items.barcode'],
426
            subfields_to_ignore         => ['items.barcode'],
432
            prefill_with_default_values => $use_default_values,
427
            prefill_with_default_values => $use_default_values,
428
            default_branches_empty      => 1,
433
        }
429
        }
434
    );
430
    );
435
431
436
437
438
    # what's the next op ? it's what we are not in : an add if we're editing, otherwise, and edit.
432
    # what's the next op ? it's what we are not in : an add if we're editing, otherwise, and edit.
439
    $template->param(
433
    $template->param(
440
        subfields           => $subfields,
434
        subfields           => $subfields,
441
- 

Return to bug 28445