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

 sanitizeFileName ($str, $newstr='_')
 Clean a string to use it as a file name.
 dol_string_unaccent ($str)
 Clean a string from all accent characters.
 dol_string_nospecial ($str, $newstr='_')
 Clean a string from all punctuation characters.
 dol_escape_js ($stringtoescape)
 Returns text escaped for inclusion in javascript code.
 dol_escape_htmltag ($stringtoescape)
 Returns text escaped for inclusion in HTML alt or title tags.
 dol_syslog ($message, $level=LOG_INFO)
 Write log message in a file or to syslog process Pour fichier: fichier defined by SYSLOG_FILE Pour syslog: facility defined by SYSLOG_FACILITY Warning, les fonctions syslog sont buggues sous Windows et generent des fautes de protection memoire.
 dol_fiche_head ($links, $active='0', $title='', $notab=0)
 Affiche le header d'une fiche.
 dol_time_plus_duree ($time, $duration_value, $duration_unit)
 Add a delay to a date.
 dol_print_date ($time, $format='', $to_gmt=false, $outputlangs='', $encodetooutput=false)
 Output date in a string format according to outputlangs (or langs if not defined).
 dol_getdate ($timestamp, $fast=false)
 Return an array with date info.
 dol_mktime ($hour, $minute, $second, $month, $day, $year, $gm=0, $check=1)
 Return a GMT date built from detailed informations 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.
 dol_date ($fmt, $timestamp, $gm=0)
 Returns formated date.
 dol_print_size ($size)
 Return string with formated size.
 dol_print_url ($url, $target='_blank', $max=32)
 Show Url link.
 dol_print_email ($email, $cid=0, $socid=0, $addlink=0, $max=64)
 Show EMail link.
 dol_print_phone ($phone, $country="FR", $cid=0, $socid=0, $addlink=0, $separ="&nbsp;")
 Format phone numbers according to country.
 dol_strlen ($string, $stringencoding='')
 Make a strlen call.
 dol_substr ($string, $start, $length, $stringencoding='')
 Make a substring.
 dol_trunc ($string, $size=40, $trunc='right', $stringencoding='')
 Truncate a string to a particular length adding '.
 img_object ($alt, $object)
 Affiche picto propre a une notion/module (fonction g�n�rique).
 img_picto ($alt, $picto, $options='', $pictoisfullpath=0)
 Show picto (generic function).
 img_picto_common ($alt, $picto, $options='', $pictoisfullpath=0)
 Show picto (generic function).
 img_action ($alt="default", $numaction)
 Affiche logo action.
 img_file ($alt="default")
 Affiche logo fichier.
 img_refresh ($alt="default")
 Affiche logo refresh.
 img_folder ($alt="default")
 Affiche logo dossier.
 img_file_new ($alt="default")
 Affiche logo nouveau fichier.
 img_pdf ($alt="default", $size=3)
 Affiche logo pdf.
 img_edit_add ($alt="default")
 Affiche logo +.
 img_edit_remove ($alt="default")
 Affiche logo -.
 img_edit ($alt="default", $float=0, $other='')
 Affiche logo editer/modifier fiche.
 img_view ($alt="default", $float=0, $other='')
 Affiche logo voir fiche.
 img_delete ($alt="default")
 Affiche logo effacer.
 img_help ($usehelpcursor=1, $usealttitle=1)
 Affiche logo help avec curseur "?".
 img_info ($alt="default")
 Affiche logo info.
 img_warning ($alt="default", $float=0)
 Affiche logo warning.
 img_error ($alt="default")
 Affiche logo error.
 img_phone ($alt="default", $option=0)
 Affiche logo telephone.
 img_next ($alt="default")
 Affiche logo suivant.
 img_previous ($alt="default")
 Affiche logo pr�c�dent.
 img_down ($alt="default", $selected=0)
 Affiche logo bas.
 img_up ($alt="default", $selected=0)
 Affiche logo haut.
 img_left ($alt="default", $selected=0)
 Affiche logo gauche.
 img_right ($alt="default", $selected=0)
 Affiche logo droite.
 img_tick ($alt="default")
 Affiche logo tick.
 img_allow ($allow)
 Affiche le logo tick si allow.
 img_mime ($file, $alt='')
 Show mime picto.
 info_admin ($texte, $infoonimgalt=0)
 Show information for admin users.
 restrictedArea ($user, $feature='societe', $objectid=0, $dbtablename='', $feature2='', $dbt_socfield='fk_soc')
 Check permissions of a user to show a page and an object.
 accessforbidden ($message='', $printheader=1)
 Affiche message erreur de type acces interdit et arrete le programme.
 dol_print_error ($db='', $error='')
 Affiche message erreur system avec toutes les informations pour faciliter le diagnostic et la remont�e des bugs.
 dol_move_uploaded_file ($src_file, $dest_file, $allowoverwrite)
 Deplacer les fichiers telecharg�s, apres quelques controles divers.
 print_liste_field_titre ($name, $file, $field, $begin="", $options="", $td="", $sortfield="", $sortorder="")
 Show title line of an array.
 print_titre ($titre)
 Affichage d'un titre.
 print_fiche_titre ($titre, $mesg='', $picto='title.gif', $pictoisfullpath=0)
 Affichage d'un titre d'une fiche, align� a gauche.
 print_barre_liste ($titre, $page, $file, $options='', $sortfield='', $sortorder='', $center='', $num=-1, $totalnboflines=0, $picto='title.gif', $pictoisfullpath=0)
 Print a title with navigation controls for pagination.
 print_fleche_navigation ($page, $file, $options='', $nextpage, $betweenarrows='')
 Fonction servant a afficher les fleches de navigation dans les pages de listes.
 dol_delete_file ($file)
 Effacement d'un fichier.
 dol_delete_dir ($dir)
 Remove a directory.
 dol_delete_dir_recursive ($dir, $count=0)
 Remove a directory $dir and its subdirectories.
 vatrate ($rate, $addpercent=false, $info_bits=0)
 Fonction qui retourne un taux de tva formate pour visualisation.
 price ($amount, $html=0, $outlangs='', $trunc=1, $rounding=2)
 Fonction qui formate un montant pour visualisation.
 price2num ($amount, $rounding='', $alreadysqlnb=0)
 Function that return a number with universal decimal format (decimal separator is '.
 get_product_vat_for_country ($idprod, $countrycode)
 Return vat rate of a product in a particular selling country.
 get_default_tva ($societe_vendeuse, $societe_acheteuse, $taux_produit, $idprod=0)
 Fonction qui renvoie la tva d'une ligne (en fonction du vendeur, acheteur et taux du produit).
 get_default_npr ($societe_vendeuse, $societe_acheteuse, $taux_produit)
 Fonction qui renvoie si tva doit etre tva percue r�cup�rable.
 yn ($yesno, $case=1, $color=0)
 Renvoie oui ou non dans la langue choisie.
 get_exdir ($num, $level=3)
 Return a path to class a directory according to an id.
 create_exdir ($dir)
 Creation of a directory (recursive).
 picto_required ()
 Retourne le picto champ obligatoire.
 dol_string_nohtmltag ($StringHtml, $removelinefeed=1)
 Clean a string from all HTML tags and entities.
 dol_nl2br ($stringtoencode, $nl2brmode=0)
 Replace CRLF in string with a HTML BR tag.
 dol_htmlentitiesbr ($stringtoencode, $nl2brmode=0, $pagecodefrom='UTF-8')
 This function is called to encode a string into a HTML string.
 dol_htmlentitiesbr_decode ($stringtodecode, $pagecodeto='UTF-8')
 This function is called to decode a HTML string (it decodes entities and br tags).
 dol_htmlcleanlastbr ($stringtodecode)
 This function remove all ending
and br at end.
 dol_entity_decode ($stringhtml, $pagecodeto='UTF-8')
 This function is called to decode a string with HTML entities (it decodes entities tags).
 dol_string_is_good_iso ($s)
 Check if a string is a correct iso string If not, it will we considered not HTML encoded even if it is by FPDF.
 dol_nboflines ($s, $maxchar=0)
 Return nb of lines of a clear text.
 dol_nboflines_bis ($texte, $maxlinesize=0)
 Return nb of lines of a formated text with
and
.
 dol_microtime_float ()
 Fonction simple identique a microtime de PHP 5 mais compatible PHP 4.
 make_substitutions ($chaine, $substitutionarray)
 Effectue les substitutions des mots cl�s par les donn�es en fonction du tableau.
 print_date_range ($date_start, $date_end, $format= '', $outputlangs='')
 Format output for start and end date.
 monthArrayOrSelected ($selected=0)
 Retourne un tableau des mois ou le mois selectionne.
 dol_htmloutput_errors ($mesgstring='', $mesgarray='')
 Returns formated reduction.
 stopwithmem ()
 This function output memory used by PHP and exit everything.
 dol_sort_array (&$array, $index, $order='asc', $natsort, $case_sensitive)
 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).
 utf8_check ($Str)
 Check if a string is in UTF8.


Detailed Description

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

Version:
Id
functions.lib.php,v 1.162.2.1 2009/05/22 15:15:58 eldy Exp

Definition in file functions.lib.php.


Function Documentation

accessforbidden ( message = '',
printheader = 1 
)

Affiche message erreur de type acces interdit et arrete le programme.

Parameters:
message Force error message
printheader Affiche avant le header
Remarks:
L'appel a cette fonction termine le code.

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

References llxHeader(), and print.

Referenced by restrictedArea().

create_exdir ( dir  ) 

dol_date ( fmt,
timestamp,
gm = 0 
)

Returns formated date.

Parameters:
fmt Format (Exemple: 'Y-m-d H:i:s')
timestamp Date. Exemple: Si timestamp=0 et gm=1, renvoi 01/01/1970 00:00:00
gm 1 if timestamp was built with gmmktime, 0 if timestamp was build with mktime
Returns:
string Formated date

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

dol_delete_dir ( dir  ) 

Remove a directory.

Parameters:
file Directory to delete
Returns:
boolean True if success, false if error
Remarks:
If directory is not empty, return false

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

Referenced by Propal::delete(), Livraison::delete(), Expedition::delete(), EcmDirectory::delete(), Commande::delete(), Livraison::valid(), and Expedition::valid().

dol_delete_dir_recursive ( dir,
count = 0 
)

Remove a directory $dir and its subdirectories.

Parameters:
file Dir to delete
count Counter to count nb of deleted elements
Returns:
int Number of files and directory removed

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

Referenced by FormMail::clear_attached_files(), and Societe::delete().

dol_delete_file ( file  ) 

Effacement d'un fichier.

Parameters:
file Fichier a effacer ou masque de fichier a effacer
boolean true if file deleted, false if error

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

References dol_syslog().

Referenced by Propal::delete(), Livraison::delete(), Expedition::delete(), Commande::delete(), Facture::set_valid(), Livraison::valid(), Expedition::valid(), and Commande::valid().

dol_entity_decode ( stringhtml,
pagecodeto = 'UTF-8' 
)

This function is called to decode a string with HTML entities (it decodes entities tags).

Parameters:
string stringhtml
Returns:
string decodestring

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

Referenced by dol_string_nohtmltag().

dol_escape_htmltag ( stringtoescape  ) 

Returns text escaped for inclusion in HTML alt or title tags.

Parameters:
$stringtoescape String to escape
Returns:
string Escaped string

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

dol_escape_js ( stringtoescape  ) 

Returns text escaped for inclusion in javascript code.

Parameters:
$stringtoescape String to escape
Returns:
string Escaped string

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

dol_fiche_head ( links,
active = '0',
title = '',
notab = 0 
)

Affiche le header d'une fiche.

Parameters:
links Tableau de titre d'onglets
active 0=onglet non actif, 1=onglet actif
title Titre tabelau ("" par defaut)
notab 0=Add tab header, 1=no tab header

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

References dol_trunc(), and print.

Referenced by report_header().

dol_getdate ( timestamp,
fast = false 
)

Return an array with date info.

Parameters:
timestamp Timestamp
fast Fast mode
Returns:
array Array of informations If no fast mode: 'seconds' => $secs, 'minutes' => $min, 'hours' => $hour, 'mday' => $day, 'wday' => $dow, 'mon' => $month, 'year' => $year, 'yday' => floor($secsInYear/$_day_power), 'weekday' => gmdate('l',$_day_power*(3+$dow)), 'month' => gmdate('F',mktime(0,0,0,$month,2,1971)), 0 => $origd If fast mode: 'seconds' => $secs, 'minutes' => $min, 'hours' => $hour, 'mday' => $day, 'mon' => $month, 'year' => $year, 'yday' => floor($secsInYear/$_day_power), 'leap' => $leaf, 'ndays' => $ndays
Remarks:
PHP getdate is restricted to the years 1901-2038 on Unix and 1970-2038 on Windows

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

dol_htmlcleanlastbr ( stringtodecode  ) 

This function remove all ending
and br at end.

Parameters:
stringtodecode String to decode

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

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

This function is called to encode a string into a HTML string.

All entities except &,<,> are converted. This permits to encode special chars to entities with no double encoded for already encoded HTML strings. This function also remove last CR/BR.

Parameters:
stringtoencode String to encode
nl2brmode 0=Adding br before
, 1=Replacing
by br (for use with FPDF writeHTMLCell function for example)
Remarks:
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.

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

References dol_nl2br().

Referenced by DolEditor::DolEditor(), Adherent::send_an_email(), show_list_sending_receive(), pdf_propale_jaune::write_file(), and pdf_soleil::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:
stringtodecode String to decode

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

Referenced by CommActionRapport::_pages().

dol_htmloutput_errors ( mesgstring = '',
mesgarray = '' 
)

Returns formated reduction.

Parameters:
reduction Reduction percentage
Returns:
int Return number of error messages shown

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

dol_microtime_float (  ) 

Fonction simple identique a microtime de PHP 5 mais compatible PHP 4.

Returns:
float Time en millisecondes avec decimal pour microsecondes

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

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

Return a GMT date built from detailed informations 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:
hour Hour (can be -1 for undefined)
minute Minute (can be -1 for undefined)
second Second (can be -1 for undefined)
month Month
day Day
year Year
gm 1=Input informations are GMT values, otherwise local to user
check 0=No check on parameters (Can use day 32, etc...)
Returns:
timestamp Date en timestamp, '' if error

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

Referenced by Product::_get_stats(), Stats::_getAmountByMonth(), Stats::_getNbByMonth(), pdf_paiement::_pagehead(), Webcal::build_calfile(), Facture::calculate_date_lim_reglement(), dol_print_date(), and show_day_events().

dol_move_uploaded_file ( src_file,
dest_file,
allowoverwrite 
)

Deplacer les fichiers telecharg�s, apres quelques controles divers.

Parameters:
src_file Source filename
dest_file Target filename
allowoverwrite Overwrite if exists
Returns:
int >0 if OK, <0 if KO, Name of virus if virus found

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

