*
* 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
@@ -17,7 +17,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
- * $Source$
*/
/**
@@ -28,6 +27,7 @@
*/
require("./pre.inc.php");
+require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
require_once(DOL_DOCUMENT_ROOT ."/notify.class.php");
if (!$user->rights->commande->lire) accessforbidden();
@@ -43,9 +43,10 @@ if ($user->societe_id > 0)
$socid = $user->societe_id;
}
+
$commandestatic=new Commande($db);
$html = new Form($db);
-
+$formfile = new FormFile($db);
llxHeader("",$langs->trans("Orders"),"Commande");
@@ -151,7 +152,7 @@ if ( $db->query($sql) )
$filename=sanitize_string($obj->ref);
$filedir=$conf->commande->dir_output . '/' . sanitize_string($obj->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
- $html->show_documents('commande',$filename,$filedir,$urlsource,'','','','','',1);
+ $formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','','','',1);
print '';
print '';
@@ -213,7 +214,7 @@ if ( $db->query($sql) )
$filename=sanitize_string($obj->ref);
$filedir=$conf->commande->dir_output . '/' . sanitize_string($obj->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
- $html->show_documents('commande',$filename,$filedir,$urlsource,'','','','','',1);
+ $formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','','','',1);
print '';
print '';
@@ -279,7 +280,7 @@ if ($resql)
$filename=sanitize_string($obj->ref);
$filedir=$conf->commande->dir_output . '/' . sanitize_string($obj->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
- $html->show_documents('commande',$filename,$filedir,$urlsource,'','','','','',1);
+ $formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','','','',1);
print '';
print '';
diff --git a/htdocs/commande/liste.php b/htdocs/commande/liste.php
index 47528933ed5..a89541d2ec7 100644
--- a/htdocs/commande/liste.php
+++ b/htdocs/commande/liste.php
@@ -30,6 +30,7 @@
require('./pre.inc.php');
+require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
$langs->load('orders');
$langs->load('companies');
@@ -58,6 +59,7 @@ if ($user->societe_id > 0)
*/
$html = new Form($db);
+$formfile = new FormFile($db);
llxHeader();
@@ -199,7 +201,7 @@ if ($resql)
$filename=sanitize_string($objp->ref);
$filedir=$conf->commande->dir_output . '/' . sanitize_string($objp->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->rowid;
- $html->show_documents('commande',$filename,$filedir,$urlsource,'','','','','',1);
+ $formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','','','',1);
print '';
print '';
diff --git a/htdocs/compta/commande/fiche.php b/htdocs/compta/commande/fiche.php
index 8f92e3076eb..c69df007552 100644
--- a/htdocs/compta/commande/fiche.php
+++ b/htdocs/compta/commande/fiche.php
@@ -28,6 +28,7 @@
*/
require("./pre.inc.php");
+require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
require_once(DOL_DOCUMENT_ROOT."/lib/order.lib.php");
if ($conf->propal->enabled) require_once(DOL_DOCUMENT_ROOT."/propal.class.php");
if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT."/project.class.php");
@@ -61,11 +62,12 @@ if ($_GET["action"] == 'facturee')
}
+
llxHeader('',$langs->trans("OrderCard"),"Commande");
-
$html = new Form($db);
+$formfile = new FormFile($db);
/* *************************************************************************** */
/* */
@@ -453,7 +455,7 @@ if ($_GET["id"] > 0)
$genallowed=0;
$delallowed=0;
- $somethingshown=$html->show_documents('commande',$comref,$filedir,$urlsource,$genallowed,$delallowed,$commande->modelpdf);
+ $somethingshown=$formfile->show_documents('commande',$comref,$filedir,$urlsource,$genallowed,$delallowed,$commande->modelpdf);
/*
* Liste des factures
diff --git a/htdocs/compta/commande/liste.php b/htdocs/compta/commande/liste.php
index 494ca27c0d3..bbc52d78c78 100644
--- a/htdocs/compta/commande/liste.php
+++ b/htdocs/compta/commande/liste.php
@@ -29,6 +29,7 @@
*/
require("./pre.inc.php");
+require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
if (!$user->rights->commande->lire) accessforbidden();
@@ -51,7 +52,9 @@ if ($user->societe_id > 0)
$langs->load('companies');
+
$html = new Form($db);
+$formfile = new FormFile($db);
llxHeader();
@@ -148,7 +151,7 @@ if ($resql)
$filename=sanitize_string($objp->ref);
$filedir=$conf->commande->dir_output . '/' . sanitize_string($objp->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->rowid;
- $html->show_documents('commande',$filename,$filedir,$urlsource,'','','','','',1);
+ $formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','','','',1);
print '';
print '';
diff --git a/htdocs/compta/dons/fiche.php b/htdocs/compta/dons/fiche.php
index d0827097338..0f6fdcee5ac 100644
--- a/htdocs/compta/dons/fiche.php
+++ b/htdocs/compta/dons/fiche.php
@@ -27,6 +27,7 @@
*/
require_once("./pre.inc.php");
+require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
require_once(DOL_DOCUMENT_ROOT."/don.class.php");
require_once(DOL_DOCUMENT_ROOT."/paiement.class.php");
if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT.'/lib/project.lib.php');
@@ -171,6 +172,7 @@ if ($_GET['action'] == 'builddoc')
llxHeader();
$html=new Form($db);
+$formfile = new FormFile($db);
/* ************************************************************************** */
@@ -199,8 +201,7 @@ if ($_GET["action"] == 'create')
print "";
print "".$langs->trans("PaymentMode")." \n";
- $form = new Form($db);
- $form->select_types_paiements('', 'modepaiement', 'CRDT', 0);
+ $html->select_types_paiements('', 'modepaiement', 'CRDT', 0);
print " \n";
if ($conf->projet->enabled)
@@ -212,7 +213,6 @@ if ($_GET["action"] == 'create')
}
print "".$langs->trans("PublicDonation")." ";
- $html=new Form($db);
print $html->selectyesno("public",1,1);
print " \n";
@@ -292,7 +292,6 @@ if ($_GET["rowid"] && $_GET["action"] == 'edit')
}
print "".$langs->trans("PublicDonation")." ";
- $html=new Form($db);
print $html->selectyesno("public",1,1);
print " ";
print " \n";
@@ -309,8 +308,7 @@ if ($_GET["rowid"] && $_GET["action"] == 'edit')
print "".''.$langs->trans("Amount").' '.$langs->trans("Currency".$conf->monnaie).' ';
print "".$langs->trans("PaymentMode")." \n";
- $form = new Form($db);
- $form->select_types_paiements('', 'modepaiement', 'CRDT', 0);
+ $html->select_types_paiements('', 'modepaiement', 'CRDT', 0);
print " \n";
print "".''.$langs->trans("Status").' '.$don->getLibStatut(4).' ';
@@ -434,7 +432,7 @@ if ($_GET["rowid"] && $_GET["action"] != 'edit')
$var=true;
print ' ';
- $html->show_documents('don',$filename,$filedir,$urlsource,$genallowed,$delallowed);
+ $formfile->show_documents('don',$filename,$filedir,$urlsource,$genallowed,$delallowed);
print ' ';
diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index 7dada17a1ef..9489e4c1357 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -31,6 +31,7 @@
*/
require('./pre.inc.php');
+require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
require_once(DOL_DOCUMENT_ROOT.'/includes/modules/facture/modules_facture.php');
require_once(DOL_DOCUMENT_ROOT.'/facture.class.php');
require_once(DOL_DOCUMENT_ROOT.'/discount.class.php');
@@ -1155,6 +1156,7 @@ if ($_REQUEST['action'] == 'builddoc') // En get ou en post
llxHeader('',$langs->trans('Bill'),'HelpInvoice');
$html = new Form($db);
+$formfile = new FormFile($db);
/*********************************************************************
@@ -2835,7 +2837,7 @@ else
$var=true;
print ' ';
- $somethingshown=$html->show_documents('facture',$filename,$filedir,$urlsource,$genallowed,$delallowed,$fac->modelpdf);
+ $somethingshown=$formfile->show_documents('facture',$filename,$filedir,$urlsource,$genallowed,$delallowed,$fac->modelpdf);
/*
* Propales rattachées
@@ -3283,7 +3285,7 @@ else
$filename=sanitize_string($objp->facnumber);
$filedir=$conf->facture->dir_output . '/' . sanitize_string($objp->facnumber);
$urlsource=$_SERVER['PHP_SELF'].'?facid='.$objp->facid;
- $html->show_documents('facture',$filename,$filedir,$urlsource,'','','','','',1);
+ $formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','','','',1);
print '';
print '';
diff --git a/htdocs/compta/facture/impayees.php b/htdocs/compta/facture/impayees.php
index 1eb7bbee51d..c8d2b8471db 100644
--- a/htdocs/compta/facture/impayees.php
+++ b/htdocs/compta/facture/impayees.php
@@ -28,6 +28,7 @@
*/
require("./pre.inc.php");
+require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
require_once(DOL_DOCUMENT_ROOT."/facture.class.php");
require_once(DOL_DOCUMENT_ROOT."/paiement.class.php");
@@ -53,6 +54,9 @@ if ($user->societe_id > 0)
llxHeader('',$langs->trans("BillsCustomersUnpayed"));
+$html = new Form($db);
+$formfile = new FormFile($db);
+
/***************************************************************************
* *
@@ -181,7 +185,6 @@ if ($user->rights->facture->lire)
if ($num > 0)
{
- $html = new Form($db);
$var=True;
$total_ht=0;
$total_ttc=0;
@@ -216,7 +219,7 @@ if ($user->rights->facture->lire)
$filename=sanitize_string($objp->facnumber);
$filedir=$conf->facture->dir_output . '/' . sanitize_string($objp->facnumber);
$urlsource=$_SERVER['PHP_SELF'].'?facid='.$objp->facid;
- $html->show_documents('facture',$filename,$filedir,$urlsource,'','','','','',1);
+ $formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','','','',1);
print '';
diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php
index 842fc21aa19..0a33a8d0ab8 100644
--- a/htdocs/compta/index.php
+++ b/htdocs/compta/index.php
@@ -28,6 +28,7 @@
*/
require("./pre.inc.php");
+require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
require_once(DOL_DOCUMENT_ROOT.'/facture.class.php');
require_once(DOL_DOCUMENT_ROOT.'/fourn/fournisseur.facture.class.php');
if ($conf->commande->enabled) require_once(DOL_DOCUMENT_ROOT.'/commande/commande.class.php');
@@ -92,6 +93,7 @@ $facturestatic=new Facture($db);
$facturesupplierstatic=new FactureFournisseur($db);
$html = new Form($db);
+$formfile = new FormFile($db);
llxHeader("",$langs->trans("AccountancyTreasuryArea"));
@@ -563,7 +565,7 @@ if ($conf->facture->enabled && $conf->commande->enabled && $user->rights->comman
$filename=sanitize_string($obj->ref);
$filedir=$conf->commande->dir_output . '/' . sanitize_string($obj->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
- $html->show_documents('commande',$filename,$filedir,$urlsource,'','','','','',1);
+ $formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','','','',1);
print '';
print '';
@@ -658,7 +660,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
$filename=sanitize_string($obj->facnumber);
$filedir=$conf->facture->dir_output . '/' . sanitize_string($obj->facnumber);
$urlsource=$_SERVER['PHP_SELF'].'?facid='.$obj->rowid;
- $html->show_documents('facture',$filename,$filedir,$urlsource,'','','','','',1);
+ $formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','','','',1);
print '';
print '';
diff --git a/htdocs/compta/paiement/cheque/fiche.php b/htdocs/compta/paiement/cheque/fiche.php
index 365ce7f47a6..65d44454695 100644
--- a/htdocs/compta/paiement/cheque/fiche.php
+++ b/htdocs/compta/paiement/cheque/fiche.php
@@ -27,6 +27,7 @@
*/
require('./pre.inc.php');
+require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
require_once(DOL_DOCUMENT_ROOT.'/paiement.class.php');
require_once(DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/remisecheque.class.php');
require_once(DOL_DOCUMENT_ROOT.'/compta/bank/account.class.php');
@@ -138,6 +139,7 @@ if ($_POST['action'] == 'builddoc' && $user->rights->banque)
llxHeader();
$html = new Form($db);
+$formfile = new FormFile($db);
if ($_GET['action'] == 'new')
{
@@ -392,10 +394,9 @@ if ($_GET['action'] != 'new')
{
if ($remisecheque->statut == 1)
{
- //show_documents($modulepart,$filename,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$modelliste=array(),$forcenomultilang=0);
$dir = DOL_DATA_ROOT.'/compta/bordereau/'.get_exdir($remisecheque->number);
$gen = array('Blochet');
- $html->show_documents("remisecheque","",$dir,'',$gen,0);
+ $formfile->show_documents("remisecheque","",$dir,'',$gen,0);
}
}
diff --git a/htdocs/compta/propal.php b/htdocs/compta/propal.php
index 4d04caee3d0..0722012fcd6 100644
--- a/htdocs/compta/propal.php
+++ b/htdocs/compta/propal.php
@@ -28,6 +28,7 @@
*/
require("./pre.inc.php");
+require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
require_once(DOL_DOCUMENT_ROOT."/propal.class.php");
require_once(DOL_DOCUMENT_ROOT."/lib/propal.lib.php");
if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT.'/project.class.php');
@@ -114,6 +115,7 @@ if ( $action == 'delete' )
llxHeader();
$html = new Form($db);
+$formfile = new FormFile($db);
$societestatic=new Societe($db);
$propalstatic=new Propal($db);
@@ -496,7 +498,7 @@ if ($_GET["propalid"] > 0)
$var=true;
- $somethingshown=$html->show_documents('propal',$filename,$filedir,$urlsource,$genallowed,$delallowed);
+ $somethingshown=$formfile->show_documents('propal',$filename,$filedir,$urlsource,$genallowed,$delallowed);
/*
@@ -769,7 +771,7 @@ else
$filename=sanitize_string($objp->ref);
$filedir=$conf->propal->dir_output . '/' . sanitize_string($objp->ref);
$urlsource=$_SERVER['PHP_SELF'].'?propalid='.$objp->propalid;
- $html->show_documents('propal',$filename,$filedir,$urlsource,'','','','','',1);
+ $formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','','','',1);
print '';
diff --git a/htdocs/expedition/commande.php b/htdocs/expedition/commande.php
index 7730a039ddb..49bb837cc51 100644
--- a/htdocs/expedition/commande.php
+++ b/htdocs/expedition/commande.php
@@ -31,6 +31,7 @@
*/
require("./pre.inc.php");
+require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
require_once(DOL_DOCUMENT_ROOT."/product.class.php");
require_once(DOL_DOCUMENT_ROOT."/project.class.php");
require_once(DOL_DOCUMENT_ROOT."/propal.class.php");
@@ -70,6 +71,8 @@ if ($_POST["action"] == 'confirm_cloture' && $_POST["confirm"] == 'yes')
}
$html = new Form($db);
+$formfile = new FormFile($db);
+
/* *************************************************************************** */
/* */
@@ -421,7 +424,7 @@ if ($_GET["id"] > 0)
$genallowed=0;
$delallowed=0;
- $somethingshown=$html->show_documents('commande',$comref,$filedir,$urlsource,$genallowed,$delallowed,$commande->modelpdf);
+ $somethingshown=$formfile->show_documents('commande',$comref,$filedir,$urlsource,$genallowed,$delallowed,$commande->modelpdf);
print '';
diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php
index c4c3550c444..86315b370fd 100644
--- a/htdocs/expedition/fiche.php
+++ b/htdocs/expedition/fiche.php
@@ -31,7 +31,8 @@
*/
require("./pre.inc.php");
-require_once(DOL_DOCUMENT_ROOT ."/expedition/mods/pdf/ModelePdfExpedition.class.php");
+require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
+require_once(DOL_DOCUMENT_ROOT."/expedition/mods/pdf/ModelePdfExpedition.class.php");
if ($conf->produit->enabled) require_once(DOL_DOCUMENT_ROOT."/product.class.php");
if ($conf->propal->enabled) require_once(DOL_DOCUMENT_ROOT."/propal.class.php");
if ($conf->commande->enabled) require_once(DOL_DOCUMENT_ROOT."/commande/commande.class.php");
@@ -177,6 +178,7 @@ if ($_REQUEST['action'] == 'builddoc') // En get ou en post
llxHeader('',$langs->trans('Sending'),'Expedition');
$html = new Form($db);
+$formfile = new FormFile($db);
/*********************************************************************
*
@@ -673,7 +675,7 @@ else
//$genallowed=1;
//$delallowed=0;
- $somethingshown=$html->show_documents('expedition',$expeditionref,$filedir,$urlsource,$genallowed,$delallowed,$expedition->modelpdf);
+ $somethingshown=$formfile->show_documents('expedition',$expeditionref,$filedir,$urlsource,$genallowed,$delallowed,$expedition->modelpdf);
if ($genallowed && ! $somethingshown) $somethingshown=1;
/*
diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php
index 6af65be1137..4a7a192ebd5 100644
--- a/htdocs/exports/export.php
+++ b/htdocs/exports/export.php
@@ -27,6 +27,7 @@
*/
require_once("./pre.inc.php");
+require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
require_once(DOL_DOCUMENT_ROOT."/exports/export.class.php");
require_once(DOL_DOCUMENT_ROOT.'/includes/modules/export/modules_export.php');
@@ -69,6 +70,7 @@ $objexport->load_arrays($user,$datatoexport);
$objmodelexport=new ModeleExports();
$html = new Form($db);
+$formfile = new FormFile($db);
/*
@@ -606,14 +608,13 @@ if ($step == 4 && $datatoexport)
if ($mesg) print $mesg;
- $htmlform=new Form($db);
print '';
if (! is_dir($conf->export->dir_temp)) create_exdir($conf->export->dir_temp);
// Affiche liste des documents
// NB: La fonction show_documents rescanne les modules qd genallowed=1
- $htmlform->show_documents('export','',$conf->export->dir_temp.'/'.$user->id,$_SERVER["PHP_SELF"].'?step=4&datatoexport='.$datatoexport,$liste,1,'csv','',1);
+ $formfile->show_documents('export','',$conf->export->dir_temp.'/'.$user->id,$_SERVER["PHP_SELF"].'?step=4&datatoexport='.$datatoexport,$liste,1,'csv','',1);
print ' ';
print '
';
diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php
index c8256334294..abca9ea10b4 100644
--- a/htdocs/fichinter/fiche.php
+++ b/htdocs/fichinter/fiche.php
@@ -28,6 +28,7 @@
*/
require("./pre.inc.php");
+require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
require_once(DOL_DOCUMENT_ROOT."/fichinter/fichinter.class.php");
require_once(DOL_DOCUMENT_ROOT."/includes/modules/fichinter/modules_fichinter.php");
require_once(DOL_DOCUMENT_ROOT."/lib/fichinter.lib.php");
@@ -340,6 +341,7 @@ if ($_GET['action'] == 'down' && $user->rights->ficheinter->creer)
* Affichage page
*/
$html = new Form($db);
+$formfile = new FormFile($db);
llxHeader();
@@ -464,10 +466,8 @@ if ($_GET["action"] == 'create')
elseif ($_GET["id"] > 0)
{
/*
-* Affichage en mode visu
-*/
-
- $html = new Form($db);
+ * Affichage en mode visu
+ */
$fichinter = new Fichinter($db);
$result=$fichinter->fetch($_GET["id"]);
if (! $result > 0)
@@ -907,7 +907,7 @@ elseif ($_GET["id"] > 0)
$var=true;
print " \n";
- $somethingshown=$html->show_documents('ficheinter',$filename,$filedir,$urlsource,$genallowed,$delallowed,$ficheinter->modelpdf);
+ $somethingshown=$formfile->show_documents('ficheinter',$filename,$filedir,$urlsource,$genallowed,$delallowed,$ficheinter->modelpdf);
print " ";
print " ";
diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php
index 6f0d97c1bf3..c0ced8ff431 100644
--- a/htdocs/fourn/commande/fiche.php
+++ b/htdocs/fourn/commande/fiche.php
@@ -29,6 +29,7 @@
*/
require('./pre.inc.php');
+require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
require_once(DOL_DOCUMENT_ROOT.'/fourn/commande/modules/modules_commandefournisseur.php');
require_once DOL_DOCUMENT_ROOT."/fourn/fournisseur.product.class.php";
if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT.'/project.class.php');
@@ -412,6 +413,7 @@ llxHeader('',$langs->trans("OrderCard"),"CommandeFournisseur");
$html = new Form($db);
+$formfile = new FormFile($db);
/*********************************************************************
*
@@ -936,7 +938,7 @@ else
$genallowed=($commande->statut == 0 ? $user->rights->fournisseur->commande->creer : 0);
$delallowed=$user->rights->fournisseur->commande->supprimer;
- $somethingshown=$html->show_documents('commande_fournisseur',$comfournref,$filedir,$urlsource,$genallowed,$delallowed,$commande->modelpdf);
+ $somethingshown=$formfile->show_documents('commande_fournisseur',$comfournref,$filedir,$urlsource,$genallowed,$delallowed,$commande->modelpdf);
print '';
@@ -968,14 +970,12 @@ else
/**
* Commander
*/
- $form = new Form($db);
-
print ' ';
print '