Skip to content

Commit

Permalink
Fixed "Auto-check "done" checkboxes in Planting quick form based on d…
Browse files Browse the repository at this point in the history
…ate" farmOS#333

Added an if statement to check if the time provided by the user is in the past, and marking the checkbox as 'done' if so.
  • Loading branch information
KrithikVallem committed Apr 27, 2021
1 parent ab983d7 commit 0f98593
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/farm/farm_crop/farm_crop.farm_quick.planting.inc
Expand Up @@ -401,6 +401,10 @@ function farm_crop_planting_quick_form_submit($form, &$form_state) {
if (!empty($log_values['done'])) {
$done = TRUE;
}
// if event's timestamp is in the past, mark it as done
if (time() > $timestamp) {
$done = TRUE;
}

// If there is a location, create a movement log.
if (!empty($log_values['location'])) {
Expand Down

0 comments on commit 0f98593

Please sign in to comment.