You are here

public function LingotekDocument::hasPhasesToComplete in Lingotek Translation 7.6

Same name and namespace in other branches
  1. 7.7 lib/Drupal/lingotek/LingotekDocument.php \LingotekDocument::hasPhasesToComplete()
  2. 7.2 lib/Drupal/lingotek/LingotekDocument.php \LingotekDocument::hasPhasesToComplete()
  3. 7.3 lib/Drupal/lingotek/LingotekDocument.php \LingotekDocument::hasPhasesToComplete()
  4. 7.4 lib/Drupal/lingotek/LingotekDocument.php \LingotekDocument::hasPhasesToComplete()
  5. 7.5 lib/Drupal/lingotek/LingotekDocument.php \LingotekDocument::hasPhasesToComplete()

Determines whether or not the document has Translation Targets in a complete-eligible phase.

Return value

bool TRUE if complete-eligible phases are present. FALSE otherwise.

File

lib/Drupal/lingotek/LingotekDocument.php, line 103
Defines LingotekDocument.

Class

LingotekDocument
A class representing a Lingotek Document

Code

public function hasPhasesToComplete() {
  $result = FALSE;
  if (class_exists('LingotekPhase')) {
    $progress = $this
      ->getProgress();
    if (is_object($progress)) {
      foreach ($progress->translationTargets as $target) {
        $current_phase = $this
          ->currentPhase($target->id);
        if (is_object($current_phase) && $current_phase
          ->canBeMarkedComplete()) {
          $result = TRUE;
          break;
        }
      }
    }
  }
  return $result;
}