#!/usr/bin/perl
#script to display detailed information
#written 8/11/99
use strict;
use C4::Search;
use CGI;
use C4::Output;
my $input = new CGI;
my $type = $input->param('type');
my $bib = $input->param('bib');
my @items = &ItemInfo(undef, $bib, $type);
my @temp = split('\t', $items[0]);
my $count = @items;
my $dat = &bibdata($bib);
my ($websitecount, @websites) = &getwebsites($bib);
my ($authorcount, $addauthor) = &addauthor($bib);
my ($webbiblioitemcount, @webbiblioitems) = &getwebbiblioitems($bib);
my $additional = $addauthor->[0]->{'author'};
my $main;
my $secondary;
my $colour;
if ($type eq '') {
$type = 'opac';
} # if
# setup colours
if ($type eq 'opac') {
$main = '#99cccc';
$secondary = '#efe5ef';
} else {
$main = '#cccc99';
$secondary = '#ffffcc';
} # else
$colour = $secondary;
for (my $i = 1; $i < $authorcount; $i++) {
$additional .= "|" . $addauthor->[$i]->{'author'};
} # for
print $input->header;
print startpage();
print startmenu($type);
if ($type ne 'opac'){
print << "EOF";
EOF
} # if
if ($type eq 'catmain'){
print mkheadr(3,"Catalogue Maintenance");
} # if
if ($dat->{'author'} ne ''){
print mkheadr(3,"$dat->{'title'} ($dat->{'author'}) $temp[4]");
} else {
print mkheadr(3,"$dat->{'title'} $temp[4]");
} # if
print << "EOF";
EOF
if ($type ne 'opac') {
print << "EOF";
EOF
} else {
print << "EOF";
|
EOF
} # else
print << "EOF";
BIBLIO RECORD
EOF
if ($type ne 'opac') {
print "$bib";
}
print << "EOF";
|
EOF
if ($type ne 'opac') {
print << "EOF";
EOF
} # if
print << "EOF";
EOF
if ($type ne 'opac') {
print << "EOF";
Subtitle: $dat->{'subtitle'}
Author: $dat->{'author'}
Additional Author: $additional
Series Title: $dat->{'seriestitle'}
Subject: $dat->{'subject'}
Copyright: $dat->{'copyrightdate'}
Notes: $dat->{'notes'}
Unititle: $dat->{'unititle'}
Analytical Author:
Analytical Title:
Serial: $dat->{'serial'}
Total Number of Items: $count
EOF
} else {
if ($dat->{'subtitle'} ne ''){
print "Subtitle: $dat->{'subtitle'} ";
} # if
if ($dat->{'author'} ne ''){
print "Author: $dat->{'author'} ";
} # if
# Additional Author:
if ($dat->{'seriestitle'} ne '') {
print "Seriestitle: $dat->{'seriestitle'} ";
} # if
if ($dat->{'subject'} ne '') {
print "Subject: $dat->{'subject'} ";
} # if
if ($dat->{'copyrightdate'} ne '') {
print "Copyright: $dat->{'copyrightdate'} ";
} # if
if ($dat->{'notes'} ne '') {
print "Notes: $dat->{'notes'} ";
} # if
if ($dat->{'unititle'} ne '') {
print "Unititle: $dat->{'unititle'} ";
} # if
# Analytical Author:
# Analytical Title:
if ($dat->{'serial'} ne '0') {
print "Serial: Yes ";
} # if
print << "EOF";
Total Number of Items: $count
EOF
} # if
print << "EOF";
|
EOF
print center();
print mktablehdr;
if ($type eq 'opac') {
print mktablerow(6,$main,'Item Type','Class','Branch','Date Due','Last Seen');
} else {
print mktablerow(7,$main,'Itemtype','Class','Location','Date Due','Last Seen','Barcode',"","/images/background-mem.gif");
} # else
$colour = 'white';
for (my $i = 0; $i < $count; $i ++) {
my @results = split('\t', $items[$i]);
if ($type ne 'opac') {
$results[1] = mklink("/cgi-bin/koha/moredetail.pl?item=$results[5]&bib=$bib&bi=$results[8]&type=$type",$results[1]);
} # if
if ($results[2] eq '') {
$results[2] = 'Available';
} # if
if ($type eq 'catmain'){
$results[10] = mklink("/cgi-bin/koha/maint/catmaintain.pl?type=fixitemtype&bi=$results[8]&item=$results[6]","Fix Itemtype");
} # if
if ($type ne 'opac'){
if ($type eq 'catmain'){
print mktablerow(8,$colour,$results[6],$results[4],$results[3],$results[2],$results[7],$results[1],$results[9],$results[10]);
} else {
print mktablerow(7,$colour,$results[6],$results[4],$results[3],$results[2],$results[7],$results[1],$results[9]);
} # else
} else {
$results[6] = ItemType($results[6]);
print mktablerow(6,$colour,$results[6],$results[4],$results[3],$results[2],$results[7],$results[9]);
} # else
if ($colour eq $secondary) {
$colour = 'white';
} else {
$colour = $secondary;
} # else
} # for
for (my $i = 0; $i < $webbiblioitemcount; $i++) {
if ($type eq 'opac') {
$webbiblioitems[$i]->{'url'} =~ s/^http:\/\///;
print mktablerow(6, $colour, 'Website', 'WEB', 'Online', 'Available', "http://$webbiblioitems[$i]->{'url'}");
} else {
$webbiblioitems[$i]->{'url'} =~ s/^http:\/\///;
print mktablerow(7, $colour, 'WEB', '', 'Online', 'Available', "", "http://$webbiblioitems[$i]->{'url'}");
} # else
} # for
print mktableft();
print "";
print mktablehdr();
if ($type ne 'opac') {
print << "EOF";
HELP
Update Biblio for all Items: Click on the Modify button [left] to amend the biblio. Any changes you make will update the record for all the items listed above.
Updating the Biblio for only ONE or SOME Items:
EOF
if ($type eq 'catmain') {
print << "EOF";
If some of the items listed above need a different biblio,
you need to click on the wrong item, then shift the group it belongs to, to the correct biblio.
You will need to know the correct biblio number
|
EOF
} else {
print << "EOF";
If some of the items listed above need a different biblio, or are on the wrong biblio, you must use the acquisitions process to fix this. You will need to "re-order" the items, and delete them from this biblio.
EOF
} # else
} # if
print mktableft();
print endcenter();
print << "EOF";
EOF
if ($type ne 'opac') {
print << "EOF";
Abstract |
$dat->{'abstract'} |
Links to Associated Websites |
EOF
for (my $i = 0; $i < $websitecount; $i++) {
$websites[$i]->{'url'} =~ s/^http:\/\///;
print << "EOF";
Title: $websites[$i]->{'title'}
Description: $websites[$i]->{'description'}
URL: http://$websites[$i]->{'url'}
|
EOF
} # for
print << "EOF";
EOF
} else {
if ($dat->{'abstract'} ne '') {
print << "EOF";
Abstract |
$dat->{'abstract'} |
EOF
} # if
if ($websitecount) {
print << "EOF";
Link to Associated Websites |
EOF
for (my $i = 0; $i < $websitecount; $i++) {
$websites[$i]->{'url'} =~ s/^http:\/\///;
print << "EOF";
Title: $websites[$i]->{'title'}
Description: $websites[$i]->{'description'}
URL: http://$websites[$i]->{'url'}
|
EOF
} # for
print << "EOF";
EOF
} # if
} # else
print endmenu($type);
print endpage();