forked from Wavyzz/dolibarr
Merge pull request #32807 from hregis/fix_20_cannot_delete_files
FIX can not delete files in task card
This commit is contained in:
@@ -2743,6 +2743,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);
|
||||||
|
|||||||
@@ -2203,6 +2203,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;
|
||||||
|
|||||||
@@ -72,7 +72,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
|
||||||
@@ -235,7 +238,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);
|
||||||
@@ -254,7 +257,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)) {
|
||||||
@@ -739,7 +741,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'));
|
||||||
|
|||||||
Reference in New Issue
Block a user