From f2de44ce51f562f327a51ab6953e602b508a7940 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Mar 2019 01:11:39 +0100 Subject: [PATCH] Clean code --- htdocs/cron/class/cronjob.class.php | 2 +- htdocs/opensurvey/card.php | 13 +++++++------ htdocs/opensurvey/class/opensurveysondage.class.php | 4 +++- htdocs/opensurvey/fonctions.php | 1 + htdocs/projet/class/project.class.php | 12 ++++++------ htdocs/stripe/class/actions_stripe.class.php | 2 +- scripts/invoices/rebuild_merge_pdf.php | 2 +- 7 files changed, 20 insertions(+), 16 deletions(-) diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index 1f22e7b910c..c223f3c76ff 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -1207,7 +1207,7 @@ class Cronjob extends CommonObject * Reprogram a job * * @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 */ public function reprogram_jobs($userlogin, $now) diff --git a/htdocs/opensurvey/card.php b/htdocs/opensurvey/card.php index 0dff8b96b69..bcfa77ab18a 100644 --- a/htdocs/opensurvey/card.php +++ b/htdocs/opensurvey/card.php @@ -112,13 +112,14 @@ if (empty($reshook)) if (! $error) { - $object->titre = GETPOST('nouveautitre'); - $object->commentaires = GETPOST('nouveauxcommentaires'); - $object->mail_admin = GETPOST('nouvelleadresse'); + $object->titre = GETPOST('nouveautitre', 'nohtml'); + $object->commentaires = GETPOST('nouveauxcommentaires', 'nohtml'); + $object->description = GETPOST('nouveauxcommentaires', 'nohtml'); + $object->mail_admin = GETPOST('nouvelleadresse', 'alpha'); $object->date_fin = $expiredate; - $object->allow_comments = GETPOST('cancomment') == 'on' ? true : false; - $object->allow_spy = GETPOST('canseeothersvote') == 'on' ? true : false; - $object->mailsonde = GETPOST('mailsonde') == 'on' ? true : false; + $object->allow_comments = GETPOST('cancomment','alpha') == 'on' ? true : false; + $object->allow_spy = GETPOST('canseeothersvote','alpha') == 'on' ? true : false; + $object->mailsonde = GETPOST('mailsonde','alpha') == 'on' ? true : false; $res=$object->update($user); if ($res < 0) diff --git a/htdocs/opensurvey/class/opensurveysondage.class.php b/htdocs/opensurvey/class/opensurveysondage.class.php index a688f12654b..8a5a102a9f5 100644 --- a/htdocs/opensurvey/class/opensurveysondage.class.php +++ b/htdocs/opensurvey/class/opensurveysondage.class.php @@ -49,7 +49,7 @@ class Opensurveysondage extends CommonObject public $id_sondage; /** * @deprecated - * @see description + * @see $description */ public $commentaires; @@ -519,6 +519,7 @@ class Opensurveysondage extends CommonObject $this->id_sondage=''; $this->commentaires='Comment of the specimen survey'; + $this->description='Comment of the specimen survey'; $this->mail_admin=''; $this->nom_admin=''; $this->titre='This is a specimen survey'; @@ -606,6 +607,7 @@ class Opensurveysondage extends CommonObject { $this->id_sondage = trim($this->id_sondage); $this->commentaires = trim($this->commentaires); + $this->description = trim($this->description); $this->mail_admin = trim($this->mail_admin); $this->nom_admin = trim($this->nom_admin); $this->titre = trim($this->titre); diff --git a/htdocs/opensurvey/fonctions.php b/htdocs/opensurvey/fonctions.php index c69b6fa3c0f..b93440f9afd 100644 --- a/htdocs/opensurvey/fonctions.php +++ b/htdocs/opensurvey/fonctions.php @@ -207,6 +207,7 @@ function ajouter_sondage() $opensurveysondage = new Opensurveysondage($db); $opensurveysondage->id_sondage = $sondage; $opensurveysondage->commentaires = $_SESSION['commentaires']; + $opensurveysondage->description = $_SESSION['commentaires']; $opensurveysondage->mail_admin = $_SESSION['adresse']; $opensurveysondage->nom_admin = $_SESSION['nom']; $opensurveysondage->titre = $_SESSION['titre']; diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 34a36e859dc..02bf2679b1b 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -74,7 +74,7 @@ class Project extends CommonObject /** * @var string * @deprecated - * @see title + * @see $title */ public $titre; @@ -107,7 +107,7 @@ class Project extends CommonObject /** * @var int Creation date * @deprecated - * @see date_c + * @see $date_c */ public $datec; @@ -119,7 +119,7 @@ class Project extends CommonObject /** * @var int Modification date * @deprecated - * @see date_m + * @see $date_m */ public $datem; @@ -1535,12 +1535,12 @@ class Project extends CommonObject /** * Shift project task date from current date to delta * - * @param timestamp $old_project_dt_start old project start date - * @return int 1 if OK or < 0 if KO + * @param integer $old_project_dt_start Old project start date + * @return int 1 if OK or < 0 if KO */ public function shiftTaskDate($old_project_dt_start) { - global $user,$langs,$conf; + global $user, $langs, $conf; $error=0; diff --git a/htdocs/stripe/class/actions_stripe.class.php b/htdocs/stripe/class/actions_stripe.class.php index 5e11e81ed3e..036c8ed2ba6 100644 --- a/htdocs/stripe/class/actions_stripe.class.php +++ b/htdocs/stripe/class/actions_stripe.class.php @@ -169,7 +169,7 @@ class ActionsStripeconnect /** * addMoreActionsButtons * - * @param arra $parameters Parameters + * @param array $parameters Parameters * @param Object $object Object * @param string $action action * @return int 0 diff --git a/scripts/invoices/rebuild_merge_pdf.php b/scripts/invoices/rebuild_merge_pdf.php index 37c471c01c9..62865570b28 100755 --- a/scripts/invoices/rebuild_merge_pdf.php +++ b/scripts/invoices/rebuild_merge_pdf.php @@ -266,7 +266,7 @@ exit($error); /** * Show usage of script * - * @return unknown + * @return void */ function usage() {