Commit 15abc316 authored by Sebastian Castro's avatar Sebastian Castro

Import add delete button and improve validation on customCode

parent f2c0bb13
......@@ -152,8 +152,8 @@ class Import extends AbstractFile
*/
public function validate(ExecutionContextInterface $context)
{
if (preg_match("/new |process|mongo/i", $this->customCode)) {
$context->buildViolation("Il est interdit d'utiliser les mots suivants: new, mongo, process... Merci de ne pas faire de betises !")
if (preg_match("/new |process|mongo|this|symfony/i", $this->customCode)) {
$context->buildViolation("Il est interdit d'utiliser les mots suivants: new, mongo, process, this, symfony... Merci de ne pas faire de betises !")
->atPath('customCode')
->addViolation();
}
......
......@@ -22,5 +22,10 @@
<a href="{{ admin.generateObjectUrl('list', object) }}" class="btn btn-default view_link">
<i class="fa fa-list" aria-hidden="true"></i>Retour à la liste
</a>
{% if object.id != "" %}
<a href="{{ admin.generateObjectUrl('delete', object) }}" class="btn btn-danger view_link">
<i class="fa fa-trash" aria-hidden="true"></i>Supprimer (ainsi que tous les éléments importés)
</a>
{% endif %}
{% endblock %}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment