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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt (-1 / +17 lines)
Lines 165-182 Link Here
165
    <div id="toolbar" class="btn-toolbar">
165
    <div id="toolbar" class="btn-toolbar">
166
        <div class="btn-group">
166
        <div class="btn-group">
167
            <button class="btn btn-default" id="submit_form"><i class="fa fa-save"></i> Save</button>
167
            <button class="btn btn-default" id="submit_form"><i class="fa fa-save"></i> Save</button>
168
            <button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
169
            <span class="caret"></span>
170
            </button>
171
            <ul class="dropdown-menu">
172
                <li><a id="saveandcontinue" href="#">Save and continue editing</a></li>
173
            </ul>
168
        </div>
174
        </div>
169
        [% IF category == 'news' %]
175
        [% IF category == 'news' %]
170
            <a class="btn btn-default cancel" href="/cgi-bin/koha/tools/additional-contents.pl"><i class="fa fa-remove"></i> Cancel</a>
176
            <a class="btn btn-default cancel" href="/cgi-bin/koha/tools/additional-contents.pl"><i class="fa fa-remove"></i> Cancel</a>
171
        [% ELSE %]
177
        [% ELSE %]
172
            <a class="btn btn-default cancel" href="/cgi-bin/koha/tools/additional-contents.pl?category=html_customizations"><i class="fa fa-remove"></i> Cancel</a>
178
            <a class="btn btn-default cancel" href="/cgi-bin/koha/tools/additional-contents.pl?category=html_customizations"><i class="fa fa-remove"></i> Cancel</a>
173
        [% END %]
179
        [% END %]
174
    </div>
180
    </div> <!-- /#toolbar -->
175
181
176
    <form id="add_additional_content" method="post" action="/cgi-bin/koha/tools/additional-contents.pl" class="validate">
182
    <form id="add_additional_content" method="post" action="/cgi-bin/koha/tools/additional-contents.pl" class="validate">
177
        <input type="hidden" name="op" value="add_validate" />
183
        <input type="hidden" name="op" value="add_validate" />
178
        <input type="hidden" name="id" value="[% additional_content.idnew | html %]" />
184
        <input type="hidden" name="id" value="[% additional_content.idnew | html %]" />
179
        <input type="hidden" name="category" value="[% category | html %]" />
185
        <input type="hidden" name="category" value="[% category | html %]" />
186
        <input type="hidden" id="redirect" name="redirect" value="" />
187
        <input type="hidden" id="editmode" name="editmode" value="[% editmode | html %]" />
180
        <fieldset class="rows">
188
        <fieldset class="rows">
181
            <ol>
189
            <ol>
182
                <li>
190
                <li>
Lines 439-447 Link Here
439
    [% INCLUDE 'calendar.inc' %]
447
    [% INCLUDE 'calendar.inc' %]
440
    [% Asset.js("js/tools-menu.js") | $raw %]
448
    [% Asset.js("js/tools-menu.js") | $raw %]
441
    [% Asset.js("lib/hc-sticky.js") | $raw %]
449
    [% Asset.js("lib/hc-sticky.js") | $raw %]
450
    <script>
451
        $("#saveandcontinue").on("click",function(e){
452
            e.preventDefault();
453
            $("#redirect").val("just_save");
454
            $("#submit_form").click();
455
        });
456
    </script>
442
    [% IF additional_contents.count %]
457
    [% IF additional_contents.count %]
443
        [% INCLUDE 'datatables.inc' %]
458
        [% INCLUDE 'datatables.inc' %]
444
        <script>
459
        <script>
460
445
            $('.preview_news').click( function() {
461
            $('.preview_news').click( function() {
446
                modalNumber = $(this).attr('data-number');
462
                modalNumber = $(this).attr('data-number');
447
                $('.modal[data-number="'+modalNumber+'"]').modal('show');
463
                $('.modal[data-number="'+modalNumber+'"]').modal('show');
(-)a/tools/additional-contents.pl (-3 / +11 lines)
Lines 40-50 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
}
51
$editmode = $wysiwyg == 1 ? "wysiwyg" : "text";
48
52
49
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
53
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
50
    {
54
    {
Lines 82-88 elsif ( $op eq 'add_validate' ) { Link Here
82
    my $location   = $cgi->param('location');
86
    my $location   = $cgi->param('location');
83
    my $code       = $cgi->param('code');
87
    my $code       = $cgi->param('code');
84
    my $branchcode = $cgi->param('branchcode') || undef;
88
    my $branchcode = $cgi->param('branchcode') || undef;
85
86
    my @title      = $cgi->multi_param('title');
89
    my @title      = $cgi->multi_param('title');
87
    my @content    = $cgi->multi_param('content');
90
    my @content    = $cgi->multi_param('content');
88
    my @lang       = $cgi->multi_param('lang');
91
    my @lang       = $cgi->multi_param('lang');
Lines 185-191 elsif ( $op eq 'add_validate' ) { Link Here
185
        }
188
        }
186
189
187
    }
190
    }
188
    $op = 'list';
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
    }
189
}
197
}
190
elsif ( $op eq 'delete_confirmed' ) {
198
elsif ( $op eq 'delete_confirmed' ) {
191
    my @ids = $cgi->multi_param('ids');
199
    my @ids = $cgi->multi_param('ids');
Lines 254-259 $template->param( Link Here
254
    op        => $op,
262
    op        => $op,
255
    category  => $category,
263
    category  => $category,
256
    wysiwyg   => $wysiwyg,
264
    wysiwyg   => $wysiwyg,
265
    editmode  => $editmode,
257
    languages => \@languages,
266
    languages => \@languages,
258
);
267
);
259
268
260
- 

Return to bug 22659