Merge branch 'Dolibarr:develop' into develop

This commit is contained in:
Erik van Berkum 2021-09-06 18:24:49 +09:00 committed by GitHub
commit 96a09543e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 53 additions and 28 deletions

View File

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

View File

@ -4727,7 +4727,7 @@ class Form
foreach ($formquestion as $key => $input) { foreach ($formquestion as $key => $input) {
if (is_array($input) && !empty($input)) { if (is_array($input) && !empty($input)) {
if ($input['type'] == 'hidden') { if ($input['type'] == 'hidden') {
$more .= '<input type="hidden" id="'.$input['name'].'" name="'.$input['name'].'" value="'.dol_escape_htmltag($input['value']).'">'."\n"; $more .= '<input type="hidden" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'" value="'.dol_escape_htmltag($input['value']).'">'."\n";
} }
} }
} }
@ -4742,9 +4742,21 @@ class Form
$morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : ''); $morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : '');
if ($input['type'] == 'text') { if ($input['type'] == 'text') {
$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"; $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="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$size.' value="'.$input['value'].'"'.$moreattr.' /></div></div>'."\n";
} elseif ($input['type'] == 'password') { } 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"; $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="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($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="'.dol_escape_htmltag($input['name']).'" id="'.dol_escape_htmltag($input['name']).'" class="'.$morecss.'"'.$moreattr.'>';
$moreonecolumn .= $input['value'];
$moreonecolumn .= '</textarea>';
$moreonecolumn .= '</div>';
} elseif ($input['type'] == 'select') { } elseif ($input['type'] == 'select') {
if (empty($morecss)) { if (empty($morecss)) {
$morecss = 'minwidth100'; $morecss = 'minwidth100';
@ -4767,7 +4779,7 @@ class Form
} elseif ($input['type'] == 'checkbox') { } elseif ($input['type'] == 'checkbox') {
$more .= '<div class="tagtr">'; $more .= '<div class="tagtr">';
$more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].' </div><div class="tagtd">'; $more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].' </div><div class="tagtd">';
$more .= '<input type="checkbox" class="flat'.$morecss.'" id="'.$input['name'].'" name="'.$input['name'].'"'.$moreattr; $more .= '<input type="checkbox" class="flat'.$morecss.'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$moreattr;
if (!is_bool($input['value']) && $input['value'] != 'false' && $input['value'] != '0') { if (!is_bool($input['value']) && $input['value'] != 'false' && $input['value'] != '0') {
$more .= ' checked'; $more .= ' checked';
} }
@ -4788,7 +4800,7 @@ class Form
} else { } else {
$more .= '<div clas="tagtd'.(empty($input['tdclass']) ? '' : (' "'.$input['tdclass'])).'">&nbsp;</div>'; $more .= '<div clas="tagtd'.(empty($input['tdclass']) ? '' : (' "'.$input['tdclass'])).'">&nbsp;</div>';
} }
$more .= '<div class="tagtd'.($i == 0 ? ' tdtop' : '').'"><input type="radio" class="flat'.$morecss.'" id="'.$input['name'].$selkey.'" name="'.$input['name'].'" value="'.$selkey.'"'.$moreattr; $more .= '<div class="tagtd'.($i == 0 ? ' tdtop' : '').'"><input type="radio" class="flat'.$morecss.'" id="'.dol_escape_htmltag($input['name'].$selkey).'" name="'.dol_escape_htmltag($input['name']).'" value="'.$selkey.'"'.$moreattr;
if ($input['disabled']) { if ($input['disabled']) {
$more .= ' disabled'; $more .= ' disabled';
} }
@ -4796,7 +4808,7 @@ class Form
$more .= ' checked="checked"'; $more .= ' checked="checked"';
} }
$more .= ' /> '; $more .= ' /> ';
$more .= '<label for="'.$input['name'].$selkey.'">'.$selval.'</label>'; $more .= '<label for="'.dol_escape_htmltag($input['name'].$selkey).'">'.$selval.'</label>';
$more .= '</div></div>'."\n"; $more .= '</div></div>'."\n";
$i++; $i++;
} }
@ -4921,7 +4933,7 @@ class Form
inputvalue = $("#" + inputname + more).val(); inputvalue = $("#" + inputname + more).val();
} }
if (typeof inputvalue == "undefined") { inputvalue=""; } if (typeof inputvalue == "undefined") { inputvalue=""; }
console.log("check inputname="+inputname+" inputvalue="+inputvalue); console.log("formconfirm check inputname="+inputname+" inputvalue="+inputvalue);
options += "&" + inputname + "=" + encodeURIComponent(inputvalue); options += "&" + inputname + "=" + encodeURIComponent(inputvalue);
}); });
} }

View File

