Exemplo n.º 1
0
 /**
  * Shows module content
  *
  * @param \phpOMS\Message\RequestAbstract  $request  Request
  * @param \phpOMS\Message\ResponseAbstract $response Response
  *
  * @since  1.0.0
  * @author Dennis Eichhorn <*****@*****.**>
  */
 public function showContentBackend($request)
 {
     switch ($request->getPath(3)) {
         case 'dashboard':
             /** @noinspection PhpIncludeInspection */
             include __DIR__ . '/Theme/Backend/eventmanagement-dashboard.tpl.php';
             break;
         case 'create':
             /** @noinspection PhpIncludeInspection */
             include __DIR__ . '/Theme/Backend/eventmanagement-create.tpl.php';
             break;
     }
 }
Exemplo n.º 2
0
 /**
  * Shows module content
  *
  * @param \phpOMS\Message\RequestAbstract  $request  Request
  * @param \phpOMS\Message\ResponseAbstract $response Response
  *
  * @since  1.0.0
  * @author Dennis Eichhorn <*****@*****.**>
  */
 public function showContentBackend($request, $response)
 {
     switch ($request->getPath(3)) {
         case 'single':
             $profileSingleView = new \phpOMS\Views\View($this->app, $request, $response);
             $profileSingleView->setTemplate('/Modules/Profile/Theme/Backend/profile-single');
             $navigation = \Modules\Navigation\Models\Navigation::getInstance($request->getHash(), $this->app->dbPool);
             $profileSingleView->addData('nav', $navigation->nav);
             echo $profileSingleView->render();
             break;
         case 'list':
             $profileView = new \phpOMS\Views\View($this->app, $request, $response);
             $profileView->setTemplate('/Modules/Profile/Theme/Backend/profile-list');
             $navigation = \Modules\Navigation\Models\Navigation::getInstance($request->getHash(), $this->app->dbPool);
             $profileView->addData('nav', $navigation->nav);
             echo $profileView->render();
             break;
     }
 }
Exemplo n.º 3
0
 /**
  * Shows module content
  *
  * @param \phpOMS\Message\RequestAbstract  $request  Request
  * @param \phpOMS\Message\ResponseAbstract $response Response
  *
  * @since  1.0.0
  * @author Dennis Eichhorn <*****@*****.**>
  */
 public function showContentBackend($request, $response)
 {
     switch ($request->getPath(4)) {
         case 'cockpit':
             $riskMgmtDashboard = new \phpOMS\Views\View($this->app, $request, $response);
             $riskMgmtDashboard->setTemplate('/Modules/RiskManagement/Theme/Backend/cockpit');
             $navigation = \Modules\Navigation\Models\Navigation::getInstance($request->getHash(), $this->app->dbPool);
             $riskMgmtDashboard->addData('nav', $navigation->nav);
             echo $riskMgmtDashboard->render();
             break;
         case 'risk':
             $this->showContentBackendRisk($request, $response);
             break;
         case 'cause':
             $this->showContentBackendCause($request, $response);
             break;
         case 'solution':
             $this->showContentBackendSolution($request, $response);
             break;
         case 'settings':
             $this->show_backend_settings();
             break;
         case 'unit':
             $this->showContentBackendUnit($request, $response);
             break;
         case 'department':
             $this->showContentBackendDepartment($request, $response);
             break;
         case 'category':
             $this->showContentBackendCategory($request, $response);
             break;
         case 'project':
             $this->showContentBackendProject($request, $response);
             break;
         case 'process':
             $this->showContentBackendProcess($request, $response);
             break;
     }
 }
