[PATCH] ISBD view enhancement: accept {@kohafield} in the isbd system preference.

Sébastien Hinderer Sebastien.Hinderer at ens-lyon.org
Wed Nov 4 11:02:07 CET 2009


The preference can contain something like {@biblionumber}.
---
 C4/Biblio.pm |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/C4/Biblio.pm b/C4/Biblio.pm
index cf48c91..fc61702 100644
--- a/C4/Biblio.pm
+++ b/C4/Biblio.pm
@@ -651,7 +651,9 @@ Return the ISBD view which can be included in opac and intranet
 
 sub GetISBDView {
     my $biblionumber    = shift;
+    my $dbh             = C4::Context->dbh;
     my $record          = GetMarcBiblio($biblionumber);
+    my $koha_record     = TransformMarcToKoha($dbh,$record);
     my $itemtype        = &GetFrameworkCode($biblionumber);
     my ($holdingbrtagf,$holdingbrtagsubf) = &GetMarcFromKohaField("items.holdingbranch",$itemtype);
     my $tagslib      = &GetMarcStructure( 1, $itemtype );
@@ -758,6 +760,8 @@ sub GetISBDView {
         }
     }
     $res .= $blocres;
+    # now replace {@foo} by the content of the foo Koha field
+    $res =~ s/\{@([^}]+)\}/$koha_record->{$1}/ge;
     
     $res =~ s/\{(.*?)\}//g;
     $res =~ s/\\n/\n/g;
-- 
1.6.5


--fdj2RfSjLxBAspz7--


More information about the Koha-patches mailing list