You are here

function support_pm_update_7001 in Support Ticketing System 7

Ensure clid 0 row exists for "All Clients" in {support_project_client}.

File

support_pm/support_pm.install, line 241

Code

function support_pm_update_7001() {
  $result = db_query('SELECT p.projid FROM {support_project} p LEFT JOIN {support_project_client} c ON p.projid = c.projid WHERE c.projid IS NULL');
  foreach ($result as $project) {
    db_insert('support_project_client')
      ->fields(array(
      'projid' => $project->projid,
      'clid' => 0,
    ))
      ->execute();
  }
}