From 90c397d1a43ecc96bb6df7fee542c5df5f6dfd9d Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Tue, 5 Aug 2014 15:24:49 +0200 Subject: [PATCH] New: Intervention documents are now available in ECM module --- ChangeLog | 1 + htdocs/core/ajax/ajaxdirpreview.php | 4 +++- htdocs/core/class/html.formfile.class.php | 8 +++++++- htdocs/ecm/index_auto.php | 1 + 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b2dd282a06e..c21bd2f76f4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -33,6 +33,7 @@ For users: Differentiate text and img. Use label into quick search form. Use accesskey on form search. +- New: Intervention documents are now available in ECM module - Fix: [ bug #1487 ] PAYMENT_DELETE trigger does not intercept trigger action - Fix: [ bug #1470, #1472, #1473] User trigger problem - Fix: [ bug #1489, #1491 ] Intervention trigger problem diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php index d1a64f6b256..e5972ad17f9 100644 --- a/htdocs/core/ajax/ajaxdirpreview.php +++ b/htdocs/core/ajax/ajaxdirpreview.php @@ -153,7 +153,7 @@ if ($type == 'directory') $sorting = (strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC); // Right area. If module is defined, we are in automatic ecm. - $automodules = array('company', 'invoice', 'invoice_supplier', 'propal', 'order', 'order_supplier', 'contract', 'product', 'tax', 'project'); + $automodules = array('company', 'invoice', 'invoice_supplier', 'propal', 'order', 'order_supplier', 'contract', 'product', 'tax', 'project', 'fichinter'); // TODO change for multicompany sharing // Auto area for suppliers invoices @@ -184,6 +184,8 @@ if ($type == 'directory') else if ($module == 'tax') $upload_dir = $conf->tax->dir_output; // Auto area for projects else if ($module == 'project') $upload_dir = $conf->projet->dir_output; + // Auto area for interventions + else if ($module == 'fichinter') $upload_dir = $conf->ficheinter->dir_output; if (in_array($module, $automodules)) { diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 8806879aa4b..d3e2f39e26d 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -936,6 +936,11 @@ class FormFile include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; $object_instance=new Project($this->db); } + else if ($modulepart == 'fichinter') + { + include_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; + $object_instance=new Fichinter($this->db); + } $var=true; foreach($filearray as $key => $file) @@ -962,7 +967,8 @@ class FormFile if ($modulepart == 'contract') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $ref=(isset($reg[1])?$reg[1]:''); } if ($modulepart == 'product') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $ref=(isset($reg[1])?$reg[1]:''); } if ($modulepart == 'tax') { preg_match('/(\d+)\/[^\/]+$/',$relativefile,$reg); $id=(isset($reg[1])?$reg[1]:''); } - if ($modulepart == 'project') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $ref=(isset($reg[1])?$reg[1]:'');} + 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 (! $id && ! $ref) continue; diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php index 3e6e6cfa05b..1afbd376838 100644 --- a/htdocs/ecm/index_auto.php +++ b/htdocs/ecm/index_auto.php @@ -409,6 +409,7 @@ if (! empty($conf->global->ECM_AUTO_TREE_ENABLED)) 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")); } 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)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'fichinter', 'test'=>$conf->ficheinter->enabled, 'label'=>$langs->trans("Interventions"), 'desc'=>$langs->trans("ECMDocsByInterventions")); } } print_fiche_titre($langs->trans("ECMArea").' - '.$langs->trans("ECMFileManager"));