Ejemplo n.º 1
0
    $nActiveTab = 0;
    $nDisabledTab = null;
    if (empty($aCategories['Individual'])) {
        $nActiveTab = 0;
        $nDisabledTab = 1;
    } elseif (empty($aCategories['VariantOnGenome'])) {
        $nActiveTab = 1;
        $nDisabledTab = 0;
    }
    if (!empty($aCategories['VariantOnGenome'])) {
        require ROOT_PATH . 'class/object_genome_variants.php';
        $_DATAvariants = new LOVD_GenomeVariant();
    }
    if (!empty($aCategories['Individual'])) {
        require ROOT_PATH . 'class/object_individuals.php';
        $_DATAindividuals = new LOVD_Individual();
    }
    print '   <SCRIPT type="text/javascript">' . "\n" . '       $(function() {' . "\n" . '           $("#tabs").tabs({active: ' . $nActiveTab . ', disabled: [' . $nDisabledTab . ']});' . "\n" . '       });' . "\n" . '   </SCRIPT>' . "\n" . '   <DIV id="tabs">' . "\n" . '       <UL>' . "\n" . '           <LI><A href="' . lovd_getInstallURL() . implode('/', $_PE) . '#tabs-variants">Variants</A></LI>' . "\n" . '           <LI><A href="' . lovd_getInstallURL() . implode('/', $_PE) . '#tabs-individuals">Individuals</A></LI>' . "\n" . '       </UL>' . "\n" . '       <DIV id="tabs-variants">' . "\n";
    if (!empty($_DATAvariants)) {
        $_DATAvariants->viewList('Variants_per_reference', $aColsToHide['VariantOnGenome'], true, true);
    }
    print '       </DIV>' . "\n" . '       <DIV id="tabs-individuals">' . "\n";
    if (!empty($_DATAindividuals)) {
        $_DATAindividuals->viewList('Individuals_per_reference', $aColsToHide['Individual'], true, true);
    }
    print '       </DIV>' . "\n" . '   </DIV>';
    $_T->printFooter();
    exit;
}
if ($bImage) {
    header('Content-type: image/png');
Ejemplo n.º 2
0
    lovd_viewForm($aForm);
    print '</FORM>' . "\n\n";
    $_T->printFooter();
    exit;
}
if (PATH_COUNT == 2 && ctype_digit($_PE[1]) && ACTION == 'delete') {
    // URL: /individuals/00000001?delete
    // Drop specific entry.
    $nID = sprintf('%08d', $_PE[1]);
    define('PAGE_TITLE', 'Delete individual information entry ' . $nID);
    define('LOG_EVENT', 'IndividualDelete');
    // FIXME: What if individual also contains other user's data?
    lovd_isAuthorized('individual', $nID);
    lovd_requireAUTH(LEVEL_CURATOR);
    require ROOT_PATH . 'class/object_individuals.php';
    $_DATA = new LOVD_Individual();
    $zData = $_DATA->loadEntry($nID);
    require ROOT_PATH . 'inc-lib-form.php';
    if (!empty($_POST)) {
        lovd_errorClean();
        // Mandatory fields.
        if (empty($_POST['password'])) {
            lovd_errorAdd('password', 'Please fill in the \'Enter your password for authorization\' field.');
        }
        // User had to enter his/her password for authorization.
        if ($_POST['password'] && !lovd_verifyPassword($_POST['password'], $_AUTH['password'])) {
            lovd_errorAdd('password', 'Please enter your correct password for authorization.');
        }
        if (!lovd_error()) {
            // Query text.
            // This also deletes the entries in TABLE_PHENOTYPES && TABLE_SCREENINGS && TABLE_SCR2VAR && TABLE_SCR2GENES.
Ejemplo n.º 3
0
        }
        if ($_AUTH['level'] >= LEVEL_MANAGER || $bDelete) {
            $aNavigation[CURRENT_PATH . '?delete'] = array('cross.png', 'Delete disease entry', 1);
        }
        $aNavigation[CURRENT_PATH . '/columns'] = array('menu_columns.png', 'View enabled phenotype columns', 1);
        $aNavigation[CURRENT_PATH . '/columns?order'] = array('menu_columns.png', 'Re-order enabled phenotype columns', 1);
        $aNavigation['columns/Phenotype'] = array('menu_columns.png', 'View all available phenotype columns', 1);
        $aNavigation['phenotypes/disease/' . $nID] = array('menu_magnifying_glass.png', 'View all phenotype entries for this disease', 1);
    }
    lovd_showJGNavigation($aNavigation, 'Diseases');
    if ($zData['individuals']) {
        $_GET['search_diseaseids'] = $nID;
        print '<BR><BR>' . "\n\n";
        $_T->printTitle('Individuals', 'H4');
        require ROOT_PATH . 'class/object_individuals.php';
        $_DATA = new LOVD_Individual();
        $_DATA->setSortDefault('id');
        $_DATA->viewList('Individuals_for_D_VE', array('panelid', 'diseaseids'), true, false, (bool) ($_AUTH['level'] >= LEVEL_MANAGER), false, true);
    }
    $_T->printFooter();
    exit;
}
if (PATH_COUNT == 2 && !ctype_digit($_PE[1]) && !ACTION) {
    // URL: /diseases/DMD
    // Try to find a disease by its abbreviation and forward.
    // When we have multiple hits, refer to listView.
    $sID = rawurldecode($_PE[1]);
    $aDiseases = $_DB->query('SELECT id FROM ' . TABLE_DISEASES . ' WHERE symbol = ?', array($sID))->fetchAllColumn();
    $n = count($aDiseases);
    if (!$n) {
        define('PAGE_TITLE', 'View disease');
Ejemplo n.º 4
0
 } else {
     // Require manager clearance.
     lovd_requireAUTH(LEVEL_MANAGER);
     lovd_showInfoTable('Below are lists of this user\'s unfinished submissions', 'information');
 }
 $zData = $_DB->query('SELECT saved_work FROM ' . TABLE_USERS . ' WHERE id = ?', array($nID), false)->fetchAssoc();
 if (!empty($zData['saved_work'])) {
     $zData['saved_work'] = unserialize($zData['saved_work']);
 } else {
     $zData['saved_work'] = array();
 }
 $_T->printTitle('Individuals', 'H4');
 $aUnfinished = !empty($zData['saved_work']['submissions']['individual']) ? array_keys($zData['saved_work']['submissions']['individual']) : array();
 if (!empty($aUnfinished)) {
     require ROOT_PATH . 'class/object_individuals.php';
     $_DATA = new LOVD_Individual();
     $_GET['search_individualid'] = implode('|', $aUnfinished);
     $_GET['page_size'] = '10';
     if ($_AUTH['id'] == $nID) {
         $_DATA->setRowLink('Individuals_submissions', 'submit/individual/' . $_DATA->sRowID);
     } else {
         $_DATA->setRowLink('Individuals_submissions', 'individuals/' . $_DATA->sRowID);
     }
     $_DATA->viewList('Individuals_submissions', array('individualid', 'diseaseids', 'owned_by_', 'status'), false, false, true, false, true);
     unset($_GET['search_individualid']);
 } else {
     lovd_showInfoTable('No submissions of individuals found!', 'stop');
 }
 $_T->printTitle('Screenings', 'H4');
 $aUnfinished = !empty($zData['saved_work']['submissions']['screening']) ? array_keys($zData['saved_work']['submissions']['screening']) : array();
 if (!empty($aUnfinished)) {