From ad4c4e7acda40763851ae81d90f7b261fad6b221 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 28 Apr 2006 22:54:02 +0000 Subject: [PATCH] =?UTF-8?q?Uniformisation=20du=20code:=20Tous=20les=20modu?= =?UTF-8?q?les=20de=20g=E9n=E9ration=20de=20document=20PDF=20s'active=20da?= =?UTF-8?q?ns=20la=20table=20llx=5Fdocument=5Fmodel=20plutot=20que=20les?= =?UTF-8?q?=20n=20tables=20llx=5Fxxxx=5Fmodel=5Fpdf.=20Cela=20r=E9duit=20l?= =?UTF-8?q?e=20nombres=20de=20tables=20et=20permet=20plus=20de=20mutualisa?= =?UTF-8?q?tion=20du=20code.=20Ainsi,=20tous=20les=20modules=20peuvent=20a?= =?UTF-8?q?voir=20maintenant=20plusieurs=20mod=E8le=20actifs,=20et=201=20m?= =?UTF-8?q?od=E8le=20d=E9faut.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/admin/avoir.php | 193 +++++---- htdocs/admin/commande.php | 201 ++++++---- htdocs/admin/expedition.php | 373 ++++++++++-------- htdocs/admin/facture.php | 218 +++++++--- htdocs/admin/fichinter.php | 166 ++++++-- htdocs/admin/propale.php | 212 ++++++---- .../modules/modules_commandefournisseur.php | 4 +- htdocs/html.form.class.php | 2 +- .../modules/commande/modules_commande.php | 4 +- ...uge.modules.php => pdf_edison.modules.php} | 17 +- ...r.modules.php => pdf_einstein.modules.php} | 21 +- htdocs/includes/modules/dons/modules_don.php | 5 +- .../modules/facture/pdf_crabe.modules.php | 5 +- .../modules/fichinter/modules_fichinter.php | 5 +- htdocs/includes/modules/modPropale.class.php | 4 +- .../modules/propale/modules_propale.php | 4 +- .../propale/pdf_propale_azur.modules.php | 3 +- htdocs/langs/en_US/admin.lang | 15 +- htdocs/langs/en_US/interventions.lang | 1 - htdocs/langs/en_US/other.lang | 3 + htdocs/langs/fr_FR/admin.lang | 16 +- htdocs/langs/fr_FR/interventions.lang | 1 - htdocs/langs/fr_FR/other.lang | 3 + htdocs/lib/functions.inc.php | 5 +- mysql/migration/2.0.0-2.1.0.sql | 4 +- mysql/tables/llx_avoir_model_pdf.sql | 30 -- mysql/tables/llx_commande_model_pdf.sql | 30 -- mysql/tables/llx_expedition_model_pdf.sql | 30 -- mysql/tables/llx_propal_model_pdf.sql | 30 -- 29 files changed, 946 insertions(+), 659 deletions(-) rename htdocs/includes/modules/commande/{pdf_rouge.modules.php => pdf_edison.modules.php} (96%) rename htdocs/includes/modules/commande/{pdf_azur.modules.php => pdf_einstein.modules.php} (98%) delete mode 100644 mysql/tables/llx_avoir_model_pdf.sql delete mode 100644 mysql/tables/llx_commande_model_pdf.sql delete mode 100644 mysql/tables/llx_expedition_model_pdf.sql delete mode 100644 mysql/tables/llx_propal_model_pdf.sql 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 "\n ".$file.""; - print "\n ".$modAvoir->info()."\n"; - print "\n ".$modAvoir->getExample()."\n"; - - print ''; - if ($avoir_addon_var == "$file") - { - $title=''; - if ($modAvoir->getNextValue() != $langs->trans("NotAvailable")) - { - $title=$langs->trans("NextValue").': '.$modAvoir->getNextValue(); - } - print img_tick($title); - } - else - { - print "".$langs->trans("Activate").""; - } - print ''; - + print "\n ".$module->info()."\n"; + // Affiche example + print ''.$module->getExample().''; + + print ''; + if ($conf->global->FACTURE_ADDON == "$file") + { + print img_tick($langs->trans("Activated")); + } + else + { + print ''.$langs->trans("Default").''; + } + print ''; + + // Info + $htmltooltip=''; + $nextval=$module->getNextValue(); + if ($nextval != $langs->trans("NotAvailable")) + { + $htmltooltip=''.$langs->trans("NextValue").': '.$nextval; + } + print 'tooltip_properties($htmltooltip).'>'; + print ($htmltooltip?img_help(0):''); + print ''; + print "\n"; } } @@ -183,29 +197,31 @@ print "
\n"; /* - * PDF + * Modeles de documents */ print_titre($langs->trans("DiscountsPDFModules")); +// Defini tableau def de modele invoice $def = array(); - -$sql = "SELECT nom FROM ".MAIN_DB_PREFIX."avoir_model_pdf"; +$sql = "SELECT nom"; +$sql.= " FROM ".MAIN_DB_PREFIX."document_model"; +$sql.= " WHERE type = 'creditnote'"; $resql=$db->query($sql); if ($resql) { - $i = 0; - $num_rows=$db->num_rows($resql); - while ($i < $num_rows) - { - $array = $db->fetch_array($resql); - array_push($def, $array[0]); - $i++; - } + $i = 0; + $num_rows=$db->num_rows($resql); + while ($i < $num_rows) + { + $array = $db->fetch_array($resql); + array_push($def, $array[0]); + $i++; + } } else { - dolibarr_print_error($db); + dolibarr_print_error($db); } $dir = DOL_DOCUMENT_ROOT .'/avoir/modules/pdf/'; @@ -214,8 +230,9 @@ print "\n"; print "\n"; print " \n"; print " \n"; -print ' \n"; -print ' \n"; +print '\n"; +print '\n"; +print ''; print "\n"; clearstatcache(); @@ -236,35 +253,53 @@ while (($file = readdir($handle))!==false) print "\n '; - print "\n "; + } + else + { + print ""; + } - if (in_array($name, $def)) - { - print img_tick(); - print "\n \n '; + + // Info + $htmltooltip = ''.$langs->trans("Type").': '.($obj->type?$obj->type:$langs->trans("Unknown")); + $htmltooltip.='
'.$langs->trans("Width").': '.$obj->page_largeur; + $htmltooltip.='
'.$langs->trans("Height").': '.$obj->page_hauteur; + $htmltooltip.='
'.$langs->trans("FeaturesSupported").':'; + $htmltooltip.='
'.$langs->trans("Logo").': '.yn($obj->option_logo); + print ''; - print "\n '; + print ''; } } closedir($handle); diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index 6775ec2df0d..4ed3b7d1a00 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -33,9 +33,10 @@ require("./pre.inc.php"); $langs->load("admin"); +$langs->load("bills"); +$langs->load("other"); $langs->load("orders"); -llxHeader(); if (!$user->admin) accessforbidden(); @@ -45,50 +46,76 @@ if (!$user->admin) * Actions */ -if ($_GET["action"] == 'setmod') -{ - dolibarr_set_const($db,'COMMANDE_ADDON',$_GET["value"]); -} if ($_GET["action"] == 'set') { - $sql = "INSERT INTO ".MAIN_DB_PREFIX."commande_model_pdf (nom) VALUES ('".$_GET["value"]."')"; - $resql=$db->query($sql); - if (! $resql) + $type='order'; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type) VALUES ('".$_GET["value"]."','".$type."')"; + if ($db->query($sql)) { - dolibarr_print_error($db); + } } -if ($_GET["action"] == 'setpdf') -{ - dolibarr_set_const($db,'COMMANDE_ADDON_PDF',$_GET["value"]); - // On active le modele - $sql_del = "delete from ".MAIN_DB_PREFIX."commande_model_pdf where nom = '".$_GET["value"]."';"; - $resql=$db->query($sql_del); - - $sql = "INSERT INTO ".MAIN_DB_PREFIX."commande_model_pdf (nom) VALUES ('".$_GET["value"]."')"; - $resql=$db->query($sql); - if (! $resql) - { - dolibarr_print_error($db); - } -} if ($_GET["action"] == 'del') { - $sql = "DELETE FROM ".MAIN_DB_PREFIX."commande_model_pdf WHERE nom='".$_GET["value"]."'"; - $resql=$db->query($sql); - if (! $resql) + $sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom='".$_GET["value"]."'"; + if ($db->query($sql)) { - dolibarr_print_error($db); + } } +if ($_GET["action"] == 'setdoc') +{ + $db->begin(); + + if (dolibarr_set_const($db, "COMMANDE_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 + $conf->global->COMMANDE_ADDON_PDF = $_GET["value"]; + } + + // On active le modele + $type='order'; + $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(); + } +} + +if ($_GET["action"] == 'setmod') +{ + // \todo Verifier si module numerotation choisi peut etre activé + // par appel methode canBeActivated + + + if (dolibarr_set_const($db, "COMMANDE_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->COMMANDE_ADDON = $_GET["value"]; + } +} + + /* * Affichage page */ +llxHeader(); + $dir = "../includes/modules/commande/"; +$html=new Form($db); print_titre($langs->trans("OrdersSetup")); @@ -98,9 +125,11 @@ print_titre($langs->trans("OrdersNumberingModules")); print '
".$langs->trans("Name")."".$langs->trans("Description")."'.$langs->trans("Activated")."'.$langs->trans("Default")."'.$langs->trans("Activated")."'.$langs->trans("Default")."'.$langs->trans("Info").'
\n"; require_once($dir.$file); $obj = new $classname($db); - print $obj->description; + print '\n"; + // Activé + if (in_array($name, $def)) + { + print "\n"; + if ($conf->global->FACTURE_AVOIR_ADDON_PDF != "$name") + { + print ''; + print img_tick($langs->trans("Disable")); + print ''; + } + else + { + print img_tick($langs->trans("Enabled")); + } + print "\n"; + print ''.$langs->trans("Activate").''; + print ""; - print ''.$langs->trans("Disable").''; - } - else - { - print " "; - print ""; - print ''.$langs->trans("Activate").''; - } + // Defaut + print ""; + if ($conf->global->FACTURE_AVOIR_ADDON_PDF == "$name") + { + print img_tick($langs->trans("Default")); + } + else + { + print ''.$langs->trans("Default").''; + } + print 'tooltip_properties($htmltooltip).'>'.img_help(0).'"; - - if ($avoir_addon_var_pdf == "$name") - { - print img_tick(); - } - else - { - print ''.$langs->trans("Activate").''; - } - print '
'; print ''; -print ''; +print ''; +print ''; print ''; print ''; +print ''; print "\n"; clearstatcache(); @@ -119,27 +148,37 @@ if ($handle) require_once(DOL_DOCUMENT_ROOT ."/includes/modules/commande/".$file.".php"); - $modCommande = new $file; + $module = new $file; $var=!$var; - print ''; - print ''; + // Examples + print '\n"; + print ''; + print img_tick($langs->trans("Activated")); } else { - print ''; + print ''.$langs->trans("Activate").''; } + print ''; + + // Info + $htmltooltip=''; + $nextval=$module->getNextValue(); + if ($nextval != $langs->trans("NotAvailable")) + { + $htmltooltip=''.$langs->trans("NextValue").': '.$nextval; + } + print ''; print ''; } @@ -147,26 +186,19 @@ if ($handle) closedir($handle); } -print '
'.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Example").''.$langs->trans("Activated").''.$langs->trans("Info").'
'.$modCommande->nom."\n"; - print $modCommande->info(); + print '
'.$module->nom."\n"; + print $module->info(); print ''; - print $modCommande->getExample(); - print ''.$module->getExample()."'; if ($conf->global->COMMANDE_ADDON == "$file") { - print ''; - print img_tick(); - print ''.$langs->trans("Activate").'tooltip_properties($htmltooltip).'>'; + print ($htmltooltip?img_help(0):''); + print '
'; +print '
'; /* - * PDF + * Modeles de documents */ -print '
'; print_titre($langs->trans("OrdersModelModule")); -print "\n"; -print "\n"; -print ' \n"; -print " \n"; -print ' \n"; -print ' \n"; -print "\n"; - -clearstatcache(); - +// Defini tableau def de modele propal +$type='order'; $def = array(); -$sql = "SELECT nom FROM ".MAIN_DB_PREFIX."commande_model_pdf"; +$sql = "SELECT nom"; +$sql.= " FROM ".MAIN_DB_PREFIX."document_model"; +$sql.= " WHERE type = '".$type."'"; $resql=$db->query($sql); if ($resql) { @@ -174,8 +206,8 @@ if ($resql) $num_rows=$db->num_rows($resql); while ($i < $num_rows) { - $obj = $db->fetch_object($resql); - array_push($def, $obj->nom); + $array = $db->fetch_array($resql); + array_push($def, $array[0]); $i++; } } @@ -183,8 +215,23 @@ else { dolibarr_print_error($db); } + +$dir = "../includes/modules/commande/"; + +print "
'.$langs->trans("Name")."".$langs->trans("Description")."'.$langs->trans("Activated")."'.$langs->trans("Default")."
\n"; +print "\n"; +print ' \n"; +print " \n"; +print '\n"; +print '\n"; +print ''; +print "\n"; + +clearstatcache(); + $handle=opendir($dir); -$var=True; + +$var=true; while (($file = readdir($handle))!==false) { if (eregi('\.modules\.php$',$file) && substr($file,0,4) == 'pdf_') @@ -197,40 +244,56 @@ while (($file = readdir($handle))!==false) print "$name"; print "\n \n"; // Activé - print ""; } else { - print ''.$langs->trans("Activate").''; + print ""; } - print "\n"; - // Defaut print "'; + print ''; + + // Info + $htmltooltip = ''.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); + $htmltooltip.='
'.$langs->trans("Width").': '.$module->page_largeur; + $htmltooltip.='
'.$langs->trans("Height").': '.$module->page_hauteur; + $htmltooltip.='
'.$langs->trans("FeaturesSupported").':'; + $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo); + $htmltooltip.='
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg); + $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg); + 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 '
'.$langs->trans("Name")."".$langs->trans("Description")."'.$langs->trans("Activated")."'.$langs->trans("Default")."'.$langs->trans("Info").'
\n"; require_once($dir.$file); - $obj = new $classname($db); - - print $obj->description; - + $module = new $classname($db); + print $module->description; print "\n"; if (in_array($name, $def)) { - print img_tick().' '; - if ($conf->global->COMMANDE_ADDON_PDF != "$name") + print "\n"; + if ($conf->global->COMMANDE_ADDON_PDF != "$name") { - print ''.$langs->trans("Disable").''; + print ''; + print img_tick($langs->trans("Disable")); + print ''; } + else + { + print img_tick($langs->trans("Enabled")); + } + print "\n"; + print ''.$langs->trans("Activate").''; + print ""; if ($conf->global->COMMANDE_ADDON_PDF == "$name") { - print img_tick(); + print img_tick($langs->trans("Default")); } else { - print ''.$langs->trans("Default").''; + print ''.$langs->trans("Default").''; } - print '
tooltip_properties($htmltooltip).'>'.img_help(0).'
'; print ''; print ''; print ''; -print ''; -print ''; +print ''; +print ''; +print ''; print "\n"; -if(is_dir($dir)) { - $handle=opendir($dir); - $var=true; - - while (($file = readdir($handle))!==false) - { - if (substr($file, strlen($file) -12) == '.modules.php' && substr($file,0,19) == 'methode_expedition_') - { - $name = substr($file, 19, strlen($file) - 31); - $classname = substr($file, 0, strlen($file) - 12); - - require_once($dir.$file); - - $obj = new $classname(); - - $var=!$var; - print "'; - - // Default - print ''; - print ''; - } - } - closedir($handle); + require_once($dir.$file); + + $obj = new $classname(); + + $var=!$var; + print "'; + + // Default + print ''; + + // Info + print ''; + + print ''; + } + } + closedir($handle); } else { - print "\n"; + print "\n"; } print '
'.$langs->trans("Name").''.$langs->trans("Description").' '.$langs->trans("Active").''.$langs->trans("Default").''.$langs->trans("Active").''.$langs->trans("Default").''.$langs->trans("Info").'
"; - echo $obj->name; - print "\n"; - - print $obj->description; - - print ''; +if(is_dir($dir)) +{ + $handle=opendir($dir); + $var=true; - if (in_array($obj->id, $mods)) - { - print img_tick(); - print ''; - print ''.$langs->trans("Disable").''; + while (($file = readdir($handle))!==false) + { + if (substr($file, strlen($file) -12) == '.modules.php' && substr($file,0,19) == 'methode_expedition_') + { + $name = substr($file, 19, strlen($file) - 31); + $classname = substr($file, 0, strlen($file) - 12); - } - else - { - print ' '; - print ''.$langs->trans("Activate").''; - } - - print ''; - if ($expedition_default == "$name") - { - print img_tick(); - } - else - { - print ''.$langs->trans("Default").''; - } - print '
"; + echo $obj->name; + print "\n"; + + print $obj->description; + + print ''; + + if (in_array($obj->id, $mods)) + { + print img_tick(); + print ''; + print ''.$langs->trans("Disable").''; + + } + else + { + print ' '; + print ''.$langs->trans("Activate").''; + } + + print ''; + if ($conf->global->EXPEDITION_ADDON == "$name") + { + print img_tick(); + } + else + { + print ''.$langs->trans("Default").''; + } + print ' 
ERROR: $dir is not a directory !
ERROR: $dir is not a directory !
'; + +/* + * Modeles de documents + */ print '
'; - -// PDF - print_titre($langs->trans("SendingsReceiptModel")); +// Defini tableau def de modele invoice +$type="shipping"; +$def = array(); +$sql = "SELECT nom"; +$sql.= " FROM ".MAIN_DB_PREFIX."document_model"; +$sql.= " WHERE type = '".$type."'"; +$resql=$db->query($sql); +if ($resql) +{ + $i = 0; + $num_rows=$db->num_rows($resql); + while ($i < $num_rows) + { + $array = $db->fetch_array($resql); + array_push($def, $array[0]); + $i++; + } +} +else +{ + dolibarr_print_error($db); +} + print ''; print ''; -print ''; -print ''; +print ''; +print ''; +print ''; +print ''; +print ''; print "\n"; clearstatcache(); @@ -231,49 +246,79 @@ $dir = DOL_DOCUMENT_ROOT."/expedition/mods/pdf/"; if(is_dir($dir)) { - $handle=opendir($dir); - $var=true; - - while (($file = readdir($handle))!==false) - { - if (substr($file, strlen($file) -12) == '.modules.php' && substr($file,0,15) == 'pdf_expedition_') - { - $name = substr($file, 15, strlen($file) - 27); - $classname = substr($file, 0, strlen($file) - 12); - - $var=!$var; - print "'; - if ($expedition_addon_var_pdf == "$name") - { - print img_tick(); - } - else - { - print " "; - } + // Activ + if (in_array($name, $def)) + { + print ""; + } + else + { + print ""; + } - print "'; - print ''.$langs->trans("Activate").''; + // Info + $htmltooltip = ''.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); + $htmltooltip.='
'.$langs->trans("Width").': '.$module->page_largeur; + $htmltooltip.='
'.$langs->trans("Height").': '.$module->page_hauteur; + $htmltooltip.='
'.$langs->trans("FeaturesSupported").':'; + $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo); + $htmltooltip.='
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg); + $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg); + print ''; - print ''; - } - } - closedir($handle); + print ''; + } + } + closedir($handle); } else { - print "\n"; + print "\n"; } print '
'.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Active").''.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Activated").''.$langs->trans("Default").''.$langs->trans("Info").'
"; - print $name; - print "\n"; - require_once($dir.$file); - $obj = new $classname(); + $handle=opendir($dir); + $var=true; - print $obj->description; + while (($file = readdir($handle))!==false) + { + if (substr($file, strlen($file) -12) == '.modules.php' && substr($file,0,15) == 'pdf_expedition_') + { + $name = substr($file, 15, strlen($file) - 27); + $classname = substr($file, 0, strlen($file) - 12); + $var=!$var; + print "
"; + print $name; + print "\n"; + require_once($dir.$file); + $obj = new $classname(); - print ''; + print $obj->description; + print '\n"; + if ($conf->global->EXPEDITION_ADDON_PDF != "$name") + { + print ''; + print img_tick($langs->trans("Disable")); + print ''; + } + else + { + print img_tick($langs->trans("Enabled")); + } + print "\n"; + print ''.$langs->trans("Activate").''; + print "\n"; + // Defaut + print ""; + if ($conf->global->EXPEDITION_ADDON_PDF == "$name") + { + print img_tick($langs->trans("Default")); + } + else + { + print ''.$langs->trans("Default").''; + } + print 'tooltip_properties($htmltooltip).'>'.img_help(0).'
ERROR: $dir is not a directory !
ERROR: $dir is not a directory !
'; diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index 852675da1f8..eac796f6710 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -33,35 +33,82 @@ require("./pre.inc.php"); $langs->load("admin"); $langs->load("bills"); +$langs->load("other"); if (!$user->admin) accessforbidden(); - -$facture_addon_var = FACTURE_ADDON; -$facture_addon_var_pdf = FACTURE_ADDON_PDF; -$facture_rib_number_var = FACTURE_RIB_NUMBER; -$facture_chq_number_var = FACTURE_CHQ_NUMBER; -$facture_tva_option = FACTURE_TVAOPTION; - $typeconst=array('yesno','texte','chaine'); +/* + * Actions + */ + if ($_GET["action"] == 'set') { - if (dolibarr_set_const($db, "FACTURE_ADDON",$_GET["value"])) - $facture_addon_var = $_GET["value"]; + $type='invoice'; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type) VALUES ('".$_GET["value"]."','".$type."')"; + if ($db->query($sql)) + { + + } +} + +if ($_GET["action"] == 'del') +{ + $sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom='".$_GET["value"]."'"; + if ($db->query($sql)) + { + + } +} + +if ($_GET["action"] == 'setdoc') +{ + $db->begin(); + + if (dolibarr_set_const($db, "FACTURE_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 + $conf->global->FACTURE_ADDON_PDF = $_GET["value"]; + } + + // On active le modele + $type='invoice'; + $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(); + } +} + +if ($_GET["action"] == 'setmod') +{ + // \todo Verifier si module numerotation choisi peut etre activé + // par appel methode canBeActivated + + + if (dolibarr_set_const($db, "FACTURE_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->FACTURE_ADDON = $_GET["value"]; + } } if ($_POST["action"] == 'setribchq') { - if (dolibarr_set_const($db, "FACTURE_RIB_NUMBER",$_POST["rib"])) $facture_rib_number_var = $_POST["rib"]; - if (dolibarr_set_const($db, "FACTURE_CHQ_NUMBER",$_POST["chq"])) $facture_chq_number_var = $_POST["chq"]; -} - -if ($_GET["action"] == 'setpdf') -{ - if (dolibarr_set_const($db, "FACTURE_ADDON_PDF",$_GET["value"])) $facture_addon_var_pdf = $_GET["value"]; + if (dolibarr_set_const($db, "FACTURE_RIB_NUMBER",$_POST["rib"])) $conf->global->FACTURE_RIB_NUMBER = $_POST["rib"]; + if (dolibarr_set_const($db, "FACTURE_CHQ_NUMBER",$_POST["chq"])) $conf->global->FACTURE_CHQ_NUMBER = $_POST["chq"]; } if ($_POST["action"] == 'setforcedate') @@ -92,12 +139,11 @@ if ($_GET["action"] == 'delete') * Affiche page */ +llxHeader("",""); + $dir = "../includes/modules/facture/"; $html=new Form($db); - -llxHeader("",""); - $h = 0; $head[$h][0] = DOL_URL_ROOT."/admin/facture.php"; @@ -123,13 +169,14 @@ print ''.$langs->trans("Name").''; print ''.$langs->trans("Description").''; print ''.$langs->trans("Example").''; print ''.$langs->trans("Default").''; +print ''.$langs->trans("Info").''; print ''."\n"; clearstatcache(); $handle=opendir($dir); -$var=True; +$var=true; while (($file = readdir($handle))!==false) { if (is_dir($dir.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS') @@ -145,29 +192,37 @@ while (($file = readdir($handle))!==false) $classname = "mod_facture_".$file; require_once($dir.$filebis); - $obj = new $classname($db); - print $obj->info(); + $module = new $classname($db); + print $module->info(); print ''; // Affiche example - print ''.$obj->getExample().''; + print ''.$module->getExample().''; print ''; - if ($facture_addon_var == "$file") + if ($conf->global->FACTURE_ADDON == "$file") { - $title=''; - if ($obj->getNextValue() != $langs->trans("NotAvailable")) - { - $title=$langs->trans("NextValue").': '.$obj->getNextValue(); - } - print img_tick($title); + print img_tick($langs->trans("Activated")); } else { - print ''.$langs->trans("Default").''; + print ''.$langs->trans("Default").''; } - print "\n"; + print ''; + + // Info + $htmltooltip=''; + $nextval=$module->getNextValue(); + if ($nextval != $langs->trans("NotAvailable")) + { + $htmltooltip=''.$langs->trans("NextValue").': '.$nextval; + } + print 'tooltip_properties($htmltooltip).'>'; + print ($htmltooltip?img_help(0):''); + print ''; + + print "\n"; } } closedir($handle); @@ -176,10 +231,32 @@ print ''; /* - * PDF + * Modeles de documents */ print '
'; -print_titre("Modèles de facture pdf"); +print_titre($langs->trans("BillsPDFModules")); + +// Defini tableau def de modele invoice +$def = array(); +$sql = "SELECT nom"; +$sql.= " FROM ".MAIN_DB_PREFIX."document_model"; +$sql.= " WHERE type = 'invoice'"; +$resql=$db->query($sql); +if ($resql) +{ + $i = 0; + $num_rows=$db->num_rows($resql); + while ($i < $num_rows) + { + $array = $db->fetch_array($resql); + array_push($def, $array[0]); + $i++; + } +} +else +{ + dolibarr_print_error($db); +} print ''; print ''; @@ -187,6 +264,7 @@ print ''; print ''; print ''; print ''; +print ''; print "\n"; clearstatcache(); @@ -206,26 +284,56 @@ while (($file = readdir($handle))!==false) echo "$name"; print "\n"; + $module = new $classname($db); + print $module->description; + print ''; + // Activé + if (in_array($name, $def)) + { + print ""; + } + else + { + print ""; + } + + // Defaut + print "'; + + // Info + $htmltooltip = ''.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); + $htmltooltip.='
'.$langs->trans("Width").': '.$module->page_largeur; + $htmltooltip.='
'.$langs->trans("Height").': '.$module->page_hauteur; + $htmltooltip.='
'.$langs->trans("FeaturesSupported").':'; + $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo); + $htmltooltip.='
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg); + $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg); + print ''; + + print "\n"; } } closedir($handle); @@ -269,7 +377,7 @@ if ($db->query($sql)) $var=!$var; $row = $db->fetch_row($i); - if ($facture_rib_number_var == $row[0]) + if ($conf->global->FACTURE_RIB_NUMBER == $row[0]) { print ''; } @@ -307,7 +415,7 @@ if ($db->query($sql)) $var=!$var; $row = $db->fetch_row($i); - if ($facture_chq_number_var == $row[0]) + if ($conf->global->FACTURE_CHQ_NUMBER == $row[0]) { print ''; } diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index df62affef8b..97bda613882 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.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 * @@ -32,34 +32,73 @@ require("./pre.inc.php"); $langs->load("admin"); +$langs->load("bills"); +$langs->load("other"); $langs->load("interventions"); -llxHeader(); - if (!$user->admin) accessforbidden(); -$ficheinter_addon_var_pdf = FICHEINTER_ADDON_PDF; - - -if ($_GET["action"] == 'setpdf') +/* + * Actions + */ + +if ($_GET["action"] == 'set') { - $sql = "DELETE FROM ".MAIN_DB_PREFIX."const WHERE name = 'FICHEINTER_ADDON_PDF' ;"; - $db->query($sql);$sql =''; - $sql = "INSERT INTO ".MAIN_DB_PREFIX."const (name,value,visible) VALUES - ('FICHEINTER_ADDON_PDF','".$_GET["value"]."',0) ; "; - - if ($db->query($sql)) + $type='ficheinter'; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type) VALUES ('".$_GET["value"]."','".$type."')"; + if ($db->query($sql)) { - // la constante qui a été lue en avant du nouveau set - // on passe donc par une variable pour avoir un affichage cohérent - $ficheinter_addon_var_pdf = $_GET["value"]; + } } -$dir = "../includes/modules/fichinter/"; +if ($_GET["action"] == 'del') +{ + $sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom='".$_GET["value"]."'"; + if ($db->query($sql)) + { + } +} + +if ($_GET["action"] == 'setdoc') +{ + $db->begin(); + + if (dolibarr_set_const($db, "FICHEINTER_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 + $conf->global->FICHEINTER_ADDON_PDF = $_GET["value"]; + } + + // On active le modele + $type='ficheinter'; + $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(); + } +} + + +/* + * Affichage page + */ + +llxHeader(); + +$dir = "../includes/modules/fichinter/"; +$html=new Form($db); print_titre($langs->trans("InterventionsSetup")); @@ -67,12 +106,37 @@ print "
"; print_titre($langs->trans("TemplatePDFInterventions")); +// Defini tableau def des modeles +$type='ficheinter'; +$def = array(); +$sql = "SELECT nom"; +$sql.= " FROM ".MAIN_DB_PREFIX."document_model"; +$sql.= " WHERE type = '".$type."'"; +$resql=$db->query($sql); +if ($resql) +{ + $i = 0; + $num_rows=$db->num_rows($resql); + while ($i < $num_rows) + { + $array = $db->fetch_array($resql); + array_push($def, $array[0]); + $i++; + } +} +else +{ + dolibarr_print_error($db); +} + + print '
'.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Activated").''.$langs->trans("Default").''.$langs->trans("Info").'
\n"; require_once($dir.$file); - $obj = new $classname($db); - - print $obj->description; - - print ''; - - if ($facture_addon_var_pdf == "$name") - { - print ' '; - print ''; - print img_tick(); - } - else - { - print ' '; - print ''; - print ''.$langs->trans("Default").''; - } - print "
\n"; + if ($conf->global->FACTURE_ADDON_PDF != "$name") + { + print ''; + print img_tick($langs->trans("Disable")); + print ''; + } + else + { + print img_tick($langs->trans("Enabled")); + } + print "\n"; + print ''.$langs->trans("Activate").''; + print ""; + if ($conf->global->FACTURE_ADDON_PDF == "$name") + { + print img_tick($langs->trans("Default")); + } + else + { + print ''.$langs->trans("Default").''; + } + print 'tooltip_properties($htmltooltip).'>'.img_help(0).'
'; print ''; print ''; print ''; -print ''; -print ''; +print '\n"; +print '\n"; +print ''; print "\n"; clearstatcache(); @@ -93,26 +157,56 @@ while (($file = readdir($handle))!==false) echo "$name"; print "'; - print '"; + } + else + { + print ""; + } - if ($ficheinter_addon_var_pdf == "$name") - { - print img_tick(); - } - else - { - print " "; - } + // Defaut + print "'; + + // Info + $htmltooltip = ''.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); + $htmltooltip.='
'.$langs->trans("Width").': '.$module->page_largeur; + $htmltooltip.='
'.$langs->trans("Height").': '.$module->page_hauteur; + $htmltooltip.='
'.$langs->trans("FeaturesSupported").':'; + $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo); + $htmltooltip.='
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg); + $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg); + print ''; - 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 '\n"; print '\n"; print '\n"; print ''; +print ''; 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 "\n "; - print "\n \n"; - print "\n \n"; + print "\n \n"; + + // Examples + print '\n"; print ''; + // Info + $htmltooltip=''; + $nextval=$module->getNextValue(); + if ($nextval != $langs->trans("NotAvailable")) + { + $htmltooltip=''.$langs->trans("NextValue").': '.$nextval; + } + print ''; print "\n"; } @@ -178,29 +193,31 @@ print "
'.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Activated").' '.$langs->trans("Activated")."'.$langs->trans("Default")."'.$langs->trans("Info").'
\n"; require_once($dir.$file); - $obj = new $classname(); - - print $obj->description; + $module = new $classname(); + print $module->description; + print ''; + // Activé + if (in_array($name, $def)) + { + print "\n"; + if ($conf->global->FICHEINTER_ADDON_PDF != "$name") + { + print ''; + print img_tick($langs->trans("Disable")); + print ''; + } + else + { + print img_tick($langs->trans("Enabled")); + } + print "\n"; + print ''.$langs->trans("Activate").''; + print ""; + if ($conf->global->FICHEINTER_ADDON_PDF == "$name") + { + print img_tick($langs->trans("Default")); + } + else + { + print ''.$langs->trans("Default").''; + } + print 'tooltip_properties($htmltooltip).'>'.img_help(0).'\n"; - - print ''.$langs->trans("Activate").''; - - print '
'.$langs->trans("Name")."'.$langs->trans("Description")."'.$langs->trans("Example")."'.$langs->trans("Activated").''.$langs->trans("Info").'
".$file."".$modPropale->info()."".$modPropale->getExample()."".$module->info()."'.$module->getExample()."'; - if ($propale_addon_var == "$file") + if ($conf->global->PROPALE_ADDON == "$file") { - $title=''; - if ($modPropale->getNextValue() != $langs->trans("NotAvailable")) - { - $title=$langs->trans("NextValue").': '.$modPropale->getNextValue(); - } - print img_tick($title); + print img_tick($langs->trans("Activated")); } else { - print "".$langs->trans("Activate").""; + print ''.$langs->trans("Activate").''; } print 'tooltip_properties($htmltooltip).'>'; + print ($htmltooltip?img_help(0):''); + print '

