Skip to content
This repository has been archived by the owner on Sep 15, 2024. It is now read-only.

Commit

Permalink
Run of update.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
Vaadasch committed Apr 27, 2024
1 parent 7f8b313 commit 5622885
Show file tree
Hide file tree
Showing 7 changed files with 146 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ When setup this way, to upgrade version the use of the web interface is mandator
| **DOLI_ADMIN_PASSWORD** | *admin* | Admin'password
| **DOLI_URL_ROOT** | *http://localhost* | Url root of the Dolibarr installation
| **DOLI_ENABLE_MODULES** | | Comma-separated list of modules to be activated at install. modUser will always be activated. (Ex: `Societe,Facture,Stock`)
| **DOLI_COMPANY_NAME** | | Set the company name of Dolibarr at container init
| **DOLI_COMPANY_COUNTRYCODE** | | Set the company and Dolibarr country at container init. Need 2-letter codes like "FR", "GB", "US",...
| **PHP_INI_DATE_TIMEZONE** | *UTC* | Default timezone on PHP
| **PHP_INI_MEMORY_LIMIT** | *256M* | PHP Memory limit
| **PHP_INI_UPLOAD_MAX_FILESIZE** | *2M* | PHP Maximum allowed size for uploaded files
Expand Down
24 changes: 24 additions & 0 deletions images/15.0.3-php7.4/docker-init.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,27 @@
}
}
}

if (!empty(getenv('INIT_COMPANY_COUNTRYCODE'))) {
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/ccountry.class.php';
$countryCode = getenv('INIT_COMPANY_COUNTRYCODE');
$country = new Ccountry($db);
$res = $country->fetch(0,$countryCode);
if ($res > 0 ) {
$s = $country->id.':'.$country->code.':'.$country->label;
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_COUNTRY", $s, 'chaine', 0, '', $conf->entity);
printf('Configuring for country : '.$s);
activateModulesRequiredByCountry($country->code);
$db->commit();
}
else {
printf('Unable to find country '.$countryCode);
}
}

if (!empty(getenv('INIT_COMPANY_NAME'))) {
$compname = getenv('INIT_COMPANY_NAME');
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOM", $compname, 'chaine', 0, '', $conf->entity);
$db->commit();
}
24 changes: 24 additions & 0 deletions images/16.0.5-php8.1/docker-init.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,27 @@
}
}
}

if (!empty(getenv('INIT_COMPANY_COUNTRYCODE'))) {
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/ccountry.class.php';
$countryCode = getenv('INIT_COMPANY_COUNTRYCODE');
$country = new Ccountry($db);
$res = $country->fetch(0,$countryCode);
if ($res > 0 ) {
$s = $country->id.':'.$country->code.':'.$country->label;
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_COUNTRY", $s, 'chaine', 0, '', $conf->entity);
printf('Configuring for country : '.$s);
activateModulesRequiredByCountry($country->code);
$db->commit();
}
else {
printf('Unable to find country '.$countryCode);
}
}

if (!empty(getenv('INIT_COMPANY_NAME'))) {
$compname = getenv('INIT_COMPANY_NAME');
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOM", $compname, 'chaine', 0, '', $conf->entity);
$db->commit();
}
24 changes: 24 additions & 0 deletions images/17.0.4-php8.1/docker-init.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,27 @@
}
}
}

if (!empty(getenv('INIT_COMPANY_COUNTRYCODE'))) {
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/ccountry.class.php';
$countryCode = getenv('INIT_COMPANY_COUNTRYCODE');
$country = new Ccountry($db);
$res = $country->fetch(0,$countryCode);
if ($res > 0 ) {
$s = $country->id.':'.$country->code.':'.$country->label;
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_COUNTRY", $s, 'chaine', 0, '', $conf->entity);
printf('Configuring for country : '.$s);
activateModulesRequiredByCountry($country->code);
$db->commit();
}
else {
printf('Unable to find country '.$countryCode);
}
}

if (!empty(getenv('INIT_COMPANY_NAME'))) {
$compname = getenv('INIT_COMPANY_NAME');
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOM", $compname, 'chaine', 0, '', $conf->entity);
$db->commit();
}
24 changes: 24 additions & 0 deletions images/18.0.5-php8.1/docker-init.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,27 @@
}
}
}

if (!empty(getenv('INIT_COMPANY_COUNTRYCODE'))) {
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/ccountry.class.php';
$countryCode = getenv('INIT_COMPANY_COUNTRYCODE');
$country = new Ccountry($db);
$res = $country->fetch(0,$countryCode);
if ($res > 0 ) {
$s = $country->id.':'.$country->code.':'.$country->label;
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_COUNTRY", $s, 'chaine', 0, '', $conf->entity);
printf('Configuring for country : '.$s);
activateModulesRequiredByCountry($country->code);
$db->commit();
}
else {
printf('Unable to find country '.$countryCode);
}
}

if (!empty(getenv('INIT_COMPANY_NAME'))) {
$compname = getenv('INIT_COMPANY_NAME');
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOM", $compname, 'chaine', 0, '', $conf->entity);
$db->commit();
}
24 changes: 24 additions & 0 deletions images/19.0.1-php8.2/docker-init.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,27 @@
}
}
}

if (!empty(getenv('INIT_COMPANY_COUNTRYCODE'))) {
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/ccountry.class.php';
$countryCode = getenv('INIT_COMPANY_COUNTRYCODE');
$country = new Ccountry($db);
$res = $country->fetch(0,$countryCode);
if ($res > 0 ) {
$s = $country->id.':'.$country->code.':'.$country->label;
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_COUNTRY", $s, 'chaine', 0, '', $conf->entity);
printf('Configuring for country : '.$s);
activateModulesRequiredByCountry($country->code);
$db->commit();
}
else {
printf('Unable to find country '.$countryCode);
}
}

if (!empty(getenv('INIT_COMPANY_NAME'))) {
$compname = getenv('INIT_COMPANY_NAME');
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOM", $compname, 'chaine', 0, '', $conf->entity);
$db->commit();
}
24 changes: 24 additions & 0 deletions images/develop/docker-init.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,27 @@
}
}
}

if (!empty(getenv('INIT_COMPANY_COUNTRYCODE'))) {
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/ccountry.class.php';
$countryCode = getenv('INIT_COMPANY_COUNTRYCODE');
$country = new Ccountry($db);
$res = $country->fetch(0,$countryCode);
if ($res > 0 ) {
$s = $country->id.':'.$country->code.':'.$country->label;
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_COUNTRY", $s, 'chaine', 0, '', $conf->entity);
printf('Configuring for country : '.$s);
activateModulesRequiredByCountry($country->code);
$db->commit();
}
else {
printf('Unable to find country '.$countryCode);
}
}

if (!empty(getenv('INIT_COMPANY_NAME'))) {
$compname = getenv('INIT_COMPANY_NAME');
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOM", $compname, 'chaine', 0, '', $conf->entity);
$db->commit();
}

0 comments on commit 5622885

Please sign in to comment.