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