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

(-)a/C4/Items.pm (+10 lines)
Lines 535-540 sub ModItem { Link Here
535
535
536
    $item->{onloan} = undef if $item->{itemlost};
536
    $item->{onloan} = undef if $item->{itemlost};
537
537
538
    for my $field ( qw( itemlost wthdrawn ) ) {
539
        if ( defined( $item->{$field} ) ) {
540
            if ( $item->{$field} ) {
541
                $item->{$field . '_on'} = DateTime::Format::MySQL->format_datetime( DateTime->now() );
542
            } else {
543
                $item->{$field . '_on'} = undef;
544
            }
545
        }
546
    }
547
538
    _set_derived_columns_for_mod($item);
548
    _set_derived_columns_for_mod($item);
539
    _do_column_fixes_for_mod($item);
549
    _do_column_fixes_for_mod($item);
540
    # FIXME add checks
550
    # FIXME add checks
(-)a/installer/data/mysql/kohastructure.sql (+4 lines)
Lines 760-766 CREATE TABLE `deleteditems` ( Link Here
760
  `notforloan` tinyint(1) NOT NULL default 0, -- authorized value defining why this item is not for loan (MARC21 952$7)
760
  `notforloan` tinyint(1) NOT NULL default 0, -- authorized value defining why this item is not for loan (MARC21 952$7)
761
  `damaged` tinyint(1) NOT NULL default 0, -- authorized value defining this item as damaged (MARC21 952$4)
761
  `damaged` tinyint(1) NOT NULL default 0, -- authorized value defining this item as damaged (MARC21 952$4)
762
  `itemlost` tinyint(1) NOT NULL default 0, -- authorized value defining this item as lost (MARC21 952$1)
762
  `itemlost` tinyint(1) NOT NULL default 0, -- authorized value defining this item as lost (MARC21 952$1)
763
  `itemlost_on` datetime DEFAULT NULL, -- the date and time an item was last marked as lost, NULL if not lost
763
  `wthdrawn` tinyint(1) NOT NULL default 0, -- authorized value defining this item as withdrawn (MARC21 952$0)
764
  `wthdrawn` tinyint(1) NOT NULL default 0, -- authorized value defining this item as withdrawn (MARC21 952$0)
765
  `wthdrawn_on` datetime DEFAULT NULL, -- the date and time an item was last marked as withdrawn, NULL if not withdrawn
764
  `itemcallnumber` varchar(255) default NULL, -- call number for this item (MARC21 952$o)
766
  `itemcallnumber` varchar(255) default NULL, -- call number for this item (MARC21 952$o)
765
  `coded_location_qualifier` varchar(10) default NULL, -- coded location qualifier(MARC21 952$f)
767
  `coded_location_qualifier` varchar(10) default NULL, -- coded location qualifier(MARC21 952$f)
766
  `issues` smallint(6) default NULL, -- number of times this item has been checked out
768
  `issues` smallint(6) default NULL, -- number of times this item has been checked out
Lines 1047-1053 CREATE TABLE `items` ( -- holdings/item information Link Here
1047
  `notforloan` tinyint(1) NOT NULL default 0, -- authorized value defining why this item is not for loan (MARC21 952$7)
1049
  `notforloan` tinyint(1) NOT NULL default 0, -- authorized value defining why this item is not for loan (MARC21 952$7)
1048
  `damaged` tinyint(1) NOT NULL default 0, -- authorized value defining this item as damaged (MARC21 952$4)
1050
  `damaged` tinyint(1) NOT NULL default 0, -- authorized value defining this item as damaged (MARC21 952$4)
1049
  `itemlost` tinyint(1) NOT NULL default 0, -- authorized value defining this item as lost (MARC21 952$1)
1051
  `itemlost` tinyint(1) NOT NULL default 0, -- authorized value defining this item as lost (MARC21 952$1)
1052
  `itemlost_on` datetime DEFAULT NULL, -- the date and time an item was last marked as lost, NULL if not lost
1050
  `wthdrawn` tinyint(1) NOT NULL default 0, -- authorized value defining this item as withdrawn (MARC21 952$0)
1053
  `wthdrawn` tinyint(1) NOT NULL default 0, -- authorized value defining this item as withdrawn (MARC21 952$0)
1054
  `wthdrawn_on` datetime DEFAULT NULL, -- the date and time an item was last marked as withdrawn, NULL if not withdrawn
1051
  `itemcallnumber` varchar(255) default NULL, -- call number for this item (MARC21 952$o)
1055
  `itemcallnumber` varchar(255) default NULL, -- call number for this item (MARC21 952$o)
1052
  `coded_location_qualifier` varchar(10) default NULL, -- coded location qualifier(MARC21 952$f)
1056
  `coded_location_qualifier` varchar(10) default NULL, -- coded location qualifier(MARC21 952$f)
1053
  `issues` smallint(6) default NULL, -- number of times this item has been checked out/issued
1057
  `issues` smallint(6) default NULL, -- number of times this item has been checked out/issued
(-)a/installer/data/mysql/updatedatabase.pl (+10 lines)
Lines 6655-6660 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
6655
    SetVersion($DBversion);
6655
    SetVersion($DBversion);
6656
}
6656
}
6657
6657
6658
$DBversion = "3.11.00.XXX";
6659
if ( CheckVersion($DBversion) ) {
6660
   $dbh->do("ALTER TABLE items ADD itemlost_on DATETIME NULL AFTER itemlost");
6661
   $dbh->do("ALTER TABLE items ADD wthdrawn_on DATETIME NULL AFTER wthdrawn");
6662
   $dbh->do("ALTER TABLE deleteditems ADD itemlost_on DATETIME NULL AFTER itemlost");
6663
   $dbh->do("ALTER TABLE deleteditems ADD wthdrawn_on DATETIME NULL AFTER wthdrawn");
6664
   print "Upgrade to $DBversion done (Bug 9673 - Track when items are marked as lost or withdrawn)\n";
6665
   SetVersion ($DBversion);
6666
}
6667
6658
=head1 FUNCTIONS
6668
=head1 FUNCTIONS
6659
6669
6660
=head2 TableExists($table)
6670
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt (-1 / +2 lines)
Lines 116-121 Link Here
116
                        &nbsp;
116
                        &nbsp;
117
                    [% END %]
117
                    [% END %]
118
                </li>
118
                </li>
119
                [% IF ITEM_DAT.itemlost_on %]<li><span class="label">Lost on:</span>[% ITEM_DAT.itemlost_on | $KohaDates %] &nbsp;</li>[% END %]
119
            [% END %]
120
            [% END %]
120
            [% IF ( ITEM_DAT.itemdamagedloop ) %]
121
            [% IF ( ITEM_DAT.itemdamagedloop ) %]
121
            <li><span class="label">Damaged status:</span>
122
            <li><span class="label">Damaged status:</span>
Lines 165-170 Link Here
165
                    </form>
166
                    </form>
166
                [% END %]
167
                [% END %]
167
            </li>
168
            </li>
169
            [% IF ITEM_DAT.wthdrawn_on %]<li><span class="label">Withdrawn on:</span>[% ITEM_DAT.wthdrawn_on | $KohaDates %] &nbsp;</li>[% END %]
168
            </ol></div>
170
            </ol></div>
169
            <div class="listgroup"><h4>History</h4>
171
            <div class="listgroup"><h4>History</h4>
170
            <ol class="bibliodetails">
172
            <ol class="bibliodetails">
171
- 

Return to bug 9673