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 133-138
elsif ( $op eq 'add_validate' ) {
Link Here
|
133 |
); |
138 |
); |
134 |
$updated = $additional_content->_result->get_dirty_columns; |
139 |
$updated = $additional_content->_result->get_dirty_columns; |
135 |
$additional_content->store; |
140 |
$additional_content->store; |
|
|
141 |
$id = $additional_content->idnew; |
136 |
}; |
142 |
}; |
137 |
if ($@) { |
143 |
if ($@) { |
138 |
$success = 0; |
144 |
$success = 0; |
Lines 167-172
elsif ( $op eq 'add_validate' ) {
Link Here
|
167 |
? 'News_' . $additional_content->idnew |
173 |
? 'News_' . $additional_content->idnew |
168 |
: $location . '_' . $additional_content->idnew; |
174 |
: $location . '_' . $additional_content->idnew; |
169 |
$additional_content->code($code)->store; |
175 |
$additional_content->code($code)->store; |
|
|
176 |
$id = $additional_content->idnew; |
170 |
} |
177 |
} |
171 |
}; |
178 |
}; |
172 |
if ($@) { |
179 |
if ($@) { |
Lines 180-186
elsif ( $op eq 'add_validate' ) {
Link Here
|
180 |
} |
187 |
} |
181 |
|
188 |
|
182 |
} |
189 |
} |
183 |
$op = 'list'; |
190 |
|
|
|
191 |
if( $redirect eq "just_save" ){ |
192 |
print $cgi->redirect("/cgi-bin/koha/tools/additional-contents.pl?op=add_form&id=$id&editmode=$editmode&redirect=done"); |
193 |
exit; |
194 |
} else { |
195 |
$op = 'list'; |
196 |
} |
184 |
} |
197 |
} |
185 |
elsif ( $op eq 'delete_confirmed' ) { |
198 |
elsif ( $op eq 'delete_confirmed' ) { |
186 |
my @ids = $cgi->multi_param('ids'); |
199 |
my @ids = $cgi->multi_param('ids'); |
Lines 249-254
$template->param(
Link Here
|
249 |
op => $op, |
262 |
op => $op, |
250 |
category => $category, |
263 |
category => $category, |
251 |
wysiwyg => $wysiwyg, |
264 |
wysiwyg => $wysiwyg, |
|
|
265 |
editmode => $editmode, |
252 |
languages => \@languages, |
266 |
languages => \@languages, |
253 |
); |
267 |
); |
254 |
|
268 |
|
255 |
- |
|
|