diff --git a/front/form.form.php b/front/form.form.php index ad8feb7b0..2877189e2 100644 --- a/front/form.form.php +++ b/front/form.form.php @@ -145,7 +145,7 @@ if ($_SESSION['glpiname'] == 'formcreator_temp_user') { // Form was saved by an annymous user unset($_SESSION['glpiname']); - Html::redirect('formdisplay.php?answer_saved'); + Html::redirect('formdisplay.php?answer_saved&id=' . $form->getID()); } // redirect to created item diff --git a/front/formdisplay.php b/front/formdisplay.php index d36b268d2..5d694fd2f 100644 --- a/front/formdisplay.php +++ b/front/formdisplay.php @@ -34,6 +34,7 @@ // Check if plugin is activated... if (!(new Plugin())->isActivated('formcreator')) { + PluginFormcreatorForm::header(); Html::displayNotFoundError(); } diff --git a/inc/form.class.php b/inc/form.class.php index 2ace39f05..3bb85c867 100644 --- a/inc/form.class.php +++ b/inc/form.class.php @@ -1476,6 +1476,7 @@ public function post_purgeItem() { PluginFormcreatorSection::class, PluginFormcreatorForm_Validator::class, PluginFormcreatorForm_Profile::class, + pluginFormcreatorForm_Language::class, ]; foreach ($associated as $itemtype) { $item = new $itemtype(); @@ -2569,8 +2570,7 @@ public function getTranslatableStrings(array $options = []) : array { } foreach ($strings[$type] as $id => $original) { if ($options['is_translated'] === true && !isset($translations[$original]) - || $options['is_translated'] === false && isset($translations[$original])) - { + || $options['is_translated'] === false && isset($translations[$original])) { unset($strings[$type][$id]); unset($strings['id'][$id]); } @@ -2656,7 +2656,7 @@ public function setTranslations(string $language, array $translations) : bool { * * @return string the best language for this form and session context */ - public function getBestLanguage() { + public function getBestLanguage() { global $DB; if ($this->isNewItem()) { diff --git a/inc/form_language.class.php b/inc/form_language.class.php index 9da4b111c..f4607b0cf 100644 --- a/inc/form_language.class.php +++ b/inc/form_language.class.php @@ -167,7 +167,7 @@ public function showForm($ID, $options = []) { echo '