Ejemplo n.º 1
0
function returnUsersUnderProjectsJSObject($user)
{
    // this function returns a JS object with the projects (the user is a member of) as properties
    // and members of each project as property value
    $output = array();
    $manageProjects = new manageProjects();
    $myProjects = $manageProjects->getActiveProjectsListOfUser($user);
    foreach ($myProjects as $project) {
        $output[$project] = $manageProjects->getUsersListInProject($project);
    }
    $output[DEFAULTPERSONALPROJECT] = array($user);
    echo 'var MYPROJECTS_USERS = ' . json_encode($output) . ' ; ';
}
Ejemplo n.º 2
0
<?php 
$manageUsers = new manageUsers();
$allusers = $manageUsers->listOfAllUsers();
$manageProjects = new manageProjects();
$allProjects = $manageProjects->listOfAllProjectsIncludeClosed();
?>
<div class="ProjectsListing">
	<div style="margin-bottom: 10px;">
		<span onclick="manageProjectsJsfunctions.createNewProject_form();" class='bluebutton'>Add Project</span>
	</div>
	<?php 
foreach ($allProjects as $project) {
    if ($project == DEFAULTPERSONALPROJECT) {
        continue;
    }
    $usersInThisProject = $manageProjects->getUsersListInProject($project);
    $isProjectActive = $manageProjects->isProjectActive($project);
    echo "\n<div class='project'>";
    if ($isProjectActive) {
        echo "<div class='projectname'>{$project}</div>";
    } else {
        echo "<div class='projectname' style='color:#D78F7B'>{$project} [CLOSED]</div>";
    }
    echo "\t<div class='projectDesc' projectName='{$project}'>" . $manageProjects->getProjectDescription($project) . "</div>";
    echo "\t<div class='projectDescOptions' projectName='{$project}'>\n\t\t\t\t\t\t<span class='bluebuttonSmall updateDescEdit' projectName='{$project}'>Update</span>\n\t\t\t\t\t\t<span class='bluebuttonSmall cancelDescEdit' projectName='{$project}'>Cancel</span>\n\t\t\t\t\t</div>";
    echo "<div class='projectUsers'> Users: ";
    foreach ($allusers as $thisuser) {
        if (in_array($thisuser, $usersInThisProject)) {
            echo "<span class='userInProject' title='click to remove this user from project' onclick=\"manageProjectsJsfunctions.removeUserFromProject('" . $thisuser . "' , '" . $project . "')\"><B>{$thisuser}</B></span>";
        } else {
            echo "<span class='userNotInProject' title='click to include this user in project' onclick=\"manageProjectsJsfunctions.addUserToProject('" . $thisuser . "' , '" . $project . "')\">{$thisuser}</span>";