diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php
index e462b7854ac..25a1ba101ad 100644
--- a/htdocs/admin/mails_templates.php
+++ b/htdocs/admin/mails_templates.php
@@ -675,17 +675,27 @@ if (!empty($user->admin) && (empty($_SESSION['leftmenu']) || $_SESSION['leftmenu
}
-// Confirmation de la suppression de la ligne
+// Confirm deletion of record
if ($action == 'delete') {
- print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid.'&code='.$code.'&id='.$id, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete', '', 0, 1);
+ print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.((int) $rowid).'&code='.urlencode($code).'&id='.((int) $id), $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete', '', 0, 1);
}
-
-
$fieldlist = explode(',', $tabfield[$id]);
if ($action == 'create') {
+ // If data was already input, we define them in obj to populate input fields.
+ $obj = new stdClass();
+ $obj->label = GETPOST('label');
+ $obj->lang = GETPOST('lang');
+ $obj->type_template = GETPOST('type_template');
+ $obj->fk_user = GETPOST('fk_user', 'int');
+ $obj->private = GETPOST('private', 'int');
+ $obj->position = GETPOST('position');
+ $obj->topic = GETPOST('topic');
+ $obj->joinfiles = GETPOST('joinfiles');
+ $obj->content = GETPOST('content', 'restricthtml');
+
// Form to add a new line
print '
';
print '
';
-} // END IF not edit
+}
// List of available record in database
dol_syslog("htdocs/admin/dict", LOG_DEBUG);
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index bb69fd4966d..37949215357 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -5371,10 +5371,10 @@ function load_fiche_titre($titre, $morehtmlright = '', $picto = 'generic', $pict
$return .= '