2
0
forked from Wavyzz/dolibarr

Fix default values

This commit is contained in:
Laurent Destailleur
2023-02-11 12:34:21 +01:00
parent 097d3c3a92
commit 1b3b7c9329

View File

@@ -147,12 +147,12 @@ if (($action == 'add' || (GETPOST('add') && $action != 'update')) || GETPOST('ac
$object->value=$defaultvalue;
$object->entity=$conf->entity;
$result=$object->create($user);
if ($result<0) {
if ($result < 0) {
$action = '';
setEventMessages($object->error, $object->errors, 'errors');
} else {
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
$action = "";
$action = '';
$defaulturl = '';
$defaultkey = '';
$defaultvalue = '';
@@ -324,16 +324,16 @@ print "\n";
print '<tr class="oddeven">';
// Page
print '<td>';
print '<input type="text" class="flat minwidth200 maxwidthonsmartphone" name="defaulturl" value="'.dol_escape_htmltag(GETPOST('defaulturl', 'alphanohtml')).'">';
print '<input type="text" class="flat minwidth200 maxwidthonsmartphone" name="defaulturl" value="'.dol_escape_htmltag($defaulturl).'">';
print '</td>'."\n";
// Field
print '<td>';
print '<input type="text" class="flat maxwidth100onsmartphone" name="defaultkey" value="'.dol_escape_htmltag(GETPOST('defaultkey', 'alphanohtml')).'">';
print '<input type="text" class="flat maxwidth100onsmartphone" name="defaultkey" value="'.dol_escape_htmltag($defaultkey).'">';
print '</td>';
// Value
if ($mode != 'focus' && $mode != 'mandatory') {
print '<td>';
print '<input type="text" class="flat maxwidth100onsmartphone" name="defaultvalue" value="">';
print '<input type="text" class="flat maxwidth100onsmartphone" name="defaultvalue" value="'.dol_escape_htmltag($defaultvalue).'">';
print '</td>';
}
// Limit to superadmin