From 920e1b77b4d40c427f11b87b149eafe1fb3d24be Mon Sep 17 00:00:00 2001 From: sonikf <93765174+sonikf@users.noreply.github.com> Date: Sun, 17 Nov 2024 01:47:12 +0200 Subject: [PATCH 1/5] NEW: Add also start date fill buttons for salary clone --- htdocs/salaries/card.php | 68 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 63 insertions(+), 5 deletions(-) diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index 305d0642270..f1e55308661 100644 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -8,6 +8,7 @@ * Copyright (C) 2023 Maxime Nicolas * Copyright (C) 2023 Benjamin GREMBI * Copyright (C) 2024 MDW + * Copyright (C) 2024 Nick Fragoulis * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -758,20 +759,77 @@ if ($id > 0) { ); //$formquestion[] = array('type' => 'date', 'name' => 'clone_date_ech', 'label' => $langs->trans("Date"), 'value' => -1); - $formquestion[] = array('type' => 'date', 'name' => 'clone_date_start', 'label' => $langs->trans("DateStart"), 'value' => -1); + if (!empty($object->dateep)) { + $formquestion[] = array('type' => 'date', 'name' => 'clone_date_start', 'label' => $langs->trans("DateStart"), 'value' => ($object->dateep) + 86400); + } else { + $formquestion[] = array('type' => 'date', 'name' => 'clone_date_start', 'label' => $langs->trans("DateStart"), 'value' => -1); + } $formquestion[] = array('type' => 'date', 'name' => 'clone_date_end', 'label' => $langs->trans("DateEnd"), 'value' => -1); $formquestion[] = array('type' => 'text', 'name' => 'amount', 'label' => $langs->trans("Amount"), 'value' => price($object->amount), 'morecss' => 'width100 right'); - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneSalary', $object->ref), 'confirm_clone', $formquestion, 'yes', 1, 280); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneSalary', $object->ref), 'confirm_clone', $formquestion, 'yes', 1, 300); - //Add fill with end of month button + //Add buttons to fill start and end dates $formconfirm .= "