Bugzilla – Attachment 126329 Details for
Bug 28445
Use the task queue for the batch delete and update items tool
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28445: Start form with empty library for batch mod
Bug-28445-Start-form-with-empty-library-for-batch-.patch (text/plain), 3.55 KB, created by
Jonathan Druart
on 2021-10-15 14:02:19 UTC
(
hide
)
Description:
Bug 28445: Start form with empty library for batch mod
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-10-15 14:02:19 UTC
Size:
3.55 KB
patch
obsolete
>From 4bd0e7ee5fd1be7f0ed6f7a2f3bc5e88c47daa38 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 20 Jul 2021 17:44:20 +0200 >Subject: [PATCH] Bug 28445: Start form with empty library for batch mod > >--- > Koha/UI/Form/Builder/Item.pm | 4 ++++ > tools/batchMod.pl | 10 ++-------- > 2 files changed, 6 insertions(+), 8 deletions(-) > >diff --git a/Koha/UI/Form/Builder/Item.pm b/Koha/UI/Form/Builder/Item.pm >index 20d2d828edf..9c10032a760 100644 >--- a/Koha/UI/Form/Builder/Item.pm >+++ b/Koha/UI/Form/Builder/Item.pm >@@ -81,6 +81,7 @@ sub generate_subfield_form { > my $restricted_edition = $params->{restricted_editition}; > my $prefill_with_default_values = $params->{prefill_with_default_values}; > my $branch_limit = $params->{branch_limit}; >+ my $default_branches_empty = $params->{default_branches_empty}; > > my $item = $self->{item}; > my $subfield = $tagslib->{$tag}{$subfieldtag}; >@@ -190,6 +191,7 @@ sub generate_subfield_form { > } > } > elsif ( $subfield->{authorised_value} eq "branches" ) { >+ push @authorised_values, "" if $default_branches_empty; > foreach my $thisbranch (@$libraries) { > push @authorised_values, $thisbranch->{branchcode}; > $authorised_lib{ $thisbranch->{branchcode} } = >@@ -471,6 +473,7 @@ sub edit_form { > my $subfields_to_ignore= $params->{subfields_to_ignore} || []; > my $prefill_with_default_values = $params->{prefill_with_default_values}; > my $branch_limit = $params->{branch_limit}; >+ my $default_branches_empty = $params->{default_branches_empty}; > > my $libraries = > Koha::Libraries->search( {}, { order_by => ['branchname'] } )->unblessed; >@@ -542,6 +545,7 @@ sub edit_form { > restricted_edition => $restricted_edition, > prefill_with_default_values => $prefill_with_default_values, > branch_limit => $branch_limit, >+ default_branches_empty => $default_branches_empty, > } > ); > push @subfields, $subfield_data; >diff --git a/tools/batchMod.pl b/tools/batchMod.pl >index acbbf295a64..0988571b5d4 100755 >--- a/tools/batchMod.pl >+++ b/tools/batchMod.pl >@@ -404,16 +404,11 @@ if ($op eq "show"){ > # Even if we do not display the items, we need the itemnumbers > $template->param(itemnumbers_array => \@itemnumbers); > } >+ > # now, build the item form for entering a new item > my @loop_data =(); > my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : ""; > >- my $libraries = Koha::Libraries->search({}, { order_by => ['branchname'] })->unblessed;# build once ahead of time, instead of multiple times later. >- >- # Adding a default choice, in case the user does not want to modify the branch >- my $nochange_branch = { branchname => '', value => '', selected => 1 }; >- unshift (@$libraries, $nochange_branch); >- > my $pref_itemcallnumber = C4::Context->preference('itemcallnumber'); > > # Getting list of subfields to keep when restricted batchmod edit is enabled >@@ -429,11 +424,10 @@ if ($op eq "show"){ > ), > subfields_to_ignore => ['items.barcode'], > prefill_with_default_values => $use_default_values, >+ default_branches_empty => 1, > } > ); > >- >- > # what's the next op ? it's what we are not in : an add if we're editing, otherwise, and edit. > $template->param( > subfields => $subfields, >-- >2.25.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 28445
:
121372
|
123221
|
123222
|
123223
|
123224
|
123225
|
123226
|
123227
|
123228
|
123229
|
123239
|
123240
|
125801
|
125802
|
125803
|
125804
|
125805
|
125808
|
125810
|
125811
|
125812
|
125817
|
125865
|
126046
|
126047
|
126136
|
126137
|
126138
|
126139
|
126140
|
126141
|
126142
|
126217
|
126218
|
126219
|
126223
|
126328
|
126329
|
126330
|
126331
|
126332
|
126333
|
126334
|
126335
|
126336
|
126337
|
126338
|
126339
|
126352
|
126353
|
126354
|
126355
|
126356
|
126357
|
126358
|
126359
|
126360
|
126361
|
126362
|
126363
|
126364
|
126365
|
126366
|
126367
|
126374
|
126375
|
126376
|
126377
|
126378
|
126379
|
126380
|
126381
|
126382
|
126383
|
126384
|
126385
|
126386
|
126387
|
126388
|
126389
|
127033
|
127037
|
127038
|
127039
|
128007
|
128008
|
128009