diff --git a/htdocs/install/mysql/migration/22.0.0-23.0.0.sql b/htdocs/install/mysql/migration/22.0.0-23.0.0.sql index a64632bb532..6f0b8ab2869 100644 --- a/htdocs/install/mysql/migration/22.0.0-23.0.0.sql +++ b/htdocs/install/mysql/migration/22.0.0-23.0.0.sql @@ -35,6 +35,7 @@ -- V22 forgotten +ALTER TABLE llx_opensurvey_user_studs ADD COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; -- V23 migration diff --git a/htdocs/opensurvey/card.php b/htdocs/opensurvey/card.php index 1a869b81cf9..d56903db292 100644 --- a/htdocs/opensurvey/card.php +++ b/htdocs/opensurvey/card.php @@ -63,8 +63,7 @@ $object = new Opensurveysondage($db); $result = $object->fetch('', $numsondage); if ($result <= 0) { - dol_print_error($db, $object->error); - exit; + accessforbidden("Record not found"); } // Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context diff --git a/htdocs/opensurvey/wizard/choix_autre.php b/htdocs/opensurvey/wizard/choix_autre.php index 09d179d84ab..a9bd3e9ddbb 100644 --- a/htdocs/opensurvey/wizard/choix_autre.php +++ b/htdocs/opensurvey/wizard/choix_autre.php @@ -74,16 +74,17 @@ if (GETPOST("ajoutcases") || GETPOST("ajoutcases_x")) { // Create survey into database if (GETPOSTISSET("confirmecreation")) { - //recuperation des données de champs textes $toutchoix = ''; for ($i = 0; $i < $_SESSION["nbrecases"] + 1; $i++) { - if (!empty($arrayofchoices[$i])) { + $tmpchoice = $arrayofchoices[$i]; + $tmptypecolumn = GETPOST('typecolonne'.$i, 'alphanohtml'); + if (!empty($tmpchoice)) { $toutchoix .= ','; - $toutchoix .= str_replace(array(",", "@"), " ", $arrayofchoices[$i]).(empty($arrayoftypecolumn[$i]) ? '' : '@'.$arrayoftypecolumn[$i]); + $toutchoix .= str_replace(array(",", "@"), " ", $tmpchoice).(empty($tmptypecolumn) ? '' : '@'.$tmptypecolumn); } } - $toutchoix = substr("$toutchoix", 1); + $toutchoix = substr($toutchoix, 1); $_SESSION["toutchoix"] = $toutchoix; //test de remplissage des cases @@ -94,11 +95,11 @@ if (GETPOSTISSET("confirmecreation")) { } } - //message d'erreur si aucun champ renseigné + // Error if no field defined if ($testremplissage != "ok" || (!$toutchoix)) { setEventMessages($langs->trans("ErrorOpenSurveyOneChoice"), null, 'errors'); } else { - //format du sondage AUTRE + // format of survey AUTRE $_SESSION["formatsondage"] = "A"; // Add into database @@ -147,7 +148,7 @@ for ($i = 0; $i < $_SESSION["nbrecases"]; $i++) { print ''.$langs->trans("TitleChoice").' '.$j.': '; $tmparray = array('checkbox' => $langs->trans("CheckBox"), 'yesno' => $langs->trans("YesNoList"), 'foragainst' => $langs->trans("PourContreList")); - print '   '.$langs->trans("Type").' '.$form->selectarray("typecolonne[]", $tmparray, $_SESSION["typecolonne".$i]); + print '   '.$langs->trans("Type").' '.$form->selectarray("typecolonne".$i, $tmparray, $_SESSION["typecolonne".$i]); print ''."\n"; }