2
0
forked from Wavyzz/dolibarr

New: Add ability for numbering module to not be shown if a condition is not true.

This commit is contained in:
Laurent Destailleur
2008-09-04 23:44:36 +00:00
parent e8c08414d6
commit 1772463414
18 changed files with 516 additions and 407 deletions

View File

@@ -101,8 +101,11 @@ while (($file = readdir($handle))!==false)
// Show modules according to features level // Show modules according to features level
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
$barcodelist[$filebis]=$module->info(); if ($module->isEnabled())
{
$barcodelist[$filebis]=$module->info();
}
} }
} }
} }

View File

@@ -205,51 +205,54 @@ if ($handle)
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
$var=!$var; if ($module->isEnabled())
print '<tr '.$bc[$var].'><td>'.$module->nom."</td><td>\n"; {
print $module->info(); $var=!$var;
print '</td>'; print '<tr '.$bc[$var].'><td>'.$module->nom."</td><td>\n";
print $module->info();
// Examples print '</td>';
print '<td nowrap="nowrap">'.$module->getExample()."</td>\n";
// Examples
print '<td align="center">'; print '<td nowrap="nowrap">'.$module->getExample()."</td>\n";
if ($conf->global->COMMANDE_ADDON == "$file")
{ print '<td align="center">';
print img_tick($langs->trans("Activated")); if ($conf->global->COMMANDE_ADDON == "$file")
} {
else print img_tick($langs->trans("Activated"));
{ }
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$file.'" alt="'.$langs->trans("Default").'">'.$langs->trans("Activate").'</a>'; else
} {
print '</td>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$file.'" alt="'.$langs->trans("Default").'">'.$langs->trans("Activate").'</a>';
}
$commande=new Commande($db); print '</td>';
$commande->initAsSpecimen();
$commande=new Commande($db);
// Info $commande->initAsSpecimen();
$htmltooltip='';
$htmltooltip.='<b>'.$langs->trans("Version").'</b>: '.$module->getVersion().'<br>'; // Info
$facture->type=0; $htmltooltip='';
$nextval=$module->getNextValue($mysoc,$commande); $htmltooltip.='<b>'.$langs->trans("Version").'</b>: '.$module->getVersion().'<br>';
if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval $facture->type=0;
{ $nextval=$module->getNextValue($mysoc,$commande);
$htmltooltip.='<b>'.$langs->trans("NextValue").'</b>: '; if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval
if ($nextval)
{ {
$htmltooltip.=$nextval.'<br>'; $htmltooltip.='<b>'.$langs->trans("NextValue").'</b>: ';
if ($nextval)
{
$htmltooltip.=$nextval.'<br>';
}
else
{
$htmltooltip.=$langs->trans($module->error).'<br>';
}
} }
else
{ print '<td align="center">';
$htmltooltip.=$langs->trans($module->error).'<br>'; print $html->textwithhelp('',$htmltooltip,1,0);
} print '</td>';
}
print '</tr>';
print '<td align="center">'; }
print $html->textwithhelp('',$htmltooltip,1,0);
print '</td>';
print '</tr>';
} }
} }
closedir($handle); closedir($handle);

View File

