2
0
forked from Wavyzz/dolibarr

Merge branch '20.0' of git@github.com:Dolibarr/dolibarr.git into 21.0

This commit is contained in:
Laurent Destailleur (aka Eldy)
2025-01-28 12:40:20 +01:00
7 changed files with 15 additions and 7 deletions

View File

@@ -682,7 +682,7 @@ class Translate
} }
} }
$str = str_replace('%)', '__percent_parenthesis__', $str); $str = preg_replace('/([^%])%([^0sd])/', '__percent_parenthesis__', $str);
if (strpos($key, 'Format') !== 0) { if (strpos($key, 'Format') !== 0) {
try { try {

View File

@@ -1270,7 +1270,7 @@ function activateModule($value, $withdeps = 1, $noconfverification = 0)
if ($activateerr) { if ($activateerr) {
$ret['errors'][] = $activateerr; $ret['errors'][] = $activateerr;
} }
$ret['errors'][] = $langs->trans('activateModuleDependNotSatisfied', $objMod->name, $modulestring); $ret['errors'][] = $langs->trans('activateModuleDependNotSatisfied', $objMod->name, $modulestring, $objMod->name).'<br>'.$langs->trans('activateModuleDependNotSatisfied2', $modulestring, $objMod->name);
} }
} }
} }

View File

@@ -2797,6 +2797,7 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks
} }
print '<td class="right">'; print '<td class="right">';
$alttext = '';
if ($objp->opp_percent && $objp->opp_amount) { if ($objp->opp_percent && $objp->opp_amount) {
$opp_weighted_amount = $objp->opp_percent * $objp->opp_amount / 100; $opp_weighted_amount = $objp->opp_percent * $objp->opp_amount / 100;
$alttext = $langs->trans("OpportunityWeightedAmount").' '.price($opp_weighted_amount, 0, '', 1, -1, 0, $conf->currency); $alttext = $langs->trans("OpportunityWeightedAmount").' '.price($opp_weighted_amount, 0, '', 1, -1, 0, $conf->currency);

View File

@@ -2114,7 +2114,8 @@ AddSubstitutions=Add keys substitutions
DetectionNotPossible=Detection not possible DetectionNotPossible=Detection not possible
UrlToGetKeyToUseAPIs=Url to get token to use API (once token has been received it is saved in database user table and must be provided on each API call) UrlToGetKeyToUseAPIs=Url to get token to use API (once token has been received it is saved in database user table and must be provided on each API call)
ListOfAvailableAPIs=List of available APIs ListOfAvailableAPIs=List of available APIs
activateModuleDependNotSatisfied=Module "%s" depends on module "%s", that is missing, so module "%1$s" may not work correctly. Please install module "%2$s" or disable module "%1$s" if you want to be safe from any surprise activateModuleDependNotSatisfied=Module "%s" depends on module "%s", that is missing, so module "%s" may not work correctly.
activateModuleDependNotSatisfied2=Please install module "%s" or disable module "%s" if you want to be safe from any surprise.
CommandIsNotInsideAllowedCommands=The command you are trying to run is not in the list of allowed commands defined in parameter <strong>$dolibarr_main_restrict_os_commands</strong> in the <strong>conf.php</strong> file. CommandIsNotInsideAllowedCommands=The command you are trying to run is not in the list of allowed commands defined in parameter <strong>$dolibarr_main_restrict_os_commands</strong> in the <strong>conf.php</strong> file.
LandingPage=Landing page LandingPage=Landing page
SamePriceAlsoForSharedCompanies=If you use a multicompany module, with the choice "Single price", the price will also be the same for all companies if products are shared between environments SamePriceAlsoForSharedCompanies=If you use a multicompany module, with the choice "Single price", the price will also be the same for all companies if products are shared between environments

View File

@@ -2250,6 +2250,9 @@ class Project extends CommonObject
$this->monthWorkLoadPerTask[$week_number][$obj->fk_element] = $obj->element_duration; $this->monthWorkLoadPerTask[$week_number][$obj->fk_element] = $obj->element_duration;
} else { } else {
$this->monthWorkLoad[$week_number] += $obj->element_duration; $this->monthWorkLoad[$week_number] += $obj->element_duration;
if (!isset($this->monthWorkLoadPerTask[$week_number][$obj->fk_element])) {
$this->monthWorkLoadPerTask[$week_number][$obj->fk_element] = 0;
}
$this->monthWorkLoadPerTask[$week_number][$obj->fk_element] += $obj->element_duration; $this->monthWorkLoadPerTask[$week_number][$obj->fk_element] += $obj->element_duration;
} }
$weekalreadyfound[$week_number] = 1; $weekalreadyfound[$week_number] = 1;

View File

@@ -81,7 +81,10 @@ if ($reshook < 0) {
} }
if ($id > 0 || $ref) { if ($id > 0 || $ref) {
$object->fetch($id, $ref); $ret = $object->fetch($id, $ref);
if ($ret > 0) {
$projectstatic->fetch($object->fk_project);
}
} }
// Security check // Security check
@@ -244,7 +247,7 @@ if ($action == 'remove_file' && $user->hasRight('projet', 'creer')) {
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$langs->load("other"); $langs->load("other");
$upload_dir = $conf->project->dir_output; $upload_dir = $conf->project->dir_output."/".dol_sanitizeFileName($projectstatic->ref)."/".dol_sanitizeFileName($object->ref);
$file = $upload_dir.'/'.dol_sanitizeFileName(GETPOST('file')); $file = $upload_dir.'/'.dol_sanitizeFileName(GETPOST('file'));
$ret = dol_delete_file($file); $ret = dol_delete_file($file);
@@ -263,7 +266,6 @@ $form = new Form($db);
$formother = new FormOther($db); $formother = new FormOther($db);
$formfile = new FormFile($db); $formfile = new FormFile($db);
$formproject = new FormProjets($db); $formproject = new FormProjets($db);
$result = $projectstatic->fetch($object->fk_project);
$title = $object->ref; $title = $object->ref;
if (!empty($withproject)) { if (!empty($withproject)) {
@@ -758,7 +760,7 @@ if ($id > 0 || !empty($ref)) {
/* /*
* Generated documents * Generated documents
*/ */
$filename = dol_sanitizeFileName($projectstatic->ref)."/".dol_sanitizeFileName($object->ref); $filename = '';
$filedir = $conf->project->dir_output."/".dol_sanitizeFileName($projectstatic->ref)."/".dol_sanitizeFileName($object->ref); $filedir = $conf->project->dir_output."/".dol_sanitizeFileName($projectstatic->ref)."/".dol_sanitizeFileName($object->ref);
$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id; $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
$genallowed = ($user->hasRight('projet', 'lire')); $genallowed = ($user->hasRight('projet', 'lire'));

View File

@@ -77,6 +77,7 @@ $cancel = GETPOST('cancel', 'alpha');
$backtopage = GETPOST('backtopage', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha');
$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma') ? GETPOST('sortfield', 'aZ09comma') : "a.datep"; $sortfield = GETPOST('sortfield', 'aZ09comma') ? GETPOST('sortfield', 'aZ09comma') : "a.datep";
$sortorder = GETPOST('sortorder', 'aZ09comma') ? GETPOST('sortorder', 'aZ09comma') : "desc"; $sortorder = GETPOST('sortorder', 'aZ09comma') ? GETPOST('sortorder', 'aZ09comma') : "desc";
$search_rowid = GETPOST('search_rowid'); $search_rowid = GETPOST('search_rowid');