NEW Can use textarea field into confirm popup.

Reponsive
This commit is contained in:
Laurent Destailleur 2021-09-06 01:42:54 +02:00
parent ed3919da13
commit f288f36b71
3 changed files with 37 additions and 16 deletions

View File

@ -1202,12 +1202,8 @@ if ($action == 'create') {
}
print "</form>\n";
} else /* *************************************************************************** */
/* */
/* Mode vue et edition */
/* */
/* *************************************************************************** */
{
} else {
// View and edit mode
$now = dol_now();
if ($object->id > 0) {

View File

@ -4745,6 +4745,18 @@ class Form
$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd"><input type="text" class="flat'.$morecss.'" id="'.$input['name'].'" name="'.$input['name'].'"'.$size.' value="'.$input['value'].'"'.$moreattr.' /></div></div>'."\n";
} elseif ($input['type'] == 'password') {
$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd"><input type="password" class="flat'.$morecss.'" id="'.$input['name'].'" name="'.$input['name'].'"'.$size.' value="'.$input['value'].'"'.$moreattr.' /></div></div>'."\n";
} elseif ($input['type'] == 'textarea') {
/*$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd">';
$more .= '<textarea name="'.$input['name'].'" class="'.$morecss.'"'.$moreattr.'>';
$more .= $input['value'];
$more .= '</textarea>';
$more .= '</div></div>'."\n";*/
$moreonecolumn .= '<div class="margintoponly">';
$moreonecolumn .= $input['label'].'<br>';
$moreonecolumn .= '<textarea name="'.$input['name'].'" class="'.$morecss.'"'.$moreattr.'>';
$moreonecolumn .= $input['value'];
$moreonecolumn .= '</textarea>';
$moreonecolumn .= '</div>';
} elseif ($input['type'] == 'select') {
if (empty($morecss)) {
$morecss = 'minwidth100';

View File

@ -84,18 +84,31 @@ if (isset($extrafields->attributes[$elementtype]['type']) && is_array($extrafiel
}
print '<tr class="oddeven">';
print "<td>".$extrafields->attributes[$elementtype]['pos'][$key]."</td>\n";
print "<td>".$extrafields->attributes[$elementtype]['label'][$key]."</td>\n"; // We don't translate here, we want admin to know what is the key not translated value
// Position
print "<td>".dol_escape_htmltag($extrafields->attributes[$elementtype]['pos'][$key])."</td>\n";
// Label
print "<td>".dol_escape_htmltag($extrafields->attributes[$elementtype]['label'][$key])."</td>\n"; // We don't translate here, we want admin to know what is the key not translated value
// Label translated
print "<td>".$langs->trans($extrafields->attributes[$elementtype]['label'][$key])."</td>\n";
print "<td>".$key."</td>\n";
print "<td>".$type2label[$extrafields->attributes[$elementtype]['type'][$key]]."</td>\n";
print '<td class="right">'.$extrafields->attributes[$elementtype]['size'][$key]."</td>\n";
print '<td>'.dol_trunc($extrafields->attributes[$elementtype]['computed'][$key], 20)."</td>\n";
// Key
print "<td>".dol_escape_htmltag($key)."</td>\n";
// Type
print "<td>".dol_escape_htmltag($type2label[$extrafields->attributes[$elementtype]['type'][$key]])."</td>\n";
// Size
print '<td class="right">'.dol_escape_htmltag($extrafields->attributes[$elementtype]['size'][$key])."</td>\n";
// Computed field
print '<td class="tdoverflowmax100" title="'.dol_escape_htmltag($extrafields->attributes[$elementtype]['computed'][$key]).'">'.dol_escape_htmltag($extrafields->attributes[$elementtype]['computed'][$key])."</td>\n";
// Is unique ?
print '<td class="center">'.yn($extrafields->attributes[$elementtype]['unique'][$key])."</td>\n";
// Is mandatory ?
print '<td class="center">'.yn($extrafields->attributes[$elementtype]['required'][$key])."</td>\n";
// Can always be editable ?
print '<td class="center">'.yn($extrafields->attributes[$elementtype]['alwayseditable'][$key])."</td>\n";
print '<td class="center">'.$extrafields->attributes[$elementtype]['list'][$key]."</td>\n";
print '<td class="center">'.$extrafields->attributes[$elementtype]['printable'][$key]."</td>\n";
// Visible
print '<td class="center tdoverflowmax100" title="'.dol_escape_htmltag($extrafields->attributes[$elementtype]['list'][$key]).'">'.dol_escape_htmltag($extrafields->attributes[$elementtype]['list'][$key])."</td>\n";
// Print on PDF
print '<td class="center tdoverflowmax100" title="'.dol_escape_htmltag($extrafields->attributes[$elementtype]['printable'][$key]).'">'.dol_escape_htmltag($extrafields->attributes[$elementtype]['printable'][$key])."</td>\n";
// Summable
print '<td class="center">'.yn($extrafields->attributes[$elementtype]['totalizable'][$key])."</td>\n";
if (!empty($conf->multicompany->enabled)) {
print '<td class="center">';
@ -116,8 +129,8 @@ if (isset($extrafields->attributes[$elementtype]['type']) && is_array($extrafiel
print '</td>';
}
print '<td class="right nowraponall">';
print '<a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'&attrname='.$key.'#formeditextrafield">'.img_edit().'</a>';
print '&nbsp; <a class="paddingleft" href="'.$_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&attrname='.$key.'">'.img_delete().'</a>';
print '<a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'&attrname='.urlencode($key).'#formeditextrafield">'.img_edit().'</a>';
print '&nbsp; <a class="paddingleft" href="'.$_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&attrname='.urlencode($key).'">'.img_delete().'</a>';
print '</td>'."\n";
print "</tr>";
}