@@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2005-2006 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2005-208 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@@ -14,15 +14,13 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
*/ */
/** /**
\file htdocs/admin/dons.php \file htdocs/admin/dons.php
\ingroup dons \ingroup dons
\brief Page d'administration/configuration du module Dons \brief Page d'administration/configuration du module Dons
\version $Revision$ \version $Id$
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php");
@@ -180,64 +178,70 @@ while (($file = readdir($handle))!==false)
require_once($dir.'/'.$file); require_once($dir.'/'.$file);
$module=new $classname($db); $module=new $classname($db);
print '<tr '.$bc[$var].'><td width=\"100\">'; // Show modules according to features level
echo $module->name; if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
print '</td>'; if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
print '<td>';
print $module->description;
print '</td>';
// Activ<69> if ($module->isEnabled())
if (in_array($name, $def)) {
{ print '<tr '.$bc[$var].'><td width=\"100\">';
print "<td align=\"center\">\n"; echo $module->name;
if ($conf->global->DON_ADDON_MODEL == $name)
{
print img_tick($langs->trans("Enabled"));
}
else
{
print '&nbsp;';
print '</td><td align="center">';
print '<a href="dons.php?action=setdoc&value='.$name.'">'.$langs->trans("Activate").'</a>';
}
print '</td>'; print '</td>';
} print '<td>';
else print $module->description;
{ print '</td>';
print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'">'.$langs->trans("Activate").'</a>'; // Active
print "</td>"; if (in_array($name, $def))
} {
print "<td align=\"center\">\n";
// Defaut if ($conf->global->DON_ADDON_MODEL == $name)
print "<td align=\"center\">"; {
if ($conf->global->DON_ADDON_MODEL == "$name") print img_tick($langs->trans("Enabled"));
{ }
print img_tick($langs->trans("Default")); else
} {
else print '&nbsp;';
{ print '</td><td align="center">';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'" alt="'.$langs->trans("Default").'">'.$langs->trans("Default").'</a>'; print '<a href="dons.php?action=setdoc&value='.$name.'">'.$langs->trans("Activate").'</a>';
} }
print '</td>'; print '</td>';
}
// Info else
$htmltooltip = '<b>'.$langs->trans("Name").'</b>: '.$module->name; {
$htmltooltip.='<br><b>'.$langs->trans("Type").'</b>: '.($module->type?$module->type:$langs->trans("Unknown")); print "<td align=\"center\">\n";
$htmltooltip.='<br><b>'.$langs->trans("Height").'/'.$langs->trans("Width").'</b>: '.$module->page_hauteur.'/'.$module->page_largeur; print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'">'.$langs->trans("Activate").'</a>';
$htmltooltip.='<br><br>'.$langs->trans("FeaturesSupported").':'; print "</td>";
$htmltooltip.='<br><b>'.$langs->trans("Logo").'</b>: '.yn($module->option_logo); }
$htmltooltip.='<br><b>'.$langs->trans("MultiLanguage").'</b>: '.yn($module->option_multilang);
print '<td align="center">'; // Defaut
print $html->textwithhelp('',$htmltooltip,1,0); print "<td align=\"center\">";
print '</td>'; if ($conf->global->DON_ADDON_MODEL == "$name")
print '<td align="center">'; {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'" target="specimen">'.img_object($langs->trans("Preview"),'generic').'</a>'; print img_tick($langs->trans("Default"));
print '</td>'; }
else
print "</tr>\n"; {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'" alt="'.$langs->trans("Default").'">'.$langs->trans("Default").'</a>';
}
print '</td>';
// Info
$htmltooltip = '<b>'.$langs->trans("Name").'</b>: '.$module->name;
$htmltooltip.='<br><b>'.$langs->trans("Type").'</b>: '.($module->type?$module->type:$langs->trans("Unknown"));
$htmltooltip.='<br><b>'.$langs->trans("Height").'/'.$langs->trans("Width").'</b>: '.$module->page_hauteur.'/'.$module->page_largeur;
$htmltooltip.='<br><br>'.$langs->trans("FeaturesSupported").':';
$htmltooltip.='<br><b>'.$langs->trans("Logo").'</b>: '.yn($module->option_logo);
$htmltooltip.='<br><b>'.$langs->trans("MultiLanguage").'</b>: '.yn($module->option_multilang);
print '<td align="center">';
print $html->textwithhelp('',$htmltooltip,1,0);
print '</td>';
print '<td align="center">';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'" target="specimen">'.img_object($langs->trans("Preview"),'generic').'</a>';
print '</td>';
print "</tr>\n";
}
} }
} }
closedir($handle); closedir($handle);

View File

@@ -257,70 +257,73 @@ while (($file = readdir($handle))!==false)
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
$var = !$var; if ($module->isEnabled())
print '<tr '.$bc[$var].'><td width="100">'; {
echo "$file"; $var = !$var;
print "</td><td>\n"; print '<tr '.$bc[$var].'><td width="100">';
echo "$file";
print $module->info(); print "</td><td>\n";
print '</td>'; print $module->info();
// Affiche example print '</td>';
print '<td nowrap="nowrap">'.$module->getExample().'</td>';
// Affiche example
print '<td align="center">'; print '<td nowrap="nowrap">'.$module->getExample().'</td>';
if ($conf->global->FACTURE_ADDON == "$file")
{ print '<td align="center">';
print img_tick($langs->trans("Activated")); if ($conf->global->FACTURE_ADDON == "$file")
} {
else print img_tick($langs->trans("Activated"));
{ }
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$file.'" alt="'.$langs->trans("Default").'">'.$langs->trans("Default").'</a>'; else
} {
print '</td>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$file.'" alt="'.$langs->trans("Default").'">'.$langs->trans("Default").'</a>';
}
$facture=new Facture($db); print '</td>';
$facture->initAsSpecimen();
$facture=new Facture($db);
// Example for standard invoice $facture->initAsSpecimen();
$htmltooltip='';
$htmltooltip.='<b>'.$langs->trans("Version").'</b>: '.$module->getVersion().'<br>'; // Example for standard invoice
$facture->type=0; $htmltooltip='';
$nextval=$module->getNextValue($mysoc,$facture); $htmltooltip.='<b>'.$langs->trans("Version").'</b>: '.$module->getVersion().'<br>';
if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval $facture->type=0;
{ $nextval=$module->getNextValue($mysoc,$facture);
$htmltooltip.='<b>'.$langs->trans("NextValueForInvoices").'</b>: '; if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval
if ($nextval)
{ {
$htmltooltip.=$nextval.'<br>'; $htmltooltip.='<b>'.$langs->trans("NextValueForInvoices").'</b>: ';
if ($nextval)
{
$htmltooltip.=$nextval.'<br>';
}
else
{
$htmltooltip.=$langs->trans($module->error).'<br>';
}
} }
else // Example for credit invoice
$facture->type=2;
$nextval=$module->getNextValue($mysoc,$facture);
if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval
{ {
$htmltooltip.=$langs->trans($module->error).'<br>'; $htmltooltip.='<b>'.$langs->trans("NextValueForCreditNotes").'</b>: ';
if ($nextval)
{
$htmltooltip.=$nextval;
}
else
{
$htmltooltip.=$langs->trans($module->error);
}
} }
}
// Example for credit invoice print '<td align="center">';
$facture->type=2; print $html->textwithhelp('',$htmltooltip,1,0);
$nextval=$module->getNextValue($mysoc,$facture); print '</td>';
if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval
{ print "</tr>\n";
$htmltooltip.='<b>'.$langs->trans("NextValueForCreditNotes").'</b>: '; }
if ($nextval)
{
$htmltooltip.=$nextval;
}
else
{
$htmltooltip.=$langs->trans($module->error);
}
}
print '<td align="center">';
print $html->textwithhelp('',$htmltooltip,1,0);
print '</td>';
print "</tr>\n";
} }
} }
} }

View File

@@ -22,11 +22,11 @@
*/ */
/** /**
\file htdocs/admin/fichinter.php \file htdocs/admin/fichinter.php
\ingroup fichinter \ingroup fichinter
\brief Page d'administration/configuration du module FicheInter \brief Page d'administration/configuration du module FicheInter
\version $Id$ \version $Id$
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php");
@@ -38,7 +38,7 @@ $langs->load("other");
$langs->load("interventions"); $langs->load("interventions");
if (!$user->admin) if (!$user->admin)
accessforbidden(); accessforbidden();
/* /*
@@ -53,7 +53,7 @@ if ($_POST["action"] == 'updateMask')
if ($_POST["action"] == 'set_FICHINTER_DRAFT_WATERMARK') if ($_POST["action"] == 'set_FICHINTER_DRAFT_WATERMARK')
{ {
dolibarr_set_const($db, "FICHINTER_DRAFT_WATERMARK",trim($_POST["FICHINTER_DRAFT_WATERMARK"])); dolibarr_set_const($db, "FICHINTER_DRAFT_WATERMARK",trim($_POST["FICHINTER_DRAFT_WATERMARK"]));
} }
if ($_GET["action"] == 'specimen') if ($_GET["action"] == 'specimen')
@@ -88,56 +88,56 @@ if ($_GET["action"] == 'specimen')
if ($_GET["action"] == 'set') if ($_GET["action"] == 'set')
{ {
$type='ficheinter'; $type='ficheinter';
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type) VALUES ('".$_GET["value"]."','".$type."')"; $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type) VALUES ('".$_GET["value"]."','".$type."')";
if ($db->query($sql)) if ($db->query($sql))
{ {
} }
} }
if ($_GET["action"] == 'del') if ($_GET["action"] == 'del')
{ {
$type='ficheinter'; $type='ficheinter';
$sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model"; $sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
$sql .= " WHERE nom = '".$_GET["value"]."' AND type = '".$type."'"; $sql .= " WHERE nom = '".$_GET["value"]."' AND type = '".$type."'";
if ($db->query($sql)) if ($db->query($sql))
{ {
} }
} }
if ($_GET["action"] == 'setdoc') if ($_GET["action"] == 'setdoc')
{ {
$db->begin(); $db->begin();
if (dolibarr_set_const($db, "FICHEINTER_ADDON_PDF",$_GET["value"]))
{
// La constante qui a <20>t<EFBFBD> lue en avant du nouveau set
// on passe donc par une variable pour avoir un affichage coh<6F>rent
$conf->global->FICHEINTER_ADDON_PDF = $_GET["value"];
}
// On active le modele if (dolibarr_set_const($db, "FICHEINTER_ADDON_PDF",$_GET["value"]))
$type='ficheinter'; {
$sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model"; // La constante qui a <20>t<EFBFBD> lue en avant du nouveau set
$sql_del .= " WHERE nom = '".$_GET["value"]."' AND type = '".$type."'"; // on passe donc par une variable pour avoir un affichage coh<6F>rent
$result1=$db->query($sql_del); $conf->global->FICHEINTER_ADDON_PDF = $_GET["value"];
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom,type) VALUES ('".$_GET["value"]."','".$type."')"; }
$result2=$db->query($sql);
if ($result1 && $result2) // On active le modele
{ $type='ficheinter';
$sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
$sql_del .= " WHERE nom = '".$_GET["value"]."' AND type = '".$type."'";
$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(); $db->commit();
} }
else else
{ {
$db->rollback(); $db->rollback();
} }
} }
if ($_GET["action"] == 'setmod') if ($_GET["action"] == 'setmod')
{ {
// \todo Verifier si module numerotation choisi peut etre activ<69> // \todo Verifier si module numerotation choisi peut etre activ<69>
// par appel methode canBeActivated // par appel methode canBeActivated
dolibarr_set_const($db, "FICHEINTER_ADDON",$_GET["value"]); dolibarr_set_const($db, "FICHEINTER_ADDON",$_GET["value"]);
} }
@@ -180,56 +180,63 @@ clearstatcache();
$handle = opendir($dir); $handle = opendir($dir);
if ($handle) if ($handle)
{ {
$var=true; $var=true;
while (($file = readdir($handle))!==false)
{
if (eregi('^(mod_.*)\.php$',$file,$reg))
{
$file = $reg[1];
$className = substr($file,4);
require_once($dir.$file.".php"); while (($file = readdir($handle))!==false)
{
if (eregi('^(mod_.*)\.php$',$file,$reg))
{
$file = $reg[1];
$className = substr($file,4);
$module = new $file; require_once($dir.$file.".php");
$var=!$var; $module = new $file;
print '<tr '.$bc[$var].'><td>'.$module->nom."</td><td>\n";
print $module->info();
print '</td>';
// Examples // Show modules according to features level
print '<td nowrap="nowrap">'.$module->getExample()."</td>\n"; if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
print '<td align="center">'; if ($module->isEnabled())
if ($conf->global->FICHEINTER_ADDON == $className) {
{ $var=!$var;
print img_tick($langs->trans("Activated")); print '<tr '.$bc[$var].'><td>'.$module->nom."</td><td>\n";
} print $module->info();
else print '</td>';
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$className.'" alt="'.$langs->trans("Default").'">'.$langs->trans("Default").'</a>';
}
print '</td>';
$ficheinter=new Fichinter($db); // Examples
$ficheinter->initAsSpecimen(); print '<td nowrap="nowrap">'.$module->getExample()."</td>\n";
// Info
$htmltooltip='';
$nextval=$module->getNextValue($mysoc,$ficheinter);
if ($nextval != $langs->trans("NotAvailable"))
{
$htmltooltip='<b>'.$langs->trans("NextValue").'</b>: '.$nextval;
}
print '<td align="center">';
print $html->textwithhelp('',$htmltooltip,1,0);
print '</td>';
print '</tr>'; print '<td align="center">';
} if ($conf->global->FICHEINTER_ADDON == $className)
} {
closedir($handle); print img_tick($langs->trans("Activated"));
}
else
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$className.'" alt="'.$langs->trans("Default").'">'.$langs->trans("Default").'</a>';
}
print '</td>';
$ficheinter=new Fichinter($db);
$ficheinter->initAsSpecimen();
// Info
$htmltooltip='';
$nextval=$module->getNextValue($mysoc,$ficheinter);
if ($nextval != $langs->trans("NotAvailable"))
{
$htmltooltip='<b>'.$langs->trans("NextValue").'</b>: '.$nextval;
}
print '<td align="center">';
print $html->textwithhelp('',$htmltooltip,1,0);
print '</td>';
print '</tr>';
}
}
}
closedir($handle);
} }
print '</table><br>'; print '</table><br>';
@@ -278,26 +285,26 @@ $var=true;
$handle=opendir($dir); $handle=opendir($dir);
while (($file = readdir($handle))!==false) while (($file = readdir($handle))!==false)
{ {
if (substr($file, strlen($file) -12) == '.modules.php' && substr($file,0,4) == 'pdf_') if (substr($file, strlen($file) -12) == '.modules.php' && substr($file,0,4) == 'pdf_')
{ {
$name = substr($file, 4, strlen($file) -16); $name = substr($file, 4, strlen($file) -16);
$classname = substr($file, 0, strlen($file) -12); $classname = substr($file, 0, strlen($file) -12);
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'><td>'; print '<tr '.$bc[$var].'><td>';
echo "$name"; echo "$name";
print "</td><td>\n"; print "</td><td>\n";
require_once($dir.$file); require_once($dir.$file);
$module = new $classname(); $module = new $classname();
print $module->description; print $module->description;
print '</td>'; print '</td>';
// Activ<69> // Activ<69>
if (in_array($name, $def)) if (in_array($name, $def))
{ {
print "<td align=\"center\">\n"; print "<td align=\"center\">\n";
if ($conf->global->FICHEINTER_ADDON_PDF != "$name") if ($conf->global->FICHEINTER_ADDON_PDF != "$name")
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'">'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'">';
print img_tick($langs->trans("Disable")); print img_tick($langs->trans("Disable"));
@@ -327,26 +334,26 @@ while (($file = readdir($handle))!==false)
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'" alt="'.$langs->trans("Default").'">'.$langs->trans("Default").'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'" alt="'.$langs->trans("Default").'">'.$langs->trans("Default").'</a>';
} }
print '</td>'; print '</td>';
// Info // Info
$htmltooltip = '<b>'.$langs->trans("Type").'</b>: '.($module->type?$module->type:$langs->trans("Unknown")); $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("Width").'</b>: '.$module->page_largeur;
$htmltooltip.='<br><b>'.$langs->trans("Height").'</b>: '.$module->page_hauteur; $htmltooltip.='<br><b>'.$langs->trans("Height").'</b>: '.$module->page_hauteur;
$htmltooltip.='<br><br>'.$langs->trans("FeaturesSupported").':'; $htmltooltip.='<br><br>'.$langs->trans("FeaturesSupported").':';
$htmltooltip.='<br><b>'.$langs->trans("Logo").'</b>: '.yn($module->option_logo); $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("PaymentMode").'</b>: '.yn($module->option_modereg);
$htmltooltip.='<br><b>'.$langs->trans("PaymentConditions").'</b>: '.yn($module->option_condreg); $htmltooltip.='<br><b>'.$langs->trans("PaymentConditions").'</b>: '.yn($module->option_condreg);
$htmltooltip.='<br><b>'.$langs->trans("MultiLanguage").'</b>: '.yn($module->option_multilang); $htmltooltip.='<br><b>'.$langs->trans("MultiLanguage").'</b>: '.yn($module->option_multilang);
$htmltooltip.='<br><b>'.$langs->trans("WatermarkOnDraftOrders").'</b>: '.yn($module->option_draft_watermark); $htmltooltip.='<br><b>'.$langs->trans("WatermarkOnDraftOrders").'</b>: '.yn($module->option_draft_watermark);
print '<td align="center">'; print '<td align="center">';
print $html->textwithhelp('',$htmltooltip,1,0); print $html->textwithhelp('',$htmltooltip,1,0);
print '</td>'; print '</td>';
print '<td align="center">'; print '<td align="center">';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'intervention').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'intervention').'</a>';
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
} }
} }
closedir($handle); closedir($handle);

View File

@@ -148,8 +148,9 @@ if ($_POST["action"] == 'updatePrefixCommande') dolibarr_set_const($db, "COMMAND
if ($_POST["action"] == 'setOffset') dolibarr_set_const($db, "COMMANDE_FOURNISSEUR_NUM_DELTA",$_POST["offset"]); if ($_POST["action"] == 'setOffset') dolibarr_set_const($db, "COMMANDE_FOURNISSEUR_NUM_DELTA",$_POST["offset"]);
if ($_POST["action"] == 'setNumRestart') dolibarr_set_const($db, "COMMANDE_FOURNISSEUR_NUM_RESTART_BEGIN_YEAR",$_POST["numrestart"]); if ($_POST["action"] == 'setNumRestart') dolibarr_set_const($db, "COMMANDE_FOURNISSEUR_NUM_RESTART_BEGIN_YEAR",$_POST["numrestart"]);
/* /*
* Affichage page * View
*/ */
llxHeader(); llxHeader();
@@ -191,55 +192,58 @@ if ($handle)
$module = new $file; $module = new $file;
// Show modules according to features level if ($module->isEnabled())
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$module->nom."</td><td>\n";
print $module->info();
print '</td>';
// Examples
print '<td nowrap="nowrap">'.$module->getExample()."</td>\n";
print '<td align="center">';
if ($conf->global->COMMANDE_SUPPLIER_ADDON == "$file")
{
print img_tick($langs->trans("Activated"));
}
else
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$file.'" alt="'.$langs->trans("Default").'">'.$langs->trans("Activate").'</a>';
}
print '</td>';
$commande=new CommandeFournisseur($db);
$commande->initAsSpecimen();
// Info
$htmltooltip='';
$htmltooltip.='<b>'.$langs->trans("Version").'</b>: '.$module->getVersion().'<br>';
$facture->type=0;
$nextval=$module->getNextValue($mysoc,$commande);
if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval
{ {
$htmltooltip.='<b>'.$langs->trans("NextValue").'</b>: '; // Show modules according to features level
if ($nextval) if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$module->nom."</td><td>\n";
print $module->info();
print '</td>';
// Examples
print '<td nowrap="nowrap">'.$module->getExample()."</td>\n";
print '<td align="center">';
if ($conf->global->COMMANDE_SUPPLIER_ADDON == "$file")
{
print img_tick($langs->trans("Activated"));
}
else
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$file.'" alt="'.$langs->trans("Default").'">'.$langs->trans("Activate").'</a>';
}
print '</td>';
$commande=new CommandeFournisseur($db);
$commande->initAsSpecimen();
// Info
$htmltooltip='';
$htmltooltip.='<b>'.$langs->trans("Version").'</b>: '.$module->getVersion().'<br>';
$facture->type=0;
$nextval=$module->getNextValue($mysoc,$commande);
if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval
{ {
$htmltooltip.=$nextval.'<br>'; $htmltooltip.='<b>'.$langs->trans("NextValue").'</b>: ';
} if ($nextval)
else {
{ $htmltooltip.=$nextval.'<br>';
$htmltooltip.=$langs->trans($module->error).'<br>'; }
else
{
$htmltooltip.=$langs->trans($module->error).'<br>';
}
} }
print '<td align="center">';
print $html->textwithhelp('',$htmltooltip,1,0);
print '</td>';
print '</tr>';
} }
print '<td align="center">';
print $html->textwithhelp('',$htmltooltip,1,0);
print '</td>';
print '</tr>';
} }
} }
closedir($handle); closedir($handle);

