Bug 18957: Record the time part of the last renewed date
[koha.git] / svc / config / systempreferences
index 6fceb97..c54e749 100755 (executable)
@@ -4,22 +4,21 @@
 #
 # This file is part of Koha.
 #
-# Koha is free software; you can redistribute it and/or modify it under the
-# terms of the GNU General Public License as published by the Free Software
-# Foundation; either version 2 of the License, or (at your option) any later
-# version.
+# Koha is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
 #
-# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
-# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+# Koha is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
 #
-# You should have received a copy of the GNU General Public License along
-# with Koha; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# You should have received a copy of the GNU General Public License
+# along with Koha; if not, see <http://www.gnu.org/licenses>.
 #
 
-use strict;
-use warnings;
+use Modern::Perl;
 
 use C4::Context;
 use C4::Service;
@@ -42,14 +41,18 @@ batches.
 
 =cut
 
-our ( $query, $response ) = C4::Service->init( parameters => 1 );
+our ( $query, $response ) = C4::Service->init( parameters => 'manage_sysprefs' );
 
 =head2 set_preference
 
 =over 4
 
+=item url path
+
 POST /svc/config/systempreferences/$preference
 
+=item url query
+
 value=$value
 
 =back
@@ -64,7 +67,6 @@ sub set_preference {
     unless ( C4::Context->config('demo') ) {
         my $value = join( ',', $query->param( 'value' ) );
         C4::Context->set_preference( $preference, $value );
-        logaction( 'SYSTEMPREFERENCE', 'MODIFY', undef, $preference . " | " . $value );
     }
 
     C4::Service->return_success( $response );
@@ -74,8 +76,12 @@ sub set_preference {
 
 =over 4
 
+=item url path
+
 POST /svc/config/systempreferences/
 
+=item url query
+
 pref_$pref1=$value1&pref_$pref2=$value2
 
 =back
@@ -95,10 +101,9 @@ sub set_preferences {
 
             next if ( !defined( $pref ) );
 
-            my $value = join( '|', $query->param( $param ) );
+            my $value = join( ',', $query->multi_param( $param ) );
 
             C4::Context->set_preference( $pref, $value );
-            logaction( 'SYSTEMPREFERENCE', 'MODIFY', undef, $pref . " | " . $value );
         }
     }