Exemplo n.º 1
0
function assignTree()
{
    require_once _base_ . '/lib/lib.form.php';
    require_once _base_ . '/lib/lib.userselector.php';
    $lang =& DoceboLanguage::createInstance('code');
    $id_code_group = Get::req('id_code_group', DOTY_INT, '0');
    $code_manager = new CodeManager();
    $selector = new UserSelector();
    $selector->show_user_selector = FALSE;
    $selector->show_group_selector = FALSE;
    $selector->show_orgchart_selector = TRUE;
    $selector->show_orgchart_simple_selector = TRUE;
    $array_user_associated = $code_manager->getOrgAssociated($id_code_group);
    $selector->resetSelection($array_user_associated);
    if (Get::req('okselector', DOTY_MIXED, '')) {
        $folder_selected = $selector->getSelection($_POST);
        if ($code_manager->insertOrgAssociation($folder_selected, $id_code_group)) {
            Util::jump_to('index.php?modname=code&op=list&result=ok');
        }
        Util::jump_to('index.php?modname=code&op=list&result=err');
    }
    cout($selector->loadSelector('index.php?modname=code&op=assign_tree&id_code_group=' . $id_code_group, array('index.php?modname=code&op=list' => $lang->def('_CODE'), $lang->def('_ASSIGN_USERS')), ''));
    cout('</div>');
}