Lines 40-51
my $op = $cgi->param('op') || 'list';
Link Here
|
40 |
my $id = $cgi->param('id'); |
40 |
my $id = $cgi->param('id'); |
41 |
my $category = $cgi->param('category') || 'news'; |
41 |
my $category = $cgi->param('category') || 'news'; |
42 |
my $wysiwyg; |
42 |
my $wysiwyg; |
|
|
43 |
my $redirect = $cgi->param('redirect'); |
44 |
my $editmode; |
45 |
|
43 |
if( $cgi->param('editmode') ){ |
46 |
if( $cgi->param('editmode') ){ |
44 |
$wysiwyg = $cgi->param('editmode') eq "wysiwyg" ? 1 : 0; |
47 |
$wysiwyg = $cgi->param('editmode') eq "wysiwyg" ? 1 : 0; |
45 |
} else { |
48 |
} else { |
46 |
$wysiwyg = C4::Context->preference("AdditionalContentsEditor") eq "tinymce" ? 1 : 0; |
49 |
$wysiwyg = C4::Context->preference("AdditionalContentsEditor") eq "tinymce" ? 1 : 0; |
47 |
} |
50 |
} |
48 |
|
51 |
|
|
|
52 |
$editmode = $wysiwyg eq 1 ? "wysiwyg" : "text"; |
53 |
|
49 |
my ( $template, $borrowernumber, $cookie ) = get_template_and_user( |
54 |
my ( $template, $borrowernumber, $cookie ) = get_template_and_user( |
50 |
{ |
55 |
{ |
51 |
template_name => "tools/additional-contents.tt", |
56 |
template_name => "tools/additional-contents.tt", |
Lines 136-141
elsif ( $op eq 'add_validate' ) {
Link Here
|
136 |
); |
141 |
); |
137 |
$updated = $additional_content->_result->get_dirty_columns; |
142 |
$updated = $additional_content->_result->get_dirty_columns; |
138 |
$additional_content->store; |
143 |
$additional_content->store; |
|
|
144 |
$id = $additional_content->idnew; |
139 |
}; |
145 |
}; |
140 |
if ($@) { |
146 |
if ($@) { |
141 |
$success = 0; |
147 |
$success = 0; |
Lines 170-175
elsif ( $op eq 'add_validate' ) {
Link Here
|
170 |
? 'News_' . $additional_content->idnew |
176 |
? 'News_' . $additional_content->idnew |
171 |
: $location . '_' . $additional_content->idnew; |
177 |
: $location . '_' . $additional_content->idnew; |
172 |
$additional_content->code($code)->store; |
178 |
$additional_content->code($code)->store; |
|
|
179 |
$id = $additional_content->idnew; |
173 |
} |
180 |
} |
174 |
}; |
181 |
}; |
175 |
if ($@) { |
182 |
if ($@) { |
Lines 183-189
elsif ( $op eq 'add_validate' ) {
Link Here
|
183 |
} |
190 |
} |
184 |
|
191 |
|
185 |
} |
192 |
} |
186 |
$op = 'list'; |
193 |
|
|
|
194 |
if( $redirect eq "just_save" ){ |
195 |
print $cgi->redirect("/cgi-bin/koha/tools/additional-contents.pl?op=add_form&id=$id&editmode=$editmode&redirect=done"); |
196 |
exit; |
197 |
} else { |
198 |
$op = 'list'; |
199 |
} |
187 |
} |
200 |
} |
188 |
elsif ( $op eq 'delete_confirmed' ) { |
201 |
elsif ( $op eq 'delete_confirmed' ) { |
189 |
my @ids = $cgi->multi_param('ids'); |
202 |
my @ids = $cgi->multi_param('ids'); |
Lines 252-257
$template->param(
Link Here
|
252 |
op => $op, |
265 |
op => $op, |
253 |
category => $category, |
266 |
category => $category, |
254 |
wysiwyg => $wysiwyg, |
267 |
wysiwyg => $wysiwyg, |
|
|
268 |
editmode => $editmode, |
255 |
languages => \@languages, |
269 |
languages => \@languages, |
256 |
); |
270 |
); |
257 |
|
271 |
|
258 |
- |
|
|