@ -84,18 +84,31 @@ if (isset($extrafields->attributes[$elementtype]['type']) && is_array($extrafiel
} }
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print "<td>".$extrafields->attributes[$elementtype]['pos'][$key]."</td>\n"; // Position
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 print "<td>".dol_escape_htmltag($extrafields->attributes[$elementtype]['pos'][$key])."</td>\n";
print "<td>".$langs->trans($extrafields->attributes[$elementtype]['label'][$key])."</td>\n"; // Label
print "<td>".$key."</td>\n"; 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
print "<td>".$type2label[$extrafields->attributes[$elementtype]['type'][$key]]."</td>\n"; // Label translated
print '<td class="right">'.$extrafields->attributes[$elementtype]['size'][$key]."</td>\n"; print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($langs->transnoentitiesnoconv($extrafields->attributes[$elementtype]['label'][$key])).'">'.dol_escape_htmltag($langs->transnoentitiesnoconv($extrafields->attributes[$elementtype]['label'][$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"; 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"; 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">'.yn($extrafields->attributes[$elementtype]['alwayseditable'][$key])."</td>\n";
print '<td class="center">'.$extrafields->attributes[$elementtype]['list'][$key]."</td>\n"; // Visible
print '<td class="center">'.$extrafields->attributes[$elementtype]['printable'][$key]."</td>\n"; 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"; print '<td class="center">'.yn($extrafields->attributes[$elementtype]['totalizable'][$key])."</td>\n";
if (!empty($conf->multicompany->enabled)) { if (!empty($conf->multicompany->enabled)) {
print '<td class="center">'; print '<td class="center">';
@ -116,8 +129,8 @@ if (isset($extrafields->attributes[$elementtype]['type']) && is_array($extrafiel
print '</td>'; print '</td>';
} }
print '<td class="right nowraponall">'; print '<td class="right nowraponall">';
print '<a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'&attrname='.$key.'#formeditextrafield">'.img_edit().'</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='.$key.'">'.img_delete().'</a>'; print '&nbsp; <a class="paddingleft" href="'.$_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&attrname='.urlencode($key).'">'.img_delete().'</a>';
print '</td>'."\n"; print '</td>'."\n";
print "</tr>"; print "</tr>";
} }

View File

@ -2163,4 +2163,5 @@ APIsAreNotEnabled=APIs modules are not enabled
YouShouldSetThisToOff=You should set this to 0 or off YouShouldSetThisToOff=You should set this to 0 or off
InstallAndUpgradeLockedBy=Install and upgrades are locked by the file <b>%s</b> InstallAndUpgradeLockedBy=Install and upgrades are locked by the file <b>%s</b>
OldImplementation=Old implementation OldImplementation=Old implementation
PDF_SHOW_LINK_TO_ONLINE_PAYMENT=If some online payment modules are enabled (Paypal, Stripe, ...), add a link on the PDF to make the online payment PDF_SHOW_LINK_TO_ONLINE_PAYMENT=If some online payment modules are enabled (Paypal, Stripe, ...), add a link on the PDF to make the online payment
EnabledCondition=Condition to have field enabled (if not enabled, visibility will always be off)

View File

@ -36,7 +36,7 @@ CloseAContract=Close a contract
ConfirmDeleteAContract=Are you sure you want to delete this contract and all its services? ConfirmDeleteAContract=Are you sure you want to delete this contract and all its services?
ConfirmValidateContract=Are you sure you want to validate this contract under name <b>%s</b>? ConfirmValidateContract=Are you sure you want to validate this contract under name <b>%s</b>?
ConfirmActivateAllOnContract=This will open all services (not yet active). Are you sure you want to open all services? ConfirmActivateAllOnContract=This will open all services (not yet active). Are you sure you want to open all services?
ConfirmCloseContract=This will close all services (active or not). Are you sure you want to close this contract? ConfirmCloseContract=This will close all services (expired or not). Are you sure you want to close this contract?
ConfirmCloseService=Are you sure you want to close this service with date <b>%s</b>? ConfirmCloseService=Are you sure you want to close this service with date <b>%s</b>?
ValidateAContract=Validate a contract ValidateAContract=Validate a contract
ActivateService=Activate service ActivateService=Activate service

View File

@ -313,10 +313,13 @@ if ($action == 'create') {
} }
print "</table>"; print "</table>";
print '<br>';
// Bouton Save payment // Bouton Save payment
print '<div class="center">'; print '<div class="center">';
print '<input type="checkbox" checked name="closepaidsalary"> '.$langs->trans("ClosePaidSalaryAutomatically"); print '<div class="paddingbottom"><input type="checkbox" checked name="closepaidsalary" id="closepaidsalary"><label for="closepaidsalary">'.$langs->trans("ClosePaidSalaryAutomatically").'</label></div>';
print $form->buttonsSaveCancel("Save", "Cancel", '', true); print $form->buttonsSaveCancel("ToMakePayment", "Cancel", '', true);
print '</div>'; print '</div>';