Bugzilla – Attachment 123223 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: Use Koha::UI::Form::Builder::Item from batchmod as well
Bug-28445-Use-KohaUIFormBuilderItem-from-batchmod-.patch (text/plain), 27.30 KB, created by
Jonathan Druart
on 2021-07-27 16:40:13 UTC
(
hide
)
Description:
Bug 28445: Use Koha::UI::Form::Builder::Item from batchmod as well
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-07-27 16:40:13 UTC
Size:
27.30 KB
patch
obsolete
>From 85f566d915c4cfd616b7c0a4a160f20a540d1d27 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 26 Jul 2021 18:29:16 +0200 >Subject: [PATCH] Bug 28445: Use Koha::UI::Form::Builder::Item from batchmod as > well > >Now that it's reusable, let use it somewhere else! >--- > Koha/UI/Form/Builder/Item.pm | 157 +++++++++--- > cataloguing/additem.pl | 11 +- > .../prog/en/modules/tools/batchMod-edit.tt | 72 +----- > tools/batchMod.pl | 225 +++--------------- > 4 files changed, 165 insertions(+), 300 deletions(-) > >diff --git a/Koha/UI/Form/Builder/Item.pm b/Koha/UI/Form/Builder/Item.pm >index b124729aa27..4ba2171802e 100644 >--- a/Koha/UI/Form/Builder/Item.pm >+++ b/Koha/UI/Form/Builder/Item.pm >@@ -24,6 +24,34 @@ use C4::ClassSource qw( GetClassSources ); > use Koha::DateUtils qw( dt_from_string ); > use Koha::Libraries; > >+=head1 NAME >+ >+Koha::UI::Form::Builder::Item >+ >+Helper to build a form to add or edit a new item. >+ >+=head1 API >+ >+=head2 Class methods >+ >+=cut >+ >+=head3 new >+ >+ my $form = Koha::UI::Form::Builder::Item->new( >+ { >+ biblionumber => $biblionumber, >+ item => $current_item, >+ } >+ ); >+ >+Constructor. >+biblionumber should be passed if we are creating a new item. >+For edition, an hashref representating the item to edit item must be passed. >+ >+=cut >+ >+ > sub new { > my ( $class, $params ) = @_; > >@@ -35,6 +63,12 @@ sub new { > return $self; > } > >+=head3 generate_subfield_form >+ >+Generate subfield's info for given tag, subfieldtag, etc. >+ >+=cut >+ > sub generate_subfield_form { > > my ($self, $params) = @_; >@@ -45,8 +79,10 @@ sub generate_subfield_form { > my $libraries = $params->{libraries}; > my $marc_record = $params->{marc_record}; > my $restricted_edition = $params->{restricted_editition}; >+ my $prefill_with_default_values = $params->{prefill_with_default_values}; >+ my $branch_limit = $params->{branch_limit}; > >- my $item = $self->{item}; >+ my $item = $self->{item}; > my $subfield = $tagslib->{$tag}{$subfieldtag}; > my $biblionumber = $self->{biblionumber}; > >@@ -79,7 +115,7 @@ sub generate_subfield_form { > $subfield_data{kohafield} = > $subfield->{kohafield} || 'items.more_subfields_xml'; > >- if ( !defined($value) || $value eq '' ) { >+ if ( $prefill_with_default_values && ( !defined($value) || $value eq '' ) ) { > $value = $subfield->{defaultvalue}; > if ($value) { > >@@ -108,7 +144,9 @@ sub generate_subfield_form { > if ( ( $subfield->{hidden} > 4 ) || ( $subfield->{hidden} <= -4 ) ); > > my $pref_itemcallnumber = C4::Context->preference('itemcallnumber'); >- if ( !$value >+ if ( $prefill_with_default_values >+ && !$value >+ && $subfield->{kohafield} > && $subfield->{kohafield} eq 'items.itemcallnumber' > && $pref_itemcallnumber ) > { >@@ -127,22 +165,6 @@ sub generate_subfield_form { > } > } > >- my $default_location = C4::Context->preference('NewItemsDefaultLocation'); >- if ( !$value >- && $subfield->{kohafield} eq 'items.location' >- && $default_location ) >- { >- $value = $default_location; >- } >- >- if ( $frameworkcode eq 'FA' >- && $subfield->{kohafield} eq 'items.barcode' >- && !$value ) >- { >- my $input = CGI->new; >- $value = $input->param('barcode'); >- } >- > if ( $subfield->{authorised_value} ) { > my @authorised_values; > my %authorised_lib; >@@ -177,8 +199,6 @@ sub generate_subfield_form { > } > elsif ( $subfield->{authorised_value} eq "itemtypes" ) { > push @authorised_values, ""; >- my $branch_limit = >- C4::Context->userenv && C4::Context->userenv->{"branch"}; > my $itemtypes; > if ($branch_limit) { > $itemtypes = Koha::ItemTypes->search_with_localization( >@@ -193,7 +213,7 @@ sub generate_subfield_form { > $itemtype->translated_description; > } > >- unless ($value) { >+ if (!$value && $biblionumber) { > my $itype_sth = $dbh->prepare( > "SELECT itemtype FROM biblioitems WHERE biblionumber = ?"); > $itype_sth->execute($biblionumber); >@@ -218,7 +238,7 @@ sub generate_subfield_form { > $authorised_lib{$class_source} = > $class_sources->{$class_source}->{'description'}; > } >- $value = $default_source unless ($value); >+ $value = $default_source if !$value && $prefill_with_default_values; > > #---- "true" authorised value > } >@@ -379,16 +399,82 @@ sub generate_subfield_form { > return \%subfield_data; > } > >+ my $subfields = >+ Koha::UI::Form::Builder::Item->new( >+ { biblionumber => $biblionumber, item => $current_item } )->edit_form( >+ { >+ branchcode => $branchcode, >+ restricted_editition => $restrictededition, >+ ( >+ @subfields_to_prefill >+ ? ( subfields_to_prefill => \@subfields_to_prefill ) >+ : () >+ ), >+ prefill_with_default_values => 1, >+ branch_limit => C4::Context->userenv->{"branch"}, >+ } >+ ); >+ >+Returns the list of subfields to display on the add/edit item form. >+ >+Use it in the view with: >+ [% PROCESS subfields_for_item subfields => subfields %] >+ >+Parameters: >+ >+=over >+ >+=item branchcode >+ >+Pre-select a library (for logged in user) >+ >+=item restricted_editition >+ >+Flag to restrict the edition if the user does not have necessary permissions. >+ >+=item subfields_to_prefill >+ >+List of subfields to prefill (value of syspref SubfieldsToUseWhenPrefill) >+ >+=item subfields_to_allow >+ >+List of subfields to allow (value of syspref SubfieldsToAllowForRestrictedBatchmod) >+ >+=item subfields_to_ignore >+ >+List of subfields to ignore/skip >+ >+=item prefill_with_default_values >+ >+Flag to prefill with the default values defined in the framework. >+ >+=item branch_limit >+ >+Limit info depending on the library (so far only item types). >+ >+=item default_branches_empty >+ >+Flag to add an empty option to the library list. >+ >+=back >+ >+=cut >+ > sub edit_form { > my ( $self, $params ) = @_; > > my $branchcode = $params->{branchcode}; > my $restricted_edition = $params->{restricted_editition}; > my $subfields_to_prefill = $params->{subfields_to_prefill} || []; >+ my $subfields_to_allow = $params->{subfields_to_allow} || []; >+ 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 $libraries = > Koha::Libraries->search( {}, { order_by => ['branchname'] } )->unblessed; > for my $library (@$libraries) { >- $library->{selected} = 1 if $library->{branchcode} eq $branchcode; >+ $library->{selected} = 1 if $branchcode && $library->{branchcode} eq $branchcode; > } > > my $item = $self->{item}; >@@ -404,7 +490,11 @@ sub edit_form { > my $subfield = $tagslib->{$tag}{$subfieldtag}; > > next if IsMarcStructureInternal($subfield); >- next if ( $subfield->{tab} ne "10" ); >+ next if $subfield->{tab} ne "10"; >+ next if @$subfields_to_allow && !grep { $subfield->{kohafield} eq $_ } @$subfields_to_allow; >+ next >+ if grep { $subfield->{kohafield} && $subfield->{kohafield} eq $_ } >+ @$subfields_to_ignore; > > my @values = (); > >@@ -441,12 +531,19 @@ sub edit_form { > > for my $value (@values) { > my $subfield_data = $self->generate_subfield_form( >- {tag => $tag, subfieldtag => $subfieldtag, value => $value, >- tagslib => $tagslib, libraries => $libraries, >- marc_record => $marc_record, restricted_edition => $restricted_edition, >- }); >+ { >+ tag => $tag, >+ subfieldtag => $subfieldtag, >+ value => $value, >+ tagslib => $tagslib, >+ libraries => $libraries, >+ marc_record => $marc_record, >+ restricted_edition => $restricted_edition, >+ prefill_with_default_values => $prefill_with_default_values, >+ branch_limit => $branch_limit, >+ } >+ ); > push @subfields, $subfield_data; >- $i++; > } > } > } >diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl >index 7620c6e3b75..ec5f3aea5af 100755 >--- a/cataloguing/additem.pl >+++ b/cataloguing/additem.pl >@@ -570,9 +570,16 @@ my $subfields = > @subfields_to_prefill > ? ( subfields_to_prefill => \@subfields_to_prefill ) > : () >- ) >+ ), >+ prefill_with_default_values => 1, >+ branch_limit => C4::Context->userenv->{"branch"}, > } >- ); >+); >+ >+if ( $frameworkcode eq 'FA' ) { >+ my ( $barcode_field ) = grep {$_->{kohafield} eq 'items.barcode'} @$subfields; >+ $barcode_field->{marc_value}->{value} ||= $input->param('barcode'); >+} > > if( my $default_location = C4::Context->preference('NewItemsDefaultLocation') ) { > my ( $location_field ) = grep {$_->{kohafield} eq 'items.location'} @$subfields; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt >index 7c444d47c31..af9c38414dc 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt >@@ -248,77 +248,7 @@ > <h2>Edit items</h2> > <div class="hint">Checking the box right next to the subfield label will disable the entry and delete the subfield on all selected items. Leave fields blank to make no change.</div> > <fieldset class="rows"> >- <ol> >- [% FOREACH ite IN item %] >- <li> >- <div class="subfield_line" style="[% ite.visibility | html %]" id="subfield[% ite.tag | html %][% ite.subfield | html %][% ite.random | html %]"> >- [% SET mv = ite.marc_value %] >- [% IF ( ite.mandatory ) %] >- <label class="required" for="[%- mv.id | html -%]"> >- [% ELSE %] >- <label for="[%- mv.id | html -%]"> >- [% END %] >- [% ite.subfield | html %] - [% ite.marc_lib | $raw %] >- </label> >- >- [% IF ( mv.type == 'select' ) -%] >- <select name="[%- mv.name | html -%]" id="[%- mv.id | html -%]" tabindex="1" class="input_marceditor select2"> >- [%- FOREACH aval IN mv.values %] >- [% ite.subfield | html %] - >- [% IF aval == mv.default %] >- <option value="[%- aval | html -%]" selected="selected">[%- mv.labels.$aval | html -%]</option> >- [% ELSE %] >- <option value="[%- aval | html -%]">[%- mv.labels.$aval | html -%]</option> >- [% END %] >- [%- END -%] >- </select> >- [% ELSIF ( mv.type == 'text1' ) %] >- <input type="text" tabindex="1" id="[%- mv.id | html -%]" name="field_value" class="input_marceditor" size="50" maxlength="255" value="[%- mv.value | html -%]" /> >- <a href="#" class="buttonDot" onclick="Dopop('/cgi-bin/koha/authorities/auth_finder.pl?authtypecode=[%- mv.authtypecode | uri -%]&index=[%- mv.id | uri -%]','[%- mv.id | uri -%]'); return false;" title="Tag editor">...</a> >- [% ELSIF ( mv.type == 'text2' ) %] >- <input type="text" id="[%- mv.id | html -%]" name="field_value" class="input_marceditor" size="50" maxlength="255" value="[%- mv.value | html -%]" /> >- [% IF mv.noclick %] >- <a href="#" class="buttonDot disabled" title="No popup">...</a> >- [% ELSE %] >- <a href="#" id="buttonDot_[% mv.id | html %]" class="buttonDot" title="Tag editor">...</a> >- [% END %] >- [% ELSIF ( mv.type == 'text' ) %] >- <input type="text" tabindex="1" id="[%- mv.id | html -%]" name="field_value" class="input_marceditor" size="50" maxlength="255" value="[%- mv.value | html -%]" /> >- [% ELSIF ( mv.type == 'hidden' ) %] >- <input type="hidden" tabindex="1" id="[%- mv.id | html -%]" name="field_value" class="input_marceditor" size="50" maxlength="255" value="[%- mv.value | html -%]" /> >- [% ELSIF ( mv.type == 'textarea' ) %] >- <textarea tabindex="1" id="[%- mv.id | html -%]" name="field_value" class="input_marceditor" size="50" maxlength="255">[%- mv.value | html -%]"</textarea> >- [%- END # /IF mv.type == ... -%] >- >- <span name="regex_fields" style="display: none;"> >- s/<input type="text" id="[% mv.id | html %]" name="regex_search" placeholder="regex pattern" />/ >- <input type="text" id="[% mv.id | html %]" name="regex_replace" placeholder="regex replacement" />/ >- <input type="text" id="[% mv.id | html %]" name="regex_modifiers" placeholder="ig" size="3" /> >- </span> >- >- [% UNLESS ( ite.mandatory ) %] >- <input type="checkbox" id="row[% ite.tag | html %][% ite.subfield | html %][% ite.random | html %]" title="Check to delete subfield [% ite.subfield | html %]" name="disable_input" value="[% ite.subfield | html %]" /> >- [% ELSE %] >- <span class="required">Required</span> >- [% END %] >- >- [% IF (mv.type == 'text' || mv.type == 'text2' || mv.type == 'textarea' ) %] >- <a href="#" name="field_regex" id="[% ite.id | html %]" >RegEx</a> >- [% END %] >- >- <input type="hidden" name="tag" value="[% ite.tag | html %]" /> >- <input type="hidden" name="subfield" value="[% ite.subfield | html %]" /> >- <input type="hidden" name="mandatory" value="[% ite.mandatory | html %]" /> >- [% IF ( ite.repeatable ) %] >- <a href="#" class="buttonPlus" onclick="CloneItemSubfield(this.parentNode.parentNode); return false;"> >- <img src="[% interface | html %]/[% theme | html %]/img/clone-subfield.png" alt="Clone" title="Clone this subfield" /> >- </a> >- [% END %] >- <span class="hint" id="hint[% ite.tag | html %][% ite.subfield | html %][% ite.random | html %]"></span> >- </div> <!-- /.subfield_line --> >- </li> >- [% END # /FOREACH ite %] >- </ol> >+ [% PROCESS subfields_for_item subfields => subfields, add_regex => 1, add_delete_checkbox => 1 %] > </fieldset> > > <fieldset class="rows"> >diff --git a/tools/batchMod.pl b/tools/batchMod.pl >index 4d9c5079947..75176b3e017 100755 >--- a/tools/batchMod.pl >+++ b/tools/batchMod.pl >@@ -50,6 +50,7 @@ use Koha::Items; > use Koha::ItemTypes; > use Koha::Patrons; > use Koha::SearchEngine::Indexer; >+use Koha::UI::Form::Builder::Item; > > my $input = CGI->new; > my $dbh = C4::Context->dbh; >@@ -393,209 +394,39 @@ 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 $i=0; >-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 >-my $subfieldsToAllowForBatchmod = C4::Context->preference('SubfieldsToAllowForRestrictedBatchmod'); >-my $allowAllSubfields = ( >- not defined $subfieldsToAllowForBatchmod >- or $subfieldsToAllowForBatchmod eq q|| >-) ? 1 : 0; >-my @subfieldsToAllow = split(/ /, $subfieldsToAllowForBatchmod); >- >-foreach my $tag (sort keys %{$tagslib}) { >- # loop through each subfield >- foreach my $subfield (sort keys %{$tagslib->{$tag}}) { >- next if IsMarcStructureInternal( $tagslib->{$tag}{$subfield} ); >- next if (not $allowAllSubfields and $restrictededition && !grep { $tag . '$' . $subfield eq $_ } @subfieldsToAllow ); >- next if ($tagslib->{$tag}->{$subfield}->{'tab'} ne "10"); >- # barcode is not meant to be batch-modified >- next if $tagslib->{$tag}->{$subfield}->{'kohafield'} eq 'items.barcode'; >- my %subfield_data; >- >- my $index_subfield = int(rand(1000000)); >- if ($subfield eq '@'){ >- $subfield_data{id} = "tag_".$tag."_subfield_00_".$index_subfield; >- } else { >- $subfield_data{id} = "tag_".$tag."_subfield_".$subfield."_".$index_subfield; >- } >- $subfield_data{tag} = $tag; >- $subfield_data{subfield} = $subfield; >- $subfield_data{marc_lib} ="<span id=\"error$i\" title=\"".$tagslib->{$tag}->{$subfield}->{lib}."\">".$tagslib->{$tag}->{$subfield}->{lib}."</span>"; >- $subfield_data{mandatory} = $tagslib->{$tag}->{$subfield}->{mandatory}; >- $subfield_data{repeatable} = $tagslib->{$tag}->{$subfield}->{repeatable}; >- my $value; >- if ( $use_default_values) { >- $value = $tagslib->{$tag}->{$subfield}->{defaultvalue}; >- # get today date & replace YYYY, MM, DD if provided in the default value >- my $today = dt_from_string; >- my $year = $today->year; >- my $month = $today->month; >- my $day = $today->day; >- $value =~ s/YYYY/$year/g; >- $value =~ s/MM/$month/g; >- $value =~ s/DD/$day/g; >- } >- $subfield_data{visibility} = "display:none;" if (($tagslib->{$tag}->{$subfield}->{hidden} > 4) || ($tagslib->{$tag}->{$subfield}->{hidden} < -4)); >- # testing branch value if IndependentBranches. >- >- if ( $tagslib->{$tag}->{$subfield}->{authorised_value} ) { >- my @authorised_values; >- my %authorised_lib; >- # builds list, depending on authorised value... >- >- if ( $tagslib->{$tag}->{$subfield}->{authorised_value} eq "branches" ) { >- foreach my $library (@$libraries) { >- push @authorised_values, $library->{branchcode}; >- $authorised_lib{$library->{branchcode}} = $library->{branchname}; >+ # 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 >+ my @subfields_to_allow = $restrictededition ? split ' ', C4::Context->preference('SubfieldsToAllowForRestrictedBatchmod') : (); >+ >+ my $subfields = Koha::UI::Form::Builder::Item->new->edit_form( >+ { >+ restricted_editition => $restrictededition, >+ ( >+ @subfields_to_allow >+ ? ( subfields_to_allow => \@subfields_to_allow ) >+ : () >+ ), >+ subfields_to_ignore => ['items.barcode'], >+ prefill_with_default_values => $use_default_values, > } >- $value = ""; >- } >- elsif ( $tagslib->{$tag}->{$subfield}->{authorised_value} eq "itemtypes" ) { >- push @authorised_values, ""; >- my $itemtypes = Koha::ItemTypes->search_with_localization; >- while ( my $itemtype = $itemtypes->next ) { >- push @authorised_values, $itemtype->itemtype; >- $authorised_lib{$itemtype->itemtype} = $itemtype->translated_description; >- } >- $value = ""; >- >- #---- class_sources >- } >- elsif ( $tagslib->{$tag}->{$subfield}->{authorised_value} eq "cn_source" ) { >- push @authorised_values, "" unless ( $tagslib->{$tag}->{$subfield}->{mandatory} ); >- >- my $class_sources = GetClassSources(); >- my $default_source = C4::Context->preference("DefaultClassificationSource"); >- >- foreach my $class_source (sort keys %$class_sources) { >- next unless $class_sources->{$class_source}->{'used'} or >- ($value and $class_source eq $value) or >- ($class_source eq $default_source); >- push @authorised_values, $class_source; >- $authorised_lib{$class_source} = $class_sources->{$class_source}->{'description'}; >- } >- $value = ''; >- >- #---- "true" authorised value >- } >- else { >- push @authorised_values, ""; # unless ( $tagslib->{$tag}->{$subfield}->{mandatory} ); >- >- my @avs = Koha::AuthorisedValues->search_with_library_limits( >- { >- category => $tagslib->{$tag}->{$subfield}->{authorised_value} >- }, >- { order_by => 'lib' }, >- $branch_limit >- ); >- for my $av ( @avs ) { >- push @authorised_values, $av->authorised_value; >- $authorised_lib{$av->authorised_value} = $av->lib; >- } >- $value=""; >- } >- $subfield_data{marc_value} = { >- type => 'select', >- id => "tag_".$tag."_subfield_".$subfield."_".$index_subfield, >- name => "field_value", >- values => \@authorised_values, >- labels => \%authorised_lib, >- default => $value, >- }; >- # it's a thesaurus / authority field >- } >- elsif ( $tagslib->{$tag}->{$subfield}->{authtypecode} ) { >- $subfield_data{marc_value} = { >- type => 'text1', >- id => $subfield_data{id}, >- value => $value, >- authtypecode => $tagslib->{$tag}->{$subfield}->{authtypecode}, >- } >- } >- elsif ( $tagslib->{$tag}->{$subfield}->{value_builder} ) { # plugin >- require Koha::FrameworkPlugin; >- my $plugin = Koha::FrameworkPlugin->new( { >- name => $tagslib->{$tag}->{$subfield}->{'value_builder'}, >- item_style => 1, >- }); >- my $temp; >- my $pars= { dbh => $dbh, record => $temp, tagslib => $tagslib, >- id => $subfield_data{id} }; >- $plugin->build( $pars ); >- if( !$plugin->errstr ) { >- $subfield_data{marc_value} = { >- type => 'text2', >- id => $subfield_data{id}, >- value => $value, >- javascript => $plugin->javascript, >- noclick => $plugin->noclick, >- }; >- } else { >- warn $plugin->errstr; >- $subfield_data{marc_value} = { # supply default input form >- type => 'text', >- id => $subfield_data{id}, >- value => $value, >- }; >- } >- } >- elsif ( $tag eq '' ) { # it's an hidden field >- $subfield_data{marc_value} = { >- type => 'hidden', >- id => $subfield_data{id}, >- value => $value, >- }; >- } >- elsif ( $tagslib->{$tag}->{$subfield}->{'hidden'} ) { # FIXME: shouldn't input type be "hidden" ? >- $subfield_data{marc_value} = { >- type => 'text', >- id => $subfield_data{id}, >- value => $value, >- }; >- } >- elsif ( length($value) > 100 >- or (C4::Context->preference("marcflavour") eq "UNIMARC" and >- 300 <= $tag && $tag < 400 && $subfield eq 'a' ) >- or (C4::Context->preference("marcflavour") eq "MARC21" and >- 500 <= $tag && $tag < 600 ) >- ) { >- # oversize field (textarea) >- $subfield_data{marc_value} = { >- type => 'textarea', >- id => $subfield_data{id}, >- value => $value, >- }; >- } else { >- # it's a standard field >- $subfield_data{marc_value} = { >- type => 'text', >- id => $subfield_data{id}, >- value => $value, >- }; >- } >-# $subfield_data{marc_value}="<input type=\"text\" name=\"field_value\">"; >- push (@loop_data, \%subfield_data); >- $i++ >- } >-} # -- End foreach tag >+ ); > > > > # what's the next op ? it's what we are not in : an add if we're editing, otherwise, and edit. > $template->param( >- item => \@loop_data, >+ subfields => $subfields, > notfoundbarcodes => \@notfoundbarcodes, > notfounditemnumbers => \@notfounditemnumbers > ); >-- >2.20.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