public function frontendScoreTypeRemove($Id)
 {
     $Stage = new Stage('Zensurtyp', 'Entfernen');
     if ($ScoreType = ScoreType::useService()->getScoreTypeById($Id)) {
         $Stage->setContent(ScoreType::useService()->removeScoreType($ScoreType));
     } else {
         $Stage->setContent(new Danger('Der Zensurentyp konnte nicht gelöscht werden') . new Redirect('/Education/Graduation/ScoreType', 2));
     }
     return $Stage;
 }
 /**
  * @param TblPerson $tblPerson
  * @param array     $Meta
  *
  * @return Stage
  */
 public function frontendMeta(TblPerson $tblPerson = null, $Meta = array())
 {
     $Stage = new Stage();
     $Stage->setMessage(new Danger(new Info() . ' Es dürfen ausschließlich für die Schulverwaltung notwendige Informationen gespeichert werden.'));
     $Stage->setContent((new Form(array(new FormGroup(array(new FormRow(array(new FormColumn(new Panel('Berufliches', array(new AutoCompleter('Meta[Occupation]', 'Beruf', 'Beruf', array(), new MapMarker()), new AutoCompleter('Meta[Employment]', 'Arbeitsstelle', 'Arbeitsstelle', array(), new Nameplate())), Panel::PANEL_TYPE_INFO), 6), new FormColumn(new Panel('Sonstiges', array(new TextArea('Meta[Remark]', 'Bemerkungen', 'Bemerkungen', new Pencil())), Panel::PANEL_TYPE_INFO), 6)))))), new Primary('Informationen speichern')))->setConfirm('Eventuelle Änderungen wurden noch nicht gespeichert.'));
     return $Stage;
 }
示例#3
0
 /**
  * @param TblPerson $tblPerson
  * @param array     $Meta
  *
  * @return Stage
  */
 public function frontendMeta(TblPerson $tblPerson = null, $Meta = array())
 {
     $Stage = new Stage();
     $Stage->setMessage(new Danger(new Info() . ' Es dürfen ausschließlich für die Schulverwaltung notwendige Informationen gespeichert werden.'));
     if (null !== $tblPerson) {
         $Global = $this->getGlobal();
         if (!isset($Global->POST['Meta'])) {
             /** @var TblCommon $tblCommon */
             $tblCommon = Common::useService()->getCommonByPerson($tblPerson);
             if ($tblCommon) {
                 $Global->POST['Meta']['Remark'] = $tblCommon->getRemark();
                 /** @var TblCommonBirthDates $tblCommonBirthDates */
                 $tblCommonBirthDates = $tblCommon->getTblCommonBirthDates();
                 if ($tblCommonBirthDates) {
                     $Global->POST['Meta']['BirthDates']['Birthday'] = $tblCommonBirthDates->getBirthday();
                     $Global->POST['Meta']['BirthDates']['Birthplace'] = $tblCommonBirthDates->getBirthplace();
                     $Global->POST['Meta']['BirthDates']['Gender'] = $tblCommonBirthDates->getGender();
                 }
                 /** @var TblCommonInformation $tblCommonInformation */
                 $tblCommonInformation = $tblCommon->getTblCommonInformation();
                 if ($tblCommonInformation) {
                     $Global->POST['Meta']['Information']['Nationality'] = $tblCommonInformation->getNationality();
                     $Global->POST['Meta']['Information']['Denomination'] = $tblCommonInformation->getDenomination();
                     $Global->POST['Meta']['Information']['IsAssistance'] = $tblCommonInformation->getIsAssistance();
                     $Global->POST['Meta']['Information']['AssistanceActivity'] = $tblCommonInformation->getAssistanceActivity();
                 }
                 $Global->savePost();
             }
         }
     }
     $Stage->setContent(Common::useService()->createMeta((new Form(array(new FormGroup(array(new FormRow(array(new FormColumn(array(new Panel('Geburtsdaten', array(new DatePicker('Meta[BirthDates][Birthday]', 'Geburtstag', 'Geburtstag', new Calendar()), new AutoCompleter('Meta[BirthDates][Birthplace]', 'Geburtsort', 'Geburtsort', array(), new MapMarker()), new SelectBox('Meta[BirthDates][Gender]', 'Geschlecht', array(TblCommonBirthDates::VALUE_GENDER_NULL => '', TblCommonBirthDates::VALUE_GENDER_MALE => 'Männlich', TblCommonBirthDates::VALUE_GENDER_FEMALE => 'Weiblich'), new Child())), Panel::PANEL_TYPE_INFO), new Panel('Sonstiges', array(new TextArea('Meta[Remark]', 'Bemerkungen', 'Bemerkungen', new Pencil())), Panel::PANEL_TYPE_INFO)), 6), new FormColumn(array(new Panel('Informationen', array(new AutoCompleter('Meta[Information][Nationality]', 'Staatsangehörigkeit', 'Staatsangehörigkeit', array(), new Nameplate()), new AutoCompleter('Meta[Information][Denomination]', 'Konfession', 'Konfession', array(), new TempleChurch()), new SelectBox('Meta[Information][IsAssistance]', 'Mitarbeitsbereitschaft', array(TblCommonInformation::VALUE_IS_ASSISTANCE_NULL => '', TblCommonInformation::VALUE_IS_ASSISTANCE_YES => 'Ja', TblCommonInformation::VALUE_IS_ASSISTANCE_NO => 'Nein'), new Sheriff()), new TextArea('Meta[Information][AssistanceActivity]', 'Mitarbeitsbereitschaft - Tätigkeiten', 'Mitarbeitsbereitschaft - Tätigkeiten', new Pencil())), Panel::PANEL_TYPE_INFO)), 6)))))), new Primary('Informationen speichern')))->setConfirm('Eventuelle Änderungen wurden noch nicht gespeichert.'), $tblPerson, $Meta));
     return $Stage;
 }
 public function frontendUpload()
 {
     $Stage = new Stage('Upload', 'Form-Test');
     $this->getDebugger()->screenDump($this->getUpload('FileUpload', __DIR__)->validateMaxSize('5M')->validateMimeType('image/png')->doUpload());
     $Stage->setContent((new Form(new FormGroup(new FormRow(new FormColumn(array(new FileUpload('FileUpload', 'FileUpload', 'FileUpload')))))))->appendFormButton(new Primary('Hochladen', new Upload())));
     return $Stage;
 }
示例#5
0
 /**
  * @param TblPerson $tblPerson
  * @param array     $Meta
  *
  * @return Stage
  */
 public function frontendMeta(TblPerson $tblPerson = null, $Meta = array())
 {
     $Stage = new Stage();
     $Stage->setMessage(new Warning(new Danger(new \SPHERE\Common\Frontend\Icon\Repository\Warning() . ' Speichern der Schülerakte in aktueller Demo-Version noch nicht möglich')) . new Danger(new Info() . ' Es dürfen ausschließlich für die Schulverwaltung notwendige Informationen gespeichert werden.'));
     $Stage->setContent((new Form(array($this->formGroupTransfer($tblPerson, $Meta), $this->formGroupGeneral($tblPerson, $Meta), $this->formGroupSubject($tblPerson, $Meta), $this->formGroupIntegration($tblPerson, $Meta)), new Primary('Informationen speichern')))->setConfirm('Eventuelle Änderungen wurden noch nicht gespeichert.'));
     return $Stage;
 }
