= $form->field($model, 'id_user')->dropDownList( ArrayHelper::map(User::find()->joinWith('userProducer')->where('user_producer.id_producer = '.GlobalParam::getCurrentProducerId())->andWhere('user_producer.active = 1')->orderBy('lastname ASC, name ASC')->all(), 'id', function($model, $defaultValue) {
if (isset($model['name_legal_person']) && strlen($model['name_legal_person'])) {
return 'Personne morale / '.$model['name_legal_person'];
} else {
return $model['lastname'] . ' ' . $model['name'];
}
}), ['prompt' => '--','class' => 'form-control user-id', ]) ?>
Produits
errors['products']) && count($model->errors['products']))
{
echo '
'.$model->errors['products'][0].'
' ;
}
?>
= $form->field($model, 'comment')->textarea(['rows' => 6]) ?>
= Html::submitButton('Enregistrer' , ['class' => 'btn btn-primary']) ?>