You are here

function redhen_note_delete_form_submit in RedHen CRM 7

Submit callback for redhen_note_delete_form().

1 string reference to 'redhen_note_delete_form_submit'
redhen_note_delete_form in modules/redhen_note/includes/redhen_note.forms.inc
Form callback: confirmation form for deleting an note.

File

modules/redhen_note/includes/redhen_note.forms.inc, line 110
Form definition and handling for redhen notes.

Code

function redhen_note_delete_form_submit($form, &$form_state) {
  $note = $form_state['redhen_note'];
  $wrapper = entity_metadata_wrapper('redhen_note', $note);
  $title = entity_label('redhen_note', $note);
  $entity_url = entity_uri($note->entity_type, $wrapper->entity
    ->value());

  // No status returned from delete(), assume it worked
  redhen_note_delete_multiple(array(
    $note->note_id,
  ));
  drupal_set_message(t('%title has been deleted.', array(
    '%title' => $title,
  )));
  watchdog('redhen_note', 'Deleted note %title.', array(
    '%title' => $title,
  ), WATCHDOG_NOTICE);
  $form_state['redirect'] = $entity_url['path'] . '/notes';
}