dolibarr  13.0.2
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

 getDoliDBInstance ($type, $host, $user, $pass, $name, $port)
 Return a DoliDB instance (database handler). More...
 
 getEntity ($element, $shared=1, $currentobject=null)
 Get list of entity id to use. More...
 
 setEntity ($currentobject)
 Set entity id to use when to create an object. More...
 
 isASecretKey ($keyname)
 Return if string has a name dedicated to store a secret. 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 the parameter $paramname. More...
 
 GETPOST ($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
 Return value of a param into GET or POST supervariable. More...
 
 GETPOSTINT ($paramname, $method=0, $filter=null, $options=null, $noreplace=0)
 Return value of a param into GET or POST supervariable. More...
 
 checkVal ($out= '', $check= 'alphanohtml', $filter=null, $options=null)
 Return a value after checking on a rule. More...
 
if(!function_exists('dol_getprefix')) dol_include_once ($relpath, $classname= '')
 Make an include_once using default root and alternate root if it fails. 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 (full isolation 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...
 
 dol_string_nounprintableascii ($str, $removetabcrlf=1)
 Clean a string from all non printable ASCII chars (0x00-0x1F and 0x7F). More...
 
 dol_escape_js ($stringtoescape, $mode=0, $noescapebackslashn=0)
 Returns text escaped for inclusion into javascript code. More...
 
 dol_escape_json ($stringtoescape)
 Returns text escaped for inclusion into javascript code. More...
 
 dol_escape_htmltag ($stringtoescape, $keepb=0, $keepn=0, $keepmoretags= '', $escapeonlyhtmltags=0)
 Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields. More...
 
 dol_strtolower ($string, $encoding="UTF-8")
 Convert a string to lower. More...
 
 dol_strtoupper ($string, $encoding="UTF-8")
 Convert a string to upper. More...
 
 dol_ucfirst ($string, $encoding="UTF-8")
 Convert first character of the first word of a string to upper. More...
 
 dol_ucwords ($string, $encoding="UTF-8")
 Convert first character of all the words of a string to upper. More...
 
 dol_syslog ($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
 Write log message into outputs. More...
 
 dolButtonToOpenUrlInDialogPopup ($name, $label, $buttonstring, $url, $disabled= '')
 Return HTML code to output a button to open a dialog popup box. More...
 
 dol_fiche_head ($links=array(), $active= '0', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
 Show tab header of a card. More...
 
 dol_get_fiche_head ($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
 Show tabs of a record. 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, $extralangcode= '')
 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= 'auto', $outputlangs= '', $encodetooutput=false)
 Output date in a string format according to outputlangs (or langs if not defined). More...
 
 dol_getdate ($timestamp, $fast=false, $forcetimezone= '')
 Return an array with locale date info. More...
 
 dol_mktime ($hour, $minute, $second, $month, $day, $year, $gm= 'auto', $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= 'auto')
 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 formatted for HTML output. More...
 
 getArrayOfSocialNetworks ()
 Get array of social network dictionary. More...
 
 dol_print_socialnetworks ($value, $cid, $socid, $type, $dictsocialnetworks=array())
 Show social network 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...
 
 getUserRemoteIP ()
 Return the IP of remote user. More...
 
 isHTTPS ()
 Return if we are using a HTTPS connexion Check HTTPS (no way to be modified by user but may be empty or wrong if user is using a proxy) Take HTTP_X_FORWARDED_PROTO (defined when using proxy) Then HTTP_X_FORWARDED_SSL. 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, $element, $id, $noprint=0, $charfornl= '')
 Format address string. More...
 
 isValidEmail ($address, $acceptsupervisorkey=0)
 Return true if email syntax is ok. More...
 
 isValidMXRecord ($domain)
 Return if the domain name has a valid MX record. 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= '', $trunconbytes=0)
 Make a substring. 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= '', $marginleftonlyshort=2)
 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, $morecss= '')
 Show weather picto. More...
 
 img_picto_common ($titlealt, $picto, $moreatt= '', $pictoisfullpath=0)
 Show picto (generic function) More...
 
 img_action ($titlealt, $numaction, $picto= '')
 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= '')
 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"', $morecss= '')
 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= '', $morecss= 'pictowarning')
 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_credit_card ($brand, $morecss=null)
 Return image of a credit card according to its brand name. More...
 
 img_mime ($file, $titlealt= '', $morecss= '')
 Show MIME img of a file. 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', $morecss= '', $textfordropdown= '')
 Show information for admin users or standard users. More...
 
 dol_print_error ($db= '', $error= '', $errors=null)
 Displays error message system with all the information to facilitate the diagnosis and the escalation of the bugs. More...
 
 dol_print_error_email ($prefixcode, $errormessage= '', $errormessages=array(), $morecss= 'error', $email= '')
 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="", $forcenowrapcolumntitle=0)
 Show title line of an array. More...
 
 getTitleFieldOfList ($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip= '', $forcenowrapcolumntitle=0)
 Get title line of an array. More...
 
 print_titre ($title)
 Show a title. More...
 
 print_fiche_titre ($title, $mesg= '', $picto= 'generic', $pictoisfullpath=0, $id= '')
 Show a title with picto. More...
 
 load_fiche_titre ($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
 Load a title with picto. More...
 
 print_barre_liste ($titre, $page, $file, $options= '', $sortfield= '', $sortorder= '', $morehtmlcenter= '', $num=-1, $totalnboflines= '', $picto= 'generic', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow= '')
 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, $beforearrows= '')
 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= '', $option=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 tax (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', $strip_tags=0, $removedoublespaces=1)
 Clean a string from all HTML tags and entities. More...
 
 dol_string_onlythesehtmltags ($stringtoclean, $cleanalsosomestyles=1, $removeclassattribute=1, $cleanalsojavascript=0)
 Clean a string to keep only desirable HTML tags. More...
 
 dol_string_neverthesehtmltags ($stringtoclean, $disallowed_tags=array('textarea'), $cleanalsosomestyles=0)
 Clean a string from some undesirable HTML tags. More...
 
 dolGetFirstLineOfText ($text, $nboflines=1, $charset= 'UTF-8')
 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', $keepsomeentities=0)
 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, $clean=0)
 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_textishtml ($msg, $option=0)
 Return if a text is a html content. More...
 
 dol_concatdesc ($text1, $text2, $forxml=false, $invert=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 substitution into a text string, replacing keys with vals from $substitutionarray (oldval=>newval), and texts like __(TranslationKey|langfile)__ and __[ConstantKey]__ are also replaced. 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', $messagekey= '')
 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=array(), $keepembedded=0)
 Get formated error messages to output (Used to show messages on html output). More...
 
 dol_htmloutput_mesg ($mesgstring= '', $mesgarray=array(), $style= 'ok', $keepembedded=0)
 Print formated messages to output (Used to show messages on html output). More...
 
 dol_htmloutput_errors ($mesgstring= '', $mesgarray=array(), $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...
 
 ascii_check ($str)
 Check if a string is in ASCII. 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...
 
 getLanguageCodeFromCountryCode ($countrycode)
 Return default language from 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...
 
 ajax_autoselect ($htmlname, $addlink= '')
 Make content of an input box selected when we click into input field. More...
 
 dolIsAllowedForPreview ($file)
 Return if a file is qualified for preview. 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...
 
 roundUpToNextMultiple ($n, $x=5)
 Round to next multiple. More...
 
 dolGetBadge ($label, $html= '', $type= 'primary', $mode= '', $url= '', $params=array())
 Function dolGetBadge. More...
 
 dolGetStatus ($statusLabel= '', $statusLabelShort= '', $html= '', $statusType= 'status0', $displayMode=0, $url= '', $params=array())
 Output the badge of a status. More...
 
 dolGetButtonAction ($label, $html= '', $actionType= 'default', $url= '', $id= '', $userRight=1, $params=array())
 Function dolGetButtonAction. More...
 
 dolGetButtonTitle ($label, $helpText= '', $iconClass= 'fa fa-file', $url= '', $id= '', $status=1, $params=array())
 Function dolGetButtonTitle : this kind of buttons are used in title in list. More...
 
 getElementProperties ($element_type)
 Get an array with properties of an element. More...
 
 fetchObjectByElement ($element_id, $element_type, $element_ref= '')
 Fetch an object from its id and element_type Inclusion of classes is automatic. More...
 
 isAFileWithExecutableContent ($filename)
 Return if a file can contains executable content. More...
 
 newToken ()
 Return the value of token currently saved into session with name 'newtoken'. More...
 
 currentToken ()
 Return the value of token currently saved into session with name 'token'. More...
 
 startSimpleTable ($header, $link="", $arguments="", $emptyRows=0, $number=-1)
 Start a table with headers and a optinal clickable number (don't forget to use "finishSimpleTable()" after the last table row) More...
 
 finishSimpleTable ($addLineBreak=false)
 Add the correct HTML close tags for "startSimpleTable(...)" (use after the last table line) More...
 
 addSummaryTableLine ($tableColumnCount, $num, $nbofloop=0, $total=0, $noneWord="None", $extraRightColumn=false)
 Add a summary line to the current open table ("None", "XMoreLines" or "Total xxx") More...
 
 readfileLowMemory ($fullpath_original_file_osencoded, $method=-1)
 Return a file on output using a low memory. More...
 

Detailed Description

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

Definition in file functions.lib.php.

Function Documentation

addSummaryTableLine (   $tableColumnCount,
  $num,
  $nbofloop = 0,
  $total = 0,
  $noneWord = "None",
  $extraRightColumn = false 
)

Add a summary line to the current open table ("None", "XMoreLines" or "Total xxx")

Parameters
integer$tableColumnCountThe complete count columns of the table
integer$numThe count of the rows of the table, when it is zero (0) the "$noneWord" is shown instead
integer$nbofloop(optional) The maximum count of rows thaht the table show (when it is zero (0) no summary line will show, expect "$noneWord" when $num === 0)
integer$total(optional) The total value thaht is shown after when the table has minimum of one entire
string$noneWord(optional) The word that is shown when the table has no entires ($num === 0)
boolean$extraRightColumn(optional) Add a addtional column after the summary word and total number
Returns
void

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

ajax_autoselect (   $htmlname,
  $addlink = '' 
)

Make content of an input box selected when we click into input field.

Parameters
string$htmlnameId of html object ('#idvalue' or '.classvalue')
string$addlinkAdd a 'link to' after
Returns
string

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

Referenced by FormFile\list_of_documents(), print_barre_liste(), showDirectDownloadLink(), and showDirectPublicLink().

ascii_check (   $str)

Check if a string is in ASCII.

Parameters
string$strString to check
Returns
boolean True if string is ASCII, False if not (byte value > 0x7F)

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

checkVal (   $out = '',
  $check = 'alphanohtml',
  $filter = null,
  $options = null 
)

Return a value after checking on a rule.

Parameters
string$outValue to get/check
string$checkType of check
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'
Returns
string|array Value found (string or array), or '' if check fails

Return a prefix to use for this Dolibarr instance, for session/cookie names or email id. The prefix is unique for instance and avoid conflict between multi-instances, even when having two instances with same root dir or two instances in same virtual servers.

Parameters
string$mode'' (prefix for session name) or 'email' (prefix for email id)
Returns
string A calculated prefix

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

References dol_string_nohtmltag(), and dol_string_onlythesehtmltags().

Referenced by GETPOST().

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 8473 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 7669 of file functions.lib.php.

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

Referenced by account_statement_prepare_head(), accounting_prepare_head(), actions_prepare_head(), agenda_prepare_head(), asset_admin_prepare_head(), asset_prepare_head(), asset_type_prepare_head(), bank_admin_prepare_head(), bank_prepare_head(), blockedlogadmin_prepare_head(), bomAdminPrepareHead(), bomPrepareHead(), calendars_prepare_head(), categories_prepare_head(), categoriesadmin_prepare_head(), commande_prepare_head(), company_admin_prepare_head(), contact_prepare_head(), contract_admin_prepare_head(), contract_prepare_head(), cron_prepare_head(), cronadmin_prepare_head(), datapolicyAdminPrepareHead(), dav_admin_prepare_head(), defaultvalues_prepare_head(), delivery_prepare_head(), donation_admin_prepare_head(), donation_prepare_head(), ecm_admin_prepare_head(), ecm_prepare_dasboard_head(), email_admin_prepare_head(), emailcollectorPrepareHead(), 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(), fichinter_rec_prepare_head(), fiscalyear_prepare_head(), group_prepare_head(), holiday_admin_prepare_head(), holiday_prepare_head(), hrm_admin_prepare_head(), intracommReportAdminPrepareHead(), intracommReportPrepareHead(), inventoryAdminPrepareHead(), invoice_admin_prepare_head(), invoice_rec_prepare_head(), ldap_prepare_head(), loan_prepare_head(), marges_admin_prepare_head(), marges_prepare_head(), member_admin_prepare_head(), member_prepare_head(), member_stats_prepare_head(), member_type_prepare_head(), modulehelp_prepare_head(), moPrepareHead(), mrpAdminPrepareHead(), 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(), reception_admin_prepare_head(), reception_prepare_head(), recruitmentAdminPrepareHead(), recruitmentCandidaturePrepareHead(), recruitmentjobpositionPrepareHead(), resource_admin_prepare_head(), resource_prepare_head(), shipping_prepare_head(), societe_admin_prepare_head(), societe_prepare_head(), stock_admin_prepare_head(), stock_prepare_head(), stripeadmin_prepare_head(), subscription_prepare_head(), supplierorder_admin_prepare_head(), takepos_admin_prepare_head(), task_prepare_head(), tax_prepare_head(), ticket_prepare_head(), ticketAdminPrepareHead(), translation_prepare_head(), trip_prepare_head(), user_admin_prepare_head(), user_prepare_head(), various_payment_prepare_head(), vat_prepare_head(), websiteaccountPrepareHead(), and zapierAdminPrepareHead().

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 6747 of file functions.lib.php.

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

Referenced by BordereauChequeBlochet\_pagefoot(), complete_head_from_modules(), Facture\create(), Adherent\makeSubstitution(), pdf_pagefoot(), pdf_watermark(), ActionComm\sendEmailsReminder(), Adherent\sendReminderForExpiredSubscription(), pdf_baleine\write_file(), pdf_timespent\write_file(), pdf_beluga\write_file(), pdf_soleil\write_file(), pdf_cornas\write_file(), doc_generic_odt\write_file(), pdf_stdandard\write_file(), doc_generic_ticket_odt\write_file(), doc_generic_contract_odt\write_file(), doc_generic_member_odt\write_file(), pdf_standard_myobject\write_file(), doc_generic_bom_odt\write_file(), pdf_cyan\write_file(), doc_generic_reception_odt\write_file(), pdf_eratosthene\write_file(), pdf_canelle\write_file(), doc_generic_mo_odt\write_file(), doc_generic_supplier_order_odt\write_file(), doc_generic_recruitmentjobposition_odt\write_file(), doc_generic_myobject_odt\write_file(), doc_generic_stock_odt\write_file(), pdf_standard_recruitmentjobposition\write_file(), pdf_sponge\write_file(), doc_generic_invoice_odt\write_file(), pdf_aurore\write_file(), doc_generic_shipment_odt\write_file(), doc_generic_order_odt\write_file(), pdf_standard\write_file(), pdf_einstein\write_file(), pdf_azur\write_file(), doc_generic_product_odt\write_file(), doc_generic_usergroup_odt\write_file(), doc_generic_user_odt\write_file(), pdf_crabe\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().

currentToken ( )

Return the value of token currently saved into session with name 'token'.

Returns
string

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

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 1577 of file functions.lib.php.

References ajax_object_onoff(), dol_convert_file(), dol_sanitizeFileName(), get_exdir(), if, 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 1868 of file functions.lib.php.

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

Return path of url or filesystem.

Can check into alternate dir or alternate dir + main dir depending on value of $returnemptyifnotfound.

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) or '' if file not found, Full url path (if mode=1)

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

Referenced by ajouter_sondage(), bomAdminPrepareHead(), checkLoginPassEntity(), complete_head_from_modules(), complete_substitutions_array(), Project\createFromClone(), cron_prepare_head(), cronadmin_prepare_head(), FormMargin\displayMarginInfos(), doc_label_pdf_create(), EmailCollector\doCollectOneCollector(), dol_include_once(), dol_print_address(), emailcollectorPrepareHead(), fichinter_create(), Utils\generateDoc(), Don\generateDocument(), DolibarrCollector\getAssets(), Canvas\getCanvas(), DolibarrModules\getChangeLog(), Ticket\getDefaultRef(), DolibarrModules\getDescLong(), DolibarrModules\getDescLongReadmeFound(), Translate\getLabelFromNumber(), Reception\getNextNumRef(), Holiday\getNextNumRef(), Expedition\getNextNumRef(), Contrat\getNextNumRef(), Commande\getNextNumRef(), RemiseCheque\getNextNumRef(), BOM\getNextNumRef(), PaiementFourn\getNextNumRef(), Mo\getNextNumRef(), Fichinter\getNextNumRef(), CommandeFournisseur\getNextNumRef(), RecruitmentCandidature\getNextNumRef(), MyObject\getNextNumRef(), RecruitmentJobPosition\getNextNumRef(), Paiement\getNextNumRef(), ExpenseReport\getNextNumRef(), FactureFournisseur\getNextNumRef(), SupplierProposal\getNextNumRef(), Propal\getNextNumRef(), Facture\getNextNumRef(), Asset\getNomUrl(), EmailCollectorFilter\getNomUrl(), EmailCollectorAction\getNomUrl(), CompanyPaymentMode\getNomUrl(), SocieteAccount\getNomUrl(), EmailCollector\getNomUrl(), Inventory\getNomUrl(), Hook\getNomUrl(), RecruitmentCandidature\getNomUrl(), MyObject\getNomUrl(), RecruitmentJobPosition\getNomUrl(), BOM\getNomUrl(), Mo\getNomUrl(), ProductFournisseur\getNomUrl(), Project\getNomUrl(), Ticket\getNomUrl(), BOMLine\getNomUrl(), Interfaces\getTriggersList(), ModeleBoxes\getWidgetsList(), inventoryPrepareHead(), PrintingDriver\listDrivers(), llxHeaderTicket(), ActionsMyModule\loadDataForCustomReports(), members_card_pdf_create(), moPrepareHead(), mrpAdminPrepareHead(), multicurrencyAdminPrepareHead(), mymoduleAdminPrepareHead(), myobjectPrepareHead(), Ticket\newMessage(), oauthadmin_prepare_head(), print_auguria_menu(), print_eldy_menu(), print_left_auguria_menu(), print_left_eldy_menu(), recruitmentAdminPrepareHead(), recruitmentCandidaturePrepareHead(), recruitmentjobpositionPrepareHead(), resource_prepare_head(), Interfaces\run_triggers(), InterfaceTicketEmail\runTrigger(), FormCompany\selectCompaniesForNewContact(), Ticket\sendLogByEmail(), DataPolicy\sendMailDataPolicyAdherent(), DataPolicy\sendMailDataPolicyCompany(), DataPolicy\sendMailDataPolicyContact(), Conf\setValues(), show_skin(), show_ticket_messaging(), showDirectPublicLink(), FormFile\showdocuments(), FormTicket\showForm(), MenuManager\showmenu(), showSkins(), ticket_prepare_head(), top_htmlhead(), websiteaccountPrepareHead(), and zapierAdminPrepareHead().

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 (full isolation clone).

This means $this->db of new object is not valid. With native = 1: Use PHP clone. Property that are reference are same pointer. This means $this->db of new object is still valid but point to same this->db than original object.

Parameters
object$objectObject to clone
int$native0=Full isolation method, 1=Native PHP method
Returns
object Clone object
See Also
https://php.net/manual/language.oop5.cloning.php

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

Referenced by MouvementStock\_createSubProduct(), Ticket\assignUser(), Products\put(), InterfaceContactRoles\runTrigger(), and InterfaceZapierTriggers\runTrigger().

dol_concatdesc (   $text1,
  $text2,
  $forxml = false,
  $invert = 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$forxmltrue=Use
instead of
if we have to add a br tag
bool$invertinvert order of description lines (we often use config MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION in this parameter)
Returns
string Text 1 + new line + Text2
See Also
dol_textishtml()

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

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

Referenced by RecruitmentJobPosition\cloture(), Propal\cloture(), CommandeFournisseur\commande(), constructGanttLine(), Facture\create(), Ticket\createTicketMessage(), doc_getlinedesc(), EmailCollector\doCollectOneCollector(), Thirdparties\merge(), InterfaceActionsAuto\runTrigger(), DataPolicy\sendMailDataPolicyAdherent(), DataPolicy\sendMailDataPolicyCompany(), DataPolicy\sendMailDataPolicyContact(), Adherent\sendReminderForExpiredSubscription(), pdf_espadon\write_file(), pdf_soleil\write_file(), pdf_storm\write_file(), pdf_strato\write_file(), pdf_cornas\write_file(), pdf_standard_myobject\write_file(), pdf_cyan\write_file(), pdf_eratosthene\write_file(), pdf_sponge\write_file(), pdf_standard_recruitmentjobposition\write_file(), pdf_aurore\write_file(), pdf_standard\write_file(), pdf_einstein\write_file(), pdf_azur\write_file(), and pdf_crabe\write_file().

dol_escape_htmltag (   $stringtoescape,
  $keepb = 0,
  $keepn = 0,
  $keepmoretags = '',
  $escapeonlyhtmltags = 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=Keep b tags and escape them, 0=remove them
int$keepn1=Preserve
strings (otherwise, replace them with escaped value). Set to 1 when escaping for a <textarea>.
string$keepmoretags'' or 'common' or list of tags
int$escapeonlyhtmltags1=Escape only html tags, not the special chars like accents.
Returns
string Escaped string
See Also
dol_string_nohtmltag(), dol_string_nospecial(), dol_string_unaccent()

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

Referenced by ActionsStripeconnect\addMoreActionsButtons(), DolEditor\Create(), EmailCollector\doCollectOneCollector(), dol_concatdesc(), dol_print_email(), dol_print_error(), dolButtonToOpenUrlInDialogPopup(), dolGetButtonTitle(), DolGraph\draw_chart(), DolGraph\draw_jflot(), Form\editfieldval(), form_constantes(), Form\formconfirm(), mailing_contacts1\formFilter(), FormMail\get_form(), DolibarrModules\getKanbanView(), Subscription\getNomUrl(), Deplacement\getNomUrl(), AssetType\getNomUrl(), EcmDirectory\getNomUrl(), PaiementFourn\getNomUrl(), PaymentLoan\getNomUrl(), Localtax\getNomUrl(), AdherentType\getNomUrl(), PaymentExpenseReport\getNomUrl(), FichinterRec\getNomUrl(), PaymentDonation\getNomUrl(), DiscountAbsolute\getNomUrl(), PaymentSocialContribution\getNomUrl(), Delivery\getNomUrl(), CommandeFournisseur\getNomUrl(), Don\getNomUrl(), Holiday\getNomUrl(), Contact\getNomUrl(), FactureRec\getNomUrl(), Facture\getNomUrl(), Categorie\getNomUrl(), Adherent\getNomUrl(), FactureFournisseur\getNomUrl(), Societe\getNomUrl(), AccountLine\getNomUrl(), SupplierProposal\getNomUrl(), ContratLigne\getNomUrl(), Propal\getNomUrl(), Commande\getNomUrl(), getSocialNetworkSharingLinks(), getTitleFieldOfList(), img_help(), img_picto(), img_search(), img_searchclear(), info_admin(), left_menu(), FormFile\list_of_documents(), FormFile\listOfLinks(), main_area(), print_auguria_menu(), print_eldy_menu(), print_fleche_navigation(), print_text_menu_entry(), print_text_menu_entry_auguria(), print_text_menu_entry_empty(), printDropdownBookmarksList(), Form\select_country(), Form\select_dolusers(), Form\select_dolusers_forevent(), FormOther\select_export_model(), FormOther\select_import_model(), FormAdmin\select_language(), FormOther\select_salesrepresentatives(), FormEcm\selectAllSections(), FormOther\selectColor(), Form\selectCurrency(), Form\selectMassAction(), Adherent\sendReminderForExpiredSubscription(), show_contacts(), ModeleBoxes\showBox(), ExtraFields\showInputField(), FormTicket\showMessageForm(), Form\textwithtooltip(), top_menu(), top_menu_user(), and treeOutputForAbsoluteDir().

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 1070 of file functions.lib.php.

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

dol_escape_json (   $stringtoescape)

Returns text escaped for inclusion into javascript code.

Parameters
string$stringtoescapeString to escape
Returns
string Escaped string for json content.

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

Referenced by getStructuredData().

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 result of eval

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

Referenced by box_scheduled_jobs\loadBox(), InterfaceTicketEmail\runTrigger(), FormOther\selectGroupByField(), FormOther\selectXAxisField(), ExtraFields\setOptionalsFromPost(), ExtraFields\showInputField(), 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
Deprecated:
Use print dol_get_fiche_end() instead

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

References dol_get_fiche_end(), and print.

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

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 print dol_get_fiche_end() to close tab is not required), -2=Add tab header with no seaparation under tab (to start a tab just after)
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
string$morecssMore Css
int$limittoshowLimit number of tabs to show. Use 0 to use automatic default value.
string$moretabssuffixA suffix to use when you have several dol_get_fiche_head() in same page
Returns
void
Deprecated:
Use print dol_get_fiche_head() instead

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

References dol_get_fiche_head(), and print.

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

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

See https://en.wikipedia.org/wiki/Address

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
string$extralangcodeUser extralanguage $langcode as values for address, town
Returns
string Formated string
See Also
dol_print_address()

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

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

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

Show tabs of a record.

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 print dol_get_fiche_end() to close tab is not required), -2=Add tab header with no seaparation under tab (to start a tab just after)
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
string$morecssMore Css
int$limittoshowLimit number of tabs to show. Use 0 to use automatic default value.
string$moretabssuffixA suffix to use when you have several dol_get_fiche_head() in same page
Returns
string

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

References img_picto().

Referenced by ActionsCardService\assign_values(), ActionsCardProduct\assign_values(), ActionsContactCardDefault\assign_values(), ActionsAdherentCardDefault\assign_values(), ActionsCardCommon\assign_values(), dol_fiche_head(), journalHead(), report_header(), and FormTicket\showForm().

dol_getdate (   $timestamp,
  $fast = false,
  $forcetimezone = '' 
)

Return an array with locale date info.

WARNING: This function use PHP server timezone by default to return locale informations. Be aware to add the third parameter to "UTC" if you need to work on UTC.

Parameters
int$timestampTimestamp
boolean$fastFast mode. deprecated.
string$forcetimezone'' to use the PHP server timezone. Or use a form like 'Europe/Paris' or '+0200' to force timezone.
Returns
array Array of informations 'seconds' => $secs, 'minutes' => $min, 'hours' => $hour, 'mday' => $day, 'wday' => $dow, 0=sunday, 6=saturday 'mon' => $month, 'year' => $year, 'yday' => floor($secsInYear/$_day_power) '0' => original timestamp
See Also
dol_print_date(), dol_stringtotime(), dol_mktime()

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

Referenced by modFacture\__construct(), modAdherent\__construct(), MouvementStock\_create(), Facture\createFromClone(), FactureRec\createRecurringInvoices(), displayBox(), dol_get_first_day_week(), dol_get_first_hour(), dol_get_last_hour(), dol_get_next_day(), dol_get_next_week(), dol_get_prev_day(), dol_get_prev_week(), getCommonSubstitutionArray(), MultiCurrency\getIdAndTxFromCode(), Paiement\getNomUrl(), GETPOST(), PaiementFourn\initAsSpecimen(), FichinterRec\initAsSpecimen(), RemiseCheque\initAsSpecimen(), Paiement\initAsSpecimen(), FactureRec\initAsSpecimen(), Facture\initAsSpecimen(), box_graph_propales_permonth\loadBox(), box_graph_invoices_supplier_permonth\loadBox(), box_graph_invoices_permonth\loadBox(), box_graph_orders_permonth\loadBox(), box_graph_orders_supplier_permonth\loadBox(), box_birthdays\loadBox(), box_birthdays_members\loadBox(), box_graph_product_distribution\loadBox(), projectLinesPerDay(), projectLinesPerWeek(), Adherent\sendReminderForExpiredSubscription(), show_actions_done(), show_ticket_messaging(), 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 7284 of file functions.lib.php.

References $resql, and dol_syslog().

Referenced by SupplierInvoices\addPayment(), Invoices\addPayment(), Invoices\addPaymentDistributed(), CommonInvoice\demande_prelevement(), EmailCollector\doCollectOneCollector(), CProductNature\getProductNatureFromCode(), CUnits\getUnitFromCode(), box_funnel_of_prospection\loadBox(), num_public_holiday(), print_projecttasks_array(), RemiseCheque\rejectCheck(), Notify\send(), Societe\setThirdpartyType(), and Adherent\subscriptionComplementaryActions().

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 8001 of file functions.lib.php.

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

Replace html_entity_decode functions to manage errors.

Parameters
string$aOperand a
string$bOperand b (ENT_QUOTES|ENT_HTML5=convert simple, double quotes, colon, e accent, ...)
string$cOperand c
string$keepsomeentitiesEntities but &, <, >, " are not converted.
Returns
string String decoded

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

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

dol_htmlcleanlastbr (   $stringtodecode)

This function remove all ending
and br at end.

Parameters
string$stringtodecodeString to decode
Returns
string String decoded

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

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

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 6060 of file functions.lib.php.

Referenced by dol_htmlentitiesbr(), dol_print_error(), FormMail\get_form(), getTaskProgressView(), box_task\loadBox(), run_sql(), Form\showrefnav(), and top_htmlhead().

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 5984 of file functions.lib.php.

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

Referenced by pdf_crabe\_tableau_info(), pdf_sponge\drawInfoTable(), 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_ban\write_file(), pdf_sepamandate\write_file(), pdf_squille\write_file(), pdf_baleine\write_file(), pdf_timespent\write_file(), pdf_beluga\write_file(), pdf_espadon\write_file(), pdf_merou\write_file(), pdf_soleil\write_file(), pdf_storm\write_file(), pdf_strato\write_file(), pdf_cornas\write_file(), pdf_typhon\write_file(), pdf_rouget\write_file(), pdf_stdandard\write_file(), pdf_standard_myobject\write_file(), pdf_cyan\write_file(), pdf_eratosthene\write_file(), pdf_canelle\write_file(), pdf_standard_recruitmentjobposition\write_file(), pdf_sponge\write_file(), pdf_aurore\write_file(), pdf_standard\write_file(), pdf_muscadet\write_file(), pdf_azur\write_file(), pdf_einstein\write_file(), and pdf_crabe\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 6010 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 = array(),
  $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 7144 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 6960 of file functions.lib.php.

References dol_htmloutput_mesg().

Referenced by llxFooterSurvey().

dol_htmloutput_mesg (   $mesgstring = '',
  $mesgarray = array(),
  $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 7087 of file functions.lib.php.

References dol_syslog(), get_htmloutput_mesg(), and print.

Referenced by dol_htmloutput_errors(), dol_htmloutput_events(), and ActionsStripeconnect\formObjectOptions().

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

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 769 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(), Utils\compressSyslogs(), Product\create(), Contrat\create(), Propal\createFromClone(), Project\createFromClone(), Contrat\createFromClone(), Commande\createFromProposal(), Societe\delete(), CommonObject\deleteCommon(), EmailCollector\doCollectOneCollector(), dolGetElementUrl(), Reception\fetch_lines(), CommonDocGenerator\fill_substitutionarray_with_extrafields(), 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(), Ticket\getDefaultRef(), ImportCsv\import_insert(), ImportXlsx\import_insert(), HookManager\initHooks(), InfoBox\listBoxes(), migrate_reload_modules(), AdvanceTargetingMailing\query_contact(), Cronjob\run_jobs(), CSMSFile\sendfile(), Conf\setValues(), show_actions_done(), FormSms\show_form(), show_ticket_messaging(), and FormTicket\showForm().

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
dolIsAllowedForPreview(), image_format_supported() from images.lib.php

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

Referenced by FormMail\add_attached_files(), Documents\builddoc(), doc_label_pdf_create(), dol_init_file_process(), FormMail\get_form(), getAdvancedPreviewUrl(), getDocument(), FormFile\getDocumentsLink(), FileUpload\getFileObject(), FileUpload\handleFileUpload(), img_mime(), Documents\index(), Ticket\messageSend(), show_ticket_messaging(), FormFile\showdocuments(), FormTicket\showMessageForm(), and pdf_standard\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)
string | null$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 5689 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(), Ticket\copyFilesForTicket(), EcmDirectory\create(), Website\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(), dolSaveIndexPage(), dolSaveJsFile(), dolSaveManifestJson(), dolSaveReadme(), dolSaveRobotFile(), Ldap\dump(), Utils\dumpDatabase(), Website\exportWebSite(), Utils\generateDoc(), Stats\getAllByProductEntry(), getAllImages(), Stats\getAmountByMonthWithPrevYear(), Stats\getNbByMonthWithPrevYear(), ProjectStats\getTransformRateByMonthWithPrevYear(), ProjectStats\getWeightedAmountByMonthWithPrevYear(), FileUpload\handleFileUpload(), Website\importWebSite(), modWebsite\init(), modSupplierProposal\init(), modContrat\init(), modReception\init(), modTicket\init(), modMrp\init(), modBom\init(), modExpedition\init(), modProjet\init(), modFacture\init(), modRecruitment\init(), modMyModule\init(), modStock\init(), modCommande\init(), modPropale\init(), modSociete\init(), modFournisseur\init(), migrate_user_photospath(), RssParser\parser(), pdf_getInstance(), Documents\post(), Utils\purgeFiles(), rebuild_merge_pdf(), Cronjob\run_jobs(), InterfaceActionsAuto\runTrigger(), Website\update(), vignette(), html_cerfafr\write_file(), BordereauChequeBlochet\write_file(), pdf_paiement\write_file(), pdf_ban\write_file(), pdf_sepamandate\write_file(), CommActionRapport\write_file(), pdf_squille\write_file(), pdf_baleine\write_file(), pdf_timespent\write_file(), pdf_beluga\write_file(), pdf_espadon\write_file(), pdf_merou\write_file(), pdf_soleil\write_file(), pdf_storm\write_file(), pdf_strato\write_file(), pdf_cornas\write_file(), pdf_typhon\write_file(), pdf_rouget\write_file(), doc_generic_odt\write_file(), doc_generic_ticket_odt\write_file(), pdf_stdandard\write_file(), doc_generic_contract_odt\write_file(), doc_generic_member_odt\write_file(), pdf_standard_myobject\write_file(), doc_generic_bom_odt\write_file(), pdf_cyan\write_file(), pdf_eratosthene\write_file(), doc_generic_reception_odt\write_file(), pdf_canelle\write_file(), doc_generic_mo_odt\write_file(), doc_generic_myobject_odt\write_file(), doc_generic_recruitmentjobposition_odt\write_file(), doc_generic_supplier_order_odt\write_file(), doc_generic_stock_odt\write_file(), doc_generic_invoice_odt\write_file(), pdf_standard_recruitmentjobposition\write_file(), pdf_sponge\write_file(), doc_generic_shipment_odt\write_file(), pdf_aurore\write_file(), pdf_standard\write_file(), doc_generic_order_odt\write_file(), pdf_muscadet\write_file(), pdf_einstein\write_file(), pdf_azur\write_file(), doc_generic_product_odt\write_file(), doc_generic_usergroup_odt\write_file(), doc_generic_user_odt\write_file(), pdf_crabe\write_file(), pdf_standardlabel\write_file(), doc_generic_supplier_proposal_odt\write_file(), doc_generic_proposal_odt\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 = 'auto',
  $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 'tzserver' = local to server TZ 'auto' 'tzuser' = local to user TZ taking dst into account at the current date. Not yet implemented. 'tzuserrel' = local to user TZ taking dst into account at the given date. Use this one to convert date input from user. '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 2212 of file functions.lib.php.

References dol_syslog().

Referenced by modFacture\__construct(), modAdherent\__construct(), MouvementStock\_create(), Product\_get_stats(), pdf_paiement\_pagehead(), mailing_fraise\add_to_target(), CommonInvoice\calculate_date_lim_reglement(), Facture\createFromClone(), Project\createFromClone(), Task\createFromClone(), FactureRec\createRecurringInvoices(), displayBox(), dol_get_first_day(), dol_get_first_day_week(), dol_get_first_hour(), dol_get_last_day(), dol_get_last_hour(), dol_get_next_day(), dol_get_next_week(), dol_get_prev_day(), dol_get_prev_week(), dol_print_date(), dol_stringtotime(), dolSqlDateFilter(), get_next_value(), getDefaultDatesForTransfer(), MultiCurrency\getIdAndTxFromCode(), ExtraFields\getOptionalsFromPost(), ICal\ical_date_to_unix(), PaiementFourn\initAsSpecimen(), FichinterRec\initAsSpecimen(), RemiseCheque\initAsSpecimen(), Paiement\initAsSpecimen(), FactureRec\initAsSpecimen(), Facture\initAsSpecimen(), DoliDB\jdate(), Adherent\sendReminderForExpiredSubscription(), ExtraFields\setOptionalsFromPost(), show_actions_done(), 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 6099 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 6118 of file functions.lib.php.

References dol_strlen(), and dol_textishtml().

Referenced by pdf_aurore\_pagehead().

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

Replace CRLF in string with a HTML BR tag.

WARNING: The content after operation contains some HTML tags (the
) so be sure to also have encode the special chars of stringtoencode into HTML before.

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 5956 of file functions.lib.php.

Referenced by DolEditor\__construct(), ActionsCardCommon\assign_values(), ActionsAdherentCardCommon\assign_values(), ActionsContactCardCommon\assign_values(), dol_concatdesc(), dol_htmlentitiesbr(), Form\editInPlace(), FormMail\get_form(), Ticket\messageSend(), Ticket\newMessage(), InterfaceTicketEmail\runTrigger(), Ticket\sendLogByEmail(), FormTicket\showMessageForm(), and ActionsTicket\viewTicketOriginalMessage().

dol_now (   $mode = 'auto')

Return date for now.

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

Parameters
string$mode'auto' => for backward compatibility (avoid this), 'gmt' => we return GMT timestamp, 'tzserver' => we add the PHP server timezone 'tzref' => we add the company timezone. Not implemented. 'tzuser' or 'tzuserrel' => we add the user timezone
Returns
int $date Timestamp

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

References getServerTimeZoneInt().

Referenced by modAccounting\__construct(), modUser\__construct(), modFacture\__construct(), modService\__construct(), modSociete\__construct(), modAdherent\__construct(), modAgenda\__construct(), modProduct\__construct(), BonPrelevement\__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(), check_user_password_dolibarr(), check_user_password_http(), check_user_password_ldap(), check_user_password_openid(), Product\clone_fournisseurs(), Product\clone_price(), Ticket\close(), Contrat\closeAll(), RecruitmentJobPosition\cloture(), Commande\cloture(), SupplierProposal\cloture(), Propal\cloture(), Ticket\copyFilesForTicket(), Propalmergepdfproduct\create(), Link\create(), CompanyBankAccount\create(), RejetPrelevement\create(), UserBankAccount\create(), Productcustomerprice\create(), Tva\create(), PaymentExpenseReport\create(), PaymentDonation\create(), PaymentSocialContribution\create(), PaymentLoan\create(), LoanSchedule\create(), Fiscalyear\create(), Delivery\create(), Cronjob\create(), Subscription\create(), CashControl\create(), FichinterRec\create(), CommandeFournisseurDispatch\create(), EcmDirectory\create(), AdvanceTargetingMailing\create(), Deplacement\create(), AccountancySystem\create(), Task\create(), RemiseCheque\create(), Productlot\create(), Bookmark\create(), Website\create(), PaiementFourn\create(), Establishment\create(), EcmFiles\create(), Loan\create(), Entrepot\create(), BookKeeping\create(), Mailing\create(), Reception\create(), DiscountAbsolute\create(), ChargeSociales\create(), FactureRec\create(), Paiement\create(), ExpenseReport\create(), AccountingAccount\create(), Fichinter\create(), Holiday\create(), Project\create(), Expedition\create(), FactureFournisseur\create(), Don\create(), PaymentSalary\create(), Contact\create(), ActionComm\create(), Categorie\create(), PaymentVarious\create(), Ticket\create(), Facture\create(), Adherent\create(), Product\create(), Account\create(), UserGroup\create(), BlockedLog\create(), CurrencyRate\create(), Societe\create(), BonPrelevement\create(), SupplierProposal\create(), Commande\create(), Contrat\create(), Propal\create(), CommandeFournisseur\create(), User\create(), ExtraFields\create_label(), createActionComm(), CommonObject\createCommon(), Thirdparties\createCompanyBankAccount(), createContact(), RecruitmentCandidature\createFromClone(), RecruitmentJobPosition\createFromClone(), MyObject\createFromClone(), Mailing\createFromClone(), ActionComm\createFromClone(), Website\createFromClone(), WebsitePage\createFromClone(), SupplierProposal\createFromClone(), Facture\createFromClone(), Commande\createFromClone(), Propal\createFromClone(), Project\createFromClone(), Task\createFromClone(), Facture\createFromOrder(), Commande\createFromProposal(), createInvoice(), createOrder(), createPayment(), SupplierProposal\createPriceFournisseur(), createProductOrService(), FactureRec\createRecurringInvoices(), BookKeeping\createStd(), createThirdParty(), Ticket\createTicketMessage(), Stripe\customerStripe(), CommonInvoice\demande_prelevement(), CommandeFournisseur\dispatchProduct(), displayBox(), EmailCollector\doCollectOneCollector(), dol_cache_refresh(), dol_print_error_email(), dolSessionGC(), dolSessionWrite(), Hook\doScheduledJob(), RecruitmentCandidature\doScheduledJob(), BOM\doScheduledJob(), MyObject\doScheduledJob(), RecruitmentJobPosition\doScheduledJob(), Mo\doScheduledJob(), AccountancyExport\exportCiel(), Website\exportWebSite(), Contrat\fetch_lines(), BonPrelevement\generate(), Utils\generateDoc(), get_next_value(), CommonDocGenerator\get_substitutionarray_other(), Stats\getAllByProductEntry(), Stats\getAmountByMonthWithPrevYear(), getCommonSubstitutionArray(), getDefaultDatesForTransfer(), ContratLigne\getLibStatut(), Stats\getNbByMonthWithPrevYear(), mailing_thirdparties_services_expired\getNbOfRecipients(), mod_codeclient_monkey\getNextValue(), mod_ticket_simple\getNextValue(), mod_ticket_universal\getNextValue(), mod_project_simple\getNextValue(), mod_task_simple\getNextValue(), mod_task_universal\getNextValue(), mod_project_universal\getNextValue(), mod_delivery_jade\getNextValue(), mod_barcode_product_standard\getNextValue(), mod_codeproduct_elephant\getNextValue(), mod_codeclient_elephant\getNextValue(), Societe\getOutstandingBills(), Stripe\getPaymentIntent(), GETPOST(), getServerTimeZoneInt(), ProjectStats\getTransformRateByMonthWithPrevYear(), ProjectStats\getWeightedAmountByMonthWithPrevYear(), ActionComm\hasDelay(), Task\hasDelay(), Project\hasDelay(), ExpenseReport\hasDelay(), Adherent\hasDelay(), FactureFournisseur\hasDelay(), CommandeFournisseur\hasDelay(), Commande\hasDelay(), Facture\hasDelay(), modBlockedLog\init(), modEmailCollector\init(), Don\initAsSpecimen(), CompanyBankAccount\initAsSpecimen(), Opensurveysondage\initAsSpecimen(), Loan\initAsSpecimen(), PaiementFourn\initAsSpecimen(), FichinterRec\initAsSpecimen(), ChargeSociales\initAsSpecimen(), Entrepot\initAsSpecimen(), ExpenseReport\initAsSpecimen(), WebsitePage\initAsSpecimen(), Website\initAsSpecimen(), Delivery\initAsSpecimen(), EcmFiles\initAsSpecimen(), RemiseCheque\initAsSpecimen(), Paiement\initAsSpecimen(), Reception\initAsSpecimen(), Project\initAsSpecimen(), Fichinter\initAsSpecimen(), BookKeeping\initAsSpecimen(), FactureRec\initAsSpecimen(), Expedition\initAsSpecimen(), ActionComm\initAsSpecimen(), Holiday\initAsSpecimen(), Adherent\initAsSpecimen(), Contrat\initAsSpecimen(), FactureFournisseur\initAsSpecimen(), CommandeFournisseur\initAsSpecimen(), User\initAsSpecimen(), Societe\initAsSpecimen(), Facture\initAsSpecimen(), Product\initAsSpecimen(), CommonObject\initAsSpecimenCommon(), DolibarrModules\insert_cronjobs(), Holiday\LibStatut(), FormFile\listOfLinks(), RemiseCheque\load_board(), Account\load_board(), Contrat\load_board(), Adherent\load_board(), FactureFournisseur\load_board(), SupplierProposal\load_board(), Holiday\load_board(), ExpenseReport\load_board(), Ticket\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_factures\loadBox(), box_services_expired\loadBox(), box_contracts\loadBox(), box_ficheinter\loadBox(), box_birthdays\loadBox(), box_birthdays_members\loadBox(), box_services_contracts\loadBox(), box_graph_product_distribution\loadBox(), box_factures_imp\loadBox(), box_propales\loadBox(), box_actions\loadBox(), box_activity\loadBox(), ActionComm\loadReminders(), Ticket\markAsRead(), Ticket\messageSend(), migrate_project_task_actors(), migrate_project_user_resp(), migrate_reset_blocked_log(), LoanSchedule\paimenttorecord(), PriceParser\parseExpression(), RssParser\parser(), SupplierOrders\post(), SupplierInvoices\post(), Invoices\post(), print_paybox_redirect(), Utils\purgeFiles(), modBlockedLog\remove(), Contrat\reopen(), Cronjob\run_jobs(), InterfaceLogevents\runTrigger(), InterfaceActionsAuto\runTrigger(), Form\selectDate(), Notify\send(), ActionComm\sendEmailsReminder(), Adherent\sendReminderForExpiredSubscription(), ExpenseReport\set_cancel(), Facture\set_paid(), Societe\set_price_level(), Societe\set_remise_client(), Societe\set_remise_supplier(), ExpenseReport\setApproved(), Project\setClose(), Reception\setClosed(), ExpenseReport\setDeny(), Fichinter\setValid(), ExpenseReport\setValidate(), show_actions_done(), show_array_actions_to_do(), show_array_last_actions_done(), show_ticket_messaging(), FormActions\showactions(), Account\solde(), Adherent\subscription(), BookKeeping\transformTransaction(), Link\update(), ProductStockEntrepot\update(), Productlot\update(), Website\update(), Productcustomerprice\update(), Societe\update(), ProductFournisseur\update_buyprice(), ExtraFields\update_label(), User\update_last_login_date(), updateActionComm(), CommonObject\updateCommon(), Thirdparties\updateCompanyBankAccount(), updateContact(), Lettering\updateLettering(), FichinterRec\updateNbGenDone(), updateProductOrService(), Contact\updateRoles(), Holiday\updateSoldeCP(), updateThirdParty(), CashControl\valid(), Delivery\valid(), Commande\valid(), Mailing\valid(), Reception\valid(), CommandeFournisseur\valid(), Expedition\valid(), SupplierProposal\valid(), Propal\valid(), Inventory\validate(), RecruitmentCandidature\validate(), Contrat\validate(), RecruitmentJobPosition\validate(), MyObject\validate(), BOM\validate(), Mo\validate(), FactureFournisseur\validate(), Adherent\validate(), Facture\validate(), write_conf_file(), html_cerfafr\write_file(), doc_generic_odt\write_file(), doc_generic_ticket_odt\write_file(), doc_generic_contract_odt\write_file(), doc_generic_member_odt\write_file(), doc_generic_bom_odt\write_file(), doc_generic_reception_odt\write_file(), doc_generic_mo_odt\write_file(), doc_generic_myobject_odt\write_file(), doc_generic_recruitmentjobposition_odt\write_file(), doc_generic_supplier_order_odt\write_file(), doc_generic_stock_odt\write_file(), doc_generic_invoice_odt\write_file(), doc_generic_shipment_odt\write_file(), doc_generic_order_odt\write_file(), doc_generic_product_odt\write_file(), doc_generic_usergroup_odt\write_file(), doc_generic_user_odt\write_file(), doc_generic_supplier_proposal_odt\write_file(), doc_generic_proposal_odt\write_file(), pdf_standard\write_file(), and doc_generic_project_odt\write_file().

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

Format address string.

Parameters
string$addressAddress string, already formatted with dol_format_address()
int$htmlidHtml ID (for example 'gmap')
int$element'thirdparty'|'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 3018 of file functions.lib.php.

References dol_buildpath(), and print.

dol_print_date (   $time,
  $format = '',
  $tzoutput = 'auto',
  $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", "...inputnoreduce", "...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 1983 of file functions.lib.php.

References $_SERVER, dol_mktime(), dol_print_error(), dol_strlen(), dol_substr(), and dol_syslog().

Referenced by modAccounting\__construct(), modUser\__construct(), modService\__construct(), modSociete\__construct(), modAdherent\__construct(), modProduct\__construct(), printing_printgcp\__construct(), MouvementStock\_create(), Product\_get_stats(), pdf_ban\_pagehead(), pdf_paiement\_pagehead(), pdf_merou\_pagehead(), pdf_timespent\_pagehead(), pdf_baleine\_pagehead(), pdf_sepamandate\_pagehead(), pdf_soleil\_pagehead(), pdf_strato\_pagehead(), pdf_standard\_pagehead(), pdf_typhon\_pagehead(), pdf_storm\_pagehead(), pdf_beluga\_pagehead(), pdf_squille\_pagehead(), pdf_standard_recruitmentjobposition\_pagehead(), pdf_espadon\_pagehead(), pdf_rouget\_pagehead(), pdf_standard_myobject\_pagehead(), pdf_stdandard\_pagehead(), pdf_canelle\_pagehead(), pdf_muscadet\_pagehead(), pdf_cornas\_pagehead(), pdf_einstein\_pagehead(), pdf_eratosthene\_pagehead(), pdf_azur\_pagehead(), pdf_cyan\_pagehead(), pdf_crabe\_pagehead(), pdf_sponge\_pagehead(), CommActionRapport\_pages(), pdf_einstein\_tableau_info(), pdf_aurore\_tableau_info(), pdf_azur\_tableau_info(), pdf_crabe\_tableau_tot(), pdf_crabe\_tableau_versements(), pdf_canelle\_tableau_versements(), mailing_fraise\add_to_target(), build_calfile(), constructGanttLine(), convertSecondToTime(), Ticket\copyFilesForTicket(), Facture\create(), Mailing\createFromClone(), Task\createFromClone(), displayBox(), ActionsDatapolicy\doActions(), doc_getlinedesc(), EmailCollector\doCollectOneCollector(), dol_meta_create(), dol_print_error(), dol_print_object_info(), dol_syslog(), pdf_eratosthene\drawInfoTable(), pdf_cyan\drawInfoTable(), pdf_sponge\drawPaymentsTable(), pdf_sponge\drawTotalTable(), Form\editInPlace(), BonPrelevement\EnregDestinataireSEPA(), BonPrelevement\EnregEmetteurSEPA(), AccountancyExport\exportAgiris(), AccountancyExport\exportBob50(), AccountancyExport\exportCegid(), AccountancyExport\exportCharlemagne(), AccountancyExport\exportCiel(), AccountancyExport\exportCoala(), AccountancyExport\exportCogilog(), AccountancyExport\exportConfigurable(), AccountancyExport\exportEbp(), AccountancyExport\exportFEC(), AccountancyExport\exportFEC2(), AccountancyExport\exportGestimumV3(), AccountancyExport\exportGestimumV5(), AccountancyExport\exportLDCompta(), AccountancyExport\exportLDCompta10(), AccountancyExport\exportOpenConcerto(), AccountancyExport\exportQuadratus(), AccountancyExport\exportSAGE50SWISS(), Website\exportWebSite(), AccountancyExport\exportWinfic(), CommonDocGenerator\fill_substitutionarray_with_extrafields(), Form\form_date(), BonPrelevement\generate(), Utils\generateDoc(), 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(), getDefaultDatesForTransfer(), getInvoice(), getInvoicesForThirdParty(), PriceGlobalVariableUpdater\getLastUpdated(), Subscription\getNomUrl(), PaiementFourn\getNomUrl(), Productlot\getNomUrl(), PaymentSocialContribution\getNomUrl(), CommandeFournisseur\getNomUrl(), Don\getNomUrl(), Project\getNomUrl(), Paiement\getNomUrl(), FactureRec\getNomUrl(), Facture\getNomUrl(), FactureFournisseur\getNomUrl(), User\getNomUrl(), Propal\getNomUrl(), Commande\getNomUrl(), getOrder(), getOrdersForThirdParty(), getProductOrService(), getProductsForCategory(), getProject(), getServerTimeZoneInt(), getStructuredData(), CommonDocGenerator\getSubstitutionarrayMember(), getSupplierInvoice(), getSupplierInvoicesForThirdParty(), getThirdParty(), getUser(), BordereauChequeBlochet\Header(), DoliDB\idate(), printing_printgcp\listJobs(), box_last_modified_ticket\loadBox(), box_last_ticket\loadBox(), box_lastlogin\loadBox(), box_services_expired\loadBox(), box_supplier_orders\loadBox(), box_supplier_orders_awaiting_reception\loadBox(), box_factures\loadBox(), box_factures_fourn_imp\loadBox(), box_factures_fourn\loadBox(), box_contracts\loadBox(), box_ficheinter\loadBox(), box_services_contracts\loadBox(), box_birthdays_members\loadBox(), box_boms\loadBox(), box_accountancy_last_manual_entries\loadBox(), box_birthdays\loadBox(), box_external_rss\loadBox(), box_fournisseurs\loadBox(), box_commandes\loadBox(), box_scheduled_jobs\loadBox(), box_mos\loadBox(), box_factures_imp\loadBox(), box_propales\loadBox(), box_actions\loadBox(), box_clients\loadBox(), box_contacts\loadBox(), box_produits\loadBox(), box_members\loadBox(), box_prospect\loadBox(), box_goodcustomers\loadBox(), Adherent\makeSubstitution(), ExpenseReport\offsetAlreadyGiven(), pdf_getlinedesc(), pdf_getLinkedObjects(), print_paybox_redirect(), pdf_standard\printLine(), projectLinesa(), projectLinesPerAction(), report_header(), Cronjob\reprogram_jobs(), InterfaceActionsAuto\runTrigger(), Form\selectDate(), dolReceiptPrinter\sendToPrinter(), BonPrelevement\set_infocredit(), BonPrelevement\set_infotrans(), vCard\setBirthday(), show_actions_done(), show_list_sending_receive(), show_ticket_messaging(), FormActions\showactions(), CommandeFournisseur\showDelay(), Commande\showDelay(), FormFile\showdocuments(), ExtraFields\showOutputField(), pdf_standard\tablePayments(), top_menu_user(), treeOutputForAbsoluteDir(), Holiday\updateSoldeCP(), ActionsTicket\viewTicketTimelineMessages(), write_conf_file(), html_cerfafr\write_file(), pdf_paiement\write_file(), pdf_timespent\write_file(), pdf_baleine\write_file(), pdf_beluga\write_file(), pdf_soleil\write_file(), pdf_strato\write_file(), doc_generic_odt\write_file(), doc_generic_ticket_odt\write_file(), pdf_stdandard\write_file(), doc_generic_contract_odt\write_file(), doc_generic_member_odt\write_file(), doc_generic_bom_odt\write_file(), doc_generic_reception_odt\write_file(), doc_generic_mo_odt\write_file(), doc_generic_recruitmentjobposition_odt\write_file(), doc_generic_supplier_order_odt\write_file(), doc_generic_myobject_odt\write_file(), doc_generic_stock_odt\write_file(), doc_generic_invoice_odt\write_file(), doc_generic_shipment_odt\write_file(), doc_generic_order_odt\write_file(), doc_generic_product_odt\write_file(), doc_generic_usergroup_odt\write_file(), doc_generic_user_odt\write_file(), doc_generic_supplier_proposal_odt\write_file(), doc_generic_proposal_odt\write_file(), pdf_standard\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 formatted for HTML output.

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$showinvalid1=Show warning if syntax email is wrong
int$withpictoShow picto
Returns
string HTML Link

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

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

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

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

Displays error message system with all the information to facilitate the diagnosis and the escalation of the bugs.

This function must be called when a blocking technical error is encountered. However, one must try to call it only within php pages, classes must return their error through their property "error".

Parameters
DoliDB$dbDatabase handler
string|string[]$error String or array of errors strings to show
array$errorsArray of errors
Returns
void
See Also
dol_htmloutput_errors()

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

References $_SERVER, dol_escape_htmltag(), dol_htmlentities(), dol_print_date(), dol_syslog(), and print.

Referenced by modAgenda\__construct(), mailing_thirdparties_services_expired\__construct(), MouvementStock\_create(), Stats\_getAllByProduct(), Stats\_getAllByYear(), Stats\_getAmountByMonth(), Stats\_getAverageByMonth(), Stats\_getNbByMonth(), Stats\_getNbByYear(), Product\_log_price(), pdf_standard\_pagehead(), pdf_stdandard\_pagehead(), Product\add_sousproduit(), mailing_contacts1\add_to_target(), addDocumentModel(), Account\addline(), ActionsStripeconnect\addMoreActionsButtons(), Localtax\addPayment(), Tva\addPayment(), PaymentLoan\addPaymentToBank(), PaymentExpenseReport\addPaymentToBank(), PaymentSocialContribution\addPaymentToBank(), PaymentDonation\addPaymentToBank(), Paiement\addPaymentToBank(), UserGroup\addrights(), User\addrights(), MailingTargets\addTargetsToDatabase(), Task\addTimeSpent(), ajouter_sondage(), BlockedLog\alreadyUsed(), ActionsAdherentCardCommon\assign_post(), ActionsContactCardCommon\assign_post(), Export\build_filterField(), calcul_price_total(), MouvementStock\calculateBalanceForProductBefore(), Account\can_be_deleted(), Stripe\cardStripe(), checkUserAccessToObject(), chequereceipt_pdf_create(), CommandeFournisseur\classifyBilled(), clean_data_ecm_directories(), cleanCorruptedTree(), Form\constructProductListOption(), Societe\contact_array(), Societe\contact_array_objects(), Societe\contact_get_property(), Societe\contact_property_array(), Categorie\containing(), Account\countAccountToReconcile(), Categorie\countNbOfCategories(), Menubase\create(), Fichinter\create(), FactureFournisseur\create(), PaymentSalary\create(), PaymentVarious\create(), Facture\create(), SupplierProposal\create(), Commande\create(), Contrat\create(), Propal\create(), CommandeFournisseur\create(), Holiday\createCPusers(), FactureRec\createRecurringInvoices(), Stripe\customerStripe(), AccountLine\dateo_change(), AccountLine\datev_change(), Product\del_sousproduit(), delDocumentModel(), DiscountAbsolute\delete(), PaymentLoan\delete(), BonPrelevement\delete(), ExtraFields\delete_label(), Facture\deleteline(), UserGroup\delrights(), User\delrights(), doc_label_pdf_create(), dol_dir_list_in_database(), dol_print_date(), dol_set_user_param(), dolibarr_del_const(), dolibarr_set_const(), dolSavePageContent(), facture_prepare_head(), facturefourn_prepare_head(), PaiementFourn\fetch(), Bookmark\fetch(), Paiement\fetch(), UserBankAccount\fetch(), CompanyBankAccount\fetch(), Import\fetch(), Categorie\fetch(), Ticket\fetch(), Don\fetch(), Export\fetch(), ExpenseReportLine\fetch(), SupplierProposalLine\fetch(), CommandeFournisseurLigne\fetch(), Opensurveysondage\fetch_lines(), Adherent\fetch_login(), Adherent\fetch_name(), ActionComm\fetch_userassigned(), EmailCollector\fetchActions(), ProductAttribute\fetchAll(), ExpeditionLineBatch\fetchAll(), Task\fetchAllTimeSpent(), EmailCollector\fetchFilters(), ActionComm\fetchResources(), fichinter_create(), FormCompany\form_prospect_level(), mailing_fraise\formFilter(), mailing_contacts1\formFilter(), mailing_advthirdparties\formFilter(), mailing_thirdparties\formFilter(), FormCompany\formProspectContactLevel(), Utils\generateDoc(), Don\generateDocument(), 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(), get_next_value(), FactureLigne\get_prev_progress(), get_product_localtax_for_country(), get_product_vat_for_country(), Account\get_url(), Fiscalyear\getAccountancyEntriesByFiscalYear(), Fiscalyear\getAccountancyMovementsByFiscalYear(), ExpenseReportIk\getAllRanges(), ExpenseReportRule\getAllRule(), AccountancyCategory\getCats(), AccountancyCategory\getCatsCpts(), Product\getChildsArbo(), Contact\getContactRoles(), getCountry(), AccountancyCategory\getCptsCat(), CommandeFournisseur\getDispachedLines(), ExpenseReportLine\getExpAmount(), Product\getFather(), ActionsCardService\getFieldList(), ActionsCardProduct\getFieldList(), CommandeFournisseur\getInputMethod(), CommonInvoice\getListIdAvoirFromInvoice(), InterfaceNotification\getListOfManagedEvents(), getListOfModels(), CommonInvoice\getListOfPayments(), ExpenseReportIk\getMaxRangeNumber(), Reception\getNextNumRef(), Holiday\getNextNumRef(), Expedition\getNextNumRef(), Contrat\getNextNumRef(), Commande\getNextNumRef(), RemiseCheque\getNextNumRef(), BOM\getNextNumRef(), PaiementFourn\getNextNumRef(), Mo\getNextNumRef(), Fichinter\getNextNumRef(), CommandeFournisseur\getNextNumRef(), RecruitmentCandidature\getNextNumRef(), MyObject\getNextNumRef(), RecruitmentJobPosition\getNextNumRef(), Paiement\getNextNumRef(), ExpenseReport\getNextNumRef(), FactureFournisseur\getNextNumRef(), SupplierProposal\getNextNumRef(), Propal\getNextNumRef(), Facture\getNextNumRef(), mod_expensereport_jade\getNextValue(), mod_takepos_ref_simple\getNextValue(), mod_facture_mars\getNextValue(), mod_facture_fournisseur_cactus\getNextValue(), mod_facture_terre\getNextValue(), Stripe\getPaymentIntent(), BlockedLog\getPreviousHash(), Project\getProjectsAuthorizedForUser(), ExpenseReportIk\getRangesByCategory(), Societe\getSalesRepresentatives(), getServerTimeZoneInt(), getSourceDocRef(), getState(), Stripe\getStripeAccount(), DiscountAbsolute\getSumCreditNotesUsed(), DiscountAbsolute\getSumDepositsUsed(), DiscountAbsolute\getSumFromThisCreditNotesNotUsed(), Task\getSummaryOfTimeSpent(), Task\getSumOfAmount(), ExpenseReportIk\getTaxCategories(), getTaxesFromId(), Holiday\getTypes(), Task\getUserRolesForProjectsOrTasks(), ImportCsv\import_insert(), ImportXlsx\import_insert(), EmailSenderProfile\info(), Establishment\info(), Asset\info(), Fiscalyear\info(), PaiementFourn\info(), EmailCollectorFilter\info(), Subscription\info(), EmailCollectorAction\info(), Deplacement\info(), SocieteAccount\info(), Entrepot\info(), CompanyPaymentMode\info(), AccountingAccount\info(), Inventory\info(), EmailCollector\info(), ChargeSociales\info(), Hook\info(), PaymentExpenseReport\info(), PaymentSalary\info(), PaymentVarious\info(), ExpenseReport\info(), Tva\info(), RecruitmentCandidature\info(), MyObject\info(), BOM\info(), Fichinter\info(), RecruitmentJobPosition\info(), Paiement\info(), Don\info(), Mo\info(), ActionComm\info(), BOMLine\info(), Contrat\info(), FactureFournisseur\info(), Holiday\info(), Project\info(), SupplierProposal\info(), AccountLine\info(), Adherent\info(), CommandeFournisseur\info(), User\info(), Propal\info(), Societe\info(), Commande\info(), Facture\info(), Product\info(), modEmailCollector\init(), FichinterLigne\insert(), DolibarrModules\insert_permissions(), Product\is_sousproduit(), CommonObject\isExistingObject(), Product\isVariant(), Export\list_export_model(), Fournisseur\ListArray(), SupplierProposal\liste_array(), Commande\liste_array(), Propal\liste_array(), Facture\liste_array(), Ticket\listeContact(), Deplacement\listOfTypes(), ExpenseReport\listOfTypes(), Translate\load(), RemiseCheque\load_board(), ActionComm\load_board(), Account\load_board(), Contrat\load_board(), Adherent\load_board(), FactureFournisseur\load_board(), Holiday\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_transport_mode(), Form\load_cache_types_fees(), Form\load_cache_types_paiements(), EcmDirectory\load_motherof(), Categorie\load_motherof(), 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(), Task\load_state_board(), Project\load_state_board(), Adherent\load_state_board(), Holiday\load_state_board(), Contrat\load_state_board(), ExpenseReport\load_state_board(), SupplierProposal\load_state_board(), FactureFournisseur\load_state_board(), CommandeFournisseur\load_state_board(), Ticket\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_last_modified_ticket\loadBox(), box_last_ticket\loadBox(), box_funnel_of_prospection\loadBox(), box_task\loadBox(), box_activity\loadBox(), box_validated_projects\loadBox(), Ticket\loadCacheCategoriesTickets(), Translate\loadCacheCurrencies(), Form\loadCacheInputReason(), Ticket\loadCacheSeveritiesTickets(), Ticket\loadCacheTypesTickets(), User\loadDefaultValues(), Translate\loadFromDatabase(), FormProduct\loadLotStock(), User\loadParentOf(), Project\loadTimeSpent(), Project\loadTimeSpentMonth(), FormProduct\loadWarehouses(), Invoices\markAsCreditAvailable(), members_card_pdf_create(), Menubase\menuLoad(), Ticket\messageSend(), migrate_actioncomm_element(), migrate_categorie_association(), migrate_commande_deliveryaddress(), migrate_commande_expedition(), migrate_commande_livraison(), migrate_contacts_socialnetworks(), migrate_contracts_date1(), migrate_contracts_date2(), 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_members_socialnetworks(), 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(), migrate_thirdparties_socialnetworks(), migrate_user_rights_entity(), migrate_usergroup_rights_entity(), migrate_users_socialnetworks(), FormAdvTargetEmailing\multiselectCivility(), FormAdvTargetEmailing\multiselectCountry(), FormAdvTargetEmailing\multiselectProspectionStatus(), FormAdvTargetEmailing\multiselectselectSalesRepresentatives(), Commande\nb_expedition(), ExpenseReport\offsetAlreadyGiven(), ordered(), pdf_bank(), print_left_auguria_menu(), print_left_eldy_menu(), print_paybox_redirect(), printDropdownBookmarksList(), printing_printipp\printFile(), project_prepare_head(), pt(), rebuild_merge_pdf(), Contrat\reopen(), security_prepare_head(), FormAccounting\select_accounting_category(), Form\select_address(), Form\select_all_categories(), 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(), FormBarCode\selectBarcodeType(), FormCompany\selectCompaniesForNewContact(), Form\selectcontacts(), Form\selectEstablishments(), Form\selectExpenseCategories(), Form\selectExpenseRanges(), FormOrder\selectInputMethod(), Form\selectInvoice(), FormProduct\selectMeasuringUnits(), FormProduct\selectProductNature(), FormPropal\selectProposalStatus(), Form\selectShippingMethod(), FormProjets\selectTasks(), FormWebsite\selectTypeOfContainer(), FormWebsite\selectWebsite(), Notify\send(), CSMSFile\sendfile(), DataPolicy\sendMailDataPolicyAdherent(), DataPolicy\sendMailDataPolicyCompany(), DataPolicy\sendMailDataPolicyContact(), FichinterRec\set_auto(), Don\set_cancel(), ExpenseReport\set_paid(), Don\set_paid(), FactureFournisseur\set_paid(), Societe\set_price_level(), Commande\set_reopen(), Facture\set_unpaid(), CompanyBankAccount\setAsDefault(), CompanyPaymentMode\setAsDefault(), FichinterRec\setAutoValidate(), FactureRec\setAutoValidate(), Reception\setClosed(), Expedition\setClosed(), Ticket\setContract(), setEventMessages(), FichinterRec\setFrequencyAndUnit(), FactureRec\setFrequencyAndUnit(), FactureRec\setGeneratePdf(), FichinterRec\setMaxPeriod(), FactureRec\setMaxPeriod(), FactureRec\setModelPdf(), FichinterRec\setNextDate(), FactureRec\setNextDate(), Adherent\setPassword(), User\setPassword(), Ticket\setProject(), 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(), show_ticket_messaging(), FormActions\showactions(), FormFile\showdocuments(), Form\showphoto(), societe_prepare_head(), task_prepare_head(), tax_by_rate(), tax_by_thirdparty(), UserBankAccount\update(), CompanyBankAccount\update(), Categorie\update(), Account\update(), Product\update(), ExpenseReportLine\update(), Account\update_bban(), Reception\update_delivery_method(), Expedition\update_delivery_method(), PaymentSalary\update_fk_bank(), PaymentVarious\update_fk_bank(), Localtax\update_fk_bank(), Tva\update_fk_bank(), ExtraFields\update_label(), Product\update_sousproduit(), FichinterRec\updateNbGenDone(), Product\updatePrice(), Mo\updateProduction(), User\user_get_property(), user_prepare_head(), Delivery\valid(), Commande\valid(), CommandeFournisseur\valid(), SupplierProposal\valid(), Propal\valid(), RecruitmentCandidature\validate(), Contrat\validate(), RecruitmentJobPosition\validate(), MyObject\validate(), BOM\validate(), Mo\validate(), Facture\validate(), Auth\verif(), Holiday\verifDateHolidayCP(), Holiday\verifDateHolidayForTimestamp(), ActionsTicket\viewTicketMessages(), pdf_paiement\write_file(), pdf_standard\write_file(), doc_generic_ticket_odt\write_file(), pdf_stdandard\write_file(), doc_generic_contract_odt\write_file(), doc_generic_member_odt\write_file(), doc_generic_bom_odt\write_file(), doc_generic_reception_odt\write_file(), doc_generic_mo_odt\write_file(), doc_generic_myobject_odt\write_file(), doc_generic_recruitmentjobposition_odt\write_file(), doc_generic_stock_odt\write_file(), doc_generic_invoice_odt\write_file(), doc_generic_shipment_odt\write_file(), doc_generic_order_odt\write_file(), doc_generic_product_odt\write_file(), doc_generic_usergroup_odt\write_file(), doc_generic_user_odt\write_file(), pdf_standardlabel\write_file(), doc_generic_supplier_proposal_odt\write_file(), doc_generic_proposal_odt\write_file(), pdf_tcpdflabel\write_file(), doc_generic_task_odt\write_file(), doc_generic_project_odt\write_file(), ExportTsv\write_record(), ExportCsv\write_record(), ExportExcel2007\write_record(), and ExportExcel2007\write_title().

dol_print_error_email (   $prefixcode,
  $errormessage = '',
  $errormessages = array(),
  $morecss = 'error',
  $email = '' 
)

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
string$morecssMore css
string$emailEmail
Returns
void

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

References dol_now(), 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 2882 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 2540 of file functions.lib.php.

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

Referenced by ActionsCardCommon\assign_values(), ActionsAdherentCardCommon\assign_values(), ActionsContactCardCommon\assign_values(), Contact\getNomUrl(), 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 label of size unit (for example 'b' instead of 'bytes')
Returns
string Link

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

Referenced by DolMemoryCollector\collect(), FormFile\list_of_autoecmfiles(), FormFile\list_of_documents(), and showWebsiteTemplates().

dol_print_socialnetworks (   $value,
  $cid,
  $socid,
  $type,
  $dictsocialnetworks = array() 
)

Show social network link.

Parameters
string$valueSkype to show (only skype, without 'Name of recipient' before)
int$cidId of contact if known
int$socidId of third party if known
string$type'skype','facebook',...
array$dictsocialnetworkssocialnetworks availables
Returns
string HTML Link

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

References dol_ucfirst(), 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 2361 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 938 of file functions.lib.php.

References dol_string_nospecial(), and dol_string_unaccent().

Referenced by FileUpload\__construct(), account_statement_prepare_head(), CommandeFournisseur\approve(), asset_prepare_head(), bank_prepare_head(), bomPrepareHead(), Expedition\cancel(), Product\check(), clean_data_ecm_directories(), commande_prepare_head(), contact_prepare_head(), contract_prepare_head(), EcmDirectory\create(), Reception\create(), Expedition\create(), Product\create(), WebsitePage\createFromClone(), Project\createFromClone(), Task\createFromClone(), Dolresource\delete(), Task\delete(), Delivery\delete(), Project\delete(), Reception\delete(), Fichinter\delete(), ExpenseReport\delete(), FactureFournisseur\delete(), Contrat\delete(), Product\delete(), Expedition\delete(), CommandeFournisseur\delete(), SupplierProposal\delete(), Facture\delete(), Propal\delete(), Commande\delete(), delivery_prepare_head(), 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(), Thirdparties\generateBankAccountDocument(), get_exdir(), Documents\getDocumentsListByElement(), RecruitmentCandidature\getNomUrl(), MyObject\getNomUrl(), RecruitmentJobPosition\getNomUrl(), EcmDirectory\getRelativePath(), holiday_prepare_head(), FormFile\list_of_documents(), loan_prepare_head(), moPrepareHead(), myobjectPrepareHead(), ordersupplier_prepare_head(), Documents\post(), product_prepare_head(), productlot_prepare_head(), project_prepare_head(), propal_prepare_head(), recruitmentCandidaturePrepareHead(), recruitmentjobpositionPrepareHead(), resource_prepare_head(), Notify\send(), Fichinter\setValid(), ExpenseReport\setValidate(), Conf\setValues(), shipping_prepare_head(), task_prepare_head(), tax_prepare_head(), Dolresource\update(), Task\update(), Project\update(), Product\update(), Societe\update(), Delivery\valid(), Commande\valid(), Reception\valid(), CommandeFournisseur\valid(), Expedition\valid(), SupplierProposal\valid(), Propal\valid(), RecruitmentCandidature\validate(), Contrat\validate(), RecruitmentJobPosition\validate(), MyObject\validate(), BOM\validate(), Holiday\validate(), Mo\validate(), FactureFournisseur\validate(), Facture\validate(), various_payment_prepare_head(), vat_prepare_head(), html_cerfafr\write_file(), pdf_ban\write_file(), pdf_sepamandate\write_file(), pdf_squille\write_file(), pdf_timespent\write_file(), pdf_baleine\write_file(), pdf_beluga\write_file(), pdf_espadon\write_file(), pdf_merou\write_file(), pdf_soleil\write_file(), pdf_storm\write_file(), pdf_strato\write_file(), pdf_cornas\write_file(), pdf_typhon\write_file(), pdf_rouget\write_file(), doc_generic_odt\write_file(), doc_generic_ticket_odt\write_file(), pdf_stdandard\write_file(), doc_generic_contract_odt\write_file(), doc_generic_member_odt\write_file(), pdf_standard_myobject\write_file(), pdf_cyan\write_file(), doc_generic_bom_odt\write_file(), pdf_eratosthene\write_file(), doc_generic_reception_odt\write_file(), pdf_canelle\write_file(), doc_generic_mo_odt\write_file(), doc_generic_supplier_order_odt\write_file(), doc_generic_recruitmentjobposition_odt\write_file(), doc_generic_myobject_odt\write_file(), doc_generic_stock_odt\write_file(), pdf_sponge\write_file(), doc_generic_invoice_odt\write_file(), pdf_standard_recruitmentjobposition\write_file(), pdf_aurore\write_file(), doc_generic_shipment_odt\write_file(), doc_generic_order_odt\write_file(), pdf_standard\write_file(), pdf_muscadet\write_file(), pdf_einstein\write_file(), pdf_azur\write_file(), doc_generic_product_odt\write_file(), doc_generic_usergroup_odt\write_file(), doc_generic_user_odt\write_file(), pdf_crabe\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 958 of file functions.lib.php.

References dol_string_nospecial(), and dol_string_unaccent().

Referenced by Documents\post().

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 7987 of file functions.lib.php.

References print.

dol_shutdown ( )

Function called at end of web php process.

Returns
void

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

References $_SERVER, and 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 919 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('key1'=>val1,'key2'=>val2,'key3'...) or array of objects)
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 7162 of file functions.lib.php.

Referenced by dol_dir_list(), EcmDirectory\get_full_arbo(), Categorie\get_full_arbo(), User\get_full_tree(), Setup\getCheckIntegrity(), FormFile\list_of_autoecmfiles(), FormFile\list_of_documents(), Form\load_cache_availability(), Form\load_cache_transport_mode(), Form\load_cache_types_paiements(), Form\loadCacheInputReason(), print_auguria_menu(), print_eldy_menu(), Form\select_country(), FormCompany\select_juridicalstatus(), FormOther\selectGroupByField(), FormOther\selectXAxisField(), show_contacts(), 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 1955 of file functions.lib.php.

dol_string_is_good_iso (   $s,
  $clean = 0 
)

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
string$cleanClean if it is not an ISO. Warning, if file is utf8, you will get a bad formated file.
Returns
int|string 0 if bad iso, 1 if good iso, Or the clean string if $clean is 1

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

References dol_strlen().

dol_string_neverthesehtmltags (   $stringtoclean,
  $disallowed_tags = array('textarea'),
  $cleanalsosomestyles = 0 
)

Clean a string from some undesirable HTML tags.

Note. Not as secured as dol_string_onlythesehtmltags().

Parameters
string$stringtocleanString to clean
array$disallowed_tagsArray of tags not allowed
string$cleanalsosomestylesClean also some tags
Returns
string String cleaned
See Also
dol_escape_htmltag() strip_tags() dol_string_nohtmltag() dol_string_onlythesehtmltags()

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

Referenced by Form\editfieldval().

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

Clean a string from all HTML tags and entities.

This function differs from strip_tags because:


  • are replaced with
    if removelinefeed=0 or 1
  • if entities are found, they are decoded BEFORE the strip
  • you can decide to convert line feed into a space
Parameters
string$stringtocleanString to clean
integer$removelinefeed1=Replace all new lines by 1 space, 0=Only ending new lines are removed others are replaced with
, 2=Ending new lines are removed but others are kept with a same number of
than nb of
when there is both "...<br>\n..."
string$pagecodetoEncoding of input/output string
integer$strip_tags0=Use internal strip, 1=Use strip_tags() php function (bugged when text contains a < char that is not for a html tag or when tags is not closed like '<img onload=aaa')
integer$removedoublespacesReplace double space into one space
Returns
string String cleaned
See Also
dol_escape_htmltag() strip_tags() dol_string_onlythesehtmltags() dol_string_neverthesehtmltags(), dolStripPhpCode()

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

References dol_html_entity_decode().

Referenced by AdherentType\_load_ldap_info(), Contact\_load_ldap_info(), UserGroup\_load_ldap_info(), CommActionRapport\_pages(), ajax_dialog(), build_calfile(), build_rssfile(), checkVal(), pdf_eratosthene\defineColumnField(), pdf_cyan\defineColumnField(), pdf_sponge\defineColumnField(), EmailCollector\doCollectOneCollector(), dol_add_file_process(), dol_trunc(), DolGraph\draw_chart(), ExportExcel2007\excel_clean(), FormMail\get_form(), getCommonSubstitutionArray(), CommonDocGenerator\getExtrafieldContent(), CommandeFournisseur\getNomUrl(), Adherent\getNomUrl(), FactureFournisseur\getNomUrl(), User\getNomUrl(), SupplierProposal\getNomUrl(), Propal\getNomUrl(), Commande\getNomUrl(), GETPOST(), getStructuredData(), pdf_build_address(), print_left_eldy_menu(), CoreObject\setValues(), AccountancyExport\toAnsi(), 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(), dol_string_nounprintableascii()

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

Referenced by BonPrelevement\buildRumNumber(), check_value(), Societe\contact_get_property(), Product\create(), CommonObject\createCommon(), dol_buildlogin(), dol_sanitizeFileName(), dol_sanitizePathName(), DolGraph\draw_chart(), DolGraph\draw_jflot(), get_next_value(), GETPOST(), Product\update(), CommonObject\updateCommon(), and doc_generic_odt\write_file().

dol_string_nounprintableascii (   $str,
  $removetabcrlf = 1 
)

Clean a string from all non printable ASCII chars (0x00-0x1F and 0x7F).

It can also removes also Tab-CR-LF. UTF8 chars remains. This can be used to sanitize a string and view its real content. Some hacks try to obfuscate attacks by inserting non printable chars. Note, for information: UTF8 on 1 byte are: -\7F 2 bytes are: byte 1 -, byte 2 = - 3 bytes are: byte 1 -, byte 2 = -, byte 3 = - 4 bytes are: byte 1 -, byte 2 = -, byte 3 = -, byte 4 = -

Parameters
string$strString to clean
int$removetabcrlfRemove also CR-LF
Returns
string Cleaned string
See Also
dol_sanitizeFilename(), dol_string_unaccent(), dol_string_nospecial()

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

Referenced by dol_string_onlythesehtmltags().

dol_string_onlythesehtmltags (   $stringtoclean,
  $cleanalsosomestyles = 1,
  $removeclassattribute = 1,
  $cleanalsojavascript = 0 
)

Clean a string to keep only desirable HTML tags.

WARNING: This also clean HTML comments (used to obfuscate tag name).

Parameters
string$stringtocleanString to clean
int$cleanalsosomestylesRemove absolute/fixed positioning from inline styles
int$removeclassattributeRemove the class attribute from tags
int$cleanalsojavascriptRemove also occurence of 'javascript:'.
Returns
string String cleaned
See Also
dol_escape_htmltag() strip_tags() dol_string_nohtmltag() dol_string_neverthesehtmltags()

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

References dol_string_nounprintableascii().

Referenced by checkVal(), and Form\editfieldval().

dol_string_unaccent (   $str)
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 3127 of file functions.lib.php.

Referenced by Product\_get_stats(), Contact\_load_ldap_info(), activateModulesRequiredByCountry(), Contrat\addline(), ActionsCardCommon\assign_values(), ActionsAdherentCardCommon\assign_values(), ActionsContactCardCommon\assign_values(), binhex(), 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(), ExpeditionLineBatch\create(), Cronjob\create(), CommandeFournisseurDispatch\create(), Productlot\create(), Website\create(), EcmFiles\create(), BookKeeping\create(), Ticket\create(), Product\create(), Contrat\create(), BookKeeping\createStd(), pdf_eratosthene\defineColumnField(), pdf_cyan\defineColumnField(), pdf_sponge\defineColumnField(), 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(), dol_trunc(), AdherentType\fetch(), Product\fetch(), fichinter_create(), Fichinter\generateDocument(), Entrepot\generateDocument(), UserGroup\generateDocument(), RecruitmentCandidature\generateDocument(), BOM\generateDocument(), Don\generateDocument(), MyObject\generateDocument(), RecruitmentJobPosition\generateDocument(), Delivery\generateDocument(), MouvementStock\generateDocument(), Mo\generateDocument(), Project\generateDocument(), Reception\generateDocument(), Task\generateDocument(), ExpenseReport\generateDocument(), Adherent\generateDocument(), Contrat\generateDocument(), Expedition\generateDocument(), SupplierProposal\generateDocument(), CommandeFournisseur\generateDocument(), User\generateDocument(), Propal\generateDocument(), Commande\generateDocument(), Societe\generateDocument(), Facture\generateDocument(), Product\generateDocument(), get_next_value(), DolGraph\GetCeilMaxValue(), DolGraph\GetFloorMinValue(), modGeneratePassStandard\getNewGeneratedPassword(), getPagesFromSearchCriterias(), hexbin(), Societe\id_prof_check(), ImportCsv\import_read_record(), ImportXlsx\import_read_record(), DolibarrModules\insert_permissions(), Ldap\littleEndian(), load_fiche_titre(), Form\load_tva(), box_graph_invoices_permonth\loadBox(), box_graph_invoices_supplier_permonth\loadBox(), box_graph_orders_supplier_permonth\loadBox(), box_graph_propales_permonth\loadBox(), box_graph_orders_permonth\loadBox(), box_last_ticket\loadBox(), box_last_modified_ticket\loadBox(), box_lastlogin\loadBox(), box_factures\loadBox(), box_graph_product_distribution\loadBox(), box_project\loadBox(), box_task\loadBox(), box_activity\loadBox(), box_validated_projects\loadBox(), ActionsCardService\LoadListDatas(), makesalt(), members_card_pdf_create(), Ticket\messageSend(), pdf_bank(), price(), price2num(), Form\select_produits_fournisseurs_list(), Notify\send(), FormSms\show_form(), CompanyBankAccount\update(), Productlot\update(), Fichinter\update(), Project\update(), Website\update(), Cronjob\update(), EcmFiles\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 (   $string,
  $encoding = "UTF-8" 
)

Convert a string to lower.

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

Parameters
string$stringString to encode
string$encodingCharacter set encoding
Returns
string String converted

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

Referenced by CommonObject\setUpperOrLowerCase().

dol_strtoupper (   $string,
  $encoding = "UTF-8" 
)

Convert a string to upper.

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

Parameters
string$stringString to encode
string$encodingCharacter set encoding
Returns
string String converted

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

Referenced by CommonObject\setUpperOrLowerCase().

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

Make a substring.

Works even if mbstring module is not enabled for better compatibility.

Parameters
string$stringString to scan
string$startStart position
int$lengthLength (in nb of characters or nb of bytes depending on trunconbytes param)
string$stringencodingPage code used for input string encoding
int$trunconbytes1=Length is max of bytes instead of max of characters
Returns
string substring

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

Referenced by Project\create(), BonPrelevement\create(), dol_print_date(), and dol_trunc().

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

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$restricttologhandlerForce output of log only to this log handler
array | null$logcontextIf defined, an array with extra informations (can be used by some log handlers)
Returns
void

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

References $_SERVER, dol_print_date(), getUserRemoteIP(), and print.

Referenced by DolGeoIP\__construct(), mailing_thirdparties_services_expired\__construct(), DoliDBMysqli\__construct(), DoliDBSqlite3\__construct(), DoliDBPgsql\__construct(), CSMSFile\__construct(), DolEditor\__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\accountDeactivate(), 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(), 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(), addFileIntoDatabaseIndex(), BonPrelevement\addline(), SupplierProposal\addline(), FichinterRec\addline(), Account\addline(), Propal\addline(), FactureRec\addline(), Fichinter\addline(), Contrat\addline(), Commande\addline(), CommandeFournisseur\addline(), FactureFournisseur\addline(), ExpenseReport\addline(), Facture\addline(), Expedition\addline_batch(), Holiday\addLogCP(), BonPrelevement\AddNotification(), Localtax\addPayment(), Tva\addPayment(), PaymentLoan\addPaymentToBank(), PaymentExpenseReport\addPaymentToBank(), Paiement\addPaymentToBank(), MultiCurrency\addRateFromDolibarr(), UserGroup\addrights(), User\addrights(), MailingTargets\addTargetsToDatabase(), Task\addTimeSpent(), ActionsMyModule\afterPDFCreation(), Categorie\already_exists(), BlockedLog\alreadyUsed(), Holiday\approve(), CommandeFournisseur\approve(), Contrat\array_detail(), Ticket\assignUser(), Commande\availability(), Propal\availability(), barcode_encode(), barcode_encode_genbarcode(), barcode_print(), ActionsMyModule\beforePDFCreation(), ActionsDatapolicy\beforePDFCreation(), DoliDB\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(), Expedition\cancel(), Stripe\cardStripe(), 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(), mod_codecompta_digitaria\checkIfAccountancyCodeIsAlreadyUsed(), checkLoginPassEntity(), AccountingAccount\checkUsage(), Propal\classifyBilled(), Commande\classifyBilled(), Commande\classifyUnBilled(), MailingTargets\clear_target(), User\clearrights(), Product\clone_associations(), Product\clone_fournisseurs(), Product\clone_price(), DoliDBMysqli\close(), DoliDBSqlite3\close(), DoliDBPgsql\close(), Ticket\close(), Societe\codeclient_modifiable(), Societe\codefournisseur_modifiable(), CommandeFournisseur\commande(), DoliDB\commit(), complete_dictionary_with_modules(), complete_elementList_with_modules(), complete_head_from_modules(), complete_substitutions_array(), completeFileArrayWithDatabaseInfo(), DoliDBMysqli\connect(), DoliDBSqlite3\connect(), Ldap\connect_bind(), MailmanSpip\connectSpip(), Form\constructProductListOption(), Categorie\containsObject(), DoliDBSqlite3\convertSQLFromMysql(), WebsitePage\countAll(), Categorie\countNbOfCategories(), BankCateg\create(), Link\create(), Propalmergepdfproduct\create(), Cpaiement\create(), Productbatch\create(), PriceExpression\create(), Ctyperesource\create(), Ctypent\create(), CUnits\create(), Dolresource\create(), PaymentTerm\create(), PriceGlobalVariable\create(), Cchargesociales\create(), ProductStockEntrepot\create(), RejetPrelevement\create(), Localtax\create(), Cstate\create(), Ccountry\create(), PriceGlobalVariableUpdater\create(), Productcustomerprice\create(), Tva\create(), CProductNature\create(), AssetType\create(), ExpeditionLineBatch\create(), PaymentExpenseReport\create(), Comment\create(), PaymentDonation\create(), MultiCurrency\create(), PaymentSocialContribution\create(), PaymentLoan\create(), LoanSchedule\create(), Fiscalyear\create(), Delivery\create(), Cronjob\create(), CashControl\create(), CommandeFournisseurDispatch\create(), AdvanceTargetingMailing\create(), EcmDirectory\create(), Events\create(), Deplacement\create(), AccountancySystem\create(), Task\create(), RemiseCheque\create(), Productlot\create(), Opensurveysondage\create(), AccountancyCategory\create(), Bookmark\create(), Website\create(), PaiementFourn\create(), Establishment\create(), Menubase\create(), EcmFiles\create(), Loan\create(), Entrepot\create(), Mailing\create(), BookKeeping\create(), BlockedLogAuthority\create(), Reception\create(), DiscountAbsolute\create(), ChargeSociales\create(), Paiement\create(), ExpenseReport\create(), AccountingAccount\create(), Fichinter\create(), Import\create(), Holiday\create(), Project\create(), AdherentType\create(), Expedition\create(), FactureFournisseur\create(), PaymentSalary\create(), Contact\create(), ActionComm\create(), Categorie\create(), PaymentVarious\create(), Ticket\create(), Facture\create(), Product\create(), Adherent\create(), Account\create(), Export\create(), BlockedLog\create(), CurrencyRate\create(), Societe\create(), BonPrelevement\create(), SupplierProposal\create(), Commande\create(), Contrat\create(), Propal\create(), CommandeFournisseur\create(), User\create(), DolibarrModules\create_dirs(), User\create_from_contact(), User\create_from_member(), Societe\create_from_member(), Societe\create_individual(), ExtraFields\create_label(), Delivery\create_line(), createActionComm(), MouvementStock\createBatch(), Fournisseur\CreateCategory(), CommonObject\createCommon(), createContact(), Holiday\createCPusers(), EmailSenderProfile\createFromClone(), EmailCollectorFilter\createFromClone(), Asset\createFromClone(), SocieteAccount\createFromClone(), EmailCollectorAction\createFromClone(), RecruitmentCandidature\createFromClone(), RecruitmentJobPosition\createFromClone(), CompanyPaymentMode\createFromClone(), BOM\createFromClone(), MyObject\createFromClone(), EmailCollector\createFromClone(), Mo\createFromClone(), Hook\createFromClone(), Cchargesociales\createFromClone(), Inventory\createFromClone(), Ctyperesource\createFromClone(), ProductStockEntrepot\createFromClone(), Productlot\createFromClone(), Website\createFromClone(), WebsitePage\createFromClone(), EcmFiles\createFromClone(), Propal\createFromClone(), Project\createFromClone(), BookKeeping\createFromClone(), Task\createFromClone(), Contrat\createFromClone(), Facture\createFromCurrent(), createInvoice(), createInvoiceFromOrder(), createOrder(), createPayment(), Stripe\createPaymentStripe(), createProductOrService(), createProject(), FactureRec\createRecurringInvoices(), BookKeeping\createStd(), createThirdParty(), createUserFromThirdparty(), Stripe\customerStripe(), DoliDBPgsql\DDLAddField(), DoliDBPgsql\DDLCreateDb(), DoliDBPgsql\DDLCreateTable(), DoliDBPgsql\DDLCreateUser(), DoliDBPgsql\DDLDescTable(), DoliDBPgsql\DDLDropField(), DoliDBPgsql\DDLInfoTable(), DoliDBPgsql\DDLUpdateField(), Societe\del_commercial(), Product\del_sousproduit(), MailmanSpip\del_to_mailman(), MailmanSpip\del_to_spip(), Categorie\del_type(), delDocumentModel(), BankCateg\delete(), PriceGlobalVariable\delete(), Cstate\delete(), Productbatch\delete(), Ctypent\delete(), Ccountry\delete(), Fiscalyear\delete(), PriceGlobalVariableUpdater\delete(), CompanyBankAccount\delete(), ChargeSociales\delete(), Loan\delete(), Events\delete(), DiscountAbsolute\delete(), Localtax\delete(), PaymentSalary\delete(), RemiseCheque\delete(), CProductNature\delete(), PriceExpression\delete(), Subscription\delete(), Comment\delete(), Tva\delete(), Cchargesociales\delete(), Import\delete(), PaymentTerm\delete(), Cpaiement\delete(), PaymentVarious\delete(), Deplacement\delete(), PaymentExpenseReport\delete(), Establishment\delete(), MultiCurrency\delete(), LoanSchedule\delete(), PaymentLoan\delete(), Propalmergepdfproduct\delete(), Entrepot\delete(), AccountancyCategory\delete(), CUnits\delete(), Link\delete(), PaymentDonation\delete(), Ctyperesource\delete(), PaymentSocialContribution\delete(), Opensurveysondage\delete(), ProductStockEntrepot\delete(), EcmDirectory\delete(), Dolresource\delete(), AccountingAccount\delete(), CommandeFournisseurDispatch\delete(), FichinterRec\delete(), Productlot\delete(), Menubase\delete(), AdvanceTargetingMailing\delete(), Task\delete(), Mailing\delete(), Don\delete(), Categorie\delete(), Website\delete(), Ldap\delete(), Cronjob\delete(), EcmFiles\delete(), Project\delete(), Documents\delete(), FactureRec\delete(), Export\delete(), Productcustomerprice\delete(), Reception\delete(), ActionComm\delete(), CurrencyRate\delete(), Adherent\delete(), Fichinter\delete(), Ticket\delete(), Holiday\delete(), Account\delete(), ExpenseReport\delete(), FactureFournisseur\delete(), Contact\delete(), Contrat\delete(), Product\delete(), User\delete(), BookKeeping\delete(), Expedition\delete(), Societe\delete(), AccountLine\delete(), CommandeFournisseur\delete(), SupplierProposal\delete(), Facture\delete(), ExpeditionLigne\delete(), Propal\delete(), SupplierInvoiceLine\delete(), SupplierProposalLine\delete(), Commande\delete(), CommandeFournisseurLigne\delete(), PropaleLigne\delete(), OrderLine\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(), CommonObject\deleteCommon(), AccountancyCategory\deleteCptCat(), deleteFilesIntoDatabaseIndex(), ExpeditionLineBatch\deletefromexp(), FichinterLigne\deleteline(), Contrat\deleteline(), FactureFournisseur\deleteline(), ExpenseReport\deleteline(), Facture\deleteline(), CommonObject\deleteLineCommon(), BookKeeping\deleteMvtNum(), deleteProductOrService(), deleteThirdParty(), AdherentType\delMultiLangs(), Product\delMultiLangs(), Task\delTimeSpent(), Commande\demand_reason(), Propal\demand_reason(), CommonInvoice\demande_prelevement(), CommonInvoice\demande_prelevement_delete(), CommandeFournisseur\dispatchProduct(), AccountancyCategory\display(), doc_label_pdf_create(), EmailCollector\doCollect(), EmailCollector\doCollectOneCollector(), dol_add_file_process(), AntiVir\dol_avscan_file(), dol_check_secure_access_document(), dol_convert_file(), dol_copy(), dol_delete_dir(), dol_delete_dir_recursive(), dol_delete_file(), dol_dir_list(), dol_ftp_connect(), dol_getIdFromCode(), dol_htmloutput_mesg(), dol_imageResizeOrCrop(), dol_include_once(), dol_json_decode(), dol_json_encode(), dol_meta_create(), dol_mkdir(), dol_mktime(), dol_move(), dol_move_uploaded_file(), dol_print_date(), dol_print_error(), dol_print_file(), dol_set_user_param(), dol_shutdown(), dol_stringtotime(), dol_uncompress(), dolCopyDir(), dolGetElementUrl(), dolibarr_del_const(), dolibarr_get_const(), dolibarr_install_syslog(), dolibarr_set_const(), dolReplaceInFile(), dolSaveCssFile(), dolSaveHtaccessFile(), dolSaveHtmlHeader(), dolSaveJsFile(), dolSaveManifestJson(), dolSaveMasterFile(), dolSavePageAlias(), dolSavePageContent(), dolSaveReadme(), dolSaveRobotFile(), dolWebsiteOutput(), dolWebsiteReplacementOfLinks(), Asset\doScheduledJob(), Hook\doScheduledJob(), RecruitmentCandidature\doScheduledJob(), BOM\doScheduledJob(), MyObject\doScheduledJob(), RecruitmentJobPosition\doScheduledJob(), Mo\doScheduledJob(), DolGraph\draw(), DolGraph\draw_chart(), DolGraph\draw_jflot(), Utils\dumpDatabase(), FormCompany\effectif_array(), encodedecode_dbpassconf(), envoi_mail(), Utils\executeCLI(), HookManager\executeHooks(), PrestaShopWebservice\executeRequest(), BookKeeping\export_bookkeeping(), Website\exportWebSite(), LignePrelevement\fetch(), RemiseCheque\fetch(), AccountancySystem\fetch(), AccountingJournal\fetch(), CActionComm\fetch(), Bookmark\fetch(), BankCateg\fetch(), DiscountAbsolute\fetch(), Loan\fetch(), ChargeSociales\fetch(), Productbatch\fetch(), PriceExpression\fetch(), ModeleBoxes\fetch(), PriceGlobalVariable\fetch(), BlockedLogAuthority\fetch(), Cstate\fetch(), UserGroup\fetch(), Propalmergepdfproduct\fetch(), Ccountry\fetch(), PriceGlobalVariableUpdater\fetch(), PaymentTerm\fetch(), Ctyperesource\fetch(), AccountingAccount\fetch(), ProductStockEntrepot\fetch(), Cpaiement\fetch(), Dolresource\fetch(), Cchargesociales\fetch(), Comment\fetch(), PaymentExpenseReport\fetch(), MultiCurrency\fetch(), PaymentLoan\fetch(), Subscription\fetch(), LoanSchedule\fetch(), PaymentDonation\fetch(), PaymentSalary\fetch(), AdvanceTargetingMailing\fetch(), Localtax\fetch(), Events\fetch(), Fiscalyear\fetch(), PaymentSocialContribution\fetch(), AccountancyCategory\fetch(), Opensurveysondage\fetch(), Tva\fetch(), CommandeFournisseurDispatch\fetch(), Task\fetch(), PaymentVarious\fetch(), WebsitePage\fetch(), Productcustomerprice\fetch(), Productlot\fetch(), AssetType\fetch(), FichinterRec\fetch(), Mailing\fetch(), Import\fetch(), Deplacement\fetch(), BonPrelevement\fetch(), Establishment\fetch(), Website\fetch(), Cronjob\fetch(), Delivery\fetch(), CommandeFournisseur\fetch(), Link\fetch(), Categorie\fetch(), RejetPrelevement\fetch(), EcmDirectory\fetch(), Holiday\fetch(), Reception\fetch(), EcmFiles\fetch(), Menubase\fetch(), User\fetch(), Fichinter\fetch(), Entrepot\fetch(), AdherentType\fetch(), FactureRec\fetch(), Project\fetch(), Ticket\fetch(), Expedition\fetch(), FactureFournisseur\fetch(), MouvementStock\fetch(), Don\fetch(), BlockedLog\fetch(), Contrat\fetch(), ActionComm\fetch(), BookKeeping\fetch(), Export\fetch(), CurrencyRate\fetch(), Contact\fetch(), Account\fetch(), SupplierProposal\fetch(), Ldap\fetch(), Adherent\fetch(), Propal\fetch(), FichinterLigne\fetch(), Societe\fetch(), Facture\fetch(), Commande\fetch(), AccountLine\fetch(), FactureLigneRec\fetch(), Product\fetch(), ContratLigne\fetch(), CommandeFournisseurLigne\fetch(), Productcustomerprice\fetch_all(), Cronjob\fetch_all(), Dolresource\fetch_all(), Productcustomerprice\fetch_all_log(), Dolresource\fetch_all_resources(), Dolresource\fetch_all_used(), AdvanceTargetingMailing\fetch_by_element(), AdvanceTargetingMailing\fetch_by_mailing(), Propalmergepdfproduct\fetch_by_product(), Dolresource\fetch_element_resource(), ExpenseReport\fetch_line_by_project(), FichinterRec\fetch_lines(), CommandeFournisseur\fetch_lines(), FactureRec\fetch_lines(), Delivery\fetch_lines(), FactureFournisseur\fetch_lines(), Contrat\fetch_lines(), ExpenseReport\fetch_lines(), Fichinter\fetch_lines(), Expedition\fetch_lines(), Propal\fetch_lines(), Facture\fetch_lines(), Commande\fetch_lines(), ExtraFields\fetch_name_optionals_label(), ProductFournisseur\fetch_product_fournisseur_price(), Adherent\fetch_subscriptions(), ExpenseReport\fetch_users_approver_expensereport(), Holiday\fetch_users_approver_holiday(), AccountingJournal\fetchAll(), ExpeditionLineBatch\fetchAll(), CProductNature\fetchAll(), CUnits\fetchAll(), Ctyperesource\fetchAll(), Link\fetchAll(), ProductStockEntrepot\fetchAll(), RecruitmentCandidature\fetchAll(), RecruitmentJobPosition\fetchAll(), WebsitePage\fetchAll(), Website\fetchAll(), EmailCollector\fetchAll(), LoanSchedule\fetchAll(), Hook\fetchAll(), BOM\fetchAll(), MyObject\fetchAll(), Mo\fetchAll(), EcmFiles\fetchAll(), Holiday\fetchAll(), CommandeFournisseurDispatch\fetchAll(), Ticket\fetchAll(), BookKeeping\fetchAll(), BOMLine\fetchAll(), MoLine\fetchAll(), User\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(), Productbatch\findAllForProduct(), FormFile\form_attach_new_file(), Form\form_confirm(), form_constantes(), FormCompany\form_prospect_level(), FormCompany\formProspectContactLevel(), BonPrelevement\generate(), Don\generateDocument(), RemiseCheque\generatePdf(), Product\get_barcode(), Product\get_buyprice(), User\get_children(), mod_codecompta_aquarium\get_code(), mod_codecompta_digitaria\get_code(), Societe\get_codeclient(), Societe\get_codefournisseur(), BookKeeping\get_compte_desc(), get_default_tva(), Project\get_element_list(), EcmDirectory\get_full_arbo(), Categorie\get_full_arbo(), User\get_full_tree(), get_localtax(), get_next_value(), 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(), getAllImages(), ProjectStats\getAllProjectByStatus(), ExpenseReportIk\getAllRanges(), ExpenseReportRule\getAllRule(), TaskStats\getAllTaskByStatus(), Stats\getAmountByMonthWithPrevYear(), Paiement\getAmountsArray(), DiscountAbsolute\getAvailableDiscounts(), PaiementFourn\getBillsArray(), Paiement\getBillsArray(), getCategory(), AccountancyCategory\getCats(), AccountancyCategory\getCatsCpts(), Product\getChildsArbo(), Holiday\getConfCP(), getContact(), Contact\getContactRoles(), getContactsForThirdParty(), Holiday\getCPforUser(), AccountancyCategory\getCptBK(), AccountancyCategory\getCptsCat(), SocieteAccount\getCustomerAccount(), PaymentTerm\getDefaultId(), getDocument(), Dolresource\getElementResources(), ExpenseReportLine\getExpAmount(), getFormeJuridiqueLabel(), MultiCurrency\getIdAndTxFromCode(), MultiCurrency\getIdFromCode(), getInvoice(), MultiCurrency\getInvoiceRate(), getInvoicesForThirdParty(), Translate\getLabelFromKey(), CommonObjectLine\getLabelOfUnit(), Product\getLabelOfUnit(), getLanguageCodeFromCountryCode(), DolibarrModules\getLastActivationDate(), DolibarrModules\getLastActivationInfo(), Product\getLibFinished(), SupplierProposal\getLinesArray(), getListActionCommType(), RejetPrelevement\getListInvoices(), BonPrelevement\getListInvoices(), Contrat\getListOfContracts(), getListOfGroups(), InterfaceNotification\getListOfManagedEvents(), getListOfModels(), CommonInvoice\getListOfPayments(), getListOfProductsOrServices(), getListOfThirdParties(), getLocalTaxesFromRate(), ExpenseReportIk\getMaxRangeNumber(), Stats\getNbByMonthWithPrevYear(), Commande\getNbOfShipments(), BookKeeping\getNextNumMvt(), Facture\getNextNumRef(), mod_reception_beryl\getNextValue(), mod_chequereceipt_mint\getNextValue(), mod_bom_standard\getNextValue(), mod_commande_marbre\getNextValue(), mod_mo_standard\getNextValue(), mod_codeclient_monkey\getNextValue(), mod_myobject_standard\getNextValue(), mod_recruitmentjobposition_standard\getNextValue(), mod_expedition_safor\getNextValue(), mod_expensereport_jade\getNextValue(), mod_recruitmentcandidature_standard\getNextValue(), mod_payment_cicada\getNextValue(), mod_supplier_payment_bronan\getNextValue(), mod_ticket_simple\getNextValue(), mod_project_simple\getNextValue(), mod_contract_serpis\getNextValue(), mod_task_simple\getNextValue(), mod_propale_marbre\getNextValue(), mod_supplier_proposal_marbre\getNextValue(), mod_holiday_madonna\getNextValue(), mod_delivery_jade\getNextValue(), mod_takepos_ref_simple\getNextValue(), mod_facture_mars\getNextValue(), mod_facture_fournisseur_cactus\getNextValue(), mod_facture_terre\getNextValue(), Notify\getNotificationsArray(), Categories\getObjects(), Categorie\getObjectsInCateg(), getOrder(), getOrdersForThirdParty(), Societe\getOutstandingBills(), Societe\getOutstandingOrders(), Societe\getOutstandingProposals(), Stripe\getPaymentIntent(), GETPOST(), getProductOrService(), getProductsForCategory(), getProject(), ExpenseReportIk\getRangesByCategory(), MultiCurrency\getRate(), Ldap\getRecords(), Dolistore\getRemoteCategories(), Dolistore\getRemoteProducts(), UserGroup\getrights(), BookKeeping\getRootAccount(), Stripe\getSetupIntent(), CommonInvoice\getSommePaiement(), ChargeSociales\getSommePaiement(), Tva\getSommePaiement(), getSourceDocRef(), getState(), Stripe\getStripeAccount(), DiscountAbsolute\getSumCreditNotesUsed(), AccountancyCategory\getSumDebitCredit(), DiscountAbsolute\getSumDepositsUsed(), DiscountAbsolute\getSumFromThisCreditNotesNotUsed(), Task\getSummaryOfTimeSpent(), Task\getSumOfAmount(), Loan\getSumPayment(), ExpenseReport\getSumPayments(), getSupplierInvoice(), getSupplierInvoicesForThirdParty(), Task\getTasksArray(), ExpenseReportIk\getTaxCategories(), getTaxesFromId(), getThirdParty(), SocieteAccount\getThirdPartyID(), ProjectStats\getTransformRateByMonthWithPrevYear(), getURLContent(), getUser(), Task\getUserRolesForProjectsOrTasks(), getVersions(), ProjectStats\getWeightedAmountByMonthWithPrevYear(), Task\hasChildren(), hash_call(), Task\hasTimeSpent(), ImportCsv\import_insert(), ImportXlsx\import_insert(), ImportCsv\import_open_file(), ImportXlsx\import_open_file(), Website\importWebSite(), Login\index(), BankAccounts\index(), Documents\index(), Projects\index(), Donations\index(), Shipments\index(), Contracts\index(), Interventions\index(), Tasks\index(), Proposals\index(), Orders\index(), Establishment\info(), Fiscalyear\info(), Deplacement\info(), Entrepot\info(), AccountingAccount\info(), ChargeSociales\info(), Loan\info(), PaymentExpenseReport\info(), PaymentSalary\info(), PaymentVarious\info(), Tva\info(), Cronjob\info(), Paiement\info(), Don\info(), ActionComm\info(), Adherent\info(), Reception\initAsSpecimen(), Categorie\initAsSpecimen(), Expedition\initAsSpecimen(), CommandeFournisseur\initAsSpecimen(), Commande\initAsSpecimen(), HookManager\initHooks(), FichinterLigne\insert(), AccountLine\insert(), ExpenseReportLine\insert(), ExpeditionLigne\insert(), SupplierProposalLine\insert(), ContratLigne\insert(), SupplierInvoiceLine\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\letteringThirdparty(), DiscountAbsolute\link_to_invoice(), 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(), AssetType\listAssetForAssetType(), InfoBox\listBoxes(), CActionComm\liste_array(), ModeleExports\liste_modeles(), ModeleImports\liste_modeles(), PriceGlobalVariable\listGlobalVariables(), UserGroup\listGroupsForUser(), AdherentType\listMembersForMemberType(), listOfSessions(), Deplacement\listOfTypes(), ExpenseReport\listOfTypes(), PriceGlobalVariableUpdater\listPendingUpdaters(), ProductFournisseur\listProductFournisseurPriceLog(), 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_transport_mode(), Form\load_cache_types_fees(), Form\load_cache_types_paiements(), Form\load_cache_vatrates(), EcmDirectory\load_motherof(), Categorie\load_motherof(), Contact\load_ref_elements(), Product\load_stats_commande(), Product\load_stock(), Product\loadBatchInfo(), box_ficheinter\loadBox(), box_birthdays\loadBox(), box_birthdays_members\loadBox(), box_actions\loadBox(), box_clients\loadBox(), box_customers_outstanding_bill_reached\loadBox(), box_prospect\loadBox(), box_goodcustomers\loadBox(), box_comptes\loadBox(), Ticket\loadCacheCategoriesTickets(), Translate\loadCacheCurrencies(), Ticket\loadCacheMsgsTicket(), Ticket\loadCacheSeveritiesTickets(), Ticket\loadCacheTypesTickets(), Commande\loadExpeditions(), Translate\loadFromDatabase(), FormProduct\loadLotStock(), User\loadParentOf(), CommandeFournisseur\loadReceptions(), Project\loadTimeSpent(), Project\loadTimeSpentMonth(), FormProduct\loadWarehouses(), makesalt(), Ticket\markAsRead(), Menubase\menuLeftCharger(), Thirdparties\merge(), Ticket\messageSend(), Ldap\modify(), FormAdvTargetEmailing\multiselectCivility(), BonPrelevement\NbFactureAPrelever(), Facture\newCycle(), num_open_day(), num_public_holiday(), ExpenseReport\offsetAlreadyGiven(), ExportTsv\open_file(), ExportCsv\open_file(), ExportExcel2007\open_file(), EmailCollector\overwritePropertiesOfObject(), RssParser\parser(), pdf_getFormat(), ExpenseReport\periode_existe(), ZapierApi\post(), print_paybox_redirect(), print_paypal_redirect(), print_titre(), printing_printipp\printFile(), PriceGlobalVariableUpdater\process(), Utils\purgeFiles(), purgeSessions(), DoliDBMysqli\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(), Reception\reOpen(), SupplierProposal\reopen(), Expedition\reOpen(), Propal\reopen(), Societe\replaceThirdparty(), Cronjob\reprogram_jobs(), Mailing\reset_targets_status(), Adherent\resiliate(), DoliDB\rollback(), Cronjob\run_jobs(), run_sql(), Interfaces\run_triggers(), InterfaceActionsBlockedLog\runTrigger(), InterfaceMailmanSpipsynchro\runTrigger(), InterfaceTicketEmail\runTrigger(), InterfaceLogevents\runTrigger(), InterfaceLdapsynchro\runTrigger(), InterfaceWorkflowManager\runTrigger(), InterfaceStripe\runTrigger(), InterfaceContactRoles\runTrigger(), InterfaceZapierTriggers\runTrigger(), InterfaceActionsAuto\runTrigger(), InterfaceNotification\runTrigger(), InterfaceMyModuleTriggers\runTrigger(), InfoBox\saveboxorder(), Ldap\search(), Ticket\searchContactByEmail(), Ticket\searchSocidByEmail(), 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(), Form\selectEstablishments(), FormTicket\selectGroupTickets(), FormOrder\selectInputMethod(), FormProduct\selectLotStock(), FormProjets\selectOpportunityStatus(), FormPropal\selectProposalStatus(), FormTicket\selectSeveritiesTickets(), Form\selectShippingMethod(), Form\selectSituationInvoices(), Form\selectTransportMode(), FormWebsite\selectTypeOfContainer(), FormTicket\selectTypesTickets(), FormProduct\selectWarehouses(), FormAccounting\selectyear_accountancy_bookkepping(), Notify\send(), Adherent\send_an_email(), User\send_password(), ActionComm\sendEmailsReminder(), CSMSFile\sendfile(), CMailFile\sendfile(), Adherent\sendReminderForExpiredSubscription(), dolReceiptPrinter\sendTestToPrinter(), Ticket\sendTicketMessageByEmail(), dolReceiptPrinter\sendToPrinter(), 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(), Propal\set_demand_reason(), Fichinter\set_description(), 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(), Propal\set_remise_absolue(), Commande\set_remise_absolue(), Facture\set_remise_absolue(), Societe\set_remise_client(), Propal\set_remise_percent(), Societe\set_remise_supplier(), Commande\set_reopen(), ExpenseReport\set_save_from_refuse(), FactureFournisseur\set_unpaid(), ExpenseReport\set_unpaid(), Facture\set_unpaid(), Product\setAccountancyCode(), ExpenseReport\setApproved(), CompanyBankAccount\setAsDefault(), CompanyPaymentMode\setAsDefault(), FichinterRec\setAutoValidate(), FactureRec\setAutoValidate(), Societe\setCategories(), Project\setClose(), Reception\setClosed(), Expedition\setClosed(), Ticket\setContract(), Ticket\setCustomer(), Delivery\setDeliveryDate(), Reception\setDeliveryDate(), SupplierProposal\setDeliveryDate(), Expedition\setDeliveryDate(), Propal\setDeliveryDate(), CommandeFournisseur\setDeliveryDate(), Commande\setDeliveryDate(), ExpenseReport\setDeny(), Fichinter\setDraft(), Commande\setDraft(), FactureFournisseur\setDraft(), Reception\setDraft(), SupplierProposal\setDraft(), Propal\setDraft(), Facture\setDraft(), setEventMessages(), Facture\setFinal(), FichinterRec\setFrequencyAndUnit(), FactureRec\setFrequencyAndUnit(), FactureRec\setGeneratePdf(), setIncoterms(), User\SetInGroup(), FichinterRec\setMaxPeriod(), FactureRec\setMaxPeriod(), FactureRec\setModelPdf(), AdherentType\setMultiLangs(), Product\setMultiLangs(), Categorie\setMultiLangs(), Societe\setMysoc(), FichinterRec\setNextDate(), FactureRec\setNextDate(), Adherent\setPassword(), User\setPassword(), Productcustomerprice\setPriceOnAffiliateThirdparty(), Ticket\setProgression(), Ticket\setProject(), Facture\setRetainedWarranty(), Facture\setRetainedWarrantyDateLimit(), User\setstatus(), Contact\setstatus(), CommandeFournisseur\setStatus(), ProductFournisseur\setSupplierPriceExpression(), Adherent\setThirdPartyId(), Societe\setThirdpartyType(), Adherent\setUserId(), setUserPassword(), Fichinter\setValid(), Project\setValid(), ExpenseReport\setValidate(), Conf\setValues(), show_actions_done(), show_contacts(), FormSms\show_form(), show_list_sending_receive(), show_ticket_messaging(), ModeleBoxes\showBox(), FormFile\showdocuments(), ExtraFields\showInputField(), ExtraFields\showOutputField(), BonPrelevement\SommeAPrelever(), Adherent\subscriptionComplementaryActions(), MultiCurrency\syncRates(), tax_by_rate(), tax_by_thirdparty(), thirdparty_doc_create(), top_htmlhead(), BookKeeping\transformTransaction(), tree_recur(), FormCompany\typent_array(), unActivateModule(), DiscountAbsolute\unlink_invoice(), PaymentSalary\update(), Link\update(), BankCateg\update(), Localtax\update(), Tva\update(), AssetType\update(), PriceGlobalVariable\update(), PaymentVarious\update(), Fiscalyear\update(), Events\update(), Productbatch\update(), Cstate\update(), PriceGlobalVariableUpdater\update(), Ctypent\update(), Ccountry\update(), Bookmark\update(), Deplacement\update(), Cpaiement\update(), Cchargesociales\update(), Dolresource\update(), Comment\update(), EcmDirectory\update(), Establishment\update(), Mailing\update(), BlockedLogAuthority\update(), Subscription\update(), PriceExpression\update(), PaymentTerm\update(), PaymentExpenseReport\update(), Entrepot\update(), CProductNature\update(), PaymentDonation\update(), PaymentLoan\update(), MultiCurrency\update(), LoanSchedule\update(), AccountancyCategory\update(), Propalmergepdfproduct\update(), Ctyperesource\update(), CUnits\update(), PaymentSocialContribution\update(), Opensurveysondage\update(), Menubase\update(), ProductStockEntrepot\update(), CommandeFournisseurDispatch\update(), AccountingAccount\update(), Productlot\update(), ChargeSociales\update(), Loan\update(), AdherentType\update(), Task\update(), Fichinter\update(), AdvanceTargetingMailing\update(), Project\update(), FactureRec\update(), Don\update(), Website\update(), ExpenseReport\update(), Contact\update(), Categorie\update(), Cronjob\update(), Productcustomerprice\update(), Ldap\update(), EcmFiles\update(), ExtraFields\update(), Adherent\update(), Account\update(), Reception\update(), Ticket\update(), Product\update(), CurrencyRate\update(), Holiday\update(), FactureFournisseur\update(), ActionComm\update(), Expedition\update(), Societe\update(), BookKeeping\update(), Contrat\update(), FichinterLigne\update(), Propal\update(), User\update(), Facture\update(), AccountLine\update(), FactureLigneRec\update(), ExpenseReportLine\update(), ExpeditionLigne\update(), ContratLigne\update(), SupplierProposalLine\update(), SupplierInvoiceLine\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(), PaymentExpenseReport\update_fk_bank(), PaymentSocialContribution\update_fk_bank(), PaymentDonation\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(), ContratLigne\update_total(), SupplierProposalLine\update_total(), SupplierInvoiceLine\update_total(), PropaleLigne\update_total(), OrderLine\update_total(), FactureLigne\update_total(), AccountancyCategory\updateAccAcc(), updateActionComm(), RemiseCheque\updateAmount(), Ldap\updateAttribute(), BookKeeping\updateByMvt(), CommonObject\updateCommon(), Holiday\updateConfCP(), updateContact(), updateInvoice(), Lettering\updateLettering(), SupplierProposal\updateline(), Propal\updateline(), FactureRec\updateline(), Contrat\updateline(), FactureFournisseur\updateline(), CommandeFournisseur\updateline(), Commande\updateline(), Facture\updateline(), FichinterRec\updateNbGenDone(), SupplierProposal\updateOrCreatePriceFournisseur(), updateOrder(), Product\updatePrice(), updateProductOrService(), Holiday\updateSoldeCP(), updateThirdParty(), Task\updateTimeSpent(), Societe\useNPR(), Societe\useRevenueStamp(), CashControl\valid(), Delivery\valid(), Commande\valid(), Mailing\valid(), Reception\valid(), CommandeFournisseur\valid(), Expedition\valid(), SupplierProposal\valid(), Propal\valid(), RemiseCheque\validate(), RecruitmentCandidature\validate(), Contrat\validate(), RecruitmentJobPosition\validate(), MyObject\validate(), BOM\validate(), Holiday\validate(), Mo\validate(), Paiement\validate(), FactureFournisseur\validate(), Adherent\validate(), Facture\validate(), validOrder(), mod_contract_olive\verif(), mod_codeclient_leopard\verif(), mod_codeproduct_leopard\verif(), mod_codeclient_monkey\verif(), mod_codecompta_aquarium\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(), Ticket\verify(), vignette(), html_cerfafr\write_file(), pdf_paiement\write_file(), doc_generic_odt\write_file(), doc_generic_ticket_odt\write_file(), doc_generic_contract_odt\write_file(), doc_generic_member_odt\write_file(), pdf_standard_myobject\write_file(), pdf_cyan\write_file(), doc_generic_bom_odt\write_file(), doc_generic_reception_odt\write_file(), doc_generic_mo_odt\write_file(), doc_generic_myobject_odt\write_file(), doc_generic_recruitmentjobposition_odt\write_file(), doc_generic_supplier_order_odt\write_file(), doc_generic_stock_odt\write_file(), pdf_standard_recruitmentjobposition\write_file(), pdf_sponge\write_file(), doc_generic_invoice_odt\write_file(), doc_generic_shipment_odt\write_file(), doc_generic_order_odt\write_file(), pdf_azur\write_file(), doc_generic_product_odt\write_file(), doc_generic_usergroup_odt\write_file(), doc_generic_user_odt\write_file(), pdf_crabe\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 
)
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 used to display data 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 3183 of file functions.lib.php.

