[-] BO : #PSTEST-220 : bug fixed, the fields number that has to be traduct is now correct
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11833 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -1122,43 +1122,53 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
$classArray = array();
|
||||
$tabs_array = array();
|
||||
$count = 0;
|
||||
|
||||
foreach (scandir(_PS_CLASS_DIR_) as $classFile)
|
||||
{
|
||||
if (!preg_match('/\.php$/', $classFile) OR $classFile == 'index.php')
|
||||
continue;
|
||||
include_once(_PS_CLASS_DIR_.$classFile);
|
||||
$prefix_key = substr($classFile, 0, -4);
|
||||
if (!class_exists($prefix_key, false) && !class_exists($prefix_key.'Core', false))
|
||||
if (!class_exists($prefix_key))
|
||||
continue;
|
||||
if (!is_subclass_of($prefix_key, 'ObjectModel'))
|
||||
continue;
|
||||
$classArray[$prefix_key] = call_user_func(array($prefix_key, 'getValidationRules'), $prefix_key);
|
||||
|
||||
foreach ($classArray as $prefix_key => $rules)
|
||||
{
|
||||
if (isset($rules['validate']))
|
||||
foreach ($rules['validate'] as $key => $value)
|
||||
if (isset($_FIELDS[$prefix_key.'_'.md5($key)]))
|
||||
// @todo check key : md5($key) was initially md5(addslashes($key))
|
||||
$tabs_array[$prefix_key][$key] = html_entity_decode($_FIELDS[$prefix_key.'_'.md5($key)], ENT_COMPAT, 'UTF-8');
|
||||
else
|
||||
{
|
||||
$tabs_array[$prefix_key][$key] = '';
|
||||
if (!isset($missing_translations[$prefix_key]))
|
||||
$missing_translations[$prefix_key] = 1;
|
||||
else
|
||||
$missing_translations[$prefix_key]++;
|
||||
}
|
||||
if (isset($rules['validateLang']))
|
||||
foreach ($rules['validateLang'] as $key => $value)
|
||||
$tabs_array[$prefix_key][$key] = array_key_exists($prefix_key.'_'.md5(addslashes($key)), $_FIELDS) ? html_entity_decode($_FIELDS[$prefix_key.'_'.md5(addslashes($key))], ENT_COMPAT, 'UTF-8') : '';
|
||||
}
|
||||
if (isset($classArray[$prefix_key]['validate']))
|
||||
$count += count($classArray[$prefix_key]['validate']);
|
||||
if (isset($classArray[$prefix_key]['validateLang']))
|
||||
$count += count($classArray[$prefix_key]['validateLang']);
|
||||
}
|
||||
|
||||
foreach ($classArray as $prefix_key => $rules)
|
||||
{
|
||||
if (isset($rules['validate']))
|
||||
foreach ($rules['validate'] as $key => $value)
|
||||
if (isset($_FIELDS[$prefix_key.'_'.md5($key)]))
|
||||
// @todo check key : md5($key) was initially md5(addslashes($key))
|
||||
$tabs_array[$prefix_key][$key] = html_entity_decode($_FIELDS[$prefix_key.'_'.md5($key)], ENT_COMPAT, 'UTF-8');
|
||||
else
|
||||
{
|
||||
$tabs_array[$prefix_key][$key] = '';
|
||||
if (!isset($missing_translations[$prefix_key]))
|
||||
$missing_translations[$prefix_key] = 1;
|
||||
else
|
||||
$missing_translations[$prefix_key]++;
|
||||
}
|
||||
if (isset($rules['validateLang']))
|
||||
foreach ($rules['validateLang'] as $key => $value)
|
||||
if (isset($_FIELDS[$prefix_key.'_'.md5($key)]))
|
||||
$tabs_array[$prefix_key][$key] = array_key_exists($prefix_key.'_'.md5(addslashes($key)), $_FIELDS) ? html_entity_decode($_FIELDS[$prefix_key.'_'.md5(addslashes($key))], ENT_COMPAT, 'UTF-8') : '';
|
||||
else
|
||||
{
|
||||
$tabs_array[$prefix_key][$key] = '';
|
||||
if (!isset($missing_translations[$prefix_key]))
|
||||
$missing_translations[$prefix_key] = 1;
|
||||
else
|
||||
$missing_translations[$prefix_key]++;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($classArray[$prefix_key]['validate']))
|
||||
$count += count($classArray[$prefix_key]['validate']);
|
||||
if (isset($classArray[$prefix_key]['validateLang']))
|
||||
$count += count($classArray[$prefix_key]['validateLang']);
|
||||
$this->tpl_view_vars = array(
|
||||
'lang' => Tools::strtoupper($lang),
|
||||
'translation_type' => $this->l('Field name translations'),
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
global $_FIELDS;
|
||||
$_FIELDS = array();
|
||||
$_FIELDS['Address_71581233bcc121fcc409ecce9317fbde'] = 'Id client';
|
||||
$_FIELDS['AddressFormat_1ddcb92ade31c8fbd370001f9b29a7d9'] = 'format';
|
||||
$_FIELDS['CMSCategory_b068931cc450442b63f5b3d276ea4297'] = 'Nom';
|
||||
$_FIELDS['Configuration_b068931cc450442b63f5b3d276ea4297'] = 'nom';
|
||||
$_FIELDS['Configuration_c79c16c41a33108866a9a4c785c73f4f'] = 'ID de groupe de la boutique';
|
||||
$_FIELDS['Configuration_5a0971a207e75dd040db8b6a3425a8bf'] = 'ID de la boutique';
|
||||
@@ -100,11 +99,6 @@ $_FIELDS['Profile_b068931cc450442b63f5b3d276ea4297'] = 'nom';
|
||||
$_FIELDS['QuickAccess_2a304a1348456ccd2234cd71a81bd338'] = 'lien';
|
||||
$_FIELDS['QuickAccess_48df2d0e8fcf6f9fe7809d5ea0cd2691'] = 'nouvelle_fenêtre';
|
||||
$_FIELDS['QuickAccess_b068931cc450442b63f5b3d276ea4297'] = 'nom';
|
||||
$_FIELDS['SpecificPriceRule_b068931cc450442b63f5b3d276ea4297'] = 'nom';
|
||||
$_FIELDS['SpecificPriceRule_dc99776458b68786a9e903854e23a483'] = 'A partir de la quantité';
|
||||
$_FIELDS['SpecificPriceRule_9477e24c78f1ca8ee9b03111f6227fc2'] = 'Réduction';
|
||||
$_FIELDS['SpecificPriceRule_d98a07f84921b24ee30f86fd8cd85c3c'] = 'A partir de';
|
||||
$_FIELDS['SpecificPriceRule_01b6e20344b68835c5ed1ddedf20d531'] = 'Jusqu\'à';
|
||||
$_FIELDS['Tab_672070865d6470b0b9c251e275faaa30'] = 'ID de l\'onglet mère';
|
||||
$_FIELDS['Tab_4757fe07fd492a8be0ea6a760d683d6e'] = 'position';
|
||||
$_FIELDS['Tab_22884db148f0ffb0d830ba431102b0b5'] = 'module';
|
||||
|
||||
Reference in New Issue
Block a user