示例#6
0
 /**
  * @param TblPerson $tblPerson
  * @param array     $Meta
  *
  * @return Stage
  */
 public function frontendMeta(TblPerson $tblPerson = null, $Meta = array())
 {
     $Stage = new Stage();
     $Stage->setMessage(new Danger(new Info() . ' Es dürfen ausschließlich für die Schulverwaltung notwendige Informationen gespeichert werden.'));
     $tblCompanyAllSchool = Group::useService()->getCompanyAllByGroup(Group::useService()->getGroupByMetaTable('SCHOOL'));
     array_push($tblCompanyAllSchool, new TblCompany());
     if (null !== $tblPerson) {
         $Global = $this->getGlobal();
         if (!isset($Global->POST['Meta'])) {
             /** @var TblProspect $tblProspect */
             $tblProspect = Prospect::useService()->getProspectByPerson($tblPerson);
             if ($tblProspect) {
                 $Global->POST['Meta']['Remark'] = $tblProspect->getRemark();
                 /** @var TblProspectAppointment $tblProspectAppointment */
                 $tblProspectAppointment = $tblProspect->getTblProspectAppointment();
                 if ($tblProspectAppointment) {
                     $Global->POST['Meta']['Appointment']['ReservationDate'] = $tblProspectAppointment->getReservationDate();
                     $Global->POST['Meta']['Appointment']['InterviewDate'] = $tblProspectAppointment->getInterviewDate();
                     $Global->POST['Meta']['Appointment']['TrialDate'] = $tblProspectAppointment->getTrialDate();
                 }
                 /** @var TblProspectReservation $tblProspectReservation */
                 $tblProspectReservation = $tblProspect->getTblProspectReservation();
                 if ($tblProspectReservation) {
                     $Global->POST['Meta']['Reservation']['Year'] = $tblProspectReservation->getReservationYear();
                     $Global->POST['Meta']['Reservation']['Division'] = $tblProspectReservation->getReservationDivision();
                     $Global->POST['Meta']['Reservation']['SchoolOptionA'] = $tblProspectReservation->getServiceTblCompanyOptionA() ? $tblProspectReservation->getServiceTblCompanyOptionA()->getId() : 0;
                     $Global->POST['Meta']['Reservation']['SchoolOptionB'] = $tblProspectReservation->getServiceTblCompanyOptionB() ? $tblProspectReservation->getServiceTblCompanyOptionB()->getId() : 0;
                 }
                 $Global->savePost();
             }
         }
     }
     $Stage->setContent(Prospect::useService()->createMeta((new Form(array(new FormGroup(array(new FormRow(array(new FormColumn(array(new Panel('Termine', array(new DatePicker('Meta[Appointment][ReservationDate]', 'Eingangsdatum', 'Eingangsdatum', new Calendar()), new DatePicker('Meta[Appointment][InterviewDate]', 'Aufnahmegespräch', 'Aufnahmegespräch', new Calendar()), new DatePicker('Meta[Appointment][TrialDate]', 'Schnuppertag', 'Schnuppertag', new Calendar())), Panel::PANEL_TYPE_INFO)), 3), new FormColumn(array(new Panel('Voranmeldung für', array(new TextField('Meta[Reservation][Year]', 'Schuljahr', 'Schuljahr'), new TextField('Meta[Reservation][Division]', 'Klassenstufe', 'Klassenstufe'), new SelectBox('Meta[Reservation][SchoolOptionA]', 'Schule: Option 1', array('{{ Name }} {{ Description }}' => $tblCompanyAllSchool), new Education()), new SelectBox('Meta[Reservation][SchoolOptionB]', 'Schule: Option 2', array('{{ Name }} {{ Description }}' => $tblCompanyAllSchool), new Education())), Panel::PANEL_TYPE_INFO)), 4), new FormColumn(array(new Panel('Sonstiges', array(new TextArea('Meta[Remark]', 'Bemerkungen', 'Bemerkungen', new Pencil())), Panel::PANEL_TYPE_INFO)), 5)))))), new Primary('Informationen speichern')))->setConfirm('Eventuelle Änderungen wurden noch nicht gespeichert.'), $tblPerson, $Meta));
     return $Stage;
 }
示例#7
0
 /**
  * @param string $ConsumerAcronym
  * @param string $ConsumerName
  *
  * @return Stage
  */
 public static function frontendConsumer($ConsumerAcronym, $ConsumerName)
 {
     $Stage = new Stage('Mandanten');
     $tblConsumerAll = Consumer::useService()->getConsumerAll();
     $Stage->setContent(new TableData($tblConsumerAll, new Title('Bestehende Mandanten'), array('Acronym' => 'Mandanten-Kürzel', 'Name' => 'Mandanten-Name')) . Consumer::useService()->createConsumer(new Form(new FormGroup(new FormRow(array(new FormColumn(new TextField('ConsumerAcronym', 'Kürzel des Mandanten', 'Kürzel des Mandanten'), 4), new FormColumn(new TextField('ConsumerName', 'Name des Mandanten', 'Name des Mandanten'), 8))), new \SPHERE\Common\Frontend\Form\Repository\Title('Mandant anlegen')), new Primary('Hinzufügen')), $ConsumerAcronym, $ConsumerName));
     return $Stage;
 }
 /**
  * @return Stage
  */
 public function frontendMeta(TblPerson $tblPerson = null, $Meta = array())
 {
     $Stage = new Stage();
     $Stage->setMessage(new Danger(new Info() . ' Es dürfen ausschließlich für die Schulverwaltung notwendige Informationen gespeichert werden.'));
     $Stage->setContent((new Form(array(new FormGroup(array(new FormRow(array(new FormColumn(new DatePicker('Meta[ReservationDate]', 'Eingangsdatum', 'Eingangsdatum', new Calendar()), 4), new FormColumn(new DatePicker('Meta[InterviewDate]', 'Aufnahmegespräch', 'Aufnahmegespräch', new Calendar()), 4), new FormColumn(new DatePicker('Meta[TrialDate]', 'Schnuppertag', 'Schnuppertag', new Calendar()), 4)))), new Title('Termine')), new FormGroup(array(new FormRow(array(new FormColumn(new TextField('Meta[ReservationYear]', 'Schuljahr', 'Schuljahr'), 6), new FormColumn(new TextField('Meta[ReservationDivision]', 'Klassenstufe', 'Klassenstufe'), 6)))), new Title('Voranmeldung', 'für')), new FormGroup(array(new FormRow(array(new FormColumn(array(new TextArea('Meta[Remark]', 'Bemerkungen', 'Bemerkungen', new Pencil())))))), new Title('Sonstiges'))), new Primary('Informationen speichern')))->setConfirm('Eventuelle Änderungen wurden noch nicht gespeichert.'));
     return $Stage;
 }
