/**
  * @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;
 }
Example #2
0
 /**
  * @param $Id
  *
  * @return Stage
  */
 public function frontendInvoicePaymentTypeSelect($Id)
 {
     $Stage = new Stage();
     $Stage->setTitle('Rechnung');
     $Stage->setDescription('Zahlungsart Auswählen');
     $Stage->addButton(new Primary('Zurück', '/Billing/Bookkeeping/Invoice/IsNotConfirmed/Edit', new ChevronLeft(), array('Id' => $Id)));
     $tblInvoice = Invoice::useService()->entityInvoiceById($Id);
     $tblPaymentTypeList = Banking::useService()->entityPaymentTypeAll();
     if ($tblPaymentTypeList) {
         foreach ($tblPaymentTypeList as &$tblPaymentType) {
             $tblPaymentType = new LayoutColumn(new Panel('Zahlungsart', $tblPaymentType->getName(), $tblPaymentType->getId() === $tblInvoice->getServiceBillingBankingPaymentType()->getId() ? Panel::PANEL_TYPE_SUCCESS : Panel::PANEL_TYPE_DEFAULT, new Primary('Auswählen', '/Billing/Bookkeeping/Invoice/IsNotConfirmed/Payment/Type/Change', new Ok(), array('Id' => $tblInvoice->getId(), 'PaymentTypeId' => $tblPaymentType->getId()))), 3);
         }
     }
     $Stage->setContent(new Layout(array(new LayoutGroup(array(new LayoutRow(array(new LayoutColumn(array(new Panel('Rechnungsnummer', $tblInvoice->getNumber(), Panel::PANEL_TYPE_SUCCESS)), 3), new LayoutColumn(array(new Panel('Empfänger', $tblInvoice->getDebtorFullName(), Panel::PANEL_TYPE_SUCCESS)), 3))))), new LayoutGroup(new LayoutRow($tblPaymentTypeList), new Title('Zahlungsarten')))));
     return $Stage;
 }
Example #3
0
 /**
  * @param TblDebtor $tblDebtor
  *
  * @return Layout
  */
 public function layoutCommodityDebtor(TblDebtor $tblDebtor)
 {
     $tblCommodityList = Banking::useService()->entityCommodityAllByDebtor($tblDebtor);
     if (!empty($tblCommodityList)) {
         /** @var TblCommodity $tblCommodity */
         foreach ($tblCommodityList as $Key => &$tblCommodity) {
             $tblReference = Banking::useService()->entityReferenceByDebtorAndCommodity($tblDebtor, $tblCommodity);
             if ($tblReference) {
                 $tblCommodity = new LayoutColumn(array(new Panel($tblCommodity->getName(), null, Panel::PANEL_TYPE_SUCCESS)), 3);
             } else {
                 $tblCommodity = new LayoutColumn(array(new Panel($tblCommodity->getName(), null, Panel::PANEL_TYPE_DANGER)), 3);
             }
         }
     }
     return new Layout(new LayoutGroup(new LayoutRow($tblCommodityList), new Title('Leistungen')));
 }