mwsimple / admincrudbundle Goto Github PK
View Code? Open in Web Editor NEWAdminCrud genera un controlador muy básico para una Entity dada. Este controlador extiende e implementa un controlador Super Genial.
Home Page: http://www.tecspro.com.ar
AdminCrud genera un controlador muy básico para una Entity dada. Este controlador extiende e implementa un controlador Super Genial.
Home Page: http://www.tecspro.com.ar
in Controller/BackendController.php, line 60
The
Exception
class resolves to the following classes:Imagine\Exception\Exception
orSymfony\Component\Config\Definition\Exception\Exception
orIvory\CKEditorBundle\Exception\Exception
.
Did you forget to add a corresponding use statement for one of them?
}
$em->flush();
$res = true;
} catch (Exception $e) {
$res = false;
}
} else {
$res = false;
}
Posted from SensioLabsInsight
30% of all actions have more than 20 lines. This violation is raised when more than 10% actions are too long.
Posted from SensioLabsInsight
Put the images like https://github.com/MWSimple/AdminCrudBundle/blob/version27/preview_list.png
inside a doc directory
in Command/MWSimpleCrudCommand.php, line 115
Commented out code reduces readability and lowers the code confidence for other developers. If it's common usage for debug, it should not be committed. Using a version control system, such code can be safely removed.
$withWrite = $input->getOption('with-write') ?: true;
$output->writeln(array(
'',
'By default, the generator creates actions: list, show, new, update, and delete.',
));
// $withWrite = $dialog->askConfirmation($output, $dialog->getQuestion('Do you want to generate the "write" actions', $withWrite ? 'yes' : 'no', '?'), $withWrite);
$input->setOption('with-write', true);
// format
$format = $input->getOption('format');
$output->writeln(array(
Posted from SensioLabsInsight
in Controller/BackEndController.php, line 6
The class
Symfony\Component\Yaml\Yaml
is declared but never used. You should remove theuse
statement.
<?php
namespace MWSimple\Bundle\AdminCrudBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Yaml\Yaml;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
/**
Posted from SensioLabsInsight
in Command/MWSimpleCrudCommand.php, line 63
__DIR__
and__FILE__
constants may conflict with the Symfony resource overriding system
if (is_dir($dir = $this->getContainer()->get('kernel')->getRootdir().'/Resources/SensioGeneratorBundle/skeleton')) {
$skeletonDirs[] = $dir;
}
$skeletonDirs[] = __DIR__.'/../Resources/skeleton';
$skeletonDirs[] = __DIR__.'/../Resources';
return $skeletonDirs;
}
Posted from SensioLabsInsight
pl y fr
Personalizar carpeta para el Theme: https://github.com/krzysiekpiasecki/Gentelella
USAR IS_NULL
in Form/DataTransformer/BootstrapDateTimeTransformer.php, line 79
With booleans, only strict comparison (with
===
operator) should be used to lower bug risks and to improve performances.
{
if (! ($value instanceof \DateTime)) {
return $value;
}
if (null == $value) {
return null;
}
if ($this->widgetType == 'date') {
$value = new \DateTime($value->format('Y-m-d'));
Posted from SensioLabsInsight
Al guardar la imagen utiliza el nombre del archivo si subo 2 igual nombre archivo lo pisa arriba. Guardar el nombre de archivo de otra manera
Configurar los servicios ACL desde la configuracion del bundle.
in Generator/MWSimpleCrudGenerator.php, line 217
The next 24 lines appear both in
Generator/MWSimpleCrudGenerator.php:217
andGenerator/MWSimpleFormGenerator.php:103
.
* Fields can be both column fields and association fields.
*
* @param ClassMetadataInfo $metadata
* @return array $fields
*/
private function getFieldsAssociationFromMetadata(ClassMetadataInfo $metadata)
{
$associations = array();
foreach ($metadata->associationMappings as $value) {
$parts = explode('\\', $value['targetEntity']);
if (count($parts) === 3) {
Posted from SensioLabsInsight
Implementar https://github.com/stephanecollot/DatetimepickerBundle y reemplazar por el que tiene ahora. Borrar las configuraciones necesarias y agregar la documentacion.
Remove 'Hello Fabien' test and unnecesary code
No muestra correctamente
in Form/DataTransformer/BootstrapDateTimeTransformer.php, line 87
The
or
operator does not have the same precedence as||
.
This could lead to unexpected behavior, use||
instead.
if ($this->widgetType == 'date') {
$value = new \DateTime($value->format('Y-m-d'));
}
if ($this->widgetType == 'time' or $this->widgetType == 'day') {
$value = new \DateTime('1970-01-01 ' . $value->format('H:i:s'));
}
return $value;
}
Posted from SensioLabsInsight
Crear BaseFile con lo necesario de VichUploaderBundle para poder extender
No permite editar lo que esta sobre el checkbox
Your project contains files with permissive permissions. In order to avoid opening a security breach, you should restrict execution rights on following files:
- Resources/views/Form/field_file.html.twig
- Services/ACLManager.php
chmod a-x 'Resources/views/Form/field_file.html.twig' \
'Services/ACLManager.php'
Posted from SensioLabsInsight
Agregar a todos los archivos un espacio al final como buena practica
in Command/MWSimpleCrudCommand.php, line 148
This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.
sprintf('You are going to generate a CRUD controller for "<info>%s:%s</info>"', $bundle, $entity),
sprintf('using the "<info>%s</info>" format.', $format),
'',
));
}
}
Posted from SensioLabsInsight
in Entity/BaseFile.php, line 113
__DIR__
and__FILE__
constants may conflict with the Symfony resource overriding system
$uploadDir = 'uploads';
} else {
$uploadDir = $this->getUploadDir();
}
$path = __DIR__ . '/../../../../../../../web/' . $this->getUploadDir();
if (!file_exists($path)) {
mkdir($path, 0755);
}
return $path;
Posted from SensioLabsInsight
28% of all actions have more than 20 lines. This violation is raised when more than 10% actions are too long.
Posted from SensioLabsInsight
Datetime field with datepicker sends wrongly formatted datetime to the database (MySQL).
Al generar el crud el formulario duplica los campos de relaciones
in Entity/BaseFile.php, line 193
This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.
if (file_exists($this->temp)) {
unlink($this->temp);
}
}
}
}
Posted from SensioLabsInsight
The line {{ knp_menu_render('MWSimpleAdminCrudBundle:Builder:adminMenu') }} in vendor/mwsimple/admin-crud/MWSimple/Bundle/AdminCrudBundle/Resources/views/layout.html.twig does not render anything. Did I miss some configuration entry?
Se creo la clase MWSimpleMenuCommand
A Symfony dependency injection container has been found as an argument.
class Twig extends \Twig_Extension
{
protected $container;
public function __construct(ContainerInterface $container = null)
{
$this->container = $container;
}
public function getFunctions()
Posted from SensioLabsInsight
Al agregar mas de 1 rol en un submenu se pierde
in Command/MWSimpleMenuCommand.php, line 37
This
url_min
local variable is declared but never used. You should remove it.
private function updateConfig(InputInterface $input, OutputInterface $output)
{
$name = $input->getArgument('name');
$name_min = strtolower($name);
$url = $input->getArgument('url');
$url_min = strtolower($url);
$configPath = $input->getArgument('config');
$file = $this->getContainer()->getParameter('kernel.root_dir').'/../'.$configPath;
// if the config.yml file doesn't exist, don't even try.
if (!file_exists($file)) {
Posted from SensioLabsInsight
in Entity/BaseFile.php, line 110
This
uploadDir
local variable is declared but never used. You should remove it.
protected function getUploadRootDir()
{
if (!$this->getUploadDir()) {
$uploadDir = 'uploads';
} else {
$uploadDir = $this->getUploadDir();
}
$path = __DIR__ . '/../../../../../../../web/' . $this->getUploadDir();
if (!file_exists($path)) {
mkdir($path, 0755);
Posted from SensioLabsInsight
Se debe poder configurar el entre las opciones los siguientes temas:
in Generator/MWSimpleFormGenerator.php, line 97
Commented out code reduces readability and lowers the code confidence for other developers. If it's common usage for debug, it should not be committed. Using a version control system, such code can be safely removed.
$fields = array_diff($fields, $metadata->identifier);
}
// Comento porque retorno en generate associations utilizando mws_tecspro_comun
// foreach ($metadata->associationMappings as $fieldName => $relation) {
// if ($relation['type'] !== ClassMetadataInfo::ONE_TO_MANY) {
// $fields[] = $fieldName;
// }
// }
return $fields;
}
Posted from SensioLabsInsight
Corregir el estilo no se ve bien con boostrap
in Command/MWSimpleCrudCommand.php, line 104
This
metadata
local variable is declared but never used. You should remove it.
$input->setOption('entity', $entity);
list($bundle, $entity) = $this->parseShortcutNotation($entity);
try {
$entityClass = $this->getContainer()->get('doctrine')->getAliasNamespace($bundle).'\\'.$entity;
$metadata = $this->getEntityMetadata($entityClass);
} catch (\Exception $e) {
throw new \RuntimeException(sprintf('Entity "%s" does not exist in the "%s" bundle. You may have mistyped the bundle name or maybe the entity doesn\'t exist yet (create it first with the "doctrine:generate:entity" command).', $entity, $bundle));
}
// write?
Posted from SensioLabsInsight
in Command/MWSimpleMenuCommand.php, line 8
The class
Symfony\Component\Console\Input\InputOption
is declared but never used. You should remove theuse
statement.
namespace MWSimple\Bundle\AdminCrudBundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Question\Question;
use Symfony\Component\Yaml\Yaml;
class MWSimpleMenuCommand extends ContainerAwareCommand
Posted from SensioLabsInsight
in Form/Listener/FilterSubscriber.php, line 7
The class
Symfony\Component\HttpFoundation\Request
is declared but never used. You should remove theuse
statement.
namespace MWSimple\Bundle\AdminCrudBundle\Form\Listener;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Lexik\Bundle\FormFilterBundle\Event\GetFilterConditionEvent;
use Symfony\Component\HttpFoundation\Request;
class FilterSubscriber implements EventSubscriberInterface {
/**
* {@inheritDoc}
Posted from SensioLabsInsight
Your project contains files with permissive permissions. In order to avoid opening a security breach, you should restrict execution rights on following files:
- Resources/views/Form/field_file.html.twig
- Services/ACLManager.php
chmod a-x 'Resources/views/Form/field_file.html.twig' \
'Services/ACLManager.php'
Posted from SensioLabsInsight
in Form/DataTransformer/EntityToJsonOneTransformer.php, line 42
The parameter
entity
, which is an object, should be typehinted.
return null;
};
$jsonResponse = array();
if (is_array($entities)) {
if (array_key_exists(0, $entities)) {
$jsonResponse = $entities->map(function ($entity) {
return array(
'id' => $entity->getId(),
'text' => $entity->__toString()
);
})->toArray();
Posted from SensioLabsInsight
Agregar en Español e Ingles
Funcion ajax
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.