Ejemplo n.º 1
0
 /**
  * @param array $Group
  *
  * @return Stage
  */
 public function frontendGroup($Group)
 {
     $Stage = new Stage('Personengruppen');
     $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('', '/People/Group/Edit', new Edit(), array('Id' => $tblGroup->getId()), 'Daten ändern') . new Standard('', '/People/Group/Manage', new GroupIcon(), array('Id' => $tblGroup->getId()), 'Personen ändern') . ($tblGroup->getIsLocked() ? '' : new Standard('', '/People/Group/Destroy', new Remove(), array('Id' => $tblGroup->getId()), 'Gruppe löschen')));
             $Footer .= new PullRight(new Label(PeoplePerson::useService()->countPersonAllByGroup($tblGroup) . ' Personen', 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', 'Verfügbare Personengruppen')), 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
 /**
  * @param TblCompany $tblCompany
  *
  * @return Layout
  */
 public function frontendLayoutCompany(TblCompany $tblCompany)
 {
     $tblMailAll = Mail::useService()->getMailAllByCompany($tblCompany);
     if ($tblMailAll !== false) {
         array_walk($tblMailAll, function (TblToCompany &$tblToCompany) {
             $Panel = array($tblToCompany->getTblMail()->getAddress());
             if ($tblToCompany->getRemark()) {
                 array_push($Panel, new Muted(new Small($tblToCompany->getRemark())));
             }
             $tblToCompany = new LayoutColumn(new Panel(new MailIcon() . ' ' . $tblToCompany->getTblType()->getName(), $Panel, Panel::PANEL_TYPE_SUCCESS, new Standard('', '/Corporation/Company/Mail/Edit', new Pencil(), array('Id' => $tblToCompany->getId()), 'Bearbeiten') . new Standard('', '/Corporation/Company/Mail/Destroy', new Remove(), array('Id' => $tblToCompany->getId()), 'Löschen')), 3);
         });
     } else {
         $tblMailAll = array(new LayoutColumn(new Warning('Keine E-Mail Adressen hinterlegt')));
     }
     $LayoutRowList = array();
     $LayoutRowCount = 0;
     $LayoutRow = null;
     /**
      * @var LayoutColumn $tblMail
      */
     foreach ($tblMailAll as $tblMail) {
         if ($LayoutRowCount % 4 == 0) {
             $LayoutRow = new LayoutRow(array());
             $LayoutRowList[] = $LayoutRow;
         }
         $LayoutRow->addColumn($tblMail);
         $LayoutRowCount++;
     }
     return new Layout(new LayoutGroup($LayoutRowList));
 }
Ejemplo n.º 3
0
 /**
  * @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));
 }
Ejemplo n.º 4
0
 /**
  * @param $PictureList
  *
  * @return Layout
  */
 public function PictureShow($PictureList)
 {
     if (!empty($PictureList)) {
         //            $this->getDebugger()->screenDump( $PictureList );
         //            /** @var TblTestPicture $Picture */
         //            foreach ($PictureList as $Key => &$Picture) {
         ////                $this->getDebugger()->screenDump($Picture);
         //                $Picture = new LayoutColumn(array(
         ////                    '<div id="Thumb-'.$Key.'"></div>
         ////                    <script type="text/javascript">
         ////                        Client.Use("ModAlways", function()
         ////                        {
         ////                            jQuery("div#Thumb-'.$Key.'").load("/Api/Test/ShowThumbnail?Id='.$Picture->getId().'");
         ////                        });
         ////                    </script>'
         //                    (new \SPHERE\Application\Api\Test\Frontend())->ShowThumbnail($Picture->getId())
         //                ), 6);
         //            }
         //
         //            return new Layout(
         //                new LayoutGroup(new LayoutRow($PictureList))
         //            );
         /** @var TblTestPicture $Picture */
         foreach ((array) $PictureList as $Index => $Picture) {
             $PictureList[$Index] = new LayoutColumn(array((new \SPHERE\Application\Api\Test\Frontend())->ShowThumbnail($Picture->getId(), true)), 3);
         }
     } else {
         $PictureList = array(new LayoutColumn(new Warning('Keine Bilder hinterlegt')));
     }
     $LayoutRowList = array();
     $LayoutRowCount = 0;
     $LayoutRow = null;
     /**
      * @var LayoutColumn $Picture
      */
     foreach ($PictureList as $Picture) {
         if ($LayoutRowCount % 4 == 0) {
             $LayoutRow = new LayoutRow(array());
             $LayoutRowList[] = $LayoutRow;
         }
         $LayoutRow->addColumn($Picture);
         $LayoutRowCount++;
     }
     return new Layout(new LayoutGroup($LayoutRowList));
 }
Ejemplo n.º 5
0
 /**
  * @param TblCompany|TblPerson|Element $tblEntity
  *
  * @return Layout
  */
 public function frontendLayoutCompany(Element $tblEntity)
 {
     if ($tblEntity instanceof TblPerson) {
         $tblRelationshipAll = Relationship::useService()->getCompanyRelationshipAllByPerson($tblEntity);
     } else {
         if ($tblEntity instanceof TblCompany) {
             $tblRelationshipAll = Relationship::useService()->getCompanyRelationshipAllByCompany($tblEntity);
         } else {
             $tblRelationshipAll = false;
         }
     }
     if ($tblRelationshipAll !== false) {
         /** @noinspection PhpUnusedParameterInspection */
         array_walk($tblRelationshipAll, function (TblToCompany &$tblToCompany, $Index, Element $tblEntity) {
             $Panel = array($tblToCompany->getServiceTblPerson()->getFullName(), $tblToCompany->getServiceTblCompany()->getName());
             if ($tblToCompany->getRemark()) {
                 array_push($Panel, new Muted(new Small($tblToCompany->getRemark())));
             }
             $tblToCompany = new LayoutColumn(new Panel(new Building() . ' ' . new Link() . ' ' . $tblToCompany->getTblType()->getName(), $Panel, $tblEntity instanceof TblPerson ? Panel::PANEL_TYPE_INFO : Panel::PANEL_TYPE_DEFAULT, $tblEntity instanceof TblPerson ? new Standard('', '/Corporation/Company/Relationship/Edit', new Pencil(), array('Id' => $tblToCompany->getId()), 'Bearbeiten') . new Standard('', '/Corporation/Company/Relationship/Destroy', new Remove(), array('Id' => $tblToCompany->getId()), 'Löschen') . new Standard('', '/Corporation/Company', new Building(), array('Id' => $tblToCompany->getServiceTblCompany()->getId()), 'zur Firma') : new Standard('', '/People/Person', new PersonIcon(), array('Id' => $tblToCompany->getServiceTblPerson()->getId()), 'zur Person')), 3);
         }, $tblEntity);
     } else {
         $tblRelationshipAll = array(new LayoutColumn(new Warning('Keine Firmenbeziehungen hinterlegt')));
     }
     $LayoutRowList = array();
     $LayoutRowCount = 0;
     $LayoutRow = null;
     /**
      * @var LayoutColumn $tblRelationship
      */
     foreach ($tblRelationshipAll as $tblRelationship) {
         if ($LayoutRowCount % 4 == 0) {
             $LayoutRow = new LayoutRow(array());
             $LayoutRowList[] = $LayoutRow;
         }
         $LayoutRow->addColumn($tblRelationship);
         $LayoutRowCount++;
     }
     return new Layout(new LayoutGroup($LayoutRowList));
 }
Ejemplo n.º 6
0
 /**
  * @param TblPerson $tblPerson
  *
  * @return Layout
  */
 public function frontendLayoutPerson(TblPerson $tblPerson)
 {
     $tblRelationshipAll = Relationship::useService()->getPersonRelationshipAllByPerson($tblPerson);
     if ($tblRelationshipAll !== false) {
         /** @noinspection PhpUnusedParameterInspection */
         array_walk($tblRelationshipAll, function (TblToPerson &$tblToPerson, $Index, TblPerson $tblPerson) {
             $Panel = array($tblToPerson->getServiceTblPersonFrom()->getId() == $tblPerson->getId() ? $tblToPerson->getServiceTblPersonTo()->getFullName() : $tblToPerson->getServiceTblPersonFrom()->getFullName());
             if ($tblToPerson->getRemark()) {
                 array_push($Panel, new Muted(new Small($tblToPerson->getRemark())));
             }
             $tblToPerson = new LayoutColumn(new Panel(new Link() . ' ' . $tblToPerson->getTblType()->getName(), $Panel, $tblToPerson->getServiceTblPersonFrom()->getId() == $tblPerson->getId() ? Panel::PANEL_TYPE_SUCCESS : Panel::PANEL_TYPE_DEFAULT, $tblToPerson->getServiceTblPersonFrom()->getId() == $tblPerson->getId() ? new Standard('', '/People/Person/Relationship/Edit', new Pencil(), array('Id' => $tblToPerson->getId()), 'Bearbeiten') . new Standard('', '/People/Person/Relationship/Destroy', new Remove(), array('Id' => $tblToPerson->getId()), 'Löschen') . new Standard('', '/People/Person', new PersonIcon(), array('Id' => $tblToPerson->getServiceTblPersonTo()->getId()), 'zur Person') : new Standard('', '/People/Person', new PersonIcon(), array('Id' => $tblToPerson->getServiceTblPersonFrom()->getId()), 'zur Person')), 3);
         }, $tblPerson);
     } else {
         $tblRelationshipAll = array(new LayoutColumn(new Warning('Keine Beziehungen hinterlegt')));
     }
     $LayoutRowList = array();
     $LayoutRowCount = 0;
     $LayoutRow = null;
     /**
      * @var LayoutColumn $tblMail
      */
     foreach ($tblRelationshipAll as $tblMail) {
         if ($LayoutRowCount % 4 == 0) {
             $LayoutRow = new LayoutRow(array());
             $LayoutRowList[] = $LayoutRow;
         }
         $LayoutRow->addColumn($tblMail);
         $LayoutRowCount++;
     }
     return new Layout(new LayoutGroup($LayoutRowList));
 }
Ejemplo n.º 7
0
 public function LayoutCombine(TblCompany $tblCompany)
 {
     $tblAddressAll = Address::useService()->getAddressAllByCompany($tblCompany);
     $tblPhoneAll = Phone::useService()->getPhoneAllByCompany($tblCompany);
     $tblMailAll = Mail::useService()->getMailAllByCompany($tblCompany);
     $tblRelationshipAll = Relationship::useService()->getCompanyRelationshipAllByCompany($tblCompany);
     if ($tblAddressAll !== false) {
         array_walk($tblAddressAll, function (TblToCompany &$tblToCompany) {
             $Panel = array($tblToCompany->getTblAddress()->getLayout());
             if ($tblToCompany->getRemark()) {
                 array_push($Panel, new Muted(new Small($tblToCompany->getRemark())));
             }
             $tblToCompany = new LayoutColumn(new Panel(new MapMarker() . ' ' . $tblToCompany->getTblType()->getName(), $Panel, Panel::PANEL_TYPE_SUCCESS, new Standard('', '/Corporation/Company/Address/Edit', new Pencil(), array('Id' => $tblToCompany->getId()), 'Bearbeiten') . new Standard('', '/Corporation/Company/Address/Destroy', new Remove(), array('Id' => $tblToCompany->getId()), 'Löschen')), 3);
         });
     } else {
         $tblAddressAll = array(new LayoutColumn(new Warning('Keine Adressen hinterlegt')));
     }
     if ($tblPhoneAll !== false) {
         array_walk($tblPhoneAll, function (\SPHERE\Application\Contact\Phone\Service\Entity\TblToCompany &$tblToCompany) {
             $Panel = array($tblToCompany->getTblPhone()->getNumber());
             if ($tblToCompany->getRemark()) {
                 array_push($Panel, new Muted(new Small($tblToCompany->getRemark())));
             }
             $tblToCompany = new LayoutColumn(new Panel((preg_match('!Fax!is', $tblToCompany->getTblType()->getName() . ' ' . $tblToCompany->getTblType()->getDescription()) ? new PhoneFax() : (preg_match('!Mobil!is', $tblToCompany->getTblType()->getName() . ' ' . $tblToCompany->getTblType()->getDescription()) ? new PhoneMobil() : new PhoneIcon())) . ' ' . $tblToCompany->getTblType()->getName() . ' ' . $tblToCompany->getTblType()->getDescription(), $Panel, preg_match('!Notfall!is', $tblToCompany->getTblType()->getName() . ' ' . $tblToCompany->getTblType()->getDescription()) ? Panel::PANEL_TYPE_DANGER : Panel::PANEL_TYPE_SUCCESS, new Standard('', '/Corporation/Company/Phone/Edit', new Pencil(), array('Id' => $tblToCompany->getId()), 'Bearbeiten') . new Standard('', '/Corporation/Company/Phone/Destroy', new Remove(), array('Id' => $tblToCompany->getId()), 'Löschen')), 3);
         });
     } else {
         $tblPhoneAll = array(new LayoutColumn(new Warning('Keine Telefonnummern hinterlegt')));
     }
     if ($tblMailAll !== false) {
         array_walk($tblMailAll, function (\SPHERE\Application\Contact\Mail\Service\Entity\TblToCompany &$tblToCompany) {
             $Panel = array($tblToCompany->getTblMail()->getAddress());
             if ($tblToCompany->getRemark()) {
                 array_push($Panel, new Muted(new Small($tblToCompany->getRemark())));
             }
             $tblToCompany = new LayoutColumn(new Panel(new MailIcon() . ' ' . $tblToCompany->getTblType()->getName(), $Panel, Panel::PANEL_TYPE_SUCCESS, new Standard('', '/Corporation/Company/Mail/Edit', new Pencil(), array('Id' => $tblToCompany->getId()), 'Bearbeiten') . new Standard('', '/Corporation/Company/Mail/Destroy', new Remove(), array('Id' => $tblToCompany->getId()), 'Löschen')), 3);
         });
     } else {
         $tblMailAll = array(new LayoutColumn(new Warning('Keine E-Mail Adressen hinterlegt')));
     }
     if ($tblRelationshipAll !== false) {
         array_walk($tblRelationshipAll, function (\SPHERE\Application\People\Relationship\Service\Entity\TblToCompany &$tblToCompany, $Index, TblCompany $tblCompany) {
             $Panel = array($tblToCompany->getServiceTblPerson()->getFullName(), $tblToCompany->getServiceTblCompany()->getName());
             if ($tblToCompany->getRemark()) {
                 array_push($Panel, new Muted(new Small($tblToCompany->getRemark())));
             }
             $tblToCompany = new LayoutColumn(new Panel(new Building() . ' ' . new Link() . ' ' . $tblToCompany->getTblType()->getName(), $Panel, Panel::PANEL_TYPE_DEFAULT, new Standard('', '/People/Person', new PersonIcon(), array('Id' => $tblToCompany->getServiceTblPerson()->getId()), 'zur Person')), 3);
         }, $tblCompany);
     } else {
         $tblRelationshipAll = array(new LayoutColumn(new Warning('Keine Firmenbeziehungen hinterlegt')));
     }
     $LayoutRowList = array();
     $LayoutRowCount = 0;
     $LayoutRow = null;
     /**
      * @var LayoutColumn $tblAddress
      */
     foreach ($tblAddressAll as $tblAddress) {
         if ($LayoutRowCount % 50 == 0) {
             $LayoutRow = new LayoutRow(array());
             $LayoutRowList[] = $LayoutRow;
         }
         $LayoutRow->addColumn($tblAddress);
         $LayoutRowCount++;
     }
     /**
      * @var LayoutColumn $tblPhone
      */
     foreach ($tblPhoneAll as $tblPhone) {
         if ($LayoutRowCount % 50 == 0) {
             $LayoutRow = new LayoutRow(array());
             $LayoutRowList[] = $LayoutRow;
         }
         $LayoutRow->addColumn($tblPhone);
         $LayoutRowCount++;
     }
     /**
      * @var LayoutColumn $tblMail
      */
     foreach ($tblMailAll as $tblMail) {
         if ($LayoutRowCount % 50 == 0) {
             $LayoutRow = new LayoutRow(array());
             $LayoutRowList[] = $LayoutRow;
         }
         $LayoutRow->addColumn($tblMail);
         $LayoutRowCount++;
     }
     /**
      * @var LayoutColumn $tblRelationship
      */
     foreach ($tblRelationshipAll as $tblRelationship) {
         if ($LayoutRowCount % 50 == 0) {
             $LayoutRow = new LayoutRow(array());
             $LayoutRowList[] = $LayoutRow;
         }
         $LayoutRow->addColumn($tblRelationship);
         $LayoutRowCount++;
     }
     return new Layout(new LayoutGroup($LayoutRowList));
 }
Ejemplo n.º 8
0
 /**
  * @param TblCompany $tblCompany
  *
  * @return Layout
  */
 public function frontendLayoutCompany(TblCompany $tblCompany)
 {
     $tblPhoneAll = Phone::useService()->getPhoneAllByCompany($tblCompany);
     if ($tblPhoneAll !== false) {
         array_walk($tblPhoneAll, function (TblToCompany &$tblToCompany) {
             $Panel = array($tblToCompany->getTblPhone()->getNumber());
             if ($tblToCompany->getRemark()) {
                 array_push($Panel, new Muted(new Small($tblToCompany->getRemark())));
             }
             $tblToCompany = new LayoutColumn(new Panel((preg_match('!Fax!is', $tblToCompany->getTblType()->getName() . ' ' . $tblToCompany->getTblType()->getDescription()) ? new PhoneFax() : (preg_match('!Mobil!is', $tblToCompany->getTblType()->getName() . ' ' . $tblToCompany->getTblType()->getDescription()) ? new PhoneMobil() : new PhoneIcon())) . ' ' . $tblToCompany->getTblType()->getName() . ' ' . $tblToCompany->getTblType()->getDescription(), $Panel, preg_match('!Notfall!is', $tblToCompany->getTblType()->getName() . ' ' . $tblToCompany->getTblType()->getDescription()) ? Panel::PANEL_TYPE_DANGER : Panel::PANEL_TYPE_SUCCESS, new Standard('', '/Corporation/Company/Phone/Edit', new Pencil(), array('Id' => $tblToCompany->getId()), 'Bearbeiten') . new Standard('', '/Corporation/Company/Phone/Destroy', new Remove(), array('Id' => $tblToCompany->getId()), 'Löschen')), 3);
         });
     } else {
         $tblPhoneAll = array(new LayoutColumn(new Warning('Keine Telefonnummern hinterlegt')));
     }
     $LayoutRowList = array();
     $LayoutRowCount = 0;
     $LayoutRow = null;
     /**
      * @var LayoutColumn $tblPhone
      */
     foreach ($tblPhoneAll as $tblPhone) {
         if ($LayoutRowCount % 4 == 0) {
             $LayoutRow = new LayoutRow(array());
             $LayoutRowList[] = $LayoutRow;
         }
         $LayoutRow->addColumn($tblPhone);
         $LayoutRowCount++;
     }
     return new Layout(new LayoutGroup($LayoutRowList));
 }