You are here

function lingotek_admin_profile_usage in Lingotek Translation 7.4

Same name and namespace in other branches
  1. 7.7 lingotek.admin.inc \lingotek_admin_profile_usage()
  2. 7.5 lingotek.admin.inc \lingotek_admin_profile_usage()
  3. 7.6 lingotek.admin.inc \lingotek_admin_profile_usage()
2 calls to lingotek_admin_profile_usage()
lingotek_admin_profiles_form in ./lingotek.admin.inc
lingotek_admin_profile_form in ./lingotek.admin.inc
Content defaults Form

File

./lingotek.admin.inc, line 356

Code

function lingotek_admin_profile_usage($id) {
  $query = db_select('node', 'n');
  $query
    ->fields('n', array(
    'nid',
  ));
  $query
    ->leftJoin('lingotek', 'l_profile', 'n.nid = l_profile.nid  and l_profile.lingokey = \'profile\'');
  $query
    ->leftJoin('lingotek', 'l_auto_upload', 'n.nid = l_auto_upload.nid  and l_auto_upload.lingokey = \'create_lingotek_document\'');
  $query
    ->leftJoin('lingotek', 'l_status', 'n.nid = l_status.nid  and l_status.lingokey = \'node_sync_status\'');
  $query
    ->condition('l_status.lingovalue', 'TARGET', '<>');
  $or = lingotek_profile_condition('n', 'l_auto_upload', 'l_profile', $id);
  $query
    ->condition($or);
  return $query
    ->countQuery()
    ->execute()
    ->fetchField();
}