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 184-189 Link Here
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 %]" />
186
        <input type="hidden" name="idnew" value="[% additional_content.idnew | html %]" />
192
        <input type="hidden" name="idnew" value="[% additional_content.idnew | html %]" />
193
        <input type="hidden" id="redirect" name="redirect" value="" />
194
        <input type="hidden" id="editmode" name="editmode" value="[% editmode | html %]" />
187
        <fieldset class="rows">
195
        <fieldset class="rows">
188
            <ol>
196
            <ol>
189
                <li>
197
                <li>
Lines 453-458 Link Here
453
    [% INCLUDE 'calendar.inc' %]
461
    [% INCLUDE 'calendar.inc' %]
454
    [% Asset.js("js/tools-menu.js") | $raw %]
462
    [% Asset.js("js/tools-menu.js") | $raw %]
455
    [% Asset.js("lib/hc-sticky.js") | $raw %]
463
    [% Asset.js("lib/hc-sticky.js") | $raw %]
464
    <script>
465
        $("#saveandcontinue").on("click",function(e){
466
            e.preventDefault();
467
            $("#redirect").val("just_save");
468
            $("#submit_form").click();
469
        });
470
    </script>
456
    [% IF additional_contents.count %]
471
    [% IF additional_contents.count %]
457
        [% INCLUDE 'datatables.inc' %]
472
        [% INCLUDE 'datatables.inc' %]
458
        <script>
473
        <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 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
- 

Return to bug 22659