Browse Source

rel_3_0 moved to HEAD

3.0.x
tipaul 15 years ago
parent
commit
fc1342f73d
  1. 23
      opac/changelanguage.pl
  2. 253
      opac/opac-ISBDdetail.pl
  3. 367
      opac/opac-MARCdetail.pl
  4. 77
      opac/opac-account.pl
  5. 158
      opac/opac-addbookbybiblionumber.pl
  6. 90
      opac/opac-alert-subscribe.pl
  7. 113
      opac/opac-basket.pl
  8. 136
      opac/opac-detail.pl
  9. 94
      opac/opac-detailprint.pl
  10. 392
      opac/opac-dictionary.pl
  11. 96
      opac/opac-logout.pl
  12. 169
      opac/opac-main.pl
  13. 112
      opac/opac-passwd.pl
  14. 112
      opac/opac-readingrecord.pl
  15. 14
      opac/opac-renew.pl
  16. 390
      opac/opac-reserve.pl
  17. 14
      opac/opac-review.pl
  18. 1020
      opac/opac-search.pl
  19. 246
      opac/opac-sendbasket.pl
  20. 104
      opac/opac-serial-issues.pl
  21. 450
      opac/opac-shelves.pl
  22. 50
      opac/opac-showreviews.pl
  23. 144
      opac/opac-suggestions.pl
  24. 173
      opac/opac-user.pl
  25. 36
      opac/opac-userdetails.pl
  26. 112
      opac/opac-userupdate.pl
  27. 1120
      reports/acquisitions_stats.pl
  28. 91
      reports/bor_issues_top.pl
  29. 59
      reports/borrowers_out.pl
  30. 47
      reports/borrowers_stats.pl
  31. 90
      reports/cat_issues_top.pl
  32. 66
      reports/catalogue_out.pl
  33. 255
      reports/catalogue_stats.pl
  34. 97
      reports/inventory.pl
  35. 30
      reports/issues_avg_stats.pl
  36. 10
      reports/issues_by_borrower_category.plugin
  37. 50
      reports/issues_stats.pl
  38. 16
      reports/itemtypes.plugin
  39. 9
      reports/manager.pl
  40. 24
      reports/reports-home.pl
  41. 90
      reports/reservereport.pl
  42. 27
      reports/stats.print.pl
  43. 312
      reports/stats.screen.pl
  44. 31
      reserve/modrequest.pl
  45. 77
      reserve/placerequest.pl
  46. 511
      reserve/request.pl
  47. 8
      rss/lastAcquired-1.0.tmpl
  48. 4
      rss/lastAcquired-2.0.tmpl
  49. 2
      rss/lastAcquired.tmpl
  50. 4
      rss/rss.pl
  51. 6
      serials/acqui-search-result.pl
  52. 110
      serials/acqui-search.pl
  53. 57
      serials/claims.pl
  54. 5
      serials/distributedto.pl
  55. 1
      serials/lateissues-excel.pl
  56. 83
      serials/member-search.pl
  57. 8
      serials/reorder_members.pl
  58. 18
      serials/routing-preview.pl
  59. 43
      serials/routing.pl
  60. 7
      serials/serial-issues.pl
  61. 65
      serials/serials-home.pl
  62. 456
      serials/subscription-add.pl
  63. 286
      serials/subscription-bib-search.pl
  64. 2
      serials/subscription-copy.pl
  65. 146
      serials/subscription-detail.pl
  66. 7
      serials/subscription-renew.pl
  67. 8
      serials/viewalerts.pl
  68. 127
      suggestion/acceptorreject.pl
  69. 8
      tools/barcodes.pl
  70. 2
      tools/barcodesGenerator.pl
  71. 16
      tools/exceptionHolidays.pl
  72. 198
      tools/export.pl
  73. 109
      tools/holidays.pl
  74. 46
      tools/import.pl
  75. 122
      tools/koha-news.pl
  76. 323
      tools/letter.pl
  77. 16
      tools/newHolidays.pl
  78. 12
      tools/overduerules.pl
  79. 1
      tools/printerConfig.pl
  80. 34
      tools/tools-home.pl
  81. 3224
      updater/updatedatabase

23
opac/changelanguage.pl

@ -1,10 +1,25 @@
#!/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
use C4::Output;
use CGI;
my $query=new CGI;
my $language=$query->param('language');
my $url=$query->referer();
my $query = new CGI;
my $language = $query->param('language');
my $url = $query->referer();
setlanguagecookie($query,$language,$url);
setlanguagecookie( $query, $language, $url );

253
opac/opac-ISBDdetail.pl

