Bugzilla – Attachment 17870 Details for
Bug 9533
batch item modification should ignore defaults
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9533 - batch item modification should ignore defaults
Bug-9533---batch-item-modification-should-ignore-d.patch (text/plain), 4.07 KB, created by
Kyle M Hall (khall)
on 2013-05-01 15:24:03 UTC
(
hide
)
Description:
Bug 9533 - batch item modification should ignore defaults
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2013-05-01 15:24:03 UTC
Size:
4.07 KB
patch
obsolete
>From b24bf15ca14ccc0d24deb8676396fd70b7622508 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Wed, 17 Apr 2013 09:33:55 -0400 >Subject: [PATCH] Bug 9533 - batch item modification should ignore defaults > >This patch makes the pre-population of the fields for the batch >item editor with the default values from the default framework >optional and off by default. > >Test Plan: >1) Apply patch >2) Add default values for cost and replacement cost to the > default framework. >3) Browse to Tools / Batch item modification >4) Choose a file, or entire some barcodes in the text area >5) Ensure that the 'Populate fields with default values from default > framework' is *not* checked >6) Click 'Continue' >7) Observe that the fields for cost and replacement cost are blank >8) Click the 'back' button on your browser >9) Check the checkbox to enable the default value >10) Click 'Continue' >11) Observe that the fields for cost and replacement cost now contain > the default values you assigned them in the default MARC framework >--- > .../prog/en/modules/tools/batchMod.tt | 14 ++++++++++++++ > tools/batchMod.pl | 7 +++---- > 2 files changed, 17 insertions(+), 4 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod.tt >index ed57366..3f9b313 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod.tt >@@ -43,11 +43,25 @@ > </ol> > </fieldset> > <input type="hidden" name="op" value="show" /> >+ >+ <fieldset class="rows"> >+ <legend>Use default values</legend> >+ <ol class="radio"> >+ <li> >+ <label> >+ <input type="checkbox" name="use_default_values" id="use_default_values" /> >+ Populate fields with default values from default framework >+ </label> >+ </li> >+ </ol> >+ </fieldset> >+ > [% IF ( del ) %]<input type="hidden" name="del" value="1" />[% END %] > <fieldset class="action"> > <input type="submit" value="Continue" class="button" /> > <a class="cancel" href="/cgi-bin/koha/tools/tools-home.pl">Cancel</a> > </fieldset> >+ > </form> > </div> > </div> >diff --git a/tools/batchMod.pl b/tools/batchMod.pl >index e416d44..840ae17 100755 >--- a/tools/batchMod.pl >+++ b/tools/batchMod.pl >@@ -47,7 +47,7 @@ my $del_records = $input->param('del_records'); > my $completedJobID = $input->param('completedJobID'); > my $runinbackground = $input->param('runinbackground'); > my $src = $input->param('src'); >- >+my $use_default_values = $input->param('use_default_values'); > > my $template_name; > my $template_flag; >@@ -78,8 +78,7 @@ my $itemrecord; > my $nextop=""; > my @errors; # store errors found while checking data BEFORE saving item. > my $items_display_hashref; >-my $frameworkcode=""; >-my $tagslib = &GetMarcStructure(1,$frameworkcode); >+my $tagslib = &GetMarcStructure(1); > > my $deleted_items = 0; # Number of deleted items > my $deleted_records = 0; # Number of deleted records ( with no items attached ) >@@ -309,7 +308,7 @@ foreach my $tag (sort keys %{$tagslib}) { > $subfield_data{repeatable} = $tagslib->{$tag}->{$subfield}->{repeatable}; > my ($x,$value); > $value =~ s/"/"/g; >- unless ($value) { >+ if ( !$value && $use_default_values) { > $value = $tagslib->{$tag}->{$subfield}->{defaultvalue}; > # get today date & replace YYYY, MM, DD if provided in the default value > my ( $year, $month, $day ) = split ',', $today_iso; # FIXME: iso dates don't have commas! >-- >1.7.2.5
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 9533
:
17498
|
17500
|
17869
|
17870
|
17879
|
17931
|
17940
|
18094
|
18095