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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt (-2 / +28 lines)
Lines 5-14 Link Here
5
[% INCLUDE 'doc-head-close.inc' %]
5
[% INCLUDE 'doc-head-close.inc' %]
6
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
6
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
7
[% INCLUDE 'datatables.inc' %]
7
[% INCLUDE 'datatables.inc' %]
8
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.fixFloat.js"></script>
8
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.insertatcaret.js"></script>
9
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.insertatcaret.js"></script>
9
<script type="text/javascript">
10
<script type="text/javascript">
10
//<![CDATA[
11
//<![CDATA[
11
$(document).ready(function() {
12
$(document).ready(function() {
13
    [% IF add_form or copy_form %]
14
        $('#toolbar').fixFloat();
15
    [% END %]
12
    $("#lettert:has(tbody tr)").dataTable($.extend(true, {}, dataTablesDefaults, {
16
    $("#lettert:has(tbody tr)").dataTable($.extend(true, {}, dataTablesDefaults, {
13
        "sDom": 't',
17
        "sDom": 't',
14
        "aoColumnDefs": [
18
        "aoColumnDefs": [
Lines 112-117 $(document).ready(function() { Link Here
112
    })
116
    })
113
117
114
    $("#tabs").tabs();
118
    $("#tabs").tabs();
119
120
    $("#saveandcontinue").on("click",function(e){
121
        e.preventDefault();
122
        $("#redirect").val("just_save");
123
        $("#submit_form").click();
124
    });
125
115
});
126
});
116
[% IF add_form or copy_form %]
127
[% IF add_form or copy_form %]
117
	
128
	
Lines 260-265 $(document).ready(function() { Link Here
260
	
271
	
261
[% IF add_form or copy_form %]
272
[% IF add_form or copy_form %]
262
<h1>[% IF ( modify ) %]Modify notice[% ELSE %]Add notice[% END %]</h1>
273
<h1>[% IF ( modify ) %]Modify notice[% ELSE %]Add notice[% END %]</h1>
274
275
    <div id="toolbar" class="btn-toolbar">
276
        <div class="btn-group">
277
            <button class="btn btn-default btn-sm" id="submit_form"><i class="fa fa-save"></i> Save</button>
278
            <button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown">
279
            <span class="caret"></span>
280
            </button>
281
            <ul class="dropdown-menu">
282
                <li><a id="saveandcontinue" href="#">Save and continue editing</a></li>
283
            </ul>
284
        </div>
285
        <a class="btn btn-default btn-sm cancel" href="/cgi-bin/koha/tools/letter.pl"><i class="fa fa-remove"></i> Cancel</a>
286
    </div>
287
263
        <form id="add_notice" name="Aform" method="post" enctype="multipart/form-data" class="validate">
288
        <form id="add_notice" name="Aform" method="post" enctype="multipart/form-data" class="validate">
264
        [% IF add_form %]
289
        [% IF add_form %]
265
          <input type="hidden" name="op" id="op" value="add_validate" />
290
          <input type="hidden" name="op" id="op" value="add_validate" />
Lines 469-476 $(document).ready(function() { Link Here
469
        [% END %]
494
        [% END %]
470
495
471
        [% IF code.search('DGST') %] <span class="overdue">Warning, this is a template for a Digest, as such, any references to branch data ( e.g. branches.branchname ) will refer to the borrower's home branch.</span> [% END %]
496
        [% IF code.search('DGST') %] <span class="overdue">Warning, this is a template for a Digest, as such, any references to branch data ( e.g. branches.branchname ) will refer to the borrower's home branch.</span> [% END %]
472
        <fieldset class="action"><input type="submit" id="submit_form" value="Submit" class="button" /> <a class="cancel" href="/cgi-bin/koha/tools/letter.pl">Cancel</a></fieldset>
497
473
      <input type="hidden" name="searchfield" value="[% searchfield %]" />
498
        <input type="hidden" id="redirect" name="redirect" value="" />
499
        <input type="hidden" name="searchfield" value="[% searchfield %]" />
474
    </form>
500
    </form>
475
[% END %]
501
[% END %]
476
502
(-)a/tools/letter.pl (-2 / +7 lines)
Lines 66-71 my $code = $input->param('code'); Link Here
66
my $module      = $input->param('module') || '';
66
my $module      = $input->param('module') || '';
67
my $content     = $input->param('content');
67
my $content     = $input->param('content');
68
my $op          = $input->param('op') || '';
68
my $op          = $input->param('op') || '';
69
my $redirect      = $input->param('redirect');
69
my $dbh = C4::Context->dbh;
70
my $dbh = C4::Context->dbh;
70
71
71
our ( $template, $borrowernumber, $cookie, $staffflags ) = get_template_and_user(
72
our ( $template, $borrowernumber, $cookie, $staffflags ) = get_template_and_user(
Lines 94-100 $template->param( Link Here
94
95
95
if ( $op eq 'add_validate' or $op eq 'copy_validate' ) {
96
if ( $op eq 'add_validate' or $op eq 'copy_validate' ) {
96
    add_validate();
97
    add_validate();
97
    $op = q{}; # we return to the default screen for the next operation
98
    if( $redirect eq "just_save" ){
99
        print $input->redirect("/cgi-bin/koha/tools/letter.pl?op=add_form&branchcode=$branchcode&module=$module&code=$code&redirect=done");
100
        exit;
101
    } else {
102
        $op = q{}; # we return to the default screen for the next operation
103
    }
98
}
104
}
99
if ($op eq 'copy_form') {
105
if ($op eq 'copy_form') {
100
    my $oldbranchcode = $input->param('oldbranchcode') || q||;
106
    my $oldbranchcode = $input->param('oldbranchcode') || q||;
101
- 

Return to bug 18847