|
Lines 112-121
if ( $op eq 'add_form' ) {
Link Here
|
| 112 |
$remote_image = $data->{imageurl}; |
112 |
$remote_image = $data->{imageurl}; |
| 113 |
} |
113 |
} |
| 114 |
|
114 |
|
|
|
115 |
my @gst_values = map { |
| 116 |
option => $_ + 0.0 |
| 117 |
}, split( '\|', C4::Context->preference("gist") ); |
| 118 |
|
| 119 |
|
| 115 |
$template->param( |
120 |
$template->param( |
| 116 |
itemtype => $itemtype, |
121 |
itemtype => $itemtype, |
| 117 |
description => $data->{'description'}, |
122 |
description => $data->{'description'}, |
| 118 |
rentalcharge => sprintf( "%.2f", $data->{'rentalcharge'} ), |
123 |
rentalcharge => sprintf( "%.2f", $data->{'rentalcharge'} ), |
|
|
124 |
gstrate => $data->{gstrate} ? $data->{gstrate}+0.0 : undef, |
| 125 |
gst_values => \@gst_values, |
| 119 |
notforloan => $data->{'notforloan'}, |
126 |
notforloan => $data->{'notforloan'}, |
| 120 |
imageurl => $data->{'imageurl'}, |
127 |
imageurl => $data->{'imageurl'}, |
| 121 |
template => C4::Context->preference('template'), |
128 |
template => C4::Context->preference('template'), |
|
Lines 144-149
elsif ( $op eq 'add_validate' ) {
Link Here
|
| 144 |
UPDATE itemtypes |
151 |
UPDATE itemtypes |
| 145 |
SET description = ? |
152 |
SET description = ? |
| 146 |
, rentalcharge = ? |
153 |
, rentalcharge = ? |
|
|
154 |
, gstrate = ? |
| 147 |
, notforloan = ? |
155 |
, notforloan = ? |
| 148 |
, imageurl = ? |
156 |
, imageurl = ? |
| 149 |
, summary = ? |
157 |
, summary = ? |
|
Lines 156-161
elsif ( $op eq 'add_validate' ) {
Link Here
|
| 156 |
$sth->execute( |
164 |
$sth->execute( |
| 157 |
$input->param('description'), |
165 |
$input->param('description'), |
| 158 |
$input->param('rentalcharge'), |
166 |
$input->param('rentalcharge'), |
|
|
167 |
$input->param('gstrate'), |
| 159 |
( $input->param('notforloan') ? 1 : 0 ), |
168 |
( $input->param('notforloan') ? 1 : 0 ), |
| 160 |
( |
169 |
( |
| 161 |
$input->param('image') eq 'removeImage' ? '' : ( |
170 |
$input->param('image') eq 'removeImage' ? '' : ( |
|
Lines 174-180
elsif ( $op eq 'add_validate' ) {
Link Here
|
| 174 |
else { # add a new itemtype & not modif an old |
183 |
else { # add a new itemtype & not modif an old |
| 175 |
my $query = " |
184 |
my $query = " |
| 176 |
INSERT INTO itemtypes |
185 |
INSERT INTO itemtypes |
| 177 |
(itemtype,description,rentalcharge, notforloan, imageurl, summary, checkinmsg, checkinmsgtype, sip_media_type) |
186 |
(itemtype,description,rentalcharge, gstrate, notforloan, imageurl, summary, checkinmsg, checkinmsgtype, sip_media_type) |
| 178 |
VALUES |
187 |
VALUES |
| 179 |
(?,?,?,?,?,?,?,?,?); |
188 |
(?,?,?,?,?,?,?,?,?); |
| 180 |
"; |
189 |
"; |
|
Lines 184-189
elsif ( $op eq 'add_validate' ) {
Link Here
|
| 184 |
$input->param('itemtype'), |
193 |
$input->param('itemtype'), |
| 185 |
$input->param('description'), |
194 |
$input->param('description'), |
| 186 |
$input->param('rentalcharge'), |
195 |
$input->param('rentalcharge'), |
|
|
196 |
$input->param('gstrate'), |
| 187 |
$input->param('notforloan') ? 1 : 0, |
197 |
$input->param('notforloan') ? 1 : 0, |
| 188 |
$image eq 'removeImage' ? '' : |
198 |
$image eq 'removeImage' ? '' : |
| 189 |
$image eq 'remoteImage' ? $input->param('remoteImage') : |
199 |
$image eq 'remoteImage' ? $input->param('remoteImage') : |