Redundant code

This commit is contained in:
Marcos García de La Fuente 2015-02-25 19:44:12 +01:00
parent 89684748c5
commit e3853a648f
3 changed files with 2 additions and 13 deletions

View File

@ -72,7 +72,6 @@ if ($action == 'remises')
{
if (dolibarr_set_const($db, 'MARGIN_METHODE_FOR_DISCOUNT', $_POST['MARGIN_METHODE_FOR_DISCOUNT'], 'chaine', 0, '', $conf->entity) > 0)
{
$conf->global->MARGIN_METHODE_FOR_DISCOUNT = $_POST['MARGIN_METHODE_FOR_DISCOUNT'];
setEventMessage($langs->trans("RecordModifiedSuccessfully"));
}
else
@ -85,7 +84,6 @@ if ($action == 'typemarges')
{
if (dolibarr_set_const($db, 'MARGIN_TYPE', $_POST['MARGIN_TYPE'], 'chaine', 0, '', $conf->entity) > 0)
{
$conf->global->MARGIN_METHODE_FOR_DISCOUNT = $_POST['MARGIN_TYPE'];
setEventMessage($langs->trans("RecordModifiedSuccessfully"));
}
else
@ -98,7 +96,6 @@ if ($action == 'contact')
{
if (dolibarr_set_const($db, 'AGENT_CONTACT_TYPE', $_POST['AGENT_CONTACT_TYPE'], 'chaine', 0, '', $conf->entity) > 0)
{
$conf->global->AGENT_CONTACT_TYPE = $_POST['AGENT_CONTACT_TYPE'];
setEventMessage($langs->trans("RecordModifiedSuccessfully"));
}
else

View File

@ -237,12 +237,7 @@ if ($action == 'deltask')
// Set default model
else if ($action == 'setdoc')
{
if (dolibarr_set_const($db, "PROJECT_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
{
// La constante qui a ete lue en avant du nouveau set
// on passe donc par une variable pour avoir un affichage coherent
$conf->global->PROJECT_ADDON_PDF = $value;
}
dolibarr_set_const($db, "PROJECT_ADDON_PDF",$value,'chaine',0,'',$conf->entity);
// On active le modele
$ret = delDocumentModel($value, $type);

View File

@ -165,10 +165,7 @@ if ($action == 'setdoc')
$db->begin();
if (dolibarr_set_const($db, "COMPANY_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
{
$conf->global->COMPANY_ADDON_PDF = $value;
}
dolibarr_set_const($db, "COMPANY_ADDON_PDF",$value,'chaine',0,'',$conf->entity);
// On active le modele
$type='company';