However, in return it just prints out this html tag for every user:
<div class="pf_info">'.PFformat::Lang('PFL_NO_TASKS').'</div>
This states that theya re no task found assigned to that user, what am I missing here..some of the users should show tasks listed......
Code: Select all
<?php
$id = (int) JRequest::GetVar('id');
if($id) {
// Load objects
$db = PFdatabase::GetInstance();
//$user = PFuser::GetInstance();
$user =& JFactory::getUser();
$config = PFconfig::GetInstance();
// Load config params
// Load tasks
$query = "SELECT t.*, u.name, p.title project_name, p.id pid, m.title ms_title FROM #__pf_tasks AS t"
. "\n LEFT JOIN jos_pf_task_users AS tu ON tu.task_id = t.id"
. "\n LEFT JOIN jos_users AS u ON u.id = tu.user_id"
. "\n LEFT JOIN jos_pf_projects AS p ON p.id = t.project"
. "\n LEFT JOIN jos_pf_milestones AS m ON m.id = t.milestone"
. "\n WHERE p.id = $id"
. "\n AND tu.user_id = $id"
. "\n GROUP BY t.id"
. "\n ORDER BY t.cdate ASC"
. "\n LIMIT $limit";
$db->setQuery($query);
//$rows = $db->loadObjectList();
echo $rows;
$rows = array();
if($user->id) {
$html = '
<table class="pf_table adminlist" width="100%" cellpadding="0" cellspacing="0">
<thead>
<tr>
<th align="center">#</th>
<th width="50%">'.PFformat::Lang('TITLE').'</th>
<th width="25%">'.PFformat::Lang('ASSIGNED_TO').'</th>
<th width="10%">'.PFformat::Lang('PRIORITY').'</th>
<th width="10%">'.PFformat::Lang('DEADLINE').'</th>
<th width="5%">'.PFformat::Lang('PROGRESS').'</th>
</tr>
</thead>
<tbody>';
$k = 0;
foreach ($rows AS $i => $row)
{
JFilterOutput::objectHTMLSafe($row);
$p_edit_s = "";
$p_edit_e = "";
$t_edit_s = "";
$t_edit_e = "";
$deadline = PFformat::Lang('NOT_SET');
if($row->edate) $deadline = PFformat::ToDate($row->edate);
if($tlink == 1) {
$t_edit_s = "<a href='".PFformat::Link("section=tasks&task=display_details&id=".$row->id)."'>";
$t_edit_e = "</a>";
}
$html .= '
<tr class="pf_row'.$k.' row'.$k.' sectiontableentry'.($k+1).'">
<td>'.($i + 1).'</td>
<td>'.$t_edit_s.$row->title.$t_edit_e.'</td>
<td>'.$row->name.'</td>
<td>'.$priority.'</td>
<td>'.$deadline.'</td>
<td>'.$row->progress.'%</td>
</tr>';
$k = 1 - $k;
}
if(!count($rows)) {
$html .= '
<tr class="pf_row0">
<td colspan="7" align="center" style="text-align:center"><div class="pf_info">'.PFformat::Lang('PFL_NO_TASKS').'</div></td>
</tr>';
}
$html .= '</tbody></table>';
echo $html;
unset($html, $rows);
}
}
?>