Exemplo n.º 1
0
    if (isset($_GET['ggid'])) {
        $page_string .= htmlspecialchars(SEP) . 'ggid=' . intval($_GET['ggid']);
    }
    if (isset($_GET['gsgid'])) {
        $page_string .= htmlspecialchars(SEP) . 'gsgid=' . intval($_GET['gsgid']);
    }
}
// Called by "create/edit checks": add pre-requisite checks, add next checks,
//           "create/edit guidelined", add checks into guideline or group.
// only list the checks that are not in the pre-requisite checks, or next checks, or guideline, or group
if (isset($_GET['list'])) {
    if ($_GET['list'] == 'pre') {
        $existing_rows = $checkPrerequisitesDAO->getPreChecksByCheckID($_GET['cid']);
    }
    if ($_GET['list'] == 'next') {
        $existing_rows = $testPassDAO->getNextChecksByCheckID($_GET['cid']);
    }
    if ($_GET['list'] == 'guideline') {
        $existing_rows = $checksDAO->getGuidelineLevelChecks($_GET['gid']);
    }
    if ($_GET['list'] == 'group') {
        $existing_rows = $checksDAO->getGroupLevelChecks($_GET['ggid']);
    }
    if ($_GET['list'] == 'subgroup') {
        $existing_rows = $checksDAO->getChecksBySubgroupID($_GET['gsgid']);
    }
    // get checks that are open to public and not in guideline
    unset($str_existing_checks);
    if (is_array($existing_rows)) {
        foreach ($existing_rows as $existing_row) {
            $str_existing_checks .= $existing_row['check_id'] . ',';
Exemplo n.º 2
0
if (isset($check_id)) {
    $check_row = $checksDAO->getCheckByID($check_id);
    if (!$check_row) {
        // invalid check id
        $msg->addError('INVALID_CHECK_ID');
        require AC_INCLUDE_PATH . 'header.inc.php';
        $msg->printAll();
        require AC_INCLUDE_PATH . 'footer.inc.php';
        exit;
    }
    // get author name
    $usersDAO = new UsersDAO();
    $user_name = $usersDAO->getUserName($check_row['user_id']);
    if ($user_name != '') {
        $savant->assign('author', $user_name);
    }
    $check_pass_example_rows = $checkExamplesDAO->getByCheckIDAndType($check_id, AC_CHECK_EXAMPLE_PASS);
    $check_fail_example_rows = $checkExamplesDAO->getByCheckIDAndType($check_id, AC_CHECK_EXAMPLE_FAIL);
    $check_example_row['pass_example_desc'] = $check_pass_example_rows[0]['description'];
    $check_example_row['pass_example'] = $check_pass_example_rows[0]['content'];
    $check_example_row['fail_example_desc'] = $check_fail_example_rows[0]['description'];
    $check_example_row['fail_example'] = $check_fail_example_rows[0]['content'];
    $savant->assign('check_row', $check_row);
    $savant->assign('pre_rows', $checkPrerequisitesDAO->getPreChecksByCheckID($check_id));
    $savant->assign('next_rows', $testPassDAO->getNextChecksByCheckID($check_id));
    $savant->assign('guideline_rows', $guidelinesDAO->getEnabledGuidelinesByCheckID($check_id));
    $savant->assign('check_example_row', $check_example_row);
}
/*****************************/
/* template starts down here */
$savant->display('check/check_create_edit.tmpl.php');