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

Ensemble de fonctions de base pour le module societe. More...

Go to the source code of this file.

Functions

 societe_prepare_head (Societe $object)
 Return array of tabs to used on pages for third parties cards. More...
 
 societe_prepare_head2 ($object)
 Return array of tabs to used on page. More...
 
 societe_admin_prepare_head ()
 Return array head with list of tabs to view object informations. More...
 
 getCountry ($searchkey, $withcode='', $dbtouse=0, $outputlangs='', $entconv=1, $searchlabel='')
 Return country label, code or id from an id, code or label. More...
 
 getState ($id, $withcode='', $dbtouse=0)
 Return state translated from an id. More...
 
 currency_name ($code_iso, $withcode='', $outputlangs=null)
 Return label of currency or code+label. More...
 
 getFormeJuridiqueLabel ($code)
 Retourne le nom traduit de la forme juridique. More...
 
 isInEEC ($object)
 Return if a country is inside the EEC (European Economic Community) TODO Add a field into country dictionary. More...
 
 show_projects ($conf, $langs, $db, $object, $backtopage='', $nocreatelink=0, $morehtmlright='')
 Show html area for list of projects. More...
 
 show_contacts ($conf, $langs, $db, $object, $backtopage='')
 Show html area for list of contacts. More...
 
 show_addresses ($conf, $langs, $db, $object, $backtopage='')
 Show html area for list of addresses. More...
 
 show_actions_todo ($conf, $langs, $db, $filterobj, $objcon='', $noprint=0, $actioncode='')
 Show html area with actions to do. More...
 
 show_actions_done ($conf, $langs, $db, $filterobj, $objcon='', $noprint=0, $actioncode='', $donetodo='done', $filters=array(), $sortfield='a.datep, a.id', $sortorder='DESC')
 Show html area with actions (done or not, ignore the name of function) More...
 
 show_subsidiaries ($conf, $langs, $db, $object)
 Show html area for list of subsidiaries. More...
 

Detailed Description

Ensemble de fonctions de base pour le module societe.

Definition in file company.lib.php.

Function Documentation

currency_name (   $code_iso,
  $withcode = '',
  $outputlangs = null 
)

Return label of currency or code+label.

Parameters
string$code_isoCode iso of currency
int$withcode'1'=show code + label
Translate$outputlangsOutput language
Returns
string Label translated of currency

Definition at line 502 of file company.lib.php.

References $resql.

Referenced by Form\form_multicurrency_code().

getCountry (   $searchkey,
  $withcode = '',
  $dbtouse = 0,
  $outputlangs = '',
  $entconv = 1,
  $searchlabel = '' 
)

Return country label, code or id from an id, code or label.

Parameters
int$searchkeyId or code of country to search
string$withcode'0'=Return label, '1'=Return code + label, '2'=Return code from id, '3'=Return id from code, 'all'=Return array('id'=>,'code'=>,'label'=>)
DoliDB$dbtouseDatabase handler (using in global way may fail because of conflicts with some autoload features)
Translate$outputlangsLangs object for output translation
int$entconv0=Return value without entities and not converted to output charset, 1=Ready for html output
int$searchlabelLabel of country to search (warning: searching on label is not reliable)
Returns
mixed String with country code or translated country name or Array('id','code','label')

Definition at line 403 of file company.lib.php.

References $resql, and dol_print_error().

Referenced by ActionsCardCommon\assign_post(), createProductOrService(), createThirdParty(), Entrepot\fetch(), Product\fetch(), CommonObject\getFullAddress(), Societe\setMysoc(), show_contacts(), updateContact(), updateProductOrService(), and updateThirdParty().

getFormeJuridiqueLabel (   $code)

Retourne le nom traduit de la forme juridique.

Parameters
string$codeCode de la forme juridique
Returns
string Nom traduit du pays

Definition at line 546 of file company.lib.php.

References $resql, and dol_syslog().

Referenced by CommonDocGenerator\get_substitutionarray_mysoc(), html_print_stripe_footer(), and pdf_pagefoot().

getState (   $id,
  $withcode = '',
  $dbtouse = 0 
)

Return state translated from an id.

Return value is always utf8 encoded and without entities.

Parameters
int$idid of state (province/departement)
int$withcode'0'=Return label, '1'=Return string code + label, '2'=Return code, 'all'=return array('id'=>,'code'=>,'label'=>)
DoliDB$dbtouseDatabase handler (using in global way may fail because of conflicts with some autoload features)
Returns
string String with state code or state name (Return value is always utf8 encoded and without entities)

Definition at line 464 of file company.lib.php.

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

Referenced by CommonDocGenerator\get_substitutionarray_contact(), CommonDocGenerator\get_substitutionarray_mysoc(), CommonDocGenerator\get_substitutionarray_thirdparty(), and pdf_build_address().

isInEEC (   $object)

Return if a country is inside the EEC (European Economic Community) TODO Add a field into country dictionary.

