dolibarr 19.0.4
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.
 
 societe_prepare_head2 ($object)
 Return array of tabs to used on page.
 
 societe_admin_prepare_head ()
 Return array head with list of tabs to view object informations.
 
 getCountry ($searchkey, $withcode='', $dbtouse=0, $outputlangs='', $entconv=1, $searchlabel='')
 Return country label, code or id from an id, code or label.
 
 getState ($id, $withcode='', $dbtouse=0, $withregion=0, $outputlangs='', $entconv=1)
 Return state translated from an id.
 
 currency_name ($code_iso, $withcode='', $outputlangs=null)
 Return label of currency or code+label.
 
 getFormeJuridiqueLabel ($code)
 Return the name translated of juridical status.
 
 getCountriesInEEC ()
 Return list of countries that are inside the EEC (European Economic Community) Note: Try to keep this function as a "memory only" function for performance reasons.
 
 isInEEC ($object)
 Return if a country of an object is inside the EEC (European Economic Community)
 
 show_projects ($conf, $langs, $db, $object, $backtopage='', $nocreatelink=0, $morehtmlright='')
 Show html area for list of projects.
 
 show_contacts ($conf, $langs, $db, $object, $backtopage='', $showuserlogin=0)
 Show html area for list of contacts.
 
 show_actions_todo ($conf, $langs, $db, $filterobj, $objcon='', $noprint=0, $actioncode='')
 Show html area with actions to do.
 
 show_actions_done ($conf, $langs, $db, $filterobj, $objcon='', $noprint=0, $actioncode='', $donetodo='done', $filters=array(), $sortfield='a.datep, a.id', $sortorder='DESC', $module='')
 Show html area with actions (done or not, ignore the name of function).
 
 show_subsidiaries ($conf, $langs, $db, $object)
 Show html area for list of subsidiaries.
 
 addEventTypeSQL (&$sql, $actioncode, $sqlANDOR="AND")
 Add Event Type SQL.
 
 addOtherFilterSQL (&$sql, $donetodo, $now, $filters)
 Add Event Type SQL.
 
 addMailingEventTypeSQL ($actioncode, $objcon, $filterobj)
 Add Mailing Event Type SQL.
 
 htmlPrintOnlineFooter ($fromcompany, $langs, $addformmessage=0, $suffix='', $object=null)
 Show footer of company in HTML pages.
 

Detailed Description

Ensemble de fonctions de base pour le module societe.

Definition in file company.lib.php.

Function Documentation

◆ addEventTypeSQL()

addEventTypeSQL ( & $sql,
$actioncode,
$sqlANDOR = "AND" )

Add Event Type SQL.

Parameters
string$sql$sql modified
string$actioncodeAction code
string$sqlANDOR"AND", "OR" or "" sql condition
Returns
string sql request

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

References getDolGlobalString().

Referenced by show_actions_done().

◆ addMailingEventTypeSQL()

addMailingEventTypeSQL ( $actioncode,
$objcon,
$filterobj )

Add Mailing Event Type SQL.

Parameters
string$actioncodeAction code
Object$objconobjcon
Object$filterobjfilterobj
Returns
string

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

Referenced by show_actions_done().

◆ addOtherFilterSQL()

addOtherFilterSQL ( & $sql,
$donetodo,
$now,
$filters )

Add Event Type SQL.

Parameters
string$sql$sql modified
string$donetododonetodo
string$nownow
string$filtersarray
Returns
string sql request

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

References natural_search().

Referenced by show_actions_done().

◆ currency_name()

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 685 of file company.lib.php.

Referenced by Form\form_multicurrency_code().

◆ getCountriesInEEC()

getCountriesInEEC ( )

Return list of countries that are inside the EEC (European Economic Community) Note: Try to keep this function as a "memory only" function for performance reasons.

Returns
array Array of countries code in EEC

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

References dol_print_error().

Referenced by UserBankAccount\checkCountryBankAccount(), and isInEEC().

◆ getCountry()

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 Integer with country id or String with country code or translated country name or Array('id','code','label') or 'NotDefined'

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

References dol_print_error().

Referenced by ActionsCardCommon\assign_post(), Form\constructProductListOption(), createProductOrService(), createThirdParty(), AccountancyExport\exportLDCompta10(), Entrepot\fetch(), Product\fetch(), CommonObject\getFullAddress(), Societe\setMysoc(), show_contacts(), updateContact(), updateProductOrService(), updateThirdParty(), pdf_crabe\write_file(), pdf_sponge\write_file(), pdf_standard_asset\write_file(), pdf_standard_myobject\write_file(), and pdf_standard_recruitmentjobposition\write_file().