References dol_avscan_file(), and dol_syslog().

Referenced by Product::add_photo().

dol_nboflines ( s,
maxchar = 0 
)

Return nb of lines of a clear text.

Parameters:
s String to check
maxchar Not yet used
Returns:
int Number of lines

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

Referenced by CommActionRapport::_pages().

dol_nboflines_bis ( texte,
maxlinesize = 0 
)

Return nb of lines of a formated text with
and
.

Parameters:
texte Text
maxlinesize Largeur de ligne en caracteres(ou 0 si pas de limite - defaut)
Returns:
int Number of lines

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

Referenced by pdf_propale_jaune::write_file(), pdf_propale_azur::write_file(), pdf_typhon::write_file(), pdf_sirocco::write_file(), pdf_soleil::write_file(), pdf_crabe::write_file(), pdf_einstein::write_file(), and pdf_edison::write_file().

dol_nl2br ( stringtoencode,
nl2brmode = 0 
)

Replace CRLF in string with a HTML BR tag.

Parameters:
string2encode String to encode
nl2brmode 0=Adding br before
, 1=Replacing
by br
Returns:
string String encoded

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

Referenced by dol_htmlentitiesbr().

dol_print_date ( time,
format = '',
to_gmt = false,
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 cas charset is output charset.

Parameters:
time GM Timestamps date (or 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM:SS' in server TZ)
format Output date format "%d %b %Y", "%d/%m/%Y %H:%M", "%d/%m/%Y %H:%M:%S", "day", "daytext", "dayhour", "dayhourldap", "dayhourtext"
to_gmt false=output string if for local server TZ users, true=output string is for GMT users
outputlangs Object lang that contains language for text translation.
Returns:
string Formated date or '' if time is null

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

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

Referenced by Product::_get_stats(), Stats::_getAmountByMonth(), Stats::_getNbByMonth(), Adherent::_load_ldap_info(), pdf_muscadet::_pagehead(), pdf_paiement::_pagehead(), pdf_typhon::_pagehead(), pdf_sirocco::_pagehead(), pdf_crabe::_pagehead(), CommActionRapport::_pages(), pdf_oursin::_tableau_versements(), pdf_crabe::_tableau_versements(), mailing_fraise::add_to_target(), build_calfile(), dol_print_error(), dol_print_object_info(), facture_meta_create(), Commande::fetch(), BordereauChequeBlochet::Header(), report_header(), InterfaceWebcalsynchro::run_trigger(), InterfacePhenixsynchro::run_trigger(), InterfaceActionsAuto::run_trigger(), Form::select_date(), show_day_events(), write_conf_file(), pdf_paiement::write_file(), pdf_soleil::write_file(), and html_cerfafr::write_file().

dol_print_email ( email,
cid = 0,
socid = 0,
addlink = 0,
max = 64 
)

Show EMail link.

Parameters:
email EMail to show
cid Id of contact if known
socid Id of third party if known
addlink 0=no link to create action
max Max number of characters to show
Returns:
string HTML Link

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

References dol_trunc(), and img_object().

Referenced by show_contacts().

dol_print_error ( db = '',
error = '' 
)

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

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

Parameters:
db Database handler
error Chaine erreur ou tableau de chaines erreur complementaires a afficher

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

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

Referenced by Stats::_getAllByYear(), Stats::_getNbByMonth(), Stats::_getNbByYear(), Product::_log_price(), Categorie::add_fille(), Product::add_sousproduit(), Product::add_subproduct(), mailing_poire::add_to_target(), Tva::addPayment(), UserGroup::addrights(), User::addrights(), Categorie::already_exists(), Societe::attribute_prefix(), batch_fournisseur_updateturnover(), Propal::classer_facturee(), Commande::classer_facturee(), clean_orphelins(), Contrat::cloture(), Societe::contact_array(), Societe::contact_email_array(), Societe::contact_get_email(), Categorie::containing(), Product::correct_stock(), Propal::create(), Don::create(), Categorie::create(), Commande::create(), AdherentOptions::create(), AdherentOptions::create_label(), Product::del_sousproduit(), UserGroup::delete(), AdherentOptions::delete_label(), FactureFournisseur::deleteline(), UserGroup::delrights(), User::delrights(), CommonObject::detail_contact(), dol_set_user_param(), dolibarr_set_const(), don_create(), expedition_pdf_create(), facture_pdf_create(), Entrepot::fetch(), Product::fetch(), Paiement::fetch(), FactureFournisseur::fetch(), CommandeFournisseurLigne::fetch(), PaiementFourn::fetch(), FichinterLigne::fetch(), FactureLigne::fetch(), Export::fetch(), AccountLine::fetch(), Categorie::fetch(), CommandeLigne::fetch(), Bookmark::fetch(), Adherent::fetch_login(), AdherentOptions::fetch_name_optionals_label(), Adherent::fetch_optionals(), fichinter_create(), FormCompany::form_prospect_level(), RemiseCheque::GeneratePdf(), Categorie::get_all_categories(), Project::get_element_list(), Categorie::get_filles(), Product::get_fils_arbo(), EcmDirectory::get_full_arbo(), Categorie::get_full_arbo(), Categorie::get_meres(), Categorie::get_nb_categories(), get_next_value(), Societe::get_nom(), Product::get_pere(), Facture::getListIdAvoirFromInvoice(), Propal::getNextNumRef(), CommandeFournisseur::getNextNumRef(), Facture::getNextNumRef(), Commande::getNextNumRef(), Propal::getOrderArrayList(), Project::getTasksArray(), Project::getTasksRoleForUser(), Societe::info(), Propal::info(), FactureFournisseur::info(), Facture::info(), AccountLine::info(), Commande::info(), Cotisation::info(), Adherent::info(), ActionComm::info(), FichinterLigne::insert(), FactureLigne::insert(), CommandeLigne::insert(), Product::is_sousproduit(), Fournisseur::ListArray(), CommonObject::liste_contact(), ModelePDFFactures::liste_modeles(), methode_expedition::liste_modeles(), ModeleDroitPret::liste_rapport(), Menubase::listeMainmenu(), Translate::Load(), FactureFournisseur::load_board(), Facture::load_board(), Contrat::load_board(), RemiseCheque::load_board(), Account::load_board(), Adherent::load_board(), Form::load_cache_conditions_paiements(), Form::load_cache_types_paiements(), User::load_entrepots(), EcmDirectory::load_motherof(), Service::load_state_board(), Prospect::load_state_board(), Propal::load_state_board(), Product::load_state_board(), Fournisseur::load_state_board(), Facture::load_state_board(), Contrat::load_state_board(), Commande::load_state_board(), Client::load_state_board(), Adherent::load_state_board(), FormProduct::loadWarehouses(), Menubase::menuLeftCharger(), Menubase::menuTopCharger(), migrate_paiements(), migrate_paiements_orphelins_1(), migrate_paiements_orphelins_2(), PDF_card::PDF_card(), print_paybox_redirect(), propale_pdf_create(), ImportCsv::read_record(), Categorie::remove(), Product::remove_price(), Form::select_adresse_livraison(), FormCompany::select_civilite(), Form::select_comptes(), Form::select_contacts(), Form::select_currency(), FormCompany::select_departement(), FormOther::select_ecotaxes(), FormOther::select_export_model(), Form::select_export_model(), FormCompany::select_forme_juridique(), Form::select_product_fourn_price(), Form::select_produits_do(), Form::select_produits_fournisseurs_do(), select_projects(), Form::select_propal_statut(), FormCompany::select_region(), Form::select_remises(), Form::select_societes(), Form::select_type_socialcontrib(), Form::select_users(), FormCompany::selectCompaniesForNewContact(), Notify::send(), FactureFournisseur::set_payed(), Societe::set_price_level(), Facture::set_valid(), CommonObject::setDocModel(), User::setPassword(), Adherent::setPassword(), CommonObject::setProject(), show_actions_done(), show_actions_todo(), show_array_actions_to_do(), show_array_last_actions_done(), FormFile::show_documents(), show_list_sending_receive(), FormActions::showactions(), supplier_order_pdf_create(), tva_coll(), tva_paye(), UserGroup::update(), Don::update(), Account::update(), Categorie::update(), AdherentOptions::update(), Product::update_barcode(), Product::update_barcode_type(), CommonObject::update_contact(), Paiement::update_fk_bank(), PaiementFourn::update_fk_bank(), Tva::update_fk_bank(), AdherentOptions::update_label(), Product::update_price(), vat_by_quarter(), vat_by_thirdparty(), pdf_paiement::write_file(), pdf_typhon::write_file(), pdf_sirocco::write_file(), pdf_soleil::write_file(), and ExportCsv::write_record().

dol_print_phone ( phone,
country = "FR",
cid = 0,
socid = 0,
addlink = 0,
separ = "&nbsp;" 
)

Format phone numbers according to country.

Parameters:
phone Phone number to format
country Country to use for formatting
cid Id of contact if known
socid Id of third party if known
addlink 0=no link to create action
separ separation between numbers for a better visibility example : xx.xx.xx.xx.xx
Returns:
string Formated phone number

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

References img_object().

Referenced by show_contacts().

dol_print_size ( size  ) 

Return string with formated size.

Parameters:
size Size to print
Returns:
string Link

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

dol_print_url ( url,
target = '_blank',
max = 32 
)

Show Url link.

Parameters:
url Url to show
target Target for link
max Max number of characters to show
Returns:
string HTML Link

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

References dol_trunc().

dol_string_is_good_iso ( s  ) 

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

Remarks:
Example, if string contains euro symbol that has ascii code 128.
Parameters:
s String to check
Returns:
int 0 if bad iso, 1 if good iso

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

dol_string_nohtmltag ( StringHtml,
removelinefeed = 1 
)

Clean a string from all HTML tags and entities.

Parameters:
StringHtml String to clean
removelinefeed Replace also all lines feeds by a space
Returns:
string String cleaned

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

References dol_entity_decode().

Referenced by build_calfile(), build_rssfile(), ImportCsv::csv_clean(), ExportCsv::csv_clean(), and ExportExcel::excel_clean().

dol_string_nospecial ( str,
newstr = '_' 
)

Clean a string from all punctuation characters.

Parameters:
str String to clean
newstr String to replace bad chars by
Returns:
string Cleaned string

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

Referenced by check_value(), Product::create(), EcmDirectory::create(), get_next_value(), sanitizeFileName(), and Product::update().

dol_string_unaccent ( str  ) 

Clean a string from all accent characters.

Parameters:
str String to clean
Returns:
string Cleaned string

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

References utf8_check().

Referenced by sanitizeFileName().

dol_strlen ( string,
stringencoding = '' 
)

Make a strlen call.

Works even in mbstring module not enabled

Parameters:
unknown_type $string
unknown_type $stringencoding
Returns:
unknown

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

Referenced by dol_trunc().

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

Make a substring.

Works even in mbstring module not enabled

Parameters:
unknown_type $string
unknown_type $start
unknown_type $length
unknown_type $stringencoding
Returns:
unknown

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

Referenced by Stats::_getAmountByMonth(), Stats::_getNbByMonth(), dol_print_date(), and dol_trunc().

dol_syslog ( message,
level = LOG_INFO 
)

Write log message in a file or to syslog process Pour fichier: fichier defined by SYSLOG_FILE Pour syslog: facility defined by SYSLOG_FACILITY Warning, les fonctions syslog sont buggues sous Windows et generent des fautes de protection memoire.

Pour resoudre, utiliser le loggage fichier, au lieu du loggage syslog (configuration du module). Si SYSLOG_FILE_NO_ERROR defini, on ne gere pas erreur ecriture log

Parameters:
message Line to log. Ne doit pas etre traduit si level = LOG_ERR
level Log level
Remarks:
This function works only if syslog module is enabled.

This must must not use any call to other function calling dol_syslog (avoid infinite loop).

On Windows LOG_ERR=4, LOG_WARNING=5, LOG_NOTICE=LOG_INFO=LOG_DEBUG=6 On Linux LOG_ERR=3, LOG_WARNING=4, LOG_INFO=6, LOG_DEBUG=7

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

References print.

Referenced by DolibarrModules::_active(), ProductLivre::_calculate_prix_revient(), MouvementStock::_create(), MouvementStock::_createProductComposition(), MouvementStock::_createSubProduct(), DolibarrModules::_dbactive(), DolibarrModules::_dbunactive(), CMailFile::_encode_file(), BonPrelevement::_get_list_factures(), Stats::_getAllByYear(), Stats::_getAmountByMonth(), Stats::_getAverageByMonth(), Stats::_getNbByMonth(), Stats::_getNbByYear(), DolibarrModules::_init(), Product::_log_price(), CommActionRapport::_pages(), Product::_setErrNo(), pdf_oursin::_tableau_versements(), pdf_crabe::_tableau_versements(), DolibarrModules::_unactive(), Contrat::active_line(), Webcal::add(), Phenix::add(), ActionComm::add(), CommonObject::add_contact(), Product::add_photo(), Product::add_photo_web(), Propal::add_product(), Adherent::add_to_mailman(), Adherent::add_to_spip(), mailing_pomme::add_to_target(), mailing_poire::add_to_target(), MailingTargets::add_to_target(), mailing_kiwi::add_to_target(), mailing_fraise::add_to_target(), Account::add_url_line(), Propal::addline(), FactureFournisseur::addline(), CommandeFournisseur::addline(), Facture::addline(), Contrat::addline(), FactureRec::addline(), Account::addline(), Commande::addline(), Tva::addPayment(), User::addrights(), ComptaExportPoivre::Agregate(), CommandeFournisseur::approve(), Contrat::array_detail(), DoliDb::begin(), Webcal::build_calfile(), build_calfile(), ActionComm::build_exportfile(), ModeleExports::build_file(), Export::build_file(), Categorie::build_path_from_id_categ(), build_rssfile(), CommandeFournisseur::Cancel(), Commande::cancel(), EcmDirectory::changeNbOfFiles(), Societe::check_codeclient(), Societe::check_codefournisseur(), check_user_password_dolibarr(), check_user_password_forceuser(), check_user_password_http(), check_user_password_ldap(), check_value(), checkBanForAccount(), MailingTargets::clear_target(), DoliDb::close(), Commande::cloture(), CMailFile::CMailFile(), Societe::codeclient_modifiable(), Societe::codefournisseur_modifiable(), CommandeFournisseur::commande(), DoliDb::commit(), Propal::cond_reglement(), Facture::cond_reglement(), Commande::cond_reglement(), DoliDb::connect(), Product::correct_stock(), Adherent::cotisation(), Notify::countDefinedNotifications(), UserGroup::create(), User::create(), Societe::create(), Propal::create(), ProductLivre::Create(), Product::create(), Livraison::create(), FactureFournisseur::create(), CommandeFournisseur::create(), PaiementFourn::create(), Facture::create(), Export::create(), EcmDirectory::create(), Don::create(), DiscountAbsolute::create(), Menubase::create(), Events::create(), Contrat::create(), Contact::create(), Tva::create(), BonPrelevement::Create(), RemiseCheque::Create(), Deplacement::create(), ComptaCompte::create(), Account::create(), Mailing::create(), AdresseLivraison::create(), PaiementCharge::create(), ChargeSociales::create(), Commande::create(), Bookmark::create(), Cotisation::create(), AdherentType::create(), AdherentOptions::create(), Adherent::create(), AccountancySystem::create(), AccountancyAccount::create(), Fournisseur::create_commande(), create_exdir(), User::create_from_contact(), User::create_from_member(), Societe::create_from_member(), Commande::create_from_propale(), AdherentOptions::create_label(), Fournisseur::CreateCategory(), Facture::createFromCurrent(), Project::CreateTask(), DoliDb::DDLAddField(), DoliDb::DDLCreateDb(), DoliDb::DDLCreateTable(), DoliDb::DDLCreateUser(), DoliDb::DDLDescTable(), DoliDb::DDLDropField(), Adherent::del_to_mailman(), Societe::delete(), Propal::delete(), Project::delete(), FactureFournisseur::delete(), CommandeFournisseur::delete(), Facture::delete(), Export::delete(), EcmDirectory::delete(), Contrat::delete(), RemiseCheque::Delete(), AccountLine::delete(), Mailing::delete(), AdresseLivraison::delete(), ChargeSociales::delete(), CommandeLigne::delete(), Cotisation::delete(), AdherentOptions::delete(), Adherent::delete(), ActionComm::delete(), DolibarrModules::delete_boxes(), CommonObject::delete_contact(), CommandeFournisseur::delete_line(), FichinterLigne::delete_line(), Contrat::delete_line(), DolibarrModules::delete_menus(), DolibarrModules::delete_permissions(), DolibarrModules::delete_style_sheet(), DolibarrModules::delete_tabs(), Facture::deleteline(), Facture::demande_prelevement(), Facture::demande_prelevement_delete(), dol_delete_file(), dol_dir_list(), dol_move_uploaded_file(), dol_print_date(), dol_print_error(), dol_print_file(), dol_set_user_param(), DolEditor::DolEditor(), dolibarr_del_const(), dolibarr_get_const(), dolibarr_set_const(), DoliDb::DoliDb(), don_create(), FormCompany::effectif_array(), encodedecode_dbpassconf(), expedition_pdf_create(), ComptaExport::Export(), Product::fastappro(), UserGroup::fetch(), User::fetch(), Societe::fetch(), Propal::fetch(), Project::fetch(), Product::fetch(), Paiement::fetch(), Osc_product::fetch(), Osc_order::fetch(), Osc_customer::fetch(), Livraison::fetch(), ModeleBoxes::fetch(), FactureFournisseur::fetch(), CommandeFournisseur::fetch(), FichinterLigne::fetch(), Facture::fetch(), Export::fetch(), Expedition::fetch(), EcmDirectory::fetch(), DiscountAbsolute::fetch(), ContratLigne::fetch(), Contrat::fetch(), LignePrelevement::fetch(), RemiseCheque::Fetch(), FactureRec::fetch(), AccountLine::fetch(), Mailing::fetch(), AdresseLivraison::fetch(), ChargeSociales::fetch(), Categorie::fetch(), Commande::fetch(), Bookmark::fetch(), Cotisation::fetch(), AdherentType::fetch(), Adherent::fetch(), ActionComm::fetch(), AdresseLivraison::fetch_adresse(), Contrat::fetch_lignes(), FactureFournisseur::fetch_lines(), Facture::fetch_lines(), FactureRec::fetch_lines(), Commande::fetch_lines(), AdherentOptions::fetch_name_optionals_label(), Adherent::fetch_optionals(), Adherent::fetch_subscriptions(), fichinter_create(), FormCompany::form_prospect_level(), RemiseCheque::GeneratePdf(), Product::get_buyprice(), mod_codecompta_aquarium::get_code(), Societe::get_codeclient(), Societe::get_codefournisseur(), get_default_tva(), Project::get_element_list(), EcmDirectory::get_full_arbo(), Categorie::get_full_arbo(), get_next_value(), Categorie::get_type(), DiscountAbsolute::getAvailableDiscounts(), Paiement::getBillsArray(), PaiementFourn::getBillsArray(), getCountryLabel(), DolibarrModules::getDbVersion(), getFormeJuridiqueLabel(), CommonObject::getIdContact(), Translate::getLabelFromKey(), Contrat::getListOfContracts(), RemiseCheque::getNextNumber(), mod_codeclient_monkey::getNextValue(), mod_propale_marbre::getNextValue(), mod_facture_terre::getNextValue(), mod_commande_marbre::getNextValue(), User::getrights(), Facture::getSommePaiement(), ChargeSociales::getSommePaiement(), DiscountAbsolute::getSumCreditNotesUsed(), DiscountAbsolute::getSumDepositsUsed(), Project::getTasksArray(), Adherent::info(), ActionComm::info(), CommandeFournisseur::initAsSpecimen(), Expedition::initAsSpecimen(), Commande::initAsSpecimen(), FichinterLigne::insert(), FactureLigne::insert(), CommandeLigne::insert(), DolibarrModules::insert_boxes(), DolibarrModules::insert_const(), DolibarrModules::insert_menus(), DolibarrModules::insert_permissions(), DolibarrModules::insert_style_sheet(), DolibarrModules::insert_tabs(), Propal::InvoiceArrayList(), CommonObject::line_order(), DiscountAbsolute::link_to_invoice(), Facture::list_qualified_avoir_invoices(), Facture::list_replacable_invoices(), InfoBox::listBoxes(), CommonObject::liste_contact(), ModelePDFPropales::liste_modeles(), ModeleImports::liste_modeles(), ModeleExports::liste_modeles(), UserGroup::listGroupsForUser(), CommandeFournisseur::Livraison(), Import::load_arrays(), Export::load_arrays(), Form::load_cache_conditions_paiements(), Form::load_cache_types_paiements(), ModeleImports::load_file(), EcmDirectory::load_motherof(), CommonObject::load_previous_next_ref(), Product::load_stock(), Commande::loadExpeditions(), FormProduct::loadWarehouses(), CommandeFournisseur::log(), Product::log_price_delete(), makesalt(), Menubase::menuLeftCharger(), Menubase::menuTopCharger(), Propal::mode_reglement(), Facture::mode_reglement(), Commande::mode_reglement(), BonPrelevement::NbFactureAPrelever(), ImportCsv::open_file(), ExportExcel::open_file(), ExportCsv::open_file(), print_paybox_redirect(), propale_pdf_create(), ComptaExport::ReadLines(), ComptaExport::ReadLinesPayment(), Categorie::rechercher(), EcmDirectory::refreshcachenboffile(), CommandeFournisseur::refuse(), Bookmark::remove(), RemiseCheque::RemoveCheck(), Mailing::reset_targets_status(), Adherent::resiliate(), restrictedArea(), DoliDb::rollback(), run_sql(), InterfaceWebcalsynchro::run_trigger(), InterfacePhenixsynchro::run_trigger(), InterfaceNotification::run_trigger(), InterfaceLdapsynchro::run_trigger(), InterfaceActionsAuto::run_trigger(), InterfaceLogevents::run_trigger(), Interfaces::run_triggers(), InfoBox::saveboxorder(), Form::select_adresse_livraison(), FormCompany::select_civilite(), Form::select_comptes(), Form::select_contacts(), DoliDb::select_db(), FormCompany::select_departement(), FormCompany::select_forme_juridique(), Form::select_product_fourn_price(), Form::select_produits_do(), Form::select_produits_fournisseurs_do(), select_projects(), Form::select_propal_statut(), FormCompany::select_region(), Form::select_remises(), Form::select_societes(), Form::select_type_socialcontrib(), Form::select_types_paiements(), Form::select_users(), FormProduct::selectWarehouses(), Notify::send(), User::send_password(), CMailFile::sendfile(), Propal::set_adresse_livraison(), Commande::set_adresse_livraison(), Facture::set_canceled(), Propal::set_date(), Propal::set_date_livraison(), Commande::set_date_livraison(), Facture::set_draft(), Commande::set_draft(), Propal::set_echeance(), Facture::set_payed(), Propal::set_ref_client(), Commande::set_ref_client(), Propal::set_remise_absolue(), Facture::set_remise_absolue(), Commande::set_remise_absolue(), Societe::set_remise_client(), Propal::set_remise_percent(), Facture::set_unpayed(), FactureFournisseur::set_valid(), Facture::set_valid(), CommonObject::setDocModel(), User::setPassword(), Adherent::setPassword(), CommonObject::setProject(), User::setstatus(), Conf::setValues(), show_actions_done(), show_actions_todo(), show_list_sending_receive(), FormActions::showactions(), ModeleBoxes::showBox(), supplier_order_pdf_create(), Project::TaskAddTime(), Osc_product::transcode(), Osc_order::transcode(), Osc_customer::transcode(), FormCompany::typent_array(), UnActivate(), DiscountAbsolute::unlink_invoice(), Translate::UnLoad(), User::update(), Societe::update(), Product::update(), FichinterLigne::update(), FactureLigne::update(), Facture::update(), EcmDirectory::update(), Don::update(), AccountLine::update(), Account::update(), Mailing::update(), AdresseLivraison::update(), ChargeSociales::update(), Categorie::update(), Bookmark::update(), Cotisation::update(), Adherent::update(), ActionComm::update(), Product::update_barcode(), Product::update_barcode_type(), AccountLine::update_conciliation(), Adherent::update_end_date(), PaiementCharge::update_fk_bank(), User::update_last_login_date(), MailingTargets::update_nb(), CommonObject::update_note(), CommonObject::update_note_public(), Product::update_price(), CommonObject::update_price(), CommandeFournisseurLigne::update_total(), FichinterLigne::update_total(), FactureLigne::update_total(), ContratLigne::update_total(), CommandeLigne::update_total(), RemiseCheque::UpdateAmount(), ProductLivreContrat::UpdateCanvas(), ProductLivre::UpdateCanvas(), Propal::updateline(), FactureFournisseur::updateline(), CommandeFournisseur::updateline(), Facture::updateline(), Contrat::updateline(), Commande::updateline(), CommandeFournisseur::UpdateNote(), Livraison::valid(), CommandeFournisseur::valid(), Expedition::valid(), Mailing::valid(), Commande::valid(), RemiseCheque::Validate(), Adherent::validate(), Paiement::valide(), PaiementFourn::valide(), vat_by_quarter(), vat_by_thirdparty(), mod_codecompta_aquarium::verif(), mod_codeclient_monkey::verif(), mod_codeclient_elephant::verif(), vignette(), pdf_paiement::write_file(), html_cerfafr::write_file(), CMailFile::write_files(), CMailFile::write_mimeheaders(), and CMailFile::write_smtpheaders().

dol_time_plus_duree ( time,
duration_value,
duration_unit 
)

Add a delay to a date.

Parameters:
time Date timestamp ou au format YYYY-MM-DD
duration_value Value of delay to add
duration_unit Unit of added delay (d, m, y)
Returns:
int New timestamp

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

Referenced by Adherent::cotisation().

dol_trunc ( string,
size = 40,
trunc = 'right',
stringencoding = '' 
)

get_default_npr ( societe_vendeuse,
societe_acheteuse,
taux_produit 
)

Fonction qui renvoie si tva doit etre tva percue r�cup�rable.

Remarks:
Si vendeur non assujeti a TVA, TVA par d�faut=0. Fin de r�gle. Si le (pays vendeur = pays acheteur) alors TVA par d�faut=TVA du produit vendu. Fin de r�gle. Si (vendeur et acheteur dans Communaut� europ�enne) et (bien vendu = moyen de transports neuf comme auto, bateau, avion) alors TVA par d�faut=0 (La TVA doit �tre pay� par acheteur au centre d'impots de son pays et non au vendeur). Fin de r�gle. Si (vendeur et acheteur dans Communaut� europ�enne) et (acheteur = particulier ou entreprise sans num TVA intra) alors TVA par d�faut=TVA du produit vendu. Fin de r�gle Si (vendeur et acheteur dans Communaut� europ�enne) et (acheteur = entreprise avec num TVA) intra alors TVA par d�faut=0. Fin de r�gle Sinon TVA propos�e par d�faut=0. Fin de r�gle.
Parameters:
societe_vendeuse Objet soci�t� vendeuse
societe_acheteuse Objet soci�t� acheteuse
taux_produit Taux par defaut du produit vendu
Returns:
float 0 or 1

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

Referenced by Form::select_tva().

get_default_tva ( societe_vendeuse,
societe_acheteuse,
taux_produit,
idprod = 0 
)

Fonction qui renvoie la tva d'une ligne (en fonction du vendeur, acheteur et taux du produit).

Remarks:
Si vendeur non assujeti a TVA, TVA par d�faut=0. Fin de r�gle. Si le (pays vendeur = pays acheteur) alors TVA par d�faut=TVA du produit vendu. Fin de r�gle. Si (vendeur et acheteur dans Communaute europeenne) et (bien vendu = moyen de transports neuf comme auto, bateau, avion) alors TVA par d�faut=0 (La TVA doit �tre pay� par acheteur au centre d'impots de son pays et non au vendeur). Fin de r�gle. Si (vendeur et acheteur dans Communaute europeenne) et (acheteur = particulier ou entreprise sans num TVA intra) alors TVA par d�faut=TVA du produit vendu. Fin de r�gle Si (vendeur et acheteur dans Communaute europeenne) et (acheteur = entreprise avec num TVA) intra alors TVA par d�faut=0. Fin de r�gle Sinon TVA proposee par defaut=0. Fin de regle.
Parameters:
societe_vendeuse Objet societe vendeuse
societe_acheteuse Objet societe acheteuse
taux_produit Taux par defaut du produit vendu (old way to get product vat rate)
idprod Id product (new way to get product vat rate)
Returns:
float Taux de tva a appliquer, -1 si ne peut etre d�termin�

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

References dol_syslog(), and get_product_vat_for_country().

Referenced by Propal::add_product(), Commande::add_product(), Facture::create(), load_tva(), and Form::select_tva().

get_exdir ( num,
level = 3 
)

Return a path to class a directory according to an id.

Remarks:
Examples: 1->"0/0/1/", 15->"0/1/5/"
Parameters:
$num Id to develop
$level Level of development (1, 2 or 3 level)

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

Referenced by Product::add_photo(), Product::add_photo_web(), Product::is_photo_available(), FormFile::list_of_documents(), FormFile::show_documents(), Product::show_photos(), and html_cerfafr::write_file().

img_action ( alt = "default",
numaction 
)

Affiche logo action.

Parameters:
alt Texte sur le alt de l'image
numaction Determine image action
Returns:
string Retourne tag img

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

Referenced by Prospect::LibStatut().

img_allow ( allow  ) 

Affiche le logo tick si allow.

Parameters:
allow Authorise ou non
Returns:
string Retourne tag img

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

img_delete ( alt = "default"  ) 

Affiche logo effacer.

Parameters:
alt Texte sur le alt de l'image
Returns:
string Retourne tag img

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

Referenced by FormFile::list_of_documents().

img_down ( alt = "default",
selected = 0 
)

Affiche logo bas.

Parameters:
alt Texte sur le alt de l'image
selected Affiche version "selected" du logo
Returns:
string Retourne tag img

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

Referenced by print_liste_field_titre().

img_edit ( alt = "default",
float = 0,
other = '' 
)

Affiche logo editer/modifier fiche.

Parameters:
alt Texte sur le alt de l'image
float Si il faut y mettre le style "float: right"
Returns:
string Retourne tag img

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

Referenced by show_contacts().

img_edit_add ( alt = "default"  ) 

Affiche logo +.

Parameters:
alt Texte sur le alt de l'image
Returns:
string Retourne tag img

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

img_edit_remove ( alt = "default"  ) 

Affiche logo -.

Parameters:
alt Texte sur le alt de l'image
Returns:
string Retourne tag img

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

img_error ( alt = "default"  ) 

Affiche logo error.

Parameters:
alt Texte sur le alt de l'image
Returns:
string Retourne tag img

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

img_file ( alt = "default"  ) 

Affiche logo fichier.

Parameters:
alt Texte sur le alt de l'image
Returns:
string Retourne tag img

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

img_file_new ( alt = "default"  ) 

Affiche logo nouveau fichier.

Parameters:
alt Texte sur le alt de l'image
Returns:
string Retourne tag img

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

img_folder ( alt = "default"  ) 

Affiche logo dossier.

Parameters:
alt Texte sur le alt de l'image
Returns:
string Retourne tag img

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

img_help ( usehelpcursor = 1,
usealttitle = 1 
)

Affiche logo help avec curseur "?".

Parameters:
usehelpcursor 
usealttitle 
Returns:
string Retourne tag img

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

img_info ( alt = "default"  ) 

Affiche logo info.

Parameters:
alt Texte sur le alt de l'image
Returns:
string Retourne tag img

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

img_left ( alt = "default",
selected = 0 
)

Affiche logo gauche.

Parameters:
alt Texte sur le alt de l'image
selected Affiche version "selected" du logo
Returns:
string Retourne tag img

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

img_mime ( file,
alt = '' 
)

Show mime picto.

Parameters:
file Filename
alt Alternate text
Returns:
string Return img tag

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

Referenced by FormFile::list_of_documents(), FormFile::show_documents(), and FormMail::show_form().

img_next ( alt = "default"  ) 

Affiche logo suivant.

Parameters:
alt Texte sur le alt de l'image
Returns:
string Retourne tag img

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

Referenced by print_fleche_navigation(), and Form::showrefnav().

img_object ( alt,
object 
)

Affiche picto propre a une notion/module (fonction g�n�rique).

Parameters:
alt Texte sur le alt de l'image
object Objet pour lequel il faut afficher le logo (exemple: user, group, action, bill, contract, propal, product, ...)
Returns:
string Retourne tag img

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

Referenced by Notify::confirmMessage(), dol_print_email(), dol_print_phone(), ActionComm::fetch(), show_actions_done(), show_actions_todo(), show_contacts(), show_list_sending_receive(), FormActions::showactions(), ModeleBoxes::showBox(), mailing_pomme::url(), mailing_poire::url(), mailing_kiwi::url(), and mailing_fraise::url().

img_pdf ( alt = "default",
size = 3 
)

Affiche logo pdf.

Parameters:
alt Texte sur le alt de l'image
$size Taille de l'icone : 3 = 16x16px , 2 = 14x14px
Returns:
string Retourne tag img

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

Referenced by FormFile::show_documents().

img_phone ( alt = "default",
option = 0 
)

Affiche logo telephone.

Parameters:
alt Texte sur le alt de l'image
option Choose of logo
Returns:
string Retourne tag img

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

img_picto ( alt,
picto,
options = '',
pictoisfullpath = 0 
)

Show picto (generic function).

Parameters:
alt Texte sur le alt de l'image
picto Nom de l'image a afficher (Si pas d'extension, on met '.png')
options Attribut supplementaire a la balise img
pictoisfullpath If 1, image path is a full path
Returns:
string Retourne tag img

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

Referenced by info_admin(), User::LibStatut(), Propal::LibStatut(), Entrepot::LibStatut(), Product::LibStatut(), Paiement::LibStatut(), Livraison::LibStatut(), CommandeFournisseur::LibStatut(), PaiementFourn::LibStatut(), Facture::LibStatut(), Expedition::LibStatut(), Don::LibStatut(), ContratLigne::LibStatut(), Contrat::LibStatut(), Contact::LibStatut(), RemiseCheque::LibStatut(), Account::LibStatut(), Mailing::LibStatut(), ChargeSociales::LibStatut(), Commande::LibStatut(), Adherent::LibStatut(), ActionComm::LibStatut(), show_day_events(), and ModeleBoxes::showBox().

img_picto_common ( alt,
picto,
options = '',
pictoisfullpath = 0 
)

Show picto (generic function).

Parameters:
alt Texte sur le alt de l'image
picto Nom de l'image a afficher (Si pas d'extension, on met '.png')
options Attribut supplementaire a la balise img
pictoisfullpath If 1, image path is a full path
Returns:
string Retourne tag img

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

Referenced by tree_showpad().

img_previous ( alt = "default"  ) 

Affiche logo pr�c�dent.

Parameters:
alt Texte sur le alt de l'image
Returns:
string Retourne tag img

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

Referenced by print_fleche_navigation(), and Form::showrefnav().

img_refresh ( alt = "default"  ) 

Affiche logo refresh.

Parameters:
alt Texte sur le alt de l'image
Returns:
string Retourne tag img

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

Referenced by dol_loginfunction().

img_right ( alt = "default",
selected = 0 
)

Affiche logo droite.

Parameters:
alt Texte sur le alt de l'image
selected Affiche version "selected" du logo
Returns:
string Retourne tag img

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

img_tick ( alt = "default"  ) 

Affiche logo tick.

Parameters:
alt Texte sur le alt de l'image
Returns:
string Retourne tag img

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

img_up ( alt = "default",
selected = 0 
)

Affiche logo haut.

Parameters:
alt Texte sur le alt de l'image
selected Affiche version "selected" du logo
Returns:
string Retourne tag img

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

Referenced by print_liste_field_titre().

img_view ( alt = "default",
float = 0,
other = '' 
)

Affiche logo voir fiche.

Parameters:
alt Texte sur le alt de l'image
float Si il faut y mettre le style "float: right"
Returns:
string Retourne tag img

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

img_warning ( alt = "default",
float = 0 
)

Affiche logo warning.

Parameters:
alt Texte sur le alt de l'image
float Si il faut afficher le style "float: right"
Returns:
string Retourne tag img

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

Referenced by Product::fetch_prod_arbo(), and show_array_actions_to_do().

info_admin ( texte,
infoonimgalt = 0 
)

Show information for admin users.

Parameters:
text Text info
infoonimgalt Info is shown on alt of star picto, otherwise it is show on output
Returns:
string String with info text

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

References img_picto().

Referenced by FormCompany::select_civilite(), Form::select_conditions_paiements(), Form::select_currency(), FormCompany::select_departement(), FormCompany::select_forme_juridique(), FormActions::select_type_actions(), Form::select_type_fees(), Form::select_type_socialcontrib(), and Form::select_types_paiements().

make_substitutions ( chaine,
substitutionarray 
)

Effectue les substitutions des mots cl�s par les donn�es en fonction du tableau.

Parameters:
chaine Chaine dans laquelle faire les substitutions
substitutionarray Tableau cl� substitution => valeur a mettre
Returns:
string Chaine avec les substitutions effectu�es

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

Referenced by FormMail::show_form().

monthArrayOrSelected ( selected = 0  ) 

Retourne un tableau des mois ou le mois selectionne.

Parameters:
selected Mois a selectionner ou -1
Returns:
string or array Month string or array if selected < 0

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

Referenced by Form::select_month().

picto_required (  ) 

Retourne le picto champ obligatoire.

Returns:
string Chaine avec picto obligatoire

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

price ( amount,
html = 0,
outlangs = '',
trunc = 1,
rounding = 2 
)

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

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

') from an amount typed by a user.

Remarks:
Function to use on each input amount before any numeric test or database insert.
Parameters:
amount Amount to convert/clean
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 Shown (MAIN_MAX_DECIMALS_SHOWN)
alreadysqlnb Put 1 if you know that content is already universal format number
Returns:
string Amount with universal numeric format (Example: '99.99999') price Opposite function of price2num

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

Referenced by pdf_oursin::_tableau_tot(), pdf_crabe::_tableau_tot(), Propal::addline(), FactureFournisseur::addline(), CommandeFournisseur::addline(), Facture::addline(), Contrat::addline(), Account::addline(), Commande::addline(), Tva::addPayment(), batch_fournisseur_updateturnover(), calcul_price_total(), ProductLivre::Create(), Product::create(), Paiement::create(), PaiementFourn::create(), Don::create(), DiscountAbsolute::create(), Account::create(), PaiementCharge::create(), ChargeSociales::create(), FactureLigne::insert(), Facture::set_remise(), Commande::set_remise(), Propal::set_remise_absolue(), Facture::set_remise_absolue(), Commande::set_remise_absolue(), Societe::set_remise_except(), Propal::set_remise_percent(), Product::update(), Product::update_price(), CommonObject::update_price(), ProductLivre::UpdateCanvas(), CommandeFournisseur::updateFromCommandeClient(), Propal::updateline(), FactureFournisseur::updateline(), CommandeFournisseur::updateline(), Facture::updateline(), Contrat::updateline(), Commande::updateline(), and pdf_edison::write_file().

print_barre_liste ( titre,
page,
file,
options = '',
sortfield = '',
sortorder = '',
center = '',
num = -1,
totalnboflines = 0,
picto = 'title.gif',
pictoisfullpath = 0 
)

Print a title with navigation controls for pagination.

Parameters:
titre Title to show (required)
page Numero of page (required)
file Url of page (required)
options parametres complementaires lien ('' par defaut)
sortfield champ de tri ('' par defaut)
sortorder ordre de tri ('' par defaut)
center chaine du centre ('' par defaut)
num number of records found by select with limit+1
totalnboflines Total number of records/lines for all pages (if known)
picto Icon to use before title (should be a 32x32 transparent png file)
pictoisfullpath 1=Icon name is a full absolute url of image

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

References print, and print_fleche_navigation().

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

Format output for start and end date.

Parameters:
date_start Start date
date_end End date
format Output format
Remarks:
Updated by Matelli : added format paramter

See http://matelli.fr/showcases/patchs-dolibarr/update-date-range-format.html for details

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

Referenced by show_list_sending_receive().

print_fiche_titre ( titre,
mesg = '',
picto = 'title.gif',
pictoisfullpath = 0 
)

Affichage d'un titre d'une fiche, align� a gauche.

Parameters:
titre Le titre a afficher
mesg Message suplementaire a afficher a droite
picto Icon to use before title (should be a 32x32 transparent png file)
pictoisfullpath 1=Icon name is a full absolute url of image

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

References print.

print_fleche_navigation ( page,
file,
options = '',
nextpage,
betweenarrows = '' 
)

Fonction servant a afficher les fleches de navigation dans les pages de listes.

Parameters:
page Numero of page
file Lien
options Autres parametres d'url a propager dans les liens ("" par defaut)
nextpage Faut-il une page suivante
betweenarraows HTML Content to show between arrows

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

References img_next(), img_previous(), and print.

Referenced by print_barre_liste().

print_liste_field_titre ( name,
file,
field,
begin = "",
options = "",
td = "",
sortfield = "",
sortorder = "" 
)

Show title line of an array.

Parameters:
name libelle champ
file url pour clic sur tri
field champ de tri
begin ("" par defaut)
options ("" par defaut)
td options de l'attribut td ("" par defaut)
sortfield field currently used to sort
sortorder ordre du tri

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

References img_down(), img_up(), and print.

Referenced by FormFile::list_of_documents().

print_titre ( titre  ) 

Affichage d'un titre.

Parameters:
titre Le titre a afficher

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

References print.

Referenced by FormFile::form_attach_new_file(), FormFile::list_of_documents(), show_actions_todo(), show_contacts(), FormFile::show_documents(), show_list_sending_receive(), and FormActions::showactions().

restrictedArea ( user,
feature = 'societe',
objectid = 0,
dbtablename = '',
feature2 = '',
dbt_socfield = 'fk_soc' 
)

Check permissions of a user to show a page and an object.

Parameters:
user User to check
feature Feature to check (in most cases, it's module name)
objectid Object ID if we want to check permission on on object (optionnal)
dbtablename Table name where object is stored. Not used if objectid is null (optionnel)
feature2 Feature to check (second level of permission)
dbt_socfield Field name for socid foreign key if not fk_soc. (optionnel)

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

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

sanitizeFileName ( str,
newstr = '_' 
)

stopwithmem (  ) 

This function output memory used by PHP and exit everything.

Used for debugging purpose.

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

utf8_check ( Str  ) 

Check if a string is in UTF8.

Parameters:
$Str String 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 2743 of file functions.lib.php.

Referenced by dol_print_file(), and dol_string_unaccent().

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

Fonction qui retourne un taux de tva formate pour visualisation.

Remarks:
Fonction utilisee dans les pdf et les pages html
Parameters:
rate Rate value to format (19.6 19,6 19.6% 19,6%,...)
foundpercent Add a percent % sign in output
info_bits Miscellanous information on vat
Returns:
string Chaine avec montant formate (19,6 ou 19,6% ou 8.5% *)

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

References price().

Referenced by pdf_muscadet::_tableau_tot(), pdf_oursin::_tableau_tot(), pdf_crabe::_tableau_tot(), pdf_propale_jaune::write_file(), pdf_propale_azur::write_file(), pdf_crabe::write_file(), pdf_einstein::write_file(), and pdf_edison::write_file().

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

Renvoie oui ou non dans la langue choisie.

Parameters:
yesno Variable pour test si oui ou non
case 1=Yes/No, 0=yes/no
color 0=texte only, 1=Text is formated with a color font style (red or blue), 2=Text is formated with blue color.

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

Referenced by AccountLine::getNomUrl(), ModeleThirdPartyCode::getToolTip(), Adherent::send_an_email(), and FormMail::show_form().


Generated on Thu Sep 24 23:50:57 2009 for dolibarr by  doxygen 1.5.8