References dol_string_nohtmltag(), dol_strlen(), dol_substr(), and dol_textishtml().

Referenced by Product\_get_stats(), CommActionRapport\_pages(), FormAdvTargetEmailing\advMultiselectarraySelllist(), Export\build_filterField(), Events\create(), WebsitePage\create(), ActionComm\create(), Stripe\createPaymentStripe(), dol_buildlogin(), dol_print_email(), dol_print_url(), BonPrelevement\EnregDestinataireSEPA(), AccountancyExport\exportBob50(), AccountancyExport\exportGestimumV3(), AccountancyExport\exportGestimumV5(), AccountancyExport\exportLDCompta10(), mailing_fraise\formFilter(), mailing_advthirdparties\formFilter(), mailing_thirdparties\formFilter(), Translate\get_available_languages(), getCommonSubstitutionArray(), CommonObject\getFullName(), getListOfModels(), AssetType\getNomUrl(), EcmDirectory\getNomUrl(), Loan\getNomUrl(), AdherentType\getNomUrl(), PaymentExpenseReport\getNomUrl(), PaymentDonation\getNomUrl(), PaymentSocialContribution\getNomUrl(), Contact\getNomUrl(), ActionComm\getNomUrl(), Facture\getNomUrl(), ExpenseReport\getNomUrl(), Adherent\getNomUrl(), FactureFournisseur\getNomUrl(), Societe\getNomUrl(), User\getNomUrl(), Product\getNomUrl(), Stripe\getPaymentIntent(), getSourceDocRef(), FormFile\list_of_autoecmfiles(), FormFile\list_of_documents(), box_graph_product_distribution\loadBox(), 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(), FormProjets\select_projects_list(), Form\select_remises(), Form\select_types_paiements(), FormResource\select_types_resource(), FormTicket\selectGroupTickets(), Form\selectInvoice(), FormTicket\selectSeveritiesTickets(), FormProjets\selectTasks(), Form\selectTransportMode(), FormTicket\selectTypesTickets(), ActionComm\sendEmailsReminder(), show_actions_done(), show_ticket_messaging(), ModeleBoxes\showBox(), FormFile\showdocuments(), ExtraFields\showOutputField(), Societe\thirdparty_and_contact_email_array(), Societe\thirdparty_and_contact_phone_array(), top_menu_user(), Translate\trans(), AccountancyExport\trunc(), CompanyBankAccount\update(), WebsitePage\update(), pdf_beluga\write_file(), and pdf_standard\write_file().

