dolibarr  7.0.0-beta
Functions
functions.lib.php File Reference

A set of functions for Dolibarr This file contains all frequently used functions. More...

Go to the source code of this file.

Functions

 getStaticMember ($class, $member)
 Function to return value of a static property when class name is dynamically defined (not hard coded). More...
 
 getDoliDBInstance ($type, $host, $user, $pass, $name, $port)
 Return a DoliDB instance (database handler). More...
 
 getEntity ($element, $shared=1, $forceentity=null)
 Get list of entity id to use. More...
 
 getBrowserInfo ($user_agent)
 Return information about user browser. More...
 
 dol_shutdown ()
 Function called at end of web php process. More...
 
 GETPOSTISSET ($paramname)
 Return true if we are in a context of submitting a parameter. More...
 
 GETPOST ($paramname, $check='none', $method=0, $filter=NULL, $options=NULL, $noreplace=0)
 Return value of a param into GET or POST supervariable. More...
 
if(!function_exists('dol_getprefix')) dol_include_once ($relpath, $classname='')
 Return a prefix to use for this Dolibarr instance, for session/cookie names or email id. More...
 
 dol_buildpath ($path, $type=0, $returnemptyifnotfound=0)
 Return path of url or filesystem. More...
 
 dol_clone ($object, $native=0)
 Create a clone of instance of object (new instance with same value for properties) With native = 0: Property that are reference are also new object (true clone). More...
 
 dol_size ($size, $type='')
 Optimize a size for some browsers (phone, smarphone, ...) More...
 
 dol_sanitizeFileName ($str, $newstr='_', $unaccent=1)
 Clean a string to use it as a file name. More...
 
 dol_sanitizePathName ($str, $newstr='_', $unaccent=1)
 Clean a string to use it as a path name. More...
 
 dol_string_unaccent ($str)
 Clean a string from all accent characters to be used as ref, login or by dol_sanitizeFileName. More...
 
 dol_string_nospecial ($str, $newstr='_', $badcharstoreplace='')
 Clean a string from all punctuation characters to use it as a ref or login. More...
 
 dolEscapeXML ($string)
 Encode string for xml usage. More...
 
 dol_escape_js ($stringtoescape, $mode=0, $noescapebackslashn=0)
 Returns text escaped for inclusion into javascript code. More...
 
 dol_escape_htmltag ($stringtoescape, $keepb=0, $keepn=0)
 Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields. More...
 
 dol_strtolower ($utf8_string)
 Convert a string to lower. More...
 
 dol_strtoupper ($utf8_string)
 Convert a string to upper. More...
 
 dol_syslog ($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='')
 Write log message into outputs. More...
 
 dol_fiche_head ($links=array(), $active='0', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='')
 Show tab header of a card. More...
 
 dol_get_fiche_head ($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='')
 Show tab header of a card. More...
 
 dol_fiche_end ($notab=0)
 Show tab footer of a card. More...
 
 dol_get_fiche_end ($notab=0)
 Return tab footer of a card. More...
 
 dol_banner_tab ($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlstatus='', $onlybanner=0, $morehtmlright='')
 Show tab footer of a card. More...
 
 fieldLabel ($langkey, $fieldkey, $fieldrequired=0)
 Show a string with the label tag dedicated to the HTML edit field. More...
 
 dol_bc ($var, $moreclass='')
 Return string to add class property on html element with pair/impair. More...
 
 dol_format_address ($object, $withcountry=0, $sep="\n", $outputlangs='', $mode=0)
 Return a formated address (part address/zip/town/state) according to country rules. More...
 
 dol_strftime ($fmt, $ts=false, $is_gmt=false)
 Format a string. More...
 
 dol_print_date ($time, $format='', $tzoutput='tzserver', $outputlangs='', $encodetooutput=false)
 Output date in a string format according to outputlangs (or langs if not defined). More...
 
 dol_getdate ($timestamp, $fast=false)
 Return an array with locale date info. More...
 
 dol_mktime ($hour, $minute, $second, $month, $day, $year, $gm=false, $check=1)
 Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Replace function mktime not available under Windows if year < 1970 PHP mktime is restricted to the years 1901-2038 on Unix and 1970-2038 on Windows. More...
 
 dol_now ($mode='gmt')
 Return date for now. More...
 
 dol_print_size ($size, $shortvalue=0, $shortunit=0)
 Return string with formated size. More...
 
 dol_print_url ($url, $target='_blank', $max=32, $withpicto=0)
 Show Url link. More...
 
 dol_print_email ($email, $cid=0, $socid=0, $addlink=0, $max=64, $showinvalid=1, $withpicto=0)
 Show EMail link. More...
 
 dol_print_skype ($skype, $cid=0, $socid=0, $addlink=0, $max=64)
 Show Skype link. More...
 
 dol_print_phone ($phone, $countrycode='', $cid=0, $socid=0, $addlink='', $separ="&nbsp;", $withpicto='', $titlealt='', $adddivfloat=0)
 Format phone numbers according to country. More...
 
 dol_print_ip ($ip, $mode=0)
 Return an IP formated to be shown on screen. More...
 
 dolGetCountryCodeFromIp ($ip)
 Return a country code from IP. More...
 
 dol_user_country ()
 Return country code for current user. More...
 
 dol_print_address ($address, $htmlid, $mode, $id, $noprint=0, $charfornl='')
 Format address string. More...
 
 isValidEmail ($address, $acceptsupervisorkey=0)
 Return true if email syntax is ok. More...
 
 isValidPhone ($phone)
 Return true if phone number syntax is ok TODO Decide what to do with this. More...
 
 dol_strlen ($string, $stringencoding='UTF-8')
 Make a strlen call. More...
 
 dol_substr ($string, $start, $length, $stringencoding='')
 Make a substring. More...
 
 dol_print_graph ($htmlid, $width, $height, $data, $showlegend=0, $type='pie', $showpercent=0, $url='', $combineother=0.05, $shownographyet=0)
 Show a javascript graph. More...
 
 dol_trunc ($string, $size=40, $trunc='right', $stringencoding='UTF-8', $nodot=0, $display=0)
 Truncate a string to a particular length adding '...' if string larger than length. More...
 
 img_picto ($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='')
 Show picto whatever it's its name (generic function) More...
 
 img_object ($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0)
 Show a picto called object_picto (generic function) More...
 
 img_weather ($titlealt, $picto, $moreatt= '', $pictoisfullpath=0)
 Show weather picto. More...
 
 img_picto_common ($titlealt, $picto, $moreatt= '', $pictoisfullpath=0)
 Show picto (generic function) More...
 
 img_action ($titlealt, $numaction)
 Show logo action. More...
 
 img_pdf ($titlealt= 'default', $size=3)
 Show pdf logo. More...
 
 img_edit_add ($titlealt= 'default', $other= '')
 Show logo +. More...
 
 img_edit_remove ($titlealt= 'default', $other='')
 Show logo -. More...
 
 img_edit ($titlealt= 'default', $float=0, $other= 'class="pictoedit"')
 Show logo editer/modifier fiche. More...
 
 img_view ($titlealt= 'default', $float=0, $other= '')
 Show logo view card. More...
 
 img_delete ($titlealt= 'default', $other= 'class="pictodelete"')
 Show delete logo. More...
 
 img_printer ($titlealt="default", $other='')
 Show printer logo. More...
 
 img_split ($titlealt= 'default', $other= 'class="pictosplit"')
 Show split logo. More...
 
 img_help ($usehelpcursor=1, $usealttitle=1)
 Show help logo with cursor "?". More...
 
 img_info ($titlealt= 'default')
 Show info logo. More...
 
 img_warning ($titlealt= 'default', $moreatt= '')
 Show warning logo. More...
 
 img_error ($titlealt= 'default')
 Show error logo. More...
 
 img_next ($titlealt= 'default', $moreatt='')
 Show next logo. More...
 
 img_previous ($titlealt= 'default', $moreatt='')
 Show previous logo. More...
 
 img_down ($titlealt= 'default', $selected=0, $moreclass='')
 Show down arrow logo. More...
 
 img_up ($titlealt= 'default', $selected=0, $moreclass='')
 Show top arrow logo. More...
 
 img_left ($titlealt= 'default', $selected=0, $moreatt='')
 Show left arrow logo. More...
 
 img_right ($titlealt= 'default', $selected=0, $moreatt='')
 Show right arrow logo. More...
 
 img_allow ($allow, $titlealt= 'default')
 Show tick logo if allowed. More...
 
 img_mime ($file, $titlealt= '', $morecss='')
 Show MIME img of a file. More...
 
 img_phone ($titlealt= 'default', $option=0)
 Show phone logo. More...
 
 img_search ($titlealt= 'default', $other= '')
 Show search logo. More...
 
 img_searchclear ($titlealt= 'default', $other= '')
 Show search logo. More...
 
 info_admin ($text, $infoonimgalt=0, $nodiv=0, $admin='1')
 Show information for admin users or standard users. More...
 
 dol_print_error ($db='', $error='', $errors=null)
 Affiche message erreur system avec toutes les informations pour faciliter le diagnostic et la remontee des bugs. More...
 
 dol_print_error_email ($prefixcode, $errormessage='', $errormessages=array())
 Show a public email and error code to contact if technical error. More...
 
 print_liste_field_titre ($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="")
 Show title line of an array. More...
 
 getTitleFieldOfList ($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='')
 Get title line of an array. More...
 
 print_titre ($title)
 Show a title. More...
 
 print_fiche_titre ($title, $mesg='', $picto='title_generic.png', $pictoisfullpath=0, $id='')
 Show a title with picto. More...
 
 load_fiche_titre ($titre, $morehtmlright='', $picto='title_generic.png', $pictoisfullpath=0, $id=0, $morecssontable='', $morehtmlcenter='')
 Load a title with picto. More...
 
 print_barre_liste ($titre, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='title_generic.png', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0)
 Print a title with navigation controls for pagination. More...
 
 print_fleche_navigation ($page, $file, $options='', $nextpage=0, $betweenarrows='', $afterarrows='', $limit=-1, $totalnboflines=0, $hideselectlimit=0)
 Function to show navigation arrows into lists. More...
 
 vatrate ($rate, $addpercent=false, $info_bits=0, $usestarfornpr=0)
 Return a string with VAT rate label formated for view output Used into pdf and HTML pages. More...
 
 price ($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
 Function to format a value into an amount for visual output Function used into PDF and HTML pages. More...
 
 price2num ($amount, $rounding='', $alreadysqlnb=0)
 Function that return a number with universal decimal format (decimal separator is '. More...
 
 showDimensionInBestUnit ($dimension, $unit, $type, $outputlangs, $round=-1, $forceunitoutput='no')
 Output a dimension with best unit. More...
 
 get_localtax ($vatrate, $local, $thirdparty_buyer="", $thirdparty_seller="", $vatnpr=0)
 Return localtax rate for a particular vat, when selling a product with vat $vatrate, from a $thirdparty_buyer to a $thirdparty_seller Note: This function applies same rules than get_default_tva. More...
 
 isOnlyOneLocalTax ($local)
 Return true if LocalTax (1 or 2) is unique. More...
 
 get_localtax_by_third ($local)
 Get values of localtaxes (1 or 2) for company country for the common vat with the highest value. More...
 
 getTaxesFromId ($vatrate, $buyer=null, $seller=null, $firstparamisid=1)
 Get vat main information from Id. More...
 
 getLocalTaxesFromRate ($vatrate, $local, $buyer, $seller, $firstparamisid=0)
 Get type and rate of localtaxes for a particular vat rate/country of a thirdparty. More...
 
 get_product_vat_for_country ($idprod, $thirdparty_seller, $idprodfournprice=0)
 Return vat rate of a product in a particular selling country or default country vat if product is unknown Function called by get_default_tva. More...
 
 get_product_localtax_for_country ($idprod, $local, $thirdparty_seller)
 Return localtax vat rate of a product in a particular selling country or default country vat if product is unknown. More...
 
 get_default_tva (Societe $thirdparty_seller, Societe $thirdparty_buyer, $idprod=0, $idprodfournprice=0)
 Function that return vat rate of a product line (according to seller, buyer and product vat rate) Si vendeur non assujeti a TVA, TVA par defaut=0. More...
 
 get_default_npr (Societe $thirdparty_seller, Societe $thirdparty_buyer, $idprod=0, $idprodfournprice=0)
 Fonction qui renvoie si tva doit etre tva percue recuperable. More...
 
 get_default_localtax ($thirdparty_seller, $thirdparty_buyer, $local, $idprod=0)
 Function that return localtax of a product line (according to seller, buyer and product vat rate) Si vendeur non assujeti a TVA, TVA par defaut=0. More...
 
 yn ($yesno, $case=1, $color=0)
 Return yes or no in current language. More...
 
 get_exdir ($num, $level, $alpha, $withoutslash, $object, $modulepart)
 Return a path to have a the directory according to object where files are stored. More...
 
 dol_mkdir ($dir, $dataroot='', $newmask=null)
 Creation of a directory (this can create recursive subdir) More...
 
 picto_required ()
 Return picto saying a field is required. More...
 
 dol_string_nohtmltag ($stringtoclean, $removelinefeed=1, $pagecodeto='UTF-8')
 Clean a string from all HTML tags and entities. More...
 
 dolGetFirstLineOfText ($text, $nboflines=1)
 Return first line of text. More...
 
 dol_nl2br ($stringtoencode, $nl2brmode=0, $forxml=false)
 Replace CRLF in string with a HTML BR tag. More...
 
 dol_htmlentitiesbr ($stringtoencode, $nl2brmode=0, $pagecodefrom='UTF-8', $removelasteolbr=1)
 This function is called to encode a string into a HTML string but differs from htmlentities because a detection is done before to see if text is already HTML or not. More...
 
 dol_htmlentitiesbr_decode ($stringtodecode, $pagecodeto='UTF-8')
 This function is called to decode a HTML string (it decodes entities and br tags) More...
 
 dol_htmlcleanlastbr ($stringtodecode)
 This function remove all ending
and br at end. More...
 
 dol_html_entity_decode ($a, $b, $c='UTF-8')
 Replace html_entity_decode functions to manage errors. More...
 
 dol_htmlentities ($string, $flags=null, $encoding='UTF-8', $double_encode=false)
 Replace htmlentities functions. More...
 
 dol_string_is_good_iso ($s)
 Check if a string is a correct iso string If not, it will we considered not HTML encoded even if it is by FPDF. More...
 
 dol_nboflines ($s, $maxchar=0)
 Return nb of lines of a clear text. More...
 
 dol_nboflines_bis ($text, $maxlinesize=0, $charset='UTF-8')
 Return nb of lines of a formated text with
and
(WARNING: string must not have mixed
and br separators) More...
 
 dol_microtime_float ()
 Same function than microtime in PHP 5 but compatible with PHP4. More...
 
 dol_textishtml ($msg, $option=0)
 Return if a text is a html content. More...
 
 dol_concatdesc ($text1, $text2, $forxml=false)
 Concat 2 descriptions with a new line between them (second operand after first one with appropriate new line separator) text1 html + text2 html => text1 + '
' + text2 text1 html + text2 txt => text1 + '
' + dol_nl2br(text2) text1 txt + text2 html => dol_nl2br(text1) + '
' + text2 text1 txt + text2 txt => text1 + '
' + text2. More...
 
 getCommonSubstitutionArray ($outputlangs, $onlykey=0, $exclude=null, $object=null)
 Return array of possible common substitutions. More...
 
 make_substitutions ($text, $substitutionarray, $outputlangs=null)
 Make substition into a text string, replacing keys with vals from $substitutionarray (oldval=>newval). More...
 
 complete_substitutions_array (&$substitutionarray, $outputlangs, $object=null, $parameters=null, $callfunc="completesubstitutionarray")
 Complete the $substitutionarray with more entries coming from external module that had set the "substitutions=1" into module_part array. More...
 
 print_date_range ($date_start, $date_end, $format= '', $outputlangs='')
 Format output for start and end date. More...
 
 get_date_range ($date_start, $date_end, $format= '', $outputlangs='', $withparenthesis=1)
 Format output for start and end date. More...
 
 dolGetFirstLastname ($firstname, $lastname, $nameorder=-1)
 Return firstname and lastname in correct order. More...
 
 setEventMessage ($mesgs, $style='mesgs')
 Set event message in dol_events session object. More...
 
 setEventMessages ($mesg, $mesgs, $style='mesgs')
 Set event messages in dol_events session object. More...
 
 dol_htmloutput_events ($disabledoutputofmessages=0)
 Print formated messages to output (Used to show messages on html output). More...
 
 get_htmloutput_mesg ($mesgstring='', $mesgarray='', $style='ok', $keepembedded=0)
 Get formated messages to output (Used to show messages on html output). More...
 
 get_htmloutput_errors ($mesgstring='', $mesgarray='', $keepembedded=0)
 Get formated error messages to output (Used to show messages on html output). More...
 
 dol_htmloutput_mesg ($mesgstring='', $mesgarray='', $style='ok', $keepembedded=0)
 Print formated messages to output (Used to show messages on html output). More...
 
 dol_htmloutput_errors ($mesgstring='', $mesgarray='', $keepembedded=0)
 Print formated error messages to output (Used to show messages on html output). More...
 
 dol_sort_array (&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
 Advanced sort array by second index function, which produces ascending (default) or descending output and uses optionally natural case insensitive sorting (which can be optionally case sensitive as well). More...
 
 utf8_check ($str)
 Check if a string is in UTF8. More...
 
 dol_osencode ($str)
 Return a string encoded into OS filesystem encoding. More...
 
 dol_getIdFromCode ($db, $key, $tablename, $fieldkey='code', $fieldid='id', $entityfilter=0)
 Return an id or code from a code or id. More...
 
 verifCond ($strRights)
 Verify if condition in string is ok or not. More...
 
 dol_eval ($s, $returnvalue=0, $hideerrors=1)
 Replace eval function to add more security. More...
 
 dol_validElement ($element)
 Return if var element is ok. More...
 
 picto_from_langcode ($codelang, $moreatt= '')
 Return img flag of country for a language code or country code. More...
 
 complete_head_from_modules ($conf, $langs, $object, &$head, &$h, $type, $mode='add')
 Complete or removed entries into a head array (used to build tabs). More...
 
 printCommonFooter ($zone='private')
 Print common footer : conf->global->MAIN_HTML_FOOTER js for switch of menu hider js for conf->global->MAIN_GOOGLE_AN_ID js for conf->global->MAIN_SHOW_TUNING_INFO or $_SERVER["MAIN_SHOW_TUNING_INFO"] js for conf->logbuffer. More...
 
 dolExplodeIntoArray ($string, $delimiter= ';', $kv= '=')
 Split a string with 2 keys into key array. More...
 
 dol_set_focus ($selector)
 Set focus onto field with selector (similar behaviour of 'autofocus' HTML5 tag) More...
 
 dol_getmypid ()
 Return getmypid() or random PID when function is disabled Some web hosts disable this php function for security reasons and sometimes we can't redeclare function. More...
 
 natural_search ($fields, $value, $mode=0, $nofirstand=0)
 Generate natural SQL search string for a criteria (this criteria can be tested on one or several fields) More...
 
 showDirectDownloadLink ($object)
 Return string with full Url. More...
 
 getImageFileNameForSize ($file, $extName, $extImgTarget='')
 Return the filename of file to get the thumbs. More...
 
 getAdvancedPreviewUrl ($modulepart, $relativepath, $alldata=0, $param='')
 Return URL we can use for advanced preview links. More...
 
 dol_mimetype ($file, $default='application/octet-stream', $mode=0)
 Return mime type of a file. More...
 
 getDictvalue ($tablename, $field, $id, $checkentity=false, $rowidfield='rowid')
 Return value from dictionary. More...
 
 colorIsLight ($stringcolor)
 Return true if the color is light. More...
 
 isVisibleToUserType ($type_user, &$menuentry, &$listofmodulesforexternal)
 Function to test if an entry is enabled or not. More...
 

Detailed Description

A set of functions for Dolibarr This file contains all frequently used functions.

Definition in file functions.lib.php.

Function Documentation

colorIsLight (   $stringcolor)

Return true if the color is light.

Parameters
string$stringcolorString with hex (FFFFFF) or comma RGB ('255,255,255')
Returns
int -1 : Error with argument passed |0 : color is dark | 1 : color is light

Definition at line 6994 of file functions.lib.php.

Referenced by Categorie\getNomUrl(), Categorie\print_all_ways(), and FormOther\showColor().

complete_head_from_modules (   $conf,
  $langs,
  $object,
$head,
$h,
  $type,
  $mode = 'add' 
)

Complete or removed entries into a head array (used to build tabs).

For example, with value added by external modules. Such values are declared into $conf->modules_parts['tab']. Or by change using hook completeTabsHead

Parameters
Conf$confObject conf
Translate$langsObject langs
object | null$objectObject object
array$headObject head
int$hNew position to fill
string$typeValue for object where objectvalue can be 'thirdparty' to add a tab in third party view 'intervention' to add a tab in intervention view 'supplier_order' to add a tab in supplier order view 'supplier_invoice' to add a tab in supplier invoice view 'invoice' to add a tab in customer invoice view 'order' to add a tab in customer order view 'contract' to add a tabl in contract view 'product' to add a tab in product view 'propal' to add a tab in propal view 'user' to add a tab in user view 'group' to add a tab in group view 'member' to add a tab in fundation member view 'categories_x' to add a tab in category view ('x': type of category (0=product, 1=supplier, 2=customer, 3=member) 'ecm' to add a tab for another ecm view 'stock' to add a tab for warehouse view
string$mode'add' to complete head, 'remove' to remove entries
Returns
void

Definition at line 6345 of file functions.lib.php.

References complete_substitutions_array(), dol_buildpath(), dol_syslog(), make_substitutions(), and verifCond().

Referenced by accounting_prepare_head(), actions_prepare_head(), agenda_prepare_head(), bank_admin_prepare_head(), bank_prepare_head(), blockedlogadmin_prepare_head(), calendars_prepare_head(), categories_prepare_head(), categoriesadmin_prepare_head(), commande_prepare_head(), contact_prepare_head(), contract_admin_prepare_head(), contract_prepare_head(), cron_prepare_head(), cronadmin_prepare_head(), defaultvalues_prepare_head(), delivery_prepare_head(), donation_admin_prepare_head(), donation_prepare_head(), ecm_prepare_dasboard_head(), email_admin_prepare_head(), emailing_prepare_head(), establishment_prepare_head(), expedition_admin_prepare_head(), expedition_prepare_head(), expensereport_admin_prepare_head(), expensereport_prepare_head(), facture_prepare_head(), facturefourn_prepare_head(), fichinter_admin_prepare_head(), fichinter_prepare_head(), fiscalyear_prepare_head(), group_prepare_head(), holiday_prepare_head(), hrm_admin_prepare_head(), inventoryAdminPrepareHead(), invoice_admin_prepare_head(), ldap_prepare_head(), loan_prepare_head(), marges_admin_prepare_head(), member_admin_prepare_head(), member_prepare_head(), member_stats_prepare_head(), member_type_prepare_head(), multicurrencyAdminPrepareHead(), mymoduleAdminPrepareHead(), myobjectPrepareHead(), oauthadmin_prepare_head(), opensurvey_prepare_head(), order_admin_prepare_head(), ordersupplier_prepare_head(), payment_expensereport_prepare_head(), paypaladmin_prepare_head(), prelevement_prepare_head(), product_admin_prepare_head(), product_lot_admin_prepare_head(), product_prepare_head(), productlot_prepare_head(), project_admin_prepare_head(), project_prepare_head(), project_timesheet_prepare_head(), propal_admin_prepare_head(), propal_prepare_head(), resource_prepare_head(), shipping_prepare_head(), societe_admin_prepare_head(), societe_prepare_head(), stock_prepare_head(), stripeadmin_prepare_head(), subscription_prepare_head(), supplierorder_admin_prepare_head(), task_prepare_head(), tax_prepare_head(), translation_prepare_head(), trip_prepare_head(), user_admin_prepare_head(), user_prepare_head(), various_payment_prepare_head(), vat_prepare_head(), and websiteaccountPrepareHead().

complete_substitutions_array ( $substitutionarray,
  $outputlangs,
  $object = null,
  $parameters = null,
  $callfunc = "completesubstitutionarray" 
)

Complete the $substitutionarray with more entries coming from external module that had set the "substitutions=1" into module_part array.

In this case, method completesubstitutionarray provided by module is called.

Parameters
array$substitutionarrayArray substitution old value => new value value
Translate$outputlangsOutput language
Object$objectSource object
mixed$parametersAdd more parameters (useful to pass product lines)
string$callfuncWhat is the name of the custom function that will be called? (default: completesubstitutionarray)
Returns
void
See also
make_substitutions

Definition at line 5691 of file functions.lib.php.

References dol_buildpath(), dol_dir_list(), dol_is_dir(), and dol_syslog().

Referenced by complete_head_from_modules(), Facture\create(), Adherent\makeSubstitution(), pdf_pagefoot(), pdf_watermark(), doc_generic_odt\write_file(), doc_generic_contract_odt\write_file(), doc_generic_invoice_odt\write_file(), doc_generic_shipment_odt\write_file(), doc_generic_order_odt\write_file(), doc_generic_user_odt\write_file(), doc_generic_product_odt\write_file(), doc_generic_usergroup_odt\write_file(), doc_generic_supplier_proposal_odt\write_file(), doc_generic_proposal_odt\write_file(), pdf_standard\write_file(), doc_generic_task_odt\write_file(), and doc_generic_project_odt\write_file().

dol_banner_tab (   $object,
  $paramid,
  $morehtml = '',
  $shownav = 1,
  $fieldid = 'rowid',
  $fieldref = 'ref',
  $morehtmlref = '',
  $moreparam = '',
  $nodbprefix = 0,
  $morehtmlleft = '',
  $morehtmlstatus = '',
  $onlybanner = 0,
  $morehtmlright = '' 
)

Show tab footer of a card.

Note: $object->next_prev_filter can be set to restrict select to find next or previous record by $form->showrefnav.

Parameters
Object$objectObject to show
string$paramidName of parameter to use to name the id into the URL next/previous link
string$morehtmlMore html content to output just before the nav bar
int$shownavShow Condition (navigation is shown if value is 1)
string$fieldidNom du champ en base a utiliser pour select next et previous (we make the select max and min on this field). Use 'none' for no prev/next search.
string$fieldrefNom du champ objet ref (object->ref) a utiliser pour select next et previous
string$morehtmlrefMore html to show after ref
string$moreparamMore param to add in nav link url.
int$nodbprefixDo not include DB prefix to forge table name
string$morehtmlleftMore html code to show before ref
string$morehtmlstatusMore html code to show under navigation arrows
int$onlybannerPut this to 1, if the card will contains only a banner (this add css 'arearefnobottom' on div)
string$morehtmlrightMore html code to show before navigation arrows
Returns
void

Definition at line 1296 of file functions.lib.php.

References $form, ajax_object_onoff(), dol_convert_file(), dol_sanitizeFileName(), get_exdir(), img_picto(), and print.

dol_bc (   $var,
  $moreclass = '' 
)

Return string to add class property on html element with pair/impair.

Parameters
string$var0 or 1
string$moreclassMore class to add
Returns
string String to add class onto HTML element

Definition at line 1551 of file functions.lib.php.

dol_buildpath (   $path,
  $type = 0,
  $returnemptyifnotfound = 0 
)

Return path of url or filesystem.

Return alternate root if exists.

Parameters
string$pathRelative path to file (if mode=0) or relative url (if mode=1). Ie: mydir/myfile, ../myfile
int$type0=Used for a Filesystem path, 1=Used for an URL path (output relative), 2=Used for an URL path (output full path using same host that current url), 3=Used for an URL path (output full path using host defined into $dolibarr_main_url_root of conf file)
int$returnemptyifnotfound0:If $type==0 and if file was not found into alternate dir, return default path into main dir (no test on it) 1:If $type==0 and if file was not found into alternate dir, return empty string 2:If $type==0 and if file was not found into alternate dir, test into main dir, return default path if found, empty string if not found
Returns
string Full filesystem path (if path=0), Full url path (if mode=1)

Definition at line 668 of file functions.lib.php.

Referenced by ajouter_sondage(), checkLoginPassEntity(), complete_head_from_modules(), complete_substitutions_array(), Project\createFromClone(), cron_prepare_head(), cronadmin_prepare_head(), FormMargin\displayMarginInfos(), doc_label_pdf_create(), dol_include_once(), dol_print_address(), don_create(), fichinter_create(), Utils\generateDoc(), Canvas\getCanvas(), DolibarrModules\getChangeLog(), DolibarrModules\getDescLong(), DolibarrModules\getDescLongReadmeFound(), ActionsContactCardCommon\getInstanceDao(), ActionsCardCommon\getInstanceDao(), ActionsAdherentCardCommon\getInstanceDao(), Translate\getLabelFromNumber(), Expedition\getNextNumRef(), Contrat\getNextNumRef(), Commande\getNextNumRef(), RemiseCheque\getNextNumRef(), PaiementFourn\getNextNumRef(), CommandeFournisseur\getNextNumRef(), Fichinter\getNextNumRef(), Paiement\getNextNumRef(), ExpenseReport\getNextNumRef(), FactureFournisseur\getNextNumRef(), SupplierProposal\getNextNumRef(), Facture\getNextNumRef(), Propal\getNextNumRef(), MyObject\getNomUrl(), WebsiteAccount\getNomUrl(), Inventory\getNomUrl(), Project\getNomUrl(), Interfaces\getTriggersList(), ModeleBoxes\getWidgetsList(), members_card_pdf_create(), multicurrencyAdminPrepareHead(), mymoduleAdminPrepareHead(), myobjectPrepareHead(), oauthadmin_prepare_head(), print_auguria_menu(), print_eldy_menu(), print_left_auguria_menu(), print_left_eldy_menu(), resource_prepare_head(), Interfaces\run_triggers(), FormCompany\selectCompaniesForNewContact(), Conf\setValues(), show_skin(), show_theme(), FormFile\showdocuments(), Form\showLinkedObjectBlock(), MenuManager\showmenu(), top_htmlhead(), and websiteaccountPrepareHead().

dol_clone (   $object,
  $native = 0 
)

Create a clone of instance of object (new instance with same value for properties) With native = 0: Property that are reference are also new object (true clone).

This means $this->db is not valid. With native = 1: Use PHP clone. Property that are reference are same pointer. This means $this->db is still valid.

Parameters
object$objectObject to clone
int$nativeNative method or true method
Returns
object Object clone
See also
https://php.net/manual/language.oop5.cloning.php

Definition at line 763 of file functions.lib.php.

dol_concatdesc (   $text1,
  $text2,
  $forxml = false 
)

Concat 2 descriptions with a new line between them (second operand after first one with appropriate new line separator) text1 html + text2 html => text1 + '
' + text2 text1 html + text2 txt => text1 + '
' + dol_nl2br(text2) text1 txt + text2 html => dol_nl2br(text1) + '
' + text2 text1 txt + text2 txt => text1 + '
' + text2.

Parameters
string$text1Text 1
string$text2Text 2
bool$forxmlfalse=Use
, true=Use
Returns
string Text 1 + new line + Text2
See also
dol_textishtml

Definition at line 5366 of file functions.lib.php.

References dol_nl2br(), and dol_textishtml().

Referenced by Propal\cloture(), constructGanttLine(), Facture\create(), doc_getlinedesc(), InterfaceActionsAuto\runTrigger(), Notify\send(), pdf_soleil\write_file(), pdf_strato\write_file(), pdf_aurore\write_file(), pdf_standard\write_file(), pdf_azur\write_file(), pdf_crabe\write_file(), and pdf_einstein\write_file().

dol_escape_htmltag (   $stringtoescape,
  $keepb = 0,
  $keepn = 0 
)

Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields.

Parameters
string$stringtoescapeString to escape
int$keepb1=Preserve b tags (otherwise, remove them)
int$keepn1=Preserve
strings (otherwise, replace them with escaped value)
Returns
string Escaped string
See also
dol_string_nohtmltag

Definition at line 948 of file functions.lib.php.

Referenced by DolEditor\Create(), DolGraph\draw_artichow(), DolGraph\draw_jflot(), form_constantes(), Form\formconfirm(), mailing_contacts1\formFilter(), Dolistore\get_categories(), Subscription\getNomUrl(), Deplacement\getNomUrl(), AdherentType\getNomUrl(), EcmDirectory\getNomUrl(), Loan\getNomUrl(), Address\getNomUrl(), ChargeSociales\getNomUrl(), DiscountAbsolute\getNomUrl(), PaymentSalary\getNomUrl(), PaymentVarious\getNomUrl(), PaiementFourn\getNomUrl(), Localtax\getNomUrl(), PaymentDonation\getNomUrl(), PaymentExpenseReport\getNomUrl(), Tva\getNomUrl(), PaymentSocialContribution\getNomUrl(), Livraison\getNomUrl(), Holiday\getNomUrl(), Don\getNomUrl(), Dolresource\getNomUrl(), RemiseCheque\getNomUrl(), Paiement\getNomUrl(), Contact\getNomUrl(), FactureRec\getNomUrl(), Facture\getNomUrl(), BonPrelevement\getNomUrl(), Expedition\getNomUrl(), Categorie\getNomUrl(), AccountLine\getNomUrl(), ContratLigne\getNomUrl(), left_menu(), FormFile\list_of_documents(), FormFile\listOfLinks(), Form\multiSelectArrayWithCheckbox(), print_text_menu_entry(), print_text_menu_entry_auguria(), print_text_menu_entry_empty(), printBookmarksList(), Form\select_dolusers_forevent(), FormEcm\selectAllSections(), Form\selectMassAction(), Product\show_photos(), ModeleBoxes\showBox(), Form\showFilterButtons(), ExtraFields\showInputField(), Form\textwithtooltip(), and top_menu().

dol_escape_js (   $stringtoescape,
  $mode = 0,
  $noescapebackslashn = 0 
)

Returns text escaped for inclusion into javascript code.

Parameters
string$stringtoescapeString to escape
int$mode0=Escape also ' and " into ', 1=Escape ' but not " for usage into 'string', 2=Escape " but not ' for usage into "string", 3=Escape ' and " with \
int$noescapebackslashn0=Escape also
. 1=Do not escape
.
Returns
string Escaped string. Both ' and " are escaped into ' if they are escaped.

Definition at line 925 of file functions.lib.php.

Referenced by ActionsCardCompany\assign_values(), constructGanttLine(), DolGraph\draw_jflot(), Form\formconfirm(), get_htmloutput_mesg(), price2numjs(), FormOther\selectColor(), and FormFile\showdocuments().

dol_eval (   $s,
  $returnvalue = 0,
  $hideerrors = 1 
)

Replace eval function to add more security.

This function is called by verifCond() or trans() and transnoentitiesnoconv().

Parameters
string$sString to evaluate
int$returnvalue0=No return (used to execute eval($a=something)). 1=Value of eval is returned (used to eval($something)).
int$hideerrors1=Hide errors
Returns
mixed Nothing or return of eval

Definition at line 6242 of file functions.lib.php.

Referenced by Export\build_file(), ExtraFields\showOutputField(), Translate\transnoentitiesnoconv(), and verifCond().

dol_fiche_end (   $notab = 0)

Show tab footer of a card.

Parameters
int$notab-1 or 0=Add tab footer, 1=no tab footer
Returns
void

Definition at line 1260 of file functions.lib.php.

References dol_get_fiche_end(), and print.

Referenced by journalHead(), and report_header().

dol_fiche_head (   $links = array(),
  $active = '0',
  $title = '',
  $notab = 0,
  $picto = '',
  $pictoisfullpath = 0,
  $morehtmlright = '' 
)

Show tab header of a card.

Parameters
array$linksArray of tabs. Currently initialized by calling a function xxx_admin_prepare_head
string$activeActive tab name (document', 'info', 'ldap', ....)
string$titleTitle
int$notab-1 or 0=Add tab header, 1=no tab header. If you set this to 1, using dol_fiche_end() to close tab is not required.
string$pictoAdd a picto on tab title
int$pictoisfullpathIf 1, image path is a full path. If you set this to 1, you can use url returned by dol_buildpath('/mymodyle/img/myimg.png',1) for $picto.
string$morehtmlrightAdd more html content on right of tabs title
Returns
void

Definition at line 1082 of file functions.lib.php.

References $title, dol_get_fiche_head(), and print.

Referenced by journalHead(), and report_header().

dol_format_address (   $object,
  $withcountry = 0,
  $sep = "\n",
  $outputlangs = '',
  $mode = 0 
)

Return a formated address (part address/zip/town/state) according to country rules.

Parameters
Object$objectA company or contact object
int$withcountry1=Add country into address string
string$sepSeparator to use to build string
Translate$outputlangsObject lang that contains language for text translation.
int$mode0=Standard output, 1=Remove address
Returns
string Formated string
See also
dol_print_address

Definition at line 1570 of file functions.lib.php.

References if.

Referenced by CommonObject\getFullAddress(), and pdf_build_address().

dol_get_fiche_end (   $notab = 0)

Return tab footer of a card.

Parameters
int$notab-1 or 0=Add tab footer, 1=no tab footer
Returns
string

Definition at line 1271 of file functions.lib.php.

Referenced by ActionsCardService\assign_values(), ActionsCardProduct\assign_values(), ActionsContactCardDefault\assign_values(), ActionsAdherentCardDefault\assign_values(), ActionsCardCommon\assign_values(), and dol_fiche_end().

dol_get_fiche_head (   $links = array(),
  $active = '',
  $title = '',
  $notab = 0,
  $picto = '',
  $pictoisfullpath = 0,
  $morehtmlright = '' 
)

Show tab header of a card.

Parameters
array$linksArray of tabs
string$activeActive tab name
string$titleTitle
int$notab-1 or 0=Add tab header, 1=no tab header. If you set this to 1, using dol_fiche_end() to close tab is not required.
string$pictoAdd a picto on tab title
int$pictoisfullpathIf 1, image path is a full path. If you set this to 1, you can use url returned by dol_buildpath('/mymodyle/img/myimg.png',1) for $picto.
string$morehtmlrightAdd more html content on right of tabs title
Returns
string

Definition at line 1099 of file functions.lib.php.

References $title, and img_picto().

Referenced by ActionsCardService\assign_values(), ActionsCardProduct\assign_values(), ActionsContactCardDefault\assign_values(), ActionsAdherentCardDefault\assign_values(), ActionsCardCommon\assign_values(), and dol_fiche_head().

dol_getdate (   $timestamp,
  $fast = false 
)

Return an array with locale date info.

PHP getdate is restricted to the years 1901-2038 on Unix and 1970-2038 on Windows WARNING: This function always use PHP server timezone to return locale informations !!! Usage must be avoid. FIXME: Replace this with PHP date function and a parameter $gm

Parameters
int$timestampTimestamp
boolean$fastFast mode
Returns
array Array of informations If no fast mode: 'seconds' => $secs, 'minutes' => $min, 'hours' => $hour, 'mday' => $day, 'wday' => $dow, 0=sunday, 6=saturday 'mon' => $month, 'year' => $year, 'yday' => floor($secsInYear/$_day_power), 'weekday' => gmdate('l',$_day_power*(3+$dow)), 'month' => gmdate('F',mktime(0,0,0,$month,2,1971)), If fast mode: 'seconds' => $secs, 'minutes' => $min, 'hours' => $hour, 'mday' => $day, 'mon' => $month, 'year' => $year, 'yday' => floor($secsInYear/$_day_power), 'leap' => $leaf, 'ndays' => $ndays
See also
dol_print_date, dol_stringtotime, dol_mktime

Definition at line 1846 of file functions.lib.php.

Referenced by MouvementStock\_create(), FactureRec\createRecurringInvoices(), displayBox(), dol_get_first_day_week(), dol_get_next_day(), dol_get_next_week(), dol_get_prev_day(), dol_get_prev_week(), getCommonSubstitutionArray(), GETPOST(), PaiementFourn\initAsSpecimen(), RemiseCheque\initAsSpecimen(), Paiement\initAsSpecimen(), FactureRec\initAsSpecimen(), Facture\initAsSpecimen(), box_graph_orders_supplier_permonth\loadBox(), box_graph_invoices_supplier_permonth\loadBox(), box_graph_orders_permonth\loadBox(), box_graph_propales_permonth\loadBox(), box_graph_invoices_permonth\loadBox(), box_graph_product_distribution\loadBox(), projectLinesPerWeek(), show_actions_done(), and FormActions\showactions().

dol_getIdFromCode (   $db,
  $key,
  $tablename,
  $fieldkey = 'code',
  $fieldid = 'id',
  $entityfilter = 0 
)

Return an id or code from a code or id.

Store also Code-Id into a cache to speed up next request on same key.

Parameters
DoliDB$dbDatabase handler
string$keyCode or Id to get Id or Code
string$tablenameTable name without prefix
string$fieldkeyField to search the key into
string$fieldidField to get
int$entityfilterFilter by entity
Returns
int <0 if KO, Id of code if OK
See also
$langs->getLabelFromKey

Definition at line 6171 of file functions.lib.php.

References $resql, dol_syslog(), and getEntity().

Referenced by Invoices\addPayment(), Facture\demande_prelevement(), ActionsCardCommon\doActions(), print_projecttasks_array(), RemiseCheque\rejectCheck(), and Notify\send().

dol_getmypid ( )

Return getmypid() or random PID when function is disabled Some web hosts disable this php function for security reasons and sometimes we can't redeclare function.

Returns
int

Definition at line 6592 of file functions.lib.php.

dol_html_entity_decode (   $a,
  $b,
  $c = 'UTF-8' 
)

Replace html_entity_decode functions to manage errors.

Parameters
string$aOperand a
string$bOperand b (ENT_QUOTES=convert simple and double quotes)
string$cOperand c
Returns
string String decoded

Definition at line 5202 of file functions.lib.php.

Referenced by Project\createFromClone(), Task\createFromClone(), dol_htmlentitiesbr_decode(), dol_string_nohtmltag(), Mailing\fetch(), jsUnEscape(), and pdf_getlinedesc().

dol_htmlcleanlastbr (   $stringtodecode)

This function remove all ending
and br at end.

Parameters
string$stringtodecodeString to decode
Returns
string String decoded

Definition at line 5188 of file functions.lib.php.

Referenced by ActionComm\create(), ExportCsv\csvClean(), getInvoice(), and getSupplierInvoicesForThirdParty().

dol_htmlentities (   $string,
  $flags = null,
  $encoding = 'UTF-8',
  $double_encode = false 
)

Replace htmlentities functions.

Goal of this function is to be sure to have default values of htmlentities that match what we need.

Parameters
string$stringThe input string to encode
int$flagsFlags (see PHP doc above)
string$encodingEncoding page code
bool$double_encodeWhen double_encode is turned off, PHP will not encode existing html entities
Returns
string $ret Encoded string

Definition at line 5217 of file functions.lib.php.

Referenced by dol_htmlentitiesbr(), FormMail\get_form(), run_sql(), and Form\showrefnav().

dol_htmlentitiesbr (   $stringtoencode,
  $nl2brmode = 0,
  $pagecodefrom = 'UTF-8',
  $removelasteolbr = 1 
)

This function is called to encode a string into a HTML string but differs from htmlentities because a detection is done before to see if text is already HTML or not.

Also, all entities but &,<,> are converted. This permits to encode special chars to entities with no double encoding for already encoded HTML strings. This function also remove last EOL or BR if $removelasteolbr=1 (default). For PDF usage, you can show text by 2 ways:

  • writeHTMLCell -> param must be encoded into HTML.
  • MultiCell -> param must not be encoded into HTML. Because writeHTMLCell convert also
    into
    , if function is used to build PDF, nl2brmode must be 1.
Parameters
string$stringtoencodeString to encode
int$nl2brmode0=Adding br before
, 1=Replacing
by br (for use with FPDF writeHTMLCell function for example)
string$pagecodefromPagecode stringtoencode is encoded
int$removelasteolbr1=Remove last br or lasts
(default), 0=Do nothing
Returns
string String encoded

Definition at line 5144 of file functions.lib.php.

References dol_htmlentities(), dol_nl2br(), and dol_textishtml().

Referenced by DolEditor\__construct(), Form\editfieldval(), getCommonSubstitutionArray(), box_services_contracts\loadBox(), make_substitutions(), Adherent\makeSubstitution(), pdf_getlinedesc(), pdf_getlinenum(), pdf_getlineref(), pdf_getlineref_supplier(), pdf_pagefoot(), Adherent\send_an_email(), show_ldap_content(), show_list_sending_receive(), pdf_merou\write_file(), pdf_baleine\write_file(), pdf_ban\write_file(), pdf_sepamandate\write_file(), pdf_soleil\write_file(), pdf_beluga\write_file(), pdf_rouget\write_file(), pdf_strato\write_file(), pdf_typhon\write_file(), pdf_canelle\write_file(), pdf_aurore\write_file(), pdf_standard\write_file(), pdf_muscadet\write_file(), pdf_azur\write_file(), pdf_crabe\write_file(), and pdf_einstein\write_file().

dol_htmlentitiesbr_decode (   $stringtodecode,
  $pagecodeto = 'UTF-8' 
)

This function is called to decode a HTML string (it decodes entities and br tags)

Parameters
string$stringtodecodeString to decode
string$pagecodetoPage code for result
Returns
string String decoded

Definition at line 5172 of file functions.lib.php.

References dol_html_entity_decode().

Referenced by CommActionRapport\_pages(), AdherentType\getMailOnResiliate(), AdherentType\getMailOnSubscription(), and AdherentType\getMailOnValid().

dol_htmloutput_errors (   $mesgstring = '',
  $mesgarray = '',
  $keepembedded = 0 
)

Print formated error messages to output (Used to show messages on html output).

Parameters
string$mesgstringError message
array$mesgarrayError messages array
int$keepembeddedSet to 1 in error message must be kept embedded into its html place (this disable jnotify)
Returns
void
See also
dol_print_error
dol_htmloutput_mesg

Definition at line 6060 of file functions.lib.php.

References dol_htmloutput_mesg().

dol_htmloutput_events (   $disabledoutputofmessages = 0)

Print formated messages to output (Used to show messages on html output).

Note: Calling dol_htmloutput_events is done into pages by standard llxFooter() function, so there is no need to call it explicitely.

Parameters
int$disabledoutputofmessagesClear all messages stored into session without diplaying them
Returns
void
See also
dol_htmloutput_mesg

Definition at line 5877 of file functions.lib.php.

References dol_htmloutput_mesg().

Referenced by llxFooterSurvey().

dol_htmloutput_mesg (   $mesgstring = '',
  $mesgarray = '',
  $style = 'ok',
  $keepembedded = 0 
)

Print formated messages to output (Used to show messages on html output).

Parameters
string$mesgstringMessage string or message key
string[]$mesgarray Array of message strings or message keys
string$styleWhich style to use ('ok', 'warning', 'error')
int$keepembeddedSet to 1 if message must be kept embedded into its html place (this disable jnotify)
Returns
void
See also
dol_print_error
dol_htmloutput_errors
setEventMessages

Definition at line 6006 of file functions.lib.php.

References get_htmloutput_mesg(), and print.

Referenced by dol_htmloutput_errors(), and dol_htmloutput_events().

if (!function_exists('dol_getprefix')) dol_include_once (   $relpath,
  $classname = '' 
)

Return a prefix to use for this Dolibarr instance, for session/cookie names or email id.

This prefix is valid in a web context only and is unique for instance and avoid conflict between multi-instances, even when having two instances with one root dir or two instances in virtual servers.

Parameters
string$mode'' (prefix for session name) or 'email' (prefix for email id)
Returns
string A calculated prefix Make an include_once using default root and alternate root if it fails. To link to a core file, use include(DOL_DOCUMENT_ROOT.'/pathtofile') To link to a module file from a module file, use include './mymodulefile'; To link to a module file from a core file, then this function can be used (call by hook / trigger / speciales pages)
Parameters
string$relpathRelative path to file (Ie: mydir/myfile, ../myfile, ...)
string$classnameClass name (deprecated)
Returns
bool True if load is a success, False if it fails

Definition at line 639 of file functions.lib.php.

References dol_buildpath(), and dol_syslog().

Referenced by FileUpload\__construct(), ActionsCardCommon\assign_values(), Product\check_barcode(), Societe\check_codeclient(), Societe\check_codefournisseur(), Societe\codeclient_modifiable(), Societe\codefournisseur_modifiable(), Product\create(), Contrat\create(), Propal\createFromClone(), Project\createFromClone(), Contrat\createFromClone(), Commande\createFromProposal(), dolGetElementUrl(), UserGroup\fetch(), Form\form_multicurrency_code(), Utils\generateDoc(), Product\get_barcode(), Societe\get_codeclient(), Societe\get_codecompta(), Societe\get_codefournisseur(), MouvementStock\get_origin(), CommonDocGenerator\get_substitutionarray_shipment(), CommonDocGenerator\get_substitutionarray_shipment_lines(), ImportCsv\import_insert(), ImportXlsx\import_insert(), HookManager\initHooks(), InfoBox\listBoxes(), AdvanceTargetingMailing\query_contact(), AdvanceTargetingMailing\query_thirdparty(), Cronjob\run_jobs(), CSMSFile\sendfile(), Conf\setValues(), and FormSms\show_form().

dol_microtime_float ( )

Same function than microtime in PHP 5 but compatible with PHP4.

Returns
float Time (millisecondes) with microsecondes in decimal part
Deprecated:
Dolibarr does not support PHP4, you should use native function
See also
microtime()

Definition at line 5312 of file functions.lib.php.

References dol_syslog().

dol_mimetype (   $file,
  $default = 'application/octet-stream',
  $mode = 0 
)

Return mime type of a file.

Parameters
string$fileFilename we looking for MIME type
string$defaultDefault mime type if extension not found in known list
int$mode0=Return full mime, 1=otherwise short mime string, 2=image for mime type, 3=source language, 4=css of font fa
Returns
string Return a mime type family (text/xxx, application/xxx, image/xxx, audio, video, archive)
See also
image_format_supported (images.lib.php)

Definition at line 6842 of file functions.lib.php.

Referenced by dol_init_file_process(), FormMail\get_form(), getAdvancedPreviewUrl(), getDocument(), FormFile\getDocumentsLink(), FileUpload\getFileObject(), FileUpload\handleFileUpload(), Notify\send(), FormFile\showdocuments(), pdf_standardlabel\write_file(), pdf_standard\write_file(), and pdf_tcpdflabel\write_file().

dol_mkdir (   $dir,
  $dataroot = '',
  $newmask = null 
)

Creation of a directory (this can create recursive subdir)

Parameters
string$dirDirectory to create (Separator must be '/'. Example: '/mydir/mysubdir')
string$datarootData root directory (To avoid having the data root in the loop. Using this will also lost the warning on first dir PHP has no permission when open_basedir is used)
int$newmaskMask for new file (Defaults to $conf->global->MAIN_UMASK or 0755 if unavailable). Example: '0444'
Returns
int < 0 if KO, 0 = already exists, > 0 if OK

Definition at line 4933 of file functions.lib.php.

References dol_osencode(), and dol_syslog().

Referenced by Categorie\add_photo(), Product\add_photo(), mailing_xinputfile\add_to_target(), ActionComm\build_exportfile(), Export\build_file(), EcmDirectory\create(), BonPrelevement\Create(), DolibarrModules\create_dirs(), Website\createFromClone(), Project\createFromClone(), Task\createFromClone(), FileUpload\createScaledImage(), dol_add_file_process(), dol_filecache(), dol_meta_create(), dolCopyDir(), dolSaveCssFile(), dolSaveHtaccessFile(), dolSaveHtmlHeader(), dolSaveJsFile(), dolSaveRobotFile(), Ldap\dump(), Utils\dumpDatabase(), Website\exportWebSite(), Utils\generateDoc(), Stats\getAllByProductEntry(), getAllImages(), Stats\getAmountByMonthWithPrevYear(), Stats\getNbByMonthWithPrevYear(), ProjectStats\getTransformRateByMonthWithPrevYear(), ProjectStats\getWeightedAmountByMonthWithPrevYear(), FileUpload\handleFileUpload(), modSupplierProposal\init(), modContrat\init(), modPropale\init(), modCommande\init(), modFacture\init(), modExpedition\init(), modProjet\init(), modSociete\init(), RssParser\parser(), pdf_getInstance(), rebuild_merge_pdf(), Cronjob\run_jobs(), InterfaceActionsAuto\runTrigger(), vignette(), html_cerfafr\write_file(), pdf_merou\write_file(), BordereauChequeBlochet\write_file(), CommActionRapport\write_file(), pdf_ban\write_file(), pdf_baleine\write_file(), pdf_paiement\write_file(), pdf_sepamandate\write_file(), pdf_soleil\write_file(), pdf_beluga\write_file(), pdf_rouget\write_file(), pdf_strato\write_file(), pdf_typhon\write_file(), pdf_canelle\write_file(), pdf_aurore\write_file(), pdf_standard\write_file(), pdf_muscadet\write_file(), pdf_azur\write_file(), pdf_crabe\write_file(), doc_generic_odt\write_file(), doc_generic_contract_odt\write_file(), pdf_einstein\write_file(), doc_generic_invoice_odt\write_file(), doc_generic_shipment_odt\write_file(), doc_generic_order_odt\write_file(), doc_generic_user_odt\write_file(), doc_generic_product_odt\write_file(), doc_generic_usergroup_odt\write_file(), doc_generic_proposal_odt\write_file(), doc_generic_supplier_proposal_odt\write_file(), pdf_standardlabel\write_file(), pdf_tcpdflabel\write_file(), doc_generic_task_odt\write_file(), doc_generic_project_odt\write_file(), modTcpdfbarcode\writeBarCode(), and modPhpbarcode\writeBarCode().

dol_mktime (   $hour,
  $minute,
  $second,
  $month,
  $day,
  $year,
  $gm = false,
  $check = 1 
)

Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Replace function mktime not available under Windows if year < 1970 PHP mktime is restricted to the years 1901-2038 on Unix and 1970-2038 on Windows.

Parameters
int$hourHour (can be -1 for undefined)
int$minuteMinute (can be -1 for undefined)
int$secondSecond (can be -1 for undefined)
int$monthMonth (1 to 12)
int$dayDay (1 to 31)
int$yearYear
mixed$gmTrue or 1 or 'gmt'=Input informations are GMT values False or 0 or 'server' = local to server TZ 'user' = local to user TZ 'tz,TimeZone' = use specified timezone
int$check0=No check on parameters (Can use day 32, etc...)
Returns
int|string Date as a timestamp, '' or false if error
See also
dol_print_date, dol_stringtotime, dol_getdate

Definition at line 1885 of file functions.lib.php.

References dol_print_error(), and dol_syslog().

Referenced by MouvementStock\_create(), Product\_get_stats(), pdf_paiement\_pagehead(), mailing_fraise\add_to_target(), CommonInvoice\calculate_date_lim_reglement(), Project\createFromClone(), Task\createFromClone(), FactureRec\createRecurringInvoices(), displayBox(), dol_get_first_day(), dol_get_first_day_week(), dol_get_last_day(), dol_get_next_day(), dol_get_next_week(), dol_get_prev_day(), dol_get_prev_week(), dol_print_date(), dol_stringtotime(), get_next_value(), ExtraFields\getOptionalsFromPost(), ICal\ical_date_to_unix(), PaiementFourn\initAsSpecimen(), RemiseCheque\initAsSpecimen(), Paiement\initAsSpecimen(), FactureRec\initAsSpecimen(), Facture\initAsSpecimen(), DoliDB\jdate(), ExtraFields\setOptionalsFromPost(), and xyzToUnixTimestamp().

dol_nboflines (   $s,
  $maxchar = 0 
)

Return nb of lines of a clear text.

Parameters
string$sString to check
int$maxcharNot yet used
Returns
int Number of lines
See also
dol_nboflines_bis, dolGetFirstLineOfText

Definition at line 5253 of file functions.lib.php.

Referenced by CommActionRapport\_pages().

dol_nboflines_bis (   $text,
  $maxlinesize = 0,
  $charset = 'UTF-8' 
)

Return nb of lines of a formated text with
and
(WARNING: string must not have mixed
and br separators)

Parameters
string$textText
int$maxlinesizeLargeur de ligne en caracteres (ou 0 si pas de limite - defaut)
string$charsetGive the charset used to encode the $text variable in memory.
Returns
int Number of lines
See also
dol_nboflines, dolGetFirstLineOfText

Definition at line 5272 of file functions.lib.php.

References dol_strlen(), and dol_textishtml().

Referenced by pdf_aurore\_pagehead(), and pdf_standard\write_file().

dol_nl2br (   $stringtoencode,
  $nl2brmode = 0,
  $forxml = false 
)

Replace CRLF in string with a HTML BR tag.

Parameters
string$stringtoencodeString to encode
int$nl2brmode0=Adding br before
, 1=Replacing
by br
bool$forxmlfalse=Use
, true=Use
Returns
string String encoded
See also
dol_nboflines, dolGetFirstLineOfText

Definition at line 5116 of file functions.lib.php.

Referenced by ActionsContactCardCommon\assign_values(), ActionsAdherentCardCommon\assign_values(), ActionsCardCommon\assign_values(), dol_concatdesc(), dol_htmlentitiesbr(), Form\editInPlace(), and FormMail\get_form().

dol_now (   $mode = 'gmt')

Return date for now.

In most cases, we use this function without parameters (that means GMT time).

Parameters
string$mode'gmt' => we return GMT timestamp, 'tzserver' => we add the PHP server timezone 'tzref' => we add the company timezone 'tzuser' => we add the user timezone
Returns
int $date Timestamp

Definition at line 1968 of file functions.lib.php.

References getServerTimeZoneInt().

Referenced by modUser\__construct(), modAdherent\__construct(), modSociete\__construct(), MouvementStock\_create(), Product\_log_price(), pdf_ban\_pagehead(), Contrat\activateAll(), Product\add_fournisseur(), mailing_thirdparties_services_expired\add_to_target(), mailing_fraise\add_to_target(), Account\addline(), Holiday\addLogCP(), BonPrelevement\AddNotification(), Tva\addPayment(), CommandeFournisseur\approve(), build_calfile(), ActionComm\build_exportfile(), CommandeFournisseur\calcAndSetStatusDispatch(), Product\clone_fournisseurs(), Contrat\closeAll(), Commande\cloture(), SupplierProposal\cloture(), Propal\cloture(), Link\create(), UserBankAccount\create(), Subscription\create(), PaymentExpenseReport\create(), Propalmergepdfproduct\create(), Fiscalyear\create(), CompanyBankAccount\create(), Productcustomerprice\create(), Tva\create(), Deplacement\create(), PaymentSocialContribution\create(), LoanSchedule\create(), PaymentLoan\create(), PaymentDonation\create(), Address\create(), Establishment\create(), EcmDirectory\create(), Livraison\create(), RejetPrelevement\create(), Cronjob\create(), FactureRec\create(), AdvanceTargetingMailing\create(), EcmFiles\create(), Productlot\create(), Mailing\create(), Entrepot\create(), BookKeeping\create(), AccountancySystem\create(), Bookmark\create(), Website\create(), Holiday\create(), Loan\create(), RemiseCheque\create(), PaiementFourn\create(), Project\create(), DiscountAbsolute\create(), AccountingAccount\create(), Paiement\create(), ExpenseReport\create(), ChargeSociales\create(), Fichinter\create(), Contact\create(), Expedition\create(), ActionComm\create(), FactureFournisseur\create(), Facture\create(), Adherent\create(), PaymentVarious\create(), PaymentSalary\create(), Don\create(), Product\create(), Societe\create(), Account\create(), BlockedLog\create(), UserGroup\create(), Commande\create(), SupplierProposal\create(), BonPrelevement\Create(), Contrat\create(), Propal\create(), User\create(), CommandeFournisseur\create(), ExtraFields\create_label(), createActionComm(), createContact(), Mailing\createFromClone(), ActionComm\createFromClone(), Facture\createFromClone(), Commande\createFromClone(), SupplierProposal\createFromClone(), Propal\createFromClone(), Project\createFromClone(), Task\createFromClone(), Facture\createFromOrder(), Commande\createFromProposal(), createInvoice(), createInvoiceFromOrder(), createOrder(), createPayment(), SupplierProposal\createPriceFournisseur(), createProductOrService(), FactureRec\createRecurringInvoices(), BookKeeping\createStd(), createThirdParty(), deleteProductOrService(), Facture\demande_prelevement(), CommandeFournisseur\dispatchProduct(), displayBox(), dol_cache_refresh(), AccountancyExport\exportCiel(), Website\exportWebSite(), Contrat\fetch_lines(), BonPrelevement\generate(), get_next_value(), CommonDocGenerator\get_substitutionarray_other(), Stats\getAllByProductEntry(), Stats\getAmountByMonthWithPrevYear(), getCommonSubstitutionArray(), ContratLigne\getLibStatut(), getListOfGroups(), getListOfProductsOrServices(), getListOfThirdParties(), Stats\getNbByMonthWithPrevYear(), mailing_thirdparties_services_expired\getNbOfRecipients(), mod_codeclient_monkey\getNextValue(), mod_project_simple\getNextValue(), mod_task_simple\getNextValue(), mod_project_universal\getNextValue(), mod_task_universal\getNextValue(), mod_livraison_jade\getNextValue(), mod_barcode_product_standard\getNextValue(), mod_codeproduct_elephant\getNextValue(), mod_codeclient_elephant\getNextValue(), GETPOST(), getServerTimeZoneInt(), ProjectStats\getTransformRateByMonthWithPrevYear(), ProjectStats\getWeightedAmountByMonthWithPrevYear(), ActionComm\hasDelay(), Project\hasDelay(), Task\hasDelay(), Adherent\hasDelay(), ExpenseReport\hasDelay(), FactureFournisseur\hasDelay(), CommandeFournisseur\hasDelay(), Commande\hasDelay(), Facture\hasDelay(), modBlockedLog\init(), Don\initAsSpecimen(), CompanyBankAccount\initAsSpecimen(), WebsitePage\initAsSpecimen(), Opensurveysondage\initAsSpecimen(), PaiementFourn\initAsSpecimen(), Entrepot\initAsSpecimen(), ExpenseReport\initAsSpecimen(), Website\initAsSpecimen(), EcmFiles\initAsSpecimen(), Livraison\initAsSpecimen(), RemiseCheque\initAsSpecimen(), Paiement\initAsSpecimen(), Project\initAsSpecimen(), Fichinter\initAsSpecimen(), FactureRec\initAsSpecimen(), BookKeeping\initAsSpecimen(), ActionComm\initAsSpecimen(), Expedition\initAsSpecimen(), Holiday\initAsSpecimen(), FactureFournisseur\initAsSpecimen(), Contrat\initAsSpecimen(), User\initAsSpecimen(), CommandeFournisseur\initAsSpecimen(), Societe\initAsSpecimen(), Facture\initAsSpecimen(), Product\initAsSpecimen(), DolibarrModules\insert_cronjobs(), Holiday\LibStatut(), FormFile\listOfLinks(), RemiseCheque\load_board(), Account\load_board(), Adherent\load_board(), FactureFournisseur\load_board(), Contrat\load_board(), SupplierProposal\load_board(), ExpenseReport\load_board(), Propal\load_board(), Facture\load_board(), box_graph_invoices_permonth\loadBox(), box_graph_invoices_supplier_permonth\loadBox(), box_graph_orders_permonth\loadBox(), box_graph_orders_supplier_permonth\loadBox(), box_graph_propales_permonth\loadBox(), box_services_expired\loadBox(), box_factures\loadBox(), box_ficheinter\loadBox(), box_contracts\loadBox(), box_graph_product_distribution\loadBox(), box_actions\loadBox(), box_services_contracts\loadBox(), box_propales\loadBox(), box_factures_imp\loadBox(), box_activity\loadBox(), migrate_project_task_actors(), migrate_project_user_resp(), migrate_reset_blocked_log(), LoanSchedule\paimenttorecord(), PriceParser\parseExpression(), RssParser\parser(), SupplierInvoices\post(), SupplierOrders\post(), Invoices\post(), Utils\purgeFiles(), modBlockedLog\remove(), Contrat\reopen(), Cronjob\run_jobs(), InterfaceLogevents\runTrigger(), InterfaceActionsAuto\runTrigger(), Form\select_date(), Notify\send(), ActionComm\sendEmailsReminder(), Societe\set_price_level(), Societe\set_remise_client(), ExpenseReport\setApproved(), Project\setClose(), ExpenseReport\setDeny(), Fichinter\setValid(), ExpenseReport\setValidate(), show_actions_done(), show_array_actions_to_do(), show_array_last_actions_done(), FormActions\showactions(), Account\solde(), Adherent\subscription(), Link\update(), Productlot\update(), ProductStockEntrepot\update(), Website\update(), Productcustomerprice\update(), Societe\update(), ProductFournisseur\update_buyprice(), ExtraFields\update_label(), User\update_last_login_date(), updateActionComm(), CommonObject\updateCommon(), updateContact(), lettering\updateLettrage(), updateOrder(), updateProductOrService(), Holiday\updateSoldeCP(), updateThirdParty(), Commande\valid(), Livraison\valid(), Mailing\valid(), CommandeFournisseur\valid(), Expedition\valid(), SupplierProposal\valid(), Propal\valid(), Contrat\validate(), FactureFournisseur\validate(), Adherent\validate(), Facture\validate(), write_conf_file(), html_cerfafr\write_file(), doc_generic_odt\write_file(), doc_generic_contract_odt\write_file(), doc_generic_invoice_odt\write_file(), doc_generic_order_odt\write_file(), doc_generic_shipment_odt\write_file(), doc_generic_user_odt\write_file(), doc_generic_product_odt\write_file(), doc_generic_usergroup_odt\write_file(), doc_generic_supplier_proposal_odt\write_file(), doc_generic_proposal_odt\write_file(), and doc_generic_project_odt\write_file().

dol_osencode (   $str)
dol_print_address (   $address,
  $htmlid,
  $mode,
  $id,
  $noprint = 0,
  $charfornl = '' 
)

Format address string.

Parameters
string$addressAddress
int$htmlidHtml ID (for example 'gmap')
int$modethirdparty|contact|member|other
int$idId of object
int$noprintNo output. Result is the function return
string$charfornlChar to use instead of nl2br. '' means we use a standad nl2br.
Returns
string|void Nothing if noprint is 0, formatted address if noprint is 1
See also
dol_format_address

Definition at line 2386 of file functions.lib.php.

References dol_buildpath(), and print.

dol_print_date (   $time,
  $format = '',
  $tzoutput = 'tzserver',
  $outputlangs = '',
  $encodetooutput = false 
)

Output date in a string format according to outputlangs (or langs if not defined).

Return charset is always UTF-8, except if encodetoouput is defined. In this case charset is output charset

Parameters
int$timeGM Timestamps date
string$formatOutput date format (tag of strftime function) "%d %b %Y", "%d/%m/%Y %H:%M", "%d/%m/%Y %H:%M:%S", "%B"=Long text of month, "%A"=Long text of day, "%b"=Short text of month, "%a"=Short text of day "day", "daytext", "dayhour", "dayhourldap", "dayhourtext", "dayrfc", "dayhourrfc", "...reduceformat"
string$tzoutputtrue or 'gmt' => string is for Greenwich location false or 'tzserver' => output string is for local PHP server TZ usage 'tzuser' => output string is for user TZ (current browser TZ with current dst) => In a future, we should have same behaviour than 'tzuserrel' 'tzuserrel' => output string is for user TZ (current browser TZ with dst or not, depending on date position) (TODO not implemented yet)
Translate$outputlangsObject lang that contains language for text translation.
boolean$encodetooutputfalse=no convert into output pagecode
Returns
string Formated date or '' if time is null
See also
dol_mktime, dol_stringtotime, dol_getdate

Definition at line 1669 of file functions.lib.php.

References dol_mktime(), dol_strlen(), dol_substr(), and dol_syslog().

Referenced by modUser\__construct(), modAdherent\__construct(), modSociete\__construct(), printing_printgcp\__construct(), MouvementStock\_create(), Product\_get_stats(), Adherent\_load_ldap_info(), pdf_ban\_pagehead(), pdf_paiement\_pagehead(), pdf_baleine\_pagehead(), pdf_merou\_pagehead(), pdf_soleil\_pagehead(), pdf_strato\_pagehead(), pdf_standard\_pagehead(), pdf_sepamandate\_pagehead(), pdf_beluga\_pagehead(), pdf_typhon\_pagehead(), pdf_rouget\_pagehead(), pdf_canelle\_pagehead(), pdf_muscadet\_pagehead(), pdf_einstein\_pagehead(), pdf_azur\_pagehead(), pdf_crabe\_pagehead(), CommActionRapport\_pages(), pdf_einstein\_tableau_info(), pdf_aurore\_tableau_info(), pdf_azur\_tableau_info(), pdf_crabe\_tableau_versements(), pdf_canelle\_tableau_versements(), mailing_fraise\add_to_target(), build_calfile(), constructGanttLine(), convertSecondToTime(), Facture\create(), create_key_table(), Mailing\createFromClone(), Task\createFromClone(), displayBox(), doc_getlinedesc(), dol_meta_create(), dol_print_object_info(), dol_syslog(), Form\editfieldval(), Form\editInPlace(), BonPrelevement\EnregDestinataireSEPA(), BonPrelevement\EnregEmetteurSEPA(), mod_syslog_file\export(), AccountancyExport\exportAgiris(), AccountancyExport\exportBob50(), AccountancyExport\exportCegid(), AccountancyExport\exportCiel(), AccountancyExport\exportCoala(), AccountancyExport\exportCogilog(), AccountancyExport\exportConfigurable(), AccountancyExport\exportEbp(), AccountancyExport\exportNormal(), AccountancyExport\exportQuadratus(), Website\exportWebSite(), CommonDocGenerator\fill_substitutionarray_with_extrafields(), Form\form_date(), BonPrelevement\generate(), get_date_range(), Dolistore\get_products(), CommonDocGenerator\get_substitutionarray_lines(), doc_generic_project_odt\get_substitutionarray_object(), doc_generic_task_odt\get_substitutionarray_object(), CommonDocGenerator\get_substitutionarray_object(), CommonDocGenerator\get_substitutionarray_other(), doc_generic_task_odt\get_substitutionarray_project_file(), doc_generic_project_odt\get_substitutionarray_project_file(), doc_generic_task_odt\get_substitutionarray_project_reference(), doc_generic_project_odt\get_substitutionarray_project_reference(), CommonDocGenerator\get_substitutionarray_shipment(), doc_generic_task_odt\get_substitutionarray_task_file(), doc_generic_project_odt\get_substitutionarray_task_file(), doc_generic_project_odt\get_substitutionarray_tasks(), doc_generic_task_odt\get_substitutionarray_tasks(), doc_generic_task_odt\get_substitutionarray_taskstime(), doc_generic_project_odt\get_substitutionarray_taskstime(), getActionComm(), ExpenseReportRule\getAllRule(), getCommonSubstitutionArray(), CoreObject\getDate(), getInvoice(), getInvoicesForThirdParty(), PriceGlobalVariableUpdater\getLastUpdated(), Productlot\getNomUrl(), Project\getNomUrl(), User\getNomUrl(), getOrder(), getOrdersForThirdParty(), getProductOrService(), getProductsForCategory(), getProject(), getServerTimeZoneInt(), getSupplierInvoice(), getSupplierInvoicesForThirdParty(), getThirdParty(), getUser(), BordereauChequeBlochet\Header(), DoliDB\idate(), DoliDBMssql\idate(), DoliDBPgsql\idate(), printing_printgcp\list_jobs(), FormFile\listOfLinks(), box_lastlogin\loadBox(), box_factures_fourn_imp\loadBox(), box_services_expired\loadBox(), box_factures\loadBox(), box_ficheinter\loadBox(), box_fournisseurs\loadBox(), box_factures_fourn\loadBox(), box_supplier_orders\loadBox(), box_contracts\loadBox(), box_services_contracts\loadBox(), box_actions\loadBox(), box_propales\loadBox(), box_commandes\loadBox(), box_external_rss\loadBox(), box_factures_imp\loadBox(), box_contacts\loadBox(), box_clients\loadBox(), box_produits\loadBox(), box_goodcustomers\loadBox(), box_prospect\loadBox(), box_members\loadBox(), ActionsCardProduct\LoadListDatas(), Adherent\makeSubstitution(), ExpenseReport\offsetAlreadyGiven(), pdf_getlinedesc(), pdf_getLinkedObjects(), projectLinesa(), projectLinesPerAction(), report_header(), Cronjob\reprogram_jobs(), InterfaceActionsAuto\runTrigger(), FormAccounting\select_bookkeeping_importkey(), Form\select_date(), BonPrelevement\set_infocredit(), BonPrelevement\set_infotrans(), vCard\setBirthday(), show_actions_done(), show_list_sending_receive(), FormActions\showactions(), CommandeFournisseur\showDelay(), Commande\showDelay(), FormFile\showdocuments(), ExtraFields\showOutputField(), Holiday\updateSoldeCP(), write_conf_file(), html_cerfafr\write_file(), pdf_baleine\write_file(), pdf_paiement\write_file(), pdf_soleil\write_file(), pdf_beluga\write_file(), pdf_strato\write_file(), pdf_standard\write_file(), doc_generic_odt\write_file(), doc_generic_contract_odt\write_file(), doc_generic_invoice_odt\write_file(), doc_generic_shipment_odt\write_file(), doc_generic_order_odt\write_file(), doc_generic_user_odt\write_file(), doc_generic_product_odt\write_file(), doc_generic_usergroup_odt\write_file(), doc_generic_proposal_odt\write_file(), doc_generic_supplier_proposal_odt\write_file(), and doc_generic_project_odt\write_file().

dol_print_email (   $email,
  $cid = 0,
  $socid = 0,
  $addlink = 0,
  $max = 64,
  $showinvalid = 1,
  $withpicto = 0 
)

Show EMail link.

Parameters
string$emailEMail to show (only email, without 'Name of recipient' before)
int$cidId of contact if known
int$socidId of third party if known
int$addlink0=no link, 1=email has a html email link (+ link to create action if constant AGENDA_ADDACTIONFOREMAIL is on)
int$maxMax number of characters to show
int$showinvalidShow warning if syntax email is wrong
int$withpictoShow picto
Returns
string HTML Link

Definition at line 2073 of file functions.lib.php.

References dol_trunc(), img_object(), img_picto(), img_warning(), and isValidEmail().

Referenced by ActionsContactCardCommon\assign_values(), ActionsAdherentCardCommon\assign_values(), ActionsCardCommon\assign_values(), Form\editfieldval(), and ExtraFields\showOutputField().

dol_print_error (   $db = '',
  $error = '',
  $errors = null 
)

Affiche message erreur system avec toutes les informations pour faciliter le diagnostic et la remontee des bugs.

On doit appeler cette fonction quand une erreur technique bloquante est rencontree. Toutefois, il faut essayer de ne l'appeler qu'au sein de pages php, les classes devant renvoyer leur erreur par l'intermediaire de leur propriete "error".

Parameters
DoliDB$dbDatabase handler
mixed$errorString or array of errors strings to show
array$errorsArray of errors
Returns
void
See also
dol_htmloutput_errors

Definition at line 3374 of file functions.lib.php.

Referenced by mailing_thirdparties_services_expired\__construct(), modAgenda\__construct(), MouvementStock\_create(), Stats\_getAllByProduct(), Stats\_getAllByYear(), Stats\_getAmountByMonth(), Stats\_getAverageByMonth(), Stats\_getNbByMonth(), Stats\_getNbByYear(), Product\_log_price(), Contrat\activateAll(), Product\add_sousproduit(), mailing_contacts1\add_to_target(), addDocumentModel(), Account\addline(), Localtax\addPayment(), Tva\addPayment(), PaymentLoan\addPaymentToBank(), PaymentExpenseReport\addPaymentToBank(), PaymentDonation\addPaymentToBank(), PaymentSocialContribution\addPaymentToBank(), Paiement\addPaymentToBank(), UserGroup\addrights(), User\addrights(), Task\addTimeSpent(), ajouter_sondage(), BlockedLog\alreadyUsed(), ActionsAdherentCardCommon\assign_post(), ActionsContactCardCommon\assign_post(), Export\build_filterField(), calcul_price_total(), MouvementStock\calculateBalanceForProductBefore(), Account\can_be_deleted(), checkUserAccessToObject(), chequereceipt_pdf_create(), CommandeFournisseur\classifyBilled(), clean_data_ecm_directories(), cleanCorruptedTree(), Contrat\closeAll(), Form\constructProductListOption(), Societe\contact_array(), Societe\contact_array_objects(), Societe\contact_get_property(), Societe\contact_property_array(), Categorie\containing(), Account\countAccountToReconcile(), Menubase\create(), EcmFiles\create(), Fichinter\create(), FactureFournisseur\create(), Facture\create(), PaymentVarious\create(), PaymentSalary\create(), Commande\create(), SupplierProposal\create(), Contrat\create(), Propal\create(), CommandeFournisseur\create(), Holiday\createCPusers(), FactureRec\createRecurringInvoices(), AccountLine\dateo_change(), AccountLine\datev_change(), Product\del_sousproduit(), delDocumentModel(), DiscountAbsolute\delete(), UserGroup\delete(), BonPrelevement\delete(), ExtraFields\delete_label(), Facture\deleteline(), UserGroup\delrights(), User\delrights(), ActionsCardCommon\doActions(), doc_label_pdf_create(), dol_dir_list_in_database(), dol_mktime(), dol_set_user_param(), dolibarr_del_const(), dolibarr_set_const(), don_create(), DolGraph\draw_jflot(), facture_prepare_head(), Bookmark\fetch(), PaiementFourn\fetch(), Paiement\fetch(), UserBankAccount\fetch(), Categorie\fetch(), CompanyBankAccount\fetch(), Import\fetch(), Don\fetch(), Export\fetch(), Product\fetch(), ExpenseReportLine\fetch(), SupplierProposalLine\fetch(), CommandeFournisseurLigne\fetch(), Opensurveysondage\fetch_lines(), Adherent\fetch_login(), Adherent\fetch_name(), ActionComm\fetch_userassigned(), ProductAttribute\fetchAll(), ExpeditionLineBatch\fetchAll(), Task\fetchAllTimeSpent(), ActionComm\fetchResources(), fichinter_create(), FormCompany\form_prospect_level(), mailing_fraise\formFilter(), mailing_contacts1\formFilter(), mailing_thirdparties\formFilter(), mailing_advthirdparties\formFilter(), Utils\generateDoc(), Societe\generateDocument(), RemiseCheque\generatePdf(), Categorie\get_all_categories(), User\get_children(), Project\get_element_list(), Categorie\get_filles(), FormMail\get_form(), EcmDirectory\get_full_arbo(), Entrepot\get_full_arbo(), Categorie\get_full_arbo(), User\get_full_tree(), Categorie\get_meres(), Categorie\get_nb_categories(), get_next_value(), get_product_localtax_for_country(), get_product_vat_for_country(), Account\get_url(), ExpenseReportIk\getAllRanges(), ExpenseReportRule\getAllRule(), AccountancyCategory\getCats(), AccountancyCategory\getCatsCpts(), Product\getChildsArbo(), getCountry(), AccountancyCategory\getCptsCat(), CommandeFournisseur\getDispachedLines(), ExpenseReportLine\getExpAmount(), Product\getFather(), ActionsCardService\getFieldList(), ActionsCardProduct\getFieldList(), CommandeFournisseur\getInputMethod(), CommonInvoice\getListIdAvoirFromInvoice(), InterfaceNotification\getListOfManagedEvents(), getListOfModels(), Facture\getListOfPayments(), ExpenseReportIk\getMaxRangeNumber(), Expedition\getNextNumRef(), Contrat\getNextNumRef(), Commande\getNextNumRef(), RemiseCheque\getNextNumRef(), PaiementFourn\getNextNumRef(), CommandeFournisseur\getNextNumRef(), Fichinter\getNextNumRef(), Paiement\getNextNumRef(), ExpenseReport\getNextNumRef(), FactureFournisseur\getNextNumRef(), SupplierProposal\getNextNumRef(), Facture\getNextNumRef(), Propal\getNextNumRef(), mod_facture_mars\getNextValue(), mod_facture_fournisseur_cactus\getNextValue(), mod_facture_terre\getNextValue(), BlockedLog\getPreviousHash(), Project\getProjectsAuthorizedForUser(), ExpenseReportIk\getRangesByCategory(), Societe\getSalesRepresentatives(), getServerTimeZoneInt(), getSourceDocRef(), getState(), getStaticMember(), DiscountAbsolute\getSumCreditNotesUsed(), DiscountAbsolute\getSumDepositsUsed(), Task\getSummaryOfTimeSpent(), Task\getSumOfAmount(), Task\getTasksArray(), ExpenseReportIk\getTaxCategories(), getTaxesFromId(), Holiday\getTypes(), Task\getUserRolesForProjectsOrTasks(), ImportCsv\import_insert(), ImportXlsx\import_insert(), Fiscalyear\info(), Establishment\info(), EmailSenderProfile\info(), Entrepot\info(), Subscription\info(), MyObject\info(), PaiementFourn\info(), Inventory\info(), WebsiteAccount\info(), Deplacement\info(), Address\info(), AccountingAccount\info(), ChargeSociales\info(), PaymentSalary\info(), PaymentVarious\info(), PaymentExpenseReport\info(), ExpenseReport\info(), Tva\info(), Fichinter\info(), Paiement\info(), Don\info(), ActionComm\info(), FactureFournisseur\info(), Project\info(), Contrat\info(), SupplierProposal\info(), Adherent\info(), AccountLine\info(), User\info(), CommandeFournisseur\info(), Societe\info(), Propal\info(), Facture\info(), Commande\info(), Product\info(), FichinterLigne\insert(), DolibarrModules\insert_permissions(), Product\is_sousproduit(), CommonObject\isExistingObject(), Export\list_export_model(), Fournisseur\ListArray(), SupplierProposal\liste_array(), Commande\liste_array(), Propal\liste_array(), Facture\liste_array(), Deplacement\listOfTypes(), ExpenseReport\listOfTypes(), Translate\load(), RemiseCheque\load_board(), ActionComm\load_board(), Account\load_board(), Adherent\load_board(), FactureFournisseur\load_board(), Contrat\load_board(), ExpenseReport\load_board(), Facture\load_board(), Form\load_cache_availability(), Dolresource\load_cache_code_type_resource(), Form\load_cache_conditions_paiements(), Form\load_cache_types_fees(), Form\load_cache_types_paiements(), EcmDirectory\load_motherof(), Categorie\load_motherof(), User\load_parentof(), Client\load_state_board(), Fournisseur\load_state_board(), Fichinter\load_state_board(), Contact\load_state_board(), RemiseCheque\load_state_board(), Don\load_state_board(), Account\load_state_board(), Adherent\load_state_board(), Project\load_state_board(), Task\load_state_board(), FactureFournisseur\load_state_board(), Contrat\load_state_board(), ExpenseReport\load_state_board(), SupplierProposal\load_state_board(), CommandeFournisseur\load_state_board(), User\load_state_board(), Propal\load_state_board(), Commande\load_state_board(), Facture\load_state_board(), Product\load_state_board(), Product\load_virtual_stock(), Product\loadBatchInfo(), box_task\loadBox(), box_activity\loadBox(), Translate\loadCacheCurrencies(), Form\loadCacheInputReason(), Translate\loadFromDatabase(), ActionsCardProduct\LoadListDatas(), FormProduct\loadLotStock(), Project\loadTimeSpent(), FormProduct\loadWarehouses(), members_card_pdf_create(), Menubase\menuLoad(), migrate_actioncomm_element(), migrate_categorie_association(), migrate_commande_deliveryaddress(), migrate_commande_expedition(), migrate_commande_livraison(), migrate_contracts_date1(), migrate_contracts_date3(), migrate_contracts_det(), migrate_contracts_open(), migrate_customerorder_shipping(), migrate_detail_livraison(), migrate_event_assignement(), migrate_event_assignement_contact(), migrate_links_transfert(), migrate_menus(), migrate_mode_reglement(), migrate_modeles(), migrate_paiements(), migrate_paiements_orphelins_1(), migrate_paiements_orphelins_2(), migrate_project_task_actors(), migrate_project_task_time(), migrate_project_user_resp(), migrate_relationship_tables(), migrate_remise_entity(), migrate_remise_except_entity(), migrate_reset_blocked_log(), migrate_restore_missing_links(), migrate_shipping_delivery(), migrate_shipping_delivery2(), migrate_stocks(), FormAdvTargetEmailing\multiselectCategories(), FormAdvTargetEmailing\multiselectCivility(), FormAdvTargetEmailing\multiselectCountry(), FormAdvTargetEmailing\multiselectProspectionStatus(), FormAdvTargetEmailing\multiselectselectSalesRepresentatives(), Commande\nb_expedition(), ExpenseReport\offsetAlreadyGiven(), ordered(), pdf_bank(), printing_printipp\print_file(), print_left_auguria_menu(), print_left_eldy_menu(), print_paybox_redirect(), printBookmarksList(), pt(), rebuild_merge_pdf(), Contrat\reopen(), FormAccounting\select_accounting_category(), Form\select_address(), Form\select_all_categories(), FormBarCode\select_barcode_type(), FormCompany\select_civility(), Form\select_comptes(), FormContract\select_contract(), Form\select_country(), FormOther\select_dictionary(), Form\select_dolgroups(), Form\select_dolusers(), FormOther\select_ecotaxes(), FormProjets\select_element(), FormOther\select_export_model(), Form\select_export_model(), FormOther\select_import_model(), Form\select_incoterms(), FormIntervention\select_interventions(), FormCompany\select_juridicalstatus(), FormAdmin\select_paper_format(), Form\select_product_fourn_price(), Form\select_produits_fournisseurs_list(), Form\select_produits_list(), FormProjets\select_projects_list(), FormCompany\select_region(), Form\select_remises(), FormResource\select_resource_list(), FormOther\select_revenue_stamp(), FormOther\select_salesrepresentatives(), FormCompany\select_state(), Form\select_thirdparty_list(), FormSocialContrib\select_type_socialcontrib(), FormAdvTargetEmailing\selectAdvtargetemailingTemplate(), FormCompany\selectCompaniesForNewContact(), Form\selectcontacts(), Form\selectExpenseCategories(), Form\selectExpenseRanges(), FormOrder\selectInputMethod(), FormPropal\selectProposalStatus(), Form\selectShippingMethod(), FormProjets\selectTasks(), FormWebsite\selectWebsite(), Notify\send(), CSMSFile\sendfile(), Don\set_cancel(), ExpenseReport\set_paid(), Don\set_paid(), FactureFournisseur\set_paid(), Societe\set_price_level(), Commande\set_reopen(), Facture\set_unpaid(), CompanyBankAccount\setAsDefault(), FactureRec\setAutoValidate(), Expedition\setClosed(), setEventMessages(), FactureRec\setFrequencyAndUnit(), FactureRec\setGeneratePdf(), FactureRec\setMaxPeriod(), FactureRec\setModelPdf(), FactureRec\setNextDate(), Adherent\setPassword(), User\setPassword(), Fichinter\setValid(), show_actions_done(), show_array_actions_to_do(), show_array_last_actions_done(), show_contacts(), FormSms\show_form(), show_list_sending_receive(), show_projects(), show_stats_for_company(), FormActions\showactions(), FormFile\showdocuments(), Form\showLinkToObjectBlock(), Form\showphoto(), societe_prepare_head(), task_prepare_head(), tax_by_date(), tva_coll(), tva_paye(), UserBankAccount\update(), CompanyBankAccount\update(), Categorie\update(), Account\update(), UserGroup\update(), Product\update(), ExpenseReportLine\update(), Account\update_bban(), Expedition\update_delivery_method(), PaymentVarious\update_fk_bank(), PaymentSalary\update_fk_bank(), Localtax\update_fk_bank(), Tva\update_fk_bank(), ExtraFields\update_label(), Product\update_sousproduit(), Product\updatePrice(), Holiday\updateSoldeCP(), user_prepare_head(), Commande\valid(), Livraison\valid(), CommandeFournisseur\valid(), SupplierProposal\valid(), Propal\valid(), Contrat\validate(), Facture\validate(), vat_by_thirdparty(), Auth\verif(), Holiday\verifDateHolidayCP(), Holiday\verifDateHolidayForTimestamp(), pdf_paiement\write_file(), doc_generic_contract_odt\write_file(), doc_generic_invoice_odt\write_file(), doc_generic_shipment_odt\write_file(), doc_generic_order_odt\write_file(), doc_generic_user_odt\write_file(), doc_generic_product_odt\write_file(), doc_generic_usergroup_odt\write_file(), doc_generic_supplier_proposal_odt\write_file(), doc_generic_proposal_odt\write_file(), pdf_standardlabel\write_file(), pdf_standard\write_file(), pdf_tcpdflabel\write_file(), doc_generic_task_odt\write_file(), doc_generic_project_odt\write_file(), ExportTsv\write_record(), ExportCsv\write_record(), ExportExcel\write_record(), and ExportExcel\write_title().

dol_print_error_email (   $prefixcode,
  $errormessage = '',
  $errormessages = array() 
)

Show a public email and error code to contact if technical error.

Parameters
string$prefixcodePrefix of public error code
string$errormessageComplete error message
array$errormessagesArray of error messages
Returns
void

Definition at line 3501 of file functions.lib.php.

dol_print_graph (   $htmlid,
  $width,
  $height,
  $data,
  $showlegend = 0,
  $type = 'pie',
  $showpercent = 0,
  $url = '',
  $combineother = 0.05,
  $shownographyet = 0 
)

Show a javascript graph.

Do not use this function anymore. Use DolGraph class instead.

Parameters
string$htmlidHtml id name
int$widthWidth in pixel
int$heightHeight in pixel
array$dataData array
int$showlegend1 to show legend, 0 otherwise
string$typeType of graph ('pie', 'barline')
int$showpercentShow percent (with type='pie' only)
string$urlParam to add an url to click values
int$combineother0=No combine, 0.05=Combine if lower than 5%
int$shownographyetShow graph to say there is not enough data
Returns
void
Deprecated:
See also
DolGraph

Definition at line 2518 of file functions.lib.php.

References dol_syslog(), and print.

dol_print_ip (   $ip,
  $mode = 0 
)

Return an IP formated to be shown on screen.

Parameters
string$ipIP
int$mode0=return IP + country/flag, 1=return only country/flag, 2=return only IP
Returns
string Formated IP, with country if GeoIP module is enabled

Definition at line 2295 of file functions.lib.php.

References dolGetCountryCodeFromIp().

dol_print_phone (   $phone,
  $countrycode = '',
  $cid = 0,
  $socid = 0,
  $addlink = '',
  $separ = "&nbsp;",
  $withpicto = '',
  $titlealt = '',
  $adddivfloat = 0 
)

Format phone numbers according to country.

Parameters
string$phonePhone number to format
string$countrycodeCountry code to use for formatting
int$cidId of contact if known
int$socidId of third party if known
string$addlink''=no link to create action, 'AC_TEL'=add link to clicktodial (if module enabled) and add link to create event (if conf->global->AGENDA_ADDACTIONFORPHONE set)
string$separSeparation between numbers for a better visibility example : xx.xx.xx.xx.xx
string$withpictoShow picto
string$titlealtText to show on alt
int$adddivfloatAdd div float around phone.
Returns
string Formated phone number

Definition at line 2176 of file functions.lib.php.

References dol_strlen(), img_object(), img_picto(), and make_substitutions().

Referenced by ActionsContactCardCommon\assign_values(), ActionsAdherentCardCommon\assign_values(), ActionsCardCommon\assign_values(), show_addresses(), and ExtraFields\showOutputField().

dol_print_size (   $size,
  $shortvalue = 0,
  $shortunit = 0 
)

Return string with formated size.

Parameters
int$sizeSize to print
int$shortvalueTell if we want long value to use another unit (Ex: 1.5Kb instead of 1500b)
int$shortunitUse short value of size unit
Returns
string Link

Definition at line 2007 of file functions.lib.php.

Referenced by FormFile\list_of_autoecmfiles(), and FormFile\list_of_documents().

dol_print_skype (   $skype,
  $cid = 0,
  $socid = 0,
  $addlink = 0,
  $max = 64 
)

Show Skype link.

Parameters
string$skypeSkype to show (only skype, without 'Name of recipient' before)
int$cidId of contact if known
int$socidId of third party if known
int$addlink0=no link to create action
int$maxMax number of characters to show
Returns
string HTML Link

Definition at line 2123 of file functions.lib.php.

References dol_trunc(), img_object(), img_picto(), and img_warning().

dol_print_url (   $url,
  $target = '_blank',
  $max = 32,
  $withpicto = 0 
)

Show Url link.

Parameters
string$urlUrl to show
string$targetTarget for link
int$maxMax number of characters to show
int$withpictoWith picto
Returns
string HTML Link

Definition at line 2043 of file functions.lib.php.

References dol_trunc(), and img_picto().

Referenced by ActionsCardCommon\assign_values(), and ExtraFields\showOutputField().

dol_sanitizeFileName (   $str,
  $newstr = '_',
  $unaccent = 1 
)

Clean a string to use it as a file name.

Parameters
string$strString to clean
string$newstrString to replace bad chars with
int$unaccent1=Remove also accent (default), 0 do not remove them
Returns
string String cleaned (a-zA-Z_)
See also
dol_string_nospecial, dol_string_unaccent, dol_sanitizePathName

Definition at line 807 of file functions.lib.php.

References dol_string_nospecial(), and dol_string_unaccent().

Referenced by FileUpload\__construct(), bank_prepare_head(), Product\check(), clean_data_ecm_directories(), commande_prepare_head(), contact_prepare_head(), contract_prepare_head(), EcmDirectory\create(), Expedition\create(), Project\createFromClone(), Task\createFromClone(), Task\delete(), Dolresource\delete(), Project\delete(), Livraison\delete(), Fichinter\delete(), FactureFournisseur\delete(), Product\delete(), Contrat\delete(), Expedition\delete(), Facture\delete(), CommandeFournisseur\delete(), SupplierProposal\delete(), Propal\delete(), Commande\delete(), dol_add_file_process(), dol_banner_tab(), dol_delete_preview(), dol_meta_create(), donation_prepare_head(), Utils\dumpDatabase(), expensereport_prepare_head(), facture_prepare_head(), fichinter_prepare_head(), EcmDirectory\getRelativePath(), holiday_prepare_head(), FormFile\list_of_documents(), loan_prepare_head(), myobjectPrepareHead(), ordersupplier_prepare_head(), product_prepare_head(), project_prepare_head(), propal_prepare_head(), resource_prepare_head(), Notify\send(), Fichinter\setValid(), ExpenseReport\setValidate(), Conf\setValues(), task_prepare_head(), tax_prepare_head(), Dolresource\update(), Project\update(), Task\update(), Product\update(), Societe\update(), Commande\valid(), Livraison\valid(), CommandeFournisseur\valid(), Expedition\valid(), SupplierProposal\valid(), Propal\valid(), Contrat\validate(), FactureFournisseur\validate(), Facture\validate(), various_payment_prepare_head(), html_cerfafr\write_file(), pdf_merou\write_file(), pdf_ban\write_file(), pdf_baleine\write_file(), pdf_sepamandate\write_file(), pdf_soleil\write_file(), pdf_beluga\write_file(), pdf_rouget\write_file(), pdf_strato\write_file(), pdf_typhon\write_file(), pdf_canelle\write_file(), pdf_aurore\write_file(), pdf_standard\write_file(), pdf_muscadet\write_file(), pdf_azur\write_file(), pdf_crabe\write_file(), doc_generic_odt\write_file(), doc_generic_contract_odt\write_file(), pdf_einstein\write_file(), doc_generic_invoice_odt\write_file(), doc_generic_shipment_odt\write_file(), doc_generic_order_odt\write_file(), doc_generic_user_odt\write_file(), doc_generic_product_odt\write_file(), doc_generic_usergroup_odt\write_file(), doc_generic_supplier_proposal_odt\write_file(), doc_generic_proposal_odt\write_file(), doc_generic_task_odt\write_file(), and doc_generic_project_odt\write_file().

dol_sanitizePathName (   $str,
  $newstr = '_',
  $unaccent = 1 
)

Clean a string to use it as a path name.

Parameters
string$strString to clean
string$newstrString to replace bad chars with
int$unaccent1=Remove also accent (default), 0 do not remove them
Returns
string String cleaned (a-zA-Z_)
See also
dol_string_nospecial, dol_string_unaccent, dol_sanitizeFileName

Definition at line 823 of file functions.lib.php.

References dol_string_nospecial(), and dol_string_unaccent().

dol_set_focus (   $selector)

Set focus onto field with selector (similar behaviour of 'autofocus' HTML5 tag)

Parameters
string$selectorSelector ('#id' or 'input[name="ref"]') to use to find the HTML input field that must get the autofocus. You must use a CSS selector, so unique id preceding with the '#' char.
Returns
string HTML code to set focus

Definition at line 6578 of file functions.lib.php.

References print.

dol_shutdown ( )

Function called at end of web php process.

Returns
void

Definition at line 237 of file functions.lib.php.

References dol_syslog().

dol_size (   $size,
  $type = '' 
)

Optimize a size for some browsers (phone, smarphone, ...)

Parameters
int$sizeSize we want
string$typeType of optimizing: '' = function used to define a size for truncation 'width' = function is used to define a width
Returns
int New size after optimizing

Definition at line 788 of file functions.lib.php.

dol_sort_array ( $array,
  $index,
  $order = 'asc',
  $natsort = 0,
  $case_sensitive = 0,
  $keepindex = 0 
)

Advanced sort array by second index function, which produces ascending (default) or descending output and uses optionally natural case insensitive sorting (which can be optionally case sensitive as well).

Parameters
array$arrayArray to sort (array of array('key','otherkey1','otherkey2'...))
string$indexKey in array to use for sorting criteria
int$orderSort order ('asc' or 'desc')
int$natsort1=use "natural" sort (natsort), 0=use "standard" sort (asort)
int$case_sensitive1=sort is case sensitive, 0=not case sensitive
int$keepindexIf 0 and index key of array to sort is a numeric, than index will be rewrote. If 1 or index key is not numeric, key for index is kept after sorting.
Returns
array Sorted array

Definition at line 6078 of file functions.lib.php.

Referenced by EcmDirectory\get_full_arbo(), Categorie\get_full_arbo(), User\get_full_tree(), Setup\getCheckIntegrity(), FormFile\list_of_documents(), Form\load_cache_availability(), Form\load_cache_types_paiements(), Form\loadCacheInputReason(), print_auguria_menu(), print_eldy_menu(), FormCompany\select_juridicalstatus(), Product\show_photos(), and MenuManager\showmenu().

dol_strftime (   $fmt,
  $ts = false,
  $is_gmt = false 
)

Format a string.

Parameters
string$fmtFormat of strftime function (http://php.net/manual/fr/function.strftime.php)
int$tsTimesamp (If is_gmt is true, timestamp is already includes timezone and daylight saving offset, if is_gmt is false, timestamp is a GMT timestamp and we must compensate with server PHP TZ)
int$is_gmtSee comment of timestamp parameter
Returns
string A formatted string

Definition at line 1640 of file functions.lib.php.

dol_string_is_good_iso (   $s)

Check if a string is a correct iso string If not, it will we considered not HTML encoded even if it is by FPDF.

Example, if string contains euro symbol that has ascii code 128

Parameters
string$sString to check
Returns
int 0 if bad iso, 1 if good iso

Definition at line 5230 of file functions.lib.php.

References dol_strlen().

dol_string_nohtmltag (   $stringtoclean,
  $removelinefeed = 1,
  $pagecodeto = 'UTF-8' 
)

Clean a string from all HTML tags and entities.

This function differs from strip_tags because:


  • are replace with
  • if entities are found, they are decoded before the strip
  • you can decide to convert line feed into spaces
Parameters
string$stringtocleanString to clean
integer$removelinefeed1=Replace also new lines by a space, 0=Only last one are removed
string$pagecodetoEncoding of input/output string
Returns
string String cleaned
See also
dol_escape_htmltag strip_tags

Definition at line 5023 of file functions.lib.php.

References dol_html_entity_decode().

Referenced by ajax_dialog(), build_calfile(), build_rssfile(), ExportExcel\excel_clean(), FormMail\get_form(), getCommonSubstitutionArray(), Facture\getNomUrl(), GETPOST(), pdf_build_address(), pdf_getInstance(), and ExportTsv\tsv_clean().

dol_string_nospecial (   $str,
  $newstr = '_',
  $badcharstoreplace = '' 
)

Clean a string from all punctuation characters to use it as a ref or login.

This is a more complete function than dol_sanitizeFileName.

Parameters
string$strString to clean
string$newstrString to replace forbidden chars with
array$badcharstoreplaceList of forbidden characters
Returns
string Cleaned string
See also
dol_sanitizeFilename, dol_string_unaccent

Definition at line 895 of file functions.lib.php.

Referenced by check_value(), Product\create(), dol_buildlogin(), dol_sanitizeFileName(), dol_sanitizePathName(), DolGraph\draw_jflot(), get_next_value(), GETPOST(), Product\update(), and doc_generic_odt\write_file().

dol_string_unaccent (   $str)

Clean a string from all accent characters to be used as ref, login or by dol_sanitizeFileName.

Parameters
string$strString to clean
Returns
string Cleaned string
See also
dol_sanitizeFilename, dol_string_nospecial

Definition at line 837 of file functions.lib.php.

References utf8_check().

Referenced by dol_buildlogin(), dol_sanitizeFileName(), dol_sanitizePathName(), DolGraph\draw_jflot(), BonPrelevement\EnregDestinataireSEPA(), BonPrelevement\EnregEmetteurSEPA(), AccountancyExport\exportCiel(), AccountancyExport\exportQuadratus(), BonPrelevement\generate(), and Form\select_country().

dol_strlen (   $string,
  $stringencoding = 'UTF-8' 
)

Make a strlen call.

Works even if mbstring module not enabled

Parameters
string$stringString to calculate length
string$stringencodingEncoding of string
Returns
int Length of string

Definition at line 2466 of file functions.lib.php.

Referenced by Product\_get_stats(), Contact\_load_ldap_info(), User\_load_ldap_info(), activateModulesRequiredByCountry(), ContratLigne\active_line(), Contrat\addline(), ActionsContactCardCommon\assign_values(), ActionsAdherentCardCommon\assign_values(), ActionsCardCommon\assign_values(), binhex(), Categorie\build_path_from_id_categ(), User\build_path_from_id_user(), calEncode(), Don\check(), Product\check(), check_value(), chequereceipt_pdf_create(), complete_dictionary_with_modules(), complete_elementList_with_modules(), Form\constructProductListOption(), Productbatch\create(), Cronjob\create(), EcmFiles\create(), CommandeFournisseurDispatch\create(), Productlot\create(), ExpeditionLineBatch\create(), BookKeeping\create(), Website\create(), Product\create(), Contrat\create(), BookKeeping\createStd(), doc_label_pdf_create(), dol_ch_controle_bvrb(), dol_decode(), dol_encode(), dol_nboflines_bis(), dol_print_date(), dol_print_phone(), dol_setshmop(), dol_string_is_good_iso(), don_create(), DolGraph\draw_artichow(), Product\fetch(), fichinter_create(), Fichinter\generateDocument(), UserGroup\generateDocument(), Livraison\generateDocument(), Project\generateDocument(), Task\generateDocument(), Adherent\generateDocument(), ExpenseReport\generateDocument(), Expedition\generateDocument(), Contrat\generateDocument(), SupplierProposal\generateDocument(), CommandeFournisseur\generateDocument(), User\generateDocument(), Product\generateDocument(), Propal\generateDocument(), Societe\generateDocument(), Commande\generateDocument(), Facture\generateDocument(), get_next_value(), DolGraph\GetCeilMaxValue(), DolGraph\GetFloorMinValue(), modGeneratePassStandard\getNewGeneratedPassword(), hexbin(), Societe\id_prof_check(), ImportCsv\import_read_record(), ImportXlsx\import_read_record(), DolibarrModules\insert_permissions(), Ldap\littleEndian(), Form\load_tva(), box_graph_invoices_supplier_permonth\loadBox(), box_graph_orders_permonth\loadBox(), box_graph_orders_supplier_permonth\loadBox(), box_graph_invoices_permonth\loadBox(), box_graph_propales_permonth\loadBox(), box_lastlogin\loadBox(), box_factures\loadBox(), box_project\loadBox(), box_graph_product_distribution\loadBox(), box_task\loadBox(), box_activity\loadBox(), ActionsCardService\LoadListDatas(), ActionsCardProduct\LoadListDatas(), makesalt(), members_card_pdf_create(), pdf_bank(), Form\select_produits_fournisseurs_list(), Notify\send(), FormSms\show_form(), CompanyBankAccount\update(), Project\update(), Productlot\update(), Fichinter\update(), Website\update(), EcmFiles\update(), Cronjob\update(), Productcustomerprice\update(), FactureFournisseur\update(), BookKeeping\update(), Contrat\updateline(), utf8_check(), modGeneratePassStandard\validatePassword(), mod_codeclient_monkey\verif(), mod_barcode_product_standard\verif(), and mod_codeclient_monkey\verif_syntax().

dol_strtolower (   $utf8_string)

Convert a string to lower.

Never use strtolower because it does not works with UTF8 strings.

Parameters
string$utf8_stringString to encode
Returns
string String converted

Definition at line 964 of file functions.lib.php.

dol_strtoupper (   $utf8_string)

Convert a string to upper.

Never use strtolower because it does not works with UTF8 strings.

Parameters
string$utf8_stringString to encode
Returns
string String converted

Definition at line 975 of file functions.lib.php.

dol_substr (   $string,
  $start,
  $length,
  $stringencoding = '' 
)

Make a substring.

Works even in mbstring module is not enabled.

Parameters
string$stringString to scan
string$startStart position
int$lengthLength
string$stringencodingPage code used for input string encoding
Returns
string substring

Definition at line 2481 of file functions.lib.php.

Referenced by BonPrelevement\Create(), and dol_print_date().

dol_syslog (   $message,
  $level = LOG_INFO,
  $ident = 0,
  $suffixinfilename = '',
  $restricttologhandler = '' 
)

Write log message into outputs.

Possible outputs can be: SYSLOG_HANDLERS = ["mod_syslog_file"] file name is then defined by SYSLOG_FILE SYSLOG_HANDLERS = ["mod_syslog_syslog"] facility is then defined by SYSLOG_FACILITY Warning, syslog functions are bugged on Windows, generating memory protection faults. To solve this, use logging to files instead of syslog (see setup of module). Note: If constant 'SYSLOG_FILE_NO_ERROR' defined, we never output any error message when writing to log fails. Note: You can get log message into html sources by adding parameter &logtohtml=1 (constant MAIN_LOGTOHTML must be set) This function works only if syslog module is enabled. This must not use any call to other function calling dol_syslog (avoid infinite loop).

Parameters
string$messageLine to log. ''=Show nothing
int$levelLog level On Windows LOG_ERR=4, LOG_WARNING=5, LOG_NOTICE=LOG_INFO=6, LOG_DEBUG=6 si define_syslog_variables ou PHP 5.3+, 7 si dolibarr On Linux LOG_ERR=3, LOG_WARNING=4, LOG_INFO=6, LOG_DEBUG=7
int$ident1=Increase ident of 1, -1=Decrease ident of 1
string$suffixinfilenameWhen output is a file, append this suffix into default log filename.
string$restricttologhandlerOutput log only for this log handler
Returns
void

Definition at line 1001 of file functions.lib.php.

References dol_print_date(), and print.

Referenced by mailing_thirdparties_services_expired\__construct(), DolGeoIP\__construct(), DoliDBMysqli\__construct(), DoliDBMssql\__construct(), CSMSFile\__construct(), DoliDBSqlite3\__construct(), DoliDBPgsql\__construct(), DolEditor\__construct(), CMailFile\__construct(), DolibarrApiAccess\__isAllowed(), DolibarrModules\_active(), DolibarrApi\_checkFilters(), MouvementStock\_create(), MouvementStock\_createSubProduct(), CMailFile\_encode_file(), Stats\_getAllByProduct(), Stats\_getAllByYear(), Stats\_getAmountByMonth(), Stats\_getAverageByMonth(), Stats\_getNbByMonth(), Stats\_getNbByYear(), DolibarrModules\_init(), DolibarrModules\_load_tables(), Product\_log_price(), CommActionRapport\_pages(), DolibarrModules\_remove(), RejetPrelevement\_send_email(), DolibarrModules\_unactive(), AccountingAccount\account_activate(), AccountingAccount\account_desactivate(), activateModule(), activateModulesRequiredByCountry(), ContratLigne\active_line(), Ldap\add(), Societe\add_commercial(), Product\add_fournisseur(), SupplierProposal\add_product(), Propal\add_product(), MailmanSpip\add_to_mailman(), MailmanSpip\add_to_spip(), mailing_thirdparties\add_to_target(), mailing_thirdparties_services_expired\add_to_target(), mailing_mailinglist_mymodule_myobject\add_to_target(), mailing_xinputfile\add_to_target(), MailingTargets\add_to_target(), mailing_pomme\add_to_target(), mailing_fraise\add_to_target(), mailing_contacts1\add_to_target(), mailing_advthirdparties\add_to_target_spec(), Categorie\add_type(), Account\add_url_line(), Ldap\addAttribute(), addDocumentModel(), BonPrelevement\AddFacture(), BonPrelevement\addline(), SupplierProposal\addline(), Account\addline(), Propal\addline(), FactureRec\addline(), Fichinter\addline(), Commande\addline(), Contrat\addline(), FactureFournisseur\addline(), CommandeFournisseur\addline(), ExpenseReport\addline(), Facture\addline(), Expedition\addline_batch(), Holiday\addLogCP(), BonPrelevement\AddNotification(), Localtax\addPayment(), Tva\addPayment(), PaymentExpenseReport\addPaymentToBank(), Paiement\addPaymentToBank(), MultiCurrency\addRateFromDolibarr(), UserGroup\addrights(), User\addrights(), Task\addTimeSpent(), FormAdvTargetEmailing\advMultiselectarraySelllist(), ActionsMyModule\afterPDFCreation(), Categorie\already_exists(), BlockedLog\alreadyUsed(), CommandeFournisseur\approve(), Contrat\array_detail(), Commande\availability(), Propal\availability(), barcode_encode(), barcode_encode_genbarcode(), barcode_print(), ActionsMyModule\beforePDFCreation(), DoliDB\begin(), DoliDBMssql\begin(), build_calfile(), Import\build_example_file(), ActionComm\build_exportfile(), Export\build_file(), Export\build_filterQuery(), Categorie\build_path_from_id_categ(), User\build_path_from_id_user(), build_rssfile(), modTcpdfbarcode\buildBarCode(), modPhpbarcode\buildBarCode(), calcul_price_total(), CommonInvoice\calculate_date_lim_reglement(), MouvementStock\calculateBalanceForProductBefore(), MailmanSpip\callMailman(), Commande\cancel(), CommandeFournisseur\Cancel(), EcmDirectory\changeNbOfFiles(), Product\check_barcode(), Societe\check_codeclient(), Societe\check_codefournisseur(), CMailFile\check_server_port(), check_user_password_dolibarr(), check_user_password_empty(), check_user_password_forceuser(), check_user_password_http(), check_user_password_ldap(), check_user_password_openid(), check_value(), checkBanForAccount(), mod_syslog_file\checkConfiguration(), mod_syslog_syslog\checkConfiguration(), checkLoginPassEntity(), AccountingAccount\checkUsage(), Propal\classer_facturee(), Commande\classer_facturee(), Propal\classifyBilled(), Commande\classifyBilled(), Commande\classifyUnBilled(), MailingTargets\clear_target(), User\clearrights(), Product\clone_associations(), Product\clone_fournisseurs(), Product\clone_price(), DoliDBMssql\close(), DoliDBMysqli\close(), DoliDBSqlite3\close(), DoliDBPgsql\close(), Societe\codeclient_modifiable(), Societe\codefournisseur_modifiable(), CommandeFournisseur\commande(), DoliDB\commit(), DoliDBMssql\commit(), complete_dictionary_with_modules(), complete_elementList_with_modules(), complete_head_from_modules(), complete_substitutions_array(), completeFileArrayWithDatabaseInfo(), DoliDBMssql\connect(), DoliDBMysqli\connect(), DoliDBSqlite3\connect(), Ldap\connect_bind(), MailmanSpip\connectSpip(), Form\constructProductListOption(), Categorie\containsObject(), DoliDBSqlite3\convertSQLFromMysql(), Comment\create(), BankCateg\create(), PriceExpression\create(), Localtax\create(), PriceGlobalVariable\create(), Link\create(), Ctypent\create(), Productbatch\create(), PriceGlobalVariableUpdater\create(), Dolresource\create(), PaymentExpenseReport\create(), Cstate\create(), Propalmergepdfproduct\create(), Ccountry\create(), Fiscalyear\create(), Productcustomerprice\create(), PaymentTerm\create(), Tva\create(), Deplacement\create(), PaymentSocialContribution\create(), LoanSchedule\create(), PaymentLoan\create(), Address\create(), PaymentDonation\create(), Cpaiement\create(), Establishment\create(), EcmDirectory\create(), Menubase\create(), Ctyperesource\create(), RejetPrelevement\create(), Cchargesociales\create(), Livraison\create(), ProductStockEntrepot\create(), Cronjob\create(), AdherentType\create(), AdvanceTargetingMailing\create(), EcmFiles\create(), CommandeFournisseurDispatch\create(), Productlot\create(), Task\create(), Entrepot\create(), Mailing\create(), BookKeeping\create(), ExpeditionLineBatch\create(), AccountancySystem\create(), Bookmark\create(), Website\create(), MultiCurrency\create(), Events\create(), Opensurveysondage\create(), Holiday\create(), Loan\create(), RemiseCheque\create(), PaiementFourn\create(), Project\create(), DiscountAbsolute\create(), AccountingAccount\create(), Paiement\create(), ExpenseReport\create(), ChargeSociales\create(), Fichinter\create(), Contact\create(), Expedition\create(), BlockedLogAuthority\create(), ActionComm\create(), FactureFournisseur\create(), Import\create(), Facture\create(), Adherent\create(), Categorie\create(), PaymentVarious\create(), PaymentSalary\create(), Don\create(), Product\create(), Societe\create(), Account\create(), BlockedLog\create(), UserGroup\create(), Export\create(), Commande\create(), CurrencyRate\create(), SupplierProposal\create(), BonPrelevement\Create(), Contrat\create(), Propal\create(), User\create(), CommandeFournisseur\create(), DolibarrModules\create_dirs(), User\create_from_contact(), User\create_from_member(), Societe\create_from_member(), Societe\create_individual(), ExtraFields\create_label(), Livraison\create_line(), createActionComm(), MouvementStock\createBatch(), Fournisseur\CreateCategory(), createContact(), Holiday\createCPusers(), EmailSenderProfile\createFromClone(), MyObject\createFromClone(), WebsiteAccount\createFromClone(), Inventory\createFromClone(), Mailing\createFromClone(), WebsitePage\createFromClone(), Cchargesociales\createFromClone(), Productlot\createFromClone(), Ctyperesource\createFromClone(), ProductStockEntrepot\createFromClone(), Website\createFromClone(), EcmFiles\createFromClone(), Project\createFromClone(), BookKeeping\createFromClone(), Task\createFromClone(), Contrat\createFromClone(), Facture\createFromCurrent(), createInvoice(), createInvoiceFromOrder(), createOrder(), createPayment(), createProductOrService(), createProject(), FactureRec\createRecurringInvoices(), BookKeeping\createStd(), createThirdParty(), createUserFromThirdparty(), DoliDBPgsql\DDLAddField(), DoliDBPgsql\DDLCreateDb(), DoliDBMssql\DDLCreateTable(), DoliDBPgsql\DDLCreateTable(), DoliDBMssql\DDLCreateUser(), DoliDBPgsql\DDLCreateUser(), DoliDBMssql\DDLDescTable(), DoliDBPgsql\DDLDescTable(), DoliDBMssql\DDLDropField(), DoliDBPgsql\DDLDropField(), DoliDBPgsql\DDLInfoTable(), DoliDBMssql\DDLUpdateField(), DoliDBPgsql\DDLUpdateField(), Societe\del_commercial(), Product\del_sousproduit(), MailmanSpip\del_to_mailman(), MailmanSpip\del_to_spip(), Categorie\del_type(), delDocumentModel(), DiscountAbsolute\delete(), BankCateg\delete(), Fiscalyear\delete(), ChargeSociales\delete(), PaymentVarious\delete(), Loan\delete(), PriceGlobalVariable\delete(), PaymentSalary\delete(), Establishment\delete(), Subscription\delete(), Entrepot\delete(), PriceGlobalVariableUpdater\delete(), Comment\delete(), Events\delete(), Cstate\delete(), CompanyBankAccount\delete(), Deplacement\delete(), Localtax\delete(), Productbatch\delete(), Ccountry\delete(), Ctypent\delete(), RemiseCheque\delete(), Tva\delete(), PriceExpression\delete(), PaymentExpenseReport\delete(), Import\delete(), Cpaiement\delete(), PaymentDonation\delete(), LoanSchedule\delete(), PaymentLoan\delete(), Menubase\delete(), Cchargesociales\delete(), MultiCurrency\delete(), AccountingAccount\delete(), EcmDirectory\delete(), PaymentTerm\delete(), PaymentSocialContribution\delete(), CommandeFournisseurDispatch\delete(), Link\delete(), Productlot\delete(), Opensurveysondage\delete(), Ctyperesource\delete(), AdvanceTargetingMailing\delete(), ProductStockEntrepot\delete(), Propalmergepdfproduct\delete(), Address\delete(), Task\delete(), Dolresource\delete(), Mailing\delete(), Website\delete(), Categorie\delete(), Don\delete(), FactureRec\delete(), UserGroup\delete(), EcmFiles\delete(), Project\delete(), Ldap\delete(), Holiday\delete(), Cronjob\delete(), Adherent\delete(), ActionComm\delete(), Export\delete(), Productcustomerprice\delete(), Fichinter\delete(), Contact\delete(), CurrencyRate\delete(), FactureFournisseur\delete(), User\delete(), Account\delete(), ExpenseReport\delete(), Product\delete(), Contrat\delete(), Expedition\delete(), BookKeeping\delete(), Societe\delete(), Facture\delete(), AccountLine\delete(), CommandeFournisseur\delete(), SupplierProposal\delete(), ExpeditionLigne\delete(), SupplierInvoiceLine\delete(), Propal\delete(), SupplierProposalLine\delete(), Commande\delete(), CommandeFournisseurLigne\delete(), OrderLine\delete(), PropaleLigne\delete(), FactureLigne\delete(), DolibarrModules\delete_boxes(), Propalmergepdfproduct\delete_by_file(), Propalmergepdfproduct\delete_by_product(), DolibarrModules\delete_const(), DolibarrModules\delete_cronjobs(), DolibarrModules\delete_dirs(), ExtraFields\delete_label(), DolibarrModules\delete_menus(), DolibarrModules\delete_module_parts(), DolibarrModules\delete_permissions(), DolibarrModules\delete_tabs(), Mailing\delete_targets(), AccountLine\delete_urls(), Ldap\deleteAttribute(), BookKeeping\deleteByImportkey(), BookKeeping\deleteByYearAndJournal(), AccountancyCategory\deleteCptCat(), ExpeditionLineBatch\deletefromexp(), FichinterLigne\deleteline(), Contrat\deleteline(), ExpenseReport\deleteline(), Facture\deleteline(), BookKeeping\deleteMvtNum(), deleteProductOrService(), deleteThirdParty(), Product\delMultiLangs(), Task\delTimeSpent(), Commande\demand_reason(), Propal\demand_reason(), Facture\demande_prelevement(), Facture\demande_prelevement_delete(), CommandeFournisseur\dispatchProduct(), AccountancyCategory\display(), ActionsCardCommon\doActions(), doc_label_pdf_create(), dol_add_file_process(), AntiVir\dol_avscan_file(), dol_check_secure_access_document(), dol_compress_file(), dol_convert_file(), dol_copy(), dol_delete_dir(), dol_delete_dir_recursive(), dol_delete_file(), dol_dir_list(), dol_ftp_connect(), dol_getIdFromCode(), dol_imageResizeOrCrop(), dol_include_once(), dol_json_decode(), dol_json_encode(), dol_meta_create(), dol_microtime_float(), dol_mkdir(), dol_mktime(), dol_move(), dol_move_uploaded_file(), dol_print_date(), dol_print_file(), dol_print_graph(), dol_set_user_param(), dol_shutdown(), dol_stringtotime(), dol_uncompress(), dolCopyDir(), dolibarr_del_const(), dolibarr_get_const(), dolibarr_install_syslog(), dolibarr_set_const(), dolReplaceInFile(), dolSaveCssFile(), dolSaveHtaccessFile(), dolSaveHtmlHeader(), dolSaveJsFile(), dolSavePageAlias(), dolSavePageContent(), dolSaveRobotFile(), dolWebsiteOutput(), don_create(), MyObject\doScheduledJob(), WebsiteAccount\doScheduledJob(), DolGraph\draw(), DolGraph\draw_artichow(), DolGraph\draw_jflot(), Utils\dumpDatabase(), FormCompany\effectif_array(), encodedecode_dbpassconf(), envoi_mail(), Utils\executeCLI(), HookManager\executeHooks(), BookKeeping\export_bookkeping(), Website\exportWebSite(), AccountancySystem\fetch(), AccountingJournal\fetch(), CActionComm\fetch(), Bookmark\fetch(), LignePrelevement\fetch(), DiscountAbsolute\fetch(), RemiseCheque\fetch(), Loan\fetch(), ChargeSociales\fetch(), UserGroup\fetch(), AccountingAccount\fetch(), BankCateg\fetch(), Comment\fetch(), PriceExpression\fetch(), PriceGlobalVariable\fetch(), Subscription\fetch(), WebsitePage\fetch(), PriceGlobalVariableUpdater\fetch(), Productbatch\fetch(), ModeleBoxes\fetch(), BlockedLogAuthority\fetch(), Cstate\fetch(), PaymentVarious\fetch(), Ccountry\fetch(), PaymentExpenseReport\fetch(), PaymentSalary\fetch(), PaymentLoan\fetch(), LoanSchedule\fetch(), Ctyperesource\fetch(), Propalmergepdfproduct\fetch(), PaymentTerm\fetch(), ProductStockEntrepot\fetch(), PaymentDonation\fetch(), Cpaiement\fetch(), Fiscalyear\fetch(), User\fetch(), Dolresource\fetch(), AdvanceTargetingMailing\fetch(), MultiCurrency\fetch(), Cchargesociales\fetch(), Establishment\fetch(), PaymentSocialContribution\fetch(), CommandeFournisseurDispatch\fetch(), Mailing\fetch(), Productlot\fetch(), Task\fetch(), Events\fetch(), Localtax\fetch(), Categorie\fetch(), Website\fetch(), Opensurveysondage\fetch(), Holiday\fetch(), CommandeFournisseur\fetch(), Tva\fetch(), Deplacement\fetch(), Productcustomerprice\fetch(), Menubase\fetch(), Livraison\fetch(), EcmFiles\fetch(), AdherentType\fetch(), Cronjob\fetch(), Import\fetch(), BonPrelevement\fetch(), EcmDirectory\fetch(), FactureRec\fetch(), Link\fetch(), Entrepot\fetch(), RejetPrelevement\fetch(), Fichinter\fetch(), Project\fetch(), Expedition\fetch(), BlockedLog\fetch(), FactureFournisseur\fetch(), MouvementStock\fetch(), ActionComm\fetch(), BookKeeping\fetch(), Contrat\fetch(), Don\fetch(), Contact\fetch(), Export\fetch(), CurrencyRate\fetch(), Account\fetch(), Adherent\fetch(), Societe\fetch(), SupplierProposal\fetch(), Facture\fetch(), Ldap\fetch(), FichinterLigne\fetch(), Propal\fetch(), Commande\fetch(), FactureLigneRec\fetch(), AccountLine\fetch(), Product\fetch(), ContratLigne\fetch(), Address\fetch_address(), Productcustomerprice\fetch_all(), Cronjob\fetch_all(), Dolresource\fetch_all(), Productcustomerprice\fetch_all_log(), Dolresource\fetch_all_resources(), Dolresource\fetch_all_used(), AdvanceTargetingMailing\fetch_by_mailing(), Propalmergepdfproduct\fetch_by_product(), Dolresource\fetch_element_resource(), ExpenseReport\fetch_line_by_project(), Address\fetch_lines(), FactureRec\fetch_lines(), Contrat\fetch_lines(), FactureFournisseur\fetch_lines(), Livraison\fetch_lines(), ExpenseReport\fetch_lines(), Fichinter\fetch_lines(), Expedition\fetch_lines(), Facture\fetch_lines(), Propal\fetch_lines(), Commande\fetch_lines(), ExtraFields\fetch_name_optionals_label(), ProductFournisseur\fetch_product_fournisseur_price(), Adherent\fetch_subscriptions(), ExpenseReport\fetch_users_approver_expensereport(), AccountingJournal\fetchAll(), ExpeditionLineBatch\fetchAll(), WebsitePage\fetchAll(), Link\fetchAll(), Ctyperesource\fetchAll(), ProductStockEntrepot\fetchAll(), Website\fetchAll(), EcmFiles\fetchAll(), LoanSchedule\fetchall(), Holiday\fetchAll(), CommandeFournisseurDispatch\fetchAll(), BookKeeping\fetchAll(), BookKeeping\fetchAllBalance(), BookKeeping\fetchAllByAccount(), Comment\fetchAllFor(), BookKeeping\fetchAllPerMvt(), Task\fetchAllTimeSpent(), Holiday\fetchByUser(), ExpeditionLineBatch\fetchFromStock(), Holiday\fetchLog(), BookKeeping\fetchPerMvt(), Facture\fetchPreviousNextSituationInvoice(), Task\fetchTimeSpent(), Holiday\fetchUsers(), Productbatch\find(), ProductFournisseur\find_min_price_product_fournisseur(), PriceExpression\find_title(), Productbatch\findAll(), form_constantes(), FormCompany\form_prospect_level(), BonPrelevement\generate(), RemiseCheque\generatePdf(), Product\get_barcode(), Product\get_buyprice(), User\get_children(), mod_codecompta_aquarium\get_code(), Societe\get_codeclient(), Societe\get_codefournisseur(), BookKeeping\get_compte_desc(), BookKeeping\get_compte_racine(), get_default_tva(), Project\get_element_list(), EcmDirectory\get_full_arbo(), Categorie\get_full_arbo(), User\get_full_tree(), get_next_value(), Societe\get_OutstandingBill(), FactureLigne\get_prev_progress(), Facture\get_prev_sits(), get_product_localtax_for_country(), get_product_vat_for_country(), doc_generic_project_odt\get_substitutionarray_project_contacts(), Account\get_url(), AccountancyCategory\getAccountsWithNoCategory(), getActionComm(), ActionComm\getActions(), Stats\getAllByProductEntry(), User\getAllChildIds(), ProjectStats\getAllProjectByStatus(), ExpenseReportIk\getAllRanges(), ExpenseReportRule\getAllRule(), TaskStats\getAllTaskByStatus(), Stats\getAmountByMonthWithPrevYear(), DiscountAbsolute\getAvailableDiscounts(), PaiementFourn\getBillsArray(), Paiement\getBillsArray(), getCategory(), AccountancyCategory\getCats(), AccountancyCategory\getCatsCpts(), Product\getChildsArbo(), Holiday\getConfCP(), getContact(), getContactsForThirdParty(), Holiday\getCPforUser(), AccountancyCategory\getCptBK(), AccountancyCategory\getCptsCat(), PaymentTerm\getDefaultId(), getDocument(), Dolresource\getElementResources(), ExpenseReportLine\getExpAmount(), getFormeJuridiqueLabel(), ActionsCardCommon\getInstanceDao(), ActionsContactCardCommon\getInstanceDao(), ActionsAdherentCardCommon\getInstanceDao(), getInvoice(), MultiCurrency\getInvoiceRate(), getInvoicesForThirdParty(), Translate\getLabelFromKey(), CommonObjectLine\getLabelOfUnit(), Product\getLabelOfUnit(), DolibarrModules\getLastActivationDate(), DolibarrModules\getLastActivationInfo(), SupplierProposal\getLinesArray(), Propal\getLinesArray(), getListActionCommType(), RejetPrelevement\getListInvoices(), BonPrelevement\getListInvoices(), Contrat\getListOfContracts(), getListOfGroups(), InterfaceNotification\getListOfManagedEvents(), getListOfModels(), Facture\getListOfPayments(), getListOfProductsOrServices(), getListOfThirdParties(), getLocalTaxesFromRate(), ExpenseReportIk\getMaxRangeNumber(), Stats\getNbByMonthWithPrevYear(), Contact\getNbOfEMailings(), Commande\getNbOfShipments(), BookKeeping\getNextNumMvt(), Facture\getNextNumRef(), mod_codeclient_monkey\getNextValue(), mod_expedition_safor\getNextValue(), mod_expensereport_jade\getNextValue(), mod_contract_serpis\getNextValue(), mod_chequereceipt_mint\getNextValue(), mod_commande_marbre\getNextValue(), mod_payment_cicada\getNextValue(), mod_supplier_payment_bronan\getNextValue(), mod_project_simple\getNextValue(), mod_task_simple\getNextValue(), mod_propale_marbre\getNextValue(), mod_supplier_proposal_marbre\getNextValue(), mod_livraison_jade\getNextValue(), mod_facture_mars\getNextValue(), mod_facture_fournisseur_cactus\getNextValue(), mod_facture_terre\getNextValue(), Notify\getNotificationsArray(), Categorie\getObjectsInCateg(), getOrder(), getOrdersForThirdParty(), Societe\getOutstandingBills(), Societe\getOutstandingOrders(), Societe\getOutstandingProposals(), GETPOST(), getProductOrService(), getProductsForCategory(), getProject(), ExpenseReportIk\getRangesByCategory(), MultiCurrency\getRate(), Ldap\getRecords(), AccountancyCategory\getResult(), UserGroup\getrights(), CommonInvoice\getSommePaiement(), ChargeSociales\getSommePaiement(), getSourceDocRef(), getState(), getStaticMember(), DiscountAbsolute\getSumCreditNotesUsed(), DiscountAbsolute\getSumDepositsUsed(), Task\getSummaryOfTimeSpent(), Task\getSumOfAmount(), Loan\getSumPayment(), getSupplierInvoice(), getSupplierInvoicesForThirdParty(), Task\getTasksArray(), ExpenseReportIk\getTaxCategories(), getTaxesFromId(), getThirdParty(), ProjectStats\getTransformRateByMonthWithPrevYear(), getURLContent(), getUser(), Task\getUserRolesForProjectsOrTasks(), ProjectStats\getWeightedAmountByMonthWithPrevYear(), Task\hasChildren(), hash_call(), Task\hasTimeSpent(), ImportCsv\import_insert(), ImportXlsx\import_insert(), ImportCsv\import_open_file(), ImportXlsx\import_open_file(), Login\index(), BankAccounts\index(), Tasks\index(), Fiscalyear\info(), Establishment\info(), Entrepot\info(), Deplacement\info(), AccountingAccount\info(), Loan\info(), ChargeSociales\info(), PaymentSalary\info(), PaymentVarious\info(), PaymentExpenseReport\info(), Tva\info(), Cronjob\info(), Paiement\info(), Don\info(), ActionComm\info(), Adherent\info(), Expedition\initAsSpecimen(), Categorie\initAsSpecimen(), CommandeFournisseur\initAsSpecimen(), Commande\initAsSpecimen(), HookManager\initHooks(), FichinterLigne\insert(), AccountLine\insert(), ExpeditionLigne\insert(), ExpenseReportLine\insert(), SupplierInvoiceLine\insert(), SupplierProposalLine\insert(), ContratLigne\insert(), CommandeFournisseurLigne\insert(), PropaleLigne\insert(), OrderLine\insert(), FactureLigne\insert(), DolibarrModules\insert_boxes(), DolibarrModules\insert_const(), DolibarrModules\insert_cronjobs(), DolibarrModules\insert_dirs(), DolibarrModules\insert_menus(), DolibarrModules\insert_module_parts(), DolibarrModules\insert_permissions(), DolibarrModules\insert_tabs(), Propal\InvoiceArrayList(), Facture\is_last_in_cycle(), CommonObject\isExistingObject(), left_menu(), lettering\lettrageTiers(), DiscountAbsolute\link_to_invoice(), dolprintIPP\list_jobs(), FormFile\list_of_autoecmfiles(), PriceExpression\list_price_expression(), ProductFournisseur\list_product_fournisseur_price(), Facture\list_qualified_avoir_invoices(), FactureFournisseur\list_qualified_avoir_supplier_invoices(), Facture\list_replacable_invoices(), FactureFournisseur\list_replacable_supplier_invoices(), InfoBox\listBoxes(), CActionComm\liste_array(), ModeleExports\liste_modeles(), ModeleImports\liste_modeles(), PriceGlobalVariable\listGlobalVariables(), UserGroup\listGroupsForUser(), AdherentType\listMembersForMemberType(), listOfSessions(), Deplacement\listOfTypes(), ExpenseReport\listOfTypes(), PriceGlobalVariableUpdater\listPendingUpdaters(), PriceGlobalVariableUpdater\listUpdaters(), UserGroup\listUsersForGroup(), CommandeFournisseur\Livraison(), Translate\load(), Import\load_arrays(), Export\load_arrays(), Form\load_cache_availability(), Dolresource\load_cache_code_type_resource(), Form\load_cache_conditions_paiements(), Form\load_cache_types_fees(), Form\load_cache_types_paiements(), Form\load_cache_vatrates(), EcmDirectory\load_motherof(), Categorie\load_motherof(), User\load_parentof(), Contact\load_ref_elements(), Product\load_stock(), Product\loadBatchInfo(), box_ficheinter\loadBox(), box_actions\loadBox(), box_clients\loadBox(), box_goodcustomers\loadBox(), box_prospect\loadBox(), box_comptes\loadBox(), Translate\loadCacheCurrencies(), Commande\loadExpeditions(), Translate\loadFromDatabase(), FormProduct\loadLotStock(), Project\loadTimeSpent(), FormProduct\loadWarehouses(), makesalt(), Menubase\menuLeftCharger(), Menubase\menuLoad(), Ldap\modify(), FormAdvTargetEmailing\multiselectCategories(), FormAdvTargetEmailing\multiselectCivility(), FormAdvTargetEmailing\multiselectCountry(), FormAdvTargetEmailing\multiselectProspectionStatus(), BonPrelevement\NbFactureAPrelever(), Facture\newCycle(), num_open_day(), ExpenseReport\offsetAlreadyGiven(), ExportTsv\open_file(), ExportCsv\open_file(), ExportExcel\open_file(), RssParser\parser(), ExpenseReport\periode_existe(), printing_printipp\print_file(), print_paybox_redirect(), print_paypal_redirect(), PriceGlobalVariableUpdater\process(), Utils\purgeFiles(), purgeSessions(), DoliDBMysqli\query(), DoliDBMssql\query(), DoliDBSqlite3\query(), DoliDBPgsql\query(), AdvanceTargetingMailing\query_contact(), AdvanceTargetingMailing\query_thirdparty(), rebuild_merge_pdf(), ExpenseReport\recalculer(), Categorie\rechercher(), EcmDirectory\refreshcachenboffile(), CommandeFournisseur\refuse(), Paiement\reject(), Bookmark\remove(), Project\remove_element(), ProductFournisseur\remove_fournisseur(), ProductFournisseur\remove_product_fournisseur_price(), RemiseCheque\removeCheck(), User\RemoveFromGroup(), Ldap\rename(), Contrat\reopen(), SupplierProposal\reopen(), Expedition\reOpen(), Propal\reopen(), Cronjob\reprogram_jobs(), Mailing\reset_targets_status(), Adherent\resiliate(), DoliDB\rollback(), DoliDBMssql\rollback(), Cronjob\run_jobs(), run_sql(), Interfaces\run_triggers(), InterfaceActionsBlockedLog\runTrigger(), InterfaceLogevents\runTrigger(), InterfaceMailmanSpipsynchro\runTrigger(), InterfaceWorkflowManager\runTrigger(), InterfaceLdapsynchro\runTrigger(), InterfaceActionsAuto\runTrigger(), InterfaceNotification\runTrigger(), InterfaceMyModuleTriggers\runTrigger(), InfoBox\saveboxorder(), Ldap\search(), Societe\searchByName(), FormAccounting\select_account(), BookKeeping\select_account(), FormAccounting\select_accounting_category(), Form\select_address(), Form\select_all_categories(), FormAccounting\select_auxaccount(), FormAccounting\select_bookkeeping_importkey(), FormOther\select_categories(), FormCompany\select_civility(), Form\select_comptes(), Form\select_conditions_paiements(), FormContract\select_contract(), Form\select_country(), DoliDBMysqli\select_db(), DoliDBSqlite3\select_db(), FormOther\select_dictionary(), Form\select_dolgroups(), Form\select_dolusers(), FormOther\select_ecotaxes(), FormProjets\select_element(), Form\select_incoterms(), FormIntervention\select_interventions(), FormAccounting\select_journal(), FormCompany\select_juridicalstatus(), Form\select_product_fourn_price(), Form\select_produits_fournisseurs_list(), Form\select_produits_list(), FormCompany\select_region(), Form\select_remises(), FormOther\select_revenue_stamp(), FormCompany\select_state(), Form\select_thirdparty_list(), Form\select_type_fees(), FormSocialContrib\select_type_socialcontrib(), Form\select_types_paiements(), FormResource\select_types_resource(), FormAdvTargetEmailing\selectAdvtargetemailingTemplate(), Form\selectAvailabilityDelay(), FormOther\selectColor(), Form\selectcontacts(), FormOrder\selectInputMethod(), FormProduct\selectLotStock(), FormProjets\selectOpportunityStatus(), FormPropal\selectProposalStatus(), Form\selectShippingMethod(), Form\selectSituationInvoices(), FormProduct\selectWarehouses(), FormAccounting\selectyear_accountancy_bookkepping(), Notify\send(), User\send_password(), ActionComm\sendEmailsReminder(), CSMSFile\sendfile(), CMailFile\sendfile(), Propal\set_availability(), ExpenseReport\set_cancel(), Facture\set_canceled(), BonPrelevement\set_credite(), RemiseCheque\set_date(), Propal\set_date(), Commande\set_date(), Fichinter\set_date_delivery(), Livraison\set_date_livraison(), SupplierProposal\set_date_livraison(), Expedition\set_date_livraison(), Propal\set_date_livraison(), CommandeFournisseur\set_date_livraison(), Commande\set_date_livraison(), Propal\set_demand_reason(), Fichinter\set_description(), Commande\set_draft(), FactureFournisseur\set_draft(), Facture\set_draft(), Propal\set_draft(), Propal\set_echeance(), CommandeFournisseur\set_id_projet(), BonPrelevement\set_infocredit(), BonPrelevement\set_infotrans(), RemiseCheque\set_number(), ExpenseReport\set_paid(), FactureFournisseur\set_paid(), Facture\set_paid(), Societe\set_parent(), Facture\set_ref_client(), Propal\set_ref_client(), Commande\set_ref_client(), Commande\set_remise(), Facture\set_remise(), Commande\set_remise_absolue(), Propal\set_remise_absolue(), Facture\set_remise_absolue(), Societe\set_remise_client(), Propal\set_remise_percent(), Commande\set_reopen(), ExpenseReport\set_save_from_refuse(), FactureFournisseur\set_unpaid(), ExpenseReport\set_unpaid(), Facture\set_unpaid(), ExpenseReport\setApproved(), CompanyBankAccount\setAsDefault(), FactureRec\setAutoValidate(), Societe\setCategories(), Project\setClose(), Expedition\setClosed(), ExpenseReport\setDeny(), Fichinter\setDraft(), Facture\setFinal(), FactureRec\setFrequencyAndUnit(), FactureRec\setGeneratePdf(), User\SetInGroup(), FactureRec\setMaxPeriod(), FactureRec\setModelPdf(), Product\setMultiLangs(), Categorie\setMultiLangs(), Societe\setMysoc(), FactureRec\setNextDate(), Adherent\setPassword(), User\setPassword(), Productcustomerprice\setPriceOnAffiliateThirdparty(), User\setstatus(), Contact\setstatus(), CommandeFournisseur\setStatus(), ProductFournisseur\setSupplierPriceExpression(), Adherent\setThirdPartyId(), Adherent\setUserId(), setUserPassword(), Fichinter\setValid(), Project\setValid(), ExpenseReport\setValidate(), Conf\setValues(), show_actions_done(), show_contacts(), FormSms\show_form(), show_list_sending_receive(), ModeleBoxes\showBox(), FormFile\showdocuments(), ExtraFields\showInputField(), ExtraFields\showOutputField(), BonPrelevement\SommeAPrelever(), tax_by_date(), thirdparty_doc_create(), top_htmlhead(), BookKeeping\transformTransaction(), tree_recur(), FormCompany\typent_array(), unActivateModule(), DiscountAbsolute\unlink_invoice(), PaymentVarious\update(), PaymentSalary\update(), Fiscalyear\update(), Localtax\update(), Establishment\update(), BankCateg\update(), Link\update(), Tva\update(), AdherentType\update(), Mailing\update(), Deplacement\update(), Events\update(), PriceGlobalVariable\update(), Bookmark\update(), Address\update(), Entrepot\update(), PriceGlobalVariableUpdater\update(), Comment\update(), Subscription\update(), EcmDirectory\update(), Cstate\update(), Menubase\update(), Ccountry\update(), Productbatch\update(), Ctypent\update(), PaymentExpenseReport\update(), Cpaiement\update(), PaymentLoan\update(), LoanSchedule\update(), PaymentDonation\update(), PriceExpression\update(), Cchargesociales\update(), Dolresource\update(), BlockedLogAuthority\update(), AccountingAccount\update(), CommandeFournisseurDispatch\update(), PaymentSocialContribution\update(), Project\update(), PaymentTerm\update(), Productlot\update(), Contact\update(), Opensurveysondage\update(), ChargeSociales\update(), Loan\update(), Fichinter\update(), AdvanceTargetingMailing\update(), Task\update(), Ctyperesource\update(), Propalmergepdfproduct\update(), ProductStockEntrepot\update(), Website\update(), ExpenseReport\update(), Adherent\update(), Categorie\update(), Don\update(), EcmFiles\update(), ExtraFields\update(), Cronjob\update(), Productcustomerprice\update(), Holiday\update(), Ldap\update(), Account\update(), UserGroup\update(), Product\update(), Societe\update(), FactureFournisseur\update(), ActionComm\update(), CurrencyRate\update(), BookKeeping\update(), Expedition\update(), Contrat\update(), User\update(), FichinterLigne\update(), Propal\update(), Facture\update(), FactureLigneRec\update(), AccountLine\update(), ExpeditionLigne\update(), ExpenseReportLine\update(), SupplierInvoiceLine\update(), ContratLigne\update(), SupplierProposalLine\update(), Commande\update(), CommandeFournisseurLigne\update(), PropaleLigne\update(), OrderLine\update(), FactureLigne\update(), Account\update_bban(), ProductFournisseur\update_buyprice(), User\update_clicktodial(), AccountLine\update_conciliation(), Paiement\update_date(), Project\update_element(), Dolresource\update_element_resource(), Adherent\update_end_date(), PaymentLoan\update_fk_bank(), PaymentDonation\update_fk_bank(), PaymentExpenseReport\update_fk_bank(), PaymentSocialContribution\update_fk_bank(), Paiement\update_fk_bank(), ExtraFields\update_label(), User\update_last_login_date(), MailingTargets\update_nb(), PriceGlobalVariableUpdater\update_next_update(), Paiement\update_num(), Contact\update_perso(), PriceGlobalVariableUpdater\update_status(), Contrat\update_statut(), FichinterLigne\update_total(), SupplierInvoiceLine\update_total(), ContratLigne\update_total(), SupplierProposalLine\update_total(), PropaleLigne\update_total(), OrderLine\update_total(), FactureLigne\update_total(), AccountancyCategory\updateAccAcc(), updateActionComm(), RemiseCheque\updateAmount(), Ldap\updateAttribute(), BookKeeping\updateByMvt(), Holiday\updateConfCP(), updateContact(), updateInvoice(), lettering\updateLettrage(), SupplierProposal\updateline(), Propal\updateline(), FactureRec\updateline(), FactureFournisseur\updateline(), Contrat\updateline(), CommandeFournisseur\updateline(), Facture\updateline(), Commande\updateline(), SupplierProposal\updateOrCreatePriceFournisseur(), updateOrder(), Product\updatePrice(), updateProductOrService(), Holiday\updateSoldeCP(), updateThirdParty(), Task\updateTimeSpent(), CommandeFournisseurLigne\updateTotal(), Societe\useLocalTax(), Societe\useNPR(), Societe\useRevenueStamp(), Commande\valid(), Livraison\valid(), Mailing\valid(), CommandeFournisseur\valid(), Expedition\valid(), SupplierProposal\valid(), Propal\valid(), RemiseCheque\validate(), Contrat\validate(), FactureFournisseur\validate(), Adherent\validate(), Facture\validate(), Paiement\valide(), validOrder(), vat_by_thirdparty(), mod_contract_olive\verif(), mod_codeclient_leopard\verif(), mod_codeproduct_leopard\verif(), mod_codecompta_aquarium\verif(), mod_codeclient_monkey\verif(), mod_barcode_product_standard\verif(), mod_codeproduct_elephant\verif(), mod_codeclient_elephant\verif(), mod_codeclient_monkey\verif_dispo(), mod_barcode_product_standard\verif_syntax(), Holiday\verifNbUsers(), vignette(), html_cerfafr\write_file(), pdf_paiement\write_file(), pdf_azur\write_file(), doc_generic_odt\write_file(), doc_generic_contract_odt\write_file(), doc_generic_invoice_odt\write_file(), doc_generic_order_odt\write_file(), doc_generic_shipment_odt\write_file(), doc_generic_user_odt\write_file(), doc_generic_product_odt\write_file(), doc_generic_usergroup_odt\write_file(), doc_generic_supplier_proposal_odt\write_file(), doc_generic_proposal_odt\write_file(), doc_generic_task_odt\write_file(), doc_generic_project_odt\write_file(), CMailFile\write_files(), CMailFile\write_images(), CMailFile\write_mimeheaders(), CMailFile\write_smtpheaders(), and modTcpdfbarcode\writeBarCode().

dol_textishtml (   $msg,
  $option = 0 
)

Return if a text is a html content.

Parameters
string$msgContent to check
int$option0=Full detection, 1=Fast check
Returns
boolean true/false
See also
dol_concatdesc

Definition at line 5327 of file functions.lib.php.

Referenced by CMailFile\__construct(), ajax_dialog(), dol_concatdesc(), dol_htmlentitiesbr(), dol_nboflines_bis(), dolGetFirstLineOfText(), envoi_mail(), Mailing\fetch(), FormMail\get_form(), make_substitutions(), Adherent\makeSubstitution(), pdf_getlinedesc(), and Adherent\send_an_email().

dol_trunc (   $string,
  $size = 40,
  $trunc = 'right',
  $stringencoding = 'UTF-8',
  $nodot = 0,
  $display = 0 
)

Truncate a string to a particular length adding '...' if string larger than length.

If length = max length+1, we do no truncate to avoid having just 1 char replaced with '...'. MAIN_DISABLE_TRUNC=1 can disable all truncings

Parameters
string$stringString to truncate
int$sizeMax string size visible (excluding ...). 0 for no limit. WARNING: Final string size can have 3 more chars (if we added ..., or if size was max+1 or max+2 or max+3 so it does not worse to replace with ...)
string$truncWhere to trunc: right, left, middle (size must be a 2 power), wrap
string$stringencodingTell what is source string encoding
int$nodotTruncation do not add ... after truncation. So it's an exact truncation.
int$displayTrunc is use to display and can be changed for small screen. TODO Remove this param (must be dealt with CSS)
Returns
string Truncated string. WARNING: length is never higher than $size if $nodot is set, but can be 3 chars higher otherwise.

Definition at line 2695 of file functions.lib.php.

Referenced by Product\_get_stats(), CommActionRapport\_pages(), FormAdvTargetEmailing\advMultiselectarraySelllist(), BordereauChequeBlochet\Body(), Export\build_filterField(), Events\create(), ActionComm\create(), dol_print_email(), dol_print_skype(), dol_print_url(), BonPrelevement\EnregDestinataireSEPA(), AccountancyExport\exportBob50(), mailing_fraise\formFilter(), mailing_thirdparties\formFilter(), mailing_advthirdparties\formFilter(), Translate\get_available_languages(), getCommonSubstitutionArray(), CommonObject\getFullName(), getListOfModels(), AdherentType\getNomUrl(), EcmDirectory\getNomUrl(), Loan\getNomUrl(), ChargeSociales\getNomUrl(), PaymentLoan\getNomUrl(), PaymentVarious\getNomUrl(), PaymentDonation\getNomUrl(), Task\getNomUrl(), PaymentExpenseReport\getNomUrl(), PaymentSocialContribution\getNomUrl(), Project\getNomUrl(), Contact\getNomUrl(), Facture\getNomUrl(), ActionComm\getNomUrl(), ExpenseReport\getNomUrl(), Adherent\getNomUrl(), Societe\getNomUrl(), FactureFournisseur\getNomUrl(), User\getNomUrl(), Product\getNomUrl(), FormFile\list_of_autoecmfiles(), box_ficheinter\loadBox(), box_graph_product_distribution\loadBox(), ActionsCardProduct\LoadListDatas(), FormAdvTargetEmailing\multiselectCountry(), print_left_auguria_menu(), print_left_eldy_menu(), FormAccounting\select_account(), FormAccounting\select_accounting_category(), Form\select_all_categories(), FormContract\select_contract(), Form\select_country(), FormIntervention\select_interventions(), Form\select_produits_fournisseurs_list(), FormProjets\select_projects_list(), Form\select_remises(), Form\select_types_paiements(), FormResource\select_types_resource(), FormProjets\selectTasks(), show_actions_done(), ModeleBoxes\showBox(), ExtraFields\showInputField(), ExtraFields\showOutputField(), Societe\thirdparty_and_contact_email_array(), Societe\thirdparty_and_contact_phone_array(), Translate\trans(), AccountancyExport\trunc(), CompanyBankAccount\update(), and pdf_standard\write_file().

dol_user_country ( )

Return country code for current user.

If software is used inside a local network, detection may fails (we need a public ip)

Returns
string Country code (fr, es, it, us, ...)

Definition at line 2354 of file functions.lib.php.

dol_validElement (   $element)

Return if var element is ok.

Parameters
string$elementVariable to check
Returns
boolean Return true of variable is not empty

Definition at line 6273 of file functions.lib.php.

dolEscapeXML (   $string)

Encode string for xml usage.

Parameters
string$stringString to encode
Returns
string String encoded

Definition at line 912 of file functions.lib.php.

dolExplodeIntoArray (   $string,
  $delimiter = ';',
  $kv = '=' 
)

Split a string with 2 keys into key array.

For example: "A=1;B=2;C=2" is exploded into array('A'=>1,'B'=>2,'C'=>3)

Parameters
string$stringString to explode
string$delimiterDelimiter between each couple of data
string$kvDelimiter between key and value
Returns
array Array of data exploded

Definition at line 6552 of file functions.lib.php.

dolGetCountryCodeFromIp (   $ip)

Return a country code from IP.

Empty string if not found.

Parameters
string$ipIP
Returns
string Country code ('us', 'fr', ...)

Definition at line 2325 of file functions.lib.php.

Referenced by dol_print_ip().

dolGetFirstLastname (   $firstname,
  $lastname,
  $nameorder = -1 
)

Return firstname and lastname in correct order.

Parameters
string$firstnameFirstname
string$lastnameLastname
int$nameorder-1=Auto, 0=Lastname+Firstname, 1=Firstname+Lastname, 2=Firstname
Returns
string Firstname + lastname or Lastname + firstname

Definition at line 5794 of file functions.lib.php.

Referenced by pdf_standard\_pagehead(), ActionComm\build_exportfile(), Societe\contact_array(), Societe\contact_get_property(), Societe\contact_property_array(), CommonObject\getFullName(), ExpenseReportRule\getUserName(), FormOther\select_salesrepresentatives(), Notify\send(), and BonPrelevement\set_infotrans().

dolGetFirstLineOfText (   $text,
  $nboflines = 1 
)

Return first line of text.

Cut will depends if content is HTML or not.

Parameters
string$textInput text
int$nboflinesNb of lines to get (default is 1 = first line only)
Returns
string Output text
See also
dol_nboflines_bis, dol_string_nohtmltag, dol_escape_htmltag

Definition at line 5057 of file functions.lib.php.

References dol_textishtml().

fieldLabel (   $langkey,
  $fieldkey,
  $fieldrequired = 0 
)

Show a string with the label tag dedicated to the HTML edit field.

Parameters
string$langkeyTranslation key
string$fieldkeyKey of the html select field the text refers to
int$fieldrequired1=Field is mandatory
Deprecated:
Form::editfieldkey

Definition at line 1532 of file functions.lib.php.

get_date_range (   $date_start,
  $date_end,
  $format = '',
  $outputlangs = '',
  $withparenthesis = 1 
)

Format output for start and end date.

Parameters
int$date_startStart date
int$date_endEnd date
string$formatOutput format
Translate$outputlangsOutput language
integer$withparenthesis1=Add parenthesis, 0=non parenthesis
Returns
string String

Definition at line 5762 of file functions.lib.php.

References dol_print_date().

Referenced by print_date_range().

get_default_localtax (   $thirdparty_seller,
  $thirdparty_buyer,
  $local,
  $idprod = 0 
)

Function that return localtax of a product line (according to seller, buyer and product vat rate) Si vendeur non assujeti a TVA, TVA par defaut=0.

Fin de regle. Si le (pays vendeur = pays acheteur) alors TVA par defaut=TVA du produit vendu. Fin de regle. Sinon TVA proposee par defaut=0. Fin de regle.

Parameters
Societe$thirdparty_sellerThirdparty seller
Societe$thirdparty_buyerThirdparty buyer
int$localLocaltax to process (1 or 2)
int$idprodId product
Returns
integer localtax, -1 si ne peut etre determine
See also
get_default_tva, get_default_npr

Definition at line 4805 of file functions.lib.php.

References get_product_localtax_for_country().

get_default_npr ( Societe  $thirdparty_seller,
Societe  $thirdparty_buyer,
  $idprod = 0,
  $idprodfournprice = 0 
)

Fonction qui renvoie si tva doit etre tva percue recuperable.

Parameters
Societe$thirdparty_sellerThirdparty seller
Societe$thirdparty_buyerThirdparty buyer
int$idprodId product
int$idprodfournpriceId supplier price for product
Returns
float 0 or 1
See also
get_default_tva, get_default_localtax

Definition at line 4768 of file functions.lib.php.

Referenced by SupplierProposal\add_product(), Propal\add_product(), Commande\add_product(), Facture\create(), and Form\load_tva().

get_default_tva ( Societe  $thirdparty_seller,
Societe  $thirdparty_buyer,
  $idprod = 0,
  $idprodfournprice = 0 
)

Function that return vat rate of a product line (according to seller, buyer and product vat rate) Si vendeur non assujeti a TVA, TVA par defaut=0.

Fin de regle. Si le (pays vendeur = pays acheteur) alors TVA par defaut=TVA du produit vendu. Fin de regle. Si (vendeur et acheteur dans Communaute europeenne) et (bien vendu = moyen de transports neuf comme auto, bateau, avion) alors TVA par defaut=0 (La TVA doit etre paye par acheteur au centre d'impots de son pays et non au vendeur). Fin de regle. Si (vendeur et acheteur dans Communaute europeenne) et (acheteur = particulier ou entreprise sans num TVA intra) alors TVA par defaut=TVA du produit vendu. Fin de regle Si (vendeur et acheteur dans Communaute europeenne) et (acheteur = entreprise avec num TVA) intra alors TVA par defaut=0. Fin de regle Sinon TVA proposee par defaut=0. Fin de regle.

Parameters
Societe$thirdparty_sellerObjet societe vendeuse
Societe$thirdparty_buyerObjet societe acheteuse
int$idprodId product
int$idprodfournpriceId product_fournisseur_price (for supplier order/invoice)
Returns
float|string Vat rate to use with format 5.0 or '5.0 (XXX)', -1 if we can't guess it
See also
get_default_npr, get_default_localtax

Definition at line 4686 of file functions.lib.php.

References dol_syslog(), get_product_vat_for_country(), Societe\isACompany(), and isInEEC().

Referenced by SupplierProposal\add_product(), Propal\add_product(), Commande\add_product(), Facture\create(), and Form\load_tva().

get_exdir (   $num,
  $level,
  $alpha,
  $withoutslash,
  $object,
  $modulepart 
)

Return a path to have a the directory according to object where files are stored.

New usage: $conf->module->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 1, $object, $modulepart) or: $conf->module->dir_output.'/'.get_exdir(0, 0, 0, 1, $object, $modulepart) if multidir_output not defined. Example our with new usage: $object is invoice -> 'INYYMM-ABCD' Example our with old usage: '015' with level 3->"0/1/5/", '015' with level 1->"5/", 'ABC-1' with level 3 ->"0/0/1/"

Parameters
string$numId of object (deprecated, $object will be used in future)
int$levelLevel of subdirs to return (1, 2 or 3 levels). (deprecated, global option will be used in future)
int$alpha0=Keep number only to forge path, 1=Use alpha part afer the - (By default, use 0). (deprecated, global option will be used in future)
int$withoutslash0=With slash at end (except if '/', we return ''), 1=without slash at end
Object$objectObject
string$modulepartType of object ('invoice_supplier, 'donation', 'invoice', ...')
Returns
string Dir to use ending. Example '' or '1/' or '1/2/'

Definition at line 4891 of file functions.lib.php.

Referenced by FileUpload\__construct(), pdf_standard\Add_PDF_card(), Categorie\add_photo(), Product\add_photo(), FactureFournisseur\delete(), dol_banner_tab(), donation_prepare_head(), facturefourn_prepare_head(), CommonDocGenerator\get_substitutionarray_user(), getCategory(), FormFile\getDocumentsLink(), Documents\getDocumentsListByElement(), getProductOrService(), getProductsForCategory(), Product\is_photo_available(), FormFile\list_of_documents(), member_prepare_head(), product_prepare_head(), Product\show_photos(), Form\showphoto(), FactureFournisseur\validate(), pdf_rouget\write_file(), pdf_canelle\write_file(), pdf_aurore\write_file(), pdf_muscadet\write_file(), pdf_azur\write_file(), pdf_crabe\write_file(), and pdf_standard\write_file().

get_htmloutput_errors (   $mesgstring = '',
  $mesgarray = '',
  $keepembedded = 0 
)

Get formated error messages to output (Used to show messages on html output).

Parameters
string$mesgstringError message
array$mesgarrayError messages array
int$keepembeddedSet to 1 in error message must be kept embedded into its html place (this disable jnotify)
Returns
string Return html output
See also
dol_print_error
dol_htmloutput_mesg

Definition at line 5988 of file functions.lib.php.

References get_htmloutput_mesg().

Referenced by ActionsCardService\assign_values(), ActionsCardProduct\assign_values(), and ActionsCardCommon\assign_values().

get_htmloutput_mesg (   $mesgstring = '',
  $mesgarray = '',
  $style = 'ok',
  $keepembedded = 0 
)

Get formated messages to output (Used to show messages on html output).

This include also the translation of the message key.

Parameters
string$mesgstringMessage string or message key
string[]$mesgarray Array of message strings or message keys
string$styleStyle of message output ('ok' or 'error')
int$keepembeddedSet to 1 in error message must be kept embedded into its html place (this disable jnotify)
Returns
string Return html output
See also
dol_print_error
dol_htmloutput_errors
setEventMessages

Definition at line 5912 of file functions.lib.php.

References dol_escape_js().

Referenced by ActionsCardCommon\assign_values(), dol_htmloutput_mesg(), and get_htmloutput_errors().

get_localtax (   $vatrate,
  $local,
  $thirdparty_buyer = "",
  $thirdparty_seller = "",
  $vatnpr = 0 
)

Return localtax rate for a particular vat, when selling a product with vat $vatrate, from a $thirdparty_buyer to a $thirdparty_seller Note: This function applies same rules than get_default_tva.

Parameters
float$vatrateVat rate. Can be '8.5' or '8.5 (VATCODEX)' for example
int$localLocal tax to search and return (1 or 2 return only tax rate 1 or tax rate 2)
Societe$thirdparty_buyerObject of buying third party
Societe$thirdparty_sellerObject of selling third party ($mysoc if not defined)
int$vatnprIf vat rate is NPR or not
Returns
mixed 0 if not found, localtax rate if found
See also
get_default_tva

Definition at line 4201 of file functions.lib.php.

Referenced by SupplierProposal\add_product(), Propal\add_product(), Commande\add_product(), Facture\create(), Expedition\fetch_lines(), getLocalTaxesFromRate(), ProductFournisseur\update_buyprice(), and Product\updatePrice().

get_localtax_by_third (   $local)

Get values of localtaxes (1 or 2) for company country for the common vat with the highest value.

Parameters
int$localLocalTax to get
Returns
number Values of localtax

Definition at line 4353 of file functions.lib.php.

Referenced by FormCompany\select_localtax().

get_product_localtax_for_country (   $idprod,
  $local,
  $thirdparty_seller 
)

Return localtax vat rate of a product in a particular selling country or default country vat if product is unknown.

Parameters
int$idprodId of product
int$local1 for localtax1, 2 for localtax 2
Societe$thirdparty_sellerThirdparty with a ->country_code defined (FR, US, IT, ...)
Returns
int <0 if KO, Vat rate if OK
See also
get_product_vat_for_country

Definition at line 4611 of file functions.lib.php.

References $resql, dol_print_error(), and dol_syslog().

Referenced by get_default_localtax().

get_product_vat_for_country (   $idprod,
  $thirdparty_seller,
  $idprodfournprice = 0 
)

Return vat rate of a product in a particular selling country or default country vat if product is unknown Function called by get_default_tva.

Parameters
int$idprodId of product or 0 if not a predefined product
Societe$thirdparty_sellerThirdparty with a ->country_code defined (FR, US, IT, ...)
int$idprodfournpriceId product_fournisseur_price (for "supplier" order/invoice)
Returns
float|string Vat rate to use with format 5.0 or '5.0 (XXX)'
See also
get_product_localtax_for_country

Definition at line 4535 of file functions.lib.php.

References $resql, dol_print_error(), and dol_syslog().

Referenced by get_default_tva().

getAdvancedPreviewUrl (   $modulepart,
  $relativepath,
  $alldata = 0,
  $param = '' 
)

Return URL we can use for advanced preview links.

Parameters
string$modulepartpropal, facture, facture_fourn, ...
string$relativepathRelative path of docs.
int$alldataReturn array with all components (1 is recommended, then use a simple a href link with the class, target and mime attribute added. 'documentpreview' css class is handled by jquery code into main.inc.php)
string$paramMore param on http links
Returns
string|array Output string with href link or array with all components of link

Definition at line 6810 of file functions.lib.php.

References dol_mimetype().

Referenced by FormFile\getDocumentsLink(), FormFile\list_of_documents(), Product\show_photos(), Form\showphoto(), and FormFile\showPreview().

getBrowserInfo (   $user_agent)

Return information about user browser.

Returns array with the following format: array( 'browsername' => Browser name (firefox|chrome|iceweasel|epiphany|safari|opera|ie|unknown) 'browserversion' => Browser version. Empty if unknown 'browseros' => Set with mobile OS (android|blackberry|ios|palm|symbian|webos|maemo|windows|unknown) 'layout' => (tablet|phone|classic) 'phone' => empty if not mobile, (android|blackberry|ios|palm|unknown) if mobile 'tablet' => true/false )

Parameters
string$user_agentContent of $_SERVER["HTTP_USER_AGENT"] variable
Returns
array Check function documentation

Definition at line 159 of file functions.lib.php.

getCommonSubstitutionArray (   $outputlangs,
  $onlykey = 0,
  $exclude = null,
  $object = null 
)

Return array of possible common substitutions.

This includes several families like: 'system', 'mycompany', 'object', 'objectamount', 'date', 'user'

Parameters
Translate$outputlangsOutput language
int$onlykey1=Do not calculate some heavy values of keys (performance enhancement when we need only the keys), 2=Values are trunc and html sanitized (to use for help tooltip)
array$excludeArray of family keys we want to exclude. For example array('system', 'mycompany', 'object', 'objectamount', 'date', 'user', ...)
Object$objectObject for keys on object
Returns
array Array of substitutions
See also
setSubstitFromObject

Definition at line 5386 of file functions.lib.php.

References dol_get_next_day(), dol_get_next_month(), dol_get_prev_day(), dol_get_prev_month(), dol_getdate(), dol_htmlentitiesbr(), dol_now(), dol_print_date(), dol_string_nohtmltag(), and dol_trunc().

Referenced by Facture\create(), and pdf_getSubstitutionArray().

getDictvalue (   $tablename,
  $field,
  $id,
  $checkentity = false,
  $rowidfield = 'rowid' 
)

Return value from dictionary.

Parameters
string$tablenamename of dictionary
string$fieldthe value to return
int$idid of line
bool$checkentityadd filter on entity
string$rowidfieldname of the column rowid

Definition at line 6956 of file functions.lib.php.

getDoliDBInstance (   $type,
  $host,
  $user,
  $pass,
  $name,
  $port 
)

Return a DoliDB instance (database handler).

Parameters
string$typeType of database (mysql, pgsql...)
string$hostAddress of database server
string$userNom de l'utilisateur autorise
string$passMot de passe
string$nameNom de la database
int$portPort of database server
Returns
DoliDB A DoliDB instance

Definition at line 94 of file functions.lib.php.

Referenced by MailmanSpip\connectSpip().

getEntity (   $element,
  $shared = 1,
  $forceentity = null 
)

Get list of entity id to use.

Parameters
string$elementCurrent element 'societe', 'socpeople', 'actioncomm', 'agenda', 'resource', 'product', 'productprice', 'stock', 'propal', 'supplier_proposal', 'facture', 'facture_fourn', 'payment_various', 'categorie', 'bank_account', 'bank_account', 'adherent', 'user', 'commande', 'commande_fournisseur', 'expedition', 'intervention', 'survey', 'contract', 'tax', 'expensereport', 'holiday', 'multicurrency', 'project', 'email_template', 'event', 'donation' 'c_paiement', ...
int$shared0=Return id of current entity only, 1=Return id of current entity + shared entities (default)
int$forceentityEntity id
Returns
mixed Entity id(s) to use

Definition at line 120 of file functions.lib.php.

Referenced by modFacture\__construct(), modSociete\__construct(), modProjet\__construct(), modSalaries\__construct(), pdf_crabe\_tableau_versements(), pdf_canelle\_tableau_versements(), TaskStats\buildWhere(), ProjectStats\buildWhere(), CommonInvoice\calculate_date_lim_reglement(), Categorie\containing(), ProductAttribute\countChildProducts(), ProductCombination\countNbOfCombinationForFkProductParent(), PaymentTerm\create(), BookKeeping\create(), PaymentTerm\delete(), BookKeeping\deleteByYearAndJournal(), BookKeeping\deleteMvtNum(), dol_getIdFromCode(), BookKeeping\export_bookkeping(), ProductAttributeValue\fetch(), ProductAttribute\fetch(), PaiementFourn\fetch(), ChargeSociales\fetch(), Paiement\fetch(), ProductCombination\fetch(), PaymentExpenseReport\fetch(), PaymentLoan\fetch(), LoanSchedule\fetch(), PaymentTerm\fetch(), PaymentDonation\fetch(), PaymentSocialContribution\fetch(), Categorie\fetch(), CommandeFournisseur\fetch(), FactureRec\fetch(), FactureFournisseur\fetch(), BookKeeping\fetch(), Don\fetch(), SupplierProposal\fetch(), Facture\fetch(), Propal\fetch(), Commande\fetch(), Productcustomerprice\fetch_all(), Productcustomerprice\fetch_all_log(), ProductAttribute\fetchAll(), AccountingJournal\fetchAll(), BookKeeping\fetchAll(), BookKeeping\fetchAllBalance(), BookKeeping\fetchAllByAccount(), ProductCombination\fetchAllByFkProductParent(), BookKeeping\fetchAllPerMvt(), ProductCombination\fetchByFkProductChild(), BookKeeping\fetchPerMvt(), BookKeeping\get_compte_desc(), BookKeeping\get_compte_racine(), Categorie\get_full_arbo(), ExpenseReportIk\getAllRanges(), ExpenseReportRule\getAllRule(), PaymentTerm\getDefaultId(), Translate\getLabelFromKey(), Facture\getListOfPayments(), BookKeeping\getNextNumMvt(), Categorie\getObjectsInCateg(), mailing_fraise\getSqlArrayForStats(), ExpenseReportIk\getTaxCategories(), Societe\id_prof_exists(), Propal\load_board(), Commande\load_board(), Form\load_cache_conditions_paiements(), Fichinter\load_state_board(), Contact\load_state_board(), Propal\load_state_board(), Commande\load_state_board(), FormProduct\loadLotStock(), Categorie\rechercher(), BookKeeping\select_account(), FormAccounting\select_auxaccount(), FormAccounting\selectyear_accountancy_bookkepping(), Productcustomerprice\setPriceOnAffiliateThirdparty(), Form\showLinkToObjectBlock(), PaymentTerm\update(), and pdf_paiement\write_file().

getImageFileNameForSize (   $file,
  $extName,
  $extImgTarget = '' 
)

Return the filename of file to get the thumbs.

Parameters
string$fileOriginal filename (full or relative path)
string$extNameExtension to differenciate thumb file name ('', '_small', '_mini')
string$extImgTargetForce image extension for thumbs. Use '' to keep same extension than original image (default).
Returns
string New file name (full or relative path, including the thumbs/)

Definition at line 6778 of file functions.lib.php.

Referenced by FormFile\list_of_documents(), Product\show_photos(), Form\showphoto(), and vignette().

getLocalTaxesFromRate (   $vatrate,
  $local,
  $buyer,
  $seller,
  $firstparamisid = 0 
)

Get type and rate of localtaxes for a particular vat rate/country of a thirdparty.

This does not take into account the seller setup if subject to vat or not, only country. TODO This function is ALSO called to retrieve type for building PDF. Such call of function must be removed. Instead this function must be called when adding a line to get the array of localtax and type, and then provide it to the function calcul_price_total.

Parameters
int | string$vatrateVAT ID or Rate+Code. Value can be value or the string with code into parenthesis or rowid if $firstparamisid is 1. Example: '8.5' or '8.5 (8.5NPR)' or 123.
int$localNumber of localtax (1 or 2, or 0 to return 1 & 2)
Societe$buyerCompany object
Societe$sellerCompany object
int$firstparamisid1 if first param is ID into table instead of Rate+code (use this if you can)
Returns
array array(localtax_type1(1-6/0 if not found), rate localtax1, localtax_type2, rate localtax2, accountancycodecust, accountancycodesupp)
See also
getTaxesFromId

Definition at line 4442 of file functions.lib.php.

References $resql, dol_syslog(), get_localtax(), and isOnlyOneLocalTax().

Referenced by SupplierProposal\addline(), Propal\addline(), FactureRec\addline(), Commande\addline(), Contrat\addline(), FactureFournisseur\addline(), CommandeFournisseur\addline(), Facture\addline(), Facturation\ajoutArticle(), ContratLigne\update(), SupplierProposal\updateline(), Propal\updateline(), FactureRec\updateline(), FactureFournisseur\updateline(), Contrat\updateline(), ExpenseReport\updateline(), CommandeFournisseur\updateline(), Facture\updateline(), Commande\updateline(), pdf_aurore\write_file(), pdf_muscadet\write_file(), pdf_azur\write_file(), pdf_crabe\write_file(), and pdf_einstein\write_file().

GETPOST (   $paramname,
  $check = 'none',
  $method = 0,
  $filter = NULL,
  $options = NULL,
  $noreplace = 0 
)

Return value of a param into GET or POST supervariable.

Use the property $user->default_values[path]['creatform'] and/or $user->default_values[path]['filters'] and/or $user->default_values[path]['sortorder'] Note: The property $user->default_values is loaded by main.php when loading the user.

Parameters
string$paramnameName of parameter to found
string$checkType of check ''=no check (deprecated) 'none'=no check (only for param that should have very rich content) 'int'=check it's numeric (integer or float) 'alpha'=check it's text and sign 'aZ'=check it's a-z only 'aZ09'=check it's simple alpha string (recommended for keys) 'array'=check it's array 'san_alpha'=Use filter_var with FILTER_SANITIZE_STRING (do not use this for free text string) 'nohtml', 'alphanohtml'=check there is no html content 'custom'= custom filter specify $filter and $options)
int$methodType of method (0 = get then post, 1 = only get, 2 = only post, 3 = post then get, 4 = post then get then cookie)
int$filterFilter to apply when $check is set to 'custom'. (See http://php.net/manual/en/filter.filters.php for d├ętails)
mixed$optionsOptions to pass to filter_var when $check is set to 'custom'
string$noreplaceForce disable of replacement of xxx strings.
Returns
string|string[] Value found (string or array), or '' if check fails

Definition at line 279 of file functions.lib.php.

References dol_get_next_day(), dol_get_next_month(), dol_get_prev_day(), dol_get_prev_month(), dol_getdate(), dol_now(), dol_string_nohtmltag(), dol_string_nospecial(), and dol_syslog().

Referenced by ImportCsv\__construct(), mailing_xinputuser\add_to_target(), mailing_contacts1\add_to_target(), ActionsCardIndividual\assign_values(), checkLoginPassEntity(), SupplierProposal\cloture(), Propal\cloture(), Facture\create(), create_script_table(), ActionsCardCommon\doActions(), ActionsContactCardCommon\doActions(), ActionsAdherentCardCommon\doActions(), dol_add_file_process(), Utils\dumpDatabase(), Form\editfieldkey(), Form\editfieldval(), fieldListAccountingCategories(), FormMail\get_form(), FormOther\getBoxesArea(), Setup\getCheckIntegrity(), ExtraFields\getOptionalsFromPost(), hash_call(), FormFile\list_of_documents(), box_graph_invoices_supplier_permonth\loadBox(), box_graph_orders_permonth\loadBox(), box_graph_orders_supplier_permonth\loadBox(), box_graph_invoices_permonth\loadBox(), box_graph_propales_permonth\loadBox(), box_graph_product_distribution\loadBox(), ActionsCardService\LoadListDatas(), ActionsCardProduct\LoadListDatas(), print_auguria_menu(), print_eldy_menu(), print_left_auguria_menu(), print_left_eldy_menu(), printingadmin_prepare_head(), restrictedArea(), ExtraFields\setOptionalsFromPost(), show_contacts(), FormSms\show_form(), MenuManager\showmenu(), top_htmlhead(), and Auth\verif().

GETPOSTISSET (   $paramname)

Return true if we are in a context of submitting a parameter.

Parameters
string$paramnameName or parameter to test
Returns
boolean True if we have just submit a POST or GET request with the parameter provided (even if param is empty)

Definition at line 251 of file functions.lib.php.

getStaticMember (   $class,
  $member 
)

Function to return value of a static property when class name is dynamically defined (not hard coded).

This is because $myclass::$myvar works from PHP 5.3.0+ only

Parameters
string$classClass name
string$memberName of property
Returns
mixed Return value of static property
Deprecated:
Dolibarr now requires 5.3.0+, use

$class::$property syntax

See also
https://php.net/manual/language.oop5.static.php

Definition at line 52 of file functions.lib.php.

References dol_print_error(), and dol_syslog().

getTaxesFromId (   $vatrate,
  $buyer = null,
  $seller = null,
  $firstparamisid = 1 
)

Get vat main information from Id.

You can call getLocalTaxesFromRate after to get other fields.

Parameters
int | string$vatrateVAT ID or Rate. Value can be value or the string with code into parenthesis or rowid if $firstparamisid is 1. Example: '8.5' or '8.5 (8.5NPR)' or 123.
Societe$buyerCompany object
Societe$sellerCompany object
int$firstparamisid1 if first param is id into table (use this if you can)
Returns
array array('rowid'=> , 'code'=> ...)
See also
getLocalTaxesFromRate

Definition at line 4387 of file functions.lib.php.

References $resql, dol_print_error(), and dol_syslog().

Referenced by Facturation\ajoutArticle().

getTitleFieldOfList (   $name,
  $thead = 0,
  $file = "",
  $field = "",
  $begin = "",
  $moreparam = "",
  $moreattrib = "",
  $sortfield = "",
  $sortorder = "",
  $prefix = "",
  $disablesortlink = 0,
  $tooltip = '' 
)

Get title line of an array.

Parameters
string$nameTranslation key of field
int$thead0=To use with standard table format, 1=To use inside <thead>

, 2=To use with

Parameters
string$fileUrl used when we click on sort picto
string$fieldField to use for new sorting. Empty if this field is not sortable.
string$begin("" by defaut)
string$moreparamAdd more parameters on sort url links ("" by default)
string$moreattribAdd more attributes on th ("" by defaut, example: 'align="center"'). To add more css class, use param $prefix.
string$sortfieldCurrent field used to sort (Ex: 'd.datep,d.id')
string$sortorderCurrent sort order (Ex: 'asc,desc')
string$prefixPrefix for css. Use space after prefix to add your own CSS tag, for example 'mycss '.
string$disablesortlink1=Disable sort link
string$tooltipTooltip
Returns
string

Definition at line 3557 of file functions.lib.php.

Referenced by show_actions_done(), and FormActions\showactions().

img_action (   $titlealt,
  $numaction 
)

Show logo action.

Parameters
string$titlealtText on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
string$numactionAction id or code to show
Returns
string Return an img tag

Definition at line 2916 of file functions.lib.php.

Referenced by Societe\LibProspCommStatut().

img_allow (   $allow,
  $titlealt = 'default' 
)

Show tick logo if allowed.

Parameters
string$allowAllow
string$titlealtText on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
Returns
string Return img tag

Definition at line 3239 of file functions.lib.php.

img_delete (   $titlealt = 'default',
  $other = 'class="pictodelete"' 
)

Show delete logo.

Parameters
string$titlealtText on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
string$otherAdd more attributes on img
Returns
string Retourne tag img

Definition at line 3024 of file functions.lib.php.

Referenced by Export\list_export_model(), FormFile\list_of_documents(), FormFile\listOfLinks(), and Product\show_photos().

img_down (   $titlealt = 'default',
  $selected = 0,
  $moreclass = '' 
)

Show down arrow logo.

Parameters
string$titlealtText on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
int$selectedSelected
string$moreclassAdd more CSS classes
Returns
string Return img tag

Definition at line 3172 of file functions.lib.php.

Referenced by form_constantes(), and FormFile\list_of_documents().

img_edit (   $titlealt = 'default',
  $float = 0,
  $other = 'class="pictoedit"' 
)

Show logo editer/modifier fiche.

Parameters
string$titlealtText on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
integer$floatSi il faut y mettre le style "float: right"
string$otherAdd more attributes on img
Returns
string Return tag img

Definition at line 2989 of file functions.lib.php.

Referenced by ActionsCardCommon\assign_values(), Form\editfieldkey(), FormFile\list_of_documents(), FormFile\listOfLinks(), show_addresses(), show_contacts(), and show_subsidiaries().

img_edit_add (   $titlealt = 'default',
  $other = '' 
)

Show logo +.

Parameters
string$titlealtText on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
string$otherAdd more attributes on img
Returns
string Return tag img

Definition at line 2957 of file functions.lib.php.

img_edit_remove (   $titlealt = 'default',
  $other = '' 
)

Show logo -.

Parameters
string$titlealtText on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
string$otherAdd more attributes on img
Returns
string Return tag img

Definition at line 2972 of file functions.lib.php.

img_error (   $titlealt = 'default')

Show error logo.

Parameters
string$titlealtText on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
Returns
string Return img tag

Definition at line 3121 of file functions.lib.php.

Referenced by Mailing\libStatutDest().

img_help (   $usehelpcursor = 1,
  $usealttitle = 1 
)

Show help logo with cursor "?".

Parameters
int$usehelpcursor1=Use help cursor, 2=Use click pointer cursor, 0=No specific cursor
int | string$usealttitleText to use as alt title
Returns
string Return tag img

Definition at line 3070 of file functions.lib.php.

Referenced by Form\textwithpicto().

img_info (   $titlealt = 'default')

Show info logo.

Parameters
string$titlealtText on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
Returns
string Return img tag

Definition at line 3089 of file functions.lib.php.

img_left (   $titlealt = 'default',
  $selected = 0,
  $moreatt = '' 
)

Show left arrow logo.

Parameters
string$titlealtText on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
int$selectedSelected
string$moreattAdd more attribute on img tag (For example 'style="float: right"')
Returns
string Return img tag

Definition at line 3206 of file functions.lib.php.

img_mime (   $file,
  $titlealt = '',
  $morecss = '' 
)

Show MIME img of a file.

Parameters
string$fileFilename
string$titlealtText on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
string$morecssMore css
Returns
string Return img tag

Definition at line 3259 of file functions.lib.php.

Referenced by FormMail\get_form(), FormFile\getDocumentsLink(), FormFile\list_of_autoecmfiles(), FormFile\list_of_documents(), FormFile\showdocuments(), and FormFile\showPreview().

img_next (   $titlealt = 'default',
  $moreatt = '' 
)

Show next logo.

Parameters
string$titlealtText on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
string$moreattAdd more attribute on img tag (For example 'style="float: right"')
Returns
string Return img tag

Definition at line 3137 of file functions.lib.php.

img_object (   $titlealt,
  $picto,
  $moreatt = '',
  $pictoisfullpath = false,
  $srconly = 0,
  $notitle = 0 
)

Show a picto called object_picto (generic function)

Parameters
string$titlealtText on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
string$pictoName of image to show object_picto (example: user, group, action, bill, contract, propal, product, ...) For external modules use imagename to search into directory "img" of module.
string$moreattAdd more attribute on img tag (ie: class="datecallink")
int$pictoisfullpathIf 1, image path is a full path
int$srconlyReturn only content of the src attribute of img.
int$notitle1=Disable tag title. Use it if you add js tooltip, to avoid duplicate tooltip.
Returns
string Return img tag
See also
img_picto, img_picto_common

Definition at line 2851 of file functions.lib.php.

Referenced by Notify\confirmMessage(), dol_print_email(), dol_print_phone(), dol_print_skype(), User\getLoginUrl(), AccountingJournal\getNomUrl(), MyObject\getNomUrl(), WebsiteAccount\getNomUrl(), Inventory\getNomUrl(), Subscription\getNomUrl(), AdherentType\getNomUrl(), Opensurveysondage\getNomUrl(), EcmDirectory\getNomUrl(), Loan\getNomUrl(), ChargeSociales\getNomUrl(), Productlot\getNomUrl(), PaymentSalary\getNomUrl(), PaymentVarious\getNomUrl(), PaiementFourn\getNomUrl(), Entrepot\getNomUrl(), Task\getNomUrl(), CommandeFournisseur\getNomUrl(), Fichinter\getNomUrl(), Holiday\getNomUrl(), Don\getNomUrl(), Dolresource\getNomUrl(), Project\getNomUrl(), Contact\getNomUrl(), FactureRec\getNomUrl(), Facture\getNomUrl(), ActionComm\getNomUrl(), Account\getNomUrl(), Expedition\getNomUrl(), ExpenseReport\getNomUrl(), Adherent\getNomUrl(), Societe\getNomUrl(), Contrat\getNomUrl(), FactureFournisseur\getNomUrl(), User\getNomUrl(), AccountLine\getNomUrl(), SupplierProposal\getNomUrl(), Propal\getNomUrl(), Commande\getNomUrl(), Product\getNomUrl(), Interfaces\getTriggersList(), ModeleBoxes\getWidgetsList(), Export\list_export_model(), RemiseCheque\load_board(), ActionComm\load_board(), Account\load_board(), Project\load_board(), Adherent\load_board(), Task\load_board(), FactureFournisseur\load_board(), Contrat\load_board(), SupplierProposal\load_board(), ExpenseReport\load_board(), CommandeFournisseur\load_board(), Propal\load_board(), Commande\load_board(), Facture\load_board(), box_services_contracts\loadBox(), show_actions_done(), show_contacts(), show_list_sending_receive(), show_projects(), show_stats_for_company(), box_actions\showBox(), ModeleBoxes\showBox(), Form\showCategories(), mailing_mailinglist_mymodule_myobject\url(), mailing_pomme\url(), mailing_fraise\url(), mailing_thirdparties_services_expired\url(), mailing_thirdparties\url(), and mailing_contacts1\url().

img_pdf (   $titlealt = 'default',
  $size = 3 
)

Show pdf logo.

Parameters
string$titlealtText on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
int$sizeTaille de l'icone : 3 = 16x16px , 2 = 14x14px
Returns
string Retourne tag img

Definition at line 2941 of file functions.lib.php.

img_phone (   $titlealt = 'default',
  $option = 0 
)

Show phone logo.

Use img_picto instead.

Parameters
string$titlealtText on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
int$optionOption
Returns
string Return img tag
Deprecated:
See also
img_picto

Definition at line 3284 of file functions.lib.php.

img_picto (   $titlealt,
  $picto,
  $moreatt = '',
  $pictoisfullpath = false,
  $srconly = 0,
  $notitle = 0,
  $alt = '',
  $morecss = '' 
)

Show picto whatever it's its name (generic function)

Parameters
string$titlealtText on title tag for tooltip. Not used if param notitle is set to 1.
string$pictoName of image file to show ('filenew', ...) If no extension provided, we use '.png'. Image must be stored into theme/xxx/img directory. Example: picto.png if picto.png is stored into htdocs/theme/mytheme/img Example: picto.png if picto.png is stored into htdocs/mymodule/img Example: /mydir/mysubdir/picto.png if picto.png is stored into htdocs/mydir/mysubdir (pictoisfullpath must be set to 1)
string$moreattAdd more attribute on img tag (For example 'style="float: right"')
int$pictoisfullpathIf 1, image path is a full path
int$srconlyReturn only content of the src attribute of img.
int$notitle1=Disable tag title. Use it if you add js tooltip, to avoid duplicate tooltip.
string$altForce alt for bind peoplae
string$morecssAdd more class css on img tag (For example 'myclascss')
Returns
string Return img tag
See also
img_object, img_picto_common

Definition at line 2764 of file functions.lib.php.

Referenced by ajax_constantonoff(), ActionsCardCompany\assign_values(), FormMargin\displayMarginInfos(), dol_banner_tab(), dol_get_fiche_head(), dol_print_cron_urls(), dol_print_email(), dol_print_phone(), dol_print_skype(), dol_print_url(), ExpenseReport\fetch_line_by_project(), Facture\getNomUrl(), Interfaces\getTriggersList(), ModeleBoxes\getWidgetsList(), left_menu(), Don\LibStatut(), LignePrelevement\LibStatut(), ActionCommReminder\LibStatut(), Fiscalyear\LibStatut(), Establishment\LibStatut(), Deplacement\LibStatut(), EmailSenderProfile\LibStatut(), MyObject\LibStatut(), Inventory\LibStatut(), WebsiteAccount\LibStatut(), Loan\LibStatut(), ChargeSociales\LibStatut(), CommonInvoice\LibStatut(), WebsitePage\LibStatut(), CommandeFournisseurDispatch\LibStatut(), Cchargesociales\LibStatut(), PaymentVarious\LibStatut(), Entrepot\LibStatut(), ProductStockEntrepot\LibStatut(), Mailing\LibStatut(), AccountingAccount\LibStatut(), CommandeFournisseur\LibStatut(), ExpenseReport\LibStatut(), Opensurveysondage\LibStatut(), Fichinter\LibStatut(), Website\LibStatut(), Livraison\LibStatut(), Holiday\LibStatut(), Project\LibStatut(), MouvementStock\LibStatut(), RemiseCheque\LibStatut(), Account\LibStatut(), FactureRec\LibStatut(), ActionComm\LibStatut(), Contact\LibStatut(), Cronjob\LibStatut(), Expedition\LibStatut(), Adherent\LibStatut(), Task\LibStatut(), Contrat\LibStatut(), BonPrelevement\LibStatut(), Societe\LibStatut(), SupplierProposal\LibStatut(), User\LibStatut(), ContratLigne\LibStatut(), Propal\LibStatut(), Commande\LibStatut(), Product\LibStatut(), Mailing\libStatutDest(), FormFile\list_of_documents(), printing_printipp\listAvailablePrinters(), printing_printgcp\listAvailablePrinters(), FormFile\listOfLinks(), box_graph_invoices_permonth\loadBox(), box_graph_invoices_supplier_permonth\loadBox(), box_graph_orders_supplier_permonth\loadBox(), box_graph_orders_permonth\loadBox(), box_graph_propales_permonth\loadBox(), box_graph_product_distribution\loadBox(), box_services_contracts\loadBox(), Form\multiSelectArrayWithCheckbox(), Form\select_company(), Form\select_produits(), show_actions_done(), show_addresses(), show_elem(), Product\show_photos(), FormActions\showactions(), ModeleBoxes\showBox(), showDirectDownloadLink(), showPaypalPaymentUrl(), showStripePaymentUrl(), Form\textwithpicto(), and top_menu().

img_picto_common (   $titlealt,
  $picto,
  $moreatt = '',
  $pictoisfullpath = 0 
)

Show picto (generic function)

Parameters
string$titlealtText on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
string$pictoName of image file to show (If no extension provided, we use '.png'). Image must be stored into htdocs/theme/common directory.
string$moreattAdd more attribute on img tag
int$pictoisfullpathIf 1, image path is a full path
Returns
string Return img tag
See also
img_object, img_picto

Definition at line 2887 of file functions.lib.php.

Referenced by picto_from_langcode(), and tree_showpad().

img_previous (   $titlealt = 'default',
  $moreatt = '' 
)

Show previous logo.

Parameters
string$titlealtText on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
string$moreattAdd more attribute on img tag (For example 'style="float: right"')
Returns
string Return img tag

Definition at line 3154 of file functions.lib.php.

img_printer (   $titlealt = "default",
  $other = '' 
)

Show printer logo.

Parameters
string$titlealtText on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
string$otherAdd more attributes on img
Returns
string Retourne tag img

Definition at line 3040 of file functions.lib.php.

img_right (   $titlealt = 'default',
  $selected = 0,
  $moreatt = '' 
)

Show right arrow logo.

Parameters
string$titlealtText on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
int$selectedSelected
string$moreattAdd more attribute on img tag (For example 'style="float: right"')
Returns
string Return img tag

Definition at line 3223 of file functions.lib.php.

img_search (   $titlealt = 'default',
  $other = '' 
)

Show search logo.

Parameters
string$titlealtText on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
string$otherAdd more attributes on img
Returns
string Retourne tag img

Definition at line 3305 of file functions.lib.php.

img_searchclear (   $titlealt = 'default',
  $other = '' 
)

Show search logo.

Parameters
string$titlealtText on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
string$otherAdd more attributes on img
Returns
string Retourne tag img

Definition at line 3326 of file functions.lib.php.

img_split (   $titlealt = 'default',
  $other = 'class="pictosplit"' 
)

Show split logo.

Parameters
string$titlealtText on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
string$otherAdd more attributes on img
Returns
string Retourne tag img

Definition at line 3054 of file functions.lib.php.

img_up (   $titlealt = 'default',
  $selected = 0,
  $moreclass = '' 
)

Show top arrow logo.

Parameters
string$titlealtText on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
int$selectedSelected
string$moreclassAdd more CSS classes
Returns
string Return img tag

Definition at line 3189 of file functions.lib.php.

Referenced by FormFile\list_of_documents().

img_view (   $titlealt = 'default',
  $float = 0,
  $other = '' 
)

Show logo view card.

Parameters
string$titlealtText on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
integer$floatSi il faut y mettre le style "float: right"
string$otherAdd more attributes on img
Returns
string Return tag img

Definition at line 3006 of file functions.lib.php.

Referenced by FormFile\list_of_documents().

img_warning (   $titlealt = 'default',
  $moreatt = '' 
)
img_weather (   $titlealt,
  $picto,
  $moreatt = '',
  $pictoisfullpath = 0 
)

Show weather picto.

Parameters
string$titlealtText on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
string$pictoName of image file to show (If no extension provided, we use '.png'). Image must be stored into htdocs/theme/common directory.
string$moreattAdd more attribute on img tag
int$pictoisfullpathIf 1, image path is a full path
Returns
string Return img tag
See also
img_object, img_picto

Definition at line 2866 of file functions.lib.php.

info_admin (   $text,
  $infoonimgalt = 0,
  $nodiv = 0,
  $admin = '1' 
)

Show information for admin users or standard users.

Parameters
string$textText info
integer$infoonimgaltInfo is shown only on alt of star picto, otherwise it is show on output after the star picto
int$nodivNo div
string$admin'1'=Info for admin users. '0'=Info for standard users (change only the look), 'xxx'=Other
Returns
string String with info text

Definition at line 3349 of file functions.lib.php.

Referenced by ActionsContactCardCommon\assign_values(), ActionsAdherentCardCommon\assign_values(), ActionsCardCommon\assign_values(), FormFile\form_attach_new_file(), FormMail\get_form(), main_area(), FormCompany\select_civility(), Form\select_conditions_paiements(), FormActions\select_type_actions(), Form\select_type_fees(), FormSocialContrib\select_type_socialcontrib(), Form\select_types_paiements(), FormResource\select_types_resource(), Form\selectAvailabilityDelay(), Form\selectCurrency(), Form\selectInputReason(), and Form\selectShippingMethod().

isOnlyOneLocalTax (   $local)

Return true if LocalTax (1 or 2) is unique.

Example: If localtax1 is 5 on line with highest common vat rate, return true Example: If localtax1 is 5:8:15 on line with highest common vat rate, return false

Parameters
int$localLocal tax to test (1 or 2)
Returns
boolean True if LocalTax have multiple values, False if not

Definition at line 4331 of file functions.lib.php.

Referenced by getLocalTaxesFromRate().

isValidEmail (   $address,
  $acceptsupervisorkey = 0 
)

Return true if email syntax is ok.

Parameters
string$addressemail (Ex: "toto@examle.com", "John Do <johndo@example.com>")
int$acceptsupervisorkeyIf 1, the special string 'SUPERVISOREMAIL' is also accepted as valid
Returns
boolean true if email syntax is OK, false if KO or empty string

Definition at line 2438 of file functions.lib.php.

Referenced by dol_print_email(), dolObfuscateEmail(), and Notify\getNotificationsArray().

isValidPhone (   $phone)

Return true if phone number syntax is ok TODO Decide what to do with this.

Parameters
string$phonephone (Ex: "0601010101")
Returns
boolean true if phone syntax is OK, false if KO or empty string

Definition at line 2453 of file functions.lib.php.

isVisibleToUserType (   $type_user,
$menuentry,
$listofmodulesforexternal 
)

Function to test if an entry is enabled or not.

Parameters
string$type_user0=We test for internal user, 1=We test for external user
array$menuentryArray for feature entry to test
array$listofmodulesforexternalArray with list of modules allowed to external users
Returns
int 0=Hide, 1=Show, 2=Show gray

Definition at line 7030 of file functions.lib.php.

Referenced by box_produits\__construct(), box_produits_alerte_stock\__construct(), and print_eldy_menu().

load_fiche_titre (   $titre,
  $morehtmlright = '',
  $picto = 'title_generic.png',
  $pictoisfullpath = 0,
  $id = 0,
  $morecssontable = '',
  $morehtmlcenter = '' 
)

Load a title with picto.

Parameters
string$titreTitle to show
string$morehtmlrightAdded message to show on right
string$pictoIcon to use before title (should be a 32x32 transparent png file)
int$pictoisfullpath1=Icon name is a full absolute url of image
int$idTo force an id on html objects
string$morecssontableMore css on table
string$morehtmlcenterAdded message to show on center
Returns
string
See also
print_barre_liste

Definition at line 3691 of file functions.lib.php.

Referenced by ActionsCardCompany\assign_values(), ActionsCardIndividual\assign_values(), FormFile\form_attach_new_file(), Setup\getCheckIntegrity(), FormFile\list_of_autoecmfiles(), FormFile\list_of_documents(), FormFile\listOfLinks(), show_addresses(), show_contacts(), show_list_sending_receive(), show_projects(), show_subsidiaries(), FormActions\showactions(), FormFile\showdocuments(), and Form\showLinkedObjectBlock().

make_substitutions (   $text,
  $substitutionarray,
  $outputlangs = null 
)
natural_search (   $fields,
  $value,
  $mode = 0,
  $nofirstand = 0 
)

Generate natural SQL search string for a criteria (this criteria can be tested on one or several fields)

Parameters
string|string[]$fields String or array of strings, filled with the name of all fields in the SQL query we must check (combined with a OR). Example: array("p.field1","p.field2")
string$valueThe value to look for. If param $mode is 0, can contains several keywords separated with a space or | like "keyword1 keyword2" = We want record field like keyword1 AND field like keyword2 or like "keyword1|keyword2" = We want record field like keyword1 OR field like keyword2 If param $mode is 1, can contains an operator <, > or = like "<10" or ">=100.5 < 1000" If param $mode is 2, can contains a list of int id separated by comma like "1,3,4" If param $mode is 3, can contains a list of string separated by comma like "a,b,c"
integer$mode0=value is list of keyword strings, 1=value is a numeric test (Example ">5.5 <10"), 2=value is a list of id separated with comma (Example '1,3,4')
integer$nofirstand1=Do not output the first 'AND'
Returns
string $res The statement to append to the SQL query

Definition at line 6617 of file functions.lib.php.

References price2num().

Referenced by BlockedLog\getLog(), Task\getTasksArray(), FormProjets\select_projects_list(), and show_actions_done().

picto_from_langcode (   $codelang,
  $moreatt = '' 
)

Return img flag of country for a language code or country code.

Parameters
string$codelangLanguage code (en_IN, fr_CA...) or Country code (IN, FR)
string$moreattAdd more attribute on img tag (For example 'style="float: right"')
Returns
string HTML img string with flag.

Definition at line 6285 of file functions.lib.php.

References img_picto_common().

Referenced by ActionsContactCardCommon\assign_values(), ActionsAdherentCardCommon\assign_values(), ActionsCardCommon\assign_values(), User\getNomUrl(), and show_addresses().

picto_required ( )

Return picto saying a field is required.

Returns
string Chaine avec picto obligatoire

Definition at line 5003 of file functions.lib.php.

price (   $amount,
  $form = 0,
  $outlangs = '',
  $trunc = 1,
  $rounding = -1,
  $forcerounding = -1,
  $currency_code = '' 
)

Function to format a value into an amount for visual output Function used into PDF and HTML pages.

Parameters
float$amountAmount to format
integer$formType of format, HTML or not (not by default)
Translate$outlangsObject langs for output
int$trunc1=Truncate if there is more decimals than MAIN_MAX_DECIMALS_SHOWN (default), 0=Does not truncate. Deprecated because amount are rounded (to unit or total amount accurancy) before beeing inserted into database or after a computation, so this parameter should be useless.
int$roundingMinimum number of decimal to show. If 0, no change, if -1, we use min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOTAL)
int$forceroundingForce the number of decimal to forcerounding decimal (-1=do not force)
string$currency_codeTo add currency symbol (''=add nothing, 'auto'=Use default currency, 'XXX'=add currency symbols for XXX currency)
Returns
string Chaine avec montant formate
See also
price2num Revert function of price

Definition at line 3985 of file functions.lib.php.

Referenced by Product\_log_price(), RejetPrelevement\_send_email(), pdf_standard\_tableau_cheque(), pdf_canelle\_tableau_tot(), pdf_rouget\_tableau_tot(), pdf_muscadet\_tableau_tot(), pdf_aurore\_tableau_tot(), pdf_einstein\_tableau_tot(), pdf_azur\_tableau_tot(), pdf_crabe\_tableau_tot(), pdf_crabe\_tableau_versements(), pdf_canelle\_tableau_versements(), BordereauChequeBlochet\Body(), pdf_paiement\Body(), ExpenseReport\checkRules(), Form\constructProductListOption(), Productcustomerprice\create(), Product\create(), ProductFournisseur\display_price_product_fournisseur(), FormMargin\displayMarginInfos(), dol_print_reduction(), Form\editfieldval(), Form\editInPlace(), envoi_mail(), AccountancyExport\exportAgiris(), AccountancyExport\exportBob50(), AccountancyExport\exportCegid(), AccountancyExport\exportCoala(), AccountancyExport\exportCogilog(), AccountancyExport\exportConfigurable(), AccountancyExport\exportNormal(), Productcustomerprice\fetch(), MouvementStock\fetch(), FactureLigneRec\fetch(), Product\fetch(), SupplierProposalLine\fetch(), PropaleLigne\fetch(), OrderLine\fetch(), ExpenseReport\fetch_line_by_project(), CommonDocGenerator\fill_substitutionarray_with_extrafields(), Form\form_multicurrency_rate(), Form\form_remise_dispo(), CommonDocGenerator\get_substitutionarray_contact(), CommonDocGenerator\get_substitutionarray_lines(), CommonDocGenerator\get_substitutionarray_object(), doc_generic_task_odt\get_substitutionarray_project_reference(), doc_generic_project_odt\get_substitutionarray_project_reference(), CommonDocGenerator\get_substitutionarray_shipment(), CommonDocGenerator\get_substitutionarray_shipment_lines(), CommonDocGenerator\get_substitutionarray_thirdparty(), ProjectStats\getAllProjectByStatus(), CommandeFournisseur\getNomUrl(), Facture\getNomUrl(), ExpenseReport\getNomUrl(), Contrat\getNomUrl(), FactureFournisseur\getNomUrl(), SupplierProposal\getNomUrl(), Propal\getNomUrl(), Commande\getNomUrl(), BordereauChequeBlochet\Header(), Productcustomerprice\initAsSpecimen(), OrderLine\insert(), box_factures\loadBox(), box_factures_fourn_imp\loadBox(), box_supplier_orders\loadBox(), box_factures_fourn\loadBox(), box_commandes\loadBox(), box_propales\loadBox(), box_factures_imp\loadBox(), box_produits\loadBox(), box_activity\loadBox(), box_comptes\loadBox(), box_produits_alerte_stock\loadBox(), ActionsCardProduct\LoadListDatas(), pdf_getlinetotalexcltax(), pdf_getlinetotalwithtax(), pdf_getlineupexcltax(), pdf_getlineupwithtax(), pdf_pagefoot(), print_projecttasks_array(), pt(), FormOther\select_ecotaxes(), Form\select_product_fourn_price(), Form\select_produits_fournisseurs_list(), Form\select_remises(), Form\selectExpenseRanges(), BonPrelevement\set_infotrans(), show_projects(), ExtraFields\showInputField(), Form\showLinkToObjectBlock(), ExtraFields\showOutputField(), Productcustomerprice\update(), FactureLigneRec\update(), SupplierProposalLine\update(), PropaleLigne\update(), OrderLine\update(), Product\updatePrice(), pdf_paiement\write_file(), pdf_beluga\write_file(), pdf_rouget\write_file(), pdf_strato\write_file(), and pdf_standard\write_file().

price2num (   $amount,
  $rounding = '',
  $alreadysqlnb = 0 
)

Function that return a number with universal decimal format (decimal separator is '.

') from an amount typed by a user. Function to use on each input amount before any numeric test or database insert

Parameters
float$amountAmount to convert/clean
string$rounding''=No rounding 'MU'=Round to Max unit price (MAIN_MAX_DECIMALS_UNIT) 'MT'=Round to Max for totals with Tax (MAIN_MAX_DECIMALS_TOT) 'MS'=Round to Max for stock quantity (MAIN_MAX_DECIMALS_STOCK)
int$alreadysqlnbPut 1 if you know that content is already universal format number
Returns
string Amount with universal numeric format (Example: '99.99999') or unchanged text if conversion fails.
See also
price Opposite function of price2num

Definition at line 4072 of file functions.lib.php.

Referenced by MouvementStock\_create(), pdf_canelle\_tableau_tot(), pdf_muscadet\_tableau_tot(), pdf_einstein\_tableau_tot(), pdf_crabe\_tableau_tot(), SupplierProposal\addline(), Propal\addline(), FactureRec\addline(), Commande\addline(), Contrat\addline(), FactureFournisseur\addline(), CommandeFournisseur\addline(), ExpenseReport\addline(), Facture\addline(), Holiday\addLogCP(), Localtax\addPayment(), Tva\addPayment(), Invoices\addPayment(), Facturation\ajoutArticle(), CommandeFournisseur\approve(), calcul_price_total(), ChargeSociales\check(), PaymentExpenseReport\create(), Productcustomerprice\create(), PaymentSocialContribution\create(), LoanSchedule\create(), PaymentLoan\create(), PaymentDonation\create(), RejetPrelevement\create(), Loan\create(), PaiementFourn\create(), Project\create(), DiscountAbsolute\create(), Paiement\create(), ChargeSociales\create(), PaymentVarious\create(), PaymentSalary\create(), Product\create(), Account\create(), CurrencyRate\create(), SupplierProposal\createPriceFournisseur(), ProductCombination\createProductCombination(), BookKeeping\createStd(), Facture\demande_prelevement(), Form\editfieldval(), AccountancyExport\exportEbp(), Product\fetch(), Contrat\fetch_lines(), ProductFournisseur\fetch_product_fournisseur_price(), CommonDocGenerator\fill_substitutionarray_with_extrafields(), ProductFournisseur\find_min_price_product_fournisseur(), Invoices\get(), Thirdparties\get(), CommonDocGenerator\get_substitutionarray_lines(), CommonDocGenerator\get_substitutionarray_object(), ProjectStats\getAllProjectByStatus(), Fichinter\getAmount(), getMarginInfos(), ExtraFields\getOptionalsFromPost(), ImportCsv\import_insert(), ImportXlsx\import_insert(), ExpenseReportLine\insert(), SupplierProposalLine\insert(), ContratLigne\insert(), CommandeFournisseurLigne\insert(), PropaleLigne\insert(), ProductFournisseur\list_product_fournisseur_price(), FormProduct\loadWarehouses(), natural_search(), pdf_pagefoot(), print_projecttasks_array(), RemiseCheque\rejectCheck(), InterfaceActionsBlockedLog\runTrigger(), Form\select_produits_list(), BonPrelevement\set_infocredit(), Commande\set_remise(), Facture\set_remise(), SupplierProposal\set_remise_absolue(), Commande\set_remise_absolue(), Propal\set_remise_absolue(), Facture\set_remise_absolue(), Societe\set_remise_except(), SupplierProposal\set_remise_percent(), Propal\set_remise_percent(), ExtraFields\setOptionalsFromPost(), CoreObject\setValues(), showMyBalance(), Deplacement\update(), Project\update(), Don\update(), Productcustomerprice\update(), Account\update(), Product\update(), Societe\update(), CurrencyRate\update(), BookKeeping\update(), ExpeditionLigne\update(), ExpenseReportLine\update(), SupplierInvoiceLine\update(), ContratLigne\update(), ProductFournisseur\update_buyprice(), CommandeFournisseur\updateFromCommandeClient(), SupplierProposal\updateline(), Propal\updateline(), FactureRec\updateline(), FactureFournisseur\updateline(), Contrat\updateline(), ExpenseReport\updateline(), CommandeFournisseur\updateline(), Facture\updateline(), Commande\updateline(), Product\updatePrice(), SupplierProposal\updatePriceFournisseur(), Holiday\updateSoldeCP(), and FactureFournisseur\validate().

print_barre_liste (   $titre,
  $page,
  $file,
  $options = '',
  $sortfield = '',
  $sortorder = '',
  $morehtmlcenter = '',
  $num = -1,
  $totalnboflines = '',
  $picto = 'title_generic.png',
  $pictoisfullpath = 0,
  $morehtmlright = '',
  $morecss = '',
  $limit = -1,
  $hideselectlimit = 0,
  $hidenavigation = 0 
)

Print a title with navigation controls for pagination.

Parameters
string$titreTitle to show (required)
int$pageNumero of page to show in navigation links (required)
string$fileUrl of page (required)
string$optionsMore parameters for links ('' by default, does not include sortfield neither sortorder). Value must be 'urlencoded' before calling function.
string$sortfieldField to sort on ('' by default)
string$sortorderOrder to sort ('' by default)
string$morehtmlcenterString in the middle ('' by default). We often find here string $massaction comming from $form->selectMassAction()
int$numNumber of records found by select with limit+1
int | string$totalnboflinesTotal number of records/lines for all pages (if known). Use a negative value of number to not show number. Use '' if unknown.
string$pictoIcon to use before title (should be a 32x32 transparent png file)
int$pictoisfullpath1=Icon name is a full absolute url of image
string$morehtmlrightMore html to show
string$morecssMore css to the table
int$limitMax number of lines (-1 = use default, 0 = no limit, > 0 = limit).
int$hideselectlimitForce to hide select limit
int$hidenavigationForce to hide all navigation tools
Returns
void

Definition at line 3740 of file functions.lib.php.

print_date_range (   $date_start,
  $date_end,
  $format = '',
  $outputlangs = '' 
)

Format output for start and end date.

Parameters
int$date_startStart date
int$date_endEnd date
string$formatOutput format
Translate$outputlangsOutput language
Returns
void

Definition at line 5747 of file functions.lib.php.

References get_date_range(), and print.

Referenced by show_list_sending_receive().

print_fiche_titre (   $title,
  $mesg = '',
  $picto = 'title_generic.png',
  $pictoisfullpath = 0,
  $id = '' 
)

Show a title with picto.

Parameters
string$titleTitle to show
string$mesgAdded message to show on right
string$pictoIcon to use before title (should be a 32x32 transparent png file)
int$pictoisfullpath1=Icon name is a full absolute url of image
int$idTo force an id on html objects
Returns
void
Deprecated:
Use print load_fiche_titre instead

Definition at line 3673 of file functions.lib.php.

print_fleche_navigation (   $page,
  $file,
  $options = '',
  $nextpage = 0,
  $betweenarrows = '',
  $afterarrows = '',
  $limit = -1,
  $totalnboflines = 0,
  $hideselectlimit = 0 
)

Function to show navigation arrows into lists.

Parameters
int$pageNumber of page
string$filePage URL (in most cases provided with $_SERVER["PHP_SELF"])
string$optionsOther url paramaters to propagate ("" by default, may include sortfield and sortorder)
integer$nextpageDo we show a next page button
string$betweenarrowsHTML content to show between arrows. MUST contains ' ' tags or ' '.
string$afterarrowsHTML content to show after arrows. Must NOT contains ' ' tags.
int$limitMax nb of record to show (-1 = no combo with limit, 0 = no limit, > 0 = limit)
int$totalnboflinesTotal number of records/lines for all pages (if known)
int$hideselectlimitForce to hide select limit
Returns
void

Definition at line 3852 of file functions.lib.php.

print_liste_field_titre (   $name,
  $file = "",
  $field = "",
  $begin = "",
  $moreparam = "",
  $moreattrib = "",
  $sortfield = "",
  $sortorder = "",
  $prefix = "",
  $tooltip = "" 
)

Show title line of an array.

Parameters
string$nameLabel of field
string$fileUrl used when we click on sort picto
string$fieldField to use for new sorting
string$begin("" by defaut)
string$moreparamAdd more parameters on sort url links ("" by default)
string$moreattribOptions of attribute td ("" by defaut, example: 'align="center"')
string$sortfieldCurrent field used to sort
string$sortorderCurrent sort order
string$prefixPrefix for css. Use space after prefix to add your own CSS tag.
string$tooltipTooltip
Returns
void

Definition at line 3535 of file functions.lib.php.

Referenced by FormFile\list_of_autoecmfiles(), FormFile\list_of_documents(), FormFile\listOfLinks(), print_projecttasks_array(), and show_contacts().

print_titre (   $title)

Show a title.

Parameters
string$titleTitle to show
Returns
string Title to show
Deprecated:
Use load_fiche_titre instead
See also
load_fiche_titre

Definition at line 3655 of file functions.lib.php.

printCommonFooter (   $zone = 'private')

Print common footer : conf->global->MAIN_HTML_FOOTER js for switch of menu hider js for conf->global->MAIN_GOOGLE_AN_ID js for conf->global->MAIN_SHOW_TUNING_INFO or $_SERVER["MAIN_SHOW_TUNING_INFO"] js for conf->logbuffer.

Parameters
string$zone'private' (for private pages) or 'public' (for public pages)
Returns
void

Definition at line 6438 of file functions.lib.php.

References if, and print.

Referenced by llxFooterSurvey(), and llxFooterVierge().

setEventMessage (   $mesgs,
  $style = 'mesgs' 
)

Set event message in dol_events session object.

Will be output by calling dol_htmloutput_events. Note: Calling dol_htmloutput_events is done into pages by standard llxFooter() function. Note: Prefer to use setEventMessages instead.

Parameters
mixed$mesgsMessage string or array
string$styleWhich style to use ('mesgs' by default, 'warnings', 'errors')
Returns
void
See also
dol_htmloutput_events

Definition at line 5831 of file functions.lib.php.

Referenced by activateModulesRequiredByCountry(), dolprintIPP\list_jobs(), and setEventMessages().

setEventMessages (   $mesg,
  $mesgs,
  $style = 'mesgs' 
)

Set event messages in dol_events session object.

Will be output by calling dol_htmloutput_events. Note: Calling dol_htmloutput_events is done into pages by standard llxFooter() function.

Parameters
string$mesgMessage string
array$mesgsMessage array
string$styleWhich style to use ('mesgs' by default, 'warnings', 'errors')
Returns
void
See also
dol_htmloutput_events

Definition at line 5857 of file functions.lib.php.

References dol_print_error(), and setEventMessage().

Referenced by completeFileArrayWithDatabaseInfo(), Website\createFromClone(), dol_add_file_process(), dol_delete_file(), dol_move(), dol_remove_file_process(), dolSaveCssFile(), dolSaveHtaccessFile(), dolSaveHtmlHeader(), dolSaveJsFile(), dolSaveRobotFile(), Website\exportWebSite(), FormMail\get_form(), getAllImages(), InterfaceActionsBlockedLog\runTrigger(), dolReceiptPrinter\SendTestToPrinter(), dolReceiptPrinter\SendToPrinter(), ExtraFields\setOptionalsFromPost(), Link\update(), and pdf_azur\write_file().

showDimensionInBestUnit (   $dimension,
  $unit,
  $type,
  $outputlangs,
  $round = -1,
  $forceunitoutput = 'no' 
)

Output a dimension with best unit.

Parameters
float$dimensionDimension
int$unitUnit of dimension (0, -3, ...)
string$type'weight', 'volume', ...
Translate$outputlangsTranslate language object
int$round-1 = non rounding, x = number of decimal
string$forceunitoutput'no' or numeric (-3, -6, ...) compared to $unit
Returns
string String to show dimensions

Definition at line 4158 of file functions.lib.php.

Referenced by pdf_rouget\_tableau_tot().

showDirectDownloadLink (   $object)

Return string with full Url.

Parameters
Object$objectObject
Returns
string Url string

Definition at line 6754 of file functions.lib.php.

References ajax_autoselect(), and img_picto().

utf8_check (   $str)

Check if a string is in UTF8.

Parameters
string$strString to check
Returns
boolean True if string is UTF8 or ISO compatible with UTF8, False if not (ISO with special char or Binary)

Definition at line 6115 of file functions.lib.php.

References dol_strlen().

Referenced by CMailFile\check_server_port(), dol_delete_dir_recursive(), dol_dir_list(), dol_print_file(), dol_string_unaccent(), ImportCsv\import_read_record(), Product\is_photo_available(), Product\liste_photos(), box_external_rss\loadBox(), and show_elem().

vatrate (   $rate,
  $addpercent = false,
  $info_bits = 0,
  $usestarfornpr = 0 
)

Return a string with VAT rate label formated for view output Used into pdf and HTML pages.

Parameters
string$rateRate value to format ('19.6', '19,6', '19.6', '19,6', '19.6 (CODEX)', ...)
boolean$addpercentAdd a percent % sign in output
int$info_bitsMiscellaneous information on vat (0=Default, 1=French NPR vat)
int$usestarfornpr-1=Never show, 0 or 1=Use '*' for NPR vat rates
Returns
string String with formated amounts ('19,6' or '19,6' or '8.5% (NPR)' or '8.5% *' or '19,6 (CODEX)')

Definition at line 3937 of file functions.lib.php.

Referenced by pdf_canelle\_tableau_tot(), pdf_muscadet\_tableau_tot(), pdf_aurore\_tableau_tot(), pdf_einstein\_tableau_tot(), pdf_azur\_tableau_tot(), pdf_crabe\_tableau_tot(), Form\constructProductListOption(), ExpenseReportLine\fetch(), CommonDocGenerator\get_substitutionarray_lines(), CommonDocGenerator\get_substitutionarray_object(), CommonDocGenerator\get_substitutionarray_shipment_lines(), ExpenseReportLine\insert(), Form\load_tva(), pdf_getlinevatrate(), Form\select_produits_fournisseurs_list(), and ExpenseReportLine\update().

verifCond (   $strRights)

Verify if condition in string is ok or not.

Parameters
string$strRightsString with condition to check
Returns
boolean True or False. Return true if strRights is ''

Definition at line 6212 of file functions.lib.php.

References dol_eval().

Referenced by complete_head_from_modules(), ActionsCardService\getFieldList(), ActionsCardProduct\getFieldList(), Export\load_arrays(), and Menubase\menuLoad().

yn (   $yesno,
  $case = 1,
  $color = 0 
)

Return yes or no in current language.

Parameters
string$yesnoValue to test (1, 'yes', 'true' or 0, 'no', 'false')
integer$case1=Yes/No, 0=yes/no, 2=Disabled checkbox, 3=Disabled checkbox + Yes/No
int$color0=texte only, 1=Text is formated with a color font style ('ok' or 'error'), 2=Text is formated with 'ok' color.
Returns
string HTML string

Definition at line 4848 of file functions.lib.php.

Referenced by ActionsCardCommon\assign_values(), FormMail\get_form(), User\getNomUrl(), AccountLine\getNomUrl(), ModeleNumRefBarCode\getToolTip(), ModeleProductCode\getToolTip(), ModeleThirdPartyCode\getToolTip(), Adherent\makeSubstitution(), and show_theme().