Skip to content

Commit

Permalink
move phpcs:ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
frederic34 committed Sep 2, 2018
1 parent 22b9632 commit 2a9ef8d
Show file tree
Hide file tree
Showing 17 changed files with 140 additions and 92 deletions.
19 changes: 11 additions & 8 deletions htdocs/accountancy/class/accountingaccount.class.php
Expand Up @@ -528,15 +528,16 @@ function info($id)
}
}

// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Account deactivated
*
* @param int $id Id
* @return int <0 if KO, >0 if OK
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function account_desactivate($id)
{
// phpcs:enable
$result = $this->checkUsage();

if ($result > 0) {
Expand All @@ -562,15 +563,16 @@ function account_desactivate($id)
}
}

// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Account activated
*
* @param int $id Id
* @return int <0 if KO, >0 if OK
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function account_activate($id)
{
// phpcs:enable
$this->db->begin();

$sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_account ";
Expand Down Expand Up @@ -601,16 +603,17 @@ function getLibStatut($mode=0)
return $this->LibStatut($this->status,$mode);
}

// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Renvoi le libelle d'un statut donne
*
* @param int $statut Id statut
* @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
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function LibStatut($statut,$mode=0)
{
// phpcs:enable
global $langs;
$langs->loadLangs(array("users"));

Expand All @@ -620,27 +623,27 @@ function LibStatut($statut,$mode=0)
if ($statut == 1) return $langs->trans('Enabled');
if ($statut == 0) return $langs->trans('Disabled');
}
if ($mode == 1)
elseif ($mode == 1)
{
if ($statut == 1) return $langs->trans('Enabled');
if ($statut == 0) return $langs->trans('Disabled');
}
if ($mode == 2)
elseif ($mode == 2)
{
if ($statut == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
if ($statut == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
}
if ($mode == 3)
elseif ($mode == 3)
{
if ($statut == 1) return img_picto($langs->trans('Enabled'),'statut4');
if ($statut == 0) return img_picto($langs->trans('Disabled'),'statut5');
}
if ($mode == 4)
elseif ($mode == 4)
{
if ($statut == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
if ($statut == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
}
if ($mode == 5)
elseif ($mode == 5)
{
if ($statut == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4');
if ($statut == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5');
Expand Down
8 changes: 5 additions & 3 deletions htdocs/adherents/canvas/actions_adherentcard_common.class.php
Expand Up @@ -75,16 +75,17 @@ function getObject($id)
//}
}

/**
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Set content of ->tpl array, to use into template
*
* @param string $action Type of action
* @param int $id Id
* @return string HTML output
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function assign_values(&$action, $id)
{
// phpcs:enable
global $conf, $langs, $user, $canvas;
global $form, $formcompany, $objsoc;

Expand Down Expand Up @@ -233,14 +234,15 @@ function assign_values(&$action, $id)
}
}

// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Assign POST values into object
*
* @return string HTML output
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
private function assign_post()
{
// phpcs:enable
global $langs, $mysoc;

$this->object->old_name = $_POST["old_name"];
Expand Down
Expand Up @@ -67,16 +67,17 @@ private function getTitle($action)
return $out;
}

// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Assign custom values for canvas
*
* @param string $action Type of action
* @param int $id Id
* @return void
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function assign_values(&$action, $id)
{
// phpcs:enable
global $limit, $offset, $sortfield, $sortorder;
global $conf, $db, $langs, $user;
global $form;
Expand Down Expand Up @@ -121,6 +122,7 @@ function assign_values(&$action, $id)
}


// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Fetch datas list and save into ->list_datas
*
Expand All @@ -130,9 +132,9 @@ function assign_values(&$action, $id)
* @param string $sortorder Sort order ('ASC' or 'DESC')
* @return void
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function LoadListDatas($limit, $offset, $sortfield, $sortorder)
{
// phpcs:enable
global $conf, $langs;

//$this->getFieldList();
Expand Down
Expand Up @@ -29,8 +29,8 @@
*/
class ActionsContactCardDefault extends ActionsContactCardCommon
{
/**
* Constructor
/**
* Constructor
*
* @param DoliDB $db Handler acces base de donnees
* @param string $dirmodule Name of directory of module
Expand Down Expand Up @@ -66,16 +66,17 @@ private function getTitle($action)
return $out;
}

// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Assign custom values for canvas
*
* @param string $action Type of action
* @param int $id Id
* @return void
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function assign_values(&$action, $id)
{
// phpcs:enable
global $limit, $offset, $sortfield, $sortorder;
global $conf, $db, $langs, $user;
global $form;
Expand Down Expand Up @@ -120,6 +121,7 @@ function assign_values(&$action, $id)
}


// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Fetch datas list and save into ->list_datas
*
Expand All @@ -129,9 +131,9 @@ function assign_values(&$action, $id)
* @param string $sortorder Sort order ('ASC' or 'DESC')
* @return void
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function LoadListDatas($limit, $offset, $sortfield, $sortorder)
{
// phpcs:enable
global $conf, $langs;

//$this->getFieldList();
Expand Down
26 changes: 10 additions & 16 deletions htdocs/core/class/emailsenderprofile.class.php
Expand Up @@ -39,17 +39,17 @@ class EmailSenderProfile extends CommonObject
* @var string ID to identify managed object
*/
public $element = 'emailsenderprofile';

/**
* @var string Name of table without prefix where object is stored
*/
public $table_element = 'c_email_senderprofile';

/**
* @var array Does emailsenderprofile support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
*/
public $ismultientitymanaged = 1;

/**
* @var string String with name of icon for emailsenderprofile
*/
Expand Down Expand Up @@ -310,50 +310,44 @@ function getLibStatut($mode=0)
return $this->LibStatut($this->status,$mode);
}

// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Return the status
*
* @param int $status Id status
* @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 Label of status
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
static function LibStatut($status,$mode=0)
{
global $langs;

if ($mode == 0)
{
$prefix='';
if ($status == 1) return $langs->trans('Enabled');
if ($status == 0) return $langs->trans('Disabled');
}
if ($mode == 1)
if ($mode == 0 || $mode == 1)
{
if ($status == 1) return $langs->trans('Enabled');
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 == 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 == 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 == 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 == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5');
}
if ($mode == 6)
elseif ($mode == 6)
{
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');
Expand Down
11 changes: 7 additions & 4 deletions htdocs/core/class/html.formprojet.class.php
Expand Up @@ -33,7 +33,7 @@ class FormProjets
* @var DoliDB Database handler.
*/
public $db;

/**
* @var string Error code (or message)
*/
Expand All @@ -51,6 +51,7 @@ function __construct($db)
return 1;
}

// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Output a combo list with projects qualified for a third party / user
*
Expand All @@ -71,9 +72,9 @@ function __construct($db)
* @param int $htmlid Html id to use instead of htmlname
* @return string Return html content
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_projects($socid=-1, $selected='', $htmlname='projectid', $maxlength=16, $option_only=0, $show_empty=1, $discard_closed=0, $forcefocus=0, $disabled=0, $mode = 0, $filterkey = '', $nooutput=0, $forceaddid=0, $morecss='', $htmlid='')
{
// phpcs:enable
global $langs,$conf,$form;

$out='';
Expand Down Expand Up @@ -119,6 +120,7 @@ function select_projects($socid=-1, $selected='', $htmlname='projectid', $maxlen
else return $out;
}

// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Returns an array with projects qualified for a third party
*
Expand All @@ -139,9 +141,9 @@ function select_projects($socid=-1, $selected='', $htmlname='projectid', $maxlen
* @param string $morecss More CSS
* @return int Nb of project if OK, <0 if KO
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_projects_list($socid=-1, $selected='', $htmlname='projectid', $maxlength=24, $option_only=0, $show_empty=1, $discard_closed=0, $forcefocus=0, $disabled=0, $mode=0, $filterkey = '', $nooutput=0, $forceaddid=0, $htmlid='', $morecss='maxwidth500')
{
// phpcs:enable
global $user,$conf,$langs;

require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
Expand Down Expand Up @@ -470,6 +472,7 @@ function selectTasks($socid=-1, $selected='', $htmlname='taskid', $maxlength=24,
}


// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Build a HTML select list of element of same thirdparty to suggest to link them to project
*
Expand All @@ -480,9 +483,9 @@ function selectTasks($socid=-1, $selected='', $htmlname='taskid', $maxlength=24,
* @param string $projectkey Equivalent key to fk_projet for actual table_element
* @return int|string The HTML select list of element or '' if nothing or -1 if KO
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_element($table_element, $socid=0, $morecss='', $limitonstatus=-2,$projectkey="fk_projet")
{
// phpcs:enable
global $conf, $langs;

if ($table_element == 'projet_task') return ''; // Special cas of element we never link to a project (already always done)
Expand Down
3 changes: 2 additions & 1 deletion htdocs/core/class/html.formsms.class.php
Expand Up @@ -88,16 +88,17 @@ function __construct($db)
return 1;
}

// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Show the form to input an sms.
*
* @param string $morecss Class on first column td
* @param int $showform Show form tags and submit button (recommanded is to use with value 0)
* @return void
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function show_form($morecss='titlefield', $showform=1)
{
// phpcs:enable
global $conf, $langs, $user, $form;

if (! is_object($form)) $form=new Form($this->db);
Expand Down
3 changes: 2 additions & 1 deletion htdocs/core/class/menu.class.php
Expand Up @@ -96,14 +96,15 @@ function insert($idafter, $url, $titre, $level=0, $enabled=1, $target='',$mainme
$this->liste=array_merge($array_start,$array_new,$array_end);
}

// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Remove a menu entry from this->liste
*
* @return void
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function remove_last()
{
// phpcs:enable
if (count($this->liste) > 1) {
array_pop($this->liste);
}
Expand Down

0 comments on commit 2a9ef8d

Please sign in to comment.