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 171-176 Link Here
171
    <div id="toolbar" class="btn-toolbar">
171
    <div id="toolbar" class="btn-toolbar">
172
        <div class="btn-group">
172
        <div class="btn-group">
173
            <button class="btn btn-default" id="submit_form"><i class="fa fa-save"></i> Save</button>
173
            <button class="btn btn-default" id="submit_form"><i class="fa fa-save"></i> Save</button>
174
            <button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
175
            <span class="caret"></span>
176
            </button>
177
            <ul class="dropdown-menu">
178
                <li><a id="saveandcontinue" href="#">Save and continue editing</a></li>
179
            </ul>
174
        </div>
180
        </div>
175
        [% IF category == 'news' %]
181
        [% IF category == 'news' %]
176
            <a class="btn btn-default cancel" href="/cgi-bin/koha/tools/additional-contents.pl"><i class="fa fa-remove"></i> Cancel</a>
182
            <a class="btn btn-default cancel" href="/cgi-bin/koha/tools/additional-contents.pl"><i class="fa fa-remove"></i> Cancel</a>
Lines 183-188 Link Here
183
        <input type="hidden" name="op" value="add_validate" />
189
        <input type="hidden" name="op" value="add_validate" />
184
        <input type="hidden" name="category" value="[% category | html %]" />
190
        <input type="hidden" name="category" value="[% category | html %]" />
185
        <input type="hidden" name="code" value="[% additional_content.code | html %]" />
191
        <input type="hidden" name="code" value="[% additional_content.code | html %]" />
192
        <input type="hidden" id="redirect" name="redirect" value="" />
193
        <input type="hidden" id="editmode" name="editmode" value="[% editmode | html %]" />
186
        <fieldset class="rows">
194
        <fieldset class="rows">
187
            <ol>
195
            <ol>
188
                <li>
196
                <li>
Lines 452-457 Link Here
452
    [% INCLUDE 'calendar.inc' %]
460
    [% INCLUDE 'calendar.inc' %]
453
    [% Asset.js("js/tools-menu.js") | $raw %]
461
    [% Asset.js("js/tools-menu.js") | $raw %]
454
    [% Asset.js("lib/hc-sticky.js") | $raw %]
462
    [% Asset.js("lib/hc-sticky.js") | $raw %]
463
    <script>
464
        $("#saveandcontinue").on("click",function(e){
465
            e.preventDefault();
466
            $("#redirect").val("just_save");
467
            $("#submit_form").click();
468
        });
469
    </script>
455
    [% IF additional_contents.count %]
470
    [% IF additional_contents.count %]
456
        [% INCLUDE 'datatables.inc' %]
471
        [% INCLUDE 'datatables.inc' %]
457
        <script>
472
        <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