Commit 1b15b256 authored by Mat's avatar Mat
Browse files

améliore le select 'offre' dans LettreType, et dans OffreLegumeInsertType

parent 16c8e4c2
......@@ -144,7 +144,7 @@ class Offre
*/
public function getReferenceMore()
{
return '(#' . sprintf("%03d", $this->id) . ') référence ' . $this->reference;
return $this->reference . ' [ ' . ($this->status === 'draft' ? 'en préparation' : 'publié') . ' ][ ' . count($this->offreLegumes) . ' légumes ]';
}
/**
......
......@@ -39,9 +39,9 @@ class LettreType extends AbstractType
->setParameters(array(
':draft' => 'draft',
':current' => 'current'))
->orderBy('o.reference', 'DESC');
->orderBy('o.status', 'ASC');
},
'choice_label' => 'getReference',
'choice_label' => 'getReferenceMore',
'label' => "À laquelle on joint une offre",
'label_attr' => array('class' => 'col-form-label'),
'attr' => array('class' => 'form-control form-control-sm'),
......
......@@ -34,8 +34,8 @@ class OffreLegumesInsertType extends AbstractType
->orderBy('o.reference', 'DESC');
},
'choice_label' => 'getReferenceMore',
'label' => 'Choisissez une offre',
'placeholder' => 'Offres en préparation :',
'placeholder' => 'Choisissez une offre',
'label' => 'Offres en préparation',
'attr' => array('class' => 'form-control form-control-sm'),
));
}
......
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