| 
      
            Lines 40-46
          if ( C4::Context->config('supportdir') ) {
      
      
        Link Here
      
     | 
  
        
          | 40 | 
               $base = C4::Context->config('supportdir'); | 
          40 | 
               $base = C4::Context->config('supportdir'); | 
        
        
          | 41 | 
          }  | 
          41 | 
          }  | 
        
        
          | 42 | 
          else { | 
          42 | 
          else { | 
        
          
            
              | 43 | 
                   $base        = "/usr/share/koha/bin";  | 
              43 | 
                   $base = "/usr/share/koha/bin";  | 
            
        
          | 44 | 
          }  | 
          44 | 
          }  | 
        
        
          | 45 | 
           | 
          45 | 
           | 
        
        
          | 46 | 
          my $CONFIG_NAME = $ENV{'KOHA_CONF'}; | 
          46 | 
          my $CONFIG_NAME = $ENV{'KOHA_CONF'}; | 
        
  
    | 
      
            Lines 68-91
          if ( $mode eq 'job_add' ) {
      
      
        Link Here
      
     | 
  
        
          | 68 | 
              my $startdate = join('', (split /-/, $c4date->output("iso"))); | 
          68 | 
              my $startdate = join('', (split /-/, $c4date->output("iso"))); | 
        
        
          | 69 | 
           | 
          69 | 
           | 
        
        
          | 70 | 
              my $starttime = $input->param('starttime'); | 
          70 | 
              my $starttime = $input->param('starttime'); | 
        
            
              | 71 | 
                  my $recurring = $input->param('recurring'); | 
               | 
               | 
            
        
          | 72 | 
              $starttime =~ s/\://g;  | 
          71 | 
              $starttime =~ s/\://g;  | 
        
        
          | 73 | 
              my $start  = $startdate . $starttime;  | 
          72 | 
              my $start  = $startdate . $starttime;  | 
        
        
          | 74 | 
              my $report = $input->param('report'); | 
          73 | 
              my $report = $input->param('report'); | 
        
        
          | 75 | 
              my $format = $input->param('format'); | 
          74 | 
              my $format = $input->param('format'); | 
        
        
          | 76 | 
              my $email  = $input->param('email'); | 
          75 | 
              my $email  = $input->param('email'); | 
        
        
          | 77 | 
              my $command =  | 
          76 | 
              my $command =  | 
        
          
            
              | 78 | 
                      "export KOHA_CONF=\"$CONFIG_NAME\"; " . $base  | 
              77 | 
                      "export KOHA_CONF=\"$CONFIG_NAME\"; " .  | 
            
            
              | 79 | 
                    . "/cronjobs/runreport.pl $report --format=$format --to=$email";  | 
              78 | 
                      "$base/cronjobs/runreport.pl $report --format=$format --to=$email";  | 
            
            
              | 80 | 
               | 
              79 | 
               | 
            
            
              | 81 | 
                  if ($recurring) { | 
              80 | 
              #FIXME commit ea899bc55933cd74e4665d70b1c48cab82cd1257 added recurring parameter (it is not in template) and call to add_cron_job (undefined)  | 
            
            
              | 82 | 
                      my $frequency = $input->param('frequency'); | 
              81 | 
              #    my $recurring = $input->param('recurring'); | 
            
            
              | 83 | 
                      add_cron_job( $start, $command );  | 
              82 | 
              #    if ($recurring) { | 
            
            
              | 84 | 
                  }  | 
              83 | 
              #        my $frequency = $input->param('frequency'); | 
            
            
              | 85 | 
                  else { | 
              84 | 
              #        add_cron_job( $start, $command );  | 
            
            
              | 86 | 
                      unless ( add_at_job( $start, $command ) ) { | 
              85 | 
              #    }  | 
            
            
              | 87 | 
                          $template->param( job_add_failed => 1 );  | 
              86 | 
              #    else { | 
            
            
              | 88 | 
                      }  | 
              87 | 
              #        #here was the the unless ( add_at_job  | 
            
            
               | 
               | 
              88 | 
              #    }  | 
            
            
              | 89 | 
               | 
            
            
              | 90 | 
                  unless ( add_at_job( $start, $command ) ) { | 
            
            
              | 91 | 
                      $template->param( job_add_failed => 1 );  | 
            
        
          | 89 | 
              }  | 
          92 | 
              }  | 
        
        
          | 90 | 
          }  | 
          93 | 
          }  | 
        
        
          | 91 | 
           | 
          94 | 
           | 
        
            
              | 92 | 
              -   | 
               | 
               |