Fix scrutinizer errors

This commit is contained in:
Laurent Destailleur 2016-05-08 12:08:23 +02:00
parent 0eb12f4c61
commit 5cf8612c58
4 changed files with 20 additions and 19 deletions

View File

@ -48,7 +48,7 @@ abstract class ActionsAdherentCardCommon
/**
* Instantiation of DAO class
* Instantiation of DAO class. Init ->object
*
* @return int 0
* @deprecated Using getInstanceDao should not be used.
@ -83,18 +83,18 @@ abstract class ActionsAdherentCardCommon
*/
function getObject($id)
{
$ret = $this->getInstanceDao();
//$ret = $this->getInstanceDao();
if (is_object($this->object) && method_exists($this->object,'fetch'))
/*if (is_object($this->object) && method_exists($this->object,'fetch'))
{
if (! empty($id)) $this->object->fetch($id);
}
else
{
{*/
$object = new Adherent($this->db);
if (! empty($id)) $object->fetch($id);
$this->object = $object;
}
//}
}
/**
@ -121,11 +121,11 @@ abstract class ActionsAdherentCardCommon
// Creation user
$nuser = new User($this->db);
$result=$nuser->create_from_member($this->object,$_POST["login"]);
$result=$nuser->create_from_member($this->object,GETPOST("login"));
if ($result > 0)
{
$result2=$nuser->setPassword($user,$_POST["password"],0,1,1);
$result2=$nuser->setPassword($user,GETPOST("password"),0,1,1);
if ($result2)
{
$this->db->commit();
@ -424,13 +424,14 @@ abstract class ActionsAdherentCardCommon
if ($resql)
{
$obj = $this->db->fetch_object($resql);
$this->object->country_code = $obj->code;
$this->object->country = $langs->trans("Country".$obj->code)?$langs->trans("Country".$obj->code):$obj->libelle;
}
else
{
dol_print_error($this->db);
}
$this->object->country_code = $obj->code;
$this->object->country = $langs->trans("Country".$obj->code)?$langs->trans("Country".$obj->code):$obj->libelle;
}
}

View File

@ -229,12 +229,13 @@ abstract class CommonObject
public $mode_reglement_id;
/**
* @var string Payment terms ID
* @var int Payment terms ID
* @see setPaymentTerms()
*/
public $cond_reglement_id;
/**
* @deprecated
* @var int Payment terms ID
* @deprecated Kept for compatibility
* @see cond_reglement_id;
*/
public $cond_reglement;

View File

@ -572,37 +572,37 @@ class Opensurveysondage extends CommonObject
if ($mode == 0)
{
if ($status==self::STATUS_DRAFT) return $langs->trans('Draft');
if ($status==self::STATUS_VALIDATED) return $langs->trans('Opened').$billedtext;
if ($status==self::STATUS_VALIDATED) return $langs->trans('Opened');
if ($status==self::STATUS_CLOSED) return $langs->trans('Closed');
}
elseif ($mode == 1)
{
if ($status==self::STATUS_DRAFT) return $langs->trans('Draft');
if ($status==self::STATUS_VALIDATED) return $langs->trans('Opened').$billedtext;
if ($status==self::STATUS_VALIDATED) return $langs->trans('Opened');
if ($status==self::STATUS_CLOSED) return $langs->trans('Closed');
}
elseif ($mode == 2)
{
if ($status==self::STATUS_DRAFT) return img_picto($langs->trans('Draft'),'statut0').' '.$langs->trans('Draft');
if ($status==self::STATUS_VALIDATED) return img_picto($langs->trans('Opened'),'statut1').' '.$langs->trans('Opened').$billedtext;
if ($status==self::STATUS_VALIDATED) return img_picto($langs->trans('Opened'),'statut1').' '.$langs->trans('Opened');
if ($status==self::STATUS_CLOSED) return img_picto($langs->trans('Closed'),'statut6').' '.$langs->trans('Closed');
}
elseif ($mode == 3)
{
if ($status==self::STATUS_DRAFT) return img_picto($langs->trans('Draft'),'statut0');
if ($status==self::STATUS_VALIDATED) return img_picto($langs->trans('Opened').$billedtext,'statut1');
if ($status==self::STATUS_VALIDATED) return img_picto($langs->trans('Opened'),'statut1');
if ($status==self::STATUS_CLOSED) return img_picto($langs->trans('Closed'),'statut6');
}
elseif ($mode == 4)
{
if ($status==self::STATUS_DRAFT) return img_picto($langs->trans('Draft'),'statut0').' '.$langs->trans('Draft');
if ($status==self::STATUS_VALIDATED) return img_picto($langs->trans('Opened').$billedtext,'statut1').' '.$langs->trans('Opened').$billedtext;
if ($status==self::STATUS_VALIDATED) return img_picto($langs->trans('Opened').$billedtext,'statut1').' '.$langs->trans('Opened');
if ($status==self::STATUS_CLOSED) return img_picto($langs->trans('Closed'),'statut6').' '.$langs->trans('Closed');
}
elseif ($mode == 5)
{
if ($status==self::STATUS_DRAFT) return '<span class="hideonsmartphone">'.$langs->trans('Draft').' </span>'.img_picto($langs->trans('Draft'),'statut0');
if ($status==self::STATUS_VALIDATED) return '<span class="hideonsmartphone">'.$langs->trans('Opened').$billedtext.' </span>'.img_picto($langs->trans('Opened').$billedtext,'statut1');
if ($status==self::STATUS_VALIDATED) return '<span class="hideonsmartphone">'.$langs->trans('Opened').' </span>'.img_picto($langs->trans('Opened'),'statut1');
if ($status==self::STATUS_CLOSED) return '<span class="hideonsmartphone">'.$langs->trans('Closed').' </span>'.img_picto($langs->trans('Closed'),'statut6');
}
}

View File

@ -23,8 +23,7 @@
*/
/**
* \class ActionsCardCommon
* \brief Classe permettant la gestion des tiers par defaut
* Classe permettant la gestion des tiers par defaut
*/
abstract class ActionsCardCommon
{