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

@ -102,7 +102,10 @@ 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;
$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();
print '</td>';
// Examples // Examples
print '<td nowrap="nowrap">'.$module->getExample()."</td>\n"; print '<td nowrap="nowrap">'.$module->getExample()."</td>\n";
print '<td align="center">'; print '<td align="center">';
if ($conf->global->COMMANDE_ADDON == "$file") if ($conf->global->COMMANDE_ADDON == "$file")
{ {
print img_tick($langs->trans("Activated")); print img_tick($langs->trans("Activated"));
} }
else else
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$file.'" alt="'.$langs->trans("Default").'">'.$langs->trans("Activate").'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$file.'" alt="'.$langs->trans("Default").'">'.$langs->trans("Activate").'</a>';
} }
print '</td>'; print '</td>';
$commande=new Commande($db); $commande=new Commande($db);
$commande->initAsSpecimen(); $commande->initAsSpecimen();
// Info // Info
$htmltooltip=''; $htmltooltip='';
$htmltooltip.='<b>'.$langs->trans("Version").'</b>: '.$module->getVersion().'<br>'; $htmltooltip.='<b>'.$langs->trans("Version").'</b>: '.$module->getVersion().'<br>';
$facture->type=0; $facture->type=0;
$nextval=$module->getNextValue($mysoc,$commande); $nextval=$module->getNextValue($mysoc,$commande);
if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval
{
$htmltooltip.='<b>'.$langs->trans("NextValue").'</b>: ';
if ($nextval)
{ {
$htmltooltip.=$nextval.'<br>'; $htmltooltip.='<b>'.$langs->trans("NextValue").'</b>: ';
if ($nextval)
{
$htmltooltip.=$nextval.'<br>';
}
else
{
$htmltooltip.=$langs->trans($module->error).'<br>';
}
} }
else
{
$htmltooltip.=$langs->trans($module->error).'<br>';
}
}
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 '</tr>'; 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 '</td>';
{ print '<td>';
print img_tick($langs->trans("Enabled")); print $module->description;
}
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>';
}
else
{
print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'">'.$langs->trans("Activate").'</a>';
print "</td>";
}
// Defaut // Active
print "<td align=\"center\">"; if (in_array($name, $def))
if ($conf->global->DON_ADDON_MODEL == "$name") {
{ print "<td align=\"center\">\n";
print img_tick($langs->trans("Default")); if ($conf->global->DON_ADDON_MODEL == $name)
} {
else print img_tick($langs->trans("Enabled"));
{ }
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'" alt="'.$langs->trans("Default").'">'.$langs->trans("Default").'</a>'; else
} {
print '</td>'; print '&nbsp;';
print '</td><td align="center">';
print '<a href="dons.php?action=setdoc&value='.$name.'">'.$langs->trans("Activate").'</a>';
}
print '</td>';
}
else
{
print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'">'.$langs->trans("Activate").'</a>';
print "</td>";
}
// Info // Defaut
$htmltooltip = '<b>'.$langs->trans("Name").'</b>: '.$module->name; print "<td align=\"center\">";
$htmltooltip.='<br><b>'.$langs->trans("Type").'</b>: '.($module->type?$module->type:$langs->trans("Unknown")); if ($conf->global->DON_ADDON_MODEL == "$name")
$htmltooltip.='<br><b>'.$langs->trans("Height").'/'.$langs->trans("Width").'</b>: '.$module->page_hauteur.'/'.$module->page_largeur; {
$htmltooltip.='<br><br>'.$langs->trans("FeaturesSupported").':'; print img_tick($langs->trans("Default"));
$htmltooltip.='<br><b>'.$langs->trans("Logo").'</b>: '.yn($module->option_logo); }
$htmltooltip.='<br><b>'.$langs->trans("MultiLanguage").'</b>: '.yn($module->option_multilang); else
print '<td align="center">'; {
print $html->textwithhelp('',$htmltooltip,1,0); print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'" alt="'.$langs->trans("Default").'">'.$langs->trans("Default").'</a>';
print '</td>'; }
print '<td align="center">'; print '</td>';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'" target="specimen">'.img_object($langs->trans("Preview"),'generic').'</a>';
print '</td>';
print "</tr>\n"; // 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 "</td><td>\n";
print $module->info(); print $module->info();
print '</td>'; print '</td>';
// Affiche example // Affiche example
print '<td nowrap="nowrap">'.$module->getExample().'</td>'; print '<td nowrap="nowrap">'.$module->getExample().'</td>';
print '<td align="center">'; print '<td align="center">';
if ($conf->global->FACTURE_ADDON == "$file") if ($conf->global->FACTURE_ADDON == "$file")
{ {
print img_tick($langs->trans("Activated")); print img_tick($langs->trans("Activated"));
} }
else else
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$file.'" alt="'.$langs->trans("Default").'">'.$langs->trans("Default").'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$file.'" alt="'.$langs->trans("Default").'">'.$langs->trans("Default").'</a>';
} }
print '</td>'; print '</td>';
$facture=new Facture($db); $facture=new Facture($db);
$facture->initAsSpecimen(); $facture->initAsSpecimen();
// Example for standard invoice // Example for standard invoice
$htmltooltip=''; $htmltooltip='';
$htmltooltip.='<b>'.$langs->trans("Version").'</b>: '.$module->getVersion().'<br>'; $htmltooltip.='<b>'.$langs->trans("Version").'</b>: '.$module->getVersion().'<br>';
$facture->type=0; $facture->type=0;
$nextval=$module->getNextValue($mysoc,$facture); $nextval=$module->getNextValue($mysoc,$facture);
if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval
{
$htmltooltip.='<b>'.$langs->trans("NextValueForInvoices").'</b>: ';
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
$facture->type=2;
$nextval=$module->getNextValue($mysoc,$facture);
if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval
{
$htmltooltip.='<b>'.$langs->trans("NextValueForCreditNotes").'</b>: ';
if ($nextval)
{
$htmltooltip.=$nextval;
}
else
{
$htmltooltip.=$langs->trans($module->error);
}
}
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 "</tr>\n"; 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"])) if (dolibarr_set_const($db, "FICHEINTER_ADDON_PDF",$_GET["value"]))
{ {
// La constante qui a <20>t<EFBFBD> lue en avant du nouveau set // 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 // on passe donc par une variable pour avoir un affichage coh<6F>rent
$conf->global->FICHEINTER_ADDON_PDF = $_GET["value"]; $conf->global->FICHEINTER_ADDON_PDF = $_GET["value"];
} }
// On active le modele // On active le modele
$type='ficheinter'; $type='ficheinter';
$sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model"; $sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
$sql_del .= " WHERE nom = '".$_GET["value"]."' AND type = '".$type."'"; $sql_del .= " WHERE nom = '".$_GET["value"]."' AND type = '".$type."'";
$result1=$db->query($sql_del); $result1=$db->query($sql_del);
$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."')";
$result2=$db->query($sql); $result2=$db->query($sql);
if ($result1 && $result2) 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) while (($file = readdir($handle))!==false)
{ {
if (eregi('^(mod_.*)\.php$',$file,$reg)) if (eregi('^(mod_.*)\.php$',$file,$reg))
{ {
$file = $reg[1]; $file = $reg[1];
$className = substr($file,4); $className = substr($file,4);
require_once($dir.$file.".php"); require_once($dir.$file.".php");
$module = new $file; $module = new $file;
$var=!$var; // Show modules according to features level
print '<tr '.$bc[$var].'><td>'.$module->nom."</td><td>\n"; if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
print $module->info(); if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
print '</td>';
// Examples if ($module->isEnabled())
print '<td nowrap="nowrap">'.$module->getExample()."</td>\n"; {
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$module->nom."</td><td>\n";
print $module->info();
print '</td>';
print '<td align="center">'; // Examples
if ($conf->global->FICHEINTER_ADDON == $className) print '<td nowrap="nowrap">'.$module->getExample()."</td>\n";
{
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); print '<td align="center">';
$ficheinter->initAsSpecimen(); if ($conf->global->FICHEINTER_ADDON == $className)
{
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>';
// Info $ficheinter=new Fichinter($db);
$htmltooltip=''; $ficheinter->initAsSpecimen();
$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>'; // Info
} $htmltooltip='';
} $nextval=$module->getNextValue($mysoc,$ficheinter);
closedir($handle); 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,20 +285,20 @@ $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))
@ -329,24 +336,24 @@ while (($file = readdir($handle))!==false)
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();
print '</td>';
// Affiche example // Affiche example
print '<td nowrap="nowrap">'.$module->getExample().'</td>'; print '<td nowrap="nowrap">'.$module->getExample().'</td>';
print '<td align="center">'; print '<td align="center">';
if ($conf->global->LIVRAISON_ADDON == "$file") if ($conf->global->LIVRAISON_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("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>';
print '</tr>'; // 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>';
}
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();
print '</td>';
// Examples // Examples
print '<td nowrap="nowrap">'.$module->getExample()."</td>\n"; print '<td nowrap="nowrap">'.$module->getExample()."</td>\n";
print '<td align="center">'; print '<td align="center">';
if ($conf->global->PROPALE_ADDON == "$file") if ($conf->global->PROPALE_ADDON == "$file")
{ {
print img_tick($langs->trans("Activated")); print img_tick($langs->trans("Activated"));
} }
else else
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$file.'" alt="'.$langs->trans("Default").'">'.$langs->trans("Activate").'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$file.'" alt="'.$langs->trans("Default").'">'.$langs->trans("Activate").'</a>';
} }
print '</td>'; print '</td>';
$propale=new Propal($db); $propale=new Propal($db);
$propale->initAsSpecimen(); $propale->initAsSpecimen();
// Info // Info
$htmltooltip=''; $htmltooltip='';
$htmltooltip.='<b>'.$langs->trans("Version").'</b>: '.$module->getVersion().'<br>'; $htmltooltip.='<b>'.$langs->trans("Version").'</b>: '.$module->getVersion().'<br>';
$facture->type=0; $facture->type=0;
$nextval=$module->getNextValue($mysoc,$propale); $nextval=$module->getNextValue($mysoc,$propale);
if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval
{
$htmltooltip.='<b>'.$langs->trans("NextValue").'</b>: ';
if ($nextval)
{ {
$htmltooltip.=$nextval.'<br>'; $htmltooltip.='<b>'.$langs->trans("NextValue").'</b>: ';
if ($nextval)
{
$htmltooltip.=$nextval.'<br>';
}
else
{
$htmltooltip.=$langs->trans($module->error).'<br>';
}
} }
else
{
$htmltooltip.=$langs->trans($module->error).'<br>';
}
}
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 "</tr>\n"; 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é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é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é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é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érotation /** \brief Renvoi la description par defaut du modele de numé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érotation /** \brief Renvoi la description par defaut du modele de numé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érotation /** \brief Renvoi la description par defaut du modele de numé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érotation /** \brief Renvoi la description par defaut du modele de numé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érotation /** \brief Renvoi la description par defaut du modele de numé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érotation /** \brief Renvoi la description par defaut du modele de numérotation
* \return string Texte descripif * \return string Texte descripif
*/ */