You are here

function entity_legal_document_version_form_submit in Entity Legal 7

Same name and namespace in other branches
  1. 7.2 entity_legal.admin.inc \entity_legal_document_version_form_submit()

Form submit handler for saving a legal document revision.

1 string reference to 'entity_legal_document_version_form_submit'
entity_legal_document_version_form in ./entity_legal.admin.inc
Generates the profile type editing form.

File

./entity_legal.admin.inc, line 324
Administration hooks and helpers for entity_legal module.

Code

function entity_legal_document_version_form_submit(&$form, &$form_state) {
  $version_entity = entity_ui_form_submit_build_entity($form, $form_state);
  $version_entity->updated = time();
  $version_entity
    ->save();
  $entity_legal_document = entity_load_single(ENTITY_LEGAL_DOCUMENT_ENTITY_NAME, $version_entity->document_name);
  if (!$entity_legal_document
    ->getPublishedVersion()) {
    $entity_legal_document
      ->setPublishedVersion($version_entity);
    $entity_legal_document
      ->save();
  }
  $form_state['redirect'] = 'admin/structure/legal/manage/' . $version_entity->document_name;
}