Ejemplo n.º 1
0
function soap_get_projects($username, $password)
{
    $user = auth_user($username, $password);
    if ($user === FALSE) {
        return new soap_fault('Client', '', 'Access Denied');
    }
    $project = new SI_Project();
    $projects = $project->getMyProjects($user->id);
    return object_to_data($projects, array('id', 'company_id', 'name', 'default_item_code_id'));
}
Ejemplo n.º 2
0
require_once('includes/SI_Project.php');
require_once('includes/SI_Company.php');
require_once('includes/SI_Task.php');

checkLogin();

$project = new SI_Project();

if($loggedin_user->hasRight('admin') && isset($_REQUEST['user_id'])){
	$user_id = $_REQUEST['user_id'];
}else{
	$user_id = $loggedin_user->id;
}

if($_REQUEST['filter'] == "all"){
	$projects = $project->getMyProjects($user_id, FALSE);
}else{
	$_REQUEST['filter'] = "pending";
	$projects = $project->getMyProjects($user_id, TRUE);
}

if($projects === FALSE){
	$error_msg .= "Could not retrieve your project list!\n";
	debug_message($project->getLastError());
}

$task = new SI_Task();
$tasks = $task->getUpcoming($user_id);
if($tasks === FALSE){
	$error_msg .= "Could not retrieve Upcoming Tasks!\n";
	debug_message($task->getLastError());