◆ getFormeJuridiqueLabel()

getFormeJuridiqueLabel ( $code)

Return the name translated of juridical status.

Parameters
string$codeCode of juridical status
Returns
string Value of the juridical status

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

References dol_syslog().

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

◆ getState()

getState ( $id,
$withcode = '',
$dbtouse = 0,
$withregion = 0,
$outputlangs = '',
$entconv = 1 )

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)
int$withregion'0'=Ignores region, '1'=Add region name/code/id as needed to output,
Translate$outputlangsLangs object for output translation, not fully implemented yet
int$entconv0=Return value without entities and not converted to output charset, 1=Ready for html output
Returns
string|array String with state code or state name or Array('id','code','label')/Array('id','code','label','region_code','region')

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

References dol_print_error(), and dol_syslog().

Referenced by CommonDocGenerator\get_substitutionarray_contact(), CommonDocGenerator\get_substitutionarray_mysoc(), CommonDocGenerator\get_substitutionarray_thirdparty(), CommonObject\getFullAddress(), pdf_build_address(), and Societe\setMysoc().

◆ htmlPrintOnlineFooter()

htmlPrintOnlineFooter ( $fromcompany,
$langs,
$addformmessage = 0,
$suffix = '',
$object = null )

Show footer of company in HTML pages.

Parameters
Societe$fromcompanyThird party
Translate$langsOutput language
int$addformmessageAdd the payment form message
string$suffixSuffix to use on constants
Object$objectObject related to payment
Returns
void

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

References getDolGlobalString(), and getFormeJuridiqueLabel().

◆ isInEEC()

isInEEC ( $object)

Return if a country of an object is inside the EEC (European Economic Community)

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

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

References getCountriesInEEC().

Referenced by Stripe\customerStripe(), get_default_tva(), AccountingAccount\getAccountingCodeToBind(), Form\load_tva(), and InterfaceStripe\runTrigger().

◆ show_actions_done()

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

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

Note: Global parameter $param must be defined.

Parameters
Conf$confObject conf
Translate$langsObject langs
DoliDB$dbObject db
mixed$filterobjFilter on object Adherent|Societe|Project|Product|CommandeFournisseur|Dolresource|Ticket... to list events linked to an object
Contact$objconFilter on object contact to filter events on a contact
int$noprintReturn string but does not output it
string | 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
string$moduleYou can add module name here if elementtype in table llx_actioncomm is objectkey
Returns
string|void Return html part or void if noprint is 1

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

References $formactions, addEventTypeSQL(), addMailingEventTypeSQL(), addOtherFilterSQL(), Contact(), dol_getdate(), dol_include_once(), dol_mktime(), dol_now(), dol_print_date(), dol_print_error(), dol_syslog(), dol_trunc(), dolGetElementUrl(), getDolGlobalString(), GETPOST(), getTitleFieldOfList(), img_object(), img_warning(), and setEventMessage().

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

◆ 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 thirdparty or member
Contact$objconObject contact
int$noprintReturn string but does not output it
int$actioncodeFilter on actioncode
Returns
string|void Return html part or void if noprint is 1

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

References show_actions_done().

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

◆ show_contacts()

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

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
int$showuserlogin1=Show also user login if it exists
Returns
int

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

References Contact(), dol_escape_htmltag(), dol_eval(), dol_mktime(), dol_print_date(), dol_print_error(), dol_sort_array(), dol_string_nohtmltag(), dol_syslog(), dolGetButtonTitle(), getArrayOfSocialNetworks(), getCountry(), getDolGlobalInt(), getDolGlobalString(), GETPOST(), getTitleFieldOfList(), img_edit(), img_object(), load_fiche_titre(), natural_search(), and setEventMessages().

◆ show_projects()

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
int

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

References dol_escape_htmltag(), dol_print_error(), dolGetButtonTitle(), getDolGlobalString(), load_fiche_titre(), and price().

◆ show_subsidiaries()

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
int

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

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

◆ societe_admin_prepare_head()

societe_admin_prepare_head ( )

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

Returns
array head array with tabs

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

References complete_head_from_modules().

◆ societe_prepare_head()

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 42 of file company.lib.php.

References complete_head_from_modules(), Link\count(), dol_dir_list(), dol_getcache(), dol_print_error(), dol_setcache(), dol_syslog(), getDolGlobalInt(), getDolGlobalString(), and GETPOST().

Referenced by ActionsCardCommon\assign_values().

◆ societe_prepare_head2()

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 445 of file company.lib.php.