Show the color dropdown when creating a new automatic action
Fixes #4443
This commit is contained in:
parent
7fb830518e
commit
f397a81984
|
|
@ -71,6 +71,22 @@ class FormHelper extends Base
|
|||
return $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a color select field
|
||||
*
|
||||
* @access public
|
||||
* @param string $name Field name
|
||||
* @param array $values Form values
|
||||
* @return string
|
||||
*/
|
||||
public function colorSelect($name, array $values)
|
||||
{
|
||||
$colors = $this->colorModel->getList();
|
||||
$html = $this->label(t('Color'), $name);
|
||||
$html .= $this->select($name, $colors, $values, array(), array('tabindex="4"'), 'color-picker');
|
||||
return $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a radio field group
|
||||
*
|
||||
|
|
|
|||
|
|
@ -108,9 +108,7 @@ class TaskHelper extends Base
|
|||
|
||||
public function renderColorField(array $values)
|
||||
{
|
||||
$colors = $this->colorModel->getList();
|
||||
$html = $this->helper->form->label(t('Color'), 'color_id');
|
||||
$html .= $this->helper->form->select('color_id', $colors, $values, array(), array('tabindex="4"'), 'color-picker');
|
||||
$html = $this->helper->form->colorSelect('color_id', $values);
|
||||
return $html;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,8 +25,7 @@
|
|||
<?= $this->form->label($param_desc, $param_name) ?>
|
||||
<?= $this->form->select('params['.$param_name.']', $projects_list, $values) ?>
|
||||
<?php elseif ($this->text->contains($param_name, 'color_id')): ?>
|
||||
<?= $this->form->label($param_desc, $param_name) ?>
|
||||
<?= $this->form->select('params['.$param_name.']', $colors_list, $values) ?>
|
||||
<?= $this->form->colorSelect('params['.$param_name.']', $values) ?>
|
||||
<?php elseif ($this->text->contains($param_name, 'category_id')): ?>
|
||||
<?= $this->form->label($param_desc, $param_name) ?>
|
||||
<?= $this->form->select('params['.$param_name.']', $categories_list, $values) ?>
|
||||
|
|
|
|||
Loading…
Reference in New Issue