move phpcs:ignore

This commit is contained in:
Frédéric FRANCE 2018-09-02 20:37:12 +02:00
parent 03a5aba8a2
commit 35232b753a
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
10 changed files with 94 additions and 72 deletions

View File

@ -32,7 +32,7 @@ class CActionComm
* @var string Error code (or message) * @var string Error code (or message)
*/ */
public $error=''; public $error='';
/** /**
* @var DoliDB Database handler. * @var DoliDB Database handler.
*/ */
@ -46,12 +46,12 @@ class CActionComm
var $code; var $code;
var $type; var $type;
var $libelle; // deprecated var $libelle; // deprecated
/** /**
* @var string proper name for given parameter * @var string proper name for given parameter
*/ */
public $label; public $label;
var $active; var $active;
var $color; var $color;
var $picto; var $picto;
@ -114,6 +114,7 @@ class CActionComm
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of event types: array(id=>label) or array(code=>label) * Return list of event types: array(id=>label) or array(code=>label)
* *
@ -125,9 +126,9 @@ class CActionComm
* @param int $shortlabel 1=Get short label instead of long label * @param int $shortlabel 1=Get short label instead of long label
* @return mixed Array of all event types if OK, <0 if KO. Key of array is id or code depending on parameter $idorcode. * @return mixed Array of all event types if OK, <0 if KO. Key of array is id or code depending on parameter $idorcode.
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function liste_array($active='',$idorcode='id',$excludetype='',$onlyautoornot=0, $morefilter='', $shortlabel=0) function liste_array($active='',$idorcode='id',$excludetype='',$onlyautoornot=0, $morefilter='', $shortlabel=0)
{ {
// phpcs:enable
global $langs,$conf; global $langs,$conf;
$langs->load("commercial"); $langs->load("commercial");

View File

@ -37,12 +37,12 @@ class RemiseCheque extends CommonObject
* @var string ID to identify managed object * @var string ID to identify managed object
*/ */
public $element='chequereceipt'; public $element='chequereceipt';
/** /**
* @var string Name of table without prefix where object is stored * @var string Name of table without prefix where object is stored
*/ */
public $table_element='bordereau_cheque'; public $table_element='bordereau_cheque';
public $picto = 'payment'; public $picto = 'payment';
var $num; var $num;
@ -488,15 +488,16 @@ class RemiseCheque extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Load indicators for dashboard (this->nbtodo and this->nbtodolate) * Load indicators for dashboard (this->nbtodo and this->nbtodolate)
* *
* @param User $user Objet user * @param User $user Objet user
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK * @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function load_board($user) function load_board($user)
{ {
// phpcs:enable
global $conf, $langs; global $conf, $langs;
if ($user->societe_id) return -1; // protection pour eviter appel par utilisateur externe if ($user->societe_id) return -1; // protection pour eviter appel par utilisateur externe
@ -542,14 +543,15 @@ class RemiseCheque extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Charge indicateurs this->nb de tableau de bord * Charge indicateurs this->nb de tableau de bord
* *
* @return int <0 if ko, >0 if ok * @return int <0 if ko, >0 if ok
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function load_state_board() function load_state_board()
{ {
// phpcs:enable
global $user; global $user;
if ($user->societe_id) return -1; // protection pour eviter appel par utilisateur externe if ($user->societe_id) return -1; // protection pour eviter appel par utilisateur externe
@ -857,14 +859,15 @@ class RemiseCheque extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Charge les proprietes ref_previous et ref_next * Charge les proprietes ref_previous et ref_next
* *
* @return int <0 if KO, 0 if OK * @return int <0 if KO, 0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function load_previous_next_id() function load_previous_next_id()
{ {
// phpcs:enable
global $conf; global $conf;
$this->errno = 0; $this->errno = 0;
@ -899,6 +902,7 @@ class RemiseCheque extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set the creation date * Set the creation date
* *
@ -906,9 +910,9 @@ class RemiseCheque extends CommonObject
* @param int $date Date creation * @param int $date Date creation
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function set_date($user, $date) function set_date($user, $date)
{ {
// phpcs:enable
if ($user->rights->banque->cheque) if ($user->rights->banque->cheque)
{ {
$sql = "UPDATE ".MAIN_DB_PREFIX."bordereau_cheque"; $sql = "UPDATE ".MAIN_DB_PREFIX."bordereau_cheque";
@ -934,6 +938,7 @@ class RemiseCheque extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set the ref of bordereau * Set the ref of bordereau
* *
@ -941,9 +946,9 @@ class RemiseCheque extends CommonObject
* @param int $ref ref of bordereau * @param int $ref ref of bordereau
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function set_number($user, $ref) function set_number($user, $ref)
{ {
// phpcs:enable
if ($user->rights->banque->cheque) if ($user->rights->banque->cheque)
{ {
$sql = "UPDATE ".MAIN_DB_PREFIX."bordereau_cheque"; $sql = "UPDATE ".MAIN_DB_PREFIX."bordereau_cheque";
@ -1057,6 +1062,7 @@ class RemiseCheque extends CommonObject
return $this->LibStatut($this->statut,$mode); return $this->LibStatut($this->statut,$mode);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return label of a status * Return label of a status
* *
@ -1064,9 +1070,9 @@ class RemiseCheque extends CommonObject
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto, 6=Long label + picto * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto, 6=Long label + picto
* @return string Libelle du statut * @return string Libelle du statut
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function LibStatut($status,$mode=0) function LibStatut($status,$mode=0)
{ {
// phpcs:enable
global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage
$langs->load('compta'); $langs->load('compta');
if ($mode == 0) if ($mode == 0)
@ -1074,32 +1080,32 @@ class RemiseCheque extends CommonObject
if ($status == 0) return $langs->trans('ToValidate'); if ($status == 0) return $langs->trans('ToValidate');
if ($status == 1) return $langs->trans('Validated'); if ($status == 1) return $langs->trans('Validated');
} }
if ($mode == 1) elseif ($mode == 1)
{ {
if ($status == 0) return $langs->trans('ToValidate'); if ($status == 0) return $langs->trans('ToValidate');
if ($status == 1) return $langs->trans('Validated'); if ($status == 1) return $langs->trans('Validated');
} }
if ($mode == 2) elseif ($mode == 2)
{ {
if ($status == 0) return img_picto($langs->trans('ToValidate'),'statut0').' '.$langs->trans('ToValidate'); if ($status == 0) return img_picto($langs->trans('ToValidate'),'statut0').' '.$langs->trans('ToValidate');
if ($status == 1) return img_picto($langs->trans('Validated'),'statut4').' '.$langs->trans('Validated'); if ($status == 1) return img_picto($langs->trans('Validated'),'statut4').' '.$langs->trans('Validated');
} }
if ($mode == 3) elseif ($mode == 3)
{ {
if ($status == 0) return img_picto($langs->trans('ToValidate'),'statut0'); if ($status == 0) return img_picto($langs->trans('ToValidate'),'statut0');
if ($status == 1) return img_picto($langs->trans('Validated'),'statut4'); if ($status == 1) return img_picto($langs->trans('Validated'),'statut4');
} }
if ($mode == 4) elseif ($mode == 4)
{ {
if ($status == 0) return img_picto($langs->trans('ToValidate'),'statut0').' '.$langs->trans('ToValidate'); if ($status == 0) return img_picto($langs->trans('ToValidate'),'statut0').' '.$langs->trans('ToValidate');
if ($status == 1) return img_picto($langs->trans('Validated'),'statut4').' '.$langs->trans('Validated'); if ($status == 1) return img_picto($langs->trans('Validated'),'statut4').' '.$langs->trans('Validated');
} }
if ($mode == 5) elseif ($mode == 5)
{ {
if ($status == 0) return $langs->trans('ToValidate').' '.img_picto($langs->trans('ToValidate'),'statut0'); if ($status == 0) return $langs->trans('ToValidate').' '.img_picto($langs->trans('ToValidate'),'statut0');
if ($status == 1) return $langs->trans('Validated').' '.img_picto($langs->trans('Validated'),'statut4'); if ($status == 1) return $langs->trans('Validated').' '.img_picto($langs->trans('Validated'),'statut4');
} }
if ($mode == 6) elseif ($mode == 6)
{ {
if ($status == 0) return $langs->trans('ToValidate').' '.img_picto($langs->trans('ToValidate'),'statut0'); if ($status == 0) return $langs->trans('ToValidate').' '.img_picto($langs->trans('ToValidate'),'statut0');
if ($status == 1) return $langs->trans('Validated').' '.img_picto($langs->trans('Validated'),'statut4'); if ($status == 1) return $langs->trans('Validated').' '.img_picto($langs->trans('Validated'),'statut4');

View File

@ -35,7 +35,7 @@ class LignePrelevement
* @var int ID * @var int ID
*/ */
public $id; public $id;
/** /**
* @var DoliDB Database handler. * @var DoliDB Database handler.
*/ */
@ -128,6 +128,7 @@ class LignePrelevement
return $this->LibStatut($this->statut,$mode); return $this->LibStatut($this->statut,$mode);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return status label for a status * Return status label for a status
* *
@ -135,28 +136,28 @@ class LignePrelevement
* @param int $mode 0=Label, 1=Picto + label, 2=Picto, 3=Label + Picto * @param int $mode 0=Label, 1=Picto + label, 2=Picto, 3=Label + Picto
* @return string Label * @return string Label
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function LibStatut($statut,$mode=0) function LibStatut($statut,$mode=0)
{ {
// phpcs:enable
global $langs; global $langs;
if ($mode == 0) if ($mode == 0)
{ {
return $langs->trans($this->statuts[$statut]); return $langs->trans($this->statuts[$statut]);
} }
if ($mode == 1) elseif ($mode == 1)
{ {
if ($statut==0) return img_picto($langs->trans($this->statuts[$statut]),'statut1').' '.$langs->trans($this->statuts[$statut]); // Waiting if ($statut==0) return img_picto($langs->trans($this->statuts[$statut]),'statut1').' '.$langs->trans($this->statuts[$statut]); // Waiting
if ($statut==2) return img_picto($langs->trans($this->statuts[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]); // Credited if ($statut==2) return img_picto($langs->trans($this->statuts[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]); // Credited
if ($statut==3) return img_picto($langs->trans($this->statuts[$statut]),'statut8').' '.$langs->trans($this->statuts[$statut]); // Refused if ($statut==3) return img_picto($langs->trans($this->statuts[$statut]),'statut8').' '.$langs->trans($this->statuts[$statut]); // Refused
} }
if ($mode == 2) elseif ($mode == 2)
{ {
if ($statut==0) return img_picto($langs->trans($this->statuts[$statut]),'statut1'); if ($statut==0) return img_picto($langs->trans($this->statuts[$statut]),'statut1');
if ($statut==2) return img_picto($langs->trans($this->statuts[$statut]),'statut6'); if ($statut==2) return img_picto($langs->trans($this->statuts[$statut]),'statut6');
if ($statut==3) return img_picto($langs->trans($this->statuts[$statut]),'statut8'); if ($statut==3) return img_picto($langs->trans($this->statuts[$statut]),'statut8');
} }
if ($mode == 3) elseif ($mode == 3)
{ {
if ($statut==0) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut1'); if ($statut==0) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut1');
if ($statut==2) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut6'); if ($statut==2) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut6');

View File

@ -31,7 +31,7 @@ abstract class ActionsContactCardCommon
* @var DoliDB Database handler. * @var DoliDB Database handler.
*/ */
public $db; public $db;
var $dirmodule; var $dirmodule;
var $targetmodule; var $targetmodule;
var $canvas; var $canvas;
@ -41,12 +41,12 @@ abstract class ActionsContactCardCommon
var $tpl = array(); var $tpl = array();
//! Object container //! Object container
var $object; var $object;
/** /**
* @var string Error code (or message) * @var string Error code (or message)
*/ */
public $error=''; public $error='';
/** /**
* @var string[] Error codes (or messages) * @var string[] Error codes (or messages)
@ -76,16 +76,17 @@ abstract class ActionsContactCardCommon
//} //}
} }
/** // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Set content of ->tpl array, to use into template * Set content of ->tpl array, to use into template
* *
* @param string $action Type of action * @param string $action Type of action
* @param int $id Id * @param int $id Id
* @return string HTML output * @return string HTML output
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function assign_values(&$action, $id) function assign_values(&$action, $id)
{ {
// phpcs:enable
global $conf, $langs, $user, $canvas; global $conf, $langs, $user, $canvas;
global $form, $formcompany, $objsoc; global $form, $formcompany, $objsoc;
@ -266,14 +267,15 @@ abstract class ActionsContactCardCommon
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Assign POST values into object * Assign POST values into object
* *
* @return string HTML output * @return string HTML output
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
private function assign_post() private function assign_post()
{ {
// phpcs:enable
global $langs, $mysoc; global $langs, $mysoc;
$this->object->old_name = $_POST["old_name"]; $this->object->old_name = $_POST["old_name"];

View File

@ -102,14 +102,15 @@ class Fournisseur extends Societe
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Load statistics indicators * Load statistics indicators
* *
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function load_state_board() function load_state_board()
{ {
// phpcs:enable
global $conf, $user; global $conf, $user;
$this->nb=array(); $this->nb=array();
@ -144,6 +145,7 @@ class Fournisseur extends Societe
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Create a supplier category * Create a supplier category
* *
@ -151,9 +153,9 @@ class Fournisseur extends Societe
* @param string $name Category name * @param string $name Category name
* @return int <0 if KO, 0 if OK * @return int <0 if KO, 0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function CreateCategory($user, $name) function CreateCategory($user, $name)
{ {
// phpcs:enable
$sql = "INSERT INTO ".MAIN_DB_PREFIX."categorie (label,visible,type)"; $sql = "INSERT INTO ".MAIN_DB_PREFIX."categorie (label,visible,type)";
$sql.= " VALUES "; $sql.= " VALUES ";
$sql.= " ('".$this->db->escape($name)."',1,1)"; $sql.= " ('".$this->db->escape($name)."',1,1)";
@ -173,14 +175,15 @@ class Fournisseur extends Societe
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return the suppliers list * Return the suppliers list
* *
* @return array Array of suppliers * @return array Array of suppliers
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function ListArray() function ListArray()
{ {
// phpcs:enable
global $conf; global $conf;
global $user; global $user;

View File

@ -27,7 +27,7 @@ class mailing_mailinglist_mymodule_myobject extends MailingTargets
var $enabled=0; var $enabled=0;
var $require_module=array(); var $require_module=array();
var $picto='mymodule@mymodule'; var $picto='mymodule@mymodule';
/** /**
* @var DoliDB Database handler. * @var DoliDB Database handler.
*/ */
@ -92,6 +92,7 @@ class mailing_mailinglist_mymodule_myobject extends MailingTargets
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* This is the main function that returns the array of emails * This is the main function that returns the array of emails
* *
@ -99,9 +100,9 @@ class mailing_mailinglist_mymodule_myobject extends MailingTargets
* @param array $filtersarray Requete sql de selection des destinataires * @param array $filtersarray Requete sql de selection des destinataires
* @return int <0 if error, number of emails added if ok * @return int <0 if error, number of emails added if ok
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function add_to_target($mailing_id,$filtersarray=array()) function add_to_target($mailing_id,$filtersarray=array())
{ {
// phpcs:enable
$target = array(); $target = array();
$cibles = array(); $cibles = array();
$j = 0; $j = 0;

View File

@ -333,15 +333,16 @@ class Dolresource extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Load object in memory from database * Load object in memory from database
* *
* @param int $id id object * @param int $id id object
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function fetch_element_resource($id) function fetch_element_resource($id)
{ {
// phpcs:enable
global $langs; global $langs;
$sql = "SELECT"; $sql = "SELECT";
$sql.= " t.rowid,"; $sql.= " t.rowid,";
@ -478,6 +479,7 @@ class Dolresource extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Load resource objects into $this->lines * Load resource objects into $this->lines
* *
@ -488,9 +490,9 @@ class Dolresource extends CommonObject
* @param array $filter filter output * @param array $filter filter output
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function fetch_all($sortorder, $sortfield, $limit, $offset, $filter='') function fetch_all($sortorder, $sortfield, $limit, $offset, $filter='')
{ {
// phpcs:enable
global $conf; global $conf;
$sql="SELECT "; $sql="SELECT ";
$sql.= " t.rowid,"; $sql.= " t.rowid,";
@ -574,6 +576,7 @@ class Dolresource extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Load all objects into $this->lines * Load all objects into $this->lines
* *
@ -584,9 +587,9 @@ class Dolresource extends CommonObject
* @param array $filter filter output * @param array $filter filter output
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function fetch_all_resources($sortorder, $sortfield, $limit, $offset, $filter='') function fetch_all_resources($sortorder, $sortfield, $limit, $offset, $filter='')
{ {
// phpcs:enable
global $conf; global $conf;
$sql="SELECT "; $sql="SELECT ";
$sql.= " t.rowid,"; $sql.= " t.rowid,";
@ -652,6 +655,7 @@ class Dolresource extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Load all objects into $this->lines * Load all objects into $this->lines
* *
@ -662,9 +666,9 @@ class Dolresource extends CommonObject
* @param array $filter filter output * @param array $filter filter output
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function fetch_all_used($sortorder, $sortfield, $limit, $offset=1, $filter='') function fetch_all_used($sortorder, $sortfield, $limit, $offset=1, $filter='')
{ {
// phpcs:enable
global $conf; global $conf;
if ( ! $sortorder) $sortorder="ASC"; if ( ! $sortorder) $sortorder="ASC";
@ -730,6 +734,7 @@ class Dolresource extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Fetch all resources available, declared by modules * Fetch all resources available, declared by modules
* Load available resource in array $this->available_resources * Load available resource in array $this->available_resources
@ -738,9 +743,9 @@ class Dolresource extends CommonObject
* @deprecated, remplaced by hook getElementResources * @deprecated, remplaced by hook getElementResources
* @see getElementResources() * @see getElementResources()
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function fetch_all_available() function fetch_all_available()
{ {
// phpcs:enable
global $conf; global $conf;
if (! empty($conf->modules_parts['resources'])) if (! empty($conf->modules_parts['resources']))
@ -752,6 +757,7 @@ class Dolresource extends CommonObject
return 0; return 0;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Update element resource into database * Update element resource into database
* *
@ -759,9 +765,9 @@ class Dolresource extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function update_element_resource($user=null, $notrigger=0) function update_element_resource($user=null, $notrigger=0)
{ {
// phpcs:enable
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;
@ -880,14 +886,15 @@ class Dolresource extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Load in cache resource type code (setup in dictionary) * Load in cache resource type code (setup in dictionary)
* *
* @return int Nb lignes chargees, 0 si deja chargees, <0 si ko * @return int Nb lignes chargees, 0 si deja chargees, <0 si ko
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function load_cache_code_type_resource() function load_cache_code_type_resource()
{ {
// phpcs:enable
global $langs; global $langs;
if (count($this->cache_code_type_resource)) return 0; // Cache deja charge if (count($this->cache_code_type_resource)) return 0; // Cache deja charge
@ -967,6 +974,7 @@ class Dolresource extends CommonObject
return $this->LibStatut($this->status,$mode); return $this->LibStatut($this->status,$mode);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return the status * Return the status
* *
@ -974,9 +982,9 @@ class Dolresource extends CommonObject
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 5=Long label + Picto * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 5=Long label + Picto
* @return string Label of status * @return string Label of status
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
static function LibStatut($status,$mode=0) static function LibStatut($status,$mode=0)
{ {
// phpcs:enable
global $langs; global $langs;
return ''; return '';

View File

@ -60,6 +60,7 @@ class FormResource
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Output html form to select a resource * Output html form to select a resource
* *
@ -75,9 +76,9 @@ class FormResource
* @param int $limit Limit number of answers * @param int $limit Limit number of answers
* @return string HTML string with * @return string HTML string with
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_resource_list($selected='',$htmlname='fk_resource',$filter='',$showempty=0, $showtype=0, $forcecombo=0, $event=array(), $filterkey='', $outputmode=0, $limit=20) function select_resource_list($selected='',$htmlname='fk_resource',$filter='',$showempty=0, $showtype=0, $forcecombo=0, $event=array(), $filterkey='', $outputmode=0, $limit=20)
{ {
// phpcs:enable
global $conf,$user,$langs; global $conf,$user,$langs;
$out=''; $out='';
@ -155,6 +156,7 @@ class FormResource
return $out; return $out;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return html list of tickets type * Return html list of tickets type
* *
@ -167,9 +169,9 @@ class FormResource
* @param int $maxlength Max length of label * @param int $maxlength Max length of label
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_types_resource($selected='',$htmlname='type_resource',$filtertype='',$format=0, $empty=0, $noadmininfo=0,$maxlength=0) function select_types_resource($selected='',$htmlname='type_resource',$filtertype='',$format=0, $empty=0, $noadmininfo=0,$maxlength=0)
{ {
// phpcs:enable
global $langs,$user; global $langs,$user;
$resourcestat = new Dolresource($this->db); $resourcestat = new Dolresource($this->db);

View File

@ -39,12 +39,12 @@ class UserGroup extends CommonObject
* @var string ID to identify managed object * @var string ID to identify managed object
*/ */
public $element='usergroup'; public $element='usergroup';
/** /**
* @var string Name of table without prefix where object is stored * @var string Name of table without prefix where object is stored
*/ */
public $table_element='usergroup'; public $table_element='usergroup';
public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
public $picto='group'; public $picto='group';
public $entity; // Entity of group public $entity; // Entity of group
@ -803,6 +803,7 @@ class UserGroup extends CommonObject
return $this->LibStatut(0,$mode); return $this->LibStatut(0,$mode);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Renvoi le libelle d'un statut donne * Renvoi le libelle d'un statut donne
* *
@ -810,9 +811,9 @@ class UserGroup extends CommonObject
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
* @return string Label of status * @return string Label of status
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function LibStatut($statut,$mode=0) function LibStatut($statut,$mode=0)
{ {
// phpcs:enable
global $langs; global $langs;
$langs->load('users'); $langs->load('users');
return ''; return '';
@ -895,6 +896,7 @@ class UserGroup extends CommonObject
return $result; return $result;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Retourne chaine DN complete dans l'annuaire LDAP pour l'objet * Retourne chaine DN complete dans l'annuaire LDAP pour l'objet
* *
@ -904,9 +906,9 @@ class UserGroup extends CommonObject
* 2=Return key only (uid=qqq) * 2=Return key only (uid=qqq)
* @return string DN * @return string DN
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function _load_ldap_dn($info,$mode=0) function _load_ldap_dn($info,$mode=0)
{ {
// phpcs:enable
global $conf; global $conf;
$dn=''; $dn='';
if ($mode==0) $dn=$conf->global->LDAP_KEY_GROUPS."=".$info[$conf->global->LDAP_KEY_GROUPS].",".$conf->global->LDAP_GROUP_DN; if ($mode==0) $dn=$conf->global->LDAP_KEY_GROUPS."=".$info[$conf->global->LDAP_KEY_GROUPS].",".$conf->global->LDAP_GROUP_DN;
@ -916,14 +918,15 @@ class UserGroup extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Initialize the info array (array of LDAP values) that will be used to call LDAP functions * Initialize the info array (array of LDAP values) that will be used to call LDAP functions
* *
* @return array Tableau info des attributs * @return array Tableau info des attributs
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function _load_ldap_info() function _load_ldap_info()
{ {
// phpcs:enable
global $conf,$langs; global $conf,$langs;
$info=array(); $info=array();
@ -986,7 +989,7 @@ class UserGroup extends CommonObject
* @param int $hidedetails Hide details of lines * @param int $hidedetails Hide details of lines
* @param int $hidedesc Hide description * @param int $hidedesc Hide description
* @param int $hideref Hide ref * @param int $hideref Hide ref
* @param null|array $moreparams Array to provide more information * @param null|array $moreparams Array to provide more information
* @return int 0 if KO, 1 if OK * @return int 0 if KO, 1 if OK
*/ */
public function generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $moreparams=null) public function generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $moreparams=null)

View File

@ -39,17 +39,17 @@ class Website extends CommonObject
* @var string Id to identify managed objects * @var string Id to identify managed objects
*/ */
public $element = 'website'; public $element = 'website';
/** /**
* @var string Name of table without prefix where object is stored * @var string Name of table without prefix where object is stored
*/ */
public $table_element = 'website'; public $table_element = 'website';
/** /**
* @var array Does website support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe * @var array Does website support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
*/ */
public $ismultientitymanaged = 1; public $ismultientitymanaged = 1;
/** /**
* @var string String with name of icon for website. Must be the part after the 'object_' into object_myobject.png * @var string String with name of icon for website. Must be the part after the 'object_' into object_myobject.png
*/ */
@ -59,37 +59,37 @@ class Website extends CommonObject
* @var int * @var int
*/ */
public $entity; public $entity;
/** /**
* @var string * @var string
*/ */
public $ref; public $ref;
/** /**
* @var string * @var string
*/ */
public $description; public $description;
/** /**
* @var int * @var int
*/ */
public $status; public $status;
/** /**
* @var mixed * @var mixed
*/ */
public $date_creation; public $date_creation;
/** /**
* @var mixed * @var mixed
*/ */
public $tms = ''; public $tms = '';
/** /**
* @var integer * @var integer
*/ */
public $fk_default_home; public $fk_default_home;
/** /**
* @var string * @var string
*/ */
@ -695,6 +695,7 @@ class Website extends CommonObject
return $this->LibStatut($this->status,$mode); return $this->LibStatut($this->status,$mode);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Renvoi le libelle d'un status donne * Renvoi le libelle d'un status donne
* *
@ -702,38 +703,32 @@ class Website extends CommonObject
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
* @return string Label of status * @return string Label of status
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function LibStatut($status,$mode=0) function LibStatut($status,$mode=0)
{ {
// phpcs:enable
global $langs; global $langs;
if ($mode == 0) if ($mode == 0 || $mode == 1)
{
$prefix='';
if ($status == 1) return $langs->trans('Enabled');
if ($status == 0) return $langs->trans('Disabled');
}
if ($mode == 1)
{ {
if ($status == 1) return $langs->trans('Enabled'); if ($status == 1) return $langs->trans('Enabled');
if ($status == 0) return $langs->trans('Disabled'); if ($status == 0) return $langs->trans('Disabled');
} }
if ($mode == 2) elseif ($mode == 2)
{ {
if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled'); if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled'); if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
} }
if ($mode == 3) elseif ($mode == 3)
{ {
if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4'); if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4');
if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5'); if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5');
} }
if ($mode == 4) elseif ($mode == 4)
{ {
if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled'); if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled'); if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
} }
if ($mode == 5) elseif ($mode == 5)
{ {
if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4'); if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4');
if ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5'); if ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5');