Bugzilla – Attachment 2781 Details for
Bug 5430
Add Control number as option to OPACSearchForTitleIn
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed patch
0001-Bug-5430-Add-Control-number-as-option-to-OPACSearchF.patch (text/plain), 3.54 KB, created by
Katrin Fischer
on 2010-11-24 06:29:44 UTC
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2010-11-24 06:29:44 UTC
Size:
3.54 KB
patch
obsolete
>From 6667fa392bb6f5256893e5a235b58a4536e96ae8 Mon Sep 17 00:00:00 2001 >From: Katrin Fischer <Katrin.Fischer.83@web.de> >Date: Wed, 24 Nov 2010 07:24:56 +0100 >Subject: [PATCH] Bug 5430: Add Control number as option to OPACSearchForTitleIn >Content-Type: text/plain; charset="utf-8" > >Makes {CONTROLNUMBER} available as new placeholder in >system preference OPACSearchForTitleIn. > >{CONTROLNUMBER} will be replaced by the number in tag 001. >--- > C4/Biblio.pm | 19 +++++++++++++++++++ > .../prog/en/modules/admin/preferences/opac.pref | 2 +- > opac/opac-detail.pl | 3 +++ > 3 files changed, 23 insertions(+), 1 deletions(-) > >diff --git a/C4/Biblio.pm b/C4/Biblio.pm >index 6a422be..4102e23 100644 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -67,6 +67,7 @@ BEGIN { > > &GetISBDView > >+ &GetMarcControlnumber > &GetMarcNotes > &GetMarcSubjects > &GetMarcBiblio >@@ -1254,6 +1255,24 @@ sub GetAuthorisedValueDesc { > } > } > >+=head2 GetMarcControlnumber >+ >+ $marccontrolnumber = GetMarcControlnumber($record,$marcflavour); >+ >+Get the control number / record Identifier from the MARC record and return it. >+ >+=cut >+ >+sub GetMarcControlnumber { >+ my ( $record, $marcflavour ) = @_; >+ my $controlnumber = ""; >+ # Control number or Record identifier are the same field in MARC21 and UNIMARC >+ # Keep $marcflavour for possible later use >+ if ($marcflavour eq "MARC21" || $marcflavour eq "UNIMARC") { >+ $controlnumber = $record->field('001')->data(); >+ } >+} >+ > =head2 GetMarcNotes > > $marcnotesarray = GetMarcNotes( $record, $marcflavour ); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >index 2619d8c..55560d3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >@@ -137,7 +137,7 @@ OPAC: > class: code > - > - 'Include a "More Searches" box on the detail pages of items on the OPAC, with the following HTML (leave blank to disable):' >- - '<br />Note: The placeholders {TITLE}, {ISBN} and {AUTHOR} will be replaced with information from the displayed record.' >+ - '<br />Note: The placeholders {CONTROLNUMBER}, {TITLE}, {ISBN} and {AUTHOR} will be replaced with information from the displayed record.' > - pref: OPACSearchForTitleIn > type: textarea > class: code >diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl >index 0cd05f7..2de8ec8 100755 >--- a/opac/opac-detail.pl >+++ b/opac/opac-detail.pl >@@ -584,12 +584,15 @@ if (C4::Context->preference('TagsEnabled') and $tag_quantity = C4::Context->pref > } > > #Search for title in links >+my $marccontrolnumber = GetMarcControlnumber ($record, $marcflavour); >+ > if (my $search_for_title = C4::Context->preference('OPACSearchForTitleIn')){ > $dat->{author} ? $search_for_title =~ s/{AUTHOR}/$dat->{author}/g : $search_for_title =~ s/{AUTHOR}//g; > $dat->{title} =~ s/\/+$//; # remove trailing slash > $dat->{title} =~ s/\s+$//; # remove trailing space > $dat->{title} ? $search_for_title =~ s/{TITLE}/$dat->{title}/g : $search_for_title =~ s/{TITLE}//g; > $isbn ? $search_for_title =~ s/{ISBN}/$isbn/g : $search_for_title =~ s/{ISBN}//g; >+ $marccontrolnumber ? $search_for_title =~ s/{CONTROLNUMBER}/$marccontrolnumber/g : $search_for_title =~ s/{CONTROLNUMBER}//g; > $template->param('OPACSearchForTitleIn' => $search_for_title); > } > >-- >1.7.1 >
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 5430
: 2781 |
2793