dolibarr 21.0.0-beta
|
A set of functions for Dolibarr This file contains all rare functions. More...
Go to the source code of this file.
Functions | |
jsUnEscape ($source) | |
Same function than javascript unescape() function but in PHP. | |
dolGetModulesDirs ($subdir='') | |
Return list of directories that contain modules. | |
dol_getDefaultFormat ($outputlangs=null) | |
Try to guess default paper format according to language into $langs. | |
dol_print_object_info ($object, $usetable=0) | |
Show information on an object TODO Move this into html.formother. | |
dolAddEmailTrackId ($email, $trackingid) | |
Return an email formatted to include a tracking id For example myema.nosp@m.il@e.nosp@m.xampl.nosp@m.e.co.nosp@m.m becom myema.nosp@m.il+t.nosp@m.racki.nosp@m.ngid.nosp@m.@exam.nosp@m.ple..nosp@m.com. | |
isValidMailDomain ($mail) | |
Return true if email has a domain name that can be resolved to MX type. | |
isValidUrl ($url, $http=0, $pass=0, $port=0, $path=0, $query=0, $anchor=0) | |
Url string validation <http[s]> :// [user[:pass]@] hostname [port] [/path] [?getquery] [anchor]. | |
isValidVATID ($company) | |
Check if VAT numero is valid (check done on syntax only, no database or remote access) | |
clean_url ($url, $http=1) | |
Clean an url string. | |
dolObfuscateEmail ($mail, $replace="*", $nbreplace=8, $nbdisplaymail=4, $nbdisplaydomain=3, $displaytld=true) | |
Returns an email value with obfuscated parts. | |
array2tr ($data, $troptions='', $tdoptions='') | |
Return lines of an html table from an array Used by array2table function only. | |
array2table ($data, $tableMarkup=1, $tableoptions='', $troptions='', $tdoptions='') | |
Return an html table from an array. | |
get_next_value ($db, $mask, $table, $field, $where='', $objsoc='', $date='', $mode='next', $bentityon=true, $objuser=null, $forceentity=null) | |
Return last or next value for a mask (according to area we should not reset) | |
get_string_between ($string, $start, $end) | |
Get string from "$start" up to "$end". | |
check_value ($mask, $value) | |
Check value. | |
binhex ($bin, $pad=false, $upper=false) | |
Convert a binary data to string that represent hexadecimal value. | |
hexbin ($hexa) | |
Convert an hexadecimal string into a binary string. | |
numero_semaine ($time) | |
Retourne le numero de la semaine par rapport a une date. | |
weight_convert ($weight, &$from_unit, $to_unit) | |
Convertit une masse d'une unite vers une autre unite. | |
dol_set_user_param ($db, $conf, &$user, $tab) | |
Save personal parameter. | |
dol_print_reduction ($reduction, $langs) | |
Returns formatted reduction. | |
version_os ($option='') | |
Return OS version. | |
version_php () | |
Return PHP version. | |
version_db () | |
Return DB version. | |
version_dolibarr () | |
Return Dolibarr version. | |
version_webserver () | |
Return web server version. | |
getListOfModels ($db, $type, $maxfilenamelength=0) | |
Return list of activated modules usable for document generation. | |
is_ip ($ip) | |
This function evaluates a string that should be a valid IPv4 Note: For ip 169.254.0.0, it returns 0 with some PHP (5.6.24) and 2 with some minor patches of PHP (5.6.25). | |
dol_buildlogin ($lastname, $firstname) | |
Build a login from lastname, firstname. | |
getSoapParams () | |
Return array to use for SoapClient constructor. | |
dolGetElementUrl ($objectid, $objecttype, $withpicto=0, $option='') | |
Return link url to an object. | |
cleanCorruptedTree ($db, $tabletocleantree, $fieldfkparent) | |
Clean corrupted database tree (orphelins linked to a not existing parent), record linked to themself, and also child-parent loop. | |
colorArrayToHex ($arraycolor, $colorifnotfound='888888') | |
Convert an array with RGB value into hex RGB value. | |
colorStringToArray ($stringcolor, $colorifnotfound=array(88, 88, 88)) | |
Convert a string RGB value ('FFFFFF', '255,255,255') into an array RGB array(255,255,255). | |
colorValidateHex ($color, $allow_white=true) | |
colorAgressiveness ($hex, $ratio=-50, $brightness=0) | |
Change color to make it less aggressive (ratio is negative) or more aggressive (ratio is positive) | |
colorAdjustBrightness ($hex, $steps) | |
colorDarker ($hex, $percent) | |
colorLighten ($hex, $percent) | |
colorHexToRgb ($hex, $alpha=false, $returnArray=false) | |
colorHexToHsl ($hex, $alpha=false, $returnArray=false) | |
Color Hex to Hsl (used for style) | |
cartesianArray (array $input) | |
Applies the Cartesian product algorithm to an array Source: http://stackoverflow.com/a/15973172. | |
getModuleDirForApiClass ($moduleobject) | |
Get name of directory where the api_...class.php file is stored. | |
randomColorPart ($min=0, $max=255) | |
Return 2 hexa code randomly. | |
randomColor ($min=0, $max=255) | |
Return hexadecimal color randomly. | |
if(!function_exists( 'dolEscapeXML')) | convertBackOfficeMediasLinksToPublicLinks ($notetoshow) |
Convert links to local wrapper to medias files into a string into a public external URL readable on internet. | |
price2fec ($amount) | |
Function to format a value into a defined format for French administration (no thousand separator & decimal separator force to ',' with two decimals) Function used into accountancy FEC export. | |
phpSyntaxError ($code) | |
Check the syntax of some PHP code. | |
acceptLocalLinktoMedia () | |
Check the syntax of some PHP code. | |
removeGlobalParenthesis ($string) | |
Remove first and last parenthesis but only if first is the opening and last the closing of the same group. | |
getArrayOfEmojiBis () | |
Return array of Emojis for miscellaneous use. | |
removeEmoji ($text, $allowedemoji=1) | |
Remove EMoji from email content. | |
csvClean ($newvalue, $charset='', $separator='') | |
Clean a cell to respect rules of CSV file cells. | |
A set of functions for Dolibarr This file contains all rare functions.
Definition in file functions2.lib.php.
acceptLocalLinktoMedia | ( | ) |
Check the syntax of some PHP code.
Definition at line 2932 of file functions2.lib.php.
References getDolGlobalInt().
array2table | ( | $data, | |
$tableMarkup = 1, | |||
$tableoptions = '', | |||
$troptions = '', | |||
$tdoptions = '' ) |
Return an html table from an array.
array<int|string,null|string|int|float> | $data Array of data | |
int | $tableMarkup | Table markup |
string | $tableoptions | Options for table |
string | $troptions | Options for tr |
string | $tdoptions | Options for td |
Definition at line 876 of file functions2.lib.php.
References array2tr().
array2tr | ( | $data, | |
$troptions = '', | |||
$tdoptions = '' ) |
Return lines of an html table from an array Used by array2table function only.
array<null|int|float|string> | $data Array of data | |
string | $troptions | Options for tr |
string | $tdoptions | Options for td |
Definition at line 856 of file functions2.lib.php.
Referenced by array2table().
binhex | ( | $bin, | |
$pad = false, | |||
$upper = false ) |
Convert a binary data to string that represent hexadecimal value.
string | $bin | Value to convert |
boolean | $pad | Add 0 |
boolean | $upper | Convert to tupper |
Definition at line 1610 of file functions2.lib.php.
References dol_strlen().
cartesianArray | ( | array | $input | ) |
Applies the Cartesian product algorithm to an array Source: http://stackoverflow.com/a/15973172.
array<string|int,string[]> | $input Array of products |
Definition at line 2654 of file functions2.lib.php.
check_value | ( | $mask, | |
$value ) |
Check value.
string | $mask | Mask to use |
string | $value | Value |
Definition at line 1484 of file functions2.lib.php.
References dol_string_nospecial(), dol_strlen(), and dol_syslog().
Referenced by mod_codeclient_elephant\verif(), mod_codeproduct_elephant\verif(), mod_barcode_product_standard\verif_syntax(), and mod_barcode_thirdparty_standard\verif_syntax().
clean_url | ( | $url, | |
$http = 1 ) |
Clean an url string.
string | $url | Url |
integer | $http | 1 = keep both http:// and https://, 0: remove http:// but not https:// |
Definition at line 769 of file functions2.lib.php.
Referenced by Adherent\update(), Link\update(), and Societe\update().
cleanCorruptedTree | ( | $db, | |
$tabletocleantree, | |||
$fieldfkparent ) |
Clean corrupted database tree (orphelins linked to a not existing parent), record linked to themself, and also child-parent loop.
DoliDB | $db | Database handler |
string | $tabletocleantree | Table to clean |
string | $fieldfkparent | Field name that contains id of parent |
Definition at line 2278 of file functions2.lib.php.
References $id, and dol_print_error().
colorAdjustBrightness | ( | $hex, | |
$steps ) |
string | $hex | Color in hex ('#AA1122' or 'AA1122' or '#a12' or 'a12') |
integer | $steps | Step/offset added to each color component. It should be between -255 and 255. Negative = darker, positive = lighter |
Definition at line 2513 of file functions2.lib.php.
Referenced by colorDarker(), and colorLighten().
colorAgressiveness | ( | $hex, | |
$ratio = -50, | |||
$brightness = 0 ) |
Change color to make it less aggressive (ratio is negative) or more aggressive (ratio is positive)
string | $hex | Color in hex ('#AA1122' or 'AA1122' or '#a12' or 'a12') |
integer | $ratio | Default=-50. Note: 0=Component color is unchanged, -100=Component color become 88, +100=Component color become 00 or FF |
integer | $brightness | Default=0. Adjust brightness. -100=Decrease brightness by 100%, +100=Increase of 100%. |
Definition at line 2457 of file functions2.lib.php.
colorArrayToHex | ( | $arraycolor, | |
$colorifnotfound = '888888' ) |
Convert an array with RGB value into hex RGB value.
This is the opposite function of colorStringToArray
array{0:int,1:int,2:int} | $arraycolor Array | |
string | $colorifnotfound | Color code to return if entry not defined or not a RGB format |
Definition at line 2392 of file functions2.lib.php.
Referenced by colorHexToHsl(), FormSetupItem\generateInputFieldColor(), FormSetupItem\generateOutputFieldColor(), box_graph_nb_tickets_type\loadBox(), WebPortalTheme\loadPrimaryColor(), and showSkins().
colorDarker | ( | $hex, | |
$percent ) |
string | $hex | color in hex |
integer | $percent | 0 to 100 |
Definition at line 2542 of file functions2.lib.php.
References colorAdjustBrightness().
colorHexToHsl | ( | $hex, | |
$alpha = false, | |||
$returnArray = false ) |
Color Hex to Hsl (used for style)
string | $hex | Color in hex |
float | false | $alpha | 0 to 1 to add alpha channel |
bool | $returnArray | true=return an array instead, false=return string |
Definition at line 2597 of file functions2.lib.php.
References colorArrayToHex(), and colorStringToArray().
Referenced by WebPortalTheme\loadPrimaryColor().
colorHexToRgb | ( | $hex, | |
$alpha = false, | |||
$returnArray = false ) |
string | $hex | color in hex |
float | false | $alpha | 0 to 1 to add alpha channel |
bool | $returnArray | true=return an array instead, false=return string |
Definition at line 2566 of file functions2.lib.php.
colorLighten | ( | $hex, | |
$percent ) |
string | $hex | color in hex |
integer | $percent | 0 to 100 |
Definition at line 2553 of file functions2.lib.php.
References colorAdjustBrightness().
colorStringToArray | ( | $stringcolor, | |
$colorifnotfound = array(88, 88, 88) ) |
Convert a string RGB value ('FFFFFF', '255,255,255') into an array RGB array(255,255,255).
This is the opposite function of colorArrayToHex. If entry is already an array, return it.
string|array{0:int,1:int,2:int} | $stringcolor String with hex (FFFFFF) or comma RGB ('255,255,255') |
array{0:int,1:int,2:int}|array{} | $colorifnotfound Color code array to return if entry not defined |
Definition at line 2413 of file functions2.lib.php.
Referenced by colorHexToHsl(), FormSetupItem\generateInputFieldColor(), FormSetupItem\generateOutputFieldColor(), WebPortalTheme\loadPrimaryColor(), and showSkins().
colorValidateHex | ( | $color, | |
$allow_white = true ) |
string | $color | the color you need to valid |
boolean | $allow_white | in case of white isn't valid |
Definition at line 2436 of file functions2.lib.php.
Referenced by WebPortalTheme\loadPrimaryColor().
if(!function_exists('dolEscapeXML')) convertBackOfficeMediasLinksToPublicLinks | ( | $notetoshow | ) |
Convert links to local wrapper to medias files into a string into a public external URL readable on internet.
string | $notetoshow | Text to convert |
Definition at line 2789 of file functions2.lib.php.
Referenced by pdf_aurore\write_file(), pdf_azur\write_file(), pdf_baleine\write_file(), pdf_beluga\write_file(), pdf_canelle\write_file(), pdf_cornas\write_file(), pdf_crabe\write_file(), pdf_cyan\write_file(), pdf_eagle_proforma\write_file(), pdf_einstein\write_file(), pdf_eratosthene\write_file(), pdf_espadon\write_file(), pdf_octopus\write_file(), pdf_soleil\write_file(), pdf_sponge\write_file(), pdf_standard\write_file(), pdf_standard_asset\write_file(), pdf_standard_expensereport\write_file(), pdf_standard_movementstock\write_file(), pdf_standard_myobject\write_file(), pdf_standard_recruitmentjobposition\write_file(), pdf_standard_stock\write_file(), pdf_strato\write_file(), pdf_timespent\write_file(), pdf_vinci\write_file(), and pdf_zenith\write_file().
csvClean | ( | $newvalue, | |
$charset = '', | |||
$separator = '' ) |
Clean a cell to respect rules of CSV file cells.
string | $newvalue | String to clean (must be UTF-8 encoded) |
string | $charset | Expected output character set ('UTF-8', 'ISO-8859-1', ...). Default '' will use the value into EXPORT_CSV_FORCE_CHARSET. |
string | $separator | CSV char separator (often ',' or ';'). Default '' will use the value into EXPORT_CSV_SEPARATOR_TO_USE. |
Definition at line 3089 of file functions2.lib.php.
References dol_htmlcleanlastbr(), getDolGlobalInt(), and getDolGlobalString().
Referenced by ExportCsv\write_record(), and ExportCsv\write_title().
dol_buildlogin | ( | $lastname, | |
$firstname ) |
Build a login from lastname, firstname.
string | $lastname | Lastname |
string | $firstname | Firstname |
Definition at line 2041 of file functions2.lib.php.
References dol_string_nospecial(), dol_string_unaccent(), dol_trunc(), and getDolGlobalString().
Referenced by ActionsAdherentCardCommon\assign_values(), ActionsContactCardCommon\assign_values(), User\create_from_contact(), and User\create_from_member().
dol_getDefaultFormat | ( | $outputlangs = null | ) |
Try to guess default paper format according to language into $langs.
?Translate | $outputlangs | Output lang to use to autodetect output format if setup not done |
Definition at line 123 of file functions2.lib.php.
Referenced by pdf_getFormat().
dol_print_object_info | ( | $object, | |
$usetable = 0 ) |
Show information on an object TODO Move this into html.formother.
object | CommonObject | $object | Object to show |
int | $usetable | Output into a table |
Definition at line 150 of file functions2.lib.php.
References $object, dol_print_date(), and getServerTimeZoneInt().
dol_print_reduction | ( | $reduction, | |
$langs ) |
Returns formatted reduction.
int | float | $reduction | Reduction percentage |
Translate | $langs | Output language |
Definition at line 1839 of file functions2.lib.php.
References vatrate().
Referenced by pdf_getlineremisepercent().
dol_set_user_param | ( | $db, | |
$conf, | |||
& | $user, | ||
$tab ) |
Save personal parameter.
DoliDB | $db | Handler database |
Conf | $conf | Object conf |
User | $user | Object user |
array<string,string|int> | $tab Array (key=>value) with all parameters to save/update |
Definition at line 1768 of file functions2.lib.php.
References $conf, dol_print_error(), and dol_syslog().
Referenced by InfoBox\saveboxorder().
dolAddEmailTrackId | ( | $email, | |
$trackingid ) |
Return an email formatted to include a tracking id For example myema.nosp@m.il@e.nosp@m.xampl.nosp@m.e.co.nosp@m.m becom myema.nosp@m.il+t.nosp@m.racki.nosp@m.ngid.nosp@m.@exam.nosp@m.ple..nosp@m.com.
string | Email address (Ex: "toto@example.com", "John Do <johndo@example.com>") | |
string | $trackingid | Tracking id (Ex: thi123 for thirdparty with id 123) |
Definition at line 661 of file functions2.lib.php.
dolGetElementUrl | ( | $objectid, | |
$objecttype, | |||
$withpicto = 0, | |||
$option = '' ) |
Return link url to an object.
int | $objectid | Id of record |
string | $objecttype | Type of object ('invoice', 'order', 'expedition_bon', 'myobject@mymodule', ...) |
int | $withpicto | Picto to show |
string | $option | More options |
Definition at line 2118 of file functions2.lib.php.
References $conf, $object, dol_include_once(), and dol_syslog().
Referenced by show_actions_done().
dolGetModulesDirs | ( | $subdir = '' | ) |
Return list of directories that contain modules.
Detects directories that contain a subdirectory /core/modules. Modules that contains 'disabled' in their name are excluded.
string | $subdir | Sub directory (Example: '/mailings' will look for /core/modules/mailings/) |
Definition at line 84 of file functions2.lib.php.
References $conf.
Referenced by activateModule(), activateModulesRequiredByCountry(), complete_dictionary_with_modules(), complete_elementList_with_modules(), Export\load_arrays(), Import\load_arrays(), and unActivateModule().
dolObfuscateEmail | ( | $mail, | |
$replace = "*", | |||
$nbreplace = 8, | |||
$nbdisplaymail = 4, | |||
$nbdisplaydomain = 3, | |||
$displaytld = true ) |
Returns an email value with obfuscated parts.
string | ||
string | $replace | Replacement character (default: *) |
int | $nbreplace | Number of replacement character (default: 8) |
int | $nbdisplaymail | Number of character unchanged (default: 4) |
int | $nbdisplaydomain | Number of character unchanged of domain (default: 3) |
bool | $displaytld | Display tld (default: true) |
Definition at line 814 of file functions2.lib.php.
References isValidEmail().
get_next_value | ( | $db, | |
$mask, | |||
$table, | |||
$field, | |||
$where = '', | |||
$objsoc = '', | |||
$date = '', | |||
$mode = 'next', | |||
$bentityon = true, | |||
$objuser = null, | |||
$forceentity = null ) |
Return last or next value for a mask (according to area we should not reset)
DoliDB | $db | Database handler |
string | $mask | Mask to use. Must contains {0...0}. Can contains {t..}, {u...}, {user_extra_xxx}, .;. |
string | $table | Table containing field with counter |
string | $field | Field containing already used values of counter |
string | $where | To add a filter on selection (for example to filter on invoice types) |
null|Societe|'' | $objsoc The company that own the object we need a counter for | |
int|'' | $date Date to use for the {y},{m},{d} tags. is timestamp or '' to use dol_now() | |
string | $mode | 'next' for next value or 'last' for last value |
bool | $bentityon | Activate the entity filter. Default is true (for modules not compatible with multicompany) |
?User | $objuser | Object user we need data from. |
?string | $forceentity | Entity id to force, can be '0' or '1' or '1,2' etc |
Definition at line 914 of file functions2.lib.php.
References dol_mktime(), dol_now(), dol_print_error(), dol_string_nospecial(), dol_string_unaccent(), dol_strlen(), dol_substr(), dol_syslog(), get_string_between(), getDolGlobalInt(), and getDolGlobalString().
Referenced by mod_arctic\getNextValue(), mod_asset_advanced\getNextValue(), mod_barcode_product_standard\getNextValue(), mod_barcode_thirdparty_standard\getNextValue(), mod_bom_advanced\getNextValue(), mod_chequereceipt_thyme\getNextValue(), mod_codeclient_elephant\getNextValue(), mod_codeproduct_elephant\getNextValue(), mod_commande_fournisseur_orchidee\getNextValue(), mod_commande_saphir\getNextValue(), mod_contract_magre\getNextValue(), mod_delivery_saphir\getNextValue(), mod_evaluation_advanced\getNextValue(), mod_expedition_ribera\getNextValue(), mod_expensereport_sand\getNextValue(), mod_facture_fournisseur_tulip\getNextValue(), mod_facture_mercure\getNextValue(), mod_holiday_immaculate\getNextValue(), mod_knowledgerecord_advanced\getNextValue(), mod_lot_advanced\getNextValue(), mod_mo_advanced\getNextValue(), mod_myobject_advanced\getNextValue(), mod_partnership_advanced\getNextValue(), mod_payment_ant\getNextValue(), mod_project_universal\getNextValue(), mod_propale_saphir\getNextValue(), mod_reception_moonstone\getNextValue(), mod_recruitmentcandidature_advanced\getNextValue(), mod_recruitmentjobposition_advanced\getNextValue(), mod_sn_advanced\getNextValue(), mod_stocktransfer_advanced\getNextValue(), mod_supplier_payment_brodator\getNextValue(), mod_supplier_proposal_saphir\getNextValue(), mod_takepos_ref_universal\getNextValue(), mod_task_universal\getNextValue(), mod_ticket_universal\getNextValue(), and mod_workstation_advanced\getNextValue().
get_string_between | ( | $string, | |
$start, | |||
$end ) |
Get string from "$start" up to "$end".
If string is "STARTcontentEND" and $start is "START" and $end is "END", then this function returns "content"
string | $string | String to test |
string | $start | String Value for start |
string | $end | String Value for end |
Definition at line 1463 of file functions2.lib.php.
Referenced by get_next_value().
getArrayOfEmojiBis | ( | ) |
Return array of Emojis for miscellaneous use.
Definition at line 3027 of file functions2.lib.php.
Referenced by removeEmoji().
getListOfModels | ( | $db, | |
$type, | |||
$maxfilenamelength = 0 ) |
Return list of activated modules usable for document generation.
DoliDB | $db | Database handler |
string | $type | Type of models (company, invoice, ...) |
int | $maxfilenamelength | Max length of value to show |
Definition at line 1922 of file functions2.lib.php.
References $conf, dol_dir_list(), dol_print_error(), dol_syslog(), dol_trunc(), and getDolGlobalString().
Referenced by ModeleAction\liste_modeles(), ModeleBankAccountDoc\liste_modeles(), ModeleChequeReceipts\liste_modeles(), ModeleDon\liste_modeles(), ModeleExpenseReport\liste_modeles(), ModelePDFAsset\liste_modeles(), ModelePDFBom\liste_modeles(), ModelePDFCards\liste_modeles(), ModelePDFCommandes\liste_modeles(), ModelePDFContract\liste_modeles(), ModelePDFDeliveryOrder\liste_modeles(), ModelePDFEvaluation\liste_modeles(), ModelePdfExpedition\liste_modeles(), ModelePDFFactures\liste_modeles(), ModelePDFFicheinter\liste_modeles(), ModelePDFHoliday\liste_modeles(), ModelePDFKnowledgeRecord\liste_modeles(), ModelePDFLabels\liste_modeles(), ModelePDFMember\liste_modeles(), ModelePDFMo\liste_modeles(), ModelePDFMovement\liste_modeles(), ModelePDFMyObject\liste_modeles(), ModelePDFPartnership\liste_modeles(), ModelePDFProduct\liste_modeles(), ModelePDFProductBatch\liste_modeles(), ModelePDFProjects\liste_modeles(), ModelePDFPropales\liste_modeles(), ModelePdfReception\liste_modeles(), ModelePDFRecruitmentCandidature\liste_modeles(), ModelePDFRecruitmentJobPosition\liste_modeles(), ModelePDFStock\liste_modeles(), ModelePDFStockTransfer\liste_modeles(), ModelePDFSupplierProposal\liste_modeles(), ModelePDFSuppliersInvoices\liste_modeles(), ModelePDFSuppliersOrders\liste_modeles(), ModelePDFSuppliersPayments\liste_modeles(), ModelePDFTask\liste_modeles(), ModelePDFTicket\liste_modeles(), ModelePDFUser\liste_modeles(), ModelePDFUserGroup\liste_modeles(), ModelePDFWorkstation\liste_modeles(), and ModeleThirdPartyDoc\liste_modeles().
getModuleDirForApiClass | ( | $moduleobject | ) |
Get name of directory where the api_...class.php file is stored.
string | $moduleobject | Module object name |
Definition at line 2684 of file functions2.lib.php.
getSoapParams | ( | ) |
Return array to use for SoapClient constructor.
Definition at line 2071 of file functions2.lib.php.
References $conf, getDolGlobalInt(), and getDolGlobalString().
hexbin | ( | $hexa | ) |
Convert an hexadecimal string into a binary string.
string | $hexa | Hexadecimal string to convert (example: 'FF') |
Definition at line 1635 of file functions2.lib.php.
References dol_strlen().
is_ip | ( | $ip | ) |
This function evaluates a string that should be a valid IPv4 Note: For ip 169.254.0.0, it returns 0 with some PHP (5.6.24) and 2 with some minor patches of PHP (5.6.25).
See https://github.com/php/php-src/pull/1954.
string | $ip | IP Address |
Definition at line 2014 of file functions2.lib.php.
Referenced by SMTPs\_server_connect().
isValidMailDomain | ( | ) |
Return true if email has a domain name that can be resolved to MX type.
string | Email address (Ex: "toto@example.com", "John Do <johndo@example.com>") |
Definition at line 673 of file functions2.lib.php.
References isValidMXRecord().
isValidUrl | ( | $url, | |
$http = 0, | |||
$pass = 0, | |||
$port = 0, | |||
$path = 0, | |||
$query = 0, | |||
$anchor = 0 ) |
Url string validation <http[s]> :// [user[:pass]@] hostname [port] [/path] [?getquery] [anchor].
string | $url | Url |
int | $http | 1: verify http is provided, 0: not verify http |
int | $pass | 1: verify user and pass is provided, 0: not verify user and pass |
int | $port | 1: verify port is provided, 0: not verify port |
int | $path | 1: verify a path is provided "/" or "/..." or "/.../", 0: not verify path |
int | $query | 1: verify query is provided, 0: not verify query |
int | $anchor | 1: verify anchor is provided, 0: not verify anchor |
Definition at line 692 of file functions2.lib.php.
isValidVATID | ( | $company | ) |
Check if VAT numero is valid (check done on syntax only, no database or remote access)
Societe | $company | VAT number |
Definition at line 745 of file functions2.lib.php.
jsUnEscape | ( | $source | ) |
Same function than javascript unescape() function but in PHP.
string | $source | String to decode |
Definition at line 42 of file functions2.lib.php.
References dol_html_entity_decode().
numero_semaine | ( | $time | ) |
Retourne le numero de la semaine par rapport a une date.
string | $time | Date au format 'timestamp' |
Definition at line 1651 of file functions2.lib.php.
References dol_print_date().
phpSyntaxError | ( | $code | ) |
Check the syntax of some PHP code.
string | $code | PHP code to check. |
Definition at line 2837 of file functions2.lib.php.
price2fec | ( | $amount | ) |
Function to format a value into a defined format for French administration (no thousand separator & decimal separator force to ',' with two decimals) Function used into accountancy FEC export.
float | $amount | Amount to format |
Definition at line 2808 of file functions2.lib.php.
References $conf, and getDolGlobalString().
Referenced by AccountancyExport\exportCegid(), and AccountancyExport\exportCiel().
randomColor | ( | $min = 0, | |
$max = 255 ) |
Return hexadecimal color randomly.
int | $min | Between 0 and 255 |
int | $max | Between 0 and 255 |
Encode string for xml usage
string | $string | String to encode |
Definition at line 2763 of file functions2.lib.php.
References randomColorPart().
randomColorPart | ( | $min = 0, | |
$max = 255 ) |
Return 2 hexa code randomly.
int | $min | Between 0 and 255 |
int | $max | Between 0 and 255 |
Definition at line 2751 of file functions2.lib.php.
Referenced by randomColor().
removeEmoji | ( | $text, | |
$allowedemoji = 1 ) |
Remove EMoji from email content.
string | $text | String to sanitize |
int<0,2> | $allowedemoji Mode to allow emoji |
Definition at line 3051 of file functions2.lib.php.
References getArrayOfEmojiBis().
removeGlobalParenthesis | ( | $string | ) |
Remove first and last parenthesis but only if first is the opening and last the closing of the same group.
string | $string | String to sanitize |
Definition at line 2987 of file functions2.lib.php.
References dol_strlen(), and dol_substr().
Referenced by Form\searchComponent().
version_db | ( | ) |
version_dolibarr | ( | ) |
Return Dolibarr version.
Definition at line 1899 of file functions2.lib.php.
Referenced by getVersions().
version_os | ( | $option = '' | ) |
Return OS version.
Note that PHP_OS returns only OS (not version) and OS PHP was built on, not necessarily OS PHP runs on.
string | $option | Option string |
Definition at line 1858 of file functions2.lib.php.
Referenced by getVersions().
version_php | ( | ) |
Return PHP version.
Definition at line 1874 of file functions2.lib.php.
Referenced by getVersions().
version_webserver | ( | ) |
Return web server version.
Definition at line 1909 of file functions2.lib.php.
Referenced by getVersions().
weight_convert | ( | $weight, | |
& | $from_unit, | ||
$to_unit ) |
Convertit une masse d'une unite vers une autre unite.
float | $weight | Masse a convertir |
int | $from_unit | Unite originale en puissance de 10 |
int | $to_unit | Nouvelle unite en puissance de 10 |
Definition at line 1733 of file functions2.lib.php.
References weight_convert().
Referenced by weight_convert().