Exemplo n.º 4
0
 /**
  * Shows api content
  *
  * @param \phpOMS\Message\RequestAbstract  $request  Request
  * @param \phpOMS\Message\ResponseAbstract $response Response
  *
  * @since  1.0.0
  * @author Dennis Eichhorn <*****@*****.**>
  */
 private function apiShow($request, $response)
 {
     if ($request->getPath(3) === 'download') {
         // TODO: check permissions + load data from database + if request = virtual directory -> zip all files and download + cache zip
         $file = $_GET["file"] . ".pdf";
         $response->setHeader('Content-Disposition', 'Content-Disposition: attachment; filename=' . urlencode($file));
         $response->setHeader('Content-Type', 'Content-Type: application/octet-stream');
         $response->setHeader('Content-Description', 'Content-Description: File Transfer');
         $response->setHeader('Content-Length', 'Content-Length: ' . filesize($file));
         $fp = fopen($file, "r");
         while (!feof($fp)) {
             echo fread($fp, 65536);
             flush();
         }
         fclose($fp);
     } else {
         // TODO: check permissions + load data from database
         switch ($extension) {
             case 'jpeg':
             case 'png':
             case 'bmp':
             case 'tiff':
             case 'gif':
                 $response->setHeader('Content-Type', 'Content-Type: image/' . $extension);
                 break;
             case 'jpg':
                 $response->setHeader('Content-Type', 'Content-Type: image/jpeg');
                 break;
             case 'svg':
                 $response->setHeader('Content-Type', 'Content-Type: image/svg+xml');
                 break;
             case 'pdf':
                 $response->setHeader('Content-Type', 'Content-Type: application/pdf');
                 break;
             case 'txt':
             case 'csv':
             case 'css':
             case 'xml':
             case 'html':
                 $response->setHeader('Content-Type', 'Content-Type: text/' . $extension);
                 break;
             case 'htm':
                 $response->setHeader('Content-Type', 'Content-Type: text/html');
                 break;
             case 'md':
                 $response->setHeader('Content-Type', 'Content-Type: text/markdown');
                 break;
             case 'json':
                 $response->setHeader('Content-Type', 'Content-Type: application/json');
                 break;
             case 'js':
                 $response->setHeader('Content-Type', 'Content-Type: application/javascript');
                 break;
             case 'avi':
             case 'mpeg':
             case 'mp4':
             case 'ogg':
                 $response->setHeader('Content-Type', 'Content-Type: video/' . $extension);
                 break;
             case 'mp3':
                 $response->setHeader('Content-Type', 'Content-Type: audio/' . $extension);
                 break;
             default:
                 $response->setHeader('HTTP', 'HTTP/1.0 406 Not acceptable');
                 $response->setHeader('Status', 'Status:406 Not acceptable');
                 return;
         }
         $response->setHeader('Content-Length', 'Content-Length: ' . filesize($file));
     }
 }
Exemplo n.º 5
0
 /**
  * Shows module content
  *
  * @param \phpOMS\Message\RequestAbstract  $request  Request
  * @param \phpOMS\Message\ResponseAbstract $response Response
  *
  * @since  1.0.0
  * @author Dennis Eichhorn <*****@*****.**>
  */
 public function showBackendGuideline($request)
 {
     switch ($request->getPath(4)) {
         case 'list':
             /** @noinspection PhpUnusedLocalVariableInspection */
             $pList = new \Modules\Production\Models\ProductionList($this->app->dbPool);
             /** @noinspection PhpIncludeInspection */
             include __DIR__ . '/Theme/Backend/guideline-list.tpl.php';
             break;
         case 'single':
             /** @noinspection PhpIncludeInspection */
             include __DIR__ . '/Theme/Backend/guideline-single.tpl.php';
             break;
     }
 }
Exemplo n.º 6
0
 /**
  * Shows module content
  *
  * @param \phpOMS\Message\RequestAbstract  $request  Request
  * @param \phpOMS\Message\ResponseAbstract $response Response
  *
  * @since  1.0.0
  * @author Dennis Eichhorn <*****@*****.**>
  */
 public function showBackendAccount($request, $response)
 {
     switch ($request->getPath(4)) {
         case 'list':
             /** @noinspection PhpUnusedLocalVariableInspection */
             $accountList = new \Modules\Accounting\Models\AccountList($this->app->dbPool);
             /** @noinspection PhpIncludeInspection */
             include __DIR__ . '/Theme/Backend/account-list.tpl.php';
             break;
         case 'postings':
             /** @noinspection PhpIncludeInspection */
             include __DIR__ . '/Theme/Backend/account-postings.tpl.php';
             break;
         case 'balance':
             /** @noinspection PhpIncludeInspection */
             include __DIR__ . '/Theme/Backend/account-balance.tpl.php';
             break;
         case 'single':
             /** @noinspection PhpIncludeInspection */
             include __DIR__ . '/Theme/Backend/account-single.tpl.php';
             break;
         case 'create':
             /** @noinspection PhpIncludeInspection */
             include __DIR__ . '/Theme/Backend/account-create.tpl.php';
             break;
         default:
             $response->setHeader('HTTP', 'HTTP/1.0 404 Not Found');
             $response->setHeader('Status', 'Status: 404 Not Found');
             include __DIR__ . '/../../Web/Backend/404.tpl.php';
             return;
     }
 }
