public function saveDraft(array $form, FormStateInterface $form_state) {
    /** @var \Drupal\eform\Entity\EFormSubmission $entity */
    $entity = $this->entity;

    $entity->setDraft(EFORM_DRAFT);
    return parent::save($form, $form_state);
  }
  public function save(array $form, FormStateInterface $form_state) {
    /** @var FillPdfFormInterface $entity */
    $entity = $this->entity;

    $form_state->setRedirect('entity.fillpdf_form.edit_form', [
      'fillpdf_form' => $this->entity->fillpdf_form->target_id,
    ]);

    return parent::save($form, $form_state);
  }
Пример #3
0
 /**
  * {@inheritdoc}
  */
 public function save(array $form, FormStateInterface $form_state)
 {
     $entity = $this->entity;
     $status = parent::save($form, $form_state);
     switch ($status) {
         case SAVED_NEW:
             drupal_set_message($this->t('Created the %label Component.', ['%label' => $entity->label()]));
             break;
         default:
             drupal_set_message($this->t('Saved the %label Component.', ['%label' => $entity->label()]));
     }
     $form_state->setRedirect('entity.component.canonical', ['component' => $entity->id()]);
 }
Пример #4
0
 /**
  * {@inheritdoc}
  */
 public function save(array $form, FormStateInterface $form_state)
 {
     parent::save($form, $form_state);
     /** @var LocalTaskItem $task_item */
     $task_item = $this->entity;
     $form_state->cleanValues();
     foreach ($form_state->getValues() as $key => $value) {
         if (is_array($value) && isset($value['translation'])) {
             // Update the translation, this will only update the translation in case
             // it has changed. We have two different cases, the first is for nested
             // texts.
             if (is_array($value['translation'])) {
                 $update['#translation']['#text'] = $value['translation']['value'];
             } else {
                 $update['#translation']['#text'] = $value['translation'];
             }
             $task_item->updateData($key, $update);
         }
     }
     $task_item->save();
     if ($form_state->getTriggeringElement()['#value'] == $form['actions']['save']['#value']) {
         drupal_set_message(t('The translation for <a href=:task_item>@task_item_title</a> has been saved.', [':task_item' => $task_item->urlInfo()->toString(), '@task_item_title' => $task_item->label()]));
     }
     $task = $task_item->getTask();
     $uri = $task->urlInfo();
     $form_state->setRedirect($uri->getRouteName(), $uri->getRouteParameters());
 }
 /**
  * {@inheritDoc}
  */
 public function save(array $form, FormStateInterface $form_state)
 {
     parent::save($form, $form_state);
     // Redirect to stored entry.
     $form_state->setRedirect('entity.mollom_test_post.edit_form', array('mollom_test_post' => $this->entity->id()));
 }