Add link "Now" on date selection when cloning social contribution

This commit is contained in:
Laurent Destailleur 2021-09-02 19:15:21 +02:00
parent 51b1cd583b
commit 67db0f1bdb
2 changed files with 4 additions and 3 deletions

View File

@ -429,7 +429,7 @@ if ($id > 0) {
if (!empty($conf->global->TAX_ADD_CLONE_FOR_NEXT_MONTH_CHECKBOX)) {
$formquestion[] = array('type' => 'checkbox', 'name' => 'clone_for_next_month', 'label' => $langs->trans("CloneTaxForNextMonth"), 'value' => 1);
} else {
$formquestion[] = array('type' => 'date', 'name' => 'clone_date_ech', 'label' => $langs->trans("Date"), 'value' => -1);
$formquestion[] = array('type' => 'date', 'datenow'=>1, 'name' => 'clone_date_ech', 'label' => $langs->trans("Date"), 'value' => -1);
$formquestion[] = array('type' => 'date', 'name' => 'clone_period', 'label' => $langs->trans("PeriodEndDate"), 'value' => -1);
}
@ -546,7 +546,7 @@ if ($id > 0) {
// Date
if ($action == 'edit') {
print '<tr><td>'.$langs->trans("Date")."</td><td>";
print $form->selectDate($object->date_ech, 'ech', 0, 0, 0, 'charge', 1);
print $form->selectDate($object->date_ech, 'ech', 0, 0, 0, 'charge', 1, 1);
print "</td></tr>";
} else {
print "<tr><td>".$langs->trans("Date")."</td><td>".dol_print_date($object->date_ech, 'day')."</td></tr>";

View File

@ -4803,7 +4803,8 @@ class Form
} elseif ($input['type'] == 'date') {
$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div>';
$more .= '<div class="tagtd">';
$more .= $this->selectDate($input['value'], $input['name'], 0, 0, 0, '', 1, 0);
$addnowlink = (empty($input['datenow']) ? 0 : 1);
$more .= $this->selectDate($input['value'], $input['name'], 0, 0, 0, '', 1, $addnowlink);
$more .= '</div></div>'."\n";
$formquestion[] = array('name'=>$input['name'].'day');
$formquestion[] = array('name'=>$input['name'].'month');