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

(-)a/C4/Items.pm (+10 lines)
Lines 536-541 sub ModItem { Link Here
536
536
537
    $item->{onloan} = undef if $item->{itemlost};
537
    $item->{onloan} = undef if $item->{itemlost};
538
538
539
    for my $field ( qw( itemlost withdrawn ) ) {
540
        if ( defined( $item->{$field} ) ) {
541
            if ( $item->{$field} ) {
542
                $item->{$field . '_on'} = DateTime::Format::MySQL->format_datetime( DateTime->now() );
543
            } else {
544
                $item->{$field . '_on'} = undef;
545
            }
546
        }
547
    }
548
539
    _set_derived_columns_for_mod($item);
549
    _set_derived_columns_for_mod($item);
540
    _do_column_fixes_for_mod($item);
550
    _do_column_fixes_for_mod($item);
541
    # FIXME add checks
551
    # FIXME add checks
(-)a/installer/data/mysql/kohastructure.sql (+4 lines)
Lines 866-872 CREATE TABLE `deleteditems` ( Link Here
866
  `notforloan` tinyint(1) NOT NULL default 0, -- authorized value defining why this item is not for loan (MARC21 952$7)
866
  `notforloan` tinyint(1) NOT NULL default 0, -- authorized value defining why this item is not for loan (MARC21 952$7)
867
  `damaged` tinyint(1) NOT NULL default 0, -- authorized value defining this item as damaged (MARC21 952$4)
867
  `damaged` tinyint(1) NOT NULL default 0, -- authorized value defining this item as damaged (MARC21 952$4)
868
  `itemlost` tinyint(1) NOT NULL default 0, -- authorized value defining this item as lost (MARC21 952$1)
868
  `itemlost` tinyint(1) NOT NULL default 0, -- authorized value defining this item as lost (MARC21 952$1)
869
  `itemlost_on` datetime DEFAULT NULL, -- the date and time an item was last marked as lost, NULL if not lost
869
  `withdrawn` tinyint(1) NOT NULL default 0, -- authorized value defining this item as withdrawn (MARC21 952$0)
870
  `withdrawn` tinyint(1) NOT NULL default 0, -- authorized value defining this item as withdrawn (MARC21 952$0)
871
  `wthdrawn_on` datetime DEFAULT NULL, -- the date and time an item was last marked as withdrawn, NULL if not withdrawn
870
  `itemcallnumber` varchar(255) default NULL, -- call number for this item (MARC21 952$o)
872
  `itemcallnumber` varchar(255) default NULL, -- call number for this item (MARC21 952$o)
871
  `coded_location_qualifier` varchar(10) default NULL, -- coded location qualifier(MARC21 952$f)
873
  `coded_location_qualifier` varchar(10) default NULL, -- coded location qualifier(MARC21 952$f)
872
  `issues` smallint(6) default NULL, -- number of times this item has been checked out
874
  `issues` smallint(6) default NULL, -- number of times this item has been checked out
Lines 1158-1164 CREATE TABLE `items` ( -- holdings/item information Link Here
1158
  `notforloan` tinyint(1) NOT NULL default 0, -- authorized value defining why this item is not for loan (MARC21 952$7)
1160
  `notforloan` tinyint(1) NOT NULL default 0, -- authorized value defining why this item is not for loan (MARC21 952$7)
1159
  `damaged` tinyint(1) NOT NULL default 0, -- authorized value defining this item as damaged (MARC21 952$4)
1161
  `damaged` tinyint(1) NOT NULL default 0, -- authorized value defining this item as damaged (MARC21 952$4)
1160
  `itemlost` tinyint(1) NOT NULL default 0, -- authorized value defining this item as lost (MARC21 952$1)
1162
  `itemlost` tinyint(1) NOT NULL default 0, -- authorized value defining this item as lost (MARC21 952$1)
1163
  `itemlost_on` datetime DEFAULT NULL, -- the date and time an item was last marked as lost, NULL if not lost
1161
  `withdrawn` tinyint(1) NOT NULL default 0, -- authorized value defining this item as withdrawn (MARC21 952$0)
1164
  `withdrawn` tinyint(1) NOT NULL default 0, -- authorized value defining this item as withdrawn (MARC21 952$0)
1165
  `wthdrawn_on` datetime DEFAULT NULL, -- the date and time an item was last marked as withdrawn, NULL if not withdrawn
1162
  `itemcallnumber` varchar(255) default NULL, -- call number for this item (MARC21 952$o)
1166
  `itemcallnumber` varchar(255) default NULL, -- call number for this item (MARC21 952$o)
1163
  `coded_location_qualifier` varchar(10) default NULL, -- coded location qualifier(MARC21 952$f)
1167
  `coded_location_qualifier` varchar(10) default NULL, -- coded location qualifier(MARC21 952$f)
1164
  `issues` smallint(6) default NULL, -- number of times this item has been checked out/issued
1168
  `issues` smallint(6) default NULL, -- number of times this item has been checked out/issued
(-)a/installer/data/mysql/updatedatabase.pl (+10 lines)
Lines 7155-7160 if ( CheckVersion($DBversion) ) { Link Here
7155
    SetVersion($DBversion);
7155
    SetVersion($DBversion);
7156
}
7156
}
7157
7157
7158
$DBversion = "3.13.00.XXX";
7159
if ( CheckVersion($DBversion) ) {
7160
   $dbh->do("ALTER TABLE items ADD itemlost_on DATETIME NULL AFTER itemlost");
7161
   $dbh->do("ALTER TABLE items ADD wthdrawn_on DATETIME NULL AFTER wthdrawn");
7162
   $dbh->do("ALTER TABLE deleteditems ADD itemlost_on DATETIME NULL AFTER itemlost");
7163
   $dbh->do("ALTER TABLE deleteditems ADD wthdrawn_on DATETIME NULL AFTER wthdrawn");
7164
   print "Upgrade to $DBversion done (Bug 9673 - Track when items are marked as lost or withdrawn)\n";
7165
   SetVersion ($DBversion);
7166
}
7167
7158
=head1 FUNCTIONS
7168
=head1 FUNCTIONS
7159
7169
7160
=head2 TableExists($table)
7170
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt (-1 / +2 lines)
Lines 127-132 Link Here
127
                         
127
                         
128
                    [% END %]
128
                    [% END %]
129
                </li>
129
                </li>
130
                [% IF ITEM_DAT.itemlost_on %]<li><span class="label">Lost on:</span>[% ITEM_DAT.itemlost_on | $KohaDates %] &nbsp;</li>[% END %]
130
            [% END %]
131
            [% END %]
131
            [% IF ( ITEM_DAT.itemdamagedloop ) %]
132
            [% IF ( ITEM_DAT.itemdamagedloop ) %]
132
            <li><span class="label">Damaged status:</span>
133
            <li><span class="label">Damaged status:</span>
Lines 176-181 Link Here
176
                    </form>
177
                    </form>
177
                [% END %]
178
                [% END %]
178
            </li>
179
            </li>
180
            [% IF ITEM_DAT.wthdrawn_on %]<li><span class="label">Withdrawn on:</span>[% ITEM_DAT.wthdrawn_on | $KohaDates %] &nbsp;</li>[% END %]
179
            </ol></div>
181
            </ol></div>
180
            <div class="listgroup"><h4>History</h4>
182
            <div class="listgroup"><h4>History</h4>
181
            <ol class="bibliodetails">
183
            <ol class="bibliodetails">
182
- 

Return to bug 9673