36 public $charset_output =
'UTF-8';
38 public $tab_translate = array();
39 private $_tab_loaded = array();
41 public $cache_labels = array();
42 public $cache_currencies = array();
43 private $cache_currencies_all_loaded =
false;
54 if (!empty($conf->file->character_set_client)) {
55 $this->charset_output = $conf->file->character_set_client;
58 $this->dir = array($dir);
60 $this->dir = $conf->file->dol_document_root;
78 if (!empty($conf->global->MAIN_FORCELANGDIR)) {
81 foreach ($conf->file->dol_document_root as $dir) {
82 $newdir = $dir.$conf->global->MAIN_FORCELANGDIR;
83 if (!in_array($newdir, $this->dir)) {
84 $more[
'module_'.$i] = $newdir;
88 $this->dir = array_merge($more, $this->dir);
91 $this->origlang = $srclang;
93 if (empty($srclang) || $srclang ==
'auto') {
95 $langpref = empty($_SERVER[
'HTTP_ACCEPT_LANGUAGE']) ?
'' : $_SERVER[
'HTTP_ACCEPT_LANGUAGE'];
96 $langpref = preg_replace(
"/;([^,]*)/i",
"", $langpref);
97 $langpref = str_replace(
"-",
"_", $langpref);
98 $langlist = preg_split(
"/[;,]/", $langpref);
99 $codetouse = preg_replace(
'/[^_a-zA-Z]/',
'', $langlist[0]);
101 $codetouse = $srclang;
105 $langpart = explode(
"_", $codetouse);
107 if (!empty($langpart[1])) {
109 $longforshort = array(
'ar'=>
'ar_SA');
110 $longforshortexcep = array(
'ar_EG');
111 if (isset($longforshort[strtolower($langpart[0])]) && !in_array($codetouse, $longforshortexcep)) {
112 $srclang = $longforshort[strtolower($langpart[0])];
113 } elseif (!is_numeric($langpart[1])) {
114 $srclang = strtolower($langpart[0]).
"_".strtoupper($langpart[1]);
115 $longforlong = array(
'no_nb'=>
'nb_NO');
116 if (isset($longforlong[strtolower($srclang)])) {
117 $srclang = $longforlong[strtolower($srclang)];
120 $srclang = strtolower($langpart[0]).
"_".strtoupper($langpart[0]);
124 $longforshort = array(
125 'am'=>
'am_ET',
'ar'=>
'ar_SA',
'bn'=>
'bn_DB',
'el'=>
'el_GR',
'ca'=>
'ca_ES',
'cs'=>
'cs_CZ',
'en'=>
'en_US',
'fa'=>
'fa_IR',
126 'gl'=>
'gl_ES',
'he'=>
'he_IL',
'hi'=>
'hi_IN',
'ja'=>
'ja_JP',
127 'ka'=>
'ka_GE',
'km'=>
'km_KH',
'kn'=>
'kn_IN',
'ko'=>
'ko_KR',
'lo'=>
'lo_LA',
'nb'=>
'nb_NO',
'no'=>
'nb_NO',
'ne'=>
'ne_NP',
128 'sl'=>
'sl_SI',
'sq'=>
'sq_AL',
'sr'=>
'sr_RS',
'sv'=>
'sv_SE',
'uk'=>
'uk_UA',
'vi'=>
'vi_VN',
'zh'=>
'zh_CN'
130 if (isset($longforshort[strtolower($langpart[0])])) {
131 $srclang = $longforshort[strtolower($langpart[0])];
132 } elseif (!empty($langpart[0])) {
133 $srclang = strtolower($langpart[0]).
"_".strtoupper($langpart[0]);
139 $this->defaultlang = $srclang;
140 $this->shortlang = substr($srclang, 0, 2);
155 return $this->defaultlang;
157 return substr($this->defaultlang, 0, 2);
170 foreach ($domains as $domain) {
171 $this->
load($domain);
196 public function load($domain, $alt = 0, $stopafterdirection = 0, $forcelangdir =
'', $loadfromfileonly = 0, $forceloadifalreadynotfound = 0)
203 if (empty($domain)) {
207 if ($this->defaultlang ===
'none_NONE') {
213 if (empty($loadfromfileonly) && count($this->tab_translate) == 0) {
218 $newdomain = $domain;
223 if (preg_match(
'/^([^@]+)@([^@]+)$/i', $domain, $regs)) {
224 $newdomain = $regs[1];
225 $modulename = $regs[2];
229 if (!empty($this->_tab_loaded[$newdomain])
230 && ($this->_tab_loaded[$newdomain] != 2 || empty($forceloadifalreadynotfound))) {
236 $langofdir = (empty($forcelangdir) ? $this->defaultlang : $forcelangdir);
239 $langarray = explode(
'_', $langofdir);
240 if ($alt < 1 && isset($langarray[1]) && (strtolower($langarray[0]) == strtolower($langarray[1]) || in_array(strtolower($langofdir), array(
'el_gr')))) {
243 if ($alt < 2 && strtolower($langofdir) ==
'en_us') {
247 if (empty($langofdir)) {
248 dol_syslog(
"Error: ".get_class($this).
"::load was called for domain=".$domain.
" but language was not set yet with langs->setDefaultLang(). Nothing will be loaded.", LOG_WARNING);
252 foreach ($this->dir as $searchdir) {
254 $file_lang = $searchdir.($modulename ?
'/'.$modulename :
'').
"/langs/".$langofdir.
"/".$newdomain.
".lang";
257 $filelangexists = is_file($file_lang_osencoded);
262 if ($filelangexists) {
269 if (!empty($conf->memcached->enabled) && !empty($conf->global->MEMCACHED_SERVER)) {
270 $usecachekey = $newdomain.
'_'.$langofdir.
'_'.md5($file_lang);
271 } elseif (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x02)) {
273 $usecachekey = $newdomain;
280 require_once DOL_DOCUMENT_ROOT.
'/core/lib/memory.lib.php';
282 if (is_array($tmparray) && count($tmparray)) {
283 $this->tab_translate += $tmparray;
294 if ($fp = @fopen($file_lang,
"rt")) {
296 $tabtranslatedomain = array();
304 while ($line = fscanf($fp,
"%[^= ]%*[ =]%[^\n\r]")) {
305 if (isset($line[1])) {
306 list($key, $value) = $line;
309 if (empty($this->tab_translate[$key])) {
310 if ($key ==
'DIRECTION') {
311 if ($alt < 2 || empty($this->tab_translate[$key])) {
312 $this->tab_translate[$key] = $value;
313 if ($stopafterdirection) {
315 } elseif ($usecachekey) {
316 $tabtranslatedomain[$key] = $value;
319 } elseif ($key[0] ==
'#') {
323 $this->tab_translate[$key] = str_replace(array(
'\\n',
'\\\\s'), array(
"\n",
'\s'), $value);
325 $tabtranslatedomain[$key] = $value;
336 if ($usecachekey && count($tabtranslatedomain)) {
337 $ressetcache =
dol_setcache($usecachekey, $tabtranslatedomain);
338 if ($ressetcache < 0) {
339 $error =
'Failed to set cache for usecachekey='.$usecachekey.
' result='.$ressetcache;
344 if (empty($conf->global->MAIN_FORCELANGDIR)) {
356 $langofdir = strtolower($langarray[0]).
'_'.strtoupper($langarray[0]);
357 if ($langofdir ==
'el_EL') {
358 $langofdir =
'el_GR';
360 if ($langofdir ==
'ar_AR') {
361 $langofdir =
'ar_SA';
363 $this->
load($domain, $alt + 1, $stopafterdirection, $langofdir);
370 $langofdir =
'en_US';
371 $this->
load($domain, $alt + 1, $stopafterdirection, $langofdir);
377 $this->_tab_loaded[$newdomain] = 1;
380 if (empty($this->_tab_loaded[$newdomain])) {
381 $this->_tab_loaded[$newdomain] = 2;
387 if (empty($loadfromfileonly)) {
388 $overwritekey =
'MAIN_OVERWRITE_TRANS_'.$this->defaultlang;
389 if (!empty($conf->global->$overwritekey)) {
391 $tmparray = explode(
',', $conf->global->$overwritekey);
392 foreach ($tmparray as $tmp) {
393 $tmparray2 = explode(
':', $tmp);
394 if (!empty($tmparray2[1])) {
395 $this->tab_translate[$tmparray2[0]] = $tmparray2[1];
402 if (!empty($this->tab_translate[
"SeparatorDecimal"]) && !empty($this->tab_translate[
"SeparatorThousand"])
403 && $this->tab_translate[
"SeparatorDecimal"] == $this->tab_translate[
"SeparatorThousand"]) {
404 $this->tab_translate[
"SeparatorThousand"] =
'';
426 $domain =
'database';
435 $newdomain = $domain;
438 if (!empty($this->_tab_loaded[$newdomain])) {
443 $this->_tab_loaded[$newdomain] = 1;
446 $langofdir = $this->defaultlang;
448 if (empty($langofdir)) {
449 dol_syslog(
"Error: ".get_class($this).
"::loadFromDatabase was called but language was not set yet with langs->setDefaultLang(). Nothing will be loaded.", LOG_WARNING);
459 if (!empty($conf->memcached->enabled) && !empty($conf->global->MEMCACHED_SERVER)) {
460 $usecachekey = $newdomain.
'_'.$langofdir;
461 } elseif (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x02)) {
463 $usecachekey = $newdomain;
470 require_once DOL_DOCUMENT_ROOT.
'/core/lib/memory.lib.php';
472 if (is_array($tmparray) && count($tmparray)) {
473 $this->tab_translate += $tmparray;
481 if (!$found && !empty($conf->global->MAIN_ENABLE_OVERWRITE_TRANSLATION)) {
483 $sql =
"SELECT transkey, transvalue FROM ".$db->prefix().
"overwrite_trans where lang='".$db->escape($this->defaultlang).
"' OR lang IS NULL";
484 $sql .=
" AND entity IN (0, ".getEntity(
'overwrite_trans').
")";
485 $sql .= $db->order(
"lang",
"DESC");
486 $resql = $db->query($sql);
489 $num = $db->num_rows(
$resql);
492 $tabtranslatedomain = array();
497 $obj = $db->fetch_object(
$resql);
499 $key = $obj->transkey;
500 $value = $obj->transvalue;
503 if (empty($this->tab_translate[$key])) {
505 $this->tab_translate[$key] = str_replace(array(
'\\n',
'\\\\s'), array(
"\n",
'\s'), $value);
508 $tabtranslatedomain[$key] = $value;
519 if ($usecachekey && count($tabtranslatedomain)) {
520 $ressetcache =
dol_setcache($usecachekey, $tabtranslatedomain);
521 if ($ressetcache < 0) {
522 $error =
'Failed to set cache for usecachekey='.$usecachekey.
' result='.$ressetcache;
533 $this->_tab_loaded[$newdomain] = 1;
536 if (empty($this->_tab_loaded[$newdomain])) {
537 $this->_tab_loaded[$newdomain] = 2;
551 return $this->_tab_loaded[$domain];
569 if (!is_string($key)) {
571 return 'ErrorBadValueForParamNotAString';
576 if (preg_match(
'/^Civility([0-9A-Z]+)$/i', $key, $reg)) {
577 $newstr = $this->
getLabelFromKey($db, $reg[1],
'c_civility',
'code',
'label');
578 } elseif (preg_match(
'/^Currency([A-Z][A-Z][A-Z])$/i', $key, $reg)) {
579 $newstr = $this->
getLabelFromKey($db, $reg[1],
'c_currencies',
'code_iso',
'label');
580 } elseif (preg_match(
'/^SendingMethod([0-9A-Z]+)$/i', $key, $reg)) {
581 $newstr = $this->
getLabelFromKey($db, $reg[1],
'c_shipment_mode',
'code',
'libelle');
582 } elseif (preg_match(
'/^PaymentType(?:Short)?([0-9A-Z]+)$/i', $key, $reg)) {
583 $newstr = $this->
getLabelFromKey($db, $reg[1],
'c_paiement',
'code',
'libelle',
'', 1);
584 } elseif (preg_match(
'/^OppStatus([0-9A-Z]+)$/i', $key, $reg)) {
585 $newstr = $this->
getLabelFromKey($db, $reg[1],
'c_lead_status',
'code',
'label');
586 } elseif (preg_match(
'/^OrderSource([0-9A-Z]+)$/i', $key, $reg)) {
614 public function trans($key, $param1 =
'', $param2 =
'', $param3 =
'', $param4 =
'', $maxsize = 0)
618 if (!empty($this->tab_translate[$key])) {
619 $str = $this->tab_translate[$key];
622 $replacekey =
'MAIN_REPLACE_TRANS_'.$this->defaultlang;
623 if (!empty($conf->global->$replacekey)) {
624 $tmparray = explode(
';', $conf->global->$replacekey);
625 foreach ($tmparray as $tmp) {
626 $tmparray2 = explode(
':', $tmp);
627 $str = preg_replace(
'/'.preg_quote($tmparray2[0]).
'/', $tmparray2[1], $str);
634 array(
'"',
'<b>',
'</b>',
'<u>',
'</u>',
'<i',
'</i>',
'<center>',
'</center>',
'<strong>',
'</strong>',
'<a ',
'</a>',
'<br>',
'<span',
'</span>',
'< ',
'>'),
635 array(
'__quot__',
'__tagb__',
'__tagbend__',
'__tagu__',
'__taguend__',
'__tagi__',
'__tagiend__',
'__tagcenter__',
'__tagcenterend__',
'__tagb__',
'__tagbend__',
'__taga__',
'__tagaend__',
'__tagbr__',
'__tagspan__',
'__tagspanend__',
'__ltspace__',
'__gt__'),
639 if (strpos($key,
'Format') !== 0) {
641 $str = sprintf($str, $param1, $param2, $param3, $param4);
648 $str = htmlentities($str, ENT_COMPAT, $this->charset_output);
652 array(
'__quot__',
'__tagb__',
'__tagbend__',
'__tagu__',
'__taguend__',
'__tagi__',
'__tagiend__',
'__tagcenter__',
'__tagcenterend__',
'__taga__',
'__tagaend__',
'__tagbr__',
'__tagspan__',
'__tagspanend__',
'__ltspace__',
'__gt__'),
653 array(
'"',
'<b>',
'</b>',
'<u>',
'</u>',
'<i',
'</i>',
'<center>',
'</center>',
'<a ',
'</a>',
'<br>',
'<span',
'</span>',
'< ',
'>'),
683 public function transnoentities($key, $param1 =
'', $param2 =
'', $param3 =
'', $param4 =
'', $param5 =
'')
708 if (!empty($this->tab_translate[$key])) {
709 $str = $this->tab_translate[$key];
712 $replacekey =
'MAIN_REPLACE_TRANS_'.$this->defaultlang;
713 if (!empty($conf->global->$replacekey)) {
714 $tmparray = explode(
';', $conf->global->$replacekey);
715 foreach ($tmparray as $tmp) {
716 $tmparray2 = explode(
':', $tmp);
717 $str = preg_replace(
'/'.preg_quote($tmparray2[0]).
'/', $tmparray2[1], $str);
721 if (!preg_match(
'/^Format/', $key)) {
723 $str = sprintf($str, $param1, $param2, $param3, $param4, $param5);
746 if (!empty($this->tab_translate[
"$str$countrycode"])) {
747 return $this->
trans(
"$str$countrycode");
749 return $this->
trans($str);
764 if (!empty($this->tab_translate[
"$str$countrycode"])) {
781 if ($pagecodefrom ==
'ISO-8859-1' && $this->charset_output ==
'UTF-8') {
782 $str = utf8_encode($str);
784 if ($pagecodefrom ==
'UTF-8' && $this->charset_output ==
'ISO-8859-1') {
785 $str = utf8_decode(str_replace(
'€', chr(128), $str));
806 $this->
load(
"languages");
809 $handle = opendir($langdir.
"/langs");
810 $langs_available = array();
811 while ($dir = trim(readdir($handle))) {
813 if (preg_match(
'/^([a-z]+)_([A-Z]+)/i', $dir, $regs)) {
816 $arrayofspecialmainlanguages = array(
845 if (strtolower($regs[1]) != strtolower($regs[2]) && !in_array($dir, $arrayofspecialmainlanguages)) {
850 if (!empty($conf->global->MAIN_LANGUAGES_ALLOWED) && !in_array($dir, explode(
',', $conf->global->MAIN_LANGUAGES_ALLOWED))) {
855 $langs_available[$dir] = $dir;
858 if ($usecode == 1 || !empty($conf->global->MAIN_SHOW_LANGUAGE_CODE)) {
859 $langs_available[$dir] = $dir.
': '.
dol_trunc($this->
trans(
'Language_'.$dir), $maxlength);
861 $langs_available[$dir] = $this->
trans(
'Language_'.$dir);
864 $langs_available[$dir] = str_replace(
' (United States)',
'', $langs_available[$dir]);
868 return $langs_available;
884 foreach ($this->dir as $searchdir) {
885 if (is_readable(
dol_osencode($searchdir.
"/langs/".$this->defaultlang.
"/".$filename))) {
891 if ($this->defaultlang !=
"en_US") {
892 $filenamealt = $searchdir.
"/langs/en_US/".$filename;
920 $newnumber = $number;
922 $dirsubstitutions = array_merge(array(), $conf->modules_parts[
'substitutions']);
923 foreach ($dirsubstitutions as $reldir) {
928 if (!is_dir($newdir)) {
932 $fonc =
'numberwords';
933 if (
file_exists($newdir.
'/functions_'.$fonc.
'.lib.php')) {
934 include_once $newdir.
'/functions_'.$fonc.
'.lib.php';
935 $newnumber = numberwords_getLabelFromNumber($this, $number, $isamount);
959 public function getLabelFromKey($db, $key, $tablename, $fieldkey, $fieldlabel, $keyforselect =
'', $filteronentity = 0)
966 if (preg_match(
'/[^0-9A-Z_]/i', $tablename) || preg_match(
'/[^0-9A-Z_]/i', $fieldkey) || preg_match(
'/[^0-9A-Z_]/i', $fieldlabel)) {
967 $this->error =
'Bad value for parameter tablename, fieldkey or fieldlabel';
975 if ($tmp != $key && $tmp !=
'ErrorBadValueForParamNotAString') {
980 if (isset($this->cache_labels[$tablename][$key])) {
981 return $this->cache_labels[$tablename][$key];
985 $sql =
"SELECT ".$fieldlabel.
" as label";
986 $sql .=
" FROM ".$db->prefix().$tablename;
987 $sql .=
" WHERE ".$fieldkey.
" = '".$db->escape($keyforselect ? $keyforselect : $key).
"'";
988 if ($filteronentity) {
989 $sql .=
" AND entity IN (".getEntity($tablename).
')';
991 dol_syslog(get_class($this).
'::getLabelFromKey', LOG_DEBUG);
992 $resql = $db->query($sql);
994 $obj = $db->fetch_object(
$resql);
996 $this->cache_labels[$tablename][$key] = $obj->label;
998 $this->cache_labels[$tablename][$key] = $key;
1002 return $this->cache_labels[$tablename][$key];
1004 $this->error = $db->lasterror();
1023 if (in_array($currency_code, array(
'USD'))) {
1024 return $symbol.$amount;
1026 return $amount.$symbol;
1040 $currency_sign =
'';
1042 if (function_exists(
"mb_convert_encoding")) {
1045 if (isset($this->cache_currencies[$currency_code]) && !empty($this->cache_currencies[$currency_code][
'unicode']) && is_array($this->cache_currencies[$currency_code][
'unicode'])) {
1046 foreach ($this->cache_currencies[$currency_code][
'unicode'] as $unicode) {
1047 $currency_sign .= mb_convert_encoding(
"&#{$unicode};",
"UTF-8",
'HTML-ENTITIES');
1052 return ($currency_sign ? $currency_sign : $currency_code);
1065 if ($this->cache_currencies_all_loaded) {
1068 if (!empty($currency_code) && isset($this->cache_currencies[$currency_code])) {
1072 $sql =
"SELECT code_iso, label, unicode";
1073 $sql .=
" FROM ".$db->prefix().
"c_currencies";
1074 $sql .=
" WHERE active = 1";
1075 if (!empty($currency_code)) {
1076 $sql .=
" AND code_iso = '".$db->escape($currency_code).
"'";
1080 dol_syslog(get_class($this).
'::loadCacheCurrencies', LOG_DEBUG);
1081 $resql = $db->query($sql);
1083 $this->
load(
"dict");
1085 if (!empty($currency_code)) {
1086 foreach ($this->cache_currencies as $key => $val) {
1087 $label[$key] = $val[
'label'];
1091 $num = $db->num_rows(
$resql);
1094 $obj = $db->fetch_object(
$resql);
1097 $this->cache_currencies[$obj->code_iso][
'label'] = ($obj->code_iso && $this->
trans(
"Currency".$obj->code_iso) !=
"Currency".$obj->code_iso ? $this->
trans(
"Currency".$obj->code_iso) : ($obj->label !=
'-' ? $obj->label :
''));
1098 $this->cache_currencies[$obj->code_iso][
'unicode'] = (array) json_decode((empty($obj->unicode) ?
'' : $obj->unicode),
true);
1099 $label[$obj->code_iso] = $this->cache_currencies[$obj->code_iso][
'label'];
1103 if (empty($currency_code)) {
1104 $this->cache_currencies_all_loaded =
true;
1109 array_multisort($label, SORT_ASC, $this->cache_currencies);
1128 $substitutionarray = array();
1130 foreach ($this->tab_translate as $code => $label) {
1131 $substitutionarray[
'lang_'.$code] = $label;
1132 $substitutionarray[
'__('.$code.
')__'] = $label;
1135 return $substitutionarray;
Class to manage translations.
transnoentities($key, $param1='', $param2='', $param3='', $param4='', $param5='')
Return translated value of a text string If there is no match for this text, we look in alternative f...
transnoentitiesnoconv($key, $param1='', $param2='', $param3='', $param4='', $param5='')
Return translated value of a text string If there is no match for this text, we look in alternative f...
getTradFromKey($key)
Return translated value of key for special keys ("Currency...", "Civility...", ......
getLabelFromNumber($number, $isamount='')
Return full text translated to language label for a key.
getCurrencyAmount($currency_code, $amount)
Return a currency code into its symbol.
get_translations_for_substitutions()
Return an array with content of all loaded translation keys (found into this->tab_translate) so we ge...
getLabelFromKey($db, $key, $tablename, $fieldkey, $fieldlabel, $keyforselect='', $filteronentity=0)
Return a label for a key.
get_available_languages($langdir=DOL_DOCUMENT_ROOT, $maxlength=0, $usecode=0, $mainlangonly=0)
Return list of all available languages.
loadCacheCurrencies($currency_code)
Load into the cache this->cache_currencies, all currencies.
setDefaultLang($srclang='en_US')
Set accessor for this->defaultlang.
file_exists($filename, $searchalt=0)
Return if a filename $filename exists for current language (or alternate language)
transcountry($str, $countrycode)
Return translation of a key depending on country.
isLoaded($domain)
Get information with result of loading data for domain.
load($domain, $alt=0, $stopafterdirection=0, $forcelangdir='', $loadfromfileonly=0, $forceloadifalreadynotfound=0)
Load translation key-value for a particular file, into a memory array.
trans($key, $param1='', $param2='', $param3='', $param4='', $maxsize=0)
Return text translated of text received as parameter (and encode it into HTML) If there is no match f...
transcountrynoentities($str, $countrycode)
Retourne la version traduite du texte passe en parametre complete du code pays.
getCurrencySymbol($currency_code, $forceloadall=0)
Return a currency code into its symbol.
loadLangs($domains)
Load translation files.
convToOutputCharset($str, $pagecodefrom='UTF-8')
Convert a string into output charset (this->charset_output that should be defined to conf->file->char...
loadFromDatabase($db)
Load translation key-value from database into a memory array.
getDefaultLang($mode=0)
Return active language code for current user It's an accessor for this->defaultlang.
__construct($dir, $conf)
Constructor.
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
dol_osencode($str)
Return a string encoded into OS filesystem encoding.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_trunc($string, $size=40, $trunc='right', $stringencoding='UTF-8', $nodot=0, $display=0)
Truncate a string to a particular length adding '…' if string larger than length.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
dol_setcache($memoryid, $data, $expire=0)
Save data into a memory area shared by all users, all sessions on server.
dol_getcache($memoryid)
Read a memory area shared by all users, all sessions on server.