/** * @return Form */ private function formRelationship() { $tblTypeAll = Relationship::useService()->getTypeAll(); $tblPersonAll = Person::useService()->getPersonAll(); array_walk($tblPersonAll, function (TblPerson &$tblPerson) { $tblPerson = new PullClear(new PullLeft(new RadioBox('To', $tblPerson->getFullName(), $tblPerson->getId())) . new PullRight(new Standard('', '/People/Person/Relationship/Create', new PersonIcon(), array('Id' => $tblPerson->getId()), 'zu' . ' ' . $tblPerson->getSalutation() . ' ' . $tblPerson->getTitle() . ' ' . $tblPerson->getLastName() . ' wechseln'))); }); return new Form(new FormGroup(array(new FormRow(array(new FormColumn(array(new Panel('hat folgende Beziehung', array(new SelectBox('Type[Type]', 'Beziehungstyp', array('{{ Name }} {{ Description }}' => $tblTypeAll), new TileBig()), new TextArea('Type[Remark]', 'Bemerkungen - z.B: Mutter / Vater / ..', 'Bemerkungen', new Pencil()), new \SPHERE\Common\Frontend\Text\Repository\Danger(new Info() . ' Es dürfen ausschließlich für die Schulverwaltung notwendige Informationen gespeichert werden.')), Panel::PANEL_TYPE_INFO)), 6), new FormColumn(array(new Panel(new PullClear('zu folgender Person' . new PullRight(new Standard('Neue Person anlegen', '/People/Person', new PersonIcon(), array(), 'Die aktuell gewählte Person verlassen'))), $tblPersonAll, Panel::PANEL_TYPE_INFO, null, 15)), 6)))))); }
/** * @return Layout */ public function frontendLayoutToken() { $tblTokenAll = Token::useService()->getTokenAllByConsumer(Consumer::useService()->getConsumerBySession()); if ($tblTokenAll !== false) { array_walk($tblTokenAll, function (TblToken &$tblToken) { $Serial = $tblToken->getSerial(); $Serial = substr($Serial, 0, 4) . ' ' . substr($Serial, 4, 4); $Content = array(); $tblAccountAll = $tblToken->getAccountAllByToken(); if (!empty($tblAccountAll)) { array_walk($tblAccountAll, function (TblAccount &$tblAccount) { $tblAccount = new PullClear(new PullLeft(new PersonKey() . ' ' . $tblAccount->getUsername()) . new PullRight(new Standard('', '/Setting/Authorization/Account', new PersonKey(), array('Id' => $tblAccount->getId()), 'zu ' . $tblAccount->getUsername() . ' wechseln'))); }); $Content = array_merge($Content, $tblAccountAll); $Content = array_filter($Content); array_unshift($Content, new Info(new Exclamation() . ' ' . new Small('Benutzerkonten verknüpft'))); } else { $Content = array(new Muted(new Small('Keine Benutzerkonten verknüpft')), new Muted(new Small('Der Schlüssel kann gefahrlos entfernt werden'))); } $tblToken = new LayoutColumn(new Panel(new YubiKey() . ' ' . $Serial, $Content, Panel::PANEL_TYPE_INFO, empty($tblAccountAll) ? new Standard('', '/Setting/Authorization/Token/Destroy', new Remove(), array('Id' => $tblToken->getId()), 'Schlüssel ' . $Serial . ' löschen') : new Muted(new Small('Der Schlüssel kann nicht entfernt werden'))), 3); }); } else { $tblTokenAll = array(new LayoutColumn(new Warning('Keine Hardware-Schlüssel hinterlegt'))); } $LayoutRowList = array(); $LayoutRowCount = 0; $LayoutRow = null; /** * @var LayoutColumn $tblToken */ foreach ($tblTokenAll as $tblToken) { if ($LayoutRowCount % 4 == 0) { $LayoutRow = new LayoutRow(array()); $LayoutRowList[] = $LayoutRow; } $LayoutRow->addColumn($tblToken); $LayoutRowCount++; } return new Layout(new LayoutGroup($LayoutRowList)); }
/** * @param TblToCompany $tblToCompany * * @return Form */ private function formRelationshipToCompany(TblToCompany $tblToCompany = null) { $PanelSelectCompanyTitle = new PullClear('zu folgender Firma' . new PullRight(new Standard('Neue Firma anlegen', '/Corporation/Company', new Building(), array(), 'Die aktuell gewählte Person verlassen'))); if ($tblToCompany) { $Global = $this->getGlobal(); if (!isset($Global->POST['To'])) { $Global->POST['Type']['Type'] = $tblToCompany->getTblType()->getId(); $Global->POST['Type']['Remark'] = $tblToCompany->getRemark(); $Global->POST['To'] = $tblToCompany->getServiceTblCompany()->getId(); $Global->POST['PanelSearch-' . sha1($PanelSelectCompanyTitle)] = $tblToCompany->getServiceTblCompany()->getName(); $Global->savePost(); } } $tblTypeAll = Relationship::useService()->getTypeAll(); $tblCompanyAll = Company::useService()->getCompanyAll(); array_walk($tblCompanyAll, function (TblCompany &$tblCompany) { $tblCompany = new PullClear(new RadioBox('To', $tblCompany->getName() . ($tblCompany->getDescription() ? ' - ' . $tblCompany->getDescription() : ''), $tblCompany->getId())); }); return new Form(new FormGroup(array(new FormRow(array(new FormColumn(array(new Panel('hat folgende Beziehung', array(new SelectBox('Type[Type]', 'Beziehungstyp', array('{{ Name }} {{ Description }}' => $tblTypeAll), new TileBig()), new TextArea('Type[Remark]', 'Bemerkungen - z.B: Schulleiter / Geschäftsführer / ..', 'Bemerkungen', new Pencil()), new \SPHERE\Common\Frontend\Text\Repository\Danger(new Info() . ' Es dürfen ausschließlich für die Schulverwaltung notwendige Informationen gespeichert werden.')), Panel::PANEL_TYPE_INFO)), 6), new FormColumn(array(new Panel($PanelSelectCompanyTitle, $tblCompanyAll, Panel::PANEL_TYPE_INFO, null, 15)), 6)))))); }
/** * @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)))))); }
/** * @return Form */ private function formSponsorAssociationCompanyDelete() { $PanelSelectCompanyTitle = new PullClear('Implementierte Fördervereine:'); $tblSponsorAssociationAll = SponsorAssociation::useService()->getSponsorAssociationAll(); array_walk($tblSponsorAssociationAll, function (TblSponsorAssociation &$tblSponsorAssociation) { $tblCompany = $tblSponsorAssociation->getServiceTblCompany(); $tblSponsorAssociation = new PullClear(new RadioBox('SponsorAssociation', $tblCompany->getName() . ' ' . new Success($tblCompany->getDescription()), $tblSponsorAssociation->getId())); }); return new Form(new FormGroup(array(new FormRow(array(new FormColumn(array(new Panel($PanelSelectCompanyTitle, $tblSponsorAssociationAll, Panel::PANEL_TYPE_INFO, null, 15)), 12)))))); }
/** * @return Form */ private function formResponsibilityCompanyDelete() { $PanelSelectCompanyTitle = new PullClear('Implementierte Schulträger:'); $tblResponsibilityAll = Responsibility::useService()->getResponsibilityAll(); array_walk($tblResponsibilityAll, function (TblResponsibility &$tblResponsibility) { $tblCompany = $tblResponsibility->getServiceTblCompany(); $tblResponsibility = new PullClear(new RadioBox('Responsibility', $tblCompany->getName() . ' ' . new Success($tblCompany->getDescription()), $tblResponsibility->getId())); }); return new Form(new FormGroup(array(new FormRow(array(new FormColumn(array(new Panel($PanelSelectCompanyTitle, $tblResponsibilityAll, Panel::PANEL_TYPE_INFO, null, 15)), 12)))))); }