diff --git a/inc/formanswer.class.php b/inc/formanswer.class.php index da5b5a509..e6ba82283 100644 --- a/inc/formanswer.class.php +++ b/inc/formanswer.class.php @@ -114,6 +114,17 @@ public function canViewItem() { return false; } + public static function canPurge() { + return true; + } + + public function canPurgeItem() { + $form = new PluginFormcreatorForm(); + $formFk = PluginFormcreatorForm::getForeignKeyField(); + $form->getFromDB($this->fields[$formFk]); + return $form->canPurgeItem(); + } + /** * Returns the type name with consideration of plural * diff --git a/install/mysql/plugin_formcreator_empty.sql b/install/mysql/plugin_formcreator_empty.sql index 3fe1daae7..192ec0c79 100644 --- a/install/mysql/plugin_formcreator_empty.sql +++ b/install/mysql/plugin_formcreator_empty.sql @@ -69,7 +69,6 @@ CREATE TABLE IF NOT EXISTS `glpi_plugin_formcreator_formanswers` ( `request_date` datetime NOT NULL, `status` enum('waiting','refused','accepted') NOT NULL DEFAULT 'waiting', `comment` text, - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), INDEX `plugin_formcreator_forms_id` (`plugin_formcreator_forms_id`), INDEX `entities_id_is_recursive` (`entities_id`, `is_recursive`), diff --git a/install/upgrade_to_2.7.php b/install/upgrade_to_2.7.php index d8d3a9dc2..3970e3e2e 100644 --- a/install/upgrade_to_2.7.php +++ b/install/upgrade_to_2.7.php @@ -105,6 +105,8 @@ public function upgrade(Migration $migration) { } $table = 'glpi_plugin_formcreator_formanswers'; $migration->renameTable('glpi_plugin_formcreator_forms_answers', $table); + $migration->migrationOneTable($table); + $migration->dropField($table, 'is_deleted'); $table = 'glpi_plugin_formcreator_answers'; $migration->changeField( $table,