Exemplo n.º 1
0
 *  contract, strict liability, or tort (including negligence or otherwise)     *
 *  arising in any way out of the use of this software, even if advised of the  *
 *  possibility of such damage.                                                 *
 *                                                                              *
 ********************************************************************************/
include_once $_SERVER['DOCUMENT_ROOT'] . '/config.php';
include_once $HUB_FLM->getCodeDirPath("core/formats/json.php");
include_once $HUB_FLM->getCodeDirPath("ui/headerstats.php");
global $CFG;
$groupid = required_param("groupid", PARAM_ALPHANUMEXT);
$userHashtable = array();
$userCheck = array();
$usersToDebates = array();
$nodeCheck = array();
$totalnodes = 0;
$mapNodes = getNodesByGroup($groupid, 0, -1, 'date', 'DESC', '', 'Map', 'mini');
$nodes = $mapNodes->nodes;
$count = count($nodes);
for ($i = 0; $i < $count; $i++) {
    $node = $nodes[$i];
    if (!array_key_exists($node->nodeid, $nodeCheck)) {
        $nodeCheck[$node->nodeid] = $node;
    }
    if (!array_key_exists($node->users[0]->userid, $userHashtable)) {
        $globaluser = clone $node->users[0];
        $globaluser->procount = 0;
        $globaluser->concount = 0;
        $globaluser->ideacount = 0;
        $globaluser->debatecount = 0;
        $globaluser->mapcount = 1;
        $userHashtable[$node->users[0]->userid] = $globaluser;
Exemplo n.º 2
0
/**
 * Return a Group for the given groupid;
 */
function getConversationData($groupid)
{
    $mapNodes = getNodesByGroup($groupid, 0, -1, 'date', 'DESC', '', 'Map', 'cif');
    $checkNodes = array();
    $checkConns = array();
    $group = new Group($groupid);
    $view = new View($groupid);
    if (!$mapNodes instanceof Error) {
        $nodes = $mapNodes->nodes;
        $count = count($nodes);
        for ($i = 0; $i < $count; $i++) {
            if (isset($nodes[$i])) {
                $node = $nodes[$i];
                /* // ADD MAP NODES ?
                			if (array_key_exists($node->nodeid, $checkNodes) === FALSE) {
                					$checkNodes[$node->nodeid] = $node->nodeid;
                					array_push($view->nodes,$node);
                				}
                			}
                			*/
                $nextmap = getView($node->nodeid, 'cif');
                $innernodes = $nextmap->nodes;
                $countk = count($innernodes);
                for ($k = 0; $k < $countk; $k++) {
                    $viewnode = $innernodes[$k];
                    $innernode = $viewnode->node;
                    if (!$innernode instanceof Error) {
                        if (array_key_exists($innernode->nodeid, $checkNodes) === FALSE) {
                            $checkNodes[$innernode->nodeid] = $innernode->nodeid;
                            array_push($view->nodes, $viewnode);
                        }
                    }
                }
                $connections = $nextmap->connections;
                $countj = count($connections);
                for ($j = 0; $j < $countj; $j++) {
                    $viewcon = $connections[$j];
                    $con = $viewcon->connection;
                    if (!$con instanceof Error && array_key_exists($con->connid, $checkConns) === FALSE) {
                        $checkConns[$con->connid] = $con->connid;
                        array_push($view->connections, $viewcon);
                    }
                }
            }
        }
    }
    $group->view = $view;
    return $group;
}
 *  are disclaimed. In no event shall the copyright owner or contributors be    *
 *  liable for any direct, indirect, incidental, special, exemplary, or         *
 *  consequential damages (including, but not limited to, procurement of        *
 *  substitute goods or services; loss of use, data, or profits; or business    *
 *  interruption) however caused and on any theory of liability, whether in     *
 *  contract, strict liability, or tort (including negligence or otherwise)     *
 *  arising in any way out of the use of this software, even if advised of the  *
 *  possibility of such damage.                                                 *
 *                                                                              *
 ********************************************************************************/
/** Author: Michelle Bachler, KMi, The Open University **/
include_once $_SERVER['DOCUMENT_ROOT'] . '/config.php';
require_once $HUB_FLM->getCodeDirPath("core/io/catalyst/analyticservices.php");
//$url = required_param('url', PARAM_URL);
$groupid = required_param("groupid", PARAM_ALPHANUMEXT);
$nodeSet = getNodesByGroup($groupid, 0, -1, 'date', 'ASC', '', 'Issue,Solution,Pro,Con', 'mini');
$nodes = $nodeSet->nodes;
$count = count($nodes);
$data = array();
$usersCheck = array();
$users = array();
$countUsers = 1;
for ($i = 0; $i < $count; $i++) {
    $node = $nodes[$i];
    $activitieSet = getAllNodeActivity($node->nodeid, 0, 0, -1);
    $activities = $activitieSet->activities;
    foreach ($activities as $activity) {
        if (isset($activity)) {
            $date = $activity->modificationdate;
            $type = $activity->type;
            $changetype = $activity->changetype;
Exemplo n.º 4
0
 case "getnodesbyurl":
     $url = required_param('url', PARAM_URL);
     $response = getNodesByURL($url, $start, $max, $o, $s, $filternodetypes, $style, $status);
     break;
 case "getnodesbyuser":
     $userid = required_param('userid', PARAM_ALPHANUMEXT);
     $query = optional_param('q', "", PARAM_TEXT);
     $connectionfilter = optional_param('filterbyconnection', '', PARAM_ALPHA);
     $response = getNodesByUser($userid, $start, $max, $o, $s, $filternodetypes, $style, $query, $connectionfilter, $status);
     break;
 case "getnodesbygroup":
     $groupid = required_param('groupid', PARAM_ALPHANUMEXT);
     $filterusers = optional_param('filterusers', '', PARAM_TEXT);
     $query = optional_param('q', "", PARAM_TEXT);
     $connectionfilter = optional_param('filterbyconnection', '', PARAM_ALPHA);
     $response = getNodesByGroup($groupid, $start, $max, $o, $s, $filterusers, $filternodetypes, $style, $query, $connectionfilter, $status);
     break;
 case "getnodesbyglobal":
     $query = optional_param('q', "", PARAM_TEXT);
     $scope = optional_param('scope', 'all', PARAM_TEXT);
     $tagsonly = optional_param('tagsonly', false, PARAM_BOOL);
     $connectionfilter = optional_param('filterbyconnection', '', PARAM_ALPHA);
     $response = getNodesByGlobal($start, $max, $o, $s, $filternodetypes, $style, $query, $scope, $tagsonly, $connectionfilter, $status);
     break;
 case "getmostconnectednodes":
     $scope = optional_param('scope', 'my', PARAM_TEXT);
     $response = getMostConnectedNodes($scope, $start, $max, $style, $status);
     break;
 case "getnodesbyfirstcharacters":
     $query = required_param('q', PARAM_TEXT);
     $scope = optional_param('scope', 'my', PARAM_TEXT);
Exemplo n.º 5
0
global $CFG;
$groupid = required_param("groupid", PARAM_ALPHANUMEXT);
//$group = getGroup($groupid);
//$members = $group->members;
//$memberlist = $members->users;
$userHashtable = array();
//$countmembers = count($memberlist);
//for ($i=0; $i<$countmembers; $i++) {
//	$member = $memberlist[$i];
//	$userHashtable[$member->userid] = $member;
//}
$userCheck = array();
$usersToDebates = array();
$nodeCheck = array();
$totalnodes = 0;
$issueNodes = getNodesByGroup($groupid, 0, -1, 'date', 'DESC', '', 'Issue', 'mini');
$nodes = $issueNodes->nodes;
$count = count($nodes);
for ($i = 0; $i < $count; $i++) {
    $node = $nodes[$i];
    if (!array_key_exists($node->nodeid, $nodeCheck)) {
        $nodeCheck[$node->nodeid] = $node;
    }
    if (!array_key_exists($node->users[0]->userid, $userHashtable)) {
        $globaluser = clone $node->users[0];
        $globaluser->procount = 0;
        $globaluser->concount = 0;
        $globaluser->ideacount = 0;
        $globaluser->debatecount = 1;
        $userHashtable[$node->users[0]->userid] = $globaluser;
    } else {
Exemplo n.º 6
0
/**
 * Return a ViewSet for the given groupid;
 */
function getConversationData($groupid)
{
    $issueNodes = getNodesByGroup($groupid, 0, -1, 'date', 'DESC', '', 'Issue', 'cif');
    $checkNodes = array();
    $checkConns = array();
    $group = new Group($groupid);
    $view = new View($groupid);
    if (!$issueNodes instanceof Error) {
        $nodes = $issueNodes->nodes;
        $count = count($nodes);
        for ($i = 0; $i < $count; $i++) {
            $node = $nodes[$i];
            if (!$node instanceof Error) {
                if (array_key_exists($node->nodeid, $checkNodes) === FALSE) {
                    $checkNodes[$node->nodeid] = $node->nodeid;
                    $view->addNode($node);
                }
                $conSet = getDebate($node->nodeid, 'cif');
                if (!$conSet instanceof Error) {
                    $countj = count($conSet->connections);
                    for ($j = 0; $j < $countj; $j++) {
                        $con = $conSet->connections[$j];
                        if (array_key_exists($con->connid, $checkConns) === FALSE) {
                            $checkConns[$con->connid] = $con->connid;
                            $view->addConnection($con);
                        }
                        $from = $con->from;
                        if (!$from instanceof Error && array_key_exists($from->nodeid, $checkNodes) === FALSE) {
                            $checkNodes[$from->nodeid] = $from->nodeid;
                            $view->addNode($from);
                        }
                        $to = $con->to;
                        if (!$to instanceof Error && array_key_exists($to->nodeid, $checkNodes) === FALSE) {
                            $checkNodes[$to->nodeid] = $to->nodeid;
                            $view->addNode($to);
                        }
                    }
                }
            }
        }
    }
    $group->view = $view;
    return $group;
}