Fix default values
This commit is contained in:
parent
097d3c3a92
commit
1b3b7c9329
@ -147,12 +147,12 @@ if (($action == 'add' || (GETPOST('add') && $action != 'update')) || GETPOST('ac
|
|||||||
$object->value=$defaultvalue;
|
$object->value=$defaultvalue;
|
||||||
$object->entity=$conf->entity;
|
$object->entity=$conf->entity;
|
||||||
$result=$object->create($user);
|
$result=$object->create($user);
|
||||||
if ($result<0) {
|
if ($result < 0) {
|
||||||
$action = '';
|
$action = '';
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
} else {
|
} else {
|
||||||
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
|
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
|
||||||
$action = "";
|
$action = '';
|
||||||
$defaulturl = '';
|
$defaulturl = '';
|
||||||
$defaultkey = '';
|
$defaultkey = '';
|
||||||
$defaultvalue = '';
|
$defaultvalue = '';
|
||||||
@ -324,16 +324,16 @@ print "\n";
|
|||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
// Page
|
// Page
|
||||||
print '<td>';
|
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";
|
print '</td>'."\n";
|
||||||
// Field
|
// Field
|
||||||
print '<td>';
|
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>';
|
print '</td>';
|
||||||
// Value
|
// Value
|
||||||
if ($mode != 'focus' && $mode != 'mandatory') {
|
if ($mode != 'focus' && $mode != 'mandatory') {
|
||||||
print '<td>';
|
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>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
// Limit to superadmin
|
// Limit to superadmin
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user