From b539c9b1c6d2547a196d7fc6ce2be5fccc7b9b79 Mon Sep 17 00:00:00 2001 From: dev2 Date: Mon, 21 Jun 2010 15:33:59 -0400 Subject: [PATCH] Bug 5193 Enhancement to allow use of specialized auction indexes Adds syspref to determine if auction indexes show in OPAC & staff advanced search, adds 591, 592, 593 fields to default framework and to indexes --- admin/systempreferences.pl | 2 ++ catalogue/search.pl | 5 +++++ etc/zebradb/biblios/etc/bib1.att | 5 +++++ etc/zebradb/ccl.properties | 5 +++++ etc/zebradb/marc_defs/marc21/biblios/record.abs | 4 ++++ installer/data/mysql/updatedatabase.pl | 13 +++++++++++++ .../prog/en/includes/search_indexes.inc | 6 ++++++ .../en/modules/admin/preferences/searching.pref | 8 ++++++++ .../opac-tmpl/prog/en/modules/opac-advsearch.tmpl | 6 ++++++ opac/opac-search.pl | 5 +++++ 10 files changed, 59 insertions(+), 0 deletions(-) diff --git a/admin/systempreferences.pl b/admin/systempreferences.pl index 824b058..b91df9b 100755 --- a/admin/systempreferences.pl +++ b/admin/systempreferences.pl @@ -274,6 +274,8 @@ $tabsysprefs{QueryAutoTruncate} = "Searching"; $tabsysprefs{QueryRemoveStopwords} = "Searching"; $tabsysprefs{AdvancedSearchTypes} = "Searching"; $tabsysprefs{DisplayMultiPlaceHold} = "Searching"; +$tabsysprefs{OPACAdvancedSearchTypes} = "Searching"; +$tabsysprefs{ShowAuctionSearchOptions} = "Searching"; # EnhancedContent $tabsysprefs{AmazonEnabled} = "EnhancedContent"; diff --git a/catalogue/search.pl b/catalogue/search.pl index 920afb7..0b67877 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -311,6 +311,11 @@ if ( $template_type eq 'advsearch' ) { my $languages_limit_loop = getAllLanguages(); $template->param(search_languages_loop => $languages_limit_loop,); + # display the auction house indexes + if ( C4::Context->preference("ShowAuctionSearchOptions") == 1) { + $template->param( ShowAuctionSearchOptions => C4::Context->preference("ShowAuctionSearchOptions") ); + } + # use the global setting by default if ( C4::Context->preference("expandedSearchOption") == 1) { $template->param( expanded_options => C4::Context->preference("expandedSearchOption") ); diff --git a/etc/zebradb/biblios/etc/bib1.att b/etc/zebradb/biblios/etc/bib1.att index d47b2a3..fce37b5 100644 --- a/etc/zebradb/biblios/etc/bib1.att +++ b/etc/zebradb/biblios/etc/bib1.att @@ -189,3 +189,8 @@ att 9903 lex att 9904 arl att 9013 arp att 9520 Item +#Auction house indexes +att 9950 auctplace +att 9951 auctdate +att 9952 auctcode + diff --git a/etc/zebradb/ccl.properties b/etc/zebradb/ccl.properties index 231c420..c2213e1 100644 --- a/etc/zebradb/ccl.properties +++ b/etc/zebradb/ccl.properties @@ -1052,6 +1052,11 @@ arl 1=9904 r=r #Accelerated Reader Point arp 1=9013 r=r +# auction information +auctplace 1=9950 +auctdate 1=9951 +auctcode 1=9952 + ## Statuses popularity 1=issues diff --git a/etc/zebradb/marc_defs/marc21/biblios/record.abs b/etc/zebradb/marc_defs/marc21/biblios/record.abs index 6cf37ba..46b8cdc 100644 --- a/etc/zebradb/marc_defs/marc21/biblios/record.abs +++ b/etc/zebradb/marc_defs/marc21/biblios/record.abs @@ -153,6 +153,10 @@ melm 526$d arp,arp:n #melm 533$d pubdate,pubdate:s #melm 541$d Date-of-acquisition,Date-of-acquisition:s melm 590 Note:w,Note:p +melm 591 auctplace:w,auctplace:p +melm 592 auctdate,auctdate:s +melm 593 auctcode:w,auctcode:p + melm 600$a Name-and-title,Name,Personal-name,Subject-name-personal,Subject melm 600$t Name-and-title,Title,Subject diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index a0b5c4a..8d8784e 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -3698,6 +3698,19 @@ $DBversion = "3.01.00.145"; if (C4::Context->preference("Version") < TransformToNum($DBversion)) { $dbh->do("ALTER TABLE borrowers ADD KEY `guarantorid` (guarantorid);"); print "Upgrade to $DBversion done (Add index on guarantorid)\n"; +} +$DBversion = '3.01.00.146'; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('ShowAuctionSearchOptions', '0', 'If ON, includes specialized auction catalog/house/date searches in advanced search (staff and OPAC)', '', 'YesNo')"); + $dbh->do("INSERT INTO `marc_tag_structure` (`tagfield`, `liblibrarian`, `libopac`, `repeatable`, `mandatory`, `authorised_value`, `frameworkcode`) VALUES + ('591', 'AUCTION HOUSE', 'AUCTION HOUSE', 1, 0, NULL, ''), + ('592', 'DATE OF AUCTION SALE', 'DATE OF AUCTION SALE', 1, 0, NULL, ''), + ('593', 'AUCTION SALES CODE', 'AUCTION SALES CODE', 1, 0, NULL, '')"); + $dbh->do("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 + ('591', 'a', 'AUCTION HOUSE', 'AUCTION HOUSE', 0, 0, NULL, 5, NULL, NULL, '', NULL, 0, '', '', '', NULL), + ('592', 'a', 'DATE OF AUCTION SALE', 'DATE OF AUCTION SALE', 0, 0, NULL, 5, NULL, NULL, '', NULL, 0, '', '', '', NULL), + ('593', 'a', 'AUCTION SALES CODE', 'AUCTION SALES CODE', 0, 0, NULL, 5, NULL, NULL, '', NULL, 0, '', '', '', NULL)"); + print "Upgrade to $DBversion done ( Added 591, 592, 593 fields into default framework for use with auction house/date/sales code indexes )\n"; SetVersion ($DBversion); } diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/search_indexes.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/search_indexes.inc index cd3226c..caaa015 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/search_indexes.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/search_indexes.inc @@ -13,6 +13,12 @@ + + + + + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref index f817ac8..69ca7cb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref @@ -58,6 +58,14 @@ Searching: - PazPar2 to group similar results on the OPAC. This requires that PazPar2 is set up and running. Search Form: - + - By default, + - pref: ShowAuctionSearchOptions + type: boolean + choices: + yes: show + no: "don't show" + - 'specialized auction indexes show in OPAC and staff advanced search.' + - - Show checkboxes to search by - pref: AdvancedSearchTypes choices: diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tmpl index 52b00e7..d56a357 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tmpl @@ -80,6 +80,12 @@ + + + + + + diff --git a/opac/opac-search.pl b/opac/opac-search.pl index 30bc34a..b12e9f2 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -241,6 +241,11 @@ if ( $template_type && $template_type eq 'advsearch' ) { advsearch => 1, search_boxes_loop => \@search_boxes_array); +# display the auction house indexes + if ( C4::Context->preference("ShowAuctionSearchOptions") == 1) { + $template->param( ShowAuctionSearchOptions => C4::Context->preference("ShowAuctionSearchOptions") ); + } + # use the global setting by default if ( C4::Context->preference("expandedSearchOption") == 1 ) { $template->param( expanded_options => C4::Context->preference("expandedSearchOption") ); -- 1.5.6.5