dol_ucfirst (   $string,
  $encoding = "UTF-8" 
)

Convert first character of the first word of a string to upper.

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

Parameters
string$stringString to encode
string$encodingCharacter set encodign
Returns
string String converted

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

Referenced by dol_print_socialnetworks().

dol_ucwords (   $string,
  $encoding = "UTF-8" 
)

Convert first character of all the words of a string to upper.

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

Parameters
string$stringString to encode
string$encodingCharacter set encodign
Returns
string String converted

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

Referenced by CommonObject\setUpperOrLowerCase().

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 2986 of file functions.lib.php.

References getUserRemoteIP().

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 7377 of file functions.lib.php.

dolButtonToOpenUrlInDialogPopup (   $name,
  $label,
  $buttonstring,
  $url,
  $disabled = '' 
)

Return HTML code to output a button to open a dialog popup box.

Such buttons must be included inside a HTML form.

Parameters
string$nameA name for the html component
string$labelLabel of button
string$buttonstringbutton string
string$urlUrl to open
string$disabledDisabled text
Returns
string HTML component with button

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

References dol_escape_htmltag(), and dol_escape_js().

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 7961 of file functions.lib.php.

Referenced by EmailCollector\doCollectOneCollector(), and EmailCollector\overwritePropertiesOfObject().

