diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index b25f67deccc..00cb18ed84c 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -3116,12 +3116,30 @@ else print ''; print ''; + $facturestatic->id=$objp->facid; $facturestatic->ref=$objp->facnumber; $facturestatic->type=$objp->type; + + print ''; + print ''; + + print ''; + print '
'; print $facturestatic->getNomUrl(1); print $objp->increment; + print ''; if ($objp->datelimite < (time() - $conf->facture->client->warning_delay) && ! $objp->paye && $objp->fk_statut == 1 && ! $objp->am) print img_warning($langs->trans('Late')); + print ''; + + $filename=sanitize_string($objp->facnumber); + $filedir=$conf->facture->dir_output . '/' . sanitize_string($objp->facnumber); + $urlsource=$_SERVER['PHP_SELF'].'?facid='.$objp->facid; + $genallowed=($fac->statut >= 1 && $user->rights->facture->liste); + $html->show_documents('facture',$filename,$filedir,$urlsource,$genallowed,'','','','',1); + + print '
'; + print "\n"; if ($objp->df > 0 ) diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index b3888cc9d7b..74fc145bf67 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -2894,7 +2894,7 @@ class Form * REFFACTURE-XXXXXX-detail.pdf ou XXXXX est une forme diverse * \return int <0 si ko, nbre de fichiers affichés si ok */ - function show_documents($modulepart,$filename,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$modelliste=array(),$forcenomultilang=0) + function show_documents($modulepart,$filename,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$modelliste=array(),$forcenomultilang=0,$iconPDF=0) { // filedir = conf->...dir_ouput."/".get_exdir(id) @@ -2908,191 +2908,199 @@ class Form // Affiche en-tete tableau if ($genallowed) { - $modellist=array(); - if ($modulepart == 'propal') - { - if (is_array($genallowed)) $modellist=$genallowed; - else - { - include_once(DOL_DOCUMENT_ROOT.'/includes/modules/propale/modules_propale.php'); - $model=new ModelePDFPropales(); - $modellist=$model->liste_modeles($this->db); - } + $modellist=array(); + if ($modulepart == 'propal') + { + if (is_array($genallowed)) $modellist=$genallowed; + else + { + include_once(DOL_DOCUMENT_ROOT.'/includes/modules/propale/modules_propale.php'); + $model=new ModelePDFPropales(); + $modellist=$model->liste_modeles($this->db); } - else if ($modulepart == 'commande') + } + else if ($modulepart == 'commande') + { + if (is_array($genallowed)) $modellist=$genallowed; + else { - if (is_array($genallowed)) $modellist=$genallowed; - else - { - include_once(DOL_DOCUMENT_ROOT.'/includes/modules/commande/modules_commande.php'); - $model=new ModelePDFCommandes(); - $modellist=$model->liste_modeles($this->db); - } + include_once(DOL_DOCUMENT_ROOT.'/includes/modules/commande/modules_commande.php'); + $model=new ModelePDFCommandes(); + $modellist=$model->liste_modeles($this->db); } - elseif ($modulepart == 'expedition') + } + elseif ($modulepart == 'expedition') + { + if (is_array($genallowed)) $modellist=$genallowed; + else { - if (is_array($genallowed)) $modellist=$genallowed; - else - { - include_once(DOL_DOCUMENT_ROOT.'/expedition/mods/pdf/ModelePdfExpedition.class.php'); - $model=new ModelePDFExpedition(); - $modellist=$model->liste_modeles($this->db); - } + include_once(DOL_DOCUMENT_ROOT.'/expedition/mods/pdf/ModelePdfExpedition.class.php'); + $model=new ModelePDFExpedition(); + $modellist=$model->liste_modeles($this->db); } - elseif ($modulepart == 'livraison') + } + elseif ($modulepart == 'livraison') + { + if (is_array($genallowed)) $modellist=$genallowed; + else { - if (is_array($genallowed)) $modellist=$genallowed; - else - { - include_once(DOL_DOCUMENT_ROOT.'/livraison/mods/modules_livraison.php'); - $model=new ModelePDFDeliveryOrder(); - $modellist=$model->liste_modeles($this->db); - } + include_once(DOL_DOCUMENT_ROOT.'/livraison/mods/modules_livraison.php'); + $model=new ModelePDFDeliveryOrder(); + $modellist=$model->liste_modeles($this->db); } - else if ($modulepart == 'ficheinter') + } + else if ($modulepart == 'ficheinter') + { + if (is_array($genallowed)) $modellist=$genallowed; + else { - if (is_array($genallowed)) $modellist=$genallowed; - else - { - include_once(DOL_DOCUMENT_ROOT.'/includes/modules/fichinter/modules_fichinter.php'); - $model=new ModelePDFFicheinter(); - $modellist=$model->liste_modeles($this->db); - } + include_once(DOL_DOCUMENT_ROOT.'/includes/modules/fichinter/modules_fichinter.php'); + $model=new ModelePDFFicheinter(); + $modellist=$model->liste_modeles($this->db); } - elseif ($modulepart == 'facture') + } + elseif ($modulepart == 'facture') + { + if (is_array($genallowed)) $modellist=$genallowed; + else { - if (is_array($genallowed)) $modellist=$genallowed; - else - { - include_once(DOL_DOCUMENT_ROOT.'/includes/modules/facture/modules_facture.php'); - $model=new ModelePDFFactures(); - $modellist=$model->liste_modeles($this->db); - } + include_once(DOL_DOCUMENT_ROOT.'/includes/modules/facture/modules_facture.php'); + $model=new ModelePDFFactures(); + $modellist=$model->liste_modeles($this->db); } - elseif ($modulepart == 'export') + } + elseif ($modulepart == 'export') + { + if (is_array($genallowed)) $modellist=$genallowed; + else { - if (is_array($genallowed)) $modellist=$genallowed; - else - { - include_once(DOL_DOCUMENT_ROOT.'/includes/modules/export/modules_export.php'); - $model=new ModeleExports(); - $modellist=$model->liste_modeles($this->db); - } - } - else if ($modulepart == 'commande_fournisseur') - { - if (is_array($genallowed)) $modellist=$genallowed; - else - { - include_once(DOL_DOCUMENT_ROOT.'/fourn/commande/modules/modules_commandefournisseur.php'); - $model=new ModelePDFSuppliersOrders(); - $modellist=$model->liste_modeles($this->db); - } - } - else if ($modulepart == 'facture_fournisseur') - { - if (is_array($genallowed)) $modellist=$genallowed; - else - { - include_once(DOL_DOCUMENT_ROOT.'/fourn/facture/modules/modules_facturefournisseur.php'); - $model=new ModelePDFFacturesSuppliers(); - $modellist=$model->liste_modeles($this->db); - } - } - else if ($modulepart == 'remisecheque') - { - if (is_array($genallowed)) $modellist=$genallowed; - else - { - // ?? - } - } - else - { - dolibarr_print_error($this->db,'Bad value for modulepart'); - return -1; + include_once(DOL_DOCUMENT_ROOT.'/includes/modules/export/modules_export.php'); + $model=new ModeleExports(); + $modellist=$model->liste_modeles($this->db); } + } + else if ($modulepart == 'commande_fournisseur') + { + if (is_array($genallowed)) $modellist=$genallowed; + else + { + include_once(DOL_DOCUMENT_ROOT.'/fourn/commande/modules/modules_commandefournisseur.php'); + $model=new ModelePDFSuppliersOrders(); + $modellist=$model->liste_modeles($this->db); + } + } + else if ($modulepart == 'facture_fournisseur') + { + if (is_array($genallowed)) $modellist=$genallowed; + else + { + include_once(DOL_DOCUMENT_ROOT.'/fourn/facture/modules/modules_facturefournisseur.php'); + $model=new ModelePDFFacturesSuppliers(); + $modellist=$model->liste_modeles($this->db); + } + } + else if ($modulepart == 'remisecheque') + { + if (is_array($genallowed)) $modellist=$genallowed; + else + { + // ?? + } + } + else + { + dolibarr_print_error($this->db,'Bad value for modulepart'); + return -1; + } + + $headershown=1; - $headershown=1; - - print '
'; - print ''; + print ''; + print ''; + + print_titre($langs->trans("Documents")); + print ''; - print_titre($langs->trans("Documents")); - print '
'; - - print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; } // Recupe liste des fichiers $file_list=dolibarr_dir_list($filedir,'files',0,'','\.meta$','date',SORT_DESC); // Affiche en-tete tableau si non deja affiché - if (sizeof($file_list) && ! $headershown) + if (sizeof($file_list) && ! $headershown && !$iconPDF) { $headershown=1; - - print_titre($langs->trans("Documents")); - print '
'.$langs->trans('Model').''; - $this->select_array('model',$modellist,$modelselected,0,0,1); - $texte=$langs->trans('Generate'); - print ''; - if($conf->global->MAIN_MULTILANGS && ! $forcenomultilang) - { - $this->select_lang($langs->getDefaultLang()); - } - else - { - print ' '; - } - print ''; - print ''; - print '
'.$langs->trans('Model').''; + $this->select_array('model',$modellist,$modelselected,0,0,1); + $texte=$langs->trans('Generate'); + print ''; + if($conf->global->MAIN_MULTILANGS && ! $forcenomultilang) + { + $this->select_lang($langs->getDefaultLang()); + } + else + { + print ' '; + } + print ''; + print ''; + print '
'; + print_titre($langs->trans("Documents")); + print '
'; } // Boucle sur chaque ligne trouvée foreach($file_list as $i => $file) { - - // Défini chemin relatif par rapport au module pour lien download - $relativepath=$file["name"]; // Cas general - if ($filename) $relativepath=$filename."/".$file["name"]; // Cas prpal, facture... - // Autre cas - if ($modulepart == 'don') { $relativepath = get_exdir($filename,2).$file["name"]; } - if ($modulepart == 'export') { $relativepath = $file["name"]; } + // Défini chemin relatif par rapport au module pour lien download + $relativepath=$file["name"]; // Cas general + if ($filename) $relativepath=$filename."/".$file["name"]; // Cas prpal, facture... + // Autre cas + if ($modulepart == 'don') { $relativepath = get_exdir($filename,2).$file["name"]; } + if ($modulepart == 'export') { $relativepath = $file["name"]; } + + // Défini le type MIME du document + if (eregi('\.([^\.]+)$',$file["name"],$reg)) $extension=$reg[1]; + $mimetype=strtoupper($extension); + if ($extension == 'pdf') $mimetype='PDF'; + if ($extension == 'html') $mimetype='HTML'; + if (eregi('\-detail\.pdf',$file["name"])) $mimetype='PDF Détaillé'; - // Défini le type MIME du document - if (eregi('\.([^\.]+)$',$file["name"],$reg)) $extension=$reg[1]; - $mimetype=strtoupper($extension); - if ($extension == 'pdf') $mimetype='PDF'; - if ($extension == 'html') $mimetype='HTML'; - if (eregi('\-detail\.pdf',$file["name"])) $mimetype='PDF Détaillé'; + if (!$iconPDF) print ""; - print ""; - - // Affiche colonne type MIME - print ''; - // Affiche nom fichier avec lien download - print ''; - // Affiche taille fichier - print ''; - // Affiche date fichier - print ''; + // Affiche colonne type MIME + if (!$iconPDF) print ''; + // Affiche nom fichier avec lien download + if (!$iconPDF) print ''; + // Affiche taille fichier + if (!$iconPDF) print ''; + // Affiche date fichier + if (!$iconPDF) print ''; if ($delallowed) { print ''; } - print ''; + if (!$iconPDF) print ''; - $i++; - } + $i++; + } if ($headershown) diff --git a/htdocs/lib/functions.inc.php b/htdocs/lib/functions.inc.php index f19120f05bc..27d7c73cc7a 100644 --- a/htdocs/lib/functions.inc.php +++ b/htdocs/lib/functions.inc.php @@ -787,13 +787,14 @@ function img_file_new($alt = "default") /** \brief Affiche logo pdf \param alt Texte sur le alt de l'image + \param $size Taille de l'icone : 3 = 16x16px , 2 = 14x14px \return string Retourne tag img */ -function img_pdf($alt = "default") +function img_pdf($alt = "default",$size=3) { global $conf,$langs; if ($alt=="default") $alt=$langs->trans("Show"); - return ''.$alt.''; + return ''.$alt.''; } /** diff --git a/htdocs/theme/auguria/img/pdf2.png b/htdocs/theme/auguria/img/pdf2.png new file mode 100644 index 00000000000..4702d19fd50 Binary files /dev/null and b/htdocs/theme/auguria/img/pdf2.png differ diff --git a/htdocs/theme/auguria/img/pdf.png b/htdocs/theme/auguria/img/pdf3.png similarity index 100% rename from htdocs/theme/auguria/img/pdf.png rename to htdocs/theme/auguria/img/pdf3.png diff --git a/htdocs/theme/dev/img/pdf2.png b/htdocs/theme/dev/img/pdf2.png new file mode 100644 index 00000000000..4702d19fd50 Binary files /dev/null and b/htdocs/theme/dev/img/pdf2.png differ diff --git a/htdocs/theme/dev/img/pdf.png b/htdocs/theme/dev/img/pdf3.png similarity index 100% rename from htdocs/theme/dev/img/pdf.png rename to htdocs/theme/dev/img/pdf3.png diff --git a/htdocs/theme/dolibarr/img/pdf2.png b/htdocs/theme/dolibarr/img/pdf2.png new file mode 100644 index 00000000000..4702d19fd50 Binary files /dev/null and b/htdocs/theme/dolibarr/img/pdf2.png differ diff --git a/htdocs/theme/dolibarr/img/pdf.png b/htdocs/theme/dolibarr/img/pdf3.png similarity index 100% rename from htdocs/theme/dolibarr/img/pdf.png rename to htdocs/theme/dolibarr/img/pdf3.png diff --git a/htdocs/theme/eldy/img/pdf2.png b/htdocs/theme/eldy/img/pdf2.png new file mode 100644 index 00000000000..4702d19fd50 Binary files /dev/null and b/htdocs/theme/eldy/img/pdf2.png differ diff --git a/htdocs/theme/eldy/img/pdf.png b/htdocs/theme/eldy/img/pdf3.png similarity index 100% rename from htdocs/theme/eldy/img/pdf.png rename to htdocs/theme/eldy/img/pdf3.png diff --git a/htdocs/theme/freelug/img/pdf2.png b/htdocs/theme/freelug/img/pdf2.png new file mode 100644 index 00000000000..4702d19fd50 Binary files /dev/null and b/htdocs/theme/freelug/img/pdf2.png differ diff --git a/htdocs/theme/freelug/img/pdf.png b/htdocs/theme/freelug/img/pdf3.png old mode 100755 new mode 100644 similarity index 100% rename from htdocs/theme/freelug/img/pdf.png rename to htdocs/theme/freelug/img/pdf3.png diff --git a/htdocs/theme/yellow/img/pdf2.png b/htdocs/theme/yellow/img/pdf2.png new file mode 100644 index 00000000000..4702d19fd50 Binary files /dev/null and b/htdocs/theme/yellow/img/pdf2.png differ diff --git a/htdocs/theme/yellow/img/pdf.png b/htdocs/theme/yellow/img/pdf3.png similarity index 100% rename from htdocs/theme/yellow/img/pdf.png rename to htdocs/theme/yellow/img/pdf3.png
'.$mimetype.''.$file["name"].''; - print ''.filesize($filedir."/".$file["name"]). ' bytes'.dolibarr_print_date(filemtime($filedir."/".$file["name"]),'dayhour').''.$mimetype.''; + print ''; + if (!$iconPDF) + { + $file["name"]; + } + else + { + print img_pdf($file["name"],2); + } + print ''; + if (!$iconPDF) print ''.filesize($filedir."/".$file["name"]). ' bytes'.dolibarr_print_date(filemtime($filedir."/".$file["name"]),'dayhour').''.img_delete().'