koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] CVS: koha/opac opac-detail.pl,NONE,1.1.2.1 opac-main.pl,NONE,


From: Finlay Thompson
Subject: [Koha-cvs] CVS: koha/opac opac-detail.pl,NONE,1.1.2.1 opac-main.pl,NONE,1.1.2.1 opac-moredetail.pl,NONE,1.1.2.1 opac-search.pl,NONE,1.1.2.1 opac-searchresults.pl,NONE,1.1.2.1
Date: Tue, 17 Sep 2002 23:25:57 -0700

Update of /cvsroot/koha/koha/opac
In directory usw-pr-cvs1:/tmp/cvs-serv11673/opac

Added Files:
      Tag: rel-1-2
        opac-detail.pl opac-main.pl opac-moredetail.pl opac-search.pl 
        opac-searchresults.pl 
Log Message:

Have moved all the fully templated cgi-bin scripts for the opac into here. Also 
given them a new naming convention :-)



--- NEW FILE ---
#!/usr/bin/perl
use strict;
require Exporter;
use C4::Output;  # contains picktemplate
use CGI;
use C4::Search;
use C4::Auth;
 
my $query=new CGI;

my ($loggedinuser, $cookie, $sessionID) = checkauth($query, 1);

my $template = gettemplate ("detail.tmpl", "opac");

my $biblionumber=$query->param('bib');
my $type='intra';

# change back when ive fixed request.pl
my @items = ItemInfo(undef, $biblionumber, $type);
my $dat=bibdata($biblionumber);
my ($authorcount, $addauthor)= &addauthor($biblionumber);
my ($webbiblioitemcount, @webbiblioitems) = &getwebbiblioitems($biblionumber);
my ($websitecount, @websites)             = &getwebsites($biblionumber);

