NEW Can edit the translation key of an overwrote translation key.
This commit is contained in:
parent
b70764af88
commit
fd3418d91d
@ -101,6 +101,10 @@ if ($action == 'setMAIN_ENABLE_OVERWRITE_TRANSLATION') {
|
||||
}
|
||||
|
||||
if ($action == 'update') {
|
||||
if ($transkey == '') {
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Key")), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
if ($transvalue == '') {
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("NewTranslationStringToShow")), null, 'errors');
|
||||
$error++;
|
||||
@ -108,7 +112,7 @@ if ($action == 'update') {
|
||||
if (!$error) {
|
||||
$db->begin();
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."overwrite_trans set transvalue = '".$db->escape($transvalue)."' WHERE rowid = ".GETPOST('rowid', 'int');
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."overwrite_trans set transkey = '".$db->escape($transkey)."', transvalue = '".$db->escape($transvalue)."' WHERE rowid = ".((int) GETPOST('rowid', 'int'));
|
||||
$result = $db->query($sql);
|
||||
if ($result > 0) {
|
||||
$db->commit();
|
||||
@ -324,7 +328,13 @@ if ($mode == 'overwrite') {
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
print '<td>'.$obj->lang.'</td>'."\n";
|
||||
print '<td>'.$obj->transkey.'</td>'."\n";
|
||||
print '<td>';
|
||||
if ($action == 'edit' && $obj->rowid == GETPOST('rowid', 'int')) {
|
||||
print '<input type="text" class="quatrevingtpercent" name="transkey" value="'.dol_escape_htmltag($obj->transkey).'">';
|
||||
} else {
|
||||
print $obj->transkey;
|
||||
}
|
||||
print '</td>'."\n";
|
||||
|
||||
// Value
|
||||
print '<td class="small">';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user