<commit_before><?php
namespace SPHERE\Application\Platform\Gatekeeper\Authorization\Consumer;

use SPHERE\Common\Frontend\Form\Repository\Button\Primary;
use SPHERE\Common\Frontend\Form\Repository\Field\TextField;
use SPHERE\Common\Frontend\Form\Structure\Form;
use SPHERE\Common\Frontend\Form\Structure\FormColumn;
use SPHERE\Common\Frontend\Form\Structure\FormGroup;
use SPHERE\Common\Frontend\Form\Structure\FormRow;
use SPHERE\Common\Frontend\Table\Repository\Title;
use SPHERE\Common\Frontend\Table\Structure\TableData;
use SPHERE\Common\Window\Stage;

/**
 * Class Frontend
 *
 * @package SPHERE\Application\System\Gatekeeper\Authorization\Consumer
 */
class Frontend
{

    /**
     * @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
            )<commit_msg>Fix: #SSW-328 Überarbeitung des Mandanten erstellungs Frontend<commit_after><?php
namespace SPHERE\Application\Platform\Gatekeeper\Authorization\Consumer;

use SPHERE\Application\Platform\Gatekeeper\Authorization\Consumer\Service\Entity\TblConsumer;
use SPHERE\Common\Frontend\Form\Repository\Button\Primary;
use SPHERE\Common\Frontend\Form\Repository\Field\TextField;
use SPHERE\Common\Frontend\Form\Structure\Form;
use SPHERE\Common\Frontend\Form\Structure\FormColumn;
use SPHERE\Common\Frontend\Form\Structure\FormGroup;
use SPHERE\Common\Frontend\Form\Structure\FormRow;
use SPHERE\Common\Frontend\Table\Repository\Title;
use SPHERE\Common\Frontend\Table\Structure\TableData;
use SPHERE\Common\Window\Stage;

/**
 * Class Frontend
 *
 * @package SPHERE\Application\System\Gatekeeper\Authorization\Consumer
 */
class Frontend
{

    /**
     * @param string $ConsumerAcronym
     * @param string $ConsumerName
     *
     * @return Stage
     */
    public static function frontendConsumer($ConsumerAcronym, $ConsumerName)
    {

        $Stage = new Stage('Mandanten');
        $tblConsumerAll = Consumer::useService()->getConsumerAll();
        $TableContent = array();
        array_walk($tblConsumerAll, function(TblConsumer $tblConsumer) use (&$TableContent){
            $Item['Acronym'] = $tblConsumer->getAcronym();
            $Item['Name'] = $tblConsumer->getName();
            array_push($TableContent, $Item);
        });
        $Stage->setContent(
            new TableData($TableContent, 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
            )
{'fraction_non_alphanumeric': 0.10543407663996536, 'fraction_numerical': 0.0015154795410261962, 'mean_word_length': 1.8536133415688696, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '938154', 'n_tokens_mistral': 1248, 'n_tokens_neox': 1230, 'n_words': 207}