Add a school principal field.

This commit is contained in:
dave 2010-04-12 00:07:33 +00:00
parent cbbb0ebca0
commit 536fec616f

View File

@ -70,6 +70,15 @@ function reports_students_award_selfnom_5(&$report, $field, $text)
{
return reports_students_award_selfnom_num(&$report, $field, $text, 4);
}
function reports_students_school_principal(&$report, $field, $text)
{
$year = $report['year'];
if($text > 0) { /* text is the uid */
$u = user_load_by_uid_year($text, $year);
return $u['name'];
}
return '';
}
$report_students_fields = array(
@ -413,6 +422,13 @@ $report_students_fields = array(
'width' => 0.75,
'table' => 'schools.postalcode' ),
'school_principal' => array(
'name' => 'School -- Principal',
'header' => 'Principal',
'width' => 1.25,
'table' => 'schools.principal_uid',
'exec_function' => 'reports_students_school_principal'),
'school_board' => array(
'name' => 'School -- Board ID',
'header' => 'Board',