mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-06 01:28:19 +01:00
FIX #2991
This commit is contained in:
@@ -46,11 +46,6 @@ if (GETPOST('id')) {
|
|||||||
$object=new Opensurveysondage($db);
|
$object=new Opensurveysondage($db);
|
||||||
|
|
||||||
$result=$object->fetch(0, $numsondage);
|
$result=$object->fetch(0, $numsondage);
|
||||||
if ($result <= 0)
|
|
||||||
{
|
|
||||||
dol_print_error($db,$object->error);
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
$expiredate=dol_mktime(0, 0, 0, GETPOST('expiremonth'), GETPOST('expireday'), GETPOST('expireyear'));
|
$expiredate=dol_mktime(0, 0, 0, GETPOST('expiremonth'), GETPOST('expireday'), GETPOST('expireyear'));
|
||||||
|
|
||||||
@@ -206,6 +201,16 @@ foreach ($toutsujet as $value)
|
|||||||
$toutsujet=str_replace("@","<br>",$toutsujet);
|
$toutsujet=str_replace("@","<br>",$toutsujet);
|
||||||
$toutsujet=str_replace("°","'",$toutsujet);
|
$toutsujet=str_replace("°","'",$toutsujet);
|
||||||
|
|
||||||
|
if (empty($object->ref)) // For survey, id is a hex string
|
||||||
|
{
|
||||||
|
$langs->load("errors");
|
||||||
|
print $langs->trans("ErrorRecordNotFound");
|
||||||
|
|
||||||
|
llxFooter();
|
||||||
|
|
||||||
|
$db->close();
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
print '<form name="updatesurvey" action="'.$_SERVER["PHP_SELF"].'?id='.$numsondage.'" method="POST">'."\n";
|
print '<form name="updatesurvey" action="'.$_SERVER["PHP_SELF"].'?id='.$numsondage.'" method="POST">'."\n";
|
||||||
print '<input type="hidden" name="action" value="update">';
|
print '<input type="hidden" name="action" value="update">';
|
||||||
@@ -442,6 +447,6 @@ print '</form>';
|
|||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
llxFooterSurvey();
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@@ -228,8 +228,7 @@ class Opensurveysondage extends CommonObject
|
|||||||
$obj = $this->db->fetch_object($resql);
|
$obj = $this->db->fetch_object($resql);
|
||||||
|
|
||||||
$this->id_sondage = $obj->id_sondage;
|
$this->id_sondage = $obj->id_sondage;
|
||||||
//For compatibility
|
$this->ref = $this->id_sondage; //For compatibility
|
||||||
$this->ref = $this->id_sondage;
|
|
||||||
|
|
||||||
$this->commentaires = $obj->description; // deprecated
|
$this->commentaires = $obj->description; // deprecated
|
||||||
$this->description = $obj->description;
|
$this->description = $obj->description;
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ if (GETPOST('sondage'))
|
|||||||
|
|
||||||
$object=new Opensurveysondage($db);
|
$object=new Opensurveysondage($db);
|
||||||
$result=$object->fetch(0,$numsondage);
|
$result=$object->fetch(0,$numsondage);
|
||||||
if ($result <= 0) dol_print_error('','Failed to get survey id '.$numsondage);
|
|
||||||
|
|
||||||
$nblignes=$object->fetch_lines();
|
$nblignes=$object->fetch_lines();
|
||||||
|
|
||||||
@@ -241,6 +240,16 @@ $arrayofjs=array();
|
|||||||
$arrayofcss=array('/opensurvey/css/style.css');
|
$arrayofcss=array('/opensurvey/css/style.css');
|
||||||
llxHeaderSurvey($object->titre, "", 0, 0, $arrayofjs, $arrayofcss);
|
llxHeaderSurvey($object->titre, "", 0, 0, $arrayofjs, $arrayofcss);
|
||||||
|
|
||||||
|
if (empty($object->ref)) // For survey, id is a hex string
|
||||||
|
{
|
||||||
|
$langs->load("errors");
|
||||||
|
print $langs->trans("ErrorRecordNotFound");
|
||||||
|
|
||||||
|
llxFooterSurvey();
|
||||||
|
|
||||||
|
$db->close();
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
// Define format of choices
|
// Define format of choices
|
||||||
$toutsujet=explode(",",$object->sujet);
|
$toutsujet=explode(",",$object->sujet);
|
||||||
|
|||||||
Reference in New Issue
Block a user