diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php
index 4776907192f..23ae5d8b032 100644
--- a/htdocs/core/lib/project.lib.php
+++ b/htdocs/core/lib/project.lib.php
@@ -2743,6 +2743,7 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks
}
print '
';
+ $alttext = '';
if ($objp->opp_percent && $objp->opp_amount) {
$opp_weighted_amount = $objp->opp_percent * $objp->opp_amount / 100;
$alttext = $langs->trans("OpportunityWeightedAmount").' '.price($opp_weighted_amount, 0, '', 1, -1, 0, $conf->currency);
diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php
index cf7cc5558a4..a8f684acf22 100644
--- a/htdocs/projet/class/project.class.php
+++ b/htdocs/projet/class/project.class.php
@@ -2203,6 +2203,9 @@ class Project extends CommonObject
$this->monthWorkLoadPerTask[$week_number][$obj->fk_element] = $obj->element_duration;
} else {
$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;
}
$weekalreadyfound[$week_number] = 1;
diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php
index fbf8fdc1e45..264462594f2 100644
--- a/htdocs/projet/tasks/task.php
+++ b/htdocs/projet/tasks/task.php
@@ -72,7 +72,10 @@ if ($reshook < 0) {
}
if ($id > 0 || $ref) {
- $object->fetch($id, $ref);
+ $ret = $object->fetch($id, $ref);
+ if ($ret > 0) {
+ $projectstatic->fetch($object->fk_project);
+ }
}
// Security check
@@ -235,7 +238,7 @@ if ($action == 'remove_file' && $user->hasRight('projet', 'creer')) {
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$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'));
$ret = dol_delete_file($file);
@@ -254,7 +257,6 @@ $form = new Form($db);
$formother = new FormOther($db);
$formfile = new FormFile($db);
$formproject = new FormProjets($db);
-$result = $projectstatic->fetch($object->fk_project);
$title = $object->ref;
if (!empty($withproject)) {
@@ -739,7 +741,7 @@ if ($id > 0 || !empty($ref)) {
/*
* 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);
$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
$genallowed = ($user->hasRight('projet', 'lire'));
|