Bug 14391: Add granular permissions to the administration module
[koha.git] / svc / localization
index 1f10f67..6eed606 100755 (executable)
@@ -6,7 +6,7 @@ use Encode qw( encode );
 use C4::Service;
 use Koha::Localizations;
 
-our ( $query, $response ) = C4::Service->init( parameters => 'parameters_remaining_permissions' );
+our ( $query, $response ) = C4::Service->init( parameters => 'manage_itemtypes' );
 
 sub get_translations {
     my $rs = Koha::Localizations->search({ entity => $query->param('entity'), code => $query->param('code') });
@@ -37,7 +37,9 @@ sub update_translation {
         $localization->translation( $translation )
     }
     my %params;
+    my $is_changed;
     if ( $localization->is_changed ) {
+        $is_changed = 1;
         unless ( Koha::Localizations->search( { entity => $localization->entity, code => $localization->code, lang => $lang, localization_id => { '!=' => $localization->localization_id }, } )->count ) {
             $localization->store;
         } else {
@@ -52,6 +54,7 @@ sub update_translation {
         code        => $localization->code,
         lang        => $localization->lang,
         translation => $localization->translation,
+        is_changed  => $is_changed,
     );
     C4::Service->return_success( $response );
 }