diff --git a/htdocs/admin/avoir.php b/htdocs/admin/avoir.php
index a22acaf7737..992a974e78c 100644
--- a/htdocs/admin/avoir.php
+++ b/htdocs/admin/avoir.php
@@ -32,6 +32,7 @@ require("./pre.inc.php");
$langs->load("admin");
$langs->load("bills");
+$langs->load("other");
if (!$user->admin)
accessforbidden();
@@ -43,48 +44,50 @@ if (!$user->admin)
if ($_GET["action"] == 'set')
{
- $sql = "INSERT INTO ".MAIN_DB_PREFIX."avoir_model_pdf (nom) VALUES ('".$_GET["value"]."')";
-
+ $type='creditnote';
+ $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom) VALUES ('".$_GET["value"]."','".$type."')";
if ($db->query($sql))
{
}
}
+
if ($_GET["action"] == 'del')
{
- $sql = "DELETE FROM ".MAIN_DB_PREFIX."avoir_model_pdf WHERE nom='".$_GET["value"]."'";
-
+ $sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom='".$_GET["value"]."'";
if ($db->query($sql))
{
}
}
-
-$avoir_addon_var_pdf = $conf->global->AVOIR_ADDON_PDF;
-
-if ($_GET["action"] == 'setpdf')
+if ($_GET["action"] == 'setdoc')
{
+ $db->begin();
+
if (dolibarr_set_const($db, "AVOIR_ADDON_PDF",$_GET["value"]))
{
// La constante qui a été lue en avant du nouveau set
// on passe donc par une variable pour avoir un affichage cohérent
- $avoir_addon_var_pdf = $_GET["value"];
+ $conf->global->AVOIR_ADDON_PDF = $_GET["value"];
}
// On active le modele
- $sql_del = "delete from ".MAIN_DB_PREFIX."avoir_model_pdf where nom = '".$_GET["value"]."';";
- $db->query($sql_del);
-
- $sql = "INSERT INTO ".MAIN_DB_PREFIX."avoir_model_pdf (nom) VALUES ('".$_GET["value"]."')";
- if ($db->query($sql))
+ $type='creditnote';
+ $sql_del = "delete from ".MAIN_DB_PREFIX."document_model where nom = '".$_GET["value"]."'";
+ $result1=$db->query($sql_del);
+ $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom,type) VALUES ('".$_GET["value"]."','".$type."')";
+ $result2=$db->query($sql);
+ if ($result1 && $result2)
{
-
+ $db->commit();
+ }
+ else
+ {
+ $db->rollback();
}
}
-$avoir_addon_var = $conf->global->AVOIR_ADDON;
-
if ($_GET["action"] == 'setmod')
{
// \todo Verifier si module numerotation choisi peut etre activé
@@ -96,7 +99,7 @@ if ($_GET["action"] == 'setmod')
{
// la constante qui a été lue en avant du nouveau set
// on passe donc par une variable pour avoir un affichage cohérent
- $avoir_addon_var = $_GET["value"];
+ $conf->global->AVOIR_ADDON = $_GET["value"];
}
}
@@ -105,10 +108,11 @@ if ($_GET["action"] == 'setmod')
* Affiche page
*/
-$dir = DOL_DOCUMENT_ROOT .'/avoir/modules/';
-
llxHeader("","");
+$dir = DOL_DOCUMENT_ROOT .'/avoir/modules/';
+$html=new Form($db);
+
$h = 0;
$head[$h][0] = DOL_URL_ROOT."/admin/facture.php";
@@ -134,11 +138,14 @@ print '
'.$langs->trans("Name")."
\n";
print '
'.$langs->trans("Description")."
\n";
print '
'.$langs->trans("Example")."
\n";
print '
'.$langs->trans("Activated").'
';
+print '
'.$langs->trans("Info").'
';
print ''."\n";
clearstatcache();
$handle = opendir($dir);
+
+$var=true;
if ($handle)
{
$var=true;
@@ -150,30 +157,37 @@ if ($handle)
require_once(DOL_DOCUMENT_ROOT ."/avoir/modules/".$file.".php");
- $modAvoir = new $file;
+ $module = new $file;
$var=!$var;
print "
';
+
+ print "\n";
}
}
closedir($handle);
diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php
index dec77cd47b8..8cd9d6c002d 100644
--- a/htdocs/admin/expedition.php
+++ b/htdocs/admin/expedition.php
@@ -1,6 +1,6 @@
- * Copyright (C) 2004-2005 Laurent Destailleur
+ * Copyright (C) 2004-2006 Laurent Destailleur
* Copyright (C) 2004 Sebastien Di Cintio
* Copyright (C) 2004 Benoit Mortier
* Copyright (C) 2004 Eric Seigne
@@ -33,110 +33,92 @@
require("./pre.inc.php");
$langs->load("admin");
+$langs->load("bills");
+$langs->load("other");
$langs->load("sendings");
if (!$user->admin) accessforbidden();
-// positionne la variable pour le test d'affichage de l'icone
-$expedition_addon_var_pdf = EXPEDITION_ADDON_PDF;
-$expedition_default = EXPEDITION_ADDON;
/*
* Actions
*/
+
if ($_GET["action"] == 'set')
{
- $file = DOL_DOCUMENT_ROOT . '/expedition/mods/methode_expedition_'.$_GET["value"].'.modules.php';
+ $type='shipping';
+ $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type) VALUES ('".$_GET["value"]."','".$type."')";
+ if ($db->query($sql))
+ {
- $classname = 'methode_expedition_'.$_GET["value"];
- require_once($file);
-
- $obj = new $classname($db);
-
- $obj->Active($_GET["statut"]);
-
- Header("Location: expedition.php");
+ }
}
-if ($_GET["action"] == 'setpdf')
+if ($_GET["action"] == 'del')
{
- $db->begin();
-
- $sql = "DELETE FROM ".MAIN_DB_PREFIX."const WHERE name = 'EXPEDITION_ADDON_PDF';";
- $resql=$db->query($sql);
- if ($resql)
+ $sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom='".$_GET["value"]."'";
+ if ($db->query($sql))
{
- $sql = "INSERT INTO ".MAIN_DB_PREFIX."const (name,value,visible) VALUES ('EXPEDITION_ADDON_PDF','".$_GET["value"]."',0)";
- $resql=$db->query($sql);
- if ($resql)
- {
- // la constante qui a été lue en avant du nouveau set
- // on passe donc par une variable pour avoir un affichage cohérent
- $expedition_addon_var_pdf = $value;
-
- $db->commit();
-
- Header("Location: ".$_SERVER["PHP_SELF"]);
- exit;
- }
- else
- {
- $db->rollback();
- dolibarr_print_error($db);
- }
+
}
- else
- {
- $db->rollback();
- dolibarr_print_error($db);
- }
}
-if ($_GET["action"] == 'setdef')
+if ($_GET["action"] == 'setdoc')
{
- $db->begin();
-
- $sql = "DELETE FROM ".MAIN_DB_PREFIX."const WHERE name = 'EXPEDITION_ADDON';";
- $resql=$db->query($sql);
- if ($resql)
+ $db->begin();
+
+ if (dolibarr_set_const($db, "EXPEDITION_ADDON_PDF",$_GET["value"]))
{
- $sql = "INSERT INTO ".MAIN_DB_PREFIX."const (name,value,visible) VALUES ('EXPEDITION_ADDON','".$_GET["value"]."',0)";
- $resql=$db->query($sql);
- if ($resql)
- {
- // la constante qui a été lue en avant du nouveau set
- // on passe donc par une variable pour avoir un affichage cohérent
- $expedition_default = $_GET["value"];
- $db->commit();
-
- Header("Location: ".$_SERVER["PHP_SELF"]);
- exit;
- }
- else
- {
- $db->rollback();
- dolibarr_print_error($db);
- }
+ // La constante qui a été lue en avant du nouveau set
+ // on passe donc par une variable pour avoir un affichage cohérent
+ $conf->global->EXPEDITION_ADDON_PDF = $_GET["value"];
}
- else
+
+ // On active le modele
+ $type='shipping';
+ $sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model where nom = '".$_GET["value"]."'";
+ $result1=$db->query($sql_del);
+ $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom,type) VALUES ('".$_GET["value"]."','".$type."')";
+ $result2=$db->query($sql);
+ if ($result1 && $result2)
{
- $db->rollback();
- dolibarr_print_error($db);
+ $db->commit();
+ }
+ else
+ {
+ $db->rollback();
}
}
+if ($_GET["action"] == 'setmod')
+{
+ // \todo Verifier si module numerotation choisi peut etre activé
+ // par appel methode canBeActivated
+
+
+ if (dolibarr_set_const($db, "EXPEDITION_ADDON",$_GET["value"]))
+ {
+ // la constante qui a été lue en avant du nouveau set
+ // on passe donc par une variable pour avoir un affichage cohérent
+ $conf->global->EXPEDITION_ADDON = $_GET["value"];
+ }
+}
+
+
+
/*
*
*/
-$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."expedition_methode WHERE statut = 1";
-$db->fetch_all_rows($sql, $mods);
-
llxHeader();
$dir = DOL_DOCUMENT_ROOT."/expedition/mods/";
+$html=new Form($db);
+
// Méthode de livraison
+$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."expedition_methode WHERE statut = 1";
+$db->fetch_all_rows($sql, $mods);
print_titre($langs->trans("SendingsSetup"));
@@ -148,81 +130,114 @@ print '
';
+ print '';
}
}
closedir($handle);
diff --git a/htdocs/admin/propale.php b/htdocs/admin/propale.php
index 1a0e6b140c9..d1e28599471 100644
--- a/htdocs/admin/propale.php
+++ b/htdocs/admin/propale.php
@@ -33,22 +33,29 @@
require("./pre.inc.php");
$langs->load("admin");
+$langs->load("bills");
$langs->load("propal");
+$langs->load("other");
if (!$user->admin)
accessforbidden();
+/*
+ * Actions
+ */
+
if ($_POST["action"] == 'nbprod')
{
dolibarr_set_const($db, "PROPALE_NEW_FORM_NB_PRODUCT",$_POST["value"]);
Header("Location: propale.php");
exit;
}
+
if ($_GET["action"] == 'set')
{
- $sql = "INSERT INTO ".MAIN_DB_PREFIX."propal_model_pdf (nom) VALUES ('".$_GET["value"]."')";
-
+ $type='propal';
+ $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type) VALUES ('".$_GET["value"]."','".$type."')";
if ($db->query($sql))
{
@@ -56,51 +63,51 @@ if ($_GET["action"] == 'set')
}
if ($_GET["action"] == 'del')
{
- $sql = "DELETE FROM ".MAIN_DB_PREFIX."propal_model_pdf WHERE nom='".$_GET["value"]."'";
-
+ $sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom='".$_GET["value"]."'";
if ($db->query($sql))
{
}
}
-
-$propale_addon_var_pdf = $conf->global->PROPALE_ADDON_PDF;
-
-if ($_GET["action"] == 'setpdf')
+if ($_GET["action"] == 'setdoc')
{
+ $db->begin();
+
if (dolibarr_set_const($db, "PROPALE_ADDON_PDF",$_GET["value"]))
{
// La constante qui a été lue en avant du nouveau set
// on passe donc par une variable pour avoir un affichage cohérent
- $propale_addon_var_pdf = $_GET["value"];
+ $conf->global->PROPALE_ADDON_PDF = $_GET["value"];
}
// On active le modele
- $sql_del = "delete from ".MAIN_DB_PREFIX."propal_model_pdf where nom = '".$_GET["value"]."';";
- $db->query($sql_del);
-
- $sql = "INSERT INTO ".MAIN_DB_PREFIX."propal_model_pdf (nom) VALUES ('".$_GET["value"]."')";
- if ($db->query($sql))
+ $type='propal';
+ $sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model where nom = '".$_GET["value"]."'";
+ $result1=$db->query($sql_del);
+ $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom,type) VALUES ('".$_GET["value"]."','".$type."')";
+ $result2=$db->query($sql);
+ if ($result1 && $result2)
{
-
+ $db->commit();
+ }
+ else
+ {
+ $db->rollback();
}
}
-$propale_addon_var = $conf->global->PROPALE_ADDON;
-
if ($_GET["action"] == 'setmod')
{
// \todo Verifier si module numerotation choisi peut etre activé
// par appel methode canBeActivated
-
if (dolibarr_set_const($db, "PROPALE_ADDON",$_GET["value"]))
{
// la constante qui a été lue en avant du nouveau set
// on passe donc par une variable pour avoir un affichage cohérent
- $propale_addon_var = $_GET["value"];
+ $conf->global->PROPALE_ADDON = $_GET["value"];
}
}
@@ -109,14 +116,14 @@ if ($_GET["action"] == 'setmod')
* Affiche page
*/
-$dir = "../includes/modules/propale/";
-
-
llxHeader('',$langs->trans("PropalSetup"));
-print_titre($langs->trans("PropalSetup"));
+$dir = "../includes/modules/propale/";
+$html=new Form($db);
+print_titre($langs->trans("PropalSetup"));
+
/*
* Module numérotation
*/
@@ -129,6 +136,7 @@ print '
'.$langs->trans("Name")."
\n";
print '
'.$langs->trans("Description")."
\n";
print '
'.$langs->trans("Example")."
\n";
print '
'.$langs->trans("Activated").'
';
+print '
'.$langs->trans("Info").'
';
print ''."\n";
clearstatcache();
@@ -145,29 +153,36 @@ if ($handle)
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/propale/".$file.".php");
- $modPropale = new $file;
+ $module = new $file;
$var=!$var;
print "
';
print '';
+print ' ';
+
$db->close();
-llxFooter();
+llxFooter('$Date$ - $Revision$');
?>
diff --git a/htdocs/fourn/commande/modules/modules_commandefournisseur.php b/htdocs/fourn/commande/modules/modules_commandefournisseur.php
index 7656c710100..d1c8e1c52dd 100644
--- a/htdocs/fourn/commande/modules/modules_commandefournisseur.php
+++ b/htdocs/fourn/commande/modules/modules_commandefournisseur.php
@@ -57,9 +57,11 @@ class ModelePDFCommandesSuppliers extends FPDF
*/
function liste_modeles($db)
{
+ $type='supplier_order';
$liste=array();
$sql ="SELECT nom as id, nom as lib";
- $sql.=" FROM ".MAIN_DB_PREFIX."commande_fournisseur_model_pdf";
+ $sql.=" FROM ".MAIN_DB_PREFIX."document_model";
+ $sql.=" WHERE type = '".$type."'";
$resql = $db->query($sql);
if ($resql)
diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php
index 6df4edc761e..9b1db616f39 100644
--- a/htdocs/html.form.class.php
+++ b/htdocs/html.form.class.php
@@ -68,7 +68,7 @@ class Form
{
global $conf;
$s ='';
- if ($conf->use_javascript)
+ if ($conf->use_javascript && $htmltooltip)
{
$s.=' onmouseover="showtip(\''.$htmltooltip.'\')"';
$s.=' onMouseout="hidetip()"';
diff --git a/htdocs/includes/modules/commande/modules_commande.php b/htdocs/includes/modules/commande/modules_commande.php
index ad3efd88530..5c6c161166b 100644
--- a/htdocs/includes/modules/commande/modules_commande.php
+++ b/htdocs/includes/modules/commande/modules_commande.php
@@ -57,9 +57,11 @@ class ModelePDFCommandes extends FPDF
*/
function liste_modeles($db)
{
+ $type='order';
$liste=array();
$sql ="SELECT nom as id, nom as lib";
- $sql.=" FROM ".MAIN_DB_PREFIX."commande_model_pdf";
+ $sql.=" FROM ".MAIN_DB_PREFIX."document_model";
+ $sql.=" WHERE type = '".$type."'";
$resql = $db->query($sql);
if ($resql)
diff --git a/htdocs/includes/modules/commande/pdf_rouge.modules.php b/htdocs/includes/modules/commande/pdf_edison.modules.php
similarity index 96%
rename from htdocs/includes/modules/commande/pdf_rouge.modules.php
rename to htdocs/includes/modules/commande/pdf_edison.modules.php
index 59f799afd1a..b67b4c9c870 100644
--- a/htdocs/includes/modules/commande/pdf_rouge.modules.php
+++ b/htdocs/includes/modules/commande/pdf_edison.modules.php
@@ -22,9 +22,9 @@
*/
/**
- \file htdocs/includes/modules/commande/pdf_rouge.modules.php
- \ingroup propale
- \brief Fichier de la classe permettant de générer les commandes au modèle Rouge
+ \file htdocs/includes/modules/commande/pdf_edison.modules.php
+ \ingroup commande
+ \brief Fichier de la classe permettant de générer les commandes au modèle Edison
\version $Revision$
*/
@@ -32,23 +32,24 @@ require_once(DOL_DOCUMENT_ROOT ."/includes/modules/commande/modules_commande.php
/**
- \class pdf_propale_rouge
- \brief Classe permettant de générer les commandes au modèle Rouge
+ \class pdf_edison
+ \brief Classe permettant de générer les commandes au modèle Edison
*/
-class pdf_rouge extends ModelePDFCommandes
+class pdf_edison extends ModelePDFCommandes
{
/** \brief Constructeur
\param db handler accès base de donnée
*/
- function pdf_rouge($db=0)
+ function pdf_edison($db=0)
{
$this->db = $db;
- $this->name = "rouge";
+ $this->name = "edison";
$this->description = "Modèle de commande simple";
// Dimension page pour format A4
+ $this->type = 'pdf';
$this->page_largeur = 210;
$this->page_hauteur = 297;
$this->format = array($this->page_largeur,$this->page_hauteur);
diff --git a/htdocs/includes/modules/commande/pdf_azur.modules.php b/htdocs/includes/modules/commande/pdf_einstein.modules.php
similarity index 98%
rename from htdocs/includes/modules/commande/pdf_azur.modules.php
rename to htdocs/includes/modules/commande/pdf_einstein.modules.php
index 9888a318b31..4b0dd6fe329 100644
--- a/htdocs/includes/modules/commande/pdf_azur.modules.php
+++ b/htdocs/includes/modules/commande/pdf_einstein.modules.php
@@ -1,5 +1,5 @@
+/* Copyright (C) 2004-2006 Laurent Destailleur
*
* 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
@@ -21,9 +21,9 @@
*/
/**
- \file htdocs/includes/modules/commande/pdf_azur.modules.php
- \ingroup propale
- \brief Fichier de la classe permettant de générer les commandes au modèle Azur
+ \file htdocs/includes/modules/commande/pdf_einstein.modules.php
+ \ingroup commande
+ \brief Fichier de la classe permettant de générer les commandes au modèle Einstein
\author Laurent Destailleur
\version $Revision$
\version $Revision$
@@ -34,26 +34,27 @@ require_once(DOL_DOCUMENT_ROOT."/product.class.php");
/**
- \class pdf_propale_azur
- \brief Classe permettant de générer les commandes au modèle Azur
+ \class pdf_einstein
+ \brief Classe permettant de générer les commandes au modèle Einstein
*/
-class pdf_azur extends ModelePDFCommandes
+class pdf_einstein extends ModelePDFCommandes
{
/**
\brief Constructeur
\param db Handler accès base de donnée
*/
- function pdf_azur($db)
+ function pdf_einstein($db)
{
global $conf,$langs;
$this->db = $db;
- $this->name = "azur";
+ $this->name = "einstein";
$this->description = "Modèle de commandes complet (logo...)";
// Dimension page pour format A4
+ $this->type = 'pdf';
$this->page_largeur = 210;
$this->page_hauteur = 297;
$this->format = array($this->page_largeur,$this->page_hauteur);
@@ -66,8 +67,6 @@ class pdf_azur extends ModelePDFCommandes
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION
$this->option_modereg = 1; // Gere choix mode règlement FACTURE_CHQ_NUMBER, FACTURE_RIB_NUMBER
$this->option_codeproduitservice = 1; // Affiche code produit-service
- $this->option_tvaintra = 1; // Affiche tva intra MAIN_INFO_TVAINTRA
- $this->option_capital = 1; // Affiche capital MAIN_INFO_CAPITAL
if (defined("FACTURE_TVAOPTION") && FACTURE_TVAOPTION == 'franchise')
$this->franchise=1;
diff --git a/htdocs/includes/modules/dons/modules_don.php b/htdocs/includes/modules/dons/modules_don.php
index 0014fb64ca1..44208d3a550 100644
--- a/htdocs/includes/modules/dons/modules_don.php
+++ b/htdocs/includes/modules/dons/modules_don.php
@@ -58,8 +58,11 @@ class ModeleDon extends FPDF
*/
function liste_modeles($db)
{
+ $type='donation';
$liste=array();
- $sql ="";
+ $sql ="SELECT nom as id, nom as lib";
+ $sql.=" FROM ".MAIN_DB_PREFIX."document_model";
+ $sql.=" WHERE type = '".$type."'";
$resql = $db->query($sql);
if ($resql)
diff --git a/htdocs/includes/modules/facture/pdf_crabe.modules.php b/htdocs/includes/modules/facture/pdf_crabe.modules.php
index 38c99a48a74..ace21e36ac3 100644
--- a/htdocs/includes/modules/facture/pdf_crabe.modules.php
+++ b/htdocs/includes/modules/facture/pdf_crabe.modules.php
@@ -1,5 +1,5 @@
+/* Copyright (C) 2004-2006 Laurent Destailleur
*
* 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
@@ -53,6 +53,7 @@ class pdf_crabe extends ModelePDFFactures
$this->description = "Modèle de facture complet (Gère l'option fiscale de facturation TVA, le choix du mode de règlement à afficher, logo...)";
// Dimension page pour format A4
+ $this->type = 'pdf';
$this->page_largeur = 210;
$this->page_hauteur = 297;
$this->format = array($this->page_largeur,$this->page_hauteur);
@@ -65,8 +66,6 @@ class pdf_crabe extends ModelePDFFactures
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION
$this->option_modereg = 1; // Gere choix mode règlement FACTURE_CHQ_NUMBER, FACTURE_RIB_NUMBER
$this->option_codeproduitservice = 1; // Affiche code produit-service
- $this->option_tvaintra = 1; // Affiche tva intra MAIN_INFO_TVAINTRA
- $this->option_capital = 1; // Affiche capital MAIN_INFO_CAPITAL
if (defined("FACTURE_TVAOPTION") && FACTURE_TVAOPTION == 'franchise')
$this->franchise=1;
diff --git a/htdocs/includes/modules/fichinter/modules_fichinter.php b/htdocs/includes/modules/fichinter/modules_fichinter.php
index a1f7b51f36d..62240e22adc 100644
--- a/htdocs/includes/modules/fichinter/modules_fichinter.php
+++ b/htdocs/includes/modules/fichinter/modules_fichinter.php
@@ -62,8 +62,11 @@ class ModelePDFFicheinter extends FPDF
*/
function liste_modeles($db)
{
+ $type='ficheinter';
$liste=array();
- $sql ="";
+ $sql ="SELECT nom as id, nom as lib";
+ $sql.=" FROM ".MAIN_DB_PREFIX."document_model";
+ $sql.=" WHERE type = '".$type."'";
$resql = $db->query($sql);
if ($resql)
diff --git a/htdocs/includes/modules/modPropale.class.php b/htdocs/includes/modules/modPropale.class.php
index b65ea49864d..e327750a629 100644
--- a/htdocs/includes/modules/modPropale.class.php
+++ b/htdocs/includes/modules/modPropale.class.php
@@ -153,8 +153,8 @@ class modPropale extends DolibarrModules
$this->dirs[1] = $conf->propal->dir_images;
$sql = array(
- "DELETE FROM ".MAIN_DB_PREFIX."propal_model_pdf WHERE nom = '".$this->const[0][2]."'",
- "INSERT INTO ".MAIN_DB_PREFIX."propal_model_pdf (nom) VALUES('".$this->const[0][2]."');",
+ "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->const[0][2]."'",
+ "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type) VALUES('".$this->const[0][2]."','propal')",
);
return $this->_init($sql);
diff --git a/htdocs/includes/modules/propale/modules_propale.php b/htdocs/includes/modules/propale/modules_propale.php
index 1407164b0c1..3dbf9032aab 100644
--- a/htdocs/includes/modules/propale/modules_propale.php
+++ b/htdocs/includes/modules/propale/modules_propale.php
@@ -54,9 +54,11 @@ class ModelePDFPropales extends FPDF
*/
function liste_modeles($db)
{
+ $type='propal';
$liste=array();
$sql ="SELECT nom as id, nom as lib";
- $sql.=" FROM ".MAIN_DB_PREFIX."propal_model_pdf";
+ $sql.=" FROM ".MAIN_DB_PREFIX."document_model";
+ $sql.=" WHERE type = '".$type."'";
$resql = $db->query($sql);
if ($resql)
diff --git a/htdocs/includes/modules/propale/pdf_propale_azur.modules.php b/htdocs/includes/modules/propale/pdf_propale_azur.modules.php
index e8b9c885062..dfc6f9466cc 100644
--- a/htdocs/includes/modules/propale/pdf_propale_azur.modules.php
+++ b/htdocs/includes/modules/propale/pdf_propale_azur.modules.php
@@ -54,6 +54,7 @@ class pdf_propale_azur extends ModelePDFPropales
$this->description = "Modèle de propositions commerciales complet (logo...)";
// Dimension page pour format A4
+ $this->type = 'pdf';
$this->page_largeur = 210;
$this->page_hauteur = 297;
$this->format = array($this->page_largeur,$this->page_hauteur);
@@ -66,8 +67,6 @@ class pdf_propale_azur extends ModelePDFPropales
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION
$this->option_modereg = 1; // Gere choix mode règlement FACTURE_CHQ_NUMBER, FACTURE_RIB_NUMBER
$this->option_codeproduitservice = 1; // Affiche code produit-service
- $this->option_tvaintra = 1; // Affiche tva intra MAIN_INFO_TVAINTRA
- $this->option_capital = 1; // Affiche capital MAIN_INFO_CAPITAL
if (defined("FACTURE_TVAOPTION") && FACTURE_TVAOPTION == 'franchise')
$this->franchise=1;
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 8a6f44d80be..350256958f8 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -375,16 +375,24 @@ ErrorConnectOkButWrongDatabase=Connection succeeded but database doesn't look to
BillsSetup=Invoices module setup
BillsDate=Invoices date
BillsNumberingModule=Invoices numbering module
+BillsPDFModules=Invoice documents models
+DiscountSetup=Credit note module setup
+DiscountsNumberingModules=Credit note numbering modules
+DiscountsPDFModules=Credit note document models
+Discounts=Discounts
##### Proposals #####
PropalSetup=Commercial proposals module setup
CreateForm=Create forms
NumberOfProductLines=Number of product lines
PathToDocuments=Path to documents
ProposalsNumberingModules=Commercial proposal numbering modules
-ProposalsPDFModules=Commercial proposal PDF modules
+ProposalsPDFModules=Commercial proposal documents models
##### Orders #####
OrdersSetup=Orders' management setup
OrdersNumberingModules=Orders numbering modules
+OrdersModelModule=Order documents models
+##### Fiche inter #####
+TemplatePDFInterventions=Intervention card documents models
##### Clicktodial #####
ClickToDialSetup=Click To Dial module setup
##### Bookmark4u #####
@@ -455,8 +463,3 @@ NewRSS=New RSS
##### Mailing #####
MailingSetup=Mailing module setup
MailingEMailFrom=Sender EMail (From) for emails sent by emailing module
-##### Discount setup #####
-DiscountSetup=Discount module setup
-DiscountsNumberingModules=Discount numbering modules
-DiscountsPDFModules=Discount PDF modules
-Discounts=Discounts
\ No newline at end of file
diff --git a/htdocs/langs/en_US/interventions.lang b/htdocs/langs/en_US/interventions.lang
index 72b4d8f099a..947851add90 100644
--- a/htdocs/langs/en_US/interventions.lang
+++ b/htdocs/langs/en_US/interventions.lang
@@ -6,7 +6,6 @@ NewIntervention=New intervention
EditIntervention=Editer intervention
AddIntervention=Add intervention
ListOfInterventions=List of interventions
-TemplatePDFInterventions=PDF template for intervention cards
LastInterventions=Last %s interventions
AllInterventions=All interventions
CreateDaftIntervention=Create draft
\ No newline at end of file
diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang
index f9951e97c48..5f2e626ecdd 100644
--- a/htdocs/langs/en_US/other.lang
+++ b/htdocs/langs/en_US/other.lang
@@ -47,6 +47,9 @@ CanceledBy=Canceled by %s
ClosedBy=Closed by %s
FileWasRemoved=File was deleted
FeatureNotYetAvailable=Feature not yet available in this version
+FeaturesSupported=Features not supported
+Width=Width
+Height=Height
##### Webcal #####
LoginWebcal=Login for Webcalendar
AddCalendarEntry=Add entry in calendar
diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang
index 5da9375bafb..431d104818f 100644
--- a/htdocs/langs/fr_FR/admin.lang
+++ b/htdocs/langs/fr_FR/admin.lang
@@ -375,16 +375,24 @@ ErrorConnectOkButWrongDatabase=La connexion a r
BillsSetup=Configuration du module Factures
BillsDate=Date des factures
BillsNumberingModule=Module de numérotation des factures
+BillsPDFModules=Modèle de document de factures
+DiscountSetup=Configuration du module Avoirs
+DiscountsNumberingModules=Modules de numérotation des avoirs
+DiscountsPDFModules=Modèles de documents des avoirs
+Discounts=Avoirs
##### Proposals #####
PropalSetup=Configuration du module Propositions Commerciales
CreateForm=Création formulaire
NumberOfProductLines=Nombre de lignes produits
PathToDocuments=Chemins d'accès aux documents
ProposalsNumberingModules=Modules de numérotation des propositions commerciales
-ProposalsPDFModules=Modules de propositions commerciales PDF
+ProposalsPDFModules=Modèles de documents de propositions commerciales
##### Orders #####
OrdersSetup=Configuration du module Commandes
OrdersNumberingModules=Modules de numérotation des commandes
+OrdersModelModule=Modèles de document des commandes
+##### Fiche inter #####
+TemplatePDFInterventions=Modèle de documents des fiches d'interventions
##### Clicktodial #####
ClickToDialSetup=Configuration du module Click To Dial
##### Bookmark4u #####
@@ -455,9 +463,5 @@ NewRSS=Syndication d'un nouveau flux RSS
##### Mailing #####
MailingSetup=Configuration du module EMailing
MailingEMailFrom=Email emetteur (From) des mails envoyés par EMailing
-##### Discount setup #####
-DiscountSetup=Configuration du module Avoirs
-DiscountsNumberingModules=Modules de numérotation des avoirs
-DiscountsPDFModules=Modèles d'avoirs PDF
-Discounts=Avoirs
+
diff --git a/htdocs/langs/fr_FR/interventions.lang b/htdocs/langs/fr_FR/interventions.lang
index f9e21f110ed..d38960d3ba1 100644
--- a/htdocs/langs/fr_FR/interventions.lang
+++ b/htdocs/langs/fr_FR/interventions.lang
@@ -6,7 +6,6 @@ NewIntervention=Nouvelle intervention
AddIntervention=Créer intervention
ListOfInterventions=Liste des interventions
EditIntervention=Editer
-TemplatePDFInterventions=Modèle PDF des fiches d'interventions
LastInterventions=Les %s dernières interventions
AllInterventions=Toutes les interventions
CreateDaftIntervention=Créer brouillon
\ No newline at end of file
diff --git a/htdocs/langs/fr_FR/other.lang b/htdocs/langs/fr_FR/other.lang
index 7f5a652c1e5..c38dbf2b076 100644
--- a/htdocs/langs/fr_FR/other.lang
+++ b/htdocs/langs/fr_FR/other.lang
@@ -47,6 +47,9 @@ CanceledBy=Annul
ClosedBy=Cloturé par %s
FileWasRemoved=Le fichier a été supprimé
FeatureNotYetAvailable=Fonctionnalité pas encore disponible dans cette version
+FeaturesSupported=Fonctionnalités supportées
+Width=Largeur
+Height=Hauteur
##### Webcal #####
LoginWebcal=Login Webcalendar
AddCalendarEntry=Ajouter entrée dans le calendrier
diff --git a/htdocs/lib/functions.inc.php b/htdocs/lib/functions.inc.php
index a4e32a6a434..978190cfe40 100644
--- a/htdocs/lib/functions.inc.php
+++ b/htdocs/lib/functions.inc.php
@@ -707,11 +707,12 @@ function img_disable($alt = "default")
\brief Affiche logo help avec curseur "?"
\return string Retourne tag img
*/
-function img_help()
+function img_help($usehelpcursor=1)
{
global $conf,$langs;
- return '';
+ return '';
}
+
/**
\brief Affiche picto calendrier "?"
\return string Retourne tag img
diff --git a/mysql/migration/2.0.0-2.1.0.sql b/mysql/migration/2.0.0-2.1.0.sql
index 245ffca2e92..90dad7b4427 100644
--- a/mysql/migration/2.0.0-2.1.0.sql
+++ b/mysql/migration/2.0.0-2.1.0.sql
@@ -6,7 +6,7 @@
--
-drop table llx_commande_model_pdf if exist;
+drop table if exists llx_commande_model_pdf;
alter table llx_commande add column note_public text after note;
@@ -62,7 +62,7 @@ update llx_actioncomm set datec = datea where datec is null;
update llx_actioncomm set datep = datea where datep is null;
-drop table llx_expedition_model_pdf if exists;
+drop table if exists llx_expedition_model_pdf;
create table llx_product_det
diff --git a/mysql/tables/llx_avoir_model_pdf.sql b/mysql/tables/llx_avoir_model_pdf.sql
deleted file mode 100644
index 51fefc0e37d..00000000000
--- a/mysql/tables/llx_avoir_model_pdf.sql
+++ /dev/null
@@ -1,30 +0,0 @@
--- ===================================================================
--- Copyright (C) 2001-2003 Rodolphe Quiedeville
---
--- 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.
---
--- $Id$
--- $Source$
---
--- Liste des modeles d'avoir pdf disponibles
---
--- ===================================================================
-
-create table llx_avoir_model_pdf
-(
- nom varchar(50) PRIMARY KEY,
- libelle varchar(255),
- description text
-)type=innodb;
diff --git a/mysql/tables/llx_commande_model_pdf.sql b/mysql/tables/llx_commande_model_pdf.sql
deleted file mode 100644
index a1764cbb2b1..00000000000
--- a/mysql/tables/llx_commande_model_pdf.sql
+++ /dev/null
@@ -1,30 +0,0 @@
--- ===================================================================
--- Copyright (C) 2001-2003 Rodolphe Quiedeville
---
--- 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.
---
--- $Id$
--- $Source$
---
--- Liste des modeles de commande pdf disponibles
---
--- ===================================================================
-
-create table llx_commande_model_pdf
-(
- nom varchar(50) PRIMARY KEY,
- libelle varchar(255),
- description text
-)type=innodb;
diff --git a/mysql/tables/llx_expedition_model_pdf.sql b/mysql/tables/llx_expedition_model_pdf.sql
deleted file mode 100644
index f3148e77228..00000000000
--- a/mysql/tables/llx_expedition_model_pdf.sql
+++ /dev/null
@@ -1,30 +0,0 @@
--- ===================================================================
--- Copyright (C) 2001-2003 Rodolphe Quiedeville
---
--- 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.
---
--- $Id$
--- $Source$
---
--- Liste des modeles de bon de livraison pdf disponibles
---
--- ===================================================================
-
-create table llx_expedition_model_pdf
-(
- nom varchar(50) PRIMARY KEY,
- libelle varchar(255),
- description text
-)type=innodb;
diff --git a/mysql/tables/llx_propal_model_pdf.sql b/mysql/tables/llx_propal_model_pdf.sql
deleted file mode 100644
index dc89ebc6ca5..00000000000
--- a/mysql/tables/llx_propal_model_pdf.sql
+++ /dev/null
@@ -1,30 +0,0 @@
--- ===================================================================
--- Copyright (C) 2001-2003 Rodolphe Quiedeville
---
--- 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.
---
--- $Id$
--- $Source$
---
--- Liste des modeles de propale pdf disponibles
---
--- ===================================================================
-
-create table llx_propal_model_pdf
-(
- nom varchar(50) PRIMARY KEY,
- libelle varchar(255),
- description text
-)type=innodb;