@@ -, +, @@ --- 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(-) --- a/clubs/clubs-add-modify.pl +++ a/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); --- a/clubs/clubs.pl +++ a/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, ); --- a/clubs/templates-add-modify.pl +++ a/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); --- a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs-add-modify.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs-add-modify.tt @@ -15,17 +15,6 @@
- [% IF stored %] -
- [% IF stored == 'updated' %] -

Your club was updated

- [% ELSE %] -

Your club was created

- [% END %] - Return to patron clubs -
- [% END %] -
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs.tt @@ -78,6 +78,24 @@

Patron clubs

+ [% IF club_template %] +
+ [% IF stored == 'updated' %] +

Club template [% club_template.name %] was updated.

+ [% ELSE %] +

Club template [% club_template.name %] was saved.

+ [% END %] +
+ [% ELSIF club %] +
+ [% IF stored == 'updated' %] +

Club [% club.name %] was updated.

+ [% ELSE %] +

Club [% club.name %] was saved.

+ [% END %] +
+ [% END %] +

Club templates

[% IF CAN_user_clubs_edit_templates %] --- a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/templates-add-modify.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/templates-add-modify.tt @@ -12,13 +12,6 @@
- [% IF stored %] -
-

Your club template was [% IF stored == 'updated' %] updated [% ELSE %] saved [% END %]

- Return to patron clubs -
- [% END %] - --