From f3891f0bf0c9262a6b5a1340e31b4c6b9458c88b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Cailly?= Date: Tue, 9 Apr 2024 12:28:52 +0200 Subject: [PATCH 1/3] fix: adjust dashboard widget height --- install/install.php | 3 +- install/upgrade_to_2.13.10.php | 83 ++++++++++++++++++++++++++++++++++ install/upgrade_to_2.13.7.php | 18 +++++--- setup.php | 2 +- 4 files changed, 98 insertions(+), 8 deletions(-) create mode 100644 install/upgrade_to_2.13.10.php diff --git a/install/install.php b/install/install.php index 1c086c611..fdb689cc6 100644 --- a/install/install.php +++ b/install/install.php @@ -83,6 +83,7 @@ class PluginFormcreatorInstall { '2.13.4' => '2.13.5', '2.13.5' => '2.13.6', '2.13.6' => '2.13.7', + '2.13.7' => '2.13.10', ]; protected bool $resyncIssues = false; @@ -764,7 +765,7 @@ protected function createMiniDashboardBigNumbers() { // With counters $x = 0; $w = 4; // Width - $h = 1; // Height + $h = 2; // Height $s = 0; // space between widgets $y = 0; foreach ($cards as $key => $options) { diff --git a/install/upgrade_to_2.13.10.php b/install/upgrade_to_2.13.10.php new file mode 100644 index 000000000..3a26be92a --- /dev/null +++ b/install/upgrade_to_2.13.10.php @@ -0,0 +1,83 @@ +. + * --------------------------------------------------------------------- + * @copyright Copyright © 2011 - 2021 Teclib' + * @license http://www.gnu.org/licenses/gpl.txt GPLv3+ + * @link https://github.com/pluginsGLPI/formcreator/ + * @link https://pluginsglpi.github.io/formcreator/ + * @link http://plugins.glpi-project.org/#/plugin/formcreator + * --------------------------------------------------------------------- + */ + +use Glpi\Dashboard\Dashboard; +use Glpi\Dashboard\Item; + +class PluginFormcreatorUpgradeTo2_13_10 +{ + /** @var Migration */ + protected $migration; + + public function isResyncIssuesRequired() + { + return false; + } + + /** + * @param Migration $migration + */ + public function upgrade(Migration $migration) + { + $this->migration = $migration; + $this->resizeWidgets(); + } + + /** + * Resize widgets of the `plugin_formcreator_issue_counters` dashboard to match + * the mini_tickets core dashboard style + * + * @return void + */ + public function resizeWidgets() + { + // Get container + $dashboard = new Dashboard(); + $found = $dashboard->getFromDB("plugin_formcreator_issue_counters"); + + if (!$found) { + // Unable to fetch dashboard + return; + }; + + $di = new Item(); + $cards = $di->find(['dashboards_dashboards_id' => $dashboard->fields['id']]); + + foreach ($cards as $card) { + $di = new Item(); + $di->update([ + 'id' => $card['id'], + 'height' => 2, + ]); + } + } +} diff --git a/install/upgrade_to_2.13.7.php b/install/upgrade_to_2.13.7.php index efba230d7..dda50fba1 100644 --- a/install/upgrade_to_2.13.7.php +++ b/install/upgrade_to_2.13.7.php @@ -1,4 +1,5 @@ migration = $migration; $this->fixEncodingInQuestions(); $this->resizeWidgets(); @@ -57,7 +61,8 @@ public function upgrade(Migration $migration) { * * @return void */ - public function fixEncodingInQuestions() { + public function fixEncodingInQuestions() + { global $DB; $table = 'glpi_plugin_formcreator_questions'; @@ -94,7 +99,8 @@ public function fixEncodingInQuestions() { * * @return void */ - public function resizeWidgets() { + public function resizeWidgets() + { // Get container $dashboard = new Dashboard(); $found = $dashboard->getFromDB("plugin_formcreator_issue_counters"); @@ -118,7 +124,7 @@ public function resizeWidgets() { 'y' => 0, ]); - $x +=4; + $x += 4; } } } diff --git a/setup.php b/setup.php index 96e95461e..40ad67fe0 100644 --- a/setup.php +++ b/setup.php @@ -33,7 +33,7 @@ global $CFG_GLPI; // Version of the plugin (major.minor.bugfix) -define('PLUGIN_FORMCREATOR_VERSION', '2.13.9'); +define('PLUGIN_FORMCREATOR_VERSION', '2.13.10'); // Schema version of this version (major.minor only) define('PLUGIN_FORMCREATOR_SCHEMA_VERSION', '2.13'); // is or is not an official release of the plugin From dca4c5a2a592a5534f0c009996d6f3f8f0177282 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Cailly?= Date: Mon, 22 Apr 2024 15:12:51 +0200 Subject: [PATCH 2/3] fix: php lint --- install/upgrade_to_2.13.10.php | 9 +++------ install/upgrade_to_2.13.7.php | 12 ++++-------- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/install/upgrade_to_2.13.10.php b/install/upgrade_to_2.13.10.php index 3a26be92a..dbc91847c 100644 --- a/install/upgrade_to_2.13.10.php +++ b/install/upgrade_to_2.13.10.php @@ -38,16 +38,14 @@ class PluginFormcreatorUpgradeTo2_13_10 /** @var Migration */ protected $migration; - public function isResyncIssuesRequired() - { + public function isResyncIssuesRequired() { return false; } /** * @param Migration $migration */ - public function upgrade(Migration $migration) - { + public function upgrade(Migration $migration) { $this->migration = $migration; $this->resizeWidgets(); } @@ -58,8 +56,7 @@ public function upgrade(Migration $migration) * * @return void */ - public function resizeWidgets() - { + public function resizeWidgets() { // Get container $dashboard = new Dashboard(); $found = $dashboard->getFromDB("plugin_formcreator_issue_counters"); diff --git a/install/upgrade_to_2.13.7.php b/install/upgrade_to_2.13.7.php index dda50fba1..e0399d8ca 100644 --- a/install/upgrade_to_2.13.7.php +++ b/install/upgrade_to_2.13.7.php @@ -39,16 +39,14 @@ class PluginFormcreatorUpgradeTo2_13_7 /** @var Migration */ protected $migration; - public function isResyncIssuesRequired() - { + public function isResyncIssuesRequired() { return false; } /** * @param Migration $migration */ - public function upgrade(Migration $migration) - { + public function upgrade(Migration $migration) { $this->migration = $migration; $this->fixEncodingInQuestions(); $this->resizeWidgets(); @@ -61,8 +59,7 @@ public function upgrade(Migration $migration) * * @return void */ - public function fixEncodingInQuestions() - { + public function fixEncodingInQuestions() { global $DB; $table = 'glpi_plugin_formcreator_questions'; @@ -99,8 +96,7 @@ public function fixEncodingInQuestions() * * @return void */ - public function resizeWidgets() - { + public function resizeWidgets() { // Get container $dashboard = new Dashboard(); $found = $dashboard->getFromDB("plugin_formcreator_issue_counters"); From ca222c1b700d880f71162d05e60ae2fb9fea4e2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Cailly?= Date: Tue, 23 Apr 2024 16:05:22 +0200 Subject: [PATCH 3/3] fix: adding 2.13.10 empty sql file --- .../plugin_formcreator_2.13.10_empty.sql | 352 ++++++++++++++++++ 1 file changed, 352 insertions(+) create mode 100644 install/mysql/plugin_formcreator_2.13.10_empty.sql diff --git a/install/mysql/plugin_formcreator_2.13.10_empty.sql b/install/mysql/plugin_formcreator_2.13.10_empty.sql new file mode 100644 index 000000000..6838b92fb --- /dev/null +++ b/install/mysql/plugin_formcreator_2.13.10_empty.sql @@ -0,0 +1,352 @@ +-- Database schema +-- Do NOT drop anything here + +CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_answers` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `plugin_formcreator_formanswers_id` int unsigned NOT NULL DEFAULT '0', + `plugin_formcreator_questions_id` int unsigned NOT NULL DEFAULT '0', + `answer` longtext, + PRIMARY KEY (`id`), + INDEX `plugin_formcreator_formanswers_id` (`plugin_formcreator_formanswers_id`), + INDEX `plugin_formcreator_questions_id` (`plugin_formcreator_questions_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; +CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_categories` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL DEFAULT '', + `comment` mediumtext, + `completename` varchar(255) DEFAULT NULL, + `plugin_formcreator_categories_id` int unsigned NOT NULL DEFAULT '0', + `level` int(11) NOT NULL DEFAULT '1', + `sons_cache` longtext, + `ancestors_cache` longtext, + `knowbaseitemcategories_id` int unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + INDEX `name` (`name`), + INDEX `knowbaseitemcategories_id` (`knowbaseitemcategories_id`), + INDEX `plugin_formcreator_categories_id` (`plugin_formcreator_categories_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; +CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_entityconfigs` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `entities_id` int unsigned NOT NULL DEFAULT '0', + `replace_helpdesk` int(11) NOT NULL DEFAULT '-2', + `default_form_list_mode` int(11) NOT NULL DEFAULT '-2', + `sort_order` int(11) NOT NULL DEFAULT '-2', + `is_kb_separated` int(11) NOT NULL DEFAULT '-2', + `is_search_visible` int(11) NOT NULL DEFAULT '-2', + `is_dashboard_visible` int(11) NOT NULL DEFAULT '-2', + `is_header_visible` int(11) NOT NULL DEFAULT '-2', + `is_search_issue_visible` int(11) NOT NULL DEFAULT '-2', + `tile_design` int(11) NOT NULL DEFAULT '-2', + `header` text, + `service_catalog_home` int(11) NOT NULL DEFAULT '-2', + PRIMARY KEY (`id`), + UNIQUE KEY `unicity` (`entities_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; +CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_forms` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL DEFAULT '', + `entities_id` int unsigned NOT NULL DEFAULT '0', + `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', + `description` varchar(255) DEFAULT NULL, + `content` longtext, + `plugin_formcreator_categories_id` int unsigned NOT NULL DEFAULT '0', + `is_active` tinyint(1) NOT NULL DEFAULT '0', + `language` varchar(255) NOT NULL DEFAULT '', + `helpdesk_home` tinyint(1) NOT NULL DEFAULT '0', + `is_deleted` tinyint(1) NOT NULL DEFAULT '0', + `validation_required` tinyint(1) NOT NULL DEFAULT '0', + `usage_count` int(11) NOT NULL DEFAULT '0', + `is_default` tinyint(1) NOT NULL DEFAULT '0', + `is_captcha_enabled` tinyint(1) NOT NULL DEFAULT '0', + `show_rule` int(11) NOT NULL DEFAULT '1' COMMENT 'Conditions setting to show the submit button', + `formanswer_name` varchar(255) NOT NULL DEFAULT '', + `is_visible` tinyint NOT NULL DEFAULT 1, + `uuid` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + INDEX `entities_id` (`entities_id`), + INDEX `plugin_formcreator_categories_id` (`plugin_formcreator_categories_id`), + FULLTEXT KEY `Search` (`name`,`description`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; +CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_formanswers` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL DEFAULT '', + `entities_id` int unsigned NOT NULL DEFAULT '0', + `is_recursive` tinyint(1) NOT NULL DEFAULT '0', + `plugin_formcreator_forms_id` int unsigned NOT NULL DEFAULT '0', + `requester_id` int unsigned NOT NULL DEFAULT '0', + `users_id_validator` int unsigned NOT NULL DEFAULT '0' COMMENT 'User in charge of validation', + `groups_id_validator` int unsigned NOT NULL DEFAULT '0' COMMENT 'Group in charge of validation', + `request_date` timestamp NULL, + `status` int(11) NOT NULL DEFAULT '101', + `comment` mediumtext, + PRIMARY KEY (`id`), + INDEX `plugin_formcreator_forms_id` (`plugin_formcreator_forms_id`), + INDEX `entities_id_is_recursive` (`entities_id`, `is_recursive`), + INDEX `requester_id` (`requester_id`), + INDEX `users_id_validator` (`users_id_validator`), + INDEX `groups_id_validator` (`groups_id_validator`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; +CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_forms_profiles` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `plugin_formcreator_forms_id` int unsigned NOT NULL DEFAULT '0', + `profiles_id` int unsigned NOT NULL DEFAULT '0', + `uuid` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `unicity` (`plugin_formcreator_forms_id`,`profiles_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; +CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_forms_users` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `plugin_formcreator_forms_id` int unsigned NOT NULL, + `users_id` int unsigned NOT NULL, + `uuid` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `unicity` (`plugin_formcreator_forms_id`,`users_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; +CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_forms_groups` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `plugin_formcreator_forms_id` int unsigned NOT NULL, + `groups_id` int unsigned NOT NULL, + `uuid` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `unicity` (`plugin_formcreator_forms_id`,`groups_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; +CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_forms_validators` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `plugin_formcreator_forms_id` int unsigned NOT NULL DEFAULT '0', + `itemtype` varchar(255) NOT NULL DEFAULT '', + `items_id` int unsigned NOT NULL DEFAULT '0', + `uuid` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `unicity` (`plugin_formcreator_forms_id`,`itemtype`,`items_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; +CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_questions` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL DEFAULT '', + `plugin_formcreator_sections_id` int unsigned NOT NULL DEFAULT '0', + `fieldtype` varchar(30) NOT NULL DEFAULT 'text', + `required` tinyint(1) NOT NULL DEFAULT '0', + `show_empty` tinyint(1) NOT NULL DEFAULT '0', + `default_values` mediumtext, + `itemtype` varchar(255) NOT NULL DEFAULT '' COMMENT 'itemtype used for glpi objects and dropdown question types', + `values` mediumtext, + `description` mediumtext, + `row` int(11) NOT NULL DEFAULT '0', + `col` int(11) NOT NULL DEFAULT '0', + `width` int(11) NOT NULL DEFAULT '0', + `show_rule` int(11) NOT NULL DEFAULT '1', + `uuid` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + INDEX `plugin_formcreator_sections_id` (`plugin_formcreator_sections_id`), + FULLTEXT KEY `Search` (`name`,`description`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; +CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_conditions` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `itemtype` varchar(255) NOT NULL DEFAULT '' COMMENT 'itemtype of the item affected by the condition', + `items_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'item ID of the item affected by the condition', + `plugin_formcreator_questions_id` int unsigned NOT NULL DEFAULT '0' COMMENT 'question to test for the condition', + `show_condition` int(11) NOT NULL DEFAULT '0', + `show_value` mediumtext NULL DEFAULT NULL, + `show_logic` int(11) NOT NULL DEFAULT '1', + `order` int(11) NOT NULL DEFAULT '1', + `uuid` varchar(255) NULL DEFAULT NULL, + PRIMARY KEY (`id`), + INDEX `plugin_formcreator_questions_id` (`plugin_formcreator_questions_id`), + INDEX `item` (`itemtype`, `items_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; +CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_sections` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL DEFAULT '', + `plugin_formcreator_forms_id` int unsigned NOT NULL DEFAULT '0', + `order` int(11) NOT NULL DEFAULT '0', + `show_rule` int(11) NOT NULL DEFAULT '1', + `uuid` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + INDEX `plugin_formcreator_forms_id` (`plugin_formcreator_forms_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; +CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_targetchanges` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL DEFAULT '', + `plugin_formcreator_forms_id` int unsigned NOT NULL DEFAULT '0', + `target_name` varchar(255) NOT NULL DEFAULT '', + `changetemplates_id` int unsigned NOT NULL DEFAULT '0', + `content` longtext, + `impactcontent` longtext, + `controlistcontent` longtext, + `rolloutplancontent` longtext, + `backoutplancontent` longtext, + `checklistcontent` longtext, + `due_date_rule` int(11) NOT NULL DEFAULT '1', + `due_date_question` int unsigned NOT NULL DEFAULT '0', + `due_date_value` tinyint(4) DEFAULT NULL, + `due_date_period` int(11) NOT NULL DEFAULT '0', + `urgency_rule` int(11) NOT NULL DEFAULT '1', + `urgency_question` int unsigned NOT NULL DEFAULT '0', + `validation_followup` tinyint(1) NOT NULL DEFAULT '1', + `destination_entity` int(11) NOT NULL DEFAULT '1', + `destination_entity_value` int unsigned NOT NULL DEFAULT '0', + `tag_type` int(11) NOT NULL DEFAULT '1', + `tag_questions` varchar(255) NOT NULL DEFAULT '', + `tag_specifics` varchar(255) NOT NULL DEFAULT '', + `category_rule` int(11) NOT NULL DEFAULT '1', + `category_question` int unsigned NOT NULL DEFAULT '0', + `commonitil_validation_rule` int(11) NOT NULL DEFAULT '1', + `commonitil_validation_question` varchar(255) DEFAULT NULL, + `show_rule` int(11) NOT NULL DEFAULT '1', + `sla_rule` int(11) NOT NULL DEFAULT '1', + `sla_question_tto` int unsigned NOT NULL DEFAULT '0', + `sla_question_ttr` int unsigned NOT NULL DEFAULT '0', + `ola_rule` int(11) NOT NULL DEFAULT '1', + `ola_question_tto` int unsigned NOT NULL DEFAULT '0', + `ola_question_ttr` int unsigned NOT NULL DEFAULT '0', + `uuid` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; +CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_targettickets` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL DEFAULT '', + `plugin_formcreator_forms_id` int unsigned NOT NULL DEFAULT '0', + `target_name` varchar(255) NOT NULL DEFAULT '', + `source_rule` int(11) NOT NULL DEFAULT '0', + `source_question` int(11) NOT NULL DEFAULT '0', + `type_rule` int(11) NOT NULL DEFAULT '0', + `type_question` int unsigned NOT NULL DEFAULT '0', + `tickettemplates_id` int unsigned NOT NULL DEFAULT '0', + `content` longtext, + `due_date_rule` int(11) NOT NULL DEFAULT '1', + `due_date_question` int unsigned NOT NULL DEFAULT '0', + `due_date_value` tinyint(4) DEFAULT NULL, + `due_date_period` int(11) NOT NULL DEFAULT '0', + `urgency_rule` int(11) NOT NULL DEFAULT '1', + `urgency_question` int unsigned NOT NULL DEFAULT '0', + `validation_followup` tinyint(1) NOT NULL DEFAULT '1', + `destination_entity` int(11) NOT NULL DEFAULT '1', + `destination_entity_value` int unsigned NOT NULL DEFAULT '0', + `tag_type` int(11) NOT NULL DEFAULT '1', + `tag_questions` varchar(255) NOT NULL DEFAULT '', + `tag_specifics` varchar(255) NOT NULL DEFAULT '', + `category_rule` int(11) NOT NULL DEFAULT '1', + `category_question` int unsigned NOT NULL DEFAULT '0', + `associate_rule` int(11) NOT NULL DEFAULT '1', + `associate_question` int unsigned NOT NULL DEFAULT '0', + `location_rule` int(11) NOT NULL DEFAULT '1', + `location_question` int unsigned NOT NULL DEFAULT '0', + `commonitil_validation_rule` int(11) NOT NULL DEFAULT '1', + `commonitil_validation_question` varchar(255) DEFAULT NULL, + `show_rule` int(11) NOT NULL DEFAULT '1', + `sla_rule` int(11) NOT NULL DEFAULT '1', + `sla_question_tto` int unsigned NOT NULL DEFAULT '0', + `sla_question_ttr` int unsigned NOT NULL DEFAULT '0', + `ola_rule` int(11) NOT NULL DEFAULT '1', + `ola_question_tto` int unsigned NOT NULL DEFAULT '0', + `ola_question_ttr` int unsigned NOT NULL DEFAULT '0', + `uuid` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + INDEX `tickettemplates_id` (`tickettemplates_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; +CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_targetproblems` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL DEFAULT '', + `plugin_formcreator_forms_id` int unsigned NOT NULL DEFAULT '0', + `target_name` varchar(255) NOT NULL DEFAULT '', + `problemtemplates_id` int unsigned NOT NULL DEFAULT '0', + `content` longtext, + `impactcontent` longtext, + `causecontent` longtext, + `symptomcontent` longtext, + `urgency_rule` int(11) NOT NULL DEFAULT '1', + `urgency_question` int unsigned NOT NULL DEFAULT '0', + `destination_entity` int(11) NOT NULL DEFAULT '1', + `destination_entity_value` int unsigned NOT NULL DEFAULT '0', + `tag_type` int(11) NOT NULL DEFAULT '1', + `tag_questions` varchar(255) NOT NULL DEFAULT '', + `tag_specifics` varchar(255) NOT NULL DEFAULT '', + `category_rule` int(11) NOT NULL DEFAULT '1', + `category_question` int unsigned NOT NULL DEFAULT '0', + `show_rule` int(11) NOT NULL DEFAULT '1', + `uuid` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + INDEX `problemtemplates_id` (`problemtemplates_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; +CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_targets_actors` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `itemtype` varchar(255) DEFAULT NULL, + `items_id` int unsigned NOT NULL DEFAULT '0', + `actor_role` int(11) NOT NULL DEFAULT '1', + `actor_type` int(11) NOT NULL DEFAULT '1', + `actor_value` int unsigned NOT NULL DEFAULT '0', + `use_notification` tinyint(1) NOT NULL DEFAULT '1', + `uuid` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + INDEX `item` (`itemtype`, `items_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; +CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_issues` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) NULL DEFAULT NULL, + `display_id` varchar(255) NOT NULL, + `items_id` int unsigned NOT NULL DEFAULT '0', + `itemtype` varchar(255) NOT NULL DEFAULT '', + `status` varchar(255) NOT NULL DEFAULT '', + `date_creation` timestamp NULL, + `date_mod` timestamp NULL, + `entities_id` int unsigned NOT NULL DEFAULT '0', + `is_recursive` tinyint(1) NOT NULL DEFAULT '0', + `requester_id` int unsigned NOT NULL DEFAULT '0', + `comment` longtext, + `users_id_recipient` int unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + INDEX `item` (`itemtype`, `items_id`), + INDEX `entities_id` (`entities_id`), + INDEX `requester_id` (`requester_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; +CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_items_targettickets` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `plugin_formcreator_targettickets_id` int unsigned NOT NULL DEFAULT '0', + `link` int(11) NOT NULL DEFAULT '0', + `itemtype` varchar(255) NOT NULL DEFAULT '', + `items_id` int unsigned NOT NULL DEFAULT '0', + `uuid` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + INDEX `plugin_formcreator_targettickets_id` (`plugin_formcreator_targettickets_id`), + INDEX `item` (`itemtype`,`items_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; +CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_questiondependencies` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `plugin_formcreator_questions_id` int unsigned NOT NULL DEFAULT '0', + `plugin_formcreator_questions_id_2` int unsigned NOT NULL DEFAULT '0', + `fieldname` varchar(255) DEFAULT NULL, + `uuid` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + INDEX `plugin_formcreator_questions_id` (`plugin_formcreator_questions_id`), + INDEX `plugin_formcreator_questions_id_2` (`plugin_formcreator_questions_id_2`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; +CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_questionregexes` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `plugin_formcreator_questions_id` int unsigned NOT NULL DEFAULT '0', + `regex` mediumtext DEFAULT NULL, + `fieldname` varchar(255) DEFAULT NULL, + `uuid` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + INDEX `plugin_formcreator_questions_id` (`plugin_formcreator_questions_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; +CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_questionranges` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `plugin_formcreator_questions_id` int unsigned NOT NULL DEFAULT '0', + `range_min` varchar(255) DEFAULT NULL, + `range_max` varchar(255) DEFAULT NULL, + `fieldname` varchar(255) DEFAULT NULL, + `uuid` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + INDEX `plugin_formcreator_questions_id` (`plugin_formcreator_questions_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; +CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_forms_languages` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `plugin_formcreator_forms_id` int unsigned NOT NULL DEFAULT '0', + `name` varchar(255) DEFAULT NULL, + `comment` text, + `uuid` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; \ No newline at end of file