Bugzilla – Attachment 64559 Details for
Bug 18847
Add "Save and continue" option to notice editing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18847 - Add "Save and continue" option to notice editing
Bug-18847---Add-Save-and-continue-option-to-notice.patch (text/plain), 5.13 KB, created by
Biblibre Sandboxes
on 2017-06-23 00:58:39 UTC
(
hide
)
Description:
Bug 18847 - Add "Save and continue" option to notice editing
Filename:
MIME Type:
Creator:
Biblibre Sandboxes
Created:
2017-06-23 00:58:39 UTC
Size:
5.13 KB
patch
obsolete
>From 312d5c1bad00c409edded58452c9852ba07384c2 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Wed, 21 Jun 2017 18:57:04 +0000 >Subject: [PATCH] Bug 18847 - Add "Save and continue" option to notice editing > >This patch adds an option to "Save and continue editing" when editing >notices. The submit button is now a split button in a floating toolbar. >The secondary action of the split button is "Save and continue editing." > >To test, apply the patch and go to Tools -> Notices. > >- Open any notice for editing. Verify that the toolbar looks correct and > floats as it should when sections of the form are expanded and the > page scrolls. >- Edit a notice and click the "Save" button. Confirm that you are > redirected to the main Notices page and that your changes were saved. >- Edit a notice and click the "Save and continue editing" menu item. > The page should reload with your updates in place. > >Signed-off-by: NickUCKohaCon17 <nicansjr@gmail.com> >--- > .../intranet-tmpl/prog/en/modules/tools/letter.tt | 30 ++++++++++++++++++++-- > tools/letter.pl | 8 +++++- > 2 files changed, 35 insertions(+), 3 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt >index 441b0ed..09a5e79 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt >@@ -5,10 +5,14 @@ > [% INCLUDE 'doc-head-close.inc' %] > <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" /> > [% INCLUDE 'datatables.inc' %] >+<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.fixFloat.js"></script> > <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.insertatcaret.js"></script> > <script type="text/javascript"> > //<![CDATA[ > $(document).ready(function() { >+ [% IF add_form or copy_form %] >+ $('#toolbar').fixFloat(); >+ [% END %] > $("#lettert:has(tbody tr)").dataTable($.extend(true, {}, dataTablesDefaults, { > "sDom": 't', > "aoColumnDefs": [ >@@ -112,6 +116,13 @@ $(document).ready(function() { > }) > > $("#tabs").tabs(); >+ >+ $("#saveandcontinue").on("click",function(e){ >+ e.preventDefault(); >+ $("#redirect").val("just_save"); >+ $("#submit_form").click(); >+ }); >+ > }); > [% IF add_form or copy_form %] > >@@ -260,6 +271,20 @@ $(document).ready(function() { > > [% IF add_form or copy_form %] > <h1>[% IF ( modify ) %]Modify notice[% ELSE %]Add notice[% END %]</h1> >+ >+ <div id="toolbar" class="btn-toolbar"> >+ <div class="btn-group"> >+ <button class="btn btn-default btn-sm" id="submit_form"><i class="fa fa-save"></i> Save</button> >+ <button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown"> >+ <span class="caret"></span> >+ </button> >+ <ul class="dropdown-menu"> >+ <li><a id="saveandcontinue" href="#">Save and continue editing</a></li> >+ </ul> >+ </div> >+ <a class="btn btn-default btn-sm cancel" href="/cgi-bin/koha/tools/letter.pl"><i class="fa fa-remove"></i> Cancel</a> >+ </div> >+ > <form id="add_notice" name="Aform" method="post" enctype="multipart/form-data" class="validate"> > [% IF add_form %] > <input type="hidden" name="op" id="op" value="add_validate" /> >@@ -469,8 +494,9 @@ $(document).ready(function() { > [% END %] > > [% 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 %] >- <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> >- <input type="hidden" name="searchfield" value="[% searchfield %]" /> >+ >+ <input type="hidden" id="redirect" name="redirect" value="" /> >+ <input type="hidden" name="searchfield" value="[% searchfield %]" /> > </form> > [% END %] > >diff --git a/tools/letter.pl b/tools/letter.pl >index 5920a84..d0c52c2 100755 >--- a/tools/letter.pl >+++ b/tools/letter.pl >@@ -66,6 +66,7 @@ my $code = $input->param('code'); > my $module = $input->param('module') || ''; > my $content = $input->param('content'); > my $op = $input->param('op') || ''; >+my $redirect = $input->param('redirect'); > my $dbh = C4::Context->dbh; > > our ( $template, $borrowernumber, $cookie, $staffflags ) = get_template_and_user( >@@ -94,7 +95,12 @@ $template->param( > > if ( $op eq 'add_validate' or $op eq 'copy_validate' ) { > add_validate(); >- $op = q{}; # we return to the default screen for the next operation >+ if( $redirect eq "just_save" ){ >+ print $input->redirect("/cgi-bin/koha/tools/letter.pl?op=add_form&branchcode=$branchcode&module=$module&code=$code&redirect=done"); >+ exit; >+ } else { >+ $op = q{}; # we return to the default screen for the next operation >+ } > } > if ($op eq 'copy_form') { > my $oldbranchcode = $input->param('oldbranchcode') || q||; >-- >2.7.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 18847
:
64549
|
64559
|
65022