|
dolibarr
13.0.2
|
Library of admin functions. More...
Go to the source code of this file.
Functions | |
| versiontostring ($versionarray) | |
| Renvoi une version en chaine depuis une version en tableau. More... | |
| versioncompare ($versionarray1, $versionarray2) | |
| Compare 2 versions (stored into 2 arrays). More... | |
| versionphparray () | |
| Return version PHP. More... | |
| versiondolibarrarray () | |
| Return version Dolibarr. More... | |
| run_sql ($sqlfile, $silent=1, $entity= '', $usesavepoint=1, $handler= '', $okerror= 'default', $linelengthlimit=32768, $nocommentremoval=0, $offsetforchartofaccount=0) | |
| Launch a sql file. More... | |
| dolibarr_del_const ($db, $name, $entity=1) | |
| Effacement d'une constante dans la base de donnees. More... | |
| dolibarr_get_const ($db, $name, $entity=1) | |
| Recupere une constante depuis la base de donnees. More... | |
| dolibarr_set_const ($db, $name, $value, $type= 'chaine', $visible=0, $note= '', $entity=1) | |
| Insert a parameter (key,value) into database (delete old key then insert it again). More... | |
| modules_prepare_head () | |
| Prepare array with list of tabs. More... | |
| security_prepare_head () | |
| Prepare array with list of tabs. More... | |
| modulehelp_prepare_head ($object) | |
| Prepare array with list of tabs. More... | |
| translation_prepare_head () | |
| Prepare array with list of tabs. More... | |
| defaultvalues_prepare_head () | |
| Prepare array with list of tabs. More... | |
| listOfSessions () | |
| Return list of session. More... | |
| purgeSessions ($mysessionid) | |
| Purge existing sessions. More... | |
| activateModule ($value, $withdeps=1) | |
| Enable a module. More... | |
| unActivateModule ($value, $requiredby=1) | |
| Disable a module. More... | |
| complete_dictionary_with_modules (&$taborder, &$tabname, &$tablib, &$tabsql, &$tabsqlsort, &$tabfield, &$tabfieldvalue, &$tabfieldinsert, &$tabrowid, &$tabcond, &$tabhelp, &$tabfieldcheck) | |
| Add external modules to list of dictionaries. More... | |
| activateModulesRequiredByCountry ($country_code) | |
| Activate external modules mandatory when country is country_code. More... | |
| complete_elementList_with_modules (&$elementList) | |
| Search external modules to complete the list of contact element. More... | |
| form_constantes ($tableau, $strictw3c=0, $helptext= '') | |
| Show array with constants to edit. More... | |
| showModulesExludedForExternal ($modules) | |
| Show array with constants to edit. More... | |
| addDocumentModel ($name, $type, $label= '', $description= '') | |
| Add document model used by doc generator. More... | |
| delDocumentModel ($name, $type) | |
| Delete document model used by doc generator. More... | |
| phpinfo_array () | |
| Return the php_info into an array. More... | |
| company_admin_prepare_head () | |
| Return array head with list of tabs to view object informations. More... | |
| email_admin_prepare_head () | |
| Return array head with list of tabs to view object informations. More... | |
Library of admin functions.
Definition in file admin.lib.php.
| activateModule | ( | $value, | |
$withdeps = 1 |
|||
| ) |
Enable a module.
| string | $value | Name of module to activate |
| int | $withdeps | Activate/Disable also all dependencies |
Definition at line 971 of file admin.lib.php.
References dol_syslog(), dolGetModulesDirs(), unActivateModule(), versioncompare(), versiondolibarrarray(), versionphparray(), and versiontostring().
Referenced by activateModulesRequiredByCountry().
| activateModulesRequiredByCountry | ( | $country_code | ) |
Activate external modules mandatory when country is country_code.
| string | $country_code | CountryCode |
Definition at line 1311 of file admin.lib.php.
References activateModule(), dol_osencode(), dol_strlen(), dol_syslog(), dolGetModulesDirs(), and setEventMessages().
| addDocumentModel | ( | $name, | |
| $type, | |||
$label = '', |
|||
$description = '' |
|||
| ) |
Add document model used by doc generator.
| string | $name | Model name |
| string | $type | Model type |
| string | $label | Model label |
| string | $description | Model description |
Definition at line 1717 of file admin.lib.php.
References $resql, dol_print_error(), and dol_syslog().
| company_admin_prepare_head | ( | ) |
Return array head with list of tabs to view object informations.
Definition at line 1806 of file admin.lib.php.
References complete_head_from_modules().
| complete_dictionary_with_modules | ( | & | $taborder, |
| & | $tabname, | ||
| & | $tablib, | ||
| & | $tabsql, | ||
| & | $tabsqlsort, | ||
| & | $tabfield, | ||
| & | $tabfieldvalue, | ||
| & | $tabfieldinsert, | ||
| & | $tabrowid, | ||
| & | $tabcond, | ||
| & | $tabhelp, | ||
| & | $tabfieldcheck | ||
| ) |
Add external modules to list of dictionaries.
Addition is done into var $taborder, $tabname, etc... that are passed with pointers.
| array | $taborder | Taborder |
| array | $tabname | Tabname |
| array | $tablib | Tablib |
| array | $tabsql | Tabsql |
| array | $tabsqlsort | Tabsqlsort |
| array | $tabfield | Tabfield |
| array | $tabfieldvalue | Tabfieldvalue |
| array | $tabfieldinsert | Tabfieldinsert |
| array | $tabrowid | Tabrowid |
| array | $tabcond | Tabcond |
| array | $tabhelp | Tabhelp |
| array | $tabfieldcheck | Tabfieldcheck |
Definition at line 1177 of file admin.lib.php.
References dol_osencode(), dol_strlen(), dol_syslog(), dolGetModulesDirs(), and print.
| complete_elementList_with_modules | ( | & | $elementList | ) |
Search external modules to complete the list of contact element.
| array | $elementList | elementList |
Definition at line 1373 of file admin.lib.php.
References dol_osencode(), dol_strlen(), dol_syslog(), and dolGetModulesDirs().
| defaultvalues_prepare_head | ( | ) |
Prepare array with list of tabs.
Definition at line 811 of file admin.lib.php.
References complete_head_from_modules().
| delDocumentModel | ( | $name, | |
| $type | |||
| ) |
Delete document model used by doc generator.
| string | $name | Model name |
| string | $type | Model type |
Definition at line 1748 of file admin.lib.php.
References $resql, dol_print_error(), and dol_syslog().
| dolibarr_del_const | ( | $db, | |
| $name, | |||
$entity = 1 |
|||
| ) |
Effacement d'une constante dans la base de donnees.
| DoliDB | $db | Database handler |
| string | $name | Name of constant or rowid of line |
| int | $entity | Multi company id, -1 for all entities |
Definition at line 499 of file admin.lib.php.
References $resql, dol_print_error(), and dol_syslog().
| dolibarr_get_const | ( | $db, | |
| $name, | |||
$entity = 1 |
|||
| ) |
Recupere une constante depuis la base de donnees.
Definition at line 539 of file admin.lib.php.
References $resql, and dol_syslog().
| dolibarr_set_const | ( | $db, | |
| $name, | |||
| $value, | |||
$type = 'chaine', |
|||
$visible = 0, |
|||
$note = '', |
|||
$entity = 1 |
|||
| ) |
Insert a parameter (key,value) into database (delete old key then insert it again).
| DoliDB | $db | Database handler |
| string | $name | Name of constant |
| string | $value | Value of constant |
| string | $type | Type of constante (chaine par defaut) |
| int | $visible | Is constant visible in Setup->Other page (0 by default) |
| string | $note | Note on parameter |
| int | $entity | Multi company id (0 means all entities) |
Definition at line 575 of file admin.lib.php.
References $resql, dol_print_error(), and dol_syslog().
Referenced by modGeneratePassPerso\__construct(), BlockedLog\getSignature(), modProductBatch\init(), and modTakePos\init().
| email_admin_prepare_head | ( | ) |
Return array head with list of tabs to view object informations.
Definition at line 1845 of file admin.lib.php.
References complete_head_from_modules().
| form_constantes | ( | $tableau, | |
$strictw3c = 0, |
|||
$helptext = '' |
|||
| ) |
Show array with constants to edit.
| array | $tableau | Array of constants array('key'=>array('type'=>type, 'label'=>label) where type can be 'string', 'text', 'textarea', 'html', 'yesno', 'emailtemplate:xxx', ... |
| int | $strictw3c | 0=Include form into table (deprecated), 1=Form is outside table to respect W3C (deprecated), 2=No form nor button at all (form is output by caller, recommended) |
| string | $helptext | Help |
Definition at line 1479 of file admin.lib.php.
References $_SERVER, dol_escape_htmltag(), dol_syslog(), img_down(), and print.
| listOfSessions | ( | ) |
Return list of session.
Definition at line 863 of file admin.lib.php.
References dol_osencode(), and dol_syslog().
| modulehelp_prepare_head | ( | $object | ) |
Prepare array with list of tabs.
| object | $object | descriptor class |
Definition at line 743 of file admin.lib.php.
References complete_head_from_modules().
| modules_prepare_head | ( | ) |
Prepare array with list of tabs.
Definition at line 633 of file admin.lib.php.
| phpinfo_array | ( | ) |
Return the php_info into an array.
Definition at line 1777 of file admin.lib.php.
| purgeSessions | ( | $mysessionid | ) |
Purge existing sessions.
| int | $mysessionid | To avoid to try to delete my own session |
Definition at line 919 of file admin.lib.php.
References dol_osencode(), and dol_syslog().
| run_sql | ( | $sqlfile, | |
$silent = 1, |
|||
$entity = '', |
|||
$usesavepoint = 1, |
|||
$handler = '', |
|||
$okerror = 'default', |
|||
$linelengthlimit = 32768, |
|||
$nocommentremoval = 0, |
|||
$offsetforchartofaccount = 0 |
|||
| ) |
Launch a sql file.
Function is used by:
| string | $sqlfile | Full path to sql file |
| int | $silent | 1=Do not output anything, 0=Output line for update page |
| int | $entity | Entity targeted for multicompany module |
| int | $usesavepoint | 1=Run a savepoint before each request and a rollback to savepoint if error (this allow to have some request with errors inside global transactions). |
| string | $handler | Handler targeted for menu (replace HANDLER with this value) |
| string | $okerror | Family of errors we accept ('default', 'none') |
| int | $linelengthlimit | Limit for length of each line (Use 0 if unknown, may be faster if defined) |
| int | $nocommentremoval | Do no try to remove comments (in such a case, we consider that each line is a request, so use also $linelengthlimit=0) |
| int | $offsetforchartofaccount | Offset to use to load chart of account table to update sql on the fly to add offset to rowid and account_parent value |
Definition at line 161 of file admin.lib.php.
References $resql, dol_htmlentities(), dol_syslog(), print, and versioncompare().
Referenced by DolibarrModules\_load_tables(), Website\importWebSite(), and migrate_reload_menu().
| security_prepare_head | ( | ) |
Prepare array with list of tabs.
Definition at line 668 of file admin.lib.php.
References $resql, and dol_print_error().
| showModulesExludedForExternal | ( | $modules | ) |
Show array with constants to edit.
| array | $modules | Array of all modules |
Definition at line 1676 of file admin.lib.php.
| translation_prepare_head | ( | ) |
Prepare array with list of tabs.
Definition at line 781 of file admin.lib.php.
References complete_head_from_modules().
| unActivateModule | ( | $value, | |
$requiredby = 1 |
|||
| ) |
Disable a module.
| string | $value | Nom du module a desactiver |
| int | $requiredby | 1=Desactive aussi modules dependants |
Definition at line 1100 of file admin.lib.php.
References dol_syslog(), and dolGetModulesDirs().
Referenced by activateModule().
| versioncompare | ( | $versionarray1, | |
| $versionarray2 | |||
| ) |
Compare 2 versions (stored into 2 arrays).
To check if Dolibarr version is lower than (x,y,z), do "if versioncompare(versiondolibarrarray(), array(x.y.z)) <= 0" For example: if (versioncompare(versiondolibarrarray(),array(4,0,-5)) >= 0) is true if version is 4.0 alpha or higher. For example: if (versioncompare(versiondolibarrarray(),array(4,0,0)) >= 0) is true if version is 4.0 final or higher. For example: if (versioncompare(versiondolibarrarray(),array(4,0,1)) >= 0) is true if version is 4.0.1 or higher. Alternative way to compare: if ((float) DOL_VERSION >= 4.0) is true if version is 4.0 alpha or higher (works only to compare first and second level)
| array | $versionarray1 | Array of version (vermajor,verminor,patch) |
| array | $versionarray2 | Array of version (vermajor,verminor,patch) |
Definition at line 66 of file admin.lib.php.
Referenced by activateModule(), migrate_restore_missing_links(), and run_sql().
| versiondolibarrarray | ( | ) |
Return version Dolibarr.
Definition at line 135 of file admin.lib.php.
Referenced by activateModule().
| versionphparray | ( | ) |
Return version PHP.
Definition at line 125 of file admin.lib.php.
Referenced by activateModule().
| versiontostring | ( | $versionarray | ) |
Renvoi une version en chaine depuis une version en tableau.
| array | $versionarray | Tableau de version (vermajeur,vermineur,autre) |
Definition at line 36 of file admin.lib.php.
Referenced by activateModule().