You are here

function theme_casetracker_project_summary in Case Tracker 5

Same name and namespace in other branches
  1. 6 casetracker.module \theme_casetracker_project_summary()
  2. 7 casetracker.module \theme_casetracker_project_summary()

Theme the project summary shown at the beginning of a project's node.

Parameters

$project: The node object of the project being viewed.

1 theme call to theme_casetracker_project_summary()
casetracker_nodeapi in ./casetracker.module
Implementation of hook_nodeapi().

File

./casetracker.module, line 1077
Enables the handling of projects and their cases.

Code

function theme_casetracker_project_summary($project) {
  $rows = array();
  $rows[] = array(
    t('Project number:'),
    $project->project_number,
  );
  $rows[] = array(
    t('Opened by:'),
    theme_username($project),
  );
  $rows[] = array(
    t('Opened on:'),
    format_date($project->created, 'large'),
  );
  $rows[] = array(
    t('Last modified:'),
    format_date($project->changed, 'large'),
  );
  $querystring = _casetracker_get_og_query_string($project);
  $operations = array();
  $node_types = node_get_types('names');
  $caseTypes = _casetracker_getCaseTypes();
  foreach ($caseTypes as $type) {
    $operations[] = l(t('add !name', array(
      '!name' => $node_types[$type],
    )), 'node/add/' . $type . '/' . $project->nid, array(), $querystring);
  }
  $operations = implode(' | ', $operations);

  // ready for printing in our Operations table cell - delimited by a pipe. nonstandard.
  $rows[] = array(
    t('Operations:'),
    $operations . ' | ' . l(t('view all project cases'), 'casetracker/cases/' . $project->nid . '/all'),
  );
  $output = '<div class="project">';
  $output .= theme('table', NULL, $rows, array(
    'class' => 'summary',
  ));
  $output .= '</div>';
  return $output;
}