diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php
index 789789bc9e5..ef9ac36f3ef 100644
--- a/htdocs/admin/mails.php
+++ b/htdocs/admin/mails.php
@@ -646,7 +646,7 @@ else
else
{
print '
'.$langs->trans("ServerNotAvailableOnIPOrPort",$server,$port);
- if ($mail->error) print ' - '.$langs->convToOutputCharset($mail->error,'ISO-8859-1');
+ if ($mail->error) print ' - '.$mail->error;
print '
';
}
print '
';
diff --git a/htdocs/admin/sms.php b/htdocs/admin/sms.php
index a63e53006e4..b385bd8ba71 100755
--- a/htdocs/admin/sms.php
+++ b/htdocs/admin/sms.php
@@ -306,7 +306,7 @@ else
else
{
print ''.$langs->trans("ServerNotAvailableOnIPOrPort",$server,$port);
- if ($mail->error) print ' - '.$langs->convToOutputCharset($mail->error,'ISO-8859-1');
+ if ($mail->error) print ' - '.$mail->error;
print '
';
}
print '
';
diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php
index 6b3337c4625..e83256cddec 100644
--- a/htdocs/core/class/CMailFile.class.php
+++ b/htdocs/core/class/CMailFile.class.php
@@ -81,19 +81,19 @@ class CMailFile
/**
* CMailFile
*
- * @param subject Topic/Subject of mail
- * @param to Recipients emails (RFC 2822: "Nom prenom [, ...]" ou "email[, ...]" ou "[, ...]")
- * @param from Sender email (RFC 2822: "Nom prenom [, ...]" ou "email[, ...]" ou "[, ...]")
- * @param msg Message
- * @param filename_list List of files to attach (full path of filename on file system)
- * @param mimetype_list List of MIME type of attached files
- * @param mimefilename_list List of attached file name in message
- * @param addr_cc Email cc
- * @param addr_bcc Email bcc
- * @param deliveryreceipt Ask a delivery receipt
- * @param msgishtml 1=String IS already html, 0=String IS NOT html, -1=Unknown need autodetection
- * @param errors_to Email errors
- * @param css Css option
+ * @param string $subject Topic/Subject of mail
+ * @param string $to Recipients emails (RFC 2822: "Nom prenom [, ...]" ou "email[, ...]" ou "[, ...]")
+ * @param string $from Sender email (RFC 2822: "Nom prenom [, ...]" ou "email[, ...]" ou "[, ...]")
+ * @param string $msg Message
+ * @param array $filename_list List of files to attach (full path of filename on file system)
+ * @param array $mimetype_list List of MIME type of attached files
+ * @param array $mimefilename_list List of attached file name in message
+ * @param string $addr_cc Email cc
+ * @param string $addr_bcc Email bcc
+ * @param int $deliveryreceipt Ask a delivery receipt
+ * @param int $msgishtml 1=String IS already html, 0=String IS NOT html, -1=Unknown need autodetection
+ * @param string $errors_to Email errors
+ * @param string $css Css option
*/
function CMailFile($subject,$to,$from,$msg,
$filename_list=array(),$mimetype_list=array(),$mimefilename_list=array(),
@@ -524,8 +524,8 @@ class CMailFile
/**
* Correct an uncomplete html string
*
- * @param $msg
- * @return
+ * @param string $msg String
+ * @return string Completed string
*/
function checkIfHTML($msg)
{
@@ -615,9 +615,9 @@ class CMailFile
/**
* Create header MIME (mode = 'mail')
*
- * @param filename_list
- * @param mimefilename_list
- * @return mime headers
+ * @param array $filename_list Array of filenames
+ * @param array $mimefilename_list Array of mime types
+ * @return array mime headers
*/
function write_mimeheaders($filename_list, $mimefilename_list)
{
@@ -644,7 +644,8 @@ class CMailFile
/**
* Return email content (mode = 'mail')
*
- * @param msgtext
+ * @param string $msgtext Message string
+ * @return string String content
*/
function write_body($msgtext)
{
@@ -675,7 +676,7 @@ class CMailFile
}
// Make RFC821 Compliant, replace bare linefeeds
- $strContent = preg_replace("/(?error = 'Error '.$errno.' - '.$errstr;
+ $this->error = utf8_check('Error '.$errno.' - '.$errstr)?'Error '.$errno.' - '.$errstr:utf8_encode('Error '.$errno.' - '.$errstr);
}
}
return $_retVal;
@@ -823,9 +826,9 @@ class CMailFile
* This function has been modified as provided by SirSir to allow multiline responses when
* using SMTP Extensions.
*
- * @param socket
- * @param response
- * @return boolean
+ * @param Socket $socket Socket
+ * @param string $response Response string
+ * @return boolean true if success
*/
function server_parse($socket, $response)
{
@@ -853,8 +856,8 @@ class CMailFile
/**
* Seearch images into html message and init array this->images_encoded if found
*
- * @param images_dir Location of physical images files
- * @return int >0 if OK, <0 if KO
+ * @param string $images_dir Location of physical images files
+ * @return int >0 if OK, <0 if KO
*/
function findHtmlImages($images_dir)
{
@@ -943,11 +946,11 @@ class CMailFile
/**
* Return an address for SMTP protocol
*
- * @param adresses Example: 'John Doe ' or 'john@doe.com'
- * @param format 0=Auto, 1=emails with <>, 2=emails without <>
- * @param encode 1=Encode name to RFC2822
- * @return string If format 1: '' or 'John Doe '
- * If format 2: 'john@doe.com'
+ * @param string $adresses Example: 'John Doe ' or 'john@doe.com'
+ * @param int $format 0=Auto, 1=emails with <>, 2=emails without <>
+ * @param int $encode 1=Encode name to RFC2822
+ * @return string If format 1: '' or 'John Doe '
+ * If format 2: 'john@doe.com'
*/
function getValidAddress($adresses,$format,$encode='')
{
diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php
index 626837b3d57..3f8de69c230 100644
--- a/htdocs/core/class/translate.class.php
+++ b/htdocs/core/class/translate.class.php
@@ -49,8 +49,8 @@ class Translate {
/**
* Constructor
*
- * @param dir Force directory that contains /langs subdirectory (value is sometine '..' like into install/* pages or support/* pages).
- * @param conf Object with Dolibarr configuration
+ * @param string $dir Force directory that contains /langs subdirectory (value is sometine '..' like into install/* pages or support/* pages).
+ * @param Conf $conf Object with Dolibarr configuration
*/
function Translate($dir = "",$conf)
{
@@ -63,7 +63,7 @@ class Translate {
/**
* Set accessor for this->defaultlang
*
- * @param srclang Language to use
+ * @param string $srclang Language to use
*/
function setDefaultLang($srclang='fr_FR')
{
@@ -129,8 +129,8 @@ class Translate {
* Return active language code for current user
* It's an accessor for this->defaultlang
*
- * @param mode 0=Long language code, 1=Short language code
- * @return string Language code used (en_US, en_AU, fr_FR, ...)
+ * @param int $mode 0=Long language code, 1=Short language code
+ * @return string Language code used (en_US, en_AU, fr_FR, ...)
*/
function getDefaultLang($mode=0)
{
@@ -337,8 +337,8 @@ class Translate {
* WARNING: To avoid infinite loop (getLabelFromKey->transnoentities->getTradFromKey), getLabelFromKey must
* not be called with same value than input.
*
- * @param key
- * @return string
+ * @param string $key Key to translate
+ * @return string Translated string
*/
function getTradFromKey($key)
{
@@ -379,13 +379,13 @@ class Translate {
* et si toujours pas trouve, il est retourne tel quel
* Les parametres de cette methode peuvent contenir de balises HTML.
*
- * @param key cle de chaine a traduire
- * @param param1 chaine de param1
- * @param param2 chaine de param2
- * @param param3 chaine de param3
- * @param param4 chaine de param4
- * @param maxsize taille max
- * @return string Chaine traduite et code en HTML
+ * @param string $key Key to translate
+ * @param string $param1 chaine de param1
+ * @param string $param2 chaine de param2
+ * @param string $param3 chaine de param3
+ * @param string $param4 chaine de param4
+ * @param int $maxsize taille max
+ * @return string Translated string (encoded into HTML entities and UTF8)
*/
function trans($key, $param1='', $param2='', $param3='', $param4='', $maxsize=0)
{
@@ -400,7 +400,7 @@ class Translate {
// We replace some HTML tags by __xx__ to avoid having them encoded by htmlentities
$str=str_replace(array('<','>','"',),array('__lt__','__gt__','__quot__'),$str);
- $str=$this->convToOutputCharset($str); // Convert string to $this->charset_output
+ //$str=$this->convToOutputCharset($str); // Convert string to $this->charset_output
// Crypt string into HTML
// $str est une chaine stockee en memoire au format $this->charset_output
@@ -413,7 +413,7 @@ class Translate {
else // Translation is not available
{
$str=$this->getTradFromKey($key);
- return $this->convToOutputCharset($str);
+ //return $this->convToOutputCharset($str);
}
}
diff --git a/htdocs/paybox/lib/paybox.lib.php b/htdocs/paybox/lib/paybox.lib.php
index 9182ed82d74..dd1b627a28d 100755
--- a/htdocs/paybox/lib/paybox.lib.php
+++ b/htdocs/paybox/lib/paybox.lib.php
@@ -258,7 +258,7 @@ function html_print_paybox_footer($fromcompany,$langs)
$line1="";
if ($fromcompany->forme_juridique_code)
{
- $line1.=($line1?" - ":"").$langs->convToOutputCharset(getFormeJuridiqueLabel($fromcompany->forme_juridique_code));
+ $line1.=($line1?" - ":"").getFormeJuridiqueLabel($fromcompany->forme_juridique_code);
}
// Capital
if ($fromcompany->capital)
@@ -270,14 +270,14 @@ function html_print_paybox_footer($fromcompany,$langs)
{
$field=$langs->transcountrynoentities("ProfId1",$fromcompany->pays_code);
if (preg_match('/\((.*)\)/i',$field,$reg)) $field=$reg[1];
- $line1.=($line1?" - ":"").$field.": ".$langs->convToOutputCharset($fromcompany->idprof1);
+ $line1.=($line1?" - ":"").$field.": ".$fromcompany->idprof1;
}
// Prof Id 2
if ($fromcompany->idprof2)
{
$field=$langs->transcountrynoentities("ProfId2",$fromcompany->pays_code);
if (preg_match('/\((.*)\)/i',$field,$reg)) $field=$reg[1];
- $line1.=($line1?" - ":"").$field.": ".$langs->convToOutputCharset($fromcompany->idprof2);
+ $line1.=($line1?" - ":"").$field.": ".$fromcompany->idprof2;
}
// Second line of company infos
@@ -287,19 +287,19 @@ function html_print_paybox_footer($fromcompany,$langs)
{
$field=$langs->transcountrynoentities("ProfId3",$fromcompany->pays_code);
if (preg_match('/\((.*)\)/i',$field,$reg)) $field=$reg[1];
- $line2.=($line2?" - ":"").$field.": ".$langs->convToOutputCharset($fromcompany->idprof3);
+ $line2.=($line2?" - ":"").$field.": ".$fromcompany->idprof3;
}
// Prof Id 4
if ($fromcompany->idprof4)
{
$field=$langs->transcountrynoentities("ProfId4",$fromcompany->pays_code);
if (preg_match('/\((.*)\)/i',$field,$reg)) $field=$reg[1];
- $line2.=($line2?" - ":"").$field.": ".$langs->convToOutputCharset($fromcompany->idprof4);
+ $line2.=($line2?" - ":"").$field.": ".$fromcompany->idprof4;
}
// IntraCommunautary VAT
if ($fromcompany->tva_intra != '')
{
- $line2.=($line2?" - ":"").$langs->transnoentities("VATIntraShort").": ".$langs->convToOutputCharset($fromcompany->tva_intra);
+ $line2.=($line2?" - ":"").$langs->transnoentities("VATIntraShort").": ".$fromcompany->tva_intra;
}
print '
'."\n";
diff --git a/htdocs/paypal/lib/paypal.lib.php b/htdocs/paypal/lib/paypal.lib.php
index 0797bbb78d8..06270d06e64 100755
--- a/htdocs/paypal/lib/paypal.lib.php
+++ b/htdocs/paypal/lib/paypal.lib.php
@@ -86,7 +86,7 @@ function html_print_paypal_footer($fromcompany,$langs)
$line1="";
if ($fromcompany->forme_juridique_code)
{
- $line1.=($line1?" - ":"").$langs->convToOutputCharset(getFormeJuridiqueLabel($fromcompany->forme_juridique_code));
+ $line1.=($line1?" - ":"").getFormeJuridiqueLabel($fromcompany->forme_juridique_code);
}
// Capital
if ($fromcompany->capital)
@@ -98,14 +98,14 @@ function html_print_paypal_footer($fromcompany,$langs)
{
$field=$langs->transcountrynoentities("ProfId1",$fromcompany->pays_code);
if (preg_match('/\((.*)\)/i',$field,$reg)) $field=$reg[1];
- $line1.=($line1?" - ":"").$field.": ".$langs->convToOutputCharset($fromcompany->idprof1);
+ $line1.=($line1?" - ":"").$field.": ".$fromcompany->idprof1;
}
// Prof Id 2
if ($fromcompany->idprof2)
{
$field=$langs->transcountrynoentities("ProfId2",$fromcompany->pays_code);
if (preg_match('/\((.*)\)/i',$field,$reg)) $field=$reg[1];
- $line1.=($line1?" - ":"").$field.": ".$langs->convToOutputCharset($fromcompany->idprof2);
+ $line1.=($line1?" - ":"").$field.": ".$fromcompany->idprof2;
}
// Second line of company infos
@@ -115,19 +115,19 @@ function html_print_paypal_footer($fromcompany,$langs)
{
$field=$langs->transcountrynoentities("ProfId3",$fromcompany->pays_code);
if (preg_match('/\((.*)\)/i',$field,$reg)) $field=$reg[1];
- $line2.=($line2?" - ":"").$field.": ".$langs->convToOutputCharset($fromcompany->idprof3);
+ $line2.=($line2?" - ":"").$field.": ".$fromcompany->idprof3;
}
// Prof Id 4
if ($fromcompany->idprof4)
{
$field=$langs->transcountrynoentities("ProfId4",$fromcompany->pays_code);
if (preg_match('/\((.*)\)/i',$field,$reg)) $field=$reg[1];
- $line2.=($line2?" - ":"").$field.": ".$langs->convToOutputCharset($fromcompany->idprof4);
+ $line2.=($line2?" - ":"").$field.": ".$fromcompany->idprof4;
}
// IntraCommunautary VAT
if ($fromcompany->tva_intra != '')
{
- $line2.=($line2?" - ":"").$langs->transnoentities("VATIntraShort").": ".$langs->convToOutputCharset($fromcompany->tva_intra);
+ $line2.=($line2?" - ":"").$langs->transnoentities("VATIntraShort").": ".$fromcompany->tva_intra;
}
print '
'."\n";
@@ -156,7 +156,7 @@ function paypaladmin_prepare_head()
$h++;
$object=(object) array();
-
+
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab