Clean code

This commit is contained in:
Laurent Destailleur 2019-03-11 01:11:39 +01:00
parent fac329e637
commit f2de44ce51
7 changed files with 20 additions and 16 deletions

View File

@ -1207,7 +1207,7 @@ class Cronjob extends CommonObject
* Reprogram a job * Reprogram a job
* *
* @param string $userlogin User login * @param string $userlogin User login
* @param timestamp $now Date returned by dol_now() * @param integer $now Date returned by dol_now()
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
public function reprogram_jobs($userlogin, $now) public function reprogram_jobs($userlogin, $now)

View File

@ -112,13 +112,14 @@ if (empty($reshook))
if (! $error) if (! $error)
{ {
$object->titre = GETPOST('nouveautitre'); $object->titre = GETPOST('nouveautitre', 'nohtml');
$object->commentaires = GETPOST('nouveauxcommentaires'); $object->commentaires = GETPOST('nouveauxcommentaires', 'nohtml');
$object->mail_admin = GETPOST('nouvelleadresse'); $object->description = GETPOST('nouveauxcommentaires', 'nohtml');
$object->mail_admin = GETPOST('nouvelleadresse', 'alpha');
$object->date_fin = $expiredate; $object->date_fin = $expiredate;
$object->allow_comments = GETPOST('cancomment') == 'on' ? true : false; $object->allow_comments = GETPOST('cancomment','alpha') == 'on' ? true : false;
$object->allow_spy = GETPOST('canseeothersvote') == 'on' ? true : false; $object->allow_spy = GETPOST('canseeothersvote','alpha') == 'on' ? true : false;
$object->mailsonde = GETPOST('mailsonde') == 'on' ? true : false; $object->mailsonde = GETPOST('mailsonde','alpha') == 'on' ? true : false;
$res=$object->update($user); $res=$object->update($user);
if ($res < 0) if ($res < 0)

View File

@ -49,7 +49,7 @@ class Opensurveysondage extends CommonObject
public $id_sondage; public $id_sondage;
/** /**
* @deprecated * @deprecated
* @see description * @see $description
*/ */
public $commentaires; public $commentaires;
@ -519,6 +519,7 @@ class Opensurveysondage extends CommonObject
$this->id_sondage=''; $this->id_sondage='';
$this->commentaires='Comment of the specimen survey'; $this->commentaires='Comment of the specimen survey';
$this->description='Comment of the specimen survey';
$this->mail_admin=''; $this->mail_admin='';
$this->nom_admin=''; $this->nom_admin='';
$this->titre='This is a specimen survey'; $this->titre='This is a specimen survey';
@ -606,6 +607,7 @@ class Opensurveysondage extends CommonObject
{ {
$this->id_sondage = trim($this->id_sondage); $this->id_sondage = trim($this->id_sondage);
$this->commentaires = trim($this->commentaires); $this->commentaires = trim($this->commentaires);
$this->description = trim($this->description);
$this->mail_admin = trim($this->mail_admin); $this->mail_admin = trim($this->mail_admin);
$this->nom_admin = trim($this->nom_admin); $this->nom_admin = trim($this->nom_admin);
$this->titre = trim($this->titre); $this->titre = trim($this->titre);

View File

@ -207,6 +207,7 @@ function ajouter_sondage()
$opensurveysondage = new Opensurveysondage($db); $opensurveysondage = new Opensurveysondage($db);
$opensurveysondage->id_sondage = $sondage; $opensurveysondage->id_sondage = $sondage;
$opensurveysondage->commentaires = $_SESSION['commentaires']; $opensurveysondage->commentaires = $_SESSION['commentaires'];
$opensurveysondage->description = $_SESSION['commentaires'];
$opensurveysondage->mail_admin = $_SESSION['adresse']; $opensurveysondage->mail_admin = $_SESSION['adresse'];
$opensurveysondage->nom_admin = $_SESSION['nom']; $opensurveysondage->nom_admin = $_SESSION['nom'];
$opensurveysondage->titre = $_SESSION['titre']; $opensurveysondage->titre = $_SESSION['titre'];

View File

@ -74,7 +74,7 @@ class Project extends CommonObject
/** /**
* @var string * @var string
* @deprecated * @deprecated
* @see title * @see $title
*/ */
public $titre; public $titre;
@ -107,7 +107,7 @@ class Project extends CommonObject
/** /**
* @var int Creation date * @var int Creation date
* @deprecated * @deprecated
* @see date_c * @see $date_c
*/ */
public $datec; public $datec;
@ -119,7 +119,7 @@ class Project extends CommonObject
/** /**
* @var int Modification date * @var int Modification date
* @deprecated * @deprecated
* @see date_m * @see $date_m
*/ */
public $datem; public $datem;
@ -1535,12 +1535,12 @@ class Project extends CommonObject
/** /**
* Shift project task date from current date to delta * Shift project task date from current date to delta
* *
* @param timestamp $old_project_dt_start old project start date * @param integer $old_project_dt_start Old project start date
* @return int 1 if OK or < 0 if KO * @return int 1 if OK or < 0 if KO
*/ */
public function shiftTaskDate($old_project_dt_start) public function shiftTaskDate($old_project_dt_start)
{ {
global $user,$langs,$conf; global $user, $langs, $conf;
$error=0; $error=0;

View File

@ -169,7 +169,7 @@ class ActionsStripeconnect
/** /**
* addMoreActionsButtons * addMoreActionsButtons
* *
* @param arra $parameters Parameters * @param array $parameters Parameters
* @param Object $object Object * @param Object $object Object
* @param string $action action * @param string $action action
* @return int 0 * @return int 0

View File

@ -266,7 +266,7 @@ exit($error);
/** /**
* Show usage of script * Show usage of script
* *
* @return unknown * @return void
*/ */
function usage() function usage()
{ {