}
$i++;
}
- $string=$string."</tr>\n";
+ $string=$string."</tr>\n"; # FIXME - .=
return($string);
}
sub mkform{
my ($action,%inputs)=@_;
my $string="<form action=$action method=post>\n";
- $string=$string.mktablehdr();
+ $string=$string.mktablehdr(); # FIXME - .=
my $key;
my @keys=sort keys %inputs;
#my $posn = shift(@data);
if ($data[0] eq 'hidden'){
$string=$string."<input type=hidden name=$keys[$i2] value=\"$data[1]\">\n";
+ # FIXME - .=
} else {
my $text;
if ($data[0] eq 'radio') {
my $i=1;
while ($data[$i] ne "") {
my $val = $data[$i+1];
- $text = $text."<option value=$data[$i]>$val";
- $i = $i+2;
+ $text = $text."<option value=$data[$i]>$val"; # FIXME - .=
+ $i = $i+2; # FIXME - +=
}
$text=$text."</select>";
+ # FIXME - .=
}
- $string=$string.mktablerow(2,'white',$keys[$i2],$text);
+ $string=$string.mktablerow(2,'white',$keys[$i2],$text); # FIXME - .=
#@order[$posn] =mktablerow(2,'white',$keys[$i2],$text);
}
$i2++;
}
#$string=$string.join("\n",@order);
$string=$string.mktablerow(2,'white','<input type=submit>','<input type=reset>');
- $string=$string.mktableft;
- $string=$string."</form>";
+ # FIXME - .=
+ $string=$string.mktableft; # FIXME - .=
+ $string=$string."</form>"; # FIXME - .=
}
=item mkform3
my $i=1;
while ($data[$i] ne "") {
my $val = $data[$i+1];
- $text = $text."<option value=$data[$i]>$val";
+ $text = $text."<option value=$data[$i]>$val"; # FIXME - .=
$i = $i+2; # FIXME - Use $i += 2.
}
- $text=$text."</select>";
+ $text=$text."</select>"; # FIXME - .=
}
# $string=$string.mktablerow(2,'white',$keys[$i2],$text);
$order[$posn]=mktablerow(2,'white',$keys[$i2],$text);
$i2++;
}
my $temp=join("\n",@order);
- # FIXME - Use ".=". That's what it's for.
- $string=$string.$temp;
- $string=$string.mktablerow(1,'white','<input type=submit>');
- $string=$string.mktableft;
- $string=$string."</form>";
+ $string=$string.$temp; # FIXME - .=
+ $string=$string.mktablerow(1,'white','<input type=submit>'); # FIXME - .=
+ $string=$string.mktableft; # FIXME - .=
+ $string=$string."</form>"; # FIXME - .=
# FIXME - A return statement, while not strictly necessary, would be nice.
}
for (my $i=0; $i<$count; $i++){
if ($inputs[$i][0] eq 'hidden'){
$string=$string."<input type=hidden name=$inputs[$i][1] value=\"$inputs[$i][2]\">\n";
+ # FIXME - .=
}
if ($inputs[$i][0] eq 'radio') {
$string.="<input type=radio name=$inputs[1] value=$inputs[$i][2]>$inputs[$i][2]";
+ # FIXME - .=
}
if ($inputs[$i][0] eq 'text') {
$string.="<input type=$inputs[$i][0] name=$inputs[$i][1] value=\"$inputs[$i][2]\">";
+ # FIXME - .=
}
if ($inputs[$i][0] eq 'textarea') {
$string.="<textarea name=$inputs[$i][1] wrap=physical cols=40 rows=4>$inputs[$i][2]</textarea>";
+ # FIXME - .=
}
if ($inputs[$i][0] eq 'reset'){
$string.="<input type=reset name=$inputs[$i][1] value=\"$inputs[$i][2]\">";
+ # FIXME - .=
}
if ($inputs[$i][0] eq 'submit'){
$string.="<input type=submit name=$inputs[$i][1] value=\"$inputs[$i][2]\">";
+ # FIXME - .=
}
}
- $string=$string."</form>";
+ $string=$string."</form>"; # FIXME - .=
}
=item mkform2
#'
sub mkform2{
# FIXME
- # no POD and no tests yet. Once tests are written,
+ # No tests yet. Once tests are written,
# this function can be cleaned up with the following steps:
# turn the while loop into a foreach loop
# pull the nested if,elsif structure back up to the main level
# functions
my ($action,%inputs)=@_;
my $string="<form action=$action method=post>\n";
- $string=$string.mktablehdr();
+ $string=$string.mktablehdr(); # FIXME - .=
my $key;
my @order;
while ( my ($key, $value) = each %inputs) {
my $ltext = shift(@data);
if ($data[0] eq 'hidden'){
$string=$string."<input type=hidden name=$key value=\"$data[1]\">\n";
+ # FIXME - .=
} else {
my $text;
if ($data[0] eq 'radio') {
my $i=2;
while ($data[$i] ne "") {
my $val = $data[$i+1];
- $text = $text."<option value=\"$data[$i]\"";
+ $text = $text."<option value=\"$data[$i]\""; # FIXME - .=
if ($data[$i] eq $sel) {
- $text = $text." selected";
+ $text = $text." selected"; # FIXME - .=
}
- $text = $text.">$val";
- $i = $i+2;
+ $text = $text.">$val"; # FIXME - .=
+ $i = $i+2; # FIXME - +=
}
- $text=$text."</select>";
+ $text=$text."</select>"; # FIXME - .=
}
if ($reqd eq "R") {
- $ltext = $ltext." (Req)";
+ $ltext = $ltext." (Req)"; # FIXME - .=
}
$order[$posn] =mktablerow(2,'white',$ltext,$text);
}
}
- $string=$string.join("\n",@order);
+ $string=$string.join("\n",@order); # FIXME - .=
$string=$string.mktablerow(2,'white','<input type=submit>','<input type=reset>');
- $string=$string.mktableft;
- $string=$string."</form>";
+ # FIXME - .=
+ $string=$string.mktableft; # FIXME - .=
+ $string=$string."</form>"; # FIXME - .=
}
=item endpage
(((title like '$key[0]%' or title like '% $key[0]%')";
while ($i < $count){
$query=$query." and (title like '$key[$i]%' or title like '% $key[$i]%')";
+ # FIXME - .=
$i++;
}
$query.= ") or ((subtitle like '$key[0]%' or subtitle like '% $key[0]%')";
seriestitle like 'new zealand%' or seriestitle like '% new zealand %'
or seriestitle like '% new zealand')"
}
- $query=$query."))";
+ $query=$query."))"; # FIXME - .=
if ($search->{'class'} ne ''){
my @temp=split(/\|/,$search->{'class'});
my $count=@temp;
biblio.author like '$key[$i]%' or biblio.author like '% $key[$i]%' or
additionalauthors.author like '$key[$i]%' or additionalauthors.author like '% $key[$i]%'
)";
+ # FIXME - .= <<EOT
$i++;
}
- $query=$query.")";
+ $query=$query.")"; # FIXME - .=
if ($search->{'title'} ne ''){
my @key=split(' ',$search->{'title'});
my $count=@key;
$query.= " and (((title like '$key[0]%' or title like '% $key[0]%' or title like '% $key[0]')";
while ($i<$count){
$query=$query." and (title like '$key[$i]%' or title like '% $key[$i]%' or title like '% $key[$i]')";
+ # FIXME - .=
$i++;
}
# $query.=") or ((subtitle like '$key[0]%' or subtitle like '% $key[0] %' or subtitle like '% $key[0]')";
for ($i=1;$i<$count;$i++){
$query.=" and (unititle like '$key[$i]%' or unititle like '% $key[$i]%')";
}
- $query=$query."))";
+ $query=$query."))"; # FIXME - .=
#$query=$query. " and (title like '%$search->{'title'}%'
#or seriestitle like '%$search->{'title'}%')";
}
(((title like '$key[0]%' or title like '% $key[0]%' or title like '% $key[0]')";
while ($i<$count){
$query=$query." and (title like '$key[$i]%' or title like '% $key[$i]%' or title like '% $key[$i]')";
+ # FIXME - .=
$i++;
}
$query.=") or ((subtitle like '$key[0]%' or subtitle like '% $key[0]%' or subtitle like '% $key[0]')";
for ($i=1;$i<$count;$i++){
$query.=" and (unititle like '$key[$i]%' or unititle like '% $key[$i]%')";
}
- $query=$query."))";
+ $query=$query."))"; # FIXME - .=
}
if ($search->{'abstract'} ne ''){
$query.= " and (abstract like '%$search->{'abstract'}%')";
$query=$query." where
items.biblionumber=biblio.biblionumber
and barcode='$search2'";
+ # FIXME - .= <<EOT;
}
if ($search->{'isbn'} ne ''){
my $search2=uc $search->{'isbn'};
#print $query;
if ($type ne 'precise' && $type ne 'subject'){
if ($search->{'author'} ne ''){
- $query=$query." order by biblio.author,title";
+ $query=$query." order by biblio.author,title"; # FIXME - .=
} else {
- $query=$query." order by title";
+ $query=$query." order by title"; # FIXME - .=
}
} else {
if ($type eq 'subject'){
- $query=$query." order by subject";
+ $query=$query." order by subject"; # FIXME - .=
}
}
#print STDERR "$query\n";
$dewey='';
}
$dewey=~ s/\.$//;
- $class = $class.$dewey;
+ $class = $class.$dewey; # FIXME - .=
if ($dewey ne ''){
- $class = $class.$data->{'subclass'};
+ $class = $class.$data->{'subclass'}; # FIXME - .=
}
# $results[$i]="$data->{'title'}\t$data->{'barcode'}\t$datedue\t$data->{'branchname'}\t$data->{'dewey'}";
# FIXME - If $data->{'datelastseen'} is NULL, perhaps it'd be prettier
my $dewey = $data->{'dewey'};
$dewey =~ s/0+$//;
my $line = $data->{'biblioitemnumber'}."\t".$data->{'itemtype'};
- $line = $line."\t$data->{'classification'}\t$dewey";
- $line = $line."\t$data->{'subclass'}\t$data->{isbn}";
- $line = $line."\t$data->{'volume'}\t$data->{number}";
+ $line = $line."\t$data->{'classification'}\t$dewey"; # FIXME - .=
+ $line = $line."\t$data->{'subclass'}\t$data->{isbn}"; # FIXME - .=
+ $line = $line."\t$data->{'volume'}\t$data->{number}"; # FIXME - .=
my $isth= $dbh->prepare("select * from items where biblioitemnumber = $data->{'biblioitemnumber'}");
$isth->execute;
while (my $idata = $isth->fetchrow_hashref) {
my $iline = $idata->{'barcode'}."[".$idata->{'holdingbranch'}."[";
if ($idata->{'notforloan'} == 1) {
- $iline = $iline."NFL ";
+ $iline = $iline."NFL "; # FIXME - .=
}
if ($idata->{'itemlost'} == 1) {
- $iline = $iline."LOST ";
+ $iline = $iline."LOST "; # FIXME - .=
}
- $line = $line."\t$iline";
+ $line = $line."\t$iline"; # FIXME - .=
}
$isth->finish;
$results[$i] = $line;
$query=$query." and (surname like \"$data[$i]%\" or surname like \"% $data[$i]%\"
or firstname like \"$data[$i]%\" or firstname like \"% $data[$i]%\"
or othernames like \"$data[$i]%\" or othernames like \"% $data[$i]%\")";
+ # FIXME - .= <<EOT;
}
$query=$query.") or cardnumber = \"$searchstring\"
order by surname,firstname";
+ # FIXME - .= <<EOT;
# print $query,"\n";
my $sth=$dbh->prepare($query);
$sth->execute;
# }
$acctlines[$numlines] = $data;
$numlines++;
- $total = $total+ $data->{'amountoutstanding'};
+ $total = $total+ $data->{'amountoutstanding'}; # FIXME - +=
}
$sth->finish;
return ($numlines,\@acctlines,$total);