Bugzilla – Attachment 60615 Details for
Bug 12461
Add patron clubs feature
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12461 - Return to clubs home after save
Bug-12461---Return-to-clubs-home-after-save.patch (text/plain), 6.86 KB, created by
Kyle M Hall (khall)
on 2017-02-23 14:54:55 UTC
(
hide
)
Description:
Bug 12461 - Return to clubs home after save
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2017-02-23 14:54:55 UTC
Size:
6.86 KB
patch
obsolete
>From 59a02676979f795a75a513525296f931333662be Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 23 Feb 2017 14:45:15 +0000 >Subject: [PATCH] Bug 12461 - Return to clubs home after save > >--- > clubs/clubs-add-modify.pl | 5 ++++- > clubs/clubs.pl | 10 ++++++++++ > clubs/templates-add-modify.pl | 12 +++++++----- > .../prog/en/modules/clubs/clubs-add-modify.tt | 11 ----------- > koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs.tt | 18 ++++++++++++++++++ > .../prog/en/modules/clubs/templates-add-modify.tt | 7 ------- > 6 files changed, 39 insertions(+), 24 deletions(-) > >diff --git a/clubs/clubs-add-modify.pl b/clubs/clubs-add-modify.pl >index 4376a30..d1873d4 100755 >--- a/clubs/clubs-add-modify.pl >+++ b/clubs/clubs-add-modify.pl >@@ -44,7 +44,7 @@ my $schema = Koha::Database->new()->schema(); > > my $id = $cgi->param('id'); > my $club = $id ? Koha::Clubs->find($id) : Koha::Club->new(); >-$template->param( stored => $id ? 'updated' : 'stored' ) if $cgi->param('name'); >+my $stored = $cgi->param('name') ? $id ? 'updated' : 'stored' : undef; > > my $club_template_id = $cgi->param('club_template_id'); > my $club_template = $club->club_template() || Koha::Club::Templates->find($club_template_id); >@@ -92,6 +92,9 @@ if ( $cgi->param('name') ) { # Update or create club > } > > $id ||= $club->id(); >+ >+ print $cgi->redirect("/cgi-bin/koha/clubs/clubs.pl?stored=$stored&club_id=$id"); >+ exit; > } > > $club = Koha::Clubs->find($id); >diff --git a/clubs/clubs.pl b/clubs/clubs.pl >index 1636ce5..4429e23 100755 >--- a/clubs/clubs.pl >+++ b/clubs/clubs.pl >@@ -39,10 +39,20 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > } > ); > >+my $stored = $cgi->param('stored'); >+my $club_template_id = $cgi->param('club_template_id'); >+my $club_id = $cgi->param('club_id'); >+ >+my $club_template = $club_template_id ? Koha::Club::Templates->find( $club_template_id ) : undef; >+my $club = $club_id ? Koha::Clubs->find( $club_id ) : undef; >+ > my @club_templates = Koha::Club::Templates->search(); > my @clubs = Koha::Clubs->search(); > > $template->param( >+ stored => $stored, >+ club_template => $club_template, >+ club => $club, > club_templates => \@club_templates, > clubs => \@clubs, > ); >diff --git a/clubs/templates-add-modify.pl b/clubs/templates-add-modify.pl >index f82ed85..ae46178 100755 >--- a/clubs/templates-add-modify.pl >+++ b/clubs/templates-add-modify.pl >@@ -47,15 +47,16 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > my $id = $cgi->param('id'); > > my $club_template; >+my $stored; > > if ( $cgi->param('name') ) { # Update or create club > if ($id) { > $club_template = Koha::Club::Templates->find($id); >- $template->param( stored => 'updated' ); >+ $stored = 'updated'; > } > else { > $club_template = Koha::Club::Template->new(); >- $template->param( stored => 'created' ); >+ $stored = 'created'; > } > > $club_template->set( >@@ -66,9 +67,7 @@ if ( $cgi->param('name') ) { # Update or create club > branchcode => $cgi->param('branchcode') || undef, > date_updated => dt_from_string(), > is_email_required => $cgi->param('is_email_required') ? 1 : 0, >- is_enrollable_from_opac => $cgi->param('is_enrollable_from_opac') >- ? 1 >- : 0, >+ is_enrollable_from_opac => $cgi->param('is_enrollable_from_opac') ? 1 : 0, > } > )->store(); > >@@ -142,6 +141,9 @@ if ( $cgi->param('name') ) { # Update or create club > )->store(); > } > } >+ >+ print $cgi->redirect("/cgi-bin/koha/clubs/clubs.pl?stored=$stored&club_template_id=$id"); >+ exit; > } > > $club_template ||= Koha::Club::Templates->find($id); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs-add-modify.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs-add-modify.tt >index f3398cd..51f4a59 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs-add-modify.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs-add-modify.tt >@@ -15,17 +15,6 @@ > > <div class="yui-t7"> > <div class="yui-main"> >- [% IF stored %] >- <div class="alert"> >- [% IF stored == 'updated' %] >- <p>Your club was updated</p> >- [% ELSE %] >- <p>Your club was created</p> >- [% END %] >- <a href="clubs.pl">Return to patron clubs</a> >- </div> >- [% END %] >- > <form method="post" class="validated"> > <input type="hidden" name="id" value="[% club.id %]" /> > <input type="hidden" name="club_template_id" value="[% club_template.id %]" /> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs.tt >index d706c27..15680bb 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs.tt >@@ -78,6 +78,24 @@ > <div class="yui-b"> > <h1>Patron clubs</h1> > >+ [% IF club_template %] >+ <div class="dialog message"> >+ [% IF stored == 'updated' %] >+ <p>Club template <i>[% club_template.name %]</i> was updated.</p> >+ [% ELSE %] >+ <p>Club template <i>[% club_template.name %]</i> was saved.</p> >+ [% END %] >+ </div> >+ [% ELSIF club %] >+ <div class="dialog message"> >+ [% IF stored == 'updated' %] >+ <p>Club <i>[% club.name %]</i> was updated.</p> >+ [% ELSE %] >+ <p>Club <i>[% club.name %]</i> was saved.</p> >+ [% END %] >+ </div> >+ [% END %] >+ > <h3>Club templates</h3> > > [% IF CAN_user_clubs_edit_templates %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/templates-add-modify.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/templates-add-modify.tt >index ba9189f..16d0106 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/templates-add-modify.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/templates-add-modify.tt >@@ -12,13 +12,6 @@ > > <div class="yui-t7"> > <div class="yui-main"> >- [% IF stored %] >- <div class="alert"> >- <p>Your club template was [% IF stored == 'updated' %] updated [% ELSE %] saved [% END %]</p> >- <a href="clubs.pl">Return to patron clubs</a> >- </div> >- [% END %] >- > <form method="post" class="validated"> > <input type="hidden" name="id" value="[% club_template.id %]" /> > >-- >2.1.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 12461
:
29105
|
30456
|
31567
|
35104
|
36098
|
36099
|
36192
|
38748
|
39181
|
43428
|
47821
|
47824
|
47825
|
47856
|
49110
|
49121
|
50422
|
50423
|
50426
|
50427
|
58818
|
58819
|
58820
|
59272
|
59273
|
60519
|
60520
|
60521
|
60610
|
60611
|
60612
|
60613
|
60614
|
60615
|
60616
|
60617
|
60618
|
60624
|
62778
|
62779
|
62813
|
62814
|
62815