Bugzilla – Attachment 18033 Details for
Bug 9673
Track when items are marked as lost or withdrawn
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9673 - Track when items are marked as lost or withdrawn - QA Followup 2
Bug-9673---Track-when-items-are-marked-as-lost-or-.patch (text/plain), 2.00 KB, created by
Kyle M Hall (khall)
on 2013-05-08 16:31:15 UTC
(
hide
)
Description:
Bug 9673 - Track when items are marked as lost or withdrawn - QA Followup 2
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2013-05-08 16:31:15 UTC
Size:
2.00 KB
patch
obsolete
>From 7ce2c2a131552087efb016ecd4affd035288f6b1 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Wed, 8 May 2013 12:27:53 -0400 >Subject: [PATCH] Bug 9673 - Track when items are marked as lost or withdrawn - QA Followup 2 > >* Reduces the possible cass to GetItem from 2 to 1 >* Uses dt_from_string to get the DateTime object, so the time zone is correct >--- > C4/Items.pm | 23 ++++++++++++++--------- > 1 files changed, 14 insertions(+), 9 deletions(-) > >diff --git a/C4/Items.pm b/C4/Items.pm >index d659de8..c5f6d79 100644 >--- a/C4/Items.pm >+++ b/C4/Items.pm >@@ -33,6 +33,7 @@ use List::MoreUtils qw/any/; > use DateTime::Format::MySQL; > use Data::Dumper; # used as part of logging item record changes, not just for > # debugging; so please don't remove this >+use Koha::DateUtils qw/dt_ftom_string/; > > use vars qw($VERSION @ISA @EXPORT); > >@@ -536,16 +537,20 @@ sub ModItem { > > $item->{onloan} = undef if $item->{itemlost}; > >- for my $field ( qw( itemlost wthdrawn ) ) { >- if ( defined( $item->{$field} ) ) { >- my $pre_mod_item = GetItem($item->{'itemnumber'}); >- unless ( $pre_mod_item->{$field} ) { >- if ( $item->{$field} ) { >- $item->{$field . '_on'} = DateTime::Format::MySQL->format_datetime( DateTime->now() ); >- } >+ if ( $item->{itemlost} || $item->{wthdrawn} ) { >+ my $pre_mod_item = GetItem( $item->{'itemnumber'} ); >+ for my $field (qw( itemlost wthdrawn )) { >+ if ( defined( $item->{$field} ) ) { >+ unless ( $pre_mod_item->{$field} ) { >+ if ( $item->{$field} ) { >+ $item->{ $field . '_on' } = >+ DateTime::Format::MySQL->format_datetime( dt_from_string() ); >+ } >+ } >+ } >+ else { >+ $item->{ $field . '_on' } = undef; > } >- } else { >- $item->{$field . '_on'} = undef; > } > } > >-- >1.7.2.5
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 9673
:
15567
|
15890
|
16002
|
16003
|
16032
|
16033
|
16642
|
16643
|
16644
|
16645
|
16646
|
18031
|
18032
|
18033
|
18034
|
19013
|
19014
|
19079
|
19080
|
19120
|
19121
|
19483
|
19484
|
19485
|
19486
|
19487
|
19488
|
19489
|
19490
|
19492
|
21730
|
21731
|
22690
|
22691