View File

@@ -217,51 +217,54 @@ if ($handle)
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
$var=!$var; if ($module->isEnabled())
print '<tr '.$bc[$var].'><td>'.$module->nom."</td><td>\n"; {
print $module->info(); $var=!$var;
print '</td>'; print '<tr '.$bc[$var].'><td>'.$module->nom."</td><td>\n";
print $module->info();
// Affiche example print '</td>';
print '<td nowrap="nowrap">'.$module->getExample().'</td>';
// Affiche example
print '<td align="center">'; print '<td nowrap="nowrap">'.$module->getExample().'</td>';
if ($conf->global->LIVRAISON_ADDON == "$file")
{ print '<td align="center">';
print img_tick($langs->trans("Activated")); if ($conf->global->LIVRAISON_ADDON == "$file")
}
else
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$file.'" alt="'.$langs->trans("Default").'">'.$langs->trans("Default").'</a>';
}
print '</td>';
$livraison=new Livraison($db);
$livraison->initAsSpecimen();
// Info
$htmltooltip='';
$htmltooltip.='<b>'.$langs->trans("Version").'</b>: '.$module->getVersion().'<br>';
$facture->type=0;
$nextval=$module->getNextValue($mysoc,$livraison);
if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval
{
$htmltooltip.='<b>'.$langs->trans("NextValue").'</b>: ';
if ($nextval)
{ {
$htmltooltip.=$nextval.'<br>'; print img_tick($langs->trans("Activated"));
} }
else else
{ {
$htmltooltip.=$langs->trans($module->error).'<br>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$file.'" alt="'.$langs->trans("Default").'">'.$langs->trans("Default").'</a>';
} }
} print '</td>';
print '<td align="center">'; $livraison=new Livraison($db);
print $html->textwithhelp('',$htmltooltip,1,0); $livraison->initAsSpecimen();
print '</td>';
// Info
print '</tr>'; $htmltooltip='';
$htmltooltip.='<b>'.$langs->trans("Version").'</b>: '.$module->getVersion().'<br>';
$facture->type=0;
$nextval=$module->getNextValue($mysoc,$livraison);
if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval
{
$htmltooltip.='<b>'.$langs->trans("NextValue").'</b>: ';
if ($nextval)
{
$htmltooltip.=$nextval.'<br>';
}
else
{
$htmltooltip.=$langs->trans($module->error).'<br>';
}
}
print '<td align="center">';
print $html->textwithhelp('',$htmltooltip,1,0);
print '</td>';
print '</tr>';
}
} }
} }
closedir($handle); closedir($handle);

