function student_priority_get_student_academic_priority_label
Search API
6.x student_priority.module | student_priority_get_student_academic_priority_label($priority_val, $student_id = NULL) |
Returns 'normal', 'medium', or 'high' based on values.
TODO: Make those values be able to be set by configuration.
TODO: If we have have a student specified, then see if we have a special priority value for them?
3 calls to student_priority_get_student_academic_priority_label()
- student_priority_display_priority_calculations_page in modules/
student_priority/ student_priority.module - Displays the calculations used to get the priority values. Can be displayed in either the dialog or stand-alone.
- student_profile_display_student_profile_page in modules/
student_profile/ student_profile.module - student_search_render_advisees in modules/
student_search/ student_search.module
File
- modules/
student_priority/ student_priority.module, line 200
Code
function student_priority_get_student_academic_priority_label($priority_val, $student_id = NULL) {
$academic_priority_label = array(
"high" => "High",
"medium" => "Medium",
"normal" => "Normal",
);
//if ($priority_val == -1) {
// $priority_val = @floatval($student_node->field_priority_value['und'][0]['value']);
//}
$machine = 'normal';
if ($priority_val >= 31 && $priority_val <= 70) {
$machine = "medium";
}
if ($priority_val > 70) {
$machine = "high";
}
$rtn = array();
$rtn ['val'] = $priority_val;
$rtn ['machine'] = $machine;
$rtn ['label'] = $academic_priority_label [$machine];
return $rtn;
}