Selaa lähdekoodia

tidying up

master
chris 21 vuotta sitten
vanhempi
commit
fc70288d55
7 muutettua tiedostoa jossa 189 lisäystä ja 38 poistoa
  1. +1
    -1
      C4/Circulation/Returns.pm
  2. +25
    -9
      C4/Search.pm
  3. +1
    -1
      detail.pl
  4. +4
    -1
      fines.pl
  5. +152
    -22
      moredetail.pl
  6. +2
    -1
      search.pl
  7. +4
    -3
      subjectsearch.pl

+ 1
- 1
C4/Circulation/Returns.pm Näytä tiedosto

@@ -145,7 +145,7 @@ sub checkissue {
where borrowernumber = '$resrec->{'borrowernumber'}'";
my $btsh = $dbh->prepare($bquery);
$btsh->execute;
my $resborrower = $bsth->fetchrow_hashref;
my $resborrower = $btsh->fetchrow_hashref;
printreserve($env,$resrec,$resborrower,$itemrec);
my $mess = "Reserved for collection at branch $resrec->{'branchcode'}";
error_msg($env,$mess);


+ 25
- 9
C4/Search.pm Näytä tiedosto

@@ -16,7 +16,7 @@ $VERSION = 0.01;
@ISA = qw(Exporter);
@EXPORT = qw(&CatSearch &BornameSearch &ItemInfo &KeywordSearch &subsearch
&itemdata &bibdata &GetItems &borrdata &getacctlist &itemnodata &itemcount
&OpacSearch &borrdata2 &NewBorrowerNumber);
&OpacSearch &borrdata2 &NewBorrowerNumber &bibitemdata);
%EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ],
# your exported package globals go here,
@@ -105,6 +105,7 @@ sub OpacSearch {
sub KeywordSearch {
my ($env,$type,$search,$num,$offset)=@_;
my $dbh = &C4Connect;
$search->{'keyword'}=~ s/ +$//;
my @key=split(' ',$search->{'keyword'});
my $count=@key;
my $i=1;
@@ -120,8 +121,7 @@ sub KeywordSearch {
$sth->execute;
$i=0;
while (my $data=$sth->fetchrow_hashref){

$results[$i]="$data->{'author'}\t$data->{'title'}\t$data->{'biblionumber'}\t$data->{'copyrightdate'}";
$results[$i]="$data->{'author'}\t$data->{'title'}\t$data->{'biblionumber'}\t$data->{'copyrightdate'}";
# print $results[$i];
$i++;
}
@@ -197,16 +197,18 @@ sub CatSearch {
my @key=split(' ',$search->{'title'});
my $count=@key;
my $i=1;
$query="select count(*) from biblio,biblioitems
where biblioitems.biblionumber=biblio.biblionumber and (title like '%$key[0]%'";
$query="select count(*) from biblio,bibliosubtitle
where
(biblio.biblionumber=bibliosubtitle.biblionumber) and
((title like '%$key[0]%' or subtitle like '%$key[0]%')";
while ($i<$count){
$query=$query." and title like '%$key[$i]%'";
$query=$query." and (title like '%$key[$i]%' or subtitle like '%$key[$i]%')";
$i++;
}
$query=$query.")";
if ($search->{'class'} ne ''){
$query.=" and biblioitems.itemtype='$search->{'class'}'";
}
# if ($search->{'class'} ne ''){
# $query.=" and biblioitems.itemtype='$search->{'class'}'";
# }
} elsif ($search->{'class'} ne ''){
$query="select count(*) from biblioitems,biblio where itemtype =
'$search->{'class'}' and biblio.biblionumber=biblioitems.biblionumber";
@@ -451,6 +453,20 @@ sub bibdata {
return($data);
}

sub bibitemdata {
my ($bibitem)=@_;
my $dbh=C4Connect;
my $query="Select * from biblio,biblioitems where biblio.biblionumber=
biblioitems.biblionumber and biblioitemnumber=$bibitem";
# print $query;
my $sth=$dbh->prepare($query);
$sth->execute;
my $data=$sth->fetchrow_hashref;
$sth->finish;
$dbh->disconnect;
return($data);
}

sub itemnodata {
my ($env,$dbh,$itemnumber) = @_;
my $query="Select * from biblio,items,biblioitems


+ 1
- 1
detail.pl Näytä tiedosto

@@ -91,7 +91,7 @@ my $colour=1;
while ($i < $count){
my @results=split('\t',$items[$i]);
if ($type ne 'opac'){
$results[1]=mklink("/cgi-bin/koha/moredetail.pl?item=$results[5]",$results[1]);
$results[1]=mklink("/cgi-bin/koha/moredetail.pl?item=$results[5]&bib=$bib&bi=$results[8]",$results[1]);
}
if ($results[2] eq ''){
$results[2]='Available';


+ 4
- 1
fines.pl Näytä tiedosto

@@ -10,7 +10,10 @@ my ($count,$data)=Getoverdues();
#print $count;
my $count2=0;
#$count=1000;
my $date=Date_DaysSince999(1,2,2000);
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =localtime(time);
$mon++;
$year=$year+1900;
my $date=Date_DaysSince999($mon,$mday,$year);
my $bornum;
my $borrower;
my $max=5;


+ 152
- 22
moredetail.pl Näytä tiedosto

@@ -29,34 +29,164 @@ my $blah;

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

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

my @items=ItemInfo(\$blah,$bib,$title);
#print @items;
my $count=@items;
my $i=0;
print center();
print mktablehdr;
print mktablerow(5,$main,'Title','Barcode','DateDue','Location','Dewey');
my $colour=1;
while ($i < $count){
my @results=split('\t',$items[$i]);
if ($type ne 'opac'){
$results[0]=mklink("/cgi-bin/koha/moredetail.pl?item=$results[5]",$results[0]);
}
if ($results[2] eq ''){
$results[2]='Available';
}
if ($colour == 1){
print mktablerow(5,$secondary,$results[0],$results[1],$results[2],$results[3],$results[4]);
$colour=0;
} else{
print mktablerow(5,'white',$results[0],$results[1],$results[2],$results[3],$results[4]);
$colour=1;
}
$i++;
}

print <<printend
<br>
<a href=request.html><img src=/images/requests.gif width=120 height=42 border=0 align=right border=0></a>
<FONT SIZE=6><em>$data->{'title'} ($data->{'author'})</em></FONT><P>
<p>
<form >
<!-------------------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 - Largeprint </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="submit" VALUE="modify" height=42 WIDTH=93 BORDER=0 src="/images/delete-mem.gif">
<br>
<FONT SIZE=2 face="arial, helvetica">
Group Number: <br>
Volume: <br>
Number: <br>
Classification: <br>
Itemtype: <br>
ISBN: <br>
ISSN: <br>
Dewey: <br>
Subclass: <br>
Copyright: <br>
Number of Items: 2 <br>
</font>
</TD>
</tr>
</table>
<img src="/images/holder.gif" width=16 height=250 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 LO123456</b></TD>
</TR>
<tr VALIGN=TOP >
<TD width=220 >
<INPUT TYPE="image" name="submit" VALUE="modify" height=42 WIDTH=93 BORDER=0 src="/images/modify-mem.gif">
<INPUT TYPE="image" name="submit" VALUE="modify" height=42 WIDTH=93 BORDER=0 src="/images/delete-mem.gif">
<br>
<FONT SIZE=2 face="arial, helvetica">
Item Number: <br>
Due Date: <br>
Member: <br>
Reserves: <br>
Home Branch: <br>
[rest of item info]<br>
&nbsp; |<br>
&nbsp; |<br>
&nbsp; |<br>
&nbsp; |<br>
&nbsp; |<br>
&nbsp; |<br>
&nbsp;\/
</font>
</TD>
</tr>
</table>
<img src="/images/holder.gif" width=16 height=250 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 LO123457</b></TD>
</TR>
<tr VALIGN=TOP >
<TD width=220 >
<INPUT TYPE="image" name="submit" VALUE="modify" height=42 WIDTH=93 BORDER=0 src="/images/modify-mem.gif">
<INPUT TYPE="image" name="submit" VALUE="modify" height=42 WIDTH=93 BORDER=0 src="/images/delete-mem.gif">
<br>
<FONT SIZE=2 face="arial, helvetica">
Item Number: <br>
Due Date: <br>
Member: <br>
Reserves: <br>
Home Branch: <br>
[rest of item info]<br>
&nbsp; |<br>
&nbsp; |<br>
&nbsp; |<br>
&nbsp; |<br>
&nbsp; |<br>
&nbsp; |<br>
&nbsp;\/
</font>
</TD>
</tr>
</table>
<p>
</form>
printend
;


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

+ 2
- 1
search.pl Näytä tiedosto

@@ -132,12 +132,13 @@ while ($i < $count2){
if ($scount > 0){
$stuff[5]=$stuff[5]." S$scount";
}
$stuff[6]=mklink("/cgi-bin/koha/request.pl?bib=$stuff[2]","Request");
} else {
my $word=$stuff[1];
$word=~ s/ /%20/g;
$stuff[1]=mklink("/cgi-bin/koha/subjectsearch.pl?subject=$word",$stuff[1]);
}
$stuff[6]=mklink("/cgi-bin/koha/request.pl?bib=$stuff[2]","Request");
if ($colour == 1){
print mktablerow(6,$secondary,$stuff[1],$stuff[0],$stuff[3],$stuff[4],$stuff[5],$stuff[6]);
$colour=0;


+ 4
- 3
subjectsearch.pl Näytä tiedosto

@@ -17,7 +17,7 @@ my $blah;
my $env;
my $subject=$input->param('subject');
#my $title=$input->param('title');
my $type=$input->param('type');
my @items=subsearch(\$blah,$subject);
#print @items;
my $count=@items;
@@ -47,11 +47,12 @@ while ($i < $count){
if ($scount > 0){
$results[4]=$results[4]." S$scount";
}
$results[6]=mklink("/cgi-bin/koha/request.pl?bib=$results[2]","Request");
if ($colour == 1){
print mktablerow(4,'#ffffcc',$results[0],$results[1],$results[3],$results[4]);
print mktablerow(5,'#ffffcc',$results[0],$results[1],$results[3],$results[4],$results[6]);
$colour=0;
} else{
print mktablerow(4,'white',$results[0],$results[1],$results[3],$results[4]);
print mktablerow(5,'white',$results[0],$results[1],$results[3],$results[4],$results[6]);
$colour=1;
}
$i++;


Ladataan…
Peruuta
Tallenna