Bug 19074: Fix category display in Batch patron modification.
[koha.git] / tools / marc_modification_templates.pl
index 10589e4..c115429 100755 (executable)
@@ -36,13 +36,13 @@ my ($template, $loggedinuser, $cookie)
             query => $cgi,
             type => "intranet",
             authnotrequired => 0,
-            flagsrequired => { tools => 'marc_modfication_templates' },
+            flagsrequired => { tools => 'marc_modification_templates' },
             debug => 1,
     });
 
 if ( $op eq "create_template" ) {
   $template_id = '' unless $cgi->param('duplicate_current_template');
-  $template_id = AddModificationTemplate( $cgi->param('template_name'), $template_id );
+  $template_id = AddModificationTemplate( scalar $cgi->param('template_name'), $template_id );
 
 } elsif ( $op eq "delete_template" ) {
 
@@ -103,21 +103,16 @@ if ( $op eq "create_template" ) {
     }
 
 } elsif ( $op eq "delete_action" ) {
-  DelModificationTemplateAction( $cgi->param('mmta_id') );
+  DelModificationTemplateAction( scalar $cgi->param('mmta_id') );
 
 } elsif ( $op eq "move_action" ) {
 
-  MoveModificationTemplateAction( $cgi->param('mmta_id'), $cgi->param('where') );
+  MoveModificationTemplateAction( scalar $cgi->param('mmta_id'), scalar $cgi->param('where') );
 
 }
 
 my @templates = GetModificationTemplates( $template_id );
 
-unless ( $template_id ) {
-  $template_id = $templates[0]->{'template_id'};
-  @templates = GetModificationTemplates( $template_id );
-}
-
 my @actions = GetModificationTemplateActions( $template_id );
 foreach my $action ( @actions ) {
   $action->{'action_delete_field'} = ( $action->{'action'} eq 'delete_field' );