[Koha-cvs] CVS: koha/opac opac-detail.pl,1.14.2.5,1.14.2.6

Paul POULAIN tipaul at users.sourceforge.net
Tue Jul 26 10:38:29 CEST 2005


Update of /cvsroot/koha/koha/opac
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30254/opac

Modified Files:
      Tag: rel_2_2
	opac-detail.pl 
Log Message:
<IMPORTANT NOTES for NPL>

Some cleaning :
- removing dirty hack getMARCurl in SearchMarc.pm & replacing it by some Perl in Search.pm : if repeated, urls are stored in biblioitems.url, separated by a |. Now, the urls are splitted in an array. WARNING : the template has been modified & NPL MUST modify their templates as well, should be really trivial (open http://bureau.paulpoulain.com:9010/cgi-bin/koha/opac-detail.pl?bib=1 to see the result)
- using getMARCsubjcts and getMARCnotes in css templates as well. WARNING (specially for NPL) : the MARC notes & subjects were outside from BIBLIO_RESULTS array. As notes & subjects were in this <!-- TMPL_LOOP --> i had to add them IN the loop. I think it's better, so I commented (line 73 and 74 of opac-detail) 2 lines that are useless for me but useful for you. My opinion is that it would be better to modify your template to put notes & subjects in the <TMPL_LOOP> (should be trivial) than uncommenting those lines (= create duplicate code)
However, my real opinion is that we have no good reason to use <!-- TMPL_LOOP name="BIBLIO_RESULTS" --> as we always have only 1 biblio here. But that's something we should fix in HEAD, not in 2.2

Index: opac-detail.pl
===================================================================
RCS file: /cvsroot/koha/koha/opac/opac-detail.pl,v
retrieving revision 1.14.2.5
retrieving revision 1.14.2.6
diff -C2 -r1.14.2.5 -r1.14.2.6
*** opac-detail.pl	1 Jul 2005 18:38:59 -0000	1.14.2.5
--- opac-detail.pl	26 Jul 2005 08:38:27 -0000	1.14.2.6
***************
*** 62,79 ****
    ## get notes and subjects from MARC record
  my $marc = C4::Context->preference("marc");
! if ($marc eq "yes") {
  	my $dbh = C4::Context->dbh;
  	my $bibid = &MARCfind_MARCbibid_from_oldbiblionumber($dbh,$biblionumber);
  	my $marcflavour = C4::Context->preference("marcflavour");
  	my $marcnotesarray = &getMARCnotes($dbh,$bibid,$marcflavour);
  	my $marcsubjctsarray = &getMARCsubjects($dbh,$bibid,$marcflavour);
! 	my $marcurlsarray = &getMARCurls($dbh,$bibid,$marcflavour);
! 
! 	$template->param(MARCNOTES => $marcnotesarray);
! 	$template->param(MARCSUBJCTS => $marcsubjctsarray);
!         $template->param(MARCURLS => $marcurlsarray);
  }
- my @results = ($dat,);
- 
  my $resultsarray=\@results;
  my $itemsarray=\@items;
--- 62,77 ----
    ## get notes and subjects from MARC record
  my $marc = C4::Context->preference("marc");
! my @results = ($dat,);
! if (C4::Boolean::true_p($marc)) {
  	my $dbh = C4::Context->dbh;
  	my $bibid = &MARCfind_MARCbibid_from_oldbiblionumber($dbh,$biblionumber);
  	my $marcflavour = C4::Context->preference("marcflavour");
  	my $marcnotesarray = &getMARCnotes($dbh,$bibid,$marcflavour);
+ 	$results[0]->{MARCNOTES} = $marcnotesarray;
  	my $marcsubjctsarray = &getMARCsubjects($dbh,$bibid,$marcflavour);
! 	$results[0]->{MARCSUBJCTS} = $marcsubjctsarray;
! # 	$template->param(MARCNOTES => $marcnotesarray);
! # 	$template->param(MARCSUBJCTS => $marcsubjctsarray);
  }
  my $resultsarray=\@results;
  my $itemsarray=\@items;





More information about the Koha-cvs mailing list