Example #1
0
require "pre.php";
require "trove.php";
require $DOCUMENT_ROOT . '/project/admin/project_admin_utils.php';
session_require(array('group' => $group_id, 'admin_flags' => 'A'));
// Check for submission. If so, make changes and redirect
if ($GLOBALS['Submit'] && $root1) {
    group_add_history('Changed Trove', $rm_id, $group_id);
    // there is at least a $root1[xxx]
    while (list($rootnode, $value) = each($root1)) {
        // check for array, then clear each root node for group
        db_query('DELETE FROM trove_group_link WHERE group_id=' . $group_id . ' AND trove_cat_root=' . $rootnode);
        for ($i = 1; $i <= $GLOBALS['TROVE_MAXPERROOT']; $i++) {
            $varname = 'root' . $i;
            // check to see if exists first, then insert into DB
            if (${$varname}[$rootnode]) {
                trove_setnode($group_id, ${$varname}[$rootnode], $rootnode);
            }
        }
    }
    session_redirect('/project/admin/?group_id=' . $group_id);
}
project_admin_header(array('title' => 'Group Trove Information', 'group' => $group_id));
print '<P>Select up to three locations for this project in each of the
Trove root categories. If the project does not require any or all of these
locations, simply select "None Selected".

<P>IMPORTANT: Projects should be categorized in the most specific locations
available in the map. Simulteneous categorization in a specific category
AND a parent category will result in only the more specific categorization
being accepted.
';
Example #2
0
    group_add_history('Changed Trove', $group_id, $group_id);
    // there is at least a $root1[xxx]
    $allroots = array();
    $allroots = getStringFromRequest('root1');
    //$eachroot = ;//must make this bypass because it wouldn't compile otherwise
    while (list($rootnode, $value) = each($allroots)) {
        // check for array, then clear each root node for group
        db_query("\n\t\t\tDELETE FROM trove_group_link\n\t\t\tWHERE group_id='{$group_id}'\n\t\t\tAND trove_cat_root='{$rootnode}'\n\t\t");
        for ($i = 1; $i <= $TROVE_MAXPERROOT; $i++) {
            $varname = 'root' . $i;
            // check to see if exists first, then insert into DB
            //@TODO change this to use the escaping utils
            $var_aux = getStringFromRequest($varname);
            $category = $var_aux[$rootnode];
            if ($category) {
                trove_setnode($group_id, $category, $rootnode);
            }
        }
    }
    session_redirect('/project/admin/?group_id=' . $group_id);
}
project_admin_header(array('title' => _('Group Trove Information'), 'group' => $group_id));
echo _('<h3>Edit Trove Categorization</h3><p>Select up to three locations for this project in each of the Trove root categories. If the project does not require any or all of these locations, simply select "None Selected".</p><p> IMPORTANT: Projects should be categorized in the most specific locations available in the map. Simultaneous categorization in a specific category AND a parent category will result in only the more specific categorization being accepted</p>.');
?>

<form action="<?php 
echo getStringFromServer('PHP_SELF');
?>
" method="post">

<?php 
Example #3
0
require_once 'common/include/HTTPRequest.class.php';
$request = HTTPRequest::instance();
$group_id = $request->getValidated('group_id', 'uint', 0);
session_require(array('group' => $group_id, 'admin_flags' => 'A'));
// Check for submission. If so, make changes and redirect
$roots = $request->get('root1');
if ($request->exist('Submit') && is_array($roots)) {
    group_add_history('changed_trove', "", $group_id);
    foreach ($roots as $root_id => $nop) {
        // check for array, then clear each root node for group
        db_query('DELETE FROM trove_group_link WHERE group_id=' . db_ei($group_id) . ' AND trove_cat_root=' . db_ei($root_id));
        for ($i = 1; $i <= $GLOBALS['TROVE_MAXPERROOT']; $i++) {
            $submitted_category = $request->get('root' . $i);
            if (isset($submitted_category[$root_id]) && $submitted_category[$root_id]) {
                $category_id = $submitted_category[$root_id];
                trove_setnode($group_id, $category_id, $root_id);
            }
        }
    }
    session_redirect('/project/admin/?group_id=' . $group_id);
}
project_admin_header(array('title' => $Language->getText('project_admin_grouptrove', 'g_trove_info'), 'group' => $group_id));
// LJ New message added to explain that if a Topic category is not there
// LJ put the project unclassified and the Codendi team will create the
// Lj new entry
//
print '<P>' . $Language->getText('project_admin_grouptrove', 'select_3_classifs', $GLOBALS['sys_name']);
print "\n<FORM method=\"post\">";
// HTML select for all available categories for this group
print trove_get_html_allcat_selectfull($group_id);
print '<P><INPUT type="submit" name="Submit" value="' . $Language->getText('project_admin_grouptrove', 'submit_all_changes') . '">';