Commit 35eb30a0 by Julien Jorry

Admin prestataire liste : Add idmlc under raison

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