Added AHA Report to download in Preorder Index
This commit is contained in:
@@ -25,10 +25,10 @@ class RimoWorkorder extends mfBaseModel {
|
||||
}
|
||||
}
|
||||
|
||||
public function downloadAh() {
|
||||
public function getAha() {
|
||||
if(!$this->id) return false;
|
||||
|
||||
$ah = Rimoapi::getWorkorderAhReport($this->rimo_id);
|
||||
$ah = Rimoapi::getWorkorderAhaReport($this->rimo_id);
|
||||
|
||||
return $ah;
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ class RimoWorkorderController extends mfBaseController {
|
||||
|
||||
}
|
||||
|
||||
protected function downloadAhAction() {
|
||||
protected function downloadAhaAction() {
|
||||
$workorder_id = $this->request->id;
|
||||
|
||||
if(!$workorder_id || $workorder_id < 1) {
|
||||
@@ -27,7 +27,7 @@ class RimoWorkorderController extends mfBaseController {
|
||||
exit;
|
||||
}
|
||||
|
||||
$return = $workorder->downloadAh();
|
||||
$return = $workorder->getAha();
|
||||
if($return === false) {
|
||||
header("HTTP/1.1 500 Not Found");
|
||||
echo "Fehler beim Herunterladen des AHA-Reports aus Rimo.";
|
||||
@@ -35,7 +35,7 @@ class RimoWorkorderController extends mfBaseController {
|
||||
}
|
||||
|
||||
header("Content-type: text/pdf");
|
||||
header("Content-disposition: attachment; filename=".$workorder->name."_AHA.pdf");
|
||||
header('Content-disposition: attachment; filename="'.$workorder->rimo_name.'_AHA.pdf"');
|
||||
echo $return;
|
||||
exit;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user