Fix expense report in ecm auto dir
This commit is contained in:
parent
a49a083629
commit
5e2f3a53c9
@ -172,7 +172,7 @@ if ($type == 'directory')
|
||||
$sorting = (strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC);
|
||||
|
||||
// Right area. If module is defined here, we are in automatic ecm.
|
||||
$automodules = array('company', 'invoice', 'invoice_supplier', 'propal', 'supplier_proposal', 'order', 'order_supplier', 'contract', 'product', 'tax', 'project', 'fichinter', 'user', 'expensereport');
|
||||
$automodules = array('company', 'invoice', 'invoice_supplier', 'propal', 'supplier_proposal', 'order', 'order_supplier', 'contract', 'product', 'tax', 'project', 'fichinter', 'user', 'expensereport', 'holiday');
|
||||
|
||||
// TODO change for multicompany sharing
|
||||
// Auto area for suppliers invoices
|
||||
@ -203,6 +203,8 @@ if ($type == 'directory')
|
||||
else if ($module == 'user') $upload_dir = $conf->user->dir_output;
|
||||
// Auto area for expense report
|
||||
else if ($module == 'expensereport') $upload_dir = $conf->expensereport->dir_output;
|
||||
// Auto area for holiday
|
||||
else if ($module == 'holiday') $upload_dir = $conf->holiday->dir_output;
|
||||
|
||||
// Automatic list
|
||||
if (in_array($module, $automodules))
|
||||
|
||||
@ -1392,6 +1392,11 @@ class FormFile
|
||||
include_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
|
||||
$object_instance=new ExpenseReport($this->db);
|
||||
}
|
||||
else if ($modulepart == 'holiday')
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
|
||||
$object_instance=new Holiday($this->db);
|
||||
}
|
||||
|
||||
foreach($filearray as $key => $file)
|
||||
{
|
||||
@ -1421,7 +1426,8 @@ class FormFile
|
||||
if ($modulepart == 'project') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $ref=(isset($reg[1])?$reg[1]:'');}
|
||||
if ($modulepart == 'fichinter') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $ref=(isset($reg[1])?$reg[1]:'');}
|
||||
if ($modulepart == 'user') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $id=(isset($reg[1])?$reg[1]:'');}
|
||||
if ($modulepart == 'expensereport') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $id=(isset($reg[1])?$reg[1]:'');}
|
||||
if ($modulepart == 'expensereport') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $ref=(isset($reg[1])?$reg[1]:'');}
|
||||
if ($modulepart == 'holiday') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $id=(isset($reg[1])?$reg[1]:'');}
|
||||
|
||||
if (! $id && ! $ref) continue;
|
||||
$found=0;
|
||||
|
||||
@ -331,6 +331,7 @@ if (! empty($conf->global->ECM_AUTO_TREE_ENABLED))
|
||||
if (! empty($conf->projet->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'project', 'test'=>$conf->projet->enabled, 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsByProjects")); }
|
||||
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("ECMDocsByInterventions")); }
|
||||
if (! empty($conf->expensereport->enabled)) { $langs->load("trips"); $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'expensereport', 'test'=>$conf->expensereport->enabled, 'label'=>$langs->trans("ExpenseReports"), 'desc'=>$langs->trans("ECMDocsByExpenseReports")); }
|
||||
if (! empty($conf->holiday->enabled)) { $langs->load("holiday"); $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'holiday', 'test'=>$conf->holiday->enabled, 'label'=>$langs->trans("Holidays"), 'desc'=>$langs->trans("ECMDocsByHolidays")); }
|
||||
$rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'user', 'test'=>1, 'label'=>$langs->trans("Users"), 'desc'=>$langs->trans("ECMDocsByUsers"));
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user