mirror of
https://github.com/farmOS/farmOS.git
synced 2024-02-23 11:37:38 +01:00
Get the assets current location relative to the movement time.
This commit is contained in:
parent
241781b13a
commit
25ecd4faf1
|
@ -222,7 +222,8 @@ function farm_livestock_move_form($form, &$form_state) {
|
||||||
// Load current location geometry of all assets.
|
// Load current location geometry of all assets.
|
||||||
$geoms = array();
|
$geoms = array();
|
||||||
foreach ($assets as $asset) {
|
foreach ($assets as $asset) {
|
||||||
$geoms[] = farm_movement_asset_geometry($asset);
|
$timestamp = strtotime($form_state['values']['move']['date'] ?: $defaults['date']);
|
||||||
|
$geoms[] = farm_movement_asset_geometry($asset, $timestamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Combine geometries.
|
// Combine geometries.
|
||||||
|
@ -628,7 +629,7 @@ function farm_livestock_move_form_submit($form, &$form_state) {
|
||||||
// Load current locations of all assets.
|
// Load current locations of all assets.
|
||||||
$previous_areas = array();
|
$previous_areas = array();
|
||||||
foreach ($assets as $asset) {
|
foreach ($assets as $asset) {
|
||||||
$previous_areas = array_merge($previous_areas, farm_movement_asset_location($asset));
|
$previous_areas = array_merge($previous_areas, farm_movement_asset_location($asset, $timestamp));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove any duplicate areas.
|
// Remove any duplicate areas.
|
||||||
|
@ -646,7 +647,7 @@ function farm_livestock_move_form_submit($form, &$form_state) {
|
||||||
// Load current location geometry of all assets.
|
// Load current location geometry of all assets.
|
||||||
$geoms = array();
|
$geoms = array();
|
||||||
foreach ($assets as $asset) {
|
foreach ($assets as $asset) {
|
||||||
$geoms[] = farm_movement_asset_geometry($asset);
|
$geoms[] = farm_movement_asset_geometry($asset, $timestamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Combine geometries.
|
// Combine geometries.
|
||||||
|
|
Loading…
Reference in a new issue