[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Koha-cvs] koha/admin aqbookfund.pl [rel_2_2]
From: |
Henri-Damien LAURENT |
Subject: |
[Koha-cvs] koha/admin aqbookfund.pl [rel_2_2] |
Date: |
Tue, 31 Jan 2006 11:45:08 +0000 |
CVSROOT: /cvsroot/koha
Module name: koha
Branch: rel_2_2
Changes by: Henri-Damien LAURENT <address@hidden> 06/01/31 11:45:07
Modified files:
admin : aqbookfund.pl
Log message:
Bug fixing in aqbookfund.
Displaying information if list is not complete.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/koha/admin/aqbookfund.pl.diff?only_with_tag=rel_2_2&tr1=1.19.2.5&tr2=1.19.2.6&r1=text&r2=text
Patches:
Index: koha/admin/aqbookfund.pl
diff -u koha/admin/aqbookfund.pl:1.19.2.5 koha/admin/aqbookfund.pl:1.19.2.6
--- koha/admin/aqbookfund.pl:1.19.2.5 Tue Sep 27 18:03:39 2005
+++ koha/admin/aqbookfund.pl Tue Jan 31 11:45:07 2006
@@ -52,9 +52,10 @@
my ($env,$searchstring,%branches)address@hidden;
my $dbh = C4::Context->dbh;
$searchstring=~ s/\'/\\\'/g;
- my @data=split(' ',$searchstring);
+ my @data=split(' ',$searchstring) if ($searchstring ne "");
my address@hidden;
- my $strsth= "select bookfundid,bookfundname,bookfundgroup,branchcode
from aqbookfund where bookfundname like ? ";
+ my $strsth= "select bookfundid,bookfundname,bookfundgroup,branchcode
from aqbookfund where 1 ";
+ $strsth.=" AND bookfundname like ? " if ($searchstring ne "");
if (%branches){
$strsth.= "AND (aqbookfund.branchcode is null " ;
foreach my $branchcode (keys %branches){
@@ -63,13 +64,18 @@
$strsth .= ") ";
}
$strsth.= "order by aqbookfund.bookfundid";
-# warn "chaine de recherche : ".$strsth;
+ warn "chaine de recherche : ".$strsth;
my $sth=$dbh->prepare($strsth);
- $sth->execute("%$data[0]%");
+ if ($searchstring){
+ $sth->execute("%$data[0]%");
+ } else {
+ $sth->execute;
+ }
my @results;
while (my $data=$sth->fetchrow_hashref){
push(@results,$data);
+ warn "id ".$data->{bookfundid}." name ".$data->{bookfundname}."
branchcode ".$data->{branchcode};
}
# $sth->execute;
$sth->finish;
@@ -163,9 +169,15 @@
my $sth=$dbh->prepare("delete from aqbookfund where bookfundid =?");
$sth->execute($bookfundid);
$sth->finish;
- my $sth=$dbh->prepare("replace aqbookfund
(bookfundid,bookfundname,branchcode) values (?,?,?)");
-
$sth->execute($input->param('bookfundid'),$input->param('bookfundname'),$input->param('branchcode'));
- $sth->finish;
+ if ($input->param('branchcode') ne ""){
+ my $sth=$dbh->prepare("replace aqbookfund
(bookfundid,bookfundname,branchcode) values (?,?,?)");
+
$sth->execute($input->param('bookfundid'),$input->param('bookfundname'),$input->param('branchcode'));
+ $sth->finish;
+ } else {
+ my $sth=$dbh->prepare("replace aqbookfund
(bookfundid,bookfundname) values (?,?)");
+
$sth->execute($input->param('bookfundid'),$input->param('bookfundname'));
+ $sth->finish;
+ }
print "Content-Type: text/html\n\n<META HTTP-EQUIV=Refresh CONTENT=\"0;
URL=aqbookfund.pl\"></html>";
exit;
@@ -206,6 +218,7 @@
my @loop_data =();
my $dbh = C4::Context->dbh;
for (my $i=$offset; $i <
($offset+$pagesize<$count?$offset+$pagesize:$count); $i++){
+# warn "i ".$i." offset".$offset." pagesize ".$pagesize." id
".$results->[$i]{bookfundid}." name ".$results->[$i]{bookfundname}." branchcode
".$results->[$i]{branchcode};
my %row_data;
$row_data{bookfundid} =$results->[$i]{'bookfundid'};
$row_data{bookfundname} = $results->[$i]{'bookfundname'};
@@ -236,6 +249,10 @@
$row_data{budget} = address@hidden;
push @loop_data,\%row_data;
}
+ $template->param(max =>
(($count>$offset+$pagesize)?$offset+$pagesize:$count));
+ $template->param(min => ($offset?$offset:1));
+ $template->param(nbresults => $count);
+ $template->param(Next => ($count>$offset+$pagesize)) if
($count>$offset+$pagesize);
$template->param(bookfund => address@hidden);
} #---- END $OP eq DEFAULT
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Koha-cvs] koha/admin aqbookfund.pl [rel_2_2],
Henri-Damien LAURENT <=