Lines 58-68
undef($sip_media_type) if defined($sip_media_type) and $sip_media_type =~ /^\s*$
Link Here
|
58 |
|
58 |
|
59 |
if ( $op eq 'add_form' ) { |
59 |
if ( $op eq 'add_form' ) { |
60 |
my $itemtype = Koha::ItemTypes->find($itemtype_code); |
60 |
my $itemtype = Koha::ItemTypes->find($itemtype_code); |
|
|
61 |
my $parent_type = $itemtype ? $itemtype->parent_type : undef; |
62 |
my $parent_types = Koha::ItemTypes->search({parent_type=>undef,itemtype => {'!='=>$itemtype_code}}); |
61 |
my $imagesets = C4::Koha::getImageSets( checked => ( $itemtype ? $itemtype->imageurl : undef ) ); |
63 |
my $imagesets = C4::Koha::getImageSets( checked => ( $itemtype ? $itemtype->imageurl : undef ) ); |
62 |
my $searchcategory = GetAuthorisedValues("ITEMTYPECAT"); |
64 |
my $searchcategory = GetAuthorisedValues("ITEMTYPECAT"); |
63 |
my $translated_languages = C4::Languages::getTranslatedLanguages( undef , C4::Context->preference('template') ); |
65 |
my $translated_languages = C4::Languages::getTranslatedLanguages( undef , C4::Context->preference('template') ); |
64 |
$template->param( |
66 |
$template->param( |
65 |
itemtype => $itemtype, |
67 |
itemtype => $itemtype, |
|
|
68 |
parent_type => $parent_type, |
69 |
parent_types => $parent_types, |
70 |
is_a_parent => $itemtype ? Koha::ItemTypes->search({parent_type=>$itemtype_code})->count : 0, |
66 |
imagesets => $imagesets, |
71 |
imagesets => $imagesets, |
67 |
searchcategory => $searchcategory, |
72 |
searchcategory => $searchcategory, |
68 |
can_be_translated => ( scalar(@$translated_languages) > 1 ? 1 : 0 ), |
73 |
can_be_translated => ( scalar(@$translated_languages) > 1 ? 1 : 0 ), |
Lines 70-75
if ( $op eq 'add_form' ) {
Link Here
|
70 |
} elsif ( $op eq 'add_validate' ) { |
75 |
} elsif ( $op eq 'add_validate' ) { |
71 |
my $is_a_modif = $input->param('is_a_modif'); |
76 |
my $is_a_modif = $input->param('is_a_modif'); |
72 |
my $itemtype = Koha::ItemTypes->find($itemtype_code); |
77 |
my $itemtype = Koha::ItemTypes->find($itemtype_code); |
|
|
78 |
my $parent_type = $input->param('parent_type'); |
73 |
my $description = $input->param('description'); |
79 |
my $description = $input->param('description'); |
74 |
my $rentalcharge = $input->param('rentalcharge'); |
80 |
my $rentalcharge = $input->param('rentalcharge'); |
75 |
my $rentalcharge_daily = $input->param('rentalcharge_daily'); |
81 |
my $rentalcharge_daily = $input->param('rentalcharge_daily'); |
Lines 93-98
if ( $op eq 'add_form' ) {
Link Here
|
93 |
|
99 |
|
94 |
if ( $itemtype and $is_a_modif ) { # it's a modification |
100 |
if ( $itemtype and $is_a_modif ) { # it's a modification |
95 |
$itemtype->description($description); |
101 |
$itemtype->description($description); |
|
|
102 |
$itemtype->parent_type($parent_type); |
96 |
$itemtype->rentalcharge($rentalcharge); |
103 |
$itemtype->rentalcharge($rentalcharge); |
97 |
$itemtype->rentalcharge_daily($rentalcharge_daily); |
104 |
$itemtype->rentalcharge_daily($rentalcharge_daily); |
98 |
$itemtype->rentalcharge_hourly($rentalcharge_hourly); |
105 |
$itemtype->rentalcharge_hourly($rentalcharge_hourly); |
Lines 119-124
if ( $op eq 'add_form' ) {
Link Here
|
119 |
{ |
126 |
{ |
120 |
itemtype => $itemtype_code, |
127 |
itemtype => $itemtype_code, |
121 |
description => $description, |
128 |
description => $description, |
|
|
129 |
parent_type => $parent_type, |
122 |
rentalcharge => $rentalcharge, |
130 |
rentalcharge => $rentalcharge, |
123 |
rentalcharge_daily => $rentalcharge_daily, |
131 |
rentalcharge_daily => $rentalcharge_daily, |
124 |
rentalcharge_hourly => $rentalcharge_hourly, |
132 |
rentalcharge_hourly => $rentalcharge_hourly, |