mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-07 16:41:48 +01:00
FIX Hour and min were lost when editing a past event.
This commit is contained in:
@@ -885,8 +885,16 @@ if (empty($reshook) && $action == 'update' && $usercancreate) {
|
||||
$datep = dol_mktime(0, 0, 0, GETPOSTINT("apmonth"), GETPOSTINT("apday"), GETPOSTINT("apyear"), $tzforfullday ? $tzforfullday : 'tzuserrel');
|
||||
$datef = dol_mktime(23, 59, 59, GETPOSTINT("p2month"), GETPOSTINT("p2day"), GETPOSTINT("p2year"), $tzforfullday ? $tzforfullday : 'tzuserrel');
|
||||
} else {
|
||||
$datep = dol_mktime(GETPOSTINT("aphour"), GETPOSTINT("apmin"), GETPOSTINT("apsec"), GETPOSTINT("apmonth"), GETPOSTINT("apday"), GETPOSTINT("apyear"), 'tzuserrel');
|
||||
$datef = dol_mktime(GETPOSTINT("p2hour"), GETPOSTINT("p2min"), GETPOSTINT("apsec"), GETPOSTINT("p2month"), GETPOSTINT("p2day"), GETPOSTINT("p2year"), 'tzuserrel');
|
||||
if (!GETPOSTISSET('ap') && !GETPOSTISSET('aphour') && !GETPOSTISSET('apmin')) { // If date fields are disabled, we keep old value
|
||||
$datep = $object->datep;
|
||||
} else {
|
||||
$datep = dol_mktime(GETPOSTINT("aphour"), GETPOSTINT("apmin"), GETPOSTINT("apsec"), GETPOSTINT("apmonth"), GETPOSTINT("apday"), GETPOSTINT("apyear"), 'tzuserrel');
|
||||
}
|
||||
if (!GETPOSTISSET('p2') && !GETPOSTISSET('p2hour') && !GETPOSTISSET('p2min')) { // If date fields are disabled, we keep old value
|
||||
$datef = $object->datef;
|
||||
} else {
|
||||
$datef = dol_mktime(GETPOSTINT("p2hour"), GETPOSTINT("p2min"), GETPOSTINT("apsec"), GETPOSTINT("p2month"), GETPOSTINT("p2day"), GETPOSTINT("p2year"), 'tzuserrel');
|
||||
}
|
||||
}
|
||||
//set end date to now if percentage is set to 100 and end date not set
|
||||
$datef = (!$datef && $percentage == 100) ? dol_now() : $datef;
|
||||
@@ -2138,10 +2146,6 @@ if ($id > 0 && $action != 'create') {
|
||||
|
||||
// Date start - end
|
||||
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>';
|
||||
$tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT');
|
||||
print $form->selectDate($datep ? $datep : $object->datep, 'ap', 1, 1, 0, "action", 1, 2, ($caneditdateorowner ? 0 : 1), 'fulldaystart', '', '', '', 1, '', '', $object->fulldayevent ? ($tzforfullday ? $tzforfullday : 'tzuserrel') : 'tzuserrel');
|
||||
|
||||
@@ -7655,7 +7655,7 @@ class Form
|
||||
$retstring .= '</option>';
|
||||
}
|
||||
$retstring .= '</select>';
|
||||
//if ($m && empty($conf->dol_optimize_smallscreen)) $retstring .= ":";
|
||||
|
||||
if ($m) {
|
||||
$retstring .= ":";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user