Bugzilla – Attachment 15567 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
Bug-9673---Track-when-items-are-marked-as-lost-or-.patch (text/plain), 4.65 KB, created by
Kyle M Hall (khall)
on 2013-02-20 14:38:08 UTC
(
hide
)
Description:
Bug 9673 - Track when items are marked as lost or withdrawn
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2013-02-20 14:38:08 UTC
Size:
4.65 KB
patch
obsolete
>From e492246c78f96cf1b9edf8cc50ab439a71db2e1a Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Wed, 20 Feb 2013 09:34:38 -0500 >Subject: [PATCH] Bug 9673 - Track when items are marked as lost or withdrawn > >Add date fields to track when an item was marked as lost or withdrawn. >Display those fields on catalogue/moredetail.pl > >Test Plan: >1) Apply patch >2) Run updatedatabase.pl >3) Pick a record with items, browse to the 'items' tab ( moredetail.pl ) >4) Mark an item as lost, verify the field "Lost on:" displays below > the "Lost status" field with todays date. >5) Mark the item as not lost, verify the field no longer displays >6) Repeat steps 4 and 5 with the Withdrawn field. >--- > C4/Items.pm | 12 +++++++++++- > installer/data/mysql/kohastructure.sql | 2 ++ > installer/data/mysql/updatedatabase.pl | 8 ++++++++ > .../prog/en/modules/catalogue/moredetail.tt | 2 ++ > 4 files changed, 23 insertions(+), 1 deletions(-) > >diff --git a/C4/Items.pm b/C4/Items.pm >index dbd06b6..0e77bce 100644 >--- a/C4/Items.pm >+++ b/C4/Items.pm >@@ -534,7 +534,17 @@ sub ModItem { > $item->{'itemnumber'} = $itemnumber or return; > > $item->{onloan} = undef if $item->{itemlost}; >- >+ >+ for my $field ( qw( itemlost wthdrawn ) ) { >+ if ( defined( $item->{$field} ) ) { >+ if ( $item->{$field} ) { >+ $item->{$field . '_on'} = DateTime::Format::MySQL->format_datetime( DateTime->now() ); >+ } else { >+ $item->{$field . '_on'} = undef; >+ } >+ } >+ } >+ > _set_derived_columns_for_mod($item); > _do_column_fixes_for_mod($item); > # FIXME add checks >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index ed673da..2c8da75 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -1046,7 +1046,9 @@ CREATE TABLE `items` ( -- holdings/item information > `notforloan` tinyint(1) NOT NULL default 0, -- authorized value defining why this item is not for loan (MARC21 952$7) > `damaged` tinyint(1) NOT NULL default 0, -- authorized value defining this item as damaged (MARC21 952$4) > `itemlost` tinyint(1) NOT NULL default 0, -- authorized value defining this item as lost (MARC21 952$1) >+ `itemlost_on` datetime DEFAULT NULL, -- the date and time an item was last marked as lost, NULL if not lost > `wthdrawn` tinyint(1) NOT NULL default 0, -- authorized value defining this item as withdrawn (MARC21 952$0) >+ `wthdrawn_on` datetime DEFAULT NULL, -- the date and time an item was last marked as withdrawn, NULL if not withdrawn > `itemcallnumber` varchar(255) default NULL, -- call number for this item (MARC21 952$o) > `coded_location_qualifier` varchar(10) default NULL, -- coded location qualifier(MARC21 952$f) > `issues` smallint(6) default NULL, -- number of times this item has been checked out/issued >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 15d900c..b14501b 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -6407,6 +6407,14 @@ if ( CheckVersion($DBversion) ) { > SetVersion ($DBversion); > } > >+$DBversion = "3.11.00.XXX"; >+if ( CheckVersion($DBversion) ) { >+ $dbh->do("ALTER TABLE items ADD itemlost_on DATETIME NULL AFTER itemlost"); >+ $dbh->do("ALTER TABLE items ADD wthdrawn_on DATETIME NULL AFTER wthdrawn"); >+ print "Upgrade to $DBversion done (Bug 9673 - Track when items are marked as lost or withdrawn)\n"; >+ SetVersion ($DBversion); >+} >+ > =head1 FUNCTIONS > > =head2 TableExists($table) >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt >index 5234e28..cbec780 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt >@@ -116,6 +116,7 @@ > > [% END %] > </li> >+ [% IF ITEM_DAT.itemlost_on %]<li><span class="label">Lost on:</span>[% ITEM_DAT.itemlost_on | $KohaDates %] </li>[% END %] > [% END %] > [% IF ( ITEM_DAT.itemdamagedloop ) %] > <li><span class="label">Damaged status:</span> >@@ -165,6 +166,7 @@ > </form> > [% END %] > </li> >+ [% IF ITEM_DAT.wthdrawn_on %]<li><span class="label">Withdrawn on:</span>[% ITEM_DAT.wthdrawn_on | $KohaDates %] </li>[% END %] > </ol></div> > <div class="listgroup"><h4>History</h4> > <ol class="bibliodetails"> >-- >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