diff --git a/inc/targetchange.class.php b/inc/targetchange.class.php index 70b56b177..69902067d 100644 --- a/inc/targetchange.class.php +++ b/inc/targetchange.class.php @@ -133,6 +133,14 @@ public function export($remove_uuid = false) { } } + // get conditions + $target_data['_conditions'] = []; + $condition = new PluginFormcreatorCondition(); + $all_conditions = $condition->getConditionsFromItem($this); + foreach ($all_conditions as $condition) { + $target_data['_conditions'][] = $condition->export($remove_uuid); + } + // remove ID or UUID $idToRemove = 'id'; if ($remove_uuid) { @@ -225,6 +233,13 @@ public static function import(PluginFormcreatorLinker $linker, $input = [], $con } } + // Import submit conditions + if (isset($input['_conditions'])) { + foreach ($input['_conditions'] as $condition) { + PluginFormcreatorCondition::import($linker, $condition, $itemId); + } + } + return $itemId; } @@ -356,7 +371,6 @@ public function showForm($ID, $options = []) { // ------------------------------------------------------------------------------------------- $this->showPluginTagsSettings($form, $rand); - // ------------------------------------------------------------------------------------------- // Conditions to generate the target // ------------------------------------------------------------------------------------------- diff --git a/inc/targetticket.class.php b/inc/targetticket.class.php index 7317b3ad2..36d6f682e 100644 --- a/inc/targetticket.class.php +++ b/inc/targetticket.class.php @@ -1123,6 +1123,13 @@ public static function import(PluginFormcreatorLinker $linker, $input = [], $con } } + // Import conditions + if (isset($input['_conditions'])) { + foreach ($input['_conditions'] as $condition) { + PluginFormcreatorCondition::import($linker, $condition, $itemId); + } + } + return $itemId; } @@ -1193,6 +1200,14 @@ public function export($remove_uuid = false) { $target_data['_ticket_relations'][] = $target_ticketLink->export($remove_uuid); } + // get conditions + $target_data['_conditions'] = []; + $condition = new PluginFormcreatorCondition(); + $all_conditions = $condition->getConditionsFromItem($this); + foreach ($all_conditions as $condition) { + $target_data['_conditions'][] = $condition->export($remove_uuid); + } + // remove ID or UUID $idToRemove = 'id'; if ($remove_uuid) {