1.8
* @date 02/12/2007
*
* Prints prints user's profile and stats
*/
if (!defined('MOODLE_INTERNAL')) {
die('Direct access to this script is forbidden.'); /// It must be included from view.php in mod/tracker
}
echo "
";
echo $OUTPUT->heading(get_string('me', 'tracker'));
echo $OUTPUT->box_start('center', '90%', '', '', 'generalbox', 'bugreport');
$table = new html_table();
$table->head = array('', '');
$table->width = '90%';
$table->size = array('30%', '70%');
$table->align = array('right', 'left');
$row = array(get_string('name'), fullname($USER));
$str = '';
$str .= ($reporter = has_capability('mod/tracker:report', $context)) ? ''.get_string('icanreport', 'tracker').'' : ''.get_string('icannotreport', 'tracker').'' ;
$str .= '
';
$str .= ($developer = has_capability('mod/tracker:develop', $context)) ? ''.get_string('iamadeveloper', 'tracker').'' : ''.get_string('iamnotadeveloper', 'tracker').'' ;
$str .= '
';
$str .= ($resolver = has_capability('mod/tracker:resolve', $context)) ? ''.get_string('icanresolve', 'tracker').'' : ''.get_string('icannotresolve', 'tracker').'' ;
$str .= '
';
$str .= ($manager = has_capability('mod/tracker:manage', $context)) ? ''.get_string('icanmanage', 'tracker').'' : ''.get_string('icannotmanage', 'tracker').'' ;
$row = array(get_string('tracker-levelaccess', 'tracker'), $str);
$table->data[] = $row;
echo html_writer::table($table);
if ($manager) {
echo $OUTPUT->heading(get_string('manager', 'tracker'));
$table = new html_table();
$table->head = array('', '');
$table->width = '90%';
$table->size = array('30%', '70%');
$table->align = array('right', 'left');
$str = '';
$assignees = tracker_getassignees($USER->id);
if ($assignees){
foreach($assignees as $assignee){
tracker_print_user($assignee);
$str .= ' ('.$assignee->issues.')
';
}
} else {
$str .= get_string('noassignees', 'tracker');
}
$table->data[] = array(get_string('myassignees', 'tracker'), $str);
$table->data[] = array(get_string('tracker-levelaccess', 'tracker'), $str);
echo html_writer::table($table);
}
if ($resolver) {
echo $OUTPUT->heading(get_string('resolver', 'tracker'));
$table = new html_table();
$table->head = array('', '');
$table->width = '90%';
$table->size = array('30%', '70%');
$table->align = array('right', 'left');
$str = '';
$assignees = tracker_getassignees($USER->id);
if ($assignees){
foreach($assignees as $assignee){
$str .= tracker_print_user($assignee, true);
$str .= ' ('.$assignee->issues.')
';
}
} else {
$str .= get_string('noassignees', 'tracker');
}
$table->data[] = array(get_string('myassignees', 'tracker'), $str);
$issues = tracker_getownedissuesforresolve($tracker->id, $USER->id);
$str = '';
if ($issues) {
foreach ($issues as $issue) {
$linkurl = new moodle_url('/mod/tracker/view.php', array('id' => $cm->id, 'view' => 'view', 'screen'=> 'viewanissue', 'issueid' => $issue->id));
$str .= $tracker->ticketprefix.$issue->id . ' - '.$issue->summary.'';
$str .= " status]}\">".$STATUSKEYS[$issue->status].'';
$str .= '
';
}
} else {
print_string('noresolvingissue', 'tracker');
}
$table->data[] = array(get_string('myissues', 'tracker'), $str);
echo html_writer::table($table);
}
$OUTPUT->box_end();