Merge pull request #19176 from atm-maxime/fix_ecm_autotree
Fix #8716 : tasks were not shown in ecm auto tree
This commit is contained in:
commit
58b2365f8a
@ -205,12 +205,14 @@ if ($type == 'directory') {
|
|||||||
'product',
|
'product',
|
||||||
'tax',
|
'tax',
|
||||||
'project',
|
'project',
|
||||||
|
'project_task',
|
||||||
'fichinter',
|
'fichinter',
|
||||||
'user',
|
'user',
|
||||||
'expensereport',
|
'expensereport',
|
||||||
'holiday',
|
'holiday',
|
||||||
'recruitment-recruitmentcandidature',
|
'recruitment-recruitmentcandidature',
|
||||||
'banque',
|
'banque',
|
||||||
|
'chequereceipt',
|
||||||
'mrp-mo'
|
'mrp-mo'
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -243,6 +245,8 @@ if ($type == 'directory') {
|
|||||||
$upload_dir = $conf->tax->dir_output;
|
$upload_dir = $conf->tax->dir_output;
|
||||||
} elseif ($module == 'project') {
|
} elseif ($module == 'project') {
|
||||||
$upload_dir = $conf->projet->dir_output;
|
$upload_dir = $conf->projet->dir_output;
|
||||||
|
} elseif ($module == 'project_task') {
|
||||||
|
$upload_dir = $conf->projet->dir_output;
|
||||||
} elseif ($module == 'fichinter') {
|
} elseif ($module == 'fichinter') {
|
||||||
$upload_dir = $conf->ficheinter->dir_output;
|
$upload_dir = $conf->ficheinter->dir_output;
|
||||||
} elseif ($module == 'user') {
|
} elseif ($module == 'user') {
|
||||||
@ -255,8 +259,10 @@ if ($type == 'directory') {
|
|||||||
$upload_dir = $conf->recruitment->dir_output.'/recruitmentcandidature';
|
$upload_dir = $conf->recruitment->dir_output.'/recruitmentcandidature';
|
||||||
} elseif ($module == 'banque') {
|
} elseif ($module == 'banque') {
|
||||||
$upload_dir = $conf->bank->dir_output;
|
$upload_dir = $conf->bank->dir_output;
|
||||||
|
} elseif ($module == 'chequereceipt') {
|
||||||
|
$upload_dir = $conf->bank->dir_output.'/checkdeposits';
|
||||||
} elseif ($module == 'mrp-mo') {
|
} elseif ($module == 'mrp-mo') {
|
||||||
$upload_dir = $conf->mrp->dir_output.'/mo';
|
$upload_dir = $conf->mrp->dir_output;
|
||||||
} else {
|
} else {
|
||||||
$parameters = array('modulepart'=>$module);
|
$parameters = array('modulepart'=>$module);
|
||||||
$reshook = $hookmanager->executeHooks('addSectionECMAuto', $parameters);
|
$reshook = $hookmanager->executeHooks('addSectionECMAuto', $parameters);
|
||||||
|
|||||||
@ -1645,6 +1645,9 @@ class FormFile
|
|||||||
} elseif ($modulepart == 'project') {
|
} elseif ($modulepart == 'project') {
|
||||||
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||||
$object_instance = new Project($this->db);
|
$object_instance = new Project($this->db);
|
||||||
|
} elseif ($modulepart == 'project_task') {
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
|
||||||
|
$object_instance = new Task($this->db);
|
||||||
} elseif ($modulepart == 'fichinter') {
|
} elseif ($modulepart == 'fichinter') {
|
||||||
include_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
|
||||||
$object_instance = new Fichinter($this->db);
|
$object_instance = new Fichinter($this->db);
|
||||||
@ -1663,6 +1666,9 @@ class FormFile
|
|||||||
} elseif ($modulepart == 'banque') {
|
} elseif ($modulepart == 'banque') {
|
||||||
include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||||
$object_instance = new Account($this->db);
|
$object_instance = new Account($this->db);
|
||||||
|
} elseif ($modulepart == 'chequereceipt') {
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php';
|
||||||
|
$object_instance = new RemiseCheque($this->db);
|
||||||
} elseif ($modulepart == 'mrp-mo') {
|
} elseif ($modulepart == 'mrp-mo') {
|
||||||
include_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php';
|
||||||
$object_instance = new Mo($this->db);
|
$object_instance = new Mo($this->db);
|
||||||
@ -1717,14 +1723,19 @@ class FormFile
|
|||||||
$id = (isset($reg[1]) ? $reg[1] : '');
|
$id = (isset($reg[1]) ? $reg[1] : '');
|
||||||
} elseif ($modulepart == 'invoice_supplier') {
|
} elseif ($modulepart == 'invoice_supplier') {
|
||||||
preg_match('/([^\/]+)\/[^\/]+$/', $relativefile, $reg);
|
preg_match('/([^\/]+)\/[^\/]+$/', $relativefile, $reg);
|
||||||
$ref = (isset($reg[1]) ? $reg[1] : ''); if (is_numeric($ref)) {
|
$ref = (isset($reg[1]) ? $reg[1] : '');
|
||||||
|
if (is_numeric($ref)) {
|
||||||
$id = $ref;
|
$id = $ref;
|
||||||
$ref = '';
|
$ref = '';
|
||||||
}
|
}
|
||||||
} elseif ($modulepart == 'user' || $modulepart == 'holiday') {
|
} elseif ($modulepart == 'user') {
|
||||||
// $ref may be also id with old supplier invoices
|
// $ref may be also id with old supplier invoices
|
||||||
preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg);
|
preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg);
|
||||||
$id = (isset($reg[1]) ? $reg[1] : '');
|
$id = (isset($reg[1]) ? $reg[1] : '');
|
||||||
|
} elseif ($modulepart == 'project_task') {
|
||||||
|
// $ref of task is the sub-directory of the project
|
||||||
|
$reg = explode("/", $relativefile);
|
||||||
|
$ref = (isset($reg[1]) ? $reg[1] : '');
|
||||||
} elseif (in_array($modulepart, array(
|
} elseif (in_array($modulepart, array(
|
||||||
'invoice',
|
'invoice',
|
||||||
'propal',
|
'propal',
|
||||||
@ -1734,11 +1745,14 @@ class FormFile
|
|||||||
'contract',
|
'contract',
|
||||||
'product',
|
'product',
|
||||||
'project',
|
'project',
|
||||||
|
'project_task',
|
||||||
'fichinter',
|
'fichinter',
|
||||||
'expensereport',
|
'expensereport',
|
||||||
'recruitment-recruitmentcandidature',
|
'recruitment-recruitmentcandidature',
|
||||||
'mrp-mo',
|
'mrp-mo',
|
||||||
'banque'))) {
|
'banque',
|
||||||
|
'chequereceipt',
|
||||||
|
'holiday'))) {
|
||||||
preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg);
|
preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg);
|
||||||
$ref = (isset($reg[1]) ? $reg[1] : '');
|
$ref = (isset($reg[1]) ? $reg[1] : '');
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -341,6 +341,7 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) {
|
|||||||
}
|
}
|
||||||
if (!empty($conf->projet->enabled)) {
|
if (!empty($conf->projet->enabled)) {
|
||||||
$rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'project', 'test'=>$conf->projet->enabled, 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Projects")));
|
$rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'project', 'test'=>$conf->projet->enabled, 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Projects")));
|
||||||
|
$rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'project_task', 'test'=>$conf->projet->enabled, 'label'=>$langs->trans("Tasks"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Tasks")));
|
||||||
}
|
}
|
||||||
if (!empty($conf->ficheinter->enabled)) {
|
if (!empty($conf->ficheinter->enabled)) {
|
||||||
$langs->load("interventions"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'fichinter', 'test'=>$conf->ficheinter->enabled, 'label'=>$langs->trans("Interventions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Interventions")));
|
$langs->load("interventions"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'fichinter', 'test'=>$conf->ficheinter->enabled, 'label'=>$langs->trans("Interventions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Interventions")));
|
||||||
@ -353,6 +354,7 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) {
|
|||||||
}
|
}
|
||||||
if (!empty($conf->banque->enabled)) {
|
if (!empty($conf->banque->enabled)) {
|
||||||
$langs->load("banks"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'banque', 'test'=>$conf->banque->enabled, 'label'=>$langs->trans("BankAccount"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("BankAccount")));
|
$langs->load("banks"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'banque', 'test'=>$conf->banque->enabled, 'label'=>$langs->trans("BankAccount"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("BankAccount")));
|
||||||
|
$rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'chequereceipt', 'test'=>$conf->banque->enabled, 'label'=>$langs->trans("CheckReceipt"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("CheckReceipt")));
|
||||||
}
|
}
|
||||||
if (!empty($conf->mrp->enabled)) {
|
if (!empty($conf->mrp->enabled)) {
|
||||||
$langs->load("mrp"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'mrp-mo', 'test'=>$conf->mrp->enabled, 'label'=>$langs->trans("MOs"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ManufacturingOrders")));
|
$langs->load("mrp"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'mrp-mo', 'test'=>$conf->mrp->enabled, 'label'=>$langs->trans("MOs"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ManufacturingOrders")));
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user