fix task parameters of type 'select'

This commit is contained in:
Uwe Steinmann 2021-09-01 16:25:54 +02:00
parent 5cf3b5fc3e
commit 9ea8a02893

View File

@ -355,15 +355,20 @@ $(document).ready( function() {
);
break;
case 'select':
$vals = $task->getParameter()[$param['name']];
foreach($param['options'] as &$opt) {
if(in_array($opt[0], $vals))
$opt[2] = true;
}
$this->formField(
getMLText('task_'.$extname."_".$taskname."_".$param['name']),
getMLText('task_'.$task->getExtension()."_".$task->getTask()."_".$param['name']),
array(
'element'=>'select',
'class'=>'chzn-select',
'name'=>'params['.$param['name'].']',
'multiple'=>false,
'name'=>'params['.$param['name'].'][]',
'multiple'=>isset($param['multiple']) ? $param['multiple'] : false,
'attributes'=>array(array('data-placeholder', getMLText('select_value'), array('data-no_results_text', getMLText('unknown_value')))),
'options'=>$task->getParameter()[$param['options']],
'options'=>$param['options'],
),
array(
'help'=>$param['description']