diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php index 3d7c41181ca..46c2c3bcc8f 100644 --- a/htdocs/admin/security_other.php +++ b/htdocs/admin/security_other.php @@ -25,7 +25,7 @@ require("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); $langs->load("users"); $langs->load("admin"); diff --git a/htdocs/comm/mailing/fiche.php b/htdocs/comm/mailing/fiche.php index 5c18d09655e..cd328fcb27f 100644 --- a/htdocs/comm/mailing/fiche.php +++ b/htdocs/comm/mailing/fiche.php @@ -850,7 +850,7 @@ else print_titre($langs->trans("TestMailing")); // Create l'objet formulaire mail - include_once("../../html.formmail.class.php"); + include_once("../../core/class/html.formmail.class.php"); $formmail = new FormMail($db); $formmail->fromname = $mil->email_from; $formmail->frommail = $mil->email_from; diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 30f17e746aa..d0528c88a97 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -33,7 +33,7 @@ require("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'); require_once(DOL_DOCUMENT_ROOT."/includes/modules/propale/modules_propale.php"); require_once(DOL_DOCUMENT_ROOT.'/comm/action/actioncomm.class.php'); -require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/propal.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php"); if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'); diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index a866f0edeb7..a4fcbd85f08 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -787,7 +787,7 @@ if ($_POST['addfile']) { $mesg = '
'.$langs->trans("FileTransferComplete").'
'; - include_once(DOL_DOCUMENT_ROOT.'/html.formmail.class.php'); + include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'); $formmail = new FormMail($db); // Add file in list of files in session $formmail->add_attached_files($upload_dir . "/" . $_FILES['addedfile']['name'],$_FILES['addedfile']['name'],$_FILES['addedfile']['type']); @@ -842,7 +842,7 @@ if (! empty($_POST['removedfile'])) $message = '
'.$langs->trans("FileWasRemoved",$filetodelete).'
'; //print_r($_FILES); - include_once(DOL_DOCUMENT_ROOT.'/html.formmail.class.php'); + include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'); $formmail = new FormMail($db); $formmail->remove_attached_files($keytodelete); } @@ -915,7 +915,7 @@ if ($_POST['action'] == 'send' && ! $_POST['addfile'] && ! $_POST['removedfile'] } // Create form object - include_once('../html.formmail.class.php'); + include_once('../core/class/html.formmail.class.php'); $formmail = new FormMail($db); $attachedfiles=$formmail->get_attached_files(); @@ -2280,7 +2280,7 @@ else print_titre($langs->trans('SendOrderByMail')); // Cree l'objet formulaire mail - include_once(DOL_DOCUMENT_ROOT.'/html.formmail.class.php'); + include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'); $formmail = new FormMail($db); $formmail->fromtype = 'user'; $formmail->fromid = $user->id; diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index 03a7528a7ae..2772e303943 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -26,7 +26,7 @@ */ require("../main.inc.php"); -require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT ."/core/class/notify.class.php"); require_once(DOL_DOCUMENT_ROOT ."/commande/class/commande.class.php"); diff --git a/htdocs/commande/liste.php b/htdocs/commande/liste.php index 140ca60f902..abc224ab37b 100644 --- a/htdocs/commande/liste.php +++ b/htdocs/commande/liste.php @@ -28,7 +28,7 @@ require("../main.inc.php"); -require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT ."/commande/class/commande.class.php"); $langs->load('orders'); diff --git a/htdocs/compta/commande/fiche.php b/htdocs/compta/commande/fiche.php index 7775f208413..2438637df7d 100644 --- a/htdocs/compta/commande/fiche.php +++ b/htdocs/compta/commande/fiche.php @@ -27,7 +27,7 @@ */ require("../../main.inc.php"); -require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/order.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/sendings.lib.php"); require_once(DOL_DOCUMENT_ROOT ."/commande/class/commande.class.php"); diff --git a/htdocs/compta/commande/liste.php b/htdocs/compta/commande/liste.php index 16aaf809d04..b3d4193ced5 100644 --- a/htdocs/compta/commande/liste.php +++ b/htdocs/compta/commande/liste.php @@ -28,7 +28,7 @@ */ require("../../main.inc.php"); -require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php"); $langs->load('companies'); diff --git a/htdocs/compta/deplacement/fiche.php b/htdocs/compta/deplacement/fiche.php index 6e56a317070..f96517b16e7 100644 --- a/htdocs/compta/deplacement/fiche.php +++ b/htdocs/compta/deplacement/fiche.php @@ -26,7 +26,7 @@ require("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/compta/deplacement/class/deplacement.class.php"); -require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); if ($conf->projet->enabled) { require_once(DOL_DOCUMENT_ROOT."/lib/project.lib.php"); diff --git a/htdocs/compta/dons/fiche.php b/htdocs/compta/dons/fiche.php index 997bb306909..e9b271859a2 100644 --- a/htdocs/compta/dons/fiche.php +++ b/htdocs/compta/dons/fiche.php @@ -26,7 +26,7 @@ require("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/includes/modules/dons/modules_don.php"); -require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT."/compta/dons/class/don.class.php"); require_once(DOL_DOCUMENT_ROOT."/compta/paiement/class/paiement.class.php"); if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT.'/lib/project.lib.php'); diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 738c14c72b2..103b3961510 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1105,7 +1105,7 @@ if ($_POST['addfile']) { $mesg = '
'.$langs->trans("FileTransferComplete").'
'; - include_once(DOL_DOCUMENT_ROOT.'/html.formmail.class.php'); + include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'); $formmail = new FormMail($db); $formmail->add_attached_files($upload_dir . "/" . $_FILES['addedfile']['name'],$_FILES['addedfile']['name'],$_FILES['addedfile']['type']); } @@ -1159,7 +1159,7 @@ if (! empty($_POST['removedfile'])) $message = '
'.$langs->trans("FileWasRemoved",$filetodelete).'
'; //print_r($_FILES); - include_once(DOL_DOCUMENT_ROOT.'/html.formmail.class.php'); + include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'); $formmail = new FormMail($db); $formmail->remove_attached_files($keytodelete); } @@ -1245,7 +1245,7 @@ if (($_POST['action'] == 'send' || $_POST['action'] == 'relance') && ! $_POST['a } // Create form object - include_once('../html.formmail.class.php'); + include_once('../core/class/html.formmail.class.php'); $formmail = new FormMail($db); $attachedfiles=$formmail->get_attached_files(); @@ -3441,7 +3441,7 @@ else print_titre($langs->trans($titre)); // Cree l'objet formulaire mail - include_once(DOL_DOCUMENT_ROOT.'/html.formmail.class.php'); + include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'); $formmail = new FormMail($db); $formmail->fromtype = 'user'; $formmail->fromid = $user->id; diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php index ab53100f58f..85473925b98 100644 --- a/htdocs/compta/facture/document.php +++ b/htdocs/compta/facture/document.php @@ -31,7 +31,7 @@ require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php"); require_once(DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'); require_once(DOL_DOCUMENT_ROOT."/lib/invoice.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); $langs->load('propal'); $langs->load('compta'); diff --git a/htdocs/compta/facture/impayees.php b/htdocs/compta/facture/impayees.php index 479052c3d90..aac3843ab31 100644 --- a/htdocs/compta/facture/impayees.php +++ b/htdocs/compta/facture/impayees.php @@ -27,7 +27,7 @@ */ require("../../main.inc.php"); -require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php"); require_once(DOL_DOCUMENT_ROOT."/compta/paiement/class/paiement.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php"); diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 1dcfb43c156..ab444d9df45 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -26,7 +26,7 @@ */ require('../main.inc.php'); -require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'); require_once(DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'); if ($conf->commande->enabled) require_once(DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'); diff --git a/htdocs/compta/paiement/cheque/fiche.php b/htdocs/compta/paiement/cheque/fiche.php index 8c67422043e..73114b6a51b 100644 --- a/htdocs/compta/paiement/cheque/fiche.php +++ b/htdocs/compta/paiement/cheque/fiche.php @@ -26,7 +26,7 @@ */ require("./pre.inc.php"); // We use pre.inc.php to have a dynamic menu -require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'); require_once(DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/remisecheque.class.php'); require_once(DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'); diff --git a/htdocs/compta/propal.php b/htdocs/compta/propal.php index 3858083b65b..e9a17f92b4a 100644 --- a/htdocs/compta/propal.php +++ b/htdocs/compta/propal.php @@ -29,7 +29,7 @@ */ require('../main.inc.php'); -require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT."/comm/propal/class/propal.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/propal.lib.php"); if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'); diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php index 9c6c02363c9..9187a4f34b4 100644 --- a/htdocs/contrat/document.php +++ b/htdocs/contrat/document.php @@ -31,7 +31,7 @@ require ("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/contract.lib.php"); require_once(DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); $langs->load("other"); $langs->load("products"); diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php new file mode 100644 index 00000000000..a60e28876ca --- /dev/null +++ b/htdocs/core/class/html.formfile.class.php @@ -0,0 +1,530 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/** + * \file htdocs/html.formfile.class.php + * \brief Fichier de la classe des fonctions predefinie de composants html fichiers + * \version $Id$ + */ + + +/** + * \class FormFile + * \brief Classe permettant la generation de composants html fichiers + */ +class FormFile +{ + var $db; + var $error; + + + /** + * \brief Constructeur + * \param DB handler d'acces base de donnee + */ + function FormFile($DB) + { + $this->db = $DB; + + return 1; + } + + + /** + * \brief Show file add form + * \param url Url + * \param title Title zone + * \param addcancel 1=Add 'Cancel' button + * \param sectionid If upload must be done inside a particular ECM section + * \param perm Value of permission to allow upload + * \return int <0 si ko, >0 si ok + */ + function form_attach_new_file($url,$title='',$addcancel=0, $sectionid=0, $perm=1) + { + global $conf,$langs; + + print "\n\n\n"; + + if (! $title) $title=$langs->trans("AttachANewFile"); + print_titre($title); + + print '
'; + print ''; + print ''; + + print ''; + print '"; + print "
'; + + $max=$conf->global->MAIN_UPLOAD_DOC; // En Kb + $maxphp=@ini_get('upload_max_filesize'); // En inconnu + if (preg_match('/m$/i',$maxphp)) $maxphp=$maxphp*1024; + if (preg_match('/k$/i',$maxphp)) $maxphp=$maxphp; + // Now $max and $maxphp are in Kb + if ($maxphp > 0) $max=min($max,$maxphp); + + if ($max > 0) + { + print ''; + } + print 'global->MAIN_UPLOAD_DOC) || empty($perm)?' disabled="true"':''); + print '>'; + print '   '; + print 'global->MAIN_UPLOAD_DOC) || empty($perm)?' disabled="true"':''); + print '>'; + + if ($addcancel) + { + print '   '; + print ''; + } + + if (! empty($conf->global->MAIN_UPLOAD_DOC)) + { + if ($perm) + { + print ' ('.$langs->trans("MaxSize").': '.$max.' '.$langs->trans("Kb"); + print ' '.info_admin($langs->trans("ThisLimitIsDefinedInSetup",$max,$maxphp),1); + print ')'; + } + } + else + { + print ' ('.$langs->trans("UploadDisabled").')'; + } + print "
"; + + print '
'; + if (empty($sectionid)) print '
'; + + print "\n\n\n"; + + return 1; + } + + + /** + * \brief Show the box with list of available documents for object + * \param modulepart propal=propal, facture=facture, ... + * \param filename Sub dir to scan (Example: '9/9', 'FA9999'). Use '' if filedir already complete) + * \param filedir Dir to scan + * \param urlsource Url of origin page (for return) + * \param genallowed Generation is allowed (1/0 or array of formats) + * \param delallowed Remove is allowed (1/0) + * \param modelselected Model to preselect by default + * \param allowgenifempty Show warning if no model activated + * \param forcenomultilang Do not show language option (even if MAIN_MULTILANGS defined) + * \param iconPDF Show only PDF icon with link (1/0) + * \param maxfilenamelength Max length for filename shown + * \param noform Do not output html form tags + * \param param More param on http links + * \param title Title to show on top of form + * \param buttonlabel Label on submit button + * \param codelang Default language code to use on lang combo box if multilang is enabled + * \return int <0 if KO, number of shown files if OK + */ + function show_documents($modulepart,$filename,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$allowgenifempty=1,$forcenomultilang=0,$iconPDF=0,$maxfilenamelength=28,$noform=0,$param='',$title='',$buttonlabel='',$codelang='') + { + // filedir = conf->...dir_ouput."/".get_exdir(id) + include_once(DOL_DOCUMENT_ROOT.'/lib/files.lib.php'); + + global $langs,$bc,$conf; + $var=true; + + if ($iconPDF == 1) + { + $genallowed = ''; + $delallowed = 0; + $modelselected = ''; + $forcenomultilang=0; + } + + $filename = dol_sanitizeFileName($filename); + $headershown=0; + $showempty=0; + $i=0; + + print "\n".''."\n"; + //print 'filedir='.$filedir; + + // Affiche en-tete tableau + if ($genallowed) + { + $modellist=array(); + if ($modulepart == 'company') + { + $showempty=1; + if (is_array($genallowed)) $modellist=$genallowed; + else + { + include_once(DOL_DOCUMENT_ROOT.'/includes/modules/societe/modules_societe.class.php'); + $model=new ModeleThirdPartyDoc(); + $modellist=$model->liste_modeles($this->db); + } + } + else 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') + { + 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); + } + } + elseif ($modulepart == 'expedition') + { + if (is_array($genallowed)) $modellist=$genallowed; + else + { + include_once(DOL_DOCUMENT_ROOT.'/includes/modules/expedition/pdf/ModelePdfExpedition.class.php'); + $model=new ModelePDFExpedition(); + $modellist=$model->liste_modeles($this->db); + } + } + elseif ($modulepart == 'livraison') + { + if (is_array($genallowed)) $modellist=$genallowed; + else + { + include_once(DOL_DOCUMENT_ROOT.'/includes/modules/livraison/modules_livraison.php'); + $model=new ModelePDFDeliveryOrder(); + $modellist=$model->liste_modeles($this->db); + } + } + else if ($modulepart == 'ficheinter') + { + 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); + } + } + elseif ($modulepart == 'facture') + { + 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); + } + } + elseif ($modulepart == 'project') + { + if (is_array($genallowed)) $modellist=$genallowed; + else + { + include_once(DOL_DOCUMENT_ROOT.'/includes/modules/project/modules_project.php'); + $model=new ModelePDFProjects(); + $modellist=$model->liste_modeles($this->db); + } + } + elseif ($modulepart == 'export') + { + 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.'/includes/modules/supplier_order/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 + { + // ?? + } + } + elseif ($modulepart == 'donation') + { + if (is_array($genallowed)) $modellist=$genallowed; + else + { + include_once(DOL_DOCUMENT_ROOT.'/includes/modules/dons/modules_don.php'); + $model=new ModeleDon(); + $modellist=$model->liste_modeles($this->db); + } + } + else if ($modulepart == 'unpaid') + { + $modellist=''; + } + else + { + dol_print_error($this->db,'Bad value for modulepart'); + return -1; + } + + $headershown=1; + + $html = new Form($db); + $buttonlabeltoshow=$buttonlabel; + if (empty($buttonlabel)) $buttonlabel=$langs->trans('Generate'); + + if (empty($noform)) print '
'; + print ''; + print ''; + + print_titre($langs->trans("Documents")); + print ''; + + print ''; + + // Model + if (! empty($modellist)) + { + print ''; + } + else + { + print ''; + } + + // Language code (if multilang) + print ''; + + // Button + print ''; + + print ''; + } + + // Get list of files + $png = ''; + $filter = ''; + if ($iconPDF==1) + { + $png = '\.png$'; + $filter = $filename.'.pdf'; + } + $file_list=dol_dir_list($filedir,'files',0,$filter,'\.meta$'.($png?'|'.$png:''),'date',SORT_DESC); + + // Affiche en-tete tableau si non deja affiche + if (sizeof($file_list) && ! $headershown && !$iconPDF) + { + $headershown=1; + $titletoshow=$langs->trans("Documents"); + if (! empty($title)) $titletoshow=$title; + print_titre($titletoshow); + print '
'; + print $langs->trans('Model').' '; + print $html->selectarray('model',$modellist,$modelselected,$showempty,0,0); + print ''; + print $langs->trans("Files"); + print ''; + if (($allowgenifempty || (is_array($modellist) && sizeof($modellist) > 0)) && $conf->global->MAIN_MULTILANGS && ! $forcenomultilang) + { + include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'); + $formadmin=new FormAdmin($this->db); + $defaultlang=$codelang?$codelang:$langs->getDefaultLang(); + $formadmin->select_lang($defaultlang); + } + else + { + print ' '; + } + print ''; + print ''; + if ($allowgenifempty && ! is_array($modellist) && empty($modellist)) + { + $langs->load("errors"); + print ' '.img_warning($langs->trans("WarningNoDocumentModelActivated")); + } + print '
'; + } + + // Loop on each file found + foreach($file_list as $i => $file) + { + $var=!$var; + + // Define relative path for download link (depends on module) + $relativepath=$file["name"]; // Cas general + if ($filename) $relativepath=$filename."/".$file["name"]; // Cas propal, facture... + // Autre cas + if ($modulepart == 'donation') { $relativepath = get_exdir($filename,2).$file["name"]; } + if ($modulepart == 'export') { $relativepath = $file["name"]; } + + if (!$iconPDF) print ""; + + // Show file name with link to download + if (!$iconPDF) print ''; + // Affiche taille fichier + if (!$iconPDF) print ''; + // Affiche date fichier + if (!$iconPDF) print ''; + + if ($delallowed) + { + print ''; + } + + if (!$iconPDF) print ''; + + $i++; + } + + + if ($headershown) + { + // Affiche pied du tableau + print "
'; + print ''; + if (!$iconPDF) + { + print img_mime($file["name"],$langs->trans("File").': '.$file["name"]).' '.dol_trunc($file["name"],$maxfilenamelength); + } + else + { + print img_pdf($file["name"],2); + } + print ''; + if (!$iconPDF) print ''.dol_print_size(dol_filesize($filedir."/".$file["name"])).''.dol_print_date(dol_filemtime($filedir."/".$file["name"]),'dayhour').''.img_delete().'
\n"; + if ($genallowed) + { + if (empty($noform)) print '
'."\n"; + } + } + print ''."\n"; + return ($i?$i:$headershown); + } + + + /** + * \brief Show list of documents in a directory + * \param filearray Array of files loaded by dol_dir_list function + * \param object Object on which document is linked to + * \param modulepart Value for modulepart used by download wrapper + * \param param Parameters on sort links + * \param forcedownload Force to open dialog box "Save As" when clicking on file + * \param relativepath Relative path of docs (autodefined if not provided) + * \param permtodelete Permission to delete + * \param useinecm Change output for use in ecm module + * \param textifempty Text to show if filearray is empty + * \return int <0 if KO, nb of files shown if OK + */ + function list_of_documents($filearray,$object,$modulepart,$param,$forcedownload=0,$relativepath='',$permtodelete=1,$useinecm=0,$textifempty='',$maxlength=0) + { + global $user, $conf, $langs; + global $bc; + global $sortfield, $sortorder; + + // Affiche liste des documents existant + if (empty($useinecm)) print_titre($langs->trans("AttachedFiles")); + else { $bc[true]=''; $bc[false]=''; }; + $url=$_SERVER["PHP_SELF"]; + print ''; + print ''; + print_liste_field_titre($langs->trans("Documents2"),$_SERVER["PHP_SELF"],"name","",$param,'align="left"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Size"),$_SERVER["PHP_SELF"],"size","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"date","",$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre('','',''); + print ''; + + $var=true; + foreach($filearray as $key => $file) + { + if (!is_dir($dir.$file['name']) + && $file['name'] != '.' + && $file['name'] != '..' + && $file['name'] != 'CVS' + && ! preg_match('/\.meta$/i',$file['name'])) + { + // Define relative path used to store the file + if (! $relativepath) $relativepath=dol_sanitizeFileName($object->ref).'/'; + + $var=!$var; + print "\n"; + print ''; + print ''; + print '\n"; + } + } + if (sizeof($filearray) == 0) + { + print ''; + } + print "
"; + //print "XX".$file['name']; //$file['name'] must be utf8 + print ''; + print img_mime($file['name'],$file['name'].' ('.dol_print_size($file['size'],0,0).')').' '; + print dol_trunc($file['name'],$maxlength,'middle'); + print ''; + print "'.dol_print_size($file['size'],1,1).''.dol_print_date($file['date'],"dayhour").''; + //print ' '; + if ($permtodelete) + print ''.img_delete().''; + else + print ' '; + print "
'; + if (empty($textifempty)) print $langs->trans("NoFileFound"); + else print $textifempty; + print '
"; + // Fin de zone + + } + +} + +?> diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php new file mode 100644 index 00000000000..14ade64a27a --- /dev/null +++ b/htdocs/core/class/html.formmail.class.php @@ -0,0 +1,577 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/** + * \file htdocs/html.formmail.class.php + * \brief Fichier de la classe permettant la generation du formulaire html d'envoi de mail unitaire + * \version $Id$ + */ + +require_once(DOL_DOCUMENT_ROOT ."/core/class/html.form.class.php"); + + +/** \class FormMail + * \brief Classe permettant la generation du formulaire html d'envoi de mail unitaire + * \remarks Utilisation: $formail = new FormMail($db) + * \remarks $formmail->proprietes=1 ou chaine ou tableau de valeurs + * \remarks $formmail->show_form() affiche le formulaire + */ +class FormMail +{ + var $db; + + var $fromname; + var $frommail; + var $replytoname; + var $replytomail; + var $toname; + var $tomail; + + var $withsubstit; // Show substitution array + var $withfrom; + var $withto; + var $withtocc; + var $withtopic; + var $withfile; // 0=No attaches files, 1=Show attached files, 2=Can add new attached files + var $withbody; + + var $withfromreadonly; + var $withreplytoreadonly; + var $withtoreadonly; + var $withtoccreadonly; + var $withtopicreadonly; + var $withdeliveryreceipt; + var $withcancel; + + var $substit=array(); + var $param=array(); + + var $error; + + + /** + * \brief Constructeur + * \param DB handler d'acces base de donnee + */ + function FormMail($DB) + { + $this->db = $DB; + + $this->withfrom=1; + $this->withto=1; + $this->withtocc=1; + $this->withtoccc=0; + $this->witherrorsto=0; + $this->withtopic=1; + $this->withfile=0; + $this->withbody=1; + + $this->withfromreadonly=1; + $this->withreplytoreadonly=1; + $this->withtoreadonly=0; + $this->withtoccreadonly=0; + $this->witherrorstoreadonly=0; + $this->withtopicreadonly=0; + $this->withbodyreadonly=0; + $this->withdeliveryreceiptreadonly=0; + + return 1; + } + + /** + * Clear list of attached files in send mail form (stored in session) + */ + function clear_attached_files() + { + global $conf,$user; + + // Set tmp user directory + $vardir=$conf->user->dir_output."/".$user->id; + $upload_dir = $vardir.'/temp/'; + if (is_dir($upload_dir)) dol_delete_dir_recursive($upload_dir); + + unset($_SESSION["listofpaths"]); + unset($_SESSION["listofnames"]); + unset($_SESSION["listofmimes"]); + } + + /** + * Add a file into the list of attached files (stored in SECTION array) + * + * @param unknown_type $path + * @param unknown_type $file + * @param unknown_type $type + */ + function add_attached_files($path,$file,$type) + { + $listofpaths=array(); + $listofnames=array(); + $listofmimes=array(); + if (! empty($_SESSION["listofpaths"])) $listofpaths=explode(';',$_SESSION["listofpaths"]); + if (! empty($_SESSION["listofnames"])) $listofnames=explode(';',$_SESSION["listofnames"]); + if (! empty($_SESSION["listofmimes"])) $listofmimes=explode(';',$_SESSION["listofmimes"]); + if (! in_array($file,$listofnames)) + { + $listofpaths[]=$path; + $listofnames[]=$file; + $listofmimes[]=$type; + $_SESSION["listofpaths"]=join(';',$listofpaths); + $_SESSION["listofnames"]=join(';',$listofnames); + $_SESSION["listofmimes"]=join(';',$listofmimes); + } + } + + /** + * Remove a file from the list of attached files (stored in SECTION array) + * + * @param unknown_type $file + */ + function remove_attached_files($keytodelete) + { + $listofpaths=array(); + $listofnames=array(); + $listofmimes=array(); + if (! empty($_SESSION["listofpaths"])) $listofpaths=explode(';',$_SESSION["listofpaths"]); + if (! empty($_SESSION["listofnames"])) $listofnames=explode(';',$_SESSION["listofnames"]); + if (! empty($_SESSION["listofmimes"])) $listofmimes=explode(';',$_SESSION["listofmimes"]); + if ($keytodelete >= 0) + { + unset ($listofpaths[$keytodelete]); + unset ($listofnames[$keytodelete]); + unset ($listofmimes[$keytodelete]); + $_SESSION["listofpaths"]=join(';',$listofpaths); + $_SESSION["listofnames"]=join(';',$listofnames); + $_SESSION["listofmimes"]=join(';',$listofmimes); + //var_dump($_SESSION['listofpaths']); + } + } + + /** + * Return list of attached files (stored in SECTION array) + * + * @return unknown_type $type + */ + function get_attached_files() + { + $listofpaths=array(); + $listofnames=array(); + $listofmimes=array(); + if (! empty($_SESSION["listofpaths"])) $listofpaths=explode(';',$_SESSION["listofpaths"]); + if (! empty($_SESSION["listofnames"])) $listofnames=explode(';',$_SESSION["listofnames"]); + if (! empty($_SESSION["listofmimes"])) $listofmimes=explode(';',$_SESSION["listofmimes"]); + return array('paths'=>$listofpaths, 'names'=>$listofnames, 'mimes'=>$listofmimes); + } + + /** + * \brief Show the form to input an email + * \param addfileaction Name of action when posting file attachments + * \param removefileaction Name of action when removing file attachments + * \remarks this->withfile: 0=No attaches files, 1=Show attached files, 2=Can add new attached files + */ + function show_form($addfileaction='addfile',$removefileaction='removefile') + { + global $conf, $langs, $user; + + $langs->load("other"); + $langs->load("mails"); + + // Define list of attached files + $listofpaths=array(); + $listofnames=array(); + $listofmimes=array(); + if (! empty($_SESSION["listofpaths"])) $listofpaths=explode(';',$_SESSION["listofpaths"]); + if (! empty($_SESSION["listofnames"])) $listofnames=explode(';',$_SESSION["listofnames"]); + if (! empty($_SESSION["listofmimes"])) $listofmimes=explode(';',$_SESSION["listofmimes"]); + + + $form=new Form($DB); + + print "\n\n"; + print "
param["returnurl"]."\">\n"; + print ''; + foreach ($this->param as $key=>$value) + { + print "\n"; + } + print "\n"; + + // Substitution array + if ($this->withsubstit) + { + print "\n"; + } + + // From + if ($this->withfrom) + { + if ($this->withfromreadonly) + { + print ''; + print ''; + print "\n"; + print "\n"; + } + else + { + print "\n"; + } + } + + // Replyto + if ($this->withreplyto) + { + if ($this->withreplytoreadonly) + { + print ''; + print ''; + print "\n"; + } + } + + // Errorsto + if ($this->witherrorsto) + { + //if (! $this->errorstomail) $this->errorstomail=$this->frommail; + if ($this->witherrorstoreadonly) + { + print ''; + print "\n"; + } + else + { + print "\n"; + } + } + + // To + if ($this->withto || is_array($this->withto)) + { + print '\n"; + } + + // CC + if ($this->withtocc || is_array($this->withtocc)) + { + print '\n"; + } + + // CCC + if ($this->withtoccc || is_array($this->withtoccc)) + { + print '\n"; + } + + // Ask delivery receipt + if ($this->withdeliveryreceipt) + { + print '\n"; + } + + // Topic + if ($this->withtopic) + { + $this->withtopic=make_substitutions($this->withtopic,$this->substit,$langs); + + print ""; + print ""; + print "\n"; + } + + // Attached files + if ($this->withfile) + { + print ""; + print '"; + print "\n"; + } + + // Message + if ($this->withbody) + { + $defaultmessage=""; + + // TODO A partir du type, proposer liste de messages dans table llx_models + if ($this->param["models"]=='body') { $defaultmessage=$this->withbody; } + if ($this->param["models"]=='facture_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendInvoice"); } + if ($this->param["models"]=='facture_relance') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendInvoiceReminder"); } + if ($this->param["models"]=='propal_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendProposal"); } + if ($this->param["models"]=='order_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendOrder"); } + + $defaultmessage=make_substitutions($defaultmessage,$this->substit,$langs); + if (isset($_POST["message"])) $defaultmessage=$_POST["message"]; + $defaultmessage=str_replace('\n',"\n",$defaultmessage); + + print ""; + print ""; + print "\n"; + } + + print "\n"; + print "
"; + $help=""; + foreach($this->substit as $key => $val) + { + $help.=$key.' -> '.$langs->trans($val).'
'; + } + print $form->textwithpicto($langs->trans("EMailTestSubstitutionReplacedByGenericValues"),$help); + print "
".$langs->trans("MailFrom").""; + if ($this->fromtype == 'user') + { + $langs->load("users"); + $fuser=new User($this->db); + $fuser->fetch($this->fromid); + print $fuser->getNomUrl(1); + } + else + { + print $this->fromname; + } + if ($this->frommail) + { + print " <".$this->frommail.">"; + } + else + { + if ($this->fromtype) + { + $langs->load("errors"); + print ' <'.$langs->trans("ErrorNoMailDefinedForThisUser").'> '; + } + } + print "
".$langs->trans("MailFrom").""; + print $langs->trans("Name").':'; + print '    '; + print $langs->trans("EMail").':<>'; + print "
".$langs->trans("MailReply")."".$this->replytoname.($this->replytomail?(" <".$this->replytomail.">"):""); + print "
".$langs->trans("MailErrorsTo").""; + print $this->errorstomail; + print "
".$langs->trans("MailErrorsTo").""; + print "errorstomail."\">"; + print "
'; + print $form->textwithpicto($langs->trans("MailTo"),$langs->trans("YouCanUseCommaSeparatorForSeveralRecipients")); + print ''; + if ($this->withtoreadonly) + { + print (! is_array($this->withto) && ! is_numeric($this->withto))?$this->withto:""; + } + else + { + print "withto)?"30":"60")."\" name=\"sendto\" value=\"".(! is_array($this->withto) && ! is_numeric($this->withto)? (isset($_REQUEST["sendto"])?$_REQUEST["sendto"]:$this->withto) :"")."\">"; + if ($this->withtosocid > 0) + { + $liste=array(); + $liste[0]=' '; + $soc=new Societe($this->db); + $soc->fetch($this->withtosocid); + foreach ($soc->thirdparty_and_contact_email_array() as $key=>$value) + { + $liste[$key]=$value; + } + print " ".$langs->trans("or")." "; + //var_dump($_REQUEST);exit; + print $form->selectarray("receiver", $liste, isset($_REQUEST["receiver"])?$_REQUEST["receiver"]:0); + } + } + print "
'; + print $form->textwithpicto($langs->trans("MailCC"),$langs->trans("YouCanUseCommaSeparatorForSeveralRecipients")); + print ''; + if ($this->withtoccreadonly) + { + print (! is_array($this->withtocc) && ! is_numeric($this->withtocc))?$this->withtocc:""; + } + else + { + print "withtocc)?"30":"60")."\" name=\"sendtocc\" value=\"".((! is_array($this->withtocc) && ! is_numeric($this->withtocc))? (isset($_POST["sendtocc"])?$_POST["sendtocc"]:$this->withtocc) : (isset($_POST["sendtocc"])?$_POST["sendtocc"]:"") )."\">"; + if ($this->withtoccsocid > 0) + { + $liste=array(); + $liste[0]=' '; + $soc=new Societe($this->db); + $soc->fetch($this->withtoccsocid); + foreach ($soc->thirdparty_and_contact_email_array() as $key=>$value) + { + $liste[$key]=$value; + } + print " ".$langs->trans("or")." "; + $form->select_array("receivercc", $liste, isset($_REQUEST["receivercc"])?$_REQUEST["receivercc"]:0); + } + } + print "
'; + print $form->textwithpicto($langs->trans("MailCCC"),$langs->trans("YouCanUseCommaSeparatorForSeveralRecipients")); + print ''; + if ($this->withtocccreadonly) + { + print (! is_array($this->withtoccc) && ! is_numeric($this->withtoccc))?$this->withtoccc:""; + } + else + { + print "withtoccc)?"30":"60")."\" name=\"sendtoccc\" value=\"".((! is_array($this->withtoccc) && ! is_numeric($this->withtoccc))? (isset($_POST["sendtoccc"])?$_POST["sendtoccc"]:$this->withtoccc) : (isset($_POST["sendtoccc"])?$_POST["sendtoccc"]:"") )."\">"; + if ($this->withtocccsocid > 0) + { + $liste=array(); + $liste[0]=' '; + $soc=new Societe($this->db); + $soc->fetch($this->withtosocid); + foreach ($soc->thirdparty_and_contact_email_array() as $key=>$value) + { + $liste[$key]=$value; + } + print " ".$langs->trans("or")." "; + $form->select_array("receiverccc", $liste, isset($_REQUEST["receiverccc"])?$_REQUEST["receiverccc"]:0); + } + } + print "
'.$langs->trans("DeliveryReceipt").''; + + if ($this->withdeliveryreceiptreadonly) + { + print yn($this->withdeliveryreceipt); + } + else + { + print $form->selectyesno('deliveryreceipt', (isset($_POST["deliveryreceipt"])?$_POST["deliveryreceipt"]:0) ,1); + } + + print "
".$langs->trans("MailTopic").""; + if ($this->withtopicreadonly) + { + print $this->withtopic; + print "withtopic."\">"; + } + else + { + print "withtopic) ."\">"; + } + print "
'.$langs->trans("MailFile").""; + //print '
'; + if (sizeof($listofpaths)) + { + foreach($listofpaths as $key => $val) + { + print img_mime($listofnames[$key]).' '.$listofnames[$key]; + print ' '; + print '
'; + } + } + else + { + print $langs->trans("NoAttachedFiles").'
'; + } + if ($this->withfile == 2) // Can add other files + { + //print '
'; + print ''; + print ' '; + print ''; + //print '
'; + } + print "
".$langs->trans("MailText").""; + if ($this->withbodyreadonly) + { + print nl2br($defaultmessage); + print ''; + } + else + { + if ($this->withfckeditor) + { + // Editeur wysiwyg + require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); + $doleditor=new DolEditor('message',$defaultmessage,280,'dolibarr_notes','In',true); + $doleditor->Create(); + } + else + { + print ''; + } + + } + print "
"; + print "trans("SendMail")."\""; + // Add a javascript test to avoid to forget to submit file before sending email + if ($this->withfile == 2 && $conf->use_javascript_ajax) + { + print ' onClick="if (document.mailform.addedfile.value != \'\') { alert(\''.dol_escape_js($langs->trans("FileWasNotUploaded")).'\'); return false; } else { return true; }"'; + } + print ">"; + if ($this->withcancel) + { + print "     "; + print "trans("Cancel")."\">"; + } + print "
\n"; + + print "
\n"; + print "\n"; + } + + + /** + * \brief Affiche la partie de formulaire pour saisie d'un mail + * \param withtopic 1 pour proposer a la saisie le sujet + * \param withbody 1 pour proposer a la saisie le corps du message + * \param withfile 1 pour proposer a la saisie l'ajout d'un fichier joint + * \todo Fonction a virer quand fichier /comm/mailing.php vire (= quand ecran dans /comm/mailing prets) + */ + function mail_topicmessagefile($withtopic=1,$withbody=1,$withfile=1,$defaultbody) + { + global $langs; + + $langs->load("other"); + + print ""; + + // Topic + if ($withtopic) + { + print ""; + print ""; + print ""; + } + + // Message + if ($withbody) + { + print ""; + print ""; + print ""; + } + + // Si fichier joint + if ($withfile) + { + print ""; + print ""; + print ""; + } + + print "
".$langs->trans("MailTopic").""; + print ""; + print "
".$langs->trans("MailText").""; + print ""; + print "
".$langs->trans("MailFile").""; + print "trans("Upload")."\"/>"; + print "
"; + } + +} + +?> diff --git a/htdocs/core/class/html.formorder.class.php b/htdocs/core/class/html.formorder.class.php new file mode 100644 index 00000000000..5c1fb4c0469 --- /dev/null +++ b/htdocs/core/class/html.formorder.class.php @@ -0,0 +1,117 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/** + * \file htdocs/html.formorder.class.php + * \brief File of predefined functions for HTML forms for order module + * \version $Id$ + */ + + +/** + * \class FormOrder + * \brief Classe permettant la generation de composants html + * \remarks Only common components must be here. + */ +class FormOrder +{ + var $db; + var $error; + + + + /** + * \brief Constructeur + * \param DB handler d'acces base de donnee + */ + function FormOrder($DB) + { + $this->db = $DB; + + return 1; + } + + + /** + * \brief Renvoie la liste des sources de commandes + * \param selected Id de la source pre-selectionnee + * \param htmlname Nom de la liste deroulante + * \param addempty 0=liste sans valeur nulle, 1=ajoute valeur inconnue + * \return array Tableau des sources de commandes + */ + function selectSourcesCommande($selected='',$htmlname='source_id',$addempty=0) + { + global $conf,$langs; + print ''; + } + + + /** + * + * + */ + function select_methodes_commande($selected='',$htmlname='source_id',$addempty=0) + { + global $conf,$langs; + $listemethodes=array(); + + require_once(DOL_DOCUMENT_ROOT."/core/class/html.form.class.php"); + $form=new Form($this->db); + + $sql = "SELECT rowid, libelle "; + $sql.= " FROM ".MAIN_DB_PREFIX."c_methode_commande_fournisseur"; + $sql.= " WHERE active = 1"; + + dol_syslog("Form::select_methodes_commande sql=".$sql); + $resql=$this->db->query($sql); + if ($resql) + { + $i = 0; + $num = $this->db->num_rows($resql); + while ($i < $num) + { + $obj = $this->db->fetch_object($resql); + $listemethodes[$obj->rowid] = $obj->libelle; + $i++; + } + } + else + { + dol_print_error($this->db); + return -1; + } + + print $form->select_array($htmlname,$listemethodes,$selected,$addempty); + return 1; + } + +} + +?> diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php new file mode 100644 index 00000000000..1b5837e5e6e --- /dev/null +++ b/htdocs/core/class/html.formother.class.php @@ -0,0 +1,493 @@ + + * Copyright (C) 2004-2009 Laurent Destailleur + * Copyright (C) 2004 Benoit Mortier + * Copyright (C) 2004 Sebastien Di Cintio + * Copyright (C) 2004 Eric Seigne + * Copyright (C) 2005-2010 Regis Houssin + * Copyright (C) 2006 Andre Cianfarani + * Copyright (C) 2006 Marc Barilley/Ocebo + * Copyright (C) 2007 Franky Van Liedekerke + * Copyright (C) 2007 Patrick Raguin + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/** + * \file htdocs/html.formother.class.php + * \brief Fichier de la classe des fonctions predefinie de composants html autre + * \version $Id$ + */ + + +/** + * \class FormOther + * \brief Classe permettant la generation de composants html autre + * \remarks Only common components must be here. + */ +class FormOther +{ + var $db; + var $error; + + + /** + * \brief Constructeur + * \param DB handler d'acces base de donnee + */ + function FormOther($DB) + { + $this->db = $DB; + + return 1; + } + + + /** + * \brief Retourne la liste des modeles d'export + * \param selected Id modele pre-selectionne + * \param htmlname Nom de la zone select + * \param type Type des modeles recherches + * \param useempty Affiche valeur vide dans liste + */ + function select_export_model($selected='',$htmlname='exportmodelid',$type='',$useempty=0) + { + $sql = "SELECT rowid, label"; + $sql.= " FROM ".MAIN_DB_PREFIX."export_model"; + $sql.= " WHERE type = '".$type."'"; + $sql.= " ORDER BY rowid"; + $result = $this->db->query($sql); + if ($result) + { + print '"; + } + else { + dol_print_error($this->db); + } + } + + + /** + * \brief Retourne la liste des modeles d'import + * \param selected Id modele pre-selectionne + * \param htmlname Nom de la zone select + * \param type Type des modeles recherches + * \param useempty Affiche valeur vide dans liste + */ + function select_import_model($selected='',$htmlname='importmodelid',$type='',$useempty=0) + { + $sql = "SELECT rowid, label"; + $sql.= " FROM ".MAIN_DB_PREFIX."import_model"; + $sql.= " WHERE type = '".$type."'"; + $sql.= " ORDER BY rowid"; + $result = $this->db->query($sql); + if ($result) + { + print '"; + } + else { + dol_print_error($this->db); + } + } + + + /** + * \brief Retourne la liste des ecotaxes avec tooltip sur le libelle + * \param selected code ecotaxes pre-selectionne + * \param htmlname nom de la liste deroulante + */ + function select_ecotaxes($selected='',$htmlname='ecotaxe_id') + { + global $langs; + + $sql = "SELECT e.rowid, e.code, e.libelle, e.price, e.organization,"; + $sql.= " p.libelle as pays"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_ecotaxe as e,".MAIN_DB_PREFIX."c_pays as p"; + $sql.= " WHERE e.active = 1 AND e.fk_pays = p.rowid"; + $sql.= " ORDER BY pays, e.organization ASC, e.code ASC"; + + if ($this->db->query($sql)) + { + print ''; + return 0; + } + else + { + dol_print_error($this->db); + return 1; + } + } + + /** + * \brief Retourne une liste de pourcentage + * \param selected pourcentage pre-selectionne + * \param htmlname nom de la liste deroulante + * \param increment increment value + * \param start start value + * \param end end value + * \return return combo + */ + function select_percent($selected=0,$htmlname='percent',$disabled=0,$increment=5,$start=0,$end=100) + { + $return = ''; + + return $return; + } + + /** + * \brief Return select list for categories (to use in form search selectors) + * \param type Type of categories (0=product, 1=suppliers, 2=customers, 3=members) + * \param selected Preselected value + * \param htmlname Name of combo list + * \return return Html combo list code + */ + function select_categories($type,$selected=0,$htmlname='search_categ') + { + global $langs; + require_once(DOL_DOCUMENT_ROOT."/categories/class/categorie.class.php"); + + // Load list of "categories" + $static_categs = new Categorie($this->db); + $tab_categs = $static_categs->get_full_arbo($type); + + // Print a select with each of them + $moreforfilter =''; + + return $moreforfilter; + } + + + /** + * \brief Return select list for categories (to use in form search selectors) + * \param selected Preselected value + * \param htmlname Name of combo list + * \return return Html combo list code + */ + function select_salesrepresentatives($selected=0,$htmlname='search_sale') + { + global $conf; + + // Select each sales and print them in a select input + $moreforfilter =''; + + return $moreforfilter; + } + + /** + * \brief Retourn list of project and tasks + * \param selected Pre-selected value + * \param projectid Project id + * \param htmlname Name of html select + * \param modeproject 1 to restrict on projects owned by user + * \param modetask 1 to restrict on tasks associated to user + * \param mode 0=Return list of tasks and their projects, 1=Return projects and tasks if exists + */ + function selectProjectTasks($selected='', $projectid=0, $htmlname='task_parent', $modeproject=0, $modetask=0, $mode=0, $useempty=0) + { + global $user, $langs; + + require_once(DOL_DOCUMENT_ROOT."/projet/class/task.class.php"); + + //print $modeproject.'-'.$modetask; + $task=new Task($this->db); + $tasksarray=$task->getTasksArray($modetask?$user:0, $modeproject?$user:0, $projectid, 0, $mode); + if ($tasksarray) + { + print ''; + } + else + { + print '
'.$langs->trans("NoProject").'
'; + } + } + + + /** + * Affiche zone de selection de couleur + * @param set_color Couleur de pre-selection + * @param prefix Prefix pour nom champ + * @param form_name Nom du formulaire de provenance. + */ + function select_color($set_color='', $prefix='f_color', $form_name='objForm') + { + print "\n".'
'; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''; + print ''."\n"; + print '
'; + } + + /** + * Creation d'un icone de couleur + * @param color Couleur de l'image + * @param module Nom du module + * @param name Nom de l'image + * @param x Largeur de l'image en pixels + * @param y Hauteur de l'image en pixels + */ + function CreateColorIcon($color,$module,$name,$x='12',$y='12') + { + global $conf; + + $file = $conf->$module->dir_temp.'/'.$name.'.png'; + + // On cree le repertoire contenant les icones + if (! file_exists($conf->$module->dir_temp)) + { + create_exdir($conf->$module->dir_temp); + } + + // On cree l'image en vraies couleurs + $image = imagecreatetruecolor($x,$y); + + $color = substr($color,1,6); + + $rouge = hexdec(substr($color,0,2)); //conversion du canal rouge + $vert = hexdec(substr($color,2,2)); //conversion du canal vert + $bleu = hexdec(substr($color,4,2)); //conversion du canal bleu + + $couleur = imagecolorallocate($image,$rouge,$vert,$bleu); + //print $rouge.$vert.$bleu; + imagefill($image,0,0,$couleur); //on remplit l'image + // On cree la couleur et on l'attribue a une variable pour ne pas la perdre + ImagePng($image,$file); //renvoie une image sous format png + ImageDestroy($image); + } + +} + + +/** + * Write all lines of a project (if parent = 0) + * + * @param unknown_type $inc + * @param unknown_type $parent + * @param unknown_type $lines + * @param unknown_type $level + */ +function PLineSelect(&$inc, $parent, $lines, $level=0, $selected=0) +{ + global $langs, $user, $conf; + + $lastprojectid=0; + + for ($i = 0 ; $i < sizeof($lines) ; $i++) + { + if ($lines[$i]->fk_parent == $parent) + { + $var = !$var; + + // Break on a new project + if ($parent == 0) + { + if ($lines[$i]->fk_project != $lastprojectid) + { + if ($i > 0 && $conf->browser->firefox) print ''; + print '\n"; + + $lastprojectid=$lines[$i]->fk_project; + $inc++; + } + } + + // Print task + if ($lines[$i]->id > 0) + { + print '\n"; + $inc++; + } + + $level++; + if ($lines[$i]->id) PLineSelect($inc, $lines[$i]->id, $lines, $level, $selected); + $level--; + } + } +} + +?> diff --git a/htdocs/ecm/docdir.php b/htdocs/ecm/docdir.php index 18786a4f67d..a1f81eb1938 100644 --- a/htdocs/ecm/docdir.php +++ b/htdocs/ecm/docdir.php @@ -26,7 +26,7 @@ */ require("../main.inc.php"); -require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT."/ecm/class/htmlecm.form.class.php"); require_once(DOL_DOCUMENT_ROOT."/ecm/class/ecmdirectory.class.php"); diff --git a/htdocs/ecm/docfile.php b/htdocs/ecm/docfile.php index 83374eaa2cc..5836c2540e9 100644 --- a/htdocs/ecm/docfile.php +++ b/htdocs/ecm/docfile.php @@ -25,7 +25,7 @@ */ require("../main.inc.php"); -require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT."/ecm/class/htmlecm.form.class.php"); require_once(DOL_DOCUMENT_ROOT."/ecm/class/ecmdirectory.class.php"); diff --git a/htdocs/ecm/docmine.php b/htdocs/ecm/docmine.php index b487dc94e97..779d8bea97c 100644 --- a/htdocs/ecm/docmine.php +++ b/htdocs/ecm/docmine.php @@ -26,7 +26,7 @@ */ require("../main.inc.php"); -require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT."/ecm/class/ecmdirectory.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/ecm.lib.php"); diff --git a/htdocs/ecm/docother.php b/htdocs/ecm/docother.php index 245bf08dcc1..8f8ba0c0777 100644 --- a/htdocs/ecm/docother.php +++ b/htdocs/ecm/docother.php @@ -11,7 +11,7 @@ */ require("../main.inc.php"); -require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); // Load traductions files $langs->load("ecm"); diff --git a/htdocs/ecm/index.php b/htdocs/ecm/index.php index 74715a96c9f..d8ef92d5819 100644 --- a/htdocs/ecm/index.php +++ b/htdocs/ecm/index.php @@ -26,7 +26,7 @@ */ require("../main.inc.php"); -require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/ecm.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/treeview.lib.php"); diff --git a/htdocs/ecm/search.php b/htdocs/ecm/search.php index d7cd122351c..13d08c3701b 100644 --- a/htdocs/ecm/search.php +++ b/htdocs/ecm/search.php @@ -26,7 +26,7 @@ */ require("../main.inc.php"); -require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/ecm.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/treeview.lib.php"); diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php index 493a87b1400..e83d9281a1f 100644 --- a/htdocs/expedition/fiche.php +++ b/htdocs/expedition/fiche.php @@ -30,7 +30,7 @@ require("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/expedition/class/expedition.class.php"); require_once(DOL_DOCUMENT_ROOT."/includes/modules/expedition/pdf/ModelePdfExpedition.class.php"); -require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT."/product/class/html.formproduct.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/product.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/sendings.lib.php"); diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 30819810ce0..63b20da6a2d 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -28,7 +28,7 @@ require("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/expedition/class/expedition.class.php"); -require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/order.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/sendings.lib.php"); if ($conf->produit->enabled || $conf->service->enabled) require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php"); diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index 8f9e742ee92..0e795bd63c5 100644 --- a/htdocs/exports/export.php +++ b/htdocs/exports/export.php @@ -26,7 +26,7 @@ require_once("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); -require_once(DOL_DOCUMENT_ROOT."/html.formother.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/class/html.formother.class.php"); require_once(DOL_DOCUMENT_ROOT."/exports/class/export.class.php"); require_once(DOL_DOCUMENT_ROOT.'/includes/modules/export/modules_export.php'); diff --git a/htdocs/fichinter/document.php b/htdocs/fichinter/document.php index 623da8d7b27..480554d31c3 100644 --- a/htdocs/fichinter/document.php +++ b/htdocs/fichinter/document.php @@ -31,7 +31,7 @@ require("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/fichinter/class/fichinter.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/fichinter.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); $langs->load("other"); $langs->load("fichinter"); diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php index c2b8031274c..4d881dc4e29 100644 --- a/htdocs/fichinter/fiche.php +++ b/htdocs/fichinter/fiche.php @@ -26,7 +26,7 @@ */ require("../main.inc.php"); -require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT."/fichinter/class/fichinter.class.php"); require_once(DOL_DOCUMENT_ROOT."/includes/modules/fichinter/modules_fichinter.php"); require_once(DOL_DOCUMENT_ROOT."/lib/fichinter.lib.php"); diff --git a/htdocs/fourn/commande/document.php b/htdocs/fourn/commande/document.php index c333b4beed0..07040129482 100644 --- a/htdocs/fourn/commande/document.php +++ b/htdocs/fourn/commande/document.php @@ -30,7 +30,7 @@ require("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT.'/lib/order.lib.php'); require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/fourn.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); require_once DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.commande.class.php"; $langs->load('orders'); diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index f99f5d95c9c..28f462cffbf 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -29,7 +29,7 @@ require("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); -require_once(DOL_DOCUMENT_ROOT."/html.formorder.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/class/html.formorder.class.php"); require_once(DOL_DOCUMENT_ROOT.'/includes/modules/supplier_order/modules_commandefournisseur.php'); require_once DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.commande.class.php"; require_once DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.product.class.php"; diff --git a/htdocs/fourn/facture/document.php b/htdocs/fourn/facture/document.php index 75bbaa5b408..b28df21a4b7 100644 --- a/htdocs/fourn/facture/document.php +++ b/htdocs/fourn/facture/document.php @@ -31,7 +31,7 @@ require_once(DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php'); require_once(DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'); require_once(DOL_DOCUMENT_ROOT.'/lib/fourn.lib.php'); require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); $langs->load('bills'); $langs->load('other'); diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index f80a6041380..622aee0b561 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -29,7 +29,7 @@ */ require("../../main.inc.php"); -require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php'); require_once(DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'); require_once(DOL_DOCUMENT_ROOT.'/fourn/facture/paiementfourn.class.php'); diff --git a/htdocs/fourn/liste.php b/htdocs/fourn/liste.php index 5202431071f..39c4c9011bd 100644 --- a/htdocs/fourn/liste.php +++ b/htdocs/fourn/liste.php @@ -26,7 +26,7 @@ */ require("../main.inc.php"); -require_once(DOL_DOCUMENT_ROOT."/html.formother.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/class/html.formother.class.php"); $langs->load("suppliers"); $langs->load("orders"); diff --git a/htdocs/ftp/index.php b/htdocs/ftp/index.php index 8d38d61c7af..e8292799c48 100644 --- a/htdocs/ftp/index.php +++ b/htdocs/ftp/index.php @@ -26,7 +26,7 @@ */ require("./pre.inc.php"); // We use pre.inc.php to have a dynamic menu -require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/treeview.lib.php"); diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index 7c0b9f80c6d..fc63ae8a12f 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -26,7 +26,7 @@ require_once("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); -require_once(DOL_DOCUMENT_ROOT."/html.formother.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/class/html.formother.class.php"); require_once(DOL_DOCUMENT_ROOT."/imports/class/import.class.php"); require_once(DOL_DOCUMENT_ROOT.'/includes/modules/import/modules_import.php'); require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php"); diff --git a/htdocs/livraison/fiche.php b/htdocs/livraison/fiche.php index 6f1164a8baa..1465a12055f 100644 --- a/htdocs/livraison/fiche.php +++ b/htdocs/livraison/fiche.php @@ -30,7 +30,7 @@ require("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/livraison/class/livraison.class.php"); require_once(DOL_DOCUMENT_ROOT."/includes/modules/livraison/modules_livraison.php"); -require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/sendings.lib.php"); if ($conf->produit->enabled || $conf->service->enabled) require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php"); if ($conf->expedition_bon->enabled) require_once(DOL_DOCUMENT_ROOT."/expedition/class/expedition.class.php"); diff --git a/htdocs/product/document.php b/htdocs/product/document.php index 342f34ee1a3..1db755a933b 100755 --- a/htdocs/product/document.php +++ b/htdocs/product/document.php @@ -31,7 +31,7 @@ require('../main.inc.php'); require_once(DOL_DOCUMENT_ROOT."/lib/product.lib.php"); require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); $langs->load("other"); $langs->load("products"); diff --git a/htdocs/product/liste.php b/htdocs/product/liste.php index 33927820497..13f73003943 100644 --- a/htdocs/product/liste.php +++ b/htdocs/product/liste.php @@ -27,7 +27,7 @@ require("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT.'/product/class/product.class.php'); -require_once(DOL_DOCUMENT_ROOT."/html.formother.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/class/html.formother.class.php"); if ($conf->categorie->enabled) require_once(DOL_DOCUMENT_ROOT."/categories/class/categorie.class.php"); $langs->load("products"); diff --git a/htdocs/product/photos.php b/htdocs/product/photos.php index a6527f19af2..92d76807bdd 100644 --- a/htdocs/product/photos.php +++ b/htdocs/product/photos.php @@ -29,7 +29,7 @@ require("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/product.lib.php"); require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php"); -require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); $langs->load("products"); $langs->load("bills"); diff --git a/htdocs/projet/document.php b/htdocs/projet/document.php index 973bf248625..cb3ac36966f 100644 --- a/htdocs/projet/document.php +++ b/htdocs/projet/document.php @@ -27,7 +27,7 @@ require('../main.inc.php'); require_once(DOL_DOCUMENT_ROOT."/projet/class/project.class.php"); require_once(DOL_DOCUMENT_ROOT.'/lib/project.lib.php'); require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); $langs->load('projects'); $langs->load('other'); diff --git a/htdocs/projet/fiche.php b/htdocs/projet/fiche.php index 0dff31db2e2..4205f523a2b 100644 --- a/htdocs/projet/fiche.php +++ b/htdocs/projet/fiche.php @@ -28,7 +28,7 @@ require("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/projet/class/project.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/project.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT."/includes/modules/project/modules_project.php"); $langs->load("projects"); diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php index d70a3bb95a7..86b1038b4c8 100644 --- a/htdocs/projet/tasks/document.php +++ b/htdocs/projet/tasks/document.php @@ -28,7 +28,7 @@ require_once(DOL_DOCUMENT_ROOT."/projet/class/project.class.php"); require_once(DOL_DOCUMENT_ROOT."/projet/class/task.class.php"); require_once(DOL_DOCUMENT_ROOT.'/lib/project.lib.php'); require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); if (!$user->rights->projet->lire) accessforbidden(); diff --git a/htdocs/projet/tasks/fiche.php b/htdocs/projet/tasks/fiche.php index 7704def4160..9fefcdc3cfe 100644 --- a/htdocs/projet/tasks/fiche.php +++ b/htdocs/projet/tasks/fiche.php @@ -30,7 +30,7 @@ require_once(DOL_DOCUMENT_ROOT."/projet/class/project.class.php"); require_once(DOL_DOCUMENT_ROOT."/projet/class/task.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/project.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/date.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/html.formother.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/class/html.formother.class.php"); $projectid=''; $projectid=isset($_REQUEST["id"])?$_REQUEST["id"]:$_POST["id"]; diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index 26f8b64cedc..bf380aa2c8b 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -29,7 +29,7 @@ require ("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/projet/class/project.class.php"); require_once(DOL_DOCUMENT_ROOT."/projet/class/task.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/project.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/html.formother.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/class/html.formother.class.php"); $taskid = (isset($_GET["id"])?$_GET["id"]:(isset($_POST["id"])?$_POST["id"]:'')); $taskref = (isset($_GET["ref"])?$_GET["ref"]:''); diff --git a/htdocs/societe/document.php b/htdocs/societe/document.php index 23fd5bb8f7a..f01b9a0ed6f 100644 --- a/htdocs/societe/document.php +++ b/htdocs/societe/document.php @@ -28,7 +28,7 @@ require("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); $langs->load("companies"); $langs->load('other');