\n"; /* - * PDF + * Modeles de documents */ print_titre($langs->trans("ProposalsPDFModules")); +// Defini tableau def de modele propal $def = array(); - -$sql = "SELECT nom FROM ".MAIN_DB_PREFIX."propal_model_pdf"; +$sql = "SELECT nom"; +$sql.= " FROM ".MAIN_DB_PREFIX."document_model"; +$sql.= " WHERE type = 'propal'"; $resql=$db->query($sql); if ($resql) { - $i = 0; - $num_rows=$db->num_rows($resql); - while ($i < $num_rows) - { - $array = $db->fetch_array($resql); - array_push($def, $array[0]); - $i++; - } + $i = 0; + $num_rows=$db->num_rows($resql); + while ($i < $num_rows) + { + $array = $db->fetch_array($resql); + array_push($def, $array[0]); + $i++; + } } else { - dolibarr_print_error($db); + dolibarr_print_error($db); } $dir = "../includes/modules/propale/"; @@ -209,8 +226,9 @@ print "\n"; print "\n"; print " \n"; print " \n"; -print ' \n"; -print ' \n"; +print '\n"; +print '\n"; +print ''; print "\n"; clearstatcache(); @@ -220,47 +238,67 @@ $handle=opendir($dir); $var=true; while (($file = readdir($handle))!==false) { - if (substr($file, strlen($file) -12) == '.modules.php' && substr($file,0,12) == 'pdf_propale_') - { - $name = substr($file, 12, strlen($file) - 24); - $classname = substr($file, 0, strlen($file) -12); - - $var=!$var; - print "\n \n \n \n \n \n \n \n '; - if ($propale_addon_var_pdf == "$name") - { - print img_tick(); + // Activé + if (in_array($name, $def)) + { + print ""; + } + else + { + print ""; + } + + // Defaut + print "'; + + // Info + $htmltooltip = ''.$langs->trans("Type").': '.($obj->type?$obj->type:$langs->trans("Unknown")); + $htmltooltip.='
'.$langs->trans("Width").': '.$obj->page_largeur; + $htmltooltip.='
'.$langs->trans("Height").': '.$obj->page_hauteur; + $htmltooltip.='
'.$langs->trans("FeaturesSupported").':'; + $htmltooltip.='
'.$langs->trans("Logo").': '.yn($obj->option_logo); + $htmltooltip.='
'.$langs->trans("PaymentMode").': '.yn($obj->option_modereg); + $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($obj->option_condreg); + print ''; + + print "\n"; } - else - { - print ''.$langs->trans("Activate").''; - } - print ''; - } } closedir($handle); @@ -303,7 +341,9 @@ print ''; print '
".$langs->trans("Name")."".$langs->trans("Description")."'.$langs->trans("Activated")."'.$langs->trans("Default")."'.$langs->trans("Activated")."'.$langs->trans("Default")."'.$langs->trans("Info").'
"; - print "$name"; - print "\n"; - require_once($dir.$file); - $obj = new $classname($db); - - print $obj->description; - - print "\n"; - - if (in_array($name, $def)) + if (substr($file, strlen($file) -12) == '.modules.php' && substr($file,0,12) == 'pdf_propale_') { - print img_tick(); - print ""; - print ''.$langs->trans("Disable").''; - } - else - { - print " "; - print ""; - print ''.$langs->trans("Activate").''; - } + $name = substr($file, 12, strlen($file) - 24); + $classname = substr($file, 0, strlen($file) -12); - print ""; + $var=!$var; + print "
"; + print "$name"; + print "\n"; + require_once($dir.$file); + $obj = new $classname($db); + print $obj->description; + print '\n"; + if ($conf->global->PROPALE_ADDON_PDF != "$name") + { + print ''; + print img_tick($langs->trans("Disable")); + print ''; + } + else + { + print img_tick($langs->trans("Enabled")); + } + print "\n"; + print ''.$langs->trans("Activate").''; + print ""; + if ($conf->global->PROPALE_ADDON_PDF == "$name") + { + print img_tick($langs->trans("Default")); + } + else + { + print ''.$langs->trans("Default").''; + } + print 'tooltip_properties($htmltooltip).'>'.img_help(0).'
'; 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;