621function GETPOST($paramname, $check =
'alphanohtml', $method = 0, $filter =
null, $options =
null, $noreplace = 0)
623 global $mysoc, $user, $conf;
625 if (empty($paramname)) {
626 return 'BadFirstParameterForGETPOST';
629 dol_syslog(
"Deprecated use of GETPOST, called with 1st param = ".$paramname.
" and a 2nd param that is '', when calling page ".$_SERVER[
"PHP_SELF"], LOG_WARNING);
634 if (empty($method)) {
635 $out = isset($_GET[$paramname]) ? $_GET[$paramname] : (isset($_POST[$paramname]) ? $_POST[$paramname] :
'');
636 } elseif ($method == 1) {
637 $out = isset($_GET[$paramname]) ? $_GET[$paramname] :
'';
638 } elseif ($method == 2) {
639 $out = isset($_POST[$paramname]) ? $_POST[$paramname] :
'';
640 } elseif ($method == 3) {
641 $out = isset($_POST[$paramname]) ? $_POST[$paramname] : (isset($_GET[$paramname]) ? $_GET[$paramname] :
'');
643 return 'BadThirdParameterForGETPOST';
646 if (empty($method) || $method == 3 || $method == 4) {
647 $relativepathstring = (empty($_SERVER[
"PHP_SELF"]) ?
'' : $_SERVER[
"PHP_SELF"]);
649 if (constant(
'DOL_URL_ROOT')) {
650 $relativepathstring = preg_replace(
'/^'.preg_quote(constant(
'DOL_URL_ROOT'),
'/').
'/',
'', $relativepathstring);
652 $relativepathstring = preg_replace(
'/^\//',
'', $relativepathstring);
653 $relativepathstring = preg_replace(
'/^custom\//',
'', $relativepathstring);
659 if (!empty($_GET[
'restore_lastsearch_values'])) {
660 if (!empty($_SESSION[
'lastsearch_values_'.$relativepathstring])) {
661 $tmp = json_decode($_SESSION[
'lastsearch_values_'.$relativepathstring],
true);
662 if (is_array($tmp)) {
663 foreach ($tmp as $key => $val) {
664 if ($key == $paramname) {
672 if ($paramname ==
'contextpage' && !empty($_SESSION[
'lastsearch_contextpage_'.$relativepathstring])) {
673 $out = $_SESSION[
'lastsearch_contextpage_'.$relativepathstring];
674 } elseif ($paramname ==
'limit' && !empty($_SESSION[
'lastsearch_limit_'.$relativepathstring])) {
675 $out = $_SESSION[
'lastsearch_limit_'.$relativepathstring];
676 } elseif ($paramname ==
'page' && !empty($_SESSION[
'lastsearch_page_'.$relativepathstring])) {
677 $out = $_SESSION[
'lastsearch_page_'.$relativepathstring];
678 } elseif ($paramname ==
'mode' && !empty($_SESSION[
'lastsearch_mode_'.$relativepathstring])) {
679 $out = $_SESSION[
'lastsearch_mode_'.$relativepathstring];
681 } elseif (!isset($_GET[
'sortfield'])) {
684 if (!empty($_GET[
'action']) && $_GET[
'action'] ==
'create' && !isset($_GET[$paramname]) && !isset($_POST[$paramname])) {
687 if (is_object($object) && isset($object->fields[$paramname][
'default'])) {
688 $out = $object->fields[$paramname][
'default'];
692 if (!empty($_GET[
'action']) && (preg_match(
'/^create/', $_GET[
'action']) || preg_match(
'/^presend/', $_GET[
'action'])) && !isset($_GET[$paramname]) && !isset($_POST[$paramname])) {
694 if (!empty($user->default_values)) {
695 if (isset($user->default_values[$relativepathstring][
'createform'])) {
696 foreach ($user->default_values[$relativepathstring][
'createform'] as $defkey => $defval) {
698 if ($defkey !=
'_noquery_') {
699 $tmpqueryarraytohave = explode(
'&', $defkey);
702 foreach ($tmpqueryarraytohave as $tmpquerytohave) {
703 if (!in_array($tmpquerytohave, $tmpqueryarraywehave)) {
716 if (isset($user->default_values[$relativepathstring][
'createform'][$defkey][$paramname])) {
717 $out = $user->default_values[$relativepathstring][
'createform'][$defkey][$paramname];
724 } elseif (!empty($paramname) && !isset($_GET[$paramname]) && !isset($_POST[$paramname])) {
726 if (!empty($user->default_values)) {
729 if ($paramname ==
'sortfield' || $paramname ==
'sortorder') {
731 if (isset($user->default_values[$relativepathstring][
'sortorder'])) {
733 foreach ($user->default_values[$relativepathstring][
'sortorder'] as $defkey => $defval) {
735 if ($defkey !=
'_noquery_') {
736 $tmpqueryarraytohave = explode(
'&', $defkey);
739 foreach ($tmpqueryarraytohave as $tmpquerytohave) {
740 if (!in_array($tmpquerytohave, $tmpqueryarraywehave)) {
753 $forbidden_chars_to_replace = array(
" ",
"'",
"/",
"\\",
":",
"*",
"?",
"\"",
"<",
">",
"|",
"[",
"]",
";",
"=");
754 foreach ($user->default_values[$relativepathstring][
'sortorder'][$defkey] as $key => $val) {
758 if ($paramname ==
'sortfield') {
761 if ($paramname ==
'sortorder') {
769 } elseif (isset($user->default_values[$relativepathstring][
'filters'])) {
770 foreach ($user->default_values[$relativepathstring][
'filters'] as $defkey => $defval) {
771 if (!empty($_GET[
'disabledefaultvalues'])) {
775 if ($defkey !=
'_noquery_') {
776 $tmpqueryarraytohave = explode(
'&', $defkey);
779 foreach ($tmpqueryarraytohave as $tmpquerytohave) {
780 if (!in_array($tmpquerytohave, $tmpqueryarraywehave)) {
792 if ($qualified && isset($user->default_values[$relativepathstring][
'filters'][$defkey][$paramname])) {
794 if (isset($_POST[
'sall']) || isset($_POST[
'search_all']) || isset($_GET[
'sall']) || isset($_GET[
'search_all'])) {
797 $forbidden_chars_to_replace = array(
" ",
"'",
"/",
"\\",
":",
"*",
"?",
"\"",
"<",
">",
"|",
"[",
"]",
";",
"=");
798 $out =
dol_string_nospecial($user->default_values[$relativepathstring][
'filters'][$defkey][$paramname],
'', $forbidden_chars_to_replace);
801 $forbidden_chars_to_replace = array(
" ",
"'",
"/",
"\\",
":",
"*",
"?",
"\"",
"<",
">",
"|",
"[",
"]",
";",
"=");
802 $out =
dol_string_nospecial($user->default_values[$relativepathstring][
'filters'][$defkey][$paramname],
'', $forbidden_chars_to_replace);
817 if (!is_array($out) && empty($_POST[$paramname]) && empty($noreplace)) {
821 while (preg_match(
'/__([A-Z0-9]+_?[A-Z0-9]+)__/i', $out, $reg) && ($loopnb < $maxloop)) {
825 if ($reg[1] ==
'DAY') {
827 $newout = $tmp[
'mday'];
828 } elseif ($reg[1] ==
'MONTH') {
830 $newout = $tmp[
'mon'];
831 } elseif ($reg[1] ==
'YEAR') {
833 $newout = $tmp[
'year'];
834 } elseif ($reg[1] ==
'PREVIOUS_DAY') {
837 $newout = $tmp2[
'day'];
838 } elseif ($reg[1] ==
'PREVIOUS_MONTH') {
841 $newout = $tmp2[
'month'];
842 } elseif ($reg[1] ==
'PREVIOUS_YEAR') {
844 $newout = ($tmp[
'year'] - 1);
845 } elseif ($reg[1] ==
'NEXT_DAY') {
848 $newout = $tmp2[
'day'];
849 } elseif ($reg[1] ==
'NEXT_MONTH') {
852 $newout = $tmp2[
'month'];
853 } elseif ($reg[1] ==
'NEXT_YEAR') {
855 $newout = ($tmp[
'year'] + 1);
856 } elseif ($reg[1] ==
'MYCOMPANY_COUNTRY_ID' || $reg[1] ==
'MYCOUNTRY_ID' || $reg[1] ==
'MYCOUNTRYID') {
857 $newout = $mysoc->country_id;
858 } elseif ($reg[1] ==
'USER_ID' || $reg[1] ==
'USERID') {
860 } elseif ($reg[1] ==
'USER_SUPERVISOR_ID' || $reg[1] ==
'SUPERVISOR_ID' || $reg[1] ==
'SUPERVISORID') {
861 $newout = $user->fk_user;
862 } elseif ($reg[1] ==
'ENTITY_ID' || $reg[1] ==
'ENTITYID') {
863 $newout = $conf->entity;
868 $out = preg_replace(
'/__'.preg_quote($reg[1],
'/').
'__/', $newout, $out);
873 if (preg_match(
'/^array/', $check)) {
874 if (!is_array($out) || empty($out)) {
877 $tmparray = explode(
':', $check);
878 if (!empty($tmparray[1])) {
879 $tmpcheck = $tmparray[1];
881 $tmpcheck =
'alphanohtml';
883 foreach ($out as $outkey => $outval) {
884 $out[$outkey] =
sanitizeVal($outval, $tmpcheck, $filter, $options);
890 if (strpos($paramname,
'search_') === 0) {
891 $out = preg_replace(
'/([<>])([-+]?\d)/',
'\1 \2', $out);
894 $out =
sanitizeVal($out, $check, $filter, $options);
899 if ($paramname ==
'backtopage' || $paramname ==
'backtolist' || $paramname ==
'backtourl') {
900 $out = str_replace(
'\\',
'/', $out);
901 $out = str_replace(array(
':',
';',
'@',
"\t",
' '),
'', $out);
903 $oldstringtoclean = $out;
904 $out = str_ireplace(array(
'javascript',
'vbscript',
'&colon',
'&#'),
'', $out);
905 $out = preg_replace(array(
'/^[^\?]*%/'),
'', $out);
906 $out = preg_replace(array(
'/^[a-z]*\/\s*\/+/i'),
'', $out);
907 }
while ($oldstringtoclean != $out);
912 if (empty($method) || $method == 3 || $method == 4) {
913 if (preg_match(
'/^search_/', $paramname) || in_array($paramname, array(
'sortorder',
'sortfield'))) {
920 if ($out !=
'' && isset($user)) {
921 $user->lastsearch_values_tmp[$relativepathstring][$paramname] = $out;
2328function dol_banner_tab($object, $paramid, $morehtml =
'', $shownav = 1, $fieldid =
'rowid', $fieldref =
'ref', $morehtmlref =
'', $moreparam =
'', $nodbprefix = 0, $morehtmlleft =
'', $morehtmlstatus =
'', $onlybanner = 0, $morehtmlright =
'')
2330 global $conf, $form, $user, $langs, $hookmanager, $action;
2334 $maxvisiblephotos = 1;
2336 $entity = (empty($object->entity) ? $conf->entity : $object->entity);
2337 $showbarcode = empty($conf->barcode->enabled) ? 0 : (empty($object->barcode) ? 0 : 1);
2338 if (
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') && !$user->hasRight(
'barcode',
'lire_advance')) {
2341 $modulepart =
'unknown';
2343 if ($object->element ==
'societe' || $object->element ==
'contact' || $object->element ==
'product' || $object->element ==
'ticket') {
2344 $modulepart = $object->element;
2345 } elseif ($object->element ==
'member') {
2346 $modulepart =
'memberphoto';
2347 } elseif ($object->element ==
'user') {
2348 $modulepart =
'userphoto';
2351 if (class_exists(
"Imagick")) {
2352 if ($object->element ==
'expensereport' || $object->element ==
'propal' || $object->element ==
'commande' || $object->element ==
'facture' || $object->element ==
'supplier_proposal') {
2353 $modulepart = $object->element;
2354 } elseif ($object->element ==
'fichinter') {
2355 $modulepart =
'ficheinter';
2356 } elseif ($object->element ==
'contrat') {
2357 $modulepart =
'contract';
2358 } elseif ($object->element ==
'order_supplier') {
2359 $modulepart =
'supplier_order';
2360 } elseif ($object->element ==
'invoice_supplier') {
2361 $modulepart =
'supplier_invoice';
2365 if ($object->element ==
'product') {
2367 $cssclass =
'photowithmargin photoref';
2368 $showimage = $object->is_photo_available($conf->product->multidir_output[$entity]);
2369 $maxvisiblephotos = (isset($conf->global->PRODUCT_MAX_VISIBLE_PHOTO) ? $conf->global->PRODUCT_MAX_VISIBLE_PHOTO : 5);
2370 if ($conf->browser->layout ==
'phone') {
2371 $maxvisiblephotos = 1;
2374 $morehtmlleft .=
'<div class="floatleft inline-block valignmiddle divphotoref">'.$object->show_photos(
'product', $conf->product->multidir_output[$entity],
'small', $maxvisiblephotos, 0, 0, 0, 0, $width, 0,
'').
'</div>';
2378 $morehtmlleft .=
'<div class="floatleft inline-block valignmiddle divphotoref"></div>';
2380 $nophoto =
'/public/theme/common/nophoto.png';
2381 $morehtmlleft .=
'<div class="floatleft inline-block valignmiddle divphotoref"><img class="photo'.$modulepart.($cssclass ?
' '.$cssclass :
'').
'" title="'.
dol_escape_htmltag($langs->trans(
"UploadAnImageToSeeAPhotoHere", $langs->transnoentitiesnoconv(
"Documents"))).
'" alt="No photo"'.($width ?
' style="width: '.$width.
'px"' :
'').
' src="'.DOL_URL_ROOT.$nophoto.
'"></div>';
2384 } elseif ($object->element ==
'ticket') {
2386 $cssclass =
'photoref';
2387 $showimage = $object->is_photo_available($conf->ticket->multidir_output[$entity].
'/'.$object->ref);
2388 $maxvisiblephotos = (isset($conf->global->TICKET_MAX_VISIBLE_PHOTO) ? $conf->global->TICKET_MAX_VISIBLE_PHOTO : 2);
2389 if ($conf->browser->layout ==
'phone') {
2390 $maxvisiblephotos = 1;
2394 $showphoto = $object->show_photos(
'ticket', $conf->ticket->multidir_output[$entity],
'small', $maxvisiblephotos, 0, 0, 0, $width, 0);
2395 if ($object->nbphoto > 0) {
2396 $morehtmlleft .=
'<div class="floatleft inline-block valignmiddle divphotoref">'.$showphoto.
'</div>';
2404 $morehtmlleft .=
'<div class="floatleft inline-block valignmiddle divphotoref"></div>';
2406 $nophoto =
img_picto(
'No photo',
'object_ticket');
2407 $morehtmlleft .=
'<!-- No photo to show -->';
2408 $morehtmlleft .=
'<div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref">';
2409 $morehtmlleft .= $nophoto;
2410 $morehtmlleft .=
'</div></div>';
2415 if ($modulepart !=
'unknown') {
2418 if (in_array($modulepart, array(
'propal',
'commande',
'facture',
'ficheinter',
'contract',
'supplier_order',
'supplier_proposal',
'supplier_invoice',
'expensereport')) && class_exists(
"Imagick")) {
2420 $dir_output = (empty($conf->$modulepart->multidir_output[$entity]) ? $conf->$modulepart->dir_output : $conf->$modulepart->multidir_output[$entity]).
"/";
2421 if (in_array($modulepart, array(
'invoice_supplier',
'supplier_invoice'))) {
2422 $subdir =
get_exdir($object->id, 2, 0, 1, $object, $modulepart);
2423 $subdir .= ((!empty($subdir) && !preg_match(
'/\/$/', $subdir)) ?
'/' :
'').$objectref;
2425 $subdir =
get_exdir($object->id, 0, 0, 1, $object, $modulepart);
2427 if (empty($subdir)) {
2428 $subdir =
'errorgettingsubdirofobject';
2431 $filepath = $dir_output.$subdir.
"/";
2433 $filepdf = $filepath.$objectref.
".pdf";
2434 $relativepath = $subdir.
'/'.$objectref.
'.pdf';
2437 $fileimage = $filepdf.
'_preview.png';
2438 $relativepathimage = $relativepath.
'_preview.png';
2440 $pdfexists = file_exists($filepdf);
2445 if (!file_exists($fileimage) || (filemtime($fileimage) < filemtime($filepdf))) {
2447 include_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
2456 if ($pdfexists && !$error) {
2457 $heightforphotref = 80;
2458 if (!empty($conf->dol_optimize_smallscreen)) {
2459 $heightforphotref = 60;
2462 if (file_exists($fileimage)) {
2463 $phototoshow =
'<div class="photoref">';
2464 $phototoshow .=
'<img height="'.$heightforphotref.
'" class="photo photowithborder" src="'.DOL_URL_ROOT.
'/viewimage.php?modulepart=apercu'.$modulepart.
'&file='.urlencode($relativepathimage).
'">';
2465 $phototoshow .=
'</div>';
2468 } elseif (!$phototoshow) {
2469 $phototoshow .= $form->showphoto($modulepart, $object, 0, 0, 0,
'photowithmargin photoref',
'small', 1, 0, $maxvisiblephotos);
2473 $morehtmlleft .=
'<div class="floatleft inline-block valignmiddle divphotoref">';
2474 $morehtmlleft .= $phototoshow;
2475 $morehtmlleft .=
'</div>';
2479 if (empty($phototoshow)) {
2480 if ($object->element ==
'action') {
2482 $cssclass =
'photorefcenter';
2483 $nophoto =
img_picto(
'No photo',
'title_agenda');
2486 $cssclass =
'photorefcenter';
2487 $picto = $object->picto;
2488 $prefix =
'object_';
2489 if ($object->element ==
'project' && !$object->public) {
2492 if (strpos($picto,
'fontawesome_') !==
false) {
2495 $nophoto =
img_picto(
'No photo', $prefix.$picto);
2497 $morehtmlleft .=
'<!-- No photo to show -->';
2498 $morehtmlleft .=
'<div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref">';
2499 $morehtmlleft .= $nophoto;
2500 $morehtmlleft .=
'</div></div>';
2507 $morehtmlleft .=
'<div class="floatleft inline-block valignmiddle divphotoref">'.$form->showbarcode($object, 100,
'photoref valignmiddle').
'</div>';
2510 if ($object->element ==
'societe') {
2511 if (!empty($conf->use_javascript_ajax) && $user->hasRight(
'societe',
'creer') &&
getDolGlobalString(
'MAIN_DIRECT_STATUS_UPDATE')) {
2512 $morehtmlstatus .=
ajax_object_onoff($object,
'status',
'status',
'InActivity',
'ActivityCeased');
2514 $morehtmlstatus .= $object->getLibStatut(6);
2516 } elseif ($object->element ==
'product') {
2518 if (!empty($conf->use_javascript_ajax) && $user->hasRight(
'produit',
'creer') &&
getDolGlobalString(
'MAIN_DIRECT_STATUS_UPDATE')) {
2519 $morehtmlstatus .=
ajax_object_onoff($object,
'status',
'tosell',
'ProductStatusOnSell',
'ProductStatusNotOnSell');
2521 $morehtmlstatus .=
'<span class="statusrefsell">'.$object->getLibStatut(6, 0).
'</span>';
2523 $morehtmlstatus .=
' ';
2525 if (!empty($conf->use_javascript_ajax) && $user->hasRight(
'produit',
'creer') &&
getDolGlobalString(
'MAIN_DIRECT_STATUS_UPDATE')) {
2526 $morehtmlstatus .=
ajax_object_onoff($object,
'status_buy',
'tobuy',
'ProductStatusOnBuy',
'ProductStatusNotOnBuy');
2528 $morehtmlstatus .=
'<span class="statusrefbuy">'.$object->getLibStatut(6, 1).
'</span>';
2530 } elseif (in_array($object->element, array(
'salary'))) {
2531 $tmptxt = $object->getLibStatut(6, $object->alreadypaid);
2532 if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3)) {
2533 $tmptxt = $object->getLibStatut(5, $object->alreadypaid);
2535 $morehtmlstatus .= $tmptxt;
2536 } elseif (in_array($object->element, array(
'facture',
'invoice',
'invoice_supplier',
'chargesociales',
'loan',
'tva'))) {
2537 $tmptxt = $object->getLibStatut(6, $object->totalpaid);
2538 if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3)) {
2539 $tmptxt = $object->getLibStatut(5, $object->totalpaid);
2541 $morehtmlstatus .= $tmptxt;
2542 } elseif ($object->element ==
'contrat' || $object->element ==
'contract') {
2543 if ($object->statut == 0) {
2544 $morehtmlstatus .= $object->getLibStatut(5);
2546 $morehtmlstatus .= $object->getLibStatut(4);
2548 } elseif ($object->element ==
'facturerec') {
2549 if ($object->frequency == 0) {
2550 $morehtmlstatus .= $object->getLibStatut(2);
2552 $morehtmlstatus .= $object->getLibStatut(5);
2554 } elseif ($object->element ==
'project_task') {
2555 $object->fk_statut = 1;
2556 if ($object->progress > 0) {
2557 $object->fk_statut = 2;
2559 if ($object->progress >= 100) {
2560 $object->fk_statut = 3;
2562 $tmptxt = $object->getLibStatut(5);
2563 $morehtmlstatus .= $tmptxt;
2564 } elseif (method_exists($object,
'getLibStatut')) {
2565 $tmptxt = $object->getLibStatut(6);
2566 if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3)) {
2567 $tmptxt = $object->getLibStatut(5);
2569 $morehtmlstatus .= $tmptxt;
2573 if (isModEnabled(
'accounting') && in_array($object->element, array(
'bank',
'paiementcharge',
'facture',
'invoice',
'invoice_supplier',
'expensereport',
'payment_various'))) {
2575 if (method_exists($object,
'getVentilExportCompta')) {
2576 $accounted = $object->getVentilExportCompta();
2577 $langs->load(
"accountancy");
2578 $morehtmlstatus .=
'</div><div class="statusref statusrefbis"><span class="opacitymedium">'.($accounted > 0 ? $langs->trans(
"Accounted") : $langs->trans(
"NotYetAccounted")).
'</span>';
2583 if (!empty($object->name_alias)) {
2584 $morehtmlref .=
'<div class="refidno opacitymedium">'.dol_escape_htmltag($object->name_alias).
'</div>';
2588 if (in_array($object->element, array(
'product',
'bank_account',
'project_task'))) {
2589 if (!empty($object->label)) {
2590 $morehtmlref .=
'<div class="refidno opacitymedium">'.$object->label.
'</div>';
2595 if (method_exists($object,
'getBannerAddress') && !in_array($object->element, array(
'product',
'bookmark',
'ecm_directories',
'ecm_files'))) {
2596 $moreaddress = $object->getBannerAddress(
'refaddress', $object);
2598 $morehtmlref .=
'<div class="refidno refaddress">';
2599 $morehtmlref .= $moreaddress;
2600 $morehtmlref .=
'</div>';
2603 if (
getDolGlobalString(
'MAIN_SHOW_TECHNICAL_ID') && (
getDolGlobalString(
'MAIN_SHOW_TECHNICAL_ID') ==
'1' || preg_match(
'/'.preg_quote($object->element,
'/').
'/i', $conf->global->MAIN_SHOW_TECHNICAL_ID)) && !empty($object->id)) {
2604 $morehtmlref .=
'<div style="clear: both;"></div>';
2605 $morehtmlref .=
'<div class="refidno opacitymedium">';
2606 $morehtmlref .= $langs->trans(
"TechnicalID").
': '.((int) $object->id);
2607 $morehtmlref .=
'</div>';
2610 $parameters=array(
'morehtmlref'=>$morehtmlref);
2611 $reshook = $hookmanager->executeHooks(
'formDolBanner', $parameters, $object, $action);
2614 } elseif (empty($reshook)) {
2615 $morehtmlref .= $hookmanager->resPrint;
2616 } elseif ($reshook > 0) {
2617 $morehtmlref = $hookmanager->resPrint;
2620 print
'<div class="'.($onlybanner ?
'arearefnobottom ' :
'arearef ').
'heightref valignmiddle centpercent">';
2621 print $form->showrefnav($object, $paramid, $morehtml, $shownav, $fieldid, $fieldref, $morehtmlref, $moreparam, $nodbprefix, $morehtmlleft, $morehtmlstatus, $morehtmlright);
2623 print
'<div class="underrefbanner clearboth"></div>';
2803function dol_print_date($time, $format =
'', $tzoutput =
'auto', $outputlangs =
'', $encodetooutput =
false)
2805 global $conf, $langs;
2812 if ($tzoutput ===
'auto') {
2813 $tzoutput = (empty($conf) ?
'tzserver' : (isset($conf->tzuserinputkey) ? $conf->tzuserinputkey :
'tzserver'));
2818 $offsettz = $offsetdst = 0;
2821 if (is_string($tzoutput)) {
2822 if ($tzoutput ==
'tzserver') {
2824 $offsettzstring = @date_default_timezone_get();
2827 } elseif ($tzoutput ==
'tzuser' || $tzoutput ==
'tzuserrel') {
2829 $offsettzstring = (empty($_SESSION[
'dol_tz_string']) ?
'UTC' : $_SESSION[
'dol_tz_string']);
2831 if (class_exists(
'DateTimeZone')) {
2832 $user_date_tz =
new DateTimeZone($offsettzstring);
2833 $user_dt =
new DateTime();
2834 $user_dt->setTimezone($user_date_tz);
2835 $user_dt->setTimestamp($tzoutput ==
'tzuser' ?
dol_now() : (int) $time);
2836 $offsettz = $user_dt->getOffset();
2838 $offsettz = (empty($_SESSION[
'dol_tz']) ? 0 : $_SESSION[
'dol_tz']) * 60 * 60;
2839 $offsetdst = (empty($_SESSION[
'dol_dst']) ? 0 : $_SESSION[
'dol_dst']) * 60 * 60;
2844 if (!is_object($outputlangs)) {
2845 $outputlangs = $langs;
2848 $format =
'daytextshort';
2853 $reduceformat = (!empty($conf->dol_optimize_smallscreen) && in_array($format, array(
'day',
'dayhour',
'dayhoursec'))) ? 1 : 0;
2854 $format = preg_replace(
'/inputnoreduce/',
'', $format);
2855 $formatwithoutreduce = preg_replace(
'/reduceformat/',
'', $format);
2856 if ($formatwithoutreduce != $format) {
2857 $format = $formatwithoutreduce;
2863 if ($format ==
'day') {
2864 $format = ($outputlangs->trans(
"FormatDateShort") !=
"FormatDateShort" ? $outputlangs->trans(
"FormatDateShort") : $conf->format_date_short);
2865 } elseif ($format ==
'hour') {
2866 $format = ($outputlangs->trans(
"FormatHourShort") !=
"FormatHourShort" ? $outputlangs->trans(
"FormatHourShort") : $conf->format_hour_short);
2867 } elseif ($format ==
'hourduration') {
2868 $format = ($outputlangs->trans(
"FormatHourShortDuration") !=
"FormatHourShortDuration" ? $outputlangs->trans(
"FormatHourShortDuration") : $conf->format_hour_short_duration);
2869 } elseif ($format ==
'daytext') {
2870 $format = ($outputlangs->trans(
"FormatDateText") !=
"FormatDateText" ? $outputlangs->trans(
"FormatDateText") : $conf->format_date_text);
2871 } elseif ($format ==
'daytextshort') {
2872 $format = ($outputlangs->trans(
"FormatDateTextShort") !=
"FormatDateTextShort" ? $outputlangs->trans(
"FormatDateTextShort") : $conf->format_date_text_short);
2873 } elseif ($format ==
'dayhour') {
2874 $format = ($outputlangs->trans(
"FormatDateHourShort") !=
"FormatDateHourShort" ? $outputlangs->trans(
"FormatDateHourShort") : $conf->format_date_hour_short);
2875 } elseif ($format ==
'dayhoursec') {
2876 $format = ($outputlangs->trans(
"FormatDateHourSecShort") !=
"FormatDateHourSecShort" ? $outputlangs->trans(
"FormatDateHourSecShort") : $conf->format_date_hour_sec_short);
2877 } elseif ($format ==
'dayhourtext') {
2878 $format = ($outputlangs->trans(
"FormatDateHourText") !=
"FormatDateHourText" ? $outputlangs->trans(
"FormatDateHourText") : $conf->format_date_hour_text);
2879 } elseif ($format ==
'dayhourtextshort') {
2880 $format = ($outputlangs->trans(
"FormatDateHourTextShort") !=
"FormatDateHourTextShort" ? $outputlangs->trans(
"FormatDateHourTextShort") : $conf->format_date_hour_text_short);
2881 } elseif ($format ==
'dayhourlog') {
2883 $format =
'%Y%m%d%H%M%S';
2884 } elseif ($format ==
'dayhourlogsmall') {
2886 $format =
'%y%m%d%H%M';
2887 } elseif ($format ==
'dayhourldap') {
2888 $format =
'%Y%m%d%H%M%SZ';
2889 } elseif ($format ==
'dayhourxcard') {
2890 $format =
'%Y%m%dT%H%M%SZ';
2891 } elseif ($format ==
'dayxcard') {
2893 } elseif ($format ==
'dayrfc') {
2894 $format =
'%Y-%m-%d';
2895 } elseif ($format ==
'dayhourrfc') {
2896 $format =
'%Y-%m-%dT%H:%M:%SZ';
2897 } elseif ($format ==
'standard') {
2898 $format =
'%Y-%m-%d %H:%M:%S';
2901 if ($reduceformat) {
2902 $format = str_replace(
'%Y',
'%y', $format);
2903 $format = str_replace(
'yyyy',
'yy', $format);
2907 if (preg_match(
'/%b/i', $format)) {
2909 $format = str_replace(
'%b',
'__b__', $format);
2910 $format = str_replace(
'%B',
'__B__', $format);
2912 if (preg_match(
'/%a/i', $format)) {
2914 $format = str_replace(
'%a',
'__a__', $format);
2915 $format = str_replace(
'%A',
'__A__', $format);
2920 if (preg_match(
'/^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])$/i', $time, $reg)) {
2921 dol_print_error(
'',
"Functions.lib::dol_print_date function called with a bad value from page ".(empty($_SERVER[
"PHP_SELF"]) ?
'unknown' : $_SERVER[
"PHP_SELF"]));
2923 } elseif (preg_match(
'/^([0-9]+)\-([0-9]+)\-([0-9]+) ?([0-9]+)?:?([0-9]+)?:?([0-9]+)?/i', $time, $reg)) {
2925 dol_syslog(
"Functions.lib::dol_print_date function called with a bad value from page ".(empty($_SERVER[
"PHP_SELF"]) ?
'unknown' : $_SERVER[
"PHP_SELF"]), LOG_WARNING);
2928 $syear = (!empty($reg[1]) ? $reg[1] :
'');
2929 $smonth = (!empty($reg[2]) ? $reg[2] :
'');
2930 $sday = (!empty($reg[3]) ? $reg[3] :
'');
2931 $shour = (!empty($reg[4]) ? $reg[4] :
'');
2932 $smin = (!empty($reg[5]) ? $reg[5] :
'');
2933 $ssec = (!empty($reg[6]) ? $reg[6] :
'');
2935 $time =
dol_mktime($shour, $smin, $ssec, $smonth, $sday, $syear,
true);
2938 $tzo =
new DateTimeZone(
'UTC');
2940 $tzo =
new DateTimeZone(date_default_timezone_get());
2942 $dtts =
new DateTime();
2943 $dtts->setTimestamp($time);
2944 $dtts->setTimezone($tzo);
2945 $newformat = str_replace(
2946 array(
'%Y',
'%y',
'%m',
'%d',
'%H',
'%I',
'%M',
'%S',
'%p',
'T',
'Z',
'__a__',
'__A__',
'__b__',
'__B__'),
2947 array(
'Y',
'y',
'm',
'd',
'H',
'h',
'i',
's',
'A',
'__£__',
'__$__',
'__{__',
'__}__',
'__[__',
'__]__'),
2950 $ret = $dtts->format($newformat);
2952 array(
'__£__',
'__$__',
'__{__',
'__}__',
'__[__',
'__]__'),
2953 array(
'T',
'Z',
'__a__',
'__A__',
'__b__',
'__B__'),
2958 if ($time < 100000000000) {
2959 $timetouse = $time + $offsettz + $offsetdst;
2962 $tzo =
new DateTimeZone(
'UTC');
2964 $tzo =
new DateTimeZone(date_default_timezone_get());
2966 $dtts =
new DateTime();
2967 $dtts->setTimestamp($timetouse);
2968 $dtts->setTimezone($tzo);
2969 $newformat = str_replace(
2970 array(
'%Y',
'%y',
'%m',
'%d',
'%H',
'%I',
'%M',
'%S',
'%p',
'%w',
'T',
'Z',
'__a__',
'__A__',
'__b__',
'__B__'),
2971 array(
'Y',
'y',
'm',
'd',
'H',
'h',
'i',
's',
'A',
'w',
'__£__',
'__$__',
'__{__',
'__}__',
'__[__',
'__]__'),
2974 $ret = $dtts->format($newformat);
2976 array(
'__£__',
'__$__',
'__{__',
'__}__',
'__[__',
'__]__'),
2977 array(
'T',
'Z',
'__a__',
'__A__',
'__b__',
'__B__'),
2982 $ret =
'Bad value '.$time.
' for date';
2986 if (preg_match(
'/__b__/i', $format)) {
2987 $timetouse = $time + $offsettz + $offsetdst;
2990 $tzo =
new DateTimeZone(
'UTC');
2992 $tzo =
new DateTimeZone(date_default_timezone_get());
2994 $dtts =
new DateTime();
2995 $dtts->setTimestamp($timetouse);
2996 $dtts->setTimezone($tzo);
2997 $month = $dtts->format(
"m");
2998 $month = sprintf(
"%02d", $month);
2999 if ($encodetooutput) {
3000 $monthtext = $outputlangs->transnoentities(
'Month'.$month);
3001 $monthtextshort = $outputlangs->transnoentities(
'MonthShort'.$month);
3003 $monthtext = $outputlangs->transnoentitiesnoconv(
'Month'.$month);
3004 $monthtextshort = $outputlangs->transnoentitiesnoconv(
'MonthShort'.$month);
3007 $ret = str_replace(
'__b__', $monthtextshort, $ret);
3008 $ret = str_replace(
'__B__', $monthtext, $ret);
3012 if (preg_match(
'/__a__/i', $format)) {
3014 $timetouse = $time + $offsettz + $offsetdst;
3017 $tzo =
new DateTimeZone(
'UTC');
3019 $tzo =
new DateTimeZone(date_default_timezone_get());
3021 $dtts =
new DateTime();
3022 $dtts->setTimestamp($timetouse);
3023 $dtts->setTimezone($tzo);
3024 $w = $dtts->format(
"w");
3025 $dayweek = $outputlangs->transnoentitiesnoconv(
'Day'.$w);
3027 $ret = str_replace(
'__A__', $dayweek, $ret);
3028 $ret = str_replace(
'__a__',
dol_substr($dayweek, 0, 3), $ret);
3576function dol_print_phone($phone, $countrycode =
'', $cid = 0, $socid = 0, $addlink =
'', $separ =
" ", $withpicto =
'', $titlealt =
'', $adddivfloat = 0)
3578 global $conf, $user, $langs, $mysoc, $hookmanager;
3581 $phone = is_null($phone) ?
'' : preg_replace(
"/[\s.-]/",
"", trim($phone));
3582 if (empty($phone)) {
3586 $separ = $conf->global->MAIN_PHONE_SEPAR;
3588 if (empty($countrycode) && is_object($mysoc)) {
3589 $countrycode = $mysoc->country_code;
3593 if ($conf->dol_optimize_smallscreen) {
3598 if (strtoupper($countrycode) ==
"FR") {
3601 $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);
3603 $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 2).$separ.substr($newphone, 5, 2);
3605 $newphone = substr($newphone, 0, 2).$separ.substr($newphone, 2, 3).$separ.substr($newphone, 5, 2).$separ.substr($newphone, 7, 2);
3607 $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);
3609 $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 1).$separ.substr($newphone, 4, 2).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 2).$separ.substr($newphone, 10, 2);
3611 $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 2).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 3).$separ.substr($newphone, 11, 2);
3613 } elseif (strtoupper($countrycode) ==
"CA") {
3615 $newphone = ($separ !=
'' ?
'(' :
'').substr($newphone, 0, 3).($separ !=
'' ?
')' :
'').$separ.substr($newphone, 3, 3).($separ !=
'' ?
'-' :
'').substr($newphone, 6, 4);
3617 } elseif (strtoupper($countrycode) ==
"PT") {
3619 $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 3).$separ.substr($newphone, 10, 3);
3621 } elseif (strtoupper($countrycode) ==
"SR") {
3623 $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 3);
3625 $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 4);
3627 } elseif (strtoupper($countrycode) ==
"DE") {
3629 $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 4).$separ.substr($newphone, 7, 4).$separ.substr($newphone, 11, 3);
3631 $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 4).$separ.substr($newphone, 10, 3);
3633 } elseif (strtoupper($countrycode) ==
"ES") {
3635 $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 3).$separ.substr($newphone, 9, 3);
3637 } elseif (strtoupper($countrycode) ==
"BF") {
3639 $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 1).$separ.substr($newphone, 4, 2).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 2).$separ.substr($newphone, 10, 2);
3641 } elseif (strtoupper($countrycode) ==
"RO") {
3643 $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 2).$separ.substr($newphone, 5, 3).$separ.substr($newphone, 8, 2).$separ.substr($newphone, 10, 2);
3645 } elseif (strtoupper($countrycode) ==
"TR") {
3647 $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 3).$separ.substr($newphone, 9, 4);
3649 } elseif (strtoupper($countrycode) ==
"US") {
3651 $newphone = substr($newphone, 0, 2).$separ.substr($newphone, 2, 3).$separ.substr($newphone, 5, 3).$separ.substr($newphone, 8, 4);
3653 } elseif (strtoupper($countrycode) ==
"MX") {
3655 $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 4).$separ.substr($newphone, 7, 3).$separ.substr($newphone, 10, 2);
3657 $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);
3659 $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 3).$separ.substr($newphone, 9, 4);
3661 } elseif (strtoupper($countrycode) ==
"ML") {
3663 $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);
3665 } elseif (strtoupper($countrycode) ==
"TH") {
3667 $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 3);
3669 $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 1).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 2).$separ.substr($newphone, 9, 3);
3671 } elseif (strtoupper($countrycode) ==
"MU") {
3674 $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 2).$separ.substr($newphone, 9, 2);
3676 $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 4).$separ.substr($newphone, 8, 2).$separ.substr($newphone, 10, 2);
3678 } elseif (strtoupper($countrycode) ==
"ZA") {
3680 $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 2).$separ.substr($newphone, 5, 3).$separ.substr($newphone, 8, 2).$separ.substr($newphone, 10, 2);
3682 } elseif (strtoupper($countrycode) ==
"SY") {
3684 $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);
3686 $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 2).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 2).$separ.substr($newphone, 10, 3);
3688 } elseif (strtoupper($countrycode) ==
"AE") {
3690 $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 3).$separ.substr($newphone, 10, 2);
3692 $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 3).$separ.substr($newphone, 10, 3);
3694 $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 3).$separ.substr($newphone, 10, 4);
3696 } elseif (strtoupper($countrycode) ==
"DZ") {
3698 $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 3).$separ.substr($newphone, 10, 3);
3700 } elseif (strtoupper($countrycode) ==
"BE") {
3702 $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 3);
3704 $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 3).$separ.substr($newphone, 9, 3);
3706 } elseif (strtoupper($countrycode) ==
"PF") {
3708 $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);
3710 } elseif (strtoupper($countrycode) ==
"CO") {
3712 $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 3).$separ.substr($newphone, 9, 2).$separ.substr($newphone, 11, 2);
3714 } elseif (strtoupper($countrycode) ==
"JO") {
3716 $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 1).$separ.substr($newphone, 5, 3).$separ.substr($newphone, 7, 2).$separ.substr($newphone, 9, 2);
3718 } elseif (strtoupper($countrycode) ==
"JM") {
3720 $newphone = substr($newphone, 0, 5).$separ.substr($newphone, 5, 3).$separ.substr($newphone, 8, 4);
3722 } elseif (strtoupper($countrycode) ==
"MG") {
3724 $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 2).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 3).$separ.substr($newphone, 11, 2);
3726 } elseif (strtoupper($countrycode) ==
"GB") {
3728 $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 4).$separ.substr($newphone, 7, 3).$separ.substr($newphone, 10, 3);
3730 } elseif (strtoupper($countrycode) ==
"CH") {
3732 $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 2).$separ.substr($newphone, 5, 3).$separ.substr($newphone, 8, 2).$separ.substr($newphone, 10, 2);
3734 $newphone = $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 2).$separ.substr($newphone, 5, 3).$separ.substr($newphone, 8, 3).$separ.substr($newphone, 11, 4);
3736 } elseif (strtoupper($countrycode) ==
"TN") {
3738 $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 2).$separ.substr($newphone, 6, 3).$separ.substr($newphone, 9, 3);
3740 } elseif (strtoupper($countrycode) ==
"GF") {
3742 $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 2).$separ.substr($newphone, 9, 2).$separ.substr($newphone, 11, 2);
3744 } elseif (strtoupper($countrycode) ==
"GP") {
3746 $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 2).$separ.substr($newphone, 9, 2).$separ.substr($newphone, 11, 2);
3748 } elseif (strtoupper($countrycode) ==
"MQ") {
3750 $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 2).$separ.substr($newphone, 9, 2).$separ.substr($newphone, 11, 2);
3752 } elseif (strtoupper($countrycode) ==
"IT") {
3754 $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 3).$separ.substr($newphone, 9, 3);
3756 $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 3).$separ.substr($newphone, 9, 2).$separ.substr($newphone, 11, 2);
3758 } elseif (strtoupper($countrycode) ==
"AU") {
3762 $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 1).$separ.substr($newphone, 4, 4).$separ.substr($newphone, 8, 4);
3764 } elseif (strtoupper($countrycode) ==
"LU") {
3767 $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 2).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 2);
3769 $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 2).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 2).$separ.substr($newphone, 10, 1);
3771 $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);
3773 $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 2).$separ.substr($newphone, 9, 2).$separ.substr($newphone, 11, 2);
3777 $newphoneastart = $newphoneaend =
'';
3778 if (!empty($addlink)) {
3779 if ($addlink ==
'tel' || $conf->browser->layout ==
'phone' || (isModEnabled(
'clicktodial') &&
getDolGlobalString(
'CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS'))) {
3780 $newphoneastart =
'<a href="tel:'.$phone.
'">';
3781 $newphoneaend .=
'</a>';
3782 } elseif (isModEnabled(
'clicktodial') && $addlink ==
'AC_TEL') {
3783 if (empty($user->clicktodial_loaded)) {
3784 $user->fetch_clicktodial();
3788 $urlmask =
getDolGlobalString(
'CLICKTODIAL_URL',
'ErrorClickToDialModuleNotConfigured');
3789 if (!empty($user->clicktodial_url)) {
3790 $urlmask = $user->clicktodial_url;
3793 $clicktodial_poste = (!empty($user->clicktodial_poste) ? urlencode($user->clicktodial_poste) :
'');
3794 $clicktodial_login = (!empty($user->clicktodial_login) ? urlencode($user->clicktodial_login) :
'');
3795 $clicktodial_password = (!empty($user->clicktodial_password) ? urlencode($user->clicktodial_password) :
'');
3797 $url = sprintf($urlmask, urlencode($phone), $clicktodial_poste, $clicktodial_login, $clicktodial_password);
3799 $substitarray = array(
'__PHONEFROM__'=>$clicktodial_poste,
3800 '__PHONETO__'=>urlencode($phone),
3801 '__LOGIN__'=>$clicktodial_login,
3802 '__PASS__'=>$clicktodial_password);
3806 $newphoneastart =
'<a href="'.$url.
'" class="cssforclicktodial">';
3807 $newphoneaend =
'</a>';
3810 $newphoneastart =
'<a href="'.$url.
'"';
3812 $newphoneastart .=
' target="_blank" rel="noopener noreferrer"';
3814 $newphoneastart .=
'>';
3815 $newphoneaend .=
'</a>';
3820 if (isModEnabled(
'agenda') && $user->hasRight(
"agenda",
"myactions",
"create")) {
3822 $addlinktoagenda =
'';
3823 if ($addlink ==
'AC_FAX') {
3827 $addlinktoagenda =
'<a href="'.DOL_URL_ROOT.
'/comm/action/card.php?action=create&backtopage='. urlencode($_SERVER[
'REQUEST_URI']) .
'&actioncode='.$type.($cid ?
'&contactid='.$cid :
'').($socid ?
'&socid='.$socid :
'').
'">'.
img_object($langs->trans(
"AddAction"),
"calendar").
'</a>';
3829 if ($addlinktoagenda) {
3830 $newphone =
'<span>'.$newphone.
' '.$addlinktoagenda.
'</span>';
3835 if (empty($titlealt)) {
3836 $titlealt = ($withpicto ==
'fax' ? $langs->trans(
"Fax") : $langs->trans(
"Phone"));
3841 $parameters = array(
'countrycode' => $countrycode,
'cid' => $cid,
'socid' => $socid,
'titlealt' => $titlealt,
'picto' => $withpicto);
3842 $reshook = $hookmanager->executeHooks(
'printPhone', $parameters, $phone);
3843 $rep .= $hookmanager->resPrint;
3845 if (empty($reshook)) {
3848 if ($withpicto ==
'fax') {
3849 $picto =
'phoning_fax';
3850 } elseif ($withpicto ==
'phone') {
3852 } elseif ($withpicto ==
'mobile') {
3853 $picto =
'phoning_mobile';
3858 if ($adddivfloat == 1) {
3859 $rep .=
'<div class="nospan float" style="margin-right: 10px">';
3860 } elseif (empty($adddivfloat)) {
3861 $rep .=
'<span style="margin-right: 10px;">';
3864 $rep .= $newphoneastart;
3865 $rep .= ($withpicto ?
img_picto($titlealt,
'object_'.$picto.
'.png') :
'');
3866 if ($separ !=
'hidenum') {
3867 $rep .= ($withpicto ?
' ' :
'').$newphone;
3869 $rep .= $newphoneaend;
3871 if ($adddivfloat == 1) {
3873 } elseif (empty($adddivfloat)) {
4363function img_picto($titlealt, $picto, $moreatt =
'', $pictoisfullpath =
false, $srconly = 0, $notitle = 0, $alt =
'', $morecss =
'', $marginleftonlyshort = 2)
4365 global $conf, $langs;
4368 $url = DOL_URL_ROOT;
4369 $theme = isset($conf->theme) ? $conf->theme :
null;
4370 $path =
'theme/'.$theme;
4371 if (empty($picto)) {
4376 if ($pictoisfullpath) {
4378 if (!preg_match(
'/(\.png|\.gif|\.svg)$/i', $picto)) {
4381 $fullpathpicto = $picto;
4383 if (preg_match(
'/class="([^"]+)"/', $moreatt, $reg)) {
4384 $morecss .= ($morecss ?
' ' :
'').$reg[1];
4385 $moreatt = str_replace(
'class="'.$reg[1].
'"',
'', $moreatt);
4388 $pictowithouttext = preg_replace(
'/(\.png|\.gif|\.svg)$/',
'', (is_null($picto) ?
'' : $picto));
4389 $pictowithouttext = str_replace(
'object_',
'', $pictowithouttext);
4390 $pictowithouttext = str_replace(
'_nocolor',
'', $pictowithouttext);
4392 if (strpos($pictowithouttext,
'fontawesome_') === 0 || strpos($pictowithouttext,
'fa-') === 0) {
4394 $pictowithouttext = str_replace(
'fontawesome_',
'', $pictowithouttext);
4395 $pictowithouttext = str_replace(
'fa-',
'', $pictowithouttext);
4398 if ($pictowithouttext ==
'file-o') {
4399 $pictowithouttext =
'file';
4402 $pictowithouttextarray = explode(
'_', $pictowithouttext);
4403 $marginleftonlyshort = 0;
4405 if (!empty($pictowithouttextarray[1])) {
4407 $fakey =
'fa-'.$pictowithouttextarray[0];
4408 $faprefix = empty($pictowithouttextarray[1]) ?
'fas' : $pictowithouttextarray[1];
4409 $facolor = empty($pictowithouttextarray[2]) ?
'' : $pictowithouttextarray[2];
4410 $fasize = empty($pictowithouttextarray[3]) ?
'' : $pictowithouttextarray[3];
4412 $fakey =
'fa-'.$pictowithouttext;
4422 if (preg_match(
'/class="([^"]+)"/', $moreatt, $reg)) {
4423 $morecss .= ($morecss ?
' ' :
'').$reg[1];
4424 $moreatt = str_replace(
'class="'.$reg[1].
'"',
'', $moreatt);
4426 if (preg_match(
'/style="([^"]+)"/', $moreatt, $reg)) {
4427 $morestyle = $reg[1];
4428 $moreatt = str_replace(
'style="'.$reg[1].
'"',
'', $moreatt);
4430 $moreatt = trim($moreatt);
4432 $enabledisablehtml =
'<span class="'.$faprefix.
' '.$fakey.($marginleftonlyshort ? ($marginleftonlyshort == 1 ?
' marginleftonlyshort' :
' marginleftonly') :
'');
4433 $enabledisablehtml .= ($morecss ?
' '.$morecss :
'').
'" style="'.($fasize ? (
'font-size: '.$fasize.
';') :
'').($facolor ? (
' color: '.$facolor.
';') :
'').($morestyle ?
' '.$morestyle :
'').
'"'.(($notitle || empty($titlealt)) ?
'' :
' title="'.dol_escape_htmltag($titlealt).
'"').($moreatt ?
' '.$moreatt :
'').
'>';
4437 $enabledisablehtml .=
'</span>';
4439 return $enabledisablehtml;
4442 if (empty($srconly) && in_array($pictowithouttext, array(
4443 '1downarrow',
'1uparrow',
'1leftarrow',
'1rightarrow',
'1uparrow_selected',
'1downarrow_selected',
'1leftarrow_selected',
'1rightarrow_selected',
4444 'accountancy',
'accounting_account',
'account',
'accountline',
'action',
'add',
'address',
'angle-double-down',
'angle-double-up',
'asset',
4445 'bank_account',
'barcode',
'bank',
'bell',
'bill',
'billa',
'billr',
'billd',
'birthday-cake',
'bookmark',
'bom',
'briefcase-medical',
'bug',
'building',
4446 'card',
'calendarlist',
'calendar',
'calendarmonth',
'calendarweek',
'calendarday',
'calendarperuser',
'calendarpertype',
4447 'cash-register',
'category',
'chart',
'check',
'clock',
'clone',
'close_title',
'code',
'cog',
'collab',
'company',
'contact',
'country',
'contract',
'conversation',
'cron',
'cross',
'cubes',
4448 'check-circle',
'check-square',
'currency',
'multicurrency',
4449 'chevron-left',
'chevron-right',
'chevron-down',
'chevron-top',
'commercial',
'companies',
4450 'delete',
'dolly',
'dollyrevert',
'donation',
'download',
'dynamicprice',
4451 'edit',
'ellipsis-h',
'email',
'entity',
'envelope',
'eraser',
'establishment',
'expensereport',
'external-link-alt',
'external-link-square-alt',
'eye',
4452 'filter',
'file',
'file-o',
'file-code',
'file-export',
'file-import',
'file-upload',
'autofill',
'folder',
'folder-open',
'folder-plus',
'font',
4453 'gears',
'generate',
'generic',
'globe',
'globe-americas',
'graph',
'grip',
'grip_title',
'group',
4454 'hands-helping',
'help',
'holiday',
4455 'id-card',
'images',
'incoterm',
'info',
'intervention',
'inventory',
'intracommreport',
'jobprofile',
4456 'key',
'knowledgemanagement',
4457 'label',
'language',
'line',
'link',
'list',
'list-alt',
'listlight',
'loan',
'lock',
'lot',
'long-arrow-alt-right',
4458 'margin',
'map-marker-alt',
'member',
'meeting',
'minus',
'money-bill-alt',
'movement',
'mrp',
'note',
'next',
4459 'off',
'on',
'order',
4460 'paiment',
'paragraph',
'play',
'pdf',
'phone',
'phoning',
'phoning_mobile',
'phoning_fax',
'playdisabled',
'previous',
'poll',
'pos',
'printer',
'product',
'propal',
'proposal',
'puce',
4461 'stock',
'resize',
'service',
'stats',
4462 'security',
'setup',
'share-alt',
'sign-out',
'split',
'stripe',
'stripe-s',
'switch_off',
'switch_on',
'switch_on_warning',
'switch_on_red',
'tools',
'unlink',
'uparrow',
'user',
'user-tie',
'vcard',
'wrench',
4463 'github',
'google',
'jabber',
'microsoft',
'skype',
'twitter',
'facebook',
'linkedin',
'instagram',
'snapchat',
'youtube',
'google-plus-g',
'whatsapp',
4464 'generic',
'home',
'hrm',
'members',
'products',
'invoicing',
4465 'partnership',
'payment',
'payment_vat',
'pencil-ruler',
'pictoconfirm',
'preview',
'project',
'projectpub',
'projecttask',
'question',
'refresh',
'region',
4466 'salary',
'shipment',
'state',
'supplier_invoice',
'supplier_invoicea',
'supplier_invoicer',
'supplier_invoiced',
4467 'technic',
'ticket',
4469 'recent',
'reception',
'recruitmentcandidature',
'recruitmentjobposition',
'replacement',
'resource',
'recurring',
'rss',
4470 'shapes',
'skill',
'square',
'sort-numeric-down',
'stop-circle',
'supplier',
'supplier_proposal',
'supplier_order',
'supplier_invoice',
4471 'tick',
'timespent',
'title_setup',
'title_accountancy',
'title_bank',
'title_hrm',
'title_agenda',
4472 'uncheck',
'url',
'user-cog',
'user-injured',
'user-md',
'vat',
'website',
'workstation',
'webhook',
'world',
'private',
4473 'conferenceorbooth',
'eventorganization',
4474 'stamp',
'signature'
4476 $fakey = $pictowithouttext;
4480 if (in_array($pictowithouttext, array(
'card',
'bell',
'clock',
'establishment',
'file',
'file-o',
'generic',
'minus-square',
'object_generic',
'pdf',
'plus-square',
'timespent',
'note',
'off',
'on',
'object_bookmark',
'bookmark',
'vcard'))) {
4483 if (in_array($pictowithouttext, array(
'black-tie',
'github',
'google',
'microsoft',
'skype',
'twitter',
'facebook',
'linkedin',
'instagram',
'snapchat',
'stripe',
'stripe-s',
'youtube',
'google-plus-g',
'whatsapp'))) {
4487 $arrayconvpictotofa = array(
4488 'account'=>
'university',
'accounting_account'=>
'clipboard-list',
'accountline'=>
'receipt',
'accountancy'=>
'search-dollar',
'action'=>
'calendar-alt',
'add'=>
'plus-circle',
'address'=>
'address-book',
'asset'=>
'money-check-alt',
'autofill'=>
'fill',
4489 'bank_account'=>
'university',
4490 'bill'=>
'file-invoice-dollar',
'billa'=>
'file-excel',
'billr'=>
'file-invoice-dollar',
'billd'=>
'file-medical',
4491 'supplier_invoice'=>
'file-invoice-dollar',
'supplier_invoicea'=>
'file-excel',
'supplier_invoicer'=>
'file-invoice-dollar',
'supplier_invoiced'=>
'file-medical',
4493 'card'=>
'address-card',
'chart'=>
'chart-line',
'company'=>
'building',
'contact'=>
'address-book',
'contract'=>
'suitcase',
'collab'=>
'people-arrows',
'conversation'=>
'comments',
'country'=>
'globe-americas',
'cron'=>
'business-time',
'cross'=>
'times',
4494 'donation'=>
'file-alt',
'dynamicprice'=>
'hand-holding-usd',
4495 'setup'=>
'cog',
'companies'=>
'building',
'products'=>
'cube',
'commercial'=>
'suitcase',
'invoicing'=>
'coins',
4496 'accounting'=>
'search-dollar',
'category'=>
'tag',
'dollyrevert'=>
'dolly',
4497 'file-o'=>
'file',
'generate'=>
'plus-square',
'hrm'=>
'user-tie',
'incoterm'=>
'truck-loading',
4498 'margin'=>
'calculator',
'members'=>
'user-friends',
'ticket'=>
'ticket-alt',
'globe'=>
'external-link-alt',
'lot'=>
'barcode',
4499 'email'=>
'at',
'establishment'=>
'building',
'edit'=>
'pencil-alt',
'entity'=>
'globe',
4500 'graph'=>
'chart-line',
'grip_title'=>
'arrows-alt',
'grip'=>
'arrows-alt',
'help'=>
'question-circle',
4501 'generic'=>
'file',
'holiday'=>
'umbrella-beach',
4502 'info'=>
'info-circle',
'inventory'=>
'boxes',
'intracommreport'=>
'globe-europe',
'jobprofile'=>
'cogs',
4503 'knowledgemanagement'=>
'ticket-alt',
'label'=>
'layer-group',
'line'=>
'bars',
'loan'=>
'money-bill-alt',
4504 'member'=>
'user-alt',
'meeting'=>
'chalkboard-teacher',
'mrp'=>
'cubes',
'next'=>
'arrow-alt-circle-right',
4505 'trip'=>
'wallet',
'expensereport'=>
'wallet',
'group'=>
'users',
'movement'=>
'people-carry',
4506 'sign-out'=>
'sign-out-alt',
4507 'switch_off'=>
'toggle-off',
'switch_on'=>
'toggle-on',
'switch_on_warning'=>
'toggle-on',
'switch_on_red'=>
'toggle-on',
'check'=>
'check',
'bookmark'=>
'star',
4508 'bank'=>
'university',
'close_title'=>
'times',
'delete'=>
'trash',
'filter'=>
'filter',
4509 'list-alt'=>
'list-alt',
'calendarlist'=>
'bars',
'calendar'=>
'calendar-alt',
'calendarmonth'=>
'calendar-alt',
'calendarweek'=>
'calendar-week',
'calendarday'=>
'calendar-day',
'calendarperuser'=>
'table',
4510 'intervention'=>
'ambulance',
'invoice'=>
'file-invoice-dollar',
'order'=>
'file-invoice',
4511 'error'=>
'exclamation-triangle',
'warning'=>
'exclamation-triangle',
4513 'playdisabled'=>
'play',
'pdf'=>
'file-pdf',
'poll'=>
'check-double',
'pos'=>
'cash-register',
'preview'=>
'binoculars',
'project'=>
'project-diagram',
'projectpub'=>
'project-diagram',
'projecttask'=>
'tasks',
'propal'=>
'file-signature',
'proposal'=>
'file-signature',
4514 'partnership'=>
'handshake',
'payment'=>
'money-check-alt',
'payment_vat'=>
'money-check-alt',
'pictoconfirm'=>
'check-square',
'phoning'=>
'phone',
'phoning_mobile'=>
'mobile-alt',
'phoning_fax'=>
'fax',
'previous'=>
'arrow-alt-circle-left',
'printer'=>
'print',
'product'=>
'cube',
'puce'=>
'angle-right',
4515 'recent' =>
'check-square',
'reception'=>
'dolly',
'recruitmentjobposition'=>
'id-card-alt',
'recruitmentcandidature'=>
'id-badge',
4516 'resize'=>
'crop',
'supplier_order'=>
'dol-order_supplier',
'supplier_proposal'=>
'file-signature',
4517 'refresh'=>
'redo',
'region'=>
'map-marked',
'replacement'=>
'exchange-alt',
'resource'=>
'laptop-house',
'recurring'=>
'history',
4518 'service'=>
'concierge-bell',
4519 'skill'=>
'shapes',
'state'=>
'map-marked-alt',
'security'=>
'key',
'salary'=>
'wallet',
'shipment'=>
'dolly',
'stock'=>
'box-open',
'stats' =>
'chart-bar',
'split'=>
'code-branch',
'stripe'=>
'stripe-s',
4520 'supplier'=>
'building',
'technic'=>
'cogs',
4521 'timespent'=>
'clock',
'tick' =>
'check',
'title_setup'=>
'tools',
'title_accountancy'=>
'money-check-alt',
'title_bank'=>
'university',
'title_hrm'=>
'umbrella-beach',
4522 'title_agenda'=>
'calendar-alt',
4523 'uncheck'=>
'times',
'uparrow'=>
'share',
'url'=>
'external-link-alt',
'vat'=>
'money-check-alt',
'vcard'=>
'arrow-alt-circle-down',
4524 'jabber'=>
'comment-o',
4525 'website'=>
'globe-americas',
'workstation'=>
'pallet',
'webhook'=>
'bullseye',
'world'=>
'globe',
'private'=>
'user-lock',
4526 'conferenceorbooth'=>
'chalkboard-teacher',
'eventorganization'=>
'project-diagram'
4528 if ($conf->currency ==
'EUR') {
4529 $arrayconvpictotofa[
'currency'] =
'euro-sign';
4530 $arrayconvpictotofa[
'multicurrency'] =
'dollar-sign';
4532 $arrayconvpictotofa[
'currency'] =
'dollar-sign';
4533 $arrayconvpictotofa[
'multicurrency'] =
'euro-sign';
4535 if ($pictowithouttext ==
'off') {
4536 $fakey =
'fa-square';
4538 } elseif ($pictowithouttext ==
'on') {
4539 $fakey =
'fa-check-square';
4541 } elseif ($pictowithouttext ==
'listlight') {
4542 $fakey =
'fa-download';
4543 $marginleftonlyshort = 1;
4544 } elseif ($pictowithouttext ==
'printer') {
4545 $fakey =
'fa-print';
4547 } elseif ($pictowithouttext ==
'note') {
4548 $fakey =
'fa-sticky-note';
4549 $marginleftonlyshort = 1;
4550 } elseif (in_array($pictowithouttext, array(
'1uparrow',
'1downarrow',
'1leftarrow',
'1rightarrow',
'1uparrow_selected',
'1downarrow_selected',
'1leftarrow_selected',
'1rightarrow_selected'))) {
4551 $convertarray = array(
'1uparrow'=>
'caret-up',
'1downarrow'=>
'caret-down',
'1leftarrow'=>
'caret-left',
'1rightarrow'=>
'caret-right',
'1uparrow_selected'=>
'caret-up',
'1downarrow_selected'=>
'caret-down',
'1leftarrow_selected'=>
'caret-left',
'1rightarrow_selected'=>
'caret-right');
4552 $fakey =
'fa-'.$convertarray[$pictowithouttext];
4553 if (preg_match(
'/selected/', $pictowithouttext)) {
4556 $marginleftonlyshort = 1;
4557 } elseif (!empty($arrayconvpictotofa[$pictowithouttext])) {
4558 $fakey =
'fa-'.$arrayconvpictotofa[$pictowithouttext];
4560 $fakey =
'fa-'.$pictowithouttext;
4563 if (in_array($pictowithouttext, array(
'dollyrevert',
'member',
'members',
'contract',
'group',
'resource',
'shipment'))) {
4564 $morecss .=
' em092';
4566 if (in_array($pictowithouttext, array(
'conferenceorbooth',
'collab',
'eventorganization',
'holiday',
'info',
'project',
'workstation'))) {
4567 $morecss .=
' em088';
4569 if (in_array($pictowithouttext, array(
'asset',
'intervention',
'payment',
'loan',
'partnership',
'stock',
'technic'))) {
4570 $morecss .=
' em080';
4574 $arrayconvpictotomarginleftonly = array(
4575 'bank',
'check',
'delete',
'generic',
'grip',
'grip_title',
'jabber',
4576 'grip_title',
'grip',
'listlight',
'note',
'on',
'off',
'playdisabled',
'printer',
'resize',
'sign-out',
'stats',
'switch_on',
'switch_on_red',
'switch_off',
4577 'uparrow',
'1uparrow',
'1downarrow',
'1leftarrow',
'1rightarrow',
'1uparrow_selected',
'1downarrow_selected',
'1leftarrow_selected',
'1rightarrow_selected'
4579 if (!isset($arrayconvpictotomarginleftonly[$pictowithouttext])) {
4580 $marginleftonlyshort = 0;
4584 $arrayconvpictotomorcess = array(
4585 'action'=>
'infobox-action',
'account'=>
'infobox-bank_account',
'accounting_account'=>
'infobox-bank_account',
'accountline'=>
'infobox-bank_account',
'accountancy'=>
'infobox-bank_account',
'asset'=>
'infobox-bank_account',
4586 'bank_account'=>
'infobox-bank_account',
4587 'bill'=>
'infobox-commande',
'billa'=>
'infobox-commande',
'billr'=>
'infobox-commande',
'billd'=>
'infobox-commande',
4588 'margin'=>
'infobox-bank_account',
'conferenceorbooth'=>
'infobox-project',
4589 'cash-register'=>
'infobox-bank_account',
'contract'=>
'infobox-contrat',
'check'=>
'font-status4',
'collab'=>
'infobox-action',
'conversation'=>
'infobox-contrat',
4590 'donation'=>
'infobox-commande',
'dolly'=>
'infobox-commande',
'dollyrevert'=>
'flip infobox-order_supplier',
4591 'ecm'=>
'infobox-action',
'eventorganization'=>
'infobox-project',
4592 'hrm'=>
'infobox-adherent',
'group'=>
'infobox-adherent',
'intervention'=>
'infobox-contrat',
4593 'incoterm'=>
'infobox-supplier_proposal',
4594 'currency'=>
'infobox-bank_account',
'multicurrency'=>
'infobox-bank_account',
4595 'members'=>
'infobox-adherent',
'member'=>
'infobox-adherent',
'money-bill-alt'=>
'infobox-bank_account',
4596 'order'=>
'infobox-commande',
4597 'user'=>
'infobox-adherent',
'users'=>
'infobox-adherent',
4598 'error'=>
'pictoerror',
'warning'=>
'pictowarning',
'switch_on'=>
'font-status4',
'switch_on_warning'=>
'font-status4 warning',
'switch_on_red'=>
'font-status8',
4599 'holiday'=>
'infobox-holiday',
'info'=>
'opacityhigh',
'invoice'=>
'infobox-commande',
4600 'knowledgemanagement'=>
'infobox-contrat rotate90',
'loan'=>
'infobox-bank_account',
4601 'payment'=>
'infobox-bank_account',
'payment_vat'=>
'infobox-bank_account',
'poll'=>
'infobox-adherent',
'pos'=>
'infobox-bank_account',
'project'=>
'infobox-project',
'projecttask'=>
'infobox-project',
4602 'propal'=>
'infobox-propal',
'proposal'=>
'infobox-propal',
'private'=>
'infobox-project',
4603 'reception'=>
'flip',
'recruitmentjobposition'=>
'infobox-adherent',
'recruitmentcandidature'=>
'infobox-adherent',
4604 'resource'=>
'infobox-action',
4605 'salary'=>
'infobox-bank_account',
'shapes'=>
'infobox-adherent',
'shipment'=>
'infobox-commande',
'supplier_invoice'=>
'infobox-order_supplier',
'supplier_invoicea'=>
'infobox-order_supplier',
'supplier_invoiced'=>
'infobox-order_supplier',
4606 'supplier'=>
'infobox-order_supplier',
'supplier_order'=>
'infobox-order_supplier',
'supplier_proposal'=>
'infobox-supplier_proposal',
4607 'ticket'=>
'infobox-contrat',
'title_accountancy'=>
'infobox-bank_account',
'title_hrm'=>
'infobox-holiday',
'expensereport'=>
'infobox-expensereport',
'trip'=>
'infobox-expensereport',
'title_agenda'=>
'infobox-action',
4608 'vat'=>
'infobox-bank_account',
4610 'list-alt'=>
'imgforviewmode',
'calendar'=>
'imgforviewmode',
'calendarweek'=>
'imgforviewmode',
'calendarmonth'=>
'imgforviewmode',
'calendarday'=>
'imgforviewmode',
'calendarperuser'=>
'imgforviewmode'
4612 if (!empty($arrayconvpictotomorcess[$pictowithouttext]) && strpos($picto,
'_nocolor') ===
false) {
4613 $morecss .= ($morecss ?
' ' :
'').$arrayconvpictotomorcess[$pictowithouttext];
4617 $arrayconvpictotocolor = array(
4618 'address'=>
'#6c6aa8',
'building'=>
'#6c6aa8',
'bom'=>
'#a69944',
4619 'clone'=>
'#999',
'cog'=>
'#999',
'companies'=>
'#6c6aa8',
'company'=>
'#6c6aa8',
'contact'=>
'#6c6aa8',
'cron'=>
'#555',
4620 'dynamicprice'=>
'#a69944',
4621 'edit'=>
'#444',
'note'=>
'#999',
'error'=>
'',
'help'=>
'#bbb',
'listlight'=>
'#999',
'language'=>
'#555',
4623 'lock'=>
'#ddd',
'lot'=>
'#a69944',
4624 'map-marker-alt'=>
'#aaa',
'mrp'=>
'#a69944',
'product'=>
'#a69944',
'service'=>
'#a69944',
'inventory'=>
'#a69944',
'stock'=>
'#a69944',
'movement'=>
'#a69944',
4625 'other'=>
'#ddd',
'world'=>
'#986c6a',
4626 'partnership'=>
'#6c6aa8',
'playdisabled'=>
'#ccc',
'printer'=>
'#444',
'projectpub'=>
'#986c6a',
'reception'=>
'#a69944',
'resize'=>
'#444',
'rss'=>
'#cba',
4628 'security'=>
'#999',
'square'=>
'#888',
'stop-circle'=>
'#888',
'stats'=>
'#444',
'switch_off'=>
'#999',
4629 'technic' =>
'#999',
'tick' =>
'#282',
'timespent' =>
'#555',
4630 'uncheck'=>
'#800',
'uparrow'=>
'#555',
'user-cog'=>
'#999',
'country'=>
'#aaa',
'globe-americas'=>
'#aaa',
'region'=>
'#aaa',
'state'=>
'#aaa',
4631 'website'=>
'#304',
'workstation'=>
'#a69944'
4633 if (isset($arrayconvpictotocolor[$pictowithouttext]) && strpos($picto,
'_nocolor') ===
false) {
4634 $facolor = $arrayconvpictotocolor[$pictowithouttext];
4641 if (preg_match(
'/class="([^"]+)"/', $moreatt, $reg)) {
4642 $morecss .= ($morecss ?
' ' :
'').$reg[1];
4643 $moreatt = str_replace(
'class="'.$reg[1].
'"',
'', $moreatt);
4645 if (preg_match(
'/style="([^"]+)"/', $moreatt, $reg)) {
4646 $morestyle = $reg[1];
4647 $moreatt = str_replace(
'style="'.$reg[1].
'"',
'', $moreatt);
4649 $moreatt = trim($moreatt);
4651 $enabledisablehtml =
'<span class="'.$fa.
' '.$fakey.($marginleftonlyshort ? ($marginleftonlyshort == 1 ?
' marginleftonlyshort' :
' marginleftonly') :
'');
4652 $enabledisablehtml .= ($morecss ?
' '.$morecss :
'').
'" style="'.($fasize ? (
'font-size: '.$fasize.
';') :
'').($facolor ? (
' color: '.$facolor.
';') :
'').($morestyle ?
' '.$morestyle :
'').
'"'.(($notitle || empty($titlealt)) ?
'' :
' title="'.dol_escape_htmltag($titlealt).
'"').($moreatt ?
' '.$moreatt :
'').
'>';
4656 $enabledisablehtml .=
'</span>';
4658 return $enabledisablehtml;
4665 } elseif (!empty($conf->modules_parts[
'theme']) && array_key_exists($theme, $conf->modules_parts[
'theme'])) {
4666 $path = $theme.
'/theme/'.$theme;
4671 if (preg_match(
'/^([^@]+)@([^@]+)$/i', $picto, $regs)) {
4677 if (!preg_match(
'/(\.png|\.gif|\.svg)$/i', $picto)) {
4682 foreach ($conf->file->dol_document_root as $type => $dirroot) {
4683 if ($type ==
'main') {
4687 if (file_exists($dirroot.
'/'.$path.
'/img/'.$picto)) {
4688 $url = DOL_URL_ROOT.$conf->file->dol_url_root[$type];
4694 $fullpathpicto = $url.
'/'.$path.
'/img/'.$picto;
4698 return $fullpathpicto;
4702 return '<img src="'.$fullpathpicto.
'"'.($notitle ?
'' :
' alt="'.dol_escape_htmltag($alt).
'"').(($notitle || empty($titlealt)) ?
'' :
' title="'.dol_escape_htmltag($titlealt).
'"').($moreatt ?
' '.$moreatt.($morecss ?
' class="'.$morecss.
'"' :
'') :
' class="inline-block'.($morecss ?
' '.$morecss :
'').
'"').
'>';