From 33de1340d79df8c3af4c538ee693b014f7f1d117 Mon Sep 17 00:00:00 2001 From: simnandez Date: Wed, 15 May 2013 18:11:44 +0200 Subject: [PATCH] Fix: use default lang if lang not defined --- scripts/contracts/email_expire_services_to_customers.php | 2 +- scripts/contracts/email_expire_services_to_representatives.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/contracts/email_expire_services_to_customers.php b/scripts/contracts/email_expire_services_to_customers.php index 09c71b571b1..4370314bb9d 100755 --- a/scripts/contracts/email_expire_services_to_customers.php +++ b/scripts/contracts/email_expire_services_to_customers.php @@ -180,7 +180,7 @@ function envoi_mail($mode,$oldemail,$message,$total,$userlang,$oldcustomer,$dura global $conf,$langs; $newlangs=new Translate('',$conf); - $newlangs->setDefaultLang($userlang); + $newlangs->setDefaultLang(empty($userlang)?(empty($conf->global->MAIN_LANG_DEFAULT)?'auto':$conf->global->MAIN_LANG_DEFAULT):$userlang); $newlangs->load("main"); $newlangs->load("contracts"); diff --git a/scripts/contracts/email_expire_services_to_representatives.php b/scripts/contracts/email_expire_services_to_representatives.php index 282d38fb82a..b509ecc69a4 100755 --- a/scripts/contracts/email_expire_services_to_representatives.php +++ b/scripts/contracts/email_expire_services_to_representatives.php @@ -180,7 +180,7 @@ function envoi_mail($mode,$oldemail,$message,$total,$userlang,$oldsalerepresenta global $conf,$langs; $newlangs=new Translate('',$conf); - $newlangs->setDefaultLang($userlang); + $newlangs->setDefaultLang(empty($userlang)?(empty($conf->global->MAIN_LANG_DEFAULT)?'auto':$conf->global->MAIN_LANG_DEFAULT):$userlang); $newlangs->load("main"); $newlangs->load("contracts");