NEW Add Manufacturing Orders into the automatic ECM
This commit is contained in:
parent
3fe0ffe7e2
commit
a4c34c2bc5
@ -180,41 +180,46 @@ 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', 'holiday', 'banque');
|
||||
$automodules = array(
|
||||
'company',
|
||||
'invoice',
|
||||
'invoice_supplier',
|
||||
'propal',
|
||||
'supplier_proposal',
|
||||
'order',
|
||||
'order_supplier',
|
||||
'contract',
|
||||
'product',
|
||||
'tax',
|
||||
'project',
|
||||
'fichinter',
|
||||
'user',
|
||||
'expensereport',
|
||||
'holiday',
|
||||
'recruitment-recruitmentcandidature',
|
||||
'banque',
|
||||
'mrp-mo'
|
||||
);
|
||||
|
||||
// TODO change for multicompany sharing
|
||||
// Auto area for suppliers invoices
|
||||
if ($module == 'company') $upload_dir = $conf->societe->dir_output;
|
||||
// Auto area for suppliers invoices
|
||||
elseif ($module == 'invoice') $upload_dir = $conf->facture->dir_output;
|
||||
// Auto area for suppliers invoices
|
||||
elseif ($module == 'invoice_supplier') $upload_dir = $conf->fournisseur->facture->dir_output;
|
||||
// Auto area for customers proposal
|
||||
elseif ($module == 'propal') $upload_dir = $conf->propal->dir_output;
|
||||
// Auto area for suppliers proposal
|
||||
elseif ($module == 'supplier_proposal') $upload_dir = $conf->supplier_proposal->dir_output;
|
||||
// Auto area for customers orders
|
||||
elseif ($module == 'order') $upload_dir = $conf->commande->dir_output;
|
||||
// Auto area for suppliers orders
|
||||
elseif ($module == 'order_supplier') $upload_dir = $conf->fournisseur->commande->dir_output;
|
||||
// Auto area for suppliers invoices
|
||||
elseif ($module == 'contract') $upload_dir = $conf->contrat->dir_output;
|
||||
// Auto area for products
|
||||
elseif ($module == 'product') $upload_dir = $conf->product->dir_output;
|
||||
// Auto area for suppliers invoices
|
||||
elseif ($module == 'tax') $upload_dir = $conf->tax->dir_output;
|
||||
// Auto area for projects
|
||||
elseif ($module == 'project') $upload_dir = $conf->projet->dir_output;
|
||||
// Auto area for interventions
|
||||
elseif ($module == 'fichinter') $upload_dir = $conf->ficheinter->dir_output;
|
||||
// Auto area for users
|
||||
elseif ($module == 'user') $upload_dir = $conf->user->dir_output;
|
||||
// Auto area for expense report
|
||||
elseif ($module == 'expensereport') $upload_dir = $conf->expensereport->dir_output;
|
||||
// Auto area for holiday
|
||||
elseif ($module == 'holiday') $upload_dir = $conf->holiday->dir_output;
|
||||
// Auto area for holiday
|
||||
elseif ($module == 'recruitment-recruitmentcandidature') $upload_dir = $conf->recruitment->dir_output.'/recruitmentcandidature';
|
||||
elseif ($module == 'banque') $upload_dir = $conf->bank->dir_output;
|
||||
elseif ($module == 'mrp-mo') $upload_dir = $conf->mrp->dir_output.'/mo';
|
||||
|
||||
// Automatic list
|
||||
if (in_array($module, $automodules))
|
||||
|
||||
@ -1526,10 +1526,18 @@ class FormFile
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
|
||||
$object_instance = new Holiday($this->db);
|
||||
} elseif ($modulepart == 'recruitment-recruitmentcandidature')
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/recruitment/class/recruitmentcandidature.class.php';
|
||||
$object_instance = new RecruitmentCandidature($this->db);
|
||||
} elseif ($modulepart == 'banque')
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
$object_instance = new Account($this->db);
|
||||
} elseif ($modulepart == 'mrp-mo')
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php';
|
||||
$object_instance = new Mo($this->db);
|
||||
}
|
||||
|
||||
foreach ($filearray as $key => $file)
|
||||
@ -1546,9 +1554,24 @@ class FormFile
|
||||
$id = 0; $ref = ''; $label = '';
|
||||
|
||||
// To show ref or specific information according to view to show (defined by $module)
|
||||
if ($modulepart == 'company' || $modulepart == 'tax') { preg_match('/(\d+)\/[^\/]+$/', $relativefile, $reg); $id = (isset($reg[1]) ? $reg[1] : ''); } elseif ($modulepart == 'invoice_supplier') { preg_match('/([^\/]+)\/[^\/]+$/', $relativefile, $reg); $ref = (isset($reg[1]) ? $reg[1] : ''); if (is_numeric($ref)) { $id = $ref; $ref = ''; } } // $ref may be also id with old supplier invoices
|
||||
elseif ($modulepart == 'user' || $modulepart == 'holiday') { preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); $id = (isset($reg[1]) ? $reg[1] : ''); } elseif (in_array($modulepart, array('invoice', 'propal', 'supplier_proposal', 'order', 'order_supplier', 'contract', 'product', 'project', 'fichinter', 'expensereport', 'banque')))
|
||||
{
|
||||
$reg = array();
|
||||
if ($modulepart == 'company' || $modulepart == 'tax') { preg_match('/(\d+)\/[^\/]+$/', $relativefile, $reg); $id = (isset($reg[1]) ? $reg[1] : ''); }
|
||||
elseif ($modulepart == 'invoice_supplier') { preg_match('/([^\/]+)\/[^\/]+$/', $relativefile, $reg); $ref = (isset($reg[1]) ? $reg[1] : ''); if (is_numeric($ref)) { $id = $ref; $ref = ''; } } // $ref may be also id with old supplier invoices
|
||||
elseif ($modulepart == 'user' || $modulepart == 'holiday') { preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); $id = (isset($reg[1]) ? $reg[1] : ''); }
|
||||
elseif (in_array($modulepart, array(
|
||||
'invoice',
|
||||
'propal',
|
||||
'supplier_proposal',
|
||||
'order',
|
||||
'order_supplier',
|
||||
'contract',
|
||||
'product',
|
||||
'project',
|
||||
'fichinter',
|
||||
'expensereport',
|
||||
'recruitment-recruitmentcandidature',
|
||||
'mrp-mo',
|
||||
'banque'))) {
|
||||
preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); $ref = (isset($reg[1]) ? $reg[1] : '');
|
||||
} else {
|
||||
//print 'Error: Value for modulepart = '.$modulepart.' is not yet implemented in function list_of_autoecmfiles'."\n";
|
||||
|
||||
@ -315,7 +315,7 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED))
|
||||
if (!empty($conf->contrat->enabled)) { $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'contract', 'test'=>$conf->contrat->enabled, 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsByContracts")); }
|
||||
if (!empty($conf->commande->enabled)) { $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'order', 'test'=>$conf->commande->enabled, 'label'=>$langs->trans("CustomersOrders"), 'desc'=>$langs->trans("ECMDocsByOrders")); }
|
||||
if (!empty($conf->facture->enabled)) { $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'invoice', 'test'=>$conf->facture->enabled, 'label'=>$langs->trans("CustomersInvoices"), 'desc'=>$langs->trans("ECMDocsByInvoices")); }
|
||||
if (!empty($conf->supplier_proposal->enabled)) { $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'supplier_proposal', 'test'=>$conf->supplier_proposal->enabled, 'label'=>$langs->trans("SupplierProposals"), 'desc'=>$langs->trans("ECMDocsBySupplierProposals")); }
|
||||
if (!empty($conf->supplier_proposal->enabled)) { $langs->load("supplier_proposal"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'supplier_proposal', 'test'=>$conf->supplier_proposal->enabled, 'label'=>$langs->trans("SupplierProposals"), 'desc'=>$langs->trans("ECMDocsBySupplierProposals")); }
|
||||
if (!empty($conf->fournisseur->enabled)) { $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'order_supplier', 'test'=>$conf->fournisseur->enabled, 'label'=>$langs->trans("SuppliersOrders"), 'desc'=>$langs->trans("ECMDocsByOrders")); }
|
||||
if (!empty($conf->fournisseur->enabled)) { $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'invoice_supplier', 'test'=>$conf->fournisseur->enabled, 'label'=>$langs->trans("SuppliersInvoices"), 'desc'=>$langs->trans("ECMDocsByInvoices")); }
|
||||
if (!empty($conf->tax->enabled)) { $langs->load("compta"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'tax', 'test'=>$conf->tax->enabled, 'label'=>$langs->trans("SocialContributions"), 'desc'=>$langs->trans("ECMDocsBySocialContributions")); }
|
||||
@ -324,6 +324,8 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED))
|
||||
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")); }
|
||||
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("ECMDocsByBankAccount")); }
|
||||
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("ECMDocsByMO")); }
|
||||
if (!empty($conf->recruitment->enabled)) { $langs->load("recruitment"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'recruitment-recruitmentcandidature', 'test'=>$conf->recruitment->enabled, 'label'=>$langs->trans("Candidatures"), 'desc'=>$langs->trans("ECMDocsByCandidature")); }
|
||||
$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