mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-24 02:11:27 +01:00
Add patch to choose separator in phone output
This commit is contained in:
@@ -96,36 +96,36 @@ function dol_string_unaccent($str)
|
|||||||
{
|
{
|
||||||
$string = rawurlencode($str);
|
$string = rawurlencode($str);
|
||||||
$replacements = array(
|
$replacements = array(
|
||||||
'%C3%80' => 'A','%C3%81' => 'A',
|
'%C3%80' => 'A','%C3%81' => 'A',
|
||||||
'%C3%88' => 'E','%C3%89' => 'E',
|
'%C3%88' => 'E','%C3%89' => 'E',
|
||||||
'%C3%8C' => 'I','%C3%8D' => 'I',
|
'%C3%8C' => 'I','%C3%8D' => 'I',
|
||||||
'%C3%92' => 'O','%C3%93' => 'O',
|
'%C3%92' => 'O','%C3%93' => 'O',
|
||||||
'%C3%99' => 'U','%C3%9A' => 'U',
|
'%C3%99' => 'U','%C3%9A' => 'U',
|
||||||
'%C3%A0' => 'a','%C3%A1' => 'a','%C3%A2' => 'a',
|
'%C3%A0' => 'a','%C3%A1' => 'a','%C3%A2' => 'a',
|
||||||
'%C3%A8' => 'e','%C3%A9' => 'e','%C3%AA' => 'e','%C3%AB' => 'e',
|
'%C3%A8' => 'e','%C3%A9' => 'e','%C3%AA' => 'e','%C3%AB' => 'e',
|
||||||
'%C3%AC' => 'i','%C3%AD' => 'i',
|
'%C3%AC' => 'i','%C3%AD' => 'i',
|
||||||
'%C3%B2' => 'o','%C3%B3' => 'o',
|
'%C3%B2' => 'o','%C3%B3' => 'o',
|
||||||
'%C3%B9' => 'u','%C3%BA' => 'u'
|
'%C3%B9' => 'u','%C3%BA' => 'u'
|
||||||
);
|
);
|
||||||
$string=strtr($string, $replacements);
|
$string=strtr($string, $replacements);
|
||||||
return rawurldecode($string);
|
return rawurldecode($string);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$string = strtr($str,
|
$string = strtr($str,
|
||||||
"xC0\xC1\xC2\xC3\xC5\xC7
|
"xC0\xC1\xC2\xC3\xC5\xC7
|
||||||
\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1
|
\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1
|
||||||
\xD2\xD3\xD4\xD5\xD8\xD9\xDA\xDB\xDD
|
\xD2\xD3\xD4\xD5\xD8\xD9\xDA\xDB\xDD
|
||||||
\xE0\xE1\xE2\xE3\xE5\xE7\xE8\xE9\xEA\xEB
|
\xE0\xE1\xE2\xE3\xE5\xE7\xE8\xE9\xEA\xEB
|
||||||
\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF8
|
\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF8
|
||||||
\xF9\xFA\xFB\xFD\xFF",
|
\xF9\xFA\xFB\xFD\xFF",
|
||||||
"AAAAAC
|
"AAAAAC
|
||||||
EEEEIIIIDN
|
EEEEIIIIDN
|
||||||
OOOOOUUUY
|
OOOOOUUUY
|
||||||
aaaaaceeee
|
aaaaaceeee
|
||||||
iiiidnooooo
|
iiiidnooooo
|
||||||
uuuyy");
|
uuuyy");
|
||||||
$string = strtr($string, array("\xC4"=>"Ae", "\xC6"=>"AE", "\xD6"=>"Oe", "\xDC"=>"Ue", "\xDE"=>"TH", "\xDF"=>"ss", "\xE4"=>"ae", "\xE6"=>"ae", "\xF6"=>"oe", "\xFC"=>"ue", "\xFE"=>"th"));
|
$string = strtr($string, array("\xC4"=>"Ae", "\xC6"=>"AE", "\xD6"=>"Oe", "\xDC"=>"Ue", "\xDE"=>"TH", "\xDF"=>"ss", "\xE4"=>"ae", "\xE6"=>"ae", "\xF6"=>"oe", "\xFC"=>"ue", "\xFE"=>"th"));
|
||||||
return $string;
|
return $string;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -712,15 +712,16 @@ function dolibarr_print_object_info($object)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Format phone numbers according to country
|
* \brief Format phone numbers according to country
|
||||||
* \param phone Phone number to format
|
* \param phone Phone number to format
|
||||||
* \param country Country to use for formatting
|
* \param country Country to use for formatting
|
||||||
* \param cid Id of contact if known
|
* \param cid Id of contact if known
|
||||||
* \param socid Id of third party if known
|
* \param socid Id of third party if known
|
||||||
* \param nolinks true means no HTML links is added
|
* \param nolinks true means no HTML links is added
|
||||||
* \return string Formated phone number
|
* \param separ separation between numbers for a better visibility example : xx.xx.xx.xx.xx
|
||||||
|
* \return string Formated phone number
|
||||||
*/
|
*/
|
||||||
function dolibarr_print_phone($phone,$country="FR",$cid=0,$socid=0,$nolinks=false)
|
function dolibarr_print_phone($phone,$country="FR",$cid=0,$socid=0,$nolinks=false,$separ=" ")
|
||||||
{
|
{
|
||||||
global $conf,$user;
|
global $conf,$user;
|
||||||
|
|
||||||
@@ -731,25 +732,24 @@ function dolibarr_print_phone($phone,$country="FR",$cid=0,$socid=0,$nolinks=fals
|
|||||||
if (strtoupper($country) == "FR")
|
if (strtoupper($country) == "FR")
|
||||||
{
|
{
|
||||||
// France
|
// France
|
||||||
if (strlen($newphone) == 10) {
|
if (strlen($phone) == 10) {
|
||||||
$newphone=substr($newphone,0,2)." ".substr($newphone,2,2)." ".substr($newphone,4,2)." ".substr($newphone,6,2)." ".substr($newphone,8,2);
|
$newphone=substr($newphone,0,2).$separ.substr($newphone,2,2).$separ.substr($newphone,4,2).$separ.substr($newphone,6,2).$separ.substr($newphone,8,2);
|
||||||
}
|
}
|
||||||
elseif (strlen($newphone) == 7)
|
elseif (strlen($newphone) == 7)
|
||||||
{
|
{
|
||||||
|
$newphone=substr($newphone,0,3).$separ.substr($newphone,3,2).$separ.substr($newphone,5,2);
|
||||||
$newphone=substr($newphone,0,3)." ".substr($newphone,3,2)." ".substr($newphone,5,2);
|
|
||||||
}
|
}
|
||||||
elseif (strlen($newphone) == 9)
|
elseif (strlen($newphone) == 9)
|
||||||
{
|
{
|
||||||
$newphone=substr($newphone,0,2)." ".substr($newphone,2,3)." ".substr($newphone,5,2)." ".substr($newphone,7,2);
|
$newphone=substr($newphone,0,2).$separ.substr($newphone,2,3).$separ.substr($newphone,5,2).$separ.substr($newphone,7,2);
|
||||||
}
|
}
|
||||||
elseif (strlen($newphone) == 11)
|
elseif (strlen($newphone) == 11)
|
||||||
{
|
{
|
||||||
$newphone=substr($newphone,0,3)." ".substr($newphone,3,2)." ".substr($newphone,5,2)." ".substr($newphone,7,2)." ".substr($newphone,9,2);
|
$newphone=substr($newphone,0,3).$separ.substr($newphone,3,2).$separ.substr($newphone,5,2).$separ.substr($newphone,7,2).$separ.substr($newphone,9,2);
|
||||||
}
|
}
|
||||||
elseif (strlen($newphone) == 12)
|
elseif (strlen($newphone) == 12)
|
||||||
{
|
{
|
||||||
$newphone=substr($newphone,0,4)." ".substr($newphone,4,2)." ".substr($newphone,6,2)." ".substr($newphone,8,2)." ".substr($newphone,10,2);
|
$newphone=substr($newphone,0,4).$separ.substr($newphone,4,2).$separ.substr($newphone,6,2).$separ.substr($newphone,8,2).$separ.substr($newphone,10,2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2578,10 +2578,10 @@ function measuring_units_string($unit,$measuring_style='')
|
|||||||
}
|
}
|
||||||
else if ($measuring_style == 'size')
|
else if ($measuring_style == 'size')
|
||||||
{
|
{
|
||||||
$measuring_units[0] = $langs->trans("SizeUnitm");
|
$measuring_units[0] = $langs->trans("SizeUnitm");
|
||||||
$measuring_units[-1] = $langs->trans("SizeUnitdm");
|
$measuring_units[-1] = $langs->trans("SizeUnitdm");
|
||||||
$measuring_units[-2] = $langs->trans("SizeUnitcm");
|
$measuring_units[-2] = $langs->trans("SizeUnitcm");
|
||||||
$measuring_units[-3] = $langs->trans("SizeUnitmm");
|
$measuring_units[-3] = $langs->trans("SizeUnitmm");
|
||||||
}
|
}
|
||||||
|
|
||||||
return $measuring_units[$unit];
|
return $measuring_units[$unit];
|
||||||
@@ -3169,13 +3169,13 @@ function get_prospect_state_selection()
|
|||||||
$sts = array(-1,0,1,2,3);
|
$sts = array(-1,0,1,2,3);
|
||||||
|
|
||||||
if (isSet($_POST["nouvel_etat"]))
|
if (isSet($_POST["nouvel_etat"]))
|
||||||
return $_POST["nouvel_etat"];
|
return $_POST["nouvel_etat"];
|
||||||
else if (isSet($_GET["nouvel_etat"]))
|
else if (isSet($_GET["nouvel_etat"]))
|
||||||
return $_GET["nouvel_etat"];
|
return $_GET["nouvel_etat"];
|
||||||
else if (isSet($_REQUEST["nouvel_etat"]))
|
else if (isSet($_REQUEST["nouvel_etat"]))
|
||||||
return $_REQUEST["nouvel_etat"];
|
return $_REQUEST["nouvel_etat"];
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
Reference in New Issue
Block a user