You are here

function globallink_get_tpt_sent_rows in GlobalLink Connect for Drupal 7.6

Same name and namespace in other branches
  1. 7.7 globallink.module \globallink_get_tpt_sent_rows()
  2. 7.5 globallink.module \globallink_get_tpt_sent_rows()

Retrieve languages with in progress translations.

Parameters

int $nid: The node id.

string $source: The drupal locale code.

Return value

array An array containing all drupal locale codes with in progress translations.

1 call to globallink_get_tpt_sent_rows()
globallink_menu_local_tasks_alter in ./globallink.module
Implements hook_menu_local_tasks_alter().

File

./globallink.module, line 1140
GlobalLink translation module.

Code

function globallink_get_tpt_sent_rows($nid, $source) {
  module_load_include("inc", "globallink", "globallink");
  $arr = array();
  $query = db_select('globallink_core', 'tc')
    ->fields('tc')
    ->condition('nid', $nid, '=')
    ->condition('status', array(
    'Sent for Translations',
    'Error',
    'Cancelled',
  ), 'IN')
    ->condition('source', globallink_get_locale_code($source), '=');
  $result = $query
    ->execute();
  foreach ($result as $row) {
    $arr[] = globallink_get_drupal_locale_code($row->target);
  }
  return $arr;
}