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 404-419 if ($op eq "show"){ Link Here
404
        # Even if we do not display the items, we need the itemnumbers
404
        # Even if we do not display the items, we need the itemnumbers
405
        $template->param(itemnumbers_array => \@itemnumbers);
405
        $template->param(itemnumbers_array => \@itemnumbers);
406
    }
406
    }
407
407
    # now, build the item form for entering a new item
408
    # now, build the item form for entering a new item
408
    my @loop_data =();
409
    my @loop_data =();
409
    my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : "";
410
    my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : "";
410
411
411
    my $libraries = Koha::Libraries->search({}, { order_by => ['branchname'] })->unblessed;# build once ahead of time, instead of multiple times later.
412
413
    # Adding a default choice, in case the user does not want to modify the branch
414
    my $nochange_branch = { branchname => '', value => '', selected => 1 };
415
    unshift (@$libraries, $nochange_branch);
416
417
    my $pref_itemcallnumber = C4::Context->preference('itemcallnumber');
412
    my $pref_itemcallnumber = C4::Context->preference('itemcallnumber');
418
413
419
    # Getting list of subfields to keep when restricted batchmod edit is enabled
414
    # Getting list of subfields to keep when restricted batchmod edit is enabled
Lines 429-439 if ($op eq "show"){ Link Here
429
            ),
424
            ),
430
            subfields_to_ignore         => ['items.barcode'],
425
            subfields_to_ignore         => ['items.barcode'],
431
            prefill_with_default_values => $use_default_values,
426
            prefill_with_default_values => $use_default_values,
427
            default_branches_empty      => 1,
432
        }
428
        }
433
    );
429
    );
434
430
435
436
437
    # what's the next op ? it's what we are not in : an add if we're editing, otherwise, and edit.
431
    # what's the next op ? it's what we are not in : an add if we're editing, otherwise, and edit.
438
    $template->param(
432
    $template->param(
439
        subfields           => $subfields,
433
        subfields           => $subfields,
440
- 

Return to bug 28445