Bug 5533 followup: reinstate Lost status editing
authorIan Walls <ian.walls@bywatersolutions.com>
Thu, 15 Dec 2011 13:21:56 +0000 (08:21 -0500)
committerPaul Poulain <paul.poulain@biblibre.com>
Tue, 17 Jan 2012 15:01:38 +0000 (16:01 +0100)
The original patch for 5533 removed the Lost status from the edit items screen; new items were not affected,
and batch changes could still be made, so this was not a consistent change.

This patch removes the filter that hid the Lost status dropdown, but then changes the default MARC framework
to hide this field by default (value -5).  New installations will not see this status in the editor, unless
they manually activate it.  This will enforce the semantics of using the "mark lost" options by default, but
provide a workaround for libraries that understand and accept the consequences of manually editing this field.

To test:

1.  on an existing install, edit an item.  you should have the Lost status visible
2.  on a new install, editing or creating an item should not show the Lost status at all

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
cataloguing/additem.pl
installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.sql

index 4442ed3..979efae 100755 (executable)
@@ -670,8 +670,6 @@ if($itemrecord){
             next if subfield_is_koha_internal_p($subfieldtag);
             next if ($tagslib->{$tag}->{$subfieldtag}->{'tab'} ne "10");
 
-            $subfieldlib->{hidden} = 1
-              if $tagslib->{$tag}->{$subfieldtag}->{authorised_value} eq 'LOST';
             my $subfield_data = generate_subfield_form($tag, $subfieldtag, $value, $tagslib, $subfieldlib, $branches, $today_iso, $biblionumber, $temp, \@loop_data, $i);        
 
             push @fields, "$tag$subfieldtag";
index 8e817ff..30fa334 100644 (file)
@@ -104,7 +104,7 @@ INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeat
 
 INSERT INTO `marc_subfield_structure` (`tagfield`, `tagsubfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `kohafield`, `tab`, `authorised_value`, `authtypecode`, `value_builder`, `isurl`, `hidden`, `frameworkcode`, `seealso`, `link`, `defaultvalue`) VALUES
                ('952', '0', 'Withdrawn status', 'Withdrawn status', 0, 0, 'items.wthdrawn', 10, 'WITHDRAWN', '', '', 0, 0, '', '', '', NULL),
-               ('952', '1', 'Lost status', 'Lost status', 0, 0, 'items.itemlost', 10, 'LOST', '', '', 0, 0, '', '', '', NULL),
+               ('952', '1', 'Lost status', 'Lost status', 0, 0, 'items.itemlost', 10, 'LOST', '', '', 0, -5, '', '', '', NULL),
                ('952', '2', 'Source of classification or shelving scheme', 'Source of classification or shelving scheme', 0, 0, 'items.cn_source', 10, 'cn_source', '', '', NULL, 0, '', '', '', NULL),
                ('952', '3', 'Materials specified (bound volume or other part)', 'Materials specified (bound volume or other part)', 0, 0, 'items.materials', 10, '', '', '', NULL, -1, '', '', '', NULL),
                ('952', '4', 'Damaged status', 'Damaged status', 0, 0, 'items.damaged', 10, 'DAMAGED', '', '', NULL, 0, '', '', '', NULL),