$labels[] = _('Export CSV');
$links[] = '/tracker/?func=csv&group_id='.$group_id.'&atid='. $this->getID();
$attr[] = array('title' => _('Download data from this tracker as csv file.'), 'class' => 'tabtitle');
- if ($this->allowsAnon() || session_loggedin()) {
+ if (forge_check_perm ('tracker',$this->getID(),'submit')) {
$labels[] = _('Submit New');
$links[] = '/tracker/?func=add&group_id='.$group_id.'&atid='. $this->getID();
$attr[] = array('title' => _('Add a new issue.'), 'class' => 'tabtitle');
}
function adminFooter($params) {
- echo $this->footer($params);
+ $this->footer($params);
}
function renderSubmitInstructions() {
return str_replace("\n","<br />", $msg);
}
- function renderExtraFields($selected=array(),$show_100=false,$text_100='none',$show_any=false,$text_any='Any',$types=array(),$status_show_100=false,$mode='') {
+ /**
+ * @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);
}
$str = $this->renderTextArea($efarr[$i]['extra_field_id'],$selected[$efarr[$i]['extra_field_id']],$efarr[$i]['attribute1'],$efarr[$i]['attribute2']);
if ($mode == 'QUERY') {
- $post_name = ' <i>'._('(%% for wildcards)').'</i> ';
+ $post_name = ' <i>'._('(%% for wildcards)').'</i>';
}
} elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_MULTISELECT) {
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())) {
+ if (forge_check_perm('tracker_admin', $ah->ArtifactType->Group->getID())) {
$is_admin=true;
} else {
$is_admin=false;
if ($taskcount > 0) {
echo '<tr><td colspan="2">';
- echo '<b>'._("Related Tasks").':</b>'.'<br/>';
+ echo '<b>'._("Related Tasks")._(':').'</b><br/>';
$title_arr = array();
$title_arr[] = _('Task Id and Summary');
+ $title_arr[] = _('Progress');
$title_arr[] = _('Start Date');
$title_arr[] = _('End Date');
$title_arr[] = _('Status');
$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><div class="percentbar" style="width: 100px;">
+ <div style="width:'.round($taskinfo['percent_complete']).'px;"></div></div></td>
<td>'.$startdate.'</td>
<td>'.$enddate.'</td>
<td>'.$status.' ('.$taskinfo['percent_complete'].'%)</td>'.
echo "\n<hr /><p style=\"text-align:right;\">";
printf(_('Average completion rate: %d%%'), (int)($totalPercentage/$taskcount));
- echo "</p>\n"; echo '</td></tr>';
+ echo "</p>\n";
+ echo '</td></tr>';
}
}
}
/**
- * 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:
-
-?>