Example #1
0
    // try to insert this snummer into max prj_grp
    $sql = "insert into project_scribe (prj_id,scribe) values({$prj_id},{$newsnummer})\n";
    $dbConn->Execute($sql);
    $dbConn->log($sql);
    //    $dbConn->log($dbConn->ErrorMsg());
}
if (isset($_REQUEST['bdelete']) && $newsnummer != 0) {
    // try to insert this snummer into max prj_grp
    $sql = "delete from project_scribe where scribe={$newsnummer} and prj_id={$prj_id}\n";
    $dbConn->Execute($sql);
    $dbConn->log($sql);
    //    $dbConn->log($dbConn->ErrorMsg());
}
$page = new PageContainer();
$page_opening = "Add project scribe" . "<span style='font-size:8pt;'>prj_id {$prj_id} milestone {$milestone} prjm_id {$prjm_id}</span>";
$page->setTitle('Add a project scribe');
$nav = new Navigation($tutor_navtable, basename($PHP_SELF), $page_opening);
$page->addBodyComponent($nav);
$templatefile = 'templates/addscribe.html';
$template_text = file_get_contents($templatefile, true);
$studentPicker->setPresentQuery("select scribe as snummer from project_scribe where prj_id={$prj_id}");
$student_picker_text = $studentPicker->getPicker();
$scribeQuery = "select snummer,achternaam,roepnaam,voorvoegsel from student\n" . "where snummer in (select scribe from project_scribe where prj_id={$prj_id}) order by achternaam,roepnaam";
$scribeTable = simpleTableString($dbConn, $scribeQuery, "<table summary='students found' border='1' style='border-collapse:collapse'>");
if ($template_text === false) {
    $page->addBodyComponent(new Component("<strong>cannot read template file {$templatefile}</strong>"));
} else {
    eval("\$text = \"{$template_text}\";");
    $page->addBodyComponent(new Component($text));
}
$page->show();
Example #2
0
require_once 'studentpicker.php';
$newsnummer = $peer_id;
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
$cap_names = array('CAP_TUTOR', 'CAP_MKPROJECT', 'CAP_MKCLASSES', 'CAP_ALTER_STUDENT', 'CAP_ALTER_STUDENT_CLASS', 'CAP_LOOKUP_STUDENT', 'CAP_IMPERSONATE_STUDENT', 'CAP_TUTOR_OWNER', 'CAP_RECRUITER', 'CAP_STUDENT_ADMIN', 'CAP_TUTOR_ADMIN', 'CAP_SUBVERSION', 'CAP_SHARING', 'CAP_JAAG', 'CAP_SYSTEM', 'CAP_MENU_ADMIN', 'CAP_EDIT_RIGHTS', 'CAP_MODULE', 'CAP_GIT', 'CAP_SELECT_ALL', 'CAP20', 'CAP21', 'CAP22', 'CAP23', 'CAP24', 'CAP25', 'CAP26', 'CAP27', 'CAP28', 'CAP29', 'CAP_BIGFACE', 'CAP31');
$caps = 0;
$dbMsg = '';
extract($_SESSION);
//        if (isSet($_REQUEST['capuserid'])) {
//            $capuserid = $_REQUEST['capuserid'];
//        }
$studentPicker = new StudentPicker($dbConn, $newsnummer, 'Search user.');
$studentPicker->setShowAcceptButton(false);
$studentPicker->setPresentQuery("select userid as snummer from passwd");
$newsnummer = $studentPicker->processRequest();
$student_picker_text = $studentPicker->getPicker();
if (isset($_REQUEST['capability'])) {
    $caps = collectBitSet($_REQUEST['capability']);
}
if (isset($_REQUEST['setcap']) && isset($newsnummer) && $newsnummer != 0) {
    $sql = "update passwd set capabilities={$caps} where userid={$newsnummer}";
    $resultSet = $dbConn->Execute($sql);
    //            $dbConn->log($sql);
    if ($resultSet === false) {
        $dbMsg = "error cause " + $dbConn->ErrorMsg();
    }
}
$sql = "select capabilities from passwd where userid={$newsnummer}";
$resultSet = $dbConn->Execute($sql);
Example #3
0
if (($isTutorOwner || $isGroupTutor) && isset($_REQUEST['baccept']) && $newsnummer != 0) {
    // try to insert this snummer into max prj_grp
    $sql = "begin work;" . " insert into prj_grp (snummer,prj_grp_open,prjtg_id) \n" . "  select snummer,false,prjtg_id\n" . " from (select snummer from student where snummer={$newsnummer} and snummer not in \n" . " (select snummer from prj_grp join prj_tutor using(prjtg_id) \n" . "   where prjm_id={$prjm_id} )) st \n" . "  cross join (select prjtg_id from prj_tutor pt where pt.prjm_id={$prjm_id} and \n" . "grp_num =(select max(grp_num) from prj_tutor where prjm_id={$prjm_id})) pgt;\n" . "update prj_tutor set prj_tutor_open=false \n" . "where grp_num=(select max(grp_num) from prj_tutor where prjm_id={$prjm_id})\n" . "   and prjm_id={$prjm_id};\n" . "update prj_grp set prj_grp_open=false where prjtg_id =\n" . "(select prjtg_id from prj_tutor where \n" . "  grp_num=(select max(grp_num) from prj_tutor \n" . "   where prjm_id={$prjm_id}) and prjm_id={$prjm_id});\n" . "commit;";
    $resultSet = $dbConn->Execute($sql);
    if ($resultSet === 0) {
        $dbConn->log($dbConn->ErrorMsg());
        $dbConn->Execute("abort");
    }
}
if (($isTutorOwner || $isGroupTutor) && isset($_REQUEST['bdelete']) && $newsnummer != 0) {
    // try to insert this snummer into max prj_grp
    $sql = "delete from prj_grp pg where snummer={$newsnummer} \n" . "and prjtg_id in (select prjtg_id from prj_tutor where prjm_id={$prjm_id})";
    $dbConn->Execute($sql);
    //    $dbConn->log($dbConn->ErrorMsg());
}
$studentPicker->setPresentQuery("select snummer from prj_grp join prj_tutor using(prjtg_id) where prjm_id={$prjm_id}");
$sql = "select distinct snummer,achternaam,roepnaam,voorvoegsel,pt.grp_num, alias as group,sclass \n" . " from prj_grp pg join prj_tutor pt using(prjtg_id) join student using(snummer) \n" . "join student_class using(class_id)\n" . " left join grp_alias using(prjtg_id)" . " where pt.prjm_id={$prjm_id} \n" . "  order by grp_num desc,achternaam,roepnaam";
$rainbow = new RainBow();
$memberTable = getQueryToTableChecked($dbConn, $sql, true, 4, $rainbow, -1, '', '');
pagehead('Add individual student.');
$page_opening = "Add individual student to a project. <span style='font-size:6pt;'>prj_id {$prj_id} milestone {$milestone} </span>";
$nav = new Navigation($tutor_navtable, basename($PHP_SELF), $page_opening);
$nav->setInterestMap($tabInterestCount);
$nav->show();
$prjSelectWidget = $prjSel->getWidget();
include_once 'templates/addindividual.html';
?>
<!-- db_name=<?php 
echo $db_name;
?>
 -->
