614function GETPOST($paramname, $check =
'alphanohtml', $method = 0, $filter =
null, $options =
null, $noreplace = 0)
616 global $mysoc, $user, $conf;
618 if (empty($paramname)) {
619 return 'BadFirstParameterForGETPOST';
622 dol_syslog(
"Deprecated use of GETPOST, called with 1st param = ".$paramname.
" and 2nd param is '', when calling page ".$_SERVER[
"PHP_SELF"], LOG_WARNING);
627 if (empty($method)) {
628 $out = isset($_GET[$paramname]) ? $_GET[$paramname] : (isset($_POST[$paramname]) ? $_POST[$paramname] :
'');
629 } elseif ($method == 1) {
630 $out = isset($_GET[$paramname]) ? $_GET[$paramname] :
'';
631 } elseif ($method == 2) {
632 $out = isset($_POST[$paramname]) ? $_POST[$paramname] :
'';
633 } elseif ($method == 3) {
634 $out = isset($_POST[$paramname]) ? $_POST[$paramname] : (isset($_GET[$paramname]) ? $_GET[$paramname] :
'');
636 return 'BadThirdParameterForGETPOST';
639 if (empty($method) || $method == 3 || $method == 4) {
640 $relativepathstring = $_SERVER[
"PHP_SELF"];
642 if (constant(
'DOL_URL_ROOT')) {
643 $relativepathstring = preg_replace(
'/^'.preg_quote(constant(
'DOL_URL_ROOT'),
'/').
'/',
'', $relativepathstring);
645 $relativepathstring = preg_replace(
'/^\//',
'', $relativepathstring);
646 $relativepathstring = preg_replace(
'/^custom\//',
'', $relativepathstring);
652 if (!empty($_GET[
'restore_lastsearch_values'])) {
653 if (!empty($_SESSION[
'lastsearch_values_'.$relativepathstring])) {
654 $tmp = json_decode($_SESSION[
'lastsearch_values_'.$relativepathstring],
true);
655 if (is_array($tmp)) {
656 foreach ($tmp as $key => $val) {
657 if ($key == $paramname) {
665 if ($paramname ==
'contextpage' && !empty($_SESSION[
'lastsearch_contextpage_'.$relativepathstring])) {
666 $out = $_SESSION[
'lastsearch_contextpage_'.$relativepathstring];
667 } elseif ($paramname ==
'limit' && !empty($_SESSION[
'lastsearch_limit_'.$relativepathstring])) {
668 $out = $_SESSION[
'lastsearch_limit_'.$relativepathstring];
669 } elseif ($paramname ==
'page' && !empty($_SESSION[
'lastsearch_page_'.$relativepathstring])) {
670 $out = $_SESSION[
'lastsearch_page_'.$relativepathstring];
671 } elseif ($paramname ==
'mode' && !empty($_SESSION[
'lastsearch_mode_'.$relativepathstring])) {
672 $out = $_SESSION[
'lastsearch_mode_'.$relativepathstring];
674 } elseif (!isset($_GET[
'sortfield'])) {
677 if (!empty($_GET[
'action']) && $_GET[
'action'] ==
'create' && !isset($_GET[$paramname]) && !isset($_POST[$paramname])) {
680 if (is_object($object) && isset($object->fields[$paramname][
'default'])) {
681 $out = $object->fields[$paramname][
'default'];
684 if (!empty($conf->global->MAIN_ENABLE_DEFAULT_VALUES)) {
685 if (!empty($_GET[
'action']) && (preg_match(
'/^create/', $_GET[
'action']) || preg_match(
'/^presend/', $_GET[
'action'])) && !isset($_GET[$paramname]) && !isset($_POST[$paramname])) {
687 if (!empty($user->default_values)) {
688 if (isset($user->default_values[$relativepathstring][
'createform'])) {
689 foreach ($user->default_values[$relativepathstring][
'createform'] as $defkey => $defval) {
691 if ($defkey !=
'_noquery_') {
692 $tmpqueryarraytohave = explode(
'&', $defkey);
695 foreach ($tmpqueryarraytohave as $tmpquerytohave) {
696 if (!in_array($tmpquerytohave, $tmpqueryarraywehave)) {
709 if (isset($user->default_values[$relativepathstring][
'createform'][$defkey][$paramname])) {
710 $out = $user->default_values[$relativepathstring][
'createform'][$defkey][$paramname];
717 } elseif (!empty($paramname) && !isset($_GET[$paramname]) && !isset($_POST[$paramname])) {
719 if (!empty($user->default_values)) {
722 if ($paramname ==
'sortfield' || $paramname ==
'sortorder') {
724 if (isset($user->default_values[$relativepathstring][
'sortorder'])) {
726 foreach ($user->default_values[$relativepathstring][
'sortorder'] as $defkey => $defval) {
728 if ($defkey !=
'_noquery_') {
729 $tmpqueryarraytohave = explode(
'&', $defkey);
732 foreach ($tmpqueryarraytohave as $tmpquerytohave) {
733 if (!in_array($tmpquerytohave, $tmpqueryarraywehave)) {
746 $forbidden_chars_to_replace = array(
" ",
"'",
"/",
"\\",
":",
"*",
"?",
"\"",
"<",
">",
"|",
"[",
"]",
";",
"=");
747 foreach ($user->default_values[$relativepathstring][
'sortorder'][$defkey] as $key => $val) {
751 if ($paramname ==
'sortfield') {
754 if ($paramname ==
'sortorder') {
762 } elseif (isset($user->default_values[$relativepathstring][
'filters'])) {
763 foreach ($user->default_values[$relativepathstring][
'filters'] as $defkey => $defval) {
764 if (!empty($_GET[
'disabledefaultvalues'])) {
768 if ($defkey !=
'_noquery_') {
769 $tmpqueryarraytohave = explode(
'&', $defkey);
772 foreach ($tmpqueryarraytohave as $tmpquerytohave) {
773 if (!in_array($tmpquerytohave, $tmpqueryarraywehave)) {
785 if ($qualified && isset($user->default_values[$relativepathstring][
'filters'][$defkey][$paramname])) {
787 if (isset($_POST[
'sall']) || isset($_POST[
'search_all']) || isset($_GET[
'sall']) || isset($_GET[
'search_all'])) {
789 if (empty($conf->global->MAIN_DISABLE_DEFAULT_FILTER_FOR_QUICK_SEARCH)) {
790 $forbidden_chars_to_replace = array(
" ",
"'",
"/",
"\\",
":",
"*",
"?",
"\"",
"<",
">",
"|",
"[",
"]",
";",
"=");
791 $out =
dol_string_nospecial($user->default_values[$relativepathstring][
'filters'][$defkey][$paramname],
'', $forbidden_chars_to_replace);
794 $forbidden_chars_to_replace = array(
" ",
"'",
"/",
"\\",
":",
"*",
"?",
"\"",
"<",
">",
"|",
"[",
"]",
";",
"=");
795 $out =
dol_string_nospecial($user->default_values[$relativepathstring][
'filters'][$defkey][$paramname],
'', $forbidden_chars_to_replace);
810 if (!is_array($out) && empty($_POST[$paramname]) && empty($noreplace)) {
814 while (preg_match(
'/__([A-Z0-9]+_?[A-Z0-9]+)__/i', $out, $reg) && ($loopnb < $maxloop)) {
818 if ($reg[1] ==
'DAY') {
820 $newout = $tmp[
'mday'];
821 } elseif ($reg[1] ==
'MONTH') {
823 $newout = $tmp[
'mon'];
824 } elseif ($reg[1] ==
'YEAR') {
826 $newout = $tmp[
'year'];
827 } elseif ($reg[1] ==
'PREVIOUS_DAY') {
830 $newout = $tmp2[
'day'];
831 } elseif ($reg[1] ==
'PREVIOUS_MONTH') {
834 $newout = $tmp2[
'month'];
835 } elseif ($reg[1] ==
'PREVIOUS_YEAR') {
837 $newout = ($tmp[
'year'] - 1);
838 } elseif ($reg[1] ==
'NEXT_DAY') {
841 $newout = $tmp2[
'day'];
842 } elseif ($reg[1] ==
'NEXT_MONTH') {
845 $newout = $tmp2[
'month'];
846 } elseif ($reg[1] ==
'NEXT_YEAR') {
848 $newout = ($tmp[
'year'] + 1);
849 } elseif ($reg[1] ==
'MYCOMPANY_COUNTRY_ID' || $reg[1] ==
'MYCOUNTRY_ID' || $reg[1] ==
'MYCOUNTRYID') {
850 $newout = $mysoc->country_id;
851 } elseif ($reg[1] ==
'USER_ID' || $reg[1] ==
'USERID') {
853 } elseif ($reg[1] ==
'USER_SUPERVISOR_ID' || $reg[1] ==
'SUPERVISOR_ID' || $reg[1] ==
'SUPERVISORID') {
854 $newout = $user->fk_user;
855 } elseif ($reg[1] ==
'ENTITY_ID' || $reg[1] ==
'ENTITYID') {
856 $newout = $conf->entity;
861 $out = preg_replace(
'/__'.preg_quote($reg[1],
'/').
'__/', $newout, $out);
866 if (preg_match(
'/^array/', $check)) {
867 if (!is_array($out) || empty($out)) {
870 $tmparray = explode(
':', $check);
871 if (!empty($tmparray[1])) {
872 $tmpcheck = $tmparray[1];
874 $tmpcheck =
'alphanohtml';
876 foreach ($out as $outkey => $outval) {
877 $out[$outkey] =
sanitizeVal($outval, $tmpcheck, $filter, $options);
883 if (strpos($paramname,
'search_') === 0) {
884 $out = preg_replace(
'/([<>])([-+]?\d)/',
'\1 \2', $out);
887 $out =
sanitizeVal($out, $check, $filter, $options);
892 if ($paramname ==
'backtopage' || $paramname ==
'backtolist' || $paramname ==
'backtourl') {
893 $out = str_replace(
'\\',
'/', $out);
894 $out = str_replace(array(
':',
';',
'@',
"\t",
' '),
'', $out);
896 $oldstringtoclean = $out;
897 $out = str_ireplace(array(
'javascript',
'vbscript',
'&colon',
'&#'),
'', $out);
898 $out = preg_replace(array(
'/^[^\?]*%/'),
'', $out);
899 $out = preg_replace(array(
'/^[a-z]*\/\s*\/+/i'),
'', $out);
900 }
while ($oldstringtoclean != $out);
905 if (empty($method) || $method == 3 || $method == 4) {
906 if (preg_match(
'/^search_/', $paramname) || in_array($paramname, array(
'sortorder',
'sortfield'))) {
913 if ($out !=
'' && isset($user)) {
914 $user->lastsearch_values_tmp[$relativepathstring][$paramname] = $out;
2254function dol_banner_tab($object, $paramid, $morehtml =
'', $shownav = 1, $fieldid =
'rowid', $fieldref =
'ref', $morehtmlref =
'', $moreparam =
'', $nodbprefix = 0, $morehtmlleft =
'', $morehtmlstatus =
'', $onlybanner = 0, $morehtmlright =
'')
2256 global $conf, $form, $user, $langs, $hookmanager, $action;
2260 $maxvisiblephotos = 1;
2262 $entity = (empty($object->entity) ? $conf->entity : $object->entity);
2263 $showbarcode = empty($conf->barcode->enabled) ? 0 : (empty($object->barcode) ? 0 : 1);
2264 if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->barcode->lire_advance)) {
2267 $modulepart =
'unknown';
2269 if ($object->element ==
'societe' || $object->element ==
'contact' || $object->element ==
'product' || $object->element ==
'ticket') {
2270 $modulepart = $object->element;
2271 } elseif ($object->element ==
'member') {
2272 $modulepart =
'memberphoto';
2273 } elseif ($object->element ==
'user') {
2274 $modulepart =
'userphoto';
2277 if (class_exists(
"Imagick")) {
2278 if ($object->element ==
'expensereport' || $object->element ==
'propal' || $object->element ==
'commande' || $object->element ==
'facture' || $object->element ==
'supplier_proposal') {
2279 $modulepart = $object->element;
2280 } elseif ($object->element ==
'fichinter') {
2281 $modulepart =
'ficheinter';
2282 } elseif ($object->element ==
'contrat') {
2283 $modulepart =
'contract';
2284 } elseif ($object->element ==
'order_supplier') {
2285 $modulepart =
'supplier_order';
2286 } elseif ($object->element ==
'invoice_supplier') {
2287 $modulepart =
'supplier_invoice';
2291 if ($object->element ==
'product') {
2293 $cssclass =
'photowithmargin photoref';
2294 $showimage = $object->is_photo_available($conf->product->multidir_output[$entity]);
2295 $maxvisiblephotos = (isset($conf->global->PRODUCT_MAX_VISIBLE_PHOTO) ? $conf->global->PRODUCT_MAX_VISIBLE_PHOTO : 5);
2296 if ($conf->browser->layout ==
'phone') {
2297 $maxvisiblephotos = 1;
2300 $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>';
2302 if (!empty($conf->global->PRODUCT_NODISPLAYIFNOPHOTO)) {
2304 $morehtmlleft .=
'<div class="floatleft inline-block valignmiddle divphotoref"></div>';
2306 $nophoto =
'/public/theme/common/nophoto.png';
2307 $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>';
2310 } elseif ($object->element ==
'ticket') {
2312 $cssclass =
'photoref';
2313 $showimage = $object->is_photo_available($conf->ticket->multidir_output[$entity].
'/'.$object->ref);
2314 $maxvisiblephotos = (isset($conf->global->TICKET_MAX_VISIBLE_PHOTO) ? $conf->global->TICKET_MAX_VISIBLE_PHOTO : 2);
2315 if ($conf->browser->layout ==
'phone') {
2316 $maxvisiblephotos = 1;
2320 $showphoto = $object->show_photos(
'ticket', $conf->ticket->multidir_output[$entity],
'small', $maxvisiblephotos, 0, 0, 0, $width, 0);
2321 if ($object->nbphoto > 0) {
2322 $morehtmlleft .=
'<div class="floatleft inline-block valignmiddle divphotoref">'.$showphoto.
'</div>';
2328 if (!empty($conf->global->TICKET_NODISPLAYIFNOPHOTO)) {
2330 $morehtmlleft .=
'<div class="floatleft inline-block valignmiddle divphotoref"></div>';
2332 $nophoto =
img_picto(
'No photo',
'object_ticket');
2333 $morehtmlleft .=
'<!-- No photo to show -->';
2334 $morehtmlleft .=
'<div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref">';
2335 $morehtmlleft .= $nophoto;
2336 $morehtmlleft .=
'</div></div>';
2341 if ($modulepart !=
'unknown') {
2344 if (in_array($modulepart, array(
'propal',
'commande',
'facture',
'ficheinter',
'contract',
'supplier_order',
'supplier_proposal',
'supplier_invoice',
'expensereport')) && class_exists(
"Imagick")) {
2346 $dir_output = (empty($conf->$modulepart->multidir_output[$entity]) ? $conf->$modulepart->dir_output : $conf->$modulepart->multidir_output[$entity]).
"/";
2347 if (in_array($modulepart, array(
'invoice_supplier',
'supplier_invoice'))) {
2348 $subdir =
get_exdir($object->id, 2, 0, 1, $object, $modulepart);
2349 $subdir .= ((!empty($subdir) && !preg_match(
'/\/$/', $subdir)) ?
'/' :
'').$objectref;
2351 $subdir =
get_exdir($object->id, 0, 0, 1, $object, $modulepart);
2353 if (empty($subdir)) {
2354 $subdir =
'errorgettingsubdirofobject';
2357 $filepath = $dir_output.$subdir.
"/";
2359 $filepdf = $filepath.$objectref.
".pdf";
2360 $relativepath = $subdir.
'/'.$objectref.
'.pdf';
2363 $fileimage = $filepdf.
'_preview.png';
2364 $relativepathimage = $relativepath.
'_preview.png';
2366 $pdfexists = file_exists($filepdf);
2371 if (!file_exists($fileimage) || (filemtime($fileimage) < filemtime($filepdf))) {
2372 if (empty($conf->global->MAIN_DISABLE_PDF_THUMBS)) {
2373 include_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
2382 if ($pdfexists && !$error) {
2383 $heightforphotref = 80;
2384 if (!empty($conf->dol_optimize_smallscreen)) {
2385 $heightforphotref = 60;
2388 if (file_exists($fileimage)) {
2389 $phototoshow =
'<div class="photoref">';
2390 $phototoshow .=
'<img height="'.$heightforphotref.
'" class="photo photowithborder" src="'.DOL_URL_ROOT.
'/viewimage.php?modulepart=apercu'.$modulepart.
'&file='.urlencode($relativepathimage).
'">';
2391 $phototoshow .=
'</div>';
2394 } elseif (!$phototoshow) {
2395 $phototoshow .= $form->showphoto($modulepart, $object, 0, 0, 0,
'photowithmargin photoref',
'small', 1, 0, $maxvisiblephotos);
2399 $morehtmlleft .=
'<div class="floatleft inline-block valignmiddle divphotoref">';
2400 $morehtmlleft .= $phototoshow;
2401 $morehtmlleft .=
'</div>';
2405 if (empty($phototoshow)) {
2406 if ($object->element ==
'action') {
2408 $cssclass =
'photorefcenter';
2409 $nophoto =
img_picto(
'No photo',
'title_agenda');
2412 $cssclass =
'photorefcenter';
2413 $picto = $object->picto;
2414 $prefix =
'object_';
2415 if ($object->element ==
'project' && !$object->public) {
2418 if (strpos($picto,
'fontawesome_') !==
false) {
2421 $nophoto =
img_picto(
'No photo', $prefix.$picto);
2423 $morehtmlleft .=
'<!-- No photo to show -->';
2424 $morehtmlleft .=
'<div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref">';
2425 $morehtmlleft .= $nophoto;
2426 $morehtmlleft .=
'</div></div>';
2433 $morehtmlleft .=
'<div class="floatleft inline-block valignmiddle divphotoref">'.$form->showbarcode($object, 100,
'photoref valignmiddle').
'</div>';
2436 if ($object->element ==
'societe') {
2437 if (!empty($conf->use_javascript_ajax) && $user->hasRight(
'societe',
'creer') && !empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
2438 $morehtmlstatus .=
ajax_object_onoff($object,
'status',
'status',
'InActivity',
'ActivityCeased');
2440 $morehtmlstatus .= $object->getLibStatut(6);
2442 } elseif ($object->element ==
'product') {
2444 if (!empty($conf->use_javascript_ajax) && $user->hasRight(
'produit',
'creer') && !empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
2445 $morehtmlstatus .=
ajax_object_onoff($object,
'status',
'tosell',
'ProductStatusOnSell',
'ProductStatusNotOnSell');
2447 $morehtmlstatus .=
'<span class="statusrefsell">'.$object->getLibStatut(6, 0).
'</span>';
2449 $morehtmlstatus .=
' ';
2451 if (!empty($conf->use_javascript_ajax) && $user->hasRight(
'produit',
'creer') && !empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
2452 $morehtmlstatus .=
ajax_object_onoff($object,
'status_buy',
'tobuy',
'ProductStatusOnBuy',
'ProductStatusNotOnBuy');
2454 $morehtmlstatus .=
'<span class="statusrefbuy">'.$object->getLibStatut(6, 1).
'</span>';
2456 } elseif (in_array($object->element, array(
'facture',
'invoice',
'invoice_supplier'))) {
2457 $totalallpayments = $object->getSommePaiement(0);
2458 $totalallpayments += $object->getSumCreditNotesUsed(0);
2459 $totalallpayments += $object->getSumDepositsUsed(0);
2460 $tmptxt = $object->getLibStatut(6, $totalallpayments);
2461 if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3)) {
2462 $tmptxt = $object->getLibStatut(5, $totalallpayments);
2464 $morehtmlstatus .= $tmptxt;
2465 } elseif (in_array($object->element, array(
'chargesociales',
'loan',
'tva'))) {
2466 $tmptxt = $object->getLibStatut(6, $object->totalpaid);
2467 if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3)) {
2468 $tmptxt = $object->getLibStatut(5, $object->totalpaid);
2470 $morehtmlstatus .= $tmptxt;
2471 } elseif ($object->element ==
'contrat' || $object->element ==
'contract') {
2472 if ($object->statut == 0) {
2473 $morehtmlstatus .= $object->getLibStatut(5);
2475 $morehtmlstatus .= $object->getLibStatut(4);
2477 } elseif ($object->element ==
'facturerec') {
2478 if ($object->frequency == 0) {
2479 $morehtmlstatus .= $object->getLibStatut(2);
2481 $morehtmlstatus .= $object->getLibStatut(5);
2483 } elseif ($object->element ==
'project_task') {
2484 $object->fk_statut = 1;
2485 if ($object->progress > 0) {
2486 $object->fk_statut = 2;
2488 if ($object->progress >= 100) {
2489 $object->fk_statut = 3;
2491 $tmptxt = $object->getLibStatut(5);
2492 $morehtmlstatus .= $tmptxt;
2493 } elseif (method_exists($object,
'getLibStatut')) {
2494 $tmptxt = $object->getLibStatut(6);
2495 if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3)) {
2496 $tmptxt = $object->getLibStatut(5);
2498 $morehtmlstatus .= $tmptxt;
2502 if (isModEnabled(
'accounting') && in_array($object->element, array(
'bank',
'paiementcharge',
'facture',
'invoice',
'invoice_supplier',
'expensereport',
'payment_various'))) {
2504 if (method_exists($object,
'getVentilExportCompta')) {
2505 $accounted = $object->getVentilExportCompta();
2506 $langs->load(
"accountancy");
2507 $morehtmlstatus .=
'</div><div class="statusref statusrefbis"><span class="opacitymedium">'.($accounted > 0 ? $langs->trans(
"Accounted") : $langs->trans(
"NotYetAccounted")).
'</span>';
2512 if (!empty($object->name_alias)) {
2513 $morehtmlref .=
'<div class="refidno opacitymedium">'.dol_escape_htmltag($object->name_alias).
'</div>';
2517 if (in_array($object->element, array(
'product',
'bank_account',
'project_task'))) {
2518 if (!empty($object->label)) {
2519 $morehtmlref .=
'<div class="refidno opacitymedium">'.$object->label.
'</div>';
2524 if (method_exists($object,
'getBannerAddress') && !in_array($object->element, array(
'product',
'bookmark',
'ecm_directories',
'ecm_files'))) {
2525 $moreaddress = $object->getBannerAddress(
'refaddress', $object);
2527 $morehtmlref .=
'<div class="refidno refaddress">';
2528 $morehtmlref .= $moreaddress;
2529 $morehtmlref .=
'</div>';
2532 if (!empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && ($conf->global->MAIN_SHOW_TECHNICAL_ID ==
'1' || preg_match(
'/'.preg_quote($object->element,
'/').
'/i', $conf->global->MAIN_SHOW_TECHNICAL_ID)) && !empty($object->id)) {
2533 $morehtmlref .=
'<div style="clear: both;"></div>';
2534 $morehtmlref .=
'<div class="refidno opacitymedium">';
2535 $morehtmlref .= $langs->trans(
"TechnicalID").
': '.((int) $object->id);
2536 $morehtmlref .=
'</div>';
2539 $parameters=array(
'morehtmlref'=>$morehtmlref);
2540 $reshook = $hookmanager->executeHooks(
'formDolBanner', $parameters, $object, $action);
2543 } elseif (empty($reshook)) {
2544 $morehtmlref .= $hookmanager->resPrint;
2545 } elseif ($reshook > 0) {
2546 $morehtmlref = $hookmanager->resPrint;
2550 print
'<div class="'.($onlybanner ?
'arearefnobottom ' :
'arearef ').
'heightref valignmiddle centpercent">';
2551 print $form->showrefnav($object, $paramid, $morehtml, $shownav, $fieldid, $fieldref, $morehtmlref, $moreparam, $nodbprefix, $morehtmlleft, $morehtmlstatus, $morehtmlright);
2553 print
'<div class="underrefbanner clearboth"></div>';
2733function dol_print_date($time, $format =
'', $tzoutput =
'auto', $outputlangs =
'', $encodetooutput =
false)
2735 global $conf, $langs;
2742 if ($tzoutput ===
'auto') {
2743 $tzoutput = (empty($conf) ?
'tzserver' : (isset($conf->tzuserinputkey) ? $conf->tzuserinputkey :
'tzserver'));
2748 $offsettz = $offsetdst = 0;
2751 if (is_string($tzoutput)) {
2752 if ($tzoutput ==
'tzserver') {
2754 $offsettzstring = @date_default_timezone_get();
2757 } elseif ($tzoutput ==
'tzuser' || $tzoutput ==
'tzuserrel') {
2759 $offsettzstring = (empty($_SESSION[
'dol_tz_string']) ?
'UTC' : $_SESSION[
'dol_tz_string']);
2761 if (class_exists(
'DateTimeZone')) {
2762 $user_date_tz =
new DateTimeZone($offsettzstring);
2763 $user_dt =
new DateTime();
2764 $user_dt->setTimezone($user_date_tz);
2765 $user_dt->setTimestamp($tzoutput ==
'tzuser' ?
dol_now() : (int) $time);
2766 $offsettz = $user_dt->getOffset();
2768 $offsettz = (empty($_SESSION[
'dol_tz']) ? 0 : $_SESSION[
'dol_tz']) * 60 * 60;
2769 $offsetdst = (empty($_SESSION[
'dol_dst']) ? 0 : $_SESSION[
'dol_dst']) * 60 * 60;
2774 if (!is_object($outputlangs)) {
2775 $outputlangs = $langs;
2778 $format =
'daytextshort';
2783 $reduceformat = (!empty($conf->dol_optimize_smallscreen) && in_array($format, array(
'day',
'dayhour'))) ? 1 : 0;
2784 $format = preg_replace(
'/inputnoreduce/',
'', $format);
2785 $formatwithoutreduce = preg_replace(
'/reduceformat/',
'', $format);
2786 if ($formatwithoutreduce != $format) {
2787 $format = $formatwithoutreduce;
2793 if ($format ==
'day') {
2794 $format = ($outputlangs->trans(
"FormatDateShort") !=
"FormatDateShort" ? $outputlangs->trans(
"FormatDateShort") : $conf->format_date_short);
2795 } elseif ($format ==
'hour') {
2796 $format = ($outputlangs->trans(
"FormatHourShort") !=
"FormatHourShort" ? $outputlangs->trans(
"FormatHourShort") : $conf->format_hour_short);
2797 } elseif ($format ==
'hourduration') {
2798 $format = ($outputlangs->trans(
"FormatHourShortDuration") !=
"FormatHourShortDuration" ? $outputlangs->trans(
"FormatHourShortDuration") : $conf->format_hour_short_duration);
2799 } elseif ($format ==
'daytext') {
2800 $format = ($outputlangs->trans(
"FormatDateText") !=
"FormatDateText" ? $outputlangs->trans(
"FormatDateText") : $conf->format_date_text);
2801 } elseif ($format ==
'daytextshort') {
2802 $format = ($outputlangs->trans(
"FormatDateTextShort") !=
"FormatDateTextShort" ? $outputlangs->trans(
"FormatDateTextShort") : $conf->format_date_text_short);
2803 } elseif ($format ==
'dayhour') {
2804 $format = ($outputlangs->trans(
"FormatDateHourShort") !=
"FormatDateHourShort" ? $outputlangs->trans(
"FormatDateHourShort") : $conf->format_date_hour_short);
2805 } elseif ($format ==
'dayhoursec') {
2806 $format = ($outputlangs->trans(
"FormatDateHourSecShort") !=
"FormatDateHourSecShort" ? $outputlangs->trans(
"FormatDateHourSecShort") : $conf->format_date_hour_sec_short);
2807 } elseif ($format ==
'dayhourtext') {
2808 $format = ($outputlangs->trans(
"FormatDateHourText") !=
"FormatDateHourText" ? $outputlangs->trans(
"FormatDateHourText") : $conf->format_date_hour_text);
2809 } elseif ($format ==
'dayhourtextshort') {
2810 $format = ($outputlangs->trans(
"FormatDateHourTextShort") !=
"FormatDateHourTextShort" ? $outputlangs->trans(
"FormatDateHourTextShort") : $conf->format_date_hour_text_short);
2811 } elseif ($format ==
'dayhourlog') {
2813 $format =
'%Y%m%d%H%M%S';
2814 } elseif ($format ==
'dayhourlogsmall') {
2816 $format =
'%y%m%d%H%M';
2817 } elseif ($format ==
'dayhourldap') {
2818 $format =
'%Y%m%d%H%M%SZ';
2819 } elseif ($format ==
'dayhourxcard') {
2820 $format =
'%Y%m%dT%H%M%SZ';
2821 } elseif ($format ==
'dayxcard') {
2823 } elseif ($format ==
'dayrfc') {
2824 $format =
'%Y-%m-%d';
2825 } elseif ($format ==
'dayhourrfc') {
2826 $format =
'%Y-%m-%dT%H:%M:%SZ';
2827 } elseif ($format ==
'standard') {
2828 $format =
'%Y-%m-%d %H:%M:%S';
2831 if ($reduceformat) {
2832 $format = str_replace(
'%Y',
'%y', $format);
2833 $format = str_replace(
'yyyy',
'yy', $format);
2837 if (preg_match(
'/%b/i', $format)) {
2839 $format = str_replace(
'%b',
'__b__', $format);
2840 $format = str_replace(
'%B',
'__B__', $format);
2842 if (preg_match(
'/%a/i', $format)) {
2844 $format = str_replace(
'%a',
'__a__', $format);
2845 $format = str_replace(
'%A',
'__A__', $format);
2850 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)) {
2851 dol_print_error(
'',
"Functions.lib::dol_print_date function called with a bad value from page ".$_SERVER[
"PHP_SELF"]);
2853 } elseif (preg_match(
'/^([0-9]+)\-([0-9]+)\-([0-9]+) ?([0-9]+)?:?([0-9]+)?:?([0-9]+)?/i', $time, $reg)) {
2855 dol_syslog(
"Functions.lib::dol_print_date function called with a bad value from page ".$_SERVER[
"PHP_SELF"], LOG_WARNING);
2858 $syear = (!empty($reg[1]) ? $reg[1] :
'');
2859 $smonth = (!empty($reg[2]) ? $reg[2] :
'');
2860 $sday = (!empty($reg[3]) ? $reg[3] :
'');
2861 $shour = (!empty($reg[4]) ? $reg[4] :
'');
2862 $smin = (!empty($reg[5]) ? $reg[5] :
'');
2863 $ssec = (!empty($reg[6]) ? $reg[6] :
'');
2865 $time =
dol_mktime($shour, $smin, $ssec, $smonth, $sday, $syear,
true);
2868 $tzo =
new DateTimeZone(
'UTC');
2870 $tzo =
new DateTimeZone(date_default_timezone_get());
2872 $dtts =
new DateTime();
2873 $dtts->setTimestamp($time);
2874 $dtts->setTimezone($tzo);
2875 $newformat = str_replace(
2876 array(
'%Y',
'%y',
'%m',
'%d',
'%H',
'%I',
'%M',
'%S',
'%p',
'T',
'Z',
'__a__',
'__A__',
'__b__',
'__B__'),
2877 array(
'Y',
'y',
'm',
'd',
'H',
'h',
'i',
's',
'A',
'__£__',
'__$__',
'__{__',
'__}__',
'__[__',
'__]__'),
2879 $ret = $dtts->format($newformat);
2881 array(
'__£__',
'__$__',
'__{__',
'__}__',
'__[__',
'__]__'),
2882 array(
'T',
'Z',
'__a__',
'__A__',
'__b__',
'__B__'),
2887 if ($time < 100000000000) {
2888 $timetouse = $time + $offsettz + $offsetdst;
2891 $tzo =
new DateTimeZone(
'UTC');
2893 $tzo =
new DateTimeZone(date_default_timezone_get());
2895 $dtts =
new DateTime();
2896 $dtts->setTimestamp($timetouse);
2897 $dtts->setTimezone($tzo);
2898 $newformat = str_replace(
2899 array(
'%Y',
'%y',
'%m',
'%d',
'%H',
'%I',
'%M',
'%S',
'%p',
'%w',
'T',
'Z',
'__a__',
'__A__',
'__b__',
'__B__'),
2900 array(
'Y',
'y',
'm',
'd',
'H',
'h',
'i',
's',
'A',
'w',
'__£__',
'__$__',
'__{__',
'__}__',
'__[__',
'__]__'),
2902 $ret = $dtts->format($newformat);
2904 array(
'__£__',
'__$__',
'__{__',
'__}__',
'__[__',
'__]__'),
2905 array(
'T',
'Z',
'__a__',
'__A__',
'__b__',
'__B__'),
2910 $ret =
'Bad value '.$time.
' for date';
2914 if (preg_match(
'/__b__/i', $format)) {
2915 $timetouse = $time + $offsettz + $offsetdst;
2918 $tzo =
new DateTimeZone(
'UTC');
2920 $tzo =
new DateTimeZone(date_default_timezone_get());
2922 $dtts =
new DateTime();
2923 $dtts->setTimestamp($timetouse);
2924 $dtts->setTimezone($tzo);
2925 $month = $dtts->format(
"m");
2926 $month = sprintf(
"%02d", $month);
2927 if ($encodetooutput) {
2928 $monthtext = $outputlangs->transnoentities(
'Month'.$month);
2929 $monthtextshort = $outputlangs->transnoentities(
'MonthShort'.$month);
2931 $monthtext = $outputlangs->transnoentitiesnoconv(
'Month'.$month);
2932 $monthtextshort = $outputlangs->transnoentitiesnoconv(
'MonthShort'.$month);
2935 $ret = str_replace(
'__b__', $monthtextshort, $ret);
2936 $ret = str_replace(
'__B__', $monthtext, $ret);
2940 if (preg_match(
'/__a__/i', $format)) {
2942 $timetouse = $time + $offsettz + $offsetdst;
2945 $tzo =
new DateTimeZone(
'UTC');
2947 $tzo =
new DateTimeZone(date_default_timezone_get());
2949 $dtts =
new DateTime();
2950 $dtts->setTimestamp($timetouse);
2951 $dtts->setTimezone($tzo);
2952 $w = $dtts->format(
"w");
2953 $dayweek = $outputlangs->transnoentitiesnoconv(
'Day'.$w);
2955 $ret = str_replace(
'__A__', $dayweek, $ret);
2956 $ret = str_replace(
'__a__',
dol_substr($dayweek, 0, 3), $ret);
3463function dol_print_phone($phone, $countrycode =
'', $cid = 0, $socid = 0, $addlink =
'', $separ =
" ", $withpicto =
'', $titlealt =
'', $adddivfloat = 0)
3465 global $conf, $user, $langs, $mysoc, $hookmanager;
3468 $phone = is_null($phone) ?
'' : preg_replace(
"/[\s.-]/",
"", trim($phone));
3469 if (empty($phone)) {
3472 if (!empty($conf->global->MAIN_PHONE_SEPAR)) {
3473 $separ = $conf->global->MAIN_PHONE_SEPAR;
3475 if (empty($countrycode) && is_object($mysoc)) {
3476 $countrycode = $mysoc->country_code;
3480 if ($conf->dol_optimize_smallscreen) {
3485 if (strtoupper($countrycode) ==
"FR") {
3488 $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);
3490 $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 2).$separ.substr($newphone, 5, 2);
3492 $newphone = substr($newphone, 0, 2).$separ.substr($newphone, 2, 3).$separ.substr($newphone, 5, 2).$separ.substr($newphone, 7, 2);
3494 $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);
3496 $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);
3498 $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);
3500 } elseif (strtoupper($countrycode) ==
"CA") {
3502 $newphone = ($separ !=
'' ?
'(' :
'').substr($newphone, 0, 3).($separ !=
'' ?
')' :
'').$separ.substr($newphone, 3, 3).($separ !=
'' ?
'-' :
'').substr($newphone, 6, 4);
3504 } elseif (strtoupper($countrycode) ==
"PT") {
3506 $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 3).$separ.substr($newphone, 10, 3);
3508 } elseif (strtoupper($countrycode) ==
"SR") {
3510 $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 3);
3512 $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 4);
3514 } elseif (strtoupper($countrycode) ==
"DE") {
3516 $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 4).$separ.substr($newphone, 7, 4).$separ.substr($newphone, 11, 3);
3518 $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 4).$separ.substr($newphone, 10, 3);
3520 } elseif (strtoupper($countrycode) ==
"ES") {
3522 $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 3).$separ.substr($newphone, 9, 3);
3524 } elseif (strtoupper($countrycode) ==
"BF") {
3526 $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);
3528 } elseif (strtoupper($countrycode) ==
"RO") {
3530 $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);
3532 } elseif (strtoupper($countrycode) ==
"TR") {
3534 $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 3).$separ.substr($newphone, 9, 4);
3536 } elseif (strtoupper($countrycode) ==
"US") {
3538 $newphone = substr($newphone, 0, 2).$separ.substr($newphone, 2, 3).$separ.substr($newphone, 5, 3).$separ.substr($newphone, 8, 4);
3540 } elseif (strtoupper($countrycode) ==
"MX") {
3542 $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 4).$separ.substr($newphone, 7, 3).$separ.substr($newphone, 10, 2);
3544 $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);
3546 $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 3).$separ.substr($newphone, 9, 4);
3548 } elseif (strtoupper($countrycode) ==
"ML") {
3550 $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);
3552 } elseif (strtoupper($countrycode) ==
"TH") {
3554 $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 3);
3556 $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);
3558 } elseif (strtoupper($countrycode) ==
"MU") {
3561 $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 2).$separ.substr($newphone, 9, 2);
3563 $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 4).$separ.substr($newphone, 8, 2).$separ.substr($newphone, 10, 2);
3565 } elseif (strtoupper($countrycode) ==
"ZA") {
3567 $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);
3569 } elseif (strtoupper($countrycode) ==
"SY") {
3571 $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);
3573 $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);
3575 } elseif (strtoupper($countrycode) ==
"AE") {
3577 $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 3).$separ.substr($newphone, 10, 2);
3579 $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 3).$separ.substr($newphone, 10, 3);
3581 $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 3).$separ.substr($newphone, 10, 4);
3583 } elseif (strtoupper($countrycode) ==
"DZ") {
3585 $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 3).$separ.substr($newphone, 10, 3);
3587 } elseif (strtoupper($countrycode) ==
"BE") {
3589 $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 3);
3591 $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 3).$separ.substr($newphone, 9, 3);
3593 } elseif (strtoupper($countrycode) ==
"PF") {
3595 $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);
3597 } elseif (strtoupper($countrycode) ==
"CO") {
3599 $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);
3601 } elseif (strtoupper($countrycode) ==
"JO") {
3603 $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);
3605 } elseif (strtoupper($countrycode) ==
"JM") {
3607 $newphone = substr($newphone, 0, 5).$separ.substr($newphone, 5, 3).$separ.substr($newphone, 8, 4);
3609 } elseif (strtoupper($countrycode) ==
"MG") {
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) ==
"GB") {
3615 $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 4).$separ.substr($newphone, 7, 3).$separ.substr($newphone, 10, 3);
3617 } elseif (strtoupper($countrycode) ==
"CH") {
3619 $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);
3621 $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);
3623 } elseif (strtoupper($countrycode) ==
"TN") {
3625 $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 2).$separ.substr($newphone, 6, 3).$separ.substr($newphone, 9, 3);
3627 } elseif (strtoupper($countrycode) ==
"GF") {
3629 $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);
3631 } elseif (strtoupper($countrycode) ==
"GP") {
3633 $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);
3635 } elseif (strtoupper($countrycode) ==
"MQ") {
3637 $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);
3639 } elseif (strtoupper($countrycode) ==
"IT") {
3641 $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 3).$separ.substr($newphone, 6, 3).$separ.substr($newphone, 9, 3);
3643 $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);
3645 } elseif (strtoupper($countrycode) ==
"AU") {
3649 $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 1).$separ.substr($newphone, 4, 4).$separ.substr($newphone, 8, 4);
3651 } elseif (strtoupper($countrycode) ==
"LU") {
3654 $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 2).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 2);
3656 $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);
3658 $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);
3660 $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);
3663 if (!empty($addlink)) {
3664 if ($addlink ==
'tel' || $conf->browser->layout ==
'phone' || (isModEnabled(
'clicktodial') && !empty($conf->global->CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS))) {
3665 $newphoneform = $newphone;
3666 $newphone =
'<a href="tel:'.$phone.
'"';
3667 $newphone .=
'>'.$newphoneform.
'</a>';
3668 } elseif (isModEnabled(
'clicktodial') && $addlink ==
'AC_TEL') {
3669 if (empty($user->clicktodial_loaded)) {
3670 $user->fetch_clicktodial();
3674 $urlmask =
'ErrorClickToDialModuleNotConfigured';
3675 if (!empty($conf->global->CLICKTODIAL_URL)) {
3676 $urlmask = $conf->global->CLICKTODIAL_URL;
3678 if (!empty($user->clicktodial_url)) {
3679 $urlmask = $user->clicktodial_url;
3682 $clicktodial_poste = (!empty($user->clicktodial_poste) ?urlencode($user->clicktodial_poste) :
'');
3683 $clicktodial_login = (!empty($user->clicktodial_login) ?urlencode($user->clicktodial_login) :
'');
3684 $clicktodial_password = (!empty($user->clicktodial_password) ?urlencode($user->clicktodial_password) :
'');
3686 $url = sprintf($urlmask, urlencode($phone), $clicktodial_poste, $clicktodial_login, $clicktodial_password);
3688 $substitarray = array(
'__PHONEFROM__'=>$clicktodial_poste,
3689 '__PHONETO__'=>urlencode($phone),
3690 '__LOGIN__'=>$clicktodial_login,
3691 '__PASS__'=>$clicktodial_password);
3693 $newphonesav = $newphone;
3694 if (empty($conf->global->CLICKTODIAL_DO_NOT_USE_AJAX_CALL)) {
3696 $newphone =
'<a href="'.$url.
'" class="cssforclicktodial"';
3697 $newphone .=
'>'.$newphonesav.
'</a>';
3700 $newphone =
'<a href="'.$url.
'"';
3701 if (!empty($conf->global->CLICKTODIAL_FORCENEWTARGET)) {
3702 $newphone .=
' target="_blank" rel="noopener noreferrer"';
3704 $newphone .=
'>'.$newphonesav.
'</a>';
3709 if (isModEnabled(
'agenda') && $user->hasRight(
"agenda",
"myactions",
"create")) {
3712 if ($addlink ==
'AC_FAX') {
3715 if (!empty($conf->global->AGENDA_ADDACTIONFORPHONE)) {
3716 $link =
'<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>';
3719 $newphone =
'<div>'.$newphone.
' '.$link.
'</div>';
3724 if (empty($titlealt)) {
3725 $titlealt = ($withpicto ==
'fax' ? $langs->trans(
"Fax") : $langs->trans(
"Phone"));
3730 $parameters = array(
'countrycode' => $countrycode,
'cid' => $cid,
'socid' => $socid,
'titlealt' => $titlealt,
'picto' => $withpicto);
3731 $reshook = $hookmanager->executeHooks(
'printPhone', $parameters, $phone);
3732 $rep .= $hookmanager->resPrint;
3734 if (empty($reshook)) {
3737 if ($withpicto ==
'fax') {
3738 $picto =
'phoning_fax';
3739 } elseif ($withpicto ==
'phone') {
3741 } elseif ($withpicto ==
'mobile') {
3742 $picto =
'phoning_mobile';
3747 if ($adddivfloat == 1) {
3748 $rep .=
'<div class="nospan float" style="margin-right: 10px">';
3749 } elseif (empty($adddivfloat)) {
3750 $rep .=
'<span style="margin-right: 10px;">';
3752 $rep .= ($withpicto ?
img_picto($titlealt,
'object_'.$picto.
'.png').
' ' :
'').$newphone;
3753 if ($adddivfloat == 1) {
3755 } elseif (empty($adddivfloat)) {
4197function img_picto($titlealt, $picto, $moreatt =
'', $pictoisfullpath =
false, $srconly = 0, $notitle = 0, $alt =
'', $morecss =
'', $marginleftonlyshort = 2)
4199 global $conf, $langs;
4202 $url = DOL_URL_ROOT;
4203 $theme = isset($conf->theme) ? $conf->theme :
null;
4204 $path =
'theme/'.$theme;
4206 if ($pictoisfullpath) {
4208 if (!preg_match(
'/(\.png|\.gif|\.svg)$/i', $picto)) {
4211 $fullpathpicto = $picto;
4213 if (preg_match(
'/class="([^"]+)"/', $moreatt, $reg)) {
4214 $morecss .= ($morecss ?
' ' :
'').$reg[1];
4215 $moreatt = str_replace(
'class="'.$reg[1].
'"',
'', $moreatt);
4218 $pictowithouttext = preg_replace(
'/(\.png|\.gif|\.svg)$/',
'', $picto);
4219 $pictowithouttext = str_replace(
'object_',
'', $pictowithouttext);
4220 $pictowithouttext = str_replace(
'_nocolor',
'', $pictowithouttext);
4222 if (strpos($pictowithouttext,
'fontawesome_') !==
false || preg_match(
'/^fa-/', $pictowithouttext)) {
4224 $pictowithouttext = str_replace(
'fontawesome_',
'', $pictowithouttext);
4225 $pictowithouttext = str_replace(
'fa-',
'', $pictowithouttext);
4227 $pictowithouttextarray = explode(
'_', $pictowithouttext);
4228 $marginleftonlyshort = 0;
4230 if (!empty($pictowithouttextarray[1])) {
4232 $fakey =
'fa-'.$pictowithouttextarray[0];
4233 $fa = empty($pictowithouttextarray[1]) ?
'fa' : $pictowithouttextarray[1];
4234 $facolor = empty($pictowithouttextarray[2]) ?
'' : $pictowithouttextarray[2];
4235 $fasize = empty($pictowithouttextarray[3]) ?
'' : $pictowithouttextarray[3];
4237 $fakey =
'fa-'.$pictowithouttext;
4247 if (preg_match(
'/class="([^"]+)"/', $moreatt, $reg)) {
4248 $morecss .= ($morecss ?
' ' :
'').$reg[1];
4249 $moreatt = str_replace(
'class="'.$reg[1].
'"',
'', $moreatt);
4251 if (preg_match(
'/style="([^"]+)"/', $moreatt, $reg)) {
4252 $morestyle = $reg[1];
4253 $moreatt = str_replace(
'style="'.$reg[1].
'"',
'', $moreatt);
4255 $moreatt = trim($moreatt);
4257 $enabledisablehtml =
'<span class="'.$fa.
' '.$fakey.($marginleftonlyshort ? ($marginleftonlyshort == 1 ?
' marginleftonlyshort' :
' marginleftonly') :
'');
4258 $enabledisablehtml .= ($morecss ?
' '.$morecss :
'').
'" style="'.($fasize ? (
'font-size: '.$fasize.
';') :
'').($facolor ? (
' color: '.$facolor.
';') :
'').($morestyle ?
' '.$morestyle :
'').
'"'.(($notitle || empty($titlealt)) ?
'' :
' title="'.dol_escape_htmltag($titlealt).
'"').($moreatt ?
' '.$moreatt :
'').
'>';
4262 $enabledisablehtml .=
'</span>';
4264 return $enabledisablehtml;
4267 if (empty($srconly) && in_array($pictowithouttext, array(
4268 '1downarrow',
'1uparrow',
'1leftarrow',
'1rightarrow',
'1uparrow_selected',
'1downarrow_selected',
'1leftarrow_selected',
'1rightarrow_selected',
4269 'accountancy',
'accounting_account',
'account',
'accountline',
'action',
'add',
'address',
'angle-double-down',
'angle-double-up',
'asset',
4270 'bank_account',
'barcode',
'bank',
'bell',
'bill',
'billa',
'billr',
'billd',
'birthday-cake',
'bookmark',
'bom',
'briefcase-medical',
'bug',
'building',
4271 'card',
'calendarlist',
'calendar',
'calendarmonth',
'calendarweek',
'calendarday',
'calendarperuser',
'calendarpertype',
4272 'cash-register',
'category',
'chart',
'check',
'clock',
'clone',
'close_title',
'cog',
'collab',
'company',
'contact',
'country',
'contract',
'conversation',
'cron',
'cross',
'cubes',
4273 'currency',
'multicurrency',
4274 'delete',
'dolly',
'dollyrevert',
'donation',
'download',
'dynamicprice',
4275 'edit',
'ellipsis-h',
'email',
'entity',
'envelope',
'eraser',
'establishment',
'expensereport',
'external-link-alt',
'external-link-square-alt',
'eye',
4276 'filter',
'file-code',
'file-export',
'file-import',
'file-upload',
'autofill',
'folder',
'folder-open',
'folder-plus',
4277 'gears',
'generate',
'generic',
'globe',
'globe-americas',
'graph',
'grip',
'grip_title',
'group',
4278 'hands-helping',
'help',
'holiday',
4279 'id-card',
'images',
'incoterm',
'info',
'intervention',
'inventory',
'intracommreport',
'jobprofile',
4280 'knowledgemanagement',
4281 'label',
'language',
'line',
'link',
'list',
'list-alt',
'listlight',
'loan',
'lock',
'lot',
'long-arrow-alt-right',
4282 'margin',
'map-marker-alt',
'member',
'meeting',
'money-bill-alt',
'movement',
'mrp',
'note',
'next',
4283 'off',
'on',
'order',
4284 'paiment',
'paragraph',
'play',
'pdf',
'phone',
'phoning',
'phoning_mobile',
'phoning_fax',
'playdisabled',
'previous',
'poll',
'pos',
'printer',
'product',
'propal',
'proposal',
'puce',
4285 'stock',
'resize',
'service',
'stats',
'trip',
4286 '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',
4287 'github',
'google',
'jabber',
'microsoft',
'skype',
'twitter',
'facebook',
'linkedin',
'instagram',
'snapchat',
'youtube',
'google-plus-g',
'whatsapp',
4288 'chevron-left',
'chevron-right',
'chevron-down',
'chevron-top',
'commercial',
'companies',
4289 'generic',
'home',
'hrm',
'members',
'products',
'invoicing',
4290 'partnership',
'payment',
'payment_vat',
'pencil-ruler',
'pictoconfirm',
'preview',
'project',
'projectpub',
'projecttask',
'question',
'refresh',
'region',
4291 'salary',
'shipment',
'state',
'supplier_invoice',
'supplier_invoicea',
'supplier_invoicer',
'supplier_invoiced',
4292 'technic',
'ticket',
4294 'recent',
'reception',
'recruitmentcandidature',
'recruitmentjobposition',
'replacement',
'resource',
'recurring',
'rss',
4295 'shapes',
'skill',
'square',
'stop-circle',
'supplier',
'supplier_proposal',
'supplier_order',
'supplier_invoice',
4296 'timespent',
'title_setup',
'title_accountancy',
'title_bank',
'title_hrm',
'title_agenda',
4297 'uncheck',
'url',
'user-cog',
'user-injured',
'user-md',
'vat',
'website',
'workstation',
'webhook',
'world',
'private',
4298 'conferenceorbooth',
'eventorganization',
4299 'stamp',
'signature'
4301 $fakey = $pictowithouttext;
4305 if (in_array($pictowithouttext, array(
'card',
'bell',
'clock',
'establishment',
'generic',
'minus-square',
'object_generic',
'pdf',
'plus-square',
'timespent',
'note',
'off',
'on',
'object_bookmark',
'bookmark',
'vcard'))) {
4308 if (in_array($pictowithouttext, array(
'black-tie',
'github',
'google',
'microsoft',
'skype',
'twitter',
'facebook',
'linkedin',
'instagram',
'snapchat',
'stripe',
'stripe-s',
'youtube',
'google-plus-g',
'whatsapp'))) {
4312 $arrayconvpictotofa = array(
4313 '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',
4314 'bank_account'=>
'university',
4315 'bill'=>
'file-invoice-dollar',
'billa'=>
'file-excel',
'billr'=>
'file-invoice-dollar',
'billd'=>
'file-medical',
4316 'supplier_invoice'=>
'file-invoice-dollar',
'supplier_invoicea'=>
'file-excel',
'supplier_invoicer'=>
'file-invoice-dollar',
'supplier_invoiced'=>
'file-medical',
4318 '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',
4319 'donation'=>
'file-alt',
'dynamicprice'=>
'hand-holding-usd',
4320 'setup'=>
'cog',
'companies'=>
'building',
'products'=>
'cube',
'commercial'=>
'suitcase',
'invoicing'=>
'coins',
4321 'accounting'=>
'search-dollar',
'category'=>
'tag',
'dollyrevert'=>
'dolly',
4322 'generate'=>
'plus-square',
'hrm'=>
'user-tie',
'incoterm'=>
'truck-loading',
4323 'margin'=>
'calculator',
'members'=>
'user-friends',
'ticket'=>
'ticket-alt',
'globe'=>
'external-link-alt',
'lot'=>
'barcode',
4324 'email'=>
'at',
'establishment'=>
'building',
'edit'=>
'pencil-alt',
'entity'=>
'globe',
4325 'graph'=>
'chart-line',
'grip_title'=>
'arrows-alt',
'grip'=>
'arrows-alt',
'help'=>
'question-circle',
4326 'generic'=>
'file',
'holiday'=>
'umbrella-beach',
4327 'info'=>
'info-circle',
'inventory'=>
'boxes',
'intracommreport'=>
'globe-europe',
'jobprofile'=>
'cogs',
4328 'knowledgemanagement'=>
'ticket-alt',
'label'=>
'layer-group',
'line'=>
'bars',
'loan'=>
'money-bill-alt',
4329 'member'=>
'user-alt',
'meeting'=>
'chalkboard-teacher',
'mrp'=>
'cubes',
'next'=>
'arrow-alt-circle-right',
4330 'trip'=>
'wallet',
'expensereport'=>
'wallet',
'group'=>
'users',
'movement'=>
'people-carry',
4331 'sign-out'=>
'sign-out-alt',
4332 'switch_off'=>
'toggle-off',
'switch_on'=>
'toggle-on',
'switch_on_warning'=>
'toggle-on',
'switch_on_red'=>
'toggle-on',
'check'=>
'check',
'bookmark'=>
'star',
4333 'bank'=>
'university',
'close_title'=>
'times',
'delete'=>
'trash',
'filter'=>
'filter',
4334 'list-alt'=>
'list-alt',
'calendarlist'=>
'bars',
'calendar'=>
'calendar-alt',
'calendarmonth'=>
'calendar-alt',
'calendarweek'=>
'calendar-week',
'calendarday'=>
'calendar-day',
'calendarperuser'=>
'table',
4335 'intervention'=>
'ambulance',
'invoice'=>
'file-invoice-dollar',
'currency'=>
'dollar-sign',
'multicurrency'=>
'dollar-sign',
'order'=>
'file-invoice',
4336 'error'=>
'exclamation-triangle',
'warning'=>
'exclamation-triangle',
4338 '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',
4339 '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',
4340 'recent' =>
'check-square',
'reception'=>
'dolly',
'recruitmentjobposition'=>
'id-card-alt',
'recruitmentcandidature'=>
'id-badge',
4341 'resize'=>
'crop',
'supplier_order'=>
'dol-order_supplier',
'supplier_proposal'=>
'file-signature',
4342 'refresh'=>
'redo',
'region'=>
'map-marked',
'replacement'=>
'exchange-alt',
'resource'=>
'laptop-house',
'recurring'=>
'history',
4343 'service'=>
'concierge-bell',
4344 'skill'=>
'shapes',
'state'=>
'map-marked-alt',
'security'=>
'key',
'salary'=>
'wallet',
'shipment'=>
'dolly',
'stock'=>
'box-open',
'stats' =>
'chart-bar',
'split'=>
'code-branch',
'stripe'=>
'stripe-s',
4345 'supplier'=>
'building',
'technic'=>
'cogs',
4346 'timespent'=>
'clock',
'title_setup'=>
'tools',
'title_accountancy'=>
'money-check-alt',
'title_bank'=>
'university',
'title_hrm'=>
'umbrella-beach',
4347 'title_agenda'=>
'calendar-alt',
4348 'uncheck'=>
'times',
'uparrow'=>
'share',
'url'=>
'external-link-alt',
'vat'=>
'money-check-alt',
'vcard'=>
'arrow-alt-circle-down',
4349 'jabber'=>
'comment-o',
4350 'website'=>
'globe-americas',
'workstation'=>
'pallet',
'webhook'=>
'bullseye',
'world'=>
'globe',
'private'=>
'user-lock',
4351 'conferenceorbooth'=>
'chalkboard-teacher',
'eventorganization'=>
'project-diagram'
4353 if ($pictowithouttext ==
'off') {
4354 $fakey =
'fa-square';
4356 } elseif ($pictowithouttext ==
'on') {
4357 $fakey =
'fa-check-square';
4359 } elseif ($pictowithouttext ==
'listlight') {
4360 $fakey =
'fa-download';
4361 $marginleftonlyshort = 1;
4362 } elseif ($pictowithouttext ==
'printer') {
4363 $fakey =
'fa-print';
4365 } elseif ($pictowithouttext ==
'note') {
4366 $fakey =
'fa-sticky-note';
4367 $marginleftonlyshort = 1;
4368 } elseif (in_array($pictowithouttext, array(
'1uparrow',
'1downarrow',
'1leftarrow',
'1rightarrow',
'1uparrow_selected',
'1downarrow_selected',
'1leftarrow_selected',
'1rightarrow_selected'))) {
4369 $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');
4370 $fakey =
'fa-'.$convertarray[$pictowithouttext];
4371 if (preg_match(
'/selected/', $pictowithouttext)) {
4374 $marginleftonlyshort = 1;
4375 } elseif (!empty($arrayconvpictotofa[$pictowithouttext])) {
4376 $fakey =
'fa-'.$arrayconvpictotofa[$pictowithouttext];
4378 $fakey =
'fa-'.$pictowithouttext;
4381 if (in_array($pictowithouttext, array(
'dollyrevert',
'member',
'members',
'contract',
'group',
'resource',
'shipment'))) {
4382 $morecss .=
' em092';
4384 if (in_array($pictowithouttext, array(
'conferenceorbooth',
'collab',
'eventorganization',
'holiday',
'info',
'project',
'workstation'))) {
4385 $morecss .=
' em088';
4387 if (in_array($pictowithouttext, array(
'asset',
'intervention',
'payment',
'loan',
'partnership',
'stock',
'technic'))) {
4388 $morecss .=
' em080';
4392 $arrayconvpictotomarginleftonly = array(
4393 'bank',
'check',
'delete',
'generic',
'grip',
'grip_title',
'jabber',
4394 'grip_title',
'grip',
'listlight',
'note',
'on',
'off',
'playdisabled',
'printer',
'resize',
'sign-out',
'stats',
'switch_on',
'switch_on_red',
'switch_off',
4395 'uparrow',
'1uparrow',
'1downarrow',
'1leftarrow',
'1rightarrow',
'1uparrow_selected',
'1downarrow_selected',
'1leftarrow_selected',
'1rightarrow_selected'
4397 if (!isset($arrayconvpictotomarginleftonly[$pictowithouttext])) {
4398 $marginleftonlyshort = 0;
4402 $arrayconvpictotomorcess = array(
4403 'action'=>
'infobox-action',
'account'=>
'infobox-bank_account',
'accounting_account'=>
'infobox-bank_account',
'accountline'=>
'infobox-bank_account',
'accountancy'=>
'infobox-bank_account',
'asset'=>
'infobox-bank_account',
4404 'bank_account'=>
'infobox-bank_account',
4405 'bill'=>
'infobox-commande',
'billa'=>
'infobox-commande',
'billr'=>
'infobox-commande',
'billd'=>
'infobox-commande',
4406 'margin'=>
'infobox-bank_account',
'conferenceorbooth'=>
'infobox-project',
4407 'cash-register'=>
'infobox-bank_account',
'contract'=>
'infobox-contrat',
'check'=>
'font-status4',
'collab'=>
'infobox-action',
'conversation'=>
'infobox-contrat',
4408 'donation'=>
'infobox-commande',
'dolly'=>
'infobox-commande',
'dollyrevert'=>
'flip infobox-order_supplier',
4409 'ecm'=>
'infobox-action',
'eventorganization'=>
'infobox-project',
4410 'hrm'=>
'infobox-adherent',
'group'=>
'infobox-adherent',
'intervention'=>
'infobox-contrat',
4411 'incoterm'=>
'infobox-supplier_proposal',
4412 'currency'=>
'infobox-bank_account',
'multicurrency'=>
'infobox-bank_account',
4413 'members'=>
'infobox-adherent',
'member'=>
'infobox-adherent',
'money-bill-alt'=>
'infobox-bank_account',
4414 'order'=>
'infobox-commande',
4415 'user'=>
'infobox-adherent',
'users'=>
'infobox-adherent',
4416 'error'=>
'pictoerror',
'warning'=>
'pictowarning',
'switch_on'=>
'font-status4',
'switch_on_warning'=>
'font-status4 warning',
'switch_on_red'=>
'font-status8',
4417 'holiday'=>
'infobox-holiday',
'info'=>
'opacityhigh',
'invoice'=>
'infobox-commande',
4418 'knowledgemanagement'=>
'infobox-contrat rotate90',
'loan'=>
'infobox-bank_account',
4419 'payment'=>
'infobox-bank_account',
'payment_vat'=>
'infobox-bank_account',
'poll'=>
'infobox-adherent',
'pos'=>
'infobox-bank_account',
'project'=>
'infobox-project',
'projecttask'=>
'infobox-project',
4420 'propal'=>
'infobox-propal',
'proposal'=>
'infobox-propal',
'private'=>
'infobox-project',
4421 'reception'=>
'flip',
'recruitmentjobposition'=>
'infobox-adherent',
'recruitmentcandidature'=>
'infobox-adherent',
4422 'resource'=>
'infobox-action',
4423 'salary'=>
'infobox-bank_account',
'shipment'=>
'infobox-commande',
'supplier_invoice'=>
'infobox-order_supplier',
'supplier_invoicea'=>
'infobox-order_supplier',
'supplier_invoiced'=>
'infobox-order_supplier',
4424 'supplier'=>
'infobox-order_supplier',
'supplier_order'=>
'infobox-order_supplier',
'supplier_proposal'=>
'infobox-supplier_proposal',
4425 'ticket'=>
'infobox-contrat',
'title_accountancy'=>
'infobox-bank_account',
'title_hrm'=>
'infobox-holiday',
'expensereport'=>
'infobox-expensereport',
'trip'=>
'infobox-expensereport',
'title_agenda'=>
'infobox-action',
4426 'vat'=>
'infobox-bank_account',
4428 'list-alt'=>
'imgforviewmode',
'calendar'=>
'imgforviewmode',
'calendarweek'=>
'imgforviewmode',
'calendarmonth'=>
'imgforviewmode',
'calendarday'=>
'imgforviewmode',
'calendarperuser'=>
'imgforviewmode'
4430 if (!empty($arrayconvpictotomorcess[$pictowithouttext]) && strpos($picto,
'_nocolor') ===
false) {
4431 $morecss .= ($morecss ?
' ' :
'').$arrayconvpictotomorcess[$pictowithouttext];
4435 $arrayconvpictotocolor = array(
4436 'address'=>
'#6c6aa8',
'building'=>
'#6c6aa8',
'bom'=>
'#a69944',
4437 'clone'=>
'#999',
'cog'=>
'#999',
'companies'=>
'#6c6aa8',
'company'=>
'#6c6aa8',
'contact'=>
'#6c6aa8',
'cron'=>
'#555',
4438 'dynamicprice'=>
'#a69944',
4439 'edit'=>
'#444',
'note'=>
'#999',
'error'=>
'',
'help'=>
'#bbb',
'listlight'=>
'#999',
'language'=>
'#555',
4441 'lock'=>
'#ddd',
'lot'=>
'#a69944',
4442 'map-marker-alt'=>
'#aaa',
'mrp'=>
'#a69944',
'product'=>
'#a69944',
'service'=>
'#a69944',
'inventory'=>
'#a69944',
'stock'=>
'#a69944',
'movement'=>
'#a69944',
4443 'other'=>
'#ddd',
'world'=>
'#986c6a',
4444 'partnership'=>
'#6c6aa8',
'playdisabled'=>
'#ccc',
'printer'=>
'#444',
'projectpub'=>
'#986c6a',
'reception'=>
'#a69944',
'resize'=>
'#444',
'rss'=>
'#cba',
4446 'security'=>
'#999',
'square'=>
'#888',
'stop-circle'=>
'#888',
'stats'=>
'#444',
'switch_off'=>
'#999',
'technic'=>
'#999',
'timespent'=>
'#555',
4447 'uncheck'=>
'#800',
'uparrow'=>
'#555',
'user-cog'=>
'#999',
'country'=>
'#aaa',
'globe-americas'=>
'#aaa',
'region'=>
'#aaa',
'state'=>
'#aaa',
4448 'website'=>
'#304',
'workstation'=>
'#a69944'
4450 if (isset($arrayconvpictotocolor[$pictowithouttext]) && strpos($picto,
'_nocolor') ===
false) {
4451 $facolor = $arrayconvpictotocolor[$pictowithouttext];
4458 if (preg_match(
'/class="([^"]+)"/', $moreatt, $reg)) {
4459 $morecss .= ($morecss ?
' ' :
'').$reg[1];
4460 $moreatt = str_replace(
'class="'.$reg[1].
'"',
'', $moreatt);
4462 if (preg_match(
'/style="([^"]+)"/', $moreatt, $reg)) {
4463 $morestyle = $reg[1];
4464 $moreatt = str_replace(
'style="'.$reg[1].
'"',
'', $moreatt);
4466 $moreatt = trim($moreatt);
4468 $enabledisablehtml =
'<span class="'.$fa.
' '.$fakey.($marginleftonlyshort ? ($marginleftonlyshort == 1 ?
' marginleftonlyshort' :
' marginleftonly') :
'');
4469 $enabledisablehtml .= ($morecss ?
' '.$morecss :
'').
'" style="'.($fasize ? (
'font-size: '.$fasize.
';') :
'').($facolor ? (
' color: '.$facolor.
';') :
'').($morestyle ?
' '.$morestyle :
'').
'"'.(($notitle || empty($titlealt)) ?
'' :
' title="'.dol_escape_htmltag($titlealt).
'"').($moreatt ?
' '.$moreatt :
'').
'>';
4473 $enabledisablehtml .=
'</span>';
4475 return $enabledisablehtml;
4478 if (!empty($conf->global->MAIN_OVERWRITE_THEME_PATH)) {
4479 $path = $conf->global->MAIN_OVERWRITE_THEME_PATH.
'/theme/'.$theme;
4480 } elseif (!empty($conf->global->MAIN_OVERWRITE_THEME_RES)) {
4481 $path = $conf->global->MAIN_OVERWRITE_THEME_RES.
'/theme/'.$conf->global->MAIN_OVERWRITE_THEME_RES;
4482 } elseif (!empty($conf->modules_parts[
'theme']) && array_key_exists($theme, $conf->modules_parts[
'theme'])) {
4483 $path = $theme.
'/theme/'.$theme;
4488 if (preg_match(
'/^([^@]+)@([^@]+)$/i', $picto, $regs)) {
4494 if (!preg_match(
'/(\.png|\.gif|\.svg)$/i', $picto)) {
4499 foreach ($conf->file->dol_document_root as $type => $dirroot) {
4500 if ($type ==
'main') {
4504 if (file_exists($dirroot.
'/'.$path.
'/img/'.$picto)) {
4505 $url = DOL_URL_ROOT.$conf->file->dol_url_root[$type];
4511 $fullpathpicto = $url.
'/'.$path.
'/img/'.$picto;
4515 return $fullpathpicto;
4519 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 :
'').
'"').
'>';