示例#9
0
 /**
  * @return Stage
  */
 public function frontendDashboard()
 {
     $Stage = new Stage('Dashboard', 'System');
     $Value = 100 / disk_total_space(__DIR__) * disk_free_space(__DIR__);
     Main::getDispatcher()->registerWidget('System', new Panel('Festplattenkapazität', array('<div class="progress" style="margin-bottom: 0;">
                       <div class="progress-bar progress-bar-success" style="width: ' . $Value . '%"></div>
                       <div class="progress-bar progress-bar-danger" style="width: ' . (100 - $Value) . '%"></div>
                     </div>', 'Gesamt: ' . number_format(disk_total_space(__DIR__), 0, ',', '.'), 'Frei: ' . number_format(disk_free_space(__DIR__), 0, ',', '.'))), 2, 2);
     $free = shell_exec('free');
     $free = (string) trim($free);
     $free_arr = explode("\n", $free);
     $mem = explode(" ", $free_arr[1]);
     $mem = array_filter($mem);
     $mem = array_merge($mem);
     $Value = $mem[2] / $mem[1] * 100;
     Main::getDispatcher()->registerWidget('System', new Panel('Speicherkapazität', array('<div class="progress" style="margin-bottom: 0;">
           <div class="progress-bar progress-bar-success" style="width: ' . $Value . '%"></div>
           <div class="progress-bar progress-bar-danger" style="width: ' . (100 - $Value) . '%"></div>
         </div>', 'Gesamt: ' . number_format($mem[1], 0, ',', '.'), 'Frei: ' . number_format($mem[2], 0, ',', '.'))), 2, 2);
     $load = sys_getloadavg();
     Main::getDispatcher()->registerWidget('System', new Panel('Rechenkapazität', array('<div class="progress" style="margin-bottom: 0;">
           <div class="progress-bar progress-bar-success" style="width: ' . 50 * (2 - $load[0]) . '%"></div>
           <div class="progress-bar progress-bar-danger" style="width: ' . 50 * $load[0] . '%"></div>
         </div>', 'Genutzt: ' . number_format($load[0], 5, ',', '.'), 'Frei: ' . number_format(2 - $load[0], 5, ',', '.'))), 2, 2);
     $Stage->setContent(Main::getDispatcher()->fetchDashboard('System'));
     return $Stage;
 }
示例#10
0
 /**
  * @param null|string $CredentialKey
  *
  * @return Stage
  */
 public function frontendYubiKey($CredentialKey)
 {
     $Stage = new Stage('Hardware-Schlüssel', 'YubiKey');
     $tblTokenAll = Token::useService()->getTokenAll();
     if ($tblTokenAll) {
         array_walk($tblTokenAll, function (TblToken &$tblToken) {
             /** @noinspection PhpUndefinedFieldInspection */
             $tblToken->Name = strtoupper($tblToken->getIdentifier());
             strtoupper($tblToken->getIdentifier());
             if ($tblToken->getSerial() % 2 != 0) {
                 /** @noinspection PhpUndefinedFieldInspection */
                 $tblToken->Number = '0' . $tblToken->getSerial();
             } else {
                 /** @noinspection PhpUndefinedFieldInspection */
                 $tblToken->Number = $tblToken->getSerial();
             }
             /** @noinspection PhpUndefinedFieldInspection */
             $tblToken->Number = substr($tblToken->Number, 0, 4) . ' ' . substr($tblToken->Number, 4, 4);
             /** @noinspection PhpUndefinedFieldInspection */
             $tblToken->Option = new Danger('Löschen', '/Platform/Gatekeeper/Authorization/Access/PrivilegeGrantRight', new Remove(), array('Id' => $tblToken->getId()), 'Löschen');
         });
     }
     $Stage->setContent(($tblTokenAll ? new TableData($tblTokenAll, new Title('Bestehende Hardware-Schlüssel'), array('Name' => 'Name', 'Number' => 'Seriennummer')) : new Warning('Keine Hardware-Schlüssel vorhanden')) . Token::useService()->createToken(new Form(new FormGroup(new FormRow(new FormColumn(new PasswordField('CredentialKey', 'YubiKey', 'YubiKey'))), new \SPHERE\Common\Frontend\Form\Repository\Title('Hardware-Schlüssel anlegen')), new Primary('Hinzufügen')), $CredentialKey));
     return $Stage;
 }
示例#11
0
 /**
  * @return Stage
  */
 public function frontendMyAccount()
 {
     $Stage = new Stage('Profil', 'Mein Benutzerkonto');
     $tblAccount = Account::useService()->getAccountBySession();
     $Stage->setMessage('[' . $tblAccount->getServiceTblConsumer()->getAcronym() . '] ' . $tblAccount->getServiceTblConsumer()->getName());
     $Stage->setContent($tblAccount->getUsername());
     return $Stage;
 }
示例#12
0
 /**
  * @return Stage
  */
 public function frontendMeta(TblPerson $tblPerson = null, $Meta = array())
 {
     $Stage = new Stage();
     $tblCompanyAllSchool = Group::useService()->getCompanyAllByGroup(Group::useService()->getGroupByMetaTable('SCHOOL'));
     array_push($tblCompanyAllSchool, new TblCompany());
     $Stage->setMessage(new Danger(new Info() . ' Es dürfen ausschließlich für die Schulverwaltung notwendige Informationen gespeichert werden.'));
     $Stage->setContent((new Form(array(new FormGroup(array(new FormRow(array(new FormColumn(new Panel(new Hospital() . ' Krankenakte', array(new TextArea('Meta[MedicalRecord][Disease]', 'Krankheiten / Allergien', 'Krankheiten / Allergien', new Heart()), new TextArea('Meta[MedicalRecord][Medication]', 'Mediakamente', 'Mediakamente', new Medicine()), new SelectBox('Meta[MedicalRecord][AttendingDoctor]', 'Behandelnder Arzt', array(), new Stethoscope()), new SelectBox('Meta[MedicalRecord][InsuranceState]', 'Versicherungsstatus', array(0 => '', 1 => 'Pflicht', 2 => 'Freiwillig', 3 => 'Privat', 4 => 'Familie Vater', 5 => 'Familie Mutter'), new Lock()), new AutoCompleter('Meta[MedicalRecord][Insurance]', 'Krankenkasse', 'Krankenkasse', array(), new Shield())), Panel::PANEL_TYPE_DANGER), 3), new FormColumn(new Panel('Schulbeförderung', array(new TextField('Meta[Transport][Route]', 'Buslinie', 'Buslinie', new Bus()), new TextField('Meta[Transport][Station][Entrance]', 'Einstiegshaltestelle', 'Einstiegshaltestelle', new StopSign()), new TextField('Meta[Transport][Station][Exit]', 'Ausstiegshaltestelle', 'Ausstiegshaltestelle', new StopSign()), new TextArea('Meta[Transport][Remark]', 'Bemerkungen', 'Bemerkungen', new Pencil())), Panel::PANEL_TYPE_INFO), 3), new FormColumn(array(new Panel('Sonstiges', array(new DatePicker('Meta[Additional][BaptismDate]', 'Taufdatum', 'Taufdatum', new TempleChurch()), new TextField('Meta[Additional][BaptismLocation]', 'Taufort', 'Taufort', new MapMarker()), new TextField('Meta[Additional][Locker][Number]', 'Schließfachnummer', 'Schließfachnummer', new Lock()), new TextField('Meta[Additional][Locker][Location]', 'Schließfach Standort', 'Schließfach Standort', new MapMarker()), new TextField('Meta[Additional][Locker][Key]', 'Schlüssel Nummer', 'Schlüssel Nummer', new Key())), Panel::PANEL_TYPE_INFO)), 3), new FormColumn(array(new Panel('Erlaubnis zur Nutzung des Schüler-Fotos', array(new CheckBox('Meta[PicturePermission][Internal]', 'Schulschriften', 1), new CheckBox('Meta[PicturePermission][External]', 'Veröffentlichungen', 1), new CheckBox('Meta[PicturePermission][Internet]', 'Internetpräsenz', 1), new CheckBox('Meta[PicturePermission][Facebook]', 'Facebookseite', 1), new CheckBox('Meta[PicturePermission][Press]', 'Druckpresse', 1), new CheckBox('Meta[PicturePermission][Multimedia]', 'Ton/Video/Film', 1), new CheckBox('Meta[PicturePermission][Promotion]', 'Werbung in eigener Sache', 1)), Panel::PANEL_TYPE_INFO)), 3))), new FormRow(array(new FormColumn(new Panel('Integration 1', array(new CheckBox('Meta[Integration][CoachingRequired]', 'Förderbedarf', 1), new Aspect('Förderschwerpunkte:'), new CheckBox('Meta[Integration][PracticeModule][1]', 'Schwerpunkt A', 1), new CheckBox('Meta[Integration][PracticeModule][2]', 'Schwerpunkt B', 1), new CheckBox('Meta[Integration][PracticeModule][3]', 'Schwerpunkt C', 1), new Aspect('Teilleistungsstörungen:'), new CheckBox('Meta[Integration][Disorder][1]', 'Störung A', 1), new CheckBox('Meta[Integration][Disorder][2]', 'Störung B', 1), new CheckBox('Meta[Integration][Disorder][3]', 'Störung C', 1), new CheckBox('Meta[Integration][Disorder][4]', 'Störung D', 1), new CheckBox('Meta[Integration][Disorder][5]', 'Störung E', 1)), Panel::PANEL_TYPE_INFO), 4), new FormColumn(new Panel('Integration 2', array(new DatePicker('Meta[Integration][CoachingCounselDate]', 'Förderantrag Beratung', 'Förderantrag Beratung', new Calendar()), new DatePicker('Meta[Integration][CoachingRequestDate]', 'Förderantrag', 'Förderantrag', new Calendar()), new DatePicker('Meta[Integration][CoachingDecisionDate]', 'Förderbescheid SBA', 'Förderbescheid SBA', new Calendar())), Panel::PANEL_TYPE_INFO), 4), new FormColumn(new Panel('Integration 3', array(new SelectBox('Meta[Integration][3]', 'Förderschule', array('Name' => $tblCompanyAllSchool), new Education()), new SelectBox('Meta[Integration][3]', 'Schulbegleitung', array(), new Person()), new NumberField('Meta[Integration][3]', 'Stundenbedarf pro Woche', 'Stundenbedarf pro Woche', new Clock()), new TextArea('Meta[Integration][Remark]', 'Bemerkungen', 'Bemerkungen', new Pencil())), Panel::PANEL_TYPE_INFO), 4))), new FormRow(array(new FormColumn(array(new Panel('Ersteinschulung', array(new SelectBox('Meta[Transfer][1]', 'Schule', array('Name' => $tblCompanyAllSchool)), new DatePicker('Meta[Transfer][2]', 'Datum', 'Datum', new Calendar()), new TextArea('Meta[Transfer][1]', 'Bemerkungen', 'Bemerkungen', new Pencil())), Panel::PANEL_TYPE_INFO)), 4), new FormColumn(array(new Panel('Schülertransfer - Aufnahme', array(new SelectBox('Meta[Transfer][0]', 'Letzte Schulart', array()), new SelectBox('Meta[Transfer][1]', 'Abgebende Schule', array('Name' => $tblCompanyAllSchool)), new DatePicker('Meta[Transfer][2]', 'Datum', 'Datum', new Calendar())), Panel::PANEL_TYPE_INFO)), 4), new FormColumn(array(new Panel('Schülertransfer - Aufnahme', array(new SelectBox('Meta[Transfer][0]', 'Letzte Schulart', array()), new SelectBox('Meta[Transfer][1]', 'Abgebende Schule', array('Name' => $tblCompanyAllSchool)), new DatePicker('Meta[Transfer][2]', 'Datum', 'Datum', new Calendar())), Panel::PANEL_TYPE_INFO)), 4))), new FormRow(array(new FormColumn(array(new Panel('Schülertransfer - Schulverlauf', array(new TextArea('Meta[Transfer][1]', 'Bemerkungen', 'Bemerkungen', new Pencil())), Panel::PANEL_TYPE_INFO)))))))), new Primary('Informationen speichern')))->setConfirm('Eventuelle Änderungen wurden noch nicht gespeichert.'));
     return $Stage;
 }
示例#13
0
 /**
  * @return Stage
  */
 public function frontendShutdown()
 {
     $Stage = new Stage('Betriebsstörung', 'Fehler in der Anwendung');
     $Stage->setMessage('<strong>Problem:</strong> Nach Aufruf der Anwendung arbeitet diese nicht wie erwartet');
     $Stage->setContent(($this->getRequest()->getPathInfo() != '/Platform/Assistance/Error/Shutdown' ? new Danger(new \SPHERE\Common\Frontend\Icon\Repository\Warning() . '<samp>' . $this->getRequest()->getPathInfo() . '</samp>') : '') . (($Error = error_get_last()) ? new Warning(new \SPHERE\Common\Frontend\Icon\Repository\Info() . '<samp>' . $Error['message'] . '<br/>' . $Error['file'] . ':' . $Error['line'] . '</samp>') : '') . '<h2><small>Mögliche Ursachen</small></h2>' . new Info('Dieser Bereich der Anwendung wird eventuell gerade gewartet') . new Danger('Die Anwendung hat erkannt, dass das System nicht fehlerfrei arbeiten kann') . new Danger('Die interne Kommunikation der Anwendung mit weiteren, notwendigen Resourcen zum Beispiel Programmen kann gestört sein') . '<h2><small> Mögliche Lösungen </small></h2> ' . new Info('Versuchen Sie die Anwendung zu einem späteren Zeitpunkt erneut aufzurufen') . new Success('Bitte wenden Sie sich an den Support damit das Problem schnellstmöglich behoben werden kann'));
     if ($this->getRequest()->getPathInfo() != '/Platform/Assistance/Error') {
         $Stage->addButton(new Primary('Fehlerbericht senden', '/Platform/Assistance/Support/Ticket', null, array('TicketSubject' => urlencode('Fehler in der Anwendung'), 'TicketMessage' => urlencode($this->getRequest()->getPathInfo() . ': ' . $Error['message'] . '<br/>' . $Error['file'] . ':' . $Error['line']))));
     }
     return $Stage;
 }
示例#14
0
 /**
  * @return Stage
  */
 public function frontendProtocol()
 {
     $Stage = new Stage('Protokoll', 'Aktivit?ten');
     $ProtocolList = Protocol::useService()->getProtocolAll();
     //        foreach($ProtocolList as $Key => &$Protocol)
     //        {
     //            $Protocol->Editor = 0;
     //        }
     $Stage->setContent(new TableData($ProtocolList, null, array('Id' => '#', 'Editor' => 'Editor', 'Origin' => 'Origin', 'Commit' => 'Commit'), array("order" => array(array(0, 'desc')), "columnDefs" => array(array("orderable" => false, "targets" => 1), array("orderable" => false, "targets" => 2), array("orderable" => false, "targets" => 3)))));
     return $Stage;
 }
示例#15
0
 /**
  * @param bool $Clear
  *
  * @return Stage
  */
 public function frontendCache($Clear = false)
 {
     $Stage = new Stage('Cache', 'Status');
     $Stage->addButton(new Standard('Cache löschen', '/Platform/System/Cache', null, array('Clear' => true), 'Cache leeren'));
     $Stage->addButton(new External('phpMemcachedAdmin', $this->getRequest()->getPathBase() . '/UnitTest/Console/phpMemcachedAdmin-1.2.2'));
     if ($Clear) {
         (new CacheType(new ApcUser(), true))->getCache()->clearCache();
         (new CacheType(new Apcu(), true))->getCache()->clearCache();
         (new CacheType(new Memcached(), true))->getCache()->clearCache();
         (new CacheType(new OpCache(), true))->getCache()->clearCache();
         (new CacheType(new TwigCache(), true))->getCache()->clearCache();
     }
     $Stage->setContent(new Layout(array(new LayoutGroup(new LayoutRow(new LayoutColumn(new Status((new CacheType(new Memcached(), true))->getCache()))), new Title('Memcached')), new LayoutGroup(new LayoutRow(new LayoutColumn(new Status((new CacheType(new Apcu(), true))->getCache()))), new Title('APCu')), new LayoutGroup(new LayoutRow(new LayoutColumn(new Status((new CacheType(new Memory(), true))->getCache()))), new Title('Memory')), new LayoutGroup(new LayoutRow(new LayoutColumn(new Status((new CacheType(new OpCache(), true))->getCache()))), new Title('Zend OpCache')), new LayoutGroup(new LayoutRow(new LayoutColumn(new Status((new CacheType(new TwigCache(), true))->getCache()))), new Title('Twig')))));
     return $Stage;
 }
示例#16
0
 /**
  * @param TblPerson $tblPerson
  * @param array     $Meta
  *
  * @return Stage
  */
 public function frontendMeta(TblPerson $tblPerson = null, $Meta = array())
 {
     $Stage = new Stage();
     $Stage->setMessage(new Danger(new Info() . ' Es dürfen ausschließlich für die Schulverwaltung notwendige Informationen gespeichert werden.'));
     if (null !== $tblPerson) {
         $Global = $this->getGlobal();
         if (!isset($Global->POST['Meta'])) {
             /** @var TblCustody $tblCustody */
             $tblCustody = Custody::useService()->getCustodyByPerson($tblPerson);
             if ($tblCustody) {
                 $Global->POST['Meta']['Remark'] = $tblCustody->getRemark();
                 $Global->POST['Meta']['Occupation'] = $tblCustody->getOccupation();
                 $Global->POST['Meta']['Employment'] = $tblCustody->getEmployment();
                 $Global->savePost();
             }
         }
     }
     $Stage->setContent(Custody::useService()->createMeta((new Form(array(new FormGroup(array(new FormRow(array(new FormColumn(new Panel('Berufliches', array(new AutoCompleter('Meta[Occupation]', 'Beruf', 'Beruf', array(), new MapMarker()), new AutoCompleter('Meta[Employment]', 'Arbeitsstelle', 'Arbeitsstelle', array(), new Nameplate())), Panel::PANEL_TYPE_INFO), 6), new FormColumn(new Panel('Sonstiges', array(new TextArea('Meta[Remark]', 'Bemerkungen', 'Bemerkungen', new Pencil())), Panel::PANEL_TYPE_INFO), 6)))))), new Primary('Informationen speichern')))->setConfirm('Eventuelle Änderungen wurden noch nicht gespeichert.'), $tblPerson, $Meta));
     return $Stage;
 }
示例#17
0
 /**
  * @return Stage
  */
 public function frontendPayment()
 {
     $Stage = new Stage();
     $Stage->setTitle('Zahlungen');
     $Stage->setDescription('Importierte');
     $paymentList = Balance::useService()->entityPaymentAll();
     if ($paymentList) {
         array_walk($paymentList, function (TblPayment &$tblPayment) {
             $tblInvoice = $tblPayment->getTblBalance()->getServiceBillingInvoice();
             if ($tblInvoice) {
                 $tblPayment->InvoiceNumber = $tblInvoice->getNumber();
                 $tblPayment->InvoiceDate = $tblInvoice->getInvoiceDate();
                 $tblPayment->DebtorFullName = $tblInvoice->getDebtorFullName();
                 $tblPayment->DebtorNumber = $tblInvoice->getDebtorNumber();
                 $tblPayment->ValueString = $tblPayment->getValueString();
             }
         });
     }
     $Stage->setContent(new TableData($paymentList, null, array('InvoiceNumber' => 'Rechnungs-Nr.', 'InvoiceDate' => 'Rechnungsdatum', 'Date' => 'Zahlungseingangsdatum', 'DebtorFullName' => 'Debitor', 'DebtorNumber' => 'Debitorennummer', 'ValueString' => 'Betrag')));
     return $Stage;
 }
示例#18
0
 /**
  * @return Stage
  */
 public function frontendDashboard()
 {
     $Stage = new Stage('Dashboard', 'Import');
     $Stage->setContent(Main::getDispatcher()->fetchDashboard('Import'));
     return $Stage;
 }
示例#19
0
 /**
  * @param int  $Id
  * @param bool $Confirm
  *
  * @return Stage
  */
 public function frontendDestroyToken($Id, $Confirm = false)
 {
     $Stage = new Stage('Hardware-Schlüssel', 'Löschen');
     if ($Id) {
         $tblToken = Token::useService()->getTokenById($Id);
         $tblAccountAll = $tblToken->getAccountAllByToken();
         if (empty($tblAccountAll)) {
             if (!$Confirm) {
                 $Serial = $tblToken->getSerial();
                 $Serial = substr($Serial, 0, 4) . ' ' . substr($Serial, 4, 4);
                 $Stage->setContent(new Layout(new LayoutGroup(new LayoutRow(new LayoutColumn(array(new Panel(new YubiKey() . ' Hardware-Schlüssel', array($Serial, strtoupper($tblToken->getIdentifier())), Panel::PANEL_TYPE_SUCCESS), new Panel(new Question() . ' Diesen Hardware-Schlüssel wirklich löschen?', array(), Panel::PANEL_TYPE_DANGER, new Standard('Ja', '/Setting/Authorization/Token/Destroy', new Ok(), array('Id' => $Id, 'Confirm' => true)) . new Standard('Nein', '/Setting/Authorization/Token', new Disable()))))))));
             } else {
                 $Stage->setContent(new Layout(new LayoutGroup(array(new LayoutRow(new LayoutColumn(array(Token::useService()->destroyToken($tblToken) ? new Success('Der Hardware-Schlüssel wurde gelöscht') : new Danger('Der Hardware-Schlüssel konnte nicht gelöscht werden'), new Redirect('/Setting/Authorization/Token', 1))))))));
             }
         } else {
             $Stage->setContent(new Layout(new LayoutGroup(array(new LayoutRow(new LayoutColumn(array(new Danger('Der Hardware-Schlüssel kann nicht gelöscht werden'), new Redirect('/Setting/Authorization/Token'))))))));
         }
     } else {
         $Stage->setContent(new Layout(new LayoutGroup(array(new LayoutRow(new LayoutColumn(array(new Danger('Der Hardware-Schlüssel konnte nicht gefunden werden'), new Redirect('/Setting/Authorization/Token'))))))));
     }
     return $Stage;
 }
示例#20
0
 /**
  * @return Stage
  */
 public function frontendAccount()
 {
     $Stage = new Stage('Benutzerkonnten');
     $tblAccount = Account::useService()->getAccountBySession();
     if ($tblAccount) {
         $isSystem = Account::useService()->hasAuthorization($tblAccount, Access::useService()->getRoleByName('Administrator'));
     } else {
         $isSystem = false;
     }
     $tblConsumer = Consumer::useService()->getConsumerBySession();
     // Token
     $tblTokenAll = Token::useService()->getTokenAll();
     if ($tblTokenAll) {
         array_walk($tblTokenAll, function (TblToken &$tblToken) {
             if (Account::useService()->getAccountAllByToken($tblToken)) {
                 $tblToken = false;
             } else {
                 $tblToken = new RadioBox('Account[Token]', implode(' ', str_split($tblToken->getSerial(), 4)), $tblToken->getId());
             }
         });
         $tblTokenAll = array_filter($tblTokenAll);
     } else {
         $tblTokenAll = array();
     }
     array_unshift($tblTokenAll, new RadioBox('Account[Token]', new \SPHERE\Common\Frontend\Text\Repository\Danger('KEIN Hardware-Schlüssel'), null));
     // Identification
     $tblIdentificationAll = Account::useService()->getIdentificationAll();
     if ($tblIdentificationAll) {
         /** @noinspection PhpUnusedParameterInspection */
         array_walk($tblIdentificationAll, function (TblIdentification &$tblIdentification, $Index, $isSystem) {
             if ($tblIdentification->getName() == 'System' && !$isSystem) {
                 $tblIdentification = false;
             } else {
                 $tblIdentification = new RadioBox('Account[Identification]', $tblIdentification->getDescription(), $tblIdentification->getId());
             }
         }, $isSystem);
         $tblIdentificationAll = array_filter($tblIdentificationAll);
     } else {
         $tblIdentificationAll = array();
     }
     // Role
     $tblRoleAll = Access::useService()->getRoleAll();
     if ($tblRoleAll) {
         /** @noinspection PhpUnusedParameterInspection */
         array_walk($tblRoleAll, function (TblRole &$tblRole, $Index, $isSystem) {
             if ($tblRole->getName() == 'Administrator' && !$isSystem) {
                 $tblRole = false;
             } else {
                 $tblRole = new CheckBox('Account[Role][' . $tblRole->getId() . ']', $tblRole->getName(), $tblRole->getId());
             }
         }, $isSystem);
         $tblRoleAll = array_filter($tblRoleAll);
     } else {
         $tblRoleAll = array();
     }
     // Account
     $tblAccountAll = Account::useService()->getAccountAll();
     if ($tblAccountAll) {
         array_walk($tblAccountAll, function (TblAccount &$tblAccount) {
             /** @noinspection PhpUndefinedFieldInspection */
             $tblAccount->Option = new Danger('Löschen', '/Platform/Gatekeeper/Authorization/Account/Destroy', new Remove(), array('Id' => $tblAccount->getId()), 'Löschen');
         });
     }
     $Stage->setContent(($tblAccountAll ? new TableData($tblAccountAll, new Title('Bestehende Benutzerkonnten'), array('Username' => 'Benutzername')) : new Warning('Keine Benutzerkonnten vorhanden')) . new Form(array(new FormGroup(array(new FormRow(array(new FormColumn((new TextField('Account[Name]', 'Benutzername', 'Benutzername', new Person()))->setPrefixValue($tblConsumer->getAcronym()), 4), new FormColumn(new PasswordField('Account[Password]', 'Passwort', 'Passwort', new Lock()), 4), new FormColumn(new PasswordField('Account[PasswordSafety]', 'Passwort wiederholen', 'Passwort wiederholen', new Repeat()), 4)))), new \SPHERE\Common\Frontend\Form\Repository\Title('Benutzerkonnto anlegen')), new FormGroup(array(new FormRow(array(new FormColumn(array(new Panel('Authentifizierungstyp', $tblIdentificationAll)), 4), new FormColumn(array(new Panel('Berechtigungsstufe', $tblRoleAll)), 4), new FormColumn(array(new Panel('Hardware-Schlüssel', $tblTokenAll)), 4)))), new \SPHERE\Common\Frontend\Form\Repository\Title('Berechtigungen zuweisen'))), new Primary('Hinzufügen')));
     return $Stage;
 }
示例#21
0
 /**
  * @param $tblItemId
  * @param $tblAccountId
  *
  * @return Stage
  */
 public function frontendItemAccountAdd($tblItemId, $tblAccountId)
 {
     $Stage = new Stage();
     $Stage->setTitle('Artikel');
     $Stage->setDescription('FIBU-Konto Hinzufügen');
     $tblItem = Item::useService()->entityItemById($tblItemId);
     $tblAccount = Account::useService()->entityAccountById($tblAccountId);
     if (!empty($tblItemId) && !empty($tblAccountId)) {
         $Stage->setContent(Item::useService()->executeAddItemAccount($tblItem, $tblAccount));
     }
     return $Stage;
 }
示例#22
0
 /**
  * @param $Id
  *
  * @return Stage
  */
 public function frontendInvoiceItemRemove($Id)
 {
     $Stage = new Stage();
     $Stage->setTitle('Rechnung');
     $Stage->setDescription('Artikel Entfernen');
     $tblInvoiceItem = Invoice::useService()->entityInvoiceItemById($Id);
     $Stage->setContent(Invoice::useService()->executeRemoveInvoiceItem($tblInvoiceItem));
     return $Stage;
 }
示例#23
0
 /**
  * @param $Id
  *
  * @return Stage
  */
 public function frontendPictureDelete($Id)
 {
     $Stage = new Stage();
     $Stage->setTitle('Bild');
     $Stage->setDescription('entfernen');
     $tblTestPicture = Test::useService()->getTestPictureById($Id);
     $Stage->setContent(Test::useService()->deleteTblTestPicture($tblTestPicture));
     return $Stage;
 }
示例#24
0
 /**
  * @return Stage
  */
 public function getStage()
 {
     $Stage = new Stage('Roadmap');
     $Stage->setContent(implode($this->Release));
     return $Stage;
 }
示例#25
0
 /**
  * @return Stage
  */
 public function frontendDestroySession()
 {
     $View = new Stage('Abmelden', 'Bitte warten...');
     $View->setContent(Account::useService()->destroySession(new Redirect('/Platform/Gatekeeper/Authentication', 0)));
     return $View;
 }
示例#26
0
 /**
  * @return Stage
  */
 public function frontendMyAccount()
 {
     $Stage = new Stage('Mein Benutzerkonto', 'Profil');
     $tblAccount = Account::useService()->getAccountBySession();
     $tblPersonAll = Account::useService()->getPersonAllByAccount($tblAccount);
     if ($tblPersonAll) {
         array_walk($tblPersonAll, function (TblPerson &$tblPerson) {
             $tblPerson = $tblPerson->getFullName();
         });
     }
     $tblAuthorizationAll = Account::useService()->getAuthorizationAllByAccount($tblAccount);
     if ($tblAuthorizationAll) {
         array_walk($tblAuthorizationAll, function (TblAuthorization &$tblAuthorization) {
             $tblAuthorization = $tblAuthorization->getServiceTblRole()->getName();
         });
     }
     $Person = new LayoutGroup(new LayoutRow(new LayoutColumn(new Panel('Informationen zur Person', !empty($tblPersonAll) ? new Listing($tblPersonAll) : new Danger(new Exclamation() . new Small(' Keine Person angeben'))))));
     $Authentication = new LayoutGroup(new LayoutRow(new LayoutColumn(new Panel('Authentication', $tblAccount->getServiceTblIdentification() ? $tblAccount->getServiceTblIdentification()->getDescription() : ''))));
     $Authorization = new LayoutGroup(new LayoutRow(new LayoutColumn(new Panel('Berechtigungen', !empty($tblAuthorizationAll) ? $tblAuthorizationAll : array(new Danger(new Exclamation() . new Small(' Keine Berechtigungen vergeben')))))));
     $Token = new LayoutGroup(new LayoutRow(new LayoutColumn(new Panel('Hardware-Schlüssel', array($tblAccount->getServiceTblToken() ? substr($tblAccount->getServiceTblToken()->getSerial(), 0, 4) . ' ' . substr($tblAccount->getServiceTblToken()->getSerial(), 4, 4) : new Muted(new Small('Kein Hardware-Schlüssel vergeben')))))));
     $Account = new Layout(array($Person, $Authentication, $Authorization, $Token));
     $Stage->setContent(new Layout(array(new LayoutGroup(new LayoutRow(new LayoutColumn(new Panel('Benutzerkonto: ' . $tblAccount->getUsername(), $Account, Panel::PANEL_TYPE_DEFAULT, new Standard('Passwort ändern', new Route(__NAMESPACE__ . '/Password'))))), new Title('Benutzerkonto', 'Informationen')), new LayoutGroup(new LayoutRow(new LayoutColumn(new Panel($tblAccount->getServiceTblConsumer()->getName() . ' [' . $tblAccount->getServiceTblConsumer()->getAcronym() . ']', array('TODO: Anzeigen von Schulen, Schulträger, Vörderverein', 'TODO: Anzeigen von zugehörigen Adressen, Telefonnummern, Personen'), Panel::PANEL_TYPE_DEFAULT, new Standard('Mandant ändern', new Route(__NAMESPACE__ . '/Consumer'))))), new Title('Mandant', 'Informationen')))));
     return $Stage;
 }
示例#27
0
 /**
  * @param int  $Id
  * @param bool $Confirm
  *
  * @return Stage
  */
 public function frontendDestroyGroup($Id, $Confirm = false)
 {
     $Stage = new Stage('Personengruppe', 'Löschen');
     if ($Id) {
         $tblGroup = Group::useService()->getGroupById($Id);
         if (!$Confirm) {
             $Stage->setContent(new Layout(new LayoutGroup(new LayoutRow(new LayoutColumn(array(new Panel(new Question() . ' Diese Gruppe wirklich löschen?', array($tblGroup->getName() . ' ' . $tblGroup->getDescription(), new Muted(new Small($tblGroup->getRemark()))), Panel::PANEL_TYPE_DANGER, new Standard('Ja', '/People/Group/Destroy', new Ok(), array('Id' => $Id, 'Confirm' => true)) . new Standard('Nein', '/People/Group', new Disable()))))))));
         } else {
             $tblPersonAll = Group::useService()->getPersonAllByGroup($tblGroup);
             /** @noinspection PhpUnusedParameterInspection */
             array_walk($tblPersonAll, function (TblPerson $tblPerson, $Index, TblGroup $tblGroup) {
                 Group::useService()->removeGroupPerson($tblGroup, $tblPerson);
             }, $tblGroup);
             $Stage->setContent(new Layout(new LayoutGroup(array(new LayoutRow(new LayoutColumn(array(Group::useService()->destroyGroup($tblGroup) ? new Success('Die Gruppe wurde gelöscht') : new Danger('Die Gruppe konnte nicht gelöscht werden'), new Redirect('/People/Group', 1))))))));
         }
     } else {
         $Stage->setContent(new Layout(new LayoutGroup(array(new LayoutRow(new LayoutColumn(array(new Danger('Die Gruppe konnte nicht gefunden werden'), new Redirect('/People/Group'))))))));
     }
     return $Stage;
 }
示例#28
0
 /**
  * @param int  $Id
  * @param bool $Confirm
  *
  * @return Stage
  */
 public function frontendDestroyToPerson($Id, $Confirm = false)
 {
     $Stage = new Stage('E-Mail Adresse', 'Löschen');
     if ($Id) {
         $tblToPerson = Mail::useService()->getMailToPersonById($Id);
         $tblPerson = $tblToPerson->getServiceTblPerson();
         if (!$Confirm) {
             $Stage->setContent(new Layout(new LayoutGroup(new LayoutRow(new LayoutColumn(array(new Panel(new PersonIcon() . ' Person', $tblPerson->getFullName(), Panel::PANEL_TYPE_SUCCESS, new Standard('Zurück zur Person', '/People/Person', new ChevronLeft(), array('Id' => $tblPerson->getId()))), new Panel(new Question() . ' Diese E-Mail Adresse wirklich löschen?', array($tblToPerson->getTblType()->getName() . ' ' . $tblToPerson->getTblType()->getDescription(), $tblToPerson->getTblMail()->getAddress(), new Muted(new Small($tblToPerson->getRemark()))), Panel::PANEL_TYPE_DANGER, new Standard('Ja', '/People/Person/Mail/Destroy', new Ok(), array('Id' => $Id, 'Confirm' => true)) . new Standard('Nein', '/People/Person', new Disable(), array('Id' => $tblPerson->getId())))))))));
         } else {
             $Stage->setContent(new Layout(new LayoutGroup(array(new LayoutRow(new LayoutColumn(array(Mail::useService()->removeMailToPerson($tblToPerson) ? new Success('Die E-Mail Adresse wurde gelöscht') : new Danger('Die E-Mail Adresse konnte nicht gelöscht werden'), new Redirect('/People/Person', 1, array('Id' => $tblPerson->getId())))))))));
         }
     } else {
         $Stage->setContent(new Layout(new LayoutGroup(array(new LayoutRow(new LayoutColumn(array(new Danger('Die E-Mail Adresse konnte nicht gefunden werden'), new Redirect('/People/Search/Group'))))))));
     }
     return $Stage;
 }
示例#29
0
 /**
  * @param bool|false|string $TabActive
  *
  * @param null|int   $Id
  * @param null|array $Person
  * @param null|array $Meta
  *
  * @return Stage
  */
 public function frontendPerson($TabActive = 'Common', $Id = null, $Person = null, $Meta = null)
 {
     $Stage = new Stage('Personen', 'Datenblatt');
     if (!$Id) {
         $BasicTable = Person::useService()->createPerson($this->formPerson()->appendFormButton(new Primary('Grunddaten anlegen'))->setConfirm('Eventuelle Änderungen wurden noch nicht gespeichert'), $Person);
         $Stage->setContent(new Layout(array(new LayoutGroup(new LayoutRow(new LayoutColumn($BasicTable)), new Title(new PersonParent() . ' Grunddaten', 'der Person')))));
     } else {
         $tblPerson = Person::useService()->getPersonById($Id);
         $Global = $this->getGlobal();
         if (!isset($Global->POST['Person'])) {
             $Global->POST['Person']['Salutation'] = $tblPerson->getTblSalutation()->getId();
             $Global->POST['Person']['Title'] = $tblPerson->getTitle();
             $Global->POST['Person']['FirstName'] = $tblPerson->getFirstName();
             $Global->POST['Person']['SecondName'] = $tblPerson->getSecondName();
             $Global->POST['Person']['LastName'] = $tblPerson->getLastName();
             $tblGroupAll = Group::useService()->getGroupAllByPerson($tblPerson);
             if (!empty($tblGroupAll)) {
                 /** @var TblGroup $tblGroup */
                 foreach ((array) $tblGroupAll as $tblGroup) {
                     $Global->POST['Person']['Group'][$tblGroup->getId()] = $tblGroup->getId();
                 }
             }
             $Global->savePost();
         }
         $BasicTable = Person::useService()->updatePerson($this->formPerson()->appendFormButton(new Primary('Grunddaten speichern'))->setConfirm('Eventuelle Änderungen wurden noch nicht gespeichert'), $tblPerson, $Person);
         $MetaTabs = Group::useService()->getGroupAllByPerson($tblPerson);
         // Sort by Name
         usort($MetaTabs, function (TblGroup $ObjectA, TblGroup $ObjectB) {
             return strnatcmp($ObjectA->getName(), $ObjectB->getName());
         });
         // Create Tabs
         /** @noinspection PhpUnusedParameterInspection */
         array_walk($MetaTabs, function (TblGroup &$tblGroup, $Index, TblPerson $tblPerson) {
             switch (strtoupper($tblGroup->getMetaTable())) {
                 case 'COMMON':
                     $tblGroup = new LayoutTab('Personendaten', $tblGroup->getMetaTable(), array('Id' => $tblPerson->getId()));
                     break;
                 case 'PROSPECT':
                     $tblGroup = new LayoutTab('Interessent', $tblGroup->getMetaTable(), array('Id' => $tblPerson->getId()));
                     break;
                 case 'STUDENT':
                     $tblGroup = new LayoutTab('Schülerakte', $tblGroup->getMetaTable(), array('Id' => $tblPerson->getId()));
                     break;
                 case 'CUSTODY':
                     $tblGroup = new LayoutTab('Sorgerechtdaten', $tblGroup->getMetaTable(), array('Id' => $tblPerson->getId()));
                     break;
                 default:
                     $tblGroup = false;
             }
         }, $tblPerson);
         /** @var LayoutTab[] $MetaTabs */
         $MetaTabs = array_filter($MetaTabs);
         // Folded ?
         if (!empty($MetaTabs)) {
             if (!$TabActive || $TabActive == '#') {
                 array_unshift($MetaTabs, new LayoutTab('&nbsp;' . new ChevronRight() . '&nbsp;', '#', array('Id' => $tblPerson->getId())));
                 $MetaTabs[0]->setActive();
             } else {
                 if ($TabActive == 'Common') {
                     array_unshift($MetaTabs, new LayoutTab('&nbsp;' . new ChevronUp() . '&nbsp;', '#', array('Id' => $tblPerson->getId())));
                     $MetaTabs[1]->setActive();
                 } else {
                     array_unshift($MetaTabs, new LayoutTab('&nbsp;' . new ChevronUp() . '&nbsp;', '#', array('Id' => $tblPerson->getId())));
                 }
             }
         }
         switch (strtoupper($TabActive)) {
             case 'COMMON':
                 $MetaTable = Common::useFrontend()->frontendMeta($tblPerson, $Meta);
                 break;
             case 'PROSPECT':
                 $MetaTable = Prospect::useFrontend()->frontendMeta($tblPerson, $Meta);
                 break;
             case 'STUDENT':
                 $MetaTable = Student::useFrontend()->frontendMeta($tblPerson, $Meta);
                 break;
             case 'CUSTODY':
                 $MetaTable = Custody::useFrontend()->frontendMeta($tblPerson, $Meta);
                 break;
             default:
                 if (!empty($MetaTabs)) {
                     $MetaTable = new Well(new Muted('Bitte wählen Sie eine Rubrik'));
                 } else {
                     $MetaTable = new Well(new Warning('Keine Informationen verfügbar'));
                 }
         }
         $Stage->setContent(new Layout(array(new LayoutGroup(new LayoutRow(new LayoutColumn(array(new Panel(new PersonIcon() . ' Person', $tblPerson->getFullName(), Panel::PANEL_TYPE_SUCCESS), $BasicTable))), new Title(new PersonParent() . ' Grunddaten', 'der Person')), new LayoutGroup(array(new LayoutRow(new LayoutColumn(new LayoutTabs($MetaTabs))), new LayoutRow(new LayoutColumn($MetaTable))), new Title(new Tag() . ' Informationen', 'zur Person')), new LayoutGroup(array(new LayoutRow(new LayoutColumn(Address::useFrontend()->frontendLayoutPerson($tblPerson)))), (new Title(new TagList() . ' Adressdaten', 'der Person'))->addButton(new Standard('Adresse hinzufügen', '/People/Person/Address/Create', new ChevronDown(), array('Id' => $tblPerson->getId())))), new LayoutGroup(array(new LayoutRow(new LayoutColumn(Phone::useFrontend()->frontendLayoutPerson($tblPerson) . Mail::useFrontend()->frontendLayoutPerson($tblPerson)))), (new Title(new TagList() . ' Kontaktdaten', 'der Person'))->addButton(new Standard('Telefonnummer hinzufügen', '/People/Person/Phone/Create', new ChevronDown(), array('Id' => $tblPerson->getId())))->addButton(new Standard('E-Mail Adresse hinzufügen', '/People/Person/Mail/Create', new ChevronDown(), array('Id' => $tblPerson->getId())))), new LayoutGroup(array(new LayoutRow(new LayoutColumn(array(Relationship::useFrontend()->frontendLayoutPerson($tblPerson), Relationship::useFrontend()->frontendLayoutCompany($tblPerson))))), (new Title(new TagList() . ' Beziehungen', 'zu Personen und Firmen'))->addButton(new Standard('Personenbeziehung hinzufügen', '/People/Person/Relationship/Create', new ChevronDown(), array('Id' => $tblPerson->getId())))->addButton(new Standard('Firmenbeziehung hinzufügen', '/Corporation/Company/Relationship/Create', new ChevronDown(), array('Id' => $tblPerson->getId())))))));
     }
     return $Stage;
 }
示例#30
0
 /**
  * @param $Id
  * @param $Date
  * @param $Data
  * @param $Save
  *
  * @return Stage
  */
 public function frontendBasketDebtorSelect($Id, $Date, $Data, $Save)
 {
     $Stage = new Stage();
     $Stage->setTitle('Warenkorb');
     $Stage->setDescription('Debitoren zuordnen');
     $Stage->setMessage('Es konnten im Warenkorb nicht zu alle Personen bei allen Leistungen eindeutig ein Debitor
         ermittelt werden. Es werden alle nicht automatisch zuordenbaren Kombinationen von Personen und Leistungen
         angezeigt. Bitte weisen Sie die entsprechenden Debitoren zu');
     $Global = $this->getGlobal();
     if (!isset($Global->POST['Save'])) {
         $Global->POST['Save'] = 1;
     }
     $Global->savePost();
     $tblBasket = Basket::useService()->entityBasketById($Id);
     $tblBasketCommodityList = Basket::useService()->entityBasketCommodityAllByBasket($tblBasket);
     /**@var TblBasketCommodity $tblBasketCommodity */
     array_walk($tblBasketCommodityList, function (TblBasketCommodity $tblBasketCommodity) {
         $tblBasketCommodityDebtorList = Basket::useService()->entityBasketCommodityDebtorAllByBasketCommodity($tblBasketCommodity);
         $tblBasketCommodity->Name = $tblBasketCommodity->getServiceManagementPerson()->getFullName();
         $tblBasketCommodity->Commodity = $tblBasketCommodity->getServiceBillingCommodity()->getName();
         $tblBasketCommodity->Select = new SelectBox('Data[' . $tblBasketCommodity->getId() . ']', '', array('{{ ServiceBillingDebtor.DebtorNumber }}' . ' - {{ ServiceBillingDebtor.ServiceManagementPerson.FullName }}' . '{% if( ServiceBillingDebtor.Description is not empty) %} - {{ ServiceBillingDebtor.Description }}{% endif %}' => $tblBasketCommodityDebtorList));
     });
     $Stage->setContent(new Layout(array(new LayoutGroup(array(new LayoutRow(array(new LayoutColumn(new Panel('Warenkorb - Nummer', $tblBasket->getId(), Panel::PANEL_TYPE_SUCCESS), 3), new LayoutColumn(new Panel('Warenkorb - Name', $tblBasket->getName(), Panel::PANEL_TYPE_SUCCESS), 6), new LayoutColumn(new Panel('Erstellt am', $tblBasket->getCreateDate(), Panel::PANEL_TYPE_SUCCESS), 3))))), new LayoutGroup(array(new LayoutRow(array(new LayoutColumn(Basket::useService()->executeCheckDebtors(new Form(new FormGroup(array(new FormRow(new FormColumn(new TableData($tblBasketCommodityList, null, array('Name' => 'Person', 'Commodity' => 'Leistung', 'Select' => 'Debitorennummer - Debitor - Beschreibung'), false))), new FormRow(array(new FormColumn(new SelectBox('Save', '', array(1 => 'Nicht speichern', 2 => 'Als Standard speichern')), 3), new FormColumn(new \SPHERE\Common\Frontend\Form\Repository\Button\Primary('Debitoren zuordnen (prüfen)'), 3)))))), $Id, $Date, $Data, $Save)))))))));
     return $Stage;
 }