diff --git a/css/styles.css b/css/styles.css
index d35ab830a..39c2f33c1 100644
--- a/css/styles.css
+++ b/css/styles.css
@@ -810,7 +810,7 @@ form.formcreator_form {
cursor: pointer;
border-radius: 0;
box-sizing: border-box;
- background-color: #E7E7E7;
+ //background-color: #E7E7E7;
animation-name: fadeInUp ;
animation-iteration-count: 1;
animation-timing-function: ease-in;
diff --git a/inc/form.class.php b/inc/form.class.php
index e9d94539d..cf756fec8 100644
--- a/inc/form.class.php
+++ b/inc/form.class.php
@@ -372,10 +372,11 @@ public function showForm($ID, $options = []) {
echo '
' . __('Form icon', 'formcreator') . ' | ';
echo '';
PluginFormcreatorCommon::showFontAwesomeDropdown('icon', ['value' => $this->fields['icon']]);
+ Html::showColorField('icon_color', ['value' => $this->fields['icon_color']]);
echo ' | ';
- echo '' . __('Icon color', 'formcreator') . ' | ';
+ echo '' . __('Background color', 'formcreator') . ' | ';
echo '';
- Html::showColorField('icon_color', ['value' => $this->fields['icon_color']]);
+ Html::showColorField('background_color', ['value' => $this->fields['background_color']]);
echo ' | ';
echo '';
@@ -829,7 +830,7 @@ public function showFormList($rootCategory = 0, $keywords = '', $helpdeskHome =
$result_forms = $DB->request([
'SELECT' => [
- $table_form => ['id', 'name', 'icon', 'icon_color', 'description', 'usage_count', 'is_default'],
+ $table_form => ['id', 'name', 'icon', 'icon_color', 'background_color', 'description', 'usage_count', 'is_default'],
],
'FROM' => $table_form,
'LEFT JOIN' => [
@@ -879,6 +880,7 @@ public function showFormList($rootCategory = 0, $keywords = '', $helpdeskHome =
'name' => $form['name'],
'icon' => $form['icon'],
'icon_color' => $form['icon_color'],
+ 'background_color' => $form['background_color'],
'description' => $form['description'],
'type' => 'form',
'usage_count' => $form['usage_count'],
@@ -962,7 +964,7 @@ public function showFormList($rootCategory = 0, $keywords = '', $helpdeskHome =
$query_forms = [
'SELECT' => [
- $table_form => ['id', 'name', 'icon', 'description', 'usage_count'],
+ $table_form => ['id', 'name', 'icon', 'icon_color', 'background_color', 'description', 'usage_count'],
],
'FROM' => $table_form,
'LEFT JOIN' => [
@@ -987,6 +989,7 @@ public function showFormList($rootCategory = 0, $keywords = '', $helpdeskHome =
'name' => $form['name'],
'icon' => $form['icon'],
'icon_color' => $form['icon_color'],
+ 'background_color' => $form['background_color'],
'description' => $form['description'],
'type' => 'form',
'usage_count' => $form['usage_count'],
diff --git a/install/mysql/plugin_formcreator_empty.sql b/install/mysql/plugin_formcreator_empty.sql
index 71910d317..a4da4d368 100644
--- a/install/mysql/plugin_formcreator_empty.sql
+++ b/install/mysql/plugin_formcreator_empty.sql
@@ -40,6 +40,7 @@ CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_forms` (
`is_recursive` tinyint(1) NOT NULL DEFAULT '0',
`icon` varchar(255) NOT NULL DEFAULT '',
`icon_color` varchar(255) NOT NULL DEFAULT '',
+ `background_color` varchar(255) NOT NULL DEFAULT '',
`access_rights` tinyint(1) NOT NULL DEFAULT '1',
`requesttype` int(11) NOT NULL DEFAULT '0',
`description` varchar(255) DEFAULT NULL,
diff --git a/install/upgrade_to_2.9.php b/install/upgrade_to_2.9.php
index f35edbd31..522ca2002 100644
--- a/install/upgrade_to_2.9.php
+++ b/install/upgrade_to_2.9.php
@@ -294,6 +294,7 @@ public function upgrade(Migration $migration) {
$table = 'glpi_plugin_formcreator_forms';
$migration->addField($table, 'icon', 'string', ['after' => 'is_recursive']);
$migration->addField($table, 'icon_color', 'string', ['after' => 'icon']);
+ $migration->addField($table, 'background_color', 'string', ['after' => 'icon']);
}
/**
diff --git a/js/scripts.js.php b/js/scripts.js.php
index f234ab63c..8eb9793d1 100644
--- a/js/scripts.js.php
+++ b/js/scripts.js.php
@@ -406,7 +406,7 @@ function buildTiles(list) {
if (item.type == 'form') {
forms.push(
- '