$template->param(
itemtype => $itemtype,
description => $data->{'description'},
- renewalsallowed => $data->{'renewalsallowed'},
rentalcharge => sprintf( "%.2f", $data->{'rentalcharge'} ),
notforloan => $data->{'notforloan'},
imageurl => $data->{'imageurl'},
my $query2 = '
UPDATE itemtypes
SET description = ?
- , renewalsallowed = ?
, rentalcharge = ?
, notforloan = ?
, imageurl = ?
$sth = $dbh->prepare($query2);
$sth->execute(
$input->param('description'),
- $input->param('renewalsallowed'),
$input->param('rentalcharge'),
( $input->param('notforloan') ? 1 : 0 ),
(
else { # add a new itemtype & not modif an old
my $query = "
INSERT INTO itemtypes
- (itemtype,description,renewalsallowed,rentalcharge, notforloan, imageurl,summary)
+ (itemtype,description,rentalcharge, notforloan, imageurl,summary)
VALUES
- (?,?,?,?,?,?,?);
+ (?,?,?,?,?,?);
";
my $sth = $dbh->prepare($query);
my $image = $input->param('image');
$sth->execute(
$input->param('itemtype'),
$input->param('description'),
- $input->param('renewalsallowed'),
$input->param('rentalcharge'),
$input->param('notforloan') ? 1 : 0,
$image eq 'removeImage' ? '' :
my $sth =
$dbh->prepare(
-"select itemtype,description,renewalsallowed,rentalcharge from itemtypes where itemtype=?"
+"select itemtype,description,rentalcharge from itemtypes where itemtype=?"
);
$sth->execute($itemtype);
my $data = $sth->fetchrow_hashref;
$template->param(
itemtype => $itemtype,
description => $data->{description},
- renewalsallowed => $data->{renewalsallowed},
rentalcharge => sprintf( "%.2f", $data->{rentalcharge} ),
imageurl => $data->{imageurl},
total => $total
(if checked, no item of this type can be issued. If not checked, every item of this type can be issued unless notforloan is set for a specific item)
</li>
- <li>
- <label for="renewalsallowed">Renewals: </label>
- <input type="text" id="renewalsallowed" name="renewalsallowed" size="3" maxlength="3" value="<!-- TMPL_VAR NAME="renewalsallowed" -->" />
- </li>
<li>
<label for="rentalcharge">Rental charge: </label>
<input type="text" id="rentalcharge" name="rentalcharge" size="10" value="<!-- TMPL_VAR name="rentalcharge" -->" />
<tr><th scope="row">Description</th><td><!-- TMPL_VAR name="description" --></td></tr>
<tr><th scope="row">Loan length</th><td><!-- TMPL_VAR name="loanlength" --></td></tr>
- <tr><th scope="row">Renewals</th><td><!-- TMPL_IF name="renewalsallowed" -->Allowed<!-- TMPL_ELSE -->Not allowed<!-- /TMPL_IF --></td></tr>
<tr><th scope="row">Rental charge</th><td><!-- TMPL_VAR name="rentalcharge" --></td></tr></table>
<form action="<!-- TMPL_VAR name="script_name" -->" method="post">
<input type="hidden" name="op" value="delete_confirmed" /><input type="hidden" name="itemtype" value="<!-- TMPL_VAR name="itemtype" -->" /><!-- TMPL_IF name="total" -->
<th>Code</th>
<th>Description</th>
<th>Not for loan</th>
- <th>Renewable</th>
<th>Charge</th>
<th>Actions</th>
</tr>
<td><!-- TMPL_VAR name="description" --></td>
<td><!-- TMPL_IF NAME="notforloan" -->Yes<!-- TMPL_ELSE --> <!-- /TMPL_IF --></td>
<td>
- <!-- TMPL_IF NAME="renewalsallowed" -->
- <!-- TMPL_VAR name="renewalsallowed" --> times
- <!-- TMPL_ELSE -->
- No
- <!-- /TMPL_IF -->
- </td>
- <td>
<!-- TMPL_UNLESS name="notforloan" -->
<!-- TMPL_VAR NAME="rentalcharge" -->
<!-- /TMPL_UNLESS -->