diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 580949d109..a700b950b8 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -174,6 +174,7 @@ my $authvalcode_items_itemlost = GetAuthValCode('items.itemlost',$fw); my $authvalcode_items_damaged = GetAuthValCode('items.damaged', $fw); my $analytics_flag; +my $materials_flag; # set this if the items have anything in the materials field foreach my $item (@items) { $item->{homebranch} = GetBranchName($item->{homebranch}); @@ -251,7 +252,9 @@ foreach my $item (@items) { $analytics_flag=1; $item->{countanalytics} = $countanalytics; } - + if ($item->{'materials'} ne ''){ + $materials_flag = 1; + } push @itemloop, $item; } @@ -276,6 +279,7 @@ $template->param( hostrecords => $hostrecords, analytics_flag => $analytics_flag, C4::Search::enabled_staff_search_views, + materials => $materials_flag, ); if (C4::Context->preference("AlternateHoldingsField") && scalar @items == 0) { diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 3de15c2d75..6f823ef48d 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -1029,7 +1029,7 @@ CREATE TABLE `items` ( -- holdings/item information `cn_source` varchar(10) default NULL, -- classification source used on this item (MARC21 952$2) `cn_sort` varchar(30) default NULL, -- normalized form of the call number (MARC21 952$o) used for sorting `ccode` varchar(10) default NULL, -- authorized value for the collection code associated with this item (MARC21 952$8) - `materials` varchar(10) default NULL, -- materials specified (MARC21 952$3) + `materials` text default NULL, -- materials specified (MARC21 952$3) `uri` varchar(255) default NULL, -- URL for the item (MARC21 952$u) `itype` varchar(10) default NULL, -- foreign key from the itemtypes table defining the type for this item (MARC21 952$y) `more_subfields_xml` longtext default NULL, -- additional 952 subfields in XML format diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index a95041204f..840044afe3 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -4569,6 +4569,14 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion($DBversion); } +$DBversion = "3.07.00.XXX"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("ALTER TABLE items MODIFY materials text;"); + print "Upgrade to $DBversion done alter items.material from varchar(10) to text \n"; + SetVersion ($DBversion); +} + + =head1 FUNCTIONS =head2 DropAllForeignKeys($table) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index 019fa10e86..2a4a975304 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -243,6 +243,7 @@ function verify_images() {