Bug 30678: Add OCLC_NO as option to OPACSearchForTitleIn

We need to pass OCLC_NO as key to C4::Output::parametrized_url.
We get it from MARC21 035$a and strip the organizational code.

Test plan:
Add e.g. 62385712 in 035$a in a record.
Add e.g. following link to pref OPACSearchForTitleIn:
    <a  href="https://worldcat.org/search?q={OCLC_NO}" target="_blank">WorldCat (via OCLC number)</a>
Open that record on detail page. Click More searches. Follow that link.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Marcel de Rooy 2022-05-04 14:30:28 +00:00 committed by Tomas Cohen Arazi
parent 39ae2fa3fe
commit ff0da4944c
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
3 changed files with 9 additions and 0 deletions

View File

@ -201,6 +201,8 @@ my $issn = $marcissns->[0] || '';
if (my $search_for_title = C4::Context->preference('OPACSearchForTitleIn')){
$dat->{title} =~ s/\/+$//; # remove trailing slash
$dat->{title} =~ s/\s+$//; # remove trailing space
my $oclc_no = $record->subfield('035','a') // q{};
$oclc_no =~ s/\([^)]*\)//;
$search_for_title = parametrized_url(
$search_for_title,
{
@ -210,6 +212,7 @@ if (my $search_for_title = C4::Context->preference('OPACSearchForTitleIn')){
ISSN => $issn,
CONTROLNUMBER => $marccontrolnumber,
BIBLIONUMBER => $biblionumber,
OCLC_NO => $oclc_no,
}
);
$template->param('OPACSearchForTitleIn' => $search_for_title);

View File

@ -352,6 +352,8 @@ my $issn = $marcissns->[0] || '';
if (my $search_for_title = C4::Context->preference('OPACSearchForTitleIn')){
$dat->{title} =~ s/\/+$//; # remove trailing slash
$dat->{title} =~ s/\s+$//; # remove trailing space
my $oclc_no = $record->subfield('035','a') // q{};
$oclc_no =~ s/\([^)]*\)//;
$search_for_title = parametrized_url(
$search_for_title,
{
@ -361,6 +363,7 @@ if (my $search_for_title = C4::Context->preference('OPACSearchForTitleIn')){
ISSN => $issn,
CONTROLNUMBER => $marccontrolnumber,
BIBLIONUMBER => $biblionumber,
OCLC_NO => $oclc_no,
}
);
$template->param('OPACSearchForTitleIn' => $search_for_title);

View File

@ -1186,6 +1186,8 @@ my $issn = $marcissns->[0] || '';
if (my $search_for_title = C4::Context->preference('OPACSearchForTitleIn')){
$dat->{title} =~ s/\/+$//; # remove trailing slash
$dat->{title} =~ s/\s+$//; # remove trailing space
my $oclc_no = $record->subfield('035','a') // q{};
$oclc_no =~ s/\([^)]*\)//;
$search_for_title = parametrized_url(
$search_for_title,
{
@ -1195,6 +1197,7 @@ if (my $search_for_title = C4::Context->preference('OPACSearchForTitleIn')){
ISSN => $issn,
CONTROLNUMBER => $marccontrolnumber,
BIBLIONUMBER => $biblionumber,
OCLC_NO => $oclc_no,
}
);
$template->param('OPACSearchForTitleIn' => $search_for_title);