Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision d7e63a2c

Von Werner Hahn vor 5 Monaten hinzugefügt

  • ID d7e63a2c2739a6d5fe3681a7381e61090e997d6d
  • Vorgänger 92f20d20

DeliveryOrder: flash_later und redirect auch bei print_preview

Unterschiede anzeigen:

SL/Controller/DeliveryOrder.pm
372 372
    $self->js_reset_order_and_item_ids_after_save;
373 373
  }
374 374

  
375
  my $redirect_url = $self->url_for(
376
    action => 'edit',
377
    type   => $self->type,
378
    id     => $self->order->id,
379
  );
380

  
375 381
  my $format      = 'pdf';
376 382
  my $media       = 'screen';
377 383
  my $formname    = $self->type;
......
394 400
      language   => $self->order->language,
395 401
    });
396 402
  if (scalar @errors) {
397
    return $self->js->flash('error',
398
      t8('Conversion to PDF failed: #1', $errors[0])
399
    )->render;
403
    flash_later('error', t8('Conversion to PDF failed: #1', $errors[0]));
404
    return $self->js->redirect_to($redirect_url)->render;
400 405
  }
401 406
  $self->save_history('PREVIEWED');
402
  $self->js->flash('info', t8('The PDF has been previewed'));
407
  flash_later('info', t8('The PDF has been previewed'));
403 408
  # screen/download
404 409
  $self->send_file(
405 410
    \$pdf,
406 411
    type         => SL::MIME->mime_type_from_ext($pdf_filename),
407 412
    name         => $pdf_filename,
408
    js_no_render => 0,
413
    js_no_render => 1,
409 414
  );
415
  $self->js->redirect_to($redirect_url)->render;
410 416
}
411 417

  
412 418
# open the email dialog

Auch abrufbar als: Unified diff