Files
thetool/application/Preorder/PreorderController.php
2022-03-31 17:05:24 +02:00

33 lines
816 B
PHP

<?php
class PreorderController extends mfBaseController {
protected function init() {
$this->needlogin=true;
$me = new User();
$me->loadMe();
$this->me = $me;
$this->layout()->set("me",$me);
if(!$me->is(["Admin", "salespartner"])) {
$this->redirect("Dashboard");
}
}
protected function addAction() {
$this->layout()->setTemplate("Preorder/Form");
if($this->me->isAdmin()) {
$this->layout()->set("networks", NetworkModel::getAll());
} else {
$this->layout()->set("networks", $this->me->my_networks);
}
$this->layout()->set("types", BuildingtypeModel::getAll());
$this->layout()->set("statuses", BuildingstatusModel::getAll());
$this->layout()->set("networksections", NetworksectionModel::getAll());
}
}