Show the color dropdown when creating a new automatic action

Fixes #4443
This commit is contained in:
Slade 2020-04-29 19:33:21 -06:00 committed by GitHub
parent 7fb830518e
commit f397a81984
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 5 deletions

View File

@ -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
*

View File

@ -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;
}

View File

@ -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) ?>