/** * @return bool|TblType */ public function getTblType() { if (null === $this->tblType) { return false; } else { return School::useService()->getTypeById($this->tblType); } }
public static function registerApplication() { School::registerModule(); Responsibility::registerModule(); SponsorAssociation::registerModule(); Main::getDisplay()->addApplicationNavigation(new Link(new Link\Route(__NAMESPACE__), new Link\Name('Mandant'), new Link\Icon(new Building()))); Main::getDispatcher()->registerRoute(Main::getDispatcher()->createRoute(__NAMESPACE__, __CLASS__ . '::frontendDashboard')); $tblSchoolAll = School::useService()->getSchoolAll(); if ($tblSchoolAll) { /** @var TblSchool $tblSchool */ foreach ((array) $tblSchoolAll as $Index => $tblSchool) { $tblSchoolAll[$tblSchool->getServiceTblCompany()->getName() . $tblSchool->getTblType()->getName()] = new Layout(new LayoutGroup(new LayoutRow(array(new LayoutColumn($tblSchool->getServiceTblCompany()->getName() . new Muted(new Small('<br/>' . $tblSchool->getTblType()->getName())), 12))))); $tblSchoolAll[$Index] = false; } $tblSchoolAll = array_filter($tblSchoolAll); } $tblResponsibilityAll = Responsibility::useService()->getResponsibilityAll(); if ($tblResponsibilityAll) { /** @var TblResponsibility $tblResponsibility */ foreach ((array) $tblResponsibilityAll as $Index => $tblResponsibility) { $tblResponsibilityAll[$tblResponsibility->getServiceTblCompany()->getName()] = new Layout(new LayoutGroup(new LayoutRow(array(new LayoutColumn($tblResponsibility->getServiceTblCompany()->getName() . new Muted(new Small('<br/>' . $tblResponsibility->getServiceTblCompany()->getDescription())), 12))))); $tblResponsibilityAll[$Index] = false; } $tblResponsibilityAll = array_filter($tblResponsibilityAll); } $tblSponsorAssociationAll = SponsorAssociation::useService()->getSponsorAssociationAll(); if ($tblSponsorAssociationAll) { /** @var TblSponsorAssociation $tblSponsorAssociation */ foreach ((array) $tblSponsorAssociationAll as $Index => $tblSponsorAssociation) { $tblSponsorAssociationAll[$tblSponsorAssociation->getServiceTblCompany()->getName()] = new Layout(new LayoutGroup(new LayoutRow(array(new LayoutColumn($tblSponsorAssociation->getServiceTblCompany()->getName() . new Muted(new Small('<br/>' . $tblSponsorAssociation->getServiceTblCompany()->getDescription())), 12))))); $tblSponsorAssociationAll[$Index] = false; } $tblSponsorAssociationAll = array_filter($tblSponsorAssociationAll); } if (empty($tblSchoolAll)) { $tblSchoolAll = new Layout(new LayoutGroup(new LayoutRow(array(new LayoutColumn(array(new Muted('Kein Eintrag'), new PullRight(new Standard(new Pencil(), '/Setting/Consumer/School/Create'))), 12))))); } if (empty($tblResponsibilityAll)) { $tblResponsibilityAll = new Layout(new LayoutGroup(new LayoutRow(array(new LayoutColumn(array(new Muted('Kein Eintrag'), new PullRight(new Standard(new Pencil(), '/Setting/Consumer/Responsibility/Create'))), 12))))); } if (empty($tblSponsorAssociationAll)) { $tblSponsorAssociationAll = new Layout(new LayoutGroup(new LayoutRow(array(new LayoutColumn(array(new Muted('Kein Eintrag'), new PullRight(new Standard(new Pencil(), '/Setting/Consumer/SponsorAssociation/Create'))), 12))))); } Main::getDispatcher()->registerWidget('Consumer', new Panel('Schule', $tblSchoolAll), 2, 2); Main::getDispatcher()->registerWidget('Consumer', new Panel('Schulträger', $tblResponsibilityAll), 2, 2); Main::getDispatcher()->registerWidget('Consumer', new Panel('Förderverein', $tblSponsorAssociationAll), 2, 2); }
/** * @return Form */ private function formSchoolCompanyDelete() { $PanelSelectCompanyTitle = new PullClear('Implementierte Schulen:'); $tblSchoolAll = School::useService()->getSchoolAll(); array_walk($tblSchoolAll, function (TblSchool &$tblSchool) { $tblCompany = $tblSchool->getServiceTblCompany(); $tblType = $tblSchool->getTblType(); $tblSchool = new PullClear(new RadioBox('School', $tblCompany->getName() . ' <b>Typ: ' . $tblType->getName() . '</b>', $tblSchool->getId())); }); return new Form(new FormGroup(array(new FormRow(array(new FormColumn(array(new Panel($PanelSelectCompanyTitle, $tblSchoolAll, Panel::PANEL_TYPE_INFO, null, 15)), 12)))))); }