Hi all,
For those who have problems with the installation :
- download the fidel's zip file on (first post)
- apply (Jmia18's modification) on ost_task.sql
- apply (ibw007's modification) on /incude/class.task.php
Is there a way to make the Task List fully visible only for Admin. And make the staff only see only tasks which are assingned only to them and to their department?
I tried a mod for this. After some tests, it seems to correspond to your needs ;)
In scp/tasklist.php find :
$nav->addSubMenu ( array ('desc' => 'All Tasks', 'href' => 'tasklist.php', 'iconclass' => 'userPref' ) );
change it to :
if ($thisuser->isadmin()) {$nav->addSubMenu ( array ('desc' => 'All Tasks', 'href' => 'tasklist.php', 'iconclass' => 'userPref' ) );}
In include/class.task.php find :
$query = "SELECT * FROM " . $this->taskTable . " WHERE start_day BETWEEN '$startOfWeek' AND '$endOfWeek'";
change it to :
$query = "SELECT * FROM " . $this->taskTable . " WHERE task_owner = '".$this->getStaffId()."' AND start_day BETWEEN '$startOfWeek' AND '$endOfWeek'";
and add this code at the end of the file for example :
/**
* method to return the staff_id corresponding to the username
*
*
* <USERMENTION username="return">@return</USERMENTION> staff_id
*/
private function getStaffId() {
$query = "SELECT staff_id FROM ost_staff WHERE username ='".$_SESSION."'";
$result = db_query ($query);
$res = mysql_fetch_array($result);
return $res;
}
EDIT : not necessary
In include/class.nav.php find :
$tabs=array('desc'=>'Task List','href'=>'tasklist.php','title'=>'Task List');
change it to :
$tabs=array('desc'=>'Task List','href'=>'tasklist.php?t=my','title'=>'Task List');
The point is that if you enter the url of tasklist.php without the '?t=my', you can see all the tasks... :
I think i've got a problem with the links ">>" on the Task Schedule : my task is always displayed whatever the selected week :