You are here

function farm_movement_asset_move_action in farmOS 7

Action function for farm_movement_asset_move.

Creates a new movement activity log for the specified assets.

Parameters

array $assets: An array of asset entities to move.

array $context: Array with parameters for this action.

File

modules/farm/farm_movement/farm_movement.location.inc, line 885
Code for managing the location of assets with movement logs.

Code

function farm_movement_asset_move_action(array $assets, $context = array()) {

  // If we're missing assets, areas, or a timestamp, bail.
  if (empty($assets) || empty($context['areas']) || empty($context['timestamp'])) {
    drupal_set_message(t('Could not perform movement because required information was missing.'), 'error');
    return;
  }

  // Create a movement activity log.
  farm_movement_create($assets, $context['areas'], $context['timestamp'], 'farm_activity', $context['done']);
}