[-] BO : fixed #PSFV-802 : now mail subject are saved
This commit is contained in:
@@ -80,6 +80,11 @@ class AdminTranslationsControllerCore extends AdminController
|
|||||||
|
|
||||||
public function initToolbar()
|
public function initToolbar()
|
||||||
{
|
{
|
||||||
|
$this->toolbar_btn['save-and-stay'] = array(
|
||||||
|
'short' => 'SaveAndStay',
|
||||||
|
'href' => '#',
|
||||||
|
'desc' => $this->l('Save and stay'),
|
||||||
|
);
|
||||||
$this->toolbar_btn['save'] = array(
|
$this->toolbar_btn['save'] = array(
|
||||||
'href' => '#',
|
'href' => '#',
|
||||||
'desc' => $this->l('Update translations')
|
'desc' => $this->l('Update translations')
|
||||||
@@ -191,9 +196,16 @@ class AdminTranslationsControllerCore extends AdminController
|
|||||||
{
|
{
|
||||||
if ($fd = fopen($path, 'w'))
|
if ($fd = fopen($path, 'w'))
|
||||||
{
|
{
|
||||||
|
// Get value of button save and stay
|
||||||
|
$save_and_stay = Tools::getValue('submitTranslations'.Tools::toCamelCase($type, true).'AndStay');
|
||||||
|
|
||||||
|
// Get language
|
||||||
|
$lang = strtolower(Tools::getValue('lang'));
|
||||||
|
|
||||||
// Unset all POST which are not translations
|
// Unset all POST which are not translations
|
||||||
unset(
|
unset(
|
||||||
$_POST['submitTranslations'.Tools::toCamelCase($type, true)],
|
$_POST['submitTranslations'.Tools::toCamelCase($type, true)],
|
||||||
|
$_POST['submitTranslations'.Tools::toCamelCase($type, true).'AndStay'],
|
||||||
$_POST['lang'],
|
$_POST['lang'],
|
||||||
$_POST['token']
|
$_POST['token']
|
||||||
);
|
);
|
||||||
@@ -211,7 +223,11 @@ class AdminTranslationsControllerCore extends AdminController
|
|||||||
fwrite($fd, '$_'.$tab.'[\''.pSQL($key, true).'\'] = \''.pSQL($value, true).'\';'."\n");
|
fwrite($fd, '$_'.$tab.'[\''.pSQL($key, true).'\'] = \''.pSQL($value, true).'\';'."\n");
|
||||||
fwrite($fd, "\n?>");
|
fwrite($fd, "\n?>");
|
||||||
fclose($fd);
|
fclose($fd);
|
||||||
Tools::redirectAdmin(self::$currentIndex.'&conf=4&token='.$this->token);
|
|
||||||
|
if ($save_and_stay)
|
||||||
|
Tools::redirectAdmin(self::$currentIndex.'&conf=4&token='.$this->token.'&lang='.$lang.'&type='.$type);
|
||||||
|
else
|
||||||
|
Tools::redirectAdmin(self::$currentIndex.'&conf=4&token='.$this->token);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
die('Cannot write language file');
|
die('Cannot write language file');
|
||||||
@@ -669,6 +685,7 @@ class AdminTranslationsControllerCore extends AdminController
|
|||||||
$this->all_iso_lang[] = $language['iso_code'];
|
$this->all_iso_lang[] = $language['iso_code'];
|
||||||
|
|
||||||
$lang = Tools::strtolower($_POST['lang']);
|
$lang = Tools::strtolower($_POST['lang']);
|
||||||
|
|
||||||
if (!Validate::isLanguageIsoCode($lang))
|
if (!Validate::isLanguageIsoCode($lang))
|
||||||
die(Tools::displayError());
|
die(Tools::displayError());
|
||||||
if (!$modules = scandir(_PS_MODULE_DIR_))
|
if (!$modules = scandir(_PS_MODULE_DIR_))
|
||||||
@@ -688,7 +705,11 @@ class AdminTranslationsControllerCore extends AdminController
|
|||||||
|
|
||||||
foreach ($arr_find_and_write as $key => $value)
|
foreach ($arr_find_and_write as $key => $value)
|
||||||
$this->findAndWriteTranslationsIntoFile($value['file_name'], $value['files'], $value['theme'], $value['module'], $value['dir']);
|
$this->findAndWriteTranslationsIntoFile($value['file_name'], $value['files'], $value['theme'], $value['module'], $value['dir']);
|
||||||
Tools::redirectAdmin(self::$currentIndex.'&conf=4&token='.$this->token);
|
|
||||||
|
if (Tools::getValue('submitTranslationsModulesAndStay'))
|
||||||
|
Tools::redirectAdmin(self::$currentIndex.'&conf=4&token='.$this->token.'&lang='.$lang.'&type=modules');
|
||||||
|
else
|
||||||
|
Tools::redirectAdmin(self::$currentIndex.'&conf=4&token='.$this->token);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -721,7 +742,7 @@ class AdminTranslationsControllerCore extends AdminController
|
|||||||
protected function submitTranslationsMails($id_lang)
|
protected function submitTranslationsMails($id_lang)
|
||||||
{
|
{
|
||||||
$obj_lang = new Language($id_lang);
|
$obj_lang = new Language($id_lang);
|
||||||
$params_redirect = (Tools::isSubmit('submitTranslationsMailsAndStay') ? '&lang='.Tools::getValue('lang').'&type='.Tools::getValue('type') : '');
|
$params_redirect = (Tools::isSubmit('submitTranslationsMailsAndStay') ? '&lang='.Tools::strtolower($_POST['lang']).'&type='.Tools::getValue('type') : '');
|
||||||
|
|
||||||
$arr_mail_content = array();
|
$arr_mail_content = array();
|
||||||
$arr_mail_path = array();
|
$arr_mail_path = array();
|
||||||
@@ -795,7 +816,7 @@ class AdminTranslationsControllerCore extends AdminController
|
|||||||
|
|
||||||
// Update subjects
|
// Update subjects
|
||||||
$array_subjects = array();
|
$array_subjects = array();
|
||||||
if ($subjects = Tools::getValue('subject') && is_array($subjects))
|
if (($subjects = Tools::getValue('subject')) && is_array($subjects))
|
||||||
{
|
{
|
||||||
$array_subjects['core_and_modules'] = array('translations'=>array(), 'path'=>$arr_mail_path['core_mail'].'lang.php');
|
$array_subjects['core_and_modules'] = array('translations'=>array(), 'path'=>$arr_mail_path['core_mail'].'lang.php');
|
||||||
if (isset($arr_mail_path['theme_mail']))
|
if (isset($arr_mail_path['theme_mail']))
|
||||||
@@ -965,7 +986,7 @@ class AdminTranslationsControllerCore extends AdminController
|
|||||||
'count' => $count,
|
'count' => $count,
|
||||||
'limit_warning' => $this->displayLimitPostWarning($count),
|
'limit_warning' => $this->displayLimitPostWarning($count),
|
||||||
'post_limit_exceeded' => $this->post_limit_exceed,
|
'post_limit_exceeded' => $this->post_limit_exceed,
|
||||||
'url_submit' => self::$currentIndex.'&submitTranslationsBack=1&token='.$this->token,
|
'url_submit' => self::$currentIndex.'&submitTranslationsFront=1&token='.$this->token,
|
||||||
'toggle_button' => $this->displayToggleButton(),
|
'toggle_button' => $this->displayToggleButton(),
|
||||||
'tabsArray' => $tabs_array,
|
'tabsArray' => $tabs_array,
|
||||||
'textarea_sized' => TEXTAREA_SIZED,
|
'textarea_sized' => TEXTAREA_SIZED,
|
||||||
|
|||||||
Reference in New Issue
Block a user