Skip to content
Snippets Groups Projects
Commit affdd30a authored by David Surville's avatar David Surville
Browse files

Ajout d'un champ description aux périmètres et catégories de périmètres

parent a6451ab2
Branches
Tags 1.1.0
No related merge requests found
Pipeline #14834 passed
Showing
with 128 additions and 6 deletions
......@@ -23,6 +23,11 @@ abstract class AbstractPerimetre implements PerimetreInterface
*/
protected $libelle;
/**
* @var string
*/
protected $description;
/**
* @var int
*/
......@@ -124,6 +129,25 @@ abstract class AbstractPerimetre implements PerimetreInterface
return $this;
}
/**
* @return string
*/
public function getDescription()
{
return $this->description;
}
/**
* @param string $description
* @return PerimetreInterface
*/
public function setDescription($description)
{
$this->description = $description;
return $this;
}
/**
* Get ordre.
*
......
......@@ -23,6 +23,11 @@ abstract class AbstractPerimetreCategorie implements PerimetreCategorieInterface
*/
protected $libelle;
/**
* @var string
*/
protected $description;
/**
* @var int
*/
......@@ -124,6 +129,25 @@ abstract class AbstractPerimetreCategorie implements PerimetreCategorieInterface
return $this;
}
/**
* @return string
*/
public function getDescription()
{
return $this->description;
}
/**
* @param string $description
* @return PerimetreCategorieInterface
*/
public function setDescription($description)
{
$this->description = $description;
return $this;
}
/**
* Get ordre.
*
......
......@@ -19,9 +19,10 @@
<field name="code" type="string" column="CODE" length="150" nullable="false"/>
<field name="libelle" type="string" column="LIBELLE" length="200" nullable="false"/>
<field name="description" type="string" column="DESCRIPTION" length="1024" nullable="true"/>
<field name="ordre" type="integer" column="ORDRE" nullable="false"/>
<one-to-many field="roleUsers" target-entity="UnicaenPrivilege\Entity\Db\UserRolePerimetre" mapped-by="perimetre">
<one-to-many field="roleUsers" target-entity="UnicaenUtilisateur\Entity\Db\UserRolePerimetre" mapped-by="perimetre">
<cascade>
<cascade-persist/>
<cascade-remove/>
......
......@@ -15,6 +15,7 @@
<field name="code" type="string" column="CODE" length="150" nullable="false"/>
<field name="libelle" type="string" column="LIBELLE" length="200" nullable="false"/>
<field name="description" type="string" column="DESCRIPTION" length="1024" nullable="true"/>
<field name="ordre" type="integer" column="ORDRE" nullable="false"/>
<one-to-many field="perimetres" target-entity="UnicaenPrivilege\Entity\Db\Perimetre" mapped-by="categorie">
......
......@@ -57,6 +57,17 @@ interface PerimetreCategorieInterface
*/
public function setLibelle($libelle);
/**
* @return string
*/
public function getDescription();
/**
* @param string $description
* @return PerimetreCategorieInterface
*/
public function setDescription($description);
/**
* Get ordre.
*
......
......@@ -57,6 +57,17 @@ interface PerimetreInterface
*/
public function setLibelle($libelle);
/**
* @return string
*/
public function getDescription();
/**
* @param string $description
* @return PerimetreInterface
*/
public function setDescription($description);
/**
* Get ordre.
*
......
......@@ -5,9 +5,12 @@ namespace UnicaenPrivilege\Form\Perimetre;
use UnicaenApp\Service\EntityManagerAwareTrait;
use UnicaenPrivilege\Service\Perimetre\PerimetreCategorieServiceAwareTrait;
use UnicaenPrivilege\Service\Privilege\PrivilegeCategorieServiceAwareTrait;
use Zend\Filter\StringTrim;
use Zend\Filter\StripTags;
use Zend\Form\Element\Button;
use Zend\Form\Element\Number;
use Zend\Form\Element\Text;
use Zend\Form\Element\Textarea;
use Zend\Form\Form;
use Zend\InputFilter\Factory;
use Zend\Validator\Callback;
......@@ -51,6 +54,18 @@ class CategorieForm extends Form
],
]);
$this->add([
'type' => Textarea::class,
'name' => 'description',
'options' => [
'label' => "Description :",
],
'attributes' => [
'id' => 'description',
'rows' => '5',
],
]);
$this->add([
'type' => Number::class,
'name' => 'ordre',
......@@ -156,6 +171,14 @@ class CategorieForm extends Form
],
],
'description' => [
'required' => false,
'filters' => [
['name' => StripTags::class],
['name' => StringTrim::class],
],
],
'ordre' => [
'required' => false,
],
......
......@@ -6,10 +6,13 @@ use DoctrineModule\Form\Element\ObjectSelect;
use UnicaenApp\Service\EntityManagerAwareTrait;
use UnicaenPrivilege\Service\Perimetre\PerimetreCategorieServiceAwareTrait;
use UnicaenPrivilege\Service\Perimetre\PerimetreServiceAwareTrait;
use Zend\Filter\StringTrim;
use Zend\Filter\StripTags;
use Zend\Form\Element\Button;
use Zend\Form\Element\Hidden;
use Zend\Form\Element\Number;
use Zend\Form\Element\Text;
use Zend\Form\Element\Textarea;
use Zend\Form\Form;
use Zend\InputFilter\Factory;
use Zend\Validator\Callback;
......@@ -82,6 +85,18 @@ class PerimetreForm extends Form
],
]);
$this->add([
'type' => Textarea::class,
'name' => 'description',
'options' => [
'label' => "Description :",
],
'attributes' => [
'id' => 'description',
'rows' => '5',
],
]);
$this->add([
'type' => Number::class,
'name' => 'ordre',
......@@ -190,6 +205,14 @@ class PerimetreForm extends Form
],
],
'description' => [
'required' => false,
'filters' => [
['name' => StripTags::class],
['name' => StringTrim::class],
],
],
'categorie' => [
'required' => false,
],
......
......@@ -101,8 +101,9 @@ $canSupprimer = $this->isAllowed(PerimetrePrivileges::getResourceId(PerimetreP
<thead>
<tr>
<th>Libellé</th>
<th>Code</th>
<th>Utilisateurs associés</th>
<th>Description</th>
<th class="col-md-2">Code</th>
<th class="col-md-2">Utilisateurs associés</th>
<th class="col-md-1">Ordre</th>
<th class="col-md-1">Action</th>
</tr>
......@@ -120,6 +121,7 @@ $canSupprimer = $this->isAllowed(PerimetrePrivileges::getResourceId(PerimetreP
?>
<tr>
<td><?php echo $perimetre->getLibelle(); ?></td>
<td><?php echo $perimetre->getDescription(); ?></td>
<td><?php echo $perimetre->getCode(); ?></td>
<td>
<a href="#" data-toggle="popover" data-placement="left" data-html="true" data-content="<?php echo implode("<br />", $users); ?>">
......
......@@ -52,9 +52,10 @@ $canSupprimer = $this->isAllowed(PerimetrePrivileges::getResourceId(PerimetreP
<thead>
<tr>
<th>Libellé</th>
<th>Code</th>
<th>Périmètres</th>
<th>Rôles associés</th>
<th>Description</th>
<th class="col-md-2">Code</th>
<th class="col-md-1">Périmètres</th>
<th class="col-md-1">Rôles associés</th>
<th class="col-md-1">Ordre</th>
<th class="col-md-1">Action</th>
</tr>
......@@ -79,6 +80,7 @@ $canSupprimer = $this->isAllowed(PerimetrePrivileges::getResourceId(PerimetreP
<tr>
<td><?php echo $categorie->getLibelle(); ?></td>
<td><?php echo $categorie->getDescription(); ?></td>
<td><?php echo $categorie->getCode(); ?></td>
<td>
<a href="#" data-toggle="popover" data-placement="left" data-html="true" data-content="<?php echo implode("<br />", $perimetres); ?>">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment