Lines 47-61
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
Link Here
|
47 |
my $id = $cgi->param('id'); |
47 |
my $id = $cgi->param('id'); |
48 |
|
48 |
|
49 |
my $club_template; |
49 |
my $club_template; |
|
|
50 |
my $stored; |
50 |
|
51 |
|
51 |
if ( $cgi->param('name') ) { # Update or create club |
52 |
if ( $cgi->param('name') ) { # Update or create club |
52 |
if ($id) { |
53 |
if ($id) { |
53 |
$club_template = Koha::Club::Templates->find($id); |
54 |
$club_template = Koha::Club::Templates->find($id); |
54 |
$template->param( stored => 'updated' ); |
55 |
$stored = 'updated'; |
55 |
} |
56 |
} |
56 |
else { |
57 |
else { |
57 |
$club_template = Koha::Club::Template->new(); |
58 |
$club_template = Koha::Club::Template->new(); |
58 |
$template->param( stored => 'created' ); |
59 |
$stored = 'created'; |
59 |
} |
60 |
} |
60 |
|
61 |
|
61 |
$club_template->set( |
62 |
$club_template->set( |
Lines 66-74
if ( $cgi->param('name') ) { # Update or create club
Link Here
|
66 |
branchcode => $cgi->param('branchcode') || undef, |
67 |
branchcode => $cgi->param('branchcode') || undef, |
67 |
date_updated => dt_from_string(), |
68 |
date_updated => dt_from_string(), |
68 |
is_email_required => $cgi->param('is_email_required') ? 1 : 0, |
69 |
is_email_required => $cgi->param('is_email_required') ? 1 : 0, |
69 |
is_enrollable_from_opac => $cgi->param('is_enrollable_from_opac') |
70 |
is_enrollable_from_opac => $cgi->param('is_enrollable_from_opac') ? 1 : 0, |
70 |
? 1 |
|
|
71 |
: 0, |
72 |
} |
71 |
} |
73 |
)->store(); |
72 |
)->store(); |
74 |
|
73 |
|
Lines 142-147
if ( $cgi->param('name') ) { # Update or create club
Link Here
|
142 |
)->store(); |
141 |
)->store(); |
143 |
} |
142 |
} |
144 |
} |
143 |
} |
|
|
144 |
|
145 |
print $cgi->redirect("/cgi-bin/koha/clubs/clubs.pl?stored=$stored&club_template_id=$id"); |
146 |
exit; |
145 |
} |
147 |
} |
146 |
|
148 |
|
147 |
$club_template ||= Koha::Club::Templates->find($id); |
149 |
$club_template ||= Koha::Club::Templates->find($id); |