Lines 44-62
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
Link Here
|
44 |
|
44 |
|
45 |
my $dbh = C4::Context->dbh; |
45 |
my $dbh = C4::Context->dbh; |
46 |
if ( $op eq 'add_form' ) { |
46 |
if ( $op eq 'add_form' ) { |
|
|
47 |
my $frameworks = Koha::BiblioFrameworks->search( {}, { order_by => ['frameworktext'], } ); |
47 |
my $framework; |
48 |
my $framework; |
48 |
if ($frameworkcode) { |
49 |
if ($frameworkcode) { |
49 |
$framework = Koha::BiblioFrameworks->find($frameworkcode); |
50 |
$framework = Koha::BiblioFrameworks->find($frameworkcode); |
50 |
} |
51 |
} |
51 |
$template->param( framework => $framework ); |
52 |
$template->param( |
|
|
53 |
framework => $framework, |
54 |
frameworks => $frameworks |
55 |
); |
52 |
} elsif ( $op eq 'add_validate' ) { |
56 |
} elsif ( $op eq 'add_validate' ) { |
53 |
my $frameworkcode = $input->param('frameworkcode'); |
57 |
my $frameworkcode = $input->param('frameworkcode'); |
54 |
my $frameworktext = $input->param('frameworktext'); |
58 |
my $frameworktext = $input->param('frameworktext'); |
55 |
my $is_a_modif = $input->param('is_a_modif'); |
59 |
my $is_a_modif = $input->param('is_a_modif'); |
|
|
60 |
my $parent_frameworkcode = $input->param('parent_frameworkcode'); |
61 |
$parent_frameworkcode = undef if $input->param('parent_frameworkcode') eq '__undef__'; |
56 |
|
62 |
|
57 |
if ($is_a_modif) { |
63 |
if ($is_a_modif) { |
58 |
my $framework = Koha::BiblioFrameworks->find($frameworkcode); |
64 |
my $framework = Koha::BiblioFrameworks->find($frameworkcode); |
59 |
$framework->frameworktext($frameworktext); |
65 |
$framework->frameworktext($frameworktext); |
|
|
66 |
$framework->parent_frameworkcode($parent_frameworkcode); |
60 |
eval { $framework->store; }; |
67 |
eval { $framework->store; }; |
61 |
if ($@) { |
68 |
if ($@) { |
62 |
push @messages, { type => 'error', code => 'error_on_update' }; |
69 |
push @messages, { type => 'error', code => 'error_on_update' }; |
Lines 67-72
if ( $op eq 'add_form' ) {
Link Here
|
67 |
my $framework = Koha::BiblioFramework->new( |
74 |
my $framework = Koha::BiblioFramework->new( |
68 |
{ frameworkcode => $frameworkcode, |
75 |
{ frameworkcode => $frameworkcode, |
69 |
frameworktext => $frameworktext, |
76 |
frameworktext => $frameworktext, |
|
|
77 |
parent_frameworkcode => $parent_frameworkcode, |
70 |
} |
78 |
} |
71 |
); |
79 |
); |
72 |
eval { $framework->store; }; |
80 |
eval { $framework->store; }; |