WIP tmp
This commit is contained in:
@@ -24,6 +24,13 @@ class RimoWorkorder extends mfBaseModel {
|
||||
AddressDB::handleRimoStatusUpdate($wohneinheit->id);
|
||||
}
|
||||
}
|
||||
|
||||
public function downloadAh() {
|
||||
if(!$this->id) return false;
|
||||
|
||||
$ah = Rimoapi::getWorkorderAhReport();
|
||||
|
||||
}
|
||||
|
||||
public function getProperty($name) {
|
||||
if($this->$name == null) {
|
||||
|
||||
43
application/RimoWorkorder/RimoWorkorderController.php
Normal file
43
application/RimoWorkorder/RimoWorkorderController.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
class RimoWorkorderController extends mfBaseController {
|
||||
|
||||
protected function init() {
|
||||
$this->needlogin=true;
|
||||
$me = new User();
|
||||
$me->loadMe();
|
||||
$this->me = $me;
|
||||
$this->layout()->set("me",$me);
|
||||
|
||||
}
|
||||
|
||||
protected function downloadAhAction() {
|
||||
$workorder_id = $this->request->id;
|
||||
|
||||
if(!$workorder_id || $workorder_id < 1) {
|
||||
header("HTTP/1.1 400 Bad Request");
|
||||
echo "Invalid workorder id.";
|
||||
exit;
|
||||
}
|
||||
|
||||
$workorder = new RimoWorkorder($workorder_id);
|
||||
if(!$workorder->id) {
|
||||
header("HTTP/1.1 404 Not Found");
|
||||
echo "Workorder nicht gefunden.";
|
||||
exit;
|
||||
}
|
||||
|
||||
$return = $workorder->downloadAh();
|
||||
if($return === false) {
|
||||
header("HTTP/1.1 500 Not Found");
|
||||
echo "Fehler beim Herunterladen des AH-Blatts aus Rimo.";
|
||||
exit;
|
||||
}
|
||||
|
||||
header("Content-type: text/pdf");
|
||||
header("Content-disposition: attachment; filename=".$workorder->name."_AHA.pdf");
|
||||
echo $return;
|
||||
exit;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -119,14 +119,14 @@ class RimoWorkorderModel {
|
||||
if(is_array($limit) && count($limit)) {
|
||||
if(is_numeric($limit['start']) && is_numeric($limit['count'])) {
|
||||
$sql .= " LIMIT ".$limit['start'].", ".$limit['count'];
|
||||
} elseif(is_numeric($count)) {
|
||||
} elseif(is_numeric($limit['count'])) {
|
||||
$sql .= " LIMIT ".$limit['count'];
|
||||
}
|
||||
}
|
||||
|
||||
$res = $db->query($sql);
|
||||
|
||||
//mfLoghandler::singleton()->debug($sql);
|
||||
mfLoghandler::singleton()->debug($sql);
|
||||
|
||||
if($db->num_rows($res)) {
|
||||
while($data = $db->fetch_object($res)) {
|
||||
|
||||
Reference in New Issue
Block a user