Merge branch 'develop' into cleandeprecated

This commit is contained in:
Frédéric FRANCE 2023-11-28 13:46:43 +01:00 committed by GitHub
commit e1bd404a87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1017 changed files with 9130 additions and 7604 deletions

View File

@ -9,6 +9,7 @@ For users:
----------
NEW: Compatibility with PHP 8.2
NEW: Module for Advanced stock transfert is now stable (#26594)
NEW: Module Workstation (used to enhance the module BOM and Manufacturing Order) is now stable
NEW: Add a confirmation popup when deleting extrafields
NEW: Add type 'icon' type for extrafields
NEW: Close #20930 Use ajax for state loading after country change
@ -238,6 +239,7 @@ The following changes may create regressions for some external modules, but were
* The property ->user_validation to store ID of user validating has been renamed into ->user_validation_id.
* The property ->user_creation to store ID of user of creation has been renamed into ->user_creation_id.
* The property ->user_modification to store ID of user of modification has been renamed into ->user_modification_id.
* The private array ->status_short, ->statuts and ->status_long are now array ->labelStatusShort and ->labelStatus everywhere.
* The duplicate property ->user_creat, ->date_creat, ->date_valid has been removed (use instead user_creation, date_creation, date_validation).
* The method get_substitutionarray_shipment_lines() has been removed. Use the generic get_substitutionarray_lines() instead.
* The method ProductcustomerPrice->fetch_all_log() has been renamed into camel case ->fetchAllLog()

View File

@ -3,9 +3,7 @@ README (English)
Building a Patch file
##################################################
This directory contains tools to build a patch
after a developer has made changes on files in its
Dolibarr tree.
The output patch file can then be submited on Dolibarr
dev mailing-list, with explanation on its goal, for
inclusion in main branch.
This directory contains tools to build a patch after a developer has made changes on files in its Dolibarr tree.
The output patch file can then be submited on Dolibarr dev mailing-list, with explanation on its goal, for inclusion in main branch.
Using this tool is now deprecated. You must use git pull requests to submit contributions.

View File

@ -1,5 +1,7 @@
README
------
Scripts in this directory can be used to load or purge data of a database instance.
Scripts in this directory can be used to load massive data or purge data of a database instance.
WARNING: Some of this script may delete definitely data.
To init data for a demo, use instead the tool into dev/initdemo

View File

@ -1 +1 @@
Files and tools were moved into htdocs/modulebuilder/template
Files and tools of a skeleton to build a module were moved into htdocs/modulebuilder/template

View File

@ -1 +1,2 @@
/test.php
/vendor

View File

@ -3,12 +3,17 @@
#### Installation
run in this folder
Run in this folder
```shell
cd dev/tools/rector
```
Install rector with composer
```shell
composer install
```
#### Usage
#### Usage
##### To make changes (Add --dry-run for test mode only)
```shell

View File

@ -9,6 +9,15 @@ use Rector\Set\ValueObject\LevelSetList;
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->phpVersion(PhpVersion::PHP_71);
//$rectorConfig->indent(' ', 4);
// Traits seems not supported correctly by rector without declaring them as bootstrapFiles
$arrayoftraitfiles = array(
__DIR__ . '/../../../htdocs/core/class/commonincoterm.class.php',
__DIR__ . '/../../../htdocs/core/class/commonpeople.class.php',
__DIR__ . '/../../../htdocs/core/class/commonsocialnetworks.class.php'
);
$rectorConfig->bootstrapFiles($arrayoftraitfiles);
$rectorConfig->paths([
__DIR__ . '/../../../htdocs/',
__DIR__ . '/../../../scripts/',
@ -33,8 +42,8 @@ return static function (RectorConfig $rectorConfig): void {
//$rectorConfig->rule(ReplaceEachAssignmentWithKeyCurrentRector::class);
//$rectorConfig->rule(Rector\Php72\Rector\FuncCall\StringifyDefineRector::class);
//$rectorConfig->rule(Dolibarr\Rector\Renaming\GlobalToFunction::class);
//$rectorConfig->rule(Dolibarr\Rector\Renaming\UserRightsToFunction::class);
$rectorConfig->rule(Dolibarr\Rector\Renaming\GlobalToFunction::class);
$rectorConfig->rule(Dolibarr\Rector\Renaming\UserRightsToFunction::class);
$rectorConfig->rule(Dolibarr\Rector\Renaming\EmptyGlobalToFunction::class);
// Add all predefined rules to migrate to up to php 71

View File

@ -684,6 +684,7 @@ if (empty($reshook)) {
$newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?' . $url_param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
$newcardbutton .= dolGetButtonTitle($langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?type=sub&' . $url_param, '', 1, array('morecss' => 'marginleftonly'));
}
$newcardbutton .= dolGetButtonTitleSeparator();
$newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?action=create');
}

View File

@ -619,7 +619,7 @@ class AccountingJournal extends CommonObject
$disposal_amount = $pre_data_info['disposal']['amount'];
$disposal_subject_to_vat = $pre_data_info['disposal']['subject_to_vat'];
$disposal_date_formatted = dol_print_date($disposal_date, 'day');
$disposal_vat = $conf->global->ASSET_DISPOSAL_VAT > 0 ? $conf->global->ASSET_DISPOSAL_VAT : 20;
$disposal_vat = getDolGlobalInt('ASSET_DISPOSAL_VAT') > 0 ? $conf->global->ASSET_DISPOSAL_VAT : 20;
// Get accountancy codes
//---------------------------

View File

@ -79,7 +79,7 @@ if (!$sortfield) {
$sortfield = "f.datef, f.ref, fd.rowid";
}
if (!$sortorder) {
if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE > 0) {
if (getDolGlobalInt('ACCOUNTING_LIST_SORT_VENTILATION_DONE') > 0) {
$sortorder = "DESC";
} else {
$sortorder = "ASC";

View File

@ -94,7 +94,7 @@ if (!$sortfield) {
$sortfield = "f.datef, f.ref, l.rowid";
}
if (!$sortorder) {
if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO > 0) {
if (getDolGlobalInt('ACCOUNTING_LIST_SORT_VENTILATION_TODO') > 0) {
$sortorder = "DESC";
} else {
$sortorder = "ASC";

View File

@ -73,7 +73,7 @@ if (!$sortfield) {
$sortfield = "erd.date, erd.rowid";
}
if (!$sortorder) {
if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE > 0) {
if (getDolGlobalInt('ACCOUNTING_LIST_SORT_VENTILATION_DONE') > 0) {
$sortorder = "DESC";
} else {
$sortorder = "ASC";

View File

@ -87,7 +87,7 @@ if (!$sortfield) {
$sortfield = "erd.date, erd.rowid";
}
if (!$sortorder) {
if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO > 0) {
if (getDolGlobalInt('ACCOUNTING_LIST_SORT_VENTILATION_TODO') > 0) {
$sortorder = "DESC";
} else {
$sortorder = "ASC";

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2016-2020 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2016-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2016-2023 Alexandre Spangaro <aspangaro@easya.solutions>
* Copyright (C) 2019-2021 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -92,7 +92,7 @@ if (isModEnabled('accounting')) {
$showtutorial = '';
if (!$helpisexpanded) {
$showtutorial = '<div align="right"><a href="#" id="show_hide">';
$showtutorial = '<div class="right"><a href="#" id="show_hide">';
$showtutorial .= img_picto('', 'chevron-down');
$showtutorial .= ' '.$langs->trans("ShowTutorial");
$showtutorial .= '</a></div>';
@ -146,6 +146,14 @@ if (isModEnabled('accounting')) {
print "<br>\n";
print "<br>\n";
if (getDolGlobalString('ACCOUNTANCY_FISCAL_PERIOD_MODE') != 'blockedonclosed') {
$step++;
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescFiscalPeriod", $step, '{s}');
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/accountancy/admin/fiscalyear.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("FiscalPeriod").'</strong></a>', $s);
print $s;
print "<br>\n";
}
$step++;
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDefault", $step, '{s}');
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/accountancy/admin/defaultaccounts.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong></a>', $s);

View File

@ -5,7 +5,7 @@
* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013-2022 Open-DSI <support@open-dsi.fr>
* Copyright (C) 2013-2023 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2013-2023 Alexandre Spangaro <aspangaro@easya.solutions>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2017-2023 Frédéric France <frederic.france@netlogic.fr>
@ -1065,14 +1065,33 @@ if (empty($action) || $action == 'view') {
$desc = '';
// Test that setup is complete (we are in accounting, so test on entity is always on $conf->entity only, no sharing allowed)
if (getDolGlobalString('ACCOUNTANCY_FISCAL_PERIOD_MODE') != 'blockedonclosed') {
// Test that setup is complete (we are in accounting, so test on entity is always on $conf->entity only, no sharing allowed)
// Fiscal period test
$sql = "SELECT COUNT(rowid) as nb FROM ".MAIN_DB_PREFIX."accounting_fiscalyear WHERE entity = ".((int) $conf->entity);
$resql = $db->query($sql);
if ($resql) {
$obj = $db->fetch_object($resql);
if ($obj->nb == 0) {
print '<br><div class="warning">'.img_warning().' '.$langs->trans("TheFiscalPeriodIsNotDefined");
$desc = ' : '.$langs->trans("AccountancyAreaDescFiscalPeriod", 4, '{link}');
$desc = str_replace('{link}', '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("FiscalPeriod").'</strong>', $desc);
print $desc;
print '</div>';
}
} else {
dol_print_error($db);
}
}
// Bank test
$sql = "SELECT COUNT(rowid) as nb FROM ".MAIN_DB_PREFIX."bank_account WHERE entity = ".((int) $conf->entity)." AND fk_accountancy_journal IS NULL AND clos=0";
$resql = $db->query($sql);
if ($resql) {
$obj = $db->fetch_object($resql);
if ($obj->nb > 0) {
print '<br><div class="warning">'.img_warning().' '.$langs->trans("TheJournalCodeIsNotDefinedOnSomeBankAccount");
$desc = ' : '.$langs->trans("AccountancyAreaDescBank", 9, '{link}');
$desc = ' : '.$langs->trans("AccountancyAreaDescBank", 6, '{link}');
$desc = str_replace('{link}', '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("BankAccounts").'</strong>', $desc);
print $desc;
print '</div>';

View File

@ -564,6 +564,25 @@ if (empty($action) || $action == 'view') {
journalHead($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink);
if (getDolGlobalString('ACCOUNTANCY_FISCAL_PERIOD_MODE') != 'blockedonclosed') {
// Test that setup is complete (we are in accounting, so test on entity is always on $conf->entity only, no sharing allowed)
// Fiscal period test
$sql = "SELECT COUNT(rowid) as nb FROM ".MAIN_DB_PREFIX."accounting_fiscalyear WHERE entity = ".((int) $conf->entity);
$resql = $db->query($sql);
if ($resql) {
$obj = $db->fetch_object($resql);
if ($obj->nb == 0) {
print '<br><div class="warning">'.img_warning().' '.$langs->trans("TheFiscalPeriodIsNotDefined");
$desc = ' : '.$langs->trans("AccountancyAreaDescFiscalPeriod", 4, '{link}');
$desc = str_replace('{link}', '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("FiscalPeriod").'</strong>', $desc);
print $desc;
print '</div>';
}
} else {
dol_print_error($db);
}
}
// Button to write into Ledger
if (!getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT') || getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT') == '-1') {
print '<br><div class="warning">'.img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone");

View File

@ -3,7 +3,7 @@
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2013-2023 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2013-2023 Alexandre Spangaro <aspangaro@easya.solutions>
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
@ -937,6 +937,25 @@ if (empty($action) || $action == 'view') {
journalHead($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink);
if (getDolGlobalString('ACCOUNTANCY_FISCAL_PERIOD_MODE') != 'blockedonclosed') {
// Test that setup is complete (we are in accounting, so test on entity is always on $conf->entity only, no sharing allowed)
// Fiscal period test
$sql = "SELECT COUNT(rowid) as nb FROM ".MAIN_DB_PREFIX."accounting_fiscalyear WHERE entity = ".((int) $conf->entity);
$resql = $db->query($sql);
if ($resql) {
$obj = $db->fetch_object($resql);
if ($obj->nb == 0) {
print '<br><div class="warning">'.img_warning().' '.$langs->trans("TheFiscalPeriodIsNotDefined");
$desc = ' : '.$langs->trans("AccountancyAreaDescFiscalPeriod", 4, '{link}');
$desc = str_replace('{link}', '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("FiscalPeriod").'</strong>', $desc);
print $desc;
print '</div>';
}
} else {
dol_print_error($db);
}
}
// Button to write into Ledger
$acctSupplierNotConfigured = in_array(getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER'), ['','-1']);
if ($acctSupplierNotConfigured) {

View File

@ -4,7 +4,7 @@
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013-2023 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2013-2023 Alexandre Spangaro <aspangaro@easya.solutions>
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
@ -994,6 +994,25 @@ if (empty($action) || $action == 'view') {
journalHead($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink);
if (getDolGlobalString('ACCOUNTANCY_FISCAL_PERIOD_MODE') != 'blockedonclosed') {
// Test that setup is complete (we are in accounting, so test on entity is always on $conf->entity only, no sharing allowed)
// Fiscal period test
$sql = "SELECT COUNT(rowid) as nb FROM ".MAIN_DB_PREFIX."accounting_fiscalyear WHERE entity = ".((int) $conf->entity);
$resql = $db->query($sql);
if ($resql) {
$obj = $db->fetch_object($resql);
if ($obj->nb == 0) {
print '<br><div class="warning">'.img_warning().' '.$langs->trans("TheFiscalPeriodIsNotDefined");
$desc = ' : '.$langs->trans("AccountancyAreaDescFiscalPeriod", 4, '{link}');
$desc = str_replace('{link}', '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("FiscalPeriod").'</strong>', $desc);
print $desc;
print '</div>';
}
} else {
dol_print_error($db);
}
}
// Button to write into Ledger
$acctCustomerNotConfigured = in_array(getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER'), ['','-1']);
if ($acctCustomerNotConfigured) {

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2021-2022 Open-DSI <support@open-dsi.fr>
/* Copyright (C) 2021-2023 Alexandre Spangaro <aspangaro@easya.solutions>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -214,6 +214,25 @@ $varlink = 'id_journal=' . $id_journal;
journalHead($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink);
if (getDolGlobalString('ACCOUNTANCY_FISCAL_PERIOD_MODE') != 'blockedonclosed') {
// Test that setup is complete (we are in accounting, so test on entity is always on $conf->entity only, no sharing allowed)
// Fiscal period test
$sql = "SELECT COUNT(rowid) as nb FROM ".MAIN_DB_PREFIX."accounting_fiscalyear WHERE entity = ".((int) $conf->entity);
$resql = $db->query($sql);
if ($resql) {
$obj = $db->fetch_object($resql);
if ($obj->nb == 0) {
print '<br><div class="warning">'.img_warning().' '.$langs->trans("TheFiscalPeriodIsNotDefined");
$desc = ' : '.$langs->trans("AccountancyAreaDescFiscalPeriod", 4, '{link}');
$desc = str_replace('{link}', '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("FiscalPeriod").'</strong>', $desc);
print $desc;
print '</div>';
}
} else {
dol_print_error($db);
}
}
if ($object->nature == 4) { // Bank journal
// Test that setup is complete (we are in accounting, so test on entity is always on $conf->entity only, no sharing allowed)
$sql = "SELECT COUNT(rowid) as nb";

View File

@ -81,7 +81,7 @@ if (!$sortfield) {
$sortfield = "f.datef, f.ref, l.rowid";
}
if (!$sortorder) {
if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE > 0) {
if (getDolGlobalInt('ACCOUNTING_LIST_SORT_VENTILATION_DONE') > 0) {
$sortorder = "DESC";
} else {
$sortorder = "ASC";

View File

@ -91,7 +91,7 @@ if (!$sortfield) {
$sortfield = "f.datef, f.ref, l.rowid";
}
if (!$sortorder) {
if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO > 0) {
if (getDolGlobalInt('ACCOUNTING_LIST_SORT_VENTILATION_TODO') > 0) {
$sortorder = "DESC";
} else {
$sortorder = "ASC";

View File

@ -271,10 +271,10 @@ foreach ($dirModMember as $dirroot) {
}
$modCodeMember = new $file;
// Show modules according to features level
if ($modCodeMember->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($modCodeMember->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
continue;
}
if ($modCodeMember->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($modCodeMember->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
continue;
}
@ -509,10 +509,10 @@ foreach ($dirmodels as $reldir) {
$module = new $classname($db);
$modulequalified = 1;
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
$modulequalified = 0;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
$modulequalified = 0;
}

View File

@ -220,7 +220,7 @@ if ($resql) {
dol_print_error($db);
}
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
print load_fiche_titre($langs->trans("AgendaModelModule"), '', '');
print '<table class="noborder centpercent">'."\n";

View File

@ -233,6 +233,9 @@ if (!isModEnabled('cron')) {
} else {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_AGENDA_REMINDER_EMAIL&token='.newToken().'">'.img_picto($langs->trans('Enabled'), 'switch_on').'</a>';
}
} else {
$langs->load("cron");
print '<span class="opacitymedium warning">'.$langs->trans("JobNotFound", $langs->transnoentitiesnoconv("sendEmailsReminder")).'</span>';
}
}
}

View File

@ -324,10 +324,10 @@ foreach ($dirmodels as $reldir) {
$module = new $classname($db);
$modulequalified = 1;
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
$modulequalified = 0;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
$modulequalified = 0;
}

View File

@ -173,10 +173,10 @@ foreach ($dirbarcode as $reldir) {
$module = new $classname($db);
// Show modules according to features level
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
continue;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
continue;
}

View File

@ -210,10 +210,10 @@ foreach ($dirmodels as $reldir) {
$module = new $classname($db);
// Show modules according to features level
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
continue;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
continue;
}
@ -345,10 +345,10 @@ foreach ($dirmodels as $reldir) {
$module = new $classname($db);
$modulequalified = 1;
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
$modulequalified = 0;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
$modulequalified = 0;
}

View File

@ -153,10 +153,10 @@ foreach ($dirmodels as $reldir) {
$module = new $classname($db);
// Show modules according to features level
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
continue;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
continue;
}

View File

@ -294,10 +294,10 @@ foreach ($dirmodels as $reldir) {
$module = new $file($db);
// Show modules according to features level
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
continue;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
continue;
}
@ -428,10 +428,10 @@ foreach ($dirmodels as $reldir) {
$module = new $classname($db);
$modulequalified = 1;
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
$modulequalified = 0;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
$modulequalified = 0;
}

View File

@ -51,6 +51,13 @@ if (!$user->admin) {
$error = 0;
$tmparraysize = getDefaultImageSizes();
$maxwidthsmall = $tmparraysize['maxwidthsmall'];
$maxheightsmall = $tmparraysize['maxheightsmall'];
$maxwidthmini = $tmparraysize['maxwidthmini'];
$maxheightmini = $tmparraysize['maxheightmini'];
$quality = $tmparraysize['quality'];
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('admincompany', 'globaladmin'));
@ -143,6 +150,7 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha'))
// Create thumbs
//$object->addThumbs($newfile); // We can't use addThumbs here yet because we need name of generated thumbs to add them into constants. TODO Check if need such constants. We should be able to retrieve value with get...
// Create small thumb, Used on logon for example
$imgThumbSmall = vignette($dirforimage.$original_file, $maxwidthsmall, $maxheightsmall, '_small', $quality);
if (image_format_supported($imgThumbSmall) >= 0 && preg_match('/([^\\/:]+)$/i', $imgThumbSmall, $reg)) {

View File

@ -245,10 +245,10 @@ foreach ($dirmodels as $reldir) {
$module = new $file($db);
// Show modules according to features level
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
continue;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
continue;
}
@ -377,10 +377,10 @@ foreach ($dirmodels as $reldir) {
$module = new $classname($db);
$modulequalified = 1;
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
$modulequalified = 0;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
$modulequalified = 0;
}

View File

@ -258,10 +258,10 @@ if (getDolGlobalString('MAIN_SUBMODULE_DELIVERY')) {
if ($module->isEnabled()) {
// Show modules according to features level
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
continue;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
continue;
}
@ -387,10 +387,10 @@ if (getDolGlobalString('MAIN_SUBMODULE_DELIVERY')) {
$module = new $classname($db);
$modulequalified = 1;
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
$modulequalified = 0;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
$modulequalified = 0;
}

View File

@ -531,7 +531,7 @@ $tabcond[39] = (isModEnabled("societe") && !getDolGlobalString('SOCIETE_DISABLE_
$tabcond[40] = (isModEnabled("societe") && getDolGlobalString('THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES'));
$tabcond[41] = isModEnabled('intracommreport');
$tabcond[42] = isModEnabled("product");
$tabcond[43] = isModEnabled("product") && isModEnabled('productbatch') && $conf->global->MAIN_FEATURES_LEVEL >= 2;
$tabcond[43] = isModEnabled("product") && isModEnabled('productbatch') && getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2;
$tabcond[44] = isModEnabled('asset');
// List of help for fields (no more used, help is defined into tabcomplete)
@ -662,7 +662,7 @@ if ($id == 11) {
'order_supplier' => img_picto('', 'supplier_order', 'class="pictofixedwidth"').$langs->trans('SupplierOrder'),
'invoice_supplier' => img_picto('', 'supplier_invoice', 'class="pictofixedwidth"').$langs->trans('SupplierBill'),
);
if (getDolGlobalString('MAIN_FEATURES_LEVEL') && $conf->global->MAIN_FEATURES_LEVEL >= 2) {
if (getDolGlobalString('MAIN_FEATURES_LEVEL') && getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
$elementList['conferenceorbooth'] = img_picto('', 'eventorganization', 'class="pictofixedwidth"').$langs->trans('ConferenceOrBooth');
}

View File

@ -403,7 +403,10 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if ($object->acces_type == 1) {
// Mode OAUth2 with PHP-IMAP
require_once DOL_DOCUMENT_ROOT.'/core/lib/oauth.lib.php'; // define $supportedoauth2array
require_once DOL_DOCUMENT_ROOT.'/core/lib/oauth.lib.php';
$supportedoauth2array = getSupportedOauth2Array();
$keyforsupportedoauth2array = $object->oauth_service;
if (preg_match('/^.*-/', $keyforsupportedoauth2array)) {
$keyforprovider = preg_replace('/^.*-/', '', $keyforsupportedoauth2array);

View File

@ -203,10 +203,10 @@ foreach ($dirmodels as $reldir) {
if ($module->isEnabled()) {
// Show modules according to features level
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
continue;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
continue;
}
@ -335,10 +335,10 @@ foreach ($dirmodels as $reldir) {
$module = new $classname($db);
$modulequalified = 1;
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
$modulequalified = 0;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
$modulequalified = 0;
}

View File

@ -223,10 +223,10 @@ foreach ($dirmodels as $reldir) {
$module = new $file($db);
// Show modules according to features level
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
continue;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
continue;
}
@ -351,10 +351,10 @@ foreach ($dirmodels as $reldir) {
$module = new $classname($db);
$modulequalified = 1;
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
$modulequalified = 0;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
$modulequalified = 0;
}

View File

@ -330,10 +330,10 @@ foreach ($dirmodels as $reldir) {
$module = new $classname($db);
// Show modules according to features level
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
continue;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
continue;
}
@ -521,10 +521,10 @@ foreach ($dirmodels as $reldir) {
$module = new $classname($db);
$modulequalified = 1;
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
$modulequalified = 0;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
$modulequalified = 0;
}

View File

@ -294,10 +294,10 @@ foreach ($dirmodels as $reldir) {
if ($module->isEnabled()) {
// Show modules according to features level
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
continue;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
continue;
}
@ -427,10 +427,10 @@ foreach ($dirmodels as $reldir) {
$module = new $classname($db);
$modulequalified = 1;
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
$modulequalified = 0;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
$modulequalified = 0;
}

View File

@ -204,10 +204,10 @@ foreach ($dirmodels as $reldir) {
$module = new $file($db);
// Show modules according to features level
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
continue;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
continue;
}
@ -281,7 +281,7 @@ print '<br>';
* Documents models for Holidays
*/
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
print load_fiche_titre($langs->trans("TemplatePDFHolidays"), '', '');
// Defined model definition table
@ -341,10 +341,10 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
$module = new $classname($db);
$modulequalified = 1;
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
$modulequalified = 0;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
$modulequalified = 0;
}
@ -525,7 +525,7 @@ if ($conf->use_javascript_ajax) {
print "</td>";
print "</tr>";
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
$substitutionarray = pdf_getSubstitutionArray($langs, array('objectamount'), null, 2);
$substitutionarray['__(AnyTranslationKey)__'] = $langs->trans("Translation");
$htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';

View File

@ -248,10 +248,10 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
$module = new $file($db);
// Show modules according to features level
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
continue;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
continue;
}
@ -386,10 +386,10 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
$module = new $classname($db);
$modulequalified = 1;
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
$modulequalified = 0;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
$modulequalified = 0;
}

View File

@ -374,10 +374,10 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
$module = new $file($db);
// Show modules according to features level
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
continue;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
continue;
}
@ -511,10 +511,10 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
$module = new $classname($db);
$modulequalified = 1;
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
$modulequalified = 0;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
$modulequalified = 0;
}

View File

@ -190,7 +190,7 @@ print '<td class="hideonsmartphone"></td>';
print '</tr>';
if (!empty($conf->use_javascript_ajax) && $conf->global->MAIN_FEATURES_LEVEL >= 1) {
if (!empty($conf->use_javascript_ajax) && getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 1) {
print '<tr class="oddeven"><td>';
print $langs->trans("MailAdvTargetRecipients").'</td><td>';
print ajax_constantonoff('EMAILING_USE_ADVANCED_SELECTOR');

View File

@ -397,7 +397,7 @@ if ($action == 'edit') {
print '</td></tr>';
// Host server
print '<tr class="oddeven">';
print '<tr class="oddeven hideonmodemail">';
if (!$conf->use_javascript_ajax && $linuxlike && getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail') == 'mail') {
print '<td>';
print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike");
@ -431,7 +431,7 @@ if ($action == 'edit') {
print '</tr>';
// Port
print '<tr class="oddeven"><td>';
print '<tr class="oddeven hideonmodemail"><td>';
if (!$conf->use_javascript_ajax && $linuxlike && getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail') == 'mail') {
print $langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike");
print '</td><td>';
@ -529,8 +529,9 @@ if ($action == 'edit') {
}
print '</td></tr>';
}
// TLS
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_EMAIL_TLS").'</td><td>';
print '<tr class="oddeven hideonmodemail"><td>'.$langs->trans("MAIN_MAIL_EMAIL_TLS").'</td><td>';
if (!empty($conf->use_javascript_ajax) || (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer')))) {
if (function_exists('openssl_open')) {
print $form->selectyesno('MAIN_MAIL_EMAIL_TLS', (getDolGlobalString('MAIN_MAIL_EMAIL_TLS') ? $conf->global->MAIN_MAIL_EMAIL_TLS : 0), 1);
@ -543,7 +544,7 @@ if ($action == 'edit') {
print '</td></tr>';
// STARTTLS
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").'</td><td>';
print '<tr class="oddeven hideonmodemail"><td>'.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").'</td><td>';
if (!empty($conf->use_javascript_ajax) || (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer')))) {
if (function_exists('openssl_open')) {
print $form->selectyesno('MAIN_MAIL_EMAIL_STARTTLS', (getDolGlobalString('MAIN_MAIL_EMAIL_STARTTLS') ? $conf->global->MAIN_MAIL_EMAIL_STARTTLS : 0), 1);
@ -556,7 +557,7 @@ if ($action == 'edit') {
print '</td></tr>';
// SMTP_ALLOW_SELF_SIGNED
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED").'</td><td>';
print '<tr class="oddeven hideonmodemail"><td>'.$langs->trans("MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED").'</td><td>';
if (!empty($conf->use_javascript_ajax) || (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer')))) {
if (function_exists('openssl_open')) {
print $form->selectyesno('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED', (getDolGlobalString('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED') ? $conf->global->MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED : 0), 1);
@ -604,8 +605,11 @@ if ($action == 'edit') {
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("OtherOptions").'</td><td></td></tr>';
// From
$help = img_help(1, $langs->trans("EMailHelpMsgSPFDKIM"));
print '<tr class="oddeven"><td class="fieldrequired">'.$langs->trans("MAIN_MAIL_EMAIL_FROM", ini_get('sendmail_from') ?ini_get('sendmail_from') : $langs->transnoentities("Undefined")).' '.$help.'</td>';
$help = $form->textwithpicto('', $langs->trans("EMailHelpMsgSPFDKIM"));
print '<tr class="oddeven"><td class="fieldrequired">';
print $langs->trans("MAIN_MAIL_EMAIL_FROM", ini_get('sendmail_from') ?ini_get('sendmail_from') : $langs->transnoentities("Undefined"));
print ' '.$help;
print '</td>';
print '<td><input class="flat minwidth200" name="MAIN_MAIL_EMAIL_FROM" value="'.(getDolGlobalString('MAIN_MAIL_EMAIL_FROM') ? $conf->global->MAIN_MAIL_EMAIL_FROM : '');
print '"></td></tr>';
@ -701,7 +705,7 @@ if ($action == 'edit') {
// Host server
if ($linuxlike && (getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail') == 'mail')) {
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike").'</td><td><span class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span></td></tr>';
//print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike").'</td><td><span class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span></td></tr>';
} else {
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMTP_SERVER", ini_get('SMTP') ?ini_get('SMTP') : $langs->transnoentities("Undefined")).'</td><td>'.(getDolGlobalString('MAIN_MAIL_SMTP_SERVER') ? $conf->global->MAIN_MAIL_SMTP_SERVER : '').'</td></tr>';
}
@ -709,7 +713,7 @@ if ($action == 'edit') {
// Port
if ($linuxlike && (getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail') == 'mail')) {
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike").'</td><td><span class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span></td></tr>';
//print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike").'</td><td><span class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span></td></tr>';
} else {
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMTP_PORT", ini_get('smtp_port') ?ini_get('smtp_port') : $langs->transnoentities("Undefined")).'</td><td>'.(getDolGlobalString('MAIN_MAIL_SMTP_PORT') ? $conf->global->MAIN_MAIL_SMTP_PORT : '').'</td></tr>';
}
@ -741,44 +745,55 @@ if ($action == 'edit') {
}
// TLS
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_EMAIL_TLS").'</td><td>';
if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer'))) {
if (function_exists('openssl_open')) {
print yn($conf->global->MAIN_MAIL_EMAIL_TLS);
} else {
print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')';
}
if ($linuxlike && (getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail') == 'mail')) {
// Nothing
} else {
print '<span class="opacitymedium">'.yn(0).' ('.$langs->trans("NotSupported").')</span>';
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_EMAIL_TLS").'</td><td>';
if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer'))) {
if (function_exists('openssl_open')) {
print yn($conf->global->MAIN_MAIL_EMAIL_TLS);
} else {
print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')';
}
} else {
print '<span class="opacitymedium">'.yn(0).' ('.$langs->trans("NotSupported").')</span>';
}
print '</td></tr>';
}
print '</td></tr>';
// STARTTLS
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").'</td><td>';
if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer'))) {
if (function_exists('openssl_open')) {
print yn($conf->global->MAIN_MAIL_EMAIL_STARTTLS);
} else {
print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')';
}
if ($linuxlike && (getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail') == 'mail')) {
// Nothing
} else {
print '<span class="opacitymedium">'.yn(0).' ('.$langs->trans("NotSupported").')</span>';
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").'</td><td>';
if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer'))) {
if (function_exists('openssl_open')) {
print yn($conf->global->MAIN_MAIL_EMAIL_STARTTLS);
} else {
print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')';
}
} else {
//print '<span class="opacitymedium">'.yn(0).' ('.$langs->trans("NotSupported").')</span>';
}
print '</td></tr>';
}
print '</td></tr>';
// SMTP_ALLOW_SELF_SIGNED
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED").'</td><td>';
if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer'))) {
if (function_exists('openssl_open')) {
print yn($conf->global->MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED);
} else {
print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')';
}
if ($linuxlike && (getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail') == 'mail')) {
// Nothing
} else {
print '<span class="opacitymedium">'.yn(0).' ('.$langs->trans("NotSupported").')</span>';
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED").'</td><td>';
if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer'))) {
if (function_exists('openssl_open')) {
print yn($conf->global->MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED);
} else {
print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')';
}
} else {
print '<span class="opacitymedium">'.yn(0).' ('.$langs->trans("NotSupported").')</span>';
}
print '</td></tr>';
}
print '</td></tr>';
if (getDolGlobalString('MAIN_MAIL_SENDMODE') == 'swiftmailer') {
// DKIM
@ -830,8 +845,11 @@ if ($action == 'edit') {
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("OtherOptions").'</td><td></td></tr>';
// From
$help = img_help(1, $langs->trans("EMailHelpMsgSPFDKIM"));
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_EMAIL_FROM", ini_get('sendmail_from') ?ini_get('sendmail_from') : $langs->transnoentities("Undefined")).' '.$help.'</td>';
$help = $form->textwithpicto('', $langs->trans("EMailHelpMsgSPFDKIM"));
print '<tr class="oddeven"><td>';
print $langs->trans("MAIN_MAIL_EMAIL_FROM", ini_get('sendmail_from') ?ini_get('sendmail_from') : $langs->transnoentities("Undefined"));
print ' '.$help;
print '</td>';
print '<td>' . getDolGlobalString('MAIN_MAIL_EMAIL_FROM');
if (!getDolGlobalString('MAIN_MAIL_EMAIL_FROM')) {
print img_warning($langs->trans("Mandatory"));
@ -991,7 +1009,7 @@ if ($action == 'edit') {
}
$companyemail = getDolGlobalString('MAIN_INFO_SOCIETE_MAIL');
$dnsinfo = false;
if (!empty($companyemail) && function_exists('dns_get_record') && empty($conf->global->MAIN_DISABLE_DNS_GET_RECORD)) {
if (!empty($companyemail) && function_exists('dns_get_record') && !getDolGlobalString('MAIN_DISABLE_DNS_GET_RECORD')) {
$arrayofemailparts = explode('@', $companyemail);
if (count($arrayofemailparts) == 2) {
$domain = $arrayofemailparts[1];

View File

@ -49,7 +49,6 @@ $substitutionarrayfortest = array(
'__SENDEREMAIL_SIGNATURE__' => (($user->signature && !getDolGlobalString('MAIN_MAIL_DO_NOT_USE_SIGN')) ? $usersignature : ''), // Done into actions_sendmails
'__ID__' => 'RecipientIdRecord',
//'__EMAIL__' => 'RecipientEMail', // Done into actions_sendmails
'__LOGIN__' => $user->login,
'__LASTNAME__' => 'RecipientLastname',
'__FIRSTNAME__' => 'RecipientFirstname',
'__ADDRESS__'=> 'RecipientAddress',
@ -368,7 +367,7 @@ if ($action == 'edit') {
// Port
print '<tr class="oddeven hideifdefault"><td>';
print '<tr class="oddeven hideifdefault hideonmodemail"><td>';
if (!$conf->use_javascript_ajax && $linuxlike && getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING') == 'mail') {
print $langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike");
print '</td><td>';
@ -398,7 +397,7 @@ if ($action == 'edit') {
// AUTH method
if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) {
print '<tr class="oddeven smtp_auth_method hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTPS_AUTH_TYPE").'</td><td>';
print '<tr class="oddeven smtp_auth_method hideonmodemail hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTPS_AUTH_TYPE").'</td><td>';
if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) {
// Note: Default value for MAIN_MAIL_SMTPS_AUTH_TYPE if not defined is 'LOGIN' (but login/pass may be empty and they won't be provided in such a case)
print '<input type="radio" id="radio_pw" name="MAIN_MAIL_SMTPS_AUTH_TYPE_EMAILING" value="LOGIN"'.(getDolGlobalString('MAIN_MAIL_SMTPS_AUTH_TYPE_EMAILING', 'LOGIN') == 'LOGIN' ? ' checked' : '').'> ';
@ -479,7 +478,7 @@ if ($action == 'edit') {
print '</td></tr>';
// STARTTLS
print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").'</td><td>';
print '<tr class="oddeven hideifdefault hideonmodemail"><td>'.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").'</td><td>';
if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) {
if (function_exists('openssl_open')) {
print $form->selectyesno('MAIN_MAIL_EMAIL_STARTTLS_EMAILING', (getDolGlobalString('MAIN_MAIL_EMAIL_STARTTLS_EMAILING') ? $conf->global->MAIN_MAIL_EMAIL_STARTTLS_EMAILING : 0), 1);
@ -492,7 +491,7 @@ if ($action == 'edit') {
print '</td></tr>';
// SMTP_ALLOW_SELF_SIGNED_EMAILING
print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED").'</td><td>';
print '<tr class="oddeven hideifdefault hideonmodemail"><td>'.$langs->trans("MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED").'</td><td>';
if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) {
if (function_exists('openssl_open')) {
print $form->selectyesno('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_EMAILING', (getDolGlobalString('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_EMAILING') ? $conf->global->MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_EMAILING : 0), 1);
@ -537,14 +536,14 @@ if ($action == 'edit') {
if (getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING') && $conf->global->MAIN_MAIL_SENDMODE_EMAILING != 'default') {
// Host server
if ($linuxlike && (getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING') == 'mail')) {
print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike").'</td><td>'.$langs->trans("SeeLocalSendMailSetup").'</td></tr>';
//print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike").'</td><td>'.$langs->trans("SeeLocalSendMailSetup").'</td></tr>';
} else {
print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTP_SERVER", ini_get('SMTP') ?ini_get('SMTP') : $langs->transnoentities("Undefined")).'</td><td>'.(getDolGlobalString('MAIN_MAIL_SMTP_SERVER_EMAILING') ? $conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING : '').'</td></tr>';
}
// Port
if ($linuxlike && (getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING') == 'mail')) {
print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike").'</td><td>'.$langs->trans("SeeLocalSendMailSetup").'</td></tr>';
//print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike").'</td><td>'.$langs->trans("SeeLocalSendMailSetup").'</td></tr>';
} else {
print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTP_PORT", ini_get('smtp_port') ?ini_get('smtp_port') : $langs->transnoentities("Undefined")).'</td><td>'.(getDolGlobalString('MAIN_MAIL_SMTP_PORT_EMAILING') ? $conf->global->MAIN_MAIL_SMTP_PORT_EMAILING : '').'</td></tr>';
}
@ -575,45 +574,56 @@ if ($action == 'edit') {
print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTPS_OAUTH_SERVICE_EMAILING").'</td><td>'.$text.'</td></tr>';
}
// TLS
print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_EMAIL_TLS").'</td><td>';
if (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer'))) {
if (function_exists('openssl_open')) {
print yn($conf->global->MAIN_MAIL_EMAIL_TLS_EMAILING);
} else {
print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')';
}
if ($linuxlike && (getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail') == 'mail')) {
// Nothing
} else {
print '<span class="opacitymedium">'.yn(0).' ('.$langs->trans("NotSupported").')</span>';
print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_EMAIL_TLS").'</td><td>';
if (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer'))) {
if (function_exists('openssl_open')) {
print yn($conf->global->MAIN_MAIL_EMAIL_TLS_EMAILING);
} else {
print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')';
}
} else {
print '<span class="opacitymedium">'.yn(0).' ('.$langs->trans("NotSupported").')</span>';
}
print '</td></tr>';
}
print '</td></tr>';
// STARTTLS
print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").'</td><td>';
if (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer'))) {
if (function_exists('openssl_open')) {
print yn($conf->global->MAIN_MAIL_EMAIL_STARTTLS_EMAILING);
} else {
print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')';
}
if ($linuxlike && (getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail') == 'mail')) {
// Nothing
} else {
print '<span class="opacitymedium">'.yn(0).' ('.$langs->trans("NotSupported").')</span>';
print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").'</td><td>';
if (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer'))) {
if (function_exists('openssl_open')) {
print yn($conf->global->MAIN_MAIL_EMAIL_STARTTLS_EMAILING);
} else {
print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')';
}
} else {
print '<span class="opacitymedium">'.yn(0).' ('.$langs->trans("NotSupported").')</span>';
}
print '</td></tr>';
}
print '</td></tr>';
// SMTP_ALLOW_SELF_SIGNED_EMAILING
print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED").'</td><td>';
if (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer'))) {
if (function_exists('openssl_open')) {
print yn(getDolGlobalInt('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_EMAILING'));
} else {
print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')';
}
if ($linuxlike && (getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail') == 'mail')) {
// Nothing
} else {
print '<span class="opacitymedium">'.yn(0).' ('.$langs->trans("NotSupported").')</span>';
print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED").'</td><td>';
if (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer'))) {
if (function_exists('openssl_open')) {
print yn(getDolGlobalInt('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_EMAILING'));
} else {
print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')';
}
} else {
print '<span class="opacitymedium">'.yn(0).' ('.$langs->trans("NotSupported").')</span>';
}
print '</td></tr>';
}
print '</td></tr>';
}
print '</table>';

View File

@ -43,19 +43,29 @@ if ($action == 'test' || $action == 'send') {
$substitutionarrayfortest = array(
'__DOL_MAIN_URL_ROOT__'=>DOL_MAIN_URL_ROOT,
'__ID__' => 'TESTIdRecord',
'__EMAIL__' => 'TESTEMail',
'__LOGIN__' => $user->login,
'__LASTNAME__' => 'TESTLastname',
'__FIRSTNAME__' => 'TESTFirstname',
'__USER_LOGIN__' => $user->login,
'__USER_EMAIL__' => $user->email,
'__USER_SIGNATURE__' => (($user->signature && !getDolGlobalString('MAIN_MAIL_DO_NOT_USE_SIGN')) ? $usersignature : ''), // Done into actions_sendmails
'__SENDEREMAIL_SIGNATURE__' => (($user->signature && !getDolGlobalString('MAIN_MAIL_DO_NOT_USE_SIGN')) ? $usersignature : ''), // Done into actions_sendmails
'__LASTNAME__' => 'RecipientLastname',
'__FIRSTNAME__' => 'RecipientFirstname',
'__ADDRESS__'=> 'RecipientAddress',
'__ZIP__'=> 'RecipientZip',
'__TOWN_'=> 'RecipientTown',
'__COUNTRY__'=> 'RecipientCountry',
'__USER_SIGNATURE__' => (($user->signature && !getDolGlobalString('MAIN_MAIL_DO_NOT_USE_SIGN')) ? $usersignature : ''),
'__SENDEREMAIL_SIGNATURE__' => (($user->signature && !getDolGlobalString('MAIN_MAIL_DO_NOT_USE_SIGN')) ? $usersignature : ''), // Done into actions_sendmails
'__COUNTRY__'=> 'RecipientCountry'
);
complete_substitutions_array($substitutionarrayfortest, $langs);
// List of sending methods
$listofmethods = array();
$listofmethods['default'] = $langs->trans('DefaultOutgoingEmailSetup');
$listofmethods['mail'] = 'PHP mail function';
//$listofmethods['simplemail']='Simplemail class';
$listofmethods['smtps'] = 'SMTP/SMTPS socket library';
if (version_compare(phpversion(), '7.0', '>=')) {
$listofmethods['swiftmailer'] = 'Swift Mailer socket library';
}
// Security check
if (!$user->admin) {
accessforbidden();
@ -142,16 +152,6 @@ print load_fiche_titre($langs->trans("EMailsSetup"), '', 'title_setup');
$head = email_admin_prepare_head();
// List of sending methods
$listofmethods = array();
$listofmethods['default'] = $langs->trans('DefaultOutgoingEmailSetup');
$listofmethods['mail'] = 'PHP mail function';
//$listofmethods['simplemail']='Simplemail class';
$listofmethods['smtps'] = 'SMTP/SMTPS socket library';
if (version_compare(phpversion(), '7.0', '>=')) {
$listofmethods['swiftmailer'] = 'Swift Mailer socket library';
}
// List of oauth services
$oauthservices = array();
@ -306,7 +306,7 @@ if ($action == 'edit') {
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SENDMODE").'</td><td>';
// SuperAdministrator access only
if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) {
if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) {
print $form->selectarray('MAIN_MAIL_SENDMODE_TICKET', $listofmethods, $conf->global->MAIN_MAIL_SENDMODE_TICKET);
} else {
$text = $listofmethods[getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET')];
@ -343,6 +343,7 @@ if ($action == 'edit') {
print '<input class="flat minwidth300" id="MAIN_MAIL_SMTP_SERVER_TICKET" name="MAIN_MAIL_SMTP_SERVER_TICKET" size="18" value="'.$mainserver.'">';
print '<input type="hidden" id="MAIN_MAIL_SMTP_SERVER_TICKET_sav" name="MAIN_MAIL_SMTP_SERVER_TICKET_sav" value="'.$mainserver.'">';
print '<span id="smtp_server_mess" class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span>';
print ' <span class="opacitymedium smtp_method">' . $langs->trans("SeeLinkToOnlineDocumentation") . '</span>';
} else {
$text = !empty($mainserver) ? $mainserver : $smtpserver;
$htmltext = $langs->trans("ContactSuperAdminForChange");
@ -355,7 +356,7 @@ if ($action == 'edit') {
// Port
print '<tr class="oddeven hideifdefault"><td>';
print '<tr class="oddeven hideifdefault hideonmodemail"><td>';
if (!$conf->use_javascript_ajax && $linuxlike && getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET') == 'mail') {
print $langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike");
print '</td><td>';
@ -385,7 +386,7 @@ if ($action == 'edit') {
// AUTH method
if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_TICKET) && in_array($conf->global->MAIN_MAIL_SENDMODE_TICKET, array('smtps', 'swiftmailer')))) {
print '<tr class="oddeven smtp_auth_method hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTPS_AUTH_TYPE").'</td><td>';
print '<tr class="oddeven smtp_auth_method hideifdefault hideonmodemail"><td>'.$langs->trans("MAIN_MAIL_SMTPS_AUTH_TYPE").'</td><td>';
if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) {
// Note: Default value for MAIN_MAIL_SMTPS_AUTH_TYPE if not defined is 'LOGIN' (but login/pass may be empty and they won't be provided in such a case)
print '<input type="radio" id="radio_pw" name="MAIN_MAIL_SMTPS_AUTH_TYPE_TICKET" value="LOGIN"'.(getDolGlobalString('MAIN_MAIL_SMTPS_AUTH_TYPE_TICKET', 'LOGIN') == 'LOGIN' ? ' checked' : '').'> ';
@ -466,7 +467,7 @@ if ($action == 'edit') {
// STARTTLS
print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").'</td><td>';
print '<tr class="oddeven hideifdefault hideonmodemail"><td>'.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").'</td><td>';
if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_TICKET) && in_array($conf->global->MAIN_MAIL_SENDMODE_TICKET, array('smtps', 'swiftmailer')))) {
if (function_exists('openssl_open')) {
print $form->selectyesno('MAIN_MAIL_EMAIL_STARTTLS_TICKET', (getDolGlobalString('MAIN_MAIL_EMAIL_STARTTLS_TICKET') ? $conf->global->MAIN_MAIL_EMAIL_STARTTLS_TICKET : 0), 1);
@ -491,6 +492,7 @@ if ($action == 'edit') {
print '<span class="opacitymedium">'.$langs->trans("EMailsDesc")."</span><br>\n";
print "<br><br>\n";
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
@ -510,14 +512,14 @@ if ($action == 'edit') {
if (getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET') && $conf->global->MAIN_MAIL_SENDMODE_TICKET != 'default') {
// Host server
if ($linuxlike && (getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET') == 'mail')) {
print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike").'</td><td>'.$langs->trans("SeeLocalSendMailSetup").'</td></tr>';
//print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike").'</td><td>'.$langs->trans("SeeLocalSendMailSetup").'</td></tr>';
} else {
print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTP_SERVER", ini_get('SMTP') ?ini_get('SMTP') : $langs->transnoentities("Undefined")).'</td><td>'.(getDolGlobalString('MAIN_MAIL_SMTP_SERVER_TICKET') ? $conf->global->MAIN_MAIL_SMTP_SERVER_TICKET : '').'</td></tr>';
}
// Port
if ($linuxlike && (getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET') == 'mail')) {
print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike").'</td><td>'.$langs->trans("SeeLocalSendMailSetup").'</td></tr>';
//print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike").'</td><td>'.$langs->trans("SeeLocalSendMailSetup").'</td></tr>';
} else {
print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTP_PORT", ini_get('smtp_port') ?ini_get('smtp_port') : $langs->transnoentities("Undefined")).'</td><td>'.(getDolGlobalString('MAIN_MAIL_SMTP_PORT_TICKET') ? $conf->global->MAIN_MAIL_SMTP_PORT_TICKET : '').'</td></tr>';
}
@ -549,33 +551,42 @@ if ($action == 'edit') {
}
// TLS
print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_EMAIL_TLS").'</td><td>';
if (isset($conf->global->MAIN_MAIL_SENDMODE_TICKET) && in_array($conf->global->MAIN_MAIL_SENDMODE_TICKET, array('smtps', 'swiftmailer'))) {
if (function_exists('openssl_open')) {
print yn($conf->global->MAIN_MAIL_EMAIL_TLS_TICKET);
} else {
print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')';
}
if ($linuxlike && (getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail') == 'mail')) {
// Nothing
} else {
print yn(0).' ('.$langs->trans("NotSupported").')';
print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_EMAIL_TLS").'</td><td>';
if (isset($conf->global->MAIN_MAIL_SENDMODE_TICKET) && in_array($conf->global->MAIN_MAIL_SENDMODE_TICKET, array('smtps', 'swiftmailer'))) {
if (function_exists('openssl_open')) {
print yn($conf->global->MAIN_MAIL_EMAIL_TLS_TICKET);
} else {
print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')';
}
} else {
print '<span class="opacitymedium">'.yn(0).' ('.$langs->trans("NotSupported").')</span>';
}
print '</td></tr>';
}
print '</td></tr>';
// STARTTLS
print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").'</td><td>';
if (isset($conf->global->MAIN_MAIL_SENDMODE_TICKET) && in_array($conf->global->MAIN_MAIL_SENDMODE_TICKET, array('smtps', 'swiftmailer'))) {
if (function_exists('openssl_open')) {
print yn($conf->global->MAIN_MAIL_EMAIL_STARTTLS_TICKET);
} else {
print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')';
}
if ($linuxlike && (getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail') == 'mail')) {
// Nothing
} else {
print yn(0).' ('.$langs->trans("NotSupported").')';
print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").'</td><td>';
if (isset($conf->global->MAIN_MAIL_SENDMODE_TICKET) && in_array($conf->global->MAIN_MAIL_SENDMODE_TICKET, array('smtps', 'swiftmailer'))) {
if (function_exists('openssl_open')) {
print yn($conf->global->MAIN_MAIL_EMAIL_STARTTLS_TICKET);
} else {
print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')';
}
} else {
print '<span class="opacitymedium">'.yn(0).' ('.$langs->trans("NotSupported").')</span>';
}
print '</td></tr>';
}
print '</td></tr>';
}
print '</table>';
print '</div>';
print dol_get_fiche_end();
@ -663,6 +674,8 @@ if ($action == 'edit') {
$formmail->fromname = (GETPOSTISSET('fromname') ? GETPOST('fromname', 'restricthtml') : $conf->global->MAIN_MAIL_EMAIL_FROM);
$formmail->frommail = (GETPOSTISSET('frommail') ? GETPOST('frommail', 'restricthtml') : $conf->global->MAIN_MAIL_EMAIL_FROM);
$formmail->trackid = (($action == 'testhtml') ? "testhtml" : "test");
$formmail->fromid = $user->id;
$formmail->fromalsorobot = 1;
$formmail->withfromreadonly = 0;
$formmail->withsubstit = 0;
$formmail->withfrom = 1;

View File

@ -615,10 +615,10 @@ if ($mode == 'common' || $mode == 'commonkanban') {
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 0) {
$array_version['deprecated'] = $langs->trans("Deprecated");
}
if ($conf->global->MAIN_FEATURES_LEVEL > 0) {
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') > 0) {
$array_version['experimental'] = $langs->trans("Experimental");
}
if ($conf->global->MAIN_FEATURES_LEVEL > 1) {
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') > 1) {
$array_version['development'] = $langs->trans("Development");
}
$moreforfilter .= '<div class="divsearchfield paddingtop paddingbottom valignmiddle inline-block">';
@ -1106,7 +1106,7 @@ if ($mode == 'marketplace') {
print '<br>';
if (!getDolGlobalString('MAIN_DISABLE_DOLISTORE_SEARCH') && $conf->global->MAIN_FEATURES_LEVEL >= 1) {
if (!getDolGlobalString('MAIN_DISABLE_DOLISTORE_SEARCH') && getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 1) {
// $options is array with filter criterias
//var_dump($options);
$dolistore->getRemoteCategories();

View File

@ -209,10 +209,10 @@ foreach ($dirmodels as $reldir) {
$module = new $file($db);
// Show modules according to features level
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
continue;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
continue;
}
@ -341,10 +341,10 @@ foreach ($dirmodels as $reldir) {
$module = new $classname($db);
$modulequalified = 1;
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
$modulequalified = 0;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
$modulequalified = 0;
}

View File

@ -29,7 +29,7 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/oauth.lib.php';
// $supportedoauth2array is defined into oauth.lib.php
$supportedoauth2array = getSupportedOauth2Array();
// Define $urlwithroot
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
@ -234,6 +234,8 @@ print '<span class="opacitymedium">'.$langs->trans("ListOfSupportedOauthProvider
print '<select name="provider" id="provider" class="minwidth150">';
print '<option name="-1" value="-1">'.$langs->trans("OAuthProvider").'</option>';
$list = getAllOauth2Array();
// TODO Make a loop directly on getSupportedOauth2Array() and remove getAllOauth2Array()
foreach ($list as $key) {
$supported = 0;
$keyforsupportedoauth2array = $key[0];
@ -245,7 +247,6 @@ foreach ($list as $key) {
continue; // show only supported
}
$i++;
print '<option name="'.$keyforsupportedoauth2array.'" value="'.str_replace('_NAME', '', $keyforsupportedoauth2array).'">'.$supportedoauth2array[$keyforsupportedoauth2array]['name'].'</option>'."\n";
}
print '</select>';

View File

@ -26,10 +26,13 @@
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/oauth.lib.php'; // This define $list and $supportedoauth2array
require_once DOL_DOCUMENT_ROOT.'/core/lib/oauth.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
use OAuth\Common\Storage\DoliStorage;
$supportedoauth2array = getSupportedOauth2Array();
// Load translation files required by the page
$langs->loadLangs(array('admin', 'printing', 'oauth'));

View File

@ -156,10 +156,10 @@ foreach ($dirmodels as $reldir) {
$module = new $classname($db);
// Show modules according to features level
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
continue;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
continue;
}

View File

@ -543,7 +543,7 @@ if (isModEnabled('barcode')) {
if ($conf->use_javascript_ajax) {
print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_SHOW_PRODUCT_BARCODE');
} else {
print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_SHOW_PRODUCT_BARCODE', (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_PRODUCT_BARCODE)) ? $conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_PRODUCT_BARCODE : 0, 1);
print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_SHOW_PRODUCT_BARCODE', (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_PRODUCT_BARCODE')) ? $conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_PRODUCT_BARCODE : 0, 1);
}
print '</td></tr>';
}

View File

@ -283,10 +283,10 @@ foreach ($dirmodels as $reldir) {
$module = new $file;
// Show modules according to features level
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
continue;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
continue;
}
@ -415,10 +415,10 @@ foreach ($dirmodels as $reldir) {
$module = new $classname($db);
$modulequalified = 1;
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
$modulequalified = 0;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
$modulequalified = 0;
}

View File

@ -209,10 +209,10 @@ foreach ($dirmodels as $reldir) {
if ($module->isEnabled()) {
// Show modules according to features level
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
continue;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
continue;
}
@ -345,10 +345,10 @@ foreach ($dirmodels as $reldir) {
$module = new $classname($db);
$modulequalified = 1;
if (isset($module->version) && $module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if (isset($module->version) && $module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
$modulequalified = 0;
}
if (isset($module->version) && $module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if (isset($module->version) && $module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
$modulequalified = 0;
}

View File

@ -225,10 +225,10 @@ $tabConf = explode(";", getDolGlobalString('USER_PASSWORD_PATTERN'));
foreach ($arrayhandler as $key => $module) {
// Show modules according to features level
if (!empty($module->version) && $module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if (!empty($module->version) && $module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
continue;
}
if (!empty($module->version) && $module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if (!empty($module->version) && $module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
continue;
}

View File

@ -583,10 +583,10 @@ foreach ($dirmodels as $reldir) {
$module = new $classname($db);
$modulequalified = 1;
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
$modulequalified = 0;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
$modulequalified = 0;
}

View File

@ -265,8 +265,8 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
$module = new $file($db);
// Show modules according to features level
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) continue;
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) continue;
if ($module->isEnabled()) {
dol_include_once('/'.$moduledir.'/class/'.strtolower($myTmpObjectKey).'.class.php');
@ -393,8 +393,8 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
$module = new $classname($db);
$modulequalified = 1;
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified = 0;
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified = 0;
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) $modulequalified = 0;
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) $modulequalified = 0;
if ($modulequalified) {
print '<tr class="oddeven"><td>';

View File

@ -237,10 +237,10 @@ foreach ($dirmodels as $reldir) {
if ($module->isEnabled()) {
// Show modules according to features level
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
continue;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
continue;
}

View File

@ -253,10 +253,10 @@ foreach ($dirmodels as $reldir) {
if ($module->isEnabled()) {
// Show modules according to features level
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
continue;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
continue;
}

View File

@ -229,10 +229,10 @@ foreach ($dirmodels as $reldir) {
$module = new $classname($db);
// Show modules according to features level
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
continue;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
continue;
}

View File

@ -262,10 +262,10 @@ foreach ($dirmodels as $reldir) {
$module = new $file;
// Show modules according to features level
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
continue;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
continue;
}
@ -393,10 +393,10 @@ foreach ($dirmodels as $reldir) {
$module = new $classname($db);
$modulequalified = 1;
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
$modulequalified = 0;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
$modulequalified = 0;
}

View File

@ -64,10 +64,10 @@ foreach ($dirsyslogs as $reldir) {
$module = new $file;
// Show modules according to features level
if ($module->getVersion() == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->getVersion() == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
continue;
}
if ($module->getVersion() == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->getVersion() == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
continue;
}

View File

@ -209,7 +209,7 @@ if (empty($mysoc->tva_assuj)) {
print '<tr class="oddeven"><td><input type="radio" name="tax_mode" value="1"'.($tax_mode == 1 ? ' checked' : '').'> '.$langs->trans('OptionVATDebitOption').'</td>';
print '<td>'.nl2br($langs->trans('OptionVatDebitOptionDesc'))."</td></tr>\n";
// On payment for both products and services
if ($conf->global->MAIN_FEATURES_LEVEL >= 1) {
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 1) {
print '<tr class="oddeven"><td><input type="radio" name="tax_mode" value="2"'.($tax_mode == 2 ? ' checked' : '').'> '.$langs->trans('OptionPaymentForProductAndServices').'</td>';
print '<td>'.nl2br($langs->trans('OptionPaymentForProductAndServicesDesc'))."</td></tr>\n";
}

View File

@ -87,7 +87,7 @@ if ($action == 'updateMask') {
} elseif (preg_match('/set_(.*)/', $action, $reg)) {
$code = $reg[1];
$value = GETPOSTISSET($code) ? GETPOST($code, 'int') : 1;
if ($code == 'TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS' && $conf->global->MAIN_FEATURES_LEVEL >= 2) {
if ($code == 'TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS' && getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
$param_notification_also_main_addressemail = GETPOST('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', 'alpha');
$res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', $param_notification_also_main_addressemail, 'chaine', 0, '', $conf->entity);
if (!($res > 0)) {
@ -219,7 +219,7 @@ if ($action == 'updateMask') {
}
// For compatibility when javascript is not enabled
if ($conf->global->MAIN_FEATURES_LEVEL >= 2 && empty($conf->use_javascript_ajax)) {
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2 && empty($conf->use_javascript_ajax)) {
$param_notification_also_main_addressemail = GETPOST('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', 'alpha');
$res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', $param_notification_also_main_addressemail, 'chaine', 0, '', $conf->entity);
if (!($res > 0)) {
@ -291,11 +291,11 @@ foreach ($dirmodels as $reldir) {
$module = new $file;
// Show modules according to features level
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
continue;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
continue;
}
@ -424,10 +424,10 @@ foreach ($dirmodels as $reldir) {
$module = new $classname($db);
$modulequalified = 1;
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
$modulequalified = 0;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
$modulequalified = 0;
}
@ -674,7 +674,7 @@ print '</td>';
print '</tr>';
// Also send to TICKET_NOTIFICATION_EMAIL_TO for responses (not only creation)
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
print '<tr class="oddeven"><td>'.$langs->trans("TicketsEmailAlsoSendToMainAddress").'</td>';
print '<td class="left">';
if ($conf->use_javascript_ajax) {

View File

@ -247,10 +247,10 @@ foreach ($dirmodels as $reldir) {
$module = new $classname($db);
$modulequalified = 1;
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
$modulequalified = 0;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
$modulequalified = 0;
}

View File

@ -170,10 +170,10 @@ foreach ($dirmodels as $reldir) {
$module = new $classname($db);
$modulequalified = 1;
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
$modulequalified = 0;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
$modulequalified = 0;
}

View File

@ -416,10 +416,10 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
$module = new $file($db);
// Show modules according to features level
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
continue;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
continue;
}
@ -553,10 +553,10 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
$module = new $classname($db);
$modulequalified = 1;
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
$modulequalified = 0;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
$modulequalified = 0;
}

View File

@ -261,10 +261,10 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
$module = new $file($db);
// Show modules according to features level
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
continue;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
continue;
}
@ -399,10 +399,10 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
$module = new $classname($db);
$modulequalified = 1;
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
$modulequalified = 0;
}
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
$modulequalified = 0;
}

View File

@ -179,11 +179,6 @@ class DolibarrApi
unset($object->alreadypaid);
unset($object->openid);
unset($object->statuts);
unset($object->statuts_short);
unset($object->statuts_logo);
unset($object->statuts_long);
//unset($object->labelStatus);
//unset($object->labelStatusShort);

View File

@ -48,7 +48,7 @@ $thirdpartytmp = new Societe($db);
$modBarCodeProduct = '';
$modBarCodeThirdparty = '';
$maxperinit = empty($conf->global->BARCODE_INIT_MAX) ? 1000 : $conf->global->BARCODE_INIT_MAX;
$maxperinit = !getDolGlobalString('BARCODE_INIT_MAX') ? 1000 : $conf->global->BARCODE_INIT_MAX;
// Security check (enable the most restrictive one)
//if ($user->socid > 0) accessforbidden();
@ -67,7 +67,7 @@ if (empty($user->admin)) {
*/
// Define barcode template for third-party
if (!empty($conf->global->BARCODE_THIRDPARTY_ADDON_NUM)) {
if (getDolGlobalString('BARCODE_THIRDPARTY_ADDON_NUM')) {
$dirbarcodenum = array_merge(array('/core/modules/barcode/'), $conf->modules_parts['barcode']);
foreach ($dirbarcodenum as $dirroot) {
@ -167,7 +167,7 @@ if ($action == 'initbarcodethirdparties') {
}
// Define barcode template for products
if (!empty($conf->global->BARCODE_PRODUCT_ADDON_NUM)) {
if (getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM')) {
$dirbarcodenum = array_merge(array('/core/modules/barcode/'), $conf->modules_parts['barcode']);
foreach ($dirbarcodenum as $dirroot) {

View File

@ -83,7 +83,7 @@ if (GETPOST('submitproduct') && GETPOST('submitproduct')) {
$forbarcode = $producttmp->barcode;
$fk_barcode_type = $producttmp->barcode_type;
if (empty($fk_barcode_type) && !empty($conf->global->PRODUIT_DEFAULT_BARCODE_TYPE)) {
if (empty($fk_barcode_type) && getDolGlobalString('PRODUIT_DEFAULT_BARCODE_TYPE')) {
$fk_barcode_type = $conf->global->PRODUIT_DEFAULT_BARCODE_TYPE;
}
@ -99,7 +99,7 @@ if (GETPOST('submitthirdparty') && GETPOST('submitthirdparty')) {
$forbarcode = $thirdpartytmp->barcode;
$fk_barcode_type = $thirdpartytmp->barcode_type_code;
if (empty($fk_barcode_type) && !empty($conf->global->GENBARCODE_BARCODETYPE_THIRDPARTY)) {
if (empty($fk_barcode_type) && getDolGlobalString('GENBARCODE_BARCODETYPE_THIRDPARTY')) {
$fk_barcode_type = $conf->global->GENBARCODE_BARCODETYPE_THIRDPARTY;
}
@ -213,12 +213,12 @@ if ($action == 'builddoc') {
// For labels
if ($mode == 'label') {
$txtforsticker = "%PHOTO%"; // Photo will be barcode image, %BARCODE% posible when using TCPDF generator
$textleft = make_substitutions((empty($conf->global->BARCODE_LABEL_LEFT_TEXT) ? $txtforsticker : $conf->global->BARCODE_LABEL_LEFT_TEXT), $substitutionarray);
$textheader = make_substitutions((empty($conf->global->BARCODE_LABEL_HEADER_TEXT) ? '' : $conf->global->BARCODE_LABEL_HEADER_TEXT), $substitutionarray);
$textfooter = make_substitutions((empty($conf->global->BARCODE_LABEL_FOOTER_TEXT) ? '' : $conf->global->BARCODE_LABEL_FOOTER_TEXT), $substitutionarray);
$textright = make_substitutions((empty($conf->global->BARCODE_LABEL_RIGHT_TEXT) ? '' : $conf->global->BARCODE_LABEL_RIGHT_TEXT), $substitutionarray);
$forceimgscalewidth = (empty($conf->global->BARCODE_FORCEIMGSCALEWIDTH) ? 1 : $conf->global->BARCODE_FORCEIMGSCALEWIDTH);
$forceimgscaleheight = (empty($conf->global->BARCODE_FORCEIMGSCALEHEIGHT) ? 1 : $conf->global->BARCODE_FORCEIMGSCALEHEIGHT);
$textleft = make_substitutions((!getDolGlobalString('BARCODE_LABEL_LEFT_TEXT') ? $txtforsticker : $conf->global->BARCODE_LABEL_LEFT_TEXT), $substitutionarray);
$textheader = make_substitutions((!getDolGlobalString('BARCODE_LABEL_HEADER_TEXT') ? '' : $conf->global->BARCODE_LABEL_HEADER_TEXT), $substitutionarray);
$textfooter = make_substitutions((!getDolGlobalString('BARCODE_LABEL_FOOTER_TEXT') ? '' : $conf->global->BARCODE_LABEL_FOOTER_TEXT), $substitutionarray);
$textright = make_substitutions((!getDolGlobalString('BARCODE_LABEL_RIGHT_TEXT') ? '' : $conf->global->BARCODE_LABEL_RIGHT_TEXT), $substitutionarray);
$forceimgscalewidth = (!getDolGlobalString('BARCODE_FORCEIMGSCALEWIDTH') ? 1 : $conf->global->BARCODE_FORCEIMGSCALEWIDTH);
$forceimgscaleheight = (!getDolGlobalString('BARCODE_FORCEIMGSCALEHEIGHT') ? 1 : $conf->global->BARCODE_FORCEIMGSCALEHEIGHT);
$MAXSTICKERS = 1000;
if ($numberofsticker <= $MAXSTICKERS) {

View File

@ -117,7 +117,7 @@ print $langs->trans("CompanyInitialKey").'</td><td>';
print $block_static->getSignature();
print '</td></tr>';
if (!empty($conf->global->BLOCKEDLOG_USE_REMOTE_AUTHORITY)) {
if (getDolGlobalString('BLOCKEDLOG_USE_REMOTE_AUTHORITY')) {
// Example with a yes / no select
print '<tr class="oddeven">';
print '<td>'.$langs->trans("BlockedLogAuthorityUrl").img_info($langs->trans('BlockedLogAuthorityNeededToStoreYouFingerprintsInNonAlterableRemote')).'</td>';
@ -155,7 +155,7 @@ if ($resql) {
}
}
$seledted = empty($conf->global->BLOCKEDLOG_DISABLE_NOT_ALLOWED_FOR_COUNTRY) ? array() : explode(',', $conf->global->BLOCKEDLOG_DISABLE_NOT_ALLOWED_FOR_COUNTRY);
$seledted = !getDolGlobalString('BLOCKEDLOG_DISABLE_NOT_ALLOWED_FOR_COUNTRY') ? array() : explode(',', $conf->global->BLOCKEDLOG_DISABLE_NOT_ALLOWED_FOR_COUNTRY);
print $form->multiselectarray('BLOCKEDLOG_DISABLE_NOT_ALLOWED_FOR_COUNTRY', $countryArray, $seledted);
print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';

View File

@ -104,7 +104,7 @@ $block_static->loadTrackedEvents();
$result = restrictedArea($user, 'blockedlog', 0, '');
// Execution Time
$max_execution_time_for_importexport = (empty($conf->global->EXPORT_MAX_EXECUTION_TIME) ? 300 : $conf->global->EXPORT_MAX_EXECUTION_TIME); // 5mn if not defined
$max_execution_time_for_importexport = (!getDolGlobalString('EXPORT_MAX_EXECUTION_TIME') ? 300 : $conf->global->EXPORT_MAX_EXECUTION_TIME); // 5mn if not defined
$max_time = @ini_get("max_execution_time");
if ($max_time && $max_time < $max_execution_time_for_importexport) {
dol_syslog("max_execution_time=".$max_time." is lower than max_execution_time_for_importexport=".$max_execution_time_for_importexport.". We try to increase it dynamically.");
@ -394,7 +394,7 @@ print $retstring;
print '<input type="text" name="yeartoexport" class="valignmiddle maxwidth50imp" value="'.GETPOST('yeartoexport', 'int').'">';
print '<input type="hidden" name="withtab" value="'.GETPOST('withtab', 'alpha').'">';
print '<input type="submit" name="downloadcsv" class="button" value="'.$langs->trans('DownloadLogCSV').'">';
if (!empty($conf->global->BLOCKEDLOG_USE_REMOTE_AUTHORITY)) {
if (getDolGlobalString('BLOCKEDLOG_USE_REMOTE_AUTHORITY')) {
print ' | <a href="?action=downloadblockchain'.(GETPOST('withtab', 'alpha') ? '&withtab='.GETPOST('withtab', 'alpha') : '').'">'.$langs->trans('DownloadBlockChain').'</a>';
}
print ' </div><br>';
@ -506,7 +506,7 @@ if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
}
print '</tr>';
if (!empty($conf->global->BLOCKEDLOG_SCAN_ALL_FOR_LOWERIDINERROR)) {
if (getDolGlobalString('BLOCKEDLOG_SCAN_ALL_FOR_LOWERIDINERROR')) {
// This is version that is faster but require more memory and report errors that are outside the filter range
// TODO Make a full scan of table in reverse order of id of $block, so we can use the parameter $previoushash into checkSignature to save requests
@ -625,7 +625,7 @@ if (is_array($blocks)) {
}
}
if (!empty($conf->global->BLOCKEDLOG_USE_REMOTE_AUTHORITY) && !empty($conf->global->BLOCKEDLOG_AUTHORITY_URL)) {
if (getDolGlobalString('BLOCKEDLOG_USE_REMOTE_AUTHORITY') && getDolGlobalString('BLOCKEDLOG_AUTHORITY_URL')) {
print ' '.($block->certified ? img_picto($langs->trans('AddedByAuthority'), 'info') : img_picto($langs->trans('NotAddedByAuthorityYet'), 'info_black'));
}
print '</td>';
@ -682,7 +682,7 @@ jQuery(document).ready(function () {
</script>'."\n";
if (!empty($conf->global->BLOCKEDLOG_USE_REMOTE_AUTHORITY) && !empty($conf->global->BLOCKEDLOG_AUTHORITY_URL)) {
if (getDolGlobalString('BLOCKEDLOG_USE_REMOTE_AUTHORITY') && getDolGlobalString('BLOCKEDLOG_AUTHORITY_URL')) {
?>
<script type="text/javascript">

View File

@ -44,7 +44,7 @@ require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/blockedlog.class.php';
require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/authority.class.php';
if (empty($conf->global->BLOCKEDLOG_AUTHORITY_URL)) {
if (!getDolGlobalString('BLOCKEDLOG_AUTHORITY_URL')) {
exit('BLOCKEDLOG_AUTHORITY_URL not set');
}

View File

@ -301,7 +301,7 @@ class BlockedLogAuthority
//TODO create cron task on activation
if (empty($conf->global->BLOCKEDLOG_AUTHORITY_URL) || empty($conf->global->BLOCKEDLOG_USE_REMOTE_AUTHORITY)) {
if (!getDolGlobalString('BLOCKEDLOG_AUTHORITY_URL') || !getDolGlobalString('BLOCKEDLOG_USE_REMOTE_AUTHORITY')) {
$this->error = $langs->trans('NoAuthorityURLDefined');
return -2;
}

View File

@ -203,14 +203,14 @@ class BlockedLog
// Cashdesk
// $conf->global->BANK_ENABLE_POS_CASHCONTROL must be set to 1 by all external POS modules
$moduleposenabled = (!empty($conf->cashdesk->enabled) || !empty($conf->takepos->enabled) || !empty($conf->global->BANK_ENABLE_POS_CASHCONTROL));
$moduleposenabled = (!empty($conf->cashdesk->enabled) || !empty($conf->takepos->enabled) || getDolGlobalString('BANK_ENABLE_POS_CASHCONTROL'));
if ($moduleposenabled) {
$this->trackedevents['CASHCONTROL_VALIDATE'] = 'logCASHCONTROL_VALIDATE';
}
// Add more action to track from a conf variable
// For example: STOCK_MOVEMENT,...
if (!empty($conf->global->BLOCKEDLOG_ADD_ACTIONS_SUPPORTED)) {
if (getDolGlobalString('BLOCKEDLOG_ADD_ACTIONS_SUPPORTED')) {
$tmparrayofmoresupportedevents = explode(',', $conf->global->BLOCKEDLOG_ADD_ACTIONS_SUPPORTED);
foreach ($tmparrayofmoresupportedevents as $val) {
$this->trackedevents[$val] = 'log'.$val;
@ -1174,7 +1174,7 @@ class BlockedLog
{
global $db, $conf, $mysoc;
if (empty($conf->global->BLOCKEDLOG_ENTITY_FINGERPRINT)) { // creation of a unique fingerprint
if (!getDolGlobalString('BLOCKEDLOG_ENTITY_FINGERPRINT')) { // creation of a unique fingerprint
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/security.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';

View File

@ -45,7 +45,7 @@ function blockedlogadmin_prepare_head()
require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/blockedlog.class.php';
$b = new BlockedLog($db);
if ($b->alreadyUsed()) {
$head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '<span class="badge marginleftonlyshort">...</span>' : '');
$head[$h][1] .= (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER') ? '<span class="badge marginleftonlyshort">...</span>' : '');
}
$head[$h][2] = 'fingerprints';
$h++;

View File

@ -47,9 +47,9 @@ $backtopage = GETPOST('backtopage', 'alpha');
// PDF
$hidedetails = (GETPOST('hidedetails', 'int') ? GETPOST('hidedetails', 'int') : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0));
$hidedesc = (GETPOST('hidedesc', 'int') ? GETPOST('hidedesc', 'int') : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0));
$hideref = (GETPOST('hideref', 'int') ? GETPOST('hideref', 'int') : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0));
$hidedetails = (GETPOST('hidedetails', 'int') ? GETPOST('hidedetails', 'int') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS') ? 1 : 0));
$hidedesc = (GETPOST('hidedesc', 'int') ? GETPOST('hidedesc', 'int') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DESC') ? 1 : 0));
$hideref = (GETPOST('hideref', 'int') ? GETPOST('hideref', 'int') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_REF') ? 1 : 0));
// Initialize technical objects
$object = new BOM($db);

View File

@ -420,7 +420,7 @@ if (!$resql) {
$num = $db->num_rows($resql);
// Direct jump if only one record found
if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) {
if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
$obj = $db->fetch_object($resql);
$id = $obj->rowid;
header("Location: ".DOL_URL_ROOT.'/bom/bom_card.php?id='.$id);

View File

@ -197,19 +197,19 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
*/
$text_stock_options = $langs->trans("RealStockDesc").'<br>';
$text_stock_options .= $langs->trans("RealStockWillAutomaticallyWhen").'<br>';
$text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) || !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE) ? '- '.$langs->trans("DeStockOnShipment").'<br>' : '');
$text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) ? '- '.$langs->trans("DeStockOnValidateOrder").'<br>' : '');
$text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_BILL) ? '- '.$langs->trans("DeStockOnBill").'<br>' : '');
$text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) ? '- '.$langs->trans("ReStockOnBill").'<br>' : '');
$text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) ? '- '.$langs->trans("ReStockOnValidateOrder").'<br>' : '');
$text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER) ? '- '.$langs->trans("ReStockOnDispatchOrder").'<br>' : '');
$text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_RECEPTION) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE) ? '- '.$langs->trans("StockOnReception").'<br>' : '');
$text_stock_options .= (getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT') || getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT_CLOSE') ? '- '.$langs->trans("DeStockOnShipment").'<br>' : '');
$text_stock_options .= (getDolGlobalString('STOCK_CALCULATE_ON_VALIDATE_ORDER') ? '- '.$langs->trans("DeStockOnValidateOrder").'<br>' : '');
$text_stock_options .= (getDolGlobalString('STOCK_CALCULATE_ON_BILL') ? '- '.$langs->trans("DeStockOnBill").'<br>' : '');
$text_stock_options .= (getDolGlobalString('STOCK_CALCULATE_ON_SUPPLIER_BILL') ? '- '.$langs->trans("ReStockOnBill").'<br>' : '');
$text_stock_options .= (getDolGlobalString('STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER') ? '- '.$langs->trans("ReStockOnValidateOrder").'<br>' : '');
$text_stock_options .= (getDolGlobalString('STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER') ? '- '.$langs->trans("ReStockOnDispatchOrder").'<br>' : '');
$text_stock_options .= (getDolGlobalString('STOCK_CALCULATE_ON_RECEPTION') || getDolGlobalString('STOCK_CALCULATE_ON_RECEPTION_CLOSE') ? '- '.$langs->trans("StockOnReception").'<br>' : '');
print '<table id="tablelines" class="noborder noshadow" width="100%">';
print "<thead>\n";
print '<tr class="liste_titre nodrag nodrop">';
print '<td class="linecoldescription">'.$langs->trans('Product');
if (!empty($conf->global->BOM_SUB_BOM) && $action == 'treeview') {
if (getDolGlobalString('BOM_SUB_BOM') && $action == 'treeview') {
print ' &nbsp; <a id="show_all" href="#">'.img_picto('', 'folder-open', 'class="paddingright"').$langs->trans("ExpandAll").'</a>&nbsp;&nbsp;';
print '<a id="hide_all" href="#">'.img_picto('', 'folder', 'class="paddingright"').$langs->trans("UndoExpandAll").'</a>&nbsp;';
}

View File

@ -269,7 +269,7 @@ class BOM extends CommonObject
$this->db = $db;
if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) {
if (!getDolGlobalString('MAIN_SHOW_TECHNICAL_ID') && isset($this->fields['rowid'])) {
$this->fields['rowid']['visible'] = 0;
}
if (!isModEnabled('multicompany') && isset($this->fields['entity'])) {
@ -873,7 +873,7 @@ class BOM extends CommonObject
global $langs, $conf;
$langs->load("mrp");
if (!empty($conf->global->BOM_ADDON)) {
if (getDolGlobalString('BOM_ADDON')) {
$mybool = false;
$file = getDolGlobalString('BOM_ADDON') . ".php";
@ -1120,7 +1120,7 @@ class BOM extends CommonObject
$datas = [];
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
return ['optimize' => $langs->trans("ShowBillOfMaterials")];
}
$picto = img_picto('', $this->picto).' <u class="paddingrightonly">'.$langs->trans("BillOfMaterials").'</u>';
@ -1193,7 +1193,7 @@ class BOM extends CommonObject
$linkclose = '';
if (empty($notooltip)) {
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowBillOfMaterials");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
}
@ -1347,7 +1347,7 @@ class BOM extends CommonObject
if ($this->model_pdf) {
$modele = $this->model_pdf;
} elseif (!empty($conf->global->BOM_ADDON_PDF)) {
} elseif (getDolGlobalString('BOM_ADDON_PDF')) {
$modele = $conf->global->BOM_ADDON_PDF;
}
}
@ -1807,7 +1807,7 @@ class BOMLine extends CommonObjectLine
$this->db = $db;
if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) {
if (!getDolGlobalString('MAIN_SHOW_TECHNICAL_ID') && isset($this->fields['rowid'])) {
$this->fields['rowid']['visible'] = 0;
}
if (!isModEnabled('multicompany') && isset($this->fields['entity'])) {
@ -2003,7 +2003,7 @@ class BOMLine extends CommonObjectLine
$linkclose = '';
if (empty($notooltip)) {
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowBillOfMaterialsLine");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
}

View File

@ -105,7 +105,7 @@ function bomPrepareHead($object)
$head[$h][0] = DOL_URL_ROOT.'/bom/bom_note.php?id='.$object->id;
$head[$h][1] = $langs->trans('Notes');
if ($nbNote > 0) {
$head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '<span class="badge marginleftonlyshort">'.$nbNote.'</span>' : '');
$head[$h][1] .= (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER') ? '<span class="badge marginleftonlyshort">'.$nbNote.'</span>' : '');
}
$head[$h][2] = 'note';
$h++;
@ -119,7 +119,7 @@ function bomPrepareHead($object)
$head[$h][0] = DOL_URL_ROOT.'/bom/bom_document.php?id='.$object->id;
$head[$h][1] = $langs->trans('Documents');
if (($nbFiles + $nbLinks) > 0) {
$head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).'</span>' : '');
$head[$h][1] .= (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER') ? '<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).'</span>' : '');
}
$head[$h][2] = 'document';
$h++;

View File

@ -45,7 +45,7 @@ if (empty($forceall)) {
}
if (empty($filtertype)) $filtertype = 0;
if (!empty($object->element) && $object->element == 'contrat' && empty($conf->global->STOCK_SUPPORT_SERVICES)) {
if (!empty($object->element) && $object->element == 'contrat' && !getDolGlobalString('STOCK_SUPPORT_SERVICES')) {
$filtertype = -1;
}
@ -64,7 +64,7 @@ $nolinesbefore = (count($this->lines) == 0 || $forcetoshowtitlelines);
if ($nolinesbefore) {
print '<tr class="liste_titre nodrag nodrop">';
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
if (getDolGlobalString('MAIN_VIEW_LINE_NUMBER')) {
print '<td class="linecolnum center"></td>';
}
print '<td class="linecoldescription minwidth500imp">';
@ -95,7 +95,7 @@ print '<tr class="pair nodrag nodrop nohoverpair'.(($nolinesbefore || $object->e
$coldisplay = 0;
// Adds a line numbering column
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
if (getDolGlobalString('MAIN_VIEW_LINE_NUMBER')) {
$coldisplay++;
echo '<td class="bordertop nobottom linecolnum center"></td>';
}
@ -112,7 +112,7 @@ if (isModEnabled("product") || isModEnabled("service")) {
}
echo '<span class="prod_entry_mode_predef">';
$statustoshow = -1;
if (!empty($conf->global->ENTREPOT_EXTRA_STATUS)) {
if (getDolGlobalString('ENTREPOT_EXTRA_STATUS')) {
// hide products in closed warehouse, but show products for internal transfer
print $form->select_produits(GETPOST('idprod', 'int'), (($filtertype == 1) ? 'idprodservice' : 'idprod'), $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, 'warehouseopen,warehouseinternal', GETPOST('combinations', 'array'), 1);
} else {
@ -123,7 +123,7 @@ if (isModEnabled("product") || isModEnabled("service")) {
echo '</span>';
}
if (!empty($conf->global->BOM_SUB_BOM) && $filtertype!=1) {
if (getDolGlobalString('BOM_SUB_BOM') && $filtertype!=1) {
print '<br><span class="opacitymedium">'.$langs->trans("or").'</span><br>'.$langs->trans("BOM");
print $form->select_bom('', 'bom_id', 0, 1, 0, '1', '', 1);
}

View File

@ -63,7 +63,7 @@ print "<!-- BEGIN PHP TEMPLATE objectline_edit.tpl.php -->\n";
$coldisplay = 0;
print '<tr class="oddeven tredited">';
// Adds a line numbering column
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
if (getDolGlobalString('MAIN_VIEW_LINE_NUMBER')) {
print '<td class="linecolnum center">'.($i + 1).'</td>';
$coldisplay++;
}

View File

@ -51,13 +51,13 @@ print "<thead>\n";
print '<tr class="liste_titre nodrag nodrop">';
// Adds a line numbering column
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
if (getDolGlobalString('MAIN_VIEW_LINE_NUMBER')) {
print '<td class="linecolnum center">&nbsp;</td>';
}
// Product or sub-bom
print '<td class="linecoldescription">'.$langs->trans('Description');
if (!empty($conf->global->BOM_SUB_BOM) && $filtertype != 1) {
if (getDolGlobalString('BOM_SUB_BOM') && $filtertype != 1) {
print ' &nbsp; <a id="show_all" href="#">'.img_picto('', 'folder-open', 'class="paddingright"').$langs->trans("ExpandAll").'</a>&nbsp;&nbsp;';
print '<a id="hide_all" href="#">'.img_picto('', 'folder', 'class="paddingright"').$langs->trans("UndoExpandAll").'</a>&nbsp;';
}

View File

@ -82,7 +82,7 @@ print "<!-- BEGIN PHP TEMPLATE objectline_view.tpl.php -->\n";
print '<tr id="row-'.$line->id.'" class="drag drop oddeven" '.$domData.' >';
// Line nb
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
if (getDolGlobalString('MAIN_VIEW_LINE_NUMBER')) {
print '<td class="linecolnum center">'.($i + 1).'</td>';
$coldisplay++;
}
@ -100,7 +100,7 @@ if ($tmpbom->id > 0) {
print ' '.$langs->trans("or").' ';
print $tmpbom->getNomUrl(1);
print ' <a class="collapse_bom" id="collapse-'.$line->id.'" href="#">';
print (empty($conf->global->BOM_SHOW_ALL_BOM_BY_DEFAULT) ? img_picto('', 'folder') : img_picto('', 'folder-open'));
print (!getDolGlobalString('BOM_SHOW_ALL_BOM_BY_DEFAULT') ? img_picto('', 'folder') : img_picto('', 'folder-open'));
print '</a>';
} else {
print $tmpproduct->getNomUrl(1);
@ -257,7 +257,7 @@ if ($resql) {
$sub_bom_line->fetch($obj->rowid);
//If hidden conf is set, we show directly all the sub-BOM lines
if (empty($conf->global->BOM_SHOW_ALL_BOM_BY_DEFAULT)) {
if (!getDolGlobalString('BOM_SHOW_ALL_BOM_BY_DEFAULT')) {
print '<tr style="display:none" class="sub_bom_lines" parentid="'.$line->id.'">';
} else {
print '<tr class="sub_bom_lines" parentid="'.$line->id.'">';
@ -278,7 +278,7 @@ if ($resql) {
$label = $sub_bom_product->getLabelOfUnit('long');
if ($sub_bom_line->qty_frozen > 0) {
print '<td class="linecolqty nowrap right" id="sub_bom_qty_'.$sub_bom_line->id.'">'.price($sub_bom_line->qty, 0, '', 0, 0).'</td>';
if (!empty($conf->global->PRODUCT_USE_UNITS)) {
if (getDolGlobalString('PRODUCT_USE_UNITS')) {
print '<td class="linecoluseunit nowrap left">';
if ($label !== '') print $langs->trans($label);
print '</td>';
@ -286,7 +286,7 @@ if ($resql) {
print '<td class="linecolqtyfrozen nowrap right" id="sub_bom_qty_frozen_'.$sub_bom_line->id.'">'.$langs->trans('Yes').'</td>';
} else {
print '<td class="linecolqty nowrap right" id="sub_bom_qty_'.$sub_bom_line->id.'">'.price($sub_bom_line->qty * $line->qty, 0, '', 0, 0).'</td>';
if (!empty($conf->global->PRODUCT_USE_UNITS)) {
if (getDolGlobalString('PRODUCT_USE_UNITS')) {
print '<td class="linecoluseunit nowrap left">';
if ($label !== '') print $langs->trans($label);
print '</td>';

View File

@ -48,7 +48,7 @@ if (GETPOST('actioncode', 'array')) {
$actioncode = '0';
}
} else {
$actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
$actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (!getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT') ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
}
$search_rowid = GETPOST('search_rowid');

View File

@ -0,0 +1,247 @@
<?php
/* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018-2023 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/compta/facture/prelevement.php
* \ingroup facture
* \brief Management of direct debit order or credit tranfer of invoices
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
dol_include_once('/bookcal/lib/bookcal_calendar.lib.php');
// load module libraries
require_once __DIR__.'/class/calendar.class.php';
// Load translation files required by the page
$langs->loadLangs(array("bookcal@bookcal", "other"));
$id = (GETPOST('id', 'int') ?GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility
$ref = GETPOST('ref', 'alpha');
$socid = GETPOST('socid', 'int');
$action = GETPOST('action', 'aZ09');
$type = GETPOST('type', 'aZ09');
$fieldid = (!empty($ref) ? 'ref' : 'rowid');
if ($user->socid) {
$socid = $user->socid;
}
$moreparam = '';
$object = new Calendar($db);
// Load object
if ($id > 0 || !empty($ref)) {
$ret = $object->fetch($id, $ref);
$isdraft = (($object->status == Calendar::STATUS_DRAFT) ? 1 : 0);
if ($ret > 0) {
$object->fetch_thirdparty();
}
}
// There is several ways to check permission.
// Set $enablepermissioncheck to 1 to enable a minimum low level of checks
$enablepermissioncheck = 0;
if ($enablepermissioncheck) {
$permissiontoread = $user->hasRight('bookcal', 'calendar', 'read');
$permissiontoadd = $user->hasRight('bookcal', 'calendar', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
$permissiontodelete = $user->hasRight('bookcal', 'calendar', 'delete') || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT);
$permissionnote = $user->hasRight('bookcal', 'calendar', 'write'); // Used by the include of actions_setnotes.inc.php
$permissiondellink = $user->hasRight('bookcal', 'calendar', 'write'); // Used by the include of actions_dellink.inc.php
} else {
$permissiontoread = 1;
$permissiontoadd = 1; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
$permissiontodelete = 1;
$permissionnote = 1;
$permissiondellink = 1;
}
if (!isModEnabled("bookcal")) {
accessforbidden();
}
if (!$permissiontoread) {
accessforbidden();
}
/*
* Actions
*/
$parameters = '';
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
}
/*
* View
*/
$form = new Form($db);
$now = dol_now();
$title = $langs->trans('Calendar')." - ".$langs->trans('Bookings');
llxHeader('', $title, $helpurl);
if ($object->id > 0) {
$head = calendarPrepareHead($object);
print dol_get_fiche_head($head, 'booking', $langs->trans("Calendar"), -1, $object->picto, 0, '', '', 0, '', 1);
$formconfirm = '';
// Call Hook formConfirm
$parameters = array('formConfirm' => $formconfirm, 'lineid' => $lineid);
$reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if (empty($reshook)) {
$formconfirm .= $hookmanager->resPrint;
} elseif ($reshook > 0) {
$formconfirm = $hookmanager->resPrint;
}
// Print form confirm
print $formconfirm;
// Object card
// ------------------------------------------------------------
$linkback = '<a href="'.dol_buildpath('/bookcal/calendar_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
$morehtmlref = '<div class="refidno">';
$morehtmlref .= '</div>';
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
print '<div class="fichecenter">';
print '<div class="fichehalfleft">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border centpercent tableforfield">'."\n";
// Common attributes
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
// Other attributes. Fields from hook formObjectOptions and Extrafields.
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
// Link to public page
print '<tr><td>Link</td>';
print '<td><a href="'. DOL_URL_ROOT.'/public/bookcal/index.php?id='.$object->id.'" target="_blank">Public page</a>';
print '</td></tr>';
print '</table>';
print '</div>';
print '</div>';
print '<div class="clearboth"></div>';
print dol_get_fiche_end();
/*
* Bookings
*/
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td class="left">'.$langs->trans("Ref").'</td>';
print '<td>'.$langs->trans("Title").'</td>';
print '<td class="center">'.$langs->trans("DateStart").'</td>';
print '<td class="center">'.$langs->trans("DateEnd").'</td>';
print '<td class="left">'.$langs->trans("Contact").'</td>';
print '</tr>';
$sql = "SELECT ac.id, ac.ref, ac.datep as date_start, ac.datep2 as date_end, ac.label, acr.fk_element";
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as ac";
$sql .= " JOIN ".MAIN_DB_PREFIX."actioncomm_resources as acr on acr.fk_actioncomm = ac.id";
$sql .= " WHERE ac.fk_bookcal_calendar = ".((int) $object->id);
$sql .= " AND ac.code = 'AC_RDV'";
$sql .= " AND acr.element_type = 'socpeople'";
$resql = $db->query($sql);
$num = 0;
if ($resql) {
$i = 0;
$tmpcontact = new Contact($db);
$tmpactioncomm = new ActionComm($db);
$num = $db->num_rows($result);
while ($i < $num) {
$obj = $db->fetch_object($resql);
$tmpcontact->fetch($obj->fk_element);
$tmpactioncomm->fetch($obj->id);
print '<tr class="oddeven">';
// Ref
print '<td class="nowraponall">'.$tmpactioncomm->getNomUrl(1, -1)."</td>\n";
// Title
print '<td class="tdoverflowmax125">';
print $obj->label;
print '</td>';
// Amount
print '<td class="center">'.dol_print_date($db->jdate($obj->date_start), "dayhour").'</td>';
// Date process
print '<td class="center">'.dol_print_date($db->jdate($obj->date_end), "dayhour").'</td>';
// Link to make payment now
print '<td class="minwidth75">';
print $tmpcontact->getNomUrl(1, -1);
print '</td>';
print "</tr>\n";
$i++;
}
$db->free($resql);
} else {
dol_print_error($db);
}
print "</table>";
print '</div>';
}
// End of page
llxFooter();
$db->close();

View File

@ -202,7 +202,7 @@ class Availabilities extends CommonObject
$this->db = $db;
if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid']) && !empty($this->fields['ref'])) {
if (!getDolGlobalString('MAIN_SHOW_TECHNICAL_ID') && isset($this->fields['rowid']) && !empty($this->fields['ref'])) {
$this->fields['rowid']['visible'] = 0;
}
if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) {
@ -749,7 +749,7 @@ class Availabilities extends CommonObject
$linkclose = '';
if (empty($notooltip)) {
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowAvailabilities");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
}
@ -997,11 +997,11 @@ class Availabilities extends CommonObject
global $langs, $conf;
$langs->load("agenda");
if (empty($conf->global->BOOKCAL_AVAILABILITIES_ADDON)) {
if (!getDolGlobalString('BOOKCAL_AVAILABILITIES_ADDON')) {
$conf->global->BOOKCAL_AVAILABILITIES_ADDON = 'mod_availabilities_standard';
}
if (!empty($conf->global->BOOKCAL_AVAILABILITIES_ADDON)) {
if (getDolGlobalString('BOOKCAL_AVAILABILITIES_ADDON')) {
$mybool = false;
$file = getDolGlobalString('BOOKCAL_AVAILABILITIES_ADDON') . ".php";
@ -1067,7 +1067,7 @@ class Availabilities extends CommonObject
if (!empty($this->model_pdf)) {
$modele = $this->model_pdf;
} elseif (!empty($conf->global->AVAILABILITIES_ADDON_PDF)) {
} elseif (getDolGlobalString('AVAILABILITIES_ADDON_PDF')) {
$modele = $conf->global->AVAILABILITIES_ADDON_PDF;
}
}

View File

@ -65,7 +65,7 @@ function availabilitiesPrepareHead($object)
$head[$h][0] = dol_buildpath('/bookcal/availabilities_note.php', 1).'?id='.$object->id;
$head[$h][1] = $langs->trans('Notes');
if ($nbNote > 0) {
$head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '<span class="badge marginleftonlyshort">'.$nbNote.'</span>' : '');
$head[$h][1] .= (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER') ? '<span class="badge marginleftonlyshort">'.$nbNote.'</span>' : '');
}
$head[$h][2] = 'note';
$h++;

View File

@ -46,6 +46,14 @@ function calendarPrepareHead($object)
$head[$h][2] = 'card';
$h++;
if ($object->status == Calendar::STATUS_VALIDATED) {
$head[$h][0] = dol_buildpath("/bookcal/booking_list.php", 1).'?id='.$object->id;
$head[$h][1] = $langs->trans("Bookings");
$head[$h][2] = 'booking';
$h++;
}
if ($showtabofpagecontact) {
$head[$h][0] = dol_buildpath("/bookcal/calendar_contact.php", 1).'?id='.$object->id;
$head[$h][1] = $langs->trans("Contacts");

View File

@ -83,7 +83,7 @@ function printDropdownBookmarksList()
}
$searchForm = '<!-- form with POST method by default, will be replaced with GET for external link by js -->'."\n";
$searchForm .= '<form id="top-menu-action-bookmark" name="actionbookmark" method="POST" action=""'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? ' onsubmit="return false"' : '').'>';
$searchForm .= '<form id="top-menu-action-bookmark" name="actionbookmark" method="POST" action=""'.(!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER') ? ' onsubmit="return false"' : '').'>';
$searchForm .= '<input type="hidden" name="token" value="'.newToken().'">';
// Url to go on create new bookmark page
@ -109,10 +109,10 @@ function printDropdownBookmarksList()
$sql .= " AND entity IN (".getEntity('bookmarks').")";
$sql .= " ORDER BY position";
if ($resql = $db->query($sql)) {
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
if (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$bookmarkList = '<div id="dropdown-bookmarks-list" >';
$i = 0;
while ((empty($conf->global->BOOKMARKS_SHOW_IN_MENU) || $i < $conf->global->BOOKMARKS_SHOW_IN_MENU) && $obj = $db->fetch_object($resql)) {
while ((!getDolGlobalString('BOOKMARKS_SHOW_IN_MENU') || $i < $conf->global->BOOKMARKS_SHOW_IN_MENU) && $obj = $db->fetch_object($resql)) {
$bookmarkList .= '<a class="dropdown-item bookmark-item'.(strpos($obj->url, 'http') === 0 ? ' bookmark-item-external' : '').'" id="bookmark-item-'.$obj->rowid.'" data-id="'.$obj->rowid.'" '.($obj->target == 1 ? ' target="_blank" rel="noopener noreferrer"' : '').' href="'.dol_escape_htmltag($obj->url).'" >';
$bookmarkList .= dol_escape_htmltag($obj->title);
$bookmarkList .= '</a>';
@ -138,7 +138,7 @@ function printDropdownBookmarksList()
}
}
$i = 0;
while ((empty($conf->global->BOOKMARKS_SHOW_IN_MENU) || $i < $conf->global->BOOKMARKS_SHOW_IN_MENU) && $obj = $db->fetch_object($resql)) {
while ((!getDolGlobalString('BOOKMARKS_SHOW_IN_MENU') || $i < $conf->global->BOOKMARKS_SHOW_IN_MENU) && $obj = $db->fetch_object($resql)) {
$searchForm .= '<option name="bookmark'.$obj->rowid.'" value="'.$obj->rowid.'" '.($obj->target == 1 ? ' target="_blank" rel="noopener noreferrer"' : '').' rel="'.dol_escape_htmltag($obj->url).'" >';
$searchForm .= dol_escape_htmltag($obj->title);
$searchForm .= '</option>';
@ -154,7 +154,7 @@ function printDropdownBookmarksList()
$searchForm .= '</form>';
// Generate the return string
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$html = $searchForm;
$html .= '<!-- script to open selected choice -->

View File

@ -318,7 +318,7 @@ class Bookmark extends CommonObject
$linkclose = '';
if (empty($notooltip)) {
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowBookmark");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
}

View File

@ -101,7 +101,7 @@ print '<td align="center" width="100">';
if ($conf->use_javascript_ajax) {
print ajax_constantonoff('CATEGORIE_RECURSIV_ADD');
} else {
if (empty($conf->global->CATEGORIE_RECURSIV_ADD)) {
if (!getDolGlobalString('CATEGORIE_RECURSIV_ADD')) {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_CATEGORIE_RECURSIV_ADD&token='.newToken().'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
} else {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_CATEGORIE_RECURSIV_ADD&token='.newToken().'">'.img_picto($langs->trans("Enabled"), 'on').'</a>';

View File

@ -461,7 +461,7 @@ class Categorie extends CommonObject
$sql .= " label,";
$sql .= " description,";
$sql .= " color,";
if (!empty($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER)) {
if (getDolGlobalString('CATEGORY_ASSIGNED_TO_A_CUSTOMER')) {
$sql .= "fk_soc,";
}
$sql .= " visible,";
@ -476,7 +476,7 @@ class Categorie extends CommonObject
$sql .= "'".$this->db->escape($this->label)."', ";
$sql .= "'".$this->db->escape($this->description)."', ";
$sql .= "'".$this->db->escape($this->color)."', ";
if (!empty($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER)) {
if (getDolGlobalString('CATEGORY_ASSIGNED_TO_A_CUSTOMER')) {
$sql .= ($this->socid > 0 ? $this->socid : 'null').", ";
}
$sql .= "'".$this->db->escape($this->visible)."', ";
@ -566,7 +566,7 @@ class Categorie extends CommonObject
$sql .= " description = '".$this->db->escape($this->description)."',";
$sql .= " ref_ext = '".$this->db->escape($this->ref_ext)."',";
$sql .= " color = '".$this->db->escape($this->color)."'";
if (!empty($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER)) {
if (getDolGlobalString('CATEGORY_ASSIGNED_TO_A_CUSTOMER')) {
$sql .= ", fk_soc = ".($this->socid > 0 ? $this->socid : 'null');
}
$sql .= ", visible = ".(int) $this->visible;
@ -735,7 +735,7 @@ class Categorie extends CommonObject
$sql .= " VALUES (".((int) $this->id).", ".((int) $obj->id).")";
if ($this->db->query($sql)) {
if (!empty($conf->global->CATEGORIE_RECURSIV_ADD)) {
if (getDolGlobalString('CATEGORIE_RECURSIV_ADD')) {
$sql = 'SELECT fk_parent FROM '.MAIN_DB_PREFIX.'categorie';
$sql .= " WHERE rowid = ".((int) $this->id);

View File

@ -159,7 +159,7 @@ $cate_arbo = $categstatic->get_full_arbo($typetext);
$fulltree = $cate_arbo;
// Load possible missing includes
if (!empty($conf->global->CATEGORY_SHOW_COUNTS)) {
if (getDolGlobalString('CATEGORY_SHOW_COUNTS')) {
if ($type == Categorie::TYPE_MEMBER) {
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
}
@ -185,7 +185,7 @@ foreach ($fulltree as $key => $val) {
$desc = dol_htmlcleanlastbr($val['description']);
$counter = '';
if (!empty($conf->global->CATEGORY_SHOW_COUNTS)) {
if (getDolGlobalString('CATEGORY_SHOW_COUNTS')) {
// we need only a count of the elements, so it is enough to consume only the id's from the database
$elements = $type == Categorie::TYPE_ACCOUNT
? $categstatic->getObjectsInCateg("account", 1) // Categorie::TYPE_ACCOUNT is "bank_account" instead of "account"

View File

@ -76,7 +76,7 @@ if ($reshook < 0) {
}
if (empty($reshook)) {
if (isset($_FILES['userfile']) && $_FILES['userfile']['size'] > 0 && GETPOST("sendit") && !empty($conf->global->MAIN_UPLOAD_DOC)) {
if (isset($_FILES['userfile']) && $_FILES['userfile']['size'] > 0 && GETPOST("sendit") && getDolGlobalString('MAIN_UPLOAD_DOC')) {
if ($object->id) {
$file = $_FILES['userfile'];
if (is_array($file['name']) && count($file['name']) > 0) {
@ -169,7 +169,7 @@ if ($object->id) {
print '<div class="tabsAction">'."\n";
if ($action != 'ajout_photo' && $user->hasRight('categorie', 'creer')) {
if (!empty($conf->global->MAIN_UPLOAD_DOC)) {
if (getDolGlobalString('MAIN_UPLOAD_DOC')) {
print '<a class="butAction hideonsmartphone" href="'.$_SERVER['PHP_SELF'].'?action=ajout_photo&amp;id='.$object->id.'&amp;type='.$type.'">';
print $langs->trans("AddPhoto").'</a>';
} else {
@ -183,7 +183,7 @@ if ($object->id) {
/*
* Ajouter une photo
*/
if ($action == 'ajout_photo' && $user->hasRight('categorie', 'creer') && !empty($conf->global->MAIN_UPLOAD_DOC)) {
if ($action == 'ajout_photo' && $user->hasRight('categorie', 'creer') && getDolGlobalString('MAIN_UPLOAD_DOC')) {
// Affiche formulaire upload
$formfile = new FormFile($db);
$formfile->form_attach_new_file($_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;type='.$type, $langs->trans("AddPhoto"), 1, '', $user->hasRight('categorie', 'creer'), 50, $object, '', false, '', 0);

View File

@ -293,7 +293,7 @@ if ($action == 'edit') {
print '<tr class="liste_titre"><td colspan="2">'.($s ? $s.' ' : '')." <b>".$langs->trans('Language_'.$key).":</b> ".'<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken().'&langtodelete='.$key.'&type='.$type.'">'.img_delete('', '').'</a></td></tr>';
print '<tr><td class="titlefield">'.$langs->trans('Label').'</td><td>'.$object->multilangs[$key]["label"].'</td></tr>';
print '<tr><td>'.$langs->trans('Description').'</td><td>'.$object->multilangs[$key]["description"].'</td></tr>';
if (!empty($conf->global->CATEGORY_USE_OTHER_FIELD_IN_TRANSLATION)) {
if (getDolGlobalString('CATEGORY_USE_OTHER_FIELD_IN_TRANSLATION')) {
print '<tr><td>'.$langs->trans('Other').' ('.$langs->trans("NotUsed").')</td><td>'.$object->multilangs[$key]["other"].'</td></tr>';
}
print '</table>';

View File

@ -144,11 +144,11 @@ if ($reshook < 0) {
}
$TRemindTypes = array();
if (!empty($conf->global->AGENDA_REMINDER_BROWSER)) {
$TRemindTypes['browser'] = array('label'=>$langs->trans('BrowserPush'), 'disabled'=>(empty($conf->global->AGENDA_REMINDER_BROWSER) ? 1 : 0));
if (getDolGlobalString('AGENDA_REMINDER_BROWSER')) {
$TRemindTypes['browser'] = array('label'=>$langs->trans('BrowserPush'), 'disabled'=>(!getDolGlobalString('AGENDA_REMINDER_BROWSER') ? 1 : 0));
}
if (!empty($conf->global->AGENDA_REMINDER_EMAIL)) {
$TRemindTypes['email'] = array('label'=>$langs->trans('EMail'), 'disabled'=>(empty($conf->global->AGENDA_REMINDER_EMAIL) ? 1 : 0));
if (getDolGlobalString('AGENDA_REMINDER_EMAIL')) {
$TRemindTypes['email'] = array('label'=>$langs->trans('EMail'), 'disabled'=>(!getDolGlobalString('AGENDA_REMINDER_EMAIL') ? 1 : 0));
}
$TDurationTypes = array('y'=>$langs->trans('Years'), 'm'=>$langs->trans('Month'), 'w'=>$langs->trans('Weeks'), 'd'=>$langs->trans('Days'), 'h'=>$langs->trans('Hours'), 'i'=>$langs->trans('Minutes'));
@ -335,7 +335,7 @@ if (empty($reshook) && $action == 'add') {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateEnd")), null, 'errors');
}
if (empty($conf->global->AGENDA_USE_EVENT_TYPE) && !GETPOST('label')) {
if (!getDolGlobalString('AGENDA_USE_EVENT_TYPE') && !GETPOST('label')) {
$error++; $donotclearsession = 1;
$action = 'create';
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Title")), null, 'errors');
@ -421,7 +421,7 @@ if (empty($reshook) && $action == 'add') {
}
}
if (!$error && !empty($conf->global->AGENDA_ENABLE_DONEBY)) {
if (!$error && getDolGlobalString('AGENDA_ENABLE_DONEBY')) {
if (GETPOST("doneby") > 0) {
$object->userdoneid = GETPOST("doneby", "int");
}
@ -856,7 +856,7 @@ if (empty($reshook) && $action == 'update') {
$object->transparency = $transparency; // We set transparency on event (even if we can also store it on each user, standard says this property is for event)
// TODO store also transparency on owner user
if (!empty($conf->global->AGENDA_ENABLE_DONEBY)) {
if (getDolGlobalString('AGENDA_ENABLE_DONEBY')) {
if (GETPOST("doneby")) {
$object->userdoneid = GETPOST("doneby", "int");
}
@ -884,7 +884,7 @@ if (empty($reshook) && $action == 'update') {
if (!$error) {
// check if an event resource is already in use
if (!empty($conf->global->RESOURCE_USED_IN_EVENT_CHECK) && $object->element == 'action') {
if (getDolGlobalString('RESOURCE_USED_IN_EVENT_CHECK') && $object->element == 'action') {
$eventDateStart = $object->datep;
$eventDateEnd = $object->datef;
@ -1062,7 +1062,7 @@ if (empty($reshook) && GETPOST('actionmove', 'alpha') == 'mupdate') {
if (!$error) {
// check if an event resource is already in use
if (!empty($conf->global->RESOURCE_USED_IN_EVENT_CHECK) && $object->element == 'action') {
if (getDolGlobalString('RESOURCE_USED_IN_EVENT_CHECK') && $object->element == 'action') {
$eventDateStart = $object->datep;
$eventDateEnd = $object->datef;
@ -1242,7 +1242,7 @@ if ($action == 'create') {
if ($backtopage) {
print '<input type="hidden" name="backtopage" value="'.($backtopage != '1' ? $backtopage : '').'">';
}
if (empty($conf->global->AGENDA_USE_EVENT_TYPE)) {
if (!getDolGlobalString('AGENDA_USE_EVENT_TYPE')) {
print '<input type="hidden" name="actioncode" value="'.dol_getIdFromCode($db, 'AC_OTH', 'c_actioncomm').'">';
}
@ -1257,7 +1257,7 @@ if ($action == 'create') {
print '<table class="border centpercent">';
// Type of event
if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) {
if (getDolGlobalString('AGENDA_USE_EVENT_TYPE')) {
print '<tr><td class="titlefieldcreate"><span class="fieldrequired">'.$langs->trans("Type").'</span></b></td><td>';
$default = getDolGlobalString('AGENDA_USE_EVENT_TYPE_DEFAULT', 'AC_RDV');
print img_picto($langs->trans("ActionType"), 'square', 'class="fawidth30 inline-block" style="color: #ddd;"');
@ -1267,7 +1267,7 @@ if ($action == 'create') {
}
// Title
print '<tr><td'.(empty($conf->global->AGENDA_USE_EVENT_TYPE) ? ' class="fieldrequired titlefieldcreate"' : '').'>'.$langs->trans("Label").'</td><td><input type="text" id="label" name="label" class="soixantepercent" value="'.GETPOST('label').'"></td></tr>';
print '<tr><td'.(!getDolGlobalString('AGENDA_USE_EVENT_TYPE') ? ' class="fieldrequired titlefieldcreate"' : '').'>'.$langs->trans("Label").'</td><td><input type="text" id="label" name="label" class="soixantepercent" value="'.GETPOST('label').'"></td></tr>';
// Full day
print '<tr><td><span class="fieldrequired">'.$langs->trans("Date").'</span></td><td class="valignmiddle height30 small"><input type="checkbox" id="fullday" name="fullday" '.(GETPOST('fullday') ? ' checked' : '').'><label for="fullday">'.$langs->trans("EventOnFullDay").'</label>';
@ -1369,8 +1369,8 @@ if ($action == 'create') {
$datef = dol_stringtotime(GETPOST('datef', 'int', 1), 'tzuserrel');
}
if (empty($datef) && !empty($datep)) {
if (GETPOST("actioncode", 'aZ09') == 'AC_RDV' || empty($conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT)) {
$datef = dol_time_plus_duree($datep, (empty($conf->global->AGENDA_AUTOSET_END_DATE_WITH_DELTA_HOURS) ? 1 : $conf->global->AGENDA_AUTOSET_END_DATE_WITH_DELTA_HOURS), 'h');
if (GETPOST("actioncode", 'aZ09') == 'AC_RDV' || !getDolGlobalString('AGENDA_USE_EVENT_TYPE_DEFAULT')) {
$datef = dol_time_plus_duree($datep, (!getDolGlobalString('AGENDA_AUTOSET_END_DATE_WITH_DELTA_HOURS') ? 1 : $conf->global->AGENDA_AUTOSET_END_DATE_WITH_DELTA_HOURS), 'h');
}
}
@ -1421,14 +1421,14 @@ if ($action == 'create') {
print '</td></tr>';
// Done by
if (!empty($conf->global->AGENDA_ENABLE_DONEBY)) {
if (getDolGlobalString('AGENDA_ENABLE_DONEBY')) {
print '<tr><td class="nowrap">'.$langs->trans("ActionDoneBy").'</td><td>';
print $form->select_dolusers(GETPOSTISSET("doneby") ? GETPOST("doneby", 'int') : (!empty($object->userdoneid) && $percent == 100 ? $object->userdoneid : 0), 'doneby', 1);
print '</td></tr>';
}
// Location
if (empty($conf->global->AGENDA_DISABLE_LOCATION)) {
if (!getDolGlobalString('AGENDA_DISABLE_LOCATION')) {
print '<tr><td>'.$langs->trans("Location").'</td><td><input type="text" name="location" class="minwidth300 maxwidth150onsmartphone" value="'.(GETPOST('location') ? GETPOST('location') : $object->location).'"></td></tr>';
}
@ -1520,7 +1520,7 @@ if ($action == 'create') {
}
if ($origin=='contact') $preselectedids[GETPOST('originid', 'int')] = GETPOST('originid', 'int');
print img_picto('', 'contact', 'class="paddingrightonly"');
print $form->selectcontacts(empty($conf->global->MAIN_ACTIONCOM_CAN_ADD_ANY_CONTACT) ? GETPOST('socid', 'int') : 0, $preselectedids, 'socpeopleassigned[]', 1, '', '', 0, 'minwidth300 widthcentpercentminusxx maxwidth500', false, 0, array(), false, 'multiple', 'contactid');
print $form->selectcontacts(!getDolGlobalString('MAIN_ACTIONCOM_CAN_ADD_ANY_CONTACT') ? GETPOST('socid', 'int') : 0, $preselectedids, 'socpeopleassigned[]', 1, '', '', 0, 'minwidth300 widthcentpercentminusxx maxwidth500', false, 0, array(), false, 'multiple', 'contactid');
print '</td></tr>';
}
@ -1597,7 +1597,7 @@ if ($action == 'create') {
}
// Priority
if (!empty($conf->global->AGENDA_SUPPORT_PRIORITY_IN_EVENTS)) {
if (getDolGlobalString('AGENDA_SUPPORT_PRIORITY_IN_EVENTS')) {
print '<tr><td class="titlefieldcreate nowrap">'.$langs->trans("Priority").'</td><td colspan="3">';
print '<input type="text" name="priority" value="'.(GETPOSTISSET('priority') ? GETPOST('priority', 'int') : ($object->priority ? $object->priority : '')).'" size="5">';
print '</td></tr>';
@ -1665,17 +1665,23 @@ if ($action == 'create') {
$("#selectremindertype").select2();
$("#select_offsetunittype_duration").select2("destroy");
$("#select_offsetunittype_duration").select2();
selectremindertype();
});
$("#selectremindertype").change(function(){
console.log("Change on selectremindertype");
selectremindertype();
});
function selectremindertype() {
console.log("Call selectremindertype");
var selected_option = $("#selectremindertype option:selected").val();
if(selected_option == "email") {
$("#select_actioncommsendmodel_mail").closest("tr").show();
} else {
$("#select_actioncommsendmodel_mail").closest("tr").hide();
}
});
}
})';
print '</script>'."\n";
}
@ -1800,7 +1806,7 @@ if ($id > 0) {
if ($backtopage) {
print '<input type="hidden" name="backtopage" value="'.($backtopage != '1' ? $backtopage : '').'">';
}
if (empty($conf->global->AGENDA_USE_EVENT_TYPE) && ! preg_match('/^TICKET_MSG_PRIVATE/', $object->code)) {
if (!getDolGlobalString('AGENDA_USE_EVENT_TYPE') && ! preg_match('/^TICKET_MSG_PRIVATE/', $object->code)) {
print '<input type="hidden" name="actioncode" value="'.$object->type_code.'">';
}
@ -1812,7 +1818,7 @@ if ($id > 0) {
print '<tr><td class="titlefieldcreate">'.$langs->trans("Ref").'</td><td colspan="3">'.$object->id.'</td></tr>';
// Type of event
if (!empty($conf->global->AGENDA_USE_EVENT_TYPE) && $object->elementtype != "ticket") {
if (getDolGlobalString('AGENDA_USE_EVENT_TYPE') && $object->elementtype != "ticket") {
print '<tr><td class="fieldrequired">'.$langs->trans("Type").'</td><td colspan="3">';
if ($object->type_code != 'AC_OTH_AUTO') {
print img_picto($langs->trans("ActionType"), 'square', 'class="fawidth30 inline-block" style="color: #ddd;"');
@ -1833,7 +1839,7 @@ if ($id > 0) {
}
// Title
print '<tr><td'.(empty($conf->global->AGENDA_USE_EVENT_TYPE) ? ' class="fieldrequired titlefieldcreate"' : '').'>'.$langs->trans("Title").'</td><td colspan="3"><input type="text" name="label" class="soixantepercent" value="'.$object->label.'"></td></tr>';
print '<tr><td'.(!getDolGlobalString('AGENDA_USE_EVENT_TYPE') ? ' class="fieldrequired titlefieldcreate"' : '').'>'.$langs->trans("Title").'</td><td colspan="3"><input type="text" name="label" class="soixantepercent" value="'.$object->label.'"></td></tr>';
// Full day event
print '<tr><td><span class="fieldrequired">'.$langs->trans("Date").'</span></td><td colspan="3" class="valignmiddle height30 small"><input type="checkbox" id="fullday" name="fullday" '.($object->fulldayevent ? ' checked' : '').'>';
@ -1970,14 +1976,14 @@ if ($id > 0) {
print '</td></tr>';
// Realised by
if (!empty($conf->global->AGENDA_ENABLE_DONEBY)) {
if (getDolGlobalString('AGENDA_ENABLE_DONEBY')) {
print '<tr><td class="nowrap">'.$langs->trans("ActionDoneBy").'</td><td colspan="3">';
print $form->select_dolusers($object->userdoneid > 0 ? $object->userdoneid : -1, 'doneby', 1);
print '</td></tr>';
}
// Location
if (empty($conf->global->AGENDA_DISABLE_LOCATION)) {
if (!getDolGlobalString('AGENDA_DISABLE_LOCATION')) {
print '<tr><td>'.$langs->trans("Location").'</td><td colspan="3"><input type="text" name="location" class="minwidth300 maxwidth150onsmartphone" value="'.$object->location.'"></td></tr>';
}
@ -2025,7 +2031,7 @@ if ($id > 0) {
// related contact
print '<tr><td>'.$langs->trans("ActionOnContact").'</td><td>';
print '<div class="maxwidth200onsmartphone">';
print img_picto('', 'contact', 'class="paddingrightonly"').$form->selectcontacts(empty($conf->global->MAIN_ACTIONCOM_CAN_ADD_ANY_CONTACT) ? $object->socid : 0, array_keys($object->socpeopleassigned), 'socpeopleassigned[]', 1, '', '', 1, 'minwidth300 widthcentpercentminusx', false, 0, 0, array(), 'multiple', 'contactid');
print img_picto('', 'contact', 'class="paddingrightonly"').$form->selectcontacts(!getDolGlobalString('MAIN_ACTIONCOM_CAN_ADD_ANY_CONTACT') ? $object->socid : 0, array_keys($object->socpeopleassigned), 'socpeopleassigned[]', 1, '', '', 1, 'minwidth300 widthcentpercentminusx', false, 0, 0, array(), 'multiple', 'contactid');
print '</div>';
print '</td>';
print '</tr>';
@ -2045,7 +2051,7 @@ if ($id > 0) {
}
// Priority
if (!empty($conf->global->AGENDA_SUPPORT_PRIORITY_IN_EVENTS)) {
if (getDolGlobalString('AGENDA_SUPPORT_PRIORITY_IN_EVENTS')) {
print '<tr><td class="titlefieldcreate nowrap">'.$langs->trans("Priority").'</td><td>';
print '<input type="text" name="priority" value="'.($object->priority ? $object->priority : '').'" size="5">';
print '</td></tr>';
@ -2295,7 +2301,7 @@ if ($id > 0) {
print '<table class="border tableforfield" width="100%">';
// Type
if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) {
if (getDolGlobalString('AGENDA_USE_EVENT_TYPE')) {
print '<tr><td class="titlefield">'.$langs->trans("Type").'</td><td>';
print $object->getTypePicto();
print $langs->trans("Action".$object->type_code);
@ -2311,7 +2317,7 @@ if ($id > 0) {
}
$rowspan = 4;
if (empty($conf->global->AGENDA_DISABLE_LOCATION)) {
if (!getDolGlobalString('AGENDA_DISABLE_LOCATION')) {
$rowspan++;
}
@ -2347,7 +2353,7 @@ if ($id > 0) {
print '</td></tr>';
// Location
if (empty($conf->global->AGENDA_DISABLE_LOCATION)) {
if (!getDolGlobalString('AGENDA_DISABLE_LOCATION')) {
print '<tr><td>'.$langs->trans("Location").'</td><td>'.$object->location.'</td></tr>';
}
@ -2395,7 +2401,7 @@ if ($id > 0) {
print ' </td></tr>';
// Done by
if (!empty($conf->global->AGENDA_ENABLE_DONEBY)) {
if (getDolGlobalString('AGENDA_ENABLE_DONEBY')) {
print '<tr><td class="nowrap">'.$langs->trans("ActionDoneBy").'</td><td>';
if ($object->userdoneid > 0) {
$tmpuser = new User($db);
@ -2504,7 +2510,7 @@ if ($id > 0) {
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
// Reminders
if (!empty($conf->global->AGENDA_REMINDER_EMAIL) || !empty($conf->global->AGENDA_REMINDER_BROWSER)) {
if (getDolGlobalString('AGENDA_REMINDER_EMAIL') || getDolGlobalString('AGENDA_REMINDER_BROWSER')) {
$filteruserid = $user->id;
if ($user->hasRight('agenda', 'allactions', 'read')) {
$filteruserid = 0;
@ -2584,7 +2590,7 @@ if ($id > 0) {
print '</div>';
if ($action != 'edit') {
if (empty($conf->global->AGENDA_DISABLE_BUILDDOC)) {
if (!getDolGlobalString('AGENDA_DISABLE_BUILDDOC')) {
print '<div class="clearboth"></div><div class="fichecenter"><div class="fichehalfleft">';
print '<a name="builddoc"></a>'; // ancre

View File

@ -291,7 +291,7 @@ class ActionComm extends CommonObject
public $fk_element; // Id of record
/**
* @var int Id of record alternative for API
* @var int Id of linked object, alternative for API or other
*/
public $elementid;
@ -435,7 +435,7 @@ class ActionComm extends CommonObject
// Check parameters
if (!isset($this->userownerid) || (string) $this->userownerid === '') { // $this->userownerid may be 0 (anonymous event) or > 0
dol_syslog("You tried to create an event but mandatory property ownerid was not defined", LOG_WARNING);
dol_syslog("You tried to create an event but mandatory property userownerid was empty (you can define it to 0 for anonymous event)", LOG_WARNING);
$this->errors[] = 'ErrorActionCommPropertyUserowneridNotDefined';
return -1;
}
@ -481,6 +481,9 @@ class ActionComm extends CommonObject
if ($this->elementtype == 'contrat') {
$this->elementtype = 'contract';
}
if (empty($this->fk_element) && !empty($this->elementid)) {
$this->fk_element = $this->elementid;
}
if (!is_array($this->userassigned) && !empty($this->userassigned)) { // For backward compatibility when userassigned was an int instead of an array
$tmpid = (int) $this->userassigned;
@ -1597,7 +1600,7 @@ class ActionComm extends CommonObject
$langs->load("commercial");
$labeltype = ($langs->transnoentities("Action".$this->type_code) != "Action".$this->type_code) ? $langs->transnoentities("Action".$this->type_code) : $this->type_label;
}
if (empty($conf->global->AGENDA_USE_EVENT_TYPE)) {
if (!getDolGlobalString('AGENDA_USE_EVENT_TYPE')) {
if ($this->type_code != 'AC_OTH_AUTO') {
$labeltype = $langs->trans('ActionAC_MANUAL');
}
@ -1701,7 +1704,7 @@ class ActionComm extends CommonObject
$langs->load("commercial");
$labeltype = ($langs->transnoentities("Action".$this->type_code) != "Action".$this->type_code) ? $langs->transnoentities("Action".$this->type_code) : $this->type_label;
}
if (empty($conf->global->AGENDA_USE_EVENT_TYPE)) {
if (!getDolGlobalString('AGENDA_USE_EVENT_TYPE')) {
if ($this->type_code != 'AC_OTH_AUTO') {
$labeltype = $langs->trans('ActionAC_MANUAL');
}
@ -1762,7 +1765,7 @@ class ActionComm extends CommonObject
//if (!empty($conf->global->AGENDA_USE_EVENT_TYPE) && $this->type_color)
// $linkclose = ' style="background-color:#'.$this->type_color.'"';
if (empty($notooltip)) {
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowAction");
$linkclose .= ' alt="'.dol_escape_htmltag($tooltip, 1).'"';
}
@ -1802,12 +1805,12 @@ class ActionComm extends CommonObject
}
if ($withpicto == 2) {
if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) {
if (getDolGlobalString('AGENDA_USE_EVENT_TYPE')) {
$label = $labeltype;
}
$labelshort = '';
} else {
if (!empty($conf->global->AGENDA_USE_EVENT_TYPE) && empty($label)) {
if (getDolGlobalString('AGENDA_USE_EVENT_TYPE') && empty($label)) {
$label = $labeltype;
}
if ($maxlength < 0) {
@ -1818,7 +1821,7 @@ class ActionComm extends CommonObject
}
if ($withpicto) {
if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) { // Add code into ()
if (getDolGlobalString('AGENDA_USE_EVENT_TYPE')) { // Add code into ()
if ($labeltype) {
$label .= (preg_match('/'.preg_quote($labeltype, '/').'/', $label) ? '' : ' ('.$langs->transnoentities("Action".$this->type_code).')');
}
@ -1857,7 +1860,7 @@ class ActionComm extends CommonObject
global $conf;
$imgpicto = '';
if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) {
if (getDolGlobalString('AGENDA_USE_EVENT_TYPE')) {
$color = '';
if ($this->type_color) {
$color = 'style="color: #'.$this->type_color.' !important;"';
@ -2122,11 +2125,11 @@ class ActionComm extends CommonObject
$event['uid'] = 'dolibarragenda-'.$this->db->database_name.'-'.$obj->id."@".$_SERVER["SERVER_NAME"];
$event['type'] = $type;
$datestart = $this->db->jdate($obj->datep) - (empty($conf->global->AGENDA_EXPORT_FIX_TZ) ? 0 : ($conf->global->AGENDA_EXPORT_FIX_TZ * 3600));
$datestart = $this->db->jdate($obj->datep) - (!getDolGlobalString('AGENDA_EXPORT_FIX_TZ') ? 0 : ($conf->global->AGENDA_EXPORT_FIX_TZ * 3600));
// fix for -> Warning: A non-numeric value encountered
if (is_numeric($this->db->jdate($obj->datep2))) {
$dateend = $this->db->jdate($obj->datep2) - (empty($conf->global->AGENDA_EXPORT_FIX_TZ) ? 0 : ($conf->global->AGENDA_EXPORT_FIX_TZ * 3600));
$dateend = $this->db->jdate($obj->datep2) - (!getDolGlobalString('AGENDA_EXPORT_FIX_TZ') ? 0 : ($conf->global->AGENDA_EXPORT_FIX_TZ * 3600));
} else {
// use start date as fall-back to avoid pb with empty end date on ICS readers
$dateend = $datestart;
@ -2152,8 +2155,8 @@ class ActionComm extends CommonObject
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
$url = $urlwithroot.'/comm/action/card.php?id='.$obj->id;
$event['url'] = $url;
$event['created'] = $this->db->jdate($obj->datec) - (empty($conf->global->AGENDA_EXPORT_FIX_TZ) ? 0 : ($conf->global->AGENDA_EXPORT_FIX_TZ * 3600));
$event['modified'] = $this->db->jdate($obj->datem) - (empty($conf->global->AGENDA_EXPORT_FIX_TZ) ? 0 : ($conf->global->AGENDA_EXPORT_FIX_TZ * 3600));
$event['created'] = $this->db->jdate($obj->datec) - (!getDolGlobalString('AGENDA_EXPORT_FIX_TZ') ? 0 : ($conf->global->AGENDA_EXPORT_FIX_TZ * 3600));
$event['modified'] = $this->db->jdate($obj->datem) - (!getDolGlobalString('AGENDA_EXPORT_FIX_TZ') ? 0 : ($conf->global->AGENDA_EXPORT_FIX_TZ * 3600));
$event['num_vote'] = $this->num_vote;
$event['event_paid'] = $this->event_paid;
$event['status'] = $this->status;
@ -2225,7 +2228,7 @@ class ActionComm extends CommonObject
$timestampEnd = dol_stringtotime($obj->date_end." 23:59:59", 0);
}
if (!empty($conf->global->AGENDA_EXPORT_FIX_TZ)) {
if (getDolGlobalString('AGENDA_EXPORT_FIX_TZ')) {
$timestampStart = $timestampStart - ($conf->global->AGENDA_EXPORT_FIX_TZ * 3600);
$timestampEnd = $timestampEnd - ($conf->global->AGENDA_EXPORT_FIX_TZ * 3600);
}
@ -2440,10 +2443,10 @@ class ActionComm extends CommonObject
if ($fk_user > 0) {
$sql .= " AND fk_user = ".((int) $fk_user);
}
if (empty($conf->global->AGENDA_REMINDER_EMAIL)) {
if (!getDolGlobalString('AGENDA_REMINDER_EMAIL')) {
$sql .= " AND typeremind != 'email'";
}
if (empty($conf->global->AGENDA_REMINDER_BROWSER)) {
if (!getDolGlobalString('AGENDA_REMINDER_BROWSER')) {
$sql .= " AND typeremind != 'browser'";
}
@ -2493,7 +2496,7 @@ class ActionComm extends CommonObject
$this->output = $langs->trans('ModuleNotEnabled', $langs->transnoentitiesnoconv("Agenda"));
return 0;
}
if (empty($conf->global->AGENDA_REMINDER_EMAIL)) {
if (!getDolGlobalString('AGENDA_REMINDER_EMAIL')) {
$langs->load("agenda");
$this->output = $langs->trans('EventRemindersByEmailNotEnabled', $langs->transnoentitiesnoconv("Agenda"));
return 0;
@ -2502,7 +2505,7 @@ class ActionComm extends CommonObject
$now = dol_now();
$actionCommReminder = new ActionCommReminder($this->db);
dol_syslog(__METHOD__, LOG_DEBUG);
dol_syslog(__METHOD__." start", LOG_INFO);
$this->db->begin();
@ -2632,10 +2635,16 @@ class ActionComm extends CommonObject
if (!$error) {
$this->output = 'Nb of emails sent : '.$nbMailSend;
$this->db->commit();
dol_syslog(__METHOD__." end - ".$this->output, LOG_INFO);
return 0;
} else {
$this->db->commit(); // We commit also on error, to have the error message recorded.
$this->error = 'Nb of emails sent : '.$nbMailSend.', '.(!empty($errorsMsg)) ? join(', ', $errorsMsg) : $error;
dol_syslog(__METHOD__." end - ".$this->error, LOG_INFO);
return $error;
}
}

View File

@ -154,7 +154,7 @@ class ActionCommReminder extends CommonObject
$this->db = $db;
if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID)) {
if (!getDolGlobalString('MAIN_SHOW_TECHNICAL_ID')) {
$this->fields['rowid']['visible'] = 0;
}
if (!isModEnabled('multicompany')) {

Some files were not shown because too many files have changed in this diff Show More