Merge pull request #15640 from ATM-Consulting/FIX/12.0_Opensurvey_filters_by_entity_but_always_sets_entity_to_1

FIX 12.0 - on survey creation, entity is always set to 1 ⇒ set it to $conf->entity
This commit is contained in:
Laurent Destailleur 2020-12-04 18:11:24 +01:00 committed by GitHub
commit bc7cb4a148
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -128,6 +128,7 @@ class Opensurveysondage extends CommonObject
*/
public function create(User $user, $notrigger = 0)
{
global $conf;
$error = 0;
// Clean parameters
@ -153,7 +154,8 @@ class Opensurveysondage extends CommonObject
$sql .= "mailsonde,";
$sql .= "allow_comments,";
$sql .= "allow_spy,";
$sql .= "sujet";
$sql .= "sujet,";
$sql .= "entity";
$sql .= ") VALUES (";
$sql .= "'".$this->db->escape($this->id_sondage)."',";
$sql .= " ".(empty($this->commentaires) ? 'NULL' : "'".$this->db->escape($this->commentaires)."'").",";
@ -165,7 +167,8 @@ class Opensurveysondage extends CommonObject
$sql .= " ".$this->db->escape($this->mailsonde).",";
$sql .= " ".$this->db->escape($this->allow_comments).",";
$sql .= " ".$this->db->escape($this->allow_spy).",";
$sql .= " '".$this->db->escape($this->sujet)."'";
$sql .= " '".$this->db->escape($this->sujet)."',";
$sql .= " ".$conf->entity;
$sql .= ")";
$this->db->begin();