use CGI;
-use C4::Auth;
-use C4::Output;
+use C4::Auth qw( get_template_and_user );
+use C4::Output qw( output_html_with_http_headers );
use Koha::Database;
-use Koha::DateUtils qw(dt_from_string);
+use Koha::DateUtils qw( dt_from_string );
use Koha::Clubs;
use Koha::Club::Fields;
-my $cgi = new CGI;
+my $cgi = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => 'clubs/clubs-add-modify.tt',
query => $cgi,
type => 'intranet',
- authnotrequired => 0,
flagsrequired => { clubs => 'edit_clubs' },
}
);
if ( $cgi->param('name') ) { # Update or create club
$club->set(
{
- club_template_id => $cgi->param('club_template_id') || undef,
- name => $cgi->param('name') || undef,
- description => $cgi->param('description') || undef,
- branchcode => $cgi->param('branchcode') || undef,
+ club_template_id => scalar $cgi->param('club_template_id') || undef,
+ name => scalar $cgi->param('name') || undef,
+ description => scalar $cgi->param('description') || undef,
+ branchcode => scalar $cgi->param('branchcode') || undef,
date_start => $date_start,
date_end => $date_end,
date_updated => dt_from_string(),