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);
|
||||
|
||||
$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'));
|
||||
|
||||
@@ -206,7 +201,17 @@ foreach ($toutsujet as $value)
|
||||
$toutsujet=str_replace("@","<br>",$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 '<input type="hidden" name="action" value="update">';
|
||||
|
||||
@@ -442,6 +447,6 @@ print '</form>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
llxFooterSurvey();
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
@@ -228,8 +228,7 @@ class Opensurveysondage extends CommonObject
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
$this->id_sondage = $obj->id_sondage;
|
||||
//For compatibility
|
||||
$this->ref = $this->id_sondage;
|
||||
$this->ref = $this->id_sondage; //For compatibility
|
||||
|
||||
$this->commentaires = $obj->description; // deprecated
|
||||
$this->description = $obj->description;
|
||||
|
||||
@@ -41,7 +41,6 @@ if (GETPOST('sondage'))
|
||||
|
||||
$object=new Opensurveysondage($db);
|
||||
$result=$object->fetch(0,$numsondage);
|
||||
if ($result <= 0) dol_print_error('','Failed to get survey id '.$numsondage);
|
||||
|
||||
$nblignes=$object->fetch_lines();
|
||||
|
||||
@@ -241,6 +240,16 @@ $arrayofjs=array();
|
||||
$arrayofcss=array('/opensurvey/css/style.css');
|
||||
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
|
||||
$toutsujet=explode(",",$object->sujet);
|
||||
|
||||
Reference in New Issue
Block a user