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

(-)a/C4/Items.pm (-47 lines)
Lines 1270-1321 sub _set_derived_columns_for_add { Link Here
1270
    }
1270
    }
1271
}
1271
}
1272
1272
1273
=head2 _do_column_fixes_for_mod
1274
1275
  _do_column_fixes_for_mod($item);
1276
1277
Given an item hashref containing one or more
1278
columns to modify, fix up certain values.
1279
Specifically, set to 0 any passed value
1280
of C<notforloan>, C<damaged>, C<itemlost>, or
1281
C<withdrawn> that is either undefined or
1282
contains the empty string.
1283
1284
=cut
1285
1286
sub _do_column_fixes_for_mod {
1287
    my $item = shift;
1288
1289
    if (exists $item->{'notforloan'} and
1290
        (not defined $item->{'notforloan'} or $item->{'notforloan'} eq '')) {
1291
        $item->{'notforloan'} = 0;
1292
    }
1293
    if (exists $item->{'damaged'} and
1294
        (not defined $item->{'damaged'} or $item->{'damaged'} eq '')) {
1295
        $item->{'damaged'} = 0;
1296
    }
1297
    if (exists $item->{'itemlost'} and
1298
        (not defined $item->{'itemlost'} or $item->{'itemlost'} eq '')) {
1299
        $item->{'itemlost'} = 0;
1300
    }
1301
    if (exists $item->{'withdrawn'} and
1302
        (not defined $item->{'withdrawn'} or $item->{'withdrawn'} eq '')) {
1303
        $item->{'withdrawn'} = 0;
1304
    }
1305
    if (
1306
        exists $item->{location}
1307
        and ( !defined $item->{location}
1308
            || ( $item->{location} ne 'CART' and $item->{location} ne 'PROC' ) )
1309
        and not $item->{permanent_location}
1310
      )
1311
    {
1312
        $item->{'permanent_location'} = $item->{'location'};
1313
    }
1314
    if (exists $item->{'timestamp'}) {
1315
        delete $item->{'timestamp'};
1316
    }
1317
}
1318
1319
=head2 _get_single_item_column
1273
=head2 _get_single_item_column
1320
1274
1321
  _get_single_item_column($column, $itemnumber);
1275
  _get_single_item_column($column, $itemnumber);
1322
- 

Return to bug 23463