From 67c6c95396fcaeca49da68499b0ceb5b6350b4b8 Mon Sep 17 00:00:00 2001 From: Chris Cormack Date: Thu, 1 Dec 2011 10:46:52 +1300 Subject: [PATCH] Bug 7728 : Materials Specified field made larger and displayed This first page makes the database change, and displays the field on the detail.pl and moredetail.pl pages in the staff client How to Test: * Add a note to the materials specified page in cataloguing (952 subfield 3 for MARC21, but it shouldn't matter as long as you have a field mapped to items.materials * Check it displays at catalogue/detail.pl * Check it displays at catalogue/moredetail.pl Patch to follow to have the note display at checkin/checkout http://bugs.koha-community.org/show_bug.cgi?id=7278 Signed-off-by: Katrin Fischer Fixed conflicts in updatedatabase.pl and kohastructure.sql --- catalogue/detail.pl | 6 +++++- installer/data/mysql/kohastructure.sql | 2 +- installer/data/mysql/updatedatabase.pl | 8 ++++++++ .../intranet-tmpl/prog/en/modules/catalogue/detail.tt | 4 ++++ .../intranet-tmpl/prog/en/modules/catalogue/moredetail.tt | 1 + 5 files changed, 19 insertions(+), 2 deletions(-) diff --git a/catalogue/detail.pl b/catalogue/detail.pl index a1e5cc91a3..3c95ba2739 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -175,6 +175,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}); @@ -252,7 +253,9 @@ foreach my $item (@items) { $analytics_flag=1; $item->{countanalytics} = $countanalytics; } - + if ($item->{'materials'} ne ''){ + $materials_flag = 1; + } push @itemloop, $item; } @@ -277,6 +280,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 5287d9fb20..e53a74ee70 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -1031,7 +1031,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 acc6ebe36b..ed47ebe3a6 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -4598,6 +4598,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 dae3ad51c8..5740c1f754 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -248,6 +248,7 @@ function verify_images() { Status Last seen Barcode + [% IF materials %]Materials Specified[% END %] [% IF ( volinfo ) %]Publication Details[% END %] [% IF ( itemdata_uri ) %]url[% END %] [% IF ( itemdata_copynumber ) %]Copy No.[% END %] @@ -377,6 +378,9 @@ function verify_images() { [% IF ( itemdata_copynumber ) %] [% itemloo.copynumber %] [% END %] + [% IF itemloo.materials %] + [% itemloo.materials %] + [% END %] [% IF ( itemdata_itemnotes ) %]
[% itemloo.itemnotes %]
[% END %] [% IF ( SpineLabelShowPrintOnBibDetails ) %] Print Label diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt index e79e9e8e87..57dac9a661 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt @@ -58,6 +58,7 @@
  • Item Callnumber: [% ITEM_DAT.itemcallnumber %] 
  • [% IF ( ITEM_DAT.copyvol ) %]
  • Copy / Vol : [% ITEM_DAT.copyvol %] 
  • [% END %] [% IF ( ITEM_DAT.replacementprice ) %]
  • Replacement Price: [% ITEM_DAT.replacementprice %] 
  • [% END %] + [% IF ITEM_DAT.materials %]
  • Materials Specified: [% ITEM_DAT.materials %]
  • [% END %]

    Statuses [% IF ( ITEM_DAT.status_advisory ) %]( [% IF ( ITEM_DAT.notforloantext ) %][% ITEM_DAT.notforloantext %] [% END %] -- 2.39.5