You are here

function support_pm_load_projects in Support Ticketing System 7

Same name and namespace in other branches
  1. 6 support_pm/support_pm.module \support_pm_load_projects()

Load projects assigned to a given client.

3 calls to support_pm_load_projects()
support_pm_form_alter in support_pm/support_pm.module
support_pm_invoice_ui_form in support_pm/support_pm.module
Provide form for selecting projects.
support_pm_invoice_ui_form_submit in support_pm/support_pm.module
Add url filter when projects are selected.

File

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

Code

function support_pm_load_projects($clid) {
  $projects = array();
  $result = db_query('SELECT sp.projid, sp.project FROM {support_project} sp INNER JOIN {support_project_client} spc ON sp.projid = spc.projid WHERE (spc.clid = :client OR spc.clid = 0) AND disabled = 0', array(
    ':client' => $clid,
  ));
  foreach ($result as $project) {
    $projects[$project->projid] = $project->project;
  }
  return $projects;
}