Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix for #187

  • Loading branch information...
commit 844797459f7fcbb8ec5137bad85aa8dcd1c715b3 1 parent 41560e8
tipaul authored
View
9 C4/Reserves2.pm
@@ -146,8 +146,6 @@ sub FindReserves {
$query.=" order by priority";
my $sth=$dbh->prepare($query);
$sth->execute;
- # FIXME - $i is unnecessary and bogus
- my $i=0;
my @results;
while (my $data=$sth->fetchrow_hashref){
# FIXME - What is this if-statement doing? How do constraints work?
@@ -173,12 +171,10 @@ sub FindReserves {
$data->{$key} = $bdata->{$key};
}
}
- $results[$i]=$data; # FIXME - Use push @results
- $i++;
+ push @results, $data;
}
-# print $query;
$sth->finish;
- return($i,\@results);
+ return($#results+1,\@results);
}
=item CheckReserves
@@ -790,6 +786,7 @@ sub getreservetitle {
= $bor and reserveconstraints.reservedate='$date' and
reserveconstraints.timestamp=$timestamp";
my $sth=$dbh->prepare($query);
+ warn "q : $query";
$sth->execute;
my $data=$sth->fetchrow_hashref;
$sth->finish;
View
10 koha-tmpl/intranet-tmpl/default/en/members/memberentry.tmpl
@@ -180,23 +180,23 @@
</tr>
<TMPL_IF NAME=modify>
- <tr><td COLSPAN=5><Font size=2>FLAGS</font></td></tr>
+ <tr><td COLSPAN=5><Font size=2>FLAGS</font></td></tr>
<TMPL_LOOP NAME=flagloop>
<tr>
<td COLSPAN=2><TMPL_VAR NAME=html></td>
- <td COLSPAN=3><input type=radio name="<TMPL_VAR NAME=name>" value="1" <TMPL_VAR NAME=yes>>Yes
- <input type=radio name="<TMPL_VAR NAME=name>" value="0" <TMPL_VAR NAME=no>>No
+ <td COLSPAN=3><input type=radio name="<TMPL_VAR NAME=name>" value="1" <TMPL_VAR NAME=yes>>Yes
+ <input type=radio name="<TMPL_VAR NAME=name>" value="0" <TMPL_VAR NAME=no>>No
</td>
</tr>
</TMPL_LOOP>
</TMPL_IF>
-
+
<tr>
<td></td>
<td><input type=image src="<TMPL_VAR name="interface">/<TMPL_VAR name="theme">/images/2rightarrow.png" ALT="Add New Member" border=0 ></td>
</tr>
</table>
-</form>
+</form>
<TMPL_INCLUDE NAME="members-bottom.inc">
View
4 koha-tmpl/intranet-tmpl/default/en/members/moremember.tmpl
@@ -193,7 +193,9 @@
<tr VALIGN=TOP >
<td colspan=5 align=right>
- <INPUT TYPE="image" name="submit" VALUE="update" height=42 WIDTH=187 BORDER=0 src="<TMPL_VAR name="themelang">/images/cancel-requests.gif">
+ <TMPL_IF name="reserveloop">
+ <INPUT TYPE="image" name="submit" VALUE="update" height=42 WIDTH=187 BORDER=0 src="<TMPL_VAR name="themelang">/images/cancel-requests.gif">
+ </TMPL_IF>
</td>
</tr>
</form>
View
2  koha-tmpl/intranet-tmpl/default/en/request.tmpl
@@ -105,7 +105,7 @@
<TMPL_LOOP Name="reserveloop">
<tr VALIGN=TOP>
<TD>
- <input type=hidden name=borrower value=<TMPL_VAR Name="borrowernumber">>
+ <input type=hidden name=borrowernumber value=<TMPL_VAR Name="borrowernumber">>
<input type=hidden name=biblio value=<TMPL_VAR Name="biblionumber">>
<select name=rank-request>
<TMPL_IF Name="wait">
View
16 koha-tmpl/intranet-tmpl/default/fr/members/moremember.tmpl
@@ -188,11 +188,23 @@
<tr VALIGN=TOP >
<td colspan=5 align=right>
- <INPUT TYPE="image" name="submit" VALUE="update" height=42 WIDTH=187 BORDER=0 src="<TMPL_VAR name="themelang">/images/cancel-requests.gif">
- </td>
+ <TMPL_IF name="reserveloop">
+ <INPUT TYPE="image" name="submit" VALUE="update" height=42 WIDTH=187 BORDER=0 src="<TMPL_VAR name="themelang">/images/cancel-requests.gif">
+ </tmpl_if>
+ </td>
</tr>
</form>
</table>
+<table>
+ <tr VALIGN=TOP >
+ <td colspan=5 align=right>
+ <p align=right>
+ <a href="/cgi-bin/koha/readingrec.pl?bornum=<TMPL_VAR NAME="bornum">"><img height=42 WIDTH=187 BORDER=0 src="<TMPL_VAR name="themelang">/images/reading-record.gif"></a>
+ </p>
+ </td>
+ </tr>
+</table>
+
<p align=right>
<a href="/cgi-bin/koha/readingrec.pl?bornum=<TMPL_VAR NAME="bornum">"><img height=42 WIDTH=187 BORDER=0 src="<TMPL_VAR name="themelang">/images/reading-record.gif"></a>
</p>
View
22 moremember.pl
@@ -184,20 +184,16 @@
my ($rescount,$reserves)=FindReserves('',$bornum); #From C4::Reserves2
-# FIXME
-# does it make sense to turn this into a foreach my $i (0..$rescount)
-# kind of loop?
-#
my @reservedata;
-for (my $i=0;$i<$rescount;$i++){
- $reserves->[$i]{'reservedate2'} = format_date($reserves->[$i]{'reservedate'});
- my $restitle;
- my %row = %$reserves->[$i];
- if ($reserves->[$i]{'constrainttype'} eq 'o'){
- $restitle=getreservetitle($reserves->[$i]{'biblionumber'},$reserves->[$i]{'borrowernumber'},$reserves->[$i]{'reservedate'},$reserves->[$i]{'timestamp'});
- %row = (%row , %$restitle);
- }
- push (@reservedata, \%row);
+foreach my $reserveline (@$reserves) {
+ $reserveline->{'reservedate2'} = format_date($reserveline->{'reservedate'});
+ my $restitle;
+ my %row = %$reserveline;
+ if ($reserveline->{'constrainttype'} eq 'o'){
+ $restitle=getreservetitle($reserveline->{'biblionumber'},$reserveline->{'borrowernumber'},$reserveline->{'reservedate'},$reserveline->{'timestamp'});
+ %row = (%row , %$restitle);
+ }
+ push (@reservedata, \%row);
}
$template->param($data);
Please sign in to comment.
Something went wrong with that request. Please try again.