Uniformisation du code: Tous les modules de gnration de document PDF s'active dans la table llx_document_model plutot que les n tables llx_xxxx_model_pdf.
Cela rduit le nombres de tables et permet plus de mutualisation du code. Ainsi, tous les modules peuvent avoir maintenant plusieurs modle actifs, et 1 modle dfaut.
This commit is contained in:
parent
1222d9a1d9
commit
ad4c4e7acd
@ -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 '<td>'.$langs->trans("Name")."</td>\n";
|
||||
print '<td>'.$langs->trans("Description")."</td>\n";
|
||||
print '<td nowrap>'.$langs->trans("Example")."</td>\n";
|
||||
print '<td align="center" width="60">'.$langs->trans("Activated").'</td>';
|
||||
print '<td align="center" width="16">'.$langs->trans("Info").'</td>';
|
||||
print '</tr>'."\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 "<tr ".$bc[$var].">\n <td width=\"140\">".$file."</td>";
|
||||
print "\n <td>".$modAvoir->info()."</td>\n";
|
||||
print "\n <td nowrap>".$modAvoir->getExample()."</td>\n";
|
||||
|
||||
print '<td align="center">';
|
||||
if ($avoir_addon_var == "$file")
|
||||
{
|
||||
$title='';
|
||||
if ($modAvoir->getNextValue() != $langs->trans("NotAvailable"))
|
||||
{
|
||||
$title=$langs->trans("NextValue").': '.$modAvoir->getNextValue();
|
||||
}
|
||||
print img_tick($title);
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<a href=\"avoir.php?action=setmod&value=".$file."\">".$langs->trans("Activate")."</a>";
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
print "\n <td>".$module->info()."</td>\n";
|
||||
|
||||
// Affiche example
|
||||
print '<td nowrap="nowrap">'.$module->getExample().'</td>';
|
||||
|
||||
print '<td align="center">';
|
||||
if ($conf->global->FACTURE_ADDON == "$file")
|
||||
{
|
||||
print img_tick($langs->trans("Activated"));
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&value='.$file.'" alt="'.$langs->trans("Default").'">'.$langs->trans("Default").'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Info
|
||||
$htmltooltip='';
|
||||
$nextval=$module->getNextValue();
|
||||
if ($nextval != $langs->trans("NotAvailable"))
|
||||
{
|
||||
$htmltooltip='<b>'.$langs->trans("NextValue").'</b>: '.$nextval;
|
||||
}
|
||||
print '<td align="center" '.$html->tooltip_properties($htmltooltip).'>';
|
||||
print ($htmltooltip?img_help(0):'');
|
||||
print '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
}
|
||||
}
|
||||
@ -183,29 +197,31 @@ print "</table><br>\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 "<table class=\"noborder\" width=\"100%\">\n";
|
||||
print "<tr class=\"liste_titre\">\n";
|
||||
print " <td width=\"140\">".$langs->trans("Name")."</td>\n";
|
||||
print " <td>".$langs->trans("Description")."</td>\n";
|
||||
print ' <td align="center" colspan="2">'.$langs->trans("Activated")."</td>\n";
|
||||
print ' <td align="center">'.$langs->trans("Default")."</td>\n";
|
||||
print '<td align="center" width="60">'.$langs->trans("Activated")."</td>\n";
|
||||
print '<td align="center" width="60">'.$langs->trans("Default")."</td>\n";
|
||||
print '<td align="center" width="16">'.$langs->trans("Info").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
clearstatcache();
|
||||
@ -236,35 +253,53 @@ while (($file = readdir($handle))!==false)
|
||||
print "</td>\n <td>\n";
|
||||
require_once($dir.$file);
|
||||
$obj = new $classname($db);
|
||||
|
||||
print $obj->description;
|
||||
print '</td>';
|
||||
|
||||
print "</td>\n <td align=\"center\">\n";
|
||||
// Activé
|
||||
if (in_array($name, $def))
|
||||
{
|
||||
print "<td align=\"center\">\n";
|
||||
if ($conf->global->FACTURE_AVOIR_ADDON_PDF != "$name")
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'">';
|
||||
print img_tick($langs->trans("Disable"));
|
||||
print '</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print img_tick($langs->trans("Enabled"));
|
||||
}
|
||||
print "</td>";
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<td align=\"center\">\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'">'.$langs->trans("Activate").'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
if (in_array($name, $def))
|
||||
{
|
||||
print img_tick();
|
||||
print "</td>\n <td>";
|
||||
print '<a href="avoir.php?action=del&value='.$name.'">'.$langs->trans("Disable").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print " ";
|
||||
print "</td>\n <td>";
|
||||
print '<a href="avoir.php?action=set&value='.$name.'">'.$langs->trans("Activate").'</a>';
|
||||
}
|
||||
// Defaut
|
||||
print "<td align=\"center\">";
|
||||
if ($conf->global->FACTURE_AVOIR_ADDON_PDF == "$name")
|
||||
{
|
||||
print img_tick($langs->trans("Default"));
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="propale.php?action=setdoc&value='.$name.'" alt="'.$langs->trans("Default").'">'.$langs->trans("Default").'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Info
|
||||
$htmltooltip = '<b>'.$langs->trans("Type").'</b>: '.($obj->type?$obj->type:$langs->trans("Unknown"));
|
||||
$htmltooltip.='<br><b>'.$langs->trans("Width").'</b>: '.$obj->page_largeur;
|
||||
$htmltooltip.='<br><b>'.$langs->trans("Height").'</b>: '.$obj->page_hauteur;
|
||||
$htmltooltip.='<br>'.$langs->trans("FeaturesSupported").':';
|
||||
$htmltooltip.='<br><b>'.$langs->trans("Logo").'</b>: '.yn($obj->option_logo);
|
||||
print '<td align="center" '.$html->tooltip_properties($htmltooltip).'>'.img_help(0).'</td>';
|
||||
|
||||
print "</td>\n <td align=\"center\">";
|
||||
|
||||
if ($avoir_addon_var_pdf == "$name")
|
||||
{
|
||||
print img_tick();
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="avoir.php?action=setpdf&value='.$name.'">'.$langs->trans("Activate").'</a>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
|
||||
@ -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 '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td width="100">'.$langs->trans("Name").'</td><td>'.$langs->trans("Description").'</td>';
|
||||
print '<td width="100">'.$langs->trans("Name").'</td>';
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
print '<td>'.$langs->trans("Example").'</td>';
|
||||
print '<td align="center" width="60">'.$langs->trans("Activated").'</td>';
|
||||
print '<td align="center" width="16">'.$langs->trans("Info").'</td>';
|
||||
print "</tr>\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 '<tr '.$bc[$var].'><td>'.$modCommande->nom."</td><td>\n";
|
||||
print $modCommande->info();
|
||||
print '<tr '.$bc[$var].'><td>'.$module->nom."</td><td>\n";
|
||||
print $module->info();
|
||||
print '</td>';
|
||||
|
||||
print '<td align="center" nowrap>';
|
||||
print $modCommande->getExample();
|
||||
print '</td>';
|
||||
// Examples
|
||||
print '<td nowrap="nowrap">'.$module->getExample()."</td>\n";
|
||||
|
||||
print '<td align="center">';
|
||||
if ($conf->global->COMMANDE_ADDON == "$file")
|
||||
{
|
||||
print '<td align="center">';
|
||||
print img_tick();
|
||||
print '</td>';
|
||||
print img_tick($langs->trans("Activated"));
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td align="center"><a href="commande.php?action=setmod&value='.$file.'">'.$langs->trans("Activate").'</a></td>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&value='.$file.'" alt="'.$langs->trans("Default").'">'.$langs->trans("Activate").'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Info
|
||||
$htmltooltip='';
|
||||
$nextval=$module->getNextValue();
|
||||
if ($nextval != $langs->trans("NotAvailable"))
|
||||
{
|
||||
$htmltooltip='<b>'.$langs->trans("NextValue").'</b>: '.$nextval;
|
||||
}
|
||||
print '<td align="center" '.$html->tooltip_properties($htmltooltip).'>';
|
||||
print ($htmltooltip?img_help(0):'');
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
}
|
||||
@ -147,26 +186,19 @@ if ($handle)
|
||||
closedir($handle);
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</table><br>';
|
||||
|
||||
/*
|
||||
* PDF
|
||||
* Modeles de documents
|
||||
*/
|
||||
print '<br>';
|
||||
print_titre($langs->trans("OrdersModelModule"));
|
||||
|
||||
print "<table class=\"noborder\" width=\"100%\">\n";
|
||||
print "<tr class=\"liste_titre\">\n";
|
||||
print ' <td width="100">'.$langs->trans("Name")."</td>\n";
|
||||
print " <td>".$langs->trans("Description")."</td>\n";
|
||||
print ' <td align="center" width="100">'.$langs->trans("Activated")."</td>\n";
|
||||
print ' <td align="center" width="60">'.$langs->trans("Default")."</td>\n";
|
||||
print "</tr>\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 "<table class=\"noborder\" width=\"100%\">\n";
|
||||
print "<tr class=\"liste_titre\">\n";
|
||||
print ' <td width="100">'.$langs->trans("Name")."</td>\n";
|
||||
print " <td>".$langs->trans("Description")."</td>\n";
|
||||
print '<td align="center" width="60">'.$langs->trans("Activated")."</td>\n";
|
||||
print '<td align="center" width="60">'.$langs->trans("Default")."</td>\n";
|
||||
print '<td align="center" width="16">'.$langs->trans("Info").'</td>';
|
||||
print "</tr>\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 "</td>\n <td>\n";
|
||||
require_once($dir.$file);
|
||||
$obj = new $classname($db);
|
||||
|
||||
print $obj->description;
|
||||
|
||||
$module = new $classname($db);
|
||||
print $module->description;
|
||||
print "</td>\n";
|
||||
|
||||
// Activé
|
||||
print "<td align=\"center\">\n";
|
||||
if (in_array($name, $def))
|
||||
{
|
||||
print img_tick().' ';
|
||||
if ($conf->global->COMMANDE_ADDON_PDF != "$name")
|
||||
print "<td align=\"center\">\n";
|
||||
if ($conf->global->COMMANDE_ADDON_PDF != "$name")
|
||||
{
|
||||
print '<a href="commande.php?action=del&value='.$name.'">'.$langs->trans("Disable").'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'">';
|
||||
print img_tick($langs->trans("Disable"));
|
||||
print '</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print img_tick($langs->trans("Enabled"));
|
||||
}
|
||||
print "</td>";
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="commande.php?action=set&value='.$name.'">'.$langs->trans("Activate").'</a>';
|
||||
print "<td align=\"center\">\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'">'.$langs->trans("Activate").'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
print "</td>\n";
|
||||
|
||||
// Defaut
|
||||
print "<td align=\"center\">";
|
||||
if ($conf->global->COMMANDE_ADDON_PDF == "$name")
|
||||
{
|
||||
print img_tick();
|
||||
print img_tick($langs->trans("Default"));
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="commande.php?action=setpdf&value='.$name.'">'.$langs->trans("Default").'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'" alt="'.$langs->trans("Default").'">'.$langs->trans("Default").'</a>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
print '</td>';
|
||||
|
||||
// Info
|
||||
$htmltooltip = '<b>'.$langs->trans("Type").'</b>: '.($module->type?$module->type:$langs->trans("Unknown"));
|
||||
$htmltooltip.='<br><b>'.$langs->trans("Width").'</b>: '.$module->page_largeur;
|
||||
$htmltooltip.='<br><b>'.$langs->trans("Height").'</b>: '.$module->page_hauteur;
|
||||
$htmltooltip.='<br>'.$langs->trans("FeaturesSupported").':';
|
||||
$htmltooltip.='<br><b>'.$langs->trans("Logo").'</b>: '.yn($module->option_logo);
|
||||
$htmltooltip.='<br><b>'.$langs->trans("PaymentMode").'</b>: '.yn($module->option_modereg);
|
||||
$htmltooltip.='<br><b>'.$langs->trans("PaymentConditions").'</b>: '.yn($module->option_condreg);
|
||||
print '<td align="center" '.$html->tooltip_properties($htmltooltip).'>'.img_help(0).'</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
@ -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 '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td width="140">'.$langs->trans("Name").'</td><td>'.$langs->trans("Description").'</td>';
|
||||
print '<td align="center"> </td>';
|
||||
print '<td align="center">'.$langs->trans("Active").'</td>';
|
||||
print '<td align="center">'.$langs->trans("Default").'</td>';
|
||||
print '<td align="center" width="60">'.$langs->trans("Active").'</td>';
|
||||
print '<td align="center" width="60">'.$langs->trans("Default").'</td>';
|
||||
print '<td align="center" width="16">'.$langs->trans("Info").'</td>';
|
||||
print "</tr>\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 "<tr $bc[$var]><td>";
|
||||
echo $obj->name;
|
||||
print "</td><td>\n";
|
||||
|
||||
print $obj->description;
|
||||
|
||||
print '</td><td align="center">';
|
||||
if(is_dir($dir))
|
||||
{
|
||||
$handle=opendir($dir);
|
||||
$var=true;
|
||||
|
||||
if (in_array($obj->id, $mods))
|
||||
{
|
||||
print img_tick();
|
||||
print '</td><td align="center">';
|
||||
print '<a href="expedition.php?action=set&statut=0&value='.$name.'">'.$langs->trans("Disable").'</a>';
|
||||
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 ' </td><td align="center">';
|
||||
print '<a href="expedition.php?action=set&statut=1&value='.$name.'">'.$langs->trans("Activate").'</a>';
|
||||
}
|
||||
|
||||
print '</td>';
|
||||
|
||||
// Default
|
||||
print '<td align="center">';
|
||||
if ($expedition_default == "$name")
|
||||
{
|
||||
print img_tick();
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="expedition.php?action=setdef&value='.$name.'">'.$langs->trans("Default").'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
require_once($dir.$file);
|
||||
|
||||
$obj = new $classname();
|
||||
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]><td>";
|
||||
echo $obj->name;
|
||||
print "</td><td>\n";
|
||||
|
||||
print $obj->description;
|
||||
|
||||
print '</td><td align="center">';
|
||||
|
||||
if (in_array($obj->id, $mods))
|
||||
{
|
||||
print img_tick();
|
||||
print '</td><td align="center">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&statut=0&value='.$name.'">'.$langs->trans("Disable").'</a>';
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
print ' </td><td align="center">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&statut=1&value='.$name.'">'.$langs->trans("Activate").'</a>';
|
||||
}
|
||||
|
||||
print '</td>';
|
||||
|
||||
// Default
|
||||
print '<td align="center">';
|
||||
if ($conf->global->EXPEDITION_ADDON == "$name")
|
||||
{
|
||||
print img_tick();
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&value='.$name.'">'.$langs->trans("Default").'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Info
|
||||
print '<td> </td>';
|
||||
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<tr><td><b>ERROR</b>: $dir is not a directory !</td></tr>\n";
|
||||
print "<tr><td><b>ERROR</b>: $dir is not a directory !</td></tr>\n";
|
||||
}
|
||||
print '</table>';
|
||||
|
||||
|
||||
/*
|
||||
* Modeles de documents
|
||||
*/
|
||||
print '<br>';
|
||||
|
||||
// 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 '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td width="140">'.$langs->trans("Name").'</td><td>'.$langs->trans("Description").'</td>';
|
||||
print '<td align="center" colspan="2">'.$langs->trans("Active").'</td>';
|
||||
print '<td width="140">'.$langs->trans("Name").'</td>';
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
print '<td align="center" width="60">'.$langs->trans("Activated").'</td>';
|
||||
print '<td align="center" width="60">'.$langs->trans("Default").'</td>';
|
||||
print '<td align="center" width="16">'.$langs->trans("Info").'</td>';
|
||||
print "</tr>\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 "<tr $bc[$var]><td>";
|
||||
print $name;
|
||||
print "</td><td>\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 "<tr $bc[$var]><td>";
|
||||
print $name;
|
||||
print "</td><td>\n";
|
||||
require_once($dir.$file);
|
||||
$obj = new $classname();
|
||||
|
||||
print '</td><td align="center">';
|
||||
print $obj->description;
|
||||
print '</td>';
|
||||
|
||||
if ($expedition_addon_var_pdf == "$name")
|
||||
{
|
||||
print img_tick();
|
||||
}
|
||||
else
|
||||
{
|
||||
print " ";
|
||||
}
|
||||
// Activ
|
||||
if (in_array($name, $def))
|
||||
{
|
||||
print "<td align=\"center\">\n";
|
||||
if ($conf->global->EXPEDITION_ADDON_PDF != "$name")
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'">';
|
||||
print img_tick($langs->trans("Disable"));
|
||||
print '</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print img_tick($langs->trans("Enabled"));
|
||||
}
|
||||
print "</td>";
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<td align=\"center\">\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'">'.$langs->trans("Activate").'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
print "</td><td>\n";
|
||||
// Defaut
|
||||
print "<td align=\"center\">";
|
||||
if ($conf->global->EXPEDITION_ADDON_PDF == "$name")
|
||||
{
|
||||
print img_tick($langs->trans("Default"));
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'" alt="'.$langs->trans("Default").'">'.$langs->trans("Default").'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
print '<a href="expedition.php?action=setpdf&value='.$name.'">'.$langs->trans("Activate").'</a>';
|
||||
// Info
|
||||
$htmltooltip = '<b>'.$langs->trans("Type").'</b>: '.($module->type?$module->type:$langs->trans("Unknown"));
|
||||
$htmltooltip.='<br><b>'.$langs->trans("Width").'</b>: '.$module->page_largeur;
|
||||
$htmltooltip.='<br><b>'.$langs->trans("Height").'</b>: '.$module->page_hauteur;
|
||||
$htmltooltip.='<br>'.$langs->trans("FeaturesSupported").':';
|
||||
$htmltooltip.='<br><b>'.$langs->trans("Logo").'</b>: '.yn($module->option_logo);
|
||||
$htmltooltip.='<br><b>'.$langs->trans("PaymentMode").'</b>: '.yn($module->option_modereg);
|
||||
$htmltooltip.='<br><b>'.$langs->trans("PaymentConditions").'</b>: '.yn($module->option_condreg);
|
||||
print '<td align="center" '.$html->tooltip_properties($htmltooltip).'>'.img_help(0).'</td>';
|
||||
|
||||
print '</td></tr>';
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
print '</td></tr>';
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<tr><td><b>ERROR</b>: $dir is not a directory !</td></tr>\n";
|
||||
print "<tr><td><b>ERROR</b>: $dir is not a directory !</td></tr>\n";
|
||||
}
|
||||
print '</table>';
|
||||
|
||||
|
||||
@ -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 '<td>'.$langs->trans("Name").'</td>';
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
print '<td nowrap>'.$langs->trans("Example").'</td>';
|
||||
print '<td align="center" width="60">'.$langs->trans("Default").'</td>';
|
||||
print '<td align="center" width="16">'.$langs->trans("Info").'</td>';
|
||||
print '</tr>'."\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 '</td>';
|
||||
|
||||
// Affiche example
|
||||
print '<td>'.$obj->getExample().'</td>';
|
||||
print '<td nowrap="nowrap">'.$module->getExample().'</td>';
|
||||
|
||||
print '<td align="center">';
|
||||
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 '<a href="facture.php?action=set&value='.$file.'">'.$langs->trans("Default").'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&value='.$file.'" alt="'.$langs->trans("Default").'">'.$langs->trans("Default").'</a>';
|
||||
}
|
||||
print "</td></tr>\n";
|
||||
print '</td>';
|
||||
|
||||
// Info
|
||||
$htmltooltip='';
|
||||
$nextval=$module->getNextValue();
|
||||
if ($nextval != $langs->trans("NotAvailable"))
|
||||
{
|
||||
$htmltooltip='<b>'.$langs->trans("NextValue").'</b>: '.$nextval;
|
||||
}
|
||||
print '<td align="center" '.$html->tooltip_properties($htmltooltip).'>';
|
||||
print ($htmltooltip?img_help(0):'');
|
||||
print '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
@ -176,10 +231,32 @@ print '</table>';
|
||||
|
||||
|
||||
/*
|
||||
* PDF
|
||||
* Modeles de documents
|
||||
*/
|
||||
print '<br>';
|
||||
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 '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
@ -187,6 +264,7 @@ print '<td>'.$langs->trans("Name").'</td>';
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
print '<td align="center" width="60">'.$langs->trans("Activated").'</td>';
|
||||
print '<td align="center" width="60">'.$langs->trans("Default").'</td>';
|
||||
print '<td align="center" width="16">'.$langs->trans("Info").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
clearstatcache();
|
||||
@ -206,26 +284,56 @@ while (($file = readdir($handle))!==false)
|
||||
echo "$name";
|
||||
print "</td><td>\n";
|
||||
require_once($dir.$file);
|
||||
$obj = new $classname($db);
|
||||
|
||||
print $obj->description;
|
||||
|
||||
print '</td><td align="center">';
|
||||
|
||||
if ($facture_addon_var_pdf == "$name")
|
||||
{
|
||||
print ' ';
|
||||
print '</td><td align="center">';
|
||||
print img_tick();
|
||||
}
|
||||
else
|
||||
{
|
||||
print ' ';
|
||||
print '</td><td align="center">';
|
||||
print '<a href="facture.php?action=setpdf&value='.$name.'">'.$langs->trans("Default").'</a>';
|
||||
}
|
||||
print "</td></tr>\n";
|
||||
$module = new $classname($db);
|
||||
print $module->description;
|
||||
print '</td>';
|
||||
|
||||
// Activé
|
||||
if (in_array($name, $def))
|
||||
{
|
||||
print "<td align=\"center\">\n";
|
||||
if ($conf->global->FACTURE_ADDON_PDF != "$name")
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'">';
|
||||
print img_tick($langs->trans("Disable"));
|
||||
print '</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print img_tick($langs->trans("Enabled"));
|
||||
}
|
||||
print "</td>";
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<td align=\"center\">\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'">'.$langs->trans("Activate").'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
// Defaut
|
||||
print "<td align=\"center\">";
|
||||
if ($conf->global->FACTURE_ADDON_PDF == "$name")
|
||||
{
|
||||
print img_tick($langs->trans("Default"));
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'" alt="'.$langs->trans("Default").'">'.$langs->trans("Default").'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Info
|
||||
$htmltooltip = '<b>'.$langs->trans("Type").'</b>: '.($module->type?$module->type:$langs->trans("Unknown"));
|
||||
$htmltooltip.='<br><b>'.$langs->trans("Width").'</b>: '.$module->page_largeur;
|
||||
$htmltooltip.='<br><b>'.$langs->trans("Height").'</b>: '.$module->page_hauteur;
|
||||
$htmltooltip.='<br>'.$langs->trans("FeaturesSupported").':';
|
||||
$htmltooltip.='<br><b>'.$langs->trans("Logo").'</b>: '.yn($module->option_logo);
|
||||
$htmltooltip.='<br><b>'.$langs->trans("PaymentMode").'</b>: '.yn($module->option_modereg);
|
||||
$htmltooltip.='<br><b>'.$langs->trans("PaymentConditions").'</b>: '.yn($module->option_condreg);
|
||||
print '<td align="center" '.$html->tooltip_properties($htmltooltip).'>'.img_help(0).'</td>';
|
||||
|
||||
print "</tr>\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 '<option value="'.$row[0].'" selected="true">'.$row[1].'</option>';
|
||||
}
|
||||
@ -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 '<option value="'.$row[0].'" selected="true">'.$row[1].'</option>';
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
*
|
||||
@ -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 "<br>";
|
||||
|
||||
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 '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Name").'</td>';
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
print '<td align="center">'.$langs->trans("Activated").'</td>';
|
||||
print '<td> </td>';
|
||||
print '<td align="center" width="60">'.$langs->trans("Activated")."</td>\n";
|
||||
print '<td align="center" width="60">'.$langs->trans("Default")."</td>\n";
|
||||
print '<td align="center" width="16">'.$langs->trans("Info").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
clearstatcache();
|
||||
@ -93,26 +157,56 @@ while (($file = readdir($handle))!==false)
|
||||
echo "$name";
|
||||
print "</td><td>\n";
|
||||
require_once($dir.$file);
|
||||
$obj = new $classname();
|
||||
|
||||
print $obj->description;
|
||||
$module = new $classname();
|
||||
print $module->description;
|
||||
print '</td>';
|
||||
|
||||
print '</td><td align="center">';
|
||||
// Activé
|
||||
if (in_array($name, $def))
|
||||
{
|
||||
print "<td align=\"center\">\n";
|
||||
if ($conf->global->FICHEINTER_ADDON_PDF != "$name")
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'">';
|
||||
print img_tick($langs->trans("Disable"));
|
||||
print '</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print img_tick($langs->trans("Enabled"));
|
||||
}
|
||||
print "</td>";
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<td align=\"center\">\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'">'.$langs->trans("Activate").'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
if ($ficheinter_addon_var_pdf == "$name")
|
||||
{
|
||||
print img_tick();
|
||||
}
|
||||
else
|
||||
{
|
||||
print " ";
|
||||
}
|
||||
// Defaut
|
||||
print "<td align=\"center\">";
|
||||
if ($conf->global->FICHEINTER_ADDON_PDF == "$name")
|
||||
{
|
||||
print img_tick($langs->trans("Default"));
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'" alt="'.$langs->trans("Default").'">'.$langs->trans("Default").'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Info
|
||||
$htmltooltip = '<b>'.$langs->trans("Type").'</b>: '.($module->type?$module->type:$langs->trans("Unknown"));
|
||||
$htmltooltip.='<br><b>'.$langs->trans("Width").'</b>: '.$module->page_largeur;
|
||||
$htmltooltip.='<br><b>'.$langs->trans("Height").'</b>: '.$module->page_hauteur;
|
||||
$htmltooltip.='<br>'.$langs->trans("FeaturesSupported").':';
|
||||
$htmltooltip.='<br><b>'.$langs->trans("Logo").'</b>: '.yn($module->option_logo);
|
||||
$htmltooltip.='<br><b>'.$langs->trans("PaymentMode").'</b>: '.yn($module->option_modereg);
|
||||
$htmltooltip.='<br><b>'.$langs->trans("PaymentConditions").'</b>: '.yn($module->option_condreg);
|
||||
print '<td align="center" '.$html->tooltip_properties($htmltooltip).'>'.img_help(0).'</td>';
|
||||
|
||||
print "</td><td>\n";
|
||||
|
||||
print '<a href="fichinter.php?action=setpdf&value='.$name.'">'.$langs->trans("Activate").'</a>';
|
||||
|
||||
print '</td></tr>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
|
||||
@ -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 '<td>'.$langs->trans("Name")."</td>\n";
|
||||
print '<td>'.$langs->trans("Description")."</td>\n";
|
||||
print '<td nowrap>'.$langs->trans("Example")."</td>\n";
|
||||
print '<td align="center" width="60">'.$langs->trans("Activated").'</td>';
|
||||
print '<td align="center" width="16">'.$langs->trans("Info").'</td>';
|
||||
print '</tr>'."\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 "<tr ".$bc[$var].">\n <td width=\"140\">".$file."</td>";
|
||||
print "\n <td>".$modPropale->info()."</td>\n";
|
||||
print "\n <td nowrap>".$modPropale->getExample()."</td>\n";
|
||||
print "\n <td>".$module->info()."</td>\n";
|
||||
|
||||
// Examples
|
||||
print '<td nowrap="nowrap">'.$module->getExample()."</td>\n";
|
||||
|
||||
print '<td align="center">';
|
||||
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 "<a href=\"propale.php?action=setmod&value=".$file."\">".$langs->trans("Activate")."</a>";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&value='.$file.'" alt="'.$langs->trans("Default").'">'.$langs->trans("Activate").'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Info
|
||||
$htmltooltip='';
|
||||
$nextval=$module->getNextValue();
|
||||
if ($nextval != $langs->trans("NotAvailable"))
|
||||
{
|
||||
$htmltooltip='<b>'.$langs->trans("NextValue").'</b>: '.$nextval;
|
||||
}
|
||||
print '<td align="center" '.$html->tooltip_properties($htmltooltip).'>';
|
||||
print ($htmltooltip?img_help(0):'');
|
||||
print '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
}
|
||||
@ -178,29 +193,31 @@ print "</table><br>\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 "<table class=\"noborder\" width=\"100%\">\n";
|
||||
print "<tr class=\"liste_titre\">\n";
|
||||
print " <td width=\"140\">".$langs->trans("Name")."</td>\n";
|
||||
print " <td>".$langs->trans("Description")."</td>\n";
|
||||
print ' <td align="center" colspan="2">'.$langs->trans("Activated")."</td>\n";
|
||||
print ' <td align="center">'.$langs->trans("Default")."</td>\n";
|
||||
print '<td align="center" width="60">'.$langs->trans("Activated")."</td>\n";
|
||||
print '<td align="center" width="60">'.$langs->trans("Default")."</td>\n";
|
||||
print '<td align="center" width="16">'.$langs->trans("Info").'</td>';
|
||||
print "</tr>\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 "<tr ".$bc[$var].">\n <td>";
|
||||
print "$name";
|
||||
print "</td>\n <td>\n";
|
||||
require_once($dir.$file);
|
||||
$obj = new $classname($db);
|
||||
|
||||
print $obj->description;
|
||||
|
||||
print "</td>\n <td align=\"center\">\n";
|
||||
|
||||
if (in_array($name, $def))
|
||||
if (substr($file, strlen($file) -12) == '.modules.php' && substr($file,0,12) == 'pdf_propale_')
|
||||
{
|
||||
print img_tick();
|
||||
print "</td>\n <td>";
|
||||
print '<a href="propale.php?action=del&value='.$name.'">'.$langs->trans("Disable").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print " ";
|
||||
print "</td>\n <td>";
|
||||
print '<a href="propale.php?action=set&value='.$name.'">'.$langs->trans("Activate").'</a>';
|
||||
}
|
||||
$name = substr($file, 12, strlen($file) - 24);
|
||||
$classname = substr($file, 0, strlen($file) -12);
|
||||
|
||||
print "</td>\n <td align=\"center\">";
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var].">\n <td>";
|
||||
print "$name";
|
||||
print "</td>\n <td>\n";
|
||||
require_once($dir.$file);
|
||||
$obj = new $classname($db);
|
||||
print $obj->description;
|
||||
print '</td>';
|
||||
|
||||
if ($propale_addon_var_pdf == "$name")
|
||||
{
|
||||
print img_tick();
|
||||
// Activé
|
||||
if (in_array($name, $def))
|
||||
{
|
||||
print "<td align=\"center\">\n";
|
||||
if ($conf->global->PROPALE_ADDON_PDF != "$name")
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'">';
|
||||
print img_tick($langs->trans("Disable"));
|
||||
print '</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print img_tick($langs->trans("Enabled"));
|
||||
}
|
||||
print "</td>";
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<td align=\"center\">\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'">'.$langs->trans("Activate").'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
// Defaut
|
||||
print "<td align=\"center\">";
|
||||
if ($conf->global->PROPALE_ADDON_PDF == "$name")
|
||||
{
|
||||
print img_tick($langs->trans("Default"));
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'" alt="'.$langs->trans("Default").'">'.$langs->trans("Default").'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Info
|
||||
$htmltooltip = '<b>'.$langs->trans("Type").'</b>: '.($obj->type?$obj->type:$langs->trans("Unknown"));
|
||||
$htmltooltip.='<br><b>'.$langs->trans("Width").'</b>: '.$obj->page_largeur;
|
||||
$htmltooltip.='<br><b>'.$langs->trans("Height").'</b>: '.$obj->page_hauteur;
|
||||
$htmltooltip.='<br>'.$langs->trans("FeaturesSupported").':';
|
||||
$htmltooltip.='<br><b>'.$langs->trans("Logo").'</b>: '.yn($obj->option_logo);
|
||||
$htmltooltip.='<br><b>'.$langs->trans("PaymentMode").'</b>: '.yn($obj->option_modereg);
|
||||
$htmltooltip.='<br><b>'.$langs->trans("PaymentConditions").'</b>: '.yn($obj->option_condreg);
|
||||
print '<td align="center" '.$html->tooltip_properties($htmltooltip).'>'.img_help(0).'</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="propale.php?action=setpdf&value='.$name.'">'.$langs->trans("Activate").'</a>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
|
||||
@ -303,7 +341,9 @@ print '</tr>';
|
||||
print '</table>';
|
||||
print '</form>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
llxFooter('$Date$ - $Revision$');
|
||||
?>
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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()"';
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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);
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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;
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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;
|
||||
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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
|
||||
@ -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
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
|
||||
@ -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
|
||||
@ -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
|
||||
|
||||
@ -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 '<img style="cursor: help;" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/help.png" border="0" alt="" title="">';
|
||||
return '<img '.($usehelpcursor?'style="cursor: help;" ':'').' src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/help.png" border="0" alt="" title="">';
|
||||
}
|
||||
|
||||
/**
|
||||
\brief Affiche picto calendrier "?"
|
||||
\return string Retourne tag img
|
||||
|
||||
@ -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
|
||||
|
||||
@ -1,30 +0,0 @@
|
||||
-- ===================================================================
|
||||
-- Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
--
|
||||
-- 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;
|
||||
@ -1,30 +0,0 @@
|
||||
-- ===================================================================
|
||||
-- Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
--
|
||||
-- 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;
|
||||
@ -1,30 +0,0 @@
|
||||
-- ===================================================================
|
||||
-- Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
--
|
||||
-- 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;
|
||||
@ -1,30 +0,0 @@
|
||||
-- ===================================================================
|
||||
-- Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
--
|
||||
-- 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;
|
||||
Loading…
Reference in New Issue
Block a user