From c3a95f31619f340384abb0e0a644f493caa31b71 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 22 May 2011 21:02:09 +0000 Subject: [PATCH] New: List of documents fo customer invoices if ecm module --- htdocs/core/class/html.formfile.class.php | 13 +++++++++++++ htdocs/ecm/index.php | 14 ++++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 3e78a54b198..2f1d5c89c1b 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -610,6 +610,11 @@ class FormFile print_liste_field_titre('','',''); print ''; + if ($modulepart == 'invoice') + { + include_once(DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'); + $object_static=new Facture($this->db); + } if ($modulepart == 'invoice_supplier') { include_once(DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'); @@ -633,6 +638,14 @@ class FormFile print ''; print ''; $id='';$ref=''; + if ($modulepart == 'invoice') + { + preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); + $ref=$reg[1]; + $object_static->fetch('',$ref); + //print $relativefile.'rr'.$id; + print $object_static->getNomUrl(1,'document'); + } if ($modulepart == 'invoice_supplier') { preg_match('/(\d+)\/[^\/]+$/',$relativefile,$reg); diff --git a/htdocs/ecm/index.php b/htdocs/ecm/index.php index 08f9e1f10ec..b53bf2b6f7c 100644 --- a/htdocs/ecm/index.php +++ b/htdocs/ecm/index.php @@ -423,7 +423,7 @@ else } //} // Show button to refresh listing -print ''; +print ''; print ''; print ''; @@ -812,7 +812,17 @@ if ($module == 'invoice_supplier') // Auto area for suppliers invoices { $relativepath='facture'; $upload_dir = $conf->fournisseur->dir_output.'/'.$relativepath; - $filearray=dol_dir_list($upload_dir,"files",1,'',array('^\.','\.meta$','^temp$','^CVS$'),$sortfield,(strtolower($sortorder)=='desc'?SORT_ASC:SORT_DESC),1); + $filearray=dol_dir_list($upload_dir,"files",1,'',array('^SPECIMEN\.pdf$','^\.','\.meta$','^temp$','^CVS$'),$sortfield,(strtolower($sortorder)=='desc'?SORT_ASC:SORT_DESC),1); + + $param='&module='.$module; + $textifempty=($section?$langs->trans("NoFileFound"):($showonrightsize=='featurenotyetavailable'?$langs->trans("FeatureNotYetAvailable"):$langs->trans("ECMSelectASection"))); + + $formfile->list_of_autoecmfiles($upload_dir,$filearray,$module,$param,1,'',$user->rights->ecm->upload,1,$textifempty,40); +} +else if ($module == 'invoice') // Auto area for suppliers invoices +{ + $upload_dir = $conf->facture->dir_output; + $filearray=dol_dir_list($upload_dir,"files",1,'',array('^SPECIMEN\.pdf$','^\.','\.meta$','^temp$','^payments$','^CVS$'),$sortfield,(strtolower($sortorder)=='desc'?SORT_ASC:SORT_DESC),1); $param='&module='.$module; $textifempty=($section?$langs->trans("NoFileFound"):($showonrightsize=='featurenotyetavailable'?$langs->trans("FeatureNotYetAvailable"):$langs->trans("ECMSelectASection")));