Merge remote-tracking branch 'upstream/develop' into patch-6

This commit is contained in:
Frédéric FRANCE 2018-09-12 21:29:41 +02:00
commit 987fdbe73c
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
282 changed files with 3284 additions and 2045 deletions

View File

@ -238,9 +238,9 @@
<!--<rule ref="PEAR.Commenting.FunctionComment.MissingReturn"> <!--<rule ref="PEAR.Commenting.FunctionComment.MissingReturn">
<severity>0</severity> <severity>0</severity>
</rule>--> </rule>-->
<rule ref="PEAR.Commenting.FunctionComment.Missing"> <!--<rule ref="PEAR.Commenting.FunctionComment.Missing">
<severity>0</severity> <severity>0</severity>
</rule> </rule>-->
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamType" /> <rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamType" />

View File

@ -64,7 +64,7 @@ class autoTranslator
// Translate // Translate
//ini_set('default_charset','UTF-8'); //ini_set('default_charset','UTF-8');
ini_set('default_charset',$this->_outputpagecode); ini_set('default_charset',$this->_outputpagecode);
$this->parse_refLangTranslationFiles(); $this->parseRefLangTranslationFiles();
} }
/** /**
@ -72,8 +72,7 @@ class autoTranslator
* *
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps private function parseRefLangTranslationFiles()
private function parse_refLangTranslationFiles()
{ {
$files = $this->getTranslationFilesArray($this->_refLang); $files = $this->getTranslationFilesArray($this->_refLang);

View File

@ -535,15 +535,16 @@ class AccountingAccount extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Account deactivated * Account deactivated
* *
* @param int $id Id * @param int $id Id
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function account_desactivate($id) function account_desactivate($id)
{ {
// phpcs:enable
$result = $this->checkUsage(); $result = $this->checkUsage();
if ($result > 0) { if ($result > 0) {
@ -569,15 +570,16 @@ class AccountingAccount extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Account activated * Account activated
* *
* @param int $id Id * @param int $id Id
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function account_activate($id) function account_activate($id)
{ {
// phpcs:enable
$this->db->begin(); $this->db->begin();
$sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_account "; $sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_account ";
@ -608,6 +610,7 @@ class AccountingAccount 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 statut donne * Renvoi le libelle d'un statut donne
* *
@ -615,9 +618,9 @@ class AccountingAccount 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->loadLangs(array("users")); $langs->loadLangs(array("users"));
@ -627,27 +630,27 @@ class AccountingAccount extends CommonObject
if ($statut == 1) return $langs->trans('Enabled'); if ($statut == 1) return $langs->trans('Enabled');
if ($statut == 0) return $langs->trans('Disabled'); if ($statut == 0) return $langs->trans('Disabled');
} }
if ($mode == 1) elseif ($mode == 1)
{ {
if ($statut == 1) return $langs->trans('Enabled'); if ($statut == 1) return $langs->trans('Enabled');
if ($statut == 0) return $langs->trans('Disabled'); 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 == 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 ($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 == 1) return img_picto($langs->trans('Enabled'),'statut4');
if ($statut == 0) return img_picto($langs->trans('Disabled'),'statut5'); 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 == 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 ($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 == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4');
if ($statut == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5'); if ($statut == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5');

View File

@ -271,6 +271,7 @@ class AccountingJournal extends CommonObject
return $this->LibType($this->nature,$mode); return $this->LibType($this->nature,$mode);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return type of an accounting journal * Return type of an accounting journal
* *
@ -278,9 +279,9 @@ class AccountingJournal extends CommonObject
* @param int $mode 0=libelle long, 1=libelle court * @param int $mode 0=libelle long, 1=libelle court
* @return string Label of type * @return string Label of type
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function LibType($nature,$mode=0) function LibType($nature,$mode=0)
{ {
// phpcs:enable
global $langs; global $langs;
$langs->loadLangs(array("accountancy")); $langs->loadLangs(array("accountancy"));

View File

@ -1548,15 +1548,16 @@ class BookKeeping extends CommonObject
return 1; return 1;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Export bookkeping * Export bookkeping
* *
* @param string $model Model * @param string $model Model
* @return int Result * @return int Result
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function export_bookkeping($model = 'ebp') function export_bookkeping($model = 'ebp')
{ {
// phpcs:enable
global $conf; global $conf;
$sql = "SELECT rowid, doc_date, doc_type,"; $sql = "SELECT rowid, doc_date, doc_type,";
@ -1701,11 +1702,12 @@ class BookKeeping extends CommonObject
*/ */
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of accounts with label by chart of accounts * Return list of accounts with label by chart of accounts
* *
* @param string $selectid Preselected chart of accounts * @param string $selectid Preselected chart of accounts
* @param string $htmlname Name of field in html form * @param string $htmlname Name of field in html form
* @param int $showempty Add an empty field * @param int $showempty Add an empty field
* @param array $event Event options * @param array $event Event options
* @param int $select_in Value is a aa.rowid (0 default) or aa.account_number (1) * @param int $select_in Value is a aa.rowid (0 default) or aa.account_number (1)
@ -1713,9 +1715,9 @@ class BookKeeping extends CommonObject
* @param int $aabase Set accounting_account base class to display empty=all or from 1 to 8 will display only account beginning by this number * @param int $aabase Set accounting_account base class to display empty=all or from 1 to 8 will display only account beginning by this number
* @return string String with HTML select * @return string String with HTML select
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_account($selectid, $htmlname = 'account', $showempty = 0, $event = array(), $select_in = 0, $select_out = 0, $aabase = '') function select_account($selectid, $htmlname = 'account', $showempty = 0, $event = array(), $select_in = 0, $select_out = 0, $aabase = '')
{ {
// phpcs:enable
global $conf; global $conf;
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
@ -1772,15 +1774,16 @@ class BookKeeping extends CommonObject
return $out; return $out;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Description of a root accounting account * Description of a root accounting account
* *
* @param string $account Accounting account * @param string $account Accounting account
* @return string Root account * @return string Root account
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_compte_racine($account = null) function get_compte_racine($account = null)
{ {
// phpcs:enable
global $conf; global $conf;
$pcgver = $conf->global->CHARTOFACCOUNTS; $pcgver = $conf->global->CHARTOFACCOUNTS;
@ -1813,15 +1816,16 @@ class BookKeeping extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Description of accounting account * Description of accounting account
* *
* @param string $account Accounting account * @param string $account Accounting account
* @return string Account desc * @return string Account desc
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_compte_desc($account = null) function get_compte_desc($account = null)
{ {
// phpcs:enable
global $conf; global $conf;
$pcgver = $conf->global->CHARTOFACCOUNTS; $pcgver = $conf->global->CHARTOFACCOUNTS;

View File

@ -75,16 +75,17 @@ abstract class ActionsAdherentCardCommon
//} //}
} }
/** // 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;
@ -233,14 +234,15 @@ abstract class ActionsAdherentCardCommon
} }
} }
// 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

@ -67,6 +67,7 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon
return $out; return $out;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Assign custom values for canvas * Assign custom values for canvas
* *
@ -74,9 +75,9 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon
* @param int $id Id * @param int $id Id
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function assign_values(&$action, $id) function assign_values(&$action, $id)
{ {
// phpcs:enable
global $limit, $offset, $sortfield, $sortorder; global $limit, $offset, $sortfield, $sortorder;
global $conf, $db, $langs, $user; global $conf, $db, $langs, $user;
global $form; global $form;
@ -121,6 +122,7 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Fetch datas list and save into ->list_datas * Fetch datas list and save into ->list_datas
* *
@ -130,9 +132,9 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon
* @param string $sortorder Sort order ('ASC' or 'DESC') * @param string $sortorder Sort order ('ASC' or 'DESC')
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function LoadListDatas($limit, $offset, $sortfield, $sortorder) function LoadListDatas($limit, $offset, $sortfield, $sortorder)
{ {
// phpcs:enable
global $conf, $langs; global $conf, $langs;
//$this->getFieldList(); //$this->getFieldList();

View File

@ -138,6 +138,7 @@ class Adherent extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Function sending an email has the adherent with the text supplied in parameter. * Function sending an email has the adherent with the text supplied in parameter.
* *
@ -153,9 +154,9 @@ class Adherent extends CommonObject
* @param string $errors_to erros to * @param string $errors_to erros to
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function send_an_email($text, $subject, $filename_list=array(), $mimetype_list=array(), $mimefilename_list=array(), $addr_cc="", $addr_bcc="", $deliveryreceipt=0, $msgishtml=-1, $errors_to='') function send_an_email($text, $subject, $filename_list=array(), $mimetype_list=array(), $mimefilename_list=array(), $addr_cc="", $addr_bcc="", $deliveryreceipt=0, $msgishtml=-1, $errors_to='')
{ {
// phpcs:enable
global $conf,$langs; global $conf,$langs;
// Detect if message is HTML // Detect if message is HTML
@ -644,6 +645,7 @@ class Adherent extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Update denormalized last subscription date. * Update denormalized last subscription date.
* This function is called when we delete a subscription for example. * This function is called when we delete a subscription for example.
@ -651,9 +653,9 @@ class Adherent extends CommonObject
* @param User $user User making change * @param User $user User making change
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function update_end_date($user) function update_end_date($user)
{ {
// phpcs:enable
$this->db->begin(); $this->db->begin();
// Search for last subscription id and end date // Search for last subscription id and end date
@ -999,15 +1001,16 @@ class Adherent extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Method to load member from its login * Method to load member from its login
* *
* @param string $login login of member * @param string $login login of member
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function fetch_login($login) function fetch_login($login)
{ {
// phpcs:enable
global $conf; global $conf;
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."adherent"; $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."adherent";
@ -1029,6 +1032,7 @@ class Adherent extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Method to load member from its name * Method to load member from its name
* *
@ -1036,9 +1040,9 @@ class Adherent extends CommonObject
* @param string $lastname Lastname * @param string $lastname Lastname
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function fetch_name($firstname,$lastname) function fetch_name($firstname,$lastname)
{ {
// phpcs:enable
global $conf; global $conf;
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."adherent"; $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."adherent";
@ -1201,6 +1205,7 @@ class Adherent extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Fonction qui recupere pour un adherent les parametres * Fonction qui recupere pour un adherent les parametres
* first_subscription_date * first_subscription_date
@ -1210,9 +1215,9 @@ class Adherent extends CommonObject
* *
* @return int <0 si KO, >0 si OK * @return int <0 si KO, >0 si OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function fetch_subscriptions() function fetch_subscriptions()
{ {
// phpcs:enable
global $langs; global $langs;
require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php';
@ -1756,14 +1761,15 @@ class Adherent extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Function to add member into external tools mailing-list, spip, etc. * Function to add member into external tools mailing-list, spip, etc.
* *
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function add_to_abo() function add_to_abo()
{ {
// phpcs:enable
global $conf,$langs; global $conf,$langs;
include_once DOL_DOCUMENT_ROOT.'/mailmanspip/class/mailmanspip.class.php'; include_once DOL_DOCUMENT_ROOT.'/mailmanspip/class/mailmanspip.class.php';
@ -1814,14 +1820,15 @@ class Adherent extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Function to delete a member from external tools like mailing-list, spip, etc. * Function to delete a member from external tools like mailing-list, spip, etc.
* *
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function del_to_abo() function del_to_abo()
{ {
// phpcs:enable
global $conf,$langs; global $conf,$langs;
include_once DOL_DOCUMENT_ROOT.'/mailmanspip/class/mailmanspip.class.php'; include_once DOL_DOCUMENT_ROOT.'/mailmanspip/class/mailmanspip.class.php';
@ -1994,6 +2001,7 @@ class Adherent extends CommonObject
return $this->LibStatut($this->statut,$this->need_subscription,$this->datefin,$mode); return $this->LibStatut($this->statut,$this->need_subscription,$this->datefin,$mode);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Renvoi le libelle d'un statut donne * Renvoi le libelle d'un statut donne
* *
@ -2003,9 +2011,9 @@ class Adherent 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 * @return string Label
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function LibStatut($statut,$need_subscription,$date_end_subscription,$mode=0) function LibStatut($statut,$need_subscription,$date_end_subscription,$mode=0)
{ {
// phpcs:enable
global $langs; global $langs;
$langs->load("members"); $langs->load("members");
if ($mode == 0) if ($mode == 0)
@ -2019,7 +2027,7 @@ class Adherent extends CommonObject
} }
if ($statut == 0) return $langs->trans("MemberStatusResiliated"); if ($statut == 0) return $langs->trans("MemberStatusResiliated");
} }
if ($mode == 1) elseif ($mode == 1)
{ {
if ($statut == -1) return $langs->trans("MemberStatusDraftShort"); if ($statut == -1) return $langs->trans("MemberStatusDraftShort");
if ($statut >= 1) if ($statut >= 1)
@ -2030,7 +2038,7 @@ class Adherent extends CommonObject
} }
if ($statut == 0) return $langs->trans("MemberStatusResiliatedShort"); if ($statut == 0) return $langs->trans("MemberStatusResiliatedShort");
} }
if ($mode == 2) elseif ($mode == 2)
{ {
if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'),'statut0').' '.$langs->trans("MemberStatusDraftShort"); if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'),'statut0').' '.$langs->trans("MemberStatusDraftShort");
if ($statut >= 1) if ($statut >= 1)
@ -2041,7 +2049,7 @@ class Adherent extends CommonObject
} }
if ($statut == 0) return img_picto($langs->trans('MemberStatusResiliated'),'statut5').' '.$langs->trans("MemberStatusResiliatedShort"); if ($statut == 0) return img_picto($langs->trans('MemberStatusResiliated'),'statut5').' '.$langs->trans("MemberStatusResiliatedShort");
} }
if ($mode == 3) elseif ($mode == 3)
{ {
if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'),'statut0'); if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'),'statut0');
if ($statut >= 1) if ($statut >= 1)
@ -2052,7 +2060,7 @@ class Adherent extends CommonObject
} }
if ($statut == 0) return img_picto($langs->trans('MemberStatusResiliated'),'statut5'); if ($statut == 0) return img_picto($langs->trans('MemberStatusResiliated'),'statut5');
} }
if ($mode == 4) elseif ($mode == 4)
{ {
if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'),'statut0').' '.$langs->trans("MemberStatusDraft"); if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'),'statut0').' '.$langs->trans("MemberStatusDraft");
if ($statut >= 1) if ($statut >= 1)
@ -2063,7 +2071,7 @@ class Adherent extends CommonObject
} }
if ($statut == 0) return img_picto($langs->trans('MemberStatusResiliated'),'statut5').' '.$langs->trans("MemberStatusResiliated"); if ($statut == 0) return img_picto($langs->trans('MemberStatusResiliated'),'statut5').' '.$langs->trans("MemberStatusResiliated");
} }
if ($mode == 5) elseif ($mode == 5)
{ {
if ($statut == -1) return $langs->trans("MemberStatusDraft").' '.img_picto($langs->trans('MemberStatusDraft'),'statut0'); if ($statut == -1) return $langs->trans("MemberStatusDraft").' '.img_picto($langs->trans('MemberStatusDraft'),'statut0');
if ($statut >= 1) if ($statut >= 1)
@ -2074,7 +2082,7 @@ class Adherent extends CommonObject
} }
if ($statut == 0) return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusResiliated").' </span>'.img_picto($langs->trans('MemberStatusResiliated'),'statut5'); if ($statut == 0) return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusResiliated").' </span>'.img_picto($langs->trans('MemberStatusResiliated'),'statut5');
} }
if ($mode == 6) elseif ($mode == 6)
{ {
if ($statut == -1) return $langs->trans("MemberStatusDraft").' '.img_picto($langs->trans('MemberStatusDraft'),'statut0'); if ($statut == -1) return $langs->trans("MemberStatusDraft").' '.img_picto($langs->trans('MemberStatusDraft'),'statut0');
if ($statut >= 1) if ($statut >= 1)
@ -2088,14 +2096,15 @@ class Adherent 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 $conf; global $conf;
$this->nb=array(); $this->nb=array();
@ -2123,15 +2132,16 @@ class Adherent 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
@ -2266,6 +2276,7 @@ class Adherent extends CommonObject
} }
// 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
* *
@ -2275,9 +2286,9 @@ class Adherent 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_MEMBERS."=".$info[$conf->global->LDAP_KEY_MEMBERS].",".$conf->global->LDAP_MEMBER_DN; if ($mode==0) $dn=$conf->global->LDAP_KEY_MEMBERS."=".$info[$conf->global->LDAP_KEY_MEMBERS].",".$conf->global->LDAP_MEMBER_DN;
@ -2287,14 +2298,15 @@ class Adherent extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Initialise tableau info (tableau des attributs LDAP) * Initialise tableau info (tableau des attributs LDAP)
* *
* @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();

View File

@ -300,14 +300,15 @@ class AdherentType extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of members' type * Return list of members' type
* *
* @return array List of types of members * @return array List of types of members
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function liste_array() function liste_array()
{ {
// phpcs:enable
global $conf,$langs; global $conf,$langs;
$adherenttypes = array(); $adherenttypes = array();
@ -432,6 +433,7 @@ class AdherentType extends CommonObject
return ''; return '';
} }
// 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
* *
@ -441,9 +443,9 @@ class AdherentType 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_MEMBERS_TYPES."=".$info[$conf->global->LDAP_KEY_MEMBERS_TYPES].",".$conf->global->LDAP_MEMBER_TYPE_DN; if ($mode==0) $dn=$conf->global->LDAP_KEY_MEMBERS_TYPES."=".$info[$conf->global->LDAP_KEY_MEMBERS_TYPES].",".$conf->global->LDAP_MEMBER_TYPE_DN;
@ -453,14 +455,15 @@ class AdherentType 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();

View File

@ -366,15 +366,16 @@ class Subscription extends CommonObject
return ''; return '';
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Renvoi le libelle d'un statut donne * Renvoi le libelle d'un statut donne
* *
* @param int $statut Id statut * @param int $statut Id statut
* @return string Label * @return string Label
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function LibStatut($statut) function LibStatut($statut)
{ {
// phpcs:enable
global $langs; global $langs;
$langs->load("members"); $langs->load("members");
return ''; return '';

View File

@ -306,7 +306,7 @@ if (! empty($conf->product->enabled))
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$langs->trans("SetDefaultBarcodeTypeProducts").'</td>'; print '<td>'.$langs->trans("SetDefaultBarcodeTypeProducts").'</td>';
print '<td width="60" align="right">'; print '<td width="60" align="right">';
$formbarcode->select_barcode_type($conf->global->PRODUIT_DEFAULT_BARCODE_TYPE,"PRODUIT_DEFAULT_BARCODE_TYPE",1); print $formbarcode->selectBarcodeType($conf->global->PRODUIT_DEFAULT_BARCODE_TYPE, "PRODUIT_DEFAULT_BARCODE_TYPE", 1);
print '</td></tr>'; print '</td></tr>';
} }
@ -317,7 +317,7 @@ if (! empty($conf->societe->enabled))
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$langs->trans("SetDefaultBarcodeTypeThirdParties").'</td>'; print '<td>'.$langs->trans("SetDefaultBarcodeTypeThirdParties").'</td>';
print '<td width="60" align="right">'; print '<td width="60" align="right">';
print $formbarcode->select_barcode_type($conf->global->GENBARCODE_BARCODETYPE_THIRDPARTY,"GENBARCODE_BARCODETYPE_THIRDPARTY",1); print $formbarcode->selectBarcodeType($conf->global->GENBARCODE_BARCODETYPE_THIRDPARTY, "GENBARCODE_BARCODETYPE_THIRDPARTY", 1);
print '</td></tr>'; print '</td></tr>';
} }

View File

@ -163,15 +163,16 @@ class Dolistore
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return tree of Dolistore categories. $this->categories must have been loaded before. * Return tree of Dolistore categories. $this->categories must have been loaded before.
* *
* @param int $parent Id of parent category * @param int $parent Id of parent category
* @return string * @return string
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_categories($parent = 0) function get_categories($parent = 0)
{ {
// phpcs:enable
if (!isset($this->categories)) die('not possible'); if (!isset($this->categories)) die('not possible');
if ($parent != 0) { if ($parent != 0) {
$html = '<ul>'; $html = '<ul>';
@ -211,14 +212,15 @@ class Dolistore
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of product formated for output * Return list of product formated for output
* *
* @return string HTML output * @return string HTML output
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_products() function get_products()
{ {
// phpcs:enable
global $langs, $conf; global $langs, $conf;
$html = ""; $html = "";
$parity = "pair"; $parity = "pair";
@ -293,38 +295,41 @@ class Dolistore
return $html; return $html;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* get previous link * get previous link
* *
* @param string $text symbol previous * @param string $text symbol previous
* @return string html previous link * @return string html previous link
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_previous_link($text = '<<') function get_previous_link($text = '<<')
{ {
// phpcs:enable
return '<a href="'.$this->get_previous_url().'" class="button">'.$text.'</a>'; return '<a href="'.$this->get_previous_url().'" class="button">'.$text.'</a>';
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* get next link * get next link
* *
* @param string $text symbol next * @param string $text symbol next
* @return string html next link * @return string html next link
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_next_link($text = '>>') function get_next_link($text = '>>')
{ {
// phpcs:enable
return '<a href="'.$this->get_next_url().'" class="button">'.$text.'</a>'; return '<a href="'.$this->get_next_url().'" class="button">'.$text.'</a>';
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* get previous url * get previous url
* *
* @return string previous url * @return string previous url
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_previous_url()
function get_previous_url()
{ {
// phpcs:enable
$param_array = array(); $param_array = array();
if ($this->start < $this->per_page) { if ($this->start < $this->per_page) {
$sub = 0; $sub = 0;
@ -340,14 +345,15 @@ class Dolistore
return $this->url."&".$param; return $this->url."&".$param;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* get next url * get next url
* *
* @return string next url * @return string next url
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_next_url() function get_next_url()
{ {
// phpcs:enable
$param_array = array(); $param_array = array();
if (count($this->products) < $this->per_page) { if (count($this->products) < $this->per_page) {
$add = 0; $add = 0;
@ -363,6 +369,7 @@ class Dolistore
return $this->url."&".$param; return $this->url."&".$param;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* version compare * version compare
* *
@ -370,9 +377,9 @@ class Dolistore
* @param string $v2 version 2 * @param string $v2 version 2
* @return int result of compare * @return int result of compare
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function version_compare($v1, $v2) function version_compare($v1, $v2)
{ {
// phpcs:enable
$v1 = explode('.', $v1); $v1 = explode('.', $v1);
$v2 = explode('.', $v2); $v2 = explode('.', $v2);
$ret = 0; $ret = 0;

View File

@ -3,6 +3,7 @@
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2017 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -133,6 +134,9 @@ if ($action == 'update')
if (GETPOST('THEME_ELDY_USE_HOVER') == '') dolibarr_set_const($db, "THEME_ELDY_USE_HOVER", '0', 'chaine', 0, '', $conf->entity); // If empty, we set to '0' ('000000' is for black) if (GETPOST('THEME_ELDY_USE_HOVER') == '') dolibarr_set_const($db, "THEME_ELDY_USE_HOVER", '0', 'chaine', 0, '', $conf->entity); // If empty, we set to '0' ('000000' is for black)
else dolibarr_set_const($db, "THEME_ELDY_USE_HOVER", $_POST["THEME_ELDY_USE_HOVER"], 'chaine', 0, '', $conf->entity); else dolibarr_set_const($db, "THEME_ELDY_USE_HOVER", $_POST["THEME_ELDY_USE_HOVER"], 'chaine', 0, '', $conf->entity);
if (GETPOST('THEME_ELDY_USE_CHECKED') == '') dolibarr_set_const($db, "THEME_ELDY_USE_CHECKED", '0', 'chaine', 0, '', $conf->entity);
else dolibarr_set_const($db, "THEME_ELDY_USE_CHECKED", $_POST["THEME_ELDY_USE_CHECKED"], 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", $_POST["main_size_liste_limit"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", $_POST["main_size_liste_limit"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_SIZE_SHORTLIST_LIMIT", $_POST["main_size_shortliste_limit"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_SIZE_SHORTLIST_LIMIT", $_POST["main_size_shortliste_limit"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", $_POST["main_disable_javascript"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", $_POST["main_disable_javascript"],'chaine',0,'',$conf->entity);

View File

@ -271,15 +271,16 @@ class DolibarrApi
return true; return true;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Function to forge a SQL criteria * Function to forge a SQL criteria
* *
* @param array $matches Array of found string by regex search * @param array $matches Array of found string by regex search
* @return string Forged criteria. Example: "t.field like 'abc%'" * @return string Forged criteria. Example: "t.field like 'abc%'"
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
static function _forge_criteria_callback($matches) static function _forge_criteria_callback($matches)
{ {
// phpcs:enable
global $db; global $db;
//dol_syslog("Convert matches ".$matches[1]); //dol_syslog("Convert matches ".$matches[1]);

View File

@ -59,15 +59,16 @@ class DolibarrApiAccess implements iAuthenticate
*/ */
public static $user = ''; public static $user = '';
// phpcs:disable PEAR.NamingConventions.ValidFunctionName
/** /**
* Check access * Check access
* *
* @return bool * @return bool
* @throws RestException * @throws RestException
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName
public function __isAllowed() public function __isAllowed()
{ {
// phpcs:enable
global $conf, $db; global $conf, $db;
$login = ''; $login = '';
@ -165,15 +166,16 @@ class DolibarrApiAccess implements iAuthenticate
return in_array(static::$role, (array) $requirefortest) || static::$role == 'admin'; return in_array(static::$role, (array) $requirefortest) || static::$role == 'admin';
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName
/** /**
* @return string string to be used with WWW-Authenticate header * @return string string to be used with WWW-Authenticate header
* @example Basic * @example Basic
* @example Digest * @example Digest
* @example OAuth * @example OAuth
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName
public function __getWWWAuthenticateString() public function __getWWWAuthenticateString()
{ {
// phpcs:enable
return ''; return '';
} }

View File

@ -356,6 +356,7 @@ class Asset 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
* *
@ -363,43 +364,37 @@ class Asset 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 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;
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');
} }
if ($mode == 6) elseif ($mode == 6)
{ {
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');

View File

@ -291,14 +291,15 @@ class AssetType extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of asset's type * Return list of asset's type
* *
* @return array List of types of members * @return array List of types of members
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function liste_array() function liste_array()
{ {
// phpcs:enable
global $conf,$langs; global $conf,$langs;
$assettypes = array(); $assettypes = array();

View File

@ -178,19 +178,19 @@ if ($action == 'builddoc')
{ {
// List of values to scan for a replacement // List of values to scan for a replacement
$substitutionarray = array ( $substitutionarray = array (
'%LOGIN%'=>$user->login, '%LOGIN%' => $user->login,
'%COMPANY%'=>$mysoc->name, '%COMPANY%' => $mysoc->name,
'%ADDRESS%'=>$mysoc->address, '%ADDRESS%' => $mysoc->address,
'%ZIP%'=>$mysoc->zip, '%ZIP%' => $mysoc->zip,
'%TOWN%'=>$mysoc->town, '%TOWN%' => $mysoc->town,
'%COUNTRY%'=>$mysoc->country, '%COUNTRY%' => $mysoc->country,
'%COUNTRY_CODE%'=>$mysoc->country_code, '%COUNTRY_CODE%' => $mysoc->country_code,
'%EMAIL%'=>$mysoc->email, '%EMAIL%' => $mysoc->email,
'%YEAR%'=>$year, '%YEAR%' => $year,
'%MONTH%'=>$month, '%MONTH%' => $month,
'%DAY%'=>$day, '%DAY%' => $day,
'%DOL_MAIN_URL_ROOT%'=>DOL_MAIN_URL_ROOT, '%DOL_MAIN_URL_ROOT%' => DOL_MAIN_URL_ROOT,
'%SERVER%'=>"http://".$_SERVER["SERVER_NAME"]."/" '%SERVER%' => "http://".$_SERVER["SERVER_NAME"]."/",
); );
complete_substitutions_array($substitutionarray, $langs); complete_substitutions_array($substitutionarray, $langs);
@ -416,7 +416,7 @@ print $langs->trans("BarcodeType").' &nbsp; ';
print '</div><div class="tagtd" style="overflow: hidden; white-space: nowrap; max-width: 300px;">'; print '</div><div class="tagtd" style="overflow: hidden; white-space: nowrap; max-width: 300px;">';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formbarcode.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formbarcode.class.php';
$formbarcode = new FormBarCode($db); $formbarcode = new FormBarCode($db);
$formbarcode->select_barcode_type($fk_barcode_type, 'fk_barcode_type', 1); print $formbarcode->selectBarcodeType($fk_barcode_type, 'fk_barcode_type', 1);
print '</div></div>'; print '</div></div>';
// Barcode value // Barcode value

View File

@ -647,6 +647,7 @@ class Categorie extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Link an object to the category * Link an object to the category
* *
@ -654,9 +655,9 @@ class Categorie extends CommonObject
* @param string $type Type of category ('product', ...) * @param string $type Type of category ('product', ...)
* @return int 1 : OK, -1 : erreur SQL, -2 : id not defined, -3 : Already linked * @return int 1 : OK, -1 : erreur SQL, -2 : id not defined, -3 : Already linked
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function add_type($obj, $type) function add_type($obj, $type)
{ {
// phpcs:enable
global $user,$langs,$conf; global $user,$langs,$conf;
$error=0; $error=0;
@ -749,6 +750,7 @@ class Categorie extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Delete object from category * Delete object from category
* *
@ -757,9 +759,9 @@ class Categorie extends CommonObject
* *
* @return int 1 if OK, -1 if KO * @return int 1 if OK, -1 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function del_type($obj,$type) function del_type($obj,$type)
{ {
// phpcs:enable
global $user,$langs,$conf; global $user,$langs,$conf;
$error=0; $error=0;
@ -973,14 +975,15 @@ class Categorie extends CommonObject
return $categories; return $categories;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return childs of a category * Return childs of a category
* *
* @return array|int <0 KO, array ok * @return array|int <0 KO, array ok
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_filles() function get_filles()
{ {
// phpcs:enable
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."categorie"; $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."categorie";
$sql.= " WHERE fk_parent = ".$this->id; $sql.= " WHERE fk_parent = ".$this->id;
@ -1003,14 +1006,15 @@ class Categorie extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Load this->motherof that is array(id_son=>id_parent, ...) * Load this->motherof that is array(id_son=>id_parent, ...)
* *
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
private function load_motherof() private function load_motherof()
{ {
// phpcs:enable
global $conf; global $conf;
$this->motherof=array(); $this->motherof=array();
@ -1038,6 +1042,7 @@ class Categorie extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Rebuilding the category tree as an array * Rebuilding the category tree as an array
* Return an array of table('id','id_mere',...) trie selon arbre et avec: * Return an array of table('id','id_mere',...) trie selon arbre et avec:
@ -1053,9 +1058,9 @@ class Categorie extends CommonObject
* *
* @return array Array of categories. this->cats and this->motherof are set. * @return array Array of categories. this->cats and this->motherof are set.
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_full_arbo($type, $markafterid=0) function get_full_arbo($type, $markafterid=0)
{ {
// phpcs:enable
global $conf, $langs; global $conf, $langs;
if (! is_numeric($type)) $type = $this->MAP_ID[$type]; if (! is_numeric($type)) $type = $this->MAP_ID[$type];
@ -1130,6 +1135,7 @@ class Categorie extends CommonObject
return $this->cats; return $this->cats;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* For category id_categ and its childs available in this->cats, define property fullpath and fulllabel * For category id_categ and its childs available in this->cats, define property fullpath and fulllabel
* *
@ -1137,9 +1143,9 @@ class Categorie extends CommonObject
* @param int $protection Deep counter to avoid infinite loop * @param int $protection Deep counter to avoid infinite loop
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function build_path_from_id_categ($id_categ,$protection=1000) function build_path_from_id_categ($id_categ,$protection=1000)
{ {
// phpcs:enable
dol_syslog(get_class($this)."::build_path_from_id_categ id_categ=".$id_categ." protection=".$protection, LOG_DEBUG); dol_syslog(get_class($this)."::build_path_from_id_categ id_categ=".$id_categ." protection=".$protection, LOG_DEBUG);
if (! empty($this->cats[$id_categ]['fullpath'])) if (! empty($this->cats[$id_categ]['fullpath']))
@ -1173,14 +1179,15 @@ class Categorie extends CommonObject
return; return;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Display content of $this->cats * Display content of $this->cats
* *
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function debug_cats() function debug_cats()
{ {
// phpcs:enable
// Display $this->cats // Display $this->cats
foreach($this->cats as $key => $val) foreach($this->cats as $key => $val)
{ {
@ -1195,6 +1202,7 @@ class Categorie extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Returns all categories * Returns all categories
* *
@ -1202,9 +1210,9 @@ class Categorie extends CommonObject
* @param boolean $parent Just parent categories if true * @param boolean $parent Just parent categories if true
* @return array Table of Object Category * @return array Table of Object Category
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_all_categories($type=null, $parent=false) function get_all_categories($type=null, $parent=false)
{ {
// phpcs:enable
if (! is_numeric($type)) $type = $this->MAP_ID[$type]; if (! is_numeric($type)) $type = $this->MAP_ID[$type];
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."categorie"; $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."categorie";
@ -1233,14 +1241,15 @@ class Categorie extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Check if no category with same label already exists for this cat's parent or root and for this cat's type * Check if no category with same label already exists for this cat's parent or root and for this cat's type
* *
* @return integer 1 if already exist, 0 otherwise, -1 if error * @return integer 1 if already exist, 0 otherwise, -1 if error
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function already_exists() function already_exists()
{ {
// phpcs:enable
$type=$this->type; $type=$this->type;
if (! is_numeric($type)) $type=$this->MAP_ID[$type]; if (! is_numeric($type)) $type=$this->MAP_ID[$type];
@ -1283,18 +1292,20 @@ class Categorie extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Returns the top level categories (which are not girls) * Returns the top level categories (which are not girls)
* *
* @param int $type Type of category (0, 1, ...) * @param int $type Type of category (0, 1, ...)
* @return array * @return array
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_main_categories($type=null) function get_main_categories($type=null)
{ {
// phpcs:enable
return $this->get_all_categories($type, true); return $this->get_all_categories($type, true);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Returns the path of the category, with the names of the categories * Returns the path of the category, with the names of the categories
* separated by $sep (" >> " by default) * separated by $sep (" >> " by default)
@ -1304,9 +1315,9 @@ class Categorie extends CommonObject
* @param int $nocolor 0 * @param int $nocolor 0
* @return array * @return array
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function print_all_ways($sep = " &gt;&gt; ", $url='', $nocolor=0) function print_all_ways($sep = " &gt;&gt; ", $url='', $nocolor=0)
{ {
// phpcs:enable
$ways = array(); $ways = array();
$allways = $this->get_all_ways(); // Load array of categories $allways = $this->get_all_ways(); // Load array of categories
@ -1353,14 +1364,15 @@ class Categorie extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Returns an array containing the list of parent categories * Returns an array containing the list of parent categories
* *
* @return int|array <0 KO, array OK * @return int|array <0 KO, array OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_meres() function get_meres()
{ {
// phpcs:enable
$parents = array(); $parents = array();
$sql = "SELECT fk_parent FROM ".MAIN_DB_PREFIX."categorie"; $sql = "SELECT fk_parent FROM ".MAIN_DB_PREFIX."categorie";
@ -1388,15 +1400,16 @@ class Categorie extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Returns in a table all possible paths to get to the category * Returns in a table all possible paths to get to the category
* starting with the major categories represented by Tables of categories * starting with the major categories represented by Tables of categories
* *
* @return array * @return array
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_all_ways() function get_all_ways()
{ {
// phpcs:enable
$ways = array(); $ways = array();
$parents=$this->get_meres(); $parents=$this->get_meres();
@ -1603,6 +1616,7 @@ class Categorie extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Deplace fichier uploade sous le nom $files dans le repertoire sdir * Deplace fichier uploade sous le nom $files dans le repertoire sdir
* *
@ -1610,9 +1624,9 @@ class Categorie extends CommonObject
* @param string $file Nom du fichier uploade * @param string $file Nom du fichier uploade
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function add_photo($sdir, $file) function add_photo($sdir, $file)
{ {
// phpcs:enable
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$dir = $sdir .'/'. get_exdir($this->id,2,0,0,$this,'category') . $this->id ."/"; $dir = $sdir .'/'. get_exdir($this->id,2,0,0,$this,'category') . $this->id ."/";
@ -1653,6 +1667,7 @@ class Categorie extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return tableau de toutes les photos de la categorie * Return tableau de toutes les photos de la categorie
* *
@ -1660,9 +1675,9 @@ class Categorie extends CommonObject
* @param int $nbmax Nombre maximum de photos (0=pas de max) * @param int $nbmax Nombre maximum de photos (0=pas de max)
* @return array Tableau de photos * @return array Tableau de photos
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function liste_photos($dir,$nbmax=0) function liste_photos($dir,$nbmax=0)
{ {
// phpcs:enable
include_once DOL_DOCUMENT_ROOT .'/core/lib/files.lib.php'; include_once DOL_DOCUMENT_ROOT .'/core/lib/files.lib.php';
$nbphoto=0; $nbphoto=0;
@ -1709,15 +1724,16 @@ class Categorie extends CommonObject
return $tabobj; return $tabobj;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Efface la photo de la categorie et sa vignette * Efface la photo de la categorie et sa vignette
* *
* @param string $file Path to file * @param string $file Path to file
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function delete_photo($file) function delete_photo($file)
{ {
// phpcs:enable
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$dir = dirname($file).'/'; // Chemin du dossier contenant l'image d'origine $dir = dirname($file).'/'; // Chemin du dossier contenant l'image d'origine
@ -1738,15 +1754,16 @@ class Categorie extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Load size of image file * Load size of image file
* *
* @param string $file Path to file * @param string $file Path to file
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_image_size($file) function get_image_size($file)
{ {
// phpcs:enable
$infoImg = getimagesize($file); // Recuperation des infos de l'image $infoImg = getimagesize($file); // Recuperation des infos de l'image
$this->imgWidth = $infoImg[0]; // Largeur de l'image $this->imgWidth = $infoImg[0]; // Largeur de l'image
$this->imgHeight = $infoImg[1]; // Hauteur de l'image $this->imgHeight = $infoImg[1]; // Hauteur de l'image

View File

@ -35,9 +35,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
class ActionComm extends CommonObject class ActionComm extends CommonObject
{ {
/** /**
* @var string ID to identify managed object * @var string ID to identify managed object
*/ */
public $element='action'; public $element='action';
/** /**
* @var string Name of table without prefix where object is stored * @var string Name of table without prefix where object is stored
@ -47,9 +47,9 @@ class ActionComm extends CommonObject
public $table_rowid = 'id'; public $table_rowid = 'id';
/** /**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/ */
public $picto='action'; public $picto = 'action';
/** /**
* 0=No test on entity, 1=Test with field entity, 2=Test with link by societe * 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
@ -698,14 +698,15 @@ class ActionComm extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Initialize this->userassigned array with list of id of user assigned to event * Initialize this->userassigned array with list of id of user assigned to event
* *
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function fetch_userassigned() function fetch_userassigned()
{ {
// phpcs:enable
$sql ="SELECT fk_actioncomm, element_type, fk_element, answer_status, mandatory, transparency"; $sql ="SELECT fk_actioncomm, element_type, fk_element, answer_status, mandatory, transparency";
$sql.=" FROM ".MAIN_DB_PREFIX."actioncomm_resources"; $sql.=" FROM ".MAIN_DB_PREFIX."actioncomm_resources";
$sql.=" WHERE element_type = 'user' AND fk_actioncomm = ".$this->id; $sql.=" WHERE element_type = 'user' AND fk_actioncomm = ".$this->id;
@ -1021,6 +1022,7 @@ class ActionComm 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)
* *
@ -1028,10 +1030,10 @@ class ActionComm extends CommonObject
* @param int $load_state_board Charge indicateurs this->nb de tableau de bord * @param int $load_state_board Charge indicateurs this->nb de tableau de bord
* @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, $load_state_board=0) function load_board($user, $load_state_board=0)
{ {
global $conf, $langs; // phpcs:enable
global $conf, $langs;
if(empty($load_state_board)) $sql = "SELECT a.id, a.datep as dp"; if(empty($load_state_board)) $sql = "SELECT a.id, a.datep as dp";
else { else {
@ -1146,6 +1148,7 @@ class ActionComm extends CommonObject
return $this->LibStatut($this->percentage,$mode,$hidenastatus,$this->datep); return $this->LibStatut($this->percentage,$mode,$hidenastatus,$this->datep);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return label of action status * Return label of action status
* *
@ -1155,9 +1158,9 @@ class ActionComm extends CommonObject
* @param int $datestart Date start of event * @param int $datestart Date start of event
* @return string Label * @return string Label
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function LibStatut($percent,$mode,$hidenastatus=0,$datestart='') function LibStatut($percent,$mode,$hidenastatus=0,$datestart='')
{ {
// phpcs:enable
global $langs; global $langs;
if ($mode == 0) if ($mode == 0)
@ -1355,6 +1358,7 @@ class ActionComm extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Export events from database into a cal file. * Export events from database into a cal file.
* *
@ -1365,9 +1369,9 @@ class ActionComm extends CommonObject
* @param array $filters Array of filters. Exemple array('notolderthan'=>99, 'year'=>..., 'idfrom'=>..., 'notactiontype'=>'systemauto', 'project'=>123, ...) * @param array $filters Array of filters. Exemple array('notolderthan'=>99, 'year'=>..., 'idfrom'=>..., 'notactiontype'=>'systemauto', 'project'=>123, ...)
* @return int <0 if error, nb of events in new file if ok * @return int <0 if error, nb of events in new file if ok
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function build_exportfile($format,$type,$cachedelay,$filename,$filters) function build_exportfile($format,$type,$cachedelay,$filename,$filters)
{ {
// phpcs:enable
global $conf,$langs,$dolibarr_main_url_root,$mysoc; global $conf,$langs,$dolibarr_main_url_root,$mysoc;
require_once DOL_DOCUMENT_ROOT ."/core/lib/xcal.lib.php"; require_once DOL_DOCUMENT_ROOT ."/core/lib/xcal.lib.php";

View File

@ -173,6 +173,7 @@ class ActionCommReminder 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
* *
@ -180,9 +181,9 @@ class ActionCommReminder 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 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;
if ($mode == 0 || $mode == 1) if ($mode == 0 || $mode == 1)

View File

@ -24,7 +24,7 @@
/** /**
* Class to manage different types of events * Class to manage different types of events
*/ */
class CActionComm class CActionComm
{ {
@ -56,9 +56,9 @@ class CActionComm
public $color; public $color;
/** /**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/ */
public $picto; public $picto;
public $type_actions=array(); public $type_actions=array();
@ -118,6 +118,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)
* *
@ -129,9 +130,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

@ -27,7 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/xcal.lib.php';
/** /**
* Class to read/parse ICal calendars * Class to read/parse ICal calendars
*/ */
class ICal class ICal
{ {
@ -39,22 +39,23 @@ class ICal
var $last_key; //Help variable save last key (multiline string) var $last_key; //Help variable save last key (multiline string)
/** /**
* Constructor * Constructor
*/ */
public function __construct() public function __construct()
{ {
} }
/** // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Read text file, icalender text file * Read text file, icalender text file
* *
* @param string $file File * @param string $file File
* @return string * @return string
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function read_file($file) function read_file($file)
{ {
// phpcs:enable
$this->file = $file; $this->file = $file;
$file_text=''; $file_text='';
@ -67,25 +68,27 @@ class ICal
return $file_text; // return all text return $file_text; // return all text
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Returns the number of calendar events * Returns the number of calendar events
* *
* @return int * @return int
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_event_count() function get_event_count()
{ {
// phpcs:enable
return $this->event_count; return $this->event_count;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Returns the number of to do * Returns the number of to do
* *
* @return int * @return int
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_todo_count() function get_todo_count()
{ {
// phpcs:enable
return $this->todo_count; return $this->todo_count;
} }
@ -197,6 +200,7 @@ class ICal
return $this->cal; return $this->cal;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Add to $this->ical array one value and key. * Add to $this->ical array one value and key.
* *
@ -205,9 +209,9 @@ class ICal
* @param string $value Value * @param string $value Value
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function add_to_array($type, $key, $value) function add_to_array($type, $key, $value)
{ {
// phpcs:enable
//print 'type='.$type.' key='.$key.' value='.$value.'<br>'."\n"; //print 'type='.$type.' key='.$key.' value='.$value.'<br>'."\n";
@ -258,16 +262,17 @@ class ICal
$this->last_key = $key; $this->last_key = $key;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Parse text "XXXX:value text some with : " and return array($key = "XXXX", $value="value"); * Parse text "XXXX:value text some with : " and return array($key = "XXXX", $value="value");
* *
* @param string $text Text * @param string $text Text
* @return array * @return array
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function retun_key_value($text) function retun_key_value($text)
{ {
/* // phpcs:enable
/*
preg_match("/([^:]+)[:]([\w\W]+)/", $text, $matches); preg_match("/([^:]+)[:]([\w\W]+)/", $text, $matches);
if (empty($matches)) if (empty($matches))
@ -279,19 +284,20 @@ class ICal
$matches = array_splice($matches, 1, 2); $matches = array_splice($matches, 1, 2);
return $matches; return $matches;
}*/ }*/
return explode(':',$text,2); return explode(':',$text,2);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Parse RRULE return array * Parse RRULE return array
* *
* @param string $value string * @param string $value string
* @return array * @return array
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function ical_rrule($value) function ical_rrule($value)
{ {
$result=array(); // phpcs:enable
$result = array();
$rrule = explode(';',$value); $rrule = explode(';',$value);
foreach ($rrule as $line) foreach ($rrule as $line)
{ {
@ -300,15 +306,17 @@ class ICal
} }
return $result; return $result;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return Unix time from ical date time fomrat (YYYYMMDD[T]HHMMSS[Z] or YYYYMMDD[T]HHMMSS) * Return Unix time from ical date time fomrat (YYYYMMDD[T]HHMMSS[Z] or YYYYMMDD[T]HHMMSS)
* *
* @param string $ical_date String date * @param string $ical_date String date
* @return int * @return int
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function ical_date_to_unix($ical_date) function ical_date_to_unix($ical_date)
{ {
// phpcs:enable
$ical_date = str_replace('T', '', $ical_date); $ical_date = str_replace('T', '', $ical_date);
$ical_date = str_replace('Z', '', $ical_date); $ical_date = str_replace('Z', '', $ical_date);
@ -322,6 +330,7 @@ class ICal
return $ntime; // ntime is a GTM time return $ntime; // ntime is a GTM time
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return unix date from iCal date format * Return unix date from iCal date format
* *
@ -329,10 +338,10 @@ class ICal
* @param string $value Value * @param string $value Value
* @return array * @return array
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function ical_dt_date($key, $value) function ical_dt_date($key, $value)
{ {
$return_value=array(); // phpcs:enable
$return_value = array();
$value = $this->ical_date_to_unix($value); $value = $this->ical_date_to_unix($value);
// Analyse TZID // Analyse TZID
@ -352,14 +361,15 @@ class ICal
return array($key,$return_value); return array($key,$return_value);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return sorted eventlist as array or false if calenar is empty * Return sorted eventlist as array or false if calenar is empty
* *
* @return array * @return array
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_sort_event_list() function get_sort_event_list()
{ {
// phpcs:enable
$temp = $this->get_event_list(); $temp = $this->get_event_list();
if (!empty($temp)) if (!empty($temp))
{ {
@ -372,6 +382,7 @@ class ICal
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Compare two unix timestamp * Compare two unix timestamp
* *
@ -379,64 +390,69 @@ class ICal
* @param array $b Operand b * @param array $b Operand b
* @return integer * @return integer
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function ical_dtstart_compare($a, $b) function ical_dtstart_compare($a, $b)
{ {
// phpcs:enable
return strnatcasecmp($a['DTSTART']['unixtime'], $b['DTSTART']['unixtime']); return strnatcasecmp($a['DTSTART']['unixtime'], $b['DTSTART']['unixtime']);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return eventlist array (not sort eventlist array) * Return eventlist array (not sort eventlist array)
* *
* @return array * @return array
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_event_list() function get_event_list()
{ {
// phpcs:enable
return (! empty($this->cal['VEVENT'])?$this->cal['VEVENT']:''); return (! empty($this->cal['VEVENT'])?$this->cal['VEVENT']:'');
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return eventlist array (not sort eventlist array) * Return eventlist array (not sort eventlist array)
* *
* @return array * @return array
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_freebusy_list() function get_freebusy_list()
{ {
// phpcs:enable
return $this->cal['VFREEBUSY']; return $this->cal['VFREEBUSY'];
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return to do array (not sort to do array) * Return to do array (not sort to do array)
* *
* @return array * @return array
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_todo_list() function get_todo_list()
{ {
// phpcs:enable
return $this->cal['VTODO']; return $this->cal['VTODO'];
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return base calendar data * Return base calendar data
* *
* @return array * @return array
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_calender_data() function get_calender_data()
{ {
// phpcs:enable
return $this->cal['VCALENDAR']; return $this->cal['VCALENDAR'];
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return array with all data * Return array with all data
* *
* @return array * @return array
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_all_data() function get_all_data()
{ {
// phpcs:enable
return $this->cal; return $this->cal;
} }
} }

View File

@ -254,15 +254,16 @@ class AdvanceTargetingMailing extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Load object in memory from the database * Load object in memory from the 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_by_mailing($id=0) function fetch_by_mailing($id=0)
{ {
// phpcs:enable
global $langs; global $langs;
$sql = "SELECT"; $sql = "SELECT";
$sql.= " t.rowid,"; $sql.= " t.rowid,";
@ -320,6 +321,7 @@ class AdvanceTargetingMailing extends CommonObject
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Load object in memory from the database * Load object in memory from the database
* *
@ -327,9 +329,9 @@ class AdvanceTargetingMailing extends CommonObject
* @param string $type_element Type target * @param string $type_element Type target
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function fetch_by_element($id=0, $type_element='mailing') function fetch_by_element($id=0, $type_element='mailing')
{ {
// phpcs:enable
global $langs; global $langs;
$sql = "SELECT"; $sql = "SELECT";
$sql.= " t.rowid,"; $sql.= " t.rowid,";
@ -546,15 +548,16 @@ class AdvanceTargetingMailing extends CommonObject
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Load object in memory from database * Load object in memory from database
* *
* @param array $arrayquery All element to Query * @param array $arrayquery All element to Query
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function query_thirdparty($arrayquery) function query_thirdparty($arrayquery)
{ {
// phpcs:enable
global $langs,$conf; global $langs,$conf;
$sql = "SELECT"; $sql = "SELECT";
@ -700,6 +703,7 @@ class AdvanceTargetingMailing extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Load object in memory from database * Load object in memory from database
* *
@ -707,9 +711,9 @@ class AdvanceTargetingMailing extends CommonObject
* @param int $withThirdpartyFilter add contact with tridparty filter * @param int $withThirdpartyFilter add contact with tridparty filter
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function query_contact($arrayquery, $withThirdpartyFilter = 0) function query_contact($arrayquery, $withThirdpartyFilter = 0)
{ {
// phpcs:enable
global $langs,$conf; global $langs,$conf;
$sql = "SELECT"; $sql = "SELECT";

View File

@ -76,10 +76,10 @@ class Mailing extends CommonObject
public $statuts=array(); public $statuts=array();
/** /**
* Constructor * Constructor
* *
* @param DoliDb $db Database handler * @param DoliDb $db Database handler
*/ */
function __construct($db) function __construct($db)
{ {
@ -442,14 +442,15 @@ class Mailing extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Delete targets emailing * Delete targets emailing
* *
* @return int 1 if OK, 0 if error * @return int 1 if OK, 0 if error
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function delete_targets() function delete_targets()
{ {
// phpcs:enable
$sql = "DELETE FROM ".MAIN_DB_PREFIX."mailing_cibles"; $sql = "DELETE FROM ".MAIN_DB_PREFIX."mailing_cibles";
$sql.= " WHERE fk_mailing = ".$this->id; $sql.= " WHERE fk_mailing = ".$this->id;
@ -467,15 +468,16 @@ class Mailing extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Change status of each recipient * Change status of each recipient
* *
* @param User $user Objet user qui valide * @param User $user Objet user qui valide
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function reset_targets_status($user) function reset_targets_status($user)
{ {
// phpcs:enable
$sql = "UPDATE ".MAIN_DB_PREFIX."mailing_cibles"; $sql = "UPDATE ".MAIN_DB_PREFIX."mailing_cibles";
$sql.= " SET statut = 0"; $sql.= " SET statut = 0";
$sql.= " WHERE fk_mailing = ".$this->id; $sql.= " WHERE fk_mailing = ".$this->id;
@ -539,6 +541,7 @@ class Mailing extends CommonObject
return $this->LibStatut($this->statut,$mode); return $this->LibStatut($this->statut,$mode);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Renvoi le libelle d'un statut donne * Renvoi le libelle d'un statut donne
* *
@ -546,42 +549,38 @@ class Mailing 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 * @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;
$langs->load('mails'); $langs->load('mails');
if ($mode == 0) if ($mode == 0 || $mode == 1)
{ {
return $langs->trans($this->statuts[$statut]); return $langs->trans($this->statuts[$statut]);
} }
if ($mode == 1) elseif ($mode == 2)
{
return $langs->trans($this->statuts[$statut]);
}
if ($mode == 2)
{ {
if ($statut == 0) return img_picto($langs->trans($this->statuts[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]); if ($statut == 0) return img_picto($langs->trans($this->statuts[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]);
if ($statut == 1) return img_picto($langs->trans($this->statuts[$statut]),'statut1').' '.$langs->trans($this->statuts[$statut]); if ($statut == 1) return img_picto($langs->trans($this->statuts[$statut]),'statut1').' '.$langs->trans($this->statuts[$statut]);
if ($statut == 2) return img_picto($langs->trans($this->statuts[$statut]),'statut3').' '.$langs->trans($this->statuts[$statut]); if ($statut == 2) return img_picto($langs->trans($this->statuts[$statut]),'statut3').' '.$langs->trans($this->statuts[$statut]);
if ($statut == 3) return img_picto($langs->trans($this->statuts[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]); if ($statut == 3) return img_picto($langs->trans($this->statuts[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]);
} }
if ($mode == 3) elseif ($mode == 3)
{ {
if ($statut == 0) return img_picto($langs->trans($this->statuts[$statut]),'statut0'); if ($statut == 0) return img_picto($langs->trans($this->statuts[$statut]),'statut0');
if ($statut == 1) return img_picto($langs->trans($this->statuts[$statut]),'statut1'); if ($statut == 1) return img_picto($langs->trans($this->statuts[$statut]),'statut1');
if ($statut == 2) return img_picto($langs->trans($this->statuts[$statut]),'statut3'); if ($statut == 2) return img_picto($langs->trans($this->statuts[$statut]),'statut3');
if ($statut == 3) return img_picto($langs->trans($this->statuts[$statut]),'statut6'); if ($statut == 3) return img_picto($langs->trans($this->statuts[$statut]),'statut6');
} }
if ($mode == 4) elseif ($mode == 4)
{ {
if ($statut == 0) return img_picto($langs->trans($this->statuts[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]); if ($statut == 0) return img_picto($langs->trans($this->statuts[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]);
if ($statut == 1) return img_picto($langs->trans($this->statuts[$statut]),'statut1').' '.$langs->trans($this->statuts[$statut]); if ($statut == 1) return img_picto($langs->trans($this->statuts[$statut]),'statut1').' '.$langs->trans($this->statuts[$statut]);
if ($statut == 2) return img_picto($langs->trans($this->statuts[$statut]),'statut3').' '.$langs->trans($this->statuts[$statut]); if ($statut == 2) return img_picto($langs->trans($this->statuts[$statut]),'statut3').' '.$langs->trans($this->statuts[$statut]);
if ($statut == 3) return img_picto($langs->trans($this->statuts[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]); if ($statut == 3) return img_picto($langs->trans($this->statuts[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]);
} }
if ($mode == 5) elseif ($mode == 5)
{ {
if ($statut == 0) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut0'); if ($statut == 0) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut0');
if ($statut == 1) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut1'); if ($statut == 1) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut1');
@ -609,39 +608,39 @@ class Mailing extends CommonObject
{ {
return $langs->trans('MailingStatusError'); return $langs->trans('MailingStatusError');
} }
if ($mode == 1) elseif ($mode == 1)
{ {
return $langs->trans('MailingStatusSent'); return $langs->trans('MailingStatusSent');
} }
if ($mode == 2) elseif ($mode == 2)
{ {
if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc); if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc);
if ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut6'); if ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut6');
if ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"),'statut4'); if ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"),'statut4');
if ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"),'statut3'); if ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"),'statut3');
} }
if ($mode == 3) elseif ($mode == 3)
{ {
if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc); if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc);
if ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut6'); if ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut6');
if ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"),'statut4'); if ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"),'statut4');
if ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"),'statut3'); if ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"),'statut3');
} }
if ($mode == 4) elseif ($mode == 4)
{ {
if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc); if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc);
if ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut6'); if ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut6');
if ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"),'statut4'); if ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"),'statut4');
if ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"),'statut3'); if ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"),'statut3');
} }
if ($mode == 5) elseif ($mode == 5)
{ {
if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc); if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc);
if ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut6'); if ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut6');
if ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"),'statut4'); if ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"),'statut4');
if ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"),'statut3'); if ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"),'statut3');
} }
if ($mode == 6) elseif ($mode == 6)
{ {
if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc); if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc);
if ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut6'); if ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut6');

View File

@ -243,9 +243,10 @@ class Propal extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Add line into array products * Add line into array products
* $this->thirdparty should be loaded * $this->thirdparty should be loaded
* *
* @param int $idproduct Product Id to add * @param int $idproduct Product Id to add
* @param int $qty Quantity * @param int $qty Quantity
@ -255,9 +256,9 @@ class Propal extends CommonObject
* TODO Replace calls to this function by generation objet Ligne * TODO Replace calls to this function by generation objet Ligne
* inserted into table $this->products * inserted into table $this->products
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function add_product($idproduct, $qty, $remise_percent=0) function add_product($idproduct, $qty, $remise_percent=0)
{ {
// phpcs:enable
global $conf, $mysoc; global $conf, $mysoc;
if (! $qty) $qty = 1; if (! $qty) $qty = 1;
@ -304,15 +305,16 @@ class Propal extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Adding line of fixed discount in the proposal in DB * Adding line of fixed discount in the proposal in DB
* *
* @param int $idremise Id of fixed discount * @param int $idremise Id of fixed discount
* @return int >0 if OK, <0 if KO * @return int >0 if OK, <0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function insert_discount($idremise) function insert_discount($idremise)
{ {
// phpcs:enable
global $langs; global $langs;
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
@ -1183,6 +1185,7 @@ class Propal extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Insert into DB a proposal object completely defined by its data members (ex, results from copy). * Insert into DB a proposal object completely defined by its data members (ex, results from copy).
* *
@ -1190,9 +1193,9 @@ class Propal extends CommonObject
* @return int Id of the new object if ok, <0 if ko * @return int Id of the new object if ok, <0 if ko
* @see create * @see create
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function create_from($user) function create_from($user)
{ {
// phpcs:enable
// i love this function because $this->products is not used in create function... // i love this function because $this->products is not used in create function...
$this->products=$this->lines; $this->products=$this->lines;
@ -1575,15 +1578,16 @@ class Propal extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Load array lines * Load array lines
* *
* @param int $only_product Return only physical products * @param int $only_product Return only physical products
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function fetch_lines($only_product=0) function fetch_lines($only_product=0)
{ {
// phpcs:enable
$this->lines=array(); $this->lines=array();
$sql = 'SELECT d.rowid, d.fk_propal, d.fk_parent_line, d.label as custom_label, d.description, d.price, d.vat_src_code, d.tva_tx, d.localtax1_tx, d.localtax2_tx, d.localtax1_type, d.localtax2_type, d.qty, d.fk_remise_except, d.remise_percent, d.subprice, d.fk_product,'; $sql = 'SELECT d.rowid, d.fk_propal, d.fk_parent_line, d.label as custom_label, d.description, d.price, d.vat_src_code, d.tva_tx, d.localtax1_tx, d.localtax2_tx, d.localtax1_type, d.localtax2_type, d.qty, d.fk_remise_except, d.remise_percent, d.subprice, d.fk_product,';
@ -1814,6 +1818,7 @@ class Propal extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Define proposal date * Define proposal date
* *
@ -1822,9 +1827,9 @@ class Propal extends CommonObject
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @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, $notrigger=0) function set_date($user, $date, $notrigger=0)
{ {
// phpcs:enable
if (empty($date)) if (empty($date))
{ {
$this->error='ErrorBadParameter'; $this->error='ErrorBadParameter';
@ -1882,6 +1887,7 @@ class Propal extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Define end validity date * Define end validity date
* *
@ -1890,9 +1896,9 @@ class Propal extends CommonObject
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function set_echeance($user, $date_fin_validite, $notrigger=0) function set_echeance($user, $date_fin_validite, $notrigger=0)
{ {
// phpcs:enable
if (! empty($user->rights->propal->creer)) if (! empty($user->rights->propal->creer))
{ {
$error=0; $error=0;
@ -1943,6 +1949,7 @@ class Propal extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set delivery date * Set delivery date
* *
@ -1951,9 +1958,9 @@ class Propal extends CommonObject
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @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_livraison($user, $date_livraison, $notrigger=0) function set_date_livraison($user, $date_livraison, $notrigger=0)
{ {
// phpcs:enable
if (! empty($user->rights->propal->creer)) if (! empty($user->rights->propal->creer))
{ {
$error=0; $error=0;
@ -2004,6 +2011,7 @@ class Propal extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set delivery * Set delivery
* *
@ -2012,9 +2020,9 @@ class Propal extends CommonObject
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function set_availability($user, $id, $notrigger=0) function set_availability($user, $id, $notrigger=0)
{ {
// phpcs:enable
if (! empty($user->rights->propal->creer) && $this->statut >= self::STATUS_DRAFT) if (! empty($user->rights->propal->creer) && $this->statut >= self::STATUS_DRAFT)
{ {
$error=0; $error=0;
@ -2074,6 +2082,7 @@ class Propal extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set source of demand * Set source of demand
* *
@ -2082,9 +2091,9 @@ class Propal extends CommonObject
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function set_demand_reason($user, $id, $notrigger=0) function set_demand_reason($user, $id, $notrigger=0)
{ {
// phpcs:enable
if (! empty($user->rights->propal->creer) && $this->statut >= self::STATUS_DRAFT) if (! empty($user->rights->propal->creer) && $this->statut >= self::STATUS_DRAFT)
{ {
$error=0; $error=0;
@ -2146,6 +2155,7 @@ class Propal extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set customer reference number * Set customer reference number
* *
@ -2154,9 +2164,9 @@ class Propal extends CommonObject
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int <0 if ko, >0 if ok * @return int <0 if ko, >0 if ok
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function set_ref_client($user, $ref_client, $notrigger=0) function set_ref_client($user, $ref_client, $notrigger=0)
{ {
// phpcs:enable
if (! empty($user->rights->propal->creer)) if (! empty($user->rights->propal->creer))
{ {
$error=0; $error=0;
@ -2210,6 +2220,7 @@ class Propal extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set an overall discount on the proposal * Set an overall discount on the proposal
* *
@ -2218,9 +2229,9 @@ class Propal extends CommonObject
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int <0 if ko, >0 if ok * @return int <0 if ko, >0 if ok
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function set_remise_percent($user, $remise, $notrigger=0) function set_remise_percent($user, $remise, $notrigger=0)
{ {
// phpcs:enable
$remise=trim($remise)?trim($remise):0; $remise=trim($remise)?trim($remise):0;
if (! empty($user->rights->propal->creer)) if (! empty($user->rights->propal->creer))
@ -2276,6 +2287,7 @@ class Propal extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set an absolute overall discount on the proposal * Set an absolute overall discount on the proposal
* *
@ -2284,9 +2296,9 @@ class Propal extends CommonObject
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int <0 if ko, >0 if ok * @return int <0 if ko, >0 if ok
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function set_remise_absolue($user, $remise, $notrigger=0) function set_remise_absolue($user, $remise, $notrigger=0)
{ {
// phpcs:enable
$remise=trim($remise)?trim($remise):0; $remise=trim($remise)?trim($remise):0;
if (! empty($user->rights->propal->creer)) if (! empty($user->rights->propal->creer))
@ -2561,6 +2573,7 @@ class Propal extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set draft status * Set draft status
* *
@ -2568,9 +2581,9 @@ class Propal extends CommonObject
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function set_draft($user, $notrigger=0) function set_draft($user, $notrigger=0)
{ {
// phpcs:enable
$error=0; $error=0;
$this->db->begin(); $this->db->begin();
@ -2619,6 +2632,7 @@ class Propal extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of proposal (eventually filtered on user) into an array * Return list of proposal (eventually filtered on user) into an array
* *
@ -2632,9 +2646,9 @@ class Propal extends CommonObject
* @param string $sortorder Sort order * @param string $sortorder Sort order
* @return int -1 if KO, array with result if OK * @return int -1 if KO, array with result if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function liste_array($shortlist=0, $draft=0, $notcurrentuser=0, $socid=0, $limit=0, $offset=0, $sortfield='p.datep', $sortorder='DESC') function liste_array($shortlist=0, $draft=0, $notcurrentuser=0, $socid=0, $limit=0, $offset=0, $sortfield='p.datep', $sortorder='DESC')
{ {
// phpcs:enable
global $user; global $user;
$ga = array(); $ga = array();
@ -2706,15 +2720,16 @@ class Propal extends CommonObject
return $this->InvoiceArrayList($this->id); return $this->InvoiceArrayList($this->id);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Returns an array with id and ref of related invoices * Returns an array with id and ref of related invoices
* *
* @param int $id Id propal * @param int $id Id propal
* @return array Array of invoices id * @return array Array of invoices id
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function InvoiceArrayList($id) function InvoiceArrayList($id)
{ {
// phpcs:enable
$ga = array(); $ga = array();
$linkedInvoices = array(); $linkedInvoices = array();
@ -2985,6 +3000,7 @@ class Propal extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Change source demand * Change source demand
* *
@ -2993,9 +3009,9 @@ class Propal extends CommonObject
* @return int >0 si ok, <0 si ko * @return int >0 si ok, <0 si ko
* @deprecated use set_demand_reason * @deprecated use set_demand_reason
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function demand_reason($demand_reason_id, $notrigger=0) function demand_reason($demand_reason_id, $notrigger=0)
{ {
// phpcs:enable
global $user; global $user;
if ($this->statut >= self::STATUS_DRAFT) if ($this->statut >= self::STATUS_DRAFT)
@ -3126,6 +3142,7 @@ class Propal 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 (draft, validated, ...) * Return label of a status (draft, validated, ...)
* *
@ -3133,9 +3150,9 @@ class Propal 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 Label * @return string Label
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function LibStatut($statut,$mode=1) function LibStatut($statut,$mode=1)
{ {
// phpcs:enable
global $conf; global $conf;
// Init/load array of translation of status // Init/load array of translation of status
@ -3169,9 +3186,10 @@ class Propal extends CommonObject
if ($mode == 4) return img_picto($this->labelstatut[$statut],$statuttrans).' '.$this->labelstatut[$statut]; if ($mode == 4) return img_picto($this->labelstatut[$statut],$statuttrans).' '.$this->labelstatut[$statut];
if ($mode == 5) return '<span class="hideonsmartphone">'.$this->labelstatut_short[$statut].' </span>'.img_picto($this->labelstatut[$statut],$statuttrans); if ($mode == 5) return '<span class="hideonsmartphone">'.$this->labelstatut_short[$statut].' </span>'.img_picto($this->labelstatut[$statut],$statuttrans);
if ($mode == 6) return '<span class="hideonsmartphone">'.$this->labelstatut[$statut].' </span>'.img_picto($this->labelstatut[$statut],$statuttrans); if ($mode == 6) return '<span class="hideonsmartphone">'.$this->labelstatut[$statut].' </span>'.img_picto($this->labelstatut[$statut],$statuttrans);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Load indicators for dashboard (this->nbtodo and this->nbtodolate) * Load indicators for dashboard (this->nbtodo and this->nbtodolate)
* *
@ -3179,9 +3197,9 @@ class Propal extends CommonObject
* @param int $mode "opened" for proposal to close, "signed" for proposal to invoice * @param int $mode "opened" for proposal to close, "signed" for proposal to invoice
* @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,$mode) function load_board($user,$mode)
{ {
// phpcs:enable
global $conf, $langs; global $conf, $langs;
$clause = " WHERE"; $clause = " WHERE";
@ -3347,14 +3365,15 @@ class Propal 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;
$this->nb=array(); $this->nb=array();
@ -4234,15 +4253,16 @@ class PropaleLigne extends CommonObjectLine
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Update DB line fields total_xxx * Update DB line fields total_xxx
* Used by migration * Used by migration
* *
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function update_total() function update_total()
{ {
// phpcs:enable
$this->db->begin(); $this->db->begin();
// Mise a jour ligne en base // Mise a jour ligne en base

View File

@ -450,6 +450,7 @@ class Commande extends CommonOrder
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set draft status * Set draft status
* *
@ -457,9 +458,9 @@ class Commande extends CommonOrder
* @param int $idwarehouse Warehouse ID to use for stock change (Used only if option STOCK_CALCULATE_ON_VALIDATE_ORDER is on) * @param int $idwarehouse Warehouse ID to use for stock change (Used only if option STOCK_CALCULATE_ON_VALIDATE_ORDER is on)
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function set_draft($user, $idwarehouse=-1) function set_draft($user, $idwarehouse=-1)
{ {
//phpcs:enable
global $conf,$langs; global $conf,$langs;
$error=0; $error=0;
@ -532,6 +533,7 @@ class Commande extends CommonOrder
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Tag the order as validated (opened) * Tag the order as validated (opened)
* Function used when order is reopend after being closed. * Function used when order is reopend after being closed.
@ -539,9 +541,9 @@ class Commande extends CommonOrder
* @param User $user Object user that change status * @param User $user Object user that change status
* @return int <0 if KO, 0 if nothing is done, >0 if OK * @return int <0 if KO, 0 if nothing is done, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function set_reopen($user) function set_reopen($user)
{ {
// phpcs:enable
$error=0; $error=0;
if ($this->statut != self::STATUS_CANCELED && $this->statut != self::STATUS_CLOSED) if ($this->statut != self::STATUS_CANCELED && $this->statut != self::STATUS_CLOSED)
@ -1497,6 +1499,7 @@ class Commande extends CommonOrder
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Add line into array * Add line into array
* $this->client must be loaded * $this->client must be loaded
@ -1511,9 +1514,9 @@ class Commande extends CommonOrder
* TODO Remplacer les appels a cette fonction par generation objet Ligne * TODO Remplacer les appels a cette fonction par generation objet Ligne
* insere dans tableau $this->products * insere dans tableau $this->products
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function add_product($idproduct, $qty, $remise_percent=0.0, $date_start='', $date_end='') function add_product($idproduct, $qty, $remise_percent=0.0, $date_start='', $date_end='')
{ {
// phpcs:enable
global $conf, $mysoc; global $conf, $mysoc;
if (! $qty) $qty = 1; if (! $qty) $qty = 1;
@ -1736,15 +1739,16 @@ class Commande extends CommonOrder
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Adding line of fixed discount in the order in DB * Adding line of fixed discount in the order in DB
* *
* @param int $idremise Id de la remise fixe * @param int $idremise Id de la remise fixe
* @return int >0 si ok, <0 si ko * @return int >0 si ok, <0 si ko
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function insert_discount($idremise) function insert_discount($idremise)
{ {
// phpcs:enable
global $langs; global $langs;
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
@ -1814,15 +1818,16 @@ class Commande extends CommonOrder
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Load array lines * Load array lines
* *
* @param int $only_product Return only physical products * @param int $only_product Return only physical products
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function fetch_lines($only_product=0) function fetch_lines($only_product=0)
{ {
// phpcs:enable
$this->lines=array(); $this->lines=array();
$sql = 'SELECT l.rowid, l.fk_product, l.fk_parent_line, l.product_type, l.fk_commande, l.label as custom_label, l.description, l.price, l.qty, l.vat_src_code, l.tva_tx,'; $sql = 'SELECT l.rowid, l.fk_product, l.fk_parent_line, l.product_type, l.fk_commande, l.label as custom_label, l.description, l.price, l.qty, l.vat_src_code, l.tva_tx,';
@ -2040,6 +2045,7 @@ class Commande extends CommonOrder
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Returns a array with expeditions lines number * Returns a array with expeditions lines number
* *
@ -2047,9 +2053,9 @@ class Commande extends CommonOrder
* *
* TODO deprecate, move to Shipping class * TODO deprecate, move to Shipping class
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function nb_expedition() function nb_expedition()
{ {
// phpcs:enable
$sql = 'SELECT count(*)'; $sql = 'SELECT count(*)';
$sql.= ' FROM '.MAIN_DB_PREFIX.'expedition as e'; $sql.= ' FROM '.MAIN_DB_PREFIX.'expedition as e';
$sql.= ', '.MAIN_DB_PREFIX.'element_element as el'; $sql.= ', '.MAIN_DB_PREFIX.'element_element as el';
@ -2066,6 +2072,7 @@ class Commande extends CommonOrder
else dol_print_error($this->db); else dol_print_error($this->db);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return a array with the pending stock by product * Return a array with the pending stock by product
* *
@ -2074,9 +2081,9 @@ class Commande extends CommonOrder
* *
* TODO FONCTION NON FINIE A FINIR * TODO FONCTION NON FINIE A FINIR
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function stock_array($filtre_statut=self::STATUS_CANCELED) function stock_array($filtre_statut=self::STATUS_CANCELED)
{ {
// phpcs:enable
$this->stocks = array(); $this->stocks = array();
// Tableau des id de produit de la commande // Tableau des id de produit de la commande
@ -2183,6 +2190,7 @@ class Commande extends CommonOrder
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Applique une remise relative * Applique une remise relative
* *
@ -2191,9 +2199,9 @@ class Commande extends CommonOrder
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function set_remise($user, $remise, $notrigger=0) function set_remise($user, $remise, $notrigger=0)
{ {
// phpcs:enable
$remise=trim($remise)?trim($remise):0; $remise=trim($remise)?trim($remise):0;
if ($user->rights->commande->creer) if ($user->rights->commande->creer)
@ -2250,6 +2258,7 @@ class Commande extends CommonOrder
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Applique une remise absolue * Applique une remise absolue
* *
@ -2258,9 +2267,9 @@ class Commande extends CommonOrder
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function set_remise_absolue($user, $remise, $notrigger=0) function set_remise_absolue($user, $remise, $notrigger=0)
{ {
// phpcs:enable
$remise=trim($remise)?trim($remise):0; $remise=trim($remise)?trim($remise):0;
if ($user->rights->commande->creer) if ($user->rights->commande->creer)
@ -2317,6 +2326,7 @@ class Commande extends CommonOrder
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set the order date * Set the order date
* *
@ -2325,9 +2335,9 @@ class Commande extends CommonOrder
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @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, $notrigger=0) function set_date($user, $date, $notrigger=0)
{ {
// phpcs:enable
if ($user->rights->commande->creer) if ($user->rights->commande->creer)
{ {
$error=0; $error=0;
@ -2382,6 +2392,7 @@ class Commande extends CommonOrder
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set the planned delivery date * Set the planned delivery date
* *
@ -2390,9 +2401,9 @@ class Commande extends CommonOrder
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int <0 si ko, >0 si ok * @return int <0 si ko, >0 si ok
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function set_date_livraison($user, $date_livraison, $notrigger=0) function set_date_livraison($user, $date_livraison, $notrigger=0)
{ {
// phpcs:enable
if ($user->rights->commande->creer) if ($user->rights->commande->creer)
{ {
$error=0; $error=0;
@ -2447,6 +2458,7 @@ class Commande extends CommonOrder
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of orders (eventuelly filtered on a user) into an array * Return list of orders (eventuelly filtered on a user) into an array
* *
@ -2460,9 +2472,9 @@ class Commande extends CommonOrder
* @param string $sortorder Sort order * @param string $sortorder Sort order
* @return int -1 if KO, array with result if OK * @return int -1 if KO, array with result if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function liste_array($shortlist=0, $draft=0, $excluser='', $socid=0, $limit=0, $offset=0, $sortfield='c.date_commande', $sortorder='DESC') function liste_array($shortlist=0, $draft=0, $excluser='', $socid=0, $limit=0, $offset=0, $sortfield='c.date_commande', $sortorder='DESC')
{ {
// phpcs:enable
global $user; global $user;
$ga = array(); $ga = array();
@ -2591,6 +2603,7 @@ class Commande extends CommonOrder
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Update order demand_reason * Update order demand_reason
* *
@ -2598,9 +2611,9 @@ class Commande extends CommonOrder
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int >0 if ok, <0 if ko * @return int >0 if ok, <0 if ko
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function demand_reason($demand_reason_id, $notrigger=0) function demand_reason($demand_reason_id, $notrigger=0)
{ {
// phpcs:enable
global $user; global $user;
dol_syslog('Commande::demand_reason('.$demand_reason_id.')'); dol_syslog('Commande::demand_reason('.$demand_reason_id.')');
@ -2662,6 +2675,7 @@ class Commande extends CommonOrder
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set customer ref * Set customer ref
* *
@ -2670,9 +2684,9 @@ class Commande extends CommonOrder
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function set_ref_client($user, $ref_client, $notrigger=0) function set_ref_client($user, $ref_client, $notrigger=0)
{ {
// phpcs:enable
if ($user->rights->commande->creer) if ($user->rights->commande->creer)
{ {
$error=0; $error=0;
@ -3275,15 +3289,16 @@ class Commande extends CommonOrder
} }
// 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 Object user * @param User $user Object 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;
$clause = " WHERE"; $clause = " WHERE";
@ -3361,6 +3376,7 @@ class Commande extends CommonOrder
return $this->LibStatut($this->statut, $this->billed, $mode); return $this->LibStatut($this->statut, $this->billed, $mode);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return label of status * Return label of status
* *
@ -3370,9 +3386,9 @@ class Commande extends CommonOrder
* @param int $donotshowbilled Do not show billed status after order status * @param int $donotshowbilled Do not show billed status after order status
* @return string Label of status * @return string Label of status
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function LibStatut($statut,$billed,$mode,$donotshowbilled=0) function LibStatut($statut,$billed,$mode,$donotshowbilled=0)
{ {
// phpcs:enable
global $langs, $conf; global $langs, $conf;
$billedtext = ''; $billedtext = '';
@ -3681,14 +3697,15 @@ class Commande extends CommonOrder
} }
// 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 si ko, >0 si ok * @return int <0 si ko, >0 si ok
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function load_state_board() function load_state_board()
{ {
// phpcs:enable
global $user; global $user;
$this->nb=array(); $this->nb=array();
@ -4317,15 +4334,16 @@ class OrderLine extends CommonOrderLine
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Update DB line fields total_xxx * Update DB line fields total_xxx
* Used by migration * Used by migration
* *
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function update_total() function update_total()
{ {
// phpcs:enable
$this->db->begin(); $this->db->begin();
// Clean parameters // Clean parameters

View File

@ -297,6 +297,7 @@ class Account extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Add a link between bank line record and its source * Add a link between bank line record and its source
* *
@ -307,9 +308,9 @@ class Account extends CommonObject
* @param string $type Type of link ('payment', 'company', 'member', ...) * @param string $type Type of link ('payment', 'company', 'member', ...)
* @return int <0 if KO, id line if OK * @return int <0 if KO, id line if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function add_url_line($line_id, $url_id, $url, $label, $type) function add_url_line($line_id, $url_id, $url, $label, $type)
{ {
// phpcs:enable
$sql = "INSERT INTO ".MAIN_DB_PREFIX."bank_url ("; $sql = "INSERT INTO ".MAIN_DB_PREFIX."bank_url (";
$sql.= "fk_bank"; $sql.= "fk_bank";
$sql.= ", url_id"; $sql.= ", url_id";
@ -337,6 +338,7 @@ class Account extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* TODO Move this into AccountLine * TODO Move this into AccountLine
* Return array with links from llx_bank_url * Return array with links from llx_bank_url
@ -344,11 +346,11 @@ class Account extends CommonObject
* @param int $fk_bank To search using bank transaction id * @param int $fk_bank To search using bank transaction id
* @param int $url_id To search using link to * @param int $url_id To search using link to
* @param string $type To search using type * @param string $type To search using type
* @return array|-1 Array of links array('url'=>, 'url_id'=>, 'label'=>, 'type'=> 'fk_bank'=> ) or -1 on error * @return array|int Array of links array('url'=>, 'url_id'=>, 'label'=>, 'type'=> 'fk_bank'=> ) or -1 on error
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_url($fk_bank='', $url_id='', $type='') function get_url($fk_bank='', $url_id='', $type='')
{ {
// phpcs:enable
$lines = array(); $lines = array();
// Check parameters // Check parameters
@ -787,15 +789,16 @@ class Account extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Update BBAN (RIB) account fields * Update BBAN (RIB) account fields
* *
* @param User $user Object user making update * @param User $user Object user making update
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function update_bban(User $user = null) function update_bban(User $user = null)
{ {
// phpcs:enable
global $conf,$langs; global $conf,$langs;
// Clean parameters // Clean parameters
@ -1074,6 +1077,7 @@ class Account extends CommonObject
return $this->LibStatut($this->clos,$mode); return $this->LibStatut($this->clos,$mode);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return label of given object status * Return label of given object status
* *
@ -1081,9 +1085,9 @@ class Account 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 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;
$langs->load('banks'); $langs->load('banks');
@ -1112,14 +1116,15 @@ class Account extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Renvoi si un compte peut etre supprimer ou non (sans mouvements) * Renvoi si un compte peut etre supprimer ou non (sans mouvements)
* *
* @return boolean vrai si peut etre supprime, faux sinon * @return boolean vrai si peut etre supprime, faux sinon
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function can_be_deleted() function can_be_deleted()
{ {
// phpcs:enable
$can_be_deleted=false; $can_be_deleted=false;
$sql = "SELECT COUNT(rowid) as nb"; $sql = "SELECT COUNT(rowid) as nb";
@ -1180,6 +1185,7 @@ class Account extends CommonObject
return $solde; return $solde;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Load indicators for dashboard (this->nbtodo and this->nbtodolate) * Load indicators for dashboard (this->nbtodo and this->nbtodolate)
* *
@ -1187,9 +1193,9 @@ class Account extends CommonObject
* @param int $filteraccountid To get info for a particular account id * @param int $filteraccountid To get info for a particular account id
* @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 $user, $filteraccountid = 0) function load_board(User $user, $filteraccountid = 0)
{ {
// 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
@ -1236,14 +1242,15 @@ class Account extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Charge indicateurs this->nb de tableau de bord * Charge indicateurs this->nb de tableau de bord
* @param int $filteraccountid To get info for a particular account id * @param int $filteraccountid To get info for a particular account id
* @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($filteraccountid = 0) function load_state_board($filteraccountid = 0)
{ {
// 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
@ -1652,7 +1659,7 @@ class AccountLine extends CommonObject
*/ */
public $error=''; public $error='';
/** /**
* @var DoliDB Database handler. * @var DoliDB Database handler.
*/ */
public $db; public $db;
@ -1677,10 +1684,10 @@ class AccountLine extends CommonObject
*/ */
public $id; public $id;
/** /**
* @var string Ref * @var string Ref
*/ */
public $ref; public $ref;
public $datec; public $datec;
public $dateo; public $dateo;
@ -1691,12 +1698,12 @@ class AccountLine extends CommonObject
public $datev; public $datev;
public $amount; public $amount;
/** /**
* @var string bank transaction lines label * @var string bank transaction lines label
*/ */
public $label; public $label;
public $note; public $note;
public $fk_user_author; public $fk_user_author;
public $fk_user_rappro; public $fk_user_rappro;
public $fk_type; public $fk_type;
@ -1709,7 +1716,7 @@ class AccountLine extends CommonObject
public $fk_account; // Id of bank account public $fk_account; // Id of bank account
public $bank_account_label; // Label of bank account public $bank_account_label; // Label of bank account
public $emetteur; public $emetteur;
/** /**
* Constructor * Constructor
@ -1894,15 +1901,16 @@ class AccountLine extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Delete bank line records * Delete bank line records
* *
* @param User $user User object that delete * @param User $user User object that delete
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function delete_urls(User $user = null) function delete_urls(User $user = null)
{ {
// phpcs:enable
$nbko=0; $nbko=0;
if ($this->rappro) if ($this->rappro)
@ -1965,6 +1973,7 @@ class AccountLine extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Update conciliation field * Update conciliation field
* *
@ -1972,9 +1981,9 @@ class AccountLine extends CommonObject
* @param int $cat Category id * @param int $cat Category id
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function update_conciliation(User $user, $cat) function update_conciliation(User $user, $cat)
{ {
// phpcs:enable
global $conf,$langs; global $conf,$langs;
$this->db->begin(); $this->db->begin();
@ -2028,6 +2037,7 @@ class AccountLine extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Increase/decrease value date of a rowid * Increase/decrease value date of a rowid
* *
@ -2035,9 +2045,9 @@ class AccountLine extends CommonObject
* @param int $sign 1 or -1 * @param int $sign 1 or -1
* @return int >0 if OK, 0 if KO * @return int >0 if OK, 0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function datev_change($rowid,$sign=1) function datev_change($rowid,$sign=1)
{ {
// phpcs:enable
$sql = "SELECT datev FROM ".MAIN_DB_PREFIX."bank WHERE rowid = ".$rowid; $sql = "SELECT datev FROM ".MAIN_DB_PREFIX."bank WHERE rowid = ".$rowid;
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) if ($resql)
@ -2067,31 +2077,34 @@ class AccountLine extends CommonObject
return 0; return 0;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Increase value date of a rowid * Increase value date of a rowid
* *
* @param int $id Id of line to change * @param int $id Id of line to change
* @return int >0 if OK, 0 if KO * @return int >0 if OK, 0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function datev_next($id) function datev_next($id)
{ {
// phpcs:enable
return $this->datev_change($id,1); return $this->datev_change($id,1);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Decrease value date of a rowid * Decrease value date of a rowid
* *
* @param int $id Id of line to change * @param int $id Id of line to change
* @return int >0 if OK, 0 if KO * @return int >0 if OK, 0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function datev_previous($id) function datev_previous($id)
{ {
// phpcs:enable
return $this->datev_change($id,-1); return $this->datev_change($id,-1);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Increase/decrease operation date of a rowid * Increase/decrease operation date of a rowid
* *
@ -2099,9 +2112,9 @@ class AccountLine extends CommonObject
* @param int $sign 1 or -1 * @param int $sign 1 or -1
* @return int >0 if OK, 0 if KO * @return int >0 if OK, 0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function dateo_change($rowid,$sign=1) function dateo_change($rowid,$sign=1)
{ {
// phpcs:enable
$sql = "SELECT dateo FROM ".MAIN_DB_PREFIX."bank WHERE rowid = ".$rowid; $sql = "SELECT dateo FROM ".MAIN_DB_PREFIX."bank WHERE rowid = ".$rowid;
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) if ($resql)
@ -2131,27 +2144,29 @@ class AccountLine extends CommonObject
return 0; return 0;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Increase operation date of a rowid * Increase operation date of a rowid
* *
* @param int $id Id of line to change * @param int $id Id of line to change
* @return int >0 if OK, 0 if KO * @return int >0 if OK, 0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function dateo_next($id) function dateo_next($id)
{ {
// phpcs:enable
return $this->dateo_change($id,1); return $this->dateo_change($id,1);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Decrease operation date of a rowid * Decrease operation date of a rowid
* *
* @param int $id Id of line to change * @param int $id Id of line to change
* @return int >0 if OK, 0 if KO * @return int >0 if OK, 0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function dateo_previous($id) function dateo_previous($id)
{ {
// phpcs:enable
return $this->dateo_change($id,-1); return $this->dateo_change($id,-1);
} }
@ -2258,6 +2273,7 @@ class AccountLine 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 statut donne * Renvoi le libelle d'un statut donne
* *
@ -2265,9 +2281,9 @@ class AccountLine 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 Libelle du statut * @return string Libelle du statut
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function LibStatut($statut,$mode=0) function LibStatut($statut,$mode=0)
{ {
// phpcs:enable
global $langs; global $langs;
//$langs->load('companies'); //$langs->load('companies');
/* /*

View File

@ -91,7 +91,7 @@ class PaymentVarious extends CommonObject
* Update database * Update database
* *
* @param User $user User that modify * @param User $user User that modify
* @param int $notrigger 0=no, 1=yes (no update trigger) * @param int $notrigger 0=no, 1=yes (no update trigger)
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user=null, $notrigger=0) function update($user=null, $notrigger=0)
@ -458,15 +458,16 @@ class PaymentVarious extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Update link between payment various and line generate into llx_bank * Update link between payment various and line generate into llx_bank
* *
* @param int $id_bank Id bank account * @param int $id_bank Id bank account
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function update_fk_bank($id_bank) function update_fk_bank($id_bank)
{ {
// phpcs:enable
$sql = 'UPDATE '.MAIN_DB_PREFIX.'payment_various SET fk_bank = '.$id_bank; $sql = 'UPDATE '.MAIN_DB_PREFIX.'payment_various SET fk_bank = '.$id_bank;
$sql.= ' WHERE rowid = '.$this->id; $sql.= ' WHERE rowid = '.$this->id;
$result = $this->db->query($sql); $result = $this->db->query($sql);
@ -493,6 +494,7 @@ class PaymentVarious extends CommonObject
return $this->LibStatut($this->statut,$mode); return $this->LibStatut($this->statut,$mode);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Renvoi le libelle d'un statut donne * Renvoi le libelle d'un statut donne
* *
@ -500,38 +502,38 @@ class PaymentVarious 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 * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
* @return string Libelle * @return string Libelle
*/ */
// 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)
{ {
return $langs->trans($this->statuts_short[$statut]); return $langs->trans($this->statuts_short[$statut]);
} }
if ($mode == 2) elseif ($mode == 2)
{ {
if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts_short[$statut]); if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts_short[$statut]);
if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts_short[$statut]); if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts_short[$statut]);
if ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts_short[$statut]); if ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts_short[$statut]);
} }
if ($mode == 3) elseif ($mode == 3)
{ {
if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0'); if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0');
if ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4'); if ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4');
if ($statut==2 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6'); if ($statut==2 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6');
} }
if ($mode == 4) elseif ($mode == 4)
{ {
if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]); if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]);
if ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts[$statut]); if ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts[$statut]);
if ($statut==2 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]); if ($statut==2 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]);
} }
if ($mode == 5) elseif ($mode == 5)
{ {
if ($statut==0 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut0'); if ($statut==0 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut0');
if ($statut==1 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut4'); if ($statut==1 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut4');

View File

@ -313,6 +313,7 @@ class Deplacement extends CommonObject
return $this->LibStatut($this->statut,$mode); return $this->LibStatut($this->statut,$mode);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Renvoi le libelle d'un statut donne * Renvoi le libelle d'un statut donne
* *
@ -320,38 +321,38 @@ class Deplacement 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 * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
* @return string Libelle * @return string Libelle
*/ */
// 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)
{ {
return $langs->trans($this->statuts_short[$statut]); return $langs->trans($this->statuts_short[$statut]);
} }
if ($mode == 2) elseif ($mode == 2)
{ {
if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts_short[$statut]); if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts_short[$statut]);
if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts_short[$statut]); if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts_short[$statut]);
if ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts_short[$statut]); if ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts_short[$statut]);
} }
if ($mode == 3) elseif ($mode == 3)
{ {
if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0'); if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0');
if ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4'); if ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4');
if ($statut==2 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6'); if ($statut==2 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6');
} }
if ($mode == 4) elseif ($mode == 4)
{ {
if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]); if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]);
if ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts[$statut]); if ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts[$statut]);
if ($statut==2 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]); if ($statut==2 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]);
} }
if ($mode == 5) elseif ($mode == 5)
{ {
if ($statut==0 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut0'); if ($statut==0 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut0');
if ($statut==1 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut4'); if ($statut==1 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut4');

View File

@ -451,14 +451,15 @@ class FactureRec extends CommonInvoice
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Recupere les lignes de factures predefinies dans this->lines * Recupere les lignes de factures predefinies dans this->lines
* *
* @return int 1 if OK, < 0 if KO * @return int 1 if OK, < 0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function fetch_lines() function fetch_lines()
{ {
// phpcs:enable
$this->lines=array(); $this->lines=array();
// Retreive all extrafield for line // Retreive all extrafield for line
@ -1193,6 +1194,7 @@ class FactureRec extends CommonInvoice
return $this->LibStatut($this->frequency?1:0, $this->suspended, $mode, $alreadypaid, empty($this->type)?0:$this->type); return $this->LibStatut($this->frequency?1:0, $this->suspended, $mode, $alreadypaid, empty($this->type)?0:$this->type);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return label of a status * Return label of a status
* *
@ -1203,9 +1205,9 @@ class FactureRec extends CommonInvoice
* @param int $type Type invoice * @param int $type Type invoice
* @return string Label of status * @return string Label of status
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function LibStatut($recur, $status, $mode=0, $alreadypaid=-1, $type=0) function LibStatut($recur, $status, $mode=0, $alreadypaid=-1, $type=0)
{ {
// phpcs:enable
global $langs; global $langs;
$langs->load('bills'); $langs->load('bills');
@ -1224,7 +1226,7 @@ class FactureRec extends CommonInvoice
else return $langs->trans("Draft"); else return $langs->trans("Draft");
} }
} }
if ($mode == 1) elseif ($mode == 1)
{ {
$prefix='Short'; $prefix='Short';
if ($recur) if ($recur)
@ -1238,7 +1240,7 @@ class FactureRec extends CommonInvoice
else return $langs->trans("Draft"); else return $langs->trans("Draft");
} }
} }
if ($mode == 2) elseif ($mode == 2)
{ {
if ($recur) if ($recur)
{ {
@ -1251,7 +1253,7 @@ class FactureRec extends CommonInvoice
else return img_picto($langs->trans('Draft'),'statut0').' '.$langs->trans('Draft'); else return img_picto($langs->trans('Draft'),'statut0').' '.$langs->trans('Draft');
} }
} }
if ($mode == 3) elseif ($mode == 3)
{ {
if ($recur) if ($recur)
{ {
@ -1265,7 +1267,7 @@ class FactureRec extends CommonInvoice
else return img_picto($langs->trans('Draft'),'statut0'); else return img_picto($langs->trans('Draft'),'statut0');
} }
} }
if ($mode == 4) elseif ($mode == 4)
{ {
$prefix=''; $prefix='';
if ($recur) if ($recur)
@ -1279,7 +1281,7 @@ class FactureRec extends CommonInvoice
else return img_picto($langs->trans('Draft'),'statut0').' '.$langs->trans('Draft'); else return img_picto($langs->trans('Draft'),'statut0').' '.$langs->trans('Draft');
} }
} }
if ($mode == 5 || $mode == 6) elseif ($mode == 5 || $mode == 6)
{ {
$prefix=''; $prefix='';
if ($mode == 5) $prefix='Short'; if ($mode == 5) $prefix='Short';

View File

@ -1424,14 +1424,15 @@ class Facture extends CommonInvoice
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Load all detailed lines into this->lines * Load all detailed lines into this->lines
* *
* @return int 1 if OK, < 0 if KO * @return int 1 if OK, < 0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function fetch_lines() function fetch_lines()
{ {
// phpcs:enable
$this->lines=array(); $this->lines=array();
$sql = 'SELECT l.rowid, l.fk_facture, l.fk_product, l.fk_parent_line, l.label as custom_label, l.description, l.product_type, l.price, l.qty, l.vat_src_code, l.tva_tx,'; $sql = 'SELECT l.rowid, l.fk_facture, l.fk_product, l.fk_parent_line, l.label as custom_label, l.description, l.product_type, l.price, l.qty, l.vat_src_code, l.tva_tx,';
@ -1684,15 +1685,16 @@ class Facture extends CommonInvoice
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Add a discount line into an invoice (as an invoice line) using an existing absolute discount (Consume the discount) * Add a discount line into an invoice (as an invoice line) using an existing absolute discount (Consume the discount)
* *
* @param int $idremise Id of absolute discount * @param int $idremise Id of absolute discount
* @return int >0 if OK, <0 if KO * @return int >0 if OK, <0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function insert_discount($idremise) function insert_discount($idremise)
{ {
// phpcs:enable
global $langs; global $langs;
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
@ -1785,6 +1787,7 @@ class Facture extends CommonInvoice
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set customer ref * Set customer ref
* *
@ -1792,9 +1795,9 @@ class Facture extends CommonInvoice
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function set_ref_client($ref_client, $notrigger=0) function set_ref_client($ref_client, $notrigger=0)
{ {
// phpcs:enable
global $user; global $user;
$error=0; $error=0;
@ -2019,6 +2022,7 @@ class Facture extends CommonInvoice
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Tag la facture comme paye completement (si close_code non renseigne) => this->fk_statut=2, this->paye=1 * Tag la facture comme paye completement (si close_code non renseigne) => this->fk_statut=2, this->paye=1
* ou partiellement (si close_code renseigne) + appel trigger BILL_PAYED => this->fk_statut=2, this->paye stay 0 * ou partiellement (si close_code renseigne) + appel trigger BILL_PAYED => this->fk_statut=2, this->paye stay 0
@ -2028,9 +2032,9 @@ class Facture extends CommonInvoice
* @param string $close_note Commentaire renseigne si on classe a payee alors que paiement incomplet (cas escompte par exemple) * @param string $close_note Commentaire renseigne si on classe a payee alors que paiement incomplet (cas escompte par exemple)
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function set_paid($user, $close_code='', $close_note='') function set_paid($user, $close_code='', $close_note='')
{ {
// phpcs:enable
$error=0; $error=0;
if ($this->paye != 1) if ($this->paye != 1)
@ -2078,6 +2082,7 @@ class Facture extends CommonInvoice
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Tag la facture comme non payee completement + appel trigger BILL_UNPAYED * Tag la facture comme non payee completement + appel trigger BILL_UNPAYED
* Fonction utilisee quand un paiement prelevement est refuse, * Fonction utilisee quand un paiement prelevement est refuse,
@ -2086,9 +2091,9 @@ class Facture extends CommonInvoice
* @param User $user Object user that change status * @param User $user Object user that change status
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function set_unpaid($user) function set_unpaid($user)
{ {
// phpcs:enable
$error=0; $error=0;
$this->db->begin(); $this->db->begin();
@ -2126,6 +2131,7 @@ class Facture extends CommonInvoice
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Tag invoice as canceled, with no payment on it (example for replacement invoice or payment never received) + call trigger BILL_CANCEL * Tag invoice as canceled, with no payment on it (example for replacement invoice or payment never received) + call trigger BILL_CANCEL
* Warning, if option to decrease stock on invoice was set, this function does not change stock (it might be a cancel because * Warning, if option to decrease stock on invoice was set, this function does not change stock (it might be a cancel because
@ -2136,9 +2142,9 @@ class Facture extends CommonInvoice
* @param string $close_note Comment * @param string $close_note Comment
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function set_canceled($user, $close_code='', $close_note='') function set_canceled($user, $close_code='', $close_note='')
{ {
// phpcs:enable
dol_syslog(get_class($this)."::set_canceled rowid=".$this->id, LOG_DEBUG); dol_syslog(get_class($this)."::set_canceled rowid=".$this->id, LOG_DEBUG);
@ -2490,6 +2496,7 @@ class Facture extends CommonInvoice
return true; return true;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set draft status * Set draft status
* *
@ -2497,9 +2504,9 @@ class Facture extends CommonInvoice
* @param int $idwarehouse Id warehouse to use for stock change. * @param int $idwarehouse Id warehouse to use for stock change.
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function set_draft($user,$idwarehouse=-1) function set_draft($user,$idwarehouse=-1)
{ {
// phpcs:enable
global $conf,$langs; global $conf,$langs;
$error=0; $error=0;
@ -3056,6 +3063,7 @@ class Facture extends CommonInvoice
else return $situation_percent < $obj->situation_percent; else return $situation_percent < $obj->situation_percent;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Update invoice line with percentage * Update invoice line with percentage
* *
@ -3063,9 +3071,9 @@ class Facture extends CommonInvoice
* @param int $percent Percentage * @param int $percent Percentage
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function update_percent($line, $percent) function update_percent($line, $percent)
{ {
// phpcs:enable
global $mysoc,$user; global $mysoc,$user;
include_once DOL_DOCUMENT_ROOT . '/core/lib/price.lib.php'; include_once DOL_DOCUMENT_ROOT . '/core/lib/price.lib.php';
@ -3153,6 +3161,7 @@ class Facture extends CommonInvoice
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set percent discount * Set percent discount
* *
@ -3161,9 +3170,9 @@ class Facture extends CommonInvoice
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int <0 if ko, >0 if ok * @return int <0 if ko, >0 if ok
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function set_remise($user, $remise, $notrigger=0) function set_remise($user, $remise, $notrigger=0)
{ {
// phpcs:enable
// Clean parameters // Clean parameters
if (empty($remise)) $remise=0; if (empty($remise)) $remise=0;
@ -3218,6 +3227,7 @@ class Facture extends CommonInvoice
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set absolute discount * Set absolute discount
* *
@ -3226,9 +3236,9 @@ class Facture extends CommonInvoice
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function set_remise_absolue($user, $remise, $notrigger=0) function set_remise_absolue($user, $remise, $notrigger=0)
{ {
// phpcs:enable
if (empty($remise)) $remise=0; if (empty($remise)) $remise=0;
if ($user->rights->facture->creer) if ($user->rights->facture->creer)
@ -3419,6 +3429,7 @@ class Facture extends CommonInvoice
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of invoices (eventually filtered on a user) into an array * Return list of invoices (eventually filtered on a user) into an array
* *
@ -3432,9 +3443,9 @@ class Facture extends CommonInvoice
* @param string $sortorder Sort order * @param string $sortorder Sort order
* @return int -1 if KO, array with result if OK * @return int -1 if KO, array with result if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function liste_array($shortlist=0, $draft=0, $excluser='', $socid=0, $limit=0, $offset=0, $sortfield='f.datef,f.rowid', $sortorder='DESC') function liste_array($shortlist=0, $draft=0, $excluser='', $socid=0, $limit=0, $offset=0, $sortfield='f.datef,f.rowid', $sortorder='DESC')
{ {
// phpcs:enable
global $conf,$user; global $conf,$user;
$ga = array(); $ga = array();
@ -3494,6 +3505,7 @@ class Facture extends CommonInvoice
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of invoices qualified to be replaced by another invoice. * Return list of invoices qualified to be replaced by another invoice.
* Invoices matching the following rules are returned: * Invoices matching the following rules are returned:
@ -3502,9 +3514,9 @@ class Facture extends CommonInvoice
* @param int $socid Id thirdparty * @param int $socid Id thirdparty
* @return array Array of invoices ('id'=>id, 'ref'=>ref, 'status'=>status, 'paymentornot'=>0/1) * @return array Array of invoices ('id'=>id, 'ref'=>ref, 'status'=>status, 'paymentornot'=>0/1)
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function list_replacable_invoices($socid=0) function list_replacable_invoices($socid=0)
{ {
// phpcs:enable
global $conf; global $conf;
$return = array(); $return = array();
@ -3543,6 +3555,7 @@ class Facture extends CommonInvoice
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of invoices qualified to be corrected by a credit note. * Return list of invoices qualified to be corrected by a credit note.
* Invoices matching the following rules are returned: * Invoices matching the following rules are returned:
@ -3551,9 +3564,9 @@ class Facture extends CommonInvoice
* @param int $socid Id thirdparty * @param int $socid Id thirdparty
* @return array Array of invoices ($id => array('ref'=>,'paymentornot'=>,'status'=>,'paye'=>) * @return array Array of invoices ($id => array('ref'=>,'paymentornot'=>,'status'=>,'paye'=>)
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function list_qualified_avoir_invoices($socid=0) function list_qualified_avoir_invoices($socid=0)
{ {
// phpcs:enable
global $conf; global $conf;
$return = array(); $return = array();
@ -3617,6 +3630,7 @@ class Facture extends CommonInvoice
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Create a withdrawal request for a standing order. * Create a withdrawal request for a standing order.
* Use the remain to pay excluding all existing open direct debit requests. * Use the remain to pay excluding all existing open direct debit requests.
@ -3625,9 +3639,9 @@ class Facture extends CommonInvoice
* @param float $amount Amount we request direct debit for * @param float $amount Amount we request direct debit for
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function demande_prelevement($fuser, $amount=0) function demande_prelevement($fuser, $amount=0)
{ {
// phpcs:enable
$error=0; $error=0;
@ -3728,6 +3742,7 @@ class Facture extends CommonInvoice
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Supprime une demande de prelevement * Supprime une demande de prelevement
* *
@ -3735,9 +3750,9 @@ class Facture extends CommonInvoice
* @param int $did id de la demande a supprimer * @param int $did id de la demande a supprimer
* @return int <0 if OK, >0 if KO * @return int <0 if OK, >0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function demande_prelevement_delete($fuser, $did) function demande_prelevement_delete($fuser, $did)
{ {
// phpcs:enable
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.'prelevement_facture_demande'; $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'prelevement_facture_demande';
$sql .= ' WHERE rowid = '.$did; $sql .= ' WHERE rowid = '.$did;
$sql .= ' AND traite = 0'; $sql .= ' AND traite = 0';
@ -3754,15 +3769,16 @@ class Facture extends CommonInvoice
} }
// 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 Object user * @param User $user Object 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;
$clause = " WHERE"; $clause = " WHERE";
@ -4000,14 +4016,15 @@ class Facture extends CommonInvoice
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Load indicators for dashboard (this->nbtodo and this->nbtodolate) * Load indicators for dashboard (this->nbtodo and this->nbtodolate)
* *
* @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();
@ -4114,25 +4131,27 @@ class Facture extends CommonInvoice
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Checks if the invoice is the first of a cycle * Checks if the invoice is the first of a cycle
* *
* @return boolean * @return boolean
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function is_first() function is_first()
{ {
// phpcs:enable
return ($this->situation_counter == 1); return ($this->situation_counter == 1);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Returns an array containing the previous situations as Facture objects * Returns an array containing the previous situations as Facture objects
* *
* @return mixed -1 if error, array of previous situations * @return mixed -1 if error, array of previous situations
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_prev_sits() function get_prev_sits()
{ {
// phpcs:enable
global $conf; global $conf;
$sql = 'SELECT rowid FROM ' . MAIN_DB_PREFIX . 'facture'; $sql = 'SELECT rowid FROM ' . MAIN_DB_PREFIX . 'facture';
@ -4205,15 +4224,16 @@ class Facture extends CommonInvoice
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Checks if the invoice is the last in its cycle * Checks if the invoice is the last in its cycle
* *
* @return bool Last of the cycle status * @return bool Last of the cycle status
* *
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function is_last_in_cycle() function is_last_in_cycle()
{ {
// phpcs:enable
global $conf; global $conf;
if (!empty($this->situation_cycle_ref)) { if (!empty($this->situation_cycle_ref)) {
@ -4843,15 +4863,16 @@ class FactureLigne extends CommonInvoiceLine
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Update DB line fields total_xxx * Update DB line fields total_xxx
* Used by migration * Used by migration
* *
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function update_total() function update_total()
{ {
// phpcs:enable
$this->db->begin(); $this->db->begin();
dol_syslog(get_class($this)."::update_total", LOG_DEBUG); dol_syslog(get_class($this)."::update_total", LOG_DEBUG);
@ -4884,6 +4905,7 @@ class FactureLigne extends CommonInvoiceLine
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Returns situation_percent of the previous line. * Returns situation_percent of the previous line.
* Warning: If invoice is a replacement invoice, this->fk_prev_id is id of the replaced line. * Warning: If invoice is a replacement invoice, this->fk_prev_id is id of the replaced line.
@ -4891,9 +4913,9 @@ class FactureLigne extends CommonInvoiceLine
* @param int $invoiceid Invoice id * @param int $invoiceid Invoice id
* @return int >= 0 * @return int >= 0
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_prev_progress($invoiceid) function get_prev_progress($invoiceid)
{ {
// phpcs:enable
if (is_null($this->fk_prev_id) || empty($this->fk_prev_id) || $this->fk_prev_id == "") { if (is_null($this->fk_prev_id) || empty($this->fk_prev_id) || $this->fk_prev_id == "") {
return 0; return 0;
} else { } else {

View File

@ -347,15 +347,16 @@ class Localtax extends CommonObject
return $solde; return $solde;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Total de la localtax des factures emises par la societe. * Total de la localtax des factures emises par la societe.
* *
* @param int $year Year * @param int $year Year
* @return int ??? * @return int ???
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function localtax_sum_collectee($year = 0) function localtax_sum_collectee($year = 0)
{ {
// phpcs:enable
$sql = "SELECT sum(f.localtax) as amount"; $sql = "SELECT sum(f.localtax) as amount";
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f WHERE f.paye = 1"; $sql .= " FROM ".MAIN_DB_PREFIX."facture as f WHERE f.paye = 1";
if ($year) if ($year)
@ -386,15 +387,16 @@ class Localtax extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* localtax payed * localtax payed
* *
* @param int $year Year * @param int $year Year
* @return int ??? * @return int ???
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function localtax_sum_payee($year = 0) function localtax_sum_payee($year = 0)
{ {
// phpcs:enable
$sql = "SELECT sum(f.total_localtax) as total_localtax"; $sql = "SELECT sum(f.total_localtax) as total_localtax";
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f";
@ -427,6 +429,7 @@ class Localtax extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* localtax payed * localtax payed
* Total de la localtax payed * Total de la localtax payed
@ -434,9 +437,9 @@ class Localtax extends CommonObject
* @param int $year Year * @param int $year Year
* @return int ??? * @return int ???
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function localtax_sum_reglee($year = 0) function localtax_sum_reglee($year = 0)
{ {
// phpcs:enable
$sql = "SELECT sum(f.amount) as amount"; $sql = "SELECT sum(f.amount) as amount";
$sql .= " FROM ".MAIN_DB_PREFIX."localtax as f"; $sql .= " FROM ".MAIN_DB_PREFIX."localtax as f";
@ -582,15 +585,16 @@ class Localtax extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Update the link betwen localtax payment and the line into llx_bank * Update the link betwen localtax payment and the line into llx_bank
* *
* @param int $id Id bank account * @param int $id Id bank account
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function update_fk_bank($id) function update_fk_bank($id)
{ {
// phpcs:enable
$sql = 'UPDATE '.MAIN_DB_PREFIX.'localtax SET fk_bank = '.$id; $sql = 'UPDATE '.MAIN_DB_PREFIX.'localtax SET fk_bank = '.$id;
$sql.= ' WHERE rowid = '.$this->id; $sql.= ' WHERE rowid = '.$this->id;
$result = $this->db->query($sql); $result = $this->db->query($sql);
@ -642,6 +646,7 @@ class Localtax extends CommonObject
return $this->LibStatut($this->statut,$mode); return $this->LibStatut($this->statut,$mode);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Renvoi le libelle d'un statut donne * Renvoi le libelle d'un statut donne
* *
@ -649,9 +654,9 @@ class Localtax 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 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
return ''; return '';

View File

@ -495,15 +495,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
@ -549,14 +550,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
@ -864,14 +866,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;
@ -906,6 +909,7 @@ class RemiseCheque extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set the creation date * Set the creation date
* *
@ -913,9 +917,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";
@ -941,6 +945,7 @@ class RemiseCheque extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set the ref of bordereau * Set the ref of bordereau
* *
@ -948,9 +953,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";
@ -1064,6 +1069,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
* *
@ -1071,9 +1077,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)
@ -1081,32 +1087,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

@ -708,15 +708,16 @@ class Paiement extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Mise a jour du lien entre le paiement et la ligne generee dans llx_bank * Mise a jour du lien entre le paiement et la ligne generee dans llx_bank
* *
* @param int $id_bank Id compte bancaire * @param int $id_bank Id compte bancaire
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function update_fk_bank($id_bank) function update_fk_bank($id_bank)
{ {
// phpcs:enable
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element.' set fk_bank = '.$id_bank; $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element.' set fk_bank = '.$id_bank;
$sql.= ' WHERE rowid = '.$this->id; $sql.= ' WHERE rowid = '.$this->id;
@ -734,15 +735,16 @@ class Paiement extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Updates the payment date * Updates the payment date
* *
* @param int $date New date * @param int $date New date
* @return int <0 if KO, 0 if OK * @return int <0 if KO, 0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function update_date($date) function update_date($date)
{ {
// phpcs:enable
if (!empty($date) && $this->statut!=1) if (!empty($date) && $this->statut!=1)
{ {
$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element; $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element;
@ -766,15 +768,16 @@ class Paiement extends CommonObject
return -1; //no date given or already validated return -1; //no date given or already validated
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Updates the payment number * Updates the payment number
* *
* @param string $num New num * @param string $num New num
* @return int <0 if KO, 0 if OK * @return int <0 if KO, 0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function update_num($num) function update_num($num)
{ {
// phpcs:enable
if(!empty($num) && $this->statut!=1) if(!empty($num) && $this->statut!=1)
{ {
$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element; $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element;
@ -1129,6 +1132,7 @@ class Paiement extends CommonObject
return $this->LibStatut($this->statut,$mode); return $this->LibStatut($this->statut,$mode);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Renvoi le libelle d'un statut donne * Renvoi le libelle d'un statut donne
* *
@ -1136,9 +1140,9 @@ class Paiement 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 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');
@ -1180,15 +1184,16 @@ class Paiement extends CommonObject
return ''; return '';
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Load the third party of object, from id into this->thirdparty * Load the third party of object, from id into this->thirdparty
* *
* @param int $force_thirdparty_id Force thirdparty id * @param int $force_thirdparty_id Force thirdparty id
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function fetch_thirdparty($force_thirdparty_id=0) function fetch_thirdparty($force_thirdparty_id=0)
{ {
// phpcs:enable
include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
if (empty($force_thirdparty_id)) if (empty($force_thirdparty_id))

View File

@ -49,10 +49,10 @@ class BonPrelevement extends CommonObject
*/ */
public $table_element='prelevement_bons'; public $table_element='prelevement_bons';
/** /**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/ */
public $picto = 'payment'; public $picto = 'payment';
public $date_echeance; public $date_echeance;
public $raison_sociale; public $raison_sociale;
@ -112,6 +112,7 @@ class BonPrelevement extends CommonObject
$this->fetched = 0; $this->fetched = 0;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Add invoice to withdrawal * Add invoice to withdrawal
* *
@ -125,9 +126,9 @@ class BonPrelevement extends CommonObject
* @param string $number_key number key of account number * @param string $number_key number key of account number
* @return int >0 if OK, <0 if KO * @return int >0 if OK, <0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function AddFacture($facture_id, $client_id, $client_nom, $amount, $code_banque, $code_guichet, $number, $number_key) function AddFacture($facture_id, $client_id, $client_nom, $amount, $code_banque, $code_guichet, $number, $number_key)
{ {
// phpcs:enable
$result = 0; $result = 0;
$line_id = 0; $line_id = 0;
@ -331,14 +332,15 @@ class BonPrelevement extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set credite and set status of linked invoices. Still used ?? * Set credite and set status of linked invoices. Still used ??
* *
* @return int <0 if KO, >=0 if OK * @return int <0 if KO, >=0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function set_credite() function set_credite()
{ {
// phpcs:enable
global $user,$conf; global $user,$conf;
$error = 0; $error = 0;
@ -409,6 +411,7 @@ class BonPrelevement extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set direct debit order to "credited" status. * Set direct debit order to "credited" status.
* *
@ -416,9 +419,9 @@ class BonPrelevement extends CommonObject
* @param int $date date of action * @param int $date date of action
* @return int >0 if OK, <0 if KO * @return int >0 if OK, <0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function set_infocredit($user, $date) function set_infocredit($user, $date)
{ {
// phpcs:enable
global $conf,$langs; global $conf,$langs;
$error = 0; $error = 0;
@ -556,6 +559,7 @@ class BonPrelevement extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set withdrawal to transmited status * Set withdrawal to transmited status
* *
@ -564,9 +568,9 @@ class BonPrelevement extends CommonObject
* @param string $method method of transmision to bank * @param string $method method of transmision to bank
* @return int >0 if OK, <0 if KO * @return int >0 if OK, <0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function set_infotrans($user, $date, $method) function set_infotrans($user, $date, $method)
{ {
// phpcs:enable
global $conf,$langs; global $conf,$langs;
$error = 0; $error = 0;
@ -681,14 +685,15 @@ class BonPrelevement extends CommonObject
return $arr; return $arr;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Returns amount of withdrawal * Returns amount of withdrawal
* *
* @return double Total amount * @return double Total amount
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SommeAPrelever() function SommeAPrelever()
{ {
// phpcs:enable
global $conf; global $conf;
$sql = "SELECT sum(pfd.amount) as nb"; $sql = "SELECT sum(pfd.amount) as nb";
@ -719,6 +724,7 @@ class BonPrelevement extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Get number of invoices to withdrawal * Get number of invoices to withdrawal
* TODO delete params banque and agence when not necesary * TODO delete params banque and agence when not necesary
@ -727,9 +733,9 @@ class BonPrelevement extends CommonObject
* @param int $agence dolibarr mysoc agence * @param int $agence dolibarr mysoc agence
* @return int <O if KO, number of invoices if OK * @return int <O if KO, number of invoices if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function NbFactureAPrelever($banque=0,$agence=0) function NbFactureAPrelever($banque=0,$agence=0)
{ {
// phpcs:enable
global $conf; global $conf;
$sql = "SELECT count(f.rowid) as nb"; $sql = "SELECT count(f.rowid) as nb";
@ -761,6 +767,7 @@ class BonPrelevement extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Create a withdraw * Create a withdraw
* TODO delete params banque and agence when not necesary * TODO delete params banque and agence when not necesary
@ -772,9 +779,9 @@ class BonPrelevement extends CommonObject
* @param string $executiondate Date to execute the transfer * @param string $executiondate Date to execute the transfer
* @return int <0 if KO, nbre of invoice withdrawed if OK * @return int <0 if KO, nbre of invoice withdrawed if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function Create($banque=0, $agence=0, $mode='real', $format='ALL',$executiondate='') function Create($banque=0, $agence=0, $mode='real', $format='ALL',$executiondate='')
{ {
// phpcs:enable
global $conf,$langs; global $conf,$langs;
dol_syslog(__METHOD__."::Bank=".$banque." Office=".$agence." mode=".$mode." format=".$format, LOG_DEBUG); dol_syslog(__METHOD__."::Bank=".$banque." Office=".$agence." mode=".$mode." format=".$format, LOG_DEBUG);
@ -1197,15 +1204,16 @@ class BonPrelevement extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Delete a notification def by id * Delete a notification def by id
* *
* @param int $rowid id of notification * @param int $rowid id of notification
* @return int 0 if OK, <0 if KO * @return int 0 if OK, <0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DeleteNotificationById($rowid) function DeleteNotificationById($rowid)
{ {
// phpcs:enable
$result = 0; $result = 0;
$sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def"; $sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def";
@ -1221,6 +1229,7 @@ class BonPrelevement extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Delete a notification * Delete a notification
* *
@ -1228,9 +1237,9 @@ class BonPrelevement extends CommonObject
* @param string $action notification action * @param string $action notification action
* @return int >0 if OK, <0 if KO * @return int >0 if OK, <0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DeleteNotification($user, $action) function DeleteNotification($user, $action)
{ {
// phpcs:enable
$result = 0; $result = 0;
$sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def"; $sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def";
@ -1246,6 +1255,7 @@ class BonPrelevement extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Add a notification * Add a notification
* *
@ -1254,9 +1264,9 @@ class BonPrelevement extends CommonObject
* @param string $action notification action * @param string $action notification action
* @return int 0 if OK, <0 if KO * @return int 0 if OK, <0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function AddNotification($db, $user, $action) function AddNotification($db, $user, $action)
{ {
// phpcs:enable
$result = 0; $result = 0;
if ($this->DeleteNotification($user, $action) == 0) if ($this->DeleteNotification($user, $action) == 0)
@ -1472,6 +1482,7 @@ class BonPrelevement extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Write recipient of request (customer) * Write recipient of request (customer)
* *
@ -1486,9 +1497,9 @@ class BonPrelevement extends CommonObject
* @param string $rib_dom rib domiciliation * @param string $rib_dom rib domiciliation
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function EnregDestinataire($rowid, $client_nom, $rib_banque, $rib_guichet, $rib_number, $amount, $facnumber, $facid, $rib_dom='') function EnregDestinataire($rowid, $client_nom, $rib_banque, $rib_guichet, $rib_number, $amount, $facnumber, $facid, $rib_dom='')
{ {
// phpcs:enable
fputs($this->file, "06"); fputs($this->file, "06");
fputs($this->file, "08"); // Prelevement ordinaire fputs($this->file, "08"); // Prelevement ordinaire
@ -1559,6 +1570,7 @@ class BonPrelevement extends CommonObject
return $pre.$row_code_client.'-'.$row_drum.'-'.date('U', $row_datec); return $pre.$row_code_client.'-'.$row_drum.'-'.date('U', $row_datec);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Write recipient of request (customer) * Write recipient of request (customer)
* *
@ -1580,9 +1592,9 @@ class BonPrelevement extends CommonObject
* @param string $row_drum rib.rowid used to generate rum * @param string $row_drum rib.rowid used to generate rum
* @return string Return string with SEPA part DrctDbtTxInf * @return string Return string with SEPA part DrctDbtTxInf
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function EnregDestinataireSEPA($row_code_client, $row_nom, $row_address, $row_zip, $row_town, $row_country_code, $row_cb, $row_cg, $row_cc, $row_somme, $row_facnumber, $row_idfac, $row_iban, $row_bic, $row_datec, $row_drum) function EnregDestinataireSEPA($row_code_client, $row_nom, $row_address, $row_zip, $row_town, $row_country_code, $row_cb, $row_cg, $row_cc, $row_somme, $row_facnumber, $row_idfac, $row_iban, $row_bic, $row_datec, $row_drum)
{ {
// phpcs:enable
$CrLf = "\n"; $CrLf = "\n";
$Rowing = sprintf("%06d", $row_idfac); $Rowing = sprintf("%06d", $row_idfac);
@ -1637,14 +1649,15 @@ class BonPrelevement extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Write sender of request (me) * Write sender of request (me)
* *
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function EnregEmetteur() function EnregEmetteur()
{ {
// phpcs:enable
fputs($this->file, "03"); fputs($this->file, "03");
fputs($this->file, "08"); // Prelevement ordinaire fputs($this->file, "08"); // Prelevement ordinaire
@ -1703,6 +1716,7 @@ class BonPrelevement extends CommonObject
fputs($this->file, "\n"); fputs($this->file, "\n");
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Write sender of request (me). * Write sender of request (me).
* Note: The tag PmtInf is opened here but closed into caller * Note: The tag PmtInf is opened here but closed into caller
@ -1715,9 +1729,9 @@ class BonPrelevement extends CommonObject
* @param string $format FRST or RCUR or ALL * @param string $format FRST or RCUR or ALL
* @return string String with SEPA Sender * @return string String with SEPA Sender
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function EnregEmetteurSEPA($configuration, $ladate, $nombre, $total, $CrLf='\n', $format='FRST') function EnregEmetteurSEPA($configuration, $ladate, $nombre, $total, $CrLf='\n', $format='FRST')
{ {
// phpcs:enable
// SEPA INITIALISATION // SEPA INITIALISATION
global $conf; global $conf;
@ -1825,15 +1839,16 @@ class BonPrelevement extends CommonObject
return $XML_SEPA_INFO; return $XML_SEPA_INFO;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Write end * Write end
* *
* @param int $total total amount * @param int $total total amount
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function EnregTotal($total) function EnregTotal($total)
{ {
// phpcs:enable
fputs($this->file, "08"); fputs($this->file, "08");
fputs($this->file, "08"); // Prelevement ordinaire fputs($this->file, "08"); // Prelevement ordinaire
@ -1898,6 +1913,7 @@ class BonPrelevement extends CommonObject
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
* *
@ -1905,9 +1921,9 @@ class BonPrelevement 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 Label * @return string Label
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function LibStatut($statut,$mode=0) function LibStatut($statut,$mode=0)
{ {
// phpcs:enable
if (empty($this->labelstatut)) if (empty($this->labelstatut))
{ {
global $langs; global $langs;
@ -1917,39 +1933,35 @@ class BonPrelevement extends CommonObject
$this->labelstatut[2]=$langs->trans("StatusCredited"); $this->labelstatut[2]=$langs->trans("StatusCredited");
} }
if ($mode == 0) if ($mode == 0 || $mode == 1)
{ {
return $this->labelstatut[$statut]; return $this->labelstatut[$statut];
} }
if ($mode == 1) elseif ($mode == 2)
{
return $this->labelstatut[$statut];
}
if ($mode == 2)
{ {
if ($statut==0) return img_picto($this->labelstatut[$statut],'statut1').' '.$this->labelstatut[$statut]; if ($statut==0) return img_picto($this->labelstatut[$statut],'statut1').' '.$this->labelstatut[$statut];
if ($statut==1) return img_picto($this->labelstatut[$statut],'statut3').' '.$this->labelstatut[$statut]; if ($statut==1) return img_picto($this->labelstatut[$statut],'statut3').' '.$this->labelstatut[$statut];
if ($statut==2) return img_picto($this->labelstatut[$statut],'statut6').' '.$this->labelstatut[$statut]; if ($statut==2) return img_picto($this->labelstatut[$statut],'statut6').' '.$this->labelstatut[$statut];
} }
if ($mode == 3) elseif ($mode == 3)
{ {
if ($statut==0) return img_picto($this->labelstatut[$statut],'statut1'); if ($statut==0) return img_picto($this->labelstatut[$statut],'statut1');
if ($statut==1) return img_picto($this->labelstatut[$statut],'statut3'); if ($statut==1) return img_picto($this->labelstatut[$statut],'statut3');
if ($statut==2) return img_picto($this->labelstatut[$statut],'statut6'); if ($statut==2) return img_picto($this->labelstatut[$statut],'statut6');
} }
if ($mode == 4) elseif ($mode == 4)
{ {
if ($statut==0) return img_picto($this->labelstatut[$statut],'statut1').' '.$this->labelstatut[$statut]; if ($statut==0) return img_picto($this->labelstatut[$statut],'statut1').' '.$this->labelstatut[$statut];
if ($statut==1) return img_picto($this->labelstatut[$statut],'statut3').' '.$this->labelstatut[$statut]; if ($statut==1) return img_picto($this->labelstatut[$statut],'statut3').' '.$this->labelstatut[$statut];
if ($statut==2) return img_picto($this->labelstatut[$statut],'statut6').' '.$this->labelstatut[$statut]; if ($statut==2) return img_picto($this->labelstatut[$statut],'statut6').' '.$this->labelstatut[$statut];
} }
if ($mode == 5) elseif ($mode == 5)
{ {
if ($statut==0) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut],'statut1'); if ($statut==0) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut],'statut1');
if ($statut==1) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut],'statut3'); if ($statut==1) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut],'statut3');
if ($statut==2) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut],'statut6'); if ($statut==2) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut],'statut6');
} }
if ($mode == 6) elseif ($mode == 6)
{ {
if ($statut==0) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut],'statut1'); if ($statut==0) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut],'statut1');
if ($statut==1) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut],'statut3'); if ($statut==1) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut],'statut3');

View File

@ -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

@ -199,15 +199,16 @@ class RejetPrelevement
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Send email to all users that has asked the withdraw request * Send email to all users that has asked the withdraw request
* *
* @param Facture $fac Invoice object * @param Facture $fac Invoice object
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function _send_email($fac) function _send_email($fac)
{ {
// phpcs:enable
global $langs; global $langs;
$userid = 0; $userid = 0;

View File

@ -494,15 +494,16 @@ class PaymentSalary extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Update link between payment salary and line generate into llx_bank * Update link between payment salary and line generate into llx_bank
* *
* @param int $id_bank Id bank account * @param int $id_bank Id bank account
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function update_fk_bank($id_bank) function update_fk_bank($id_bank)
{ {
// phpcs:enable
$sql = 'UPDATE '.MAIN_DB_PREFIX.'payment_salary SET fk_bank = '.$id_bank; $sql = 'UPDATE '.MAIN_DB_PREFIX.'payment_salary SET fk_bank = '.$id_bank;
$sql.= ' WHERE rowid = '.$this->id; $sql.= ' WHERE rowid = '.$this->id;
$result = $this->db->query($sql); $result = $this->db->query($sql);
@ -592,6 +593,7 @@ class PaymentSalary extends CommonObject
return $this->LibStatut($this->statut,$mode); return $this->LibStatut($this->statut,$mode);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Renvoi le libelle d'un statut donne * Renvoi le libelle d'un statut donne
* *
@ -599,9 +601,9 @@ class PaymentSalary 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 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');

View File

@ -461,6 +461,7 @@ class Cchargesociales
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
* *
@ -468,9 +469,9 @@ class Cchargesociales
* @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)

View File

@ -45,9 +45,9 @@ class ChargeSociales extends CommonObject
public $table_element='chargesociales'; public $table_element='chargesociales';
/** /**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/ */
public $picto = 'bill'; public $picto = 'bill';
/** /**
* {@inheritdoc} * {@inheritdoc}
@ -370,15 +370,16 @@ class ChargeSociales extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Tag social contribution as payed completely * Tag social contribution as payed completely
* *
* @param User $user Object user making change * @param User $user Object user making change
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function set_paid($user) function set_paid($user)
{ {
// phpcs:enable
$sql = "UPDATE ".MAIN_DB_PREFIX."chargesociales SET"; $sql = "UPDATE ".MAIN_DB_PREFIX."chargesociales SET";
$sql.= " paye = 1"; $sql.= " paye = 1";
$sql.= " WHERE rowid = ".$this->id; $sql.= " WHERE rowid = ".$this->id;
@ -386,15 +387,17 @@ class ChargeSociales extends CommonObject
if ($return) return 1; if ($return) return 1;
else return -1; else return -1;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Remove tag payed on social contribution * Remove tag payed on social contribution
* *
* @param User $user Object user making change * @param User $user Object user making change
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function set_unpaid($user) function set_unpaid($user)
{ {
// phpcs:enable
$sql = "UPDATE ".MAIN_DB_PREFIX."chargesociales SET"; $sql = "UPDATE ".MAIN_DB_PREFIX."chargesociales SET";
$sql.= " paye = 0"; $sql.= " paye = 0";
$sql.= " WHERE rowid = ".$this->id; $sql.= " WHERE rowid = ".$this->id;
@ -415,6 +418,7 @@ class ChargeSociales extends CommonObject
return $this->LibStatut($this->paye,$mode,$alreadypaid); return $this->LibStatut($this->paye,$mode,$alreadypaid);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Renvoi le libelle d'un statut donne * Renvoi le libelle d'un statut donne
* *
@ -423,55 +427,50 @@ class ChargeSociales extends CommonObject
* @param double $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise) * @param double $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise)
* @return string Label * @return string Label
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function LibStatut($statut,$mode=0,$alreadypaid=-1) function LibStatut($statut,$mode=0,$alreadypaid=-1)
{ {
// phpcs:enable
global $langs; global $langs;
$langs->load('customers'); $langs->load('customers');
$langs->load('bills'); $langs->load('bills');
if ($mode == 0) if ($mode == 0 || $mode == 1)
{ {
if ($statut == 0) return $langs->trans("Unpaid"); if ($statut == 0) return $langs->trans("Unpaid");
if ($statut == 1) return $langs->trans("Paid"); if ($statut == 1) return $langs->trans("Paid");
} }
if ($mode == 1) elseif ($mode == 2)
{
if ($statut == 0) return $langs->trans("Unpaid");
if ($statut == 1) return $langs->trans("Paid");
}
if ($mode == 2)
{ {
if ($statut == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1').' '.$langs->trans("Unpaid"); if ($statut == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1').' '.$langs->trans("Unpaid");
if ($statut == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3').' '.$langs->trans("BillStatusStarted"); if ($statut == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3').' '.$langs->trans("BillStatusStarted");
if ($statut == 1) return img_picto($langs->trans("Paid"), 'statut6').' '.$langs->trans("Paid"); if ($statut == 1) return img_picto($langs->trans("Paid"), 'statut6').' '.$langs->trans("Paid");
} }
if ($mode == 3) elseif ($mode == 3)
{ {
if ($statut == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1'); if ($statut == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1');
if ($statut == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3'); if ($statut == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3');
if ($statut == 1) return img_picto($langs->trans("Paid"), 'statut6'); if ($statut == 1) return img_picto($langs->trans("Paid"), 'statut6');
} }
if ($mode == 4) elseif ($mode == 4)
{ {
if ($statut == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1').' '.$langs->trans("Unpaid"); if ($statut == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1').' '.$langs->trans("Unpaid");
if ($statut == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3').' '.$langs->trans("BillStatusStarted"); if ($statut == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3').' '.$langs->trans("BillStatusStarted");
if ($statut == 1) return img_picto($langs->trans("Paid"), 'statut6').' '.$langs->trans("Paid"); if ($statut == 1) return img_picto($langs->trans("Paid"), 'statut6').' '.$langs->trans("Paid");
} }
if ($mode == 5) elseif ($mode == 5)
{ {
if ($statut == 0 && $alreadypaid <= 0) return $langs->trans("Unpaid").' '.img_picto($langs->trans("Unpaid"), 'statut1'); if ($statut == 0 && $alreadypaid <= 0) return $langs->trans("Unpaid").' '.img_picto($langs->trans("Unpaid"), 'statut1');
if ($statut == 0 && $alreadypaid > 0) return $langs->trans("BillStatusStarted").' '.img_picto($langs->trans("BillStatusStarted"), 'statut3'); if ($statut == 0 && $alreadypaid > 0) return $langs->trans("BillStatusStarted").' '.img_picto($langs->trans("BillStatusStarted"), 'statut3');
if ($statut == 1) return $langs->trans("Paid").' '.img_picto($langs->trans("Paid"), 'statut6'); if ($statut == 1) return $langs->trans("Paid").' '.img_picto($langs->trans("Paid"), 'statut6');
} }
if ($mode == 6) elseif ($mode == 6)
{ {
if ($statut == 0 && $alreadypaid <= 0) return $langs->trans("Unpaid").' '.img_picto($langs->trans("Unpaid"), 'statut1'); if ($statut == 0 && $alreadypaid <= 0) return $langs->trans("Unpaid").' '.img_picto($langs->trans("Unpaid"), 'statut1');
if ($statut == 0 && $alreadypaid > 0) return $langs->trans("BillStatusStarted").' '.img_picto($langs->trans("BillStatusStarted"), 'statut3'); if ($statut == 0 && $alreadypaid > 0) return $langs->trans("BillStatusStarted").' '.img_picto($langs->trans("BillStatusStarted"), 'statut3');
if ($statut == 1) return $langs->trans("Paid").' '.img_picto($langs->trans("Paid"), 'statut6'); if ($statut == 1) return $langs->trans("Paid").' '.img_picto($langs->trans("Paid"), 'statut6');
} }
return "Error, mode/status not found"; else return "Error, mode/status not found";
} }

View File

@ -605,15 +605,16 @@ class PaymentSocialContribution extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Mise a jour du lien entre le paiement de charge et la ligne dans llx_bank generee * Mise a jour du lien entre le paiement de charge et la ligne dans llx_bank generee
* *
* @param int $id_bank Id if bank * @param int $id_bank Id if bank
* @return int >0 if OK, <=0 if KO * @return int >0 if OK, <=0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function update_fk_bank($id_bank) function update_fk_bank($id_bank)
{ {
// phpcs:enable
$sql = "UPDATE ".MAIN_DB_PREFIX."paiementcharge SET fk_bank = ".$id_bank." WHERE rowid = ".$this->id; $sql = "UPDATE ".MAIN_DB_PREFIX."paiementcharge SET fk_bank = ".$id_bank." WHERE rowid = ".$this->id;
dol_syslog(get_class($this)."::update_fk_bank", LOG_DEBUG); dol_syslog(get_class($this)."::update_fk_bank", LOG_DEBUG);
@ -641,6 +642,7 @@ class PaymentSocialContribution extends CommonObject
return $this->LibStatut($this->statut,$mode); return $this->LibStatut($this->statut,$mode);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Renvoi le libelle d'un statut donne * Renvoi le libelle d'un statut donne
* *
@ -648,9 +650,9 @@ class PaymentSocialContribution 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 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');

View File

@ -366,15 +366,16 @@ class Tva extends CommonObject
return $solde; return $solde;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Total of the VAT from invoices emitted by the thirdparty. * Total of the VAT from invoices emitted by the thirdparty.
* *
* @param int $year Year * @param int $year Year
* @return double Amount * @return double Amount
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function tva_sum_collectee($year = 0) function tva_sum_collectee($year = 0)
{ {
// phpcs:enable
$sql = "SELECT sum(f.tva) as amount"; $sql = "SELECT sum(f.tva) as amount";
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f WHERE f.paye = 1"; $sql .= " FROM ".MAIN_DB_PREFIX."facture as f WHERE f.paye = 1";
@ -406,15 +407,16 @@ class Tva extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* VAT payed * VAT payed
* *
* @param int $year Year * @param int $year Year
* @return double Amount * @return double Amount
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function tva_sum_payee($year = 0) function tva_sum_payee($year = 0)
{ {
// phpcs:enable
$sql = "SELECT sum(f.total_tva) as total_tva"; $sql = "SELECT sum(f.total_tva) as total_tva";
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f";
@ -447,15 +449,16 @@ class Tva extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Total of the VAT payed * Total of the VAT payed
* *
* @param int $year Year * @param int $year Year
* @return double Amount * @return double Amount
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function tva_sum_reglee($year = 0) function tva_sum_reglee($year = 0)
{ {
// phpcs:enable
$sql = "SELECT sum(f.amount) as amount"; $sql = "SELECT sum(f.amount) as amount";
$sql .= " FROM ".MAIN_DB_PREFIX."tva as f"; $sql .= " FROM ".MAIN_DB_PREFIX."tva as f";
@ -639,15 +642,16 @@ class Tva extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Update link between payment tva and line generate into llx_bank * Update link between payment tva and line generate into llx_bank
* *
* @param int $id_bank Id bank account * @param int $id_bank Id bank account
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function update_fk_bank($id_bank) function update_fk_bank($id_bank)
{ {
// phpcs:enable
$sql = 'UPDATE '.MAIN_DB_PREFIX.'tva SET fk_bank = '.$id_bank; $sql = 'UPDATE '.MAIN_DB_PREFIX.'tva SET fk_bank = '.$id_bank;
$sql.= ' WHERE rowid = '.$this->id; $sql.= ' WHERE rowid = '.$this->id;
$result = $this->db->query($sql); $result = $this->db->query($sql);
@ -803,6 +807,7 @@ class Tva extends CommonObject
return $this->LibStatut($this->statut,$mode); return $this->LibStatut($this->statut,$mode);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Renvoi le libelle d'un statut donne * Renvoi le libelle d'un statut donne
* *
@ -810,9 +815,9 @@ class Tva 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 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
return ''; return '';

View File

@ -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

@ -29,8 +29,8 @@ include_once DOL_DOCUMENT_ROOT.'/contact/canvas/actions_contactcard_common.class
*/ */
class ActionsContactCardDefault extends ActionsContactCardCommon class ActionsContactCardDefault extends ActionsContactCardCommon
{ {
/** /**
* Constructor * Constructor
* *
* @param DoliDB $db Handler acces base de donnees * @param DoliDB $db Handler acces base de donnees
* @param string $dirmodule Name of directory of module * @param string $dirmodule Name of directory of module
@ -66,6 +66,7 @@ class ActionsContactCardDefault extends ActionsContactCardCommon
return $out; return $out;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Assign custom values for canvas * Assign custom values for canvas
* *
@ -73,9 +74,9 @@ class ActionsContactCardDefault extends ActionsContactCardCommon
* @param int $id Id * @param int $id Id
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function assign_values(&$action, $id) function assign_values(&$action, $id)
{ {
// phpcs:enable
global $limit, $offset, $sortfield, $sortorder; global $limit, $offset, $sortfield, $sortorder;
global $conf, $db, $langs, $user; global $conf, $db, $langs, $user;
global $form; global $form;
@ -120,6 +121,7 @@ class ActionsContactCardDefault extends ActionsContactCardCommon
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Fetch datas list and save into ->list_datas * Fetch datas list and save into ->list_datas
* *
@ -129,9 +131,9 @@ class ActionsContactCardDefault extends ActionsContactCardCommon
* @param string $sortorder Sort order ('ASC' or 'DESC') * @param string $sortorder Sort order ('ASC' or 'DESC')
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function LoadListDatas($limit, $offset, $sortfield, $sortorder) function LoadListDatas($limit, $offset, $sortfield, $sortorder)
{ {
// phpcs:enable
global $conf, $langs; global $conf, $langs;
//$this->getFieldList(); //$this->getFieldList();

View File

@ -135,9 +135,6 @@ class Contact extends CommonObject
public $oldcopy; // To contains a clone of this when we need to save old properties of object public $oldcopy; // To contains a clone of this when we need to save old properties of object
/** /**
* Constructor * Constructor
* *
@ -149,14 +146,15 @@ class Contact extends CommonObject
$this->statut = 1; // By default, status is enabled $this->statut = 1; // By default, status is enabled
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Load indicators into this->nb for board * Load indicators into this->nb for board
* *
* @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;
$this->nb=array(); $this->nb=array();
@ -479,6 +477,7 @@ class Contact extends CommonObject
} }
// 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
* *
@ -488,9 +487,9 @@ class Contact 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_CONTACTS."=".$info[$conf->global->LDAP_KEY_CONTACTS].",".$conf->global->LDAP_CONTACT_DN; if ($mode==0) $dn=$conf->global->LDAP_KEY_CONTACTS."=".$info[$conf->global->LDAP_KEY_CONTACTS].",".$conf->global->LDAP_CONTACT_DN;
@ -500,14 +499,15 @@ class Contact extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Initialise tableau info (tableau des attributs LDAP) * Initialise tableau info (tableau des attributs LDAP)
* *
* @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();
@ -574,6 +574,7 @@ class Contact extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Update field alert birthday * Update field alert birthday
* *
@ -582,9 +583,9 @@ class Contact extends CommonObject
* @param int $notrigger 0=no, 1=yes * @param int $notrigger 0=no, 1=yes
* @return int <0 if KO, >=0 if OK * @return int <0 if KO, >=0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function update_perso($id, $user=null, $notrigger=0) function update_perso($id, $user=null, $notrigger=0)
{ {
// phpcs:enable
$error=0; $error=0;
$result=false; $result=false;
@ -856,6 +857,7 @@ class Contact extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Load number of elements the contact is used as a link for * Load number of elements the contact is used as a link for
* ref_facturation * ref_facturation
@ -865,9 +867,9 @@ class Contact extends CommonObject
* *
* @return int <0 if KO, >=0 if OK * @return int <0 if KO, >=0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function load_ref_elements() function load_ref_elements()
{ {
// phpcs:enable
// Compte les elements pour lesquels il est contact // Compte les elements pour lesquels il est contact
$sql ="SELECT tc.element, count(ec.rowid) as nb"; $sql ="SELECT tc.element, count(ec.rowid) as nb";
$sql.=" FROM ".MAIN_DB_PREFIX."element_contact as ec, ".MAIN_DB_PREFIX."c_type_contact as tc"; $sql.=" FROM ".MAIN_DB_PREFIX."element_contact as ec, ".MAIN_DB_PREFIX."c_type_contact as tc";
@ -1198,6 +1200,7 @@ class Contact extends CommonObject
return $this->LibStatut($this->statut,$mode); return $this->LibStatut($this->statut,$mode);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Renvoi le libelle d'un statut donne * Renvoi le libelle d'un statut donne
* *
@ -1205,9 +1208,9 @@ class Contact 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 Libelle * @return string Libelle
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function LibStatut($statut,$mode) function LibStatut($statut,$mode)
{ {
// phpcs:enable
global $langs; global $langs;
if ($mode == 0) if ($mode == 0)
@ -1244,15 +1247,16 @@ class Contact extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return translated label of Public or Private * Return translated label of Public or Private
* *
* @param int $statut Type (0 = public, 1 = private) * @param int $statut Type (0 = public, 1 = private)
* @return string Label translated * @return string Label translated
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function LibPubPriv($statut) function LibPubPriv($statut)
{ {
// phpcs:enable
global $langs; global $langs;
if ($statut=='1') return $langs->trans('ContactPrivate'); if ($statut=='1') return $langs->trans('ContactPrivate');
else return $langs->trans('ContactPublic'); else return $langs->trans('ContactPublic');

View File

@ -249,6 +249,7 @@ class Contrat extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Activate a contract line * Activate a contract line
* *
@ -259,9 +260,9 @@ class Contrat extends CommonObject
* @param string $comment A comment typed by user * @param string $comment A comment typed by user
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function active_line($user, $line_id, $date, $date_end='', $comment='') function active_line($user, $line_id, $date, $date_end='', $comment='')
{ {
// phpcs:enable
$result = $this->lines[$this->lines_id_index_mapper[$line_id]]->active_line($user, $date, $date_end, $comment); $result = $this->lines[$this->lines_id_index_mapper[$line_id]]->active_line($user, $date, $date_end, $comment);
if ($result < 0) if ($result < 0)
{ {
@ -272,6 +273,7 @@ class Contrat extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Close a contract line * Close a contract line
* *
@ -281,9 +283,9 @@ class Contrat extends CommonObject
* @param string $comment A comment typed by user * @param string $comment A comment typed by user
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function close_line($user, $line_id, $date_end, $comment='') function close_line($user, $line_id, $date_end, $comment='')
{ {
// phpcs:enable
$result=$this->lines[$this->lines_id_index_mapper[$line_id]]->close_line($user, $date_end, $comment); $result=$this->lines[$this->lines_id_index_mapper[$line_id]]->close_line($user, $date_end, $comment);
if ($result < 0) if ($result < 0)
{ {
@ -715,15 +717,16 @@ class Contrat extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Load lines array into this->lines. * Load lines array into this->lines.
* This set also nbofserviceswait, nbofservicesopened, nbofservicesexpired and nbofservicesclosed * This set also nbofserviceswait, nbofservicesopened, nbofservicesexpired and nbofservicesclosed
* *
* @return ContratLigne[] Return array of contract lines * @return ContratLigne[] Return array of contract lines
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function fetch_lines() function fetch_lines()
{ {
// phpcs:enable
$this->nbofserviceswait=0; $this->nbofserviceswait=0;
$this->nbofservicesopened=0; $this->nbofservicesopened=0;
$this->nbofservicesexpired=0; $this->nbofservicesexpired=0;
@ -1793,6 +1796,7 @@ class Contrat extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Update statut of contract according to services * Update statut of contract according to services
* *
@ -1800,9 +1804,9 @@ class Contrat extends CommonObject
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
* @deprecated This function will never be used. Status of a contract is status of its lines. * @deprecated This function will never be used. Status of a contract is status of its lines.
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function update_statut($user) function update_statut($user)
{ {
// phpcs:enable
dol_syslog(__METHOD__ . " is deprecated", LOG_WARNING); dol_syslog(__METHOD__ . " is deprecated", LOG_WARNING);
// If draft, we keep it (should not happen) // If draft, we keep it (should not happen)
@ -1832,6 +1836,7 @@ class Contrat extends CommonObject
return $this->LibStatut($this->statut,$mode); return $this->LibStatut($this->statut,$mode);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Renvoi label of a given contrat status * Renvoi label of a given contrat status
* *
@ -1839,9 +1844,9 @@ class Contrat extends CommonObject
* @param int $mode 0=Long label, 1=Short label, 2=Picto + Libelle court, 3=Picto, 4=Picto + Long label of all services, 5=Libelle court + Picto, 6=Picto of all services, 7=Same than 6 with fixed length * @param int $mode 0=Long label, 1=Short label, 2=Picto + Libelle court, 3=Picto, 4=Picto + Long label of all services, 5=Libelle court + Picto, 6=Picto of all services, 7=Same than 6 with fixed length
* @return string Label * @return string Label
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function LibStatut($statut,$mode) function LibStatut($statut,$mode)
{ {
// phpcs:enable
global $langs; global $langs;
$langs->load("contracts"); $langs->load("contracts");
if ($mode == 0) if ($mode == 0)
@ -2015,15 +2020,16 @@ class Contrat extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of line rowid * Return list of line rowid
* *
* @param int $statut Status of lines to get * @param int $statut Status of lines to get
* @return array Array of line's rowid * @return array Array of line's rowid
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function array_detail($statut=-1) function array_detail($statut=-1)
{ {
// phpcs:enable
$tab=array(); $tab=array();
$sql = "SELECT cd.rowid"; $sql = "SELECT cd.rowid";
@ -2091,6 +2097,7 @@ class Contrat 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)
* *
@ -2098,9 +2105,9 @@ class Contrat extends CommonObject
* @param string $mode "inactive" pour services a activer, "expired" pour services expires * @param string $mode "inactive" pour services a activer, "expired" pour services expires
* @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,$mode) function load_board($user,$mode)
{ {
// phpcs:enable
global $conf, $langs; global $conf, $langs;
$this->from = " FROM ".MAIN_DB_PREFIX."contrat as c"; $this->from = " FROM ".MAIN_DB_PREFIX."contrat as c";
@ -2170,14 +2177,15 @@ class Contrat 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 si ko, >0 si ok * @return int <0 si ko, >0 si 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();
@ -2602,6 +2610,7 @@ class ContratLigne extends CommonObjectLine
return $this->LibStatut($this->statut,$mode,((! empty($this->date_fin_validite))?($this->date_fin_validite < dol_now()?1:0):-1)); return $this->LibStatut($this->statut,$mode,((! empty($this->date_fin_validite))?($this->date_fin_validite < dol_now()?1:0):-1));
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return label of a contract line status * Return label of a contract line status
* *
@ -2611,9 +2620,9 @@ class ContratLigne extends CommonObjectLine
* @param string $moreatt More attribute * @param string $moreatt More attribute
* @return string Libelle * @return string Libelle
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
static function LibStatut($statut,$mode,$expired=-1,$moreatt='') static function LibStatut($statut,$mode,$expired=-1,$moreatt='')
{ {
// phpcs:enable
global $langs; global $langs;
$langs->load("contracts"); $langs->load("contracts");
if ($mode == 0) if ($mode == 0)
@ -3025,15 +3034,16 @@ class ContratLigne extends CommonObjectLine
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Mise a jour en base des champs total_xxx de ligne * Mise a jour en base des champs total_xxx de ligne
* Used by migration process * Used by migration process
* *
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function update_total() function update_total()
{ {
// phpcs:enable
$this->db->begin(); $this->db->begin();
// Mise a jour ligne en base // Mise a jour ligne en base
@ -3142,6 +3152,7 @@ class ContratLigne extends CommonObjectLine
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Activate a contract line * Activate a contract line
* *
@ -3151,9 +3162,9 @@ class ContratLigne extends CommonObjectLine
* @param string $comment A comment typed by user * @param string $comment A comment typed by user
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function active_line($user, $date, $date_end = '', $comment = '') function active_line($user, $date, $date_end = '', $comment = '')
{ {
// phpcs:enable
global $langs, $conf; global $langs, $conf;
$error = 0; $error = 0;
@ -3200,6 +3211,7 @@ class ContratLigne extends CommonObjectLine
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Close a contract line * Close a contract line
* *
@ -3209,9 +3221,9 @@ class ContratLigne extends CommonObjectLine
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function close_line($user, $date_end, $comment = '', $notrigger=0) function close_line($user, $date_end, $comment = '', $notrigger=0)
{ {
// phpcs:enable
global $langs, $conf; global $langs, $conf;
// Update object // Update object

View File

@ -827,15 +827,16 @@ class CMailFile
return '=?'.$conf->file->character_set_client.'?B?'.base64_encode($stringtoencode).'?='; return '=?'.$conf->file->character_set_client.'?B?'.base64_encode($stringtoencode).'?=';
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Read a file on disk and return encoded content for emails (mode = 'mail') * Read a file on disk and return encoded content for emails (mode = 'mail')
* *
* @param string $sourcefile Path to file to encode * @param string $sourcefile Path to file to encode
* @return int <0 if KO, encoded string if OK * @return int <0 if KO, encoded string if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function _encode_file($sourcefile) function _encode_file($sourcefile)
{ {
// phpcs:enable
$newsourcefile=dol_osencode($sourcefile); $newsourcefile=dol_osencode($sourcefile);
if (is_readable($newsourcefile)) if (is_readable($newsourcefile))
@ -853,6 +854,7 @@ class CMailFile
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Write content of a SMTP request into a dump file (mode = all) * Write content of a SMTP request into a dump file (mode = all)
* Used for debugging. * Used for debugging.
@ -860,9 +862,9 @@ class CMailFile
* *
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function dump_mail() function dump_mail()
{ {
// phpcs:enable
global $conf,$dolibarr_main_data_root; global $conf,$dolibarr_main_data_root;
if (@is_writeable($dolibarr_main_data_root)) // Avoid fatal error on fopen with open_basedir if (@is_writeable($dolibarr_main_data_root)) // Avoid fatal error on fopen with open_basedir
@ -947,14 +949,15 @@ class CMailFile
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Create SMTP headers (mode = 'mail') * Create SMTP headers (mode = 'mail')
* *
* @return string headers * @return string headers
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function write_smtpheaders() function write_smtpheaders()
{ {
// phpcs:enable
global $conf; global $conf;
$out = ""; $out = "";
@ -1010,6 +1013,7 @@ class CMailFile
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Create header MIME (mode = 'mail') * Create header MIME (mode = 'mail')
* *
@ -1017,9 +1021,9 @@ class CMailFile
* @param array $mimefilename_list Array of mime types * @param array $mimefilename_list Array of mime types
* @return string mime headers * @return string mime headers
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function write_mimeheaders($filename_list, $mimefilename_list) function write_mimeheaders($filename_list, $mimefilename_list)
{ {
// phpcs:enable
$mimedone=0; $mimedone=0;
$out = ""; $out = "";
@ -1040,15 +1044,16 @@ class CMailFile
return $out; return $out;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return email content (mode = 'mail') * Return email content (mode = 'mail')
* *
* @param string $msgtext Message string * @param string $msgtext Message string
* @return string String content * @return string String content
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function write_body($msgtext) function write_body($msgtext)
{ {
// phpcs:enable
global $conf; global $conf;
$out=''; $out='';
@ -1141,6 +1146,7 @@ class CMailFile
return $out; return $out;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Attach file to email (mode = 'mail') * Attach file to email (mode = 'mail')
* *
@ -1149,9 +1155,9 @@ class CMailFile
* @param array $mimefilename_list Tableau * @param array $mimefilename_list Tableau
* @return string Chaine fichiers encodes * @return string Chaine fichiers encodes
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function write_files($filename_list,$mimetype_list,$mimefilename_list) function write_files($filename_list,$mimetype_list,$mimefilename_list)
{ {
// phpcs:enable
$out = ''; $out = '';
$filename_list_size=count($filename_list); $filename_list_size=count($filename_list);
@ -1189,15 +1195,16 @@ class CMailFile
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Attach an image to email (mode = 'mail') * Attach an image to email (mode = 'mail')
* *
* @param array $images_list Tableau * @param array $images_list Tableau
* @return string Chaine images encodees * @return string Chaine images encodees
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function write_images($images_list) function write_images($images_list)
{ {
// phpcs:enable
$out = ''; $out = '';
if ($images_list) if ($images_list)
@ -1221,6 +1228,7 @@ class CMailFile
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Try to create a socket connection * Try to create a socket connection
* *
@ -1228,9 +1236,9 @@ class CMailFile
* @param int $port Example: 25, 465 * @param int $port Example: 25, 465
* @return int Socket id if ok, 0 if KO * @return int Socket id if ok, 0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function check_server_port($host,$port) function check_server_port($host,$port)
{ {
// phpcs:enable
global $conf; global $conf;
$_retVal=0; $_retVal=0;
@ -1285,6 +1293,7 @@ class CMailFile
return $_retVal; return $_retVal;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* This function has been modified as provided by SirSir to allow multiline responses when * This function has been modified as provided by SirSir to allow multiline responses when
* using SMTP Extensions. * using SMTP Extensions.
@ -1293,9 +1302,9 @@ class CMailFile
* @param string $response Response string * @param string $response Response string
* @return boolean true if success * @return boolean true if success
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function server_parse($socket, $response) function server_parse($socket, $response)
{ {
// phpcs:enable
$_retVal = true; // Indicates if Object was created or not $_retVal = true; // Indicates if Object was created or not
$server_response = ''; $server_response = '';

View File

@ -192,15 +192,16 @@ class CSMSFile
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Write content of a SendSms request into a dump file (mode = all) * Write content of a SendSms request into a dump file (mode = all)
* Used for debugging. * Used for debugging.
* *
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function dump_sms() function dump_sms()
{ {
// phpcs:enable
global $conf,$dolibarr_main_data_root; global $conf,$dolibarr_main_data_root;
if (@is_writeable($dolibarr_main_data_root)) // Avoid fatal error on fopen with open_basedir if (@is_writeable($dolibarr_main_data_root)) // Avoid fatal error on fopen with open_basedir
@ -222,6 +223,7 @@ class CSMSFile
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Write content of a SendSms result into a dump file (mode = all) * Write content of a SendSms result into a dump file (mode = all)
* Used for debugging. * Used for debugging.
@ -229,9 +231,9 @@ class CSMSFile
* @param int $result Result of sms sending * @param int $result Result of sms sending
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function dump_sms_result($result) function dump_sms_result($result)
{ {
// phpcs:enable
global $conf,$dolibarr_main_data_root; global $conf,$dolibarr_main_data_root;
if (@is_writeable($dolibarr_main_data_root)) // Avoid fatal error on fopen with open_basedir if (@is_writeable($dolibarr_main_data_root)) // Avoid fatal error on fopen with open_basedir

View File

@ -57,6 +57,7 @@ class AntiVir
$this->db=$db; $this->db=$db;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Scan a file with antivirus. * Scan a file with antivirus.
* This function runs the command defined in setup. This antivirus command must return 0 if OK. * This function runs the command defined in setup. This antivirus command must return 0 if OK.
@ -65,9 +66,9 @@ class AntiVir
* @param string $file File to scan * @param string $file File to scan
* @return int <0 if KO (-98 if error, -99 if virus), 0 if OK * @return int <0 if KO (-98 if error, -99 if virus), 0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function dol_avscan_file($file) function dol_avscan_file($file)
{ {
// phpcs:enable
global $conf; global $conf;
$return = 0; $return = 0;

View File

@ -133,6 +133,7 @@ class Canvas
//print ' => template_dir='.$this->template_dir.'<br>'; //print ' => template_dir='.$this->template_dir.'<br>';
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Shared method for canvas to assign values for templates * Shared method for canvas to assign values for templates
* *
@ -141,9 +142,9 @@ class Canvas
* @param string $ref Object ref (if id not provided) * @param string $ref Object ref (if id not provided)
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function assign_values(&$action='view', $id=0, $ref='') function assign_values(&$action='view', $id=0, $ref='')
{ {
// phpcs:enable
if (method_exists($this->control,'assign_values')) $this->control->assign_values($action, $id, $ref); if (method_exists($this->control,'assign_values')) $this->control->assign_values($action, $id, $ref);
} }
@ -161,6 +162,7 @@ class Canvas
else return 0; else return 0;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Display a canvas page. This will include the template for output. * Display a canvas page. This will include the template for output.
* Variables used by templates may have been defined or loaded before into the assign_values function. * Variables used by templates may have been defined or loaded before into the assign_values function.
@ -168,9 +170,9 @@ class Canvas
* @param string $action Action code * @param string $action Action code
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function display_canvas($action) function display_canvas($action)
{ {
// phpcs:enable
global $db, $conf, $langs, $user, $canvas; global $db, $conf, $langs, $user, $canvas;
global $form, $formfile; global $form, $formfile;

View File

@ -48,6 +48,7 @@ abstract class CommonDocGenerator
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Define array with couple subtitution key => subtitution value * Define array with couple subtitution key => subtitution value
* *
@ -55,9 +56,9 @@ abstract class CommonDocGenerator
* @param Translate $outputlangs Language object for output * @param Translate $outputlangs Language object for output
* @return array Array of substitution key->code * @return array Array of substitution key->code
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_substitutionarray_user($user,$outputlangs) function get_substitutionarray_user($user,$outputlangs)
{ {
// phpcs:enable
global $conf; global $conf;
$logotouse=$conf->user->dir_output.'/'.get_exdir($user->id, 2, 0, 1, $user, 'user').'/'.$user->photo; $logotouse=$conf->user->dir_output.'/'.get_exdir($user->id, 2, 0, 1, $user, 'user').'/'.$user->photo;
@ -85,6 +86,7 @@ abstract class CommonDocGenerator
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Define array with couple subtitution key => subtitution value * Define array with couple subtitution key => subtitution value
* *
@ -92,9 +94,9 @@ abstract class CommonDocGenerator
* @param Translate $outputlangs Language object for output * @param Translate $outputlangs Language object for output
* @return array Array of substitution key->code * @return array Array of substitution key->code
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_substitutionarray_mysoc($mysoc,$outputlangs) function get_substitutionarray_mysoc($mysoc,$outputlangs)
{ {
// phpcs:enable
global $conf; global $conf;
if (empty($mysoc->forme_juridique) && ! empty($mysoc->forme_juridique_code)) if (empty($mysoc->forme_juridique) && ! empty($mysoc->forme_juridique_code))
@ -144,6 +146,7 @@ abstract class CommonDocGenerator
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Define array with couple subtitution key => subtitution value * Define array with couple subtitution key => subtitution value
* *
@ -151,9 +154,9 @@ abstract class CommonDocGenerator
* @param Translate $outputlangs Language object for output * @param Translate $outputlangs Language object for output
* @return array Array of substitution key->code * @return array Array of substitution key->code
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_substitutionarray_thirdparty($object,$outputlangs) function get_substitutionarray_thirdparty($object,$outputlangs)
{ {
// phpcs:enable
global $conf; global $conf;
if (empty($object->country) && ! empty($object->country_code)) if (empty($object->country) && ! empty($object->country_code))
@ -224,6 +227,7 @@ abstract class CommonDocGenerator
return $array_thirdparty; return $array_thirdparty;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Define array with couple subtitution key => subtitution value * Define array with couple subtitution key => subtitution value
* *
@ -232,9 +236,9 @@ abstract class CommonDocGenerator
* @param array_key $array_key Name of the key for return array * @param array_key $array_key Name of the key for return array
* @return array of substitution key->code * @return array of substitution key->code
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_substitutionarray_contact($object, $outputlangs, $array_key = 'object') function get_substitutionarray_contact($object, $outputlangs, $array_key = 'object')
{ {
// phpcs:enable
global $conf; global $conf;
if(empty($object->country) && ! empty($object->country_code)) if(empty($object->country) && ! empty($object->country_code))
@ -297,15 +301,16 @@ abstract class CommonDocGenerator
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Define array with couple subtitution key => subtitution value * Define array with couple subtitution key => subtitution value
* *
* @param Translate $outputlangs Language object for output * @param Translate $outputlangs Language object for output
* @return array Array of substitution key->code * @return array Array of substitution key->code
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_substitutionarray_other($outputlangs) function get_substitutionarray_other($outputlangs)
{ {
// phpcs:enable
global $conf; global $conf;
$now=dol_now('gmt'); // gmt $now=dol_now('gmt'); // gmt
@ -334,6 +339,7 @@ abstract class CommonDocGenerator
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Define array with couple substitution key => substitution value * Define array with couple substitution key => substitution value
* *
@ -342,9 +348,9 @@ abstract class CommonDocGenerator
* @param string $array_key Name of the key for return array * @param string $array_key Name of the key for return array
* @return array Array of substitution * @return array Array of substitution
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_substitutionarray_object($object,$outputlangs,$array_key='object') function get_substitutionarray_object($object,$outputlangs,$array_key='object')
{ {
// phpcs:enable
global $conf; global $conf;
$sumpayed=$sumdeposit=$sumcreditnote=''; $sumpayed=$sumdeposit=$sumcreditnote='';
@ -481,6 +487,7 @@ abstract class CommonDocGenerator
return $resarray; return $resarray;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Define array with couple substitution key => substitution value * Define array with couple substitution key => substitution value
* *
@ -488,9 +495,9 @@ abstract class CommonDocGenerator
* @param Translate $outputlangs Lang object to use for output * @param Translate $outputlangs Lang object to use for output
* @return array Return a substitution array * @return array Return a substitution array
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_substitutionarray_lines($line,$outputlangs) function get_substitutionarray_lines($line,$outputlangs)
{ {
// phpcs:enable
global $conf; global $conf;
$resarray= array( $resarray= array(
@ -559,6 +566,7 @@ abstract class CommonDocGenerator
return $resarray; return $resarray;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Define array with couple substitution key => substitution value * Define array with couple substitution key => substitution value
* *
@ -567,9 +575,9 @@ abstract class CommonDocGenerator
* @param array_key $array_key Name of the key for return array * @param array_key $array_key Name of the key for return array
* @return array Array of substitution * @return array Array of substitution
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_substitutionarray_shipment($object,$outputlangs,$array_key='object') function get_substitutionarray_shipment($object,$outputlangs,$array_key='object')
{ {
// phpcs:enable
global $conf; global $conf;
dol_include_once('/core/lib/product.lib.php'); dol_include_once('/core/lib/product.lib.php');
$object->list_delivery_methods($object->shipping_method_id); $object->list_delivery_methods($object->shipping_method_id);
@ -621,6 +629,7 @@ abstract class CommonDocGenerator
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Define array with couple substitution key => substitution value * Define array with couple substitution key => substitution value
* *
@ -628,10 +637,10 @@ abstract class CommonDocGenerator
* @param Translate $outputlangs Lang object to use for output * @param Translate $outputlangs Lang object to use for output
* @return array Substitution array * @return array Substitution array
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_substitutionarray_shipment_lines($line, $outputlangs) function get_substitutionarray_shipment_lines($line, $outputlangs)
{ {
global $conf; // phpcs:enable
global $conf;
dol_include_once('/core/lib/product.lib.php'); dol_include_once('/core/lib/product.lib.php');
$resarray = array( $resarray = array(
@ -668,6 +677,7 @@ abstract class CommonDocGenerator
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Define array with couple subtitution key => subtitution value * Define array with couple subtitution key => subtitution value
* *
@ -676,17 +686,17 @@ abstract class CommonDocGenerator
* @param boolean $recursive Want to fetch child array or child object * @param boolean $recursive Want to fetch child array or child object
* @return array Array of substitution key->code * @return array Array of substitution key->code
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_substitutionarray_each_var_object(&$object,$outputlangs,$recursive=true) function get_substitutionarray_each_var_object(&$object,$outputlangs,$recursive=true)
{ {
// phpcs:enable
$array_other = array(); $array_other = array();
if(!empty($object)) { if (!empty($object)) {
foreach($object as $key => $value) { foreach($object as $key => $value) {
if(!empty($value)) { if (!empty($value)) {
if(!is_array($value) && !is_object($value)) { if (!is_array($value) && !is_object($value)) {
$array_other['object_'.$key] = $value; $array_other['object_'.$key] = $value;
} }
if(is_array($value) && $recursive){ if (is_array($value) && $recursive) {
$array_other['object_'.$key] = $this->get_substitutionarray_each_var_object($value,$outputlangs,false); $array_other['object_'.$key] = $this->get_substitutionarray_each_var_object($value,$outputlangs,false);
} }
} }
@ -696,6 +706,7 @@ abstract class CommonDocGenerator
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Fill array with couple extrafield key => extrafield value * Fill array with couple extrafield key => extrafield value
* *
@ -706,9 +717,9 @@ abstract class CommonDocGenerator
* @param Translate $outputlangs Lang object to use for output * @param Translate $outputlangs Lang object to use for output
* @return array Substitution array * @return array Substitution array
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fill_substitutionarray_with_extrafields($object,$array_to_fill,$extrafields,$array_key,$outputlangs)
function fill_substitutionarray_with_extrafields($object,$array_to_fill,$extrafields,$array_key,$outputlangs)
{ {
// phpcs:enable
global $conf; global $conf;
foreach($extrafields->attribute_label as $key=>$label) foreach($extrafields->attribute_label as $key=>$label)
{ {

View File

@ -325,6 +325,7 @@ abstract class CommonInvoice extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return if an invoice can be deleted * Return if an invoice can be deleted
* Rule is: * Rule is:
@ -337,9 +338,9 @@ abstract class CommonInvoice extends CommonObject
* *
* @return int <=0 if no, >0 if yes * @return int <=0 if no, >0 if yes
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function is_erasable() function is_erasable()
{ {
// phpcs:enable
global $conf; global $conf;
// We check if invoice is a temporary number (PROVxxxx) // We check if invoice is a temporary number (PROVxxxx)
@ -450,6 +451,7 @@ abstract class CommonInvoice extends CommonObject
return $this->LibStatut($this->paye, $this->statut, $mode, $alreadypaid, $this->type); return $this->LibStatut($this->paye, $this->statut, $mode, $alreadypaid, $this->type);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return label of a status * Return label of a status
* *
@ -460,9 +462,9 @@ abstract class CommonInvoice extends CommonObject
* @param int $type Type invoice * @param int $type Type invoice
* @return string Label of status * @return string Label of status
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function LibStatut($paye, $status, $mode=0, $alreadypaid=-1, $type=0) function LibStatut($paye, $status, $mode=0, $alreadypaid=-1, $type=0)
{ {
// phpcs:enable
global $langs; global $langs;
$langs->load('bills'); $langs->load('bills');
@ -485,7 +487,7 @@ abstract class CommonInvoice extends CommonObject
else return $langs->trans('Bill'.$prefix.'StatusPaid'); else return $langs->trans('Bill'.$prefix.'StatusPaid');
} }
} }
if ($mode == 1) elseif ($mode == 1)
{ {
$prefix='Short'; $prefix='Short';
if (! $paye) if (! $paye)
@ -503,7 +505,7 @@ abstract class CommonInvoice extends CommonObject
else return $langs->trans('Bill'.$prefix.'StatusPaid'); else return $langs->trans('Bill'.$prefix.'StatusPaid');
} }
} }
if ($mode == 2) elseif ($mode == 2)
{ {
$prefix='Short'; $prefix='Short';
if (! $paye) if (! $paye)
@ -521,7 +523,7 @@ abstract class CommonInvoice extends CommonObject
else return img_picto($langs->trans('BillStatusPaid'),'statut6').' '.$langs->trans('Bill'.$prefix.'StatusPaid'); else return img_picto($langs->trans('BillStatusPaid'),'statut6').' '.$langs->trans('Bill'.$prefix.'StatusPaid');
} }
} }
if ($mode == 3) elseif ($mode == 3)
{ {
$prefix='Short'; $prefix='Short';
if (! $paye) if (! $paye)
@ -539,7 +541,7 @@ abstract class CommonInvoice extends CommonObject
else return img_picto($langs->trans('BillStatusPaid'),'statut6'); else return img_picto($langs->trans('BillStatusPaid'),'statut6');
} }
} }
if ($mode == 4) elseif ($mode == 4)
{ {
$prefix=''; $prefix='';
if (! $paye) if (! $paye)
@ -557,7 +559,7 @@ abstract class CommonInvoice extends CommonObject
else return img_picto($langs->trans('BillStatusPaid'),'statut6').' '.$langs->trans('BillStatusPaid'); else return img_picto($langs->trans('BillStatusPaid'),'statut6').' '.$langs->trans('BillStatusPaid');
} }
} }
if ($mode == 5 || $mode == 6) elseif ($mode == 5 || $mode == 6)
{ {
$prefix=''; $prefix='';
if ($mode == 5) $prefix='Short'; if ($mode == 5) $prefix='Short';
@ -582,6 +584,7 @@ abstract class CommonInvoice extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Renvoi une date limite de reglement de facture en fonction des * Renvoi une date limite de reglement de facture en fonction des
* conditions de reglements de la facture et date de facturation * conditions de reglements de la facture et date de facturation
@ -589,9 +592,9 @@ abstract class CommonInvoice extends CommonObject
* @param integer $cond_reglement Condition of payment (code or id) to use. If 0, we use current condition. * @param integer $cond_reglement Condition of payment (code or id) to use. If 0, we use current condition.
* @return date Date limite de reglement si ok, <0 si ko * @return date Date limite de reglement si ok, <0 si ko
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function calculate_date_lim_reglement($cond_reglement=0) function calculate_date_lim_reglement($cond_reglement=0)
{ {
// phpcs:enable
if (! $cond_reglement) $cond_reglement=$this->cond_reglement_code; if (! $cond_reglement) $cond_reglement=$this->cond_reglement_code;
if (! $cond_reglement) $cond_reglement=$this->cond_reglement_id; if (! $cond_reglement) $cond_reglement=$this->cond_reglement_id;

View File

@ -714,6 +714,7 @@ abstract class CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Add a link between element $this->element and a contact * Add a link between element $this->element and a contact
* *
@ -723,9 +724,9 @@ abstract class CommonObject
* @param int $notrigger Disable all triggers * @param int $notrigger Disable all triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function add_contact($fk_socpeople, $type_contact, $source='external',$notrigger=0) function add_contact($fk_socpeople, $type_contact, $source='external',$notrigger=0)
{ {
// phpcs:enable
global $user,$langs; global $user,$langs;
@ -837,6 +838,7 @@ abstract class CommonObject
} else return 0; } else return 0;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Copy contact from one element to current * Copy contact from one element to current
* *
@ -844,9 +846,9 @@ abstract class CommonObject
* @param string $source Nature of contact ('internal' or 'external') * @param string $source Nature of contact ('internal' or 'external')
* @return int >0 if OK, <0 if KO * @return int >0 if OK, <0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function copy_linked_contact($objFrom, $source='internal') function copy_linked_contact($objFrom, $source='internal')
{ {
// phpcs:enable
$contacts = $objFrom->liste_contact(-1, $source); $contacts = $objFrom->liste_contact(-1, $source);
foreach($contacts as $contact) foreach($contacts as $contact)
{ {
@ -859,6 +861,7 @@ abstract class CommonObject
return 1; return 1;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Update a link to contact line * Update a link to contact line
* *
@ -868,9 +871,9 @@ abstract class CommonObject
* @param int $fk_socpeople Id of soc_people to update (not modified if 0) * @param int $fk_socpeople Id of soc_people to update (not modified if 0)
* @return int <0 if KO, >= 0 if OK * @return int <0 if KO, >= 0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function update_contact($rowid, $statut, $type_contact_id=0, $fk_socpeople=0) function update_contact($rowid, $statut, $type_contact_id=0, $fk_socpeople=0)
{ {
// phpcs:enable
// Insert into database // Insert into database
$sql = "UPDATE ".MAIN_DB_PREFIX."element_contact set"; $sql = "UPDATE ".MAIN_DB_PREFIX."element_contact set";
$sql.= " statut = ".$statut; $sql.= " statut = ".$statut;
@ -889,6 +892,7 @@ abstract class CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Delete a link to contact line * Delete a link to contact line
* *
@ -896,9 +900,9 @@ abstract class CommonObject
* @param int $notrigger Disable all triggers * @param int $notrigger Disable all triggers
* @return int >0 if OK, <0 if KO * @return int >0 if OK, <0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function delete_contact($rowid, $notrigger=0) function delete_contact($rowid, $notrigger=0)
{ {
// phpcs:enable
global $user; global $user;
@ -927,6 +931,7 @@ abstract class CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Delete all links between an object $this and all its contacts * Delete all links between an object $this and all its contacts
* *
@ -934,9 +939,9 @@ abstract class CommonObject
* @param string $code Type of contact (code or id) * @param string $code Type of contact (code or id)
* @return int >0 if OK, <0 if KO * @return int >0 if OK, <0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function delete_linked_contact($source='',$code='') function delete_linked_contact($source='',$code='')
{ {
// phpcs:enable
$temp = array(); $temp = array();
$typeContact = $this->liste_type_contact($source,'',0,0,$code); $typeContact = $this->liste_type_contact($source,'',0,0,$code);
@ -963,6 +968,7 @@ abstract class CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Get array of all contacts for an object * Get array of all contacts for an object
* *
@ -972,9 +978,9 @@ abstract class CommonObject
* @param string $code Filter on this code of contact type ('SHIPPING', 'BILLING', ...) * @param string $code Filter on this code of contact type ('SHIPPING', 'BILLING', ...)
* @return array Array of contacts * @return array Array of contacts
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function liste_contact($statut=-1,$source='external',$list=0,$code='') function liste_contact($statut=-1,$source='external',$list=0,$code='')
{ {
// phpcs:enable
global $langs; global $langs;
$tab=array(); $tab=array();
@ -1071,6 +1077,7 @@ abstract class CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return array with list of possible values for type of contacts * Return array with list of possible values for type of contacts
* *
@ -1081,9 +1088,9 @@ abstract class CommonObject
* @param string $code Type of contact (Example: 'CUSTOMER', 'SERVICE') * @param string $code Type of contact (Example: 'CUSTOMER', 'SERVICE')
* @return array Array list of type of contacts (id->label if option=0, code->label if option=1) * @return array Array list of type of contacts (id->label if option=0, code->label if option=1)
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function liste_type_contact($source='internal', $order='position', $option=0, $activeonly=0, $code='') function liste_type_contact($source='internal', $order='position', $option=0, $activeonly=0, $code='')
{ {
// phpcs:enable
global $langs; global $langs;
if (empty($order)) $order='position'; if (empty($order)) $order='position';
@ -1185,15 +1192,16 @@ abstract class CommonObject
return $result; return $result;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Load object contact with id=$this->contactid into $this->contact * Load object contact with id=$this->contactid into $this->contact
* *
* @param int $contactid Id du contact. Use this->contactid if empty. * @param int $contactid Id du contact. Use this->contactid if empty.
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function fetch_contact($contactid=null) function fetch_contact($contactid=null)
{ {
// phpcs:enable
if (empty($contactid)) $contactid=$this->contactid; if (empty($contactid)) $contactid=$this->contactid;
if (empty($contactid)) return 0; if (empty($contactid)) return 0;
@ -1205,15 +1213,16 @@ abstract class CommonObject
return $result; return $result;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Load the third party of object, from id $this->socid or $this->fk_soc, into this->thirdparty * Load the third party of object, from id $this->socid or $this->fk_soc, into this->thirdparty
* *
* @param int $force_thirdparty_id Force thirdparty id * @param int $force_thirdparty_id Force thirdparty id
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function fetch_thirdparty($force_thirdparty_id=0) function fetch_thirdparty($force_thirdparty_id=0)
{ {
// phpcs:enable
global $conf; global $conf;
if (empty($this->socid) && empty($this->fk_soc) && empty($this->fk_thirdparty) && empty($force_thirdparty_id)) if (empty($this->socid) && empty($this->fk_soc) && empty($this->fk_thirdparty) && empty($force_thirdparty_id))
@ -1267,6 +1276,7 @@ abstract class CommonObject
return $this->fetch($result->rowid); return $this->fetch($result->rowid);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Load data for barcode into properties ->barcode_type* * Load data for barcode into properties ->barcode_type*
* Properties ->barcode_type that is id of barcode. Type is used to find other properties, but * Properties ->barcode_type that is id of barcode. Type is used to find other properties, but
@ -1274,9 +1284,9 @@ abstract class CommonObject
* *
* @return int <0 if KO, 0 if can't guess type of barcode (ISBN, EAN13...), >0 if OK (all barcode properties loaded) * @return int <0 if KO, 0 if can't guess type of barcode (ISBN, EAN13...), >0 if OK (all barcode properties loaded)
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function fetch_barcode() function fetch_barcode()
{ {
// phpcs:enable
global $conf; global $conf;
dol_syslog(get_class($this).'::fetch_barcode this->element='.$this->element.' this->barcode_type='.$this->barcode_type); dol_syslog(get_class($this).'::fetch_barcode this->element='.$this->element.' this->barcode_type='.$this->barcode_type);
@ -1317,14 +1327,15 @@ abstract class CommonObject
return 0; return 0;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Load the project with id $this->fk_project into this->project * Load the project with id $this->fk_project into this->project
* *
* @return int <0 if KO, >=0 if OK * @return int <0 if KO, >=0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function fetch_projet() function fetch_projet()
{ {
// phpcs:enable
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
if (empty($this->fk_project) && ! empty($this->fk_projet)) $this->fk_project = $this->fk_projet; // For backward compatibility if (empty($this->fk_project) && ! empty($this->fk_projet)) $this->fk_project = $this->fk_projet; // For backward compatibility
@ -1338,14 +1349,15 @@ abstract class CommonObject
return $result; return $result;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Load the product with id $this->fk_product into this->product * Load the product with id $this->fk_product into this->product
* *
* @return int <0 if KO, >=0 if OK * @return int <0 if KO, >=0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function fetch_product() function fetch_product()
{ {
// phpcs:enable
include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
if (empty($this->fk_product)) return 0; if (empty($this->fk_product)) return 0;
@ -1357,29 +1369,31 @@ abstract class CommonObject
return $result; return $result;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Load the user with id $userid into this->user * Load the user with id $userid into this->user
* *
* @param int $userid Id du contact * @param int $userid Id du contact
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function fetch_user($userid) function fetch_user($userid)
{ {
// phpcs:enable
$user = new User($this->db); $user = new User($this->db);
$result=$user->fetch($userid); $result=$user->fetch($userid);
$this->user = $user; $this->user = $user;
return $result; return $result;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Read linked origin object * Read linked origin object
* *
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function fetch_origin() function fetch_origin()
{ {
// phpcs:enable
if ($this->origin == 'shipping') $this->origin = 'expedition'; if ($this->origin == 'shipping') $this->origin = 'expedition';
if ($this->origin == 'delivery') $this->origin = 'livraison'; if ($this->origin == 'delivery') $this->origin = 'livraison';
@ -1539,6 +1553,7 @@ abstract class CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Load properties id_previous and id_next by comparing $fieldid with $this->ref * Load properties id_previous and id_next by comparing $fieldid with $this->ref
* *
@ -1547,9 +1562,9 @@ abstract class CommonObject
* @param int $nodbprefix Do not include DB prefix to forge table name * @param int $nodbprefix Do not include DB prefix to forge table name
* @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_ref($filter, $fieldid, $nodbprefix=0) function load_previous_next_ref($filter, $fieldid, $nodbprefix=0)
{ {
// phpcs:enable
global $conf, $user; global $conf, $user;
if (! $this->table_element) if (! $this->table_element)
@ -2174,6 +2189,7 @@ abstract class CommonObject
// TODO: Move line related operations to CommonObjectLine? // TODO: Move line related operations to CommonObjectLine?
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Save a new position (field rang) for details lines. * Save a new position (field rang) for details lines.
* You can choose to set position for lines with already a position or lines without any position defined. * You can choose to set position for lines with already a position or lines without any position defined.
@ -2183,9 +2199,9 @@ abstract class CommonObject
* @param boolean $fk_parent_line Table with fk_parent_line field or not * @param boolean $fk_parent_line Table with fk_parent_line field or not
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function line_order($renum=false, $rowidorder='ASC', $fk_parent_line=true) function line_order($renum=false, $rowidorder='ASC', $fk_parent_line=true)
{ {
// phpcs:enable
if (! $this->table_element_line) if (! $this->table_element_line)
{ {
dol_syslog(get_class($this)."::line_order was called on objet with property table_element_line not defined",LOG_ERR); dol_syslog(get_class($this)."::line_order was called on objet with property table_element_line not defined",LOG_ERR);
@ -2294,6 +2310,7 @@ abstract class CommonObject
return $rows; return $rows;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Update a line to have a lower rank * Update a line to have a lower rank
* *
@ -2301,9 +2318,9 @@ abstract class CommonObject
* @param boolean $fk_parent_line Table with fk_parent_line field or not * @param boolean $fk_parent_line Table with fk_parent_line field or not
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function line_up($rowid, $fk_parent_line=true) function line_up($rowid, $fk_parent_line=true)
{ {
// phpcs:enable
$this->line_order(false, 'ASC', $fk_parent_line); $this->line_order(false, 'ASC', $fk_parent_line);
// Get rang of line // Get rang of line
@ -2313,6 +2330,7 @@ abstract class CommonObject
$this->updateLineUp($rowid, $rang); $this->updateLineUp($rowid, $rang);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Update a line to have a higher rank * Update a line to have a higher rank
* *
@ -2320,9 +2338,9 @@ abstract class CommonObject
* @param boolean $fk_parent_line Table with fk_parent_line field or not * @param boolean $fk_parent_line Table with fk_parent_line field or not
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function line_down($rowid, $fk_parent_line=true) function line_down($rowid, $fk_parent_line=true)
{ {
// phpcs:enable
$this->line_order(false, 'ASC', $fk_parent_line); $this->line_order(false, 'ASC', $fk_parent_line);
// Get rang of line // Get rang of line
@ -2357,15 +2375,16 @@ abstract class CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Update position of line with ajax (rang) * Update position of line with ajax (rang)
* *
* @param array $rows Array of rows * @param array $rows Array of rows
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function line_ajaxorder($rows) function line_ajaxorder($rows)
{ {
// phpcs:enable
$num = count($rows); $num = count($rows);
for ($i = 0 ; $i < $num ; $i++) for ($i = 0 ; $i < $num ; $i++)
{ {
@ -2473,15 +2492,16 @@ abstract class CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Get max value used for position of line (rang) * Get max value used for position of line (rang)
* *
* @param int $fk_parent_line Parent line id * @param int $fk_parent_line Parent line id
* @return int Max value of rang in table of lines * @return int Max value of rang in table of lines
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function line_max($fk_parent_line=0) function line_max($fk_parent_line=0)
{ {
// phpcs:enable
// Search the last rang with fk_parent_line // Search the last rang with fk_parent_line
if ($fk_parent_line) if ($fk_parent_line)
{ {
@ -2520,15 +2540,16 @@ abstract class CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Update external ref of element * Update external ref of element
* *
* @param string $ref_ext Update field ref_ext * @param string $ref_ext Update field ref_ext
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function update_ref_ext($ref_ext) function update_ref_ext($ref_ext)
{ {
// phpcs:enable
if (! $this->table_element) if (! $this->table_element)
{ {
dol_syslog(get_class($this)."::update_ref_ext was called on objet with property table_element not defined", LOG_ERR); dol_syslog(get_class($this)."::update_ref_ext was called on objet with property table_element not defined", LOG_ERR);
@ -2552,6 +2573,7 @@ abstract class CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Update note of element * Update note of element
* *
@ -2559,9 +2581,9 @@ abstract class CommonObject
* @param string $suffix '', '_public' or '_private' * @param string $suffix '', '_public' or '_private'
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function update_note($note, $suffix='') function update_note($note, $suffix='')
{ {
// phpcs:enable
global $user; global $user;
if (! $this->table_element) if (! $this->table_element)
@ -2604,6 +2626,7 @@ abstract class CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Update public note (kept for backward compatibility) * Update public note (kept for backward compatibility)
* *
@ -2612,12 +2635,13 @@ abstract class CommonObject
* @deprecated * @deprecated
* @see update_note() * @see update_note()
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function update_note_public($note) function update_note_public($note)
{ {
// phpcs:enable
return $this->update_note($note,'_public'); return $this->update_note($note,'_public');
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Update total_ht, total_ttc, total_vat, total_localtax1, total_localtax2 for an object (sum of lines). * Update total_ht, total_ttc, total_vat, total_localtax1, total_localtax2 for an object (sum of lines).
* Must be called at end of methods addline or updateline. * Must be called at end of methods addline or updateline.
@ -2628,9 +2652,9 @@ abstract class CommonObject
* @param Societe $seller If roundingadjust is '0' or '1' or maybe 'auto', it means we recalculate total for lines before calculating total for object and for this, we need seller object. * @param Societe $seller If roundingadjust is '0' or '1' or maybe 'auto', it means we recalculate total for lines before calculating total for object and for this, we need seller object.
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function update_price($exclspec=0,$roundingadjust='none',$nodatabaseupdate=0,$seller=null) function update_price($exclspec=0,$roundingadjust='none',$nodatabaseupdate=0,$seller=null)
{ {
// phpcs:enable
global $conf, $hookmanager, $action; global $conf, $hookmanager, $action;
// Some external module want no update price after a trigger because they have another method to calculate the total (ex: with an extrafield) // Some external module want no update price after a trigger because they have another method to calculate the total (ex: with an extrafield)
@ -2857,6 +2881,7 @@ abstract class CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Add objects linked in llx_element_element. * Add objects linked in llx_element_element.
* *
@ -2865,9 +2890,9 @@ abstract class CommonObject
* @return int <=0 if KO, >0 if OK * @return int <=0 if KO, >0 if OK
* @see fetchObjectLinked, updateObjectLinked, deleteObjectLinked * @see fetchObjectLinked, updateObjectLinked, deleteObjectLinked
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function add_object_linked($origin=null, $origin_id=null) function add_object_linked($origin=null, $origin_id=null)
{ {
// phpcs:enable
$origin = (! empty($origin) ? $origin : $this->origin); $origin = (! empty($origin) ? $origin : $this->origin);
$origin_id = (! empty($origin_id) ? $origin_id : $this->origin_id); $origin_id = (! empty($origin_id) ? $origin_id : $this->origin_id);
@ -3618,15 +3643,16 @@ abstract class CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return incoterms informations * Return incoterms informations
* TODO Use a cache for label get * TODO Use a cache for label get
* *
* @return string incoterms info * @return string incoterms info
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function display_incoterms() function display_incoterms()
{ {
// phpcs:enable
$out = ''; $out = '';
$this->libelle_incoterms = ''; $this->libelle_incoterms = '';
if (!empty($this->fk_incoterms)) if (!empty($this->fk_incoterms))
@ -4226,6 +4252,7 @@ abstract class CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Add resources to the current object : add entry into llx_element_resources * Add resources to the current object : add entry into llx_element_resources
* Need $this->element & $this->id * Need $this->element & $this->id
@ -4236,9 +4263,9 @@ abstract class CommonObject
* @param int $mandatory Mandatory or not * @param int $mandatory Mandatory or not
* @return int <=0 if KO, >0 if OK * @return int <=0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function add_element_resource($resource_id, $resource_type, $busy=0, $mandatory=0) function add_element_resource($resource_id, $resource_type, $busy=0, $mandatory=0)
{ {
// phpcs:enable
$this->db->begin(); $this->db->begin();
$sql = "INSERT INTO ".MAIN_DB_PREFIX."element_resources ("; $sql = "INSERT INTO ".MAIN_DB_PREFIX."element_resources (";
@ -4271,6 +4298,7 @@ abstract class CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Delete a link to resource line * Delete a link to resource line
* *
@ -4279,9 +4307,9 @@ abstract class CommonObject
* @param int $notrigger Disable all triggers * @param int $notrigger Disable all triggers
* @return int >0 if OK, <0 if KO * @return int >0 if OK, <0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function delete_resource($rowid, $element, $notrigger=0) function delete_resource($rowid, $element, $notrigger=0)
{ {
// phpcs:enable
global $user; global $user;
$this->db->begin(); $this->db->begin();
@ -4654,6 +4682,7 @@ abstract class CommonObject
/* For triggers */ /* For triggers */
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Call trigger based on this instance. * Call trigger based on this instance.
* Some context information may also be provided into array property this->context. * Some context information may also be provided into array property this->context.
@ -4664,9 +4693,9 @@ abstract class CommonObject
* @param User $user Object user * @param User $user Object user
* @return int Result of run_triggers * @return int Result of run_triggers
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function call_trigger($trigger_name, $user) function call_trigger($trigger_name, $user)
{ {
// phpcs:enable
global $langs,$conf; global $langs,$conf;
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
@ -4691,6 +4720,7 @@ abstract class CommonObject
/* Functions for extrafields */ /* Functions for extrafields */
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Function to get extra fields of an object into $this->array_options * Function to get extra fields of an object into $this->array_options
* This method is in most cases called by method fetch of objects but you can call it separately. * This method is in most cases called by method fetch of objects but you can call it separately.
@ -4699,9 +4729,9 @@ abstract class CommonObject
* @param array $optionsArray Array resulting of call of extrafields->fetch_name_optionals_label(). Deprecated. Function must be called without parameters. * @param array $optionsArray Array resulting of call of extrafields->fetch_name_optionals_label(). Deprecated. Function must be called without parameters.
* @return int <0 if error, 0 if no values of extrafield to find nor found, 1 if an attribute is found and value loaded * @return int <0 if error, 0 if no values of extrafield to find nor found, 1 if an attribute is found and value loaded
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function fetch_optionals($rowid=null, $optionsArray=null) function fetch_optionals($rowid=null, $optionsArray=null)
{ {
// phpcs:enable
if (empty($rowid)) $rowid=$this->id; if (empty($rowid)) $rowid=$this->id;
// To avoid SQL errors. Probably not the better solution though // To avoid SQL errors. Probably not the better solution though
@ -6463,6 +6493,7 @@ abstract class CommonObject
return $buyPrice; return $buyPrice;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Show photos of an object (nbmax maximum), into several columns * Show photos of an object (nbmax maximum), into several columns
* *
@ -6480,9 +6511,9 @@ abstract class CommonObject
* @param int $usesharelink Use the public shared link of image (if not available, the 'nophoto' image will be shown instead) * @param int $usesharelink Use the public shared link of image (if not available, the 'nophoto' image will be shown instead)
* @return string Html code to show photo. Number of photos shown is saved in this->nbphoto * @return string Html code to show photo. Number of photos shown is saved in this->nbphoto
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function show_photos($modulepart, $sdir, $size=0, $nbmax=0, $nbbyrow=5, $showfilename=0, $showaction=0, $maxHeight=120, $maxWidth=160, $nolink=0, $notitle=0, $usesharelink=0) function show_photos($modulepart, $sdir, $size=0, $nbmax=0, $nbbyrow=5, $showfilename=0, $showaction=0, $maxHeight=120, $maxWidth=160, $nolink=0, $notitle=0, $usesharelink=0)
{ {
// phpcs:enable
global $conf,$user,$langs; global $conf,$user,$langs;
include_once DOL_DOCUMENT_ROOT .'/core/lib/files.lib.php'; include_once DOL_DOCUMENT_ROOT .'/core/lib/files.lib.php';

View File

@ -94,6 +94,7 @@ abstract class CommonStickerGenerator
$this->db = $db; $this->db = $db;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Function to build PDF on disk, then output on HTTP strem. * Function to build PDF on disk, then output on HTTP strem.
* *
@ -103,8 +104,8 @@ abstract class CommonStickerGenerator
* @param string $outputdir Output directory for pdf file * @param string $outputdir Output directory for pdf file
* @return int 1=OK, 0=KO * @return int 1=OK, 0=KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
abstract function write_file($arrayofrecords,$outputlangs,$srctemplatepath,$outputdir=''); abstract function write_file($arrayofrecords,$outputlangs,$srctemplatepath,$outputdir='');
// phpcs:enable
/** /**
* Output a sticker on page at position _COUNTX, _COUNTY (_COUNTX and _COUNTY start from 0) * Output a sticker on page at position _COUNTX, _COUNTY (_COUNTX and _COUNTY start from 0)
@ -116,6 +117,7 @@ abstract class CommonStickerGenerator
*/ */
abstract function addSticker(&$pdf,$outputlangs,$param); abstract function addSticker(&$pdf,$outputlangs,$param);
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Methode qui permet de modifier la taille des caracteres * Methode qui permet de modifier la taille des caracteres
* Cela modiera aussi l'espace entre chaque ligne * Cela modiera aussi l'espace entre chaque ligne
@ -124,9 +126,9 @@ abstract class CommonStickerGenerator
* @param int $pt point * @param int $pt point
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function Set_Char_Size(&$pdf,$pt) function Set_Char_Size(&$pdf,$pt)
{ {
// phpcs:enable
if ($pt > 3) { if ($pt > 3) {
$this->_Char_Size = $pt; $this->_Char_Size = $pt;
$this->_Line_Height = $this->_Get_Height_Chars($pt); $this->_Line_Height = $this->_Get_Height_Chars($pt);
@ -134,6 +136,7 @@ abstract class CommonStickerGenerator
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* protected Print dot line * protected Print dot line
* *
@ -146,9 +149,9 @@ abstract class CommonStickerGenerator
* @param int $nbPointilles Nb pointilles * @param int $nbPointilles Nb pointilles
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function _Pointille(&$pdf,$x1=0,$y1=0,$x2=210,$y2=297,$epaisseur=1,$nbPointilles=15) function _Pointille(&$pdf,$x1=0,$y1=0,$x2=210,$y2=297,$epaisseur=1,$nbPointilles=15)
{ {
// phpcs:enable
$pdf->SetLineWidth($epaisseur); $pdf->SetLineWidth($epaisseur);
$length=abs($x1-$x2); $length=abs($x1-$x2);
$hauteur=abs($y1-$y2); $hauteur=abs($y1-$y2);
@ -176,6 +179,7 @@ abstract class CommonStickerGenerator
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* protected Function realisant une croix aux 4 coins des cartes * protected Function realisant une croix aux 4 coins des cartes
* *
@ -188,9 +192,9 @@ abstract class CommonStickerGenerator
* @param int $taille Size * @param int $taille Size
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function _Croix(&$pdf,$x1=0,$y1=0,$x2=210,$y2=297,$epaisseur=1,$taille=4) function _Croix(&$pdf,$x1=0,$y1=0,$x2=210,$y2=297,$epaisseur=1,$taille=4)
{ {
// phpcs:enable
$pdf->SetDrawColor(192,192,192); $pdf->SetDrawColor(192,192,192);
$pdf->SetLineWidth($epaisseur); $pdf->SetLineWidth($epaisseur);
@ -211,6 +215,7 @@ abstract class CommonStickerGenerator
$pdf->SetDrawColor(0,0,0); $pdf->SetDrawColor(0,0,0);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* protected Convert units (in to mm, mm to in) * protected Convert units (in to mm, mm to in)
* $src and $dest must be 'in' or 'mm' * $src and $dest must be 'in' or 'mm'
@ -220,9 +225,9 @@ abstract class CommonStickerGenerator
* @param string $dest to * @param string $dest to
* @return float value value after conversion * @return float value value after conversion
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function _Convert_Metric($value, $src, $dest) function _Convert_Metric($value, $src, $dest)
{ {
// phpcs:enable
if ($src != $dest) { if ($src != $dest) {
$tab['in'] = 39.37008; $tab['in'] = 39.37008;
$tab['mm'] = 1000; $tab['mm'] = 1000;
@ -232,15 +237,16 @@ abstract class CommonStickerGenerator
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* protected Give the height for a char size given. * protected Give the height for a char size given.
* *
* @param int $pt Point * @param int $pt Point
* @return int Height chars * @return int Height chars
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function _Get_Height_Chars($pt) function _Get_Height_Chars($pt)
{ {
// phpcs:enable
// Tableau de concordance entre la hauteur des caracteres et de l'espacement entre les lignes // Tableau de concordance entre la hauteur des caracteres et de l'espacement entre les lignes
$_Table_Hauteur_Chars = array(6=>2, 7=>2.5, 8=>3, 9=>3.5, 10=>4, 11=>6, 12=>7, 13=>8, 14=>9, 15=>10); $_Table_Hauteur_Chars = array(6=>2, 7=>2.5, 8=>3, 9=>3.5, 10=>4, 11=>6, 12=>7, 13=>8, 14=>9, 15=>10);
if (in_array($pt, array_keys($_Table_Hauteur_Chars))) { if (in_array($pt, array_keys($_Table_Hauteur_Chars))) {
@ -250,6 +256,7 @@ abstract class CommonStickerGenerator
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* protected Set format * protected Set format
* *
@ -257,9 +264,9 @@ abstract class CommonStickerGenerator
* @param string $format Format * @param string $format Format
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function _Set_Format(&$pdf, $format) function _Set_Format(&$pdf, $format)
{ {
// phpcs:enable
$this->_Metric = $format['metric']; $this->_Metric = $format['metric'];
$this->_Avery_Name = $format['name']; $this->_Avery_Name = $format['name'];
$this->_Avery_Code = $format['code']; $this->_Avery_Code = $format['code'];

View File

@ -361,6 +361,7 @@ class DiscountAbsolute
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Link the discount to a particular invoice line or a particular invoice. * Link the discount to a particular invoice line or a particular invoice.
* When discount is a global discount used as an invoice line, we link using rowidline. * When discount is a global discount used as an invoice line, we link using rowidline.
@ -370,9 +371,9 @@ class DiscountAbsolute
* @param int $rowidinvoice Invoice id (To use discount as a credit note to reduc payment of invoice) * @param int $rowidinvoice Invoice id (To use discount as a credit note to reduc payment of invoice)
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function link_to_invoice($rowidline,$rowidinvoice) function link_to_invoice($rowidline,$rowidinvoice)
{ {
// phpcs:enable
// Check parameters // Check parameters
if (! $rowidline && ! $rowidinvoice) if (! $rowidline && ! $rowidinvoice)
{ {
@ -416,15 +417,16 @@ class DiscountAbsolute
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Link the discount to a particular invoice line or a particular invoice. * Link the discount to a particular invoice line or a particular invoice.
* Do not call this if discount is linked to a reconcialiated invoice * Do not call this if discount is linked to a reconcialiated invoice
* *
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function unlink_invoice() function unlink_invoice()
{ {
// phpcs:enable
$sql ="UPDATE ".MAIN_DB_PREFIX."societe_remise_except"; $sql ="UPDATE ".MAIN_DB_PREFIX."societe_remise_except";
if(! empty($this->discount_type)) { if(! empty($this->discount_type)) {
$sql.=" SET fk_invoice_supplier_line = NULL, fk_invoice_supplier = NULL"; $sql.=" SET fk_invoice_supplier_line = NULL, fk_invoice_supplier = NULL";

View File

@ -137,6 +137,7 @@ class DolEditor
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Output edit area inside the HTML stream. * Output edit area inside the HTML stream.
* Output depends on this->tool (fckeditor, ckeditor, textarea, ...) * Output depends on this->tool (fckeditor, ckeditor, textarea, ...)
@ -148,9 +149,9 @@ class DolEditor
* @param string $option For ACE editor, set the source language ('html', 'php', 'javascript', ...) * @param string $option For ACE editor, set the source language ('html', 'php', 'javascript', ...)
* @return void|string * @return void|string
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function Create($noprint=0, $morejs='', $disallowAnyContent=true, $titlecontent='', $option='') function Create($noprint=0, $morejs='', $disallowAnyContent=true, $titlecontent='', $option='')
{ {
// phpcs:enable
global $conf,$langs; global $conf,$langs;
$fullpage=false; $fullpage=false;

View File

@ -128,120 +128,130 @@ class DolGraph
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set Y precision * Set Y precision
* *
* @param float $which_prec Precision * @param float $which_prec Precision
* @return boolean * @return boolean
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetPrecisionY($which_prec) function SetPrecisionY($which_prec)
{ {
// phpcs:enable
$this->PrecisionY = $which_prec; $this->PrecisionY = $which_prec;
return true; return true;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Utiliser SetNumTicks ou SetHorizTickIncrement mais pas les 2 * Utiliser SetNumTicks ou SetHorizTickIncrement mais pas les 2
* *
* @param float $xi Xi * @param float $xi Xi
* @return boolean True * @return boolean True
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetHorizTickIncrement($xi) function SetHorizTickIncrement($xi)
{ {
// phpcs:enable
$this->horizTickIncrement = $xi; $this->horizTickIncrement = $xi;
return true; return true;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Utiliser SetNumTicks ou SetHorizTickIncrement mais pas les 2 * Utiliser SetNumTicks ou SetHorizTickIncrement mais pas les 2
* *
* @param float $xt Xt * @param float $xt Xt
* @return boolean True * @return boolean True
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetNumXTicks($xt) function SetNumXTicks($xt)
{ {
// phpcs:enable
$this->SetNumXTicks = $xt; $this->SetNumXTicks = $xt;
return true; return true;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set label interval to reduce number of labels * Set label interval to reduce number of labels
* *
* @param float $x Label interval * @param float $x Label interval
* @return boolean True * @return boolean True
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetLabelInterval($x) function SetLabelInterval($x)
{ {
// phpcs:enable
$this->labelInterval = $x; $this->labelInterval = $x;
return true; return true;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Hide X grid * Hide X grid
* *
* @param boolean $bool XGrid or not * @param boolean $bool XGrid or not
* @return boolean true * @return boolean true
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetHideXGrid($bool) function SetHideXGrid($bool)
{ {
// phpcs:enable
$this->hideXGrid = $bool; $this->hideXGrid = $bool;
return true; return true;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Hide Y grid * Hide Y grid
* *
* @param boolean $bool YGrid or not * @param boolean $bool YGrid or not
* @return boolean true * @return boolean true
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetHideYGrid($bool) function SetHideYGrid($bool)
{ {
// phpcs:enable
$this->hideYGrid = $bool; $this->hideYGrid = $bool;
return true; return true;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set y label * Set y label
* *
* @param string $label Y label * @param string $label Y label
* @return boolean|null True * @return boolean|null True
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetYLabel($label) function SetYLabel($label)
{ {
// phpcs:enable
$this->YLabel = $label; $this->YLabel = $label;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set width * Set width
* *
* @param int $w Width * @param int $w Width
* @return boolean|null True * @return boolean|null True
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetWidth($w) function SetWidth($w)
{ {
// phpcs:enable
$this->width = $w; $this->width = $w;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set title * Set title
* *
* @param string $title Title * @param string $title Title
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetTitle($title) function SetTitle($title)
{ {
// phpcs:enable
$this->title = $title; $this->title = $title;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set data * Set data
* *
@ -249,161 +259,174 @@ class DolGraph
* @return void * @return void
* @see draw_jflot for syntax of data array * @see draw_jflot for syntax of data array
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetData($data) function SetData($data)
{ {
// phpcs:enable
$this->data = $data; $this->data = $data;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set data * Set data
* *
* @param array $datacolor Data color array(array(R,G,B),array(R,G,B)...) * @param array $datacolor Data color array(array(R,G,B),array(R,G,B)...)
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetDataColor($datacolor) function SetDataColor($datacolor)
{ {
// phpcs:enable
$this->datacolor = $datacolor; $this->datacolor = $datacolor;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set type * Set type
* *
* @param array $type Array with type for each serie. Example: array('pie'), array('lines',...,'bars') * @param array $type Array with type for each serie. Example: array('pie'), array('lines',...,'bars')
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetType($type) function SetType($type)
{ {
// phpcs:enable
$this->type = $type; $this->type = $type;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set legend * Set legend
* *
* @param array $legend Legend. Example: array('seriename1','seriname2',...) * @param array $legend Legend. Example: array('seriename1','seriname2',...)
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetLegend($legend) function SetLegend($legend)
{ {
// phpcs:enable
$this->Legend = $legend; $this->Legend = $legend;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set min width * Set min width
* *
* @param int $legendwidthmin Min width * @param int $legendwidthmin Min width
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetLegendWidthMin($legendwidthmin) function SetLegendWidthMin($legendwidthmin)
{ {
// phpcs:enable
$this->LegendWidthMin = $legendwidthmin; $this->LegendWidthMin = $legendwidthmin;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set max value * Set max value
* *
* @param int $max Max value * @param int $max Max value
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetMaxValue($max) function SetMaxValue($max)
{ {
// phpcs:enable
$this->MaxValue = $max; $this->MaxValue = $max;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Get max value * Get max value
* *
* @return int Max value * @return int Max value
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function GetMaxValue() function GetMaxValue()
{ {
// phpcs:enable
return $this->MaxValue; return $this->MaxValue;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set min value * Set min value
* *
* @param int $min Min value * @param int $min Min value
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetMinValue($min) function SetMinValue($min)
{ {
// phpcs:enable
$this->MinValue = $min; $this->MinValue = $min;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Get min value * Get min value
* *
* @return int Max value * @return int Max value
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function GetMinValue() function GetMinValue()
{ {
// phpcs:enable
return $this->MinValue; return $this->MinValue;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set height * Set height
* *
* @param int $h Height * @param int $h Height
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetHeight($h) function SetHeight($h)
{ {
// phpcs:enable
$this->height = $h; $this->height = $h;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set shading * Set shading
* *
* @param string $s Shading * @param string $s Shading
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetShading($s) function SetShading($s)
{ {
// phpcs:enable
$this->SetShading = $s; $this->SetShading = $s;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set shading * Set shading
* *
* @param string $s Shading * @param string $s Shading
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetCssPrefix($s) function SetCssPrefix($s)
{ {
// phpcs:enable
$this->cssprefix = $s; $this->cssprefix = $s;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Reset bg color * Reset bg color
* *
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function ResetBgColor() function ResetBgColor()
{ {
// phpcs:enable
unset($this->bgcolor); unset($this->bgcolor);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Reset bgcolorgrid * Reset bgcolorgrid
* *
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function ResetBgColorGrid() function ResetBgColorGrid()
{ {
// phpcs:enable
unset($this->bgcolorgrid); unset($this->bgcolorgrid);
} }
@ -452,15 +475,16 @@ class DolGraph
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Define background color of complete image * Define background color of complete image
* *
* @param array $bg_color array(R,G,B) ou 'onglet' ou 'default' * @param array $bg_color array(R,G,B) ou 'onglet' ou 'default'
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetBgColor($bg_color = array(255,255,255)) function SetBgColor($bg_color = array(255,255,255))
{ {
// phpcs:enable
global $theme_bgcolor,$theme_bgcoloronglet; global $theme_bgcolor,$theme_bgcoloronglet;
if (! is_array($bg_color)) if (! is_array($bg_color))
@ -481,15 +505,16 @@ class DolGraph
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Define background color of grid * Define background color of grid
* *
* @param array $bg_colorgrid array(R,G,B) ou 'onglet' ou 'default' * @param array $bg_colorgrid array(R,G,B) ou 'onglet' ou 'default'
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetBgColorGrid($bg_colorgrid = array(255,255,255)) function SetBgColorGrid($bg_colorgrid = array(255,255,255))
{ {
// phpcs:enable
global $theme_bgcolor,$theme_bgcoloronglet; global $theme_bgcolor,$theme_bgcoloronglet;
if (! is_array($bg_colorgrid)) if (! is_array($bg_colorgrid))
@ -510,25 +535,27 @@ class DolGraph
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Reset data color * Reset data color
* *
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function ResetDataColor() function ResetDataColor()
{ {
// phpcs:enable
unset($this->datacolor); unset($this->datacolor);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Get max value * Get max value
* *
* @return int Max value * @return int Max value
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function GetMaxValueInData() function GetMaxValueInData()
{ {
// phpcs:enable
$k = 0; $k = 0;
$vals = array(); $vals = array();
@ -547,14 +574,15 @@ class DolGraph
return $vals[0]; return $vals[0];
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return min value of all data * Return min value of all data
* *
* @return int Min value of all data * @return int Min value of all data
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function GetMinValueInData() function GetMinValueInData()
{ {
// phpcs:enable
$k = 0; $k = 0;
$vals = array(); $vals = array();
@ -573,14 +601,15 @@ class DolGraph
return $vals[0]; return $vals[0];
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return max value of all data * Return max value of all data
* *
* @return int Max value of all data * @return int Max value of all data
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function GetCeilMaxValue() function GetCeilMaxValue()
{ {
// phpcs:enable
$max = $this->GetMaxValueInData(); $max = $this->GetMaxValueInData();
if ($max != 0) $max++; if ($max != 0) $max++;
$size=dol_strlen(abs(ceil($max))); $size=dol_strlen(abs(ceil($max)));
@ -597,14 +626,15 @@ class DolGraph
return $res; return $res;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return min value of all data * Return min value of all data
* *
* @return double Max value of all data * @return double Max value of all data
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function GetFloorMinValue() function GetFloorMinValue()
{ {
// phpcs:enable
$min = $this->GetMinValueInData(); $min = $this->GetMinValueInData();
if ($min == '') $min=0; if ($min == '') $min=0;
if ($min != 0) $min--; if ($min != 0) $min--;
@ -652,6 +682,7 @@ class DolGraph
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Build a graph onto disk using Artichow library and return img string to it * Build a graph onto disk using Artichow library and return img string to it
* *
@ -659,9 +690,9 @@ class DolGraph
* @param string $fileurl Url path to show image if saved onto disk * @param string $fileurl Url path to show image if saved onto disk
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
private function draw_artichow($file,$fileurl) private function draw_artichow($file,$fileurl)
{ {
// phpcs:enable
global $artichow_defaultfont; global $artichow_defaultfont;
dol_syslog(get_class($this)."::draw_artichow this->type=".join(',',$this->type)); dol_syslog(get_class($this)."::draw_artichow this->type=".join(',',$this->type));
@ -832,6 +863,7 @@ class DolGraph
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Build a graph using JFlot library. Input when calling this method should be: * Build a graph using JFlot library. Input when calling this method should be:
* $this->data = array(array(0=>'labelxA',1=>yA), array('labelxB',yB)); * $this->data = array(array(0=>'labelxA',1=>yA), array('labelxB',yB));
@ -848,9 +880,9 @@ class DolGraph
* @param string $fileurl Url path to show image if saved onto disk. Never used here. * @param string $fileurl Url path to show image if saved onto disk. Never used here.
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
private function draw_jflot($file,$fileurl) private function draw_jflot($file,$fileurl)
{ {
// phpcs:enable
global $artichow_defaultfont; global $artichow_defaultfont;
dol_syslog(get_class($this)."::draw_jflot this->type=".join(',',$this->type)." this->MaxValue=".$this->MaxValue); dol_syslog(get_class($this)."::draw_jflot this->type=".join(',',$this->type)." this->MaxValue=".$this->MaxValue);

View File

@ -116,14 +116,14 @@ class dolReceiptPrinter extends Escpos
var $template; var $template;
/** /**
* @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)
*/ */
public $errors = array(); public $errors = array();
@ -352,6 +352,7 @@ class dolReceiptPrinter extends Escpos
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Function to Add a printer in db * Function to Add a printer in db
* *
@ -361,9 +362,9 @@ class dolReceiptPrinter extends Escpos
* @param string $parameter Printer parameter * @param string $parameter Printer parameter
* @return int 0 if OK; >0 if KO * @return int 0 if OK; >0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function AddPrinter($name, $type, $profile, $parameter) function AddPrinter($name, $type, $profile, $parameter)
{ {
// phpcs:enable
global $conf; global $conf;
$error = 0; $error = 0;
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'printer_receipt'; $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'printer_receipt';
@ -377,6 +378,7 @@ class dolReceiptPrinter extends Escpos
return $error; return $error;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Function to Update a printer in db * Function to Update a printer in db
* *
@ -387,9 +389,9 @@ class dolReceiptPrinter extends Escpos
* @param int $printerid Printer id * @param int $printerid Printer id
* @return int 0 if OK; >0 if KO * @return int 0 if OK; >0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function UpdatePrinter($name, $type, $profile, $parameter, $printerid) function UpdatePrinter($name, $type, $profile, $parameter, $printerid)
{ {
// phpcs:enable
global $conf; global $conf;
$error = 0; $error = 0;
$sql = 'UPDATE '.MAIN_DB_PREFIX.'printer_receipt'; $sql = 'UPDATE '.MAIN_DB_PREFIX.'printer_receipt';
@ -406,15 +408,16 @@ class dolReceiptPrinter extends Escpos
return $error; return $error;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Function to Delete a printer from db * Function to Delete a printer from db
* *
* @param int $printerid Printer id * @param int $printerid Printer id
* @return int 0 if OK; >0 if KO * @return int 0 if OK; >0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DeletePrinter($printerid) function DeletePrinter($printerid)
{ {
// phpcs:enable
global $conf; global $conf;
$error = 0; $error = 0;
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.'printer_receipt'; $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'printer_receipt';
@ -427,6 +430,7 @@ class dolReceiptPrinter extends Escpos
return $error; return $error;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Function to Update a printer template in db * Function to Update a printer template in db
* *
@ -435,9 +439,9 @@ class dolReceiptPrinter extends Escpos
* @param int $templateid Template id * @param int $templateid Template id
* @return int 0 if OK; >0 if KO * @return int 0 if OK; >0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function UpdateTemplate($name, $template, $templateid) function UpdateTemplate($name, $template, $templateid)
{ {
// phpcs:enable
global $conf; global $conf;
$error = 0; $error = 0;
$sql = 'UPDATE '.MAIN_DB_PREFIX.'printer_receipt_template'; $sql = 'UPDATE '.MAIN_DB_PREFIX.'printer_receipt_template';
@ -453,15 +457,16 @@ class dolReceiptPrinter extends Escpos
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Function to Send Test page to Printer * Function to Send Test page to Printer
* *
* @param int $printerid Printer id * @param int $printerid Printer id
* @return int 0 if OK; >0 if KO * @return int 0 if OK; >0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SendTestToPrinter($printerid) function SendTestToPrinter($printerid)
{ {
// phpcs:enable
global $conf; global $conf;
$error = 0; $error = 0;
$img = new EscposImage(DOL_DOCUMENT_ROOT .'/theme/common/dolibarr_logo_bw.png'); $img = new EscposImage(DOL_DOCUMENT_ROOT .'/theme/common/dolibarr_logo_bw.png');
@ -488,6 +493,7 @@ class dolReceiptPrinter extends Escpos
return $error; return $error;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Function to Print Receipt Ticket * Function to Print Receipt Ticket
* *
@ -496,9 +502,9 @@ class dolReceiptPrinter extends Escpos
* @param int $printerid Printer id * @param int $printerid Printer id
* @return int 0 if OK; >0 if KO * @return int 0 if OK; >0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SendToPrinter($object, $templateid, $printerid) function SendToPrinter($object, $templateid, $printerid)
{ {
// phpcs:enable
global $conf; global $conf;
$error = 0; $error = 0;
$ret = $this->loadTemplate($templateid); $ret = $this->loadTemplate($templateid);
@ -652,15 +658,16 @@ class dolReceiptPrinter extends Escpos
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Function Init Printer * Function Init Printer
* *
* @param int $printerid Printer id * @param int $printerid Printer id
* @return int 0 if OK; >0 if KO * @return int 0 if OK; >0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function InitPrinter($printerid) function InitPrinter($printerid)
{ {
// phpcs:enable
global $conf; global $conf;
$error=0; $error=0;
$sql = 'SELECT rowid, name, fk_type, fk_profile, parameter'; $sql = 'SELECT rowid, name, fk_type, fk_profile, parameter';

View File

@ -319,6 +319,7 @@ class EmailSenderProfile 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
* *
@ -326,43 +327,36 @@ class EmailSenderProfile 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 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)
{ {
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');
} }
if ($mode == 6) elseif ($mode == 6)
{ {
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');

View File

@ -293,6 +293,7 @@ class ExtraFields
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Add description of a new optional attribute * Add description of a new optional attribute
* *
@ -316,9 +317,9 @@ class ExtraFields
* @param string $enabled Condition to have the field enabled or not * @param string $enabled Condition to have the field enabled or not
* @return int <=0 if KO, >0 if OK * @return int <=0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
private function create_label($attrname, $label='', $type='', $pos=0, $size=0, $elementtype='member', $unique=0, $required=0, $param='', $alwayseditable=0, $perms='', $list='-1', $help='', $default='', $computed='',$entity='', $langfile='', $enabled='1') private function create_label($attrname, $label='', $type='', $pos=0, $size=0, $elementtype='member', $unique=0, $required=0, $param='', $alwayseditable=0, $perms='', $list='-1', $help='', $default='', $computed='',$entity='', $langfile='', $enabled='1')
{ {
// phpcs:enable
global $conf,$user; global $conf,$user;
if ($elementtype == 'thirdparty') $elementtype='societe'; if ($elementtype == 'thirdparty') $elementtype='societe';
@ -463,6 +464,7 @@ class ExtraFields
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Delete description of an optional attribute * Delete description of an optional attribute
* *
@ -470,9 +472,9 @@ class ExtraFields
* @param string $elementtype Element type ('member', 'product', 'thirdparty', ...) * @param string $elementtype Element type ('member', 'product', 'thirdparty', ...)
* @return int < 0 if KO, 0 if nothing is done, 1 if OK * @return int < 0 if KO, 0 if nothing is done, 1 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
private function delete_label($attrname, $elementtype='member') private function delete_label($attrname, $elementtype='member')
{ {
// phpcs:enable
global $conf; global $conf;
if ($elementtype == 'thirdparty') $elementtype='societe'; if ($elementtype == 'thirdparty') $elementtype='societe';
@ -612,6 +614,7 @@ class ExtraFields
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Modify description of personalized attribute * Modify description of personalized attribute
* *
@ -636,9 +639,9 @@ class ExtraFields
* @param int $totalizable Is extrafield totalizable on list * @param int $totalizable Is extrafield totalizable on list
* @return int <=0 if KO, >0 if OK * @return int <=0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
private function update_label($attrname,$label,$type,$size,$elementtype,$unique=0,$required=0,$pos=0,$param='',$alwayseditable=0,$perms='',$list='0',$help='',$default='',$computed='',$entity='',$langfile='',$enabled='1', $totalizable=0) private function update_label($attrname,$label,$type,$size,$elementtype,$unique=0,$required=0,$pos=0,$param='',$alwayseditable=0,$perms='',$list='0',$help='',$default='',$computed='',$entity='',$langfile='',$enabled='1', $totalizable=0)
{ {
// phpcs:enable
global $conf, $user; global $conf, $user;
dol_syslog(get_class($this)."::update_label ".$attrname.", ".$label.", ".$type.", ".$size.", ".$elementtype.", ".$unique.", ".$required.", ".$pos.", ".$alwayseditable.", ".$perms.", ".$list.", ".$default.", ".$computed.", ".$entity.", ".$langfile.", ".$enabled.", ".$totalizable); dol_syslog(get_class($this)."::update_label ".$attrname.", ".$label.", ".$type.", ".$size.", ".$elementtype.", ".$unique.", ".$required.", ".$pos.", ".$alwayseditable.", ".$perms.", ".$list.", ".$default.", ".$computed.", ".$entity.", ".$langfile.", ".$enabled.", ".$totalizable);
@ -759,6 +762,7 @@ class ExtraFields
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Load array this->attributes, or old this->attribute_xxx like attribute_label, attribute_type, ... * Load array this->attributes, or old this->attribute_xxx like attribute_label, attribute_type, ...
* *
@ -766,9 +770,9 @@ class ExtraFields
* @param boolean $forceload Force load of extra fields whatever is option MAIN_EXTRAFIELDS_DISABLED. Deprecated. Should not be required. * @param boolean $forceload Force load of extra fields whatever is option MAIN_EXTRAFIELDS_DISABLED. Deprecated. Should not be required.
* @return array Array of attributes keys+label for all extra fields. * @return array Array of attributes keys+label for all extra fields.
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function fetch_name_optionals_label($elementtype,$forceload=false) function fetch_name_optionals_label($elementtype,$forceload=false)
{ {
// phpcs:enable
global $conf; global $conf;
if (empty($elementtype)) return array(); if (empty($elementtype)) return array();

View File

@ -261,6 +261,7 @@ class Fiscalyear extends CommonObject
return $this->LibStatut($this->statut,$mode); return $this->LibStatut($this->statut,$mode);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Give a label from a status * Give a label from a status
* *
@ -268,38 +269,38 @@ class Fiscalyear 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 * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short 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)
{ {
return $langs->trans($this->statuts_short[$statut]); return $langs->trans($this->statuts_short[$statut]);
} }
if ($mode == 2) elseif ($mode == 2)
{ {
if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts_short[$statut]); if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts_short[$statut]);
if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut8').' '.$langs->trans($this->statuts_short[$statut]); elseif ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut8').' '.$langs->trans($this->statuts_short[$statut]);
} }
if ($mode == 3) elseif ($mode == 3)
{ {
if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4'); if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4');
if ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut8'); elseif ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut8');
} }
if ($mode == 4) elseif ($mode == 4)
{ {
if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts[$statut]); if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts[$statut]);
if ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut8').' '.$langs->trans($this->statuts[$statut]); elseif ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut8').' '.$langs->trans($this->statuts[$statut]);
} }
if ($mode == 5) elseif ($mode == 5)
{ {
if ($statut==0 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut4'); if ($statut==0 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut4');
if ($statut==1 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6'); elseif ($statut==1 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6');
} }
} }

View File

@ -654,6 +654,7 @@ class Form
return $ret; return $ret;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return combo list of activated countries, into language of user * Return combo list of activated countries, into language of user
* *
@ -667,9 +668,9 @@ class Form
* @param int $disablefavorites Disable favorites * @param int $disablefavorites Disable favorites
* @return string HTML string with select * @return string HTML string with select
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_country($selected='', $htmlname='country_id', $htmloption='', $maxlength=0, $morecss='minwidth300', $usecodeaskey='', $showempty=1, $disablefavorites=0) function select_country($selected='', $htmlname='country_id', $htmloption='', $maxlength=0, $morecss='minwidth300', $usecodeaskey='', $showempty=1, $disablefavorites=0)
{ {
// phpcs:enable
global $conf,$langs; global $conf,$langs;
$langs->load("dict"); $langs->load("dict");
@ -751,6 +752,7 @@ class Form
return $out; return $out;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return select list of incoterms * Return select list of incoterms
* *
@ -763,9 +765,9 @@ class Form
* @param array $events Event options to run on change. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled'))) * @param array $events Event options to run on change. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
* @return string HTML string with select and input * @return string HTML string with select and input
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_incoterms($selected='', $location_incoterms='', $page='', $htmlname='incoterm_id', $htmloption='', $forcecombo=1, $events=array()) function select_incoterms($selected='', $location_incoterms='', $page='', $htmlname='incoterm_id', $htmloption='', $forcecombo=1, $events=array())
{ {
// phpcs:enable
global $conf,$langs; global $conf,$langs;
$langs->load("dict"); $langs->load("dict");
@ -844,6 +846,7 @@ class Form
return $out; return $out;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of types of lines (product or service) * Return list of types of lines (product or service)
* Example: 0=product, 1=service, 9=other (for external module) * Example: 0=product, 1=service, 9=other (for external module)
@ -855,9 +858,9 @@ class Form
* @param integer $forceall 1=Force to show products and services in combo list, whatever are activated modules, 0=No force, -1=Force none (and set hidden field to 'service') * @param integer $forceall 1=Force to show products and services in combo list, whatever are activated modules, 0=No force, -1=Force none (and set hidden field to 'service')
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_type_of_lines($selected='',$htmlname='type',$showempty=0,$hidetext=0,$forceall=0) function select_type_of_lines($selected='',$htmlname='type',$showempty=0,$hidetext=0,$forceall=0)
{ {
// phpcs:enable
global $db,$langs,$user,$conf; global $db,$langs,$user,$conf;
// If product & services are enabled or both disabled. // If product & services are enabled or both disabled.
@ -900,14 +903,15 @@ class Form
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Load into cache cache_types_fees, array of types of fees * Load into cache cache_types_fees, array of types of fees
* *
* @return int Nb of lines loaded, <0 if KO * @return int Nb of lines loaded, <0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function load_cache_types_fees() function load_cache_types_fees()
{ {
// phpcs:enable
global $langs; global $langs;
$num = count($this->cache_types_fees); $num = count($this->cache_types_fees);
@ -948,6 +952,7 @@ class Form
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of types of notes * Return list of types of notes
* *
@ -956,9 +961,9 @@ class Form
* @param int $showempty Add an empty field * @param int $showempty Add an empty field
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_type_fees($selected='',$htmlname='type',$showempty=0) function select_type_fees($selected='',$htmlname='type',$showempty=0)
{ {
// phpcs:enable
global $user, $langs; global $user, $langs;
dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
@ -987,6 +992,7 @@ class Form
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return HTML code to select a company. * Return HTML code to select a company.
* *
@ -999,12 +1005,13 @@ class Form
* @return string Return select box for thirdparty. * @return string Return select box for thirdparty.
* @deprecated 3.8 Use select_company instead. For exemple $form->select_thirdparty(GETPOST('socid'),'socid','',0) => $form->select_company(GETPOST('socid'),'socid','',1,0,0,array(),0) * @deprecated 3.8 Use select_company instead. For exemple $form->select_thirdparty(GETPOST('socid'),'socid','',0) => $form->select_company(GETPOST('socid'),'socid','',1,0,0,array(),0)
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_thirdparty($selected='', $htmlname='socid', $filter='', $limit=20, $ajaxoptions=array(), $forcecombo=0) function select_thirdparty($selected='', $htmlname='socid', $filter='', $limit=20, $ajaxoptions=array(), $forcecombo=0)
{ {
// phpcs:enable
return $this->select_thirdparty_list($selected,$htmlname,$filter,1,0,$forcecombo,array(),'',0, $limit); return $this->select_thirdparty_list($selected,$htmlname,$filter,1,0,$forcecombo,array(),'',0, $limit);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Output html form to select a third party * Output html form to select a third party
* *
@ -1024,9 +1031,9 @@ class Form
* @param bool $multiple add [] in the name of element and add 'multiple' attribut (not working with ajax_autocompleter) * @param bool $multiple add [] in the name of element and add 'multiple' attribut (not working with ajax_autocompleter)
* @return string HTML string with select box for thirdparty. * @return string HTML string with select box for thirdparty.
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_company($selected='', $htmlname='socid', $filter='', $showempty='', $showtype=0, $forcecombo=0, $events=array(), $limit=0, $morecss='minwidth100', $moreparam='', $selected_input_value='', $hidelabel=1, $ajaxoptions=array(), $multiple=false) function select_company($selected='', $htmlname='socid', $filter='', $showempty='', $showtype=0, $forcecombo=0, $events=array(), $limit=0, $morecss='minwidth100', $moreparam='', $selected_input_value='', $hidelabel=1, $ajaxoptions=array(), $multiple=false)
{ {
// phpcs:enable
global $conf,$user,$langs; global $conf,$user,$langs;
$out=''; $out='';
@ -1068,6 +1075,7 @@ class Form
return $out; return $out;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Output html form to select a third party. * Output html form to select a third party.
* Note, you must use the select_company to get the component to select a third party. This function must only be called by select_company. * Note, you must use the select_company to get the component to select a third party. This function must only be called by select_company.
@ -1087,9 +1095,9 @@ class Form
* @param bool $multiple add [] in the name of element and add 'multiple' attribut * @param bool $multiple add [] in the name of element and add 'multiple' attribut
* @return string HTML string with * @return string HTML string with
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_thirdparty_list($selected='',$htmlname='socid',$filter='',$showempty='', $showtype=0, $forcecombo=0, $events=array(), $filterkey='', $outputmode=0, $limit=0, $morecss='minwidth100', $moreparam='', $multiple=false) function select_thirdparty_list($selected='',$htmlname='socid',$filter='',$showempty='', $showtype=0, $forcecombo=0, $events=array(), $filterkey='', $outputmode=0, $limit=0, $morecss='minwidth100', $moreparam='', $multiple=false)
{ {
// phpcs:enable
global $conf,$user,$langs; global $conf,$user,$langs;
$out=''; $out='';
@ -1250,6 +1258,7 @@ class Form
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return HTML combo list of absolute discounts * Return HTML combo list of absolute discounts
* *
@ -1260,9 +1269,9 @@ class Form
* @param int $maxvalue Max value for lines that can be selected * @param int $maxvalue Max value for lines that can be selected
* @return int Return number of qualifed lines in list * @return int Return number of qualifed lines in list
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_remises($selected, $htmlname, $filter, $socid, $maxvalue=0) function select_remises($selected, $htmlname, $filter, $socid, $maxvalue=0)
{ {
// phpcs:enable
global $langs,$conf; global $langs,$conf;
// On recherche les remises // On recherche les remises
@ -1326,6 +1335,7 @@ class Form
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of all contacts (for a third party or all) * Return list of all contacts (for a third party or all)
* *
@ -1346,9 +1356,9 @@ class Form
* @return int <0 if KO, Nb of contact in list if OK * @return int <0 if KO, Nb of contact in list if OK
* @deprected You can use selectcontacts directly (warning order of param was changed) * @deprected You can use selectcontacts directly (warning order of param was changed)
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_contacts($socid,$selected='',$htmlname='contactid',$showempty=0,$exclude='',$limitto='',$showfunction=0, $moreclass='', $showsoc=0, $forcecombo=0, $events=array(), $options_only=false, $moreparam='', $htmlid='') function select_contacts($socid,$selected='',$htmlname='contactid',$showempty=0,$exclude='',$limitto='',$showfunction=0, $moreclass='', $showsoc=0, $forcecombo=0, $events=array(), $options_only=false, $moreparam='', $htmlid='')
{ {
// phpcs:enable
print $this->selectcontacts($socid,$selected,$htmlname,$showempty,$exclude,$limitto,$showfunction, $moreclass, $options_only, $showsoc, $forcecombo, $events, $moreparam, $htmlid); print $this->selectcontacts($socid,$selected,$htmlname,$showempty,$exclude,$limitto,$showfunction, $moreclass, $options_only, $showsoc, $forcecombo, $events, $moreparam, $htmlid);
return $this->num; return $this->num;
} }
@ -1486,6 +1496,7 @@ class Form
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return select list of users * Return select list of users
* *
@ -1501,12 +1512,13 @@ class Form
* @deprecated Use select_dolusers instead * @deprecated Use select_dolusers instead
* @see select_dolusers() * @see select_dolusers()
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_users($selected='',$htmlname='userid',$show_empty=0,$exclude=null,$disabled=0,$include='',$enableonly='',$force_entity='0') function select_users($selected='',$htmlname='userid',$show_empty=0,$exclude=null,$disabled=0,$include='',$enableonly='',$force_entity='0')
{ {
// phpcs:enable
print $this->select_dolusers($selected,$htmlname,$show_empty,$exclude,$disabled,$include,$enableonly,$force_entity); print $this->select_dolusers($selected,$htmlname,$show_empty,$exclude,$disabled,$include,$enableonly,$force_entity);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return select list of users * Return select list of users
* *
@ -1530,9 +1542,9 @@ class Form
* @return string HTML select string * @return string HTML select string
* @see select_dolgroups * @see select_dolgroups
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_dolusers($selected='', $htmlname='userid', $show_empty=0, $exclude=null, $disabled=0, $include='', $enableonly='', $force_entity='0', $maxlength=0, $showstatus=0, $morefilter='', $show_every=0, $enableonlytext='', $morecss='', $noactive=0, $outputmode=0, $multiple=false) function select_dolusers($selected='', $htmlname='userid', $show_empty=0, $exclude=null, $disabled=0, $include='', $enableonly='', $force_entity='0', $maxlength=0, $showstatus=0, $morefilter='', $show_every=0, $enableonlytext='', $morecss='', $noactive=0, $outputmode=0, $multiple=false)
{ {
// phpcs:enable
global $conf,$user,$langs; global $conf,$user,$langs;
// If no preselected user defined, we take current user // If no preselected user defined, we take current user
@ -1715,6 +1727,7 @@ class Form
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return select list of users. Selected users are stored into session. * Return select list of users. Selected users are stored into session.
* List of users are provided into $_SESSION['assignedtouser']. * List of users are provided into $_SESSION['assignedtouser'].
@ -1737,9 +1750,9 @@ class Form
* @return string HTML select string * @return string HTML select string
* @see select_dolgroups * @see select_dolgroups
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_dolusers_forevent($action='', $htmlname='userid', $show_empty=0, $exclude=null, $disabled=0, $include='', $enableonly='', $force_entity='0', $maxlength=0, $showstatus=0, $morefilter='', $showproperties=0, $listofuserid=array(), $listofcontactid=array(), $listofotherid=array()) function select_dolusers_forevent($action='', $htmlname='userid', $show_empty=0, $exclude=null, $disabled=0, $include='', $enableonly='', $force_entity='0', $maxlength=0, $showstatus=0, $morefilter='', $showproperties=0, $listofuserid=array(), $listofcontactid=array(), $listofotherid=array())
{ {
// phpcs:enable
global $conf, $user, $langs; global $conf, $user, $langs;
$userstatic=new User($this->db); $userstatic=new User($this->db);
@ -1804,6 +1817,7 @@ class Form
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of products for customer in Ajax if Ajax activated or go to select_produits_list * Return list of products for customer in Ajax if Ajax activated or go to select_produits_list
* *
@ -1829,9 +1843,9 @@ class Form
* @param array $selected_combinations Selected combinations. Format: array([attrid] => attrval, [...]) * @param array $selected_combinations Selected combinations. Format: array([attrid] => attrval, [...])
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_produits($selected='', $htmlname='productid', $filtertype='', $limit=20, $price_level=0, $status=1, $finished=2, $selected_input_value='', $hidelabel=0, $ajaxoptions=array(), $socid=0, $showempty='1', $forcecombo=0, $morecss='', $hidepriceinlabel=0, $warehouseStatus='', $selected_combinations = array()) function select_produits($selected='', $htmlname='productid', $filtertype='', $limit=20, $price_level=0, $status=1, $finished=2, $selected_input_value='', $hidelabel=0, $ajaxoptions=array(), $socid=0, $showempty='1', $forcecombo=0, $morecss='', $hidepriceinlabel=0, $warehouseStatus='', $selected_combinations = array())
{ {
// phpcs:enable
global $langs,$conf; global $langs,$conf;
$price_level = (! empty($price_level) ? $price_level : 0); $price_level = (! empty($price_level) ? $price_level : 0);
@ -1947,6 +1961,7 @@ class Form
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of products for a customer * Return list of products for a customer
* *
@ -1970,9 +1985,9 @@ class Form
* 'warehouseinternal' = select products from warehouses for internal correct/transfer only * 'warehouseinternal' = select products from warehouses for internal correct/transfer only
* @return array Array of keys for json * @return array Array of keys for json
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_produits_list($selected='',$htmlname='productid',$filtertype='',$limit=20,$price_level=0,$filterkey='',$status=1,$finished=2,$outputmode=0,$socid=0,$showempty='1',$forcecombo=0,$morecss='',$hidepriceinlabel=0, $warehouseStatus='') function select_produits_list($selected='',$htmlname='productid',$filtertype='',$limit=20,$price_level=0,$filterkey='',$status=1,$finished=2,$outputmode=0,$socid=0,$showempty='1',$forcecombo=0,$morecss='',$hidepriceinlabel=0, $warehouseStatus='')
{ {
// phpcs:enable
global $langs,$conf,$user,$db; global $langs,$conf,$user,$db;
$out=''; $out='';
@ -2434,6 +2449,7 @@ class Form
$optJson = array('key'=>$outkey, 'value'=>$outref, 'label'=>$outval, 'label2'=>$outlabel, 'desc'=>$outdesc, 'type'=>$outtype, 'price_ht'=>$outprice_ht, 'price_ttc'=>$outprice_ttc, 'pricebasetype'=>$outpricebasetype, 'tva_tx'=>$outtva_tx, 'qty'=>$outqty, 'discount'=>$outdiscount, 'duration_value'=>$outdurationvalue, 'duration_unit'=>$outdurationunit); $optJson = array('key'=>$outkey, 'value'=>$outref, 'label'=>$outval, 'label2'=>$outlabel, 'desc'=>$outdesc, 'type'=>$outtype, 'price_ht'=>$outprice_ht, 'price_ttc'=>$outprice_ttc, 'pricebasetype'=>$outpricebasetype, 'tva_tx'=>$outtva_tx, 'qty'=>$outqty, 'discount'=>$outdiscount, 'duration_value'=>$outdurationvalue, 'duration_unit'=>$outdurationunit);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of products for customer (in Ajax if Ajax activated or go to select_produits_fournisseurs_list) * Return list of products for customer (in Ajax if Ajax activated or go to select_produits_fournisseurs_list)
* *
@ -2447,9 +2463,9 @@ class Form
* @param int $alsoproductwithnosupplierprice 1=Add also product without supplier prices * @param int $alsoproductwithnosupplierprice 1=Add also product without supplier prices
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_produits_fournisseurs($socid, $selected='', $htmlname='productid', $filtertype='', $filtre='', $ajaxoptions=array(), $hidelabel=0, $alsoproductwithnosupplierprice=0) function select_produits_fournisseurs($socid, $selected='', $htmlname='productid', $filtertype='', $filtre='', $ajaxoptions=array(), $hidelabel=0, $alsoproductwithnosupplierprice=0)
{ {
// phpcs:enable
global $langs,$conf; global $langs,$conf;
global $price_level, $status, $finished; global $price_level, $status, $finished;
@ -2476,6 +2492,7 @@ class Form
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of suppliers products * Return list of suppliers products
* *
@ -2491,9 +2508,9 @@ class Form
* @param int $alsoproductwithnosupplierprice 1=Add also product without supplier prices * @param int $alsoproductwithnosupplierprice 1=Add also product without supplier prices
* @return array Array of keys for json * @return array Array of keys for json
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_produits_fournisseurs_list($socid,$selected='',$htmlname='productid',$filtertype='',$filtre='',$filterkey='',$statut=-1,$outputmode=0,$limit=100,$alsoproductwithnosupplierprice=0) function select_produits_fournisseurs_list($socid,$selected='',$htmlname='productid',$filtertype='',$filtre='',$filterkey='',$statut=-1,$outputmode=0,$limit=100,$alsoproductwithnosupplierprice=0)
{ {
// phpcs:enable
global $langs,$conf,$db; global $langs,$conf,$db;
$out=''; $out='';
@ -2706,6 +2723,7 @@ class Form
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of suppliers prices for a product * Return list of suppliers prices for a product
* *
@ -2714,9 +2732,9 @@ class Form
* @param int $selected_supplier Pre-selected supplier if more than 1 result * @param int $selected_supplier Pre-selected supplier if more than 1 result
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_product_fourn_price($productid, $htmlname='productfournpriceid', $selected_supplier='') function select_product_fourn_price($productid, $htmlname='productfournpriceid', $selected_supplier='')
{ {
// phpcs:enable
global $langs,$conf; global $langs,$conf;
$langs->load('stocks'); $langs->load('stocks');
@ -2818,6 +2836,7 @@ class Form
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of delivery address * Return list of delivery address
* *
@ -2827,10 +2846,10 @@ class Form
* @param int $showempty Add an empty field * @param int $showempty Add an empty field
* @return integer|null * @return integer|null
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_address($selected, $socid, $htmlname='address_id',$showempty=0) function select_address($selected, $socid, $htmlname='address_id',$showempty=0)
{ {
// On recherche les utilisateurs // phpcs:enable
// looking for users
$sql = "SELECT a.rowid, a.label"; $sql = "SELECT a.rowid, a.label";
$sql .= " FROM ".MAIN_DB_PREFIX ."societe_address as a"; $sql .= " FROM ".MAIN_DB_PREFIX ."societe_address as a";
$sql .= " WHERE a.fk_soc = ".$socid; $sql .= " WHERE a.fk_soc = ".$socid;
@ -2871,14 +2890,15 @@ class Form
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Load into cache list of payment terms * Load into cache list of payment terms
* *
* @return int Nb of lines loaded, <0 if KO * @return int Nb of lines loaded, <0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function load_cache_conditions_paiements() function load_cache_conditions_paiements()
{ {
// phpcs:enable
global $langs; global $langs;
$num = count($this->cache_conditions_paiements); $num = count($this->cache_conditions_paiements);
@ -2919,14 +2939,15 @@ class Form
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Charge dans cache la liste des délais de livraison possibles * Charge dans cache la liste des délais de livraison possibles
* *
* @return int Nb of lines loaded, <0 if KO * @return int Nb of lines loaded, <0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function load_cache_availability() function load_cache_availability()
{ {
// phpcs:enable
global $langs; global $langs;
$num = count($this->cache_availability); $num = count($this->cache_availability);
@ -3086,14 +3107,15 @@ class Form
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Charge dans cache la liste des types de paiements possibles * Charge dans cache la liste des types de paiements possibles
* *
* @return int Nb of lines loaded, <0 if KO * @return int Nb of lines loaded, <0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function load_cache_types_paiements() function load_cache_types_paiements()
{ {
// phpcs:enable
global $langs; global $langs;
$num=count($this->cache_types_paiements); $num=count($this->cache_types_paiements);
@ -3139,6 +3161,7 @@ class Form
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of payment modes. * Return list of payment modes.
* Constant MAIN_DEFAULT_PAYMENT_TERM_ID can used to set default value but scope is all application, probably not what you want. * Constant MAIN_DEFAULT_PAYMENT_TERM_ID can used to set default value but scope is all application, probably not what you want.
@ -3152,9 +3175,9 @@ class Form
* @param string $morecss Add more CSS on select tag * @param string $morecss Add more CSS on select tag
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_conditions_paiements($selected=0, $htmlname='condid', $filtertype=-1, $addempty=0, $noinfoadmin=0, $morecss='') function select_conditions_paiements($selected=0, $htmlname='condid', $filtertype=-1, $addempty=0, $noinfoadmin=0, $morecss='')
{ {
// phpcs:enable
global $langs, $user, $conf; global $langs, $user, $conf;
dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
@ -3184,6 +3207,7 @@ class Form
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of payment methods * Return list of payment methods
* *
@ -3198,9 +3222,9 @@ class Form
* @param string $morecss Add more CSS on select tag * @param string $morecss Add more CSS on select tag
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_types_paiements($selected='', $htmlname='paiementtype', $filtertype='', $format=0, $empty=1, $noadmininfo=0, $maxlength=0, $active=1, $morecss='') function select_types_paiements($selected='', $htmlname='paiementtype', $filtertype='', $format=0, $empty=1, $noadmininfo=0, $maxlength=0, $active=1, $morecss='')
{ {
// phpcs:enable
global $langs,$user; global $langs,$user;
dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$filtertype.", ".$format, LOG_DEBUG); dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$filtertype.", ".$format, LOG_DEBUG);
@ -3460,6 +3484,7 @@ class Form
return $return; return $return;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return a HTML select list of bank accounts * Return a HTML select list of bank accounts
* *
@ -3472,9 +3497,9 @@ class Form
* @param int $showcurrency Show currency in label * @param int $showcurrency Show currency in label
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_comptes($selected='',$htmlname='accountid',$statut=0,$filtre='',$useempty=0,$moreattrib='',$showcurrency=0) function select_comptes($selected='',$htmlname='accountid',$statut=0,$filtre='',$useempty=0,$moreattrib='',$showcurrency=0)
{ {
// phpcs:enable
global $langs, $conf; global $langs, $conf;
$langs->load("admin"); $langs->load("admin");
@ -3564,6 +3589,7 @@ class Form
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of categories having choosed type * Return list of categories having choosed type
* *
@ -3576,9 +3602,9 @@ class Form
* @return string * @return string
* @see select_categories * @see select_categories
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_all_categories($type, $selected='', $htmlname="parent", $maxlength=64, $excludeafterid=0, $outputmode=0) function select_all_categories($type, $selected='', $htmlname="parent", $maxlength=64, $excludeafterid=0, $outputmode=0)
{ {
// phpcs:enable
global $conf, $langs; global $conf, $langs;
$langs->load("categories"); $langs->load("categories");
@ -3650,6 +3676,7 @@ class Form
return $output; return $output;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Show a confirmation HTML form or AJAX popup * Show a confirmation HTML form or AJAX popup
* *
@ -3666,9 +3693,9 @@ class Form
* @deprecated * @deprecated
* @see formconfirm() * @see formconfirm()
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function form_confirm($page, $title, $question, $action, $formquestion='', $selectedchoice="", $useajax=0, $height=170, $width=500) function form_confirm($page, $title, $question, $action, $formquestion='', $selectedchoice="", $useajax=0, $height=170, $width=500)
{ {
// phpcs:enable
print $this->formconfirm($page, $title, $question, $action, $formquestion, $selectedchoice, $useajax, $height, $width); print $this->formconfirm($page, $title, $question, $action, $formquestion, $selectedchoice, $useajax, $height, $width);
} }
@ -3962,6 +3989,7 @@ class Form
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Show a form to select a project * Show a form to select a project
* *
@ -3975,9 +4003,9 @@ class Form
* @param int $nooutput No print is done. String is returned. * @param int $nooutput No print is done. String is returned.
* @return string Return html content * @return string Return html content
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function form_project($page, $socid, $selected='', $htmlname='projectid', $discard_closed=0, $maxlength=20, $forcefocus=0, $nooutput=0) function form_project($page, $socid, $selected='', $htmlname='projectid', $discard_closed=0, $maxlength=20, $forcefocus=0, $nooutput=0)
{ {
// phpcs:enable
global $langs; global $langs;
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
@ -4021,6 +4049,7 @@ class Form
return $out; return $out;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Show a form to select payment conditions * Show a form to select payment conditions
* *
@ -4030,9 +4059,9 @@ class Form
* @param int $addempty Add empty entry * @param int $addempty Add empty entry
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function form_conditions_reglement($page, $selected='', $htmlname='cond_reglement_id', $addempty=0) function form_conditions_reglement($page, $selected='', $htmlname='cond_reglement_id', $addempty=0)
{ {
// phpcs:enable
global $langs; global $langs;
if ($htmlname != "none") if ($htmlname != "none")
{ {
@ -4055,6 +4084,7 @@ class Form
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Show a form to select a delivery delay * Show a form to select a delivery delay
* *
@ -4064,9 +4094,9 @@ class Form
* @param int $addempty Ajoute entree vide * @param int $addempty Ajoute entree vide
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function form_availability($page, $selected='', $htmlname='availability', $addempty=0) function form_availability($page, $selected='', $htmlname='availability', $addempty=0)
{ {
// phpcs:enable
global $langs; global $langs;
if ($htmlname != "none") if ($htmlname != "none")
{ {
@ -4130,6 +4160,7 @@ class Form
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Show a form + html select a date * Show a form + html select a date
* *
@ -4142,9 +4173,9 @@ class Form
* @return string * @return string
* @see selectDate * @see selectDate
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function form_date($page, $selected, $htmlname, $displayhour=0, $displaymin=0, $nooutput=0) function form_date($page, $selected, $htmlname, $displayhour=0, $displaymin=0, $nooutput=0)
{ {
// phpcs:enable
global $langs; global $langs;
$ret=''; $ret='';
@ -4172,6 +4203,7 @@ class Form
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Show a select form to choose a user * Show a select form to choose a user
* *
@ -4182,9 +4214,9 @@ class Form
* @param array $include List of users id to include * @param array $include List of users id to include
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function form_users($page, $selected='', $htmlname='userid', $exclude='', $include='') function form_users($page, $selected='', $htmlname='userid', $exclude='', $include='')
{ {
// phpcs:enable
global $langs; global $langs;
if ($htmlname != "none") if ($htmlname != "none")
@ -4211,6 +4243,7 @@ class Form
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Show form with payment mode * Show form with payment mode
* *
@ -4221,9 +4254,9 @@ class Form
* @param int $active Active or not, -1 = all * @param int $active Active or not, -1 = all
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function form_modes_reglement($page, $selected='', $htmlname='mode_reglement_id', $filtertype='', $active=1) function form_modes_reglement($page, $selected='', $htmlname='mode_reglement_id', $filtertype='', $active=1)
{ {
// phpcs:enable
global $langs; global $langs;
if ($htmlname != "none") if ($htmlname != "none")
{ {
@ -4246,6 +4279,7 @@ class Form
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Show form with multicurrency code * Show form with multicurrency code
* *
@ -4254,9 +4288,9 @@ class Form
* @param string $htmlname Name of select html field * @param string $htmlname Name of select html field
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function form_multicurrency_code($page, $selected='', $htmlname='multicurrency_code') function form_multicurrency_code($page, $selected='', $htmlname='multicurrency_code')
{ {
// phpcs:enable
global $langs; global $langs;
if ($htmlname != "none") if ($htmlname != "none")
{ {
@ -4274,6 +4308,7 @@ class Form
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Show form with multicurrency rate * Show form with multicurrency rate
* *
@ -4283,9 +4318,9 @@ class Form
* @param string $currency Currency code to explain the rate * @param string $currency Currency code to explain the rate
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function form_multicurrency_rate($page, $rate='', $htmlname='multicurrency_tx', $currency='') function form_multicurrency_rate($page, $rate='', $htmlname='multicurrency_tx', $currency='')
{ {
// phpcs:enable
global $langs, $mysoc, $conf; global $langs, $mysoc, $conf;
if ($htmlname != "none") if ($htmlname != "none")
@ -4316,6 +4351,7 @@ class Form
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Show a select box with available absolute discounts * Show a select box with available absolute discounts
* *
@ -4331,9 +4367,9 @@ class Form
* @param int $discount_type 0 => customer discount, 1 => supplier discount * @param int $discount_type 0 => customer discount, 1 => supplier discount
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function form_remise_dispo($page, $selected, $htmlname, $socid, $amount, $filter='', $maxvalue=0, $more='', $hidelist=0, $discount_type=0) function form_remise_dispo($page, $selected, $htmlname, $socid, $amount, $filter='', $maxvalue=0, $more='', $hidelist=0, $discount_type=0)
{ {
// phpcs:enable
global $conf,$langs; global $conf,$langs;
if ($htmlname != "none") if ($htmlname != "none")
{ {
@ -4412,6 +4448,7 @@ class Form
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Show forms to select a contact * Show forms to select a contact
* *
@ -4421,9 +4458,9 @@ class Form
* @param string $htmlname Name of HTML select. If 'none', we just show contact link. * @param string $htmlname Name of HTML select. If 'none', we just show contact link.
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function form_contacts($page, $societe, $selected='', $htmlname='contactid') function form_contacts($page, $societe, $selected='', $htmlname='contactid')
{ {
// phpcs:enable
global $langs, $conf; global $langs, $conf;
if ($htmlname != "none") if ($htmlname != "none")
@ -4457,6 +4494,7 @@ class Form
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Output html select to select thirdparty * Output html select to select thirdparty
* *
@ -4470,9 +4508,9 @@ class Form
* @param array $events Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled'))) * @param array $events Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function form_thirdparty($page, $selected='', $htmlname='socid', $filter='',$showempty=0, $showtype=0, $forcecombo=0, $events=array()) function form_thirdparty($page, $selected='', $htmlname='socid', $filter='',$showempty=0, $showtype=0, $forcecombo=0, $events=array())
{ {
// phpcs:enable
global $langs; global $langs;
if ($htmlname != "none") if ($htmlname != "none")
@ -4500,6 +4538,7 @@ class Form
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Retourne la liste des devises, dans la langue de l'utilisateur * Retourne la liste des devises, dans la langue de l'utilisateur
* *
@ -4507,9 +4546,9 @@ class Form
* @param string $htmlname name of HTML select list * @param string $htmlname name of HTML select list
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_currency($selected='',$htmlname='currency_id') function select_currency($selected='',$htmlname='currency_id')
{ {
// phpcs:enable
print $this->selectCurrency($selected,$htmlname); print $this->selectCurrency($selected,$htmlname);
} }
@ -4612,15 +4651,16 @@ class Form
return $out; return $out;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Load into the cache vat rates of a country * Load into the cache vat rates of a country
* *
* @param string $country_code Country code with quotes ("'CA'", or "'CA,IN,...'") * @param string $country_code Country code with quotes ("'CA'", or "'CA,IN,...'")
* @return int Nb of loaded lines, 0 if already loaded, <0 if KO * @return int Nb of loaded lines, 0 if already loaded, <0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function load_cache_vatrates($country_code) function load_cache_vatrates($country_code)
{ {
// phpcs:enable
global $langs; global $langs;
$num = count($this->cache_vatrates); $num = count($this->cache_vatrates);
@ -4678,6 +4718,7 @@ class Form
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Output an HTML select vat rate. * Output an HTML select vat rate.
* The name of this function should be selectVat. We keep bad name for compatibility purpose. * The name of this function should be selectVat. We keep bad name for compatibility purpose.
@ -4699,9 +4740,9 @@ class Form
* @param int $mode 0=Use vat rate as key in combo list, 1=Add VAT code after vat rate into key, -1=Use id of vat line as key * @param int $mode 0=Use vat rate as key in combo list, 1=Add VAT code after vat rate into key, -1=Use id of vat line as key
* @return string * @return string
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function load_tva($htmlname='tauxtva', $selectedrate='', $societe_vendeuse='', $societe_acheteuse='', $idprod=0, $info_bits=0, $type='', $options_only=false, $mode=0) function load_tva($htmlname='tauxtva', $selectedrate='', $societe_vendeuse='', $societe_acheteuse='', $idprod=0, $info_bits=0, $type='', $options_only=false, $mode=0)
{ {
// phpcs:enable
global $langs,$conf,$mysoc; global $langs,$conf,$mysoc;
$langs->load('errors'); $langs->load('errors');
@ -4866,8 +4907,9 @@ class Form
} }
/** // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
* Show a HTML widget to input a date or combo list for day, month, years and optionaly hours and minutes. /**
* Show a HTML widget to input a date or combo list for day, month, years and optionaly hours and minutes.
* Fields are preselected with : * Fields are preselected with :
* - set_time date (must be a local PHP server timestamp or string date with format 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM') * - set_time date (must be a local PHP server timestamp or string date with format 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM')
* - local date in user area, if set_time is '' (so if set_time is '', output may differs when done from two different location) * - local date in user area, if set_time is '' (so if set_time is '', output may differs when done from two different location)
@ -4890,14 +4932,16 @@ class Form
* @deprecated * @deprecated
* @see form_date, select_month, select_year, select_dayofweek * @see form_date, select_month, select_year, select_dayofweek
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_date($set_time='', $prefix='re', $h=0, $m=0, $empty=0, $form_name="", $d=1, $addnowlink=0, $nooutput=0, $disabled=0, $fullday='', $addplusone='', $adddateof='') function select_date($set_time='', $prefix='re', $h=0, $m=0, $empty=0, $form_name="", $d=1, $addnowlink=0, $nooutput=0, $disabled=0, $fullday='', $addplusone='', $adddateof='')
{ {
$retstring = selectDate($set_time='', $prefix='re', $h=0, $m=0, $empty=0, $form_name="", $d=1, $addnowlink=0, $disabled=0, $fullday='', $addplusone='', $adddateof=''); // phpcs:enable
if (! empty($nooutput)) return $retstring; $retstring = $this->selectDate($set_time='', $prefix='re', $h=0, $m=0, $empty=0, $form_name="", $d=1, $addnowlink=0, $disabled=0, $fullday='', $addplusone='', $adddateof='');
if (! empty($nooutput)) {
return $retstring;
}
print $retstring; print $retstring;
return; return;
} }
/** /**
@ -4928,9 +4972,9 @@ class Form
$retstring=''; $retstring='';
if($prefix=='') $prefix='re'; if ($prefix=='') $prefix='re';
if($h == '') $h=0; if ($h == '') $h=0;
if($m == '') $m=0; if ($m == '') $m=0;
$emptydate=0; $emptydate=0;
$emptyhours=0; $emptyhours=0;
if ($empty == 1) { $emptydate=1; $emptyhours=1; } if ($empty == 1) { $emptydate=1; $emptyhours=1; }
@ -5271,6 +5315,7 @@ class Form
return $retstring; return $retstring;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Function to show a form to select a duration on a page * Function to show a form to select a duration on a page
* *
@ -5284,9 +5329,9 @@ class Form
* @param int $nooutput Do not output html string but return it * @param int $nooutput Do not output html string but return it
* @return string|null * @return string|null
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_duration($prefix, $iSecond='', $disabled=0, $typehour='select', $minunderhours=0, $nooutput=0) function select_duration($prefix, $iSecond='', $disabled=0, $typehour='select', $minunderhours=0, $nooutput=0)
{ {
// phpcs:enable
global $langs; global $langs;
$retstring=''; $retstring='';
@ -6470,6 +6515,7 @@ class Form
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of export templates * Return list of export templates
* *
@ -6479,10 +6525,9 @@ class Form
* @param int $useempty Affiche valeur vide dans liste * @param int $useempty Affiche valeur vide dans liste
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_export_model($selected='',$htmlname='exportmodelid',$type='',$useempty=0) function select_export_model($selected='',$htmlname='exportmodelid',$type='',$useempty=0)
{ {
// phpcs:enable
$sql = "SELECT rowid, label"; $sql = "SELECT rowid, label";
$sql.= " FROM ".MAIN_DB_PREFIX."export_model"; $sql.= " FROM ".MAIN_DB_PREFIX."export_model";
$sql.= " WHERE type = '".$type."'"; $sql.= " WHERE type = '".$type."'";
@ -6851,6 +6896,7 @@ class Form
return $ret; return $ret;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return select list of groups * Return select list of groups
* *
@ -6866,9 +6912,9 @@ class Form
* @return string * @return string
* @see select_dolusers * @see select_dolusers
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_dolgroups($selected='', $htmlname='groupid', $show_empty=0, $exclude='', $disabled=0, $include='', $enableonly='', $force_entity='0', $multiple=false) function select_dolgroups($selected='', $htmlname='groupid', $show_empty=0, $exclude='', $disabled=0, $include='', $enableonly='', $force_entity='0', $multiple=false)
{ {
// phpcs:enable
global $conf,$user,$langs; global $conf,$user,$langs;
// Permettre l'exclusion de groupes // Permettre l'exclusion de groupes
@ -6992,17 +7038,22 @@ class Form
$("#checkallactions").click(function() { $("#checkallactions").click(function() {
if($(this).is(\':checked\')){ if($(this).is(\':checked\')){
console.log("We check all"); console.log("We check all");
$(".'.$cssclass.'").prop(\'checked\', true); $(".'.$cssclass.'").prop(\'checked\', true).trigger(\'change\');
} }
else else
{ {
console.log("We uncheck all"); console.log("We uncheck all");
$(".'.$cssclass.'").prop(\'checked\', false); $(".'.$cssclass.'").prop(\'checked\', false).trigger(\'change\');
}'."\n"; }'."\n";
if ($calljsfunction) $out.='if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }'; if ($calljsfunction) $out.='if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }';
$out.=' }); $out.=' });
});
</script>'; $(".checkforselect").change(function() {
$(this).closest("tr").toggleClass("highlight", this.checked);
});
});
</script>';
return $out; return $out;
} }

View File

@ -55,6 +55,7 @@ class FormAccounting extends Form
$this->db = $db; $this->db = $db;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of journals with label by nature * Return list of journals with label by nature
* *
@ -69,9 +70,9 @@ class FormAccounting extends Form
* @param int $disabledajaxcombo Disable ajax combo box. * @param int $disabledajaxcombo Disable ajax combo box.
* @return string String with HTML select * @return string String with HTML select
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_journal($selectid, $htmlname = 'journal', $nature=0, $showempty = 0, $select_in = 0, $select_out = 0, $morecss='maxwidth300 maxwidthonsmartphone', $usecache='', $disabledajaxcombo=0) function select_journal($selectid, $htmlname = 'journal', $nature=0, $showempty = 0, $select_in = 0, $select_out = 0, $morecss='maxwidth300 maxwidthonsmartphone', $usecache='', $disabledajaxcombo=0)
{ {
// phpcs:enable
global $conf,$langs; global $conf,$langs;
$out = ''; $out = '';
@ -137,6 +138,7 @@ class FormAccounting extends Form
return $out; return $out;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of accounting category. * Return list of accounting category.
* Use mysoc->country_id or mysoc->country_code so they must be defined. * Use mysoc->country_id or mysoc->country_code so they must be defined.
@ -149,9 +151,9 @@ class FormAccounting extends Form
* @param int $allcountries All countries * @param int $allcountries All countries
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_accounting_category($selected='',$htmlname='account_category', $useempty=0, $maxlen=0, $help=1, $allcountries=0) function select_accounting_category($selected='',$htmlname='account_category', $useempty=0, $maxlen=0, $help=1, $allcountries=0)
{ {
// phpcs:enable
global $db,$langs,$user,$mysoc; global $db,$langs,$user,$mysoc;
if (empty($mysoc->country_id) && empty($mysoc->country_code) && empty($allcountries)) if (empty($mysoc->country_id) && empty($mysoc->country_code) && empty($allcountries))
@ -218,6 +220,7 @@ class FormAccounting extends Form
print $out; print $out;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return select filter with date of transaction * Return select filter with date of transaction
* *
@ -225,9 +228,9 @@ class FormAccounting extends Form
* @param string $selectedkey Value * @param string $selectedkey Value
* @return string HTML edit field * @return string HTML edit field
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_bookkeeping_importkey($htmlname = 'importkey', $selectedkey = '') function select_bookkeeping_importkey($htmlname = 'importkey', $selectedkey = '')
{ {
// phpcs:enable
$options = array(); $options = array();
$sql = 'SELECT DISTINCT import_key from ' . MAIN_DB_PREFIX . 'accounting_bookkeeping'; $sql = 'SELECT DISTINCT import_key from ' . MAIN_DB_PREFIX . 'accounting_bookkeeping';
@ -250,6 +253,7 @@ class FormAccounting extends Form
return Form::selectarray($htmlname, $options, $selectedkey); return Form::selectarray($htmlname, $options, $selectedkey);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of accounts with label by chart of accounts * Return list of accounts with label by chart of accounts
* *
@ -263,9 +267,9 @@ class FormAccounting extends Form
* @param string $usecache Key to use to store result into a cache. Next call with same key will reuse the cache. * @param string $usecache Key to use to store result into a cache. Next call with same key will reuse the cache.
* @return string String with HTML select * @return string String with HTML select
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_account($selectid, $htmlname = 'account', $showempty = 0, $event = array(), $select_in = 0, $select_out = 0, $morecss='maxwidth300 maxwidthonsmartphone', $usecache='') function select_account($selectid, $htmlname = 'account', $showempty = 0, $event = array(), $select_in = 0, $select_out = 0, $morecss='maxwidth300 maxwidthonsmartphone', $usecache='')
{ {
// phpcs:enable
global $conf, $langs; global $conf, $langs;
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
@ -342,6 +346,7 @@ class FormAccounting extends Form
return $out; return $out;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of auxilary thirdparty accounts * Return list of auxilary thirdparty accounts
* *
@ -351,9 +356,9 @@ class FormAccounting extends Form
* @param string $morecss More css * @param string $morecss More css
* @return string String with HTML select * @return string String with HTML select
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_auxaccount($selectid, $htmlname='account_num_aux', $showempty=0, $morecss='maxwidth200') function select_auxaccount($selectid, $htmlname='account_num_aux', $showempty=0, $morecss='maxwidth200')
{ {
// phpcs:enable
$aux_account = array(); $aux_account = array();
@ -403,6 +408,7 @@ class FormAccounting extends Form
return $out; return $out;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return HTML combo list of years existing into book keepping * Return HTML combo list of years existing into book keepping
* *
@ -412,9 +418,9 @@ class FormAccounting extends Form
* @param string $output_format (html/opton (for option html only)/array (to return options arrays * @param string $output_format (html/opton (for option html only)/array (to return options arrays
* @return string/array * @return string/array
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function selectyear_accountancy_bookkepping($selected = '', $htmlname = 'yearid', $useempty = 0, $output_format = 'html') function selectyear_accountancy_bookkepping($selected = '', $htmlname = 'yearid', $useempty = 0, $output_format = 'html')
{ {
// phpcs:enable
global $conf; global $conf;
$out_array = array(); $out_array = array();

View File

@ -52,6 +52,7 @@ class FormActions
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Show list of action status * Show list of action status
* *
@ -64,9 +65,9 @@ class FormActions
* @param string $morecss More css on select field * @param string $morecss More css on select field
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function form_select_status_action($formname, $selected, $canedit=1, $htmlname='complete', $showempty=0, $onlyselect=0, $morecss='maxwidth100') function form_select_status_action($formname, $selected, $canedit=1, $htmlname='complete', $showempty=0, $onlyselect=0, $morecss='maxwidth100')
{ {
// phpcs:enable
global $langs,$conf; global $langs,$conf;
$listofstatus = array( $listofstatus = array(
@ -314,6 +315,7 @@ class FormActions
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Output html select list of type of event * Output html select list of type of event
* *
@ -326,9 +328,9 @@ class FormActions
* @param int $nooutput 1=No output * @param int $nooutput 1=No output
* @return string * @return string
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_type_actions($selected='', $htmlname='actioncode', $excludetype='', $onlyautoornot=0, $hideinfohelp=0, $multiselect=0, $nooutput=0) function select_type_actions($selected='', $htmlname='actioncode', $excludetype='', $onlyautoornot=0, $hideinfohelp=0, $multiselect=0, $nooutput=0)
{ {
// phpcs:enable
global $langs,$user,$form,$conf; global $langs,$user,$form,$conf;
if (! is_object($form)) $form=new Form($db); if (! is_object($form)) $form=new Form($db);

View File

@ -29,15 +29,8 @@
*/ */
class FormAdmin class FormAdmin
{ {
/** var $db;
* @var DoliDB Database handler. var $error;
*/
public $db;
/**
* @var string Error code (or message)
*/
public $error='';
/** /**
@ -51,6 +44,7 @@ class FormAdmin
return 1; return 1;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return html select list with available languages (key='en_US', value='United States' for example) * Return html select list with available languages (key='en_US', value='United States' for example)
* *
@ -66,9 +60,9 @@ class FormAdmin
* @param int $forcecombo Force to use combo box (so no ajax beautify effect) * @param int $forcecombo Force to use combo box (so no ajax beautify effect)
* @return string Return HTML select string with list of languages * @return string Return HTML select string with list of languages
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_language($selected='', $htmlname='lang_id', $showauto=0, $filter=null, $showempty='', $showwarning=0, $disabled=0, $morecss='', $showcode=0, $forcecombo=0) function select_language($selected='', $htmlname='lang_id', $showauto=0, $filter=null, $showempty='', $showwarning=0, $disabled=0, $morecss='', $showcode=0, $forcecombo=0)
{ {
// phpcs:enable
global $langs; global $langs;
$langs_available=$langs->get_available_languages(DOL_DOCUMENT_ROOT,12); $langs_available=$langs->get_available_languages(DOL_DOCUMENT_ROOT,12);
@ -127,6 +121,7 @@ class FormAdmin
return $out; return $out;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of available menus (eldy_backoffice, ...) * Return list of available menus (eldy_backoffice, ...)
* *
@ -136,9 +131,9 @@ class FormAdmin
* @param string $moreattrib More attributes on html select tag * @param string $moreattrib More attributes on html select tag
* @return integer|null * @return integer|null
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_menu($selected, $htmlname, $dirmenuarray, $moreattrib='') function select_menu($selected, $htmlname, $dirmenuarray, $moreattrib='')
{ {
// phpcs:enable
global $langs,$conf; global $langs,$conf;
// Clean parameters // Clean parameters
@ -217,6 +212,7 @@ class FormAdmin
print '</select>'; print '</select>';
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return combo list of available menu families * Return combo list of available menu families
* *
@ -225,9 +221,9 @@ class FormAdmin
* @param string[] $dirmenuarray Directories to scan * @param string[] $dirmenuarray Directories to scan
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_menu_families($selected, $htmlname, $dirmenuarray) function select_menu_families($selected, $htmlname, $dirmenuarray)
{ {
// phpcs:enable
global $langs,$conf; global $langs,$conf;
//$expdevmenu=array('smartphone_backoffice.php','smartphone_frontoffice.php'); // Menu to disable if $conf->global->MAIN_FEATURES_LEVEL is not set //$expdevmenu=array('smartphone_backoffice.php','smartphone_frontoffice.php'); // Menu to disable if $conf->global->MAIN_FEATURES_LEVEL is not set
@ -289,6 +285,7 @@ class FormAdmin
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return a HTML select list of timezones * Return a HTML select list of timezones
* *
@ -296,9 +293,9 @@ class FormAdmin
* @param string $htmlname Nom de la zone select * @param string $htmlname Nom de la zone select
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_timezone($selected,$htmlname) function select_timezone($selected,$htmlname)
{ {
// phpcs:enable
global $langs,$conf; global $langs,$conf;
print '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'">'; print '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'">';
@ -342,6 +339,7 @@ class FormAdmin
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return html select list with available languages (key='en_US', value='United States' for example) * Return html select list with available languages (key='en_US', value='United States' for example)
* *
@ -351,9 +349,9 @@ class FormAdmin
* @param int $showempty Add empty value * @param int $showempty Add empty value
* @return string Return HTML output * @return string Return HTML output
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_paper_format($selected='',$htmlname='paperformat_id',$filter=0,$showempty=0) function select_paper_format($selected='',$htmlname='paperformat_id',$filter=0,$showempty=0)
{ {
// phpcs:enable
global $langs; global $langs;
$langs->load("dict"); $langs->load("dict");

View File

@ -1,21 +1,22 @@
<?php <?php
/* Copyright (C) 2007-2012 Regis Houssin <regis.houssin@capnetworks.com> /* Copyright (C) 2007-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2008-2012 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2008-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* * Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by * This program is free software; you can redistribute it and/or modify
* the Free Software Foundation; either version 3 of the License, or * it under the terms of the GNU General Public License as published by
* (at your option) any later version. * the Free Software Foundation; either version 3 of the License, or
* * (at your option) any later version.
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of * This program is distributed in the hope that it will be useful,
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * but WITHOUT ANY WARRANTY; without even the implied warranty of
* GNU General Public License for more details. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* * GNU General Public License for more details.
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. * You should have received a copy of the GNU General Public License
* * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ *
*/
/** /**
* \file htdocs/core/class/html.formbarcode.class.php * \file htdocs/core/class/html.formbarcode.class.php
@ -34,15 +35,15 @@ class FormBarCode
public $db; public $db;
/** /**
* @var string Error code (or message) * @var string Error code (or message)
*/ */
public $error=''; public $error='';
/** /**
* Constructor * Constructor
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) function __construct($db)
{ {
@ -103,18 +104,35 @@ class FormBarCode
return $select_encoder; return $select_encoder;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return form to select type of barcode * Print form to select type of barcode
* *
* @param int $selected Id code pre-selected * @param int $selected Id code pre-selected
* @param string $htmlname Name of HTML select field * @param string $htmlname Name of HTML select field
* @param int $useempty Affiche valeur vide dans liste * @param int $useempty Affiche valeur vide dans liste
* @return void * @return void
* @deprecated
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_barcode_type($selected='', $htmlname='barcodetype_id', $useempty=0)
function select_barcode_type($selected='',$htmlname='barcodetype_id',$useempty=0)
{ {
global $langs,$conf; // phpcs:enable
print $this->selectBarcodeType($selected, $htmlname, $useempty);
}
/**
* Return html form to select type of barcode
*
* @param int $selected Id code pre-selected
* @param string $htmlname Name of HTML select field
* @param int $useempty Display empty value in select
* @return string
*/
function selectBarcodeType($selected='', $htmlname='barcodetype_id', $useempty=0)
{
global $langs, $conf;
$out = '';
$sql = "SELECT rowid, code, libelle"; $sql = "SELECT rowid, code, libelle";
$sql.= " FROM ".MAIN_DB_PREFIX."c_barcode_type"; $sql.= " FROM ".MAIN_DB_PREFIX."c_barcode_type";
@ -123,46 +141,40 @@ class FormBarCode
$sql.= " ORDER BY code"; $sql.= " ORDER BY code";
$result = $this->db->query($sql); $result = $this->db->query($sql);
if ($result) if ($result) {
{
$num = $this->db->num_rows($result); $num = $this->db->num_rows($result);
$i = 0; $i = 0;
if ($useempty && $num > 0) if ($useempty && $num > 0) {
{ $out .= '<select class="flat minwidth75imp" name="' . $htmlname . '" id="select_' . $htmlname . '">';
print '<select class="flat minwidth75imp" name="'.$htmlname.'" id="select_'.$htmlname.'">'; $out .= '<option value="0">&nbsp;</option>';
print '<option value="0">&nbsp;</option>'; } else {
}
else
{
$langs->load("errors"); $langs->load("errors");
print '<select disabled class="flat minwidth75imp" name="'.$htmlname.'" id="select_'.$htmlname.'">'; $out .= '<select disabled class="flat minwidth75imp" name="' . $htmlname . '" id="select_' . $htmlname . '">';
print '<option value="0" selected>'.$langs->trans('ErrorNoActivatedBarcode').'</option>'; $out .= '<option value="0" selected>' . $langs->trans('ErrorNoActivatedBarcode') . '</option>';
} }
while ($i < $num) while ($i < $num) {
{
$obj = $this->db->fetch_object($result); $obj = $this->db->fetch_object($result);
if ($selected == $obj->rowid) if ($selected == $obj->rowid) {
{ $out .= '<option value="' . $obj->rowid . '" selected>';
print '<option value="'.$obj->rowid.'" selected>'; } else {
$out .= '<option value="' . $obj->rowid . '">';
} }
else $out .= $obj->libelle;
{ $out .= '</option>';
print '<option value="'.$obj->rowid.'">';
}
print $obj->libelle;
print '</option>';
$i++; $i++;
} }
print "</select>"; $out .= "</select>";
print ajax_combobox("select_".$htmlname); $out .= ajax_combobox("select_".$htmlname);
} }
else { else {
dol_print_error($this->db); dol_print_error($this->db);
} }
return $out;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Show form to select type of barcode * Show form to select type of barcode
* *
@ -170,22 +182,37 @@ class FormBarCode
* @param int $selected Id condition preselected * @param int $selected Id condition preselected
* @param string $htmlname Nom du formulaire select * @param string $htmlname Nom du formulaire select
* @return void * @return void
* @deprecated
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function form_barcode_type($page, $selected='', $htmlname='barcodetype_id') function form_barcode_type($page, $selected='', $htmlname='barcodetype_id')
{ {
global $langs,$conf; // phpcs:enable
if ($htmlname != "none") print $this->formBarcodeType($page, $selected, $htmlname);
{ }
print '<form method="post" action="'.$page.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; /**
print '<input type="hidden" name="action" value="set'.$htmlname.'">'; * Return html form to select type of barcode
print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">'; *
print '<tr><td>'; * @param string $page Page
$this->select_barcode_type($selected, $htmlname, 1); * @param int $selected Id condition preselected
print '</td>'; * @param string $htmlname Nom du formulaire select
print '<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'">'; * @return string
print '</td></tr></table></form>'; */
function formBarcodeType($page, $selected='', $htmlname='barcodetype_id')
{
global $langs, $conf;
$out = '';
if ($htmlname != "none") {
$out .= '<form method="post" action="' . $page . '">';
$out .= '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
$out .= '<input type="hidden" name="action" value="set'.$htmlname.'">';
$out .= '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
$out .= '<tr><td>';
$out .= $this->selectBarcodeType($selected, $htmlname, 1);
$out .= '</td>';
$out .= '<td align="left"><input type="submit" class="button" value="' . $langs->trans("Modify") . '">';
$out .= '</td></tr></table></form>';
} }
return $out;
} }
} }

View File

@ -54,6 +54,7 @@ class FormCompany
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of labels (translated) of third parties type * Return list of labels (translated) of third parties type
* *
@ -61,9 +62,9 @@ class FormCompany
* @param string $filter Add a SQL filter to select * @param string $filter Add a SQL filter to select
* @return array Array of types * @return array Array of types
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function typent_array($mode=0, $filter='') function typent_array($mode=0, $filter='')
{ {
// phpcs:enable
global $langs,$mysoc; global $langs,$mysoc;
$effs = array(); $effs = array();
@ -96,6 +97,7 @@ class FormCompany
return $effs; return $effs;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Renvoie la liste des types d'effectifs possibles (pas de traduction car nombre) * Renvoie la liste des types d'effectifs possibles (pas de traduction car nombre)
* *
@ -103,9 +105,9 @@ class FormCompany
* @param string $filter Add a SQL filter to select * @param string $filter Add a SQL filter to select
* @return array Array of types d'effectifs * @return array Array of types d'effectifs
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function effectif_array($mode=0, $filter='') function effectif_array($mode=0, $filter='')
{ {
// phpcs:enable
$effs = array(); $effs = array();
$sql = "SELECT id, code, libelle"; $sql = "SELECT id, code, libelle";
@ -135,6 +137,7 @@ class FormCompany
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Affiche formulaire de selection des modes de reglement * Affiche formulaire de selection des modes de reglement
* *
@ -144,9 +147,9 @@ class FormCompany
* @param int $empty Add empty value in list * @param int $empty Add empty value in list
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function form_prospect_level($page, $selected='', $htmlname='prospect_level_id', $empty=0) function form_prospect_level($page, $selected='', $htmlname='prospect_level_id', $empty=0)
{ {
// phpcs:enable
global $user, $langs; global $user, $langs;
print '<form method="post" action="'.$page.'">'; print '<form method="post" action="'.$page.'">';
@ -185,6 +188,7 @@ class FormCompany
print '</form>'; print '</form>';
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Retourne la liste deroulante des departements/province/cantons tout pays confondu ou pour un pays donne. * Retourne la liste deroulante des departements/province/cantons tout pays confondu ou pour un pays donne.
* Dans le cas d'une liste tout pays confondus, l'affichage fait une rupture sur le pays. * Dans le cas d'une liste tout pays confondus, l'affichage fait une rupture sur le pays.
@ -197,12 +201,13 @@ class FormCompany
* @param string $htmlname Id of department * @param string $htmlname Id of department
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_departement($selected='',$country_codeid=0, $htmlname='state_id') function select_departement($selected='',$country_codeid=0, $htmlname='state_id')
{ {
// phpcs:enable
print $this->select_state($selected,$country_codeid, $htmlname); print $this->select_state($selected,$country_codeid, $htmlname);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Retourne la liste deroulante des departements/province/cantons tout pays confondu ou pour un pays donne. * Retourne la liste deroulante des departements/province/cantons tout pays confondu ou pour un pays donne.
* Dans le cas d'une liste tout pays confondus, l'affichage fait une rupture sur le pays. * Dans le cas d'une liste tout pays confondus, l'affichage fait une rupture sur le pays.
@ -216,9 +221,9 @@ class FormCompany
* @return string String with HTML select * @return string String with HTML select
* @see select_country * @see select_country
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_state($selected='',$country_codeid=0, $htmlname='state_id') function select_state($selected='',$country_codeid=0, $htmlname='state_id')
{ {
// phpcs:enable
global $conf,$langs,$user; global $conf,$langs,$user;
dol_syslog(get_class($this)."::select_departement selected=".$selected.", country_codeid=".$country_codeid,LOG_DEBUG); dol_syslog(get_class($this)."::select_departement selected=".$selected.", country_codeid=".$country_codeid,LOG_DEBUG);
@ -318,6 +323,7 @@ class FormCompany
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Retourne la liste deroulante des regions actives dont le pays est actif * Retourne la liste deroulante des regions actives dont le pays est actif
* La cle de la liste est le code (il peut y avoir plusieurs entree pour * La cle de la liste est le code (il peut y avoir plusieurs entree pour
@ -328,9 +334,9 @@ class FormCompany
* @param string $htmlname Name of HTML select field * @param string $htmlname Name of HTML select field
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_region($selected='',$htmlname='region_id') function select_region($selected='',$htmlname='region_id')
{ {
// phpcs:enable
global $conf,$langs; global $conf,$langs;
$langs->load("dict"); $langs->load("dict");
@ -385,6 +391,7 @@ class FormCompany
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return combo list with people title * Return combo list with people title
* *
@ -393,9 +400,9 @@ class FormCompany
* @param string $morecss Add more css on SELECT element * @param string $morecss Add more css on SELECT element
* @return string String with HTML select * @return string String with HTML select
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_civility($selected='',$htmlname='civility_id',$morecss='maxwidth100') function select_civility($selected='',$htmlname='civility_id',$morecss='maxwidth100')
{ {
// phpcs:enable
global $conf,$langs,$user; global $conf,$langs,$user;
$langs->load("dict"); $langs->load("dict");
@ -442,6 +449,7 @@ class FormCompany
return $out; return $out;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Retourne la liste deroulante des formes juridiques tous pays confondus ou pour un pays donne. * Retourne la liste deroulante des formes juridiques tous pays confondus ou pour un pays donne.
* Dans le cas d'une liste tous pays confondu, on affiche une rupture sur le pays. * Dans le cas d'une liste tous pays confondu, on affiche une rupture sur le pays.
@ -453,12 +461,13 @@ class FormCompany
* @deprecated Use print xxx->select_juridicalstatus instead * @deprecated Use print xxx->select_juridicalstatus instead
* @see select_juridicalstatus() * @see select_juridicalstatus()
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_forme_juridique($selected='', $country_codeid=0, $filter='') function select_forme_juridique($selected='', $country_codeid=0, $filter='')
{ {
// phpcs:enable
print $this->select_juridicalstatus($selected, $country_codeid, $filter); print $this->select_juridicalstatus($selected, $country_codeid, $filter);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Retourne la liste deroulante des formes juridiques tous pays confondus ou pour un pays donne. * Retourne la liste deroulante des formes juridiques tous pays confondus ou pour un pays donne.
* Dans le cas d'une liste tous pays confondu, on affiche une rupture sur le pays * Dans le cas d'une liste tous pays confondu, on affiche une rupture sur le pays
@ -469,9 +478,9 @@ class FormCompany
* @param string $htmlname HTML name of select * @param string $htmlname HTML name of select
* @return string String with HTML select * @return string String with HTML select
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_juridicalstatus($selected='', $country_codeid=0, $filter='', $htmlname='forme_juridique_code') function select_juridicalstatus($selected='', $country_codeid=0, $filter='', $htmlname='forme_juridique_code')
{ {
// phpcs:enable
global $conf,$langs,$user; global $conf,$langs,$user;
$langs->load("dict"); $langs->load("dict");
@ -754,6 +763,7 @@ class FormCompany
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return a select list with zip codes and their town * Return a select list with zip codes and their town
* *
@ -766,9 +776,9 @@ class FormCompany
* @param string $morecss More css * @param string $morecss More css
* @return string * @return string
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_ziptown($selected='', $htmlname='zipcode', $fields='', $fieldsize=0, $disableautocomplete=0, $moreattrib='',$morecss='') function select_ziptown($selected='', $htmlname='zipcode', $fields='', $fieldsize=0, $disableautocomplete=0, $moreattrib='',$morecss='')
{ {
// phpcs:enable
global $conf; global $conf;
$out=''; $out='';
@ -786,6 +796,7 @@ class FormCompany
return $out; return $out;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return HTML string to use as input of professional id into a HTML page (siren, siret, etc...) * Return HTML string to use as input of professional id into a HTML page (siren, siret, etc...)
* *
@ -796,9 +807,9 @@ class FormCompany
* @param string $morecss More css * @param string $morecss More css
* @return string HTML string with prof id * @return string HTML string with prof id
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_input_id_prof($idprof,$htmlname,$preselected,$country_code,$morecss='maxwidth100onsmartphone quatrevingtpercent') function get_input_id_prof($idprof,$htmlname,$preselected,$country_code,$morecss='maxwidth100onsmartphone quatrevingtpercent')
{ {
// phpcs:enable
global $conf,$langs; global $conf,$langs;
$formlength=0; $formlength=0;
@ -837,6 +848,7 @@ class FormCompany
return $out; return $out;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return a HTML select with localtax values for thirdparties * Return a HTML select with localtax values for thirdparties
* *
@ -845,13 +857,13 @@ class FormCompany
* @param string $htmlname HTML select name * @param string $htmlname HTML select name
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_localtax($local, $selected, $htmlname) function select_localtax($local, $selected, $htmlname)
{ {
$tax=get_localtax_by_third($local); // phpcs:enable
$tax=get_localtax_by_third($local);
$num = $this->db->num_rows($tax); $num = $this->db->num_rows($tax);
$i = 0; $i = 0;
if ($num) if ($num)
{ {
$valors=explode(":", $tax); $valors=explode(":", $tax);

View File

@ -49,6 +49,7 @@ class FormContract
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Show a combo list with contracts qualified for a third party * Show a combo list with contracts qualified for a third party
* *
@ -59,9 +60,9 @@ class FormContract
* @param int $showempty Show empty line * @param int $showempty Show empty line
* @return int Nbr of project if OK, <0 if KO * @return int Nbr of project if OK, <0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_contract($socid=-1, $selected='', $htmlname='contrattid', $maxlength=16, $showempty=1) function select_contract($socid=-1, $selected='', $htmlname='contrattid', $maxlength=16, $showempty=1)
{ {
// phpcs:enable
global $db,$user,$conf,$langs; global $db,$user,$conf,$langs;
$hideunselectables = false; $hideunselectables = false;

View File

@ -50,6 +50,7 @@ class FormCron extends Form
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Display On Off selector * Display On Off selector
* *
@ -58,9 +59,9 @@ class FormCron extends Form
* @param integer $readonly Select is read only or not * @param integer $readonly Select is read only or not
* @return string HTML select field * @return string HTML select field
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_typejob($htmlname,$selected=0,$readonly=0) function select_typejob($htmlname,$selected=0,$readonly=0)
{ {
// phpcs:enable
global $langs; global $langs;
$langs->load('cron@cron'); $langs->load('cron@cron');

View File

@ -58,6 +58,7 @@ class FormFile
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Show form to upload a new file. * Show form to upload a new file.
* *
@ -77,9 +78,9 @@ class FormFile
* @param string $sectiondir If upload must be done inside a particular directory (is sectiondir defined, sectionid must not be) * @param string $sectiondir If upload must be done inside a particular directory (is sectiondir defined, sectionid must not be)
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function form_attach_new_file($url, $title='', $addcancel=0, $sectionid=0, $perm=1, $size=50, $object='', $options='', $useajax=1, $savingdocmask='', $linkfiles=1, $htmlname='formuserfile', $accept='', $sectiondir='') function form_attach_new_file($url, $title='', $addcancel=0, $sectionid=0, $perm=1, $size=50, $object='', $options='', $useajax=1, $savingdocmask='', $linkfiles=1, $htmlname='formuserfile', $accept='', $sectiondir='')
{ {
// phpcs:enable
global $conf,$langs, $hookmanager; global $conf,$langs, $hookmanager;
$hookmanager->initHooks(array('formfile')); $hookmanager->initHooks(array('formfile'));
@ -231,6 +232,7 @@ class FormFile
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Show the box with list of available documents for object * Show the box with list of available documents for object
* *
@ -253,9 +255,9 @@ class FormFile
* @return int <0 if KO, number of shown files if OK * @return int <0 if KO, number of shown files if OK
* @deprecated Use print xxx->showdocuments() instead. * @deprecated Use print xxx->showdocuments() instead.
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function show_documents($modulepart,$modulesubdir,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$allowgenifempty=1,$forcenomultilang=0,$iconPDF=0,$notused=0,$noform=0,$param='',$title='',$buttonlabel='',$codelang='') function show_documents($modulepart,$modulesubdir,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$allowgenifempty=1,$forcenomultilang=0,$iconPDF=0,$notused=0,$noform=0,$param='',$title='',$buttonlabel='',$codelang='')
{ {
// phpcs:enable
$this->numoffiles=0; $this->numoffiles=0;
print $this->showdocuments($modulepart,$modulesubdir,$filedir,$urlsource,$genallowed,$delallowed,$modelselected,$allowgenifempty,$forcenomultilang,$iconPDF,$notused,$noform,$param,$title,$buttonlabel,$codelang); print $this->showdocuments($modulepart,$modulesubdir,$filedir,$urlsource,$genallowed,$delallowed,$modelselected,$allowgenifempty,$forcenomultilang,$iconPDF,$notused,$noform,$param,$title,$buttonlabel,$codelang);
return $this->numoffiles; return $this->numoffiles;
@ -981,6 +983,7 @@ class FormFile
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Show list of documents in $filearray (may be they are all in same directory but may not) * Show list of documents in $filearray (may be they are all in same directory but may not)
* This also sync database if $upload_dir is defined. * This also sync database if $upload_dir is defined.
@ -1010,9 +1013,9 @@ class FormFile
* @return int <0 if KO, nb of files shown if OK * @return int <0 if KO, nb of files shown if OK
* @see list_of_autoecmfiles * @see list_of_autoecmfiles
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function list_of_documents($filearray,$object,$modulepart,$param='',$forcedownload=0,$relativepath='',$permonobject=1,$useinecm=0,$textifempty='',$maxlength=0,$title='',$url='', $showrelpart=0, $permtoeditline=-1,$upload_dir='',$sortfield='',$sortorder='ASC', $disablemove=1, $addfilterfields=0) function list_of_documents($filearray,$object,$modulepart,$param='',$forcedownload=0,$relativepath='',$permonobject=1,$useinecm=0,$textifempty='',$maxlength=0,$title='',$url='', $showrelpart=0, $permtoeditline=-1,$upload_dir='',$sortfield='',$sortorder='ASC', $disablemove=1, $addfilterfields=0)
{ {
// phpcs:enable
global $user, $conf, $langs, $hookmanager; global $user, $conf, $langs, $hookmanager;
global $sortfield, $sortorder, $maxheightmini; global $sortfield, $sortorder, $maxheightmini;
global $dolibarr_main_url_root; global $dolibarr_main_url_root;
@ -1379,6 +1382,7 @@ class FormFile
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Show list of documents in a directory * Show list of documents in a directory
* *
@ -1397,9 +1401,9 @@ class FormFile
* @return int <0 if KO, nb of files shown if OK * @return int <0 if KO, nb of files shown if OK
* @see list_of_documents * @see list_of_documents
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function list_of_autoecmfiles($upload_dir, $filearray, $modulepart, $param, $forcedownload=0, $relativepath='', $permtodelete=1, $useinecm=0, $textifempty='', $maxlength=0, $url='', $addfilterfields=0) function list_of_autoecmfiles($upload_dir, $filearray, $modulepart, $param, $forcedownload=0, $relativepath='', $permtodelete=1, $useinecm=0, $textifempty='', $maxlength=0, $url='', $addfilterfields=0)
{ {
// phpcs:enable
global $user, $conf, $langs, $form; global $user, $conf, $langs, $form;
global $sortfield, $sortorder; global $sortfield, $sortorder;
global $search_doc_ref; global $search_doc_ref;

View File

@ -49,6 +49,7 @@ class FormIntervention
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Show a combo list with contracts qualified for a third party * Show a combo list with contracts qualified for a third party
* *
@ -59,9 +60,9 @@ class FormIntervention
* @param int $showempty Show empty line * @param int $showempty Show empty line
* @return int Nbre of project if OK, <0 if KO * @return int Nbre of project if OK, <0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_interventions($socid=-1, $selected='', $htmlname='interventionid', $maxlength=16, $showempty=1) function select_interventions($socid=-1, $selected='', $htmlname='interventionid', $maxlength=16, $showempty=1)
{ {
// phpcs:enable
global $db,$user,$conf,$langs; global $db,$user,$conf,$langs;
$out=''; $out='';

View File

@ -136,14 +136,15 @@ class FormMail extends Form
return 1; return 1;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Clear list of attached files in send mail form (also stored in session) * Clear list of attached files in send mail form (also stored in session)
* *
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function clear_attached_files() function clear_attached_files()
{ {
// phpcs:enable
global $conf,$user; global $conf,$user;
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
@ -158,6 +159,7 @@ class FormMail extends Form
unset($_SESSION["listofmimes".$keytoavoidconflict]); unset($_SESSION["listofmimes".$keytoavoidconflict]);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Add a file into the list of attached files (stored in SECTION array) * Add a file into the list of attached files (stored in SECTION array)
* *
@ -166,9 +168,9 @@ class FormMail extends Form
* @param string $type Mime type (can be dol_mimetype($file)) * @param string $type Mime type (can be dol_mimetype($file))
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function add_attached_files($path, $file='', $type='') function add_attached_files($path, $file='', $type='')
{ {
// phpcs:enable
$listofpaths=array(); $listofpaths=array();
$listofnames=array(); $listofnames=array();
$listofmimes=array(); $listofmimes=array();
@ -191,15 +193,16 @@ class FormMail extends Form
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Remove a file from the list of attached files (stored in SECTION array) * Remove a file from the list of attached files (stored in SECTION array)
* *
* @param string $keytodelete Key in file array (0, 1, 2, ...) * @param string $keytodelete Key in file array (0, 1, 2, ...)
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function remove_attached_files($keytodelete) function remove_attached_files($keytodelete)
{ {
// phpcs:enable
$listofpaths=array(); $listofpaths=array();
$listofnames=array(); $listofnames=array();
$listofmimes=array(); $listofmimes=array();
@ -220,14 +223,15 @@ class FormMail extends Form
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of attached files (stored in SECTION array) * Return list of attached files (stored in SECTION array)
* *
* @return array array('paths'=> ,'names'=>, 'mimes'=> ) * @return array array('paths'=> ,'names'=>, 'mimes'=> )
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_attached_files() function get_attached_files()
{ {
// phpcs:enable
$listofpaths=array(); $listofpaths=array();
$listofnames=array(); $listofnames=array();
$listofmimes=array(); $listofmimes=array();
@ -239,6 +243,7 @@ class FormMail extends Form
return array('paths'=>$listofpaths, 'names'=>$listofnames, 'mimes'=>$listofmimes); return array('paths'=>$listofpaths, 'names'=>$listofnames, 'mimes'=>$listofmimes);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Show the form to input an email * Show the form to input an email
* this->withfile: 0=No attaches files, 1=Show attached files, 2=Can add new attached files * this->withfile: 0=No attaches files, 1=Show attached files, 2=Can add new attached files
@ -248,12 +253,13 @@ class FormMail extends Form
* @param string $removefileaction Name of action when removing file attachments * @param string $removefileaction Name of action when removing file attachments
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function show_form($addfileaction='addfile',$removefileaction='removefile') function show_form($addfileaction='addfile',$removefileaction='removefile')
{ {
// phpcs:enable
print $this->get_form($addfileaction,$removefileaction); print $this->get_form($addfileaction,$removefileaction);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Get the form to input an email * Get the form to input an email
* this->withfile: 0=No attaches files, 1=Show attached files, 2=Can add new attached files * this->withfile: 0=No attaches files, 1=Show attached files, 2=Can add new attached files
@ -264,9 +270,9 @@ class FormMail extends Form
* @param string $removefileaction Name of action when removing file attachments * @param string $removefileaction Name of action when removing file attachments
* @return string Form to show * @return string Form to show
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_form($addfileaction='addfile', $removefileaction='removefile') function get_form($addfileaction='addfile', $removefileaction='removefile')
{ {
// phpcs:enable
global $conf, $langs, $user, $hookmanager, $form; global $conf, $langs, $user, $hookmanager, $form;
if (! is_object($form)) $form=new Form($this->db); if (! is_object($form)) $form=new Form($this->db);

View File

@ -58,6 +58,7 @@ class FormOther
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return HTML select list of export models * Return HTML select list of export models
* *
@ -68,13 +69,13 @@ class FormOther
* @param int $fk_user Utilisateur créant le modèle * @param int $fk_user Utilisateur créant le modèle
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_export_model($selected='', $htmlname='exportmodelid', $type='', $useempty=0, $fk_user=null) function select_export_model($selected='', $htmlname='exportmodelid', $type='', $useempty=0, $fk_user=null)
{ {
// phpcs:enable
$sql = "SELECT rowid, label"; $sql = "SELECT rowid, label";
$sql.= " FROM ".MAIN_DB_PREFIX."export_model"; $sql.= " FROM ".MAIN_DB_PREFIX."export_model";
$sql.= " WHERE type = '".$type."'"; $sql.= " WHERE type = '".$type."'";
if(!empty($fk_user))$sql.=" AND fk_user=".$fk_user; if (!empty($fk_user)) $sql.=" AND fk_user=".$fk_user;
$sql.= " ORDER BY rowid"; $sql.= " ORDER BY rowid";
$result = $this->db->query($sql); $result = $this->db->query($sql);
if ($result) if ($result)
@ -110,6 +111,7 @@ class FormOther
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of export models * Return list of export models
* *
@ -119,9 +121,9 @@ class FormOther
* @param int $useempty Affiche valeur vide dans liste * @param int $useempty Affiche valeur vide dans liste
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_import_model($selected='', $htmlname='importmodelid', $type='', $useempty=0) function select_import_model($selected='', $htmlname='importmodelid', $type='', $useempty=0)
{ {
// phpcs:enable
$sql = "SELECT rowid, label"; $sql = "SELECT rowid, label";
$sql.= " FROM ".MAIN_DB_PREFIX."import_model"; $sql.= " FROM ".MAIN_DB_PREFIX."import_model";
$sql.= " WHERE type = '".$type."'"; $sql.= " WHERE type = '".$type."'";
@ -160,6 +162,7 @@ class FormOther
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of ecotaxes with label * Return list of ecotaxes with label
* *
@ -167,9 +170,9 @@ class FormOther
* @param string $htmlname Name of combo list * @param string $htmlname Name of combo list
* @return integer * @return integer
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_ecotaxes($selected='', $htmlname='ecotaxe_id') function select_ecotaxes($selected='', $htmlname='ecotaxe_id')
{ {
// phpcs:enable
global $langs; global $langs;
$sql = "SELECT e.rowid, e.code, e.label, e.price, e.organization,"; $sql = "SELECT e.rowid, e.code, e.label, e.price, e.organization,";
@ -217,6 +220,7 @@ class FormOther
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of revenue stamp for country * Return list of revenue stamp for country
* *
@ -225,9 +229,9 @@ class FormOther
* @param string $country_code Country Code * @param string $country_code Country Code
* @return string HTML select list * @return string HTML select list
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_revenue_stamp($selected='', $htmlname='revenuestamp', $country_code='') function select_revenue_stamp($selected='', $htmlname='revenuestamp', $country_code='')
{ {
// phpcs:enable
global $langs; global $langs;
$out=''; $out='';
@ -275,6 +279,7 @@ class FormOther
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return a HTML select list to select a percent * Return a HTML select list to select a percent
* *
@ -287,9 +292,9 @@ class FormOther
* @param int $showempty Add also an empty line * @param int $showempty Add also an empty line
* @return string HTML select string * @return string HTML select string
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_percent($selected=0,$htmlname='percent',$disabled=0,$increment=5,$start=0,$end=100,$showempty=0) function select_percent($selected=0,$htmlname='percent',$disabled=0,$increment=5,$start=0,$end=100,$showempty=0)
{ {
// phpcs:enable
$return = '<select class="flat" name="'.$htmlname.'" '.($disabled?'disabled':'').'>'; $return = '<select class="flat" name="'.$htmlname.'" '.($disabled?'disabled':'').'>';
if ($showempty) $return.='<option value="-1"'.(($selected == -1 || $selected == '')?' selected':'').'>&nbsp;</option>'; if ($showempty) $return.='<option value="-1"'.(($selected == -1 || $selected == '')?' selected':'').'>&nbsp;</option>';
@ -312,6 +317,7 @@ class FormOther
return $return; return $return;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return select list for categories (to use in form search selectors) * Return select list for categories (to use in form search selectors)
* *
@ -324,9 +330,9 @@ class FormOther
* @return string Html combo list code * @return string Html combo list code
* @see select_all_categories * @see select_all_categories
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_categories($type, $selected=0, $htmlname='search_categ', $nocateg=0, $showempty=1, $morecss='') function select_categories($type, $selected=0, $htmlname='search_categ', $nocateg=0, $showempty=1, $morecss='')
{ {
// phpcs:enable
global $conf, $langs; global $conf, $langs;
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
@ -373,6 +379,7 @@ class FormOther
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return select list for categories (to use in form search selectors) * Return select list for categories (to use in form search selectors)
* *
@ -384,9 +391,9 @@ class FormOther
* @param string $morecss More CSS * @param string $morecss More CSS
* @return string Html combo list code * @return string Html combo list code
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_salesrepresentatives($selected,$htmlname,$user,$showstatus=0,$showempty=1,$morecss='') function select_salesrepresentatives($selected,$htmlname,$user,$showstatus=0,$showempty=1,$morecss='')
{ {
// phpcs:enable
global $conf,$langs; global $conf,$langs;
$langs->load('users'); $langs->load('users');
@ -628,6 +635,7 @@ class FormOther
else print $textifnotdefined; else print $textifnotdefined;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Output a HTML code to select a color * Output a HTML code to select a color
* *
@ -640,9 +648,9 @@ class FormOther
* @deprecated Use instead selectColor * @deprecated Use instead selectColor
* @see selectColor() * @see selectColor()
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_color($set_color='', $prefix='f_color', $form_name='', $showcolorbox=1, $arrayofcolors='') function select_color($set_color='', $prefix='f_color', $form_name='', $showcolorbox=1, $arrayofcolors='')
{ {
// phpcs:enable
print $this->selectColor($set_color, $prefix, $form_name, $showcolorbox, $arrayofcolors); print $this->selectColor($set_color, $prefix, $form_name, $showcolorbox, $arrayofcolors);
} }
@ -746,6 +754,7 @@ class FormOther
return $out; return $out;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Creation d'un icone de couleur * Creation d'un icone de couleur
* *
@ -756,9 +765,9 @@ class FormOther
* @param int $y Hauteur de l'image en pixels * @param int $y Hauteur de l'image en pixels
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function CreateColorIcon($color,$module,$name,$x='12',$y='12') function CreateColorIcon($color,$module,$name,$x='12',$y='12')
{ {
// phpcs:enable
global $conf; global $conf;
$file = $conf->$module->dir_temp.'/'.$name.'.png'; $file = $conf->$module->dir_temp.'/'.$name.'.png';
@ -786,6 +795,7 @@ class FormOther
ImageDestroy($image); ImageDestroy($image);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return HTML combo list of week * Return HTML combo list of week
* *
@ -794,18 +804,20 @@ class FormOther
* @param int $useempty Affiche valeur vide dans liste * @param int $useempty Affiche valeur vide dans liste
* @return string * @return string
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_dayofweek($selected='',$htmlname='weekid',$useempty=0) function select_dayofweek($selected='',$htmlname='weekid',$useempty=0)
{ {
// phpcs:enable
global $langs; global $langs;
$week = array( 0=>$langs->trans("Day0"), $week = array(
1=>$langs->trans("Day1"), 0=>$langs->trans("Day0"),
2=>$langs->trans("Day2"), 1=>$langs->trans("Day1"),
3=>$langs->trans("Day3"), 2=>$langs->trans("Day2"),
4=>$langs->trans("Day4"), 3=>$langs->trans("Day3"),
5=>$langs->trans("Day5"), 4=>$langs->trans("Day4"),
6=>$langs->trans("Day6")); 5=>$langs->trans("Day5"),
6=>$langs->trans("Day6")
);
$select_week = '<select class="flat" name="'.$htmlname.'">'; $select_week = '<select class="flat" name="'.$htmlname.'">';
if ($useempty) if ($useempty)
@ -829,6 +841,7 @@ class FormOther
return $select_week; return $select_week;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return HTML combo list of month * Return HTML combo list of month
* *
@ -839,9 +852,9 @@ class FormOther
* @param string $morecss More Css * @param string $morecss More Css
* @return string * @return string
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_month($selected='', $htmlname='monthid', $useempty=0, $longlabel=0, $morecss='') function select_month($selected='', $htmlname='monthid', $useempty=0, $longlabel=0, $morecss='')
{ {
// phpcs:enable
global $langs; global $langs;
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
@ -871,6 +884,7 @@ class FormOther
return $select_month; return $select_month;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return HTML combo list of years * Return HTML combo list of years
* *
@ -885,9 +899,9 @@ class FormOther
* @param string $morecss More CSS * @param string $morecss More CSS
* @return string * @return string
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_year($selected='',$htmlname='yearid',$useempty=0, $min_year=10, $max_year=5, $offset=0, $invert=0, $option='', $morecss='valignmiddle widthauto') function select_year($selected='',$htmlname='yearid',$useempty=0, $min_year=10, $max_year=5, $offset=0, $invert=0, $option='', $morecss='valignmiddle widthauto')
{ {
// phpcs:enable
print $this->selectyear($selected,$htmlname,$useempty,$min_year,$max_year,$offset,$invert,$option,$morecss); print $this->selectyear($selected,$htmlname,$useempty,$min_year,$max_year,$offset,$invert,$option,$morecss);
} }
@ -944,6 +958,7 @@ class FormOther
return $out; return $out;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Show form to select address * Show form to select address
* *
@ -955,9 +970,9 @@ class FormOther
* @param int $originid Id de l'origine * @param int $originid Id de l'origine
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function form_address($page, $selected, $socid, $htmlname='address_id', $origin='', $originid='') function form_address($page, $selected, $socid, $htmlname='address_id', $origin='', $originid='')
{ {
// phpcs:enable
global $langs,$conf; global $langs,$conf;
global $form; global $form;
@ -1206,6 +1221,7 @@ class FormOther
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return a HTML select list of a dictionary * Return a HTML select list of a dictionary
* *
@ -1218,9 +1234,9 @@ class FormOther
* @param string $moreattrib More attributes on HTML select tag * @param string $moreattrib More attributes on HTML select tag
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_dictionary($htmlname,$dictionarytable,$keyfield='code',$labelfield='label',$selected='',$useempty=0,$moreattrib='') function select_dictionary($htmlname,$dictionarytable,$keyfield='code',$labelfield='label',$selected='',$useempty=0,$moreattrib='')
{ {
// phpcs:enable
global $langs, $conf; global $langs, $conf;
$langs->load("admin"); $langs->load("admin");

View File

@ -51,6 +51,7 @@ class FormProjets
return 1; return 1;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Output a combo list with projects qualified for a third party / user * Output a combo list with projects qualified for a third party / user
* *
@ -71,9 +72,9 @@ class FormProjets
* @param int $htmlid Html id to use instead of htmlname * @param int $htmlid Html id to use instead of htmlname
* @return string Return html content * @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='') 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; global $langs,$conf,$form;
$out=''; $out='';
@ -119,6 +120,7 @@ class FormProjets
else return $out; else return $out;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Returns an array with projects qualified for a third party * Returns an array with projects qualified for a third party
* *
@ -139,9 +141,9 @@ class FormProjets
* @param string $morecss More CSS * @param string $morecss More CSS
* @return int Nb of project if OK, <0 if KO * @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') 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; global $user,$conf,$langs;
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
@ -470,6 +472,7 @@ class FormProjets
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Build a HTML select list of element of same thirdparty to suggest to link them to project * Build a HTML select list of element of same thirdparty to suggest to link them to project
* *
@ -480,9 +483,9 @@ class FormProjets
* @param string $projectkey Equivalent key to fk_projet for actual table_element * @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 * @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") function select_element($table_element, $socid=0, $morecss='', $limitonstatus=-2,$projectkey="fk_projet")
{ {
// phpcs:enable
global $conf, $langs; global $conf, $langs;
if ($table_element == 'projet_task') return ''; // Special cas of element we never link to a project (already always done) if ($table_element == 'projet_task') return ''; // Special cas of element we never link to a project (already always done)

View File

@ -88,6 +88,7 @@ class FormSms
return 1; return 1;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Show the form to input an sms. * Show the form to input an sms.
* *
@ -95,9 +96,9 @@ class FormSms
* @param int $showform Show form tags and submit button (recommanded is to use with value 0) * @param int $showform Show form tags and submit button (recommanded is to use with value 0)
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function show_form($morecss='titlefield', $showform=1) function show_form($morecss='titlefield', $showform=1)
{ {
// phpcs:enable
global $conf, $langs, $user, $form; global $conf, $langs, $user, $form;
if (! is_object($form)) $form=new Form($this->db); if (! is_object($form)) $form=new Form($this->db);

View File

@ -48,9 +48,10 @@ class FormSocialContrib
$this->db = $db; $this->db = $db;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of social contributions. * Return list of social contributions.
* Use mysoc->country_id or mysoc->country_code so they must be defined. * Use mysoc->country_id or mysoc->country_code so they must be defined.
* *
* @param string $selected Preselected type * @param string $selected Preselected type
* @param string $htmlname Name of field in form * @param string $htmlname Name of field in form
@ -60,9 +61,9 @@ class FormSocialContrib
* @param string $morecss Add more CSS on select * @param string $morecss Add more CSS on select
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_type_socialcontrib($selected='',$htmlname='actioncode', $useempty=0, $maxlen=40, $help=1, $morecss='minwidth300') function select_type_socialcontrib($selected='',$htmlname='actioncode', $useempty=0, $maxlen=40, $help=1, $morecss='minwidth300')
{ {
// phpcs:enable
global $conf,$db,$langs,$user,$mysoc; global $conf,$db,$langs,$user,$mysoc;
if (empty($mysoc->country_id) && empty($mysoc->country_code)) if (empty($mysoc->country_id) && empty($mysoc->country_code))

View File

@ -53,6 +53,7 @@ class Interfaces
$this->db = $db; $this->db = $db;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Function called when a Dolibarr business event occurs * Function called when a Dolibarr business event occurs
* This function call all qualified triggers. * This function call all qualified triggers.
@ -64,9 +65,9 @@ class Interfaces
* @param Conf $conf Objet conf * @param Conf $conf Objet conf
* @return int Nb of triggers ran if no error, -Nb of triggers with errors otherwise. * @return int Nb of triggers ran if no error, -Nb of triggers with errors otherwise.
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function run_triggers($action,$object,$user,$langs,$conf) function run_triggers($action,$object,$user,$langs,$conf)
{ {
// phpcs:enable
// Check parameters // Check parameters
if (! is_object($object) || ! is_object($conf)) // Error if (! is_object($object) || ! is_object($conf)) // Error
{ {

View File

@ -149,6 +149,7 @@ class Ldap
// Connection handling methods ------------------------------------------- // Connection handling methods -------------------------------------------
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Connect and bind * Connect and bind
* Use this->server, this->serverPort, this->ldapProtocolVersion, this->serverType, this->searchUser, this->searchPassword * Use this->server, this->serverPort, this->ldapProtocolVersion, this->serverType, this->searchUser, this->searchPassword
@ -156,9 +157,9 @@ class Ldap
* *
* @return int <0 if KO, 1 if bind anonymous, 2 if bind auth * @return int <0 if KO, 1 if bind anonymous, 2 if bind auth
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function connect_bind() function connect_bind()
{ {
// phpcs:enable
global $langs, $conf; global $langs, $conf;
$connected=0; $connected=0;
@ -655,6 +656,7 @@ class Ldap
return -1; return -1;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Build a LDAP message * Build a LDAP message
* *
@ -662,9 +664,9 @@ class Ldap
* @param array $info Attributes array * @param array $info Attributes array
* @return string Content of file * @return string Content of file
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function dump_content($dn, $info) function dump_content($dn, $info)
{ {
// phpcs:enable
$content=''; $content='';
// Create file content // Create file content
@ -1436,15 +1438,16 @@ class Ldap
return($retval); return($retval);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Convertit le temps ActiveDirectory en Unix timestamp * Convertit le temps ActiveDirectory en Unix timestamp
* *
* @param string $value AD time to convert * @param string $value AD time to convert
* @return integer Unix timestamp * @return integer Unix timestamp
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function convert_time($value) function convert_time($value)
{ {
// phpcs:enable
$dateLargeInt=$value; // nano secondes depuis 1601 !!!! $dateLargeInt=$value; // nano secondes depuis 1601 !!!!
$secsAfterADEpoch = $dateLargeInt / (10000000); // secondes depuis le 1 jan 1601 $secsAfterADEpoch = $dateLargeInt / (10000000); // secondes depuis le 1 jan 1601
$ADToUnixConvertor=((1970-1601) * 365.242190) * 86400; // UNIX start date - AD start date * jours * secondes $ADToUnixConvertor=((1970-1601) * 365.242190) * 86400; // UNIX start date - AD start date * jours * secondes

View File

@ -96,14 +96,15 @@ class Menu
$this->liste=array_merge($array_start,$array_new,$array_end); $this->liste=array_merge($array_start,$array_new,$array_end);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Remove a menu entry from this->liste * Remove a menu entry from this->liste
* *
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function remove_last() function remove_last()
{ {
// phpcs:enable
if (count($this->liste) > 1) { if (count($this->liste) > 1) {
array_pop($this->liste); array_pop($this->liste);
} }

View File

@ -45,63 +45,68 @@ class SimpleOpenID
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* SetOpenIDServer * SetOpenIDServer
* *
* @param string $a Server * @param string $a Server
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetOpenIDServer($a) function SetOpenIDServer($a)
{ {
// phpcs:enable
$this->URLs['openid_server'] = $a; $this->URLs['openid_server'] = $a;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* SetOpenIDServer * SetOpenIDServer
* *
* @param string $a Server * @param string $a Server
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetTrustRoot($a) function SetTrustRoot($a)
{ {
// phpcs:enable
$this->URLs['trust_root'] = $a; $this->URLs['trust_root'] = $a;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* SetOpenIDServer * SetOpenIDServer
* *
* @param string $a Server * @param string $a Server
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetCancelURL($a) function SetCancelURL($a)
{ {
// phpcs:enable
$this->URLs['cancel'] = $a; $this->URLs['cancel'] = $a;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* SetApprovedURL * SetApprovedURL
* *
* @param string $a Server * @param string $a Server
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetApprovedURL($a) function SetApprovedURL($a)
{ {
// phpcs:enable
$this->URLs['approved'] = $a; $this->URLs['approved'] = $a;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* SetRequiredFields * SetRequiredFields
* *
* @param string $a Server * @param string $a Server
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetRequiredFields($a) function SetRequiredFields($a)
{ {
// phpcs:enable
if (is_array($a)) { if (is_array($a)) {
$this->fields['required'] = $a; $this->fields['required'] = $a;
} else { } else {
@ -109,15 +114,16 @@ class SimpleOpenID
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* SetOptionalFields * SetOptionalFields
* *
* @param string $a Server * @param string $a Server
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetOptionalFields($a) function SetOptionalFields($a)
{ {
// phpcs:enable
if (is_array($a)) { if (is_array($a)) {
$this->fields['optional'] = $a; $this->fields['optional'] = $a;
} else { } else {
@ -125,15 +131,16 @@ class SimpleOpenID
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* SetIdentity * SetIdentity
* *
* @param string $a Server * @param string $a Server
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetIdentity($a) function SetIdentity($a)
{ {
// phpcs:enable
// Set Identity URL // Set Identity URL
if ((stripos($a, 'http://') === false) if ((stripos($a, 'http://') === false)
&& (stripos($a, 'https://') === false)) { && (stripos($a, 'https://') === false)) {
@ -155,30 +162,33 @@ class SimpleOpenID
$this->openid_url_identity = $a; $this->openid_url_identity = $a;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* GetIdentity * GetIdentity
* *
* @return string * @return string
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function GetIdentity() function GetIdentity()
{ {
// phpcs:enable
// Get Identity // Get Identity
return $this->openid_url_identity; return $this->openid_url_identity;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* SetOpenIDServer * SetOpenIDServer
* *
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function GetError() function GetError()
{ {
// phpcs:enable
$e = $this->error; $e = $this->error;
return array('code'=>$e[0],'description'=>$e[1]); return array('code'=>$e[0],'description'=>$e[1]);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* ErrorStore * ErrorStore
* *
@ -186,9 +196,9 @@ class SimpleOpenID
* @param string $desc Description * @param string $desc Description
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function ErrorStore($code, $desc = null) function ErrorStore($code, $desc = null)
{ {
// phpcs:enable
$errs['OPENID_NOSERVERSFOUND'] = 'Cannot find OpenID Server TAG on Identity page.'; $errs['OPENID_NOSERVERSFOUND'] = 'Cannot find OpenID Server TAG on Identity page.';
if ($desc == null){ if ($desc == null){
$desc = $errs[$code]; $desc = $errs[$code];
@ -196,14 +206,15 @@ class SimpleOpenID
$this->error = array($code,$desc); $this->error = array($code,$desc);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* IsError * IsError
* *
* @return boolean * @return boolean
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function IsError() function IsError()
{ {
// phpcs:enable
if (count($this->error) > 0) if (count($this->error) > 0)
{ {
return true; return true;
@ -234,15 +245,16 @@ class SimpleOpenID
return $r; return $r;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* OpenID_Standarize * OpenID_Standarize
* *
* @param string $openid_identity Server * @param string $openid_identity Server
* @return string * @return string
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function OpenID_Standarize($openid_identity = null) function OpenID_Standarize($openid_identity = null)
{ {
// phpcs:enable
if ($openid_identity === null) if ($openid_identity === null)
$openid_identity = $this->openid_url_identity; $openid_identity = $this->openid_url_identity;
@ -280,6 +292,7 @@ class SimpleOpenID
return $query; return $query;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* FSOCK_Request * FSOCK_Request
* *
@ -288,9 +301,9 @@ class SimpleOpenID
* @param string $params Params * @param string $params Params
* @return boolean|unknown * @return boolean|unknown
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function FSOCK_Request($url, $method="GET", $params = "") function FSOCK_Request($url, $method="GET", $params = "")
{ {
// phpcs:enable
$fp = fsockopen("ssl://www.myopenid.com", 443, $errno, $errstr, 3); // Connection timeout is 3 seconds $fp = fsockopen("ssl://www.myopenid.com", 443, $errno, $errstr, 3); // Connection timeout is 3 seconds
if (!$fp) { if (!$fp) {
$this->ErrorStore('OPENID_SOCKETERROR', $errstr); $this->ErrorStore('OPENID_SOCKETERROR', $errstr);
@ -313,6 +326,7 @@ class SimpleOpenID
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* CURL_Request * CURL_Request
* *
@ -321,9 +335,9 @@ class SimpleOpenID
* @param string $params Params * @param string $params Params
* @return string * @return string
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function CURL_Request($url, $method="GET", $params = "") function CURL_Request($url, $method="GET", $params = "")
{ {
// phpcs:enable
// Remember, SSL MUST BE SUPPORTED // Remember, SSL MUST BE SUPPORTED
if (is_array($params)) $params = $this->array2url($params); if (is_array($params)) $params = $this->array2url($params);
@ -345,15 +359,16 @@ class SimpleOpenID
return $response; return $response;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* HTML2OpenIDServer * HTML2OpenIDServer
* *
* @param string $content Content * @param string $content Content
* @return array Array of servers * @return array Array of servers
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function HTML2OpenIDServer($content) function HTML2OpenIDServer($content)
{ {
// phpcs:enable
$get = array(); $get = array();
// Get details of their OpenID server and (optional) delegate // Get details of their OpenID server and (optional) delegate
@ -372,15 +387,16 @@ class SimpleOpenID
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Get openid server * Get openid server
* *
* @param string $url Url to found endpoint * @param string $url Url to found endpoint
* @return string Endpoint * @return string Endpoint
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function GetOpenIDServer($url='') function GetOpenIDServer($url='')
{ {
// phpcs:enable
global $conf; global $conf;
include_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
@ -401,14 +417,15 @@ class SimpleOpenID
return $servers[0]; return $servers[0];
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* GetRedirectURL * GetRedirectURL
* *
* @return string * @return string
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function GetRedirectURL() function GetRedirectURL()
{ {
// phpcs:enable
$params = array(); $params = array();
$params['openid.return_to'] = urlencode($this->URLs['approved']); $params['openid.return_to'] = urlencode($this->URLs['approved']);
$params['openid.mode'] = 'checkid_setup'; $params['openid.mode'] = 'checkid_setup';
@ -426,14 +443,15 @@ class SimpleOpenID
return $this->URLs['openid_server'] . "?". $this->array2url($params); return $this->URLs['openid_server'] . "?". $this->array2url($params);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Redirect * Redirect
* *
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function Redirect() function Redirect()
{ {
// phpcs:enable
$redirect_to = $this->GetRedirectURL(); $redirect_to = $this->GetRedirectURL();
if (headers_sent()) if (headers_sent())
{ // Use JavaScript to redirect if content has been previously sent (not recommended, but safe) { // Use JavaScript to redirect if content has been previously sent (not recommended, but safe)
@ -447,14 +465,15 @@ class SimpleOpenID
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* ValidateWithServer * ValidateWithServer
* *
* @return boolean * @return boolean
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function ValidateWithServer() function ValidateWithServer()
{ {
// phpcs:enable
$params = array( $params = array(
'openid.assoc_handle' => urlencode($_GET['openid_assoc_handle']), 'openid.assoc_handle' => urlencode($_GET['openid_assoc_handle']),
'openid.signed' => urlencode($_GET['openid_signed']), 'openid.signed' => urlencode($_GET['openid_signed']),

View File

@ -461,6 +461,7 @@ class RssParser
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Triggered when opened tag is found * Triggered when opened tag is found
* *
@ -469,9 +470,9 @@ class RssParser
* @param array $attrs Attributes of tags * @param array $attrs Attributes of tags
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function feed_start_element($p, $element, &$attrs) function feed_start_element($p, $element, &$attrs)
{ {
// phpcs:enable
$el = $element = strtolower($element); $el = $element = strtolower($element);
$attrs = array_change_key_case($attrs, CASE_LOWER); $attrs = array_change_key_case($attrs, CASE_LOWER);
@ -582,6 +583,7 @@ class RssParser
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Triggered when CDATA is found * Triggered when CDATA is found
* *
@ -589,9 +591,9 @@ class RssParser
* @param string $text Tag * @param string $text Tag
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function feed_cdata($p, $text) function feed_cdata($p, $text)
{ {
// phpcs:enable
if ($this->_format == 'atom' and $this->incontent) if ($this->_format == 'atom' and $this->incontent)
{ {
$this->append_content($text); $this->append_content($text);
@ -603,6 +605,7 @@ class RssParser
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Triggered when closed tag is found * Triggered when closed tag is found
* *
@ -610,9 +613,9 @@ class RssParser
* @param string $el Tag * @param string $el Tag
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function feed_end_element($p, $el) function feed_end_element($p, $el)
{ {
// phpcs:enable
$el = strtolower($el); $el = strtolower($el);
if ($el == 'item' or $el == 'entry') if ($el == 'item' or $el == 'entry')
@ -673,15 +676,16 @@ class RssParser
$str1 .= $str2; $str1 .= $str2;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Enter description here ... * Enter description here ...
* *
* @param string $text Text * @param string $text Text
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function append_content($text) function append_content($text)
{ {
// phpcs:enable
if ( $this->initem ) { if ( $this->initem ) {
$this->concat($this->current_item[ $this->incontent ], $text); $this->concat($this->current_item[ $this->incontent ], $text);
} }
@ -759,7 +763,7 @@ function xml2php($xml)
} }
//Let see if the new child is not in the array //Let see if the new child is not in the array
if($tab==false && in_array($key,array_keys($array))) if ($tab==false && in_array($key,array_keys($array)))
{ {
//If this element is already in the array we will create an indexed array //If this element is already in the array we will create an indexed array
$tmp = $array[$key]; $tmp = $array[$key];
@ -783,7 +787,7 @@ function xml2php($xml)
} }
if($fils==0) if ($fils==0)
{ {
return (string) $xml; return (string) $xml;
} }

View File

@ -344,14 +344,15 @@ class SMTPs
$_aryToList = $this->getTO(); $_aryToList = $this->getTO();
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Attempt a connection to mail server * Attempt a connection to mail server
* *
* @return mixed $_retVal Boolean indicating success or failure on connection * @return mixed $_retVal Boolean indicating success or failure on connection
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function _server_connect() function _server_connect()
{ {
// phpcs:enable
// Default return value // Default return value
$_retVal = true; $_retVal = true;
@ -407,14 +408,15 @@ class SMTPs
return $_retVal; return $_retVal;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Attempt mail server authentication for a secure connection * Attempt mail server authentication for a secure connection
* *
* @return boolean|null $_retVal Boolean indicating success or failure of authentication * @return boolean|null $_retVal Boolean indicating success or failure of authentication
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function _server_authenticate() function _server_authenticate()
{ {
// phpcs:enable
global $conf; global $conf;
// Send the RFC2554 specified EHLO. // Send the RFC2554 specified EHLO.
@ -1038,6 +1040,7 @@ class SMTPs
$this->_msgRecipients = $aryHost; $this->_msgRecipients = $aryHost;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Returns an array of the various parts of an email address * Returns an array of the various parts of an email address
* This assumes a well formed address: * This assumes a well formed address:
@ -1054,9 +1057,9 @@ class SMTPs
* @param string $_strAddr Email address * @param string $_strAddr Email address
* @return array An array of the various parts of an email address * @return array An array of the various parts of an email address
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function _strip_email($_strAddr) function _strip_email($_strAddr)
{ {
// phpcs:enable
// Keep the orginal // Keep the orginal
$_aryEmail['org'] = $_strAddr; $_aryEmail['org'] = $_strAddr;
@ -1090,6 +1093,7 @@ class SMTPs
return $_aryEmail; return $_aryEmail;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Returns an array of bares addresses for use with 'RCPT TO:' * Returns an array of bares addresses for use with 'RCPT TO:'
* This is a "build as you go" method. Each time this method is called * This is a "build as you go" method. Each time this method is called
@ -1097,9 +1101,9 @@ class SMTPs
* *
* @return array Returns an array of bares addresses * @return array Returns an array of bares addresses
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_RCPT_list() function get_RCPT_list()
{ {
// phpcs:enable
/** /**
* An array of bares addresses for use with 'RCPT TO:' * An array of bares addresses for use with 'RCPT TO:'
*/ */
@ -1121,15 +1125,16 @@ class SMTPs
return $_RCPT_list; return $_RCPT_list;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Returns an array of addresses for a specific type; TO, CC or BCC * Returns an array of addresses for a specific type; TO, CC or BCC
* *
* @param string $_which Which collection of addresses to return ('to', 'cc', 'bcc') * @param string $_which Which collection of addresses to return ('to', 'cc', 'bcc')
* @return string|false Array of emaill address * @return string|false Array of emaill address
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_email_list($_which = null) function get_email_list($_which = null)
{ {
// phpcs:enable
// We need to know which address segment to pull // We need to know which address segment to pull
if ( $_which ) if ( $_which )
{ {
@ -1750,6 +1755,7 @@ class SMTPs
else if ($type == 'alternative') return $this->_smtpsAlternativeBoundary; else if ($type == 'alternative') return $this->_smtpsAlternativeBoundary;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* This function has been modified as provided by SirSir to allow multiline responses when * This function has been modified as provided by SirSir to allow multiline responses when
* using SMTP Extensions * using SMTP Extensions
@ -1758,9 +1764,9 @@ class SMTPs
* @param string $response Response. Example: "550 5.7.1 https://support.google.com/a/answer/6140680#invalidcred j21sm814390wre.3" * @param string $response Response. Example: "550 5.7.1 https://support.google.com/a/answer/6140680#invalidcred j21sm814390wre.3"
* @return boolean True or false * @return boolean True or false
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function server_parse($socket, $response) function server_parse($socket, $response)
{ {
// phpcs:enable
/** /**
* Returns constructed SELECT Object string or boolean upon failure * Returns constructed SELECT Object string or boolean upon failure
* Default value is set at true * Default value is set at true
@ -1792,6 +1798,7 @@ class SMTPs
return $_retVal; return $_retVal;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Send str * Send str
* *
@ -1800,9 +1807,9 @@ class SMTPs
* @param string $CRLF CRLF * @param string $CRLF CRLF
* @return boolean|null True or false * @return boolean|null True or false
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function socket_send_str( $_strSend, $_returnCode = null, $CRLF = "\r\n" ) function socket_send_str( $_strSend, $_returnCode = null, $CRLF = "\r\n" )
{ {
// phpcs:enable
if ($this->_debug) $this->log.=$_strSend; // @CHANGE LDR for log if ($this->_debug) $this->log.=$_strSend; // @CHANGE LDR for log
fputs($this->socket, $_strSend . $CRLF); fputs($this->socket, $_strSend . $CRLF);
if ($this->_debug) $this->log.=' ('.$_returnCode.')' . $CRLF; if ($this->_debug) $this->log.=' ('.$_returnCode.')' . $CRLF;

View File

@ -756,6 +756,7 @@ class Translate
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of all available languages * Return list of all available languages
* *
@ -764,9 +765,9 @@ class Translate
* @param int $usecode 1=Show code instead of country name for language variant, 2=Show only code * @param int $usecode 1=Show code instead of country name for language variant, 2=Show only code
* @return array List of languages * @return array List of languages
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_available_languages($langdir=DOL_DOCUMENT_ROOT,$maxlength=0,$usecode=0) function get_available_languages($langdir=DOL_DOCUMENT_ROOT,$maxlength=0,$usecode=0)
{ {
// phpcs:enable
global $conf; global $conf;
// We scan directory langs to detect available languages // We scan directory langs to detect available languages
@ -796,6 +797,7 @@ class Translate
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return if a filename $filename exists for current language (or alternate language) * Return if a filename $filename exists for current language (or alternate language)
* *
@ -803,9 +805,9 @@ class Translate
* @param integer $searchalt Search also alernate language file * @param integer $searchalt Search also alernate language file
* @return boolean true if exists and readable * @return boolean true if exists and readable
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function file_exists($filename,$searchalt=0) function file_exists($filename,$searchalt=0)
{ {
// phpcs:enable
// Test si fichier dans repertoire de la langue // Test si fichier dans repertoire de la langue
foreach($this->dir as $searchdir) foreach($this->dir as $searchdir)
{ {
@ -1020,15 +1022,16 @@ class Translate
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return an array with content of all loaded translation keys (found into this->tab_translate) so * Return an array with content of all loaded translation keys (found into this->tab_translate) so
* we get a substitution array we can use for substitutions (for mail or ODT generation for example) * we get a substitution array we can use for substitutions (for mail or ODT generation for example)
* *
* @return array Array of translation keys lang_key => string_translation_loaded * @return array Array of translation keys lang_key => string_translation_loaded
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_translations_for_substitutions() function get_translations_for_substitutions()
{ {
// phpcs:enable
$substitutionarray = array(); $substitutionarray = array();
foreach($this->tab_translate as $code => $label) { foreach($this->tab_translate as $code => $label) {

View File

@ -35,14 +35,15 @@ interface Database
*/ */
function ifsql($test, $resok, $resko); function ifsql($test, $resok, $resko);
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return datas as an array * Return datas as an array
* *
* @param resource $resultset Resultset of request * @param resource $resultset Resultset of request
* @return array Array * @return array Array
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_row($resultset);
function fetch_row($resultset); // phpcs:enable
/** /**
* Convert (by PHP) a GM Timestamp date into a string date with PHP server TZ to insert into a date field. * Convert (by PHP) a GM Timestamp date into a string date with PHP server TZ to insert into a date field.
@ -67,6 +68,7 @@ interface Database
*/ */
function begin(); function begin();
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Create a new database * Create a new database
* Do not use function xxx_create_db (xxx=mysql, ...) as they are deprecated * Do not use function xxx_create_db (xxx=mysql, ...) as they are deprecated
@ -78,8 +80,8 @@ interface Database
* @param string $owner Username of database owner * @param string $owner Username of database owner
* @return resource resource defined if OK, null if KO * @return resource resource defined if OK, null if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLCreateDb($database, $charset = '', $collation = '', $owner = '');
function DDLCreateDb($database, $charset = '', $collation = '', $owner = ''); // phpcs:enable
/** /**
* Return version of database server into an array * Return version of database server into an array
@ -97,6 +99,7 @@ interface Database
*/ */
static function convertSQLFromMysql($line, $type = 'ddl'); static function convertSQLFromMysql($line, $type = 'ddl');
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Renvoie le nombre de lignes dans le resultat d'une requete INSERT, DELETE ou UPDATE * Renvoie le nombre de lignes dans le resultat d'une requete INSERT, DELETE ou UPDATE
* *
@ -104,8 +107,8 @@ interface Database
* @return int Nombre de lignes * @return int Nombre de lignes
* @see num_rows * @see num_rows
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function affected_rows($resultset);
function affected_rows($resultset); // phpcs:enable
/** /**
* Return description of last error * Return description of last error
@ -114,6 +117,7 @@ interface Database
*/ */
function error(); function error();
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* List tables into a database * List tables into a database
* *
@ -121,8 +125,8 @@ interface Database
* @param string $table Nmae of table filter ('xxx%') * @param string $table Nmae of table filter ('xxx%')
* @return array List of tables in an array * @return array List of tables in an array
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLListTables($database, $table = '');
function DDLListTables($database, $table = ''); // phpcs:enable
/** /**
* Return last request executed with query() * Return last request executed with query()
@ -148,14 +152,15 @@ interface Database
*/ */
function decrypt($value); function decrypt($value);
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return datas as an array * Return datas as an array
* *
* @param resource $resultset Resultset of request * @param resource $resultset Resultset of request
* @return array Array * @return array Array
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_array($resultset);
function fetch_array($resultset); // phpcs:enable
/** /**
* Return last error label * Return last error label
@ -172,6 +177,7 @@ interface Database
*/ */
function escape($stringtoencode); function escape($stringtoencode);
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Get last ID after an insert INSERT * Get last ID after an insert INSERT
* *
@ -179,8 +185,8 @@ interface Database
* @param string $fieldid Field name * @param string $fieldid Field name
* @return int Id of row * @return int Id of row
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function last_insert_id($tab, $fieldid = 'rowid');
function last_insert_id($tab, $fieldid = 'rowid'); // phpcs:enable
/** /**
* Return full path of restore program * Return full path of restore program
@ -253,6 +259,7 @@ interface Database
*/ */
function getDefaultCollationDatabase(); function getDefaultCollationDatabase();
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return number of lines for result of a SELECT * Return number of lines for result of a SELECT
* *
@ -260,8 +267,8 @@ interface Database
* @return int Nb of lines * @return int Nb of lines
* @see affected_rows * @see affected_rows
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function num_rows($resultset);
function num_rows($resultset); // phpcs:enable
/** /**
* Return full path of dump program * Return full path of dump program
@ -284,6 +291,7 @@ interface Database
*/ */
function errno(); function errno();
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Create a table into database * Create a table into database
* *
@ -296,17 +304,18 @@ interface Database
* @param array $keys Tableau des champs cles noms => valeur * @param array $keys Tableau des champs cles noms => valeur
* @return int <0 if KO, >=0 if OK * @return int <0 if KO, >=0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLCreateTable($table, $fields, $primary_key, $type, $unique_keys = null, $fulltext_keys = null, $keys = null);
function DDLCreateTable($table, $fields, $primary_key, $type, $unique_keys = null, $fulltext_keys = null, $keys = null); // phpcs:enable
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Drop a table into database * Drop a table into database
* *
* @param string $table Name of table * @param string $table Name of table
* @return int <0 if KO, >=0 if OK * @return int <0 if KO, >=0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLDropTable($table);
function DDLDropTable($table); // phpcs:enable
/** /**
* Return list of available charset that can be used to store data in database * Return list of available charset that can be used to store data in database
@ -315,6 +324,7 @@ interface Database
*/ */
function getListOfCharacterSet(); function getListOfCharacterSet();
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Create a new field into table * Create a new field into table
* *
@ -324,9 +334,10 @@ interface Database
* @param string $field_position Optionnel ex.: "after champtruc" * @param string $field_position Optionnel ex.: "after champtruc"
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLAddField($table, $field_name, $field_desc, $field_position = "");
function DDLAddField($table, $field_name, $field_desc, $field_position = ""); // phpcs:enable
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Drop a field from table * Drop a field from table
* *
@ -334,9 +345,10 @@ interface Database
* @param string $field_name Name of field to drop * @param string $field_name Name of field to drop
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLDropField($table, $field_name);
function DDLDropField($table, $field_name); // phpcs:enable
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Update format of a field into a table * Update format of a field into a table
* *
@ -345,8 +357,8 @@ interface Database
* @param string $field_desc Array with description of field format * @param string $field_desc Array with description of field format
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLUpdateField($table, $field_name, $field_desc);
function DDLUpdateField($table, $field_name, $field_desc); // phpcs:enable
/** /**
* Return list of available collation that can be used for database * Return list of available collation that can be used for database
@ -355,6 +367,7 @@ interface Database
*/ */
function getListOfCollation(); function getListOfCollation();
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return a pointer of line with description of a table or field * Return a pointer of line with description of a table or field
* *
@ -362,8 +375,8 @@ interface Database
* @param string $field Optionnel : Name of field if we want description of field * @param string $field Optionnel : Name of field if we want description of field
* @return resource Resource * @return resource Resource
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLDescTable($table, $field = "");
function DDLDescTable($table, $field = ""); // phpcs:enable
/** /**
* Return version of database server * Return version of database server
@ -379,6 +392,7 @@ interface Database
*/ */
function getDefaultCharacterSetDatabase(); function getDefaultCharacterSetDatabase();
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Create a user and privileges to connect to database (even if database does not exists yet) * Create a user and privileges to connect to database (even if database does not exists yet)
* *
@ -388,13 +402,13 @@ interface Database
* @param string $dolibarr_main_db_name Database name where user must be granted * @param string $dolibarr_main_db_name Database name where user must be granted
* @return int <0 if KO, >=0 if OK * @return int <0 if KO, >=0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLCreateUser( function DDLCreateUser(
$dolibarr_main_db_host, $dolibarr_main_db_host,
$dolibarr_main_db_user, $dolibarr_main_db_user,
$dolibarr_main_db_pass, $dolibarr_main_db_pass,
$dolibarr_main_db_name $dolibarr_main_db_name
); );
// phpcs:enable
/** /**
* Convert (by PHP) a PHP server TZ string date into a Timestamps date (GMT if gm=true) * Convert (by PHP) a PHP server TZ string date into a Timestamps date (GMT if gm=true)
@ -425,14 +439,15 @@ interface Database
*/ */
function commit($log = ''); function commit($log = '');
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* List information of columns into a table. * List information of columns into a table.
* *
* @param string $table Name of table * @param string $table Name of table
* @return array Array with inforation on table * @return array Array with inforation on table
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLInfoTable($table);
function DDLInfoTable($table); // phpcs:enable
/** /**
* Free last resultset used. * Free last resultset used.
@ -457,29 +472,32 @@ interface Database
*/ */
function lastqueryerror(); function lastqueryerror();
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return connexion ID * Return connexion ID
* *
* @return string Id connexion * @return string Id connexion
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLGetConnectId();
function DDLGetConnectId(); // phpcs:enable
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Renvoie la ligne courante (comme un objet) pour le curseur resultset * Renvoie la ligne courante (comme un objet) pour le curseur resultset
* *
* @param resource $resultset Curseur de la requete voulue * @param resource $resultset Curseur de la requete voulue
* @return Object Object result line or false if KO or end of cursor * @return Object Object result line or false if KO or end of cursor
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_object($resultset);
function fetch_object($resultset); // phpcs:enable
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Select a database * Select a database
* *
* @param string $database Name of database * @param string $database Name of database
* @return boolean true if OK, false if KO * @return boolean true if OK, false if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_db($database);
function select_db($database); // phpcs:enable
} }

View File

@ -139,15 +139,16 @@ class DoliDBMssql extends DoliDB
return $line; return $line;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Select a database * Select a database
* *
* @param string $database Name of database * @param string $database Name of database
* @return boolean true if OK, false if KO * @return boolean true if OK, false if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_db($database) function select_db($database)
{ {
// phpcs:enable
return @mssql_select_db($database, $this->db); return @mssql_select_db($database, $this->db);
} }
@ -460,49 +461,53 @@ class DoliDBMssql extends DoliDB
return $ret; return $ret;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Renvoie la ligne courante (comme un objet) pour le curseur resultset * Renvoie la ligne courante (comme un objet) pour le curseur resultset
* *
* @param resource $resultset Curseur de la requete voulue * @param resource $resultset Curseur de la requete voulue
* @return object|false Object result line or false if KO or end of cursor * @return object|false Object result line or false if KO or end of cursor
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function fetch_object($resultset) function fetch_object($resultset)
{ {
// phpcs:enable
// Si le resultset n'est pas fourni, on prend le dernier utilise sur cette connexion // Si le resultset n'est pas fourni, on prend le dernier utilise sur cette connexion
if (! is_resource($resultset)) { $resultset=$this->_results; } if (! is_resource($resultset)) { $resultset=$this->_results; }
return mssql_fetch_object($resultset); return mssql_fetch_object($resultset);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return datas as an array * Return datas as an array
* *
* @param resource $resultset Resultset of request * @param resource $resultset Resultset of request
* @return array|false Array or false if KO or end of cursor * @return array|false Array or false if KO or end of cursor
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function fetch_array($resultset) function fetch_array($resultset)
{ {
// phpcs:enable
// Si le resultset n'est pas fourni, on prend le dernier utilise sur cette connexion // Si le resultset n'est pas fourni, on prend le dernier utilise sur cette connexion
if (! is_resource($resultset)) { $resultset=$this->_results; } if (! is_resource($resultset)) { $resultset=$this->_results; }
return mssql_fetch_array($resultset); return mssql_fetch_array($resultset);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return datas as an array * Return datas as an array
* *
* @param resource $resultset Resultset of request * @param resource $resultset Resultset of request
* @return array|false Array or false if KO or end of cursor * @return array|false Array or false if KO or end of cursor
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function fetch_row($resultset) function fetch_row($resultset)
{ {
// phpcs:enable
// Si le resultset n'est pas fourni, on prend le dernier utilise sur cette connexion // Si le resultset n'est pas fourni, on prend le dernier utilise sur cette connexion
if (! is_resource($resultset)) { $resultset=$this->_results; } if (! is_resource($resultset)) { $resultset=$this->_results; }
return @mssql_fetch_row($resultset); return @mssql_fetch_row($resultset);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return number of lines for result of a SELECT * Return number of lines for result of a SELECT
* *
@ -510,14 +515,15 @@ class DoliDBMssql extends DoliDB
* @return int Nb of lines * @return int Nb of lines
* @see affected_rows * @see affected_rows
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function num_rows($resultset) function num_rows($resultset)
{ {
// phpcs:enable
// Si le resultset n'est pas fourni, on prend le dernier utilise sur cette connexion // Si le resultset n'est pas fourni, on prend le dernier utilise sur cette connexion
if (! is_resource($resultset)) { $resultset=$this->_results; } if (! is_resource($resultset)) { $resultset=$this->_results; }
return mssql_num_rows($resultset); return mssql_num_rows($resultset);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Renvoie le nombre de lignes dans le resultat d'une requete INSERT, DELETE ou UPDATE * Renvoie le nombre de lignes dans le resultat d'une requete INSERT, DELETE ou UPDATE
* *
@ -525,9 +531,9 @@ class DoliDBMssql extends DoliDB
* @return int Nombre de lignes * @return int Nombre de lignes
* @see num_rows * @see num_rows
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function affected_rows($resultset) function affected_rows($resultset)
{ {
// phpcs:enable
// Si le resultset n'est pas fourni, on prend le dernier utilise sur cette connexion // Si le resultset n'est pas fourni, on prend le dernier utilise sur cette connexion
if (! is_resource($resultset)) { $resultset=$this->_results; } if (! is_resource($resultset)) { $resultset=$this->_results; }
// mssql necessite un link de base pour cette fonction contrairement // mssql necessite un link de base pour cette fonction contrairement
@ -645,6 +651,7 @@ class DoliDBMssql extends DoliDB
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Get last ID after an insert INSERT * Get last ID after an insert INSERT
* *
@ -652,9 +659,9 @@ class DoliDBMssql extends DoliDB
* @param string $fieldid Field name * @param string $fieldid Field name
* @return int Id of row or -1 on error * @return int Id of row or -1 on error
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function last_insert_id($tab,$fieldid='rowid') function last_insert_id($tab,$fieldid='rowid')
{ {
// phpcs:enable
$res = $this->query("SELECT @@IDENTITY as id"); $res = $this->query("SELECT @@IDENTITY as id");
if ($res && $data = $this->fetch_array($res)) if ($res && $data = $this->fetch_array($res))
{ {
@ -709,14 +716,15 @@ class DoliDBMssql extends DoliDB
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return connexion ID * Return connexion ID
* *
* @return string Id connexion * @return string Id connexion
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLGetConnectId() function DDLGetConnectId()
{ {
// phpcs:enable
$resql=$this->query('SELECT CONNECTION_ID()'); $resql=$this->query('SELECT CONNECTION_ID()');
if ($resql) if ($resql)
{ {
@ -726,6 +734,7 @@ class DoliDBMssql extends DoliDB
else return '?'; else return '?';
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Create a new database * Create a new database
* Do not use function xxx_create_db (xxx=mysql, ...) as they are deprecated * Do not use function xxx_create_db (xxx=mysql, ...) as they are deprecated
@ -737,9 +746,9 @@ class DoliDBMssql extends DoliDB
* @param string $owner Username of database owner * @param string $owner Username of database owner
* @return false|resource|true resource defined if OK, false if KO * @return false|resource|true resource defined if OK, false if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLCreateDb($database,$charset='',$collation='',$owner='') function DDLCreateDb($database,$charset='',$collation='',$owner='')
{ {
// phpcs:enable
/*if (empty($charset)) $charset=$this->forcecharset; /*if (empty($charset)) $charset=$this->forcecharset;
if (empty($collation)) $collation=$this->forcecollate; if (empty($collation)) $collation=$this->forcecollate;
*/ */
@ -763,6 +772,7 @@ class DoliDBMssql extends DoliDB
return $ret; return $ret;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* List tables into a database * List tables into a database
* *
@ -770,22 +780,23 @@ class DoliDBMssql extends DoliDB
* @param string $table Nmae of table filter ('xxx%') * @param string $table Nmae of table filter ('xxx%')
* @return array List of tables in an array * @return array List of tables in an array
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLListTables($database,$table='') function DDLListTables($database,$table='')
{ {
// phpcs:enable
$this->_results = mssql_list_tables($database, $this->db); $this->_results = mssql_list_tables($database, $this->db);
return $this->_results; return $this->_results;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* List information of columns into a table. * List information of columns into a table.
* *
* @param string $table Name of table * @param string $table Name of table
* @return array Tableau des informations des champs de la table * @return array Tableau des informations des champs de la table
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLInfoTable($table) function DDLInfoTable($table)
{ {
// phpcs:enable
// FIXME: Dummy method // FIXME: Dummy method
// TODO: Implement // TODO: Implement
@ -795,6 +806,7 @@ class DoliDBMssql extends DoliDB
return $infotables; return $infotables;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Create a table into database * Create a table into database
* *
@ -807,9 +819,9 @@ class DoliDBMssql extends DoliDB
* @param array $keys Tableau des champs cles noms => valeur * @param array $keys Tableau des champs cles noms => valeur
* @return int <0 if KO, >=0 if OK * @return int <0 if KO, >=0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLCreateTable($table,$fields,$primary_key,$type,$unique_keys=null,$fulltext_keys=null,$keys=null) function DDLCreateTable($table,$fields,$primary_key,$type,$unique_keys=null,$fulltext_keys=null,$keys=null)
{ {
// phpcs:enable
// FIXME: $fulltext_keys parameter is unused // FIXME: $fulltext_keys parameter is unused
// cles recherchees dans le tableau des descriptions (fields) : type,value,attribute,null,default,extra // cles recherchees dans le tableau des descriptions (fields) : type,value,attribute,null,default,extra
@ -875,15 +887,16 @@ class DoliDBMssql extends DoliDB
return 1; return 1;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Drop a table into database * Drop a table into database
* *
* @param string $table Name of table * @param string $table Name of table
* @return int <0 if KO, >=0 if OK * @return int <0 if KO, >=0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLDropTable($table) function DDLDropTable($table)
{ {
// phpcs:enable
$sql = "DROP TABLE ".$table; $sql = "DROP TABLE ".$table;
if (! $this->query($sql)) if (! $this->query($sql))
@ -892,6 +905,7 @@ class DoliDBMssql extends DoliDB
return 1; return 1;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return a pointer of line with description of a table or field * Return a pointer of line with description of a table or field
* *
@ -899,9 +913,9 @@ class DoliDBMssql extends DoliDB
* @param string $field Optionnel : Name of field if we want description of field * @param string $field Optionnel : Name of field if we want description of field
* @return false|resource|true Resource * @return false|resource|true Resource
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLDescTable($table,$field="") function DDLDescTable($table,$field="")
{ {
// phpcs:enable
$sql="DESC ".$table." ".$field; $sql="DESC ".$table." ".$field;
dol_syslog($sql); dol_syslog($sql);
@ -909,6 +923,7 @@ class DoliDBMssql extends DoliDB
return $this->_results; return $this->_results;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Create a new field into table * Create a new field into table
* *
@ -918,9 +933,9 @@ class DoliDBMssql extends DoliDB
* @param string $field_position Optionnel ex.: "after champtruc" * @param string $field_position Optionnel ex.: "after champtruc"
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLAddField($table,$field_name,$field_desc,$field_position="") function DDLAddField($table,$field_name,$field_desc,$field_position="")
{ {
// phpcs:enable
// cles recherchees dans le tableau des descriptions (field_desc) : type,value,attribute,null,default,extra // cles recherchees dans le tableau des descriptions (field_desc) : type,value,attribute,null,default,extra
// ex. : $field_desc = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment'); // ex. : $field_desc = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment');
$sql= "ALTER TABLE ".$table." ADD ".$field_name." "; $sql= "ALTER TABLE ".$table." ADD ".$field_name." ";
@ -946,6 +961,7 @@ class DoliDBMssql extends DoliDB
return 1; return 1;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Update format of a field into a table * Update format of a field into a table
* *
@ -954,9 +970,9 @@ class DoliDBMssql extends DoliDB
* @param string $field_desc Array with description of field format * @param string $field_desc Array with description of field format
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLUpdateField($table,$field_name,$field_desc) function DDLUpdateField($table,$field_name,$field_desc)
{ {
// phpcs:enable
$sql = "ALTER TABLE ".$table; $sql = "ALTER TABLE ".$table;
$sql .= " MODIFY COLUMN ".$field_name." ".$field_desc['type']; $sql .= " MODIFY COLUMN ".$field_name." ".$field_desc['type'];
if ($field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int' || $field_desc['type'] == 'varchar') { if ($field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int' || $field_desc['type'] == 'varchar') {
@ -970,6 +986,7 @@ class DoliDBMssql extends DoliDB
return 1; return 1;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Drop a field from table * Drop a field from table
* *
@ -977,9 +994,9 @@ class DoliDBMssql extends DoliDB
* @param string $field_name Name of field to drop * @param string $field_name Name of field to drop
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLDropField($table,$field_name) function DDLDropField($table,$field_name)
{ {
// phpcs:enable
$sql= "ALTER TABLE ".$table." DROP COLUMN `".$field_name."`"; $sql= "ALTER TABLE ".$table." DROP COLUMN `".$field_name."`";
dol_syslog($sql,LOG_DEBUG); dol_syslog($sql,LOG_DEBUG);
if (! $this->query($sql)) if (! $this->query($sql))
@ -990,6 +1007,7 @@ class DoliDBMssql extends DoliDB
else return 1; else return 1;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Create a user and privileges to connect to database (even if database does not exists yet) * Create a user and privileges to connect to database (even if database does not exists yet)
* *
@ -999,10 +1017,10 @@ class DoliDBMssql extends DoliDB
* @param string $dolibarr_main_db_name Database name where user must be granted * @param string $dolibarr_main_db_name Database name where user must be granted
* @return int <0 if KO, >=0 if OK * @return int <0 if KO, >=0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLCreateUser($dolibarr_main_db_host,$dolibarr_main_db_user,$dolibarr_main_db_pass,$dolibarr_main_db_name) function DDLCreateUser($dolibarr_main_db_host,$dolibarr_main_db_user,$dolibarr_main_db_pass,$dolibarr_main_db_name)
{ {
$sql = "CREATE LOGIN ".$this->EscapeFieldName($dolibarr_main_db_user)." WITH PASSWORD='$dolibarr_main_db_pass'"; // phpcs:enable
$sql = "CREATE LOGIN ".$this->EscapeFieldName($dolibarr_main_db_user)." WITH PASSWORD='$dolibarr_main_db_pass'";
dol_syslog(get_class($this)."::DDLCreateUser", LOG_DEBUG); // No sql to avoid password in log dol_syslog(get_class($this)."::DDLCreateUser", LOG_DEBUG); // No sql to avoid password in log
$resql=$this->query($sql); $resql=$this->query($sql);
if (! $resql) if (! $resql)
@ -1150,19 +1168,21 @@ class DoliDBMssql extends DoliDB
return array(); return array();
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Escape a field name according to escape's syntax * Escape a field name according to escape's syntax
* *
* @param string $fieldname Field's name to escape * @param string $fieldname Field's name to escape
* @return string field's name escaped * @return string field's name escaped
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function EscapeFieldName($fieldname) function EscapeFieldName($fieldname)
{ {
// phpcs:enable
return "[".$fieldname."]"; return "[".$fieldname."]";
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Get information on field * Get information on field
* *
@ -1170,9 +1190,9 @@ class DoliDBMssql extends DoliDB
* @param mixed $fields String for one field or array of string for multiple field * @param mixed $fields String for one field or array of string for multiple field
* @return false|object * @return false|object
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function GetFieldInformation($table,$fields) function GetFieldInformation($table,$fields)
{ {
// phpcs:enable
$sql="SELECT * from INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='".$this->escape($table)."' AND COLUMN_NAME"; $sql="SELECT * from INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='".$this->escape($table)."' AND COLUMN_NAME";
if (is_array($fields)) if (is_array($fields))
{ {

View File

@ -167,17 +167,18 @@ class DoliDBMysqli extends DoliDB
return $line; return $line;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Select a database * Select a database
* *
* @param string $database Name of database * @param string $database Name of database
* @return boolean true if OK, false if KO * @return boolean true if OK, false if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_db($database) function select_db($database)
{ {
// phpcs:enable
dol_syslog(get_class($this)."::select_db database=".$database, LOG_DEBUG); dol_syslog(get_class($this)."::select_db database=".$database, LOG_DEBUG);
return $this->db->select_db($database); return $this->db->select_db($database);
} }
@ -286,44 +287,47 @@ class DoliDBMysqli extends DoliDB
return $ret; return $ret;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Renvoie la ligne courante (comme un objet) pour le curseur resultset * Renvoie la ligne courante (comme un objet) pour le curseur resultset
* *
* @param mysqli_result $resultset Curseur de la requete voulue * @param mysqli_result $resultset Curseur de la requete voulue
* @return object|null Object result line or null if KO or end of cursor * @return object|null Object result line or null if KO or end of cursor
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function fetch_object($resultset) function fetch_object($resultset)
{ {
// phpcs:enable
// Si le resultset n'est pas fourni, on prend le dernier utilise sur cette connexion // Si le resultset n'est pas fourni, on prend le dernier utilise sur cette connexion
if (! is_object($resultset)) { $resultset=$this->_results; } if (! is_object($resultset)) { $resultset=$this->_results; }
return $resultset->fetch_object(); return $resultset->fetch_object();
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return datas as an array * Return datas as an array
* *
* @param mysqli_result $resultset Resultset of request * @param mysqli_result $resultset Resultset of request
* @return array|null Array or null if KO or end of cursor * @return array|null Array or null if KO or end of cursor
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function fetch_array($resultset) function fetch_array($resultset)
{ {
// phpcs:enable
// If resultset not provided, we take the last used by connexion // If resultset not provided, we take the last used by connexion
if (! is_object($resultset)) { $resultset=$this->_results; } if (! is_object($resultset)) { $resultset=$this->_results; }
return $resultset->fetch_array(); return $resultset->fetch_array();
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return datas as an array * Return datas as an array
* *
* @param mysqli_result $resultset Resultset of request * @param mysqli_result $resultset Resultset of request
* @return array|null|0 Array or null if KO or end of cursor or 0 if resultset is bool * @return array|null|0 Array or null if KO or end of cursor or 0 if resultset is bool
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function fetch_row($resultset) function fetch_row($resultset)
{ {
// phpcs:enable
// If resultset not provided, we take the last used by connexion // If resultset not provided, we take the last used by connexion
if (! is_bool($resultset)) if (! is_bool($resultset))
{ {
@ -337,6 +341,7 @@ class DoliDBMysqli extends DoliDB
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return number of lines for result of a SELECT * Return number of lines for result of a SELECT
* *
@ -344,14 +349,15 @@ class DoliDBMysqli extends DoliDB
* @return int Nb of lines * @return int Nb of lines
* @see affected_rows * @see affected_rows
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function num_rows($resultset) function num_rows($resultset)
{ {
// phpcs:enable
// If resultset not provided, we take the last used by connexion // If resultset not provided, we take the last used by connexion
if (! is_object($resultset)) { $resultset=$this->_results; } if (! is_object($resultset)) { $resultset=$this->_results; }
return $resultset->num_rows; return $resultset->num_rows;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Renvoie le nombre de lignes dans le resultat d'une requete INSERT, DELETE ou UPDATE * Renvoie le nombre de lignes dans le resultat d'une requete INSERT, DELETE ou UPDATE
* *
@ -359,9 +365,9 @@ class DoliDBMysqli extends DoliDB
* @return int Nombre de lignes * @return int Nombre de lignes
* @see num_rows * @see num_rows
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function affected_rows($resultset) function affected_rows($resultset)
{ {
// phpcs:enable
// If resultset not provided, we take the last used by connexion // If resultset not provided, we take the last used by connexion
if (! is_object($resultset)) { $resultset=$this->_results; } if (! is_object($resultset)) { $resultset=$this->_results; }
// mysql necessite un link de base pour cette fonction contrairement // mysql necessite un link de base pour cette fonction contrairement
@ -462,6 +468,7 @@ class DoliDBMysqli extends DoliDB
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Get last ID after an insert INSERT * Get last ID after an insert INSERT
* *
@ -469,9 +476,9 @@ class DoliDBMysqli extends DoliDB
* @param string $fieldid Field name * @param string $fieldid Field name
* @return int|string Id of row * @return int|string Id of row
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function last_insert_id($tab,$fieldid='rowid') function last_insert_id($tab,$fieldid='rowid')
{ {
// phpcs:enable
return $this->db->insert_id; return $this->db->insert_id;
} }
@ -545,14 +552,15 @@ class DoliDBMysqli extends DoliDB
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return connexion ID * Return connexion ID
* *
* @return string Id connexion * @return string Id connexion
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLGetConnectId() function DDLGetConnectId()
{ {
// phpcs:enable
$resql=$this->query('SELECT CONNECTION_ID()'); $resql=$this->query('SELECT CONNECTION_ID()');
if ($resql) if ($resql)
{ {
@ -562,8 +570,9 @@ class DoliDBMysqli extends DoliDB
else return '?'; else return '?';
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Create a new database * Create a new database
* Do not use function xxx_create_db (xxx=mysql, ...) as they are deprecated * Do not use function xxx_create_db (xxx=mysql, ...) as they are deprecated
* We force to create database with charset this->forcecharset and collate this->forcecollate * We force to create database with charset this->forcecharset and collate this->forcecollate
* *
@ -573,9 +582,9 @@ class DoliDBMysqli extends DoliDB
* @param string $owner Username of database owner * @param string $owner Username of database owner
* @return bool|mysqli_result resource defined if OK, null if KO * @return bool|mysqli_result resource defined if OK, null if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLCreateDb($database,$charset='',$collation='',$owner='') function DDLCreateDb($database,$charset='',$collation='',$owner='')
{ {
// phpcs:enable
if (empty($charset)) $charset=$this->forcecharset; if (empty($charset)) $charset=$this->forcecharset;
if (empty($collation)) $collation=$this->forcecollate; if (empty($collation)) $collation=$this->forcecollate;
@ -595,6 +604,7 @@ class DoliDBMysqli extends DoliDB
return $ret; return $ret;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* List tables into a database * List tables into a database
* *
@ -602,9 +612,9 @@ class DoliDBMysqli extends DoliDB
* @param string $table Nmae of table filter ('xxx%') * @param string $table Nmae of table filter ('xxx%')
* @return array List of tables in an array * @return array List of tables in an array
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLListTables($database, $table='') function DDLListTables($database, $table='')
{ {
// phpcs:enable
$listtables=array(); $listtables=array();
$like = ''; $like = '';
@ -622,15 +632,16 @@ class DoliDBMysqli extends DoliDB
return $listtables; return $listtables;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* List information of columns into a table. * List information of columns into a table.
* *
* @param string $table Name of table * @param string $table Name of table
* @return array Tableau des informations des champs de la table * @return array Tableau des informations des champs de la table
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLInfoTable($table) function DDLInfoTable($table)
{ {
// phpcs:enable
$infotables=array(); $infotables=array();
$sql="SHOW FULL COLUMNS FROM ".$table.";"; $sql="SHOW FULL COLUMNS FROM ".$table.";";
@ -647,6 +658,7 @@ class DoliDBMysqli extends DoliDB
return $infotables; return $infotables;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Create a table into database * Create a table into database
* *
@ -659,9 +671,9 @@ class DoliDBMysqli extends DoliDB
* @param array $keys Tableau des champs cles noms => valeur * @param array $keys Tableau des champs cles noms => valeur
* @return int <0 if KO, >=0 if OK * @return int <0 if KO, >=0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLCreateTable($table,$fields,$primary_key,$type,$unique_keys=null,$fulltext_keys=null,$keys=null) function DDLCreateTable($table,$fields,$primary_key,$type,$unique_keys=null,$fulltext_keys=null,$keys=null)
{ {
// phpcs:enable
// FIXME: $fulltext_keys parameter is unused // FIXME: $fulltext_keys parameter is unused
// cles recherchees dans le tableau des descriptions (fields) : type,value,attribute,null,default,extra // cles recherchees dans le tableau des descriptions (fields) : type,value,attribute,null,default,extra
@ -730,16 +742,17 @@ class DoliDBMysqli extends DoliDB
return 1; return 1;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Drop a table into database * Drop a table into database
* *
* @param string $table Name of table * @param string $table Name of table
* @return int <0 if KO, >=0 if OK * @return int <0 if KO, >=0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLDropTable($table) function DDLDropTable($table)
{ {
$sql = "DROP TABLE ".$table; // phpcs:enable
$sql = "DROP TABLE ".$table;
if (! $this->query($sql)) if (! $this->query($sql))
return -1; return -1;
@ -747,6 +760,7 @@ class DoliDBMysqli extends DoliDB
return 1; return 1;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return a pointer of line with description of a table or field * Return a pointer of line with description of a table or field
* *
@ -754,9 +768,9 @@ class DoliDBMysqli extends DoliDB
* @param string $field Optionnel : Name of field if we want description of field * @param string $field Optionnel : Name of field if we want description of field
* @return bool|mysqli_result Resultset x (x->Field, x->Type, ...) * @return bool|mysqli_result Resultset x (x->Field, x->Type, ...)
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLDescTable($table,$field="") function DDLDescTable($table,$field="")
{ {
// phpcs:enable
$sql="DESC ".$table." ".$field; $sql="DESC ".$table." ".$field;
dol_syslog(get_class($this)."::DDLDescTable ".$sql,LOG_DEBUG); dol_syslog(get_class($this)."::DDLDescTable ".$sql,LOG_DEBUG);
@ -764,6 +778,7 @@ class DoliDBMysqli extends DoliDB
return $this->_results; return $this->_results;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Create a new field into table * Create a new field into table
* *
@ -773,9 +788,9 @@ class DoliDBMysqli extends DoliDB
* @param string $field_position Optionnel ex.: "after champtruc" * @param string $field_position Optionnel ex.: "after champtruc"
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLAddField($table,$field_name,$field_desc,$field_position="") function DDLAddField($table,$field_name,$field_desc,$field_position="")
{ {
// phpcs:enable
// cles recherchees dans le tableau des descriptions (field_desc) : type,value,attribute,null,default,extra // cles recherchees dans le tableau des descriptions (field_desc) : type,value,attribute,null,default,extra
// ex. : $field_desc = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment'); // ex. : $field_desc = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment');
$sql= "ALTER TABLE ".$table." ADD ".$field_name." "; $sql= "ALTER TABLE ".$table." ADD ".$field_name." ";
@ -815,6 +830,7 @@ class DoliDBMysqli extends DoliDB
return -1; return -1;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Update format of a field into a table * Update format of a field into a table
* *
@ -823,9 +839,9 @@ class DoliDBMysqli extends DoliDB
* @param string $field_desc Array with description of field format * @param string $field_desc Array with description of field format
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLUpdateField($table,$field_name,$field_desc) function DDLUpdateField($table,$field_name,$field_desc)
{ {
// phpcs:enable
$sql = "ALTER TABLE ".$table; $sql = "ALTER TABLE ".$table;
$sql .= " MODIFY COLUMN ".$field_name." ".$field_desc['type']; $sql .= " MODIFY COLUMN ".$field_name." ".$field_desc['type'];
if ($field_desc['type'] == 'double' || $field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int' || $field_desc['type'] == 'varchar') { if ($field_desc['type'] == 'double' || $field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int' || $field_desc['type'] == 'varchar') {
@ -861,6 +877,7 @@ class DoliDBMysqli extends DoliDB
return 1; return 1;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Drop a field from table * Drop a field from table
* *
@ -868,19 +885,20 @@ class DoliDBMysqli extends DoliDB
* @param string $field_name Name of field to drop * @param string $field_name Name of field to drop
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLDropField($table,$field_name) function DDLDropField($table,$field_name)
{ {
// phpcs:enable
$sql= "ALTER TABLE ".$table." DROP COLUMN `".$field_name."`"; $sql= "ALTER TABLE ".$table." DROP COLUMN `".$field_name."`";
dol_syslog(get_class($this)."::DDLDropField ".$sql,LOG_DEBUG); dol_syslog(get_class($this)."::DDLDropField ".$sql,LOG_DEBUG);
if ($this->query($sql)) { if ($this->query($sql)) {
return 1; return 1;
} }
$this->error=$this->lasterror(); $this->error=$this->lasterror();
return -1; return -1;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Create a user and privileges to connect to database (even if database does not exists yet) * Create a user and privileges to connect to database (even if database does not exists yet)
* *
@ -890,9 +908,9 @@ class DoliDBMysqli extends DoliDB
* @param string $dolibarr_main_db_name Database name where user must be granted * @param string $dolibarr_main_db_name Database name where user must be granted
* @return int <0 if KO, >=0 if OK * @return int <0 if KO, >=0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLCreateUser($dolibarr_main_db_host,$dolibarr_main_db_user,$dolibarr_main_db_pass,$dolibarr_main_db_name) function DDLCreateUser($dolibarr_main_db_host,$dolibarr_main_db_user,$dolibarr_main_db_pass,$dolibarr_main_db_name)
{ {
// phpcs:enable
$sql = "CREATE USER '".$this->escape($dolibarr_main_db_user)."'"; $sql = "CREATE USER '".$this->escape($dolibarr_main_db_user)."'";
dol_syslog(get_class($this)."::DDLCreateUser", LOG_DEBUG); // No sql to avoid password in log dol_syslog(get_class($this)."::DDLCreateUser", LOG_DEBUG); // No sql to avoid password in log
$resql=$this->query($sql); $resql=$this->query($sql);

View File

@ -359,20 +359,24 @@ class DoliDBPgsql extends DoliDB
return $line; return $line;
} }
/** // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
* Select a database /**
* Select a database
* Ici postgresql n'a aucune fonction equivalente de mysql_select_db * Ici postgresql n'a aucune fonction equivalente de mysql_select_db
* On compare juste manuellement si la database choisie est bien celle activee par la connexion * On compare juste manuellement si la database choisie est bien celle activee par la connexion
* *
* @param string $database Name of database * @param string $database Name of database
* @return bool true if OK, false if KO * @return bool true if OK, false if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_db($database) function select_db($database)
{ {
if ($database == $this->database_name) return true; // phpcs:enable
else return false; if ($database == $this->database_name) {
} return true;
} else {
return false;
}
}
/** /**
* Connexion to server * Connexion to server
@ -541,63 +545,68 @@ class DoliDBPgsql extends DoliDB
return $ret; return $ret;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Renvoie la ligne courante (comme un objet) pour le curseur resultset * Renvoie la ligne courante (comme un objet) pour le curseur resultset
* *
* @param resource $resultset Curseur de la requete voulue * @param resource $resultset Curseur de la requete voulue
* @return false|object Object result line or false if KO or end of cursor * @return false|object Object result line or false if KO or end of cursor
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function fetch_object($resultset) function fetch_object($resultset)
{ {
// phpcs:enable
// If resultset not provided, we take the last used by connexion // If resultset not provided, we take the last used by connexion
if (! is_resource($resultset)) { $resultset=$this->_results; } if (! is_resource($resultset)) { $resultset=$this->_results; }
return pg_fetch_object($resultset); return pg_fetch_object($resultset);
} }
/** // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Return datas as an array * Return datas as an array
* *
* @param resource $resultset Resultset of request * @param resource $resultset Resultset of request
* @return false|array Array * @return false|array Array
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function fetch_array($resultset) function fetch_array($resultset)
{ {
// phpcs:enable
// If resultset not provided, we take the last used by connexion // If resultset not provided, we take the last used by connexion
if (! is_resource($resultset)) { $resultset=$this->_results; } if (! is_resource($resultset)) { $resultset=$this->_results; }
return pg_fetch_array($resultset); return pg_fetch_array($resultset);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return datas as an array * Return datas as an array
* *
* @param resource $resultset Resultset of request * @param resource $resultset Resultset of request
* @return false|array Array * @return false|array Array
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function fetch_row($resultset) function fetch_row($resultset)
{ {
// phpcs:enable
// Si le resultset n'est pas fourni, on prend le dernier utilise sur cette connexion // Si le resultset n'est pas fourni, on prend le dernier utilise sur cette connexion
if (! is_resource($resultset)) { $resultset=$this->_results; } if (! is_resource($resultset)) { $resultset=$this->_results; }
return pg_fetch_row($resultset); return pg_fetch_row($resultset);
} }
/** // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Return number of lines for result of a SELECT * Return number of lines for result of a SELECT
* *
* @param resourse $resultset Resulset of requests * @param resourse $resultset Resulset of requests
* @return int Nb of lines, -1 on error * @return int Nb of lines, -1 on error
* @see affected_rows * @see affected_rows
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function num_rows($resultset) function num_rows($resultset)
{ {
// phpcs:enable
// If resultset not provided, we take the last used by connexion // If resultset not provided, we take the last used by connexion
if (! is_resource($resultset)) { $resultset=$this->_results; } if (! is_resource($resultset)) { $resultset=$this->_results; }
return pg_num_rows($resultset); return pg_num_rows($resultset);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Renvoie le nombre de lignes dans le resultat d'une requete INSERT, DELETE ou UPDATE * Renvoie le nombre de lignes dans le resultat d'une requete INSERT, DELETE ou UPDATE
* *
@ -605,9 +614,9 @@ class DoliDBPgsql extends DoliDB
* @return int Nb of lines * @return int Nb of lines
* @see num_rows * @see num_rows
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function affected_rows($resultset) function affected_rows($resultset)
{ {
// phpcs:enable
// If resultset not provided, we take the last used by connexion // If resultset not provided, we take the last used by connexion
if (! is_resource($resultset)) { $resultset=$this->_results; } if (! is_resource($resultset)) { $resultset=$this->_results; }
// pgsql necessite un resultset pour cette fonction contrairement // pgsql necessite un resultset pour cette fonction contrairement
@ -760,6 +769,7 @@ class DoliDBPgsql extends DoliDB
return pg_last_error($this->db); return pg_last_error($this->db);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Get last ID after an insert INSERT * Get last ID after an insert INSERT
* *
@ -767,9 +777,9 @@ class DoliDBPgsql extends DoliDB
* @param string $fieldid Field name * @param string $fieldid Field name
* @return string Id of row * @return string Id of row
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function last_insert_id($tab,$fieldid='rowid') function last_insert_id($tab,$fieldid='rowid')
{ {
// phpcs:enable
//$result = pg_query($this->db,"SELECT MAX(".$fieldid.") FROM ".$tab); //$result = pg_query($this->db,"SELECT MAX(".$fieldid.") FROM ".$tab);
$result = pg_query($this->db,"SELECT currval('".$tab."_".$fieldid."_seq')"); $result = pg_query($this->db,"SELECT currval('".$tab."_".$fieldid."_seq')");
if (! $result) if (! $result)
@ -826,19 +836,21 @@ class DoliDBPgsql extends DoliDB
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return connexion ID * Return connexion ID
* *
* @return string Id connexion * @return string Id connexion
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLGetConnectId() function DDLGetConnectId()
{ {
// phpcs:enable
return '?'; return '?';
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Create a new database * Create a new database
* Do not use function xxx_create_db (xxx=mysql, ...) as they are deprecated * Do not use function xxx_create_db (xxx=mysql, ...) as they are deprecated
@ -850,9 +862,9 @@ class DoliDBPgsql extends DoliDB
* @param string $owner Username of database owner * @param string $owner Username of database owner
* @return false|resource resource defined if OK, null if KO * @return false|resource resource defined if OK, null if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLCreateDb($database,$charset='',$collation='',$owner='') function DDLCreateDb($database,$charset='',$collation='',$owner='')
{ {
// phpcs:enable
if (empty($charset)) $charset=$this->forcecharset; if (empty($charset)) $charset=$this->forcecharset;
if (empty($collation)) $collation=$this->forcecollate; if (empty($collation)) $collation=$this->forcecollate;
@ -865,6 +877,7 @@ class DoliDBPgsql extends DoliDB
return $ret; return $ret;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* List tables into a database * List tables into a database
* *
@ -872,9 +885,9 @@ class DoliDBPgsql extends DoliDB
* @param string $table Name of table filter ('xxx%') * @param string $table Name of table filter ('xxx%')
* @return array List of tables in an array * @return array List of tables in an array
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLListTables($database, $table='') function DDLListTables($database, $table='')
{ {
// phpcs:enable
$listtables=array(); $listtables=array();
$like = ''; $like = '';
@ -890,6 +903,7 @@ class DoliDBPgsql extends DoliDB
return $listtables; return $listtables;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* List information of columns into a table. * List information of columns into a table.
* *
@ -897,9 +911,9 @@ class DoliDBPgsql extends DoliDB
* @return array Tableau des informations des champs de la table * @return array Tableau des informations des champs de la table
* *
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLInfoTable($table) function DDLInfoTable($table)
{ {
// phpcs:enable
$infotables=array(); $infotables=array();
$sql="SELECT "; $sql="SELECT ";
@ -931,6 +945,7 @@ class DoliDBPgsql extends DoliDB
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Create a table into database * Create a table into database
* *
@ -943,9 +958,9 @@ class DoliDBPgsql extends DoliDB
* @param array $keys Tableau des champs cles noms => valeur * @param array $keys Tableau des champs cles noms => valeur
* @return int <0 if KO, >=0 if OK * @return int <0 if KO, >=0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLCreateTable($table,$fields,$primary_key,$type,$unique_keys=null,$fulltext_keys=null,$keys=null) function DDLCreateTable($table,$fields,$primary_key,$type,$unique_keys=null,$fulltext_keys=null,$keys=null)
{ {
// phpcs:enable
// FIXME: $fulltext_keys parameter is unused // FIXME: $fulltext_keys parameter is unused
// cles recherchees dans le tableau des descriptions (fields) : type,value,attribute,null,default,extra // cles recherchees dans le tableau des descriptions (fields) : type,value,attribute,null,default,extra
@ -1011,15 +1026,16 @@ class DoliDBPgsql extends DoliDB
return 1; return 1;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Drop a table into database * Drop a table into database
* *
* @param string $table Name of table * @param string $table Name of table
* @return int <0 if KO, >=0 if OK * @return int <0 if KO, >=0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLDropTable($table) function DDLDropTable($table)
{ {
// phpcs:enable
$sql = "DROP TABLE ".$table; $sql = "DROP TABLE ".$table;
if (! $this->query($sql)) if (! $this->query($sql))
@ -1028,6 +1044,7 @@ class DoliDBPgsql extends DoliDB
return 1; return 1;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Create a user to connect to database * Create a user to connect to database
* *
@ -1037,9 +1054,9 @@ class DoliDBPgsql extends DoliDB
* @param string $dolibarr_main_db_name Database name where user must be granted * @param string $dolibarr_main_db_name Database name where user must be granted
* @return int <0 if KO, >=0 if OK * @return int <0 if KO, >=0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLCreateUser($dolibarr_main_db_host,$dolibarr_main_db_user,$dolibarr_main_db_pass,$dolibarr_main_db_name) function DDLCreateUser($dolibarr_main_db_host,$dolibarr_main_db_user,$dolibarr_main_db_pass,$dolibarr_main_db_name)
{ {
// phpcs:enable
// Note: using ' on user does not works with pgsql // Note: using ' on user does not works with pgsql
$sql = "CREATE USER ".$this->escape($dolibarr_main_db_user)." with password '".$this->escape($dolibarr_main_db_pass)."'"; $sql = "CREATE USER ".$this->escape($dolibarr_main_db_user)." with password '".$this->escape($dolibarr_main_db_pass)."'";
@ -1053,6 +1070,7 @@ class DoliDBPgsql extends DoliDB
return 1; return 1;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return a pointer of line with description of a table or field * Return a pointer of line with description of a table or field
* *
@ -1060,9 +1078,9 @@ class DoliDBPgsql extends DoliDB
* @param string $field Optionnel : Name of field if we want description of field * @param string $field Optionnel : Name of field if we want description of field
* @return false|resource Resultset x (x->attname) * @return false|resource Resultset x (x->attname)
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLDescTable($table,$field="") function DDLDescTable($table,$field="")
{ {
// phpcs:enable
$sql ="SELECT attname FROM pg_attribute, pg_type WHERE typname = '".$table."' AND attrelid = typrelid"; $sql ="SELECT attname FROM pg_attribute, pg_type WHERE typname = '".$table."' AND attrelid = typrelid";
$sql.=" AND attname NOT IN ('cmin', 'cmax', 'ctid', 'oid', 'tableoid', 'xmin', 'xmax')"; $sql.=" AND attname NOT IN ('cmin', 'cmax', 'ctid', 'oid', 'tableoid', 'xmin', 'xmax')";
if ($field) $sql.= " AND attname = '".$field."'"; if ($field) $sql.= " AND attname = '".$field."'";
@ -1072,6 +1090,7 @@ class DoliDBPgsql extends DoliDB
return $this->_results; return $this->_results;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Create a new field into table * Create a new field into table
* *
@ -1081,37 +1100,38 @@ class DoliDBPgsql extends DoliDB
* @param string $field_position Optionnel ex.: "after champtruc" * @param string $field_position Optionnel ex.: "after champtruc"
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLAddField($table,$field_name,$field_desc,$field_position="") function DDLAddField($table,$field_name,$field_desc,$field_position="")
{ {
// phpcs:enable
// cles recherchees dans le tableau des descriptions (field_desc) : type,value,attribute,null,default,extra // cles recherchees dans le tableau des descriptions (field_desc) : type,value,attribute,null,default,extra
// ex. : $field_desc = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment'); // ex. : $field_desc = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment');
$sql= "ALTER TABLE ".$table." ADD ".$field_name." "; $sql= "ALTER TABLE ".$table." ADD ".$field_name." ";
$sql .= $field_desc['type']; $sql .= $field_desc['type'];
if(preg_match("/^[^\s]/i",$field_desc['value'])) if (preg_match("/^[^\s]/i",$field_desc['value']))
if (! in_array($field_desc['type'],array('int','date','datetime'))) if (! in_array($field_desc['type'],array('int','date','datetime')))
{ {
$sql.= "(".$field_desc['value'].")"; $sql.= "(".$field_desc['value'].")";
} }
if (preg_match("/^[^\s]/i",$field_desc['attribute'])) if (preg_match("/^[^\s]/i",$field_desc['attribute']))
$sql .= " ".$field_desc['attribute']; $sql .= " ".$field_desc['attribute'];
if (preg_match("/^[^\s]/i",$field_desc['null'])) if (preg_match("/^[^\s]/i",$field_desc['null']))
$sql .= " ".$field_desc['null']; $sql .= " ".$field_desc['null'];
if (preg_match("/^[^\s]/i",$field_desc['default'])) if (preg_match("/^[^\s]/i",$field_desc['default']))
if (preg_match("/null/i",$field_desc['default'])) if (preg_match("/null/i",$field_desc['default']))
$sql .= " default ".$field_desc['default']; $sql .= " default ".$field_desc['default'];
else else
$sql .= " default '".$field_desc['default']."'"; $sql .= " default '".$field_desc['default']."'";
if (preg_match("/^[^\s]/i",$field_desc['extra'])) if (preg_match("/^[^\s]/i",$field_desc['extra']))
$sql .= " ".$field_desc['extra']; $sql .= " ".$field_desc['extra'];
$sql .= " ".$field_position; $sql .= " ".$field_position;
dol_syslog($sql,LOG_DEBUG); dol_syslog($sql,LOG_DEBUG);
if(! $this -> query($sql)) if (! $this -> query($sql))
return -1; return -1;
return 1; return 1;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Update format of a field into a table * Update format of a field into a table
* *
@ -1120,9 +1140,9 @@ class DoliDBPgsql extends DoliDB
* @param string $field_desc Array with description of field format * @param string $field_desc Array with description of field format
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLUpdateField($table,$field_name,$field_desc) function DDLUpdateField($table,$field_name,$field_desc)
{ {
// phpcs:enable
$sql = "ALTER TABLE ".$table; $sql = "ALTER TABLE ".$table;
$sql .= " MODIFY COLUMN ".$field_name." ".$field_desc['type']; $sql .= " MODIFY COLUMN ".$field_name." ".$field_desc['type'];
if ($field_desc['type'] == 'double' || $field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int' || $field_desc['type'] == 'varchar') { if ($field_desc['type'] == 'double' || $field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int' || $field_desc['type'] == 'varchar') {
@ -1156,6 +1176,7 @@ class DoliDBPgsql extends DoliDB
return 1; return 1;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Drop a field from table * Drop a field from table
* *
@ -1163,9 +1184,9 @@ class DoliDBPgsql extends DoliDB
* @param string $field_name Name of field to drop * @param string $field_name Name of field to drop
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLDropField($table,$field_name) function DDLDropField($table,$field_name)
{ {
// phpcs:enable
$sql= "ALTER TABLE ".$table." DROP COLUMN ".$field_name; $sql= "ALTER TABLE ".$table." DROP COLUMN ".$field_name;
dol_syslog($sql,LOG_DEBUG); dol_syslog($sql,LOG_DEBUG);
if (! $this->query($sql)) if (! $this->query($sql))

View File

@ -296,17 +296,18 @@ class DoliDBSqlite3 extends DoliDB
return $line; return $line;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Select a database * Select a database
* *
* @param string $database Name of database * @param string $database Name of database
* @return boolean true if OK, false if KO * @return boolean true if OK, false if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_db($database) function select_db($database)
{ {
// phpcs:enable
dol_syslog(get_class($this)."::select_db database=".$database, LOG_DEBUG); dol_syslog(get_class($this)."::select_db database=".$database, LOG_DEBUG);
// sqlite_select_db() does not exist // sqlite_select_db() does not exist
//return sqlite_select_db($this->db,$database); //return sqlite_select_db($this->db,$database);
return true; return true;
} }
@ -491,15 +492,16 @@ class DoliDBSqlite3 extends DoliDB
return $ret; return $ret;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Renvoie la ligne courante (comme un objet) pour le curseur resultset * Renvoie la ligne courante (comme un objet) pour le curseur resultset
* *
* @param SQLite3Result $resultset Curseur de la requete voulue * @param SQLite3Result $resultset Curseur de la requete voulue
* @return false|object Object result line or false if KO or end of cursor * @return false|object Object result line or false if KO or end of cursor
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function fetch_object($resultset) function fetch_object($resultset)
{ {
// phpcs:enable
// Si le resultset n'est pas fourni, on prend le dernier utilise sur cette connexion // Si le resultset n'est pas fourni, on prend le dernier utilise sur cette connexion
if (! is_object($resultset)) { $resultset=$this->_results; } if (! is_object($resultset)) { $resultset=$this->_results; }
//return $resultset->fetch(PDO::FETCH_OBJ); //return $resultset->fetch(PDO::FETCH_OBJ);
@ -511,15 +513,16 @@ class DoliDBSqlite3 extends DoliDB
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return datas as an array * Return datas as an array
* *
* @param SQLite3Result $resultset Resultset of request * @param SQLite3Result $resultset Resultset of request
* @return false|array Array or false if KO or end of cursor * @return false|array Array or false if KO or end of cursor
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function fetch_array($resultset) function fetch_array($resultset)
{ {
// phpcs:enable
// If resultset not provided, we take the last used by connexion // If resultset not provided, we take the last used by connexion
if (! is_object($resultset)) { $resultset=$this->_results; } if (! is_object($resultset)) { $resultset=$this->_results; }
//return $resultset->fetch(PDO::FETCH_ASSOC); //return $resultset->fetch(PDO::FETCH_ASSOC);
@ -527,15 +530,16 @@ class DoliDBSqlite3 extends DoliDB
return $ret; return $ret;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return datas as an array * Return datas as an array
* *
* @param SQLite3Result $resultset Resultset of request * @param SQLite3Result $resultset Resultset of request
* @return false|array Array or false if KO or end of cursor * @return false|array Array or false if KO or end of cursor
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function fetch_row($resultset) function fetch_row($resultset)
{ {
// phpcs:enable
// If resultset not provided, we take the last used by connexion // If resultset not provided, we take the last used by connexion
if (! is_bool($resultset)) if (! is_bool($resultset))
{ {
@ -549,6 +553,7 @@ class DoliDBSqlite3 extends DoliDB
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return number of lines for result of a SELECT * Return number of lines for result of a SELECT
* *
@ -556,10 +561,10 @@ class DoliDBSqlite3 extends DoliDB
* @return int Nb of lines * @return int Nb of lines
* @see affected_rows * @see affected_rows
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function num_rows($resultset) function num_rows($resultset)
{ {
// FIXME: SQLite3Result does not have a queryString member // phpcs:enable
// FIXME: SQLite3Result does not have a queryString member
// If resultset not provided, we take the last used by connexion // If resultset not provided, we take the last used by connexion
if (! is_object($resultset)) { $resultset=$this->_results; } if (! is_object($resultset)) { $resultset=$this->_results; }
@ -569,6 +574,7 @@ class DoliDBSqlite3 extends DoliDB
return 0; return 0;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return number of lines for result of a SELECT * Return number of lines for result of a SELECT
* *
@ -576,10 +582,10 @@ class DoliDBSqlite3 extends DoliDB
* @return int Nb of lines * @return int Nb of lines
* @see affected_rows * @see affected_rows
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function affected_rows($resultset) function affected_rows($resultset)
{ {
// FIXME: SQLite3Result does not have a queryString member // phpcs:enable
// FIXME: SQLite3Result does not have a queryString member
// If resultset not provided, we take the last used by connexion // If resultset not provided, we take the last used by connexion
if (! is_object($resultset)) { $resultset=$this->_results; } if (! is_object($resultset)) { $resultset=$this->_results; }
@ -698,6 +704,7 @@ class DoliDBSqlite3 extends DoliDB
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Get last ID after an insert INSERT * Get last ID after an insert INSERT
* *
@ -705,9 +712,9 @@ class DoliDBSqlite3 extends DoliDB
* @param string $fieldid Field name * @param string $fieldid Field name
* @return int Id of row * @return int Id of row
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function last_insert_id($tab,$fieldid='rowid') function last_insert_id($tab,$fieldid='rowid')
{ {
// phpcs:enable
return $this->db->lastInsertRowId(); return $this->db->lastInsertRowId();
} }
@ -780,18 +787,20 @@ class DoliDBSqlite3 extends DoliDB
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return connexion ID * Return connexion ID
* *
* @return string Id connexion * @return string Id connexion
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLGetConnectId() function DDLGetConnectId()
{ {
// phpcs:enable
return '?'; return '?';
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Create a new database * Create a new database
* Do not use function xxx_create_db (xxx=mysql, ...) as they are deprecated * Do not use function xxx_create_db (xxx=mysql, ...) as they are deprecated
@ -803,9 +812,9 @@ class DoliDBSqlite3 extends DoliDB
* @param string $owner Username of database owner * @param string $owner Username of database owner
* @return SQLite3Result resource defined if OK, null if KO * @return SQLite3Result resource defined if OK, null if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLCreateDb($database,$charset='',$collation='',$owner='') function DDLCreateDb($database,$charset='',$collation='',$owner='')
{ {
// phpcs:enable
if (empty($charset)) $charset=$this->forcecharset; if (empty($charset)) $charset=$this->forcecharset;
if (empty($collation)) $collation=$this->forcecollate; if (empty($collation)) $collation=$this->forcecollate;
@ -825,6 +834,7 @@ class DoliDBSqlite3 extends DoliDB
return $ret; return $ret;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* List tables into a database * List tables into a database
* *
@ -832,9 +842,9 @@ class DoliDBSqlite3 extends DoliDB
* @param string $table Name of table filter ('xxx%') * @param string $table Name of table filter ('xxx%')
* @return array List of tables in an array * @return array List of tables in an array
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLListTables($database, $table='') function DDLListTables($database, $table='')
{ {
// phpcs:enable
$listtables=array(); $listtables=array();
$like = ''; $like = '';
@ -852,16 +862,17 @@ class DoliDBSqlite3 extends DoliDB
return $listtables; return $listtables;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* List information of columns into a table. * List information of columns into a table.
* *
* @param string $table Name of table * @param string $table Name of table
* @return array Tableau des informations des champs de la table * @return array Tableau des informations des champs de la table
* TODO modify for sqlite * TODO modify for sqlite
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLInfoTable($table) function DDLInfoTable($table)
{ {
// phpcs:enable
$infotables=array(); $infotables=array();
$sql="SHOW FULL COLUMNS FROM ".$table.";"; $sql="SHOW FULL COLUMNS FROM ".$table.";";
@ -878,6 +889,7 @@ class DoliDBSqlite3 extends DoliDB
return $infotables; return $infotables;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Create a table into database * Create a table into database
* *
@ -890,10 +902,10 @@ class DoliDBSqlite3 extends DoliDB
* @param array $keys Tableau des champs cles noms => valeur * @param array $keys Tableau des champs cles noms => valeur
* @return int <0 if KO, >=0 if OK * @return int <0 if KO, >=0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLCreateTable($table,$fields,$primary_key,$type,$unique_keys=null,$fulltext_keys=null,$keys=null) function DDLCreateTable($table,$fields,$primary_key,$type,$unique_keys=null,$fulltext_keys=null,$keys=null)
{ {
// FIXME: $fulltext_keys parameter is unused // phpcs:enable
// FIXME: $fulltext_keys parameter is unused
// cles recherchees dans le tableau des descriptions (fields) : type,value,attribute,null,default,extra // cles recherchees dans le tableau des descriptions (fields) : type,value,attribute,null,default,extra
// ex. : $fields['rowid'] = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment'); // ex. : $fields['rowid'] = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment');
@ -957,15 +969,16 @@ class DoliDBSqlite3 extends DoliDB
return 1; return 1;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Drop a table into database * Drop a table into database
* *
* @param string $table Name of table * @param string $table Name of table
* @return int <0 if KO, >=0 if OK * @return int <0 if KO, >=0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLDropTable($table) function DDLDropTable($table)
{ {
// phpcs:enable
$sql = "DROP TABLE ".$table; $sql = "DROP TABLE ".$table;
if (! $this->query($sql)) if (! $this->query($sql))
@ -974,6 +987,7 @@ class DoliDBSqlite3 extends DoliDB
return 1; return 1;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return a pointer of line with description of a table or field * Return a pointer of line with description of a table or field
* *
@ -981,9 +995,9 @@ class DoliDBSqlite3 extends DoliDB
* @param string $field Optionnel : Name of field if we want description of field * @param string $field Optionnel : Name of field if we want description of field
* @return SQLite3Result Resource * @return SQLite3Result Resource
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLDescTable($table,$field="") function DDLDescTable($table,$field="")
{ {
// phpcs:enable
$sql="DESC ".$table." ".$field; $sql="DESC ".$table." ".$field;
dol_syslog(get_class($this)."::DDLDescTable ".$sql,LOG_DEBUG); dol_syslog(get_class($this)."::DDLDescTable ".$sql,LOG_DEBUG);
@ -991,6 +1005,7 @@ class DoliDBSqlite3 extends DoliDB
return $this->_results; return $this->_results;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Create a new field into table * Create a new field into table
* *
@ -1000,9 +1015,9 @@ class DoliDBSqlite3 extends DoliDB
* @param string $field_position Optionnel ex.: "after champtruc" * @param string $field_position Optionnel ex.: "after champtruc"
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLAddField($table,$field_name,$field_desc,$field_position="") function DDLAddField($table,$field_name,$field_desc,$field_position="")
{ {
// phpcs:enable
// cles recherchees dans le tableau des descriptions (field_desc) : type,value,attribute,null,default,extra // cles recherchees dans le tableau des descriptions (field_desc) : type,value,attribute,null,default,extra
// ex. : $field_desc = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment'); // ex. : $field_desc = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment');
$sql= "ALTER TABLE ".$table." ADD ".$field_name." "; $sql= "ALTER TABLE ".$table." ADD ".$field_name." ";
@ -1035,6 +1050,7 @@ class DoliDBSqlite3 extends DoliDB
return 1; return 1;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Update format of a field into a table * Update format of a field into a table
* *
@ -1043,9 +1059,9 @@ class DoliDBSqlite3 extends DoliDB
* @param string $field_desc Array with description of field format * @param string $field_desc Array with description of field format
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLUpdateField($table,$field_name,$field_desc) function DDLUpdateField($table,$field_name,$field_desc)
{ {
// phpcs:enable
$sql = "ALTER TABLE ".$table; $sql = "ALTER TABLE ".$table;
$sql .= " MODIFY COLUMN ".$field_name." ".$field_desc['type']; $sql .= " MODIFY COLUMN ".$field_name." ".$field_desc['type'];
if ($field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int' || $field_desc['type'] == 'varchar') { if ($field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int' || $field_desc['type'] == 'varchar') {
@ -1058,6 +1074,7 @@ class DoliDBSqlite3 extends DoliDB
return 1; return 1;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Drop a field from table * Drop a field from table
* *
@ -1065,9 +1082,9 @@ class DoliDBSqlite3 extends DoliDB
* @param string $field_name Name of field to drop * @param string $field_name Name of field to drop
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLDropField($table,$field_name) function DDLDropField($table,$field_name)
{ {
// phpcs:enable
$sql= "ALTER TABLE ".$table." DROP COLUMN `".$field_name."`"; $sql= "ALTER TABLE ".$table." DROP COLUMN `".$field_name."`";
dol_syslog(get_class($this)."::DDLDropField ".$sql,LOG_DEBUG); dol_syslog(get_class($this)."::DDLDropField ".$sql,LOG_DEBUG);
if (! $this->query($sql)) if (! $this->query($sql))
@ -1079,8 +1096,9 @@ class DoliDBSqlite3 extends DoliDB
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Create a user and privileges to connect to database (even if database does not exists yet) * Create a user and privileges to connect to database (even if database does not exists yet)
* *
* @param string $dolibarr_main_db_host Ip serveur * @param string $dolibarr_main_db_host Ip serveur
* @param string $dolibarr_main_db_user Nom user a creer * @param string $dolibarr_main_db_user Nom user a creer
@ -1088,9 +1106,9 @@ class DoliDBSqlite3 extends DoliDB
* @param string $dolibarr_main_db_name Database name where user must be granted * @param string $dolibarr_main_db_name Database name where user must be granted
* @return int <0 if KO, >=0 if OK * @return int <0 if KO, >=0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLCreateUser($dolibarr_main_db_host,$dolibarr_main_db_user,$dolibarr_main_db_pass,$dolibarr_main_db_name) function DDLCreateUser($dolibarr_main_db_host,$dolibarr_main_db_user,$dolibarr_main_db_pass,$dolibarr_main_db_name)
{ {
// phpcs:enable
$sql = "INSERT INTO user "; $sql = "INSERT INTO user ";
$sql.= "(Host,User,password,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv,Index_Priv,Alter_priv,Lock_tables_priv)"; $sql.= "(Host,User,password,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv,Index_Priv,Alter_priv,Lock_tables_priv)";
$sql.= " VALUES ('".$this->escape($dolibarr_main_db_host)."','".$this->escape($dolibarr_main_db_user)."',password('".addslashes($dolibarr_main_db_pass)."')"; $sql.= " VALUES ('".$this->escape($dolibarr_main_db_host)."','".$this->escape($dolibarr_main_db_user)."',password('".addslashes($dolibarr_main_db_pass)."')";
@ -1312,6 +1330,7 @@ class DoliDBSqlite3 extends DoliDB
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* calc_daynr * calc_daynr
* *
@ -1320,9 +1339,9 @@ class DoliDBSqlite3 extends DoliDB
* @param int $day Day * @param int $day Day
* @return int Formatted date * @return int Formatted date
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
private static function calc_daynr($year, $month, $day) private static function calc_daynr($year, $month, $day)
{ {
// phpcs:enable
$y = $year; $y = $year;
if ($y == 0 && $month == 0) return 0; if ($y == 0 && $month == 0) return 0;
$num = (365* $y + 31 * ($month - 1) + $day); $num = (365* $y + 31 * ($month - 1) + $day);
@ -1335,6 +1354,7 @@ class DoliDBSqlite3 extends DoliDB
return $num + floor($y / 4) - $temp; return $num + floor($y / 4) - $temp;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* calc_weekday * calc_weekday
* *
@ -1342,25 +1362,27 @@ class DoliDBSqlite3 extends DoliDB
* @param bool $sunday_first_day_of_week ??? * @param bool $sunday_first_day_of_week ???
* @return int * @return int
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
private static function calc_weekday($daynr, $sunday_first_day_of_week) private static function calc_weekday($daynr, $sunday_first_day_of_week)
{ {
$ret = floor(($daynr + 5 + ($sunday_first_day_of_week ? 1 : 0)) % 7); // phpcs:enable
return $ret; $ret = floor(($daynr + 5 + ($sunday_first_day_of_week ? 1 : 0)) % 7);
return $ret;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* calc_days_in_year * calc_days_in_year
* *
* @param string $year Year * @param string $year Year
* @return int Nb of days in year * @return int Nb of days in year
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
private static function calc_days_in_year($year) private static function calc_days_in_year($year)
{ {
return (($year & 3) == 0 && ($year%100 || ($year%400 == 0 && $year)) ? 366 : 365); // phpcs:enable
return (($year & 3) == 0 && ($year%100 || ($year%400 == 0 && $year)) ? 366 : 365);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* calc_week * calc_week
* *
@ -1371,9 +1393,9 @@ class DoliDBSqlite3 extends DoliDB
* @param string $calc_year ??? * @param string $calc_year ???
* @return string ??? * @return string ???
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
private static function calc_week($year, $month, $day, $week_behaviour, &$calc_year) private static function calc_week($year, $month, $day, $week_behaviour, &$calc_year)
{ {
// phpcs:enable
$daynr=self::calc_daynr($year,$month,$day); $daynr=self::calc_daynr($year,$month,$day);
$first_daynr=self::calc_daynr($year,1,1); $first_daynr=self::calc_daynr($year,1,1);
$monday_first= ($week_behaviour & self::WEEK_MONDAY_FIRST) ? 1 : 0; $monday_first= ($week_behaviour & self::WEEK_MONDAY_FIRST) ? 1 : 0;

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2006-2012 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2006-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010-2017 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2010-2017 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com> * Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -322,6 +323,10 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
if (empty($foruserprofile)) $hoverdisabled=(isset($conf->global->THEME_ELDY_USE_HOVER) && $conf->global->THEME_ELDY_USE_HOVER == '0'); if (empty($foruserprofile)) $hoverdisabled=(isset($conf->global->THEME_ELDY_USE_HOVER) && $conf->global->THEME_ELDY_USE_HOVER == '0');
else $hoverdisabled=(is_object($fuser)?(empty($fuser->conf->THEME_ELDY_USE_HOVER) || $fuser->conf->THEME_ELDY_USE_HOVER == '0'):''); else $hoverdisabled=(is_object($fuser)?(empty($fuser->conf->THEME_ELDY_USE_HOVER) || $fuser->conf->THEME_ELDY_USE_HOVER == '0'):'');
$checkeddisabled='';
if (empty($foruserprofile)) $checkeddisabled=(isset($conf->global->THEME_ELDY_USE_CHECKED) && $conf->global->THEME_ELDY_USE_CHECKED == '0');
else $checkeddisabled=(is_object($fuser)?(empty($fuser->conf->THEME_ELDY_USE_CHECKED) || $fuser->conf->THEME_ELDY_USE_CHECKED == '0'):'');
$colspan=2; $colspan=2;
if ($foruserprofile) $colspan=4; if ($foruserprofile) $colspan=4;
@ -809,8 +814,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
print '</tr>'; print '</tr>';
*/ */
} }
else else {
{
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$langs->trans("HighlightLinesColor").'</td>'; print '<td>'.$langs->trans("HighlightLinesColor").'</td>';
print '<td colspan="'.($colspan-1).'">'; print '<td colspan="'.($colspan-1).'">';
@ -837,6 +841,50 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis")); print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis"));
print '</span>'; print '</span>';
print '</td>'; print '</td>';
}
// Use Checked
if ($foruserprofile)
{
/* Must first change option to choose color of highlight instead of yes or no.
print '<tr class="oddeven">';
print '<td>'.$langs->trans("HighlightLinesOnMouseHover").'</td>';
print '<td><input '.$bc[$var].' name="check_THEME_ELDY_USE_HOVER" disabled="disabled" type="checkbox" '.($conf->global->THEME_ELDY_USE_HOVER?" checked":"").'></td>';
print '<td align="left" class="nowrap" width="20%"><input '.$bc[$var].' name="check_MAIN_THEME"'.($edit?'':' disabled').' type="checkbox" '.($selected_theme?" checked":"").'> '.$langs->trans("UsePersonalValue").'</td>';
print '<td><input '.$bc[$var].' name="check_THEME_ELDY_USE_HOVER"'.($edit?'':' disabled="disabled"').' type="checkbox" '.($hoverdisabled?"":" checked").'>';
print ' &nbsp; ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
print '</td>';
print '</tr>';
*/
}
else
{
print '<tr class="oddeven">';
print '<td>'.$langs->trans("HighlightLinesChecked").'</td>';
print '<td colspan="'.($colspan-1).'">';
//print '<input '.$bc[$var].' name="check_THEME_ELDY_USE_HOVER"'.($edit?'':' disabled').' type="checkbox" '.($hoverdisabled?"":" checked").'>';
//print ' &nbsp; ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
if ($edit)
{
if ($conf->global->THEME_ELDY_USE_CHECKED == '1') $color='ffefbb';
else $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_USE_CHECKED,array()),'');
print $formother->selectColor($color,'THEME_ELDY_USE_CHECKED','formcolor',1).' ';
}
else
{
if ($conf->global->THEME_ELDY_USE_CHECKED == '1') $color='ffefbb';
else $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_USE_CHECKED,array()),'');
if ($color)
{
if ($color != 'ffefbb') print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">';
else print $langs->trans("Default");
}
else print $langs->trans("None");
}
print ' &nbsp; <span class="nowraponall">('.$langs->trans("Default").': <strong>ffefbb</strong>) ';
print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis"));
print '</span>';
print '</td>';
print '</tr>'; print '</tr>';
} }

View File

@ -999,6 +999,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Create tables and keys required by module. * Create tables and keys required by module.
* Files module.sql and module.key.sql with create table and create keys * Files module.sql and module.key.sql with create table and create keys
@ -1008,9 +1009,9 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
* @param string $reldir Relative directory where to scan files * @param string $reldir Relative directory where to scan files
* @return int <=0 if KO, >0 if OK * @return int <=0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function _load_tables($reldir) function _load_tables($reldir)
{ {
// phpcs:enable
global $conf; global $conf;
$error=0; $error=0;
@ -1118,6 +1119,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Adds boxes * Adds boxes
* *
@ -1125,9 +1127,9 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
* *
* @return int Error count (0 if OK) * @return int Error count (0 if OK)
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function insert_boxes($option='') function insert_boxes($option='')
{ {
// phpcs:enable
require_once DOL_DOCUMENT_ROOT . '/core/class/infobox.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/infobox.class.php';
global $conf; global $conf;
@ -1218,14 +1220,15 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Removes boxes * Removes boxes
* *
* @return int Error count (0 if OK) * @return int Error count (0 if OK)
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function delete_boxes() function delete_boxes()
{ {
// phpcs:enable
global $conf; global $conf;
$err=0; $err=0;
@ -1294,14 +1297,15 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
return $err; return $err;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Adds cronjobs * Adds cronjobs
* *
* @return int Error count (0 if OK) * @return int Error count (0 if OK)
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function insert_cronjobs() function insert_cronjobs()
{ {
// phpcs:enable
require_once DOL_DOCUMENT_ROOT . '/core/class/infobox.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/infobox.class.php';
global $conf; global $conf;
@ -1408,14 +1412,15 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Removes boxes * Removes boxes
* *
* @return int Error count (0 if OK) * @return int Error count (0 if OK)
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function delete_cronjobs() function delete_cronjobs()
{ {
// phpcs:enable
global $conf; global $conf;
$err=0; $err=0;
@ -1438,14 +1443,15 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
return $err; return $err;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Removes tabs * Removes tabs
* *
* @return int Error count (0 if OK) * @return int Error count (0 if OK)
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function delete_tabs() function delete_tabs()
{ {
// phpcs:enable
global $conf; global $conf;
$err=0; $err=0;
@ -1464,14 +1470,15 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
return $err; return $err;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Adds tabs * Adds tabs
* *
* @return int Error count (0 if ok) * @return int Error count (0 if ok)
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function insert_tabs() function insert_tabs()
{ {
// phpcs:enable
global $conf; global $conf;
$err=0; $err=0;
@ -1532,14 +1539,15 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
return $err; return $err;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Adds constants * Adds constants
* *
* @return int Error count (0 if OK) * @return int Error count (0 if OK)
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function insert_const() function insert_const()
{ {
// phpcs:enable
global $conf; global $conf;
$err=0; $err=0;
@ -1602,14 +1610,15 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
return $err; return $err;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Removes constants tagged 'deleteonunactive' * Removes constants tagged 'deleteonunactive'
* *
* @return int <0 if KO, 0 if OK * @return int <0 if KO, 0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function delete_const() function delete_const()
{ {
// phpcs:enable
global $conf; global $conf;
$err=0; $err=0;
@ -1638,6 +1647,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
return $err; return $err;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Adds access rights * Adds access rights
* *
@ -1646,9 +1656,9 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int Error count (0 if OK) * @return int Error count (0 if OK)
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function insert_permissions($reinitadminperms=0, $force_entity=null, $notrigger=0) function insert_permissions($reinitadminperms=0, $force_entity=null, $notrigger=0)
{ {
// phpcs:enable
global $conf,$user; global $conf,$user;
$err=0; $err=0;
@ -1794,14 +1804,15 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Removes access rights * Removes access rights
* *
* @return int Error count (0 if OK) * @return int Error count (0 if OK)
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function delete_permissions() function delete_permissions()
{ {
// phpcs:enable
global $conf; global $conf;
$err=0; $err=0;
@ -1820,14 +1831,15 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Adds menu entries * Adds menu entries
* *
* @return int Error count (0 if OK) * @return int Error count (0 if OK)
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function insert_menus() function insert_menus()
{ {
// phpcs:enable
global $user; global $user;
if (! is_array($this->menu) || empty($this->menu)) return 0; if (! is_array($this->menu) || empty($this->menu)) return 0;
@ -1930,14 +1942,15 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Removes menu entries * Removes menu entries
* *
* @return int Error count (0 if OK) * @return int Error count (0 if OK)
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function delete_menus() function delete_menus()
{ {
// phpcs:enable
global $conf; global $conf;
$err=0; $err=0;
@ -1960,14 +1973,15 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
return $err; return $err;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Creates directories * Creates directories
* *
* @return int Error count (0 if OK) * @return int Error count (0 if OK)
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function create_dirs() function create_dirs()
{ {
// phpcs:enable
global $langs, $conf; global $langs, $conf;
$err=0; $err=0;
@ -2019,6 +2033,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Adds directories definitions * Adds directories definitions
* *
@ -2027,9 +2042,9 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
* *
* @return int Error count (0 if OK) * @return int Error count (0 if OK)
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function insert_dirs($name,$dir) function insert_dirs($name,$dir)
{ {
// phpcs:enable
global $conf; global $conf;
$err=0; $err=0;
@ -2064,14 +2079,15 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Removes directories * Removes directories
* *
* @return int Error count (0 if OK) * @return int Error count (0 if OK)
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function delete_dirs() function delete_dirs()
{ {
// phpcs:enable
global $conf; global $conf;
$err=0; $err=0;
@ -2090,14 +2106,15 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
return $err; return $err;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Adds generic parts * Adds generic parts
* *
* @return int Error count (0 if OK) * @return int Error count (0 if OK)
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function insert_module_parts() function insert_module_parts()
{ {
// phpcs:enable
global $conf; global $conf;
$error=0; $error=0;
@ -2169,14 +2186,15 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
return $error; return $error;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Removes generic parts * Removes generic parts
* *
* @return int Error count (0 if OK) * @return int Error count (0 if OK)
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function delete_module_parts() function delete_module_parts()
{ {
// phpcs:enable
global $conf; global $conf;
$err=0; $err=0;

View File

@ -33,16 +33,17 @@ abstract class ModeleAction extends CommonDocGenerator
*/ */
public $error=''; public $error='';
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of active generation modules * Return list of active generation modules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param integer $maxfilenamelength Max length of value to show * @param integer $maxfilenamelength Max length of value to show
* @return array List of templates * @return array List of templates
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
static function liste_modeles($db,$maxfilenamelength=0) static function liste_modeles($db,$maxfilenamelength=0)
{ {
// phpcs:enable
global $conf; global $conf;
$type='action'; $type='action';
@ -54,6 +55,8 @@ abstract class ModeleAction extends CommonDocGenerator
return $liste; return $liste;
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Create an product document on disk using template defined into PRODUCT_ADDON_PDF * Create an product document on disk using template defined into PRODUCT_ADDON_PDF
* *
@ -66,9 +69,9 @@ abstract class ModeleAction extends CommonDocGenerator
* @param int $hideref Hide ref * @param int $hideref Hide ref
* @return int 0 if KO, 1 if OK * @return int 0 if KO, 1 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function action_create($db, $object, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0) function action_create($db, $object, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
{ {
// phpcs:enable
global $conf,$langs,$user; global $conf,$langs,$user;
$langs->load("action"); $langs->load("action");

View File

@ -93,6 +93,7 @@ class CommActionRapport
$this->subject=$langs->transnoentitiesnoconv("ActionsReport").' '.$this->year."-".$this->month; $this->subject=$langs->transnoentitiesnoconv("ActionsReport").' '.$this->year."-".$this->month;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Write the object to document file to disk * Write the object to document file to disk
* *
@ -101,9 +102,9 @@ class CommActionRapport
* @param Translate $outputlangs Lang object for output language * @param Translate $outputlangs Lang object for output language
* @return int 1=OK, 0=KO * @return int 1=OK, 0=KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function write_file($socid = 0, $catid = 0, $outputlangs='') function write_file($socid = 0, $catid = 0, $outputlangs='')
{ {
// phpcs:enable
global $user,$conf,$langs,$hookmanager; global $user,$conf,$langs,$hookmanager;
if (! is_object($outputlangs)) $outputlangs=$langs; if (! is_object($outputlangs)) $outputlangs=$langs;

View File

@ -83,6 +83,7 @@ class pdf_ban extends ModeleBankAccountDoc
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Fonction generant le projet sur le disque * Fonction generant le projet sur le disque
* *
@ -90,9 +91,9 @@ class pdf_ban extends ModeleBankAccountDoc
* @param Translate $outputlangs Lang output object * @param Translate $outputlangs Lang output object
* @return int 1 if OK, <=0 if KO * @return int 1 if OK, <=0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function write_file($object,$outputlangs) function write_file($object,$outputlangs)
{ {
// phpcs:enable
global $conf, $hookmanager, $langs, $user; global $conf, $hookmanager, $langs, $user;
if (! is_object($outputlangs)) $outputlangs=$langs; if (! is_object($outputlangs)) $outputlangs=$langs;

View File

@ -83,8 +83,9 @@ class pdf_sepamandate extends ModeleBankAccountDoc
} }
/** // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
* Fonction generant le projet sur le disque /**
* Fonction generant le projet sur le disque
* *
* @param Project $object Object project a generer * @param Project $object Object project a generer
* @param Translate $outputlangs Lang output object * @param Translate $outputlangs Lang output object
@ -95,9 +96,9 @@ class pdf_sepamandate extends ModeleBankAccountDoc
* @param null|array $moreparams More parameters * @param null|array $moreparams More parameters
* @return int 1 if OK, <=0 if KO * @return int 1 if OK, <=0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function write_file($object, $outputlangs, $srctemplatepath='', $hidedetails=0, $hidedesc=0, $hideref=0, $moreparams=null) function write_file($object, $outputlangs, $srctemplatepath='', $hidedetails=0, $hidedesc=0, $hideref=0, $moreparams=null)
{ {
// phpcs:enable
global $conf, $hookmanager, $langs, $user, $mysoc; global $conf, $hookmanager, $langs, $user, $mysoc;
if (! is_object($outputlangs)) $outputlangs=$langs; if (! is_object($outputlangs)) $outputlangs=$langs;
@ -427,6 +428,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Show miscellaneous information (payment mode, payment term, ...) * Show miscellaneous information (payment mode, payment term, ...)
* *
@ -436,10 +438,10 @@ class pdf_sepamandate extends ModeleBankAccountDoc
* @param Translate $outputlangs Langs object * @param Translate $outputlangs Langs object
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function _tableau_info(&$pdf, $object, $posy, $outputlangs) function _tableau_info(&$pdf, $object, $posy, $outputlangs)
{ {
global $conf, $mysoc; // phpcs:enable
global $conf, $mysoc;
$default_font_size = pdf_getPDFFontSize($outputlangs); $default_font_size = pdf_getPDFFontSize($outputlangs);
@ -463,6 +465,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Show area for the customer to sign * Show area for the customer to sign
* *
@ -472,9 +475,9 @@ class pdf_sepamandate extends ModeleBankAccountDoc
* @param Translate $outputlangs Objet langs * @param Translate $outputlangs Objet langs
* @return int Position pour suite * @return int Position pour suite
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function _signature_area(&$pdf, $object, $posy, $outputlangs) function _signature_area(&$pdf, $object, $posy, $outputlangs)
{ {
// phpcs:enable
$default_font_size = pdf_getPDFFontSize($outputlangs); $default_font_size = pdf_getPDFFontSize($outputlangs);
$tab_top = $posy + 4; $tab_top = $posy + 4;
$tab_hl = 4; $tab_hl = 4;

View File

@ -37,6 +37,7 @@ abstract class ModeleBankAccountDoc extends CommonDocGenerator
public $error=''; public $error='';
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of active generation modules * Return list of active generation modules
* *
@ -44,9 +45,9 @@ abstract class ModeleBankAccountDoc extends CommonDocGenerator
* @param integer $maxfilenamelength Max length of value to show * @param integer $maxfilenamelength Max length of value to show
* @return array List of templates * @return array List of templates
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
static function liste_modeles($db, $maxfilenamelength=0) static function liste_modeles($db, $maxfilenamelength=0)
{ {
// phpcs:enable
global $conf; global $conf;
$type = 'bankaccount'; $type = 'bankaccount';

View File

@ -223,6 +223,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return if a code is used (by other element) * Return if a code is used (by other element)
* *
@ -231,9 +232,9 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
* @param Product $product Objet product * @param Product $product Objet product
* @return int 0 if available, <0 if KO * @return int 0 if available, <0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function verif_dispo($db, $code, $product) function verif_dispo($db, $code, $product)
{ {
// phpcs:enable
$sql = "SELECT barcode FROM ".MAIN_DB_PREFIX."product"; $sql = "SELECT barcode FROM ".MAIN_DB_PREFIX."product";
$sql.= " WHERE barcode = '".$code."'"; $sql.= " WHERE barcode = '".$code."'";
if ($product->id > 0) $sql.= " AND rowid <> ".$product->id; if ($product->id > 0) $sql.= " AND rowid <> ".$product->id;
@ -256,6 +257,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return if a barcode value match syntax * Return if a barcode value match syntax
* *
@ -263,9 +265,9 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
* @param string $typefortest Type of barcode (ISBN, EAN, ...) * @param string $typefortest Type of barcode (ISBN, EAN, ...)
* @return int 0 if OK, <0 if KO * @return int 0 if OK, <0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function verif_syntax($codefortest, $typefortest) function verif_syntax($codefortest, $typefortest)
{ {
// phpcs:enable
global $conf; global $conf;
$result = 0; $result = 0;

View File

@ -74,6 +74,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
$this->tab_height = 200; //$this->line_height * $this->line_per_page; $this->tab_height = 200; //$this->line_height * $this->line_per_page;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Fonction to generate document on disk * Fonction to generate document on disk
* *
@ -83,9 +84,9 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
* @param Translate $outputlangs Lang output object * @param Translate $outputlangs Lang output object
* @return int 1=ok, 0=ko * @return int 1=ok, 0=ko
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function write_file($object, $_dir, $number, $outputlangs) function write_file($object, $_dir, $number, $outputlangs)
{ {
// phpcs:enable
global $user,$conf,$langs,$hookmanager; global $user,$conf,$langs,$hookmanager;
if (! is_object($outputlangs)) $outputlangs=$langs; if (! is_object($outputlangs)) $outputlangs=$langs;
@ -198,6 +199,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Generate Header * Generate Header
* *
@ -207,9 +209,9 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
* @param Translate $outputlangs Object language for output * @param Translate $outputlangs Object language for output
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function Header(&$pdf, $page, $pages, $outputlangs) function Header(&$pdf, $page, $pages, $outputlangs)
{ {
// phpcs:enable
global $langs; global $langs;
$default_font_size = pdf_getPDFFontSize($outputlangs); $default_font_size = pdf_getPDFFontSize($outputlangs);
@ -305,6 +307,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Output array * Output array
* *
@ -314,9 +317,9 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
* @param Translate $outputlangs Object lang * @param Translate $outputlangs Object lang
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function Body(&$pdf, $pagenb, $pages, $outputlangs) function Body(&$pdf, $pagenb, $pages, $outputlangs)
{ {
// phpcs:enable
// x=10 - Num // x=10 - Num
// x=30 - Banque // x=30 - Banque
// x=100 - Emetteur // x=100 - Emetteur

View File

@ -138,6 +138,7 @@ class mod_chequereceipt_mint extends ModeleNumRefChequeReceipts
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return next free value * Return next free value
* *
@ -145,9 +146,9 @@ class mod_chequereceipt_mint extends ModeleNumRefChequeReceipts
* @param string $objforref Object for number to search * @param string $objforref Object for number to search
* @return string Next free value * @return string Next free value
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function chequereceipt_get_num($objsoc,$objforref) function chequereceipt_get_num($objsoc,$objforref)
{ {
// phpcs:enable
return $this->getNextValue($objsoc,$objforref); return $this->getNextValue($objsoc,$objforref);
} }
} }

View File

@ -124,6 +124,7 @@ class mod_chequereceipt_thyme extends ModeleNumRefChequeReceipts
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return next free value * Return next free value
* *
@ -131,9 +132,9 @@ class mod_chequereceipt_thyme extends ModeleNumRefChequeReceipts
* @param string $objforref Object for number to search * @param string $objforref Object for number to search
* @return string Next free value * @return string Next free value
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function chequereceipt_get_num($objsoc,$objforref) function chequereceipt_get_num($objsoc,$objforref)
{ {
// phpcs:enable
return $this->getNextValue($objsoc,$objforref); return $this->getNextValue($objsoc,$objforref);
} }
} }

Some files were not shown because too many files have changed in this diff Show More