dolGetBadge (   $label,
  $html = '',
  $type = 'primary',
  $mode = '',
  $url = '',
  $params = array() 
)

Function dolGetBadge.

Parameters
string$labellabel of badge no html : use in alt attribute for accessibility
string$htmloptional : label of badge with html
string$typetype of badge : Primary Secondary Success Danger Warning Info Light Dark status0 status1 status2 status3 status4 status5 status6 status7 status8 status9
string$modedefault '' , 'pill', 'dot'
string$urlthe url for link
array$paramsvarious params for future : recommended rather than adding more fuction arguments. array('attr'=>array('title'=>'abc'))
Returns
string Html badge

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

Referenced by dolGetStatus().

dolGetButtonAction (   $label,
  $html = '',
  $actionType = 'default',
  $url = '',
  $id = '',
  $userRight = 1,
  $params = array() 
)

Function dolGetButtonAction.

Parameters
string$labellabel of button no html : use in alt attribute for accessibility $html is not empty
string$htmloptional : content with html
string$actionTypedefault, delete, danger
string$urlthe url for link
string$idattribute id of button
int$userRightuser action right
array$paramsvarious params for future : recommended rather than adding more function arguments
Returns
string html button

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

dolGetButtonTitle (   $label,
  $helpText = '',
  $iconClass = 'fa fa-file',
  $url = '',
  $id = '',
  $status = 1,
  $params = array() 
)

