@@ -, +, @@ --- admin/systempreferences.pl | 3 +- installer/data/mysql/en/mandatory/sysprefs.sql | 2 + installer/data/mysql/updatedatabase.pl | 11 ++ .../prog/en/modules/admin/preferences/opac.pref | 6 + koha-tmpl/opac-tmpl/prog/en/css/opac.css | 30 ++++ .../opac-tmpl/prog/en/modules/opac-detail.tmpl | 139 ++++++++++++++++++-- opac/opac-detail.pl | 33 +++++ 7 files changed, 214 insertions(+), 10 deletions(-) --- a/admin/systempreferences.pl +++ a/admin/systempreferences.pl @@ -379,7 +379,8 @@ $tabsysprefs{OPACItemHolds} = "OPAC"; $tabsysprefs{OPACGroupResults} = "OPAC"; $tabsysprefs{XSLTDetailsDisplay} = "OPAC"; $tabsysprefs{XSLTResultsDisplay} = "OPAC"; -$tabsysprefs{OPACShowCheckoutName} = "OPAC"; +$tabsysprefs{OPACShowCheckoutName} = "OPAC"; +$tabsysprefs{OPACSearchReboundBy} = "OPAC"; # Serials $tabsysprefs{RoutingListAddReserves} = "Serials"; --- a/installer/data/mysql/en/mandatory/sysprefs.sql +++ a/installer/data/mysql/en/mandatory/sysprefs.sql @@ -292,3 +292,5 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('TraceCompleteSubfields','0','Force subject tracings to only match complete subfields.','0','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('UseAuthoritiesForTracings','1','Use authority record numbers for subject tracings instead of heading strings.','0','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OPACAllowUserToChooseBranch', 1, 'Allow the user to choose the branch they want to pickup their hold from','1','YesNo'); +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( 'OPACSearchReboundBy', 'term', 'term|authority', 'determines if the rebound search use authority number or term.', 'Choice' ); + --- a/installer/data/mysql/updatedatabase.pl +++ a/installer/data/mysql/updatedatabase.pl @@ -4090,6 +4090,17 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion = 'XXX'; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do(q{ + INSERT INTO systempreferences (variable,value,explanation,options,type) + VALUES ('OPACSearchReboundBy', 'term', 'determines if the search rebound use authority number or term.','term|authority','Choice'); +}); + print "Upgrade to $DBversion done. (Add a new system preference OPACSearchReboundBy)\n"; + SetVersion ($DBversion); +} + + =head1 FUNCTIONS =head2 DropAllForeignKeys($table) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -225,6 +225,12 @@ OPAC: yes: Allow no: "Don't allow" - patrons to place holds on items from the OPAC. + - + - Do search rebound on + - pref: OPACSearchReboundBy + choices: + authority: Authority + term: Term Policy: - - pref: singleBranchMode --- a/koha-tmpl/opac-tmpl/prog/en/css/opac.css +++ a/koha-tmpl/opac-tmpl/prog/en/css/opac.css @@ -1956,6 +1956,36 @@ a.p1:active { div.ft { clear : both; } + +.authorSearch { + position: absolute; + display: none; + z-index: 2; + background-color: white; + border: 1px solid black; + padding: 4px; +} +.authorSearch li { + list-style-type: none; +} +.authorSearch ul { + padding-left: 0px; +} +.subjectSearch { + position: absolute; + display: none; + z-index: 2; + background-color: white; + border: 1px solid black; + padding: 4px; +} +.subjectSearch li { + list-style-type: none; +} +.subjectSearch ul { + padding-left: 0px; +} + #basket td ul li { font-size:90%; list-style:disc outside url("../../images/item-bullet.gif"); --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl +++ a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl @@ -44,6 +44,95 @@ YAHOO.util.Event.onContentReady("furtherm", function () { //]]> + @@ -101,12 +190,26 @@ YAHOO.util.Event.onContentReady("furtherm", function () { - Authors: - - :"> - | - + + Authors: +
+ Select the item(s) to search : +
    +
  • all
  • + +
  • an:au,wrdl:+au,wrdl:+">
  • + +
+ Cancel | Search +
+ + /cgi-bin/koha/opac-authoritiesdetail.pl?authid=" > + + + an:au,wrdl:+au,wrdl:+')">  |  + +
@@ -160,12 +263,30 @@ YAHOO.util.Event.onContentReady("furtherm", function () { - Subject(s): + Subject(s): +
+ Select the item(s) to search : +
    +
  • all
  • + + +
  • " value="an:su,wrdl:">
  • + +

  • + +
+ Cancel | Search +
- " href="/cgi-bin/koha/opac-search.pl?q=:"> - | -
+ + + "> + + an:su,wrdl:', '')"> + | + +
Subject(s): "> | --- a/opac/opac-detail.pl +++ a/opac/opac-detail.pl @@ -205,6 +205,38 @@ my $marcseriesarray = GetMarcSeries ($record,$marcflavour); my $marcurlsarray = GetMarcUrls ($record,$marcflavour); my $subtitle = GetRecordValue('subtitle', $record, GetFrameworkCode($biblionumber)); +#search rebound parameter +my $searchByauthority = 0; +if ( C4::Context->preference("OPACSearchReboundBy") eq "authority" ) { + $searchByauthority = 1; +} + +#search rebound on author +my @reboundmarcauthorsarray; +foreach my $author (@$marcauthorsarray) { + my ( $a, $b, $authoritylink, @term ); + foreach my $subfield ( @{ $author->{'MARCAUTHOR_SUBFIELDS_LOOP'} } ) { + if ( $subfield->{'code'} eq "a" && @{ $subfield->{'link_loop'} }[0]->{"limit"} eq "an" ) { + $authoritylink = @{ $subfield->{'link_loop'} }[0]->{"link"}; + } + unless ( $subfield->{'code'} eq "3" || $subfield->{'code'} eq "4" ) { push( @term, { value => $subfield->{'value'} } ); } + } + push( + @reboundmarcauthorsarray, + { term => \@term, + authoritylink => $authoritylink, + searchbyauthority => $searchByauthority, + } + ); +} + +#search rebound on subject +foreach my $subject (@$marcsubjctsarray) { + foreach my $subfield ( @{ $subject->{'MARCSUBJECT_SUBFIELDS_LOOP'} } ) { + $subfield->{'searchbyauthority'} = $searchByauthority; + } +} + $template->param( MARCNOTES => $marcnotesarray, MARCSUBJCTS => $marcsubjctsarray, @@ -220,6 +252,7 @@ my $subtitle = GetRecordValue('subtitle', $record, GetFrameworkCode($bib itemdata_itemnotes => $itemfields{itemnotes}, authorised_value_images => $biblio_authorised_value_images, subtitle => $subtitle, + bouncemarcauthorsarray => \@reboundmarcauthorsarray, ); foreach ( keys %{$dat} ) { --