You are here

public function TMGMTJobItem::accepted in Translation Management Tool 7

Sets the state of the job item to 'accepted'.

File

entity/tmgmt.entity.job_item.inc, line 422

Class

TMGMTJobItem
Entity class for the tmgmt_job entity.

Code

public function accepted($message = NULL, $variables = array(), $type = 'status') {
  if (!isset($message)) {
    $uri = $this
      ->getSourceUri();
    $message = 'The translation for !source has been accepted.';
    $variables = array(
      '!source' => l($this
        ->getSourceLabel(), $uri['path']),
    );
  }
  $return = $this
    ->setState(TMGMT_JOB_ITEM_STATE_ACCEPTED, $message, $variables, $type);

  // Check if this was the last unfinished job item in this job.
  if (tmgmt_job_check_finished($this->tjid) && ($job = $this
    ->getJob())) {

    // Mark the job as finished.
    $job
      ->finished();
  }
  return $return;
}