View | Details | Raw Unified | Return to bug 37398
Collapse All | Expand All

(-)a/Koha/UI/Form/Builder/Item.pm (-10 / +5 lines)
Lines 147-159 sub generate_subfield_form { Link Here
147
        }
147
        }
148
    }
148
    }
149
149
150
    if ( defined $subfield->{kohafield}  && $subfield->{kohafield} =~ /items\.(replacementpricedate|dateaccessioned|datelastborrowed|onloan)/) {
150
    my $columns = Koha::Items->_resultset->result_source->columns_info;
151
        $subfield_data{datetype} = 'date';
151
    $subfield_data{data_type} =
152
    }
152
        defined $subfield->{kohafield} ? $columns->{ $subfield->{kohafield} =~ s|^items\.||r }->{data_type} : undef;
153
154
    if ( defined $subfield->{kohafield} && $subfield->{kohafield} =~ /items\.(datelastseen|damaged_on|itemlost_on|withdrawn_on|deleted_on)/) {
155
        $subfield_data{datetype} = 'datetime';
156
    }
157
153
158
    $subfield_data{visibility} = "display:none;"
154
    $subfield_data{visibility} = "display:none;"
159
      if ( ( $subfield->{hidden} > 4 ) || ( $subfield->{hidden} <= -4 ) );
155
      if ( ( $subfield->{hidden} > 4 ) || ( $subfield->{hidden} <= -4 ) );
Lines 319-332 sub generate_subfield_form { Link Here
319
            authtypecode => $subfield->{authtypecode},
315
            authtypecode => $subfield->{authtypecode},
320
        };
316
        };
321
    }
317
    }
322
    elsif ( defined $subfield_data{datetype} && $subfield_data{datetype} eq 'date' ) {
318
    elsif ( defined $subfield_data{data_type} && $subfield_data{data_type} eq 'date' ) {
323
        $subfield_data{marc_value} = {
319
        $subfield_data{marc_value} = {
324
            type => 'date_field',
320
            type => 'date_field',
325
            id => $subfield_data{id},
321
            id => $subfield_data{id},
326
            value => $value,
322
            value => $value,
327
        }
323
        }
328
    }
324
    }
329
    elsif ( defined $subfield_data{datetype} && $subfield_data{datetype} eq 'datetime' ) {
325
    elsif ( defined $subfield_data{data_type} && $subfield_data{data_type} eq 'datetime' ) {
330
        $subfield_data{marc_value} = {
326
        $subfield_data{marc_value} = {
331
            type => 'datetime_field',
327
            type => 'datetime_field',
332
            id => $subfield_data{id},
328
            id => $subfield_data{id},
333
- 

Return to bug 37398