View File

@@ -229,51 +229,54 @@ if ($handle)
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
$var=!$var; if ($module->isEnabled())
print '<tr '.$bc[$var].'><td>'.$module->nom."</td><td>\n"; {
print $module->info(); $var=!$var;
print '</td>'; print '<tr '.$bc[$var].'><td>'.$module->nom."</td><td>\n";
print $module->info();
// Examples print '</td>';
print '<td nowrap="nowrap">'.$module->getExample()."</td>\n";
// Examples
print '<td align="center">'; print '<td nowrap="nowrap">'.$module->getExample()."</td>\n";
if ($conf->global->PROPALE_ADDON == "$file")
{ print '<td align="center">';
print img_tick($langs->trans("Activated")); if ($conf->global->PROPALE_ADDON == "$file")
} {
else print img_tick($langs->trans("Activated"));
{ }
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$file.'" alt="'.$langs->trans("Default").'">'.$langs->trans("Activate").'</a>'; else
} {
print '</td>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$file.'" alt="'.$langs->trans("Default").'">'.$langs->trans("Activate").'</a>';
}
$propale=new Propal($db); print '</td>';
$propale->initAsSpecimen();
$propale=new Propal($db);
// Info $propale->initAsSpecimen();
$htmltooltip='';
$htmltooltip.='<b>'.$langs->trans("Version").'</b>: '.$module->getVersion().'<br>'; // Info
$facture->type=0; $htmltooltip='';
$nextval=$module->getNextValue($mysoc,$propale); $htmltooltip.='<b>'.$langs->trans("Version").'</b>: '.$module->getVersion().'<br>';
if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval $facture->type=0;
{ $nextval=$module->getNextValue($mysoc,$propale);
$htmltooltip.='<b>'.$langs->trans("NextValue").'</b>: '; if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval
if ($nextval)
{ {
$htmltooltip.=$nextval.'<br>'; $htmltooltip.='<b>'.$langs->trans("NextValue").'</b>: ';
if ($nextval)
{
$htmltooltip.=$nextval.'<br>';
}
else
{
$htmltooltip.=$langs->trans($module->error).'<br>';
}
} }
else
{ print '<td align="center">';
$htmltooltip.=$langs->trans($module->error).'<br>'; print $html->textwithhelp('',$htmltooltip,1,0);
} print '</td>';
}
print "</tr>\n";
print '<td align="center">'; }
print $html->textwithhelp('',$htmltooltip,1,0);
print '</td>';
print "</tr>\n";
} }
} }
closedir($handle); closedir($handle);

