";
$html .= '';
if(!empty($object->id))
{
$html .= $object->id . html::hidden("id[$row]", $object->id);
}
else
{
$sub = " {$this->lang->port->new}";
if($model == 'task') $sub = (strpos($object->name, '>') === 0) ? " {$this->lang->task->children}" : $sub;
$html .= $addID++ . $sub;
}
$html .= " | ";
foreach($fields as $field => $value)
{
$control = $value['control'];
$values = $value['values'];
$name = "{$field}[$row]";
$selected = isset($object->$field) ? $object->$field : '';
if($model)
{
if($control == 'hidden' and isset($this->session->{$model.'PortParams'}[$field. 'ID'])) $selected = $this->session->{$model . 'PortParams'}[$field. 'ID'];
}
$options = array();
if($control == 'select')
{
if(!empty($values[$selected])) $options = array($selected => $values[$selected]);
if(empty($options) and is_array($values)) $options = array_slice($values, 0, 1);
}
if($control == 'select') $html .= '' . html::select("$name", $options, $selected, "class='form-control picker-select nopicker' data-field='{$field}' data-index='{$row}'") . ' | ';
elseif($control == 'multiple') $html .= '' . html::select($name . "[]", $values, $selected, "multiple class='form-control picker-select nopicker' data-field='{$field}' data-index='{$row}'") . ' | ';
elseif($control == 'date') $html .= '' . html::input("$name", $selected, "class='form-control form-date' autocomplete='off'") . ' | ';
elseif($control == 'datetime') $html .= '' . html::input("$name", $selected, "class='form-control form-datetime' autocomplete='off'") . ' | ';
elseif($control == 'hidden') $html .= html::hidden("$name", $selected);
elseif($control == 'textarea') $html .= '' . html::textarea("$name", $selected, "class='form-control' cols='50' rows='1'") . ' | ';
elseif($field == 'stepDesc' or $field == 'stepExpect')
{
$stepDesc = $this->process4Testcase($field, $tmpList, $row);
if($stepDesc) $html .= '' . $stepDesc . ' | ';
}
elseif($field == 'estimate')
{
$html .= '';
if(!empty($object->estimate) and is_array($object->estimate))
{
$html .= "";
foreach($object->estimate as $account => $estimate)
{
$html .= '';
$html .= '' . html::select("team[$row][]", $members, $account, "class='form-control chosen'") . ' | ';
$html .= '' . html::input("estimate[$row][]", $estimate, "class='form-control' autocomplete='off'") . ' | ';
$html .= ' ';
}
$html .= " ";
}
else
{
$html .= html::input("estimate[$row]", !empty($object->estimate) ? $object->estimate : '', "class='form-control'");
}
$html .= ' | ';
}
else $html .= '' . html::input("$name", $selected, "class='form-control autocomplete='off'") . ' | ';
}
if(!empty($appendFields))
{
$this->loadModel('flow');
foreach($appendFields as $field)
{
if(!$field->show) continue;
$value = $field->defaultValue ? $field->defaultValue : zget($object, $field->field, '');
$html .='' . $this->flow->buildControl($field, $value, "$field->field[$key]", true) . ' | ';
}
}
$html .= '
' . "\n";
}
return $html;
}
/**
* Process stepExpect and stepDesc for testcase .
*
* @param int $field
* @param int $datas
* @param int $key
* @access public
* @return void
*/
public function process4Testcase($field, $datas, $key = 0)
{
$stepData = $this->testcase->processDatas($datas);
$html = '';
if($field == 'stepExpect') return $html;
if(isset($stepData[$key]['desc']))
{
$html = "