Merge pull request #20268 from FHenry/14_fix_date_behaviour_action_card

fix: #20267 #Evarisk same required field displayed on edit or new card
This commit is contained in:
Laurent Destailleur 2022-03-17 02:31:16 +01:00 committed by GitHub
commit 6885568b7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1439,6 +1439,10 @@ if ($id > 0) {
$("#fullday").change(function() {
setdatefields();
});
$("#actioncode").change(function() {
if ($("#actioncode").val() == \'AC_RDV\') $("#dateend").addClass("fieldrequired");
else $("#dateend").removeClass("fieldrequired");
});
})';
print '</script>'."\n";
}
@ -1483,7 +1487,12 @@ if ($id > 0) {
print '<tr><td>'.$langs->trans("EventOnFullDay").'</td><td colspan="3"><input type="checkbox" id="fullday" name="fullday" '.($object->fulldayevent ? ' checked' : '').'></td></tr>';
// Date start - end
print '<tr><td class="nowrap"><span class="fieldrequired">'.$langs->trans("DateActionStart").' - '.$langs->trans("DateActionEnd").'</span></td><td colspan="3">';
print '<tr><td class="nowrap">';
print '<span class="fieldrequired">'.$langs->trans("DateActionStart").'</span>';
print ' - ';
print '<span id="dateend"'.($object->type_code == 'AC_RDV' ? ' class="fieldrequired"' : '').'>'.$langs->trans("DateActionEnd").'</span>';
print '</td><td td colspan="3">';
//print '<tr><td class="nowrap"><span class="fieldrequired">'.$langs->trans("DateActionStart").' - '.$langs->trans("DateActionEnd").'</span></td><td colspan="3">';
if (GETPOST("afaire") == 1) {
print $form->selectDate($datep ? $datep : $object->datep, 'ap', 1, 1, 0, "action", 1, 1, 0, 'fulldaystart', '', '', '', 1, '', '', 'tzuser');
} elseif (GETPOST("afaire") == 2) {