[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Koha-cvs] koha/catalogue detail.pl detailprint.pl ISBDdet...
From: |
paul poulain |
Subject: |
[Koha-cvs] koha/catalogue detail.pl detailprint.pl ISBDdet... |
Date: |
Fri, 09 Mar 2007 14:32:40 +0000 |
CVSROOT: /sources/koha
Module name: koha
Changes by: paul poulain <tipaul> 07/03/09 14:32:39
Modified files:
catalogue : detail.pl detailprint.pl ISBDdetail.pl
MARCdetail.pl moredetail.pl
Log message:
rel_3_0 moved to HEAD
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/catalogue/detail.pl?cvsroot=koha&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/koha/catalogue/detailprint.pl?cvsroot=koha&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/koha/catalogue/ISBDdetail.pl?cvsroot=koha&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/koha/catalogue/MARCdetail.pl?cvsroot=koha&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/koha/catalogue/moredetail.pl?cvsroot=koha&r1=1.9&r2=1.10
Patches:
Index: detail.pl
===================================================================
RCS file: /sources/koha/koha/catalogue/detail.pl,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- detail.pl 15 Nov 2006 01:41:51 -0000 1.10
+++ detail.pl 9 Mar 2007 14:32:39 -0000 1.11
@@ -1,80 +1,100 @@
#!/usr/bin/perl
+
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA 02111-1307 USA
+
+# $Id: detail.pl,v 1.11 2007/03/09 14:32:39 tipaul Exp $
+
use strict;
require Exporter;
-use C4::Search;
+use CGI;
use C4::Auth;
use C4::Serials; #uses getsubscriptionfrom biblionumber
use C4::Interface::CGI::Output;
-use CGI;
use C4::Biblio;
-use C4::Context;
+use C4::Serials;
-my $dbh=C4::Context->dbh;
-my $query=new CGI;
-my ($template, $borrowernumber, $cookie)
- = get_template_and_user({template_name => "catalogue/detail.tmpl",
+my $query = new CGI;
+my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
+ {
+ template_name => "catalogue/detail.tmpl",
query => $query,
type => "intranet",
- authnotrequired => 1,
- flagsrequired => {borrow => 1},
- });
-
-my $biblionumber=$query->param('biblionumber');
-$template->param(biblionumber => $biblionumber);
-my $retrieve_from=C4::Context->preference('retrieve_from');
-my ($record,$frameworkcode);
-my @itemrecords;
-my @items;
-if ($retrieve_from eq "zebra"){
-($record,@itemrecords)=ZEBRAgetrecord($biblionumber);
-}else{
- $record =XMLgetbiblio($dbh,$biblionumber);
-$record=XML_xml2hash_onerecord($record);
-my @itemxmls=XMLgetallitems($dbh,$biblionumber);
- foreach my $itemrecord(@itemxmls){
- my $itemhash=XML_xml2hash_onerecord($itemrecord);
- push @itemrecords, $itemhash;
+ authnotrequired => 0,
+ flagsrequired => { catalogue => 1 },
}
-}
+);
-my $dat = XMLmarc2koha_onerecord($dbh,$record,"biblios");
-my $norequests = 1;
-foreach my $itemrecord (@itemrecords){
+my $biblionumber = $query->param('biblionumber');
-my $item= XMLmarc2koha_onerecord($dbh,$itemrecord,"holdings");
-$item=ItemInfo($dbh,$item);
-$item->{itemtype}=$dat->{itemtype};
- $norequests = 0 unless $item->{'notforloan'};
- $item->{$item->{'publictype'}} = 1; ## NOT sure what this is kept from old
db probably useless now
-push @items,$item;
+# change back when ive fixed request.pl
+my @items = &GetItemsInfo( $biblionumber, 'intra' );
+my $dat = &GetBiblioData($biblionumber);
+#coping with subscriptions
+my $subscriptionsnumber = CountSubscriptionFromBiblionumber($biblionumber);
+my @subscriptions = GetSubscriptions( $dat->{title}, $dat->{issn},
$biblionumber );
+
+my @subs;
+foreach my $subscription (@subscriptions) {
+ my %cell;
+ $cell{subscriptionid} = $subscription->{subscriptionid};
+ $cell{subscriptionnotes} = $subscription->{notes};
+
+ #get the three latest serials.
+ $cell{latestserials} =
+ GetLatestSerials( $subscription->{subscriptionid}, 3 );
+ push @subs, \%cell;
}
-my $subscriptionsnumber = GetSubscriptionsFromBiblionumber($biblionumber);
+$dat->{'count'} = @items;
-$dat->{'count'address@hidden;
-$template->param(count =>$dat->{'count'});
-$template->param(norequests => $norequests);
+my $norequests = 1;
+foreach my $itm (@items) {
+ $norequests = 0
+ unless ( ( $itm->{'notforloan'} > 0 )
+ || ( $itm->{'itemnotforloan'} > 0 ) );
+ $itm->{ $itm->{'publictype'} } = 1;
+}
- ## get notes subjects and URLS from MARC record
+$template->param( norequests => $norequests );
+## get notes and subjects from MARC record
+ my $dbh = C4::Context->dbh;
my $marcflavour = C4::Context->preference("marcflavour");
- my $marcnotesarray = &getMARCnotes($dbh,$record,$marcflavour);
- my $marcsubjctsarray = &getMARCsubjects($dbh,$record,$marcflavour);
- my $marcurlssarray = &getMARCurls($dbh,$record,$marcflavour);
- $template->param(MARCURLS => $marcurlssarray);
- $template->param(MARCNOTES => $marcnotesarray);
- $template->param(MARCSUBJCTS => $marcsubjctsarray);
-
-
-my @results = ($dat,);
-
-my address@hidden;
-my address@hidden;
-
+ my $record = GetMarcBiblio($biblionumber);
+ my $marcnotesarray = GetMarcNotes( $record, $marcflavour );
+ my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour );
+ my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
+
+ $template->param(
+ MARCNOTES => $marcnotesarray,
+ MARCSUBJCTS => $marcsubjctsarray,
+ MARCAUTHORS => $marcauthorsarray
+ );
+
+my @results = ( $dat, );
+foreach ( keys %{$dat} ) {
+ $template->param( "$_" => $dat->{$_} . "" );
+}
-$template->param(BIBLIO_RESULTS => $resultsarray,
- ITEM_RESULTS => $itemsarray,
+$template->param(
+ ITEM_RESULTS => address@hidden,
+ biblionumber => $biblionumber,
+ subscriptions => address@hidden,
subscriptionsnumber => $subscriptionsnumber,
+ subscriptiontitle => $dat->{title},
);
output_html_with_http_headers $query, $cookie, $template->output;
Index: detailprint.pl
===================================================================
RCS file: /sources/koha/koha/catalogue/detailprint.pl,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- detailprint.pl 15 Nov 2006 01:41:51 -0000 1.3
+++ detailprint.pl 9 Mar 2007 14:32:39 -0000 1.4
@@ -17,82 +17,83 @@
# You should have received a copy of the GNU General Public License along with
# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
# Suite 330, Boston, MA 02111-1307 USA
+
use strict;
require Exporter;
-use C4::Search;
-use C4::Auth;
-use C4::Serials; #uses getsubscriptionfrom biblionumber
-use C4::Interface::CGI::Output;
+use C4::Context;
+use C4::Output; # contains gettemplate
use CGI;
+use C4::Auth;
use C4::Biblio;
-use C4::Context;
+use C4::Interface::CGI::Output;
+use C4::Date;
-my $dbh=C4::Context->dbh;
my $query=new CGI;
-my ($template, $borrowernumber, $cookie)
- = get_template_and_user({template_name => "catalogue/detailprint.tmpl",
- query => $query,
- type => "intranet",
- authnotrequired => 1,
- flagsrequired => {borrow => 1},
- });
+my $type=$query->param('type');
+($type) || ($type='intra');
my $biblionumber=$query->param('biblionumber');
-$template->param(biblionumber => $biblionumber);
-my $retrieve_from=C4::Context->preference('retrieve_from');
-my ($record,$frameworkcode);
-my @itemrecords;
-my @items;
-if ($retrieve_from eq "zebra"){
-($record,@itemrecords)=ZEBRAgetrecord($biblionumber);
-}else{
- $record =XMLgetbiblio($dbh,$biblionumber);
-$record=XML_xml2hash_onerecord($record);
-my @itemxmls=XMLgetallitems($dbh,$biblionumber);
- foreach my $itemrecord(@itemxmls){
- my $itemhash=XML_xml2hash_onerecord($itemrecord);
- push @itemrecords, $itemhash;
- }
-}
-my $dat = XMLmarc2koha_onerecord($dbh,$record,"biblios");
+# change back when ive fixed request.pl
+my @items = GetItemsInfo($biblionumber, $type);
my $norequests = 1;
-foreach my $itemrecord (@itemrecords){
-
-my $item= XMLmarc2koha_onerecord($dbh,$itemrecord,"holdings");
-$item=ItemInfo($dbh,$item);
-$item->{itemtype}=$dat->{itemtype};
- $norequests = 0 unless $item->{'notforloan'};
- $item->{$item->{'publictype'}} = 1; ## NOT sure what this is kept from old
db probably useless now
-push @items,$item;
+foreach my $itm (@items) {
+ $norequests = 0 unless $itm->{'notforloan'};
}
-my $subscriptionsnumber = GetSubscriptionsFromBiblionumber($biblionumber);
+my $dat = GetBiblioData($biblionumber);
+my $record = GetMarcBiblio($biblionumber);
+my $addauthor =
GetMarcAuthors($record,C4::Context->preference("marcflavour"));
+my $authorcount = scalar @$addauthor;
+
+$dat->{'additional'} ="";
+foreach (@$addauthor) {
+ $dat->{'additional'} .= "|" . $_->{'a'};
+} # for
-$dat->{'count'address@hidden;
-$template->param(count =>$dat->{'count'});
-$template->param(norequests => $norequests);
-
- ## get notes subjects and URLS from MARC record
- my $marcflavour = C4::Context->preference("marcflavour");
- my $marcnotesarray = &getMARCnotes($dbh,$record,$marcflavour);
- my $marcsubjctsarray = &getMARCsubjects($dbh,$record,$marcflavour);
- my $marcurlssarray = &getMARCurls($dbh,$record,$marcflavour);
- $template->param(MARCURLS => $marcurlssarray);
- $template->param(MARCNOTES => $marcnotesarray);
- $template->param(MARCSUBJCTS => $marcsubjctsarray);
+$dat->{'count'address@hidden;
+$dat->{'norequests'} = $norequests;
+my @results;
-my @results = ($dat,);
+$results[0]=$dat;
my address@hidden;
my address@hidden;
+my $startfrom=$query->param('startfrom');
+($startfrom) || ($startfrom=0);
+
+my ($template, $loggedinuser, $cookie) = get_template_and_user({
+ template_name => ('catalogue/detailprint.tmpl'),
+ query => $query,
+ type => "intranet",
+ authnotrequired => ($type eq 'opac'),
+ flagsrequired => {catalogue => 1},
+ });
+
+my $count=1;
+
+# now to get the items into a hash we can use and whack that thru
-$template->param(BIBLIO_RESULTS => $resultsarray,
+
+my $nextstartfrom=($startfrom+20<$count-20) ? ($startfrom+20) : ($count-20);
+my $prevstartfrom=($startfrom-20>0) ? ($startfrom-20) : (0);
+$template->param(startfrom => $startfrom+1,
+ endat => $startfrom+20,
+ numrecords => $count,
+ nextstartfrom => $nextstartfrom,
+ prevstartfrom => $prevstartfrom,
+ BIBLIO_RESULTS => $resultsarray,
ITEM_RESULTS => $itemsarray,
- subscriptionsnumber => $subscriptionsnumber,
-);
+ loggedinuser => $loggedinuser,
+ biblionumber => $biblionumber,
+ );
output_html_with_http_headers $query, $cookie, $template->output;
+
+
+# Local Variables:
+# tab-width: 8
+# End:
Index: ISBDdetail.pl
===================================================================
RCS file: /sources/koha/koha/catalogue/ISBDdetail.pl,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- ISBDdetail.pl 15 Nov 2006 01:41:51 -0000 1.5
+++ ISBDdetail.pl 9 Mar 2007 14:32:39 -0000 1.6
@@ -26,8 +26,7 @@
=head1 DESCRIPTION
-This script needs a biblionumber in bib parameter (bibnumber
-from koha style DB. Automaticaly maps to marc biblionumber).
+This script needs a biblionumber as parameter
=head1 FUNCTIONS
@@ -35,118 +34,159 @@
=cut
-
use strict;
-
+require Exporter;
use C4::Auth;
use C4::Context;
-use C4::AuthoritiesMarc;
+use C4::Output;
use C4::Interface::CGI::Output;
use CGI;
-use C4::Search;
-use C4::Biblio;
-use C4::Acquisition;
use C4::Koha;
+use C4::Biblio;
+use C4::Branch; # GetBranchDetail
+use C4::Serials; # CountSubscriptionFromBiblionumber
-my $query=new CGI;
-my $dbh=C4::Context->dbh;
+#---- Internal function
+
+sub get_authorised_value_desc ($$$$$$$) {
+ my ( $itemtype, $tagslib, $tag, $subfield, $value, $framework, $dbh ) = @_;
+
+ #---- branch
+ if ( $tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "branches" ) {
+ return GetBranchDetail($value)->{branchname};
+ }
-my $biblionumber=$query->param('biblionumber');
+ #---- itemtypes
+ if ( $tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "itemtypes" ) {
+ my $itemtypedef = getitemtypeinfo($itemtype);
+ return $itemtypedef->{description};
+ }
-my $itemtype = &MARCfind_frameworkcode($dbh,$biblionumber);
-my $tagslib = &MARCgettagslib($dbh,1,$itemtype);
+ #---- "true" authorized value
+ my $category = $tagslib->{$tag}->{$subfield}->{'authorised_value'};
+
+ if ( $category ne "" ) {
+ my $sth =
+ $dbh->prepare(
+"select lib from authorised_values where category = ? and authorised_value = ?"
+ );
+ $sth->execute( $category, $value );
+ my $data = $sth->fetchrow_hashref;
+ return $data->{'lib'};
+ }
+ else {
+ return $value; # if nothing is found return the original value
+ }
+}
+# ------
+
+
+my $query = new CGI;
+my $dbh = C4::Context->dbh;
+
+my $biblionumber = $query->param('biblionumber');
+my $itemtype = &MARCfind_frameworkcode($biblionumber);
+my $tagslib = &MARCgettagslib( $dbh, 1, $itemtype );
+
+my $record = GetMarcBiblio($biblionumber);
-my $record =XMLgetbibliohash($dbh,$biblionumber);
# open template
-my ($template, $loggedinuser, $cookie)
- = get_template_and_user({template_name =>
"catalogue/ISBDdetail.tmpl",
+my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
+ {
+ template_name => "catalogue/ISBDdetail.tmpl",
query => $query,
type => "intranet",
- authnotrequired => 1,
debug => 1,
- });
+ }
+);
my $ISBD = C4::Context->preference('ISBD');
-my $res;
- my $bloc = $ISBD;
- my $blocres;
- foreach my $isbdfield (split /#/,$bloc) {
- $isbdfield =~ /(\d\d\d)\|(.*)\|(.*)\|(.*)/;
- my $fieldvalue=$1;
- my $textbefore=$2;
- my $analysestring=$3;
- my $textafter=$4;
- if ($fieldvalue>0) {
- my $hasputtextbefore=0;
- my $calculated = $analysestring;
- my $tag = $fieldvalue;
- if ($tag<10) {
- my
$value=XML_readline_onerecord($record,"","",$tag);
- my $subfieldcode = "@";
- my $subfieldvalue =
get_authorised_value_desc($tag, "", $value, '', $dbh);;
- my $tagsubf =
$tag.$subfieldcode;
- $calculated =~
s/\{(.?.?.?)$tagsubf(.*?)\}/$1$subfieldvalue\{$1$tagsubf$2\}$2/g;
+# my @blocs = split /\@/,$ISBD;
+# my @fields = $record->fields();
+my $res;
- } else {
- my @subf =
XML_readline_withtags($record,"","",$tag);
+# foreach my $bloc (@blocs) {
+# $bloc =~ s/\n//g;
+my $bloc = $ISBD;
+my $blocres;
+foreach my $isbdfield ( split /#/, $bloc ) {
- for my $i (0..$#subf) {
+ # $isbdfield= /(.?.?.?)/;
+ $isbdfield =~ /(\d\d\d)\|(.*)\|(.*)\|(.*)/;
+ my $fieldvalue = $1;
+ my $textbefore = $2;
+ my $analysestring = $3;
+ my $textafter = $4;
+
+ # warn "==> $1 / $2 / $3 / $4";
+ # my $fieldvalue=substr($isbdfield,0,3);
+ if ( $fieldvalue > 0 ) {
+
+ # warn "ERROR IN ISBD DEFINITION at : $isbdfield" unless
$fieldvalue;
+ # warn "FV : $fieldvalue";
+ my $hasputtextbefore = 0;
+ foreach my $field ( $record->field($fieldvalue) ) {
+ my $calculated = $analysestring;
+ my $tag = $field->tag();
+ if ( $tag < 10 ) {
+ }
+ else {
+ my @subf = $field->subfields;
+ for my $i ( 0 .. $#subf ) {
my $subfieldcode = $subf[$i][0];
- my $subfieldvalue =
get_authorised_value_desc($tag, $subf[$i][0], $subf[$i][1], '', $dbh);;
- my $tagsubf =
$tag.$subfieldcode;
- $calculated =~
s/\{(.?.?.?)$tagsubf(.*?)\}/$1$subfieldvalue\{$1$tagsubf$2\}$2/g;
+ my $subfieldvalue =
+ get_authorised_value_desc( $itemtype,$tagslib, $tag,
$subf[$i][0],
+ $subf[$i][1], '', $dbh );
+ my $tagsubf = $tag . $subfieldcode;
+ $calculated =~
+s/\{(.?.?.?)$tagsubf(.*?)\}/$1$subfieldvalue\{$1$tagsubf$2\}$2/g;
}
+
# field builded, store the result
- if ($calculated && !$hasputtextbefore)
{ # put textbefore if not done
- $blocres .=$textbefore;
- $hasputtextbefore=1
+ if ( $calculated && !$hasputtextbefore )
+ { # put textbefore if not done
+ $blocres .= $textbefore;
+ $hasputtextbefore = 1;
}
+
# remove punctuation at start
$calculated =~ s/^( |;|:|\.|-)*//g;
- $blocres.=$calculated;
+ $blocres .= $calculated;
}
-
- $blocres .=$textafter if $hasputtextbefore;
- } else {
- $blocres.=$isbdfield;
}
+ $blocres .= $textafter if $hasputtextbefore;
}
- $res.=$blocres;
+ else {
+ $blocres .= $isbdfield;
+ }
+}
+$res .= $blocres;
+
# }
$res =~ s/\{(.*?)\}//g;
$res =~ s/\\n/\n/g;
$res =~ s/\n/<br\/>/g;
+
# remove empty ()
$res =~ s/\(\)//g;
-$template->param(ISBD => $res,
- biblionumber => $biblionumber);
-
-output_html_with_http_headers $query, $cookie, $template->output;
-sub get_authorised_value_desc ($$$$$) {
- my($tag, $subfield, $value, $framework, $dbh) = @_;
+my $subscriptionsnumber = CountSubscriptionFromBiblionumber($biblionumber);
- #---- branch
- if ($tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "branches" ) {
- return getbranchname($value);
- }
+if ($subscriptionsnumber) {
+ my $subscriptions = GetSubscriptionsFromBiblionumber($biblionumber);
+ my $subscriptiontitle = $subscriptions->[0]{'bibliotitle'};
+ $template->param(
+ subscriptionsnumber => $subscriptionsnumber,
+ subscriptiontitle => $subscriptiontitle,
+ );
+}
- #---- itemtypes
- if ($tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "itemtypes" ) {
- return ItemType($value);
- }
+$template->param (
+ ISBD => $res,
+ biblionumber => $biblionumber,
+);
- #---- "true" authorized value
- my $category = $tagslib->{$tag}->{$subfield}->{'authorised_value'};
+output_html_with_http_headers $query, $cookie, $template->output;
- if ($category ne "") {
- my $sth = $dbh->prepare("select lib from authorised_values where
category = ? and authorised_value = ?");
- $sth->execute($category, $value);
- my $data = $sth->fetchrow_hashref;
- return $data->{'lib'};
- } else {
- return $value; # if nothing is found return the original value
- }
-}
Index: MARCdetail.pl
===================================================================
RCS file: /sources/koha/koha/catalogue/MARCdetail.pl,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- MARCdetail.pl 27 Sep 2006 19:37:27 -0000 1.8
+++ MARCdetail.pl 9 Mar 2007 14:32:39 -0000 1.9
@@ -26,8 +26,7 @@
=head1 DESCRIPTION
-This script needs a biblionumber in bib parameter (bibnumber
-from koha style DB. Automaticaly maps to marc biblionumber).
+This script needs a biblionumber as parameter
It shows the biblio in a (nice) MARC format depending on MARC
parameters tables.
@@ -44,64 +43,91 @@
=cut
-
use strict;
+require Exporter;
use C4::Auth;
use C4::Context;
use C4::Output;
use C4::Interface::CGI::Output;
use CGI;
-use C4::Search;
+use C4::Koha;
+use MARC::Record;
use C4::Biblio;
use C4::Acquisition;
-use C4::Serials; #uses getsubscriptionsfrombiblionumber
-use C4::Koha;
+use C4::Serials; #uses getsubscriptionsfrombiblionumber
GetSubscriptionsFromBiblionumber
-my $query=new CGI;
+#---- Internal function ---
+sub get_authorised_value_desc ($$$$$$) {
+ my ( $tagslib, $tag, $subfield, $value, $framework, $dbh ) = @_;
-my $dbh=C4::Context->dbh;
-my $retrieve_from=C4::Context->preference('retrieve_from');
-my $biblionumber=$query->param('biblionumber');
-my $frameworkcode = $query->param('frameworkcode');
-my $popup = $query->param('popup'); # if set to 1, then don't insert links,
it's just to show the biblio
-my $record;
-my @itemrecords;
-my $xmlhash;
-$frameworkcode=MARCfind_frameworkcode($dbh,$biblionumber);
-my $tagslib = &MARCgettagslib($dbh,1,$frameworkcode);
-my $itemstagslib = &MARCitemsgettagslib($dbh,1,$frameworkcode);
+ #---- branch
+ if ( $tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "branches" ) {
-if ($retrieve_from eq "zebra"){
-($xmlhash,@itemrecords)=ZEBRAgetrecord($biblionumber);
+ # return GetBranchDetail($value)->{branchname};
+ }
+
+ #---- itemtypes
+ if ( $tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "itemtypes" ) {
-}else{
- $record =XMLgetbiblio($dbh,$biblionumber);
-$xmlhash=XML_xml2hash_onerecord($record);
-my @itemxmls=XMLgetallitems($dbh,$biblionumber);
- foreach my $itemrecord(@itemxmls){
- my $itemhash=XML_xml2hash($itemrecord);
- push @itemrecords, $itemhash;
+ # my $itemtypedef = getitemtypeinfo($itemtype);
+ # return $itemtypedef->{description};
+ }
+
+ #---- "true" authorized value
+ my $category = $tagslib->{$tag}->{$subfield}->{'authorised_value'};
+
+ if ( $category ne "" ) {
+ my $sth =
+ $dbh->prepare(
+"select lib from authorised_values where category = ? and authorised_value = ?"
+ );
+ $sth->execute( $category, $value );
+ my $data = $sth->fetchrow_hashref;
+ return $data->{'lib'};
+ }
+ else {
+ return $value; # if nothing is found return the original value
}
}
-my ($template, $loggedinuser, $cookie)
- = get_template_and_user({template_name =>
"catalogue/MARCdetail.tmpl",
+#---------
+
+my $query = new CGI;
+my $dbh = C4::Context->dbh;
+my $biblionumber = $query->param('biblionumber');
+my $frameworkcode = MARCfind_frameworkcode( $biblionumber );
+my $popup =
+ $query->param('popup')
+ ; # if set to 1, then don't insert links, it's just to show the biblio
+my $subscriptionid = $query->param('subscriptionid');
+
+my $tagslib = &MARCgettagslib($dbh,1,$frameworkcode);
+
+my $record = GetMarcBiblio($biblionumber);
+
+# open template
+my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
+ {
+ template_name => "catalogue/MARCdetail.tmpl",
query => $query,
type => "intranet",
authnotrequired => 0,
- flagsrequired => {catalogue => 1},
+ flagsrequired => { catalogue => 1 },
debug => 1,
- });
+ }
+);
#Getting the list of all frameworks
-my $queryfwk =$dbh->prepare("select frameworktext, frameworkcode from
biblios_framework");
+my $queryfwk =
+ $dbh->prepare("select frameworktext, frameworkcode from biblio_framework");
$queryfwk->execute;
my %select_fwk;
my @select_fwk;
my $curfwk;
-push @select_fwk,"Default";
+push @select_fwk, "Default";
$select_fwk{"Default"} = "Default";
-while (my ($description, $fwk) =$queryfwk->fetchrow) {
+
+while ( my ( $description, $fwk ) = $queryfwk->fetchrow ) {
push @select_fwk, $fwk;
$select_fwk{$fwk} = $description;
}
@@ -114,214 +140,209 @@
-labels => \%select_fwk,
-size => 1,
-multiple => 0 );
-
-$template->param( framework => $framework);
+$template->param(framework => $framework);
# fill arrays
-my @loop_data =();
+my @loop_data = ();
my $tag;
+
# loop through each tab 0 through 9
-##Only attempt to fill the template if we actually received a MARC record
-if ($xmlhash){
-my ($isbntag,$isbnsub)=MARCfind_marc_from_kohafield("isbn","biblios");
-my $biblio=$xmlhash->{'datafield'};
-my $controlfields=$xmlhash->{'controlfield'};
-my $leader=$xmlhash->{'leader'};
-for (my $tabloop = 0; $tabloop<10;$tabloop++) {
-# loop through each tag
- my @loop_data =();
+for ( my $tabloop = 0 ; $tabloop <= 10 ; $tabloop++ ) {
+
+ # loop through each tag
+ my @fields = $record->fields();
+ my @loop_data = ();
my @subfields_data;
# deal with leader
- unless (($tagslib->{'000'}->{'@'}->{tab} ne $tabloop) ||
(substr($tagslib->{'000'}->{'@'}->{hidden},1,1)>0)) {
-
+ unless ( $tagslib->{'000'}->{'@'}->{tab} ne $tabloop )
+ { # or ($tagslib->{'000'}->{'@'}->{hidden}==(-7|-4|-3|-2|2|3|5|8))) {
my %subfield_data;
- $subfield_data{marc_value}=$leader->[0] ;
- push(@subfields_data, \%subfield_data);
+ $subfield_data{marc_lib} = $tagslib->{'000'}->{'@'}->{lib};
+ $subfield_data{marc_value} = $record->leader();
+ $subfield_data{marc_subfield} = '@';
+ $subfield_data{marc_tag} = '000';
+ push( @subfields_data, \%subfield_data );
my %tag_data;
- $tag_data{tag}='000 -'. $tagslib->{'000'}->{lib};
+ $tag_data{tag} = '000 -' . $tagslib->{'000'}->{lib};
my @tmp = @subfields_data;
$tag_data{subfield} = address@hidden;
- push (@loop_data, \%tag_data);
+ push( @loop_data, \%tag_data );
undef @subfields_data;
}
- ##Controlfields
+ @fields = $record->fields();
+ for ( my $x_i = 0 ; $x_i <= $#fields ; $x_i++ ) {
- foreach my $control (@$controlfields){
+ # if tag <10, there's no subfield, use the "@" trick
+ if ( $fields[$x_i]->tag() < 10 ) {
+ next
+ if (
+ $tagslib->{ $fields[$x_i]->tag() }->{'@'}->{tab} ne $tabloop );
+ next if ( $tagslib->{ $fields[$x_i]->tag() }->{'@'}->{hidden} );
my %subfield_data;
- my %tag_data;
- next if ($tagslib->{$control->{'tag'}}->{'@'}->{tab}
ne $tabloop);
- next if
(substr($tagslib->{$control->{'tag'}}->{'@'}->{hidden},1,1)>0);
- $subfield_data{marc_value}=$control->{'content'} ;
- push(@subfields_data, \%subfield_data);
- if (C4::Context->preference('hide_marc')) {
-
$tag_data{tag}=$tagslib->{$control->{'tag'}}->{lib};
- } else {
- $tag_data{tag}=$control->{'tag'}.' -'.
$tagslib->{$control->{'tag'}}->{lib};
- }
- my @tmp = @subfields_data;
- $tag_data{subfield} = address@hidden;
- push (@loop_data, \%tag_data);
- undef @subfields_data;
- }
- my $previoustag;
- my %datatags;
- my $i=0;
- foreach my $data (@$biblio){
- $datatags{$i++}=$data->{'tag'};
- foreach my $subfield ( $data->{'subfield'}){
- foreach my $code ( @$subfield){
- next if
($tagslib->{$data->{'tag'}}->{$code->{'code'}}->{tab} ne $tabloop);
- next if
(substr($tagslib->{$data->{'tag'}}->{$code->{'code'}}->{hidden},1,1)>0);
+ $subfield_data{marc_lib} =
+ $tagslib->{ $fields[$x_i]->tag() }->{'@'}->{lib};
+ $subfield_data{marc_value} = $fields[$x_i]->data();
+ $subfield_data{marc_subfield} = '@';
+ $subfield_data{marc_tag} = $fields[$x_i]->tag();
+ push( @subfields_data, \%subfield_data );
+ }
+ else {
+ my @subf = $fields[$x_i]->subfields;
+
+ # loop through each subfield
+ for my $i ( 0 .. $#subf ) {
+ $subf[$i][0] = "@" unless $subf[$i][0];
+ next
+ if (
+ $tagslib->{ $fields[$x_i]->tag() }->{ $subf[$i][0] }->{tab}
+ ne $tabloop );
+ next
+ if ( $tagslib->{ $fields[$x_i]->tag() }->{ $subf[$i][0] }
+ ->{hidden} );
my %subfield_data;
- my $value=$code->{'content'};
-
$subfield_data{marc_lib}=$tagslib->{$data->{'tag'}}->{$code->{'code'}}->{lib};
-
$subfield_data{link}=$tagslib->{$data->{'tag'}}->{$code->{'code'}}->{link};
- if
($tagslib->{$data->{'tag'}}->{$code->{'code'}}->{isurl}) {
- $subfield_data{marc_value}="<a
href=\"$value\">$value</a>";
- } elsif ($data->{'tag'} eq $isbntag && $code->{'code'}
eq $isbnsub) {
- $subfield_data{marc_value}=DisplayISBN($value);
- } else {
- if
($tagslib->{$data->{'tag'}}->{$code->{'code'}}->{authtypecode}) {
- my
($authtag,$authtagsub)=MARCfind_marc_from_kohafield("auth_biblio_link_subf","biblios");
-
$subfield_data{authority}=XML_readline_onerecord($xmlhash,"","",$data->{'tag'},$authtagsub);
- }
-
$subfield_data{marc_value}=get_authorised_value_desc($data->{'tag'},
$code->{'code'}, $value, '', $dbh);
- }
- $subfield_data{marc_subfield}=$code->{'code'};
- $subfield_data{marc_tag}=$data->{'tag'};
- push(@subfields_data, \%subfield_data);
- }### $code
-
-
- if ($#subfields_data==0) {
- # $subfields_data[0]->{marc_lib}='';
- # $subfields_data[0]->{marc_subfield}='';
+ $subfield_data{short_desc} = substr(
+ $tagslib->{ $fields[$x_i]->tag() }->{ $subf[$i][0]
}->{lib},
+ 0, 20
+ );
+ $subfield_data{long_desc} =
+ $tagslib->{ $fields[$x_i]->tag() }->{ $subf[$i][0] }->{lib};
+ $subfield_data{link} =
+ $tagslib->{ $fields[$x_i]->tag() }->{ $subf[$i][0] }->{link};
+
+# warn "tag : ".$tagslib->{$fields[$x_i]->tag()}." subfield
:".$tagslib->{$fields[$x_i]->tag()}->{$subf[$i][0]}."lien koha? :
"$subfield_data{link};
+ if ( $tagslib->{ $fields[$x_i]->tag() }->{ $subf[$i][0] }
+ ->{isurl} )
+ {
+ $subfield_data{marc_value} =
+ "<a href=\"$subf[$i][1]\">$subf[$i][1]</a>";
+ }
+ elsif ( $tagslib->{ $fields[$x_i]->tag() }->{ $subf[$i][0] }
+ ->{kohafield} eq "biblioitems.isbn" )
+ {
+
+# warn " tag : ".$tagslib->{$fields[$x_i]->tag()}."
subfield :".$tagslib->{$fields[$x_i]->tag()}->{$subf[$i][0]}. "ISBN :
".$subf[$i][1]."PosttraitementISBN :".DisplayISBN($subf[$i][1]);
+ $subfield_data{marc_value} = DisplayISBN( $subf[$i][1] );
+ }
+ else {
+ if ( $tagslib->{ $fields[$x_i]->tag() }->{ $subf[$i][0] }
+ ->{authtypecode} )
+ {
+ $subfield_data{authority} = $fields[$x_i]->subfield(9);
+ }
+ $subfield_data{marc_value} =
+ get_authorised_value_desc( $tagslib,
$fields[$x_i]->tag(),
+ $subf[$i][0], $subf[$i][1], '', $dbh );
+ }
+ $subfield_data{marc_subfield} = $subf[$i][0];
+ $subfield_data{marc_tag} = $fields[$x_i]->tag();
+ push( @subfields_data, \%subfield_data );
+ }
+ }
+ if ( $#subfields_data == 0 ) {
+ $subfields_data[0]->{marc_lib} = '';
+ $subfields_data[0]->{marc_subfield} = '';
}
- if ($#subfields_data>=0) {
+ if ( $#subfields_data >= 0 ) {
my %tag_data;
- if (($datatags{$i} eq $datatags{$i-1}) &&
(C4::Context->preference('LabelMARCView') eq 'economical')) {
- $tag_data{tag}="";
- } else {
- if (C4::Context->preference('hide_marc')) {
-
$tag_data{tag}=$tagslib->{$data->{'tag'}}->{lib};
- } else {
- $tag_data{tag}=$data->{'tag'}.' -'.
$tagslib->{$data->{'tag'}}->{lib};
+ if ( $fields[$x_i]->tag() eq $fields[ $x_i - 1 ]->tag() ) {
+ $tag_data{tag} = "";
+ }
+ else {
+ if ( C4::Context->preference('hide_marc') ) {
+ $tag_data{tag} = $tagslib->{ $fields[$x_i]->tag() }->{lib};
+ }
+ else {
+ $tag_data{tag} =
+ $fields[$x_i]->tag() . ' -'
+ . $tagslib->{ $fields[$x_i]->tag() }->{lib};
}
}
my @tmp = @subfields_data;
$tag_data{subfield} = address@hidden;
- push (@loop_data, \%tag_data);
+ push( @loop_data, \%tag_data );
undef @subfields_data;
}
- }### each $subfield
}
-
- $template->param($tabloop."XX" =>address@hidden);
+ $template->param( $tabloop . "XX" => address@hidden );
}
+
# now, build item tab !
# the main difference is that datas are in lines and not in columns : thus, we
build the <th> first, then the values...
# loop through each tag
# warning : we may have differents number of columns in each row. Thus, we
first build a hash, complete it if necessary
# then construct template.
-my @fields;
-my %witness; #---- stores the list of subfields used at least once, with the
"meaning" of the code
+my @fields = $record->fields();
+my %witness
+ ; #---- stores the list of subfields used at least once, with the "meaning"
of the code
my @big_array;
-foreach my $itemrecord (@itemrecords){
-my $item=$itemrecord->{'datafield'};
-my $controlfields=$itemrecord->{'controlfield'};
-my $leader=$itemrecord->{'leader'};
-my %this_row;
- ### The leader
- unless (substr($itemstagslib->{'000'}->{'@'}->{hidden},1,1)>0){
- my @datasub='000@';
- $witness{$datasub[0]} =
$itemstagslib->{'000'}->{'@'}->{lib};
- $this_row{$datasub[0]} =$leader->[0];
- }
- foreach my $control (@$controlfields){
- next if ($itemstagslib->{$control->{'tag'}}->{'@'}->{tab} ne
10);
- next if
(substr($itemstagslib->{$control->{'tag'}}->{'@'}->{hidden},1,1)>0);
- my @datasub=$control->{'tag'}.'@';
- $witness{$datasub[0]} =
$itemstagslib->{$control->{'tag'}}->{'@'}->{lib};
- $this_row{$datasub[0]} =$control->{'content'};
- }
-
- foreach my $data (@$item){
- foreach my $subfield ( $data->{'subfield'}){
- foreach my $code ( @$subfield){
- next if
($itemstagslib->{$data->{'tag'}}->{$code->{'code'}}->{tab} ne 10);
- next if
(substr($itemstagslib->{$data->{'tag'}}->{$code->{'code'}}->{hidden},1,1)>0);
- $witness{$data->{'tag'}.$code->{'code'}} =
$itemstagslib->{$data->{'tag'}}->{$code->{'code'}}->{lib};
- $this_row{$data->{'tag'}.$code->{'code'}}
=$code->{'content'};
+foreach my $field (@fields) {
+ next if ( $field->tag() < 10 );
+ my @subf = $field->subfields;
+ my %this_row;
+
+ # loop through each subfield
+ for my $i ( 0 .. $#subf ) {
+ next if ( $tagslib->{ $field->tag() }->{ $subf[$i][0] }->{tab} ne 10 );
+ next if ( $tagslib->{ $field->tag() }->{ $subf[$i][0] }->{hidden} );
+ $witness{ $subf[$i][0] } =
+ $tagslib->{ $field->tag() }->{ $subf[$i][0] }->{lib};
+ $this_row{ $subf[$i][0] } = $subf[$i][1];
}
- }# subfield
- }## each field
if (%this_row) {
- push(@big_array, \%this_row);
+ push( @big_array, \%this_row );
}
-}## each record
-my ($holdingbrtagf,$holdingbrtagsubf) =
&MARCfind_marc_from_kohafield("holdingbranch","holdings");
+}
+my ($holdingbrtagf,$holdingbrtagsubf) =
&MARCfind_marc_from_kohafield($dbh,"items.holdingbranch",$frameworkcode);
@big_array = sort {$a->{$holdingbrtagsubf} cmp $b->{$holdingbrtagsubf}}
@big_array;
#fill big_row with missing datas
-foreach my $subfield_code (keys(%witness)) {
- for (my $i=0;$i<=$#big_array;$i++) {
- $big_array[$i]{$subfield_code}=" " unless
($big_array[$i]{$subfield_code});
+foreach my $subfield_code ( keys(%witness) ) {
+ for ( my $i = 0 ; $i <= $#big_array ; $i++ ) {
+ $big_array[$i]{$subfield_code} = " "
+ unless ( $big_array[$i]{$subfield_code} );
}
}
+
# now, construct template !
my @item_value_loop;
my @header_value_loop;
-for (my $i=0;$i<=$#big_array; $i++) {
+for ( my $i = 0 ; $i <= $#big_array ; $i++ ) {
my $items_data;
- foreach my $subfield_code (keys(%witness)) {
- $items_data .="<td>".$big_array[$i]{$subfield_code}."</td>";
+ foreach my $subfield_code ( keys(%witness) ) {
+ $items_data .= "<td>" . $big_array[$i]{$subfield_code} . "</td>";
}
my %row_data;
$row_data{item_value} = $items_data;
- push(@item_value_loop,\%row_data);
+ push( @item_value_loop, \%row_data );
}
-foreach my $subfield_code (keys(%witness)) {
+foreach my $subfield_code ( keys(%witness) ) {
my %header_value;
$header_value{header_value} = $witness{$subfield_code};
- push(@header_value_loop, \%header_value);
+ push( @header_value_loop, \%header_value );
+}
+
+my $subscriptionsnumber = CountSubscriptionFromBiblionumber($biblionumber);
+
+if ($subscriptionsnumber) {
+ my $subscriptions = GetSubscriptionsFromBiblionumber($biblionumber);
+ my $subscriptiontitle = $subscriptions->[0]{'bibliotitle'};
+ $template->param(
+ subscriptiontitle => $subscriptiontitle,
+ subscriptionsnumber => $subscriptionsnumber,
+ );
}
-my $subscriptionsnumber = GetSubscriptionsFromBiblionumber($biblionumber);
-$template->param(item_loop => address@hidden,
+$template->param (
+ item_loop => address@hidden,
item_header_loop =>
address@hidden,
biblionumber => $biblionumber,
- subscriptionsnumber =>
$subscriptionsnumber,
popup => $popup,
hide_marc =>
C4::Context->preference('hide_marc'),
- intranetcolorstylesheet =>
C4::Context->preference("intranetcolorstylesheet"),
+ intranetcolorstylesheet =>
+ C4::Context->preference("intranetcolorstylesheet"),
intranetstylesheet =>
C4::Context->preference("intranetstylesheet"),
IntranetNav => C4::Context->preference("IntranetNav"),
- );
-}##if $xmlhash
-output_html_with_http_headers $query, $cookie, $template->output;
-
-sub get_authorised_value_desc ($$$$$) {
- my($tag, $subfield, $value, $framework, $dbh) = @_;
-
- #---- branch
- if ($tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "branches" ) {
- return getbranchname($value);
- }
-
- #---- itemtypes
- if ($tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "itemtypes" ) {
- return ItemType($value);
- }
- #---- "true" authorized value
- my $category = $tagslib->{$tag}->{$subfield}->{'authorised_value'};
+);
- if ($category ne "") {
- my $sth = $dbh->prepare("select lib from authorised_values where
category = ? and authorised_value = ?");
- $sth->execute($category, $value);
- my $data = $sth->fetchrow_hashref;
- return $data->{'lib'};
- } else {
- return $value; # if nothing is found return the original value
- }
-}
+output_html_with_http_headers $query, $cookie, $template->output;
Index: moredetail.pl
===================================================================
RCS file: /sources/koha/koha/catalogue/moredetail.pl,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- moredetail.pl 15 Nov 2006 01:41:51 -0000 1.9
+++ moredetail.pl 9 Mar 2007 14:32:39 -0000 1.10
@@ -1,7 +1,4 @@
#!/usr/bin/perl
-# NOTE: Use standard 8-space tabs for this file (indents are 4 spaces)
-
-# $Id: moredetail.pl,v 1.9 2006/11/15 01:41:51 tgarip1957 Exp $
# Copyright 2000-2003 Katipo Communications
#
@@ -20,26 +17,29 @@
# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
# Suite 330, Boston, MA 02111-1307 USA
+# $Id: moredetail.pl,v 1.10 2007/03/09 14:32:39 tipaul Exp $
+
use strict;
require Exporter;
use C4::Koha;
use CGI;
-use C4::Search;
+use C4::Biblio; # to use &GetBiblioItemData &itemissues
use C4::Acquisition;
+use C4::Output; # contains gettemplate
use C4::Auth;
use C4::Interface::CGI::Output;
use C4::Date;
-use C4::Context;
-use C4::Biblio;
-use C4::Accounts2;
-use C4::Circulation::Circ2;
+use C4::Circulation::Circ2; # to use itemissues
-my $dbh=C4::Context->dbh;
my $query=new CGI;
+# FIXME subject is not exported to the template?
+my $subject=$query->param('subject');
+# if its a subject we need to use the subject.tmpl
my ($template, $loggedinuser, $cookie) = get_template_and_user({
- template_name => ( 'catalogue/moredetail.tmpl'),
+ template_name => ($subject? 'catalogue/subject.tmpl':
+ 'catalogue/moredetail.tmpl'),
query => $query,
type => "intranet",
authnotrequired => 0,
@@ -47,17 +47,12 @@
});
# get variables
-my $op=$query->param('op');
-my $lost=$query->param('lost');
-my $withdrawn=$query->param('withdrawn');
-my $override=$query->param('override');
-my $itemnumber=$query->param('itemnumber');
-my $barcode=$query->param('barcode');
-my $title=$query->param('title');
my $biblionumber=$query->param('biblionumber');
-my ($record)=XMLgetbibliohash($dbh,$biblionumber);
-my $data=XMLmarc2koha_onerecord($dbh,$record,"biblios");
+my $title=$query->param('title');
+my $bi=$query->param('bi');
+
+my $data=GetBiblioItemData($bi);
my $dewey = $data->{'dewey'};
# FIXME Dewey is a string, not a number, & we should use a function
$dewey =~ s/0+$//;
@@ -72,80 +67,12 @@
my @results;
-my @items;
-if ($op eq "update"){
-my $env;
-##Do Lost or Withdraw here
-my $flag=0;
- my ($resbor,$resrec)=C4::Reserves2::CheckReserves($env,$dbh,$itemnumber);
-if ($override ne "yes"){
- if ($resbor){
-# print $query->header;
- $template->param(error => "This item has a reserve on it");
- $template->param(biblionumber =>$biblionumber);
- $template->param(itemnumber =>$itemnumber);
- $template->param(lost =>$lost);
- $template->param(withdrawn =>$withdrawn);
- $flag=1;
- }
- my $sth=$dbh->prepare("Select * from issues where (itemnumber=?) and
(returndate is null)");
- $sth->execute($itemnumber);
-
- if (my $data=$sth->fetchrow_hashref) {
- $template->param(biblionumber =>$biblionumber);
- $template->param(itemnumber =>$itemnumber);
- $template->param(error => "This item is On Loan to a member");
- $template->param(lost =>$lost);
- $template->param(withdrawn =>$withdrawn);
- $flag=2;
- }
-}
-if ($flag != 0 && $override ne "yes"){
-
- }else {
- ##UPDATE here
-
-XMLmoditemonefield($dbh,$biblionumber,$itemnumber,'wthdrawn',$withdrawn,1);
-XMLmoditemonefield($dbh,$biblionumber,$itemnumber,'itemlost',$lost);
-
- if ($lost ==1 && $flag ==2){
- my $sth=$dbh->prepare("Select * from issues where (itemnumber=?) and
(returndate is null)");
- $sth->execute($itemnumber);
- my $data=$sth->fetchrow_hashref;
- if ($data->{'borrowernumber'} ne '') {
- #item on issue add replacement cost to borrowers record
- my $accountno=getnextacctno($env,$data->{'borrowernumber'},$dbh);
- my $item=getiteminformation($env, $itemnumber);
- my $sth2=$dbh->prepare("Insert into accountlines
-
(borrowernumber,accountno,date,amount,description,accounttype,amountoutstanding,itemnumber)
- values
- (?,?,now(),?,?,'L',?,?)");
-
$sth2->execute($data->{'borrowernumber'},$accountno,$item->{'replacementprice'},
- "Lost Item $item->{'title'} $item->{'barcode'}",
- $item->{'replacementprice'},$itemnumber);
- $sth2->finish;
- }
- }
- if ($flag==1){
- foreach my $res ($resrec){
-
C4::Reserves2::CancelReseve(undef,$res->{itemnumber},$res->{borrowernumber});
- }
- }
-
- }
-}
-my @itemrecords=XMLgetallitems($dbh,$biblionumber);
-foreach my $itemrecord (@itemrecords){
-$itemrecord=XML_xml2hash_onerecord($itemrecord);
-my $items = XMLmarc2koha_onerecord($dbh,$itemrecord,"holdings");
-$items->{itemtype}=$data->{itemtype};
-$items->{biblionumber}=$biblionumber;
-$items=itemissues($dbh,$items,$items->{'itemnumber'});
-push @items,$items;
-}
+my (@items)= itemissues($bi);
my address@hidden;
$data->{'count'}=$count;
-my ($order,$ordernum)=GetOrder($biblionumber,$barcode);
+
+my $ordernum = GetOrderNumber($biblionumber,$bi);
+my $order = GetOrder($ordernum);
my $env;
$env->{itemcount}=1;
@@ -160,14 +87,13 @@
$item->{'ordernumber'} = $ordernum;
$item->{'booksellerinvoicenumber'} = $order->{'booksellerinvoicenumber'};
- if ($item->{'date_due'} gt '0000-00-00'){
+ if ($item->{'date_due'} eq 'Available'){
+ $item->{'issue'}= 0;
+ } else {
$item->{'date_due'} = format_date($item->{'date_due'});
-$item->{'issue'}= 1;
+ $item->{'issue'}= 1;
$item->{'borrowernumber'} = $item->{'borrower'};
$item->{'cardnumber'} = $item->{'card'};
-
- } else {
- $item->{'issue'}= 0;
}
}
@@ -177,7 +103,3 @@
output_html_with_http_headers $query, $cookie, $template->output;
-
-# Local Variables:
-# tab-width: 8
-# End:
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Koha-cvs] koha/catalogue detail.pl detailprint.pl ISBDdet...,
paul poulain <=