6 use C4::Output; # contains picktemplate
16 my $language='french';
20 open (KC, "/etc/koha.conf");
25 if (/(.*)\s*=\s*(.*)/) {
28 # Clean up white space at beginning and end
33 $configfile{$variable}=$value;
38 my $biblionumber=$query->param('bib');
39 my $tag=$query->param('tag');
40 if (! defined $tag) { $tag='2XX';}
41 #print STDERR "BIB : $biblionumber // TAG : $tag\n";
42 if (! defined $biblionumber) {
43 my $includes=$configfile{'includes'};
44 ($includes) || ($includes="/usr/local/www/hdl/htdocs/includes");
45 my $templatebase="MARCdetailbiblioselect.tmpl";
46 my $theme=picktemplate($includes, $templatebase);
47 my $template = HTML::Template->new(filename => "$includes/templates/$theme/$templatebase", die_on_bad_params => 0, path => [$includes]);
48 print "Content-Type: text/html\n\n", $template->output;
51 &showmarcrecord($biblionumber,$tag);
55 my ($biblionumber,$tag) = @_;
57 my $sth=$dbh->prepare("select liblibrarian from marc_subfield_structure where tagfield=? and tagsubfield=?");
58 my $record =MARCgetbiblio($dbh,$biblionumber);
60 my $templatebase="catalogue/MARCdetail.tmpl";
61 my $includes=$configfile{'includes'};
62 ($includes) || ($includes="/usr/local/www/hdl/htdocs/includes");
63 my $theme=picktemplate($includes, $templatebase);
64 my $template = HTML::Template->new(filename => "$includes/templates/$theme/$templatebase", die_on_bad_params => 0, path => [$includes]);
67 my @fields = $record->field($tag);
68 foreach my $field (@fields) {
69 my @subf=$field->subfields;
70 for my $i (0..$#subf) {
71 $sth->execute($field->tag(), $subf[$i][0]);
72 my $row=$sth->fetchrow_hashref;
74 $row_data{marc_lib}=$row->{'liblibrarian'};
75 $row_data{marc_value}=$subf[$i][1];
76 $row_data{marc_tag}=$field->tag().$subf[$i][0];
77 push(@loop_data, \%row_data);
78 # print $field->tag(), " ", $field->indicator(1),$field->indicator(2), "subf: ", $subf[$i][0]," =",$subf[$i][1]," <-- \n";
82 # fill template with arrays
83 $template->param(biblionumber => $biblionumber);
84 $template->param(marc =>\@loop_data);
85 print "Content-Type: text/html\n\n", $template->output;