Lines 71-81
if ( $op eq 'add_form' ) {
Link Here
|
71 |
}; |
71 |
}; |
72 |
} |
72 |
} |
73 |
|
73 |
|
|
|
74 |
my $parent_type = $itemtype ? $itemtype->parent_type : undef; |
75 |
my $parent_types = Koha::ItemTypes->search({parent_type=>undef,itemtype => {'!='=>$itemtype_code}}); |
74 |
my $imagesets = C4::Koha::getImageSets( checked => ( $itemtype ? $itemtype->imageurl : undef ) ); |
76 |
my $imagesets = C4::Koha::getImageSets( checked => ( $itemtype ? $itemtype->imageurl : undef ) ); |
75 |
my $searchcategory = GetAuthorisedValues("ITEMTYPECAT"); |
77 |
my $searchcategory = GetAuthorisedValues("ITEMTYPECAT"); |
76 |
my $translated_languages = C4::Languages::getTranslatedLanguages( undef , C4::Context->preference('template') ); |
78 |
my $translated_languages = C4::Languages::getTranslatedLanguages( undef , C4::Context->preference('template') ); |
77 |
$template->param( |
79 |
$template->param( |
78 |
itemtype => $itemtype, |
80 |
itemtype => $itemtype, |
|
|
81 |
parent_type => $parent_type, |
82 |
parent_types => $parent_types, |
83 |
is_a_parent => $itemtype ? Koha::ItemTypes->search({parent_type=>$itemtype_code})->count : 0, |
79 |
imagesets => $imagesets, |
84 |
imagesets => $imagesets, |
80 |
searchcategory => $searchcategory, |
85 |
searchcategory => $searchcategory, |
81 |
can_be_translated => ( scalar(@$translated_languages) > 1 ? 1 : 0 ), |
86 |
can_be_translated => ( scalar(@$translated_languages) > 1 ? 1 : 0 ), |
Lines 84-89
if ( $op eq 'add_form' ) {
Link Here
|
84 |
} elsif ( $op eq 'add_validate' ) { |
89 |
} elsif ( $op eq 'add_validate' ) { |
85 |
my $is_a_modif = $input->param('is_a_modif'); |
90 |
my $is_a_modif = $input->param('is_a_modif'); |
86 |
my $itemtype = Koha::ItemTypes->find($itemtype_code); |
91 |
my $itemtype = Koha::ItemTypes->find($itemtype_code); |
|
|
92 |
my $parent_type = $input->param('parent_type'); |
87 |
my $description = $input->param('description'); |
93 |
my $description = $input->param('description'); |
88 |
my $rentalcharge = $input->param('rentalcharge'); |
94 |
my $rentalcharge = $input->param('rentalcharge'); |
89 |
my $rentalcharge_daily = $input->param('rentalcharge_daily'); |
95 |
my $rentalcharge_daily = $input->param('rentalcharge_daily'); |
Lines 108-113
if ( $op eq 'add_form' ) {
Link Here
|
108 |
|
114 |
|
109 |
if ( $itemtype and $is_a_modif ) { # it's a modification |
115 |
if ( $itemtype and $is_a_modif ) { # it's a modification |
110 |
$itemtype->description($description); |
116 |
$itemtype->description($description); |
|
|
117 |
$itemtype->parent_type($parent_type); |
111 |
$itemtype->rentalcharge($rentalcharge); |
118 |
$itemtype->rentalcharge($rentalcharge); |
112 |
$itemtype->rentalcharge_daily($rentalcharge_daily); |
119 |
$itemtype->rentalcharge_daily($rentalcharge_daily); |
113 |
$itemtype->rentalcharge_hourly($rentalcharge_hourly); |
120 |
$itemtype->rentalcharge_hourly($rentalcharge_hourly); |
Lines 137-142
if ( $op eq 'add_form' ) {
Link Here
|
137 |
{ |
144 |
{ |
138 |
itemtype => $itemtype_code, |
145 |
itemtype => $itemtype_code, |
139 |
description => $description, |
146 |
description => $description, |
|
|
147 |
parent_type => $parent_type, |
140 |
rentalcharge => $rentalcharge, |
148 |
rentalcharge => $rentalcharge, |
141 |
rentalcharge_daily => $rentalcharge_daily, |
149 |
rentalcharge_daily => $rentalcharge_daily, |
142 |
rentalcharge_hourly => $rentalcharge_hourly, |
150 |
rentalcharge_hourly => $rentalcharge_hourly, |