Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into 17.0
This commit is contained in:
commit
53032fd6ed
@ -2856,7 +2856,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
|
|||||||
}
|
}
|
||||||
$original_file = $conf->commande->multidir_output[$entity].'/'.$original_file;
|
$original_file = $conf->commande->multidir_output[$entity].'/'.$original_file;
|
||||||
$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."commande WHERE ref='".$db->escape($refname)."' AND entity IN (".getEntity('order').")";
|
$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."commande WHERE ref='".$db->escape($refname)."' AND entity IN (".getEntity('order').")";
|
||||||
} elseif ($modulepart == 'project' && !empty($conf->project->dir_output)) {
|
} elseif ($modulepart == 'project' && !empty($conf->project->multidir_output[$entity])) {
|
||||||
// Wrapping pour les projets
|
// Wrapping pour les projets
|
||||||
if ($fuser->hasRight('projet', $lire) || preg_match('/^specimen/i', $original_file)) {
|
if ($fuser->hasRight('projet', $lire) || preg_match('/^specimen/i', $original_file)) {
|
||||||
$accessallowed = 1;
|
$accessallowed = 1;
|
||||||
@ -2868,9 +2868,9 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
|
|||||||
$accessallowed = checkUserAccessToObject($user, array('projet'), $tmpproject->id, 'projet&project', '', '', 'rowid', '');
|
$accessallowed = checkUserAccessToObject($user, array('projet'), $tmpproject->id, 'projet&project', '', '', 'rowid', '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$original_file = $conf->project->dir_output.'/'.$original_file;
|
$original_file = $conf->project->multidir_output[$entity].'/'.$original_file;
|
||||||
$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."projet WHERE ref='".$db->escape($refname)."' AND entity IN (".getEntity('project').")";
|
$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."projet WHERE ref='".$db->escape($refname)."' AND entity IN (".getEntity('project').")";
|
||||||
} elseif ($modulepart == 'project_task' && !empty($conf->project->dir_output)) {
|
} elseif ($modulepart == 'project_task' && !empty($conf->project->multidir_output[$entity])) {
|
||||||
if ($fuser->hasRight('projet', $lire) || preg_match('/^specimen/i', $original_file)) {
|
if ($fuser->hasRight('projet', $lire) || preg_match('/^specimen/i', $original_file)) {
|
||||||
$accessallowed = 1;
|
$accessallowed = 1;
|
||||||
// If we known $id of project, call checkUserAccessToObject to check permission on properties and contact of project
|
// If we known $id of project, call checkUserAccessToObject to check permission on properties and contact of project
|
||||||
@ -2881,7 +2881,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
|
|||||||
$accessallowed = checkUserAccessToObject($user, array('projet_task'), $tmptask->id, 'projet_task&project', '', '', 'rowid', '');
|
$accessallowed = checkUserAccessToObject($user, array('projet_task'), $tmptask->id, 'projet_task&project', '', '', 'rowid', '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$original_file = $conf->project->dir_output.'/'.$original_file;
|
$original_file = $conf->project->multidir_output[$entity].'/'.$original_file;
|
||||||
$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."projet WHERE ref='".$db->escape($refname)."' AND entity IN (".getEntity('project').")";
|
$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."projet WHERE ref='".$db->escape($refname)."' AND entity IN (".getEntity('project').")";
|
||||||
} elseif (($modulepart == 'commande_fournisseur' || $modulepart == 'order_supplier') && !empty($conf->fournisseur->commande->dir_output)) {
|
} elseif (($modulepart == 'commande_fournisseur' || $modulepart == 'order_supplier') && !empty($conf->fournisseur->commande->dir_output)) {
|
||||||
// Wrapping pour les commandes fournisseurs
|
// Wrapping pour les commandes fournisseurs
|
||||||
|
|||||||
@ -288,7 +288,7 @@ function project_prepare_head(Project $project, $moreparam = '')
|
|||||||
} else {
|
} else {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
|
||||||
$upload_dir = $conf->project->dir_output."/".dol_sanitizeFileName($project->ref);
|
$upload_dir = $conf->project->multidir_output[$project->entity]."/".dol_sanitizeFileName($project->ref);
|
||||||
$nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$'));
|
$nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$'));
|
||||||
$nbLinks = Link::count($db, $project->element, $project->id);
|
$nbLinks = Link::count($db, $project->element, $project->id);
|
||||||
$totalAttached = $nbFiles + $nbLinks;
|
$totalAttached = $nbFiles + $nbLinks;
|
||||||
@ -416,7 +416,7 @@ function task_prepare_head($object)
|
|||||||
}
|
}
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/document.php?id='.$object->id.(GETPOST('withproject') ? '&withproject=1' : '');
|
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/document.php?id='.$object->id.(GETPOST('withproject') ? '&withproject=1' : '');
|
||||||
$filesdir = $conf->project->dir_output."/".dol_sanitizeFileName($object->project->ref).'/'.dol_sanitizeFileName($object->ref);
|
$filesdir = $conf->project->multidir_output[$object->entity]."/".dol_sanitizeFileName($object->project->ref).'/'.dol_sanitizeFileName($object->ref);
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
|
||||||
$nbFiles = count(dol_dir_list($filesdir, 'files', 0, '', '(\.meta|_preview.*\.png)$'));
|
$nbFiles = count(dol_dir_list($filesdir, 'files', 0, '', '(\.meta|_preview.*\.png)$'));
|
||||||
|
|||||||
@ -394,20 +394,19 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
$label .= $object->tracking_url;
|
$label .= $object->tracking_url;
|
||||||
}
|
}
|
||||||
|
|
||||||
$height_trackingnumber += 6;
|
$height_trackingnumber += 4;
|
||||||
$pdf->SetFont('', 'B', $default_font_size - 2);
|
$pdf->SetFont('', 'B', $default_font_size - 2);
|
||||||
$pdf->writeHTMLCell(60, $height_trackingnumber, $this->posxdesc - 1, $tab_top_alt, $label, 0, 1, false, true, 'L');
|
$pdf->writeHTMLCell(60, $height_trackingnumber, $this->posxdesc - 1, $tab_top_alt, $label, 0, 1, false, true, 'L');
|
||||||
|
|
||||||
$tab_top = $pdf->GetY();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$tab_top = $pdf->GetY();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Notes
|
// Notes
|
||||||
$pagenb = $pdf->getPage();
|
$pagenb = $pdf->getPage();
|
||||||
if (!empty($notetoshow) || !empty($object->tracking_number)) {
|
if (!empty($notetoshow) || !empty($object->tracking_number)) {
|
||||||
$tab_top -= 2;
|
$tab_top -= 1;
|
||||||
|
|
||||||
$tab_width = $this->page_largeur - $this->marge_gauche - $this->marge_droite;
|
$tab_width = $this->page_largeur - $this->marge_gauche - $this->marge_droite;
|
||||||
$pageposbeforenote = $pagenb;
|
$pageposbeforenote = $pagenb;
|
||||||
@ -476,7 +475,7 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
$height_note = $this->page_hauteur - ($tab_top_newpage + $heightforfooter) + $height_trackingnumber + 1;
|
$height_note = $this->page_hauteur - ($tab_top_newpage + $heightforfooter) + $height_trackingnumber + 1;
|
||||||
$tab_top_newpage = $tab_topbeforetrackingnumber;
|
$tab_top_newpage = $tab_topbeforetrackingnumber;
|
||||||
}
|
}
|
||||||
$pdf->Rect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 1);
|
$pdf->Rect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 2);
|
||||||
} else {
|
} else {
|
||||||
if (empty($height_trackingnumber)) {
|
if (empty($height_trackingnumber)) {
|
||||||
$height_note = $this->page_hauteur - ($tab_top + $heightforfooter);
|
$height_note = $this->page_hauteur - ($tab_top + $heightforfooter);
|
||||||
@ -484,7 +483,7 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
$height_note = $this->page_hauteur - ($tab_top + $heightforfooter)+ $height_trackingnumber + 1;
|
$height_note = $this->page_hauteur - ($tab_top + $heightforfooter)+ $height_trackingnumber + 1;
|
||||||
$tab_top = $tab_topbeforetrackingnumber;
|
$tab_top = $tab_topbeforetrackingnumber;
|
||||||
}
|
}
|
||||||
$pdf->Rect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 1);
|
$pdf->Rect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add footer
|
// Add footer
|
||||||
@ -510,7 +509,7 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
$height_note = $posyafter - $tab_top + $height_trackingnumber + 1;
|
$height_note = $posyafter - $tab_top + $height_trackingnumber + 1;
|
||||||
$tab_top = $tab_topbeforetrackingnumber;
|
$tab_top = $tab_topbeforetrackingnumber;
|
||||||
}
|
}
|
||||||
$pdf->Rect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 1);
|
$pdf->Rect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 2);
|
||||||
|
|
||||||
|
|
||||||
if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + 20))) {
|
if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + 20))) {
|
||||||
|
|||||||
@ -195,11 +195,11 @@ class pdf_baleine extends ModelePDFProjects
|
|||||||
// Load traductions files required by page
|
// Load traductions files required by page
|
||||||
$outputlangs->loadLangs(array("main", "dict", "companies", "projects"));
|
$outputlangs->loadLangs(array("main", "dict", "companies", "projects"));
|
||||||
|
|
||||||
if ($conf->project->dir_output) {
|
if ($conf->project->multidir_output[$object->entity]) {
|
||||||
//$nblines = count($object->lines); // This is set later with array of tasks
|
//$nblines = count($object->lines); // This is set later with array of tasks
|
||||||
|
|
||||||
$objectref = dol_sanitizeFileName($object->ref);
|
$objectref = dol_sanitizeFileName($object->ref);
|
||||||
$dir = $conf->project->dir_output;
|
$dir = $conf->project->multidir_output[$object->entity];
|
||||||
if (!preg_match('/specimen/i', $objectref)) {
|
if (!preg_match('/specimen/i', $objectref)) {
|
||||||
$dir .= "/".$objectref;
|
$dir .= "/".$objectref;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -242,11 +242,11 @@ class pdf_beluga extends ModelePDFProjects
|
|||||||
// Load traductions files required by page
|
// Load traductions files required by page
|
||||||
$outputlangs->loadLangs(array("main", "dict", "companies", "projects"));
|
$outputlangs->loadLangs(array("main", "dict", "companies", "projects"));
|
||||||
|
|
||||||
if ($conf->project->dir_output) {
|
if ($conf->project->multidir_output[$object->entity]) {
|
||||||
//$nblines = count($object->lines); // This is set later with array of tasks
|
//$nblines = count($object->lines); // This is set later with array of tasks
|
||||||
|
|
||||||
$objectref = dol_sanitizeFileName($object->ref);
|
$objectref = dol_sanitizeFileName($object->ref);
|
||||||
$dir = $conf->project->dir_output;
|
$dir = $conf->project->multidir_output[$object->entity];
|
||||||
if (!preg_match('/specimen/i', $objectref)) {
|
if (!preg_match('/specimen/i', $objectref)) {
|
||||||
$dir .= "/".$objectref;
|
$dir .= "/".$objectref;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -195,11 +195,11 @@ class pdf_timespent extends ModelePDFProjects
|
|||||||
// Load traductions files required by page
|
// Load traductions files required by page
|
||||||
$outputlangs->loadLangs(array("main", "dict", "companies", "projects"));
|
$outputlangs->loadLangs(array("main", "dict", "companies", "projects"));
|
||||||
|
|
||||||
if ($conf->project->dir_output) {
|
if ($conf->project->multidir_output[$object->entity]) {
|
||||||
//$nblines = count($object->lines); // This is set later with array of tasks
|
//$nblines = count($object->lines); // This is set later with array of tasks
|
||||||
|
|
||||||
$objectref = dol_sanitizeFileName($object->ref);
|
$objectref = dol_sanitizeFileName($object->ref);
|
||||||
$dir = $conf->project->dir_output;
|
$dir = $conf->project->multidir_output[$object->entity];
|
||||||
if (!preg_match('/specimen/i', $objectref)) {
|
if (!preg_match('/specimen/i', $objectref)) {
|
||||||
$dir .= "/".$objectref;
|
$dir .= "/".$objectref;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -614,6 +614,7 @@ if (empty($reshook)) {
|
|||||||
$num_prod = count($lines);
|
$num_prod = count($lines);
|
||||||
for ($i = 0; $i < $num_prod; $i++) {
|
for ($i = 0; $i < $num_prod; $i++) {
|
||||||
if ($lines[$i]->id == $line_id) { // we have found line to update
|
if ($lines[$i]->id == $line_id) { // we have found line to update
|
||||||
|
$update_done = false;
|
||||||
$line = new ExpeditionLigne($db);
|
$line = new ExpeditionLigne($db);
|
||||||
$line->fk_expedition = $object->id;
|
$line->fk_expedition = $object->id;
|
||||||
|
|
||||||
@ -654,6 +655,8 @@ if (empty($reshook)) {
|
|||||||
if ($line->update($user) < 0) {
|
if ($line->update($user) < 0) {
|
||||||
setEventMessages($line->error, $line->errors, 'errors');
|
setEventMessages($line->error, $line->errors, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
|
} else {
|
||||||
|
$update_done=true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
setEventMessages($lotStock->error, $lotStock->errors, 'errors');
|
setEventMessages($lotStock->error, $lotStock->errors, 'errors');
|
||||||
@ -696,6 +699,8 @@ if (empty($reshook)) {
|
|||||||
if ($line->update($user) < 0) {
|
if ($line->update($user) < 0) {
|
||||||
setEventMessages($line->error, $line->errors, 'errors');
|
setEventMessages($line->error, $line->errors, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
|
} else {
|
||||||
|
$update_done=true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
setEventMessages($line->error, $line->errors, 'errors');
|
setEventMessages($line->error, $line->errors, 'errors');
|
||||||
@ -713,6 +718,8 @@ if (empty($reshook)) {
|
|||||||
if ($object->create_line_batch($line, $line->array_options) < 0) {
|
if ($object->create_line_batch($line, $line->array_options) < 0) {
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
|
} else {
|
||||||
|
$update_done=true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -750,6 +757,8 @@ if (empty($reshook)) {
|
|||||||
if ($line->update($user) < 0) {
|
if ($line->update($user) < 0) {
|
||||||
setEventMessages($line->error, $line->errors, 'errors');
|
setEventMessages($line->error, $line->errors, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
|
} else {
|
||||||
|
$update_done=true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unset($_POST[$stockLocation]);
|
unset($_POST[$stockLocation]);
|
||||||
@ -764,6 +773,8 @@ if (empty($reshook)) {
|
|||||||
if ($line->update($user) < 0) {
|
if ($line->update($user) < 0) {
|
||||||
setEventMessages($line->error, $line->errors, 'errors');
|
setEventMessages($line->error, $line->errors, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
|
} else {
|
||||||
|
$update_done=true;
|
||||||
}
|
}
|
||||||
unset($_POST[$qty]);
|
unset($_POST[$qty]);
|
||||||
}
|
}
|
||||||
@ -776,10 +787,17 @@ if (empty($reshook)) {
|
|||||||
if ($line->update($user) < 0) {
|
if ($line->update($user) < 0) {
|
||||||
setEventMessages($line->error, $line->errors, 'errors');
|
setEventMessages($line->error, $line->errors, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
|
} else {
|
||||||
|
$update_done=true;
|
||||||
}
|
}
|
||||||
unset($_POST[$qty]);
|
unset($_POST[$qty]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (empty($update_done)) {
|
||||||
|
$line->id = $lines[$i]->id;
|
||||||
|
$line->insertExtraFields();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -415,7 +415,7 @@ if (empty($reshook)) {
|
|||||||
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->multidir_output[$object->entity];
|
||||||
$file = $upload_dir.'/'.GETPOST('file');
|
$file = $upload_dir.'/'.GETPOST('file');
|
||||||
$ret = dol_delete_file($file, 0, 0, 0, $object);
|
$ret = dol_delete_file($file, 0, 0, 0, $object);
|
||||||
if ($ret) {
|
if ($ret) {
|
||||||
@ -1629,12 +1629,12 @@ if ($action == 'create' && $user->rights->projet->creer) {
|
|||||||
* Generated documents
|
* Generated documents
|
||||||
*/
|
*/
|
||||||
$filename = dol_sanitizeFileName($object->ref);
|
$filename = dol_sanitizeFileName($object->ref);
|
||||||
$filedir = $conf->project->dir_output."/".dol_sanitizeFileName($object->ref);
|
$filedir = $conf->project->multidir_output[$object->entity]."/".dol_sanitizeFileName($object->ref);
|
||||||
$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
|
$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
|
||||||
$genallowed = ($user->rights->projet->lire && $userAccess > 0);
|
$genallowed = ($user->rights->projet->lire && $userAccess > 0);
|
||||||
$delallowed = ($user->rights->projet->creer && $userWrite > 0);
|
$delallowed = ($user->rights->projet->creer && $userWrite > 0);
|
||||||
|
|
||||||
print $formfile->showdocuments('project', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf);
|
print $formfile->showdocuments('project', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 0, 0, '', '', '', '', '', $object);
|
||||||
|
|
||||||
print '</div><div class="fichehalfright">';
|
print '</div><div class="fichehalfright">';
|
||||||
|
|
||||||
@ -1653,7 +1653,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
|
|||||||
// Presend form
|
// Presend form
|
||||||
$modelmail = 'project';
|
$modelmail = 'project';
|
||||||
$defaulttopic = 'SendProjectRef';
|
$defaulttopic = 'SendProjectRef';
|
||||||
$diroutput = $conf->project->dir_output;
|
$diroutput = $conf->project->multidir_output[$object->entity];
|
||||||
$autocopy = 'MAIN_MAIL_AUTOCOPY_PROJECT_TO'; // used to know the automatic BCC to add
|
$autocopy = 'MAIN_MAIL_AUTOCOPY_PROJECT_TO'; // used to know the automatic BCC to add
|
||||||
$trackid = 'proj'.$object->id;
|
$trackid = 'proj'.$object->id;
|
||||||
|
|
||||||
|
|||||||
@ -1385,6 +1385,7 @@ class Project extends CommonObject
|
|||||||
// Initialise parameters
|
// Initialise parameters
|
||||||
$this->id = 0;
|
$this->id = 0;
|
||||||
$this->ref = 'SPECIMEN';
|
$this->ref = 'SPECIMEN';
|
||||||
|
$this->entity = $conf->entity;
|
||||||
$this->specimen = 1;
|
$this->specimen = 1;
|
||||||
$this->socid = 1;
|
$this->socid = 1;
|
||||||
$this->date_c = $now;
|
$this->date_c = $now;
|
||||||
|
|||||||
@ -199,7 +199,7 @@ class Task extends CommonObjectLine
|
|||||||
$sql .= ", progress";
|
$sql .= ", progress";
|
||||||
$sql .= ", budget_amount";
|
$sql .= ", budget_amount";
|
||||||
$sql .= ") VALUES (";
|
$sql .= ") VALUES (";
|
||||||
$sql .= ((int) $conf->entity);
|
$sql .= (!empty($this->entity) ? (int) $this->entity : (int) $conf->entity);
|
||||||
$sql .= ", ".((int) $this->fk_project);
|
$sql .= ", ".((int) $this->fk_project);
|
||||||
$sql .= ", ".(!empty($this->ref) ? "'".$this->db->escape($this->ref)."'" : 'null');
|
$sql .= ", ".(!empty($this->ref) ? "'".$this->db->escape($this->ref)."'" : 'null');
|
||||||
$sql .= ", ".((int) $this->fk_task_parent);
|
$sql .= ", ".((int) $this->fk_task_parent);
|
||||||
@ -275,6 +275,7 @@ class Task extends CommonObjectLine
|
|||||||
$sql = "SELECT";
|
$sql = "SELECT";
|
||||||
$sql .= " t.rowid,";
|
$sql .= " t.rowid,";
|
||||||
$sql .= " t.ref,";
|
$sql .= " t.ref,";
|
||||||
|
$sql .= " t.entity,";
|
||||||
$sql .= " t.fk_projet as fk_project,";
|
$sql .= " t.fk_projet as fk_project,";
|
||||||
$sql .= " t.fk_task_parent,";
|
$sql .= " t.fk_task_parent,";
|
||||||
$sql .= " t.label,";
|
$sql .= " t.label,";
|
||||||
@ -319,6 +320,7 @@ class Task extends CommonObjectLine
|
|||||||
|
|
||||||
$this->id = $obj->rowid;
|
$this->id = $obj->rowid;
|
||||||
$this->ref = $obj->ref;
|
$this->ref = $obj->ref;
|
||||||
|
$this->entity = $obj->entity;
|
||||||
$this->fk_project = $obj->fk_project;
|
$this->fk_project = $obj->fk_project;
|
||||||
$this->fk_task_parent = $obj->fk_task_parent;
|
$this->fk_task_parent = $obj->fk_task_parent;
|
||||||
$this->label = $obj->label;
|
$this->label = $obj->label;
|
||||||
|
|||||||
@ -50,7 +50,7 @@ if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($ob
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($id > 0 || !empty($ref)) {
|
if ($id > 0 || !empty($ref)) {
|
||||||
$upload_dir = $conf->project->dir_output."/".dol_sanitizeFileName($object->ref);
|
$upload_dir = $conf->project->multidir_output[$object->entity]."/".dol_sanitizeFileName($object->ref);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get parameters
|
// Get parameters
|
||||||
@ -110,7 +110,7 @@ llxHeader('', $title, $help_url);
|
|||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
|
||||||
if ($object->id > 0) {
|
if ($object->id > 0) {
|
||||||
$upload_dir = $conf->project->dir_output.'/'.dol_sanitizeFileName($object->ref);
|
$upload_dir = $conf->project->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->ref);
|
||||||
|
|
||||||
// To verify role of users
|
// To verify role of users
|
||||||
//$userAccess = $object->restrictedProjectArea($user,'read');
|
//$userAccess = $object->restrictedProjectArea($user,'read');
|
||||||
|
|||||||
@ -336,6 +336,7 @@ if ($action == 'createtask' && $user->rights->projet->creer) {
|
|||||||
$task = new Task($db);
|
$task = new Task($db);
|
||||||
|
|
||||||
$task->fk_project = $projectid;
|
$task->fk_project = $projectid;
|
||||||
|
$task->entity = $object->entity; // Task have the same entity of project
|
||||||
$task->ref = $taskref;
|
$task->ref = $taskref;
|
||||||
$task->label = $label;
|
$task->label = $label;
|
||||||
$task->description = $description;
|
$task->description = $description;
|
||||||
|
|||||||
@ -111,7 +111,7 @@ if ($id > 0 || !empty($ref)) {
|
|||||||
|
|
||||||
$object->project = clone $projectstatic;
|
$object->project = clone $projectstatic;
|
||||||
|
|
||||||
$upload_dir = $conf->project->dir_output.'/'.dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($object->ref);
|
$upload_dir = $conf->project->multidir_output[$projectstatic->entity].'/'.dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($object->ref);
|
||||||
}
|
}
|
||||||
|
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user