smarty_function_jrTracker_status_select no longer processes the classes parameter
Using Jamroom
here's the full function in case you don't want to wait for it to pass testing:
function smarty_function_jrTracker_status_select($params, $smarty)
{
if (!isset($params['item_id']) || !jrCore_checktype($params['item_id'], 'number_nz')) {
return jrCore_smarty_invalid_error('item_id');
}
if (empty($params['status'])) {
return jrCore_smarty_missing_error('status');
}
if (empty($params['type'])) {
return jrCore_smarty_missing_error('type');
}
$stt = $params['status'];
$_as = jrTracker_get_tracker_statuses();
if (!isset($_as[$stt])) {
return jrCore_smarty_invalid_error('item_id');
}
$cls = '';
if (!empty($params['class'])) {
$cls = $params['class'];
}
$iid = (int) $params['item_id'];
$out = '<select id="tracker-status-sel" class="status_section status_section_' . str_replace(' ', '_', $stt) . ' ' . $cls . '" onchange="var v=$(this).val(); jrTracker_set_status(' . $iid . ', v)">';
$out .= '<option value="' . $stt . '" selected="selected">' . $_as[$stt] . '</option>';
$out .= '<optgroup label="Change Status To:">';
foreach ($_as as $k => $v) {
if ($k == $stt) {
continue;
}
// If our tracker is not a FEATURE REQUEST turn off "complete"
if ($params['type'] != 'feature' && $k == 'completed') {
continue;
}
$out .= "\n<option value=\"{$k}\">» {$v}</option>";
}
$out .= '</optgroup></select>';
if (!empty($params['assign'])) {
/** @noinspection PhpUndefinedMethodInspection */
$smarty->assign($params['assign'], $out);
return '';
}
return $out;
}