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

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

Return to bug 23463