$dat->{'count'address@hidden;

$dat->{'additional'}=$addauthor->[0]->{'author'};
for (my $i = 1; $i < $authorcount; $i++) {
        $dat->{'additional'} .= "|" . $addauthor->[$i]->{'author'};
} # for

my @results;

$results[0]=$dat;

my address@hidden;
my address@hidden;
my address@hidden;
my address@hidden;


my $startfrom=$query->param('startfrom');
($startfrom) || ($startfrom=0);

my $count=1;

# now to get the items into a hash we can use and whack that thru
$template->param(startfrom => $startfrom+1);
$template->param(endat => $startfrom+20);
$template->param(numrecords => $count);
my $nextstartfrom=($startfrom+20<$count-20) ? ($startfrom+20) : ($count-20);
my $prevstartfrom=($startfrom-20>0) ? ($startfrom-20) : (0);
$template->param(nextstartfrom => $nextstartfrom);
$template->param(prevstartfrom => $prevstartfrom);

$template->param(BIBLIO_RESULTS => $resultsarray);
$template->param(ITEM_RESULTS => $itemsarray);
$template->param(WEB_RESULTS => $webarray);
$template->param(SITE_RESULTS => $sitearray);

print "Content-Type: text/html\n\n", $template->output;


--- NEW FILE ---
#!/usr/bin/perl
use strict;
require Exporter;
use CGI;

use C4::Output;       # gettemplate
use C4::Auth;         # checkauth

my $query = new CGI;

my ($loggedinuser, $cookie, $sessionID) = checkauth($query, 1);

my $template = gettemplate("opac-main.tmpl", "opac");

print "Content-Type: text/html\n\n", $template->output;

--- NEW FILE ---
#!/usr/bin/perl

#script to display detailed information
#written 8/11/99

use strict;
#use DBI;
use C4::Search;
use C4::Koha;
use C4::Output;
use C4::Acquisitions;
use C4::Biblio;

use CGI;
my $input = new CGI;
print $input->header;
#whether it is called from the opac of the intranet
my $type=$input->param('type');
#setup colours
my $main;
my $secondary;
if ($type eq 'opac'){
  $main='#99cccc';
  $secondary='#efe5ef';
} else {
  $main='#cccc99';
  $secondary='#ffffcc';
}
print startpage();
print startmenu($type);
my $blah;

my $bib=$input->param('bib');
my $title=$input->param('title');
my $bi=$input->param('bi');
my $data=bibitemdata($bi);

my (@items)=itemissues($bi);
my ($order,$ordernum)=getorder($bi,$bib);
#print @items;
my address@hidden;

my $i=0;
print center();

my $dewey = $data->{'dewey'};                                                  
$dewey =~ s/0+$//;                                                             
if ($dewey eq "000.") { $dewey = "";};                                         
if ($dewey < 10){$dewey='00'.$dewey;}                                          
if ($dewey < 100 && $dewey > 10){$dewey='0'.$dewey;}                           
if ($dewey <= 0){
  $dewey='';                                                                   
}               
$dewey=~ s/\.$//;
print <<printend
<br>
<a href=/cgi-bin/koha/request.pl?bib=$bib><img src=/images/requests.gif 
width=120 height=42 border=0 align=right border=0></a>
printend
;
if ($type eq 'catmain'){
  print "<FONT SIZE=6><em>Catalogue Maintenance</em></FONT><br>";
}
print <<printend
<FONT SIZE=6><em><a 
href=/cgi-bin/koha/detail.pl?bib=$bib&type=intra>$data->{'title'} 
($data->{'author'})</a></em></FONT><P>
<p>
<form action=/cgi-bin/koha/modbibitem.pl>
<input type=hidden name=bibitem value=$bi>
<input type=hidden name=biblio value=$bib>
<!-------------------BIBLIO ITEM------------>
<TABLE  CELLSPACING=0  CELLPADDING=5 border=1 align=left>
<TR VALIGN=TOP>
<td  bgcolor="99cc33" background="/images/background-mem.gif" 
><B>$data->{'biblioitemnumber'} GROUP - $data->{'description'} </b> </TD>
</TR>
<tr VALIGN=TOP  >
<TD width=210 >
<INPUT TYPE="image" name="submit"  VALUE="modify" height=42  WIDTH=93 BORDER=0 
src="/images/modify-mem.gif"> 
<INPUT TYPE="image" name="delete"  VALUE="delete" height=42  WIDTH=93 BORDER=0 
src="/images/delete-mem.gif"> 
<br>
<FONT SIZE=2  face="arial, helvetica">
<b>Biblionumber:</b> $bib<br>
<b>Item Type:</b> $data->{'itemtype'}<br>
<b>Loan Length:</b> $data->{'loanlength'}<br>
<b>Rental Charge:</b> $data->{'rentalcharge'}<br>
<b>Classification:</b> $data->{'classification'}$dewey$data->{'subclass'}<br>
<b>ISBN:</b> $data->{'isbn'}<br>
<b>Publisher:</b> $data->{'publishercode'} <br>
<b>Place:</b> $data->{'place'}<br>
<b>Date:</b> $data->{'publicationyear'}<br>
<b>Volume:</b> $data->{'volumeddesc'}<br>
<b>Pages:</b> $data->{'pages'}<br>
<b>Illus:</b> $data->{'illus'}<br>
<b>Size:</b> $data->{'size'}<br>
<b>Notes:</b> $data->{'bnotes'}<br>
<b>No. of Items:</b> $count

printend
;
if ($type eq 'catmain'){
  print "<br><a 
href=/cgi-bin/koha/maint/shiftbib.pl?bi=$data->{'biblioitemnumber'}&bib=$data->{'biblionumber'}>Shift
 to another biblio</a>";
 
}
print <<printend

</font>
</TD>
</tr>
</table>
</form>
printend
;

for (my $i=0;$i<$count;$i++){
print <<printend
<img src="/images/holder.gif" width=16 height=300 align=left>
<TABLE  CELLSPACING=0  CELLPADDING=5 border=1 align=left width=220 >            
                
<TR VALIGN=TOP>
<td  bgcolor="99cc33" background="/images/background-mem.gif"><B>BARCODE 
$items[$i]->{'barcode'}</b></TD>
</TR>
<tr VALIGN=TOP  >
<TD width=220 >
<form action=/cgi-bin/koha/moditem.pl method=post>
<input type=hidden name=bibitem value=$bi>
<input type=hidden name=item value=$items[$i]->{'itemnumber'}>
<input type=hidden name=type value=$type>
<INPUT TYPE="image" name="submit"  VALUE="modify" height=42  WIDTH=93 BORDER=0 
src="/images/modify-mem.gif"> 
<INPUT TYPE="image" name="delete"  VALUE="delete" height=42  WIDTH=93 BORDER=0 
src="/images/delete-mem.gif"> 
<br>
printend
;
$items[$i]->{'itemlost'}=~ s/0/No/;
$items[$i]->{'itemlost'}=~ s/1/Yes/;
$items[$i]->{'withdrawn'}=~ s/0/No/;
$items[$i]->{'withdrawn'}=~ s/1/Yes/;
$items[$i]->{'replacementprice'}+=0.00;

my $year=substr($items[$i]->{'timestamp0'},0,4);
my $mon=substr($items[$i]->{'timestamp0'},4,2);
my $day=substr($items[$i]->{'timestamp0'},6,2);
$items[$i]->{'timestamp0'}="$day/$mon/$year";

$items[$i]->{'dateaccessioned'} = slashifyDate($items[$i]->{'dateaccessioned'});
$items[$i]->{'datelastseen'} = slashifyDate($items[$i]->{'datelastseen'});

print <<printend
<FONT SIZE=2  face="arial, helvetica">
<b>Home Branch:</b> $items[$i]->{'homebranch'}<br>
<b>Last seen:</b> $items[$i]->{'datelastseen'}<br>
<b>Last borrowed:</b> $items[$i]->{'timestamp0'}<br>
printend
;
if ($items[$i] eq 'Available'){
  print "<b>Currently on issue to:</b><br>";
} else {
  print "<b>Currently on issue to:</b> <a 
href=/cgi-bin/koha/moremember.pl?bornum=$items[$i]->{'borrower0'}>$items[$i]->{'card'}</a><br>";
}
print <<printend
<b>Last Borrower 1:</b> $items[$i]->{'card0'}<br>
<b>Last Borrower 2:</b> $items[$i]->{'card1'}<br>
<b>Current Branch:</b> $items[$i]->{'holdingbranch'}<br>
<b>Replacement Price:</b> $items[$i]->{'replacementprice'}<br>
<b>Item lost:</b> $items[$i]->{'itemlost'}<br>
<b>Paid for:</b> $items[$i]->{'paidfor'}<br>
<b>Notes:</b> $items[$i]->{'itemnotes'}<br>
<b>Renewals:</b> $items[$i]->{'renewals'}<br>
<b><a 
href=/cgi-bin/koha/acqui/acquire.pl?recieve=$ordernum&biblio=$bib&invoice=$order->{'booksellerinvoicenumber'}&catview=yes>Accession</a>
 Date: $items[$i]->{'dateaccessioned'}<br>
printend
;
if ($items[$i]->{'wthdrawn'} eq '1'){
  $items[$i]->{'wthdrawn'}="Yes";
} else {
  $items[$i]->{'wthdrawn'}="No";
}
print <<printend
<b>Cancelled: $items[$i]->{'wthdrawn'}<br>
<b>Total Issues:</b> $items[$i]->{'issues'}<br>
<b>Group Number:</b> $bi <br>
<b>Biblio number:</b> $bib <br>



</font>
</TD>
</tr>
</table>
</form>
printend
;
}
print <<printend
<p>
</form>
printend
;


print endcenter();

print endmenu($type);
print endpage();

--- NEW FILE ---
#!/usr/bin/perl
use strict;
require Exporter;

use C4::Output;  # contains picktemplate
use CGI;
use C4::Auth;

my $query = new CGI;
#my ($loggedinuser, $cookie, $sessionID) = checkauth($query);

my $template = gettemplate("opac-search.tmpl", "opac");

#$template->param(SITE_RESULTS => $sitearray);
print "Content-Type: text/html\n\n", $template->output;

--- NEW FILE ---
#!/usr/bin/perl
use strict;
require Exporter;
use CGI;
use C4::Search;
use C4::Auth;
use C4::Output; # now contains picktemplate
  
my $query=new CGI;

my ($loggedinuser, $cookie, $sessionID) = checkauth($query, 1);


my $template;
my $subject=$query->param('subject');
# if its a subject we need to use the subject.tmpl
if ($subject) {
    $template = gettemplate ("subject.tmpl", "opac");
} else {
    $template = gettemplate ("searchresults.tmpl", "opac");
}

# get all the search variables
# we assume that C4::Search will validate these values for us
my @fields = ('keyword', 'subject', 'author', 'illustrator', 'itemnumber', 
'isbn', 'date-before', 'date-after', 'class', 'dewey', 'branch', 'title', 
'abstract', 'publisher');



# collect all the fields ...
my %search;
my $forminputs;
my $searchdesc = '';
foreach my $field (@fields) {
    $search{$field} = $query->param($field);
    if ($search{$field}) {
        push @$forminputs, {field => $field, value => $search{$field}};
        $searchdesc .= "$field = $search{$field}, ";
    }
}
$search{'ttype'} = $query->param('ttype');
push @$forminputs, {field => 'ttype', value => $search{'ttype'}};

if (my $subjectitems=$query->param('subjectitems')){
    $search{'subject'} = $subjectitems;
    $searchdesc.="subject = $subjectitems, ";
}

@$forminputs=() unless $forminputs;
$template->param(FORMINPUTS => $forminputs);

# do the searchs ....
my $env;
$env->{itemcount}=1;
my $num=10;
my @results;
my $count;
my $startfrom = $query->param('startfrom');
my $subjectitems=$query->param('subjectitems');
if ($subjectitems) {
    my $blah;
    @results = subsearch(\$blah,$subjectitems, $num, $startfrom);
    $count = $#results+1;
} else {
    ($count, @results) = catalogsearch($env,'',\%search,$num,$startfrom);
}

my $startfrom=$query->param('startfrom');
($startfrom) || ($startfrom=0);

my address@hidden;
($resultsarray) || (@$resultsarray=());


# sorting out which results to display.
$template->param(startfrom => $startfrom+1);
($startfrom+$num<=$count) ? ($template->param(endat => $startfrom+$num)) : 
($template->param(endat => $count));
$template->param(numrecords => $count);
my $nextstartfrom=($startfrom+$num<$count) ? ($startfrom+$num) : (-1);
my $prevstartfrom=($startfrom-$num>=0) ? ($startfrom-$num) : (-1);
$template->param(nextstartfrom => $nextstartfrom);
my $displaynext=1;
my $displayprev=0;
($nextstartfrom==-1) ? ($displaynext=0) : ($displaynext=1);
($prevstartfrom==-1) ? ($displayprev=0) : ($displayprev=1);
$template->param(displaynext => $displaynext);
$template->param(displayprev => $displayprev);
$template->param(prevstartfrom => $prevstartfrom);

$template->param(searchdesc => $searchdesc);
$template->param(SEARCH_RESULTS => $resultsarray);
$template->param(loggedinuser => $loggedinuser);

my $numbers;
@$numbers = ();
if ($count>10) {
    for (my $i=1; $i<$count/10+1; $i++) {
        my $highlight=0;
        my $themelang = $template->param('themelang');
        ($startfrom==($i-1)*10) && ($highlight=1);
        push @$numbers, { number => $i, highlight => $highlight , startfrom => 
($i-1)*10 };
    }
}

$template->param(numbers => $numbers);


print $query->header(-cookie => $cookie), $template->output;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]