Bug 6331: (follow-up) update timestamp when deleting items

When item is transfered from items table to deleted items, all fields
must be copies but "timestamp".

This value must be updated to know when the item was deleted.

Test plan:
- Look a an item timestamp :
mysql> select timestamp from items where itemnumber = 2690;
+---------------------+
| timestamp           |
+---------------------+
| 2011-09-09 15:30:21 |
+---------------------+
1 row in set (0.00 sec)
- Delete this item in cataloguing module
- Check it is not in items table anymore :
mysql> select timestamp from items where itemnumber = 2690;
Empty set (0.00 sec)
- Look in deleteditems table :
mysql> select timestamp from deleteditems where itemnumber = 2690;
+---------------------+
| timestamp           |
+---------------------+
| 2013-12-05 15:33:20 |
+---------------------+
1 row in set (0.00 sec)
=> timestamp as been set to actual date/time

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Patch set passes koha-qa.pl, works as advertised!

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit cada676ef3)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
This commit is contained in:
Fridolyn SOMERS 2013-12-05 15:34:44 +01:00 committed by Fridolin SOMERS
parent 574dc07e0d
commit d2c9c8837b
1 changed files with 1 additions and 0 deletions

View File

@ -2309,6 +2309,7 @@ sub _koha_delete_item {
my $query = "INSERT INTO deleteditems SET ";
my @bind = ();
foreach my $key ( keys %$data ) {
next if ( $key eq 'timestamp' ); # timestamp will be set by db
$query .= "$key = ?,";
push( @bind, $data->{$key} );
}