Function dolGetButtonTitle : this kind of buttons are used in title in list.

Parameters
string$labellabel of button
string$helpTextoptional : content for help tooltip
string$iconClassclass for icon element (Example: 'fa fa-file')
string$urlthe url for link
string$idattribute id of button
int$status0 no user rights, 1 active, -1 Feature Disabled, -2 disable Other reason use helpText as tooltip
array$paramsvarious params for future : recommended rather than adding more function arguments
Returns
string html button

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

References dol_escape_htmltag().

Referenced by show_contacts(), show_projects(), and FormActions\showactions().

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 2959 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, 3=Firstname if defined else lastname, 4=Lastname, 5=Lastname if defined else firstname
Returns
string Firstname + lastname or Lastname + firstname

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

Referenced by pdf_standard\_pagehead(), ActionComm\build_exportfile(), Societe\contact_array(), Societe\contact_get_property(), Societe\contact_property_array(), Tickets\getCommon(), CommonObject\getFullName(), mod_expensereport_jade\getNextValue(), ExpenseReportRule\getUserName(), Ticket\newMessage(), InterfaceTicketEmail\runTrigger(), FormAccounting\select_auxaccount(), FormOther\select_salesrepresentatives(), Notify\send(), Ticket\sendLogByEmail(), BonPrelevement\set_infotrans(), and User\user_get_property().

