*
* Copyright 1999-2001 (c) VA Linux Systems
* Copyright 2010 Roland Mas
+ * Copyright 2010 Alain Peyrat, Alcatel-Lucent
*
*/
require_once $gfcommon.'tracker/ArtifactFactory.class.php';
$offset = getStringFromRequest('offset');
$_sort_col = getStringFromRequest('_sort_col',$_sort_col);
$_sort_ord = getStringFromRequest('_sort_ord',$_sort_ord);
-$max_rows = getStringFromRequest('max_rows');
+$max_rows = getIntFromRequest('max_rows', 25);
$set = getStringFromRequest('set');
$_assigned_to = getIntFromRequest('_assigned_to');
$_status = getIntFromRequest('_status');
//build page title to make bookmarking easier
//if a user was selected, add the user_name to the title
//same for status
-$ath->header(array('atid'=>$ath->getID()));
+$ath->header(array('atid'=>$ath->getID(), 'title'=>$ath->getName()));
/**
*
if (db_numrows($res)>0) {
echo '<form action="'. getStringFromServer('PHP_SELF') .'" method="get">';
- echo '<input type="hidden" name="group_id" value="'.$group_id.'" />';
- echo '<input type="hidden" name="atid" value="'.$ath->getID().'" />';
- echo '<input type="hidden" name="power_query" value="1" />';
echo ' <table width="100%" cellspacing="0">
<tr>
<td>
';
+ echo '<input type="hidden" name="group_id" value="'.$group_id.'" />';
+ echo '<input type="hidden" name="atid" value="'.$ath->getID().'" />';
+ echo '<input type="hidden" name="power_query" value="1" />';
$optgroup['key'] = 'type';
$optgroup['values'][0] = 'Private queries';
$optgroup['values'][1] = 'Project queries';
</div>
<div class="tabbertab'.($af->query_type == 'custom' ? ' tabbertabdefault' : '').'" title="'._('Simple Filtering and Sorting').'">
<form action="'. getStringFromServer('PHP_SELF') .'?group_id='.$group_id.'&atid='.$ath->getID().'" method="post">
- <input type="hidden" name="query_id" value="-1" />
- <input type="hidden" name="set" value="custom" />
<table width="100%" cellspacing="0">
<tr>
<td>
+ <input type="hidden" name="query_id" value="-1" />
+ <input type="hidden" name="set" value="custom" />
'._('Assignee').': '. $tech_box .'
</td>
<td align="center">
</td>
<td align="right">';
+// Compute the list of fields which can be sorted.
+// Currently, only text & integer are taken (for simplicity only).
+$efarr = $ath->getExtraFields(ARTIFACT_EXTRAFIELDTYPE_TEXT.",".ARTIFACT_EXTRAFIELDTYPE_INTEGER);
+$keys=array_keys($efarr);
+for ($k=0; $k<count($keys); $k++) {
+ $i=$keys[$k];
+ $order_name_arr[] = $efarr[$i]['field_name'];
+ $order_arr[] = $efarr[$i]['extra_field_id'];
+}
+
echo _('Order by').
': <a href="javascript:help_window(\'/help/tracker.php?helpname=sort_by\')">' .
'<strong>(?)</strong></a>'.
foreach ($browse_fields as $f) {
$title=$f;
if (intval($f) > 0) {
- $title = $ath->getExtraFieldName($f);
+ $title = $ath->getExtraFieldName($f);
} else {
if ($f == 'id')
$title=_('ID');
$title=_('Assigned to');
if ($f == 'submitted_by')
$title=_('Submitted by');
+ if ($f == 'related_tasks')
+ $title=_('Related tasks');
}
$title_arr[] = $title;
}
date(_('Y-m-d H:i'),$art_arr[$i]->getCloseDate()) :' ') .'</td>';
} else if ($f == 'details') {
echo '<td>'. $art_arr[$i]->getDetails() .'</td>';
+ } else if ($f == 'related_tasks') {
+ echo '<td>';
+ $tasks_res = $art_arr[$i]->getRelatedTasks();
+ $s ='';
+ while ($rest = db_fetch_array($tasks_res)) {
+ $link = '/pm/task.php?func=detailtask&project_task_id='.$rest['project_task_id'].
+ '&group_id='.$group_id.'&group_project_id='.$rest['group_project_id'];
+ $title = '[T'.$rest['project_task_id'].']';
+ if ($rest['status_id'] == 2) {
+ $title = '<strike>'.$title.'</strike>';
+ }
+ print $s.'<a href="'.$link.'" title="'.$rest['summary'].'">'.$title.'</a>';
+ $s = ' ';
+ }
+ echo '</td>';
} else if (intval($f) > 0) {
// Now display extra-fields (fields are numbers).
$value = $extra_data[$f]['value'];
if ($extra_data[$f]['type'] == 9) {
$value = preg_replace('/\b(\d+)\b/e', "_artifactid2url('\\1')", $value);
+ } else if ($extra_data[$f]['type'] == 7) {
+ if ($art_arr[$i]->getStatusID() == 2) {
+ $value = '<strike>'.$value.'</strike>';
+ }
+
}
echo '<td>' . $value .'</td>';
} else {
if (in_array('priority', $browse_fields)) {
show_priority_colors_key();
-
}
} else {
-
- echo '
- <h1>'._('No items found').'</h1>';
+ echo '<div class="warning_msg">'._('No items found').'</div>';
echo db_error();
- //echo "<!-- $sql -->";
-
}
$ath->footer(array());