<?php
namespace Modules\RemoteData\InfoBox; class View_ExtResSystem extends \App\Mvc\View_RemoteDataInfoBoxEntityAbstract { protected function getEntityRemoteDetails(\App\Entity\SelectAbstract $entity) { $output = \Engine\RemoteData\InfoBox\Container_Main::create( $entity->name.' ('.$entity->code.')' ) ->setShortTitle(sprintf("%s (%s)", $entity->name, $entity->code)) ->setId(sprintf("%s.%s", __CLASS__, $entity->getId())); $cont1 = \Engine\RemoteData\InfoBox\Container_Simple::create($this->lang['general']['titles']['general']); $output->addContainer($cont1); $cont1->addField( \Engine\RemoteData\InfoBox\Field_String::create($this->lang['general']['fields']['id'], $entity->getId()) ); $cont1->addField( \Engine\RemoteData\InfoBox\Field_String::create($this->lang['general']['fields']['name'], $entity->name) ); $cont1->addField( \Engine\RemoteData\InfoBox\Field_String::create($this->lang['general']['fields']['code'], $entity->code) ); $cont1->addField( \Engine\RemoteData\InfoBox\Field_Boolean::create($this->lang['extResSystem']['fields']['active'], (bool)$entity->active) ); if ($entity->type) { $cont1->addField( \Engine\RemoteData\InfoBox\Field_String::create($this->lang['extResSystem']['fields']['type'], $entity->type) ); } if ($entity->url) { $cont1->addField( \Engine\RemoteData\InfoBox\Field_Url::create($this->lang['extResSystem']['fields']['url'], ['label' => $entity->url, 'value'=>$entity->url])); } $cont2 = \Engine\RemoteData\InfoBox\Container_Simple::create($this->lang['extResSystem']['titles']['manageAccount']); $output->addContainer($cont2); $cont2->addField( \Engine\RemoteData\InfoBox\Field_String::create($this->lang['extResSystem']['fields']['username'], $entity->username) ); $cont2->addField( \Engine\RemoteData\InfoBox\Field_String::create($this->lang['extResSystem']['fields']['token'], $entity->token) ); $cont3 = \Engine\RemoteData\InfoBox\Container_Simple::create($this->lang['general']['titles']['updates'])->setHidden(true); $output->addContainer($cont3); $cont3->addField( \Engine\RemoteData\InfoBox\Field_DateTime::create($this->lang['general']['fields']['addTime'], \Engine\DateTime::createFromTimestamp($entity->addTime)) ); $cont3->addField( \App\RemoteData\InfoBox\Field_EntityInfoBox::create($this->lang['general']['fields']['addUser'], $entity->addUser->name)->setEntity('user', $entity->idAddUser) ); $cont3->addField( \Engine\RemoteData\InfoBox\Field_DateTime::create($this->lang['general']['fields']['updateTime'], \Engine\DateTime::createFromTimestamp($entity->lastUpdateTime)) ); $cont3->addField( \App\RemoteData\InfoBox\Field_EntityInfoBox::create($this->lang['general']['fields']['updateUser'], $entity->updateUser->name)->setEntity('user', $entity->idUpdateUser) ); if ($entity->updatesCount) { $cont3->addField( \Engine\RemoteData\InfoBox\Field_String::create($this->lang['general']['fields']['updatesCount'], $entity->updatesCount) ); } return $output; } } 