|
dolibarr 21.0.4
|
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. | |
| versioncompare ($versionarray1, $versionarray2) | |
| Compare 2 versions (stored into 2 arrays), to know if a version (a,b,c) is lower than (x,y,z) To check using a string version do a preg_split('/[. | |
| versionphparray () | |
| Return version PHP. | |
| versiondolibarrarray () | |
| Return version Dolibarr. | |
| run_sql ($sqlfile, $silent=1, $entity=0, $usesavepoint=1, $handler='', $okerror='default', $linelengthlimit=32768, $nocommentremoval=0, $offsetforchartofaccount=0, $colspan=0, $onlysqltoimportwebsite=0, $database='') | |
| Launch a sql file. | |
| dolibarr_del_const ($db, $name, $entity=1) | |
| Delete a constant. | |
| dolibarr_get_const ($db, $name, $entity=1) | |
| Get the value of a setup constant from database. | |
| 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). | |
| modules_prepare_head ($nbofactivatedmodules, $nboftotalmodules, $nbmodulesnotautoenabled) | |
| Prepare array with list of tabs. | |
| ihm_prepare_head () | |
| Prepare array with list of tabs. | |
| security_prepare_head () | |
| Prepare array with list of tabs. | |
| modulehelp_prepare_head ($object) | |
| Prepare array with list of tabs. | |
| translation_prepare_head () | |
| Prepare array with list of tabs. | |
| defaultvalues_prepare_head () | |
| Prepare array with list of tabs. | |
| listOfSessions () | |
| Return list of session. | |
| purgeSessions ($mysessionid) | |
| Purge existing sessions. | |
| activateModule ($value, $withdeps=1, $noconfverification=0) | |
| Enable a module. | |
| unActivateModule ($value, $requiredby=1) | |
| Disable a module. | |
| complete_dictionary_with_modules (&$taborder, &$tabname, &$tablib, &$tabsql, &$tabsqlsort, &$tabfield, &$tabfieldvalue, &$tabfieldinsert, &$tabrowid, &$tabcond, &$tabhelp, &$tabcomplete) | |
| Add external modules to list of dictionaries. | |
| activateModulesRequiredByCountry ($country_code) | |
| Activate external modules mandatory when country is country_code. | |
| complete_elementList_with_modules (&$elementList) | |
| Search external modules to complete the list of contact element. | |
| form_constantes ($tableau, $strictw3c=2, $helptext='', $text='Value') | |
| Show array with constants to edit. | |
| showModulesExludedForExternal ($modules) | |
| Show array with constants to edit. | |
| addDocumentModel ($name, $type, $label='', $description='') | |
| Add document model used by doc generator. | |
| delDocumentModel ($name, $type) | |
| Delete document model used by doc generator. | |
| phpinfo_array () | |
| Return the php_info into an array. | |
| company_admin_prepare_head () | |
| Return array head with list of tabs to view object information. | |
| email_admin_prepare_head () | |
| Return array head with list of tabs to view object information. | |
Library of admin functions.
Definition in file admin.lib.php.
| activateModule | ( | $value, | |
| $withdeps = 1, | |||
| $noconfverification = 0 ) |
Enable a module.
| string | $value | Name of module to activate |
| int | $withdeps | Activate/Disable also all dependencies |
| int | $noconfverification | Remove verification of $conf variable for module |
Definition at line 1167 of file admin.lib.php.
References $conf, activateModule(), dol_syslog(), dolGetModulesDirs(), getDolGlobalString(), unActivateModule(), versioncompare(), versiondolibarrarray(), versionphparray(), and versiontostring().
Referenced by activateModule(), and activateModulesRequiredByCountry().
| activateModulesRequiredByCountry | ( | $country_code | ) |
Activate external modules mandatory when country is country_code.
| string | $country_code | CountryCode |
Definition at line 1562 of file admin.lib.php.
References $conf, activateModule(), dol_osencode(), dol_strlen(), dol_syslog(), dolGetModulesDirs(), getDolGlobalInt(), getDolGlobalString(), 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 1996 of file admin.lib.php.
References $conf, dol_print_error(), and dol_syslog().
| company_admin_prepare_head | ( | ) |
Return array head with list of tabs to view object information.
Definition at line 2085 of file admin.lib.php.
References $conf, and complete_head_from_modules().
| complete_dictionary_with_modules | ( | & | $taborder, |
| & | $tabname, | ||
| & | $tablib, | ||
| & | $tabsql, | ||
| & | $tabsqlsort, | ||
| & | $tabfield, | ||
| & | $tabfieldvalue, | ||
| & | $tabfieldinsert, | ||
| & | $tabrowid, | ||
| & | $tabcond, | ||
| & | $tabhelp, | ||
| & | $tabcomplete ) |
Add external modules to list of dictionaries.
Addition is done into var $taborder, $tabname, etc... that are passed with pointers.
| int[] | $taborder | Taborder |
| string[] | $tabname | Tabname |
| string[] | $tablib | Tablib |
| string[] | $tabsql | Tabsql |
| string[] | $tabsqlsort | Tabsqlsort |
| string[] | $tabfield | Tabfield |
| string[] | $tabfieldvalue | Tabfieldvalue |
| string[] | $tabfieldinsert | Tabfieldinsert |
| string[] | $tabrowid | Tabrowid |
| bool[] | $tabcond | Tabcond |
| array<array<string,string>> | $tabhelp Tabhelp | |
| array<string,array<string,array<string,string>>> | $tabcomplete Tab complete (will replace all other in future). Key is table name. |
Definition at line 1388 of file admin.lib.php.
References dol_osencode(), dol_strlen(), dol_syslog(), dolGetModulesDirs(), getDolGlobalInt(), and getDolGlobalString().
| complete_elementList_with_modules | ( | & | $elementList | ) |
Search external modules to complete the list of contact element.
| array<string,string> | $elementList elementList |
Definition at line 1625 of file admin.lib.php.
References $conf, dol_osencode(), dol_strlen(), dol_syslog(), dolGetModulesDirs(), getDolGlobalInt(), and getDolGlobalString().
| defaultvalues_prepare_head | ( | ) |
Prepare array with list of tabs.
Definition at line 1006 of file admin.lib.php.
References $conf, and 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 2027 of file admin.lib.php.
References $conf, dol_print_error(), and dol_syslog().
| dolibarr_del_const | ( | $db, | |
| $name, | |||
| $entity = 1 ) |
Delete a constant.
| DoliDB | $db | Database handler |
| int | string | $name | Name of constant or rowid of line |
| int | $entity | Multi company id, -1 for all entities |
Definition at line 583 of file admin.lib.php.
References $conf, dol_print_error(), and dol_syslog().
| dolibarr_get_const | ( | $db, | |
| $name, | |||
| $entity = 1 ) |
Get the value of a setup constant from database.
Definition at line 637 of file admin.lib.php.
References dol_syslog(), and dolDecrypt().
| 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 |
| int | string | $value | Value of constant |
| string | $type | Type of constant. Deprecated, only strings are allowed for $value. Caller must json encode/decode to store other type of data. |
| 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 673 of file admin.lib.php.
References $conf, dol_print_error(), dol_syslog(), and dolEncrypt().
Referenced by modGeneratePassPerso\__construct(), DolibarrApiAccess\__isAllowed(), BlockedLog\getSignature(), mod_codeclient_elephant\info(), modEventOrganization\init(), modProductBatch\init(), modTakePos\init(), migrate_invoice_export_models(), FormSetupItem\saveConfValue(), and top_htmlhead().
| email_admin_prepare_head | ( | ) |
Return array head with list of tabs to view object information.
Definition at line 2124 of file admin.lib.php.
References $conf, complete_head_from_modules(), and getDolGlobalString().
| form_constantes | ( | $tableau, | |
| $strictw3c = 2, | |||
| $helptext = '', | |||
| $text = 'Value' ) |
Show array with constants to edit.
| array<string,array{type:string,label:string,tooltip?:string}>|array<int,string> | $tableau Array of constants array('key'=>array('type'=>type, 'label'=>label, 'tooltip'=>tooltip) where type can be 'string', 'text', 'textarea', 'html', 'yesno', 'emailtemplate:xxx', ... | |
| int<2,3> | $strictw3c 0=Include form into table (deprecated), 1=Form is outside table to respect W3C (deprecated), 2=No form nor button at all, 3=No form nor button at all and each field has a unique name (form is output by caller, recommended) (typed as int<2,3> to highlight the deprecated values) | |
| string | $helptext | Tooltip help to use for the column name of values |
| string | $text | Text to use for the column name of values |
Definition at line 1732 of file admin.lib.php.
References $conf, dol_escape_htmltag(), dol_syslog(), img_down(), and img_picto().
| ihm_prepare_head | ( | ) |
Prepare array with list of tabs.
Definition at line 810 of file admin.lib.php.
References $conf, and complete_head_from_modules().
| listOfSessions | ( | ) |
Return list of session.
Definition at line 1058 of file admin.lib.php.
References $conf, dol_osencode(), dol_syslog(), and getDolGlobalString().
| modulehelp_prepare_head | ( | $object | ) |
Prepare array with list of tabs.
| DolibarrModules | $object | Descriptor class |
Definition at line 938 of file admin.lib.php.
References $conf, $object, and complete_head_from_modules().
| modules_prepare_head | ( | $nbofactivatedmodules, | |
| $nboftotalmodules, | |||
| $nbmodulesnotautoenabled ) |
Prepare array with list of tabs.
| int | $nbofactivatedmodules | Number if activated modules |
| int | $nboftotalmodules | Nb of total modules |
| int | $nbmodulesnotautoenabled | Nb of modules not auto enabled that are activated |
Definition at line 765 of file admin.lib.php.
References getDolGlobalInt(), getDolGlobalString(), and img_picto().
| phpinfo_array | ( | ) |
Return the php_info into an array.
Definition at line 2056 of file admin.lib.php.
| purgeSessions | ( | $mysessionid | ) |
Purge existing sessions.
| string | $mysessionid | To avoid to try to delete my own session |
Definition at line 1114 of file admin.lib.php.
References $conf, dol_osencode(), dol_syslog(), and getDolGlobalString().
| run_sql | ( | $sqlfile, | |
| $silent = 1, | |||
| $entity = 0, | |||
| $usesavepoint = 1, | |||
| $handler = '', | |||
| $okerror = 'default', | |||
| $linelengthlimit = 32768, | |||
| $nocommentremoval = 0, | |||
| $offsetforchartofaccount = 0, | |||
| $colspan = 0, | |||
| $onlysqltoimportwebsite = 0, | |||
| $database = '' ) |
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 between quotes) |
| 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 |
| int | $colspan | 2=Add a colspan=2 on td |
| int | $onlysqltoimportwebsite | Only sql requests used to import a website template are allowed |
| string | $database | Database (replace DATABASE with this value) |
Definition at line 173 of file admin.lib.php.
References $conf, checkPHPCode(), dol_htmlentities(), dol_syslog(), dolKeepOnlyPhpCode(), and versioncompare().
Referenced by DolibarrModules\_load_tables(), and migrate_reload_menu().
| security_prepare_head | ( | ) |
Prepare array with list of tabs.
Definition at line 855 of file admin.lib.php.
References $conf, dol_print_error(), and getDolGlobalString().
| showModulesExludedForExternal | ( | $modules | ) |
Show array with constants to edit.
| DolibarrModules[] | $modules | Array of all modules |
Definition at line 1946 of file admin.lib.php.
References dol_sort_array(), and getDolGlobalString().
| translation_prepare_head | ( | ) |
Prepare array with list of tabs.
Definition at line 976 of file admin.lib.php.
References $conf, and 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 1311 of file admin.lib.php.
References $conf, dol_syslog(), dolGetModulesDirs(), and unActivateModule().
Referenced by activateModule(), and unActivateModule().
| versioncompare | ( | $versionarray1, | |
| $versionarray2 ) |
Compare 2 versions (stored into 2 arrays), to know if a version (a,b,c) is lower than (x,y,z) To check using a string version do a preg_split('/[.
-]/', strinversion) to convert the string into an array. To check with Dolibarr version use versiondolibarrarray() to get the array of Dolibarr current version
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<int|string> | $versionarray1 Array of version (vermajor,verminor,patch) |
| array<int|string> | $versionarray2 Array of version (vermajor,verminor,patch) |
Definition at line 71 of file admin.lib.php.
Referenced by ImportCsv\__construct(), ImportXlsx\__construct(), activateModule(), migrate_invoice_export_models(), migrate_restore_missing_links(), and run_sql().
| versiondolibarrarray | ( | ) |
Return version Dolibarr.
Definition at line 144 of file admin.lib.php.
Referenced by activateModule().
| versionphparray | ( | ) |
Return version PHP.
Definition at line 133 of file admin.lib.php.
Referenced by ImportCsv\__construct(), ImportXlsx\__construct(), and activateModule().
| versiontostring | ( | $versionarray | ) |
Renvoi une version en chaine depuis une version en tableau.
| array<int<0,2>,int|string> | $versionarray Tableau de version (vermajeur,vermineur,autre) |
Definition at line 39 of file admin.lib.php.
Referenced by activateModule().