View File

@@ -208,11 +208,17 @@ print '</tr>';
foreach ($arrayhandler as $key => $module) foreach ($arrayhandler as $key => $module)
{ {
// Show modules according to features level
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
if ($module->isEnabled())
{
$var = !$var; $var = !$var;
print '<tr '.$bc[$var].'><td width="100">'; print '<tr '.$bc[$var].'><td width="100">';
print ucfirst($key); print ucfirst($key);
print "</td><td>\n"; print "</td><td>\n";
print $arrayhandler[$key]->getDescription(); print $module->getDescription();
print '</td>'; print '</td>';
// Affiche example // Affiche example
@@ -229,6 +235,7 @@ foreach ($arrayhandler as $key => $module)
print '<a href="'.$_SERVER['PHP_SELF'].'?action=setgeneraterule&amp;value='.$key.'">'.$langs->trans("Activate").'</a>'; print '<a href="'.$_SERVER['PHP_SELF'].'?action=setgeneraterule&amp;value='.$key.'">'.$langs->trans("Activate").'</a>';
} }
print "</td></tr>\n"; print "</td></tr>\n";
}
} }
print '</table>'; print '</table>';
print '</form>'; print '</form>';

View File

@@ -91,7 +91,15 @@ class ModeleNumRefSuppliersOrders
{ {
var $error=''; var $error='';
/** \brief Renvoi la description par defaut du modele de num<75>rotation /** \brief Return if a module can be used or not
* \return boolean true if module can be used
*/
function isEnabled()
{
return true;
}
/** \brief Renvoi la description par defaut du modele de num<75>rotation
* \return string Texte descripif * \return string Texte descripif
*/ */
function info() function info()

View File

@@ -38,7 +38,15 @@ class modPhpbarcode extends ModeleBarCode
var $version='dolibarr'; // 'development', 'experimental', 'dolibarr' var $version='dolibarr'; // 'development', 'experimental', 'dolibarr'
var $error=''; var $error='';
/** \brief Renvoi la description du modele de num<75>rotation /** \brief Return if a module can be used or not
* \return boolean true if module can be used
*/
function isEnabled()
{
return true;
}
/** \brief Renvoi la description du modele de num<75>rotation
* \return string Texte descripif * \return string Texte descripif
*/ */
function info() function info()

View File

@@ -95,6 +95,14 @@ class ModeleNumRefCommandes
{ {
var $error=''; var $error='';
/** \brief Return if a module can be used or not
* \return boolean true if module can be used
*/
function isEnabled()
{
return true;
}
/** \brief Renvoi la description par defaut du modele de num<75>rotation /** \brief Renvoi la description par defaut du modele de num<75>rotation
* \return string Texte descripif * \return string Texte descripif
*/ */

View File

@@ -88,6 +88,14 @@ class ModeleNumRefDons
{ {
var $error=''; var $error='';
/** \brief Return if a module can be used or not
* \return boolean true if module can be used
*/
function isEnabled()
{
return true;
}
/** \brief Renvoi la description par defaut du modele de num<75>rotation /** \brief Renvoi la description par defaut du modele de num<75>rotation
* \return string Texte descripif * \return string Texte descripif
*/ */

View File

@@ -93,6 +93,14 @@ class ModeleNumRefFactures
{ {
var $error=''; var $error='';
/** \brief Return if a module can be used or not
* \return boolean true if module can be used
*/
function isEnabled()
{
return true;
}
/** \brief Renvoi la description par defaut du modele de num<75>rotation /** \brief Renvoi la description par defaut du modele de num<75>rotation
* \return string Texte descripif * \return string Texte descripif
*/ */

View File

@@ -96,6 +96,14 @@ class ModeleNumRefFicheinter
{ {
var $error=''; var $error='';
/** \brief Return if a module can be used or not
* \return boolean true if module can be used
*/
function isEnabled()
{
return true;
}
/** \brief Renvoi la description par defaut du modele de num<75>rotation /** \brief Renvoi la description par defaut du modele de num<75>rotation
* \return string Texte descripif * \return string Texte descripif
*/ */

View File

@@ -90,6 +90,14 @@ class ModeleNumRefPropales
{ {
var $error=''; var $error='';
/** \brief Return if a module can be used or not
* \return boolean true if module can be used
*/
function isEnabled()
{
return true;
}
/** \brief Renvoi la description par defaut du modele de num<75>rotation /** \brief Renvoi la description par defaut du modele de num<75>rotation
* \return string Texte descripif * \return string Texte descripif
*/ */

View File

@@ -36,6 +36,14 @@ class ModeleGenPassword
{ {
var $error=''; var $error='';
/** \brief Return if a module can be used or not
* \return boolean true if module can be used
*/
function isEnabled()
{
return true;
}
/** \brief Renvoi la description par defaut du modele /** \brief Renvoi la description par defaut du modele
* \return string Texte descripif * \return string Texte descripif
*/ */

View File

@@ -92,6 +92,14 @@ class ModeleNumRefDeliveryOrder
{ {
var $error=''; var $error='';
/** \brief Return if a module can be used or not
* \return boolean true if module can be used
*/
function isEnabled()
{
return true;
}
/** \brief Renvoi la description par defaut du modele de num<75>rotation /** \brief Renvoi la description par defaut du modele de num<75>rotation
* \return string Texte descripif * \return string Texte descripif
*/ */