Exemplo n.º 7
0
 /**
  * Shows module content
  *
  * @param \phpOMS\Message\RequestAbstract  $request  Request
  * @param \phpOMS\Message\ResponseAbstract $response Response
  *
  * @since  1.0.0
  * @author Dennis Eichhorn <*****@*****.**>
  */
 public function showContentBackendPrivate($request, $response)
 {
     switch ($request->getPath(4)) {
         case 'dashboard':
             $supportDashboardView = new \phpOMS\Views\View($this->app, $request, $response);
             $supportDashboardView->setTemplate('/Modules/Support/Theme/Backend/user-support-dashboard');
             $navigation = \Modules\Navigation\Models\Navigation::getInstance($request->getHash(), $this->app->dbPool);
             $supportDashboardView->addData('nav', $navigation->nav);
             echo $supportDashboardView->render();
             break;
     }
 }
Exemplo n.º 8
0
 /**
  * Shows module content
  *
  * @param \phpOMS\Message\RequestAbstract  $request  Request
  * @param \phpOMS\Message\ResponseAbstract $response Response
  *
  * @since  1.0.0
  * @author Dennis Eichhorn <*****@*****.**>
  */
 public function showContentBackendDepartment($request, $response)
 {
     switch ($request->getPath(4)) {
         case 'list':
             $departmentListView = new \phpOMS\Views\View($this->app, $request, $response);
             $departmentListView->setTemplate('/Modules/Business/Theme/Backend/department-list');
             $navigation = \Modules\Navigation\Models\Navigation::getInstance($request->getHash(), $this->app->dbPool);
             $departmentListView->addData('nav', $navigation->nav);
             echo $departmentListView->render();
             break;
         case 'create':
             $departmentCreateView = new \phpOMS\Views\View($this->app, $request, $response);
             $departmentCreateView->setTemplate('/Modules/Business/Theme/Backend/department-create');
             $navigation = \Modules\Navigation\Models\Navigation::getInstance($request->getHash(), $this->app->dbPool);
             $departmentCreateView->addData('nav', $navigation->nav);
             echo $departmentCreateView->render();
             break;
     }
 }
Exemplo n.º 9
0
 /**
  * Shows module content
  *
  * @param \phpOMS\Message\RequestAbstract  $request  Request
  * @param \phpOMS\Message\ResponseAbstract $response Response
  *
  * @since  1.0.0
  * @author Dennis Eichhorn <*****@*****.**>
  */
 public function showContentApi($request, $response)
 {
     switch ($request->getPath(3)) {
         case 'create':
             // TODO: validate parameter/query
             // TODO: handle creation
             // TODO: return success (at least a notify msg for user information)?
             // + created id + destination url IFF creator = (first) receiver
             break;
     }
 }
Exemplo n.º 10
0
 /**
  * Shows api content
  *
  * @param \phpOMS\Message\RequestAbstract  $request  Request
  * @param \phpOMS\Message\ResponseAbstract $response Response
  *
  * @since  1.0.0
  * @author Dennis Eichhorn <*****@*****.**>
  */
 private function showAPI($request, $response)
 {
     switch ($request->getPath(3)) {
         case 'module':
             $this->apiModule($request, $response);
             break;
     }
 }
Exemplo n.º 11
0
 /**
  * Shows module content
  *
  * @param \phpOMS\Message\RequestAbstract  $request  Request
  * @param \phpOMS\Message\ResponseAbstract $response Response
  *
  * @since  1.0.0
  * @author Dennis Eichhorn <*****@*****.**>
  */
 public function showBackendAnalysis($request)
 {
     switch ($request->getPath(4)) {
         case 'dashboard':
             /** @noinspection PhpIncludeInspection */
             include __DIR__ . '/Theme/Backend/analysis-dashboard.tpl.php';
             break;
     }
 }
Exemplo n.º 12
0
 /**
  * Shows module content
  *
  * @param \phpOMS\Message\RequestAbstract  $request  Request
  * @param \phpOMS\Message\ResponseAbstract $response Response
  *
  * @since  1.0.0
  * @author Dennis Eichhorn <*****@*****.**>
  */
 public function showContentBackend($request, $response)
 {
     switch ($request->getPath(3)) {
     }
 }
