Dear all,
Not sure whether this feature will be useful to others.
Not sure its implementation is satisfactory either.
So, comments are very welcome.
Sébastien.
>From a3041b72f7d2827c4c9ffd1f7ca6b184a0346979 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Hinderer?= <[email protected]>
Date: Wed, 4 Nov 2009 11:02:07 +0100
Subject: [PATCH] ISBD view enhancement: accept {...@kohafield} in the isbd system preference.
Content-Type: text/plain; charset="utf-8"
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
_______________________________________________
Koha-patches mailing list
[email protected]
http://lists.koha.org/mailman/listinfo/koha-patches