You are here

function farm_crop_form_farm_asset_form_alter in farmOS 7

Implements hook_form_FORM_ID_alter().

File

modules/farm/farm_crop/farm_crop.module, line 33

Code

function farm_crop_form_farm_asset_form_alter(&$form, &$form_state, $form_id) {

  // Get the farm asset entity from the form.
  $asset = $form['farm_asset']['#value'];

  // If the asset is not a planting, bail.
  if (empty($asset->type) || $asset->type != 'planting') {
    return;
  }

  // If this is a new planting form, display a link to the planting quick form
  // for convenience.
  if (!empty($form['farm_asset']['#value']->is_new)) {
    drupal_set_message(t('Tip: Use the <a href="@path">Planting Quick Form</a> to quickly record a planting and create seedings and other logs associated with it in one step.', array(
      '@path' => url('farm/quick/planting'),
    )));
  }
}