Define a default module is not defined

This commit is contained in:
Laurent Destailleur 2011-02-20 22:53:59 +00:00
parent 4917ba31a2
commit 8fd2f8a577
5 changed files with 61 additions and 53 deletions

View File

@ -35,9 +35,16 @@ $langs->load("contracts");
if (!$user->admin) if (!$user->admin)
accessforbidden(); accessforbidden();
if (empty($conf->global->CONTRACT_ADDON))
{
$conf->global->CONTRACT_ADDON='mod_contract_serpis';
}
/* /*
* Actions * Actions
*/ */
if ($_POST["action"] == 'updateMask') if ($_POST["action"] == 'updateMask')
{ {
$maskconst=$_POST['maskconstcontract']; $maskconst=$_POST['maskconstcontract'];
@ -56,9 +63,11 @@ if ($_POST["action"] == 'updatePrefix') dolibarr_set_const($db, "CONTRACT_NUM_PR
if ($_POST["action"] == 'setOffset') dolibarr_set_const($db, "CONTRACT_NUM_DELTA",$_POST["offset"],'chaine',0,'',$conf->entity); if ($_POST["action"] == 'setOffset') dolibarr_set_const($db, "CONTRACT_NUM_DELTA",$_POST["offset"],'chaine',0,'',$conf->entity);
if ($_POST["action"] == 'setNumRestart') dolibarr_set_const($db, "CONTRACT_NUM_RESTART_BEGIN_YEAR",$_POST["numrestart"],'chaine',0,'',$conf->entity); if ($_POST["action"] == 'setNumRestart') dolibarr_set_const($db, "CONTRACT_NUM_RESTART_BEGIN_YEAR",$_POST["numrestart"],'chaine',0,'',$conf->entity);
/* /*
* View * View
*/ */
llxHeader(); llxHeader();
$dir=DOL_DOCUMENT_ROOT."/includes/modules/contract/"; $dir=DOL_DOCUMENT_ROOT."/includes/modules/contract/";

View File

@ -41,6 +41,11 @@ $langs->load("deliveries");
if (!$user->admin) accessforbidden(); if (!$user->admin) accessforbidden();
if (empty($conf->global->EXPEDITION_ADDON_NUMBER))
{
$conf->global->EXPEDITION_ADDON_NUMBER='mod_expedition_safor';
}
/* /*
* Actions * Actions

View File

@ -100,8 +100,11 @@ class Contrat extends CommonObject
$dir = DOL_DOCUMENT_ROOT . "/includes/modules/contract"; $dir = DOL_DOCUMENT_ROOT . "/includes/modules/contract";
if (! empty($conf->global->CONTRACT_ADDON)) if (empty($conf->global->CONTRACT_ADDON))
{ {
$conf->global->CONTRACT_ADDON='mod_contract_serpis';
}
$file = $conf->global->CONTRACT_ADDON.".php"; $file = $conf->global->CONTRACT_ADDON.".php";
// Chargement de la classe de numerotation // Chargement de la classe de numerotation
@ -130,12 +133,6 @@ class Contrat extends CommonObject
return ""; return "";
} }
} }
else
{
print $langs->trans("Error")." ".$langs->trans("Error_CONTRACT_ADDON_NotDefined");
return "";
}
}
/** /**
* \brief Activate a contract line * \brief Activate a contract line

View File

@ -98,8 +98,11 @@ class Expedition extends CommonObject
$dir = DOL_DOCUMENT_ROOT . "/includes/modules/expedition"; $dir = DOL_DOCUMENT_ROOT . "/includes/modules/expedition";
if (! empty($conf->global->EXPEDITION_ADDON_NUMBER)) if (empty($conf->global->EXPEDITION_ADDON_NUMBER))
{ {
$conf->global->EXPEDITION_ADDON_NUMBER='mod_expedition_safor';
}
$file = $conf->global->EXPEDITION_ADDON_NUMBER.".php"; $file = $conf->global->EXPEDITION_ADDON_NUMBER.".php";
// Chargement de la classe de numerotation // Chargement de la classe de numerotation
@ -128,12 +131,6 @@ class Expedition extends CommonObject
return ""; return "";
} }
} }
else
{
print $langs->trans("Error")." ".$langs->trans("Error_EXPEDITION_ADDON_NUMBER_NotDefined");
return "";
}
}
/** /**
* \brief Cree expedition en base * \brief Cree expedition en base

View File

@ -31,7 +31,7 @@ require_once(DOL_DOCUMENT_ROOT ."/includes/modules/expedition/modules_expedition
class mod_expedition_safor extends ModelNumRefExpedition class mod_expedition_safor extends ModelNumRefExpedition
{ {
var $version='dolibarr'; var $version='dolibarr';
var $prefix='BE'; var $prefix='SH';
var $error=''; var $error='';
var $nom='Safor'; var $nom='Safor';