forked from Wavyzz/dolibarr
Fix default values
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user