<?php
namespace App\Controller\Admin;
use App\Entity\Airline;
use App\Entity\Airplane;
use App\Entity\Appointment;
use App\Entity\AppUser;
use App\Entity\BusinessClient;
use App\Entity\Cell;
use App\Entity\Consignee;
use App\Entity\CubaCustomsCategory;
use App\Entity\CubaCustomsItem;
use App\Entity\CurrencyChange;
use App\Entity\CustomsBroker;
use App\Entity\Dispatch\Dispatch;
use App\Entity\Documentation\CargoManifest;
use App\Entity\Documentation\HouseGuide;
use App\Entity\Documentation\HouseGuideNumber;
use App\Entity\Documentation\MasterGuide;
use App\Entity\Documentation\MasterGuideNumber;
use App\Entity\Enterprise;
use App\Entity\FiscalWarehouse;
use App\Entity\FreightForwarder;
use App\Entity\GeneralConfig;
use App\Entity\GroundCarrier;
use App\Entity\Level;
use App\Entity\MetricUnit;
use App\Entity\OtherProvider;
use App\Entity\Packing;
use App\Entity\Product\Product;
use App\Entity\Quote\Client;
use App\Entity\Quote\Quote;
use App\Entity\Quote\Service;
use App\Entity\SecurityDocument\Document;
use App\Entity\SecurityDocument\Vocabulary;
use App\Entity\Shelving;
use App\Entity\Shipping;
use App\Entity\Storage;
use App\Entity\TariffFraction;
use App\Entity\TaxDeposit;
use EasyCorp\Bundle\EasyAdminBundle\Config\Action;
use EasyCorp\Bundle\EasyAdminBundle\Config\Assets;
use EasyCorp\Bundle\EasyAdminBundle\Config\Dashboard;
use EasyCorp\Bundle\EasyAdminBundle\Config\MenuItem;
use EasyCorp\Bundle\EasyAdminBundle\Config\UserMenu;
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractDashboardController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Core\User\UserInterface;
class DashboardController extends AbstractDashboardController
{
/**
* @Route("/admin", name="admin")
*/
public function index(): Response
{
return $this->render('dashboard/dashboard.html.twig');
}
public function configureDashboard(): Dashboard
{
return Dashboard::new()
->setTitle('<img class="logo" src="web/img/CargoLogo.png" alt="Merely Cargo">');
}
public function configureMenuItems(): iterable
{
yield MenuItem::section('app.menu.package.manage');
yield MenuItem::linkToCrud('Citas Registradas', 'fas fa-list', Appointment::class);
yield MenuItem::linkToCrud('Expedientes', 'fas fa-list', Shipping::class);
yield MenuItem::linkToCrud('Despachos', 'fas fa-list', Dispatch::class);
yield MenuItem::linkToCrud('app.menu.packaging', 'fas fa-list', Packing::class);
yield MenuItem::linkToCrud('Productos', 'fas fa-list', Product::class);
yield MenuItem::section('Cotizaciones');
yield MenuItem::linkToCrud('Ver Todas', 'fas fa-list', Quote::class);
yield MenuItem::linkToCrud('Clientes', 'fas fa-list', Client::class);
yield MenuItem::section('Documentación');
yield MenuItem::linkToCrud('Guías Master', 'fas fa-list', MasterGuide::class);
yield MenuItem::linkToCrud('Manifiestos de Carga', 'fas fa-list', CargoManifest::class);
yield MenuItem::linkToCrud('Guías House', 'fas fa-list', HouseGuide::class);
yield MenuItem::linkToCrud('Documentos de Seguridad', 'fas fa-list', \App\Entity\Documentation\Document::class);
yield MenuItem::section('app.menu.customs.cuba.label');
yield MenuItem::linkToCrud('app.menu.customs.cuba.category', 'fas fa-list', CubaCustomsCategory::class);
yield MenuItem::linkToCrud('app.menu.customs.cuba.item', 'fas fa-list', CubaCustomsItem::class);
yield MenuItem::linkToCrud('app.menu.customs.cuba.umt', 'fas fa-list', MetricUnit::class);
yield MenuItem::section('app.menu.storage.label');
yield MenuItem::linkToCrud('app.menu.storage.store', 'fas fa-list', Storage::class);
yield MenuItem::linkToCrud('app.menu.storage.shelving', 'fas fa-list', Shelving::class);
yield MenuItem::linkToCrud('app.menu.storage.level', 'fas fa-list', Level::class);
yield MenuItem::linkToCrud('app.menu.storage.cell', 'fas fa-list', Cell::class);
yield MenuItem::section('Nomencladores');
yield MenuItem::linkToCrud('Clientes Empresariales', 'fas fa-list', BusinessClient::class);
yield MenuItem::linkToCrud('Consignatarios', 'fas fa-list', Consignee::class);
yield MenuItem::linkToCrud('Empresas', 'fas fa-list', Enterprise::class);
yield MenuItem::linkToCrud('Aerolíneas', 'fas fa-list', Airline::class);
yield MenuItem::linkToCrud('app.menu.plane', 'fas fa-list', Airplane::class);
yield MenuItem::linkToCrud('Transportistas Terrestres', 'fas fa-list', GroundCarrier::class);
yield MenuItem::linkToCrud('Agencias Aduanales', 'fas fa-list', CustomsBroker::class);
yield MenuItem::linkToCrud('Almacenes Fiscales', 'fas fa-list', FiscalWarehouse::class);
yield MenuItem::linkToCrud('Depósitos Fiscales', 'fas fa-list', TaxDeposit::class);
yield MenuItem::linkToCrud('Transitarios', 'fas fa-list', FreightForwarder::class);
yield MenuItem::linkToCrud('Otros Proveedores', 'fas fa-list', OtherProvider::class);
yield MenuItem::linkToCrud('Servicios para cotización', 'fas fa-list', Service::class);
yield MenuItem::linkToCrud('app.menu.fraction', 'fas fa-list', TariffFraction::class);
yield MenuItem::section('Plantillas de Documentación');
yield MenuItem::linkToCrud('Plantillas', 'fas fa-list', Document::class);
yield MenuItem::linkToCrud('Vocabulario', 'fas fa-list', Vocabulary::class);
yield MenuItem::section('Configuración');
yield MenuItem::linkToCrud('app.menu.config', 'fas fa-list', GeneralConfig::class)
->setAction(Action::EDIT)
->setEntityId(1);
yield MenuItem::linkToCrud('Tasas de Cambio', 'fas fa-list', CurrencyChange::class);
yield MenuItem::linkToCrud('Números de Guía Master', 'fas fa-list', MasterGuideNumber::class);
yield MenuItem::linkToCrud('Números de Guía House', 'fas fa-list', HouseGuideNumber::class);
yield MenuItem::linkToCrud('Días de Atención', 'fas fa-list', GeneralConfig\AttentionDay::class);
yield MenuItem::linkToCrud('Usuarios', 'fas fa-user', AppUser::class);
}
public function configureUserMenu(UserInterface $user): UserMenu
{
return parent::configureUserMenu($user)
->addMenuItems([
MenuItem::linkToRoute('Perfil', 'fas fa-id-card', 'app_appuser_profile')
]);
}
public function configureAssets(): Assets
{
return Assets::new()->addWebpackEncoreEntry('app_admin');
}
}