Filter tasks by person
Page: 1
First of all: I'm really loving aC! But I have one 'problem' I'm not getting: is it possible to show all the tasks assigned to a certain person? So I could select a person, and see all the tasks that are currently assigned to him.
Thnx in advance,
Chris
Thnx in advance,
Chris
Ilija Studen
on Jan 21. 2007. 3:57 pm
It is not possible at the moment. I know it would be useful and it will be included at some point.
activeCollab team member
I wanted to do the same thing, list tasks by user, so I wrote these scripts, just save in files in your web-accessible directory. Ok to use until the feature is officially supported :)
Save as whatever name you want e.g. form.html (this is where you enter the name):
<form action="usertasks.php" method="post">
<p>Name: <input type="text" name="name" /></p>
<p><input type="submit" /></p>
</form>
Save as usertasks.php (replace host, mysqluser and mysqlpassword):
<?php
$link = mysql_connect('host', 'mysqluser', 'mysqlpassword');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
mysql_select_db('activecollab') or die('Could not connect: ' . mysql_error());
// This could be supplied by a user, for example
$name = $_POST['name'];
$query = sprintf("select p.name, tl.name, pt.text from
ac_users as u
join ac_project_tasks as pt on u.id = pt.assigned_to_user_id
join ac_project_task_lists as tl on tl.id = pt.task_list_id
join ac_projects as p on p.id = tl.project_id
where u.username = '%s';",
mysql_real_escape_string($name));
$result = mysql_query($query);
if (!$result) {
$message = 'Invalid query: ' . mysql_error() . "\n";
$message .= 'Whole query: ' . $query;
die($message);
}
echo('<table border=\"1">');
while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
printf("<tr><td>%s<td>%s<td>%s<br>", $row[0], $row[1], $row[2]);
}
echo('<table/>');
// Free the resources associated with the result set
// This is done automatically at the end of the script
mysql_free_result($result);
mysql_close($link);
exit;
?>
Save as whatever name you want e.g. form.html (this is where you enter the name):
<form action="usertasks.php" method="post">
<p>Name: <input type="text" name="name" /></p>
<p><input type="submit" /></p>
</form>
Save as usertasks.php (replace host, mysqluser and mysqlpassword):
<?php
$link = mysql_connect('host', 'mysqluser', 'mysqlpassword');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
mysql_select_db('activecollab') or die('Could not connect: ' . mysql_error());
// This could be supplied by a user, for example
$name = $_POST['name'];
$query = sprintf("select p.name, tl.name, pt.text from
ac_users as u
join ac_project_tasks as pt on u.id = pt.assigned_to_user_id
join ac_project_task_lists as tl on tl.id = pt.task_list_id
join ac_projects as p on p.id = tl.project_id
where u.username = '%s';",
mysql_real_escape_string($name));
$result = mysql_query($query);
if (!$result) {
$message = 'Invalid query: ' . mysql_error() . "\n";
$message .= 'Whole query: ' . $query;
die($message);
}
echo('<table border=\"1">');
while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
printf("<tr><td>%s<td>%s<td>%s<br>", $row[0], $row[1], $row[2]);
}
echo('<table/>');
// Free the resources associated with the result set
// This is done automatically at the end of the script
mysql_free_result($result);
mysql_close($link);
exit;
?>
Topic is locked. If you have something important to say about issues discussed on this page please write at hi@a51dev.com.



