Bugzilla – Attachment 90526 Details for
Bug 23100
Notify user if leaving modified patron edit form without saving
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23100: Add leave page confirmation to patron edit form
Bug-23100-Add-leave-page-confirmation-to-patron-ed.patch (text/plain), 1.90 KB, created by
Josef Moravec
on 2019-06-12 07:47:36 UTC
(
hide
)
Description:
Bug 23100: Add leave page confirmation to patron edit form
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2019-06-12 07:47:36 UTC
Size:
1.90 KB
patch
obsolete
>From cdf83f0ab9fd1597293a6708f01c22934235e2cd Mon Sep 17 00:00:00 2001 >From: Josef Moravec <josef.moravec@gmail.com> >Date: Wed, 12 Jun 2019 07:44:54 +0000 >Subject: [PATCH] Bug 23100: Add leave page confirmation to patron edit form > >Test plan: >1) Apply the patch >2) Try to edit a patron, change some value and try to go out without >saving, you should be notified you have unsaved changes >--- > .../prog/en/modules/members/memberentrygen.tt | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >index 62fc2db2de..5cd3118b38 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >@@ -1256,6 +1256,7 @@ > var LABEL_SET_TO_PATRON = _("Set to patron"); > var LABEL_AGE = _("Age"); > var MSG_MESSAGING_DFEAULTS = _("Change messaging preferences to default for this category?"); >+ var MSG_PATRON_MODIFIED = _("You made some modification, are you sure you want to leave this page?"); > > [% IF quickadd && opadd && !check_member %] > $(document).ready(function () { >@@ -1290,6 +1291,21 @@ > }); > [% END %] > >+ $(document).ready(function () { >+ $("#entryform :input").change(function() { >+ $("#entryform").data("modified", true); >+ }); >+ >+ $("#entryform").submit(function(){ >+ $(this).data("modified",false); >+ }); >+ >+ window.onbeforeunload = function (e) { >+ if ($("#entryform").data("modified")) { >+ return MSG_PATRON_MODIFIED; >+ } >+ }; >+ }); > </script> > [% Asset.js("js/members.js") | $raw %] > [% Asset.js("js/messaging-preference-form.js") | $raw %] >-- >2.11.0
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 23100
:
90526
|
90617