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;
2341function dol_banner_tab($object, $paramid, $morehtml =
'', $shownav = 1, $fieldid =
'rowid', $fieldref =
'ref', $morehtmlref =
'', $moreparam =
'', $nodbprefix = 0, $morehtmlleft =
'', $morehtmlstatus =
'', $onlybanner = 0, $morehtmlright =
'')
2343 global $conf, $form, $user, $langs, $hookmanager, $action;
2347 $maxvisiblephotos = 1;
2349 $entity = (empty($object->entity) ? $conf->entity : $object->entity);
2350 $showbarcode = empty($conf->barcode->enabled) ? 0 : (empty($object->barcode) ? 0 : 1);
2351 if (
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') && !$user->hasRight(
'barcode',
'lire_advance')) {
2354 $modulepart =
'unknown';
2356 if ($object->element ==
'societe' || $object->element ==
'contact' || $object->element ==
'product' || $object->element ==
'ticket') {
2357 $modulepart = $object->element;
2358 } elseif ($object->element ==
'member') {
2359 $modulepart =
'memberphoto';
2360 } elseif ($object->element ==
'user') {
2361 $modulepart =
'userphoto';
2364 if (class_exists(
"Imagick")) {
2365 if ($object->element ==
'expensereport' || $object->element ==
'propal' || $object->element ==
'commande' || $object->element ==
'facture' || $object->element ==
'supplier_proposal') {
2366 $modulepart = $object->element;
2367 } elseif ($object->element ==
'fichinter') {
2368 $modulepart =
'ficheinter';
2369 } elseif ($object->element ==
'contrat') {
2370 $modulepart =
'contract';
2371 } elseif ($object->element ==
'order_supplier') {
2372 $modulepart =
'supplier_order';
2373 } elseif ($object->element ==
'invoice_supplier') {
2374 $modulepart =
'supplier_invoice';
2378 if ($object->element ==
'product') {
2380 $cssclass =
'photowithmargin photoref';
2381 $showimage = $object->is_photo_available($conf->product->multidir_output[$entity]);
2382 $maxvisiblephotos = (isset($conf->global->PRODUCT_MAX_VISIBLE_PHOTO) ? $conf->global->PRODUCT_MAX_VISIBLE_PHOTO : 5);
2383 if ($conf->browser->layout ==
'phone') {
2384 $maxvisiblephotos = 1;
2387 $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>';
2391 $morehtmlleft .=
'<div class="floatleft inline-block valignmiddle divphotoref"></div>';
2393 $nophoto =
'/public/theme/common/nophoto.png';
2394 $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>';
2397 } elseif ($object->element ==
'ticket') {
2399 $cssclass =
'photoref';
2400 $showimage = $object->is_photo_available($conf->ticket->multidir_output[$entity].
'/'.$object->ref);
2401 $maxvisiblephotos = (isset($conf->global->TICKET_MAX_VISIBLE_PHOTO) ? $conf->global->TICKET_MAX_VISIBLE_PHOTO : 2);
2402 if ($conf->browser->layout ==
'phone') {
2403 $maxvisiblephotos = 1;
2407 $showphoto = $object->show_photos(
'ticket', $conf->ticket->multidir_output[$entity],
'small', $maxvisiblephotos, 0, 0, 0, $width, 0);
2408 if ($object->nbphoto > 0) {
2409 $morehtmlleft .=
'<div class="floatleft inline-block valignmiddle divphotoref">'.$showphoto.
'</div>';
2417 $morehtmlleft .=
'<div class="floatleft inline-block valignmiddle divphotoref"></div>';
2419 $nophoto =
img_picto(
'No photo',
'object_ticket');
2420 $morehtmlleft .=
'<!-- No photo to show -->';
2421 $morehtmlleft .=
'<div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref">';
2422 $morehtmlleft .= $nophoto;
2423 $morehtmlleft .=
'</div></div>';
2428 if ($modulepart !=
'unknown') {
2431 if (in_array($modulepart, array(
'propal',
'commande',
'facture',
'ficheinter',
'contract',
'supplier_order',
'supplier_proposal',
'supplier_invoice',
'expensereport')) && class_exists(
"Imagick")) {
2433 $dir_output = (empty($conf->$modulepart->multidir_output[$entity]) ? $conf->$modulepart->dir_output : $conf->$modulepart->multidir_output[$entity]).
"/";
2434 if (in_array($modulepart, array(
'invoice_supplier',
'supplier_invoice'))) {
2435 $subdir =
get_exdir($object->id, 2, 0, 1, $object, $modulepart);
2436 $subdir .= ((!empty($subdir) && !preg_match(
'/\/$/', $subdir)) ?
'/' :
'').$objectref;
2438 $subdir =
get_exdir($object->id, 0, 0, 1, $object, $modulepart);
2440 if (empty($subdir)) {
2441 $subdir =
'errorgettingsubdirofobject';
2444 $filepath = $dir_output.$subdir.
"/";
2446 $filepdf = $filepath.$objectref.
".pdf";
2447 $relativepath = $subdir.
'/'.$objectref.
'.pdf';
2450 $fileimage = $filepdf.
'_preview.png';
2451 $relativepathimage = $relativepath.
'_preview.png';
2453 $pdfexists = file_exists($filepdf);
2458 if (!file_exists($fileimage) || (filemtime($fileimage) < filemtime($filepdf))) {
2460 include_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
2469 if ($pdfexists && !$error) {
2470 $heightforphotref = 80;
2471 if (!empty($conf->dol_optimize_smallscreen)) {
2472 $heightforphotref = 60;
2475 if (file_exists($fileimage)) {
2476 $phototoshow =
'<div class="photoref">';
2477 $phototoshow .=
'<img height="'.$heightforphotref.
'" class="photo photowithborder" src="'.DOL_URL_ROOT.
'/viewimage.php?modulepart=apercu'.$modulepart.
'&file='.urlencode($relativepathimage).
'">';
2478 $phototoshow .=
'</div>';
2481 } elseif (!$phototoshow) {
2482 $phototoshow .= $form->showphoto($modulepart, $object, 0, 0, 0,
'photowithmargin photoref',
'small', 1, 0, $maxvisiblephotos);
2486 $morehtmlleft .=
'<div class="floatleft inline-block valignmiddle divphotoref">';
2487 $morehtmlleft .= $phototoshow;
2488 $morehtmlleft .=
'</div>';
2492 if (empty($phototoshow)) {
2493 if ($object->element ==
'action') {
2495 $cssclass =
'photorefcenter';
2496 $nophoto =
img_picto(
'No photo',
'title_agenda');
2499 $cssclass =
'photorefcenter';
2500 $picto = $object->picto;
2501 $prefix =
'object_';
2502 if ($object->element ==
'project' && !$object->public) {
2505 if (strpos($picto,
'fontawesome_') !==
false) {
2508 $nophoto =
img_picto(
'No photo', $prefix.$picto);
2510 $morehtmlleft .=
'<!-- No photo to show -->';
2511 $morehtmlleft .=
'<div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref">';
2512 $morehtmlleft .= $nophoto;
2513 $morehtmlleft .=
'</div></div>';
2520 $morehtmlleft .=
'<div class="floatleft inline-block valignmiddle divphotoref">'.$form->showbarcode($object, 100,
'photoref valignmiddle').
'</div>';
2523 if ($object->element ==
'societe') {
2524 if (!empty($conf->use_javascript_ajax) && $user->hasRight(
'societe',
'creer') &&
getDolGlobalString(
'MAIN_DIRECT_STATUS_UPDATE')) {
2525 $morehtmlstatus .=
ajax_object_onoff($object,
'status',
'status',
'InActivity',
'ActivityCeased');
2527 $morehtmlstatus .= $object->getLibStatut(6);
2529 } elseif ($object->element ==
'product') {
2531 if (!empty($conf->use_javascript_ajax) && $user->hasRight(
'produit',
'creer') &&
getDolGlobalString(
'MAIN_DIRECT_STATUS_UPDATE')) {
2532 $morehtmlstatus .=
ajax_object_onoff($object,
'status',
'tosell',
'ProductStatusOnSell',
'ProductStatusNotOnSell');
2534 $morehtmlstatus .=
'<span class="statusrefsell">'.$object->getLibStatut(6, 0).
'</span>';
2536 $morehtmlstatus .=
' ';
2538 if (!empty($conf->use_javascript_ajax) && $user->hasRight(
'produit',
'creer') &&
getDolGlobalString(
'MAIN_DIRECT_STATUS_UPDATE')) {
2539 $morehtmlstatus .=
ajax_object_onoff($object,
'status_buy',
'tobuy',
'ProductStatusOnBuy',
'ProductStatusNotOnBuy');
2541 $morehtmlstatus .=
'<span class="statusrefbuy">'.$object->getLibStatut(6, 1).
'</span>';
2543 } elseif (in_array($object->element, array(
'salary'))) {
2544 $tmptxt = $object->getLibStatut(6, $object->alreadypaid);
2545 if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3)) {
2546 $tmptxt = $object->getLibStatut(5, $object->alreadypaid);
2548 $morehtmlstatus .= $tmptxt;
2549 } elseif (in_array($object->element, array(
'facture',
'invoice',
'invoice_supplier'))) {
2550 $totalallpayments = $object->getSommePaiement(0);
2551 $totalallpayments += $object->getSumCreditNotesUsed(0);
2552 $totalallpayments += $object->getSumDepositsUsed(0);
2553 $tmptxt = $object->getLibStatut(6, $totalallpayments);
2554 if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3)) {
2555 $tmptxt = $object->getLibStatut(5, $totalallpayments);
2557 $morehtmlstatus .= $tmptxt;
2558 } elseif (in_array($object->element, array(
'chargesociales',
'loan',
'tva'))) {
2559 $tmptxt = $object->getLibStatut(6, $object->totalpaid);
2560 if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3)) {
2561 $tmptxt = $object->getLibStatut(5, $object->totalpaid);
2563 $morehtmlstatus .= $tmptxt;
2564 } elseif ($object->element ==
'contrat' || $object->element ==
'contract') {
2565 if ($object->statut == 0) {
2566 $morehtmlstatus .= $object->getLibStatut(5);
2568 $morehtmlstatus .= $object->getLibStatut(4);
2570 } elseif ($object->element ==
'facturerec') {
2571 if ($object->frequency == 0) {
2572 $morehtmlstatus .= $object->getLibStatut(2);
2574 $morehtmlstatus .= $object->getLibStatut(5);
2576 } elseif ($object->element ==
'project_task') {
2577 $object->fk_statut = 1;
2578 if ($object->progress > 0) {
2579 $object->fk_statut = 2;
2581 if ($object->progress >= 100) {
2582 $object->fk_statut = 3;
2584 $tmptxt = $object->getLibStatut(5);
2585 $morehtmlstatus .= $tmptxt;
2586 } elseif (method_exists($object,
'getLibStatut')) {
2587 $tmptxt = $object->getLibStatut(6);
2588 if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3)) {
2589 $tmptxt = $object->getLibStatut(5);
2591 $morehtmlstatus .= $tmptxt;
2595 if (isModEnabled(
'accounting') && in_array($object->element, array(
'bank',
'paiementcharge',
'facture',
'invoice',
'invoice_supplier',
'expensereport',
'payment_various'))) {
2597 if (method_exists($object,
'getVentilExportCompta')) {
2598 $accounted = $object->getVentilExportCompta();
2599 $langs->load(
"accountancy");
2600 $morehtmlstatus .=
'</div><div class="statusref statusrefbis"><span class="opacitymedium">'.($accounted > 0 ? $langs->trans(
"Accounted") : $langs->trans(
"NotYetAccounted")).
'</span>';
2605 if (!empty($object->name_alias)) {
2606 $morehtmlref .=
'<div class="refidno opacitymedium">'.dol_escape_htmltag($object->name_alias).
'</div>';
2610 if (in_array($object->element, array(
'product',
'bank_account',
'project_task'))) {
2611 if (!empty($object->label)) {
2612 $morehtmlref .=
'<div class="refidno opacitymedium">'.$object->label.
'</div>';
2617 if (method_exists($object,
'getBannerAddress') && !in_array($object->element, array(
'product',
'bookmark',
'ecm_directories',
'ecm_files'))) {
2618 $moreaddress = $object->getBannerAddress(
'refaddress', $object);
2620 $morehtmlref .=
'<div class="refidno refaddress">';
2621 $morehtmlref .= $moreaddress;
2622 $morehtmlref .=
'</div>';
2625 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)) {
2626 $morehtmlref .=
'<div style="clear: both;"></div>';
2627 $morehtmlref .=
'<div class="refidno opacitymedium">';
2628 $morehtmlref .= $langs->trans(
"TechnicalID").
': '.((int) $object->id);
2629 $morehtmlref .=
'</div>';
2632 $parameters=array(
'morehtmlref'=>$morehtmlref);
2633 $reshook = $hookmanager->executeHooks(
'formDolBanner', $parameters, $object, $action);
2636 } elseif (empty($reshook)) {
2637 $morehtmlref .= $hookmanager->resPrint;
2638 } elseif ($reshook > 0) {
2639 $morehtmlref = $hookmanager->resPrint;
2642 print
'<div class="'.($onlybanner ?
'arearefnobottom ' :
'arearef ').
'heightref valignmiddle centpercent">';
2643 print $form->showrefnav($object, $paramid, $morehtml, $shownav, $fieldid, $fieldref, $morehtmlref, $moreparam, $nodbprefix, $morehtmlleft, $morehtmlstatus, $morehtmlright);
2645 print
'<div class="underrefbanner clearboth"></div>';
2825function dol_print_date($time, $format =
'', $tzoutput =
'auto', $outputlangs =
'', $encodetooutput =
false)
2827 global $conf, $langs;
2834 if ($tzoutput ===
'auto') {
2835 $tzoutput = (empty($conf) ?
'tzserver' : (isset($conf->tzuserinputkey) ? $conf->tzuserinputkey :
'tzserver'));
2840 $offsettz = $offsetdst = 0;
2843 if (is_string($tzoutput)) {
2844 if ($tzoutput ==
'tzserver') {
2846 $offsettzstring = @date_default_timezone_get();
2849 } elseif ($tzoutput ==
'tzuser' || $tzoutput ==
'tzuserrel') {
2851 $offsettzstring = (empty($_SESSION[
'dol_tz_string']) ?
'UTC' : $_SESSION[
'dol_tz_string']);
2853 if (class_exists(
'DateTimeZone')) {
2854 $user_date_tz =
new DateTimeZone($offsettzstring);
2855 $user_dt =
new DateTime();
2856 $user_dt->setTimezone($user_date_tz);
2857 $user_dt->setTimestamp($tzoutput ==
'tzuser' ?
dol_now() : (int) $time);
2858 $offsettz = $user_dt->getOffset();
2860 $offsettz = (empty($_SESSION[
'dol_tz']) ? 0 : $_SESSION[
'dol_tz']) * 60 * 60;
2861 $offsetdst = (empty($_SESSION[
'dol_dst']) ? 0 : $_SESSION[
'dol_dst']) * 60 * 60;
2866 if (!is_object($outputlangs)) {
2867 $outputlangs = $langs;
2870 $format =
'daytextshort';
2875 $reduceformat = (!empty($conf->dol_optimize_smallscreen) && in_array($format, array(
'day',
'dayhour',
'dayhoursec'))) ? 1 : 0;
2876 $format = preg_replace(
'/inputnoreduce/',
'', $format);
2877 $formatwithoutreduce = preg_replace(
'/reduceformat/',
'', $format);
2878 if ($formatwithoutreduce != $format) {
2879 $format = $formatwithoutreduce;
2885 if ($format ==
'day') {
2886 $format = ($outputlangs->trans(
"FormatDateShort") !=
"FormatDateShort" ? $outputlangs->trans(
"FormatDateShort") : $conf->format_date_short);
2887 } elseif ($format ==
'hour') {
2888 $format = ($outputlangs->trans(
"FormatHourShort") !=
"FormatHourShort" ? $outputlangs->trans(
"FormatHourShort") : $conf->format_hour_short);
2889 } elseif ($format ==
'hourduration') {
2890 $format = ($outputlangs->trans(
"FormatHourShortDuration") !=
"FormatHourShortDuration" ? $outputlangs->trans(
"FormatHourShortDuration") : $conf->format_hour_short_duration);
2891 } elseif ($format ==
'daytext') {
2892 $format = ($outputlangs->trans(
"FormatDateText") !=
"FormatDateText" ? $outputlangs->trans(
"FormatDateText") : $conf->format_date_text);
2893 } elseif ($format ==
'daytextshort') {
2894 $format = ($outputlangs->trans(
"FormatDateTextShort") !=
"FormatDateTextShort" ? $outputlangs->trans(
"FormatDateTextShort") : $conf->format_date_text_short);
2895 } elseif ($format ==
'dayhour') {
2896 $format = ($outputlangs->trans(
"FormatDateHourShort") !=
"FormatDateHourShort" ? $outputlangs->trans(
"FormatDateHourShort") : $conf->format_date_hour_short);
2897 } elseif ($format ==
'dayhoursec') {
2898 $format = ($outputlangs->trans(
"FormatDateHourSecShort") !=
"FormatDateHourSecShort" ? $outputlangs->trans(
"FormatDateHourSecShort") : $conf->format_date_hour_sec_short);
2899 } elseif ($format ==
'dayhourtext') {
2900 $format = ($outputlangs->trans(
"FormatDateHourText") !=
"FormatDateHourText" ? $outputlangs->trans(
"FormatDateHourText") : $conf->format_date_hour_text);
2901 } elseif ($format ==
'dayhourtextshort') {
2902 $format = ($outputlangs->trans(
"FormatDateHourTextShort") !=
"FormatDateHourTextShort" ? $outputlangs->trans(
"FormatDateHourTextShort") : $conf->format_date_hour_text_short);
2903 } elseif ($format ==
'dayhourlog') {
2905 $format =
'%Y%m%d%H%M%S';
2906 } elseif ($format ==
'dayhourlogsmall') {
2908 $format =
'%y%m%d%H%M';
2909 } elseif ($format ==
'dayhourldap') {
2910 $format =
'%Y%m%d%H%M%SZ';
2911 } elseif ($format ==
'dayhourxcard') {
2912 $format =
'%Y%m%dT%H%M%SZ';
2913 } elseif ($format ==
'dayxcard') {
2915 } elseif ($format ==
'dayrfc') {
2916 $format =
'%Y-%m-%d';
2917 } elseif ($format ==
'dayhourrfc') {
2918 $format =
'%Y-%m-%dT%H:%M:%SZ';
2919 } elseif ($format ==
'standard') {
2920 $format =
'%Y-%m-%d %H:%M:%S';
2923 if ($reduceformat) {
2924 $format = str_replace(
'%Y',
'%y', $format);
2925 $format = str_replace(
'yyyy',
'yy', $format);
2929 if (preg_match(
'/%b/i', $format)) {
2931 $format = str_replace(
'%b',
'__b__', $format);
2932 $format = str_replace(
'%B',
'__B__', $format);
2934 if (preg_match(
'/%a/i', $format)) {
2936 $format = str_replace(
'%a',
'__a__', $format);
2937 $format = str_replace(
'%A',
'__A__', $format);
2942 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)) {
2943 dol_print_error(
'',
"Functions.lib::dol_print_date function called with a bad value from page ".(empty($_SERVER[
"PHP_SELF"]) ?
'unknown' : $_SERVER[
"PHP_SELF"]));
2945 } elseif (preg_match(
'/^([0-9]+)\-([0-9]+)\-([0-9]+) ?([0-9]+)?:?([0-9]+)?:?([0-9]+)?/i', $time, $reg)) {
2947 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);
2950 $syear = (!empty($reg[1]) ? $reg[1] :
'');
2951 $smonth = (!empty($reg[2]) ? $reg[2] :
'');
2952 $sday = (!empty($reg[3]) ? $reg[3] :
'');
2953 $shour = (!empty($reg[4]) ? $reg[4] :
'');
2954 $smin = (!empty($reg[5]) ? $reg[5] :
'');
2955 $ssec = (!empty($reg[6]) ? $reg[6] :
'');
2957 $time =
dol_mktime($shour, $smin, $ssec, $smonth, $sday, $syear,
true);
2960 $tzo =
new DateTimeZone(
'UTC');
2962 $tzo =
new DateTimeZone(date_default_timezone_get());
2964 $dtts =
new DateTime();
2965 $dtts->setTimestamp($time);
2966 $dtts->setTimezone($tzo);
2967 $newformat = str_replace(
2968 array(
'%Y',
'%y',
'%m',
'%d',
'%H',
'%I',
'%M',
'%S',
'%p',
'T',
'Z',
'__a__',
'__A__',
'__b__',
'__B__'),
2969 array(
'Y',
'y',
'm',
'd',
'H',
'h',
'i',
's',
'A',
'__£__',
'__$__',
'__{__',
'__}__',
'__[__',
'__]__'),
2972 $ret = $dtts->format($newformat);
2974 array(
'__£__',
'__$__',
'__{__',
'__}__',
'__[__',
'__]__'),
2975 array(
'T',
'Z',
'__a__',
'__A__',
'__b__',
'__B__'),
2980 if ($time < 100000000000) {
2981 $timetouse = $time + $offsettz + $offsetdst;
2984 $tzo =
new DateTimeZone(
'UTC');
2986 $tzo =
new DateTimeZone(date_default_timezone_get());
2988 $dtts =
new DateTime();
2989 $dtts->setTimestamp($timetouse);
2990 $dtts->setTimezone($tzo);
2991 $newformat = str_replace(
2992 array(
'%Y',
'%y',
'%m',
'%d',
'%H',
'%I',
'%M',
'%S',
'%p',
'%w',
'T',
'Z',
'__a__',
'__A__',
'__b__',
'__B__'),
2993 array(
'Y',
'y',
'm',
'd',
'H',
'h',
'i',
's',
'A',
'w',
'__£__',
'__$__',
'__{__',
'__}__',
'__[__',
'__]__'),
2996 $ret = $dtts->format($newformat);
2998 array(
'__£__',
'__$__',
'__{__',
'__}__',
'__[__',
'__]__'),
2999 array(
'T',
'Z',
'__a__',
'__A__',
'__b__',
'__B__'),
3004 $ret =
'Bad value '.$time.
' for date';
3008 if (preg_match(
'/__b__/i', $format)) {
3009 $timetouse = $time + $offsettz + $offsetdst;
3012 $tzo =
new DateTimeZone(
'UTC');
3014 $tzo =
new DateTimeZone(date_default_timezone_get());
3016 $dtts =
new DateTime();
3017 $dtts->setTimestamp($timetouse);
3018 $dtts->setTimezone($tzo);
3019 $month = $dtts->format(
"m");
3020 $month = sprintf(
"%02d", $month);
3021 if ($encodetooutput) {
3022 $monthtext = $outputlangs->transnoentities(
'Month'.$month);
3023 $monthtextshort = $outputlangs->transnoentities(
'MonthShort'.$month);
3025 $monthtext = $outputlangs->transnoentitiesnoconv(
'Month'.$month);
3026 $monthtextshort = $outputlangs->transnoentitiesnoconv(
'MonthShort'.$month);
3029 $ret = str_replace(
'__b__', $monthtextshort, $ret);
3030 $ret = str_replace(
'__B__', $monthtext, $ret);
3034 if (preg_match(
'/__a__/i', $format)) {
3036 $timetouse = $time + $offsettz + $offsetdst;
3039 $tzo =
new DateTimeZone(
'UTC');
3041 $tzo =
new DateTimeZone(date_default_timezone_get());
3043 $dtts =
new DateTime();
3044 $dtts->setTimestamp($timetouse);
3045 $dtts->setTimezone($tzo);
3046 $w = $dtts->format(
"w");
3047 $dayweek = $outputlangs->transnoentitiesnoconv(
'Day'.$w);
3049 $ret = str_replace(
'__A__', $dayweek, $ret);
3050 $ret = str_replace(
'__a__',
dol_substr($dayweek, 0, 3), $ret);
3598function dol_print_phone($phone, $countrycode =
'', $cid = 0, $socid = 0, $addlink =
'', $separ =
" ", $withpicto =
'', $titlealt =
'', $adddivfloat = 0)
3600 global $conf, $user, $langs, $mysoc, $hookmanager;
3603 $phone = is_null($phone) ?
'' : preg_replace(
"/[\s.-]/",
"", trim($phone));
3604 if (empty($phone)) {
3608 $separ = $conf->global->MAIN_PHONE_SEPAR;
3610 if (empty($countrycode) && is_object($mysoc)) {
3611 $countrycode = $mysoc->country_code;
3615 if ($conf->dol_optimize_smallscreen) {
3620 if (strtoupper($countrycode) ==
"FR") {
3623 $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);
3625 $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 2).$separ.substr($newphone, 5, 2);
3627 $newphone = substr($newphone, 0, 2).$separ.substr($newphone, 2, 3).$separ.substr($newphone, 5, 2).$separ.substr($newphone, 7, 2);
3629 $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);
3631 $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);
3633 $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);
3635 } elseif (strtoupper($countrycode) ==
"CA") {
3637 $newphone = ($separ !=
'' ?
'(' :
'').substr($newphone, 0, 3).($separ !=
'' ?
')' :
'').$separ.substr($newphone, 3, 3).($separ !=
'' ?
'-' :
'').substr($newphone, 6, 4);
3639 } elseif (strtoupper($countrycode) ==
"PT") {
3641 $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 3).$separ.substr($newphone, 10, 3);
3643 } elseif (strtoupper($countrycode) ==
"SR") {
3645 $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 3);
3647 $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 4);
3649 } elseif (strtoupper($countrycode) ==
"DE") {
3651 $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 4).$separ.substr($newphone, 7, 4).$separ.substr($newphone, 11, 3);
3653 $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 4).$separ.substr($newphone, 10, 3);
3655 } elseif (strtoupper($countrycode) ==
"ES") {
3657 $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 3).$separ.substr($newphone, 9, 3);
3659 } elseif (strtoupper($countrycode) ==
"BF") {
3661 $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);
3663 } elseif (strtoupper($countrycode) ==
"RO") {
3665 $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);
3667 } elseif (strtoupper($countrycode) ==
"TR") {
3669 $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 3).$separ.substr($newphone, 9, 4);
3671 } elseif (strtoupper($countrycode) ==
"US") {
3673 $newphone = substr($newphone, 0, 2).$separ.substr($newphone, 2, 3).$separ.substr($newphone, 5, 3).$separ.substr($newphone, 8, 4);
3675 } elseif (strtoupper($countrycode) ==
"MX") {
3677 $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 4).$separ.substr($newphone, 7, 3).$separ.substr($newphone, 10, 2);
3679 $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);
3681 $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 3).$separ.substr($newphone, 9, 4);
3683 } elseif (strtoupper($countrycode) ==
"ML") {
3685 $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);
3687 } elseif (strtoupper($countrycode) ==
"TH") {
3689 $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 3);
3691 $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);
3693 } elseif (strtoupper($countrycode) ==
"MU") {
3696 $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 2).$separ.substr($newphone, 9, 2);
3698 $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 4).$separ.substr($newphone, 8, 2).$separ.substr($newphone, 10, 2);
3700 } elseif (strtoupper($countrycode) ==
"ZA") {
3702 $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);
3704 } elseif (strtoupper($countrycode) ==
"SY") {
3706 $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);
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, 3);
3710 } elseif (strtoupper($countrycode) ==
"AE") {
3712 $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 3).$separ.substr($newphone, 10, 2);
3714 $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 3).$separ.substr($newphone, 10, 3);
3716 $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 3).$separ.substr($newphone, 10, 4);
3718 } elseif (strtoupper($countrycode) ==
"DZ") {
3720 $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 3).$separ.substr($newphone, 10, 3);
3722 } elseif (strtoupper($countrycode) ==
"BE") {
3724 $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 3);
3726 $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 3).$separ.substr($newphone, 9, 3);
3728 } elseif (strtoupper($countrycode) ==
"PF") {
3730 $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);
3732 } elseif (strtoupper($countrycode) ==
"CO") {
3734 $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);
3736 } elseif (strtoupper($countrycode) ==
"JO") {
3738 $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);
3740 } elseif (strtoupper($countrycode) ==
"JM") {
3742 $newphone = substr($newphone, 0, 5).$separ.substr($newphone, 5, 3).$separ.substr($newphone, 8, 4);
3744 } elseif (strtoupper($countrycode) ==
"MG") {
3746 $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);
3748 } elseif (strtoupper($countrycode) ==
"GB") {
3750 $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 4).$separ.substr($newphone, 7, 3).$separ.substr($newphone, 10, 3);
3752 } elseif (strtoupper($countrycode) ==
"CH") {
3754 $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);
3756 $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);
3758 } elseif (strtoupper($countrycode) ==
"TN") {
3760 $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 2).$separ.substr($newphone, 6, 3).$separ.substr($newphone, 9, 3);
3762 } elseif (strtoupper($countrycode) ==
"GF") {
3764 $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);
3766 } elseif (strtoupper($countrycode) ==
"GP") {
3768 $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);
3770 } elseif (strtoupper($countrycode) ==
"MQ") {
3772 $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);
3774 } elseif (strtoupper($countrycode) ==
"IT") {
3776 $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 3).$separ.substr($newphone, 9, 3);
3778 $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);
3780 } elseif (strtoupper($countrycode) ==
"AU") {
3784 $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 1).$separ.substr($newphone, 4, 4).$separ.substr($newphone, 8, 4);
3786 } elseif (strtoupper($countrycode) ==
"LU") {
3789 $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 2).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 2);
3791 $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);
3793 $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);
3795 $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);
3799 $newphoneastart = $newphoneaend =
'';
3800 if (!empty($addlink)) {
3801 if ($addlink ==
'tel' || $conf->browser->layout ==
'phone' || (isModEnabled(
'clicktodial') &&
getDolGlobalString(
'CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS'))) {
3802 $newphoneastart =
'<a href="tel:'.$phone.
'">';
3803 $newphoneaend .=
'</a>';
3804 } elseif (isModEnabled(
'clicktodial') && $addlink ==
'AC_TEL') {
3805 if (empty($user->clicktodial_loaded)) {
3806 $user->fetch_clicktodial();
3810 $urlmask =
getDolGlobalString(
'CLICKTODIAL_URL',
'ErrorClickToDialModuleNotConfigured');
3811 if (!empty($user->clicktodial_url)) {
3812 $urlmask = $user->clicktodial_url;
3815 $clicktodial_poste = (!empty($user->clicktodial_poste) ? urlencode($user->clicktodial_poste) :
'');
3816 $clicktodial_login = (!empty($user->clicktodial_login) ? urlencode($user->clicktodial_login) :
'');
3817 $clicktodial_password = (!empty($user->clicktodial_password) ? urlencode($user->clicktodial_password) :
'');
3819 $url = sprintf($urlmask, urlencode($phone), $clicktodial_poste, $clicktodial_login, $clicktodial_password);
3821 $substitarray = array(
'__PHONEFROM__'=>$clicktodial_poste,
3822 '__PHONETO__'=>urlencode($phone),
3823 '__LOGIN__'=>$clicktodial_login,
3824 '__PASS__'=>$clicktodial_password);
3828 $newphoneastart =
'<a href="'.$url.
'" class="cssforclicktodial">';
3829 $newphoneaend =
'</a>';
3832 $newphoneastart =
'<a href="'.$url.
'"';
3834 $newphoneastart .=
' target="_blank" rel="noopener noreferrer"';
3836 $newphoneastart .=
'>';
3837 $newphoneaend .=
'</a>';
3842 if (isModEnabled(
'agenda') && $user->hasRight(
"agenda",
"myactions",
"create")) {
3844 $addlinktoagenda =
'';
3845 if ($addlink ==
'AC_FAX') {
3849 $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>';
3851 if ($addlinktoagenda) {
3852 $newphone =
'<span>'.$newphone.
' '.$addlinktoagenda.
'</span>';
3857 if (empty($titlealt)) {
3858 $titlealt = ($withpicto ==
'fax' ? $langs->trans(
"Fax") : $langs->trans(
"Phone"));
3863 $parameters = array(
'countrycode' => $countrycode,
'cid' => $cid,
'socid' => $socid,
'titlealt' => $titlealt,
'picto' => $withpicto);
3864 $reshook = $hookmanager->executeHooks(
'printPhone', $parameters, $phone);
3865 $rep .= $hookmanager->resPrint;
3867 if (empty($reshook)) {
3870 if ($withpicto ==
'fax') {
3871 $picto =
'phoning_fax';
3872 } elseif ($withpicto ==
'phone') {
3874 } elseif ($withpicto ==
'mobile') {
3875 $picto =
'phoning_mobile';
3880 if ($adddivfloat == 1) {
3881 $rep .=
'<div class="nospan float" style="margin-right: 10px">';
3882 } elseif (empty($adddivfloat)) {
3883 $rep .=
'<span style="margin-right: 10px;">';
3886 $rep .= $newphoneastart;
3887 $rep .= ($withpicto ?
img_picto($titlealt,
'object_'.$picto.
'.png') :
'');
3888 if ($separ !=
'hidenum') {
3889 $rep .= ($withpicto ?
' ' :
'').$newphone;
3891 $rep .= $newphoneaend;
3893 if ($adddivfloat == 1) {
3895 } elseif (empty($adddivfloat)) {
4385function img_picto($titlealt, $picto, $moreatt =
'', $pictoisfullpath =
false, $srconly = 0, $notitle = 0, $alt =
'', $morecss =
'', $marginleftonlyshort = 2)
4387 global $conf, $langs;
4390 $url = DOL_URL_ROOT;
4391 $theme = isset($conf->theme) ? $conf->theme :
null;
4392 $path =
'theme/'.$theme;
4393 if (empty($picto)) {
4398 if ($pictoisfullpath) {
4400 if (!preg_match(
'/(\.png|\.gif|\.svg)$/i', $picto)) {
4403 $fullpathpicto = $picto;
4405 if (preg_match(
'/class="([^"]+)"/', $moreatt, $reg)) {
4406 $morecss .= ($morecss ?
' ' :
'').$reg[1];
4407 $moreatt = str_replace(
'class="'.$reg[1].
'"',
'', $moreatt);
4410 $pictowithouttext = preg_replace(
'/(\.png|\.gif|\.svg)$/',
'', (is_null($picto) ?
'' : $picto));
4411 $pictowithouttext = str_replace(
'object_',
'', $pictowithouttext);
4412 $pictowithouttext = str_replace(
'_nocolor',
'', $pictowithouttext);
4414 if (strpos($pictowithouttext,
'fontawesome_') === 0 || strpos($pictowithouttext,
'fa-') === 0) {
4416 $pictowithouttext = str_replace(
'fontawesome_',
'', $pictowithouttext);
4417 $pictowithouttext = str_replace(
'fa-',
'', $pictowithouttext);
4420 if ($pictowithouttext ==
'file-o') {
4421 $pictowithouttext =
'file';
4424 $pictowithouttextarray = explode(
'_', $pictowithouttext);
4425 $marginleftonlyshort = 0;
4427 if (!empty($pictowithouttextarray[1])) {
4429 $fakey =
'fa-'.$pictowithouttextarray[0];
4430 $faprefix = empty($pictowithouttextarray[1]) ?
'fas' : $pictowithouttextarray[1];
4431 $facolor = empty($pictowithouttextarray[2]) ?
'' : $pictowithouttextarray[2];
4432 $fasize = empty($pictowithouttextarray[3]) ?
'' : $pictowithouttextarray[3];
4434 $fakey =
'fa-'.$pictowithouttext;
4444 if (preg_match(
'/class="([^"]+)"/', $moreatt, $reg)) {
4445 $morecss .= ($morecss ?
' ' :
'').$reg[1];
4446 $moreatt = str_replace(
'class="'.$reg[1].
'"',
'', $moreatt);
4448 if (preg_match(
'/style="([^"]+)"/', $moreatt, $reg)) {
4449 $morestyle = $reg[1];
4450 $moreatt = str_replace(
'style="'.$reg[1].
'"',
'', $moreatt);
4452 $moreatt = trim($moreatt);
4454 $enabledisablehtml =
'<span class="'.$faprefix.
' '.$fakey.($marginleftonlyshort ? ($marginleftonlyshort == 1 ?
' marginleftonlyshort' :
' marginleftonly') :
'');
4455 $enabledisablehtml .= ($morecss ?
' '.$morecss :
'').
'" style="'.($fasize ? (
'font-size: '.$fasize.
';') :
'').($facolor ? (
' color: '.$facolor.
';') :
'').($morestyle ?
' '.$morestyle :
'').
'"'.(($notitle || empty($titlealt)) ?
'' :
' title="'.dol_escape_htmltag($titlealt).
'"').($moreatt ?
' '.$moreatt :
'').
'>';
4459 $enabledisablehtml .=
'</span>';
4461 return $enabledisablehtml;
4464 if (empty($srconly) && in_array($pictowithouttext, array(
4465 '1downarrow',
'1uparrow',
'1leftarrow',
'1rightarrow',
'1uparrow_selected',
'1downarrow_selected',
'1leftarrow_selected',
'1rightarrow_selected',
4466 'accountancy',
'accounting_account',
'account',
'accountline',
'action',
'add',
'address',
'angle-double-down',
'angle-double-up',
'asset',
4467 'bank_account',
'barcode',
'bank',
'bell',
'bill',
'billa',
'billr',
'billd',
'birthday-cake',
'bookmark',
'bom',
'briefcase-medical',
'bug',
'building',
4468 'card',
'calendarlist',
'calendar',
'calendarmonth',
'calendarweek',
'calendarday',
'calendarperuser',
'calendarpertype',
4469 'cash-register',
'category',
'chart',
'check',
'clock',
'clone',
'close_title',
'code',
'cog',
'collab',
'company',
'contact',
'country',
'contract',
'conversation',
'cron',
'cross',
'cubes',
4470 'check-circle',
'check-square',
'currency',
'multicurrency',
4471 'chevron-left',
'chevron-right',
'chevron-down',
'chevron-top',
'commercial',
'companies',
4472 'delete',
'dolly',
'dollyrevert',
'donation',
'download',
'dynamicprice',
4473 'edit',
'ellipsis-h',
'email',
'entity',
'envelope',
'eraser',
'establishment',
'expensereport',
'external-link-alt',
'external-link-square-alt',
'eye',
4474 'filter',
'file',
'file-o',
'file-code',
'file-export',
'file-import',
'file-upload',
'autofill',
'folder',
'folder-open',
'folder-plus',
'font',
4475 'gears',
'generate',
'generic',
'globe',
'globe-americas',
'graph',
'grip',
'grip_title',
'group',
4476 'hands-helping',
'help',
'holiday',
4477 'id-card',
'images',
'incoterm',
'info',
'intervention',
'inventory',
'intracommreport',
'jobprofile',
4478 'key',
'knowledgemanagement',
4479 'label',
'language',
'line',
'link',
'list',
'list-alt',
'listlight',
'loan',
'lock',
'lot',
'long-arrow-alt-right',
4480 'margin',
'map-marker-alt',
'member',
'meeting',
'minus',
'money-bill-alt',
'movement',
'mrp',
'note',
'next',
4481 'off',
'on',
'order',
4482 'paiment',
'paragraph',
'play',
'pdf',
'phone',
'phoning',
'phoning_mobile',
'phoning_fax',
'playdisabled',
'previous',
'poll',
'pos',
'printer',
'product',
'propal',
'proposal',
'puce',
4483 'stock',
'resize',
'service',
'stats',
4484 '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',
4485 'github',
'google',
'jabber',
'microsoft',
'skype',
'twitter',
'facebook',
'linkedin',
'instagram',
'snapchat',
'youtube',
'google-plus-g',
'whatsapp',
4486 'generic',
'home',
'hrm',
'members',
'products',
'invoicing',
4487 'partnership',
'payment',
'payment_vat',
'pencil-ruler',
'pictoconfirm',
'preview',
'project',
'projectpub',
'projecttask',
'question',
'refresh',
'region',
4488 'salary',
'shipment',
'state',
'supplier_invoice',
'supplier_invoicea',
'supplier_invoicer',
'supplier_invoiced',
4489 'technic',
'ticket',
4491 'recent',
'reception',
'recruitmentcandidature',
'recruitmentjobposition',
'replacement',
'resource',
'recurring',
'rss',
4492 'shapes',
'skill',
'square',
'sort-numeric-down',
'stop-circle',
'supplier',
'supplier_proposal',
'supplier_order',
'supplier_invoice',
4493 'tick',
'timespent',
'title_setup',
'title_accountancy',
'title_bank',
'title_hrm',
'title_agenda',
4494 'uncheck',
'url',
'user-cog',
'user-injured',
'user-md',
'vat',
'website',
'workstation',
'webhook',
'world',
'private',
4495 'conferenceorbooth',
'eventorganization',
4496 'stamp',
'signature'
4498 $fakey = $pictowithouttext;
4502 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'))) {
4505 if (in_array($pictowithouttext, array(
'black-tie',
'github',
'google',
'microsoft',
'skype',
'twitter',
'facebook',
'linkedin',
'instagram',
'snapchat',
'stripe',
'stripe-s',
'youtube',
'google-plus-g',
'whatsapp'))) {
4509 $arrayconvpictotofa = array(
4510 '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',
4511 'bank_account'=>
'university',
4512 'bill'=>
'file-invoice-dollar',
'billa'=>
'file-excel',
'billr'=>
'file-invoice-dollar',
'billd'=>
'file-medical',
4513 'supplier_invoice'=>
'file-invoice-dollar',
'supplier_invoicea'=>
'file-excel',
'supplier_invoicer'=>
'file-invoice-dollar',
'supplier_invoiced'=>
'file-medical',
4515 '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',
4516 'donation'=>
'file-alt',
'dynamicprice'=>
'hand-holding-usd',
4517 'setup'=>
'cog',
'companies'=>
'building',
'products'=>
'cube',
'commercial'=>
'suitcase',
'invoicing'=>
'coins',
4518 'accounting'=>
'search-dollar',
'category'=>
'tag',
'dollyrevert'=>
'dolly',
4519 'file-o'=>
'file',
'generate'=>
'plus-square',
'hrm'=>
'user-tie',
'incoterm'=>
'truck-loading',
4520 'margin'=>
'calculator',
'members'=>
'user-friends',
'ticket'=>
'ticket-alt',
'globe'=>
'external-link-alt',
'lot'=>
'barcode',
4521 'email'=>
'at',
'establishment'=>
'building',
'edit'=>
'pencil-alt',
'entity'=>
'globe',
4522 'graph'=>
'chart-line',
'grip_title'=>
'arrows-alt',
'grip'=>
'arrows-alt',
'help'=>
'question-circle',
4523 'generic'=>
'file',
'holiday'=>
'umbrella-beach',
4524 'info'=>
'info-circle',
'inventory'=>
'boxes',
'intracommreport'=>
'globe-europe',
'jobprofile'=>
'cogs',
4525 'knowledgemanagement'=>
'ticket-alt',
'label'=>
'layer-group',
'line'=>
'bars',
'loan'=>
'money-bill-alt',
4526 'member'=>
'user-alt',
'meeting'=>
'chalkboard-teacher',
'mrp'=>
'cubes',
'next'=>
'arrow-alt-circle-right',
4527 'trip'=>
'wallet',
'expensereport'=>
'wallet',
'group'=>
'users',
'movement'=>
'people-carry',
4528 'sign-out'=>
'sign-out-alt',
4529 'switch_off'=>
'toggle-off',
'switch_on'=>
'toggle-on',
'switch_on_warning'=>
'toggle-on',
'switch_on_red'=>
'toggle-on',
'check'=>
'check',
'bookmark'=>
'star',
4530 'bank'=>
'university',
'close_title'=>
'times',
'delete'=>
'trash',
'filter'=>
'filter',
4531 'list-alt'=>
'list-alt',
'calendarlist'=>
'bars',
'calendar'=>
'calendar-alt',
'calendarmonth'=>
'calendar-alt',
'calendarweek'=>
'calendar-week',
'calendarday'=>
'calendar-day',
'calendarperuser'=>
'table',
4532 'intervention'=>
'ambulance',
'invoice'=>
'file-invoice-dollar',
'order'=>
'file-invoice',
4533 'error'=>
'exclamation-triangle',
'warning'=>
'exclamation-triangle',
4535 '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',
4536 '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',
4537 'recent' =>
'check-square',
'reception'=>
'dolly',
'recruitmentjobposition'=>
'id-card-alt',
'recruitmentcandidature'=>
'id-badge',
4538 'resize'=>
'crop',
'supplier_order'=>
'dol-order_supplier',
'supplier_proposal'=>
'file-signature',
4539 'refresh'=>
'redo',
'region'=>
'map-marked',
'replacement'=>
'exchange-alt',
'resource'=>
'laptop-house',
'recurring'=>
'history',
4540 'service'=>
'concierge-bell',
4541 'skill'=>
'shapes',
'state'=>
'map-marked-alt',
'security'=>
'key',
'salary'=>
'wallet',
'shipment'=>
'dolly',
'stock'=>
'box-open',
'stats' =>
'chart-bar',
'split'=>
'code-branch',
'stripe'=>
'stripe-s',
4542 'supplier'=>
'building',
'technic'=>
'cogs',
4543 'timespent'=>
'clock',
'tick' =>
'check',
'title_setup'=>
'tools',
'title_accountancy'=>
'money-check-alt',
'title_bank'=>
'university',
'title_hrm'=>
'umbrella-beach',
4544 'title_agenda'=>
'calendar-alt',
4545 'uncheck'=>
'times',
'uparrow'=>
'share',
'url'=>
'external-link-alt',
'vat'=>
'money-check-alt',
'vcard'=>
'arrow-alt-circle-down',
4546 'jabber'=>
'comment-o',
4547 'website'=>
'globe-americas',
'workstation'=>
'pallet',
'webhook'=>
'bullseye',
'world'=>
'globe',
'private'=>
'user-lock',
4548 'conferenceorbooth'=>
'chalkboard-teacher',
'eventorganization'=>
'project-diagram'
4550 if ($conf->currency ==
'EUR') {
4551 $arrayconvpictotofa[
'currency'] =
'euro-sign';
4552 $arrayconvpictotofa[
'multicurrency'] =
'dollar-sign';
4554 $arrayconvpictotofa[
'currency'] =
'dollar-sign';
4555 $arrayconvpictotofa[
'multicurrency'] =
'euro-sign';
4557 if ($pictowithouttext ==
'off') {
4558 $fakey =
'fa-square';
4560 } elseif ($pictowithouttext ==
'on') {
4561 $fakey =
'fa-check-square';
4563 } elseif ($pictowithouttext ==
'listlight') {
4564 $fakey =
'fa-download';
4565 $marginleftonlyshort = 1;
4566 } elseif ($pictowithouttext ==
'printer') {
4567 $fakey =
'fa-print';
4569 } elseif ($pictowithouttext ==
'note') {
4570 $fakey =
'fa-sticky-note';
4571 $marginleftonlyshort = 1;
4572 } elseif (in_array($pictowithouttext, array(
'1uparrow',
'1downarrow',
'1leftarrow',
'1rightarrow',
'1uparrow_selected',
'1downarrow_selected',
'1leftarrow_selected',
'1rightarrow_selected'))) {
4573 $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');
4574 $fakey =
'fa-'.$convertarray[$pictowithouttext];
4575 if (preg_match(
'/selected/', $pictowithouttext)) {
4578 $marginleftonlyshort = 1;
4579 } elseif (!empty($arrayconvpictotofa[$pictowithouttext])) {
4580 $fakey =
'fa-'.$arrayconvpictotofa[$pictowithouttext];
4582 $fakey =
'fa-'.$pictowithouttext;
4585 if (in_array($pictowithouttext, array(
'dollyrevert',
'member',
'members',
'contract',
'group',
'resource',
'shipment'))) {
4586 $morecss .=
' em092';
4588 if (in_array($pictowithouttext, array(
'conferenceorbooth',
'collab',
'eventorganization',
'holiday',
'info',
'project',
'workstation'))) {
4589 $morecss .=
' em088';
4591 if (in_array($pictowithouttext, array(
'asset',
'intervention',
'payment',
'loan',
'partnership',
'stock',
'technic'))) {
4592 $morecss .=
' em080';
4596 $arrayconvpictotomarginleftonly = array(
4597 'bank',
'check',
'delete',
'generic',
'grip',
'grip_title',
'jabber',
4598 'grip_title',
'grip',
'listlight',
'note',
'on',
'off',
'playdisabled',
'printer',
'resize',
'sign-out',
'stats',
'switch_on',
'switch_on_red',
'switch_off',
4599 'uparrow',
'1uparrow',
'1downarrow',
'1leftarrow',
'1rightarrow',
'1uparrow_selected',
'1downarrow_selected',
'1leftarrow_selected',
'1rightarrow_selected'
4601 if (!isset($arrayconvpictotomarginleftonly[$pictowithouttext])) {
4602 $marginleftonlyshort = 0;
4606 $arrayconvpictotomorcess = array(
4607 'action'=>
'infobox-action',
'account'=>
'infobox-bank_account',
'accounting_account'=>
'infobox-bank_account',
'accountline'=>
'infobox-bank_account',
'accountancy'=>
'infobox-bank_account',
'asset'=>
'infobox-bank_account',
4608 'bank_account'=>
'infobox-bank_account',
4609 'bill'=>
'infobox-commande',
'billa'=>
'infobox-commande',
'billr'=>
'infobox-commande',
'billd'=>
'infobox-commande',
4610 'margin'=>
'infobox-bank_account',
'conferenceorbooth'=>
'infobox-project',
4611 'cash-register'=>
'infobox-bank_account',
'contract'=>
'infobox-contrat',
'check'=>
'font-status4',
'collab'=>
'infobox-action',
'conversation'=>
'infobox-contrat',
4612 'donation'=>
'infobox-commande',
'dolly'=>
'infobox-commande',
'dollyrevert'=>
'flip infobox-order_supplier',
4613 'ecm'=>
'infobox-action',
'eventorganization'=>
'infobox-project',
4614 'hrm'=>
'infobox-adherent',
'group'=>
'infobox-adherent',
'intervention'=>
'infobox-contrat',
4615 'incoterm'=>
'infobox-supplier_proposal',
4616 'currency'=>
'infobox-bank_account',
'multicurrency'=>
'infobox-bank_account',
4617 'members'=>
'infobox-adherent',
'member'=>
'infobox-adherent',
'money-bill-alt'=>
'infobox-bank_account',
4618 'order'=>
'infobox-commande',
4619 'user'=>
'infobox-adherent',
'users'=>
'infobox-adherent',
4620 'error'=>
'pictoerror',
'warning'=>
'pictowarning',
'switch_on'=>
'font-status4',
'switch_on_warning'=>
'font-status4 warning',
'switch_on_red'=>
'font-status8',
4621 'holiday'=>
'infobox-holiday',
'info'=>
'opacityhigh',
'invoice'=>
'infobox-commande',
4622 'knowledgemanagement'=>
'infobox-contrat rotate90',
'loan'=>
'infobox-bank_account',
4623 'payment'=>
'infobox-bank_account',
'payment_vat'=>
'infobox-bank_account',
'poll'=>
'infobox-adherent',
'pos'=>
'infobox-bank_account',
'project'=>
'infobox-project',
'projecttask'=>
'infobox-project',
4624 'propal'=>
'infobox-propal',
'proposal'=>
'infobox-propal',
'private'=>
'infobox-project',
4625 'reception'=>
'flip',
'recruitmentjobposition'=>
'infobox-adherent',
'recruitmentcandidature'=>
'infobox-adherent',
4626 'resource'=>
'infobox-action',
4627 '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',
4628 'supplier'=>
'infobox-order_supplier',
'supplier_order'=>
'infobox-order_supplier',
'supplier_proposal'=>
'infobox-supplier_proposal',
4629 'ticket'=>
'infobox-contrat',
'title_accountancy'=>
'infobox-bank_account',
'title_hrm'=>
'infobox-holiday',
'expensereport'=>
'infobox-expensereport',
'trip'=>
'infobox-expensereport',
'title_agenda'=>
'infobox-action',
4630 'vat'=>
'infobox-bank_account',
4632 'list-alt'=>
'imgforviewmode',
'calendar'=>
'imgforviewmode',
'calendarweek'=>
'imgforviewmode',
'calendarmonth'=>
'imgforviewmode',
'calendarday'=>
'imgforviewmode',
'calendarperuser'=>
'imgforviewmode'
4634 if (!empty($arrayconvpictotomorcess[$pictowithouttext]) && strpos($picto,
'_nocolor') ===
false) {
4635 $morecss .= ($morecss ?
' ' :
'').$arrayconvpictotomorcess[$pictowithouttext];
4639 $arrayconvpictotocolor = array(
4640 'address'=>
'#6c6aa8',
'building'=>
'#6c6aa8',
'bom'=>
'#a69944',
4641 'clone'=>
'#999',
'cog'=>
'#999',
'companies'=>
'#6c6aa8',
'company'=>
'#6c6aa8',
'contact'=>
'#6c6aa8',
'cron'=>
'#555',
4642 'dynamicprice'=>
'#a69944',
4643 'edit'=>
'#444',
'note'=>
'#999',
'error'=>
'',
'help'=>
'#bbb',
'listlight'=>
'#999',
'language'=>
'#555',
4645 'lock'=>
'#ddd',
'lot'=>
'#a69944',
4646 'map-marker-alt'=>
'#aaa',
'mrp'=>
'#a69944',
'product'=>
'#a69944',
'service'=>
'#a69944',
'inventory'=>
'#a69944',
'stock'=>
'#a69944',
'movement'=>
'#a69944',
4647 'other'=>
'#ddd',
'world'=>
'#986c6a',
4648 'partnership'=>
'#6c6aa8',
'playdisabled'=>
'#ccc',
'printer'=>
'#444',
'projectpub'=>
'#986c6a',
'reception'=>
'#a69944',
'resize'=>
'#444',
'rss'=>
'#cba',
4650 'security'=>
'#999',
'square'=>
'#888',
'stop-circle'=>
'#888',
'stats'=>
'#444',
'switch_off'=>
'#999',
4651 'technic' =>
'#999',
'tick' =>
'#282',
'timespent' =>
'#555',
4652 'uncheck'=>
'#800',
'uparrow'=>
'#555',
'user-cog'=>
'#999',
'country'=>
'#aaa',
'globe-americas'=>
'#aaa',
'region'=>
'#aaa',
'state'=>
'#aaa',
4653 'website'=>
'#304',
'workstation'=>
'#a69944'
4655 if (isset($arrayconvpictotocolor[$pictowithouttext]) && strpos($picto,
'_nocolor') ===
false) {
4656 $facolor = $arrayconvpictotocolor[$pictowithouttext];
4663 if (preg_match(
'/class="([^"]+)"/', $moreatt, $reg)) {
4664 $morecss .= ($morecss ?
' ' :
'').$reg[1];
4665 $moreatt = str_replace(
'class="'.$reg[1].
'"',
'', $moreatt);
4667 if (preg_match(
'/style="([^"]+)"/', $moreatt, $reg)) {
4668 $morestyle = $reg[1];
4669 $moreatt = str_replace(
'style="'.$reg[1].
'"',
'', $moreatt);
4671 $moreatt = trim($moreatt);
4673 $enabledisablehtml =
'<span class="'.$fa.
' '.$fakey.($marginleftonlyshort ? ($marginleftonlyshort == 1 ?
' marginleftonlyshort' :
' marginleftonly') :
'');
4674 $enabledisablehtml .= ($morecss ?
' '.$morecss :
'').
'" style="'.($fasize ? (
'font-size: '.$fasize.
';') :
'').($facolor ? (
' color: '.$facolor.
';') :
'').($morestyle ?
' '.$morestyle :
'').
'"'.(($notitle || empty($titlealt)) ?
'' :
' title="'.dol_escape_htmltag($titlealt).
'"').($moreatt ?
' '.$moreatt :
'').
'>';
4678 $enabledisablehtml .=
'</span>';
4680 return $enabledisablehtml;
4687 } elseif (!empty($conf->modules_parts[
'theme']) && array_key_exists($theme, $conf->modules_parts[
'theme'])) {
4688 $path = $theme.
'/theme/'.$theme;
4693 if (preg_match(
'/^([^@]+)@([^@]+)$/i', $picto, $regs)) {
4699 if (!preg_match(
'/(\.png|\.gif|\.svg)$/i', $picto)) {
4704 foreach ($conf->file->dol_document_root as $type => $dirroot) {
4705 if ($type ==
'main') {
4709 if (file_exists($dirroot.
'/'.$path.
'/img/'.$picto)) {
4710 $url = DOL_URL_ROOT.$conf->file->dol_url_root[$type];
4716 $fullpathpicto = $url.
'/'.$path.
'/img/'.$picto;
4720 return $fullpathpicto;
4724 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 :
'').
'"').
'>';