Example #1
0
 /**
  * @return Stage
  */
 public function frontendDashboard()
 {
     $Stage = new Stage('Dashboard', 'Förderverein');
     $Stage->setContent(new Standard('Förderverein hinzufügen', '/Setting/Consumer/SponsorAssociation/Create') . new Layout(new LayoutGroup(new LayoutRow(new LayoutColumn(new Warning('Es ist noch kein Förderverein eingetragen'))))));
     if ($tblSponsorAssociationAll = SponsorAssociation::useService()->getSponsorAssociationAll()) {
         $tblCompanyAll[] = null;
         $Form[] = null;
         foreach ($tblSponsorAssociationAll as $tblSponsorAssociation) {
             $tblCompany = $tblSponsorAssociation->getServiceTblCompany();
             $Stage->setContent(new Standard('Förderverein hinzufügen', '/Setting/Consumer/SponsorAssociation/Create') . new Standard('Förderverein entfernen', '/Setting/Consumer/SponsorAssociation/Delete') . new Layout(array(new LayoutGroup(array(new LayoutRow(new LayoutColumn(Address::useFrontend()->frontendLayoutCompany($tblCompany) . Phone::useFrontend()->frontendLayoutCompany($tblCompany) . Mail::useFrontend()->frontendLayoutCompany($tblCompany) . Relationship::useFrontend()->frontendLayoutCompany($tblCompany)))), new Title(new TagList() . ' Kontaktdaten', 'von ' . $tblCompany->getName())))));
         }
     }
     return $Stage;
 }
Example #2
0
 /**
  * @return Stage
  */
 public function frontendDashboard()
 {
     $Stage = new Stage('Dashboard', 'Schulträger');
     $Stage->setContent(new Standard('Schulträger hinzufügen', '/Setting/Consumer/Responsibility/Create') . new Layout(new LayoutGroup(new LayoutRow(new LayoutColumn(new Warning('Es ist noch kein Schulträger eingetragen'))))));
     if ($tblResponsibilityAll = Responsibility::useService()->getResponsibilityAll()) {
         $tblCompanyAll[] = null;
         $Form[] = null;
         foreach ($tblResponsibilityAll as $tblResponsibility) {
             $tblCompany = $tblResponsibility->getServiceTblCompany();
             $Stage->setContent(new Standard('Schulträger hinzufügen', '/Setting/Consumer/Responsibility/Create') . new Standard('Schulträger entfernen', '/Setting/Consumer/Responsibility/Delete') . new Layout(array(new LayoutGroup(array(new LayoutRow(new LayoutColumn(Address::useFrontend()->frontendLayoutCompany($tblCompany) . Phone::useFrontend()->frontendLayoutCompany($tblCompany) . Mail::useFrontend()->frontendLayoutCompany($tblCompany) . Relationship::useFrontend()->frontendLayoutCompany($tblCompany)))), new Title(new TagList() . ' Kontaktdaten', 'von ' . $tblCompany->getName())))));
         }
     }
     return $Stage;
 }
Example #3
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(' ' . new ChevronRight() . ' ', '#', array('Id' => $tblPerson->getId())));
                 $MetaTabs[0]->setActive();
             } else {
                 if ($TabActive == 'Common') {
                     array_unshift($MetaTabs, new LayoutTab(' ' . new ChevronUp() . ' ', '#', array('Id' => $tblPerson->getId())));
                     $MetaTabs[1]->setActive();
                 } else {
                     array_unshift($MetaTabs, new LayoutTab(' ' . new ChevronUp() . ' ', '#', 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;
 }
Example #4
0
 /**
  * @param bool|false $TabActive
  *
  * @param null|int   $Id
  * @param null|array $Company
  * @param null|array $Meta
  *
  * @return Stage
  */
 public function frontendCompany($TabActive = false, $Id = null, $Company = null, $Meta = null)
 {
     $Stage = new Stage('Firmen', 'Datenblatt');
     if (!$Id) {
         $BasicTable = Company::useService()->createCompany($this->formCompany()->appendFormButton(new Primary('Grunddaten anlegen'))->setConfirm('Eventuelle Änderungen wurden noch nicht gespeichert'), $Company);
         $Stage->setContent(new Layout(array(new LayoutGroup(new LayoutRow(new LayoutColumn($BasicTable)), new Title(new Building() . ' Grunddaten', 'der Firma')))));
     } else {
         $tblCompany = Company::useService()->getCompanyById($Id);
         $Global = $this->getGlobal();
         if (!isset($Global->POST['Company'])) {
             $Global->POST['Company']['Name'] = $tblCompany->getName();
             $Global->POST['Company']['Description'] = $tblCompany->getDescription();
             $tblGroupAll = Group::useService()->getGroupAllByCompany($tblCompany);
             if (!empty($tblGroupAll)) {
                 /** @var TblGroup $tblGroup */
                 foreach ((array) $tblGroupAll as $tblGroup) {
                     $Global->POST['Company']['Group'][$tblGroup->getId()] = $tblGroup->getId();
                 }
             }
             $Global->savePost();
         }
         $BasicTable = Company::useService()->updateCompany($this->formCompany()->appendFormButton(new Primary('Grunddaten speichern'))->setConfirm('Eventuelle Änderungen wurden noch nicht gespeichert'), $tblCompany, $Company);
         $MetaTabs = Group::useService()->getGroupAllByCompany($tblCompany);
         // 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, TblCompany $tblCompany) {
             switch (strtoupper($tblGroup->getMetaTable())) {
                 //                    case 'COMMON':
                 //                        $tblGroup = new LayoutTab( 'Allgemein', $tblGroup->getMetaTable(),
                 //                            array( 'tblCompany' => $tblCompany->getId() )
                 //                        );
                 //                        break;
                 default:
                     $tblGroup = false;
             }
         }, $tblCompany);
         /** @var LayoutTab[] $MetaTabs */
         $MetaTabs = array_filter($MetaTabs);
         // Folded ?
         if (!empty($MetaTabs)) {
             if (!$TabActive || $TabActive == '#') {
                 array_unshift($MetaTabs, new LayoutTab(' ' . new ChevronRight() . ' ', '#', array('Id' => $tblCompany->getId())));
                 $MetaTabs[0]->setActive();
             } else {
                 array_unshift($MetaTabs, new LayoutTab(' ' . new ChevronUp() . ' ', '#', array('Id' => $tblCompany->getId())));
             }
         }
         //            switch (strtoupper($TabActive)) {
         //                case 'COMMON':
         //                    $MetaTable = Common::useFrontend()->frontendMeta( $tblCompany, $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 Building() . ' Firma', array($tblCompany->getName(), $tblCompany->getDescription()), Panel::PANEL_TYPE_SUCCESS), $BasicTable))), new Title(new Building() . ' Grunddaten', 'der Firma')), new LayoutGroup(array(new LayoutRow(new LayoutColumn(Address::useFrontend()->frontendLayoutCompany($tblCompany)))), (new Title(new TagList() . ' Adressdaten', 'der Firma'))->addButton(new Standard('Adresse hinzufügen', '/Corporation/Company/Address/Create', new ChevronDown(), array('Id' => $tblCompany->getId())))), new LayoutGroup(array(new LayoutRow(new LayoutColumn(Phone::useFrontend()->frontendLayoutCompany($tblCompany) . Mail::useFrontend()->frontendLayoutCompany($tblCompany)))), (new Title(new TagList() . ' Kontaktdaten', 'der Firma'))->addButton(new Standard('Telefonnummer hinzufügen', '/Corporation/Company/Phone/Create', new ChevronDown(), array('Id' => $tblCompany->getId())))->addButton(new Standard('E-Mail Adresse hinzufügen', '/Corporation/Company/Mail/Create', new ChevronDown(), array('Id' => $tblCompany->getId())))), new LayoutGroup(array(new LayoutRow(new LayoutColumn(array(Relationship::useFrontend()->frontendLayoutCompany($tblCompany))))), new Title(new TagList() . ' Beziehungen', 'zu Personen')))));
     }
     return $Stage;
 }