fix problem for namedic

This commit is contained in:
Lamrani Abdel
2023-08-09 13:43:44 +02:00
parent ce7de59782
commit d0dc3b019c
2 changed files with 4 additions and 3 deletions

View File

@@ -1034,7 +1034,7 @@ function updateDictionaryInFile($module, $file, $dicts)
$isEmpty = false; $isEmpty = false;
$dicData = "\t\t\$this->dictionaries=array(\n"; $dicData = "\t\t\$this->dictionaries=array(\n";
$module = strtolower($module);
foreach ($dicts as $key => $value) { foreach ($dicts as $key => $value) {
if (empty($value)) { if (empty($value)) {
$isEmpty = true; $isEmpty = true;
@@ -1140,7 +1140,7 @@ function createNewDictionnary($modulename, $file, $namedic, $dictionnaires = nul
} }
// rewrite dictionnary if // rewrite dictionnary if
$dictionnaires['tabname'][] = $namedic; $dictionnaires['tabname'][] = strtolower($namedic);
$dictionnaires['tablib'][] = ucfirst(substr($namedic, 2)); $dictionnaires['tablib'][] = ucfirst(substr($namedic, 2));
$dictionnaires['tabsql'][] = 'SELECT f.rowid as rowid, f.code, f.label, f.active FROM '.MAIN_DB_PREFIX.strtolower($namedic).' as f'; $dictionnaires['tabsql'][] = 'SELECT f.rowid as rowid, f.code, f.label, f.active FROM '.MAIN_DB_PREFIX.strtolower($namedic).' as f';
$dictionnaires['tabsqlsort'][] = (array_key_exists('label', $columns) ? 'label ASC' : ''); $dictionnaires['tabsqlsort'][] = (array_key_exists('label', $columns) ? 'label ASC' : '');

View File

@@ -1978,7 +1978,8 @@ if ($dirins && $action == 'confirm_deletedictionary' && $dicname) {
// search the key by name // search the key by name
$keyToDelete = null; $keyToDelete = null;
foreach ($dicts['tabname'] as $key => $table) { foreach ($dicts['tabname'] as $key => $table) {
if ($table === $newdicname) { //var_dump($table." /////// ".$newdicname);exit;
if (strtolower($table) === $newdicname) {
$keyToDelete = $key; $keyToDelete = $key;
break; break;
} }