Example #4
0
}
//
pagehead('Add project auditor.');
$page_opening = "Add project auditor to a project. prj_id {$prj_id} milestone {$milestone} prjm_id {$prjm_id}";
$nav = new Navigation($tutor_navtable, basename($PHP_SELF), $page_opening);
$nav->setInterestMap($tabInterestCount);
echo $nav->show();
?>
<div id='navmain' style='padding:1em;'>
<p>Add a project auditor to a project /group.</p>
<p>Project auditors have the privilege to access the groups resources such as svn and trac. Use case: extra 
    readers of project artifacts without having to add (empty) project groups with these readers as tutor.
</p>
  <?php 
echo $prjSel->getWidget();
$studentPicker->setPresentQuery("select snummer from project_auditor where prjm_id={$prjm_id}");
$studentPicker->show();
$sql = "select snummer,achternaam,roepnaam,voorvoegsel from student where snummer={$newauditor}";
$resultSet = $dbConn->Execute($sql);
extract($resultSet->fields, EXTR_PREFIX_ALL, 'auditor');
if ($newauditor != 0) {
    ?>
<fieldset><legend>Select groups to audit.</legend>
<form name='set auditgroups' method='post' action='<?php 
    echo $PHP_SELF;
    ?>
'>
<p>Choose groups in project <b><?php 
    echo $afko;
    ?>
 <?php 
Example #5
0
<form method="get" name="activity" action="<?php 
echo $PHP_SELF;
?>
">
<?php 
echo $act_id_selector;
?>
csv:
<input type='checkbox' name='csvout' <?php 
echo $csvout_checked;
?>
 value='Y' />
<input type='submit' name='get' value='Get' />
</form>
</fieldset>

<?php 
$studentPicker->setPresentQuery("select snummer,act_id from activity_participant where act_id={$act_id}");
$studentPicker->show();
?>
<div align='center'>
<?php 
$inputColumns = array('4' => array('type' => 'H', 'size' => '2'));
echo queryToTableChecked($dbConn, $sql1, true, 3, $rainbow, -1, '', '', $inputColumns);
?>
</div>
</div>
</body>
</html>
<?php 
echo "<!-- dbname={$db_name} -->";
Example #6
0
require_once './peerlib/peerutils.inc';
include_once 'navigation2.inc';
requireCap(CAP_EDIT_RIGHTS);
require_once 'bitset.php';
require_once 'studentpicker.php';
$newuserid = $peer_id;
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
$dbMsg = '';
extract($_SESSION);
$tutorPicker = new StudentPicker($dbConn, $newuserid, 'Search tutor.');
$tutorPicker->setShowAcceptButton(false);
$tutorPicker->setPresentQuery("select userid as snummer from tutor");
$newuserid = $tutorPicker->processRequest();
$tutor_picker_text = $tutorPicker->getPicker();
$cluster_widget = "<table border='1' style='border-collapse:collapse; width:100%'>\n";
if (isset($_REQUEST['class_cluster']) && isset($_REQUEST['newuserid'])) {
    $newuserid = $_REQUEST['newuserid'];
    $sql1 = "begin work;\n" . "delete from tutor_class_cluster where userid={$newuserid};\n";
    for ($i = 0; $i < count($_REQUEST['class_cluster']); $i++) {
        if ($_REQUEST['cluster_order'][$i] > 0) {
            $sql1 .= "insert into tutor_class_cluster select {$newuserid},{$_REQUEST['class_cluster'][$i]},{$_REQUEST['cluster_order'][$i]};\n";
        }
    }
    $sql1 .= "commit;\n";
    $rs = $dbConn->Execute($sql1);
}
$sql = "select cluster_name, cluster_description, class_cluster,sort_order,coalesce(cluster_order,0) as cluster_order\n" . " from class_cluster left join (select class_cluster,cluster_order from tutor_class_cluster where userid={$newuserid}) tcc using(class_cluster)\n" . "order by sort_order";