add visibility

This commit is contained in:
Frédéric FRANCE 2019-02-26 22:42:19 +01:00
parent 5016bc7188
commit 8b4e920d5e
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
16 changed files with 1991 additions and 1975 deletions

View File

@ -316,7 +316,7 @@ class BillOfMaterials extends CommonObject
if ($key=='t.rowid') { if ($key=='t.rowid') {
$sqlwhere[] = $key . '='. $value; $sqlwhere[] = $key . '='. $value;
} }
elseif (strpos($key,'date') !== false) { elseif (strpos($key, 'date') !== false) {
$sqlwhere[] = $key.' = \''.$this->db->idate($value).'\''; $sqlwhere[] = $key.' = \''.$this->db->idate($value).'\'';
} }
elseif ($key=='customsql') { elseif ($key=='customsql') {

View File

@ -91,7 +91,7 @@ class Menubase
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param string $menu_handler Menu handler * @param string $menu_handler Menu handler
*/ */
function __construct($db, $menu_handler = '') public function __construct($db, $menu_handler = '')
{ {
$this->db = $db; $this->db = $db;
$this->menu_handler = $menu_handler; $this->menu_handler = $menu_handler;
@ -105,7 +105,7 @@ class Menubase
* @param User $user User that create * @param User $user User that create
* @return int <0 if KO, Id of record if OK * @return int <0 if KO, Id of record if OK
*/ */
function create($user = null) public function create($user = null)
{ {
global $conf, $langs; global $conf, $langs;
@ -245,7 +245,7 @@ class Menubase
* @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) public function update($user = null, $notrigger = 0)
{ {
global $conf, $langs; global $conf, $langs;
@ -310,7 +310,7 @@ class Menubase
* @param User $user User that load * @param User $user User that load
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function fetch($id, $user = null) public function fetch($id, $user = null)
{ {
global $langs; global $langs;
@ -384,7 +384,7 @@ class Menubase
* @param User $user User that delete * @param User $user User that delete
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function delete($user) public function delete($user)
{ {
global $conf, $langs; global $conf, $langs;
@ -410,7 +410,7 @@ class Menubase
* *
* @return void * @return void
*/ */
function initAsSpecimen() public function initAsSpecimen()
{ {
$this->id=0; $this->id=0;
@ -443,7 +443,7 @@ class Menubase
* @param array $tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty) * @param array $tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty)
* @return array Return array with menu entries for top menu * @return array Return array with menu entries for top menu
*/ */
function menuTopCharger($mymainmenu, $myleftmenu, $type_user, $menu_handler, &$tabMenu) public function menuTopCharger($mymainmenu, $myleftmenu, $type_user, $menu_handler, &$tabMenu)
{ {
global $langs, $user, $conf; // To export to dol_eval function global $langs, $user, $conf; // To export to dol_eval function
global $mainmenu,$leftmenu; // To export to dol_eval function global $mainmenu,$leftmenu; // To export to dol_eval function
@ -472,7 +472,7 @@ class Menubase
* @param array $tabMenu Array with menu entries already loaded * @param array $tabMenu Array with menu entries already loaded
* @return Menu Menu array for particular mainmenu value or full tabArray * @return Menu Menu array for particular mainmenu value or full tabArray
*/ */
function menuLeftCharger($newmenu, $mymainmenu, $myleftmenu, $type_user, $menu_handler, &$tabMenu) public function menuLeftCharger($newmenu, $mymainmenu, $myleftmenu, $type_user, $menu_handler, &$tabMenu)
{ {
global $langs, $user, $conf; // To export to dol_eval function global $langs, $user, $conf; // To export to dol_eval function
global $mainmenu,$leftmenu; // To export to dol_eval function global $mainmenu,$leftmenu; // To export to dol_eval function
@ -561,7 +561,7 @@ class Menubase
* @param array $tabMenu Array to store new entries found (in most cases, it's empty, but may be alreay filled) * @param array $tabMenu Array to store new entries found (in most cases, it's empty, but may be alreay filled)
* @return int >0 if OK, <0 if KO * @return int >0 if OK, <0 if KO
*/ */
function menuLoad($mymainmenu, $myleftmenu, $type_user, $menu_handler, &$tabMenu) public function menuLoad($mymainmenu, $myleftmenu, $type_user, $menu_handler, &$tabMenu)
{ {
global $langs, $user, $conf; // To export to dol_eval function global $langs, $user, $conf; // To export to dol_eval function
global $mainmenu, $leftmenu; // To export to dol_eval function global $mainmenu, $leftmenu; // To export to dol_eval function

View File

@ -90,7 +90,7 @@ class Notify
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;
} }
@ -105,7 +105,7 @@ class Notify
* @param Object $object Object the notification is about * @param Object $object Object the notification is about
* @return string Message * @return string Message
*/ */
function confirmMessage($action, $socid, $object) public function confirmMessage($action, $socid, $object)
{ {
global $langs; global $langs;
$langs->load("mails"); $langs->load("mails");
@ -146,7 +146,7 @@ class Notify
* @param array $scope Scope where to search * @param array $scope Scope where to search
* @return array|int <0 if KO, array of notifications to send if OK * @return array|int <0 if KO, array of notifications to send if OK
*/ */
function getNotificationsArray($notifcode, $socid = 0, $object = null, $userid = 0, $scope = array('thirdparty', 'user', 'global')) public function getNotificationsArray($notifcode, $socid = 0, $object = null, $userid = 0, $scope = array('thirdparty', 'user', 'global'))
{ {
global $conf, $user; global $conf, $user;
@ -309,7 +309,7 @@ class Notify
* @param array $mimefilename_list List of attached file name in message * @param array $mimefilename_list List of attached file name in message
* @return int <0 if KO, or number of changes if OK * @return int <0 if KO, or number of changes if OK
*/ */
function send($notifcode, $object, $filename_list = array(), $mimetype_list = array(), $mimefilename_list = array()) public function send($notifcode, $object, $filename_list = array(), $mimetype_list = array(), $mimefilename_list = array())
{ {
global $user,$conf,$langs,$mysoc; global $user,$conf,$langs,$mysoc;
global $hookmanager; global $hookmanager;

View File

@ -26,10 +26,10 @@
*/ */
class SimpleOpenID class SimpleOpenID
{ {
var $openid_url_identity; public $openid_url_identity;
var $URLs = array(); public $URLs = array();
var $error = array(); public $error = array();
var $fields = array( public $fields = array(
'required' => array(), 'required' => array(),
'optional' => array(), 'optional' => array(),
); );
@ -37,7 +37,7 @@ class SimpleOpenID
/** /**
* Constructor * Constructor
*/ */
function __construct() public function __construct()
{ {
if (!function_exists('curl_exec')) if (!function_exists('curl_exec'))
{ {
@ -45,66 +45,66 @@ class SimpleOpenID
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* SetOpenIDServer * SetOpenIDServer
* *
* @param string $a Server * @param string $a Server
* @return void * @return void
*/ */
function SetOpenIDServer($a) public function SetOpenIDServer($a)
{ {
// phpcs:enable // phpcs:enable
$this->URLs['openid_server'] = $a; $this->URLs['openid_server'] = $a;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* SetOpenIDServer * SetOpenIDServer
* *
* @param string $a Server * @param string $a Server
* @return void * @return void
*/ */
function SetTrustRoot($a) public function SetTrustRoot($a)
{ {
// phpcs:enable // phpcs:enable
$this->URLs['trust_root'] = $a; $this->URLs['trust_root'] = $a;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* SetOpenIDServer * SetOpenIDServer
* *
* @param string $a Server * @param string $a Server
* @return void * @return void
*/ */
function SetCancelURL($a) public function SetCancelURL($a)
{ {
// phpcs:enable // phpcs:enable
$this->URLs['cancel'] = $a; $this->URLs['cancel'] = $a;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* SetApprovedURL * SetApprovedURL
* *
* @param string $a Server * @param string $a Server
* @return void * @return void
*/ */
function SetApprovedURL($a) public function SetApprovedURL($a)
{ {
// phpcs:enable // phpcs:enable
$this->URLs['approved'] = $a; $this->URLs['approved'] = $a;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* SetRequiredFields * SetRequiredFields
* *
* @param string $a Server * @param string $a Server
* @return void * @return void
*/ */
function SetRequiredFields($a) public function SetRequiredFields($a)
{ {
// phpcs:enable // phpcs:enable
if (is_array($a)) { if (is_array($a)) {
@ -114,14 +114,14 @@ class SimpleOpenID
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* SetOptionalFields * SetOptionalFields
* *
* @param string $a Server * @param string $a Server
* @return void * @return void
*/ */
function SetOptionalFields($a) public function SetOptionalFields($a)
{ {
// phpcs:enable // phpcs:enable
if (is_array($a)) { if (is_array($a)) {
@ -131,14 +131,14 @@ class SimpleOpenID
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* SetIdentity * SetIdentity
* *
* @param string $a Server * @param string $a Server
* @return void * @return void
*/ */
function SetIdentity($a) public function SetIdentity($a)
{ {
// phpcs:enable // phpcs:enable
// Set Identity URL // Set Identity URL
@ -162,33 +162,33 @@ class SimpleOpenID
$this->openid_url_identity = $a; $this->openid_url_identity = $a;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* GetIdentity * GetIdentity
* *
* @return string * @return string
*/ */
function GetIdentity() public function GetIdentity()
{ {
// phpcs:enable // phpcs:enable
// Get Identity // Get Identity
return $this->openid_url_identity; return $this->openid_url_identity;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* SetOpenIDServer * SetOpenIDServer
* *
* @return void * @return void
*/ */
function GetError() public function GetError()
{ {
// phpcs:enable // 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 // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* ErrorStore * ErrorStore
* *
@ -196,7 +196,7 @@ class SimpleOpenID
* @param string $desc Description * @param string $desc Description
* @return void * @return void
*/ */
function ErrorStore($code, $desc = null) public function ErrorStore($code, $desc = null)
{ {
// phpcs:enable // phpcs:enable
$errs['OPENID_NOSERVERSFOUND'] = 'Cannot find OpenID Server TAG on Identity page.'; $errs['OPENID_NOSERVERSFOUND'] = 'Cannot find OpenID Server TAG on Identity page.';
@ -206,13 +206,13 @@ class SimpleOpenID
$this->error = array($code,$desc); $this->error = array($code,$desc);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* IsError * IsError
* *
* @return boolean * @return boolean
*/ */
function IsError() public function IsError()
{ {
// phpcs:enable // phpcs:enable
if (count($this->error) > 0) if (count($this->error) > 0)
@ -231,7 +231,7 @@ class SimpleOpenID
* @param string $response Server * @param string $response Server
* @return void * @return void
*/ */
function splitResponse($response) public function splitResponse($response)
{ {
$r = array(); $r = array();
$response = explode("\n", $response); $response = explode("\n", $response);
@ -245,14 +245,14 @@ class SimpleOpenID
return $r; return $r;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* OpenID_Standarize * OpenID_Standarize
* *
* @param string $openid_identity Server * @param string $openid_identity Server
* @return string * @return string
*/ */
function OpenID_Standarize($openid_identity = null) public function OpenID_Standarize($openid_identity = null)
{ {
// phpcs:enable // phpcs:enable
if ($openid_identity === null) if ($openid_identity === null)
@ -279,7 +279,7 @@ class SimpleOpenID
* @param array $arr An array * @param array $arr An array
* @return false|string false if KO, string of url if OK * @return false|string false if KO, string of url if OK
*/ */
function array2url($arr) public function array2url($arr)
{ {
// converts associated array to URL Query String // converts associated array to URL Query String
if (!is_array($arr)){ if (!is_array($arr)){
@ -292,7 +292,7 @@ class SimpleOpenID
return $query; return $query;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* FSOCK_Request * FSOCK_Request
* *
@ -301,7 +301,7 @@ class SimpleOpenID
* @param string $params Params * @param string $params Params
* @return boolean|unknown * @return boolean|unknown
*/ */
function FSOCK_Request($url, $method = "GET", $params = "") public function FSOCK_Request($url, $method = "GET", $params = "")
{ {
// phpcs:enable // 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
@ -326,7 +326,7 @@ class SimpleOpenID
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* CURL_Request * CURL_Request
* *
@ -335,7 +335,7 @@ class SimpleOpenID
* @param string $params Params * @param string $params Params
* @return string * @return string
*/ */
function CURL_Request($url, $method = "GET", $params = "") public function CURL_Request($url, $method = "GET", $params = "")
{ {
// phpcs:enable // phpcs:enable
// Remember, SSL MUST BE SUPPORTED // Remember, SSL MUST BE SUPPORTED
@ -359,14 +359,14 @@ class SimpleOpenID
return $response; return $response;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* HTML2OpenIDServer * HTML2OpenIDServer
* *
* @param string $content Content * @param string $content Content
* @return array Array of servers * @return array Array of servers
*/ */
function HTML2OpenIDServer($content) public function HTML2OpenIDServer($content)
{ {
// phpcs:enable // phpcs:enable
$get = array(); $get = array();
@ -387,14 +387,14 @@ class SimpleOpenID
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* 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
*/ */
function GetOpenIDServer($url = '') public function GetOpenIDServer($url = '')
{ {
// phpcs:enable // phpcs:enable
global $conf; global $conf;
@ -417,13 +417,13 @@ class SimpleOpenID
return $servers[0]; return $servers[0];
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* GetRedirectURL * GetRedirectURL
* *
* @return string * @return string
*/ */
function GetRedirectURL() public function GetRedirectURL()
{ {
// phpcs:enable // phpcs:enable
$params = array(); $params = array();
@ -443,13 +443,13 @@ class SimpleOpenID
return $this->URLs['openid_server'] . "?". $this->array2url($params); return $this->URLs['openid_server'] . "?". $this->array2url($params);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Redirect * Redirect
* *
* @return void * @return void
*/ */
function Redirect() public function Redirect()
{ {
// phpcs:enable // phpcs:enable
$redirect_to = $this->GetRedirectURL(); $redirect_to = $this->GetRedirectURL();
@ -465,13 +465,13 @@ class SimpleOpenID
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* ValidateWithServer * ValidateWithServer
* *
* @return boolean * @return boolean
*/ */
function ValidateWithServer() public function ValidateWithServer()
{ {
// phpcs:enable // phpcs:enable
$params = array( $params = array(
@ -518,7 +518,7 @@ class SimpleOpenID
* @param string $url Url of endpoint to request * @param string $url Url of endpoint to request
* @return string First endpoint OpenID server found. False if it failed to found. * @return string First endpoint OpenID server found. False if it failed to found.
*/ */
function sendDiscoveryRequestToGetXRDS($url = '') public function sendDiscoveryRequestToGetXRDS($url = '')
{ {
global $conf; global $conf;

View File

@ -461,7 +461,7 @@ class RssParser
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Triggered when opened tag is found * Triggered when opened tag is found
* *
@ -470,7 +470,7 @@ class RssParser
* @param array $attrs Attributes of tags * @param array $attrs Attributes of tags
* @return void * @return void
*/ */
function feed_start_element($p, $element, &$attrs) public function feed_start_element($p, $element, &$attrs)
{ {
// phpcs:enable // phpcs:enable
$el = $element = strtolower($element); $el = $element = strtolower($element);
@ -581,7 +581,7 @@ class RssParser
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Triggered when CDATA is found * Triggered when CDATA is found
* *
@ -589,7 +589,7 @@ class RssParser
* @param string $text Tag * @param string $text Tag
* @return void * @return void
*/ */
function feed_cdata($p, $text) public function feed_cdata($p, $text)
{ {
// phpcs:enable // phpcs:enable
if ($this->_format == 'atom' and $this->incontent) if ($this->_format == 'atom' and $this->incontent)
@ -603,7 +603,7 @@ class RssParser
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Triggered when closed tag is found * Triggered when closed tag is found
* *
@ -611,7 +611,7 @@ class RssParser
* @param string $el Tag * @param string $el Tag
* @return void * @return void
*/ */
function feed_end_element($p, $el) public function feed_end_element($p, $el)
{ {
// phpcs:enable // phpcs:enable
$el = strtolower($el); $el = strtolower($el);
@ -666,7 +666,7 @@ class RssParser
* @param string $str2 Str2 * @param string $str2 Str2
* @return string String cancatenated * @return string String cancatenated
*/ */
function concat(&$str1, $str2 = "") public function concat(&$str1, $str2 = "")
{ {
if (!isset($str1) ) { if (!isset($str1) ) {
$str1=""; $str1="";
@ -674,14 +674,14 @@ class RssParser
$str1 .= $str2; $str1 .= $str2;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Enter description here ... * Enter description here ...
* *
* @param string $text Text * @param string $text Text
* @return void * @return void
*/ */
function append_content($text) public function append_content($text)
{ {
// phpcs:enable // phpcs:enable
if ( $this->initem ) { if ( $this->initem ) {
@ -699,7 +699,7 @@ class RssParser
* @param string $text Text * @param string $text Text
* @return void * @return void
*/ */
function append($el, $text) public function append($el, $text)
{ {
if (!$el) { if (!$el) {
return; return;

View File

@ -48,76 +48,76 @@ class SMTPs
/** /**
* Host Name or IP of SMTP Server to use * Host Name or IP of SMTP Server to use
*/ */
var $_smtpsHost = 'localhost'; private $_smtpsHost = 'localhost';
/** /**
* SMTP Server Port definition. 25 is default value * SMTP Server Port definition. 25 is default value
* This can be defined via a INI file or via a setter method * This can be defined via a INI file or via a setter method
*/ */
var $_smtpsPort = '25'; private $_smtpsPort = '25';
/** /**
* Secure SMTP Server access ID * Secure SMTP Server access ID
* This can be defined via a INI file or via a setter method * This can be defined via a INI file or via a setter method
*/ */
var $_smtpsID = null; private $_smtpsID = null;
/** /**
* Secure SMTP Server access Password * Secure SMTP Server access Password
* This can be defined via a INI file or via a setter method * This can be defined via a INI file or via a setter method
*/ */
var $_smtpsPW = null; private $_smtpsPW = null;
/** /**
* Who sent the Message * Who sent the Message
* This can be defined via a INI file or via a setter method * This can be defined via a INI file or via a setter method
*/ */
var $_msgFrom = null; private $_msgFrom = null;
/** /**
* Where are replies and errors to be sent to * Where are replies and errors to be sent to
* This can be defined via a INI file or via a setter method * This can be defined via a INI file or via a setter method
*/ */
var $_msgReplyTo = null; private $_msgReplyTo = null;
/** /**
* Who will the Message be sent to; TO, CC, BCC * Who will the Message be sent to; TO, CC, BCC
* Multi-diminsional array containg addresses the message will * Multi-diminsional array containg addresses the message will
* be sent TO, CC or BCC * be sent TO, CC or BCC
*/ */
var $_msgRecipients = null; private $_msgRecipients = null;
/** /**
* Message Subject * Message Subject
*/ */
var $_msgSubject = null; private $_msgSubject = null;
/** /**
* Message Content * Message Content
*/ */
var $_msgContent = null; private $_msgContent = null;
/** /**
* Custom X-Headers * Custom X-Headers
*/ */
var $_msgXheader = null; private $_msgXheader = null;
/** /**
* Character set * Character set
* Defaulted to 'iso-8859-1' * Defaulted to 'iso-8859-1'
*/ */
var $_smtpsCharSet = 'iso-8859-1'; private $_smtpsCharSet = 'iso-8859-1';
/** /**
* Message Sensitivity * Message Sensitivity
* Defaults to ZERO - None * Defaults to ZERO - None
*/ */
var $_msgSensitivity = 0; private $_msgSensitivity = 0;
/** /**
* Message Sensitivity * Message Sensitivity
*/ */
var $_arySensitivity = array ( false, private $_arySensitivity = array ( false,
'Personal', 'Personal',
'Private', 'Private',
'Company Confidential' ); 'Company Confidential' );
@ -126,12 +126,12 @@ class SMTPs
* Message Sensitivity * Message Sensitivity
* Defaults to 3 - Normal * Defaults to 3 - Normal
*/ */
var $_msgPriority = 3; private $_msgPriority = 3;
/** /**
* Message Priority * Message Priority
*/ */
var $_aryPriority = array ( 'Bulk', private $_aryPriority = array ( 'Bulk',
'Highest', 'Highest',
'High', 'High',
'Normal', 'Normal',
@ -142,12 +142,12 @@ class SMTPs
* Content-Transfer-Encoding * Content-Transfer-Encoding
* Defaulted to 0 - 7bit * Defaulted to 0 - 7bit
*/ */
var $_smtpsTransEncodeType = 0; private $_smtpsTransEncodeType = 0;
/** /**
* Content-Transfer-Encoding * Content-Transfer-Encoding
*/ */
var $_smtpsTransEncodeTypes = array( '7bit', // Simple 7-bit ASCII private $_smtpsTransEncodeTypes = array( '7bit', // Simple 7-bit ASCII
'8bit', // 8-bit coding with line termination characters '8bit', // 8-bit coding with line termination characters
'base64', // 3 octets encoded into 4 sextets with offset 'base64', // 3 octets encoded into 4 sextets with offset
'binary', // Arbitrary binary stream 'binary', // Arbitrary binary stream
@ -159,22 +159,22 @@ class SMTPs
* Content-Transfer-Encoding * Content-Transfer-Encoding
* Defaulted to '7bit' * Defaulted to '7bit'
*/ */
var $_smtpsTransEncode = '7bit'; private $_smtpsTransEncode = '7bit';
/** /**
* Boundary String for MIME seperation * Boundary String for MIME seperation
*/ */
var $_smtpsBoundary = null; private $_smtpsBoundary = null;
/** /**
* Related Boundary * Related Boundary
*/ */
var $_smtpsRelatedBoundary = null; private $_smtpsRelatedBoundary = null;
/** /**
* Alternative Boundary * Alternative Boundary
*/ */
var $_smtpsAlternativeBoundary = null; private $_smtpsAlternativeBoundary = null;
/** /**
* Determines the method inwhich the message are to be sent. * Determines the method inwhich the message are to be sent.
@ -183,28 +183,28 @@ class SMTPs
* - 'phpmail [2] - use the PHP built-in mail function * - 'phpmail [2] - use the PHP built-in mail function
* NOTE: Only 'sockets' is implemented * NOTE: Only 'sockets' is implemented
*/ */
var $_transportType = 0; private $_transportType = 0;
/** /**
* If '$_transportType' is set to '1', then this variable is used * If '$_transportType' is set to '1', then this variable is used
* to define the UNIX file system path to the sendmail execuable * to define the UNIX file system path to the sendmail execuable
*/ */
var $_mailPath = '/usr/lib/sendmail'; private $_mailPath = '/usr/lib/sendmail';
/** /**
* Sets the SMTP server timeout in seconds. * Sets the SMTP server timeout in seconds.
*/ */
var $_smtpTimeout = 10; private $_smtpTimeout = 10;
/** /**
* Determines whether to calculate message MD5 checksum. * Determines whether to calculate message MD5 checksum.
*/ */
var $_smtpMD5 = false; private $_smtpMD5 = false;
/** /**
* Class error codes and messages * Class error codes and messages
*/ */
var $_smtpsErrors = null; private $_smtpsErrors = null;
/** /**
* Defines log level * Defines log level
@ -213,20 +213,20 @@ class SMTPs
* 2 - message generation logging * 2 - message generation logging
* 3 - detail logging * 3 - detail logging
*/ */
var $_log_level = 0; private $_log_level = 0;
/** /**
* Place Class in" debug" mode * Place Class in" debug" mode
*/ */
var $_debug = false; private $_debug = false;
// @CHANGE LDR // @CHANGE LDR
var $log = ''; private $log = '';
var $_errorsTo = ''; private $_errorsTo = '';
var $_deliveryReceipt = 0; private $_deliveryReceipt = 0;
var $_trackId = ''; private $_trackId = '';
var $_moreInHeader = ''; private $_moreInHeader = '';
/** /**
@ -235,7 +235,7 @@ class SMTPs
* @param int $_val Value * @param int $_val Value
* @return void * @return void
*/ */
function setDeliveryReceipt($_val = 0) public function setDeliveryReceipt($_val = 0)
{ {
$this->_deliveryReceipt = $_val; $this->_deliveryReceipt = $_val;
} }
@ -245,7 +245,7 @@ class SMTPs
* *
* @return int Delivery receipt * @return int Delivery receipt
*/ */
function getDeliveryReceipt() public function getDeliveryReceipt()
{ {
return $this->_deliveryReceipt; return $this->_deliveryReceipt;
} }
@ -256,7 +256,7 @@ class SMTPs
* @param string $_val Value * @param string $_val Value
* @return void * @return void
*/ */
function setTrackId($_val = '') public function setTrackId($_val = '')
{ {
$this->_trackId = $_val; $this->_trackId = $_val;
} }
@ -267,7 +267,7 @@ class SMTPs
* @param string $_val Value * @param string $_val Value
* @return void * @return void
*/ */
function setMoreInHeader($_val = '') public function setMoreInHeader($_val = '')
{ {
$this->_moreinheader = $_val; $this->_moreinheader = $_val;
} }
@ -277,7 +277,7 @@ class SMTPs
* *
* @return string Track id * @return string Track id
*/ */
function getTrackId() public function getTrackId()
{ {
return $this->_trackId; return $this->_trackId;
} }
@ -287,7 +287,7 @@ class SMTPs
* *
* @return string moreInHeader * @return string moreInHeader
*/ */
function getMoreInHeader() public function getMoreInHeader()
{ {
return $this->_moreinheader; return $this->_moreinheader;
} }
@ -298,7 +298,7 @@ class SMTPs
* @param string $_strErrorsTo Errors to * @param string $_strErrorsTo Errors to
* @return void * @return void
*/ */
function setErrorsTo($_strErrorsTo) public function setErrorsTo($_strErrorsTo)
{ {
if ( $_strErrorsTo ) if ( $_strErrorsTo )
$this->_errorsTo = $this->_strip_email($_strErrorsTo); $this->_errorsTo = $this->_strip_email($_strErrorsTo);
@ -310,7 +310,7 @@ class SMTPs
* @param boolean $_part Variant * @param boolean $_part Variant
* @return string Errors to * @return string Errors to
*/ */
function getErrorsTo($_part = true) public function getErrorsTo($_part = true)
{ {
$_retValue = ''; $_retValue = '';
@ -328,7 +328,7 @@ class SMTPs
* @param boolean $_vDebug Value for debug * @param boolean $_vDebug Value for debug
* @return void * @return void
*/ */
function setDebug($_vDebug = false) public function setDebug($_vDebug = false)
{ {
$this->_debug = $_vDebug; $this->_debug = $_vDebug;
} }
@ -338,19 +338,19 @@ class SMTPs
* *
* @return void * @return void
*/ */
function buildRCPTlist() public function buildRCPTlist()
{ {
// Pull TO list // Pull TO list
$_aryToList = $this->getTO(); $_aryToList = $this->getTO();
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* 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
*/ */
function _server_connect() private function _server_connect()
{ {
// phpcs:enable // phpcs:enable
// Default return value // Default return value
@ -407,13 +407,13 @@ class SMTPs
return $_retVal; return $_retVal;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* 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
*/ */
function _server_authenticate() private function _server_authenticate()
{ {
// phpcs:enable // phpcs:enable
global $conf; global $conf;
@ -524,7 +524,7 @@ class SMTPs
* @return boolean|null void * @return boolean|null void
* $_strMsg If this is run in 'Test' mode, the actual message structure will be returned * $_strMsg If this is run in 'Test' mode, the actual message structure will be returned
*/ */
function sendMsg($_bolTestMsg = false, $_bolDebug = false) public function sendMsg($_bolTestMsg = false, $_bolDebug = false)
{ {
global $conf; global $conf;
@ -646,7 +646,7 @@ class SMTPs
* @param mixed $_strConfigPath path to config file or VOID * @param mixed $_strConfigPath path to config file or VOID
* @return boolean * @return boolean
*/ */
function setConfig($_strConfigPath = null) public function setConfig($_strConfigPath = null)
{ {
/** /**
* Returns constructed SELECT Object string or boolean upon failure * Returns constructed SELECT Object string or boolean upon failure
@ -694,12 +694,12 @@ class SMTPs
* @param int $_type Interger value representing Mail Transport Type * @param int $_type Interger value representing Mail Transport Type
* @return void * @return void
*/ */
function setTransportType($_type = 0) public function setTransportType($_type = 0)
{ {
if ( ( is_numeric($_type) ) && if ((is_numeric($_type)) && (($_type >= 0) && ($_type <= 3))) {
( ( $_type >= 0 ) && ( $_type <= 3 ) ) )
$this->_transportType = $_type; $this->_transportType = $_type;
} }
}
/** /**
* Return the method inwhich the message is to be sent. * Return the method inwhich the message is to be sent.
@ -709,7 +709,7 @@ class SMTPs
* *
* @return int $_strHost Host Name or IP of the Mail Server to use * @return int $_strHost Host Name or IP of the Mail Server to use
*/ */
function getTransportType() public function getTransportType()
{ {
return $this->_transportType; return $this->_transportType;
} }
@ -721,7 +721,7 @@ class SMTPs
* @return boolean * @return boolean
* *
*/ */
function setMailPath($_path) public function setMailPath($_path)
{ {
// This feature is not yet implemented // This feature is not yet implemented
return true; return true;
@ -737,7 +737,7 @@ class SMTPs
* @param string $_strHost Host Name or IP of the Mail Server to use * @param string $_strHost Host Name or IP of the Mail Server to use
* @return void * @return void
*/ */
function setHost($_strHost) public function setHost($_strHost)
{ {
if ( $_strHost ) if ( $_strHost )
$this->_smtpsHost = $_strHost; $this->_smtpsHost = $_strHost;
@ -749,7 +749,7 @@ class SMTPs
* *
* @return string $_strHost Host Name or IP of the Mail Server to use * @return string $_strHost Host Name or IP of the Mail Server to use
*/ */
function getHost() public function getHost()
{ {
return $this->_smtpsHost; return $this->_smtpsHost;
} }
@ -762,7 +762,7 @@ class SMTPs
* @param int $_intPort Port Number of the Mail Server to use * @param int $_intPort Port Number of the Mail Server to use
* @return void * @return void
*/ */
function setPort($_intPort) public function setPort($_intPort)
{ {
if ( ( is_numeric($_intPort) ) && if ( ( is_numeric($_intPort) ) &&
( ( $_intPort >= 1 ) && ( $_intPort <= 65536 ) ) ) ( ( $_intPort >= 1 ) && ( $_intPort <= 65536 ) ) )
@ -775,7 +775,7 @@ class SMTPs
* *
* @return string Port Number of the Mail Server to use * @return string Port Number of the Mail Server to use
*/ */
function getPort() public function getPort()
{ {
return $this->_smtpsPort; return $this->_smtpsPort;
} }
@ -786,7 +786,7 @@ class SMTPs
* @param string $_strID User Name for authentication on Mail Server * @param string $_strID User Name for authentication on Mail Server
* @return void * @return void
*/ */
function setID($_strID) public function setID($_strID)
{ {
$this->_smtpsID = $_strID; $this->_smtpsID = $_strID;
} }
@ -796,7 +796,7 @@ class SMTPs
* *
* @return string User Name for authentication on Mail Server * @return string User Name for authentication on Mail Server
*/ */
function getID() public function getID()
{ {
return $this->_smtpsID; return $this->_smtpsID;
} }
@ -807,7 +807,7 @@ class SMTPs
* @param string $_strPW User Password for authentication on Mail Server * @param string $_strPW User Password for authentication on Mail Server
* @return void * @return void
*/ */
function setPW($_strPW) public function setPW($_strPW)
{ {
$this->_smtpsPW = $_strPW; $this->_smtpsPW = $_strPW;
} }
@ -817,7 +817,7 @@ class SMTPs
* *
* @return string User Password for authentication on Mail Server * @return string User Password for authentication on Mail Server
*/ */
function getPW() public function getPW()
{ {
return $this->_smtpsPW; return $this->_smtpsPW;
} }
@ -829,7 +829,7 @@ class SMTPs
* @param string $_strCharSet Character set used for current message * @param string $_strCharSet Character set used for current message
* @return void * @return void
*/ */
function setCharSet($_strCharSet) public function setCharSet($_strCharSet)
{ {
if ( $_strCharSet ) if ( $_strCharSet )
$this->_smtpsCharSet = $_strCharSet; $this->_smtpsCharSet = $_strCharSet;
@ -840,7 +840,7 @@ class SMTPs
* *
* @return string $_smtpsCharSet Character set used for current message * @return string $_smtpsCharSet Character set used for current message
*/ */
function getCharSet() public function getCharSet()
{ {
return $this->_smtpsCharSet; return $this->_smtpsCharSet;
} }
@ -860,7 +860,7 @@ class SMTPs
* @param string $_strTransEncode Content-Transfer-Encoding * @param string $_strTransEncode Content-Transfer-Encoding
* @return void * @return void
*/ */
function setTransEncode($_strTransEncode) public function setTransEncode($_strTransEncode)
{ {
if (array_search($_strTransEncode, $this->_smtpsTransEncodeTypes)) if (array_search($_strTransEncode, $this->_smtpsTransEncodeTypes))
$this->_smtpsTransEncode = $_strTransEncode; $this->_smtpsTransEncode = $_strTransEncode;
@ -871,7 +871,7 @@ class SMTPs
* *
* @return string $_smtpsTransEncode Content-Transfer-Encoding * @return string $_smtpsTransEncode Content-Transfer-Encoding
*/ */
function getTransEncode() public function getTransEncode()
{ {
return $this->_smtpsTransEncode; return $this->_smtpsTransEncode;
} }
@ -892,7 +892,7 @@ class SMTPs
* @return void * @return void
* *
*/ */
function setTransEncodeType($_strTransEncodeType) public function setTransEncodeType($_strTransEncodeType)
{ {
if (array_search($_strTransEncodeType, $this->_smtpsTransEncodeTypes)) if (array_search($_strTransEncodeType, $this->_smtpsTransEncodeTypes))
$this->_smtpsTransEncodeType = $_strTransEncodeType; $this->_smtpsTransEncodeType = $_strTransEncodeType;
@ -903,7 +903,7 @@ class SMTPs
* *
* @return string Content-Transfer-Encoding * @return string Content-Transfer-Encoding
*/ */
function getTransEncodeType() public function getTransEncodeType()
{ {
return $this->_smtpsTransEncodeTypes[$this->_smtpsTransEncodeType]; return $this->_smtpsTransEncodeTypes[$this->_smtpsTransEncodeType];
} }
@ -917,7 +917,7 @@ class SMTPs
* @param string $_strFrom Address from which mail will be sent * @param string $_strFrom Address from which mail will be sent
* @return void * @return void
*/ */
function setFrom($_strFrom) public function setFrom($_strFrom)
{ {
if ( $_strFrom ) if ( $_strFrom )
$this->_msgFrom = $this->_strip_email($_strFrom); $this->_msgFrom = $this->_strip_email($_strFrom);
@ -929,7 +929,7 @@ class SMTPs
* @param boolean $_part To "strip" 'Real name' from address * @param boolean $_part To "strip" 'Real name' from address
* @return string Address from which mail will be sent * @return string Address from which mail will be sent
*/ */
function getFrom($_part = true) public function getFrom($_part = true)
{ {
$_retValue = ''; $_retValue = '';
@ -947,7 +947,7 @@ class SMTPs
* @param string $_strReplyTo Address from which mail will be the reply-to * @param string $_strReplyTo Address from which mail will be the reply-to
* @return void * @return void
*/ */
function setReplyTo($_strReplyTo) public function setReplyTo($_strReplyTo)
{ {
if ( $_strReplyTo ) if ( $_strReplyTo )
$this->_msgReplyTo = $this->_strip_email($_strReplyTo); $this->_msgReplyTo = $this->_strip_email($_strReplyTo);
@ -959,7 +959,7 @@ class SMTPs
* @param boolean $_part To "strip" 'Real name' from address * @param boolean $_part To "strip" 'Real name' from address
* @return string Address from which mail will be the reply-to * @return string Address from which mail will be the reply-to
*/ */
function getReplyTo($_part = true) public function getReplyTo($_part = true)
{ {
$_retValue = ''; $_retValue = '';
@ -983,7 +983,7 @@ class SMTPs
* @return void * @return void
* *
*/ */
function _buildAddrList($_type, $_addrList) private function _buildAddrList($_type, $_addrList)
{ {
// Pull existing list // Pull existing list
$aryHost = $this->_msgRecipients; $aryHost = $this->_msgRecipients;
@ -1039,7 +1039,7 @@ class SMTPs
$this->_msgRecipients = $aryHost; $this->_msgRecipients = $aryHost;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* 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:
@ -1056,7 +1056,7 @@ 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
*/ */
function _strip_email($_strAddr) private function _strip_email($_strAddr)
{ {
// phpcs:enable // phpcs:enable
// Keep the orginal // Keep the orginal
@ -1092,7 +1092,7 @@ class SMTPs
return $_aryEmail; return $_aryEmail;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* 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
@ -1100,7 +1100,7 @@ class SMTPs
* *
* @return array Returns an array of bares addresses * @return array Returns an array of bares addresses
*/ */
function get_RCPT_list() public function get_RCPT_list()
{ {
// phpcs:enable // phpcs:enable
/** /**
@ -1124,14 +1124,14 @@ class SMTPs
return $_RCPT_list; return $_RCPT_list;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* 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
*/ */
function get_email_list($_which = null) public function get_email_list($_which = null)
{ {
// phpcs:enable // phpcs:enable
// We need to know which address segment to pull // We need to know which address segment to pull
@ -1182,7 +1182,7 @@ class SMTPs
* @param string $_addrTo TO Address[es] inwhich to send mail to * @param string $_addrTo TO Address[es] inwhich to send mail to
* @return void * @return void
*/ */
function setTO($_addrTo) public function setTO($_addrTo)
{ {
if ( $_addrTo ) if ( $_addrTo )
$this->_buildAddrList('to', $_addrTo); $this->_buildAddrList('to', $_addrTo);
@ -1193,7 +1193,7 @@ class SMTPs
* *
* @return string TO Address[es] inwhich to send mail to * @return string TO Address[es] inwhich to send mail to
*/ */
function getTo() public function getTo()
{ {
return $this->get_email_list('to'); return $this->get_email_list('to');
} }
@ -1204,7 +1204,7 @@ class SMTPs
* @param string $_strCC CC Address[es] inwhich to send mail to * @param string $_strCC CC Address[es] inwhich to send mail to
* @return void * @return void
*/ */
function setCC($_strCC) public function setCC($_strCC)
{ {
if ( $_strCC ) if ( $_strCC )
$this->_buildAddrList('cc', $_strCC); $this->_buildAddrList('cc', $_strCC);
@ -1215,7 +1215,7 @@ class SMTPs
* *
* @return string CC Address[es] inwhich to send mail to * @return string CC Address[es] inwhich to send mail to
*/ */
function getCC() public function getCC()
{ {
return $this->get_email_list('cc'); return $this->get_email_list('cc');
} }
@ -1226,7 +1226,7 @@ class SMTPs
* @param string $_strBCC Recipients BCC Address[es] inwhich to send mail to * @param string $_strBCC Recipients BCC Address[es] inwhich to send mail to
* @return void * @return void
*/ */
function setBCC($_strBCC) public function setBCC($_strBCC)
{ {
if ( $_strBCC ) if ( $_strBCC )
$this->_buildAddrList('bcc', $_strBCC); $this->_buildAddrList('bcc', $_strBCC);
@ -1237,7 +1237,7 @@ class SMTPs
* *
* @return string BCC Address[es] inwhich to send mail to * @return string BCC Address[es] inwhich to send mail to
*/ */
function getBCC() public function getBCC()
{ {
return $this->get_email_list('bcc'); return $this->get_email_list('bcc');
} }
@ -1248,7 +1248,7 @@ class SMTPs
* @param string $_strSubject Message Subject * @param string $_strSubject Message Subject
* @return void * @return void
*/ */
function setSubject($_strSubject = '') public function setSubject($_strSubject = '')
{ {
if ( $_strSubject ) if ( $_strSubject )
$this->_msgSubject = $_strSubject; $this->_msgSubject = $_strSubject;
@ -1259,7 +1259,7 @@ class SMTPs
* *
* @return string Message Subject * @return string Message Subject
*/ */
function getSubject() public function getSubject()
{ {
return $this->_msgSubject; return $this->_msgSubject;
} }
@ -1269,7 +1269,7 @@ class SMTPs
* *
* @return string Complete message header * @return string Complete message header
*/ */
function getHeader() public function getHeader()
{ {
global $conf; global $conf;
@ -1353,7 +1353,7 @@ class SMTPs
* @param string $strType Type * @param string $strType Type
* @return void * @return void
*/ */
function setBodyContent($strContent, $strType = 'plain') public function setBodyContent($strContent, $strType = 'plain')
{ {
//if ( $strContent ) //if ( $strContent )
//{ //{
@ -1394,7 +1394,7 @@ class SMTPs
* *
* @return string Message Content * @return string Message Content
*/ */
function getBodyContent() public function getBodyContent()
{ {
global $conf; global $conf;
@ -1568,7 +1568,7 @@ class SMTPs
* @param string $strMimeType File Mime Type of attachment * @param string $strMimeType File Mime Type of attachment
* @return void * @return void
*/ */
function setAttachment($strContent, $strFileName = 'unknown', $strMimeType = 'unknown') public function setAttachment($strContent, $strFileName = 'unknown', $strMimeType = 'unknown')
{ {
if ( $strContent ) if ( $strContent )
{ {
@ -1596,7 +1596,7 @@ class SMTPs
* @param string $strImageCid CID * @param string $strImageCid CID
* @return void * @return void
*/ */
function setImageInline($strContent, $strImageName = 'unknown', $strMimeType = 'unknown', $strImageCid = 'unknown') public function setImageInline($strContent, $strImageName = 'unknown', $strMimeType = 'unknown', $strImageCid = 'unknown')
{ {
if ($strContent) if ($strContent)
{ {
@ -1623,7 +1623,7 @@ class SMTPs
* @param integer $_value Message Sensitivity * @param integer $_value Message Sensitivity
* @return void * @return void
*/ */
function setSensitivity($_value = 0) public function setSensitivity($_value = 0)
{ {
if ( ( is_numeric($_value) ) && if ( ( is_numeric($_value) ) &&
( ( $_value >= 0 ) && ( $_value <= 3 ) ) ) ( ( $_value >= 0 ) && ( $_value <= 3 ) ) )
@ -1640,7 +1640,7 @@ class SMTPs
* *
* @return void * @return void
*/ */
function getSensitivity() public function getSensitivity()
{ {
return $this->_arySensitivity[$this->_msgSensitivity]; return $this->_arySensitivity[$this->_msgSensitivity];
} }
@ -1658,7 +1658,7 @@ class SMTPs
* @param integer $_value Message Priority * @param integer $_value Message Priority
* @return void * @return void
*/ */
function setPriority($_value = 3) public function setPriority($_value = 3)
{ {
if ( ( is_numeric($_value) ) && if ( ( is_numeric($_value) ) &&
( ( $_value >= 0 ) && ( $_value <= 5 ) ) ) ( ( $_value >= 0 ) && ( $_value <= 5 ) ) )
@ -1677,7 +1677,7 @@ class SMTPs
* *
* @return string * @return string
*/ */
function getPriority() public function getPriority()
{ {
return 'Importance: ' . $this->_aryPriority[$this->_msgPriority] . "\r\n" return 'Importance: ' . $this->_aryPriority[$this->_msgPriority] . "\r\n"
. 'Priority: ' . $this->_aryPriority[$this->_msgPriority] . "\r\n" . 'Priority: ' . $this->_aryPriority[$this->_msgPriority] . "\r\n"
@ -1690,7 +1690,7 @@ class SMTPs
* @param string $_flag Message Priority * @param string $_flag Message Priority
* @return void * @return void
*/ */
function setMD5flag($_flag = false) public function setMD5flag($_flag = false)
{ {
$this->_smtpMD5 = $_flag; $this->_smtpMD5 = $_flag;
} }
@ -1700,7 +1700,7 @@ class SMTPs
* *
* @return boolean Message Priority * @return boolean Message Priority
*/ */
function getMD5flag() public function getMD5flag()
{ {
return $this->_smtpMD5; return $this->_smtpMD5;
} }
@ -1713,7 +1713,7 @@ class SMTPs
* @param string $strXdata Message X-Header Content * @param string $strXdata Message X-Header Content
* @return void * @return void
*/ */
function setXheader($strXdata) public function setXheader($strXdata)
{ {
if ( $strXdata ) if ( $strXdata )
$this->_msgXheader[] = $strXdata; $this->_msgXheader[] = $strXdata;
@ -1724,7 +1724,7 @@ class SMTPs
* *
* @return string[] $_msgContent Message X-Header Content * @return string[] $_msgContent Message X-Header Content
*/ */
function getXheader() public function getXheader()
{ {
return $this->_msgXheader; return $this->_msgXheader;
} }
@ -1734,7 +1734,7 @@ class SMTPs
* *
* @return void * @return void
*/ */
function _setBoundary() private function _setBoundary()
{ {
$this->_smtpsBoundary = "multipart_x." . time() . ".x_boundary"; $this->_smtpsBoundary = "multipart_x." . time() . ".x_boundary";
$this->_smtpsRelatedBoundary = 'mul_'.dol_hash(uniqid("dolibarr2"), 3); $this->_smtpsRelatedBoundary = 'mul_'.dol_hash(uniqid("dolibarr2"), 3);
@ -1747,14 +1747,14 @@ class SMTPs
* @param string $type Type of boundary * @param string $type Type of boundary
* @return string $_smtpsBoundary MIME message Boundary * @return string $_smtpsBoundary MIME message Boundary
*/ */
function _getBoundary($type = 'mixed') private function _getBoundary($type = 'mixed')
{ {
if ($type == 'mixed') return $this->_smtpsBoundary; if ($type == 'mixed') return $this->_smtpsBoundary;
elseif ($type == 'related') return $this->_smtpsRelatedBoundary; elseif ($type == 'related') return $this->_smtpsRelatedBoundary;
elseif ($type == 'alternative') return $this->_smtpsAlternativeBoundary; elseif ($type == 'alternative') return $this->_smtpsAlternativeBoundary;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* 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
@ -1763,7 +1763,7 @@ 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
*/ */
function server_parse($socket, $response) public function server_parse($socket, $response)
{ {
// phpcs:enable // phpcs:enable
/** /**
@ -1797,7 +1797,7 @@ class SMTPs
return $_retVal; return $_retVal;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Send str * Send str
* *
@ -1806,7 +1806,7 @@ class SMTPs
* @param string $CRLF CRLF * @param string $CRLF CRLF
* @return boolean|null True or false * @return boolean|null True or false
*/ */
function socket_send_str($_strSend, $_returnCode = null, $CRLF = "\r\n") public function socket_send_str($_strSend, $_returnCode = null, $CRLF = "\r\n")
{ {
// phpcs:enable // phpcs:enable
if ($this->_debug) $this->log.=$_strSend; // @CHANGE LDR for log if ($this->_debug) $this->log.=$_strSend; // @CHANGE LDR for log
@ -1827,7 +1827,7 @@ class SMTPs
* @param string $_errMsg Error Message * @param string $_errMsg Error Message
* @return void * @return void
*/ */
function _setErr($_errNum, $_errMsg) private function _setErr($_errNum, $_errMsg)
{ {
$this->_smtpsErrors[] = array( $this->_smtpsErrors[] = array(
'num' => $_errNum, 'num' => $_errNum,
@ -1840,7 +1840,7 @@ class SMTPs
* *
* @return string $_errMsg Error Message * @return string $_errMsg Error Message
*/ */
function getErrors() public function getErrors()
{ {
$_errMsg = array(); $_errMsg = array();

View File

@ -42,7 +42,7 @@ abstract class Stats
* @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month * @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
* @return array Array of values * @return array Array of values
*/ */
function getNbByMonthWithPrevYear($endyear, $startyear, $cachedelay = 0, $format = 0) public function getNbByMonthWithPrevYear($endyear, $startyear, $cachedelay = 0, $format = 0)
{ {
global $conf,$user,$langs; global $conf,$user,$langs;
@ -136,7 +136,7 @@ abstract class Stats
* @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month * @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
* @return array Array of values * @return array Array of values
*/ */
function getAmountByMonthWithPrevYear($endyear, $startyear, $cachedelay = 0, $format = 0) public function getAmountByMonthWithPrevYear($endyear, $startyear, $cachedelay = 0, $format = 0)
{ {
global $conf,$user,$langs; global $conf,$user,$langs;
@ -228,7 +228,7 @@ abstract class Stats
* @param int $startyear End year * @param int $startyear End year
* @return array Array of values * @return array Array of values
*/ */
function getAverageByMonthWithPrevYear($endyear, $startyear) public function getAverageByMonthWithPrevYear($endyear, $startyear)
{ {
if ($startyear > $endyear) return -1; if ($startyear > $endyear) return -1;
@ -264,7 +264,7 @@ abstract class Stats
* @param int $cachedelay Delay we accept for cache file (0=No read, no save of cache, -1=No read but save) * @param int $cachedelay Delay we accept for cache file (0=No read, no save of cache, -1=No read but save)
* @return array Array of values * @return array Array of values
*/ */
function getAllByProductEntry($year, $cachedelay = 0) public function getAllByProductEntry($year, $cachedelay = 0)
{ {
global $conf,$user,$langs; global $conf,$user,$langs;
@ -333,14 +333,16 @@ abstract class Stats
// Here we have low level of shared code called by XxxStats.class.php // Here we have low level of shared code called by XxxStats.class.php
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
/** /**
* Return nb of elements by year * Return nb of elements by year
* *
* @param string $sql SQL request * @param string $sql SQL request
* @return array * @return array
*/ */
function _getNbByYear($sql) protected function _getNbByYear($sql)
{ {
// phpcs:enable
$result = array(); $result = array();
dol_syslog(get_class($this).'::'.__FUNCTION__."", LOG_DEBUG); dol_syslog(get_class($this).'::'.__FUNCTION__."", LOG_DEBUG);
@ -363,14 +365,16 @@ abstract class Stats
return $result; return $result;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
/** /**
* Return nb of elements, total amount and avg amount each year * Return nb of elements, total amount and avg amount each year
* *
* @param string $sql SQL request * @param string $sql SQL request
* @return array Array with nb, total amount, average for each year * @return array Array with nb, total amount, average for each year
*/ */
function _getAllByYear($sql) protected function _getAllByYear($sql)
{ {
// phpcs:enable
$result = array(); $result = array();
dol_syslog(get_class($this).'::'.__FUNCTION__."", LOG_DEBUG); dol_syslog(get_class($this).'::'.__FUNCTION__."", LOG_DEBUG);
@ -405,6 +409,7 @@ abstract class Stats
return $result; return $result;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
/** /**
* Renvoie le nombre de proposition par mois pour une annee donnee * Renvoie le nombre de proposition par mois pour une annee donnee
* *
@ -413,8 +418,9 @@ abstract class Stats
* @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month * @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
* @return array Array of nb each month * @return array Array of nb each month
*/ */
function _getNbByMonth($year, $sql, $format = 0) protected function _getNbByMonth($year, $sql, $format = 0)
{ {
// phpcs:enable
global $langs; global $langs;
$result=array(); $result=array();
@ -462,6 +468,7 @@ abstract class Stats
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
/** /**
* Renvoie le nombre d'element par mois pour une annee donnee * Renvoie le nombre d'element par mois pour une annee donnee
* *
@ -470,8 +477,9 @@ abstract class Stats
* @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month * @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
* @return array * @return array
*/ */
function _getAmountByMonth($year, $sql, $format = 0) protected function _getAmountByMonth($year, $sql, $format = 0)
{ {
// phpcs:enable
global $langs; global $langs;
$result=array(); $result=array();
@ -516,6 +524,7 @@ abstract class Stats
return $data; return $data;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
/** /**
* Renvoie le montant moyen par mois pour une annee donnee * Renvoie le montant moyen par mois pour une annee donnee
* *
@ -524,8 +533,9 @@ abstract class Stats
* @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month * @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
* @return array * @return array
*/ */
function _getAverageByMonth($year, $sql, $format = 0) protected function _getAverageByMonth($year, $sql, $format = 0)
{ {
// phpcs:enable
global $langs; global $langs;
$result=array(); $result=array();
@ -570,6 +580,7 @@ abstract class Stats
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
/** /**
* Return number or total of product refs * Return number or total of product refs
* *
@ -577,8 +588,9 @@ abstract class Stats
* @param int $limit Limit * @param int $limit Limit
* @return array * @return array
*/ */
function _getAllByProduct($sql, $limit = 10) protected function _getAllByProduct($sql, $limit = 10)
{ {
// phpcs:enable
global $langs; global $langs;
$result=array(); $result=array();

View File

@ -48,7 +48,7 @@ class Translate
* @param string $dir Force directory that contains /langs subdirectory (value is sometimes '..' like into install/* pages or support/* pages). Use '' by default. * @param string $dir Force directory that contains /langs subdirectory (value is sometimes '..' like into install/* pages or support/* pages). Use '' by default.
* @param Conf $conf Object with Dolibarr configuration * @param Conf $conf Object with Dolibarr configuration
*/ */
function __construct($dir, $conf) public function __construct($dir, $conf)
{ {
if (! empty($conf->file->character_set_client)) $this->charset_output=$conf->file->character_set_client; // If charset output is forced if (! empty($conf->file->character_set_client)) $this->charset_output=$conf->file->character_set_client; // If charset output is forced
if ($dir) $this->dir=array($dir); if ($dir) $this->dir=array($dir);
@ -62,7 +62,7 @@ class Translate
* @param string $srclang Language to use. If '' or 'auto', we use browser lang. * @param string $srclang Language to use. If '' or 'auto', we use browser lang.
* @return void * @return void
*/ */
function setDefaultLang($srclang = 'en_US') public function setDefaultLang($srclang = 'en_US')
{ {
global $conf; global $conf;
@ -132,7 +132,7 @@ class Translate
* @param int $mode 0=Long language code, 1=Short language code (en, fr, es, ...) * @param int $mode 0=Long language code, 1=Short language code (en, fr, es, ...)
* @return string Language code used (en_US, en_AU, fr_FR, ...) * @return string Language code used (en_US, en_AU, fr_FR, ...)
*/ */
function getDefaultLang($mode = 0) public function getDefaultLang($mode = 0)
{ {
if (empty($mode)) return $this->defaultlang; if (empty($mode)) return $this->defaultlang;
else return substr($this->defaultlang, 0, 2); else return substr($this->defaultlang, 0, 2);
@ -145,7 +145,7 @@ class Translate
* @param array $domains Array of lang files to load * @param array $domains Array of lang files to load
* @return int <0 if KO, 0 if already loaded or loading not required, >0 if OK * @return int <0 if KO, 0 if already loaded or loading not required, >0 if OK
*/ */
function loadLangs($domains) public function loadLangs($domains)
{ {
foreach($domains as $domain) foreach($domains as $domain)
{ {
@ -173,7 +173,7 @@ class Translate
* @return int <0 if KO, 0 if already loaded or loading not required, >0 if OK * @return int <0 if KO, 0 if already loaded or loading not required, >0 if OK
* @see loadLangs * @see loadLangs
*/ */
function load($domain, $alt = 0, $stopafterdirection = 0, $forcelangdir = '', $loadfromfileonly = 0) public function load($domain, $alt = 0, $stopafterdirection = 0, $forcelangdir = '', $loadfromfileonly = 0)
{ {
global $conf,$db; global $conf,$db;
@ -399,7 +399,7 @@ class Translate
* @param Database $db Database handler * @param Database $db Database handler
* @return int <0 if KO, 0 if already loaded or loading not required, >0 if OK * @return int <0 if KO, 0 if already loaded or loading not required, >0 if OK
*/ */
function loadFromDatabase($db) public function loadFromDatabase($db)
{ {
global $conf; global $conf;
@ -594,7 +594,7 @@ class Translate
* @param int $maxsize Max length of text * @param int $maxsize Max length of text
* @return string Translated string (encoded into HTML entities and UTF8) * @return string Translated string (encoded into HTML entities and UTF8)
*/ */
function trans($key, $param1 = '', $param2 = '', $param3 = '', $param4 = '', $maxsize = 0) public function trans($key, $param1 = '', $param2 = '', $param3 = '', $param4 = '', $maxsize = 0)
{ {
global $conf; global $conf;
@ -655,7 +655,7 @@ class Translate
* @param string $param5 chaine de param5 * @param string $param5 chaine de param5
* @return string Translated string (encoded into UTF8) * @return string Translated string (encoded into UTF8)
*/ */
function transnoentities($key, $param1 = '', $param2 = '', $param3 = '', $param4 = '', $param5 = '') public function transnoentities($key, $param1 = '', $param2 = '', $param3 = '', $param4 = '', $param5 = '')
{ {
return $this->convToOutputCharset($this->transnoentitiesnoconv($key, $param1, $param2, $param3, $param4, $param5)); return $this->convToOutputCharset($this->transnoentitiesnoconv($key, $param1, $param2, $param3, $param4, $param5));
} }
@ -676,7 +676,7 @@ class Translate
* @param string $param5 chaine de param5 * @param string $param5 chaine de param5
* @return string Translated string * @return string Translated string
*/ */
function transnoentitiesnoconv($key, $param1 = '', $param2 = '', $param3 = '', $param4 = '', $param5 = '') public function transnoentitiesnoconv($key, $param1 = '', $param2 = '', $param3 = '', $param4 = '', $param5 = '')
{ {
global $conf; global $conf;
@ -719,7 +719,7 @@ class Translate
* @param string $countrycode country code (FR, ...) * @param string $countrycode country code (FR, ...)
* @return string translated string * @return string translated string
*/ */
function transcountry($str, $countrycode) public function transcountry($str, $countrycode)
{ {
if ($this->tab_translate["$str$countrycode"]) return $this->trans("$str$countrycode"); if ($this->tab_translate["$str$countrycode"]) return $this->trans("$str$countrycode");
else return $this->trans($str); else return $this->trans($str);
@ -733,7 +733,7 @@ class Translate
* @param string $countrycode country code (FR, ...) * @param string $countrycode country code (FR, ...)
* @return string translated string * @return string translated string
*/ */
function transcountrynoentities($str, $countrycode) public function transcountrynoentities($str, $countrycode)
{ {
if ($this->tab_translate["$str$countrycode"]) return $this->transnoentities("$str$countrycode"); if ($this->tab_translate["$str$countrycode"]) return $this->transnoentities("$str$countrycode");
else return $this->transnoentities($str); else return $this->transnoentities($str);
@ -747,7 +747,7 @@ class Translate
* @param string $pagecodefrom Page code of src string * @param string $pagecodefrom Page code of src string
* @return string Converted string * @return string Converted string
*/ */
function convToOutputCharset($str, $pagecodefrom = 'UTF-8') public function convToOutputCharset($str, $pagecodefrom = 'UTF-8')
{ {
if ($pagecodefrom == 'ISO-8859-1' && $this->charset_output == 'UTF-8') $str=utf8_encode($str); if ($pagecodefrom == 'ISO-8859-1' && $this->charset_output == 'UTF-8') $str=utf8_encode($str);
if ($pagecodefrom == 'UTF-8' && $this->charset_output == 'ISO-8859-1') $str=utf8_decode(str_replace('€', chr(128), $str)); if ($pagecodefrom == 'UTF-8' && $this->charset_output == 'ISO-8859-1') $str=utf8_decode(str_replace('€', chr(128), $str));
@ -755,7 +755,7 @@ class Translate
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return list of all available languages * Return list of all available languages
* *
@ -764,7 +764,7 @@ 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
*/ */
function get_available_languages($langdir = DOL_DOCUMENT_ROOT, $maxlength = 0, $usecode = 0) public function get_available_languages($langdir = DOL_DOCUMENT_ROOT, $maxlength = 0, $usecode = 0)
{ {
// phpcs:enable // phpcs:enable
global $conf; global $conf;
@ -796,7 +796,7 @@ class Translate
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return if a filename $filename exists for current language (or alternate language) * Return if a filename $filename exists for current language (or alternate language)
* *
@ -804,7 +804,7 @@ 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
*/ */
function file_exists($filename, $searchalt = 0) public function file_exists($filename, $searchalt = 0)
{ {
// phpcs:enable // phpcs:enable
// Test si fichier dans repertoire de la langue // Test si fichier dans repertoire de la langue
@ -836,7 +836,7 @@ class Translate
* 10 if setDefaultLang was en_US => ten * 10 if setDefaultLang was en_US => ten
* 123 if setDefaultLang was fr_FR => cent vingt trois * 123 if setDefaultLang was fr_FR => cent vingt trois
*/ */
function getLabelFromNumber($number, $isamount = 0) public function getLabelFromNumber($number, $isamount = 0)
{ {
global $conf; global $conf;
@ -879,7 +879,7 @@ class Translate
* @return string Label in UTF8 (but without entities) * @return string Label in UTF8 (but without entities)
* @see dol_getIdFromCode * @see dol_getIdFromCode
*/ */
function getLabelFromKey($db, $key, $tablename, $fieldkey, $fieldlabel, $keyforselect = '', $filteronentity = 0) public function getLabelFromKey($db, $key, $tablename, $fieldkey, $fieldlabel, $keyforselect = '', $filteronentity = 0)
{ {
// If key empty // If key empty
if ($key == '') return ''; if ($key == '') return '';
@ -931,7 +931,7 @@ class Translate
* @deprecated Use method price to output a price * @deprecated Use method price to output a price
* @see price() * @see price()
*/ */
function getCurrencyAmount($currency_code, $amount) public function getCurrencyAmount($currency_code, $amount)
{ {
$symbol=$this->getCurrencySymbol($currency_code); $symbol=$this->getCurrencySymbol($currency_code);
@ -947,7 +947,7 @@ class Translate
* @param integer $forceloadall 1=Force to load all currencies into cache. We know we need to use all of them. By default read and cache only required currency. * @param integer $forceloadall 1=Force to load all currencies into cache. We know we need to use all of them. By default read and cache only required currency.
* @return string Currency symbol encoded into UTF8 * @return string Currency symbol encoded into UTF8
*/ */
function getCurrencySymbol($currency_code, $forceloadall = 0) public function getCurrencySymbol($currency_code, $forceloadall = 0)
{ {
$currency_sign = ''; // By default return iso code $currency_sign = ''; // By default return iso code
@ -1021,14 +1021,14 @@ class Translate
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* 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
*/ */
function get_translations_for_substitutions() public function get_translations_for_substitutions()
{ {
// phpcs:enable // phpcs:enable
$substitutionarray = array(); $substitutionarray = array();

View File

@ -98,7 +98,7 @@ class vCard
* @param string $type Type * @param string $type Type
* @return void * @return void
*/ */
function setPhoneNumber($number, $type = "") public function setPhoneNumber($number, $type = "")
{ {
// type may be PREF | WORK | HOME | VOICE | FAX | MSG | CELL | PAGER | BBS | CAR | MODEM | ISDN | VIDEO or any senseful combination, e.g. "PREF;WORK;VOICE" // type may be PREF | WORK | HOME | VOICE | FAX | MSG | CELL | PAGER | BBS | CAR | MODEM | ISDN | VIDEO or any senseful combination, e.g. "PREF;WORK;VOICE"
$key = "TEL"; $key = "TEL";
@ -115,7 +115,7 @@ class vCard
* @param string $photo Photo * @param string $photo Photo
* @return void * @return void
*/ */
function setPhoto($type, $photo) public function setPhoto($type, $photo)
{ {
// $type = "GIF" | "JPEG" // $type = "GIF" | "JPEG"
$this->properties["PHOTO;TYPE=$type;ENCODING=BASE64"] = base64_encode($photo); $this->properties["PHOTO;TYPE=$type;ENCODING=BASE64"] = base64_encode($photo);
@ -127,7 +127,7 @@ class vCard
* @param string $name Name * @param string $name Name
* @return void * @return void
*/ */
function setFormattedName($name) public function setFormattedName($name)
{ {
$this->properties["FN;CHARSET=".$this->encoding] = encode($name); $this->properties["FN;CHARSET=".$this->encoding] = encode($name);
} }
@ -142,7 +142,7 @@ class vCard
* @param string $suffix Suffix * @param string $suffix Suffix
* @return void * @return void
*/ */
function setName($family = "", $first = "", $additional = "", $prefix = "", $suffix = "") public function setName($family = "", $first = "", $additional = "", $prefix = "", $suffix = "")
{ {
$this->properties["N;CHARSET=".$this->encoding] = encode($family).";".encode($first).";".encode($additional).";".encode($prefix).";".encode($suffix); $this->properties["N;CHARSET=".$this->encoding] = encode($family).";".encode($first).";".encode($additional).";".encode($prefix).";".encode($suffix);
$this->filename = "$first%20$family.vcf"; $this->filename = "$first%20$family.vcf";
@ -155,7 +155,7 @@ class vCard
* @param timestamp $date Date * @param timestamp $date Date
* @return void * @return void
*/ */
function setBirthday($date) public function setBirthday($date)
{ {
// $date format is YYYY-MM-DD - RFC 2425 and RFC 2426 // $date format is YYYY-MM-DD - RFC 2425 and RFC 2426
$this->properties["BDAY"] = dol_print_date($date, 'dayrfc'); $this->properties["BDAY"] = dol_print_date($date, 'dayrfc');
@ -174,7 +174,7 @@ class vCard
* @param string $type Type * @param string $type Type
* @return void * @return void
*/ */
function setAddress($postoffice = "", $extended = "", $street = "", $city = "", $region = "", $zip = "", $country = "", $type = "HOME;POSTAL") public function setAddress($postoffice = "", $extended = "", $street = "", $city = "", $region = "", $zip = "", $country = "", $type = "HOME;POSTAL")
{ {
// $type may be DOM | INTL | POSTAL | PARCEL | HOME | WORK or any combination of these: e.g. "WORK;PARCEL;POSTAL" // $type may be DOM | INTL | POSTAL | PARCEL | HOME | WORK or any combination of these: e.g. "WORK;PARCEL;POSTAL"
$key = "ADR"; $key = "ADR";
@ -201,7 +201,7 @@ class vCard
* @param string $type Type * @param string $type Type
* @return void * @return void
*/ */
function setLabel($postoffice = "", $extended = "", $street = "", $city = "", $region = "", $zip = "", $country = "", $type = "HOME;POSTAL") public function setLabel($postoffice = "", $extended = "", $street = "", $city = "", $region = "", $zip = "", $country = "", $type = "HOME;POSTAL")
{ {
$label = ""; $label = "";
if ($postoffice!="") $label.= "$postoffice\r\n"; if ($postoffice!="") $label.= "$postoffice\r\n";
@ -222,7 +222,7 @@ class vCard
* @param string $type Vcard type * @param string $type Vcard type
* @return void * @return void
*/ */
function setEmail($address, $type = "internet,pref") public function setEmail($address, $type = "internet,pref")
{ {
$this->properties["EMAIL;TYPE=".$type] = $address; $this->properties["EMAIL;TYPE=".$type] = $address;
} }
@ -233,7 +233,7 @@ class vCard
* @param string $note Note * @param string $note Note
* @return void * @return void
*/ */
function setNote($note) public function setNote($note)
{ {
$this->properties["NOTE;CHARSET=".$this->encoding] = encode($note); $this->properties["NOTE;CHARSET=".$this->encoding] = encode($note);
} }
@ -244,7 +244,7 @@ class vCard
* @param string $title Title * @param string $title Title
* @return void * @return void
*/ */
function setTitle($title) public function setTitle($title)
{ {
$this->properties["TITLE;CHARSET=".$this->encoding] = encode($title); $this->properties["TITLE;CHARSET=".$this->encoding] = encode($title);
} }
@ -256,7 +256,7 @@ class vCard
* @param string $org Org * @param string $org Org
* @return void * @return void
*/ */
function setOrg($org) public function setOrg($org)
{ {
$this->properties["ORG;CHARSET=".$this->encoding] = encode($org); $this->properties["ORG;CHARSET=".$this->encoding] = encode($org);
} }
@ -268,7 +268,7 @@ class vCard
* @param string $prodid Prodid * @param string $prodid Prodid
* @return void * @return void
*/ */
function setProdId($prodid) public function setProdId($prodid)
{ {
$this->properties["PRODID;CHARSET=".$this->encoding] = encode($prodid); $this->properties["PRODID;CHARSET=".$this->encoding] = encode($prodid);
} }
@ -280,7 +280,7 @@ class vCard
* @param string $uid Uid * @param string $uid Uid
* @return void * @return void
*/ */
function setUID($uid) public function setUID($uid)
{ {
$this->properties["UID;CHARSET=".$this->encoding] = encode($uid); $this->properties["UID;CHARSET=".$this->encoding] = encode($uid);
} }
@ -293,7 +293,7 @@ class vCard
* @param string $type Type * @param string $type Type
* @return void * @return void
*/ */
function setURL($url, $type = "") public function setURL($url, $type = "")
{ {
// $type may be WORK | HOME // $type may be WORK | HOME
$key = "URL"; $key = "URL";
@ -306,7 +306,7 @@ class vCard
* *
* @return string * @return string
*/ */
function getVCard() public function getVCard()
{ {
$text = "BEGIN:VCARD\r\n"; $text = "BEGIN:VCARD\r\n";
$text.= "VERSION:3.0\r\n"; $text.= "VERSION:3.0\r\n";
@ -326,7 +326,7 @@ class vCard
* *
* @return string Filename * @return string Filename
*/ */
function getFileName() public function getFileName()
{ {
return $this->filename; return $this->filename;
} }

View File

@ -61,7 +61,7 @@ class doc_generic_product_odt extends ModelePDFProduct
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
global $conf, $langs, $mysoc; global $conf, $langs, $mysoc;
@ -106,7 +106,7 @@ class doc_generic_product_odt extends ModelePDFProduct
* @param Translate $langs Lang object to use for output * @param Translate $langs Lang object to use for output
* @return string Description * @return string Description
*/ */
function info($langs) public function info($langs)
{ {
global $conf, $langs; global $conf, $langs;
@ -205,7 +205,7 @@ class doc_generic_product_odt extends ModelePDFProduct
return $texte; return $texte;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Function to build a document on disk using the generic odt module. * Function to build a document on disk using the generic odt module.
* *
@ -217,7 +217,7 @@ class doc_generic_product_odt extends ModelePDFProduct
* @param int $hideref Do not show ref * @param int $hideref Do not show ref
* @return int 1 if OK, <=0 if KO * @return int 1 if OK, <=0 if KO
*/ */
function write_file($object, $outputlangs, $srctemplatepath, $hidedetails = 0, $hidedesc = 0, $hideref = 0) public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{ {
// phpcs:enable // phpcs:enable
global $product,$langs,$conf,$mysoc,$hookmanager,$user; global $product,$langs,$conf,$mysoc,$hookmanager,$user;

View File

@ -148,7 +148,7 @@ class pdf_standard extends ModelePDFProduct
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Function to build a document on disk using the generic odt module. * Function to build a document on disk using the generic odt module.
* *
@ -160,7 +160,7 @@ class pdf_standard extends ModelePDFProduct
* @param int $hideref Do not show ref * @param int $hideref Do not show ref
* @return int 1 if OK, <=0 if KO * @return int 1 if OK, <=0 if KO
*/ */
function write_file($object, $outputlangs, $srctemplatepath, $hidedetails = 0, $hidedesc = 0, $hideref = 0) public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{ {
// phpcs:enable // phpcs:enable
global $user,$langs,$conf,$mysoc,$db,$hookmanager; global $user,$langs,$conf,$mysoc,$db,$hookmanager;
@ -608,7 +608,7 @@ class pdf_standard extends ModelePDFProduct
* @param string $currency Currency code * @param string $currency Currency code
* @return void * @return void
*/ */
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0, $currency = '') private function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0, $currency = '')
{ {
global $conf; global $conf;
@ -718,7 +718,7 @@ class pdf_standard extends ModelePDFProduct
* @param string $titlekey Translation key to show as title of document * @param string $titlekey Translation key to show as title of document
* @return void * @return void
*/ */
function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $titlekey = "") private function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $titlekey = "")
{ {
global $conf,$langs,$hookmanager; global $conf,$langs,$hookmanager;
@ -867,7 +867,7 @@ class pdf_standard extends ModelePDFProduct
* @param int $hidefreetext 1=Hide free text * @param int $hidefreetext 1=Hide free text
* @return int Return height of bottom margin including footer text * @return int Return height of bottom margin including footer text
*/ */
function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0) private function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0)
{ {
global $conf; global $conf;
$showdetails=$conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS; $showdetails=$conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS;

View File

@ -72,7 +72,7 @@ class mod_codeproduct_elephant extends ModeleProductCode
/** /**
* Constructor * Constructor
*/ */
function __construct() public function __construct()
{ {
$this->code_null = 0; $this->code_null = 0;
$this->code_modifiable = 1; $this->code_modifiable = 1;
@ -83,12 +83,13 @@ class mod_codeproduct_elephant extends ModeleProductCode
} }
/** Return description of module /**
* Return description of module
* *
* @param Translate $langs Object langs * @param Translate $langs Object langs
* @return string Description of module * @return string Description of module
*/ */
function info($langs) public function info($langs)
{ {
global $conf, $mc; global $conf, $mc;
global $form; global $form;
@ -138,7 +139,7 @@ class mod_codeproduct_elephant extends ModeleProductCode
* @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect) * @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect)
* @return string Return string example * @return string Return string example
*/ */
function getExample($langs, $objproduct = 0, $type = -1) public function getExample($langs, $objproduct = 0, $type = -1)
{ {
if ($type == 0 || $type == -1) if ($type == 0 || $type == -1)
{ {
@ -179,7 +180,7 @@ class mod_codeproduct_elephant extends ModeleProductCode
* @param int $type Produit ou service (0:product, 1:service) * @param int $type Produit ou service (0:product, 1:service)
* @return string Value if OK, '' if module not configured, <0 if KO * @return string Value if OK, '' if module not configured, <0 if KO
*/ */
function getNextValue($objproduct = 0, $type = -1) public function getNextValue($objproduct = 0, $type = -1)
{ {
global $db,$conf; global $db,$conf;
@ -219,13 +220,13 @@ class mod_codeproduct_elephant extends ModeleProductCode
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Check if mask/numbering use prefix * Check if mask/numbering use prefix
* *
* @return int 0 or 1 * @return int 0 or 1
*/ */
function verif_prefixIsUsed() public function verif_prefixIsUsed()
{ {
// phpcs:enable // phpcs:enable
global $conf; global $conf;
@ -254,7 +255,7 @@ class mod_codeproduct_elephant extends ModeleProductCode
* -4 ErrorPrefixRequired * -4 ErrorPrefixRequired
* -5 Other (see this->error) * -5 Other (see this->error)
*/ */
function verif($db, &$code, $product, $type) public function verif($db, &$code, $product, $type)
{ {
global $conf; global $conf;
@ -305,7 +306,7 @@ class mod_codeproduct_elephant extends ModeleProductCode
* @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
*/ */
function verif_dispo($db, $code, $product) public function verif_dispo($db, $code, $product)
{ {
// phpcs:enable // phpcs:enable
$sql = "SELECT ref FROM ".MAIN_DB_PREFIX."product"; $sql = "SELECT ref FROM ".MAIN_DB_PREFIX."product";

View File

@ -71,7 +71,7 @@ class mod_codeproduct_leopard extends ModeleProductCode
/** /**
* Constructor * Constructor
*/ */
function __construct() public function __construct()
{ {
$this->code_null = 1; $this->code_null = 1;
$this->code_modifiable = 1; $this->code_modifiable = 1;
@ -81,12 +81,13 @@ class mod_codeproduct_leopard extends ModeleProductCode
} }
/** Return description of module /**
* Return description of module
* *
* @param Translate $langs Object langs * @param Translate $langs Object langs
* @return string Description of module * @return string Description of module
*/ */
function info($langs) public function info($langs)
{ {
$langs->load("companies"); $langs->load("companies");
return $langs->trans("LeopardNumRefModelDesc"); return $langs->trans("LeopardNumRefModelDesc");
@ -100,7 +101,7 @@ class mod_codeproduct_leopard extends ModeleProductCode
* @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect) * @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect)
* @return string Return next value * @return string Return next value
*/ */
function getNextValue($objproduct = 0, $type = -1) public function getNextValue($objproduct = 0, $type = -1)
{ {
global $langs; global $langs;
return ''; return '';
@ -120,7 +121,7 @@ class mod_codeproduct_leopard extends ModeleProductCode
* -3 ErrorProductCodeAlreadyUsed * -3 ErrorProductCodeAlreadyUsed
* -4 ErrorPrefixRequired * -4 ErrorPrefixRequired
*/ */
function verif($db, &$code, $product, $type) public function verif($db, &$code, $product, $type)
{ {
global $conf; global $conf;
@ -131,7 +132,7 @@ class mod_codeproduct_leopard extends ModeleProductCode
{ {
$result=0; $result=0;
} }
elseif (empty($code) && (! $this->code_null || ! empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED)) ) elseif (empty($code) && (! $this->code_null || ! empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED)))
{ {
$result=-2; $result=-2;
} }

View File

@ -47,7 +47,7 @@ abstract class ModelePDFProduct 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
*/ */
static function liste_modeles($db, $maxfilenamelength = 0) public static function liste_modeles($db, $maxfilenamelength = 0)
{ {
// phpcs:enable // phpcs:enable
global $conf; global $conf;
@ -73,7 +73,7 @@ abstract class ModeleProductCode
* @param Translate $langs Object langs * @param Translate $langs Object langs
* @return string Texte descripif * @return string Texte descripif
*/ */
function info($langs) public function info($langs)
{ {
$langs->load("bills"); $langs->load("bills");
return $langs->trans("NoDescription"); return $langs->trans("NoDescription");
@ -84,7 +84,7 @@ abstract class ModeleProductCode
* @param Translate $langs Object langs * @param Translate $langs Object langs
* @return string Nom du module * @return string Nom du module
*/ */
function getNom($langs) public function getNom($langs)
{ {
return empty($this->name)?$this->nom:$this->name; return empty($this->name)?$this->nom:$this->name;
} }
@ -95,7 +95,7 @@ abstract class ModeleProductCode
* @param Translate $langs Object langs * @param Translate $langs Object langs
* @return string Example * @return string Example
*/ */
function getExample($langs) public function getExample($langs)
{ {
$langs->load("bills"); $langs->load("bills");
return $langs->trans("NoExample"); return $langs->trans("NoExample");
@ -106,7 +106,7 @@ abstract class ModeleProductCode
* *
* @return boolean false si conflit, true si ok * @return boolean false si conflit, true si ok
*/ */
function canBeActivated() public function canBeActivated()
{ {
return true; return true;
} }
@ -118,7 +118,7 @@ abstract class ModeleProductCode
* @param int $type Type * @param int $type Type
* @return string Value * @return string Value
*/ */
function getNextValue($objproduct = 0, $type = -1) public function getNextValue($objproduct = 0, $type = -1)
{ {
global $langs; global $langs;
return $langs->trans("Function_getNextValue_InModuleNotWorking"); return $langs->trans("Function_getNextValue_InModuleNotWorking");
@ -129,7 +129,7 @@ abstract class ModeleProductCode
* *
* @return string Version * @return string Version
*/ */
function getVersion() public function getVersion()
{ {
global $langs; global $langs;
$langs->load("admin"); $langs->load("admin");
@ -141,7 +141,7 @@ abstract class ModeleProductCode
return $langs->trans("NotAvailable"); return $langs->trans("NotAvailable");
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Renvoi la liste des modeles de numérotation * Renvoi la liste des modeles de numérotation
* *
@ -149,7 +149,7 @@ abstract class ModeleProductCode
* @param integer $maxfilenamelength Max length of value to show * @param integer $maxfilenamelength Max length of value to show
* @return array List of numbers * @return array List of numbers
*/ */
static function liste_modeles($db, $maxfilenamelength = 0) public static function liste_modeles($db, $maxfilenamelength = 0)
{ {
// phpcs:enable // phpcs:enable
$liste=array(); $liste=array();
@ -182,15 +182,17 @@ abstract class ModeleProductCode
* @param int $type -1=Nothing, 0=Customer, 1=Supplier * @param int $type -1=Nothing, 0=Customer, 1=Supplier
* @return string HTML translated description * @return string HTML translated description
*/ */
function getToolTip($langs, $product, $type) public function getToolTip($langs, $product, $type)
{ {
global $conf; global $conf;
$langs->load("admin"); $langs->load("admin");
$s=''; $s='';
if ($type == -1) $s.=$langs->trans("Name").': <b>'.$this->getNom($langs).'</b><br>'; if ($type == -1) {
if ($type == -1) $s.=$langs->trans("Version").': <b>'.$this->getVersion().'</b><br>'; $s.=$langs->trans("Name").': <b>'.$this->getNom($langs).'</b><br>';
$s.=$langs->trans("Version").': <b>'.$this->getVersion().'</b><br>';
}
if ($type == 0) $s.=$langs->trans("ProductCodeDesc").'<br>'; if ($type == 0) $s.=$langs->trans("ProductCodeDesc").'<br>';
if ($type == 1) $s.=$langs->trans("ServiceCodeDesc").'<br>'; if ($type == 1) $s.=$langs->trans("ServiceCodeDesc").'<br>';
if ($type != -1) $s.=$langs->trans("ValidityControledByModule").': <b>'.$this->getNom($langs).'</b><br>'; if ($type != -1) $s.=$langs->trans("ValidityControledByModule").': <b>'.$this->getNom($langs).'</b><br>';
@ -247,7 +249,7 @@ abstract class ModeleProductCode
* *
* @return int 0=no, 1=yes * @return int 0=no, 1=yes
*/ */
function verif_prefixIsUsed() public function verif_prefixIsUsed()
{ {
// phpcs:enable // phpcs:enable
return 0; return 0;

View File

@ -44,7 +44,7 @@ abstract class ModelePDFProductBatch extends CommonDocGenerator
public $error=''; public $error='';
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return list of active generation modules * Return list of active generation modules
* *
@ -52,12 +52,12 @@ abstract class ModelePDFProductBatch 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
*/ */
static function liste_modeles($db, $maxfilenamelength = 0) public static function liste_modeles($db, $maxfilenamelength = 0)
{ {
// phpcs:enable // phpcs:enable
global $conf; global $conf;
$type='product_batch'; $type = 'product_batch';
$list = array(); $list = array();
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';