dolibarr 21.0.0-alpha
lib_head.js.php File Reference

File that include javascript functions (included if option use_javascript activated) JQuery (providing object $) and JQuery-UI (providing $datepicker) libraries must be loaded before this file. More...

Go to the source code of this file.

Functions

 copyToClipboard (text, text2)
 Function to output a dialog box for copy/paste.
 
 newpopup (url, title)
 Show a popup HTML page.
 
 document_preview (file, type, title)
 Function show document preview.
 
 getOperatorsForFieldType (type)
 Get the list of operators for a given field type.
 
 generateFilterString (column, operator, context, fieldType)
 Generate a filter string based on the given column, operator, context and field type.
 
 pricejs (amount, mode='MT', currency_code='', force_locale='')
 Function similar to PHP price()
 
 price2numjs (amount)
 Function similar to PHP price2num()
 

Detailed Description

File that include javascript functions (included if option use_javascript activated) JQuery (providing object $) and JQuery-UI (providing $datepicker) libraries must be loaded before this file.

Definition in file lib_head.js.php.

Function Documentation

◆ copyToClipboard()

copyToClipboard ( text ,
text2  )

Function to output a dialog box for copy/paste.

Parameters
textText to put into copy/paste area
text2Text to put under the copy/paste area

Definition at line 955 of file lib_head.js.php.

◆ document_preview()

document_preview ( file ,
type ,
title  )

Function show document preview.

It uses the "dialog" function. The a tag around the img must have the src='', class='documentpreview', mime='image/xxx', target='_blank' from getAdvancedPreviewUrl().

Parameters
fileUrl
typeMime file type ("image/jpeg", "application/pdf", "text/html")
titleTitle of popup
Returns
void
See also
newpopup()

Definition at line 1001 of file lib_head.js.php.

References type.

◆ generateFilterString()

generateFilterString ( column ,
operator ,
context ,
fieldType  )

Generate a filter string based on the given column, operator, context and field type.

Decimal adjustment of a number.

Parameters
{String}type The type of adjustment.
{Number}value The number.
{Integer}exp The exponent (the 10 logarithm of the adjustment base).
Returns
{Number} The adjusted value.

Definition at line 1163 of file lib_head.js.php.

◆ newpopup()

newpopup ( url ,
title  )

Show a popup HTML page.

Use the "window.open" function.

Parameters
urlUrl
titleTitle of popup
Returns
boolean False
See also
document_preview()

Definition at line 976 of file lib_head.js.php.

References newpopup().

Referenced by newpopup().

◆ price2numjs()

price2numjs ( amount )

Function similar to PHP price2num()

Parameters
{number|string}amount The amount to convert/clean
Returns
{number} The amount in universal numeric format (Example: '99.99999')

Definition at line 1364 of file lib_head.js.php.

References getDolGlobalInt(), and getDolGlobalString().

◆ pricejs()

pricejs ( amount ,
mode = 'MT',
currency_code = '',
force_locale = '' )

Function similar to PHP price()

Example use: pricejs(13312.448, 'MT', 'EUR', 'fr_FR') // (depending on conf for 'MT'): '13 312.45 €'

pricejs(343000.121, 'MT') // assuming conf for 'MT' is 2 and $langs->defaultlang is 'en_US': '343,000.12'

Parameters
{number|string}amount The amount to show
{string}mode 'MT' or 'MU'
{string}currency_code ISO code of currency (empty by default)
{string}force_locale ISO code locale to use (if empty, will use Dolibarr's current locale code)
Returns
{string} The amount with digits

Definition at line 1291 of file lib_head.js.php.

References getDolGlobalInt(), and getDolGlobalString().