Bug 17600: Standardize our EXPORT_OK
[srvgit] / clubs / clubs-add-modify.pl
index 9d0ff08..4a41f5c 100755 (executable)
@@ -21,21 +21,20 @@ use Modern::Perl;
 
 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' },
     }
 );
@@ -64,10 +63,10 @@ $date_end = $date_end ? dt_from_string($date_end) : undef;
 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(),