Bugzilla – Attachment 41714 Details for
Bug 14675
Updating personal details on OPAC - request sent even if no changes are made
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14675: Don't update details if no changes made
Bug-14675-Dont-update-details-if-no-changes-made.patch (text/plain), 3.38 KB, created by
Jonathan Druart
on 2015-08-20 12:50:41 UTC
(
hide
)
Description:
Bug 14675: Don't update details if no changes made
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-08-20 12:50:41 UTC
Size:
3.38 KB
patch
obsolete
>From 654d6f3b63a4f1d06b5149816fe5aea287f9e642 Mon Sep 17 00:00:00 2001 >From: Martin Stenberg <martin@xinxidi.net> >Date: Tue, 18 Aug 2015 16:41:42 +0200 >Subject: [PATCH] Bug 14675: Don't update details if no changes made > >if no changes has been made for personal details, bring user back to details >page and inform them that no changes has been made. > >Signed-off-by: Aleisha <aleishaamohia@hotmail.com> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > .../bootstrap/en/modules/opac-memberentry.tt | 3 ++ > opac/opac-memberentry.pl | 42 +++++++++++++--------- > 2 files changed, 28 insertions(+), 17 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt >index 4eed652..d5408d5 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt >@@ -44,6 +44,9 @@ > [% UNLESS OPACPatronDetails %] > <div class="alert alert-info">To make changes to your record please contact the library.</div> > [% END %] >+ [% IF nochanges %] >+ <div class="alert alert-error">No changes were made.</div> >+ [% END %] > [% END %] > > [% IF empty_mandatory_fields %] >diff --git a/opac/opac-memberentry.pl b/opac/opac-memberentry.pl >index 116ba7f..f696208 100755 >--- a/opac/opac-memberentry.pl >+++ b/opac/opac-memberentry.pl >@@ -182,26 +182,34 @@ elsif ( $action eq 'update' ) { > $template->param( action => 'edit' ); > } > else { >- ( $template, $borrowernumber, $cookie ) = get_template_and_user( >- { >- template_name => "opac-memberentry-update-submitted.tt", >- type => "opac", >- query => $cgi, >- authnotrequired => 1, >- } >- ); >- > my %borrower_changes = DelUnchangedFields( $borrowernumber, %borrower ); >+ if (%borrower_changes) { >+ ( $template, $borrowernumber, $cookie ) = get_template_and_user( >+ { >+ template_name => "opac-memberentry-update-submitted.tt", >+ type => "opac", >+ query => $cgi, >+ authnotrequired => 1, >+ } >+ ); > >- my $m = >- Koha::Borrower::Modifications->new( >- borrowernumber => $borrowernumber ); >+ my $m = >+ Koha::Borrower::Modifications->new( >+ borrowernumber => $borrowernumber ); > >- $m->DelModifications; >- $m->AddModifications(\%borrower_changes); >- $template->param( >- borrower => GetMember( borrowernumber => $borrowernumber ), >- ); >+ $m->DelModifications; >+ $m->AddModifications(\%borrower_changes); >+ $template->param( >+ borrower => GetMember( borrowernumber => $borrowernumber ), >+ ); >+ } >+ else { >+ $template->param( >+ action => 'edit', >+ nochanges => 1, >+ borrower => GetMember( borrowernumber => $borrowernumber ), >+ ); >+ } > } > } > elsif ( $action eq 'edit' ) { #Display logged in borrower's data >-- >2.1.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 14675
:
41605
|
41690
| 41714