You are here

function support_pm_default_project in Support Ticketing System 6

Same name and namespace in other branches
  1. 7 support_pm/support_pm.module \support_pm_default_project()

Determine default for a list of projects.

1 call to support_pm_default_project()
support_pm_form_alter in support_pm/support_pm.module

File

support_pm/support_pm.module, line 1049
Support Project Management. @author Jeremy Andrews <jeremy@tag1consulting.com> @package Support

Code

function support_pm_default_project($projects) {
  $projids = array();
  foreach ($projects as $projid => $project) {
    $projids[] = $projid;
  }
  if (empty($projids)) {
    return 0;
  }
  else {
    return db_result(db_query_range('SELECT projid FROM {support_project} WHERE projid IN (%s) AND disabled = 0 ORDER BY weight ASC', implode(',', $projids), 0, 1));
  }
}