View | Details | Raw Unified | Return to bug 22659
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt (+15 lines)
Lines 166-171 Link Here
166
    <div id="toolbar" class="btn-toolbar">
166
    <div id="toolbar" class="btn-toolbar">
167
        <div class="btn-group">
167
        <div class="btn-group">
168
            <button class="btn btn-default" id="submit_form"><i class="fa fa-save"></i> Save</button>
168
            <button class="btn btn-default" id="submit_form"><i class="fa fa-save"></i> Save</button>
169
            <button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
170
            <span class="caret"></span>
171
            </button>
172
            <ul class="dropdown-menu">
173
                <li><a id="saveandcontinue" href="#">Save and continue editing</a></li>
174
            </ul>
169
        </div>
175
        </div>
170
        [% IF category == 'news' %]
176
        [% IF category == 'news' %]
171
            <a class="btn btn-default cancel" href="/cgi-bin/koha/tools/additional-contents.pl"><i class="fa fa-remove"></i> Cancel</a>
177
            <a class="btn btn-default cancel" href="/cgi-bin/koha/tools/additional-contents.pl"><i class="fa fa-remove"></i> Cancel</a>
Lines 178-183 Link Here
178
        <input type="hidden" name="op" value="add_validate" />
184
        <input type="hidden" name="op" value="add_validate" />
179
        <input type="hidden" name="category" value="[% category | html %]" />
185
        <input type="hidden" name="category" value="[% category | html %]" />
180
        <input type="hidden" name="code" value="[% additional_content.code | html %]" />
186
        <input type="hidden" name="code" value="[% additional_content.code | html %]" />
187
        <input type="hidden" id="redirect" name="redirect" value="" />
188
        <input type="hidden" id="editmode" name="editmode" value="[% editmode | html %]" />
181
        <fieldset class="rows">
189
        <fieldset class="rows">
182
            <ol>
190
            <ol>
183
                <li>
191
                <li>
Lines 438-443 Link Here
438
    [% INCLUDE 'calendar.inc' %]
446
    [% INCLUDE 'calendar.inc' %]
439
    [% Asset.js("js/tools-menu.js") | $raw %]
447
    [% Asset.js("js/tools-menu.js") | $raw %]
440
    [% Asset.js("lib/hc-sticky.js") | $raw %]
448
    [% Asset.js("lib/hc-sticky.js") | $raw %]
449
    <script>
450
        $("#saveandcontinue").on("click",function(e){
451
            e.preventDefault();
452
            $("#redirect").val("just_save");
453
            $("#submit_form").click();
454
        });
455
    </script>
441
    [% IF additional_contents.count %]
456
    [% IF additional_contents.count %]
442
        [% INCLUDE 'datatables.inc' %]
457
        [% INCLUDE 'datatables.inc' %]
443
        <script>
458
        <script>
(-)a/tools/additional-contents.pl (-2 / +15 lines)
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
- 

Return to bug 22659