[Koha-patches] [PATCH] Revert "(bug #3801) fix itemtype administration"
Nahuel ANGELINETTI
nahuel.angelinetti at biblibre.com
Tue Dec 29 15:19:57 CET 2009
This reverts commit 0dca25841d90cfb86080bbce37f0a0f8c09904ae.
---
admin/itemtypes.pl | 11 ++++++++---
.../prog/en/modules/admin/itemtypes.tmpl | 13 +++++++++++++
2 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/admin/itemtypes.pl b/admin/itemtypes.pl
index 4e6fc5f..9f0395c 100755
--- a/admin/itemtypes.pl
+++ b/admin/itemtypes.pl
@@ -112,6 +112,7 @@ if ( $op eq 'add_form' ) {
$template->param(
itemtype => $itemtype,
description => $data->{'description'},
+ renewalsallowed => $data->{'renewalsallowed'},
rentalcharge => sprintf( "%.2f", $data->{'rentalcharge'} ),
notforloan => $data->{'notforloan'},
imageurl => $data->{'imageurl'},
@@ -137,6 +138,7 @@ elsif ( $op eq 'add_validate' ) {
my $query2 = '
UPDATE itemtypes
SET description = ?
+ , renewalsallowed = ?
, rentalcharge = ?
, notforloan = ?
, imageurl = ?
@@ -146,6 +148,7 @@ elsif ( $op eq 'add_validate' ) {
$sth = $dbh->prepare($query2);
$sth->execute(
$input->param('description'),
+ $input->param('renewalsallowed'),
$input->param('rentalcharge'),
( $input->param('notforloan') ? 1 : 0 ),
(
@@ -162,15 +165,16 @@ elsif ( $op eq 'add_validate' ) {
else { # add a new itemtype & not modif an old
my $query = "
INSERT INTO itemtypes
- (itemtype,description,rentalcharge, notforloan, imageurl,summary)
+ (itemtype,description,renewalsallowed,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' ? '' :
@@ -200,13 +204,14 @@ elsif ( $op eq 'delete_confirm' ) {
my $sth =
$dbh->prepare(
-"select itemtype,description,rentalcharge from itemtypes where itemtype=?"
+"select itemtype,description,renewalsallowed,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
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tmpl
index 4c34695..a519c0e 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tmpl
@@ -225,6 +225,10 @@ Item Types Administration
</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" -->" />
</li>
@@ -259,6 +263,7 @@ Item Types Administration
<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" -->
@@ -280,6 +285,7 @@ Item Types Administration
<th>Code</th>
<th>Description</th>
<th>Not for loan</th>
+ <th>Renewable</th>
<th>Charge</th>
<th>Actions</th>
</tr>
@@ -298,6 +304,13 @@ Item Types Administration
<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 -->
--
1.6.3.3
More information about the Koha-patches
mailing list