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