';
} elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_TEXT) {
//text fields might be really wide, so need a row to themselves.
if (($col_count == 1) && ($efarr[$i]['attribute1'] > 30)) {
$colspan=2;
$return .= '
';
} else {
$colspan=1;
}
$return .= '
'.$name.'
';
} elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_TEXTAREA) {
//text areas might be really wide, so need a row to themselves.
if (($col_count == 1) && ($efarr[$i]['attribute2'] > 30)) {
$colspan=2;
$return .= '
';
} elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_RELATION) {
//text fields might be really wide, so need a row to themselves.
if (($col_count == 1) && ($efarr[$i]['attribute1'] > 30)) {
$colspan=2;
$return .= '
';
} else {
$colspan=1;
}
$return .= '
'.$name.'
';
}
$col_count++;
//we've done two columns - if there are more to do, start a new row
if (($col_count == 2) && ($k != $count-1)) {
$col_count = 0;
$return .= '
';
}
}
if ($col_count == 1) {
$return .= '
';
}
$return .= '
';
return $return;
}
/**
* renderSelect - this function builds pop up
* box with choices.
*
* @param int The ID of this field.
* @param string The item that should be checked
* @param string Whether to show the '100 row'
* @param string What to call the '100 row'
* @return box and choices
*/
function renderSelect ($extra_field_id,$checked='xzxz',$show_100=false,$text_100='none',$show_any=false,$text_any='Any', $allowed=false) {
if ($text_100 == 'none'){
$text_100=_('None');
}
$arr =& $this->getExtraFieldElements($extra_field_id);
for ($i=0; $igetExtraFieldElements($extra_field_id);
for ($i=0; $igetExtraFieldElements($extra_field_id);
if ($show_100) {
$return .= '
'.$text_100.' ';
}
for ($i=0; $i '.$arr[$i]['element_name'].' ';
}
return $return;
}
/**
* renderMultiSelectBox - this function builds checkboxes.
*
* @param int The ID of this field.
* @param array The items that should be checked
* @param string Whether to show the '100 row'
* @param string What to call the '100 row'
* @return radio multiselectbox
*/
function renderMultiSelectBox ($extra_field_id,$checked=array(),$show_100=false,$text_100='none') {
$arr =& $this->getExtraFieldElements($extra_field_id);
if (!$checked) {
$checked=array();
}
if (!is_array($checked)) {
$checked = explode(',',$checked);
}
$keys=array();
$vals=array();
$arr =& $this->getExtraFieldElements($extra_field_id);
for ($i=0; $i';
}
/**
* renderRelationField - this function builds a relation field.
*
* @param int The ID of this field.
* @param string The data for this field.
* @return text area and data.
*/
function renderRelationField ($extra_field_id,$contents,$size,$maxlength) {
$arr =& $this->getExtraFieldElements($extra_field_id);
for ($i=0; $irenderTextField ($extra_field_id,$contents,$size,$maxlength);
$edit_tips = ' '._('Tip: Enter a space-separated list of artifact ids ([#NNN] also accepted)').'';
return '
'.$edit_contents.$edit_tips.'
'.$html_contents.'
';
}
/**
* renderTextArea - this function builds a text area.
*
* @param int The ID of this field.
* @param string The data for this field.
* @return text area and data.
*/
function renderTextArea ($extra_field_id,$contents,$rows,$cols) {
return '
';
}
function technicianBox ($name='assigned_to[]',$checked='xzxz',$show_100=true,$text_100='none',$extra_id='-1',$extra_name='',$multiple=false) {
if ($text_100=='none'){
$text_100=_('Nobody');
}
$result = $this->getTechnicians();
// this was a bad hack to allow you to mass-update to unassigned, which is ID=100, which
// conflicted with the "No Change" ID of 100.
$ids =& util_result_column_to_array($result,0);
$names =& util_result_column_to_array($result,1);
if ($extra_id != '-1') {
$ids[]=$extra_id;
$names[]=$extra_name;
}
if ($multiple) {
if (!is_array($checked)) {
$checked = explode(',',$checked);
}
$size = min( count($ids)+1, 15);
return html_build_multiple_select_box_from_arrays ($ids,$names,$name,$checked,$size,$show_100,$text_100);
} else {
return html_build_select_box_from_arrays ($ids,$names,$name,$checked,$show_100,$text_100);
}
}
function cannedResponseBox ($name='canned_response',$checked='xzxz') {
return html_build_select_box ($this->getCannedResponses(),$name,$checked);
}
/**
* statusBox - show the statuses - automatically shows the "custom statuses" if they exist
*
*
*/
function statusBox ($name='status_id',$checked='xzxz',$show_100=false,$text_100='none') {
if ($text_100=='none'){
$text_100=_('None');
}
return html_build_select_box($this->getStatuses(),$name,$checked,$show_100,$text_100);
}
}
// Local Variables:
// mode: php
// c-file-style: "bsd"
// End:
?>