Bugzilla – Attachment 134844 Details for
Bug 30678
Add OCLC_NO as option to OPACSearchForTitleIn
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30678: Add OCLC_NO as option to OPACSearchForTitleIn
Bug-30678-Add-OCLCNO-as-option-to-OPACSearchForTit.patch (text/plain), 3.58 KB, created by
David Nind
on 2022-05-11 00:50:42 UTC
(
hide
)
Description:
Bug 30678: Add OCLC_NO as option to OPACSearchForTitleIn
Filename:
MIME Type:
Creator:
David Nind
Created:
2022-05-11 00:50:42 UTC
Size:
3.58 KB
patch
obsolete
>From 1ad146b3d4476b8797e09add7038fdc16cf18c73 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Wed, 4 May 2022 14:30:28 +0000 >Subject: [PATCH] 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> >--- > opac/opac-ISBDdetail.pl | 3 +++ > opac/opac-MARCdetail.pl | 3 +++ > opac/opac-detail.pl | 3 +++ > 3 files changed, 9 insertions(+) > >diff --git a/opac/opac-ISBDdetail.pl b/opac/opac-ISBDdetail.pl >index 9335ea4ccd..05e06c1849 100755 >--- a/opac/opac-ISBDdetail.pl >+++ b/opac/opac-ISBDdetail.pl >@@ -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); >diff --git a/opac/opac-MARCdetail.pl b/opac/opac-MARCdetail.pl >index 0133784d39..444d9de8ad 100755 >--- a/opac/opac-MARCdetail.pl >+++ b/opac/opac-MARCdetail.pl >@@ -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); >diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl >index b281c958f6..003d731ae8 100755 >--- a/opac/opac-detail.pl >+++ b/opac/opac-detail.pl >@@ -1175,6 +1175,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, > { >@@ -1184,6 +1186,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); >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 30678
:
134613
|
134614
|
134814
|
134815
|
134844
|
134845
|
134846
|
134847
|
136222
|
136223
|
136224
|
136225
|
138046
|
138047
|
138048
|
138049
|
138050