Parameters
Object$objectObject
Returns
boolean true = country inside EEC, false = country outside EEC

Definition at line 582 of file company.lib.php.

Referenced by get_default_tva(), and Form\load_tva().

show_actions_done (   $conf,
  $langs,
  $db,
  $filterobj,
  $objcon = '',
  $noprint = 0,
  $actioncode = '',
  $donetodo = 'done',
  $filters = array(),
  $sortfield = 'a.datep,
a.id'  ,
  $sortorder = 'DESC' 
)

Show html area with actions (done or not, ignore the name of function)

Parameters
Conf$confObject conf
Translate$langsObject langs
DoliDB$dbObject db
mixed$filterobjObject Adherent|Societe|Project|Product|CommandeFournisseur
Contact$objconObject contact
int$noprintReturn string but does not output it
string$actioncodeFilter on actioncode
string$donetodoFilter on event 'done' or 'todo' or ''=nofilter (all).
array$filtersFilter on other fields
string$sortfieldSort field
string$sortorderSort order
Returns
mixed Return html part or void if noprint is 1 TODO change function to be able to list event linked to an object.

Definition at line 1115 of file company.lib.php.

References $form, $formactions, $resql, dol_getdate(), dol_now(), dol_print_date(), dol_print_error(), dol_syslog(), dol_trunc(), getTitleFieldOfList(), img_object(), img_picto(), img_warning(), natural_search(), and print.

Referenced by ActionsContactCardDefault\assign_values(), ActionsAdherentCardDefault\assign_values(), and show_actions_todo().

show_actions_todo (   $conf,
  $langs,
  $db,
  $filterobj,
  $objcon = '',
  $noprint = 0,
  $actioncode = '' 
)

Show html area with actions to do.

Parameters
Conf$confObject conf
Translate$langsObject langs
DoliDB$dbObject db
Adherent | Societe$filterobjObject third party or member
Contact$objconObject contact
int$noprintReturn string but does not output it
int$actioncodeFilter on actioncode
Returns
mixed Return html part or void if noprint is 1

Definition at line 1088 of file company.lib.php.

References print, and show_actions_done().

Referenced by ActionsContactCardDefault\assign_values(), and ActionsAdherentCardDefault\assign_values().

show_addresses (   $conf,
  $langs,
  $db,
  $object,
  $backtopage = '' 
)

Show html area for list of addresses.

Parameters
Conf$confObject conf
Translate$langsObject langs
DoliDB$dbDatabase handler
Societe$objectThird party object
string$backtopageUrl to go once address is created
Returns
void

Definition at line 995 of file company.lib.php.

References dol_print_phone(), img_edit(), img_picto(), load_fiche_titre(), picto_from_langcode(), and print.

show_contacts (   $conf,
  $langs,
  $db,
  $object,
  $backtopage = '' 
)

Show html area for list of contacts.

Parameters
Conf$confObject conf
Translate$langsObject langs
DoliDB$dbDatabase handler
Societe$objectThird party object
string$backtopageUrl to go once contact is created
Returns
void

Definition at line 769 of file company.lib.php.

References $form, $title, dol_print_error(), dol_syslog(), getCountry(), GETPOST(), img_edit(), img_object(), load_fiche_titre(), print, and print_liste_field_titre().

show_projects (   $conf,
  $langs,
  $db,
  $object,
  $backtopage = '',
  $nocreatelink = 0,
  $morehtmlright = '' 
)

Show html area for list of projects.

Parameters
Conf$confObject conf
Translate$langsObject langs
DoliDB$dbDatabase handler
Object$objectThird party object
string$backtopageUrl to go once contact is created
int$nocreatelink1=Hide create project link
string$morehtmlrightMore html on right of title
Returns
void

Definition at line 640 of file company.lib.php.

References dol_print_error(), img_object(), load_fiche_titre(), price(), and print.

show_subsidiaries (   $conf,
  $langs,
  $db,
  $object 
)

Show html area for list of subsidiaries.

Parameters
Conf$confObject conf
Translate$langsObject langs
DoliDB$dbDatabase handler
Societe$objectThird party object
Returns
void

Definition at line 1560 of file company.lib.php.

References img_edit(), load_fiche_titre(), and print.

societe_admin_prepare_head ( )

Return array head with list of tabs to view object informations.

Returns
array head array with tabs

Definition at line 353 of file company.lib.php.

References complete_head_from_modules().

societe_prepare_head ( Societe  $object)

Return array of tabs to used on pages for third parties cards.

Parameters
Societe$objectObject company shown
Returns
array Array of tabs

Definition at line 40 of file company.lib.php.

References $resql, complete_head_from_modules(), Link\count(), dol_dir_list(), dol_print_error(), and CommonObject\liste_contact().

Referenced by ActionsCardCommon\assign_values().

societe_prepare_head2 (   $object)

Return array of tabs to used on page.

Parameters
Object$objectObject for tabs
Returns
array Array of tabs

Definition at line 327 of file company.lib.php.