Exemplo n.º 13
0
 /**
  * Shows module content
  *
  * @param \phpOMS\Message\RequestAbstract  $request  Request
  * @param \phpOMS\Message\ResponseAbstract $response Response
  *
  * @since  1.0.0
  * @author Dennis Eichhorn <*****@*****.**>
  */
 public function showContentBackend($request, $response)
 {
     switch ($request->getPath(3)) {
         case 'dashboard':
             $newsDashboard = new \phpOMS\Views\View($this->app, $request, $response);
             $newsDashboard->setTemplate('/Modules/News/Theme/Backend/news-dashboard');
             $navigation = \Modules\Navigation\Models\Navigation::getInstance($request->getHash(), $this->app->dbPool);
             $newsDashboard->addData('nav', $navigation->nav);
             echo $newsDashboard->render();
             break;
         case 'single':
             $article = new \Modules\News\Models\Article($this->app->dbPool);
             $article->init($request->getData('id'));
             /** @noinspection PhpIncludeInspection */
             include __DIR__ . '/Theme/Backend/news-single.tpl.php';
             break;
         case 'archive':
             $newArchive = new \phpOMS\Views\View($this->app, $request, $response);
             $newArchive->setTemplate('/Modules/News/Theme/Backend/news-archive');
             $navigation = \Modules\Navigation\Models\Navigation::getInstance($request->getHash(), $this->app->dbPool);
             $newArchive->addData('nav', $navigation->nav);
             echo $newArchive->render();
             break;
         case 'create':
             $newsCreate = new \phpOMS\Views\View($this->app, $request, $response);
             $newsCreate->setTemplate('/Modules/News/Theme/Backend/news-create');
             $navigation = \Modules\Navigation\Models\Navigation::getInstance($request->getHash(), $this->app->dbPool);
             $newsCreate->addData('nav', $navigation->nav);
             echo $newsCreate->render();
             break;
         default:
             $response->setHeader('HTTP', 'HTTP/1.0 404 Not Found');
             $response->setHeader('Status', 'Status: 404 Not Found');
             include __DIR__ . '/../../Web/Backend/404.tpl.php';
             return;
     }
 }
Exemplo n.º 14
0
 /**
  * Shows api content
  *
  * @param \phpOMS\Message\RequestAbstract  $request  Request
  * @param \phpOMS\Message\ResponseAbstract $response Response
  *
  * @since  1.0.0
  * @author Dennis Eichhorn <*****@*****.**>
  */
 public function showAPI($request, $response)
 {
     switch ($request->getPath(3)) {
         case 'export':
             switch ($request->getData('type')) {
                 case 'pdf':
                     $response->setHeader('Content-Type', \phpOMS\System\MimeType::M_PDF, true);
                     break;
                 case 'csv':
                     $response->setHeader('Content-Type', \phpOMS\System\MimeType::M_CONF, true);
                     break;
                 case 'xlsx':
                     $response->setHeader('Content-Type', \phpOMS\System\MimeType::M_XLSX, true);
                     break;
                 case 'json':
                     $response->setHeader('Content-Type', \phpOMS\System\MimeType::M_JSON, true);
                     break;
                 default:
                     // TODO handle bad request
             }
             if ($request->getData('download') !== null) {
                 $response->setHeader('Content-Type', \phpOMS\System\MimeType::M_BIN, true);
                 $response->setHeader('Content-Transfer-Encoding', 'Binary', true);
                 $response->setHeader('Content-disposition', 'attachment; filename="' . $request->getData('id') . '.' . $request->getData('type') . '"', true);
             }
             /** @var array $reportLanguage */
             /** @noinspection PhpIncludeInspection */
             include_once __DIR__ . '/Templates/' . $request->getData('id') . '/' . $request->getData('id') . '.lang.php';
             $pdfView = new \phpOMS\Views\View($this->app, $request, $response);
             $pdfView->addData('lang', $reportLanguage[$this->app->accountManager->get($request->getAccount())->getL11n()->getLanguage()]);
             $pdfView->setTemplate('/Modules/Reporter/Templates/' . $request->getData('id') . '/' . $request->getData('id') . '.' . $request->getData('type'));
             $response->set('GLOBAL', $pdfView->render());
             break;
     }
 }