@ -21,18 +21,16 @@
=head1 NAME
MARCdetail.pl : script to show a biblio in MARC format
opac-ISBDdetail.pl : script to show a biblio in ISBD format
=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.
It shows the biblio
The template is in <templates_dir>/catalogue/MARCdetail.tmpl.
The template is in <templates_dir>/catalogue/ISBDdetail.tmpl.
this template must be divided into 11 "tabs".
The first 10 tabs present the biblio, the 11th one presents
@ -44,7 +42,6 @@ the items attached to the biblio
=cut
use strict;
require Exporter;
use C4::Auth;
@ -52,135 +49,183 @@ use C4::Context;
use C4::Output;
use C4::Interface::CGI::Output;
use CGI;
use C4::Search;
use MARC::Record;
use C4::Biblio;
use C4::Acquisition;
use C4::Serials; #uses getsubscriptionfrom biblionumber
use HTML::Template;
use C4::Review;
use C4::Serials; # uses getsubscriptionfrom biblionumber
use C4::Koha; # use getitemtypeinfo
use C4::Members; # GetMember
my $query=new CGI;
my $query = new CGI;
my $dbh=C4::Context->dbh;
my $dbh = C4::Context->dbh;
my $biblionumber=$query->param('bib');
my $bibid = $query->param('bibid');
$bibid = &MARCfind_MARCbibid_from_oldbiblionumber($dbh,$biblionumber) unless $bibid;
$biblionumber = &MARCfind_oldbiblionumber_from_MARCbibid($dbh,$bibid) unless $biblionumber;
my $itemtype = &MARCfind_frameworkcode($dbh,$bibid);
my $tagslib = &MARCgettagslib($dbh,1,$itemtype);
my $biblionumber = $query->param('biblionumber');
my $itemtype = &MARCfind_frameworkcode($biblionumber);
my $tagslib = &MARCgettagslib( $dbh, 1, $itemtype );
my $record =MARCgetbiblio($dbh,$bibid);
my $record = GetMarcBiblio($biblionumber);
#coping with subscriptions
my $subscriptionsnumber = CountSubscriptionFromBiblionumber($biblionumber);
my $dat = MARCmarc2koha($dbh,$record);
my @subscriptions = GetSubscriptions($dat->{title},$dat->{issn},$biblionumber);
my $dat = MARCmarc2koha( $dbh, $record );
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;
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;
}
# open template
my ($template, $loggedinuser, $cookie)
= get_template_and_user({template_name => "opac-ISBDdetail.tmpl",
query => $query,
type => "opac",
authnotrequired => 1,
debug => 1,
});
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "opac-ISBDdetail.tmpl",
query => $query,
type => "opac",
authnotrequired => 1,
debug => 1,
}
);
$template->param(
subscriptions => \@subs,
subscriptionsnumber => $subscriptionsnumber,
subscriptions => \@subs,
subscriptionsnumber => $subscriptionsnumber,
);
my $ISBD = C4::Context->preference('ISBD');
# my @blocs = split /\@/,$ISBD;
# my @fields = $record->fields();
my $res;
# foreach my $bloc (@blocs) {
# $bloc =~ s/\n//g;
my $bloc = $ISBD;
my $blocres;
foreach my $isbdfield (split /#/,$bloc) {
# $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$2\{$1$tagsubf$2\}/g;
}
# field builded, store the result
if ($calculated && !$hasputtextbefore) { # put textbefore if not done
$blocres .=$textbefore;
$hasputtextbefore=1
}
# remove punctuation at start
$calculated =~ s/^( |;|:|\.|-)*//g;
$blocres.=$calculated;
}
}
$blocres .=$textafter if $hasputtextbefore;
} else {
$blocres.=$isbdfield;
}
}
$res.=$blocres;
# $bloc =~ s/\n//g;
my $bloc = $ISBD;
my $blocres;
foreach my $isbdfield ( split /#/, $bloc ) {
# $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 =
GetAuthorisedValueDesc( $tag, $subf[$i][0],
$subf[$i][1], '', $tagslib );
my $tagsubf = $tag . $subfieldcode;
$calculated =~
s/\{(.?.?.?.?)$tagsubf(.*?)\}/$1$subfieldvalue$2\{$1$tagsubf$2\}/g;
}
# field builded, store the result
if ( $calculated && !$hasputtextbefore )
{ # put textbefore if not done
$blocres .= $textbefore;
$hasputtextbefore = 1;
}
# remove punctuation at start
$calculated =~ s/^( |;|:|\.|-)*//g;
$blocres .= $calculated;
}
}
$blocres .= $textafter if $hasputtextbefore;
}
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;
my $reviews = getreviews( $biblionumber, 1 );
foreach ( @$reviews ) {
my $borrower_number_review = $_->{borrowernumber};
my $borrowerData = GetMember('',$borrower_number_review);
# setting some borrower info into this hash
$_->{title} = $borrowerData->{'title'};
$_->{surname} = $borrowerData->{'surname'};
$_->{firstname} = $borrowerData->{'firstname'};
}
sub get_authorised_value_desc ($$$$$) {
my($tag, $subfield, $value, $framework, $dbh) = @_;
#---- branch
if ($tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "branches" ) {
return getbranchname($value);
}
$template->param(
ISBD => $res,
biblionumber => $biblionumber,
reviews => $reviews,
);
## Amazon.com stuff
#not used unless preference set
if ( C4::Context->preference("AmazonContent") == 1 ) {
use C4::Amazon;
$dat->{'amazonisbn'} = $dat->{'isbn'};
$dat->{'amazonisbn'} =~ s|-||g;
#---- itemtypes
if ($tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "itemtypes" ) {
return ItemType($value);
$template->param( amazonisbn => $dat->{amazonisbn} );
my $amazon_details = &get_amazon_details( $dat->{amazonisbn} );
foreach my $result ( @{ $amazon_details->{Details} } ) {
$template->param( item_description => $result->{ProductDescription} );
$template->param( image => $result->{ImageUrlMedium} );
$template->param( list_price => $result->{ListPrice} );
$template->param( amazon_url => $result->{url} );
}
#---- "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 @products;
my @reviews;
for my $details ( @{ $amazon_details->{Details} } ) {
next unless $details->{SimilarProducts};
for my $product ( @{ $details->{SimilarProducts}->{Product} } ) {
push @products, +{ Product => $product };
}
next unless $details->{Reviews};
for my $product ( @{ $details->{Reviews}->{AvgCustomerRating} } ) {
$template->param( rating => $product * 20 );
}
for my $reviews ( @{ $details->{Reviews}->{CustomerReview} } ) {
push @reviews,
+{
Summary => $reviews->{Summary},
Comment => $reviews->{Comment},
};
}
}
$template->param( SIMILAR_PRODUCTS => \@products );
$template->param( AMAZONREVIEWS => \@reviews );
}
output_html_with_http_headers $query, $cookie, $template->output;

367
opac/opac-MARCdetail.pl

@ -26,8 +26,7 @@ MARCdetail.pl : script to show a biblio in MARC format
=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.
@ -38,13 +37,8 @@ this template must be divided into 11 "tabs".
The first 10 tabs present the biblio, the 11th one presents
the items attached to the biblio
=head1 FUNCTIONS
=over 2
=cut
use strict;
require Exporter;
use C4::Auth;
@ -52,196 +46,235 @@ use C4::Context;
use C4::Output;
use C4::Interface::CGI::Output;
use CGI;
use C4::Search;
use MARC::Record;
use C4::Biblio;
use C4::Acquisition;
use HTML::Template;
use C4::Koha;
my $query=new CGI;
my $query = new CGI;
my $dbh=C4::Context->dbh;
my $dbh = C4::Context->dbh;
my $biblionumber=$query->param('bib');
my $bibid = $query->param('bibid');
$bibid = &MARCfind_MARCbibid_from_oldbiblionumber($dbh,$biblionumber) unless $bibid;
$biblionumber = &MARCfind_oldbiblionumber_from_MARCbibid($dbh,$bibid) unless $biblionumber;
my $itemtype = &MARCfind_frameworkcode($dbh,$bibid);
my $tagslib = &MARCgettagslib($dbh,0,$itemtype);
my $biblionumber = $query->param('biblionumber');
my $itemtype = &MARCfind_frameworkcode($biblionumber);
my $tagslib = &MARCgettagslib( $dbh, 0, $itemtype );
my $record = GetMarcBiblio($biblionumber);
my $record =MARCgetbiblio($dbh,$bibid);
# open template
my ($template, $loggedinuser, $cookie)
= get_template_and_user({template_name => "opac-MARCdetail.tmpl",
query => $query,
type => "opac",
authnotrequired => 1,
debug => 1,
});
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "opac-MARCdetail.tmpl",
query => $query,
type => "opac",
authnotrequired => 1,
debug => 1,
}
);
# adding the $RequestOnOpac param
my $RequestOnOpac;
if (C4::Context->preference("RequestOnOpac")) {
$RequestOnOpac = 1;
}
# fill arrays
my @loop_data =();
my @loop_data = ();
my $tag;
# loop through each tab 0 through 9
for (my $tabloop = 0; $tabloop<=10;$tabloop++) {
# loop through each tag
my @loop_data =();
my @subfields_data;
# deal with leader
unless ($tagslib->{'000'}->{'@'}->{tab} ne $tabloop or $tagslib->{'000'}->{'@'}->{hidden}>0) {
my %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};
my @tmp = @subfields_data;
$tag_data{subfield} = \@tmp;
push (@loop_data, \%tag_data);
undef @subfields_data;
}
my @fields = $record->fields();
for (my $x_i=0;$x_i<=$#fields;$x_i++) {
# 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}>0);
my %subfield_data;
$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}>0);
my %subfield_data;
$subfield_data{marc_lib}=$tagslib->{$fields[$x_i]->tag()}->{$subf[$i][0]}->{lib};
$subfield_data{link}=$tagslib->{$fields[$x_i]->tag()}->{$subf[$i][0]}->{link};
$subf[$i][1] =~ s/\n/<br\/>/g;
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($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) {
my %tag_data;
if (($fields[$x_i]->tag() eq $fields[$x_i-1]->tag()) && (C4::Context->preference('LabelMARCView') eq 'economical')) {
$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} = \@tmp;
push (@loop_data, \%tag_data);
undef @subfields_data;
}
}
$template->param($tabloop."XX" =>\@loop_data);
for ( my $tabloop = 0 ; $tabloop <= 10 ; $tabloop++ ) {
# loop through each tag
my @loop_data = ();
my @subfields_data;
# deal with leader
unless ( $tagslib->{'000'}->{'@'}->{tab} ne $tabloop
or $tagslib->{'000'}->{'@'}->{hidden} > 0 )
{
my %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};
my @tmp = @subfields_data;
$tag_data{subfield} = \@tmp;
push( @loop_data, \%tag_data );
undef @subfields_data;
}
my @fields = $record->fields();
for ( my $x_i = 0 ; $x_i <= $#fields ; $x_i++ ) {
# 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} > 0 );
my %subfield_data;
$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} > 0 );
my %subfield_data;
$subfield_data{marc_lib} =
$tagslib->{ $fields[$x_i]->tag() }->{ $subf[$i][0] }->{lib};
$subfield_data{link} =
$tagslib->{ $fields[$x_i]->tag() }->{ $subf[$i][0] }->{link};
$subf[$i][1] =~ s/\n/<br\/>/g;
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} =
GetAuthorisedValueDesc( $fields[$x_i]->tag(),
$subf[$i][0], $subf[$i][1], '', $tagslib );
}
$subfield_data{marc_subfield} = $subf[$i][0];
$subfield_data{marc_tag} = $fields[$x_i]->tag();
push( @subfields_data, \%subfield_data );
}
}
if ( $#subfields_data >= 0 ) {
my %tag_data;
if ( ( $fields[$x_i]->tag() eq $fields[ $x_i - 1 ]->tag() )
&& ( C4::Context->preference('LabelMARCView') eq 'economical' )
)
{
$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} = \@tmp;
push( @loop_data, \%tag_data );
undef @subfields_data;
}
}
$template->param( $tabloop . "XX" => \@loop_data );
}
# 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 = $record->fields();
my %witness; #---- stores the list of subfields used at least once, with the "meaning" of the code
my %witness
; #---- stores the list of subfields used at least once, with the "meaning" of the code
my @big_array;
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);
$witness{$subf[$i][0]} = $tagslib->{$field->tag()}->{$subf[$i][0]}->{lib};
if ($tagslib->{$field->tag()}->{$subf[$i][0]}->{isurl}) {
$this_row{$subf[$i][0]}="<a href=\"$subf[$i][1]\">$subf[$i][1]</a>";
} elsif ($tagslib->{$field->tag()}->{$subf[$i][0]}->{kohafield} eq "biblioitems.isbn") {
$this_row{$subf[$i][0]}=DisplayISBN($subf[$i][1]);
} else {
$this_row{$subf[$i][0]}=get_authorised_value_desc($field->tag(), $subf[$i][0], $subf[$i][1], '', $dbh);
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 );
$witness{ $subf[$i][0] } =
$tagslib->{ $field->tag() }->{ $subf[$i][0] }->{lib};
if ( $tagslib->{ $field->tag() }->{ $subf[$i][0] }->{isurl} ) {
$this_row{ $subf[$i][0] } =
"<a href=\"$subf[$i][1]\">$subf[$i][1]</a>";
}
elsif ( $tagslib->{ $field->tag() }->{ $subf[$i][0] }->{kohafield} eq
"biblioitems.isbn" )
{
$this_row{ $subf[$i][0] } = DisplayISBN( $subf[$i][1] );
}
else {
$this_row{ $subf[$i][0] } =
GetAuthorisedValueDesc( $field->tag(), $subf[$i][0],
$subf[$i][1], '', $tagslib );
}
}
if (%this_row) {
push(@big_array, \%this_row);
}
}
if (%this_row) {
push( @big_array, \%this_row );
}
}
my ($holdingbrtagf,$holdingbrtagsubf) = &MARCfind_marc_from_kohafield($dbh,"items.holdingbranch",$itemtype);
@big_array = sort {$a->{$holdingbrtagsubf} cmp $b->{$holdingbrtagsubf}} @big_array;
my ( $holdingbrtagf, $holdingbrtagsubf ) =
&MARCfind_marc_from_kohafield( $dbh, "items.holdingbranch", $itemtype );
@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}="&nbsp;" 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} = "&nbsp;"
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++) {
my $items_data;
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);
}
foreach my $subfield_code (keys(%witness)) {
my %header_value;
$header_value{header_value} = $witness{$subfield_code};
push(@header_value_loop, \%header_value);
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>";
}
my %row_data;
$row_data{item_value} = $items_data;
push( @item_value_loop, \%row_data );
}
$template->param(item_loop => \@item_value_loop,
item_header_loop => \@header_value_loop,
biblionumber => $biblionumber
);
output_html_with_http_headers $query, $cookie, $template->output;
sub get_authorised_value_desc ($$$$$) {
my($tag, $subfield, $value, $framework, $dbh) = @_;
foreach my $subfield_code ( keys(%witness) ) {
my %header_value;
$header_value{header_value} = $witness{$subfield_code};
push( @header_value_loop, \%header_value );
}
#---- branch
if ($tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "branches" ) {
# return getbranchdetail($value)->{branchname};
}
if(C4::Context->preference("ISBD")) {
$template->param(ISBD => 1);
}
#---- itemtypes
if ($tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "itemtypes" ) {
# return ItemType($value);
}
$template->param(
item_loop => \@item_value_loop,
item_header_loop => \@header_value_loop,
biblionumber => $biblionumber,
);
#---- "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;

77
opac/opac-account.pl

@ -1,5 +1,20 @@
#!/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
# wrriten 15/10/2002 by finlay@katipo.oc.nz
# script to display borrowers account details in the opac
@ -10,43 +25,47 @@ use C4::Members;
use C4::Circulation::Circ2;
use C4::Auth;
use C4::Interface::CGI::Output;
use HTML::Template;
use C4::Date;
my $query = new CGI;
my ($template, $borrowernumber, $cookie)
= get_template_and_user({template_name => "opac-account.tmpl",
query => $query,
type => "opac",
authnotrequired => 0,
flagsrequired => {borrow => 1},
debug => 1,
});
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
{
template_name => "opac-account.tmpl",
query => $query,
type => "opac",
authnotrequired => 0,
flagsrequired => { borrow => 1 },
debug => 1,
}
);
# get borrower information ....
my ($borr, $flags) = getpatroninformation(undef, $borrowernumber);
my ( $borr, $flags ) = getpatroninformation( undef, $borrowernumber );
my @bordat;
$bordat[0] = $borr;
$template->param( BORROWER_INFO => \@bordat );
#get account details
my ($numaccts,$accts,$total) = getboracctrecord(undef,$borr);
my ( $numaccts, $accts, $total ) = getboracctrecord( undef, $borr );
for (my $i=0;$i<$numaccts;$i++){
$accts->[$i]{'date'} = format_date($accts->[$i]{'date'});
$accts->[$i]{'amount'} = sprintf("%.2f", $accts->[$i]{'amount'});
if($accts->[$i]{'amount'} >= 0){
$accts->[$i]{'amountcredit'} = 1;
}
$accts->[$i]{'amountoutstanding'} =sprintf("%.2f", $accts->[$i]{'amountoutstanding'});
if($accts->[$i]{'amountoutstanding'} >= 0){
$accts->[$i]{'amountoutstandingcredit'} = 1;
}
if ($accts->[$i]{'accounttype'} ne 'F' && $accts->[$i]{'accounttype'} ne 'FU'){
$accts->[$i]{'print_title'};
for ( my $i = 0 ; $i < $numaccts ; $i++ ) {
$accts->[$i]{'date'} = format_date( $accts->[$i]{'date'} );
$accts->[$i]{'amount'} = sprintf( "%.2f", $accts->[$i]{'amount'} );
if ( $accts->[$i]{'amount'} >= 0 ) {
$accts->[$i]{'amountcredit'} = 1;
}
$accts->[$i]{'amountoutstanding'} =
sprintf( "%.2f", $accts->[$i]{'amountoutstanding'} );
if ( $accts->[$i]{'amountoutstanding'} >= 0 ) {
$accts->[$i]{'amountoutstandingcredit'} = 1;
}
if ( $accts->[$i]{'accounttype'} ne 'F'
&& $accts->[$i]{'accounttype'} ne 'FU' )
{
$accts->[$i]{'print_title'};
}
}
@ -54,16 +73,14 @@ for (my $i=0;$i<$numaccts;$i++){
my $num = 0;
foreach my $row (@$accts) {
$row->{'even'} = 1 if $num % 2 == 0;
$row->{'odd'} = 1 if $num % 2 == 1;
$row->{'odd'} = 1 if $num % 2 == 1;
$num++;
}
$template->param( ACCOUNT_LINES => $accts,
$template->param (
ACCOUNT_LINES => $accts,
total => sprintf( "%.2f", $total )
);
$template->param( total => sprintf("%.2f",$total) );
#$template->param(loggeninuser => $loggedinuser);
output_html_with_http_headers $query, $cookie, $template->output;

158
opac/opac-addbookbybiblionumber.pl

@ -1,4 +1,5 @@
#!/usr/bin/perl
#script to provide bookshelf management
# WARNING: This file uses 4-character tabs!
#
@ -22,7 +23,6 @@
# Suite 330, Boston, MA 02111-1307 USA
use strict;
use C4::Search;
use C4::Biblio;
use CGI;
use C4::Output;
@ -30,99 +30,89 @@ use C4::BookShelves;
use C4::Circulation::Circ2;
use C4::Auth;
use C4::Interface::CGI::Output;
use HTML::Template;
my $env;
my $query = new CGI;
my $query = new CGI;
my $biblionumber = $query->param('biblionumber');
my $shelfnumber = $query->param('shelfnumber');
my $shelfnumber = $query->param('shelfnumber');
my $newbookshelf = $query->param('newbookshelf');
my $category = $query->param('category');
my $category = $query->param('category');
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "opac-addbookbybiblionumber.tmpl",
query => $query,
type => "opac",
authnotrequired => 1,
}
);
my ($template, $loggedinuser, $cookie)
= get_template_and_user({template_name => "opac-addbookbybiblionumber.tmpl",
query => $query,
type => "opac",
authnotrequired => 1,
});
$shelfnumber = AddShelf( '', $newbookshelf, $loggedinuser, $category ) if $newbookshelf;
# to know if we had to add more than one biblio.
my $multiple = 0;
$multiple = 1 if $biblionumber =~ /^(\d*\/)*$/;
my $x; # for trash
($x,$x,$shelfnumber) = AddShelf('',$newbookshelf,$loggedinuser,$category) if $newbookshelf;
if ($shelfnumber) {
&AddToShelfFromBiblio($env, $biblionumber, $shelfnumber);
print "Content-Type: text/html\n\n<html><body onload=\"window.close()\"></body></html>";
exit;
} else {
my ( $bibliocount, @biblios ) = getbiblio($biblionumber);
if ($multiple){
foreach (split /\//,$biblionumber){
&AddToShelfFromBiblio($_,$shelfnumber);
}
}
else {
&AddToShelfFromBiblio( $biblionumber, $shelfnumber );
}
print $query->header;
print "<html><body onload=\"window.close();\"></body></html>";
exit;
}
else {
my ($shelflist) = GetShelves( $loggedinuser, 3 );
my @shelvesloop;
my %shelvesloop;
foreach my $element ( sort keys %$shelflist ) {
push( @shelvesloop, $element );
$shelvesloop{$element} = $shelflist->{$element}->{'shelfname'};
}
my ($shelflist) = GetShelfList($loggedinuser,3);
my @shelvesloop;
my %shelvesloop;
foreach my $element (sort keys %$shelflist) {
push (@shelvesloop, $element);
$shelvesloop{$element} = $shelflist->{$element}->{'shelfname'};
}
my $CGIbookshelves;
if ( @shelvesloop > 0 ) {
$CGIbookshelves = CGI::scrolling_list (
-name => 'shelfnumber',
-values => \@shelvesloop,
-labels => \%shelvesloop,
-size => 1,
-tabindex => '',
-multiple => 0
);
}
my $CGIbookshelves;
if (@shelvesloop > 0){
$CGIbookshelves=CGI::scrolling_list( -name => 'shelfnumber',
-values => \@shelvesloop,
-labels => \%shelvesloop,
-size => 1,
-tabindex=>'',
-multiple => 0 );
}
if ( $multiple ) {
my @biblios;
foreach (split /\//,$biblionumber){
my $data = GetBiblioData($_);
push @biblios,$data;
}
$template->param (
multiple => 1,
biblionumber => $biblionumber,
total => scalar @biblios,
biblios => \@biblios,
);
}
else { # just one to add.
my $data = GetBiblioData( $biblionumber );
$template->param (
biblionumber => $biblionumber,
title => $data->{'title'},
author => $data->{'author'},
);
}
$template->param(biblionumber => $biblionumber,
title => $biblios[0]->{'title'},
author => $biblios[0]->{'author'},
CGIbookshelves => $CGIbookshelves,
LibraryName => C4::Context->preference("LibraryName"),
suggestion => C4::Context->preference("suggestion"),
virtualshelves => C4::Context->preference("virtualshelves"),
OpacNav => C4::Context->preference("OpacNav"),
opaccredits => C4::Context->preference("opaccredits"),
opacsmallimage => C4::Context->preference("opacsmallimage"),
opaclayoutstylesheet => C4::Context->preference("opaclayoutstylesheet"),
opaccolorstylesheet => C4::Context->preference("opaccolorstylesheet"),
);
$template->param (
CGIbookshelves => $CGIbookshelves,
);
output_html_with_http_headers $query, $cookie, $template->output;
output_html_with_http_headers $query, $cookie, $template->output;
}
# $Log$
# Revision 1.5 2006/07/04 14:36:52 toins
# Head & rel_2_2 merged
#
# Revision 1.4 2006/05/21 02:10:32 kados
# syncing dev-week and HEAD
#
# Revision 1.1.2.6 2006/04/27 16:23:34 oleonard
# Hiding option to add to existing virtual shelves if there are no existing virtual shelves (thanks Chris!)
#
# Revision 1.1.2.5 2006/03/01 22:33:25 oleonard
# Enabling several new system preferences: opacreadinghistory, opaccolorstylesheet, opaclanguagesdisplay, opaclayoutstylesheet, opacsmallimage
#
# Revision 1.1.2.4 2006/02/04 16:47:21 kados
# Adding support for opaccredits to opac scripts
#
# Revision 1.1.2.3 2006/02/03 21:03:57 kados
# Updating script for new system preference: OpacNav
# ----------------------------------------------------------------------
#
# Revision 1.1.2.2 2005/03/25 17:04:27 tipaul
# adding virtual shelves & suggestions button to the top
#
# Revision 1.1.2.1 2005/03/10 08:44:43 tipaul
# bugfix in baskets :
# * The user does not need to have to have librarian rights to use virtual shelves
# * error when adding a biblio to an existing basket
#
# Revision 1.1 2005/01/03 11:09:59 tipaul
# *** empty log message ***
#
# Local Variables:
# tab-width: 4
# End:

90
opac/opac-alert-subscribe.pl

@ -29,54 +29,62 @@ use C4::Context;
use C4::Koha;
use C4::Letters;
use C4::Serials;
# use C4::Search;
use HTML::Template;
my $query = new CGI;
my $op = $query->param('op');
my $dbh = C4::Context->dbh;
my $op = $query->param('op');
my $dbh = C4::Context->dbh;
my $sth;
my ($template, $loggedinuser, $cookie);
my $externalid = $query->param('externalid');
my $alerttype = $query->param('alerttype');
my ( $template, $loggedinuser, $cookie );
my $externalid = $query->param('externalid');
my $alerttype = $query->param('alerttype');
my $biblionumber = $query->param('biblionumber');
($template, $loggedinuser, $cookie)
= get_template_and_user({template_name => "opac-alert-subscribe.tmpl",
query => $query,
type => "opac",
authnotrequired => 1,
debug => 1,
});
( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "opac-alert-subscribe.tmpl",
query => $query,
type => "opac",
authnotrequired => 1,
debug => 1,
}
);
if ( $op eq 'alert_confirmed' ) {
addalert( $loggedinuser, $alerttype, $externalid );
if ( $alerttype eq 'issue' ) {
print $query->redirect(
"opac-serial-issues.pl?biblionumber=$biblionumber");
exit;
}
}
elsif ( $op eq 'cancel_confirmed' ) {
my $alerts = getalert( $loggedinuser, $alerttype, $externalid );
foreach (@$alerts)
{ # we are supposed to have only 1 result, but just in case...
delalert( $_->{alertid} );
}
if ( $alerttype eq 'issue' ) {
print $query->redirect(
"opac-serial-issues.pl?biblionumber=$biblionumber");
exit;
}
if ($op eq 'alert_confirmed') {
addalert($loggedinuser,$alerttype,$externalid);
if ($alerttype eq 'issue') {
print $query->redirect("opac-serial-issues.pl?biblionumber=$biblionumber");
exit;
}
} elsif ($op eq 'cancel_confirmed') {
my $alerts =getalert($loggedinuser,$alerttype,$externalid);
foreach (@$alerts) { # we are supposed to have only 1 result, but just in case...
delalert($_->{alertid});
}
if ($alerttype eq 'issue') {
print $query->redirect("opac-serial-issues.pl?biblionumber=$biblionumber");
exit;
}
}
else {
if ( $alerttype eq 'issue' ) { # alert for subscription issues
my $subscription = &GetSubscription($externalid);
$template->param(
"typeissue$op" => 1,
bibliotitle => $subscription->{bibliotitle},
notes => $subscription->{notes},
externalid => $externalid,
biblionumber => $biblionumber,
);
}
else {
}
} else {
if ($alerttype eq 'issue') { # alert for subscription issues
my $subscription = &GetSubscription($externalid);
$template->param("typeissue$op" => 1,
bibliotitle => $subscription->{bibliotitle},
notes => $subscription->{notes},
externalid => $externalid,
biblionumber => $biblionumber,
);
} else {
}
}
output_html_with_http_headers $query, $cookie, $template->output;

113
opac/opac-basket.pl

@ -1,65 +1,92 @@
#!/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$
use strict;
require Exporter;
use CGI;
use C4::Biblio;
use C4::Auth;
use C4::Interface::CGI::Output;
use HTML::Template;
my $query=new CGI;
my ($template, $borrowernumber, $cookie)
= get_template_and_user({template_name => "opac-basket.tmpl",
query => $query,
type => "opac",
authnotrequired => 1,
flagsrequired => {borrow => 1},
});
my $query = new CGI;
my ( $template, $borrowernumber, $cookie ) = get_template_and_user (
{
template_name => "opac-basket.tmpl",
query => $query,
type => "opac",
authnotrequired => 1,
flagsrequired => { borrow => 1 },
}
);
my $bib_list=$query->param('bib_list');
my $print_basket=$query->param('print');
my $verbose = $query->param('verbose');
my $bib_list = $query->param('bib_list');
my $print_basket = $query->param('print');
my $verbose = $query->param('verbose');
if($verbose) { $template->param(verbose => 1); }
if ($print_basket) { $template->param(print_basket => 1); }
if ($verbose) { $template->param( verbose => 1 ); }
if ($print_basket) { $template->param( print_basket => 1 ); }
my @bibs = split(/\//, $bib_list);
my @bibs = split( /\//, $bib_list );
my @results;
my $num = 1;
foreach my $biblionumber (@bibs) {
$template->param(biblionumber => $biblionumber);
my $dat = &bibdata($biblionumber);
my ($authorcount, $addauthor) = &addauthor($biblionumber);
my @items = &ItemInfo(undef, $biblionumber, 'opac');
$dat->{'additional'}=$addauthor->[0]->{'author'};
for (my $i = 1; $i < $authorcount; $i++) {
$dat->{'additional'} .= "|" . $addauthor->[$i]->{'author'};
} # for
if($num % 2 == 1){
$dat->{'even'} = 1;
}
$num++;
$dat->{'biblionumber'} = $biblionumber;
$dat->{ITEM_RESULTS} = \@items;
if (C4::Context->preference("BiblioDefaultView") eq "normal") {
$dat->{dest} = "opac-detail.pl";
} elsif (C4::Context->preference("BiblioDefaultView") eq "marc") {
$dat->{dest} ="opac-MARCdetail.pl";
} else {
$dat->{dest} = "opac-ISBDdetail.pl";
}
push (@results, $dat);
my $marcflavour = C4::Context->preference('marcflavour');
foreach my $biblionumber ( @bibs ) {
$template->param( biblionumber => $biblionumber );
my $dat = &GetBiblioData($biblionumber);
my $record = &GetMarcBiblio($biblionumber);
my $marcnotesarray = GetMarcNotes( $record, $marcflavour );
my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour );
my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
my @items = &GetItemsInfo( $biblionumber, 'opac' );
if ( $num % 2 == 1 ) {
$dat->{'even'} = 1;
}
$num++;
$dat->{biblionumber} = $biblionumber;
$dat->{ITEM_RESULTS} = \@items;
$dat->{MARCNOTES} = $marcnotesarray;
$dat->{MARCSUBJCTS} = $marcsubjctsarray;
$dat->{MARCAUTHORS} = $marcauthorsarray;
if ( C4::Context->preference("BiblioDefaultView") eq "normal" ) {
$dat->{dest} = "opac-detail.pl";
}
elsif ( C4::Context->preference("BiblioDefaultView") eq "marc" ) {
$dat->{dest} = "opac-MARCdetail.pl";
}
else {
$dat->{dest} = "opac-ISBDdetail.pl";
}
push( @results, $dat );
}
my $resultsarray=\@results;
my $resultsarray = \@results;
# my $itemsarray=\@items;
$template->param(BIBLIO_RESULTS => $resultsarray,
$template->param(
BIBLIO_RESULTS => $resultsarray,
);
output_html_with_http_headers $query, $cookie, $template->output;

136
opac/opac-detail.pl

@ -25,11 +25,12 @@ use CGI;
use C4::Auth;
use C4::Serials; #uses getsubscriptionfrom biblionumber
use C4::Interface::CGI::Output;
use HTML::Template;
use C4::Biblio;
use C4::Search;
use C4::Amazon;
use C4::Review;
use C4::Serials;
use C4::Members;
my $query = new CGI;
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
@ -42,16 +43,12 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
}
);
my $biblionumber = $query->param('bib');
my $biblionumber = $query->param('biblionumber') || $query->param('bib');
$template->param( biblionumber => $biblionumber );
# change back when ive fixed request.pl
my @items = &ItemInfo( undef, $biblionumber, 'opac' );
my $dat = &bibdata($biblionumber);
my ( $authorcount, $addauthor ) = &addauthor($biblionumber);
my ( $webbiblioitemcount, @webbiblioitems ) = &getwebbiblioitems($biblionumber);
my ( $websitecount, @websites ) = &getwebsites($biblionumber);
my @items = &GetItemsInfo( $biblionumber, 'opac' );
my $dat = &GetBiblioData($biblionumber);
#coping with subscriptions
my $subscriptionsnumber = CountSubscriptionFromBiblionumber($biblionumber);
my @subscriptions =
@ -69,109 +66,66 @@ foreach my $subscription (@subscriptions) {
}
$dat->{'count'} = @items;
my @author;
if ( $dat->{'author'} ) {
my %authorpush;
$authorpush{author} = $dat->{'author'};
push @author, \%authorpush;
}