You are here

function lingotek_get_phases_by_workflow_id in Lingotek Translation 7.6

Same name and namespace in other branches
  1. 7.7 lingotek.module \lingotek_get_phases_by_workflow_id()
  2. 7.4 lingotek.module \lingotek_get_phases_by_workflow_id()
  3. 7.5 lingotek.module \lingotek_get_phases_by_workflow_id()

Get project phases by workflow ID.

Parameters

string $workflow_id: the workflow UUID

Return value

array an associative array of phases for the given workflow

4 calls to lingotek_get_phases_by_workflow_id()
lingotek_add_workflow_settings_form in ./lingotek.module
lingotek_admin_additional_translation_settings_form in ./lingotek.admin.inc
Additional translation form
lingotek_admin_profile_form in ./lingotek.admin.inc
Content defaults Form
lingotek_get_change_workflow_form in ./lingotek.module

File

./lingotek.module, line 2433

Code

function lingotek_get_phases_by_workflow_id($workflow_id) {
  $api = LingotekApi::instance();
  $workflow = $api
    ->getWorkflow($workflow_id);
  $phases = array();
  $excluded_phases = array(
    'Setup',
    'Translation Completion',
    'Project Completion',
  );
  if (isset($workflow->steps)) {
    foreach ($workflow->steps as $id => $phase_obj) {
      if (!in_array($phase_obj->name, $excluded_phases)) {
        $phases[$id] = $phase_obj->name;
      }
    }
  }
  return $phases;
}