dolGetFirstLineOfText (   $text,
  $nboflines = 1,
  $charset = 'UTF-8' 
)

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)
string$charsetCharset of $text string (UTF-8 by default)
Returns
string Output text
See Also
dol_nboflines_bis(), dol_string_nohtmltag(), dol_escape_htmltag()

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

References dol_textishtml().

Referenced by CommActionRapport\_pages(), EmailCollector\doCollectOneCollector(), and FormMail\get_form().

dolGetStatus (   $statusLabel = '',
  $statusLabelShort = '',
  $html = '',
  $statusType = 'status0',
  $displayMode = 0,
  $url = '',
  $params = array() 
)

Output the badge of a status.

Parameters
string$statusLabelLabel of badge no html : use in alt attribute for accessibility
string$statusLabelShortShort label of badge no html
string$htmlOptional : label of badge with html
string$statusTypestatus0 status1 status2 status3 status4 status5 status6 status7 status8 status9 : image name or badge name
int$displayMode0=Long label, 1=Short label, 2=Picto + Short label, 3=Picto, 4=Picto + Long label, 5=Short label + Picto, 6=Long label + Picto
string$urlThe url for link
array$paramsVarious params. Example: array('tooltip'=>'no|...', 'badgeParams'=>...)
Returns
string Html status string

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

References dolGetBadge(), and img_picto().

Referenced by Don\LibStatut(), ActionCommReminder\LibStatut(), EmailSenderProfile\LibStatut(), CashControl\LibStatut(), Establishment\LibStatut(), Asset\LibStatut(), Loan\LibStatut(), ChargeSociales\LibStatut(), CompanyPaymentMode\LibStatut(), CommonInvoice\LibStatut(), Inventory\LibStatut(), EmailCollector\LibStatut(), Hook\LibStatut(), AdherentType\LibStatut(), Opensurveysondage\LibStatut(), Entrepot\LibStatut(), CommandeFournisseur\LibStatut(), ExpenseReport\LibStatut(), Mailing\LibStatut(), Fichinter\LibStatut(), RecruitmentCandidature\LibStatut(), WebsitePage\LibStatut(), MyObject\LibStatut(), Website\LibStatut(), Delivery\LibStatut(), BOM\LibStatut(), RecruitmentJobPosition\LibStatut(), RemiseCheque\LibStatut(), Mo\LibStatut(), Project\LibStatut(), Reception\LibStatut(), Account\LibStatut(), Holiday\LibStatut(), Ticket\LibStatut(), Cronjob\LibStatut(), ActionComm\LibStatut(), FactureRec\LibStatut(), Contact\LibStatut(), Expedition\LibStatut(), Contrat\LibStatut(), Adherent\LibStatut(), SupplierProposal\LibStatut(), BonPrelevement\LibStatut(), Societe\LibStatut(), User\LibStatut(), ContratLigne\LibStatut(), Propal\LibStatut(), Commande\LibStatut(), Product\LibStatut(), and Mailing\libStatutDest().

dolIsAllowedForPreview (   $file)

Return if a file is qualified for preview.

Parameters
string$fileFilename we looking for information
Returns
int 1 If allowed, 0 otherwise
See Also
dol_mimetype(), image_format_supported() from images.lib.php

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

Referenced by getAdvancedPreviewUrl().

fetchObjectByElement (   $element_id,
  $element_type,
  $element_ref = '' 
)

Fetch an object from its id and element_type Inclusion of classes is automatic.

Parameters
int$element_idElement id
string$element_typeElement type
string$element_refElement ref (Use this or element_id but not both)
Returns
int|object object || 0 || -1 if error

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

References getElementProperties().

Referenced by Dolresource\fetch_all_resources(), Dolresource\fetch_all_used(), Dolresource\fetch_element_resource(), and Dolresource\fetchElementResources().

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
Returns
string
Deprecated:
Form::editfieldkey

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

finishSimpleTable (   $addLineBreak = false)

Add the correct HTML close tags for "startSimpleTable(...)" (use after the last table line)

Parameters
bool$addLineBreak(optional) Add a extra line break after the complete table (<br>)
Returns
void
See Also
startSimpleTable()

Definition at line 9137 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 6829 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 5569 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 5531 of file functions.lib.php.

Referenced by SupplierProposal\add_product(), Propal\add_product(), Commande\add_product(), Product\getSellPrice(), 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 5442 of file functions.lib.php.

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

Referenced by SupplierProposal\add_product(), Propal\add_product(), Commande\add_product(), Product\getSellPrice(), Form\load_tva(), Adherent\subscriptionComplementaryActions(), and doc_generic_project_odt\write_file().

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, '').'/' or: $conf->module->dir_output.'/'.get_exdir(0, 0, 0, 0, $object, '') if multidir_output not defined. Example out with new usage: $object is invoice -> 'INYYMM-ABCD' Example out 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 | int$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 to use to get ref to forge the path.
string$modulepartType of object ('invoice_supplier, 'donation', 'invoice', ...'). Use '' for autodetect from $object.
Returns
string Dir to use ending. Example '' or '1/' or '1/2/'

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

References dol_sanitizeFileName().

Referenced by FileUpload\__construct(), pdf_standard\Add_PDF_card(), Categorie\add_photo(), FactureFournisseur\delete(), dol_banner_tab(), facturefourn_prepare_head(), Reception\fetch(), CommonDocGenerator\get_substitutionarray_user(), getCategory(), FormFile\getDocumentsLink(), Documents\getDocumentsListByElement(), getProductOrService(), getProductsForCategory(), CommonDocGenerator\getSubstitutionarrayMember(), FormFile\list_of_documents(), member_prepare_head(), migrate_user_photospath(), Documents\post(), product_prepare_head(), Form\showphoto(), FactureFournisseur\validate(), BordereauChequeBlochet\write_file(), pdf_squille\write_file(), pdf_espadon\write_file(), pdf_storm\write_file(), pdf_cornas\write_file(), pdf_rouget\write_file(), pdf_cyan\write_file(), pdf_eratosthene\write_file(), pdf_canelle\write_file(), pdf_sponge\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 = array(),
  $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 7069 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 6995 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 5012 of file functions.lib.php.

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

Referenced by SupplierProposal\add_product(), Propal\add_product(), Commande\add_product(), 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 5144 of file functions.lib.php.

References $resql.

