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

Return to bug 28445