move phpcs:ignore

This commit is contained in:
Frédéric FRANCE 2018-09-02 10:43:34 +02:00
parent 47879d44bc
commit b60f7db60a
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
9 changed files with 183 additions and 116 deletions

View File

@ -46,15 +46,16 @@ class ICal
{ {
} }
// 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,15 +262,16 @@ 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);
@ -282,16 +287,17 @@ class ICal
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

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

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

@ -512,14 +512,15 @@ class EcmDirectory // extends CommonObject
return $ret; return $ret;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* 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.NotCamelCaps
function load_motherof() function load_motherof()
{ {
// phpcs:enable
global $conf; global $conf;
$this->motherof=array(); $this->motherof=array();
@ -560,6 +561,7 @@ class EcmDirectory // 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
* *
@ -567,14 +569,15 @@ class EcmDirectory // extends CommonObject
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 5=Long label + Picto * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 5=Long label + Picto
* @return string Label of status * @return string Label of status
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
static function LibStatut($status,$mode=0) static function LibStatut($status,$mode=0)
{ {
// phpcs:enable
global $langs; global $langs;
return ''; return '';
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Reconstruit l'arborescence des categories sous la forme d'un tableau à partir de la base de donnée * Reconstruit l'arborescence des categories sous la forme d'un tableau à partir de la base de donnée
* Renvoi un tableau de tableau('id','id_mere',...) trie selon arbre et avec: * Renvoi un tableau de tableau('id','id_mere',...) trie selon arbre et avec:
@ -594,9 +597,9 @@ class EcmDirectory // extends CommonObject
* @param int $force Force reload of full arbo even if already loaded in cache $this->cats * @param int $force Force reload of full arbo even if already loaded in cache $this->cats
* @return array Tableau de array * @return array Tableau de array
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_full_arbo($force=0) function get_full_arbo($force=0)
{ {
// phpcs:enable
global $conf; global $conf;
if (empty($force) && ! empty($this->full_arbo_loaded)) if (empty($force) && ! empty($this->full_arbo_loaded))
@ -676,6 +679,7 @@ class EcmDirectory // extends CommonObject
return $this->cats; return $this->cats;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Define properties fullpath, fullrelativename, fulllabel of a directory of array this->cats and all its childs. * Define properties fullpath, fullrelativename, fulllabel of a directory of array this->cats and all its childs.
* Separator between directories is always '/', whatever is OS. * Separator between directories is always '/', whatever is OS.
@ -684,9 +688,9 @@ class EcmDirectory // 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=0) function build_path_from_id_categ($id_categ,$protection=0)
{ {
// phpcs:enable
// Define fullpath // Define fullpath
if (! empty($this->cats[$id_categ]['id_mere'])) if (! empty($this->cats[$id_categ]['id_mere']))
{ {
@ -761,6 +765,7 @@ class EcmDirectory // extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Call trigger based on this instance * Call trigger based on this instance
* *
@ -772,9 +777,9 @@ class EcmDirectory // extends 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';

View File

@ -779,6 +779,7 @@ class EcmFiles 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
* *
@ -786,9 +787,9 @@ class EcmFiles extends CommonObject
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 5=Long label + Picto * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 5=Long label + Picto
* @return string Label of status * @return string Label of status
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
static function LibStatut($status,$mode=0) static function LibStatut($status,$mode=0)
{ {
// phpcs:enable
global $langs; global $langs;
return ''; return '';
} }

View File

@ -452,6 +452,7 @@ class CompanyPaymentMode 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
* *
@ -459,43 +460,37 @@ class CompanyPaymentMode 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

@ -571,15 +571,16 @@ class Societe extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Create a contact/address from thirdparty * Create a contact/address from thirdparty
* *
* @param User $user Object user * @param User $user Object user
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function create_individual(User $user) function create_individual(User $user)
{ {
// phpcs:enable
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
$contact=new Contact($this->db); $contact=new Contact($this->db);
@ -1475,14 +1476,15 @@ class Societe extends CommonObject
return 0; return 0;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Define third party as a customer * Define third party as a customer
* *
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function set_as_client() function set_as_client()
{ {
// phpcs:enable
if ($this->id) if ($this->id)
{ {
$newclient=1; $newclient=1;
@ -1502,6 +1504,7 @@ class Societe extends CommonObject
return 0; return 0;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Definit la societe comme un client * Definit la societe comme un client
* *
@ -1510,9 +1513,9 @@ class Societe extends CommonObject
* @param User $user Utilisateur qui definie la remise * @param User $user Utilisateur qui definie la remise
* @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_client($remise, $note, User $user) function set_remise_client($remise, $note, User $user)
{ {
// phpcs:enable
global $conf, $langs; global $conf, $langs;
// Nettoyage parametres // Nettoyage parametres
@ -1564,6 +1567,7 @@ class Societe extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Definit la societe comme un client * Definit la societe comme un client
* *
@ -1572,9 +1576,9 @@ class Societe extends CommonObject
* @param User $user Utilisateur qui definie la remise * @param User $user Utilisateur qui definie la remise
* @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_supplier($remise, $note, User $user) function set_remise_supplier($remise, $note, User $user)
{ {
// phpcs:enable
global $conf, $langs; global $conf, $langs;
// Nettoyage parametres // Nettoyage parametres
@ -1626,6 +1630,7 @@ class Societe extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Add a discount for third party * Add a discount for third party
* *
@ -1636,9 +1641,9 @@ class Societe extends CommonObject
* @param int $discount_type 0 => customer discount, 1 => supplier discount * @param int $discount_type 0 => customer discount, 1 => supplier discount
* @return int <0 if KO, id of discount record if OK * @return int <0 if KO, id of discount record if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function set_remise_except($remise, User $user, $desc, $tva_tx=0, $discount_type=0) function set_remise_except($remise, User $user, $desc, $tva_tx=0, $discount_type=0)
{ {
// phpcs:enable
global $langs; global $langs;
// Clean parameters // Clean parameters
@ -1771,6 +1776,7 @@ class Societe extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set the price level * Set the price level
* *
@ -1778,9 +1784,9 @@ class Societe extends CommonObject
* @param User $user Use making change * @param User $user Use 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_price_level($price_level, User $user) function set_price_level($price_level, User $user)
{ {
// phpcs:enable
if ($this->id) if ($this->id)
{ {
$now=dol_now(); $now=dol_now();
@ -1809,6 +1815,7 @@ class Societe extends CommonObject
return -1; return -1;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Add link to sales representative * Add link to sales representative
* *
@ -1816,14 +1823,12 @@ class Societe extends CommonObject
* @param int $commid Id of user * @param int $commid Id of user
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function add_commercial(User $user, $commid) function add_commercial(User $user, $commid)
{ {
// phpcs:enable
$error=0; $error=0;
if ($this->id > 0 && $commid > 0) if ($this->id > 0 && $commid > 0)
{ {
$sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_commerciaux"; $sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_commerciaux";
@ -1848,6 +1853,7 @@ class Societe extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Add link to sales representative * Add link to sales representative
* *
@ -1855,9 +1861,9 @@ class Societe extends CommonObject
* @param int $commid Id of user * @param int $commid Id of user
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function del_commercial(User $user, $commid) function del_commercial(User $user, $commid)
{ {
// phpcs:enable
$error=0; $error=0;
$this->context=array('commercial_modified'=>$commid); $this->context=array('commercial_modified'=>$commid);
@ -2069,6 +2075,7 @@ class Societe 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
* *
@ -2076,9 +2083,9 @@ class Societe 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($statut,$mode=0) function LibStatut($statut,$mode=0)
{ {
// phpcs:enable
global $langs; global $langs;
$langs->load('companies'); $langs->load('companies');
@ -2119,15 +2126,16 @@ class Societe extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of contacts emails existing for third party * Return list of contacts emails existing for third party
* *
* @param int $addthirdparty 1=Add also a record for thirdparty email * @param int $addthirdparty 1=Add also a record for thirdparty email
* @return array Array of contacts emails * @return array Array of contacts emails
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function thirdparty_and_contact_email_array($addthirdparty=0) function thirdparty_and_contact_email_array($addthirdparty=0)
{ {
// phpcs:enable
global $langs; global $langs;
$contact_emails = $this->contact_property_array('email',1); $contact_emails = $this->contact_property_array('email',1);
@ -2140,14 +2148,15 @@ class Societe extends CommonObject
return $contact_emails; return $contact_emails;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of contacts mobile phone existing for third party * Return list of contacts mobile phone existing for third party
* *
* @return array Array of contacts emails * @return array Array of contacts emails
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function thirdparty_and_contact_phone_array() function thirdparty_and_contact_phone_array()
{ {
// phpcs:enable
global $langs; global $langs;
$contact_phone = $this->contact_property_array('mobile'); $contact_phone = $this->contact_property_array('mobile');
@ -2161,6 +2170,7 @@ class Societe extends CommonObject
return $contact_phone; return $contact_phone;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of contacts emails or mobile existing for third party * Return list of contacts emails or mobile existing for third party
* *
@ -2168,9 +2178,9 @@ class Societe extends CommonObject
* @param int $hidedisabled 1=Hide contact if disabled * @param int $hidedisabled 1=Hide contact if disabled
* @return array Array of contacts emails or mobile. Example: array(id=>'Name <email>') * @return array Array of contacts emails or mobile. Example: array(id=>'Name <email>')
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function contact_property_array($mode='email', $hidedisabled=0) function contact_property_array($mode='email', $hidedisabled=0)
{ {
// phpcs:enable
global $langs; global $langs;
$contact_property = array(); $contact_property = array();
@ -2230,14 +2240,15 @@ class Societe extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Renvoie la liste des contacts de cette societe * Renvoie la liste des contacts de cette societe
* *
* @return array tableau des contacts * @return array tableau des contacts
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function contact_array() function contact_array()
{ {
// phpcs:enable
$contacts = array(); $contacts = array();
$sql = "SELECT rowid, lastname, firstname FROM ".MAIN_DB_PREFIX."socpeople WHERE fk_soc = ".$this->id; $sql = "SELECT rowid, lastname, firstname FROM ".MAIN_DB_PREFIX."socpeople WHERE fk_soc = ".$this->id;
@ -2263,14 +2274,15 @@ class Societe extends CommonObject
return $contacts; return $contacts;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Renvoie la liste des contacts de cette societe * Renvoie la liste des contacts de cette societe
* *
* @return array $contacts tableau des contacts * @return array $contacts tableau des contacts
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function contact_array_objects() function contact_array_objects()
{ {
// phpcs:enable
require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
$contacts = array(); $contacts = array();
@ -2299,6 +2311,7 @@ class Societe extends CommonObject
return $contacts; return $contacts;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return property of contact from its id * Return property of contact from its id
* *
@ -2306,9 +2319,9 @@ class Societe extends CommonObject
* @param string $mode 'email' or 'mobile' * @param string $mode 'email' or 'mobile'
* @return string Email of contact with format: "Full name <email>" * @return string Email of contact with format: "Full name <email>"
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function contact_get_property($rowid,$mode) function contact_get_property($rowid,$mode)
{ {
// phpcs:enable
$contact_property=''; $contact_property='';
if (empty($rowid)) return ''; if (empty($rowid)) return '';
@ -2338,15 +2351,16 @@ class Societe extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return bank number property of thirdparty (label or rum) * Return bank number property of thirdparty (label or rum)
* *
* @param string $mode 'label' or 'rum' or 'format' * @param string $mode 'label' or 'rum' or 'format'
* @return string Bank number * @return string Bank number
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function display_rib($mode='label') function display_rib($mode='label')
{ {
// phpcs:enable
require_once DOL_DOCUMENT_ROOT . '/societe/class/companybankaccount.class.php'; require_once DOL_DOCUMENT_ROOT . '/societe/class/companybankaccount.class.php';
$bac = new CompanyBankAccount($this->db); $bac = new CompanyBankAccount($this->db);
@ -2375,14 +2389,15 @@ class Societe extends CommonObject
return 'BadParameterToFunctionDisplayRib'; return 'BadParameterToFunctionDisplayRib';
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return Array of RIB * Return Array of RIB
* *
* @return array|int 0 if KO, Array of CompanyBanckAccount if OK * @return array|int 0 if KO, Array of CompanyBanckAccount if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_all_rib() function get_all_rib()
{ {
// phpcs:enable
require_once DOL_DOCUMENT_ROOT . '/societe/class/companybankaccount.class.php'; require_once DOL_DOCUMENT_ROOT . '/societe/class/companybankaccount.class.php';
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe_rib WHERE type='ban' AND fk_soc = ".$this->id; $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe_rib WHERE type='ban' AND fk_soc = ".$this->id;
$result = $this->db->query($sql); $result = $this->db->query($sql);
@ -2404,6 +2419,7 @@ class Societe extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Attribut un code client a partir du module de controle des codes. * Attribut un code client a partir du module de controle des codes.
* Return value is stored into this->code_client * Return value is stored into this->code_client
@ -2412,9 +2428,9 @@ class Societe extends CommonObject
* @param int $type Should be 0 to say customer * @param int $type Should be 0 to say customer
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_codeclient($objsoc=0,$type=0) function get_codeclient($objsoc=0,$type=0)
{ {
// phpcs:enable
global $conf; global $conf;
if (! empty($conf->global->SOCIETE_CODECLIENT_ADDON)) if (! empty($conf->global->SOCIETE_CODECLIENT_ADDON))
{ {
@ -2435,6 +2451,7 @@ class Societe extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Attribut un code fournisseur a partir du module de controle des codes. * Attribut un code fournisseur a partir du module de controle des codes.
* Return value is stored into this->code_fournisseur * Return value is stored into this->code_fournisseur
@ -2443,9 +2460,9 @@ class Societe extends CommonObject
* @param int $type Should be 1 to say supplier * @param int $type Should be 1 to say supplier
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_codefournisseur($objsoc=0,$type=1) function get_codefournisseur($objsoc=0,$type=1)
{ {
// phpcs:enable
global $conf; global $conf;
if (! empty($conf->global->SOCIETE_CODECLIENT_ADDON)) if (! empty($conf->global->SOCIETE_CODECLIENT_ADDON))
{ {
@ -2465,15 +2482,16 @@ class Societe extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Verifie si un code client est modifiable en fonction des parametres * Verifie si un code client est modifiable en fonction des parametres
* du module de controle des codes. * du module de controle des codes.
* *
* @return int 0=No, 1=Yes * @return int 0=No, 1=Yes
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function codeclient_modifiable() function codeclient_modifiable()
{ {
// phpcs:enable
global $conf; global $conf;
if (! empty($conf->global->SOCIETE_CODECLIENT_ADDON)) if (! empty($conf->global->SOCIETE_CODECLIENT_ADDON))
{ {
@ -2501,14 +2519,15 @@ class Societe extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Verifie si un code fournisseur est modifiable dans configuration du module de controle des codes * Verifie si un code fournisseur est modifiable dans configuration du module de controle des codes
* *
* @return int 0=No, 1=Yes * @return int 0=No, 1=Yes
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function codefournisseur_modifiable() function codefournisseur_modifiable()
{ {
// phpcs:enable
global $conf; global $conf;
if (! empty($conf->global->SOCIETE_CODECLIENT_ADDON)) if (! empty($conf->global->SOCIETE_CODECLIENT_ADDON))
{ {
@ -2536,6 +2555,7 @@ class Societe extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Check customer code * Check customer code
* *
@ -2545,9 +2565,9 @@ class Societe extends CommonObject
* -3 ErrorCustomerCodeAlreadyUsed * -3 ErrorCustomerCodeAlreadyUsed
* -4 ErrorPrefixRequired * -4 ErrorPrefixRequired
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function check_codeclient() function check_codeclient()
{ {
// phpcs:enable
global $conf; global $conf;
if (! empty($conf->global->SOCIETE_CODECLIENT_ADDON)) if (! empty($conf->global->SOCIETE_CODECLIENT_ADDON))
{ {
@ -2572,6 +2592,7 @@ class Societe extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Check supplier code * Check supplier code
* *
@ -2581,9 +2602,9 @@ class Societe extends CommonObject
* -3 ErrorCustomerCodeAlreadyUsed * -3 ErrorCustomerCodeAlreadyUsed
* -4 ErrorPrefixRequired * -4 ErrorPrefixRequired
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function check_codefournisseur() function check_codefournisseur()
{ {
// phpcs:enable
global $conf; global $conf;
if (! empty($conf->global->SOCIETE_CODECLIENT_ADDON)) if (! empty($conf->global->SOCIETE_CODECLIENT_ADDON))
{ {
@ -2608,6 +2629,7 @@ class Societe extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Renvoie un code compta, suivant le module de code compta. * Renvoie un code compta, suivant le module de code compta.
* Peut etre identique a celui saisit ou genere automatiquement. * Peut etre identique a celui saisit ou genere automatiquement.
@ -2616,9 +2638,9 @@ class Societe extends CommonObject
* @param string $type Type of thirdparty ('customer' or 'supplier') * @param string $type Type of thirdparty ('customer' or 'supplier')
* @return string Code compta si ok, 0 si aucun, <0 si ko * @return string Code compta si ok, 0 si aucun, <0 si ko
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_codecompta($type) function get_codecompta($type)
{ {
// phpcs:enable
global $conf; global $conf;
if (! empty($conf->global->SOCIETE_CODECOMPTA_ADDON)) if (! empty($conf->global->SOCIETE_CODECOMPTA_ADDON))
@ -2659,15 +2681,16 @@ class Societe extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Define parent commany of current company * Define parent commany of current company
* *
* @param int $id Id of thirdparty to set or '' to remove * @param int $id Id of thirdparty to set or '' to remove
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function set_parent($id) function set_parent($id)
{ {
// phpcs:enable
if ($this->id) if ($this->id)
{ {
$sql = "UPDATE ".MAIN_DB_PREFIX."societe"; $sql = "UPDATE ".MAIN_DB_PREFIX."societe";
@ -2688,15 +2711,16 @@ class Societe extends CommonObject
else return -1; else return -1;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Returns if a profid sould be verified * Returns if a profid sould be verified
* *
* @param int $idprof 1,2,3,4,5,6 (Exemple: 1=siren,2=siret,3=naf,4=rcs/rm,5=idprof5,6=idprof6) * @param int $idprof 1,2,3,4,5,6 (Exemple: 1=siren,2=siret,3=naf,4=rcs/rm,5=idprof5,6=idprof6)
* @return boolean true , false * @return boolean true , false
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function id_prof_verifiable($idprof) function id_prof_verifiable($idprof)
{ {
// phpcs:enable
global $conf; global $conf;
switch($idprof) switch($idprof)
@ -2726,6 +2750,7 @@ class Societe extends CommonObject
return $ret; return $ret;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Verify if a profid exists into database for others thirds * Verify if a profid exists into database for others thirds
* *
@ -2734,9 +2759,9 @@ class Societe extends CommonObject
* @param int $socid Id of thirdparty to exclude (if update) * @param int $socid Id of thirdparty to exclude (if update)
* @return boolean True if exists, False if not * @return boolean True if exists, False if not
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function id_prof_exists($idprof, $value, $socid=0) function id_prof_exists($idprof, $value, $socid=0)
{ {
// phpcs:enable
$field = $idprof; $field = $idprof;
switch($idprof) // For backward compatibility switch($idprof) // For backward compatibility
@ -2785,6 +2810,7 @@ class Societe extends CommonObject
else return false; else return false;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Verifie la validite d'un identifiant professionnel en fonction du pays de la societe (siren, siret, ...) * Verifie la validite d'un identifiant professionnel en fonction du pays de la societe (siren, siret, ...)
* *
@ -2793,9 +2819,9 @@ class Societe extends CommonObject
* @return int <=0 if KO, >0 if OK * @return int <=0 if KO, >0 if OK
* TODO better to have this in a lib than into a business class * TODO better to have this in a lib than into a business class
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function id_prof_check($idprof,$soc) function id_prof_check($idprof,$soc)
{ {
// phpcs:enable
global $conf; global $conf;
$ok=1; $ok=1;
@ -2935,6 +2961,7 @@ class Societe extends CommonObject
return $ok; return $ok;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return an url to check online a professional id or empty string * Return an url to check online a professional id or empty string
* *
@ -2943,9 +2970,9 @@ class Societe extends CommonObject
* @return string Url or empty string if no URL known * @return string Url or empty string if no URL known
* TODO better in a lib than into business class * TODO better in a lib than into business class
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function id_prof_url($idprof,$thirdparty) function id_prof_url($idprof,$thirdparty)
{ {
// phpcs:enable
global $conf,$langs,$hookmanager; global $conf,$langs,$hookmanager;
$url=''; $url='';
@ -2988,14 +3015,15 @@ class Societe extends CommonObject
return ''; return '';
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Indique si la societe a des projets * Indique si la societe a des projets
* *
* @return bool true si la societe a des projets, false sinon * @return bool true si la societe a des projets, false sinon
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function has_projects() function has_projects()
{ {
// phpcs:enable
$sql = 'SELECT COUNT(*) as numproj FROM '.MAIN_DB_PREFIX.'projet WHERE fk_soc = ' . $this->id; $sql = 'SELECT COUNT(*) as numproj FROM '.MAIN_DB_PREFIX.'projet WHERE fk_soc = ' . $this->id;
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) if ($resql)
@ -3090,14 +3118,15 @@ class Societe extends CommonObject
return isInEEC($this); return isInEEC($this);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Charge la liste des categories fournisseurs * Charge la liste des categories fournisseurs
* *
* @return int 0 if success, <> 0 if error * @return int 0 if success, <> 0 if error
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function LoadSupplierCateg() function LoadSupplierCateg()
{ {
// phpcs:enable
$this->SupplierCategories = array(); $this->SupplierCategories = array();
$sql = "SELECT rowid, label"; $sql = "SELECT rowid, label";
$sql.= " FROM ".MAIN_DB_PREFIX."categorie"; $sql.= " FROM ".MAIN_DB_PREFIX."categorie";
@ -3118,15 +3147,16 @@ class Societe extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Insert link supplier - category * Insert link supplier - category
* *
* @param int $categorie_id Id of category * @param int $categorie_id Id of category
* @return int 0 if success, <> 0 if error * @return int 0 if success, <> 0 if error
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function AddFournisseurInCategory($categorie_id) function AddFournisseurInCategory($categorie_id)
{ {
// phpcs:enable
if ($categorie_id > 0 && $this->id > 0) if ($categorie_id > 0 && $this->id > 0)
{ {
$sql = "INSERT INTO ".MAIN_DB_PREFIX."categorie_fournisseur (fk_categorie, fk_soc) "; $sql = "INSERT INTO ".MAIN_DB_PREFIX."categorie_fournisseur (fk_categorie, fk_soc) ";
@ -3142,6 +3172,7 @@ class Societe extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Create a third party into database from a member object * Create a third party into database from a member object
* *
@ -3150,9 +3181,9 @@ class Societe extends CommonObject
* @param string $socalias Alias name of third party to force * @param string $socalias Alias name of third party to force
* @return int <0 if KO, id of created account if OK * @return int <0 if KO, id of created account if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function create_from_member(Adherent $member, $socname='', $socalias='') function create_from_member(Adherent $member, $socname='', $socalias='')
{ {
// phpcs:enable
global $user,$langs; global $user,$langs;
dol_syslog(get_class($this)."::create_from_member", LOG_DEBUG); dol_syslog(get_class($this)."::create_from_member", LOG_DEBUG);
@ -3419,15 +3450,16 @@ class Societe extends CommonObject
return $this->LibProspLevel($this->fk_prospectlevel); return $this->LibProspLevel($this->fk_prospectlevel);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return label of prospect level * Return label of prospect level
* *
* @param int $fk_prospectlevel Prospect level * @param int $fk_prospectlevel Prospect level
* @return string label of level * @return string label of level
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function LibProspLevel($fk_prospectlevel) function LibProspLevel($fk_prospectlevel)
{ {
// phpcs:enable
global $langs; global $langs;
$lib=$langs->trans("ProspectLevel".$fk_prospectlevel); $lib=$langs->trans("ProspectLevel".$fk_prospectlevel);
@ -3440,6 +3472,7 @@ class Societe extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set prospect level * Set prospect level
* *
@ -3447,9 +3480,9 @@ class Societe extends CommonObject
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
* @deprecated Use update function instead * @deprecated Use update function instead
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function set_prospect_level(User $user) function set_prospect_level(User $user)
{ {
// phpcs:enable
return $this->update($this->id, $user); return $this->update($this->id, $user);
} }
@ -3465,6 +3498,7 @@ class Societe extends CommonObject
return $this->LibProspCommStatut($this->stcomm_id, $mode, $label); return $this->LibProspCommStatut($this->stcomm_id, $mode, $label);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return label of a given status * Return label of a given status
* *
@ -3473,9 +3507,9 @@ class Societe extends CommonObject
* @param string $label Label to use for status for added status * @param string $label Label to use for status for added status
* @return string Libelle du statut * @return string Libelle du statut
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function LibProspCommStatut($statut, $mode=0, $label='') function LibProspCommStatut($statut, $mode=0, $label='')
{ {
// phpcs:enable
global $langs; global $langs;
$langs->load('customers'); $langs->load('customers');
@ -3519,6 +3553,7 @@ class Societe extends CommonObject
return "Error, mode/status not found"; return "Error, mode/status not found";
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set outstanding value * Set outstanding value
* *
@ -3526,9 +3561,9 @@ class Societe extends CommonObject
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
* @deprecated Use update function instead * @deprecated Use update function instead
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function set_OutstandingBill(User $user) function set_OutstandingBill(User $user)
{ {
// phpcs:enable
return $this->update($this->id, $user); return $this->update($this->id, $user);
} }
@ -3685,15 +3720,16 @@ class Societe extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return amount of bill not paid * Return amount of bill not paid
* *
* @return int Amount in debt for thirdparty * @return int Amount in debt for thirdparty
* @deprecated * @deprecated
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_OutstandingBill() function get_OutstandingBill()
{ {
// phpcs:enable
/* Accurate value of remain to pay is to sum remaintopay for each invoice /* Accurate value of remain to pay is to sum remaintopay for each invoice
$paiement = $invoice->getSommePaiement(); $paiement = $invoice->getSommePaiement();
$creditnotes=$invoice->getSumCreditNotesUsed(); $creditnotes=$invoice->getSumCreditNotesUsed();
@ -3739,15 +3775,16 @@ class Societe extends CommonObject
return $this->LibCustProspStatut($this->client); return $this->LibCustProspStatut($this->client);
} }
// 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 Libelle du statut * @return string Libelle du statut
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function LibCustProspStatut($statut) function LibCustProspStatut($statut)
{ {
// phpcs:enable
global $langs; global $langs;
$langs->load('companies'); $langs->load('companies');

View File

@ -395,6 +395,7 @@ class SocieteAccount 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
* *
@ -402,9 +403,9 @@ class SocieteAccount 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)