Referenced by isOnlyOneLocalTax(), and 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 5372 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" proposal/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 5301 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 8240 of file functions.lib.php.

References dol_mimetype(), and dolIsAllowedForPreview().

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

getArrayOfSocialNetworks ( )

Get array of social network dictionary.

Returns
array Array of Social Networks Dictionary

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

References $resql.

Referenced by Adherent\_load_ldap_info(), User\_load_ldap_info(), show_contacts(), and User\update_ldap2dolibarr().

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 148 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 6229 of file functions.lib.php.

References dol_convertToWord(), 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(), dol_trunc(), getUserRemoteIP(), and price().

Referenced by Facture\create(), pdf_getSubstitutionArray(), print_auguria_menu(), print_eldy_menu(), print_left_auguria_menu(), print_left_eldy_menu(), ActionComm\sendEmailsReminder(), Adherent\sendReminderForExpiredSubscription(), MenuManager\showmenu(), doc_generic_contract_odt\write_file(), doc_generic_bom_odt\write_file(), doc_generic_mo_odt\write_file(), doc_generic_recruitmentjobposition_odt\write_file(), doc_generic_myobject_odt\write_file(), doc_generic_supplier_order_odt\write_file(), doc_generic_stock_odt\write_file(), doc_generic_invoice_odt\write_file(), doc_generic_order_odt\write_file(), doc_generic_product_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().

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
Returns
string

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

References $resql.

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$userAuthorized username
string$passPassword
string$nameName of database
int$portPort of database server
Returns
DoliDB A DoliDB instance

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

Referenced by MailmanSpip\connectSpip(), and dolSessionOpen().

getElementProperties (   $element_type)

Get an array with properties of an element.

Called by fetchObjectByElement.

Parameters
string$element_typeElement type (Value of $object->element). Example: 'action', 'facture', 'project_task' or 'object'...
Returns
array (module, classpath, element, subelement, classfile, classname)

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

Referenced by fetchObjectByElement().

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

Get list of entity id to use.

Parameters
string$elementCurrent element 'societe', 'socpeople', 'actioncomm', 'agenda', 'resource', 'product', 'productprice', 'stock', 'bom', 'mo', 'propal', 'supplier_proposal', 'invoice', 'supplier_invoice', 'payment_various', 'categorie', 'bank_account', 'bank_account', 'adherent', 'user', 'commande', 'supplier_order', 'expedition', 'intervention', 'survey', 'contract', 'tax', 'expensereport', 'holiday', 'multicurrency', 'project', 'email_template', 'event', 'donation' 'c_paiement', 'c_payment_term', ...
int$shared0=Return id of current entity only, 1=Return id of current entity + shared entities (default)
object$currentobjectCurrent object if needed
Returns
mixed Entity id(s) to use ( eg. entity IN ('.getEntity(elementname).')' )

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

Referenced by modProjet\__construct(), modSociete\__construct(), FichinterStats\__construct(), CommandeStats\__construct(), PropaleStats\__construct(), MailingTargets\addTargetsToDatabase(), ProductAttribute\countChildProducts(), ProductCombination\countNbOfCombinationForFkProductParent(), Cpaiement\create(), PaymentTerm\create(), Products\deleteAttributeValueByRef(), ProductAttributeValue\fetch(), ProductAttribute\fetch(), ProductCombination\fetch(), Categorie\fetch(), FactureFournisseur\fetch(), Propal\fetch(), Societe\fetch(), ProductAttribute\fetchAll(), ProductCombination\fetchAllByFkProductParent(), ProductCombination\fetchByFkProductChild(), Project\get_element_list(), Products\getAttributesByRef(), Products\getAttributesByRefExt(), Products\getAttributeValueById(), Products\getAttributeValueByRef(), Project\getElementCount(), mod_takepos_ref_universal\getNextValue(), mod_commande_saphir\getNextValue(), mod_propale_saphir\getNextValue(), mod_facture_mercure\getNextValue(), mailing_fraise\getSqlArrayForStats(), CdavLib\getSqlCalEvents(), Societe\id_prof_exists(), Product\isVariant(), SupplierProposal\load_board(), Ticket\load_board(), Propal\load_board(), Commande\load_board(), Fichinter\load_state_board(), Contact\load_state_board(), SupplierProposal\load_state_board(), Ticket\load_state_board(), Propal\load_state_board(), Commande\load_state_board(), Facture\load_state_board(), box_funnel_of_prospection\loadBox(), FormProduct\loadLotStock(), AdvanceTargetingMailing\query_contact(), Form\select_produits_fournisseurs_list(), Form\select_produits_list(), FormOther\select_salesrepresentatives(), and Contact\updateRoles().

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 8207 of file functions.lib.php.

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

getLanguageCodeFromCountryCode (   $countrycode)

Return default language from country code.

Return null if not found.

Parameters
string$countrycodeCountry code like 'US', 'FR', 'CA', ...
Returns
string Value of locale like 'en_US', 'fr_FR', ...

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

References dol_syslog().

Referenced by Adherent\sendReminderForExpiredSubscription().

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 possible values for localtax and type, and then provide the selected value 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 or 0 if not found), rate localtax1, localtax_type2, rate localtax2, accountancycodecust, accountancycodesupp)
See Also
getTaxesFromId()

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

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

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

GETPOST (   $paramname,
  $check = 'alphanohtml',
  $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) 'array', 'array:restricthtml' or 'array:aZ09' to check it's an array 'int'=check it's numeric (integer or float) 'intcomma'=check it's integer+comma ('1,2,3,4...') 'alpha'=Same than alphanohtml since v13 'alphanohtml'=check there is no html content and no " and no ../ 'aZ'=check it's a-z only 'aZ09'=check it's simple alpha string (recommended for keys) 'san_alpha'=Use filter_var with FILTER_SANITIZE_STRING (do not use this for free text string) 'nohtml'=check there is no html content and no " and no ../ 'restricthtml'=check html content is restricted to some tags only '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)
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|array Value found (string or array), or '' if check fails

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

References $_SERVER, checkVal(), 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_thirdparties\add_to_target(), mailing_thirdparties_services_expired\add_to_target(), mailing_mailinglist_mymodule_myobject\add_to_target(), mailing_xinputuser\add_to_target(), mailing_pomme\add_to_target(), mailing_fraise\add_to_target(), mailing_contacts1\add_to_target(), ActionsCardIndividual\assign_values(), checkLoginPassEntity(), RecruitmentJobPosition\cloture(), SupplierProposal\cloture(), Propal\cloture(), Facture\create(), ActionsDatapolicy\doActions(), dol_add_file_process(), Utils\dumpDatabase(), Form\editfieldkey(), Form\editfieldval(), fieldListAccountingCategories(), ActionsStripeconnect\formObjectOptions(), FormMail\get_form(), FormOther\getBoxesArea(), Setup\getCheckIntegrity(), ExtraFields\getOptionalsFromPost(), GETPOSTINT(), 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_propales_permonth\loadBox(), box_graph_invoices_permonth\loadBox(), box_graph_product_distribution\loadBox(), box_task\loadBox(), ActionsCardService\LoadListDatas(), ActionsCardProduct\LoadListDatas(), MenuManager\loadMenu(), main_area(), Ticket\newMessage(), print_auguria_menu(), print_left_eldy_menu(), ActionsDatapolicy\printCommonFooter(), printCommonFooter(), printingAdminPrepareHead(), restrictedArea(), InterfaceTicketEmail\runTrigger(), InterfaceStripe\runTrigger(), ExtraFields\setOptionalsFromPost(), show_actions_done(), show_contacts(), FormSms\show_form(), FormTicket\showForm(), FormTicket\showMessageForm(), ExtraFields\showSeparator(), societe_prepare_head(), Adherent\subscriptionComplementaryActions(), top_htmlhead(), top_menu(), Auth\verif(), ActionsTicket\viewTicketMessages(), ActionsTicket\viewTicketOriginalMessage(), ActionsTicket\viewTicketTimelineMessages(), Form\widgetForTranslation(), and pdf_stdandard\write_file().

GETPOSTINT (   $paramname,
  $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
int$methodType of method (0 = get then post, 1 = only get, 2 = only post, 3 = post then get)
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
int Value found (int)

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

References GETPOST().

GETPOSTISSET (   $paramname)

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

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 234 of file functions.lib.php.

References $_SERVER.

Referenced by mailing_thirdparties\add_to_target(), mailing_mailinglist_mymodule_myobject\add_to_target(), mailing_pomme\add_to_target(), check_user_password_openid(), FormMail\get_form(), ExtraFields\getOptionalsFromPost(), MenuManager\loadMenu(), printCommonFooter(), ExtraFields\setOptionalsFromPost(), show_contacts(), FormSms\show_form(), FormTicket\showForm(), FormTicket\showMessageForm(), top_htmlhead(), Form\widgetForTranslation(), and pdf_stdandard\write_file().

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

Get tax (VAT) main information from Id.

You can also call getLocalTaxesFromRate() after to get only localtax 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 5177 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 = '',
  $forcenowrapcolumntitle = 0 
)

Get title line of an array.

Parameters
string$nameTranslation key of field to show or complete HTML string to show
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. Example "t.abc" or "t.abc,t.def"
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
string$forcenowrapcolumntitleNo need for use 'wrapcolumntitle' css style
Returns
string

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

References dol_escape_htmltag(), and dol_textishtml().

Referenced by print_liste_field_titre(), show_actions_done(), show_contacts(), show_ticket_messaging(), and FormActions\showactions().

getUserRemoteIP ( )

Return the IP of remote user.

Take HTTP_X_FORWARDED_FOR (defined when using proxy) Then HTTP_CLIENT_IP if defined (rare) Then REMOTE_ADDR (no way to be modified by user but may be wrong if user is using a proxy)

Returns
string Ip of remote user.

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

References $_SERVER.

Referenced by callSetExpressCheckout(), Stripe\cardStripe(), Events\create(), Stripe\createPaymentStripe(), Stripe\customerStripe(), dol_syslog(), dol_user_country(), getCommonSubstitutionArray(), User\getNomUrl(), Stripe\getPaymentIntent(), and Stripe\getSetupIntent().

img_action (   $titlealt,
  $numaction,
  $picto = '' 
)

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
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)
Returns
string Return an img tag

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

References img_picto().

Referenced by Contact\libProspCommStatut(), and 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 3920 of file functions.lib.php.

References img_picto().

img_credit_card (   $brand,
  $morecss = null 
)

Return image of a credit card according to its brand name.

Parameters
string$brandBrand name of credit card
string$morecssMore CSS
Returns
string Return img tag

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

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

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
string$morecssMore CSS
Returns
string Retourne tag img

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

References img_picto().

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

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 3851 of file functions.lib.php.

References img_picto().

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

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

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$floatIf you have to put the style "float: right"
string$otherAdd more attributes on img
Returns
string Return tag img

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

References img_picto().

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

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 3634 of file functions.lib.php.

References img_picto().

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 3649 of file functions.lib.php.

References img_picto().

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 3800 of file functions.lib.php.

References img_picto().

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 3748 of file functions.lib.php.

References dol_escape_htmltag(), and img_picto().

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 3767 of file functions.lib.php.

References img_picto().

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 3885 of file functions.lib.php.

References img_picto().

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 3969 of file functions.lib.php.

References dol_mimetype().

Referenced by FormMail\get_form(), FormFile\getDocumentsLink(), FormFile\list_of_autoecmfiles(), FormFile\list_of_documents(), show_ticket_messaging(), FormFile\showdocuments(), FormTicket\showForm(), FormTicket\showMessageForm(), 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 3816 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 3503 of file functions.lib.php.

References img_picto().

Referenced by Notify\confirmMessage(), dol_print_email(), dol_print_phone(), dol_print_socialnetworks(), DolibarrModules\getKanbanView(), User\getLoginUrl(), AccountingJournal\getNomUrl(), Fiscalyear\getNomUrl(), Bookmark\getNomUrl(), Asset\getNomUrl(), EmailCollectorFilter\getNomUrl(), EmailCollectorAction\getNomUrl(), CashControl\getNomUrl(), CompanyPaymentMode\getNomUrl(), SocieteAccount\getNomUrl(), Subscription\getNomUrl(), AssetType\getNomUrl(), Opensurveysondage\getNomUrl(), BookKeeping\getNomUrl(), EmailCollector\getNomUrl(), EcmDirectory\getNomUrl(), Inventory\getNomUrl(), Hook\getNomUrl(), Loan\getNomUrl(), ChargeSociales\getNomUrl(), PaiementFourn\getNomUrl(), Productlot\getNomUrl(), PaymentSalary\getNomUrl(), PaymentLoan\getNomUrl(), AdherentType\getNomUrl(), Mailing\getNomUrl(), PaymentVarious\getNomUrl(), Task\getNomUrl(), Tva\getNomUrl(), RecruitmentCandidature\getNomUrl(), Entrepot\getNomUrl(), UserGroup\getNomUrl(), MyObject\getNomUrl(), CommandeFournisseur\getNomUrl(), Fichinter\getNomUrl(), RecruitmentJobPosition\getNomUrl(), BOM\getNomUrl(), Cronjob\getNomUrl(), Don\getNomUrl(), Dolresource\getNomUrl(), RemiseCheque\getNomUrl(), Mo\getNomUrl(), ProductFournisseur\getNomUrl(), Project\getNomUrl(), Paiement\getNomUrl(), Holiday\getNomUrl(), BonPrelevement\getNomUrl(), Ticket\getNomUrl(), Contact\getNomUrl(), Account\getNomUrl(), FactureRec\getNomUrl(), BOMLine\getNomUrl(), ActionComm\getNomUrl(), Facture\getNomUrl(), ExpenseReport\getNomUrl(), Expedition\getNomUrl(), Contrat\getNomUrl(), Adherent\getNomUrl(), FactureFournisseur\getNomUrl(), Societe\getNomUrl(), AccountLine\getNomUrl(), User\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(), Task\load_board(), Project\load_board(), Contrat\load_board(), Adherent\load_board(), FactureFournisseur\load_board(), SupplierProposal\load_board(), Holiday\load_board(), ExpenseReport\load_board(), CommandeFournisseur\load_board(), Ticket\load_board(), Propal\load_board(), Commande\load_board(), Facture\load_board(), box_services_contracts\loadBox(), Categorie\print_all_ways(), show_actions_done(), show_contacts(), show_list_sending_receive(), show_stats_for_company(), show_ticket_messaging(), ModeleBoxes\showBox(), box_actions\showBox(), 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 3618 of file functions.lib.php.

References img_picto().

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

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"')
boolean | int$pictoisfullpathIf true or 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 people
string$morecssAdd more class css on img tag (For example 'myclascss').
string$marginleftonlyshort1 = Add a short left margin on picto, 2 = Add a larger left margin on picto, 0 = No margin left. Works for fontawesome picto only.
Returns
string Return img tag
See Also
img_object(), img_picto_common()

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

References dol_escape_htmltag().

Referenced by ajax_constantonoff(), ActionsCardCompany\assign_values(), Stripe\cardStripe(), FormMargin\displayMarginInfos(), dol_banner_tab(), dol_get_fiche_head(), dol_print_cron_urls(), dol_print_email(), dol_print_phone(), dol_print_socialnetworks(), dol_print_url(), dolGetStatus(), ExpenseReport\fetch_line_by_project(), DolibarrModules\getKanbanView(), Subscription\getNomUrl(), Opensurveysondage\getNomUrl(), ChargeSociales\getNomUrl(), PaymentSalary\getNomUrl(), AdherentType\getNomUrl(), Task\getNomUrl(), RecruitmentCandidature\getNomUrl(), PaymentSocialContribution\getNomUrl(), Entrepot\getNomUrl(), Delivery\getNomUrl(), MyObject\getNomUrl(), WebsitePage\getNomUrl(), CommandeFournisseur\getNomUrl(), Fichinter\getNomUrl(), RecruitmentJobPosition\getNomUrl(), BOM\getNomUrl(), Cronjob\getNomUrl(), Don\getNomUrl(), Dolresource\getNomUrl(), Mo\getNomUrl(), ProductFournisseur\getNomUrl(), Reception\getNomUrl(), Project\getNomUrl(), Paiement\getNomUrl(), Holiday\getNomUrl(), Ticket\getNomUrl(), Contact\getNomUrl(), Account\getNomUrl(), ActionComm\getNomUrl(), Facture\getNomUrl(), ExpenseReport\getNomUrl(), Contrat\getNomUrl(), Adherent\getNomUrl(), FactureFournisseur\getNomUrl(), Societe\getNomUrl(), AccountLine\getNomUrl(), User\getNomUrl(), SupplierProposal\getNomUrl(), Propal\getNomUrl(), Commande\getNomUrl(), Product\getNomUrl(), getResultColumn(), getTicketTimelineIcon(), Interfaces\getTriggersList(), ModeleBoxes\getWidgetsList(), img_action(), img_allow(), img_delete(), img_down(), img_edit(), img_edit_add(), img_edit_remove(), img_error(), img_help(), img_info(), img_left(), img_object(), img_pdf(), img_picto_common(), img_printer(), img_right(), img_search(), img_searchclear(), img_split(), img_up(), img_view(), img_warning(), img_weather(), doc_generic_odt\info(), doc_generic_ticket_odt\info(), doc_generic_bom_odt\info(), doc_generic_reception_odt\info(), doc_generic_user_odt\info(), doc_generic_member_odt\info(), doc_generic_stock_odt\info(), doc_generic_proposal_odt\info(), doc_generic_supplier_proposal_odt\info(), doc_generic_order_odt\info(), doc_generic_invoice_odt\info(), doc_generic_mo_odt\info(), doc_generic_supplier_order_odt\info(), doc_generic_shipment_odt\info(), doc_generic_task_odt\info(), doc_generic_project_odt\info(), info_admin(), LignePrelevement\LibStatut(), Deplacement\LibStatut(), Fiscalyear\LibStatut(), EmailCollectorFilter\LibStatut(), EmailCollectorAction\LibStatut(), SocieteAccount\LibStatut(), Cchargesociales\LibStatut(), ProductStockEntrepot\LibStatut(), CommandeFournisseurDispatch\LibStatut(), PaymentVarious\LibStatut(), AccountingAccount\LibStatut(), MouvementStock\LibStatut(), Task\LibStatut(), FormFile\list_of_autoecmfiles(), FormFile\list_of_documents(), printing_printipp\listAvailablePrinters(), printing_printgcp\listAvailablePrinters(), FormFile\listOfLinks(), box_graph_orders_permonth\loadBox(), box_graph_invoices_permonth\loadBox(), box_graph_orders_supplier_permonth\loadBox(), box_graph_propales_permonth\loadBox(), box_graph_invoices_supplier_permonth\loadBox(), box_services_contracts\loadBox(), box_graph_product_distribution\loadBox(), print_actions_filter(), printDropdownBookmarksList(), printSearchForm(), Form\select_company(), Form\select_produits(), show_actions_done(), show_elem(), FormActions\showactions(), ModeleBoxes\showBox(), showDirectDownloadLink(), showDirectPublicLink(), FormTicket\showForm(), Form\textwithpicto(), top_menu(), ActionsTicket\viewTicketMessages(), and Form\widgetForTranslation().

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 3547 of file functions.lib.php.

References img_picto().

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 3833 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 3718 of file functions.lib.php.

References img_picto().

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 3904 of file functions.lib.php.

References img_picto().

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 3991 of file functions.lib.php.

References dol_escape_htmltag(), and img_picto().

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 4012 of file functions.lib.php.

References dol_escape_htmltag(), and img_picto().

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 3732 of file functions.lib.php.

References img_picto().

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 3868 of file functions.lib.php.

References img_picto().

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$floatIf you have to put the style "float: right"
string$otherAdd more attributes on img
Returns
string Return tag img

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

References img_picto().

img_warning (   $titlealt = 'default',
  $moreatt = '',
  $morecss = 'pictowarning' 
)

Show warning 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"'). If 1, add float: right. Can't be "class" attribute.
string$morecssAdd more CSS
Returns
string Return img tag

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

References img_picto().

Referenced by dol_print_email(), dol_print_socialnetworks(), getResultColumn(), getTaskProgressView(), doc_generic_odt\info(), doc_generic_ticket_odt\info(), doc_generic_bom_odt\info(), doc_generic_reception_odt\info(), doc_generic_user_odt\info(), doc_generic_member_odt\info(), doc_generic_stock_odt\info(), doc_generic_proposal_odt\info(), doc_generic_product_odt\info(), doc_generic_supplier_proposal_odt\info(), doc_generic_usergroup_odt\info(), doc_generic_contract_odt\info(), doc_generic_myobject_odt\info(), doc_generic_recruitmentjobposition_odt\info(), doc_generic_order_odt\info(), doc_generic_invoice_odt\info(), doc_generic_mo_odt\info(), doc_generic_supplier_order_odt\info(), doc_generic_shipment_odt\info(), doc_generic_task_odt\info(), doc_generic_project_odt\info(), box_factures\loadBox(), box_services_expired\loadBox(), box_supplier_orders_awaiting_reception\loadBox(), box_factures_fourn_imp\loadBox(), box_factures_fourn\loadBox(), box_services_contracts\loadBox(), box_propales\loadBox(), box_factures_imp\loadBox(), box_actions\loadBox(), box_produits_alerte_stock\loadBox(), print_left_eldy_menu(), projectLinesa(), show_actions_done(), show_array_actions_to_do(), show_ticket_messaging(), and Form\textwithpicto().

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

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 | int$pictoName of image file to show (If no extension provided, we use '.png'). Image must be stored into htdocs/theme/common directory. Or level of meteo image (0-4).
string$moreattAdd more attribute on img tag
int$pictoisfullpathIf 1, image path is a full path
string$morecssMore CSS
Returns
string Return img tag
See Also
img_object(), img_picto()

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

References img_picto().

Referenced by showWeather().

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

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), 'error', 'warning', 'xxx'=Other
string$morecssMore CSS ('', 'warning', 'error')
string$textfordropdownShow a text to click to dropdown the info box.
Returns
string String with info text

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

References dol_escape_htmltag(), and img_picto().

Referenced by ActionsCardCommon\assign_values(), ActionsAdherentCardCommon\assign_values(), ActionsContactCardCommon\assign_values(), FormFile\form_attach_new_file(), FormMail\get_form(), main_area(), FormCompany\select_civility(), Form\select_conditions_paiements(), FormCompany\select_state(), FormActions\select_type_actions(), Form\select_type_fees(), FormSocialContrib\select_type_socialcontrib(), Form\select_types_paiements(), FormResource\select_types_resource(), Form\selectAvailabilityDelay(), Form\selectCurrency(), FormTicket\selectGroupTickets(), Form\selectInputReason(), FormProjets\selectOpportunityStatus(), FormTicket\selectSeveritiesTickets(), Form\selectShippingMethod(), Form\selectTransportMode(), FormWebsite\selectTypeOfContainer(), FormTicket\selectTypesTickets(), show_ticket_messaging(), and FormTicket\showMessageForm().

isAFileWithExecutableContent (   $filename)

Return if a file can contains executable content.

Parameters
string$filenameFile name to test
Returns
boolean True if yes, False if no

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

Referenced by dol_move_uploaded_file().

isASecretKey (   $keyname)

Return if string has a name dedicated to store a secret.

Parameters
string$keynameName of key to test
Returns
boolean True if key is used to store a secret

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

Referenced by CommonDocGenerator\get_substitutionarray_other(), Setup\getConf(), and make_substitutions().

isHTTPS ( )

Return if we are using a HTTPS connexion Check HTTPS (no way to be modified by user but may be empty or wrong if user is using a proxy) Take HTTP_X_FORWARDED_PROTO (defined when using proxy) Then HTTP_X_FORWARDED_SSL.

Returns
boolean True if user is using HTTPS

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

References $_SERVER.

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 5125 of file functions.lib.php.

References get_localtax_by_third().

Referenced by get_localtax().

isValidEmail (   $address,
  $acceptsupervisorkey = 0 
)

Return true if email syntax is ok.

Parameters
string$addressemail (Ex: "toto@examle.com". Long form "John Do <johndo@example.com>" will be false)
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
See Also
isValidMXRecord()

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

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

isValidMXRecord (   $domain)

Return if the domain name has a valid MX record.

WARNING: This need function idn_to_ascii, checkdnsrr and getmxrr

Parameters
string$domainDomain name (Ex: "yahoo.com", "yhaoo.com", "dolibarr.fr")
Returns
int -1 if error (function not available), 0=Not valid, 1=Valid
See Also
isValidEmail()

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

Referenced by isValidMailDomain().

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 3114 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 8508 of file functions.lib.php.

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

load_fiche_titre (   $titre,
  $morehtmlright = '',
  $picto = 'generic',
  $pictoisfullpath = 0,
  $id = '',
  $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
string$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 4436 of file functions.lib.php.

References dol_strlen().

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(), print_fiche_titre(), show_contacts(), show_list_sending_receive(), show_projects(), show_subsidiaries(), FormActions\showactions(), and FormFile\showdocuments().

make_substitutions (   $text,
  $substitutionarray,
  $outputlangs = null 
)

Make substitution into a text string, replacing keys with vals from $substitutionarray (oldval=>newval), and texts like __(TranslationKey|langfile)__ and __[ConstantKey]__ are also replaced.

Example of usage: $substitutionarray = getCommonSubstitutionArray($langs, 0, null, $thirdparty); complete_substitutions_array($substitutionarray, $langs, $thirdparty); $mesg = make_substitutions($mesg, $substitutionarray, $langs);

Parameters
string$textSource string in which we must do substitution
array$substitutionarrayArray with key->val to substitute. Example: array('MYKEY' => 'MyVal', ...)
Translate$outputlangsOutput language
Returns
string Output string after substitutions
See Also
complete_substitutions_array(), getCommonSubstitutionArray()

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

References dol_htmlentitiesbr(), dol_textishtml(), and isASecretKey().

Referenced by BordereauChequeBlochet\_pagefoot(), complete_head_from_modules(), Facture\create(), dol_print_phone(), dolReplaceInFile(), FormMail\get_form(), Adherent\makeSubstitution(), Menubase\menuLoad(), EmailCollector\overwritePropertiesOfObject(), pdf_pagefoot(), pdf_watermark(), print_auguria_menu(), print_eldy_menu(), print_left_auguria_menu(), print_left_eldy_menu(), ActionComm\sendEmailsReminder(), DataPolicy\sendMailDataPolicyAdherent(), DataPolicy\sendMailDataPolicyCompany(), DataPolicy\sendMailDataPolicyContact(), Adherent\sendReminderForExpiredSubscription(), FormSms\show_form(), MenuManager\showmenu(), FormTicket\showMessageForm(), pdf_baleine\write_file(), pdf_timespent\write_file(), pdf_beluga\write_file(), pdf_soleil\write_file(), pdf_cornas\write_file(), pdf_stdandard\write_file(), doc_generic_contract_odt\write_file(), pdf_standard_myobject\write_file(), pdf_cyan\write_file(), doc_generic_bom_odt\write_file(), doc_generic_reception_odt\write_file(), pdf_eratosthene\write_file(), pdf_canelle\write_file(), doc_generic_mo_odt\write_file(), doc_generic_myobject_odt\write_file(), doc_generic_recruitmentjobposition_odt\write_file(), doc_generic_supplier_order_odt\write_file(), doc_generic_stock_odt\write_file(), pdf_sponge\write_file(), pdf_standard_recruitmentjobposition\write_file(), doc_generic_invoice_odt\write_file(), doc_generic_shipment_odt\write_file(), pdf_aurore\write_file(), doc_generic_order_odt\write_file(), pdf_standard\write_file(), pdf_einstein\write_file(), pdf_azur\write_file(), doc_generic_product_odt\write_file(), doc_generic_usergroup_odt\write_file(), pdf_crabe\write_file(), doc_generic_supplier_proposal_odt\write_file(), and doc_generic_proposal_odt\write_file().

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') 3=value is list of string separated with comma (Example 'text 1,text 2'), 4=value is a list of ID separated with comma (Example '2,7') to be used to search into a multiselect string '1,2,3,4'
integer$nofirstand1=Do not output the first 'AND'
Returns
string $res The statement to append to the SQL query

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

References price2num().

Referenced by addEventTypeSQL(), BookKeeping\fetchAll(), BookKeeping\fetchAllByAccount(), BlockedLog\getLog(), Task\getTasksArray(), FormProjets\select_projects_list(), show_contacts(), show_ticket_messaging(), and pdf_stdandard\write_file().

newToken ( )

Return the value of token currently saved into session with name 'newtoken'.

This token must be send by any POST as it will be used by next page for comparison with value in session.

Returns
string

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

Referenced by printing_printgcp\__construct(), ajax_constantonoff(), Form\formconfirm(), Export\list_export_model(), FormFile\list_of_documents(), printing_printipp\listAvailablePrinters(), printing_printgcp\listAvailablePrinters(), FormFile\listOfLinks(), and ActionsTicket\viewStatusActions().

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 ISO Country code on 2 characters in uppercase ('IN', 'FR')
string$moreattAdd more attribute on img tag (For example 'style="float: right"' or 'class="saturatemedium"')
Returns
string HTML img string with flag.

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

References img_picto_common().

Referenced by ActionsCardCommon\assign_values(), ActionsAdherentCardCommon\assign_values(), ActionsContactCardCommon\assign_values(), User\getNomUrl(), Form\select_country(), Form\showrefnav(), top_menu_user(), and Form\widgetForTranslation().

picto_required ( )

Return picto saying a field is required.

Returns
string Chaine avec picto obligatoire

Definition at line 5755 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_TOT)
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 4757 of file functions.lib.php.

References dol_strlen().

Referenced by MouvementStock\_create(), Product\_log_price(), pdf_standard\_pagehead(), pdf_stdandard\_pagehead(), RejetPrelevement\_send_email(), pdf_standard\_tableau_cheque(), pdf_squille\_tableau_tot(), pdf_canelle\_tableau_tot(), pdf_rouget\_tableau_tot(), pdf_espadon\_tableau_tot(), pdf_muscadet\_tableau_tot(), pdf_einstein\_tableau_tot(), pdf_aurore\_tableau_tot(), pdf_cornas\_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(), pdf_sponge\drawPaymentsTable(), pdf_eratosthene\drawTotalTable(), pdf_cyan\drawTotalTable(), pdf_sponge\drawTotalTable(), Form\editfieldval(), Form\editInPlace(), envoi_mail(), AccountancyExport\exportAgiris(), AccountancyExport\exportBob50(), AccountancyExport\exportCharlemagne(), AccountancyExport\exportCoala(), AccountancyExport\exportCogilog(), AccountancyExport\exportLDCompta(), AccountancyExport\exportLDCompta10(), AccountancyExport\exportOpenConcerto(), Productcustomerprice\fetch(), MouvementStock\fetch(), FactureLigneRec\fetch(), Product\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_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(), ProjectStats\getAllProjectByStatus(), getCommonSubstitutionArray(), CommandeFournisseur\getNomUrl(), Facture\getNomUrl(), ExpenseReport\getNomUrl(), Contrat\getNomUrl(), FactureFournisseur\getNomUrl(), SupplierProposal\getNomUrl(), Propal\getNomUrl(), Commande\getNomUrl(), Product\getSellPrice(), BordereauChequeBlochet\Header(), Productcustomerprice\initAsSpecimen(), OrderLine\insert(), box_factures\loadBox(), box_supplier_orders\loadBox(), box_supplier_orders_awaiting_reception\loadBox(), box_factures_fourn_imp\loadBox(), box_factures_fourn\loadBox(), box_accountancy_last_manual_entries\loadBox(), box_commandes\loadBox(), box_propales\loadBox(), box_factures_imp\loadBox(), box_funnel_of_prospection\loadBox(), box_produits\loadBox(), box_activity\loadBox(), box_produits_alerte_stock\loadBox(), box_comptes\loadBox(), loanCalcMonthlyPayment(), pdf_getlinetotalexcltax(), pdf_getlinetotalwithtax(), pdf_getlineupexcltax(), pdf_getlineupwithtax(), pdf_pagefoot(), print_projecttasks_array(), pdf_standard\printLine(), FormOther\select_ecotaxes(), Form\select_product_fourn_price(), Form\select_produits_fournisseurs_list(), Form\select_remises(), Form\selectExpenseRanges(), dolReceiptPrinter\sendToPrinter(), BonPrelevement\set_infotrans(), show_projects(), showDimensionInBestUnit(), ExtraFields\showInputField(), ExtraFields\showOutputField(), pdf_standard\tablePayments(), Productcustomerprice\update(), FactureLigneRec\update(), PropaleLigne\update(), OrderLine\update(), Product\updatePrice(), vatrate(), html_cerfafr\write_file(), pdf_paiement\write_file(), pdf_squille\write_file(), pdf_beluga\write_file(), pdf_espadon\write_file(), pdf_strato\write_file(), pdf_rouget\write_file(), and pdf_standard\write_file().

price2num (   $amount,
  $rounding = '',
  $option = 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. A better name for this function should be roundtext2num().

Parameters
string | float$amountAmount to convert/clean or round
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) 'CU'=Round to Max unit price of foreign currency accuracy 'CT'=Round to Max for totals with Tax of foreign currency accuracy Numeric = Nb of digits for rounding
int$optionPut 1 if you know that content is already universal format number (so no correction on decimal will be done) Put 2 if you know that number is a user input (so we know we don't have to fix decimal separator).
Returns
string Amount with universal numeric format (Example: '99.99999'). If conversion fails, it return text unchanged if $rounding = '' or '0' if $rounding is defined. If amount is null or '', it returns '' if $rounding = '' or '0' if $rounding is defined..
See Also
price() Opposite function of price2num

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

References dol_strlen().

Referenced by MouvementStock\_create(), Invoices\_fetch(), Thirdparties\_fetch(), pdf_standard\_pagehead(), pdf_stdandard\_pagehead(), pdf_canelle\_tableau_tot(), pdf_muscadet\_tableau_tot(), pdf_einstein\_tableau_tot(), pdf_cornas\_tableau_tot(), pdf_crabe\_tableau_tot(), Product\add_fournisseur(), SupplierProposal\addline(), FichinterRec\addline(), Propal\addline(), FactureRec\addline(), Contrat\addline(), Commande\addline(), CommandeFournisseur\addline(), FactureFournisseur\addline(), ExpenseReport\addline(), Facture\addline(), Holiday\addLogCP(), SupplierInvoices\addPayment(), Localtax\addPayment(), Tva\addPayment(), Invoices\addPayment(), Invoices\addPaymentDistributed(), MultiCurrency\addRate(), Products\addVariant(), Products\addVariantByProductRef(), Facturation\ajoutArticle(), CommandeFournisseur\approve(), calcul_price_total(), BOM\calculateCosts(), ChargeSociales\check(), PaymentVarious\check(), Form\constructProductListOption(), RejetPrelevement\create(), Productcustomerprice\create(), PaymentExpenseReport\create(), PaymentDonation\create(), PaymentSocialContribution\create(), PaymentLoan\create(), LoanSchedule\create(), PaiementFourn\create(), Loan\create(), DiscountAbsolute\create(), ChargeSociales\create(), Paiement\create(), Project\create(), PaymentSalary\create(), PaymentVarious\create(), Facture\create(), Product\create(), Account\create(), CurrencyRate\create(), SupplierProposal\createPriceFournisseur(), ProductCombination\createProductCombination(), BookKeeping\createStd(), CommonInvoice\demande_prelevement(), pdf_eratosthene\drawTotalTable(), pdf_sponge\drawTotalTable(), Form\editfieldval(), AccountancyExport\exportConfigurable(), AccountancyExport\exportEbp(), AccountancyExport\exportGestimumV3(), AccountancyExport\exportGestimumV5(), Societe\fetch(), Product\fetch(), Productcustomerprice\fetch_all(), Contrat\fetch_lines(), ProductFournisseur\fetch_product_fournisseur_price(), CommonDocGenerator\fill_substitutionarray_with_extrafields(), ProductFournisseur\find_min_price_product_fournisseur(), Form\form_multicurrency_rate(), Dolistore\get_products(), CommonDocGenerator\get_substitutionarray_lines(), CommonDocGenerator\get_substitutionarray_object(), ProjectStats\getAllProjectByStatus(), Fichinter\getAmount(), MultiCurrency\getAmountConversionFromInvoiceRate(), getMarginInfos(), ExtraFields\getOptionalsFromPost(), CommonInvoice\getRemainToPay(), ImportCsv\import_insert(), ImportXlsx\import_insert(), Invoices\index(), ExpenseReportLine\insert(), SupplierProposalLine\insert(), ContratLigne\insert(), SupplierInvoiceLine\insert(), CommandeFournisseurLigne\insert(), PropaleLigne\insert(), OrderLine\insert(), ProductFournisseur\list_product_fournisseur_price(), Product\load_stats_bom(), box_funnel_of_prospection\loadBox(), FormProduct\loadWarehouses(), ProductFournisseur\logPrice(), natural_search(), pdf_pagefoot(), print_projecttasks_array(), RemiseCheque\rejectCheck(), InterfaceActionsBlockedLog\runTrigger(), Form\select_produits_fournisseurs_list(), Form\select_produits_list(), BonPrelevement\set_infocredit(), Commande\set_remise(), Facture\set_remise(), SupplierProposal\set_remise_absolue(), Propal\set_remise_absolue(), Commande\set_remise_absolue(), Facture\set_remise_absolue(), Societe\set_remise_except(), SupplierProposal\set_remise_percent(), Propal\set_remise_percent(), ExtraFields\setOptionalsFromPost(), CoreObject\setValues(), InterfaceWorkflowManager\shouldClassify(), showMyBalance(), Account\solde(), Adherent\subscriptionComplementaryActions(), BankAccounts\transfer(), CUnits\unitConverter(), Deplacement\update(), Project\update(), Productcustomerprice\update(), Account\update(), Product\update(), CurrencyRate\update(), Societe\update(), BookKeeping\update(), ExpenseReportLine\update(), ExpeditionLigne\update(), ContratLigne\update(), SupplierInvoiceLine\update(), ProductFournisseur\update_buyprice(), CommandeFournisseur\updateFromCommandeClient(), SupplierProposal\updateline(), Propal\updateline(), FactureRec\updateline(), Contrat\updateline(), FactureFournisseur\updateline(), ExpenseReport\updateline(), CommandeFournisseur\updateline(), Commande\updateline(), Facture\updateline(), Product\updatePrice(), SupplierProposal\updatePriceFournisseur(), Mo\updateProduction(), Holiday\updateSoldeCP(), FactureFournisseur\validate(), pdf_standard\write_file(), pdf_stdandard\write_file(), and doc_generic_project_odt\write_file().

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

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 (after arrows)
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
int$pagenavastextinput1=Do not suggest list of pages to navigate but suggest the page number into an input field.
string$morehtmlrightbeforearrowMore html to show (before arrows)
Returns
void

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

References ajax_autoselect(), print, and print_fleche_navigation().

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 6814 of file functions.lib.php.

References get_date_range(), and print.

Referenced by show_list_sending_receive().

print_fiche_titre (   $title,
  $mesg = '',
  $picto = 'generic',
  $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 4418 of file functions.lib.php.

References load_fiche_titre(), and print.

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

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 parameters 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
string$beforearrowsHTML content to show before arrows. Must NOT contains ' ' tags.
Returns
void

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

References dol_escape_htmltag(), and print.

Referenced by print_barre_liste().

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

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
string$forcenowrapcolumntitleNo need for use 'wrapcolumntitle' css style
Returns
void

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

References getTitleFieldOfList(), and print.

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

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 4400 of file functions.lib.php.

References dol_syslog(), and print.

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 7760 of file functions.lib.php.

References $_SERVER, GETPOST(), GETPOSTISSET(), n, name, and print.

Referenced by llxFooterSurvey(), and llxFooterVierge().

readfileLowMemory (   $fullpath_original_file_osencoded,
  $method = -1 
)

Return a file on output using a low memory.

It can return very large files with no need of memory. WARNING: This close output buffers.

Parameters
string$fullpath_original_file_osencodedFull path of file to return.
int$method-1 automatic, 0=readfile, 1=fread, 2=stream_copy_to_stream
Returns
void

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

References print.

roundUpToNextMultiple (   $n,
  $x = 5 
)

Round to next multiple.

Parameters
double$nNumber to round up
integer$xMultiple. For example 60 to round up to nearest exact minute for a date with seconds.
Returns
integer Value rounded.

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

setEntity (   $currentobject)

Set entity id to use when to create an object.

Parameters
object$currentobjectCurrent object
Returns
mixed Entity id to use ( eg. entity = '.setEntity($object) )

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

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
string|string[]$mesgs Message string or array
string$styleWhich style to use ('mesgs' by default, 'warnings', 'errors')
Returns
void
See Also
dol_htmloutput_events()

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

Referenced by CommandeFournisseur\addline(), DataPolicy\sendMailDataPolicyAdherent(), DataPolicy\sendMailDataPolicyCompany(), DataPolicy\sendMailDataPolicyContact(), setEventMessages(), show_actions_done(), show_stats_for_company(), show_ticket_messaging(), and CommandeFournisseur\updateline().

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

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')
string$messagekeyA key to be used to allow the feature "Never show this message again"
Returns
void
See Also
dol_htmloutput_events()

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

References dol_print_error(), dol_syslog(), and setEventMessage().

Referenced by activateModulesRequiredByCountry(), completeFileArrayWithDatabaseInfo(), Societe\create_from_member(), Website\createFromClone(), pdf_storm\defineColumnField(), pdf_standard_recruitmentjobposition\defineColumnField(), pdf_espadon\defineColumnField(), pdf_standard_myobject\defineColumnField(), pdf_cornas\defineColumnField(), pdf_eratosthene\defineColumnField(), pdf_cyan\defineColumnField(), pdf_sponge\defineColumnField(), ActionsDatapolicy\doActions(), EmailCollector\doCollectOneCollector(), dol_add_file_process(), dol_delete_file(), dol_move(), dol_remove_file_process(), Website\exportWebSite(), FormMail\get_form(), getAllImages(), CommonDocGenerator\getExtrafieldContent(), Ticket\newMessage(), CommonDocGenerator\pdfTabTitles(), CommonDocGenerator\printStdColumnContent(), redirectToContainer(), InterfaceTicketEmail\runTrigger(), InterfaceContactRoles\runTrigger(), Ticket\sendLogByEmail(), dolReceiptPrinter\sendTestToPrinter(), Ticket\sendTicketMessageByEmail(), dolReceiptPrinter\sendToPrinter(), ExtraFields\setOptionalsFromPost(), show_contacts(), FormTicket\showMessageForm(), MultiCurrency\syncRates(), Link\update(), Mo\update(), pdf_cyan\write_file(), 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 scale of dimension (Example: 0=kg, -3=g, -6=mg, 98=ounce, 99=pound, ...)
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 (In most case, this value is value defined into $conf->global->MAIN_WEIGHT_DEFAULT_UNIT)
Returns
string String to show dimensions

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

References measuringUnitString(), and price().

Referenced by pdf_squille\_tableau_tot(), pdf_rouget\_tableau_tot(), pdf_espadon\_tableau_tot(), Form\constructProductListOption(), and Form\select_produits_fournisseurs_list().

showDirectDownloadLink (   $object)

Return string with full Url.

The file qualified is the one defined by relative path in $object->last_main_doc

Parameters
Object$objectObject
Returns
string Url string

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

References ajax_autoselect(), and img_picto().

startSimpleTable (   $header,
  $link = "",
  $arguments = "",
  $emptyRows = 0,
  $number = -1 
)

Start a table with headers and a optinal clickable number (don't forget to use "finishSimpleTable()" after the last table row)

Parameters
string$headerThe first left header of the table (automatic translated)
string$link(optional) The link to a internal dolibarr page, when click on the number (without the first "/")
string$arguments(optional) Additional arguments for the link (e.g. "search_status=0")
integer$emptyRows(optional) The count of empty rows after the first header
integer$number(optional) The number that is shown right after the first header, when not set the link is shown on the right side of the header as "FullList"
Returns
void
See Also
finishSimpleTable()

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

References print.

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 7209 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(), Ticket\is_photo_available(), 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 4710 of file functions.lib.php.

References price().

Referenced by pdf_canelle\_tableau_tot(), pdf_muscadet\_tableau_tot(), pdf_einstein\_tableau_tot(), pdf_aurore\_tableau_tot(), pdf_cornas\_tableau_tot(), pdf_azur\_tableau_tot(), pdf_crabe\_tableau_tot(), Form\constructProductListOption(), dol_print_reduction(), pdf_eratosthene\drawTotalTable(), pdf_cyan\drawTotalTable(), pdf_sponge\drawTotalTable(), 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 7324 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 | int$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 5609 of file functions.lib.php.

Referenced by ActionsCardCommon\assign_values(), AdherentType\getNomUrl(), ActionComm\getNomUrl(), AccountLine\getNomUrl(), User\getNomUrl(), getResultColumn(), ModeleNumRefBarCode\getToolTip(), ModeleProductCode\getToolTip(), ModeleThirdPartyCode\getToolTip(), mod_codecompta_aquarium\info(), mod_codecompta_digitaria\info(), Adherent\makeSubstitution(), showSkins(), and top_menu_user().