diff --git a/src/Entity/JobItem.php b/src/Entity/JobItem.php index 904b387..05d06c6 100644 --- a/src/Entity/JobItem.php +++ b/src/Entity/JobItem.php @@ -463,7 +463,7 @@ class JobItem extends ContentEntityBase implements JobItemInterface { } $return = $this->setState(static::STATE_REVIEW, $message, $variables, $type); // Auto accept the translation if the translator is configured for it. - if ($this->getTranslator()->isAutoAccept()) { + if ($this->getTranslator()->isAutoAccept() && !$this->isAborted()) { $this->acceptTranslation(); } return $return; diff --git a/src/Entity/ListBuilder/JobItemListBuilder.php b/src/Entity/ListBuilder/JobItemListBuilder.php index 1503ca9..ebeb081 100644 --- a/src/Entity/ListBuilder/JobItemListBuilder.php +++ b/src/Entity/ListBuilder/JobItemListBuilder.php @@ -36,7 +36,7 @@ class JobItemListBuilder extends EntityListBuilder { // Do not display delete on active jobs, display abort. if ($entity->getJob()->isActive() && $entity->isActive() && !$entity->isAborted()) { unset($operations['delete']); - $operations['cancel'] = array( + $operations['abort'] = array( 'url' => $entity->urlInfo('abort-form')->setOption('query', array('destination' => Url::fromRoute('')->getInternalPath())), 'title' => t('Abort'), 'weight' => 10, diff --git a/src/Entity/ListBuilder/JobListBuilder.php b/src/Entity/ListBuilder/JobListBuilder.php index f77f68d..1b2cbe5 100644 --- a/src/Entity/ListBuilder/JobListBuilder.php +++ b/src/Entity/ListBuilder/JobListBuilder.php @@ -36,7 +36,7 @@ class JobListBuilder extends EntityListBuilder { ); } if ($entity->isAbortable() && $entity->access('submit')) { - $operations['cancel'] = array( + $operations['abort'] = array( 'url' => $entity->urlInfo('abort-form')->setOption('query', array('destination' => Url::fromRoute('')->getInternalPath())), 'title' => t('Abort'), 'weight' => 10, diff --git a/src/Form/JobItemAbortForm.php b/src/Form/JobItemAbortForm.php index 0722898..afbc33c 100644 --- a/src/Form/JobItemAbortForm.php +++ b/src/Form/JobItemAbortForm.php @@ -23,7 +23,7 @@ class JobItemAbortForm extends ContentEntityConfirmFormBase { } public function getDescription() { - return $this->t('This will send a request to the translator to abort the job item. After the action the job item translation process will be aborted and only remaining action will be resubmitting it.'); + return $this->t('This is only an internal decision and the translator does not know about it. After the action the job item will be aborted and the only remaining action will be deleting it.'); } /** diff --git a/src/Form/JobItemForm.php b/src/Form/JobItemForm.php index 2c7ff7e..587407f 100644 --- a/src/Form/JobItemForm.php +++ b/src/Form/JobItemForm.php @@ -149,7 +149,7 @@ class JobItemForm extends TmgmtFormBase { '#type' => 'submit', '#button_type' => 'primary', '#value' => t('Save as completed'), - '#access' => $item->isNeedsReview(), + '#access' => $item->isNeedsReview() && !$item->isAborted(), '#validate' => array('::validateForm', '::validateJobItem'), '#submit' => array('::submitForm', '::save'), );