Commit 35eb30a0 by Julien Jorry

Admin prestataire liste : Add idmlc under raison

parent 9543d7ec
...@@ -507,12 +507,12 @@ class PrestataireAdmin extends AbstractAdmin ...@@ -507,12 +507,12 @@ class PrestataireAdmin extends AbstractAdmin
'advanced_filter' => false, 'advanced_filter' => false,
]) ])
->add('createdAt', 'doctrine_orm_datetime_range', [ ->add('createdAt', 'doctrine_orm_datetime_range', [
'field_type'=> DateTimeRangePickerType::class, 'field_type' => DateTimeRangePickerType::class,
'label' => 'Date de création' 'label' => 'Date de création',
]) ])
->add('updatedAt', 'doctrine_orm_datetime_range', [ ->add('updatedAt', 'doctrine_orm_datetime_range', [
'field_type'=> DateTimeRangePickerType::class, 'field_type' => DateTimeRangePickerType::class,
'label' => 'Date de mise à jour' 'label' => 'Date de mise à jour',
]) ])
->add('typeprestataire', null, [ ->add('typeprestataire', null, [
'label' => 'Type', 'label' => 'Type',
...@@ -692,7 +692,9 @@ class PrestataireAdmin extends AbstractAdmin ...@@ -692,7 +692,9 @@ class PrestataireAdmin extends AbstractAdmin
} }
} }
$listMapper $listMapper
->addIdentifier('raison') ->addIdentifier('raisonAndIdmlc', 'html', [
'label' => 'Raison',
])
->add('groupe', null, [ ->add('groupe', null, [
'label' => 'Groupe', 'label' => 'Groupe',
'sortable' => true, 'sortable' => true,
...@@ -845,7 +847,7 @@ class PrestataireAdmin extends AbstractAdmin ...@@ -845,7 +847,7 @@ class PrestataireAdmin extends AbstractAdmin
$datagrid->buildPager(); $datagrid->buildPager();
$query = $datagrid->getQuery(); $query = $datagrid->getQuery();
$query->select('DISTINCT '.current($query->getRootAliases())); $query->select('DISTINCT ' . current($query->getRootAliases()));
$query->setFirstResult($firstResult); $query->setFirstResult($firstResult);
$query->setMaxResults($maxResult); $query->setMaxResults($maxResult);
......
...@@ -670,8 +670,9 @@ class Prestataire extends AccountableObject implements AccountableInterface ...@@ -670,8 +670,9 @@ class Prestataire extends AccountableObject implements AccountableInterface
public function getUsersString() public function getUsersString()
{ {
return join(' - ', array_map(function ($user) { return join(' - ', array_map(function ($user) {
$return = $user->getName() . ($user->getEmail() == $user->getName()?'':(':' . $user->getEmail())); $return = $user->getName() . ($user->getEmail() == $user->getName() ? '' : (':' . $user->getEmail()));
$return .= '[' . implode(', ', $user->getPossiblegroups()->toArray()) . ']'; $return .= '[' . implode(', ', $user->getPossiblegroups()->toArray()) . ']';
return $return; return $return;
}, $this->users->getValues())); }, $this->users->getValues()));
} }
...@@ -1049,6 +1050,11 @@ class Prestataire extends AccountableObject implements AccountableInterface ...@@ -1049,6 +1050,11 @@ class Prestataire extends AccountableObject implements AccountableInterface
return $this; return $this;
} }
public function getRaisonAndIdmlc(): ?string
{
return $this->getRaison() . ($this->getIdmlc() ? '<br/>(' . $this->getIdmlc() . ')' : '');
}
public function __toString(): string public function __toString(): string
{ {
return $this->raison ? $this->raison : 'Prestataire ' . $this->id; return $this->raison ? $this->raison : 'Prestataire ' . $this->id;
......
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