Ejemplo n.º 1
0
 /**
  * @param array $Group
  *
  * @return Stage
  */
 public function frontendGroup($Group)
 {
     $Stage = new Stage('Gruppen');
     $tblGroupAll = Group::useService()->getGroupAll();
     if ($tblGroupAll) {
         array_walk($tblGroupAll, function (TblGroup &$tblGroup) {
             $Content = array($tblGroup->getDescription() ? new Small(new Muted($tblGroup->getDescription())) : false, $tblGroup->getRemark() ? nl2br($tblGroup->getRemark()) : false);
             $Content = array_filter($Content);
             $Type = $tblGroup->getIsLocked() ? Panel::PANEL_TYPE_INFO : Panel::PANEL_TYPE_DEFAULT;
             $Footer = new PullLeft(new Standard('', '/Corporation/Group/Edit', new Edit(), array('Id' => $tblGroup->getId()), 'Daten ändern') . ($tblGroup->getIsLocked() ? '' : new Standard('', '/Corporation/Group/Destroy', new Remove(), array('Id' => $tblGroup->getId()), 'Gruppe löschen')));
             $Footer .= new PullRight(new Label(CorporationCompany::useService()->countCompanyAllByGroup($tblGroup) . ' Firmen', Label::LABEL_TYPE_INFO));
             $tblGroup = new LayoutColumn(new Panel($tblGroup->getName(), $Content, $Type, new PullClear($Footer)), 4);
         });
         $LayoutRowList = array();
         $LayoutRowCount = 0;
         $LayoutRow = null;
         /**
          * @var LayoutColumn $tblGroup
          */
         foreach ($tblGroupAll as $tblGroup) {
             if ($LayoutRowCount % 3 == 0) {
                 $LayoutRow = new LayoutRow(array());
                 $LayoutRowList[] = $LayoutRow;
             }
             $LayoutRow->addColumn($tblGroup);
             $LayoutRowCount++;
         }
     } else {
         $LayoutRowList = new LayoutRow(new LayoutColumn(new Warning('Keine Gruppen vorhanden')));
     }
     $Stage->setContent(new Layout(array(new LayoutGroup($LayoutRowList, new Title('Gruppen')), new LayoutGroup(new LayoutRow(new LayoutColumn(Group::useService()->createGroup($this->formGroup()->appendFormButton(new Primary('Hinzufügen'))->setConfirm('Die neue Gruppe wurde noch nicht gespeichert'), $Group))), new Title('Gruppe hinzufügen')))));
     return $Stage;
 }
Ejemplo n.º 2
0
 /**
  * @return bool|TblCompany
  */
 public function getServiceTblCompany()
 {
     if (null === $this->serviceTblCompany) {
         return false;
     } else {
         return Company::useService()->getCompanyById($this->serviceTblCompany);
     }
 }
Ejemplo n.º 3
0
 /**
  * @param int    $Id
  * @param string $Address
  * @param array  $Type
  *
  * @return Stage
  */
 public function frontendCreateToCompany($Id, $Address, $Type)
 {
     $Stage = new Stage('E-Mail Adresse', 'Hinzufügen');
     $Stage->setMessage('Eine E-Mail Adresse zur gewählten Firma hinzufügen');
     $tblCompany = Company::useService()->getCompanyById($Id);
     $Stage->setContent(new Layout(array(new LayoutGroup(array(new LayoutRow(new LayoutColumn(new Panel(new PersonIcon() . ' Firma', $tblCompany->getName(), Panel::PANEL_TYPE_SUCCESS, new Standard('Zurück zur Firma', '/Corporation/Company', new ChevronLeft(), array('Id' => $tblCompany->getId()))))))), new LayoutGroup(array(new LayoutRow(new LayoutColumn(Mail::useService()->createMailToCompany($this->formAddress()->appendFormButton(new Primary('E-Mail Adresse hinzufügen'))->setConfirm('Eventuelle Änderungen wurden noch nicht gespeichert'), $tblCompany, $Address, $Type))))))));
     return $Stage;
 }
Ejemplo n.º 4
0
 /**
  * @return Form
  */
 private function formSponsorAssociationCompanyCreate()
 {
     $PanelSelectCompanyTitle = new PullClear('Förderverein auswählen:' . new PullRight(new Standard('Neue Firma anlegen', '/Corporation/Company', new Building(), array(), '"Förderverein hinzufügen" verlassen')));
     $tblCompanyAll = Company::useService()->getCompanyAll();
     array_walk($tblCompanyAll, function (TblCompany &$tblCompany) {
         $tblCompany = new PullClear(new RadioBox('SponsorAssociation', $tblCompany->getName() . ' ' . new Success($tblCompany->getDescription()), $tblCompany->getId()));
     });
     return new Form(new FormGroup(array(new FormRow(array(new FormColumn(array(new Panel($PanelSelectCompanyTitle, $tblCompanyAll, Panel::PANEL_TYPE_INFO, null, 15)), 12))))));
 }
Ejemplo n.º 5
0
 public static function registerCluster()
 {
     Search::registerApplication();
     Company::registerApplication();
     Group::registerApplication();
     Main::getDisplay()->addClusterNavigation(new Link(new Link\Route(__NAMESPACE__), new Link\Name('Firmen')));
     Main::getDispatcher()->registerRoute(Main::getDispatcher()->createRoute(__NAMESPACE__, __CLASS__ . '::frontendDashboard'));
     $tblGroupAll = Group::useService()->getGroupAll();
     if ($tblGroupAll) {
         /** @var TblGroup $tblGroup */
         foreach ((array) $tblGroupAll as $Index => $tblGroup) {
             $tblGroupAll[$tblGroup->getName()] = new Layout(new LayoutGroup(new LayoutRow(array(new LayoutColumn($tblGroup->getName() . new Muted(new Small('<br/>' . $tblGroup->getDescription())), array(9, 0, 7)), new LayoutColumn(new Muted(new Small(Group::useService()->countCompanyAllByGroup($tblGroup) . '&nbsp;Mitglieder')), 2, array(LayoutColumn::GRID_OPTION_HIDDEN_SM, LayoutColumn::GRID_OPTION_HIDDEN_XS)), new LayoutColumn(new PullRight(new Standard('', '/Corporation/Search/Group', new \SPHERE\Common\Frontend\Icon\Repository\Group(), array('Id' => $tblGroup->getId()), 'zur Gruppe')), array(3, 0, 3))))));
             $tblGroupAll[$Index] = false;
         }
         $tblGroupAll = array_filter($tblGroupAll);
         Main::getDispatcher()->registerWidget('Firmen', new Panel('Firmen in Gruppen', $tblGroupAll), 4, 6);
     }
     $tblCompanyAll = Company::useService()->getCompanyAll();
     Main::getDispatcher()->registerWidget('Firmen', new Panel('Anzahl an Firmen', 'Insgesamt: ' . count($tblCompanyAll)));
 }
Ejemplo n.º 6
0
 /**
  * @param IFormInterface $Form
  * @param integer        $SponsorAssociation
  *
  * @return IFormInterface|string
  */
 public function createSponsorAssociation(IFormInterface $Form, $SponsorAssociation)
 {
     /**
      * Skip to Frontend
      */
     if (null === $SponsorAssociation) {
         $Form->appendGridGroup(new FormGroup(new FormRow(new FormColumn(new Danger('Bitte wählen Sie einen Förderverein aus')))));
         return $Form;
     }
     $Error = false;
     if (!$Error) {
         $tblCompany = Company::useService()->getCompanyById($SponsorAssociation);
         if ((new Data($this->Binding))->addSponsorAssociation($tblCompany)) {
             return new Success('Der Förderverein wurde erfolgreich hinzugefügt') . new Redirect('/Setting/Consumer/SponsorAssociation', 1, array('Id' => $tblCompany->getId()));
         } else {
             return new Danger('Der Förderverein konnte nicht hinzugefügt werden') . new Redirect('/Setting/Consumer/SponsorAssociation', 10, array('Id' => $tblCompany->getId()));
         }
     }
     return $Form;
 }
Ejemplo n.º 7
0
 /**
  * @param IFormInterface $Form
  * @param TblPerson      $tblPerson
  * @param array          $Meta
  *
  * @return IFormInterface|Redirect
  */
 public function createMeta(IFormInterface $Form = null, TblPerson $tblPerson, $Meta)
 {
     /**
      * Skip to Frontend
      */
     if (null === $Meta) {
         return $Form;
     }
     $tblProspect = $this->getProspectByPerson($tblPerson);
     if ($tblProspect) {
         (new Data($this->Binding))->updateProspectAppointment($tblProspect->getTblProspectAppointment(), $Meta['Appointment']['ReservationDate'], $Meta['Appointment']['InterviewDate'], $Meta['Appointment']['TrialDate']);
         $OptionA = Company::useService()->getCompanyById($Meta['Reservation']['SchoolOptionA']);
         $OptionB = Company::useService()->getCompanyById($Meta['Reservation']['SchoolOptionB']);
         (new Data($this->Binding))->updateProspectReservation($tblProspect->getTblProspectReservation(), $Meta['Reservation']['Year'], $Meta['Reservation']['Division'], $OptionA ? $OptionA : null, $OptionB ? $OptionB : null);
         (new Data($this->Binding))->updateProspect($tblProspect, $Meta['Remark']);
     } else {
         $tblProspectAppointment = (new Data($this->Binding))->createProspectAppointment($Meta['Appointment']['ReservationDate'], $Meta['Appointment']['InterviewDate'], $Meta['Appointment']['TrialDate']);
         $OptionA = Company::useService()->getCompanyById($Meta['Reservation']['SchoolOptionA']);
         $OptionB = Company::useService()->getCompanyById($Meta['Reservation']['SchoolOptionB']);
         $tblProspectReservation = (new Data($this->Binding))->createProspectReservation($Meta['Reservation']['Year'], $Meta['Reservation']['Division'], $OptionA ? $OptionA : null, $OptionB ? $OptionB : null);
         (new Data($this->Binding))->createProspect($tblPerson, $tblProspectAppointment, $tblProspectReservation, $Meta['Remark']);
     }
     return new Success('Die Daten wurde erfolgreich gespeichert') . new Redirect('/People/Person', 3, array('Id' => $tblPerson->getId()));
 }
Ejemplo n.º 8
0
 /**
  * @param IFormInterface $Form
  * @param integer        $Responsibility
  *
  * @return IFormInterface|string
  */
 public function createResponsibility(IFormInterface $Form, $Responsibility)
 {
     /**
      * Skip to Frontend
      */
     var_dump($Responsibility);
     if (null === $Responsibility) {
         return $Form;
     }
     if (false === $Responsibility) {
         $Form->appendGridGroup(new FormGroup(new FormRow(new FormColumn(new Danger('Bitte wählen Sie einen Schulträger aus')))));
         return $Form;
     }
     $Error = false;
     if (!$Error) {
         $tblCompany = Company::useService()->getCompanyById($Responsibility);
         if ((new Data($this->Binding))->addResponsibility($tblCompany)) {
             return new Success('Der Schulträger wurde erfolgreich hinzugefügt') . new Redirect('/Setting/Consumer/Responsibility', 1, array('Id' => $tblCompany->getId()));
         } else {
             return new Danger('Der Schulträger konnte nicht hinzugefügt werden') . new Redirect('/Setting/Consumer/Responsibility', 10, array('Id' => $tblCompany->getId()));
         }
     }
     return $Form;
 }
Ejemplo n.º 9
0
 /**
  * @return bool|TblCompany[]
  */
 public function getCompanyAllHavingNoGroup()
 {
     $Exclude = $this->Connection->getEntityManager()->getQueryBuilder()->select('M.serviceTblCompany')->from('\\SPHERE\\Application\\Corporation\\Group\\Service\\Entity\\TblMember', 'M')->distinct()->getQuery()->getResult("COLUMN_HYDRATOR");
     $tblCompanyAll = Company::useService()->getCompanyAll();
     if ($tblCompanyAll) {
         /** @noinspection PhpUnusedParameterInspection */
         array_walk($tblCompanyAll, function (TblCompany &$tblCompany, $Index, $Exclude) {
             if (in_array($tblCompany->getId(), $Exclude)) {
                 $tblCompany = false;
             }
         }, $Exclude);
         $EntityList = array_filter($tblCompanyAll);
     } else {
         $EntityList = null;
     }
     return null === $EntityList ? false : $EntityList;
 }
Ejemplo n.º 10
0
 /**
  * @param IFormInterface $Form
  * @param integer        $School
  * @param array          $Type
  *
  * @return IFormInterface|string
  */
 public function createSchool(IFormInterface $Form, $Type, $School)
 {
     /**
      * Skip to Frontend
      */
     if (null === $Type) {
         return $Form;
     }
     $Error = false;
     if (null === $School) {
         $Form->appendGridGroup(new FormGroup(new FormRow(new FormColumn(new Danger('Bitte wählen Sie eine Schule aus')))));
         $Error = true;
     }
     if (!$Error) {
         $tblCompany = Company::useService()->getCompanyById($School);
         $tblType = (new Data($this->Binding))->getTypeById($Type['Type']);
         if ((new Data($this->Binding))->addSchool($tblCompany, $tblType)) {
             return new Success('Die Schule wurde erfolgreich hinzugefügt') . new Redirect('/Setting/Consumer/School', 1, array('Id' => $tblCompany->getId()));
         } else {
             return new Danger('Die Schule konnte nicht hinzugefügt werden') . new Redirect('/Setting/Consumer/School', 10, array('Id' => $tblCompany->getId()));
         }
     }
     return $Form;
 }
Ejemplo n.º 11
0
 /**
  * @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))))));
 }
Ejemplo n.º 12
0
 /**
  * @param IFormInterface $Form
  * @param TblToCompany   $tblToCompany
  * @param TblPerson      $tblPersonFrom
  * @param int            $tblCompanyTo
  * @param array          $Type
  *
  * @return IFormInterface|string
  */
 public function updateRelationshipToCompany(IFormInterface $Form, TblToCompany $tblToCompany, TblPerson $tblPersonFrom, $tblCompanyTo, $Type)
 {
     /**
      * Skip to Frontend
      */
     if (null === $Type) {
         return $Form;
     }
     $Error = false;
     if (empty($tblCompanyTo)) {
         $Form->appendGridGroup(new FormGroup(new FormRow(new FormColumn(new Danger('Bitte wählen Sie eine Firma')))));
         $Error = true;
     } else {
         $tblCompanyTo = Company::useService()->getCompanyById($tblCompanyTo);
     }
     if (!$Error) {
         $tblType = $this->getTypeById($Type['Type']);
         // Remove current
         (new Data($this->Binding))->removeCompanyRelationshipToPerson($tblToCompany);
         // Add new
         if ((new Data($this->Binding))->addCompanyRelationshipToPerson($tblCompanyTo, $tblPersonFrom, $tblType, $Type['Remark'])) {
             return new Success('Die Beziehung wurde erfolgreich geändert') . new Redirect('/People/Person', 1, array('Id' => $tblToCompany->getServiceTblPerson()->getId()));
         } else {
             return new Danger('Die Beziehung konnte nicht geändert werden') . new Redirect('/People/Person', 10, array('Id' => $tblToCompany->getServiceTblPerson()->getId()));
         }
     }
     return $Form;
 }
Ejemplo n.º 13
0
 /**
  * @return Form
  */
 private function formSchoolCompanyCreate()
 {
     $PanelSelectCompanyTitle = new PullClear('Schule auswählen:' . new PullRight(new Standard('Neue Firma anlegen', '/Corporation/Company', new Building(), array(), '"Schule hinzufügen" verlassen')));
     $tblTypeAll = School::useService()->getTypeAll();
     $tblCompanyAll = Company::useService()->getCompanyAll();
     array_walk($tblCompanyAll, function (TblCompany &$tblCompany) {
         $tblCompany = new PullClear(new RadioBox('School', $tblCompany->getName() . ' ' . new Success($tblCompany->getDescription()), $tblCompany->getId()));
     });
     return new Form(new FormGroup(array(new FormRow(array(new FormColumn(array(new Panel('Schulgrad', array(new SelectBox('Type[Type]', '', array('{{ Name }} {{ Description }}' => $tblTypeAll), new TileBig())), Panel::PANEL_TYPE_INFO)), 4), new FormColumn(array(new Panel($PanelSelectCompanyTitle, $tblCompanyAll, Panel::PANEL_TYPE_INFO, null, 15)), 8))))));
 }
Ejemplo n.º 14
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('&nbsp;' . new ChevronRight() . '&nbsp;', '#', array('Id' => $tblCompany->getId())));
                 $MetaTabs[0]->setActive();
             } else {
                 array_unshift($MetaTabs, new LayoutTab('&nbsp;' . new ChevronUp() . '&nbsp;', '#', 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;
 }