}
function adminFooter($params) {
- echo $this->footer($params);
+ $this->footer($params);
}
function renderSubmitInstructions() {
return str_replace("\n","<br />", $msg);
}
+ /**
+ * @param array $selected
+ * @param bool $show_100
+ * @param string $text_100
+ * @param bool $show_any
+ * @param string $text_any
+ * @param array $types
+ * @param bool $status_show_100
+ * @param string $mode
+ */
function renderExtraFields($selected=array(),$show_100=false,$text_100='none',$show_any=false,$text_any='Any',$types=array(),$status_show_100=false,$mode='') {
$efarr = $this->getExtraFields($types);
//each two columns, we'll reset this and start a new row
}
}
- // 'DISPLAY' mode is for renderding in 'read-only' mode (for detail view).
+ // 'DISPLAY' mode is for rendering in 'read-only' mode (for detail view).
if ($mode === 'DISPLAY') {
$keys=array_keys($efarr);
for ($k=0; $k<count($keys); $k++) {
}
$value = join('<br />', $new);
}
- } else if ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_TEXT ||
+ } elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_TEXT ||
$efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_TEXTAREA) {
$value = preg_replace('/((http|https|ftp):\/\/\S+)/',
"<a href=\"\\1\" target=\"_blank\">\\1</a>", $value);
- } else if ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_RELATION) {
+ } elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_RELATION) {
// Convert artifact id to links.
$value = preg_replace('/\b(\d+)\b/e', "_artifactid2url('\\1')", $value);
}
function renderRelatedTasks($group, $ah) {
if (!$group->usesPM()) {
- return '';
+ return;
}
$taskcount = db_numrows($ah->getRelatedTasks());
+ db_result_reset($ah->getRelatedTasks());
if (forge_check_perm ('tracker_admin', $ah->ArtifactType->Group->getID())) {
- $is_admin=false;
- } else {
$is_admin=true;
+ } else {
+ $is_admin=false;
}
$totalPercentage = 0;
echo '<tr><td colspan="2">';
echo '<b>'._("Related Tasks").':</b>'.'<br/>';
$title_arr = array();
- $title_arr[] = _('Task Id');
- $title_arr[] = _('Task Summary');
+ $title_arr[] = _('Task Id and Summary');
$title_arr[] = _('Start Date');
$title_arr[] = _('End Date');
$title_arr[] = _('Status');
(($is_admin) ? $title_arr[]=_('Remove Relation') : '');
echo $GLOBALS['HTML']->listTableTop($title_arr);
- echo '<table cellspacing="0">';
for ($i = 0; $i < $taskcount; $i++) {
$taskinfo = db_fetch_array($ah->relatedtasks, $i);
$totalPercentage += $taskinfo['percent_complete'];
$enddate = date(_('Y-m-d H:i'), $taskinfo['end_date']);
$status = $taskinfo['status_name'];
echo '<tr>
- <td><a href="/pm/task.php?func=detailtask&project_task_id='.$taskid.
- '&group_id='.$groupid.'&group_project_id='.$projectid.'">[T'.$taskid.'] '.$summary.'</a></td>
+ <td><a href="/pm/task.php?func=detailtask&project_task_id='.$taskid.'&group_id='.$groupid.'&group_project_id='.$projectid.'">[T'.$taskid.'] '.$summary.'</a></td>
<td>'.$startdate.'</td>
<td>'.$enddate.'</td>
<td>'.$status.' ('.$taskinfo['percent_complete'].'%)</td>'.
}
/**
- * getRenderHTML
+ * getRenderHTML
*
- * @return string HTML template.
+ * @param array $types
+ * @param string $mode
+ * @return string HTML template.
*/
function getRenderHTML($types=array(), $mode='') {
// Use template only for the browse (not for query or mass update)
}
/**
- * generateRenderHTML
+ * generateRenderHTML
*
- * @return string HTML template.
+ * @param array $types
+ * @param string $mode Display mode (QUERY OR DISPLAY)
+ * @return string HTML template.
*/
function generateRenderHTML($types=array(), $mode) {
$efarr = $this->getExtraFields($types);
}
/**
- * renderSelect - this function builds pop up
- * box with choices.
+ * 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
+ * @param int $extra_field_id The ID of this field.
+ * @param string $checked The item that should be checked
+ * @param bool|string $show_100 Whether to show the '100 row'
+ * @param string $text_100 What to call the '100 row'
+ * @param bool $show_any
+ * @param string $text_any
+ * @param bool $allowed
+ * @return string HTML code for the 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'){
}
/**
- * renderRadio - this function builds radio buttons.
+ * renderRadio - this function builds radio buttons.
*
- * @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 radio buttons
+ * @param int $extra_field_id The $int ID of this field.
+ * @param string $checked The $string item that should be checked
+ * @param bool $show_100 Whether $string to show the '100 row'
+ * @param string $text_100 What $string to call the '100 row'
+ * @param bool $show_any
+ * @param string $text_any
+ * @return string HTML code using radio buttons
*/
function renderRadio ($extra_field_id,$checked='xzxz',$show_100=false,$text_100='none',$show_any=false,$text_any='Any') {
$arr = $this->getExtraFieldElements($extra_field_id);
}
/**
- * renderCheckbox - this function builds checkboxes.
+ * renderCheckbox - 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 buttons
+ * @param int $extra_field_id The ID of this field.
+ * @param array $checked The items that should be checked
+ * @param bool|string $show_100 Whether to show the '100 row'
+ * @param string $text_100 What to call the '100 row'
+ * @return string radio buttons
*/
function renderCheckbox ($extra_field_id,$checked=array(),$show_100=false,$text_100='none') {
if ($text_100 == 'none'){
}
/**
- * renderMultiSelectBox - this function builds checkboxes.
+ * 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
+ * @param int $extra_field_id The ID of this field.
+ * @param array $checked The items that should be checked
+ * @param bool|string $show_100 Whether to show the '100 row'
+ * @param string $text_100 What to call the '100 row'
+ * @return string 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();
}
}
/**
- * renderTextField - this function builds a text field.
+ * renderTextField - this function builds a text field.
*
- * @param int The ID of this field.
- * @param string The data for this field.
- * @return text area and data.
+ * @param int $extra_field_id The ID of this field.
+ * @param string $contents The data for this field.
+ * @param string $size
+ * @param string $maxlength
+ * @return string HTML code of corresponding input tag.
*/
- function renderTextField ($extra_field_id,$contents,$size,$maxlength) {
+ function renderTextField ($extra_field_id, $contents, $size, $maxlength) {
return '
<input type="text" name="extra_fields['.$extra_field_id.']" value="'.$contents.'" size="'.$size.'" maxlength="'.$maxlength.'"/>';
}
/**
- * renderRelationField - this function builds a relation field.
+ * 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.
+ * @param int $extra_field_id The ID of this field.
+ * @param string $contents The data for this field.
+ * @param string $size
+ * @param string $maxlength
+ * @return string text area and data.
*/
function renderRelationField ($extra_field_id,$contents,$size,$maxlength) {
$arr = $this->getExtraFieldElements($extra_field_id);
}
/**
- * renderTextArea - this function builds a text area.
+ * 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.
+ * @param int $extra_field_id The ID of this field.
+ * @param string $contents The data for this field.
+ * @param string $rows
+ * @param string $cols
+ * @return string text area and data.
*/
function renderTextArea ($extra_field_id,$contents,$rows,$cols) {
return '
// mode: php
// c-file-style: "bsd"
// End:
-
-?>