예제 #1
0
    // URL: /announcements/00001
    // View specific entry.
    $nID = sprintf('%05d', $_PE[1]);
    define('PAGE_TITLE', 'View announcement #' . $nID);
    $_T->printHeader();
    $_T->printTitle();
    // Require manager clearance.
    lovd_requireAUTH(LEVEL_MANAGER);
    require ROOT_PATH . 'class/object_announcements.php';
    $_DATA = new LOVD_Announcement();
    $zData = $_DATA->viewEntry($nID);
    $aNavigation = array();
    // Authorized user is logged in. Provide tools.
    $aNavigation[CURRENT_PATH . '?edit'] = array('menu_edit.png', 'Edit announcement', 1);
    $aNavigation[CURRENT_PATH . '?delete'] = array('cross.png', 'Delete announcement', 1);
    lovd_showJGNavigation($aNavigation, 'Announcements');
    $_T->printFooter();
    exit;
}
if (PATH_COUNT == 1 && ACTION == 'create') {
    // URL: /announcements?create
    // URL: /announcements?register
    // Create a new announcement.
    define('LOG_EVENT', 'AnnouncementCreate');
    define('PAGE_TITLE', 'Create a new announcement');
    // Require manager clearance.
    lovd_requireAUTH(LEVEL_MANAGER);
    require ROOT_PATH . 'class/object_announcements.php';
    $_DATA = new LOVD_Announcement();
    require ROOT_PATH . 'inc-lib-form.php';
    if (!empty($_POST)) {
예제 #2
0
파일: columns.php 프로젝트: LOVDnl/LOVD3
    $_DATA = new LOVD_Column();
    $zData = $_DATA->viewEntry($sColumnID);
    $aTableInfo = lovd_getTableInfoByCategory($zData['category']);
    $aNavigation = array();
    if ($_AUTH['level'] >= LEVEL_MANAGER || $aTableInfo['shared'] && $_AUTH['level'] >= LEVEL_CURATOR) {
        // Authorized user (admin or manager, or curator in case of shared column) is logged in. Provide tools.
        // FIXME; needs exact check if there are genes/diseases left that do not have this column.
        // A check on 'active' is way too simple and does not work for shared columns.
        $aNavigation[CURRENT_PATH . '?add'] = array('menu_plus.png', 'Enable column', !$zData['active'] || $aTableInfo['shared'] ? 1 : 0);
        $aNavigation[CURRENT_PATH . '?remove'] = array('cross.png', 'Disable column' . ($aTableInfo['shared'] ? '' : ' and remove values'), $zData['active'] && !$zData['hgvs'] ? 1 : 0);
        $aNavigation[CURRENT_PATH . '?delete'] = array('cross.png', 'Delete column', !$zData['active'] && !$zData['hgvs'] && (int) $zData['created_by'] ? 1 : 0);
        $aNavigation[CURRENT_PATH . '?edit'] = array('menu_edit.png', 'Edit custom data column settings', $_AUTH['level'] >= LEVEL_MANAGER);
        $aNavigation[$_PE[0] . '/' . $zData['category'] . '?order'] = array('menu_columns.png', 'Re-order all ' . $zData['category'] . ' columns', $_AUTH['level'] >= LEVEL_MANAGER);
        // $aNavigation[$_SERVER['PHP_SELF'] . '?action=edit_colid&edit_colid=' . rawurlencode($zData['colid'])] = array('menu_edit.png', 'Edit column ID', ($zData['created_by'] && !$bSelected? 1 : 0));
    }
    lovd_showJGNavigation($aNavigation, 'Columns');
    $_T->printFooter();
    exit;
}
if (PATH_COUNT == 2 && ACTION == 'order') {
    // URL: /columns/Individual?order
    // Change in what order the columns will be shown in a viewList/viewEntry.
    $sCategory = $_PE[1];
    require_once ROOT_PATH . 'inc-lib-columns.php';
    $aTableInfo = lovd_getTableInfoByCategory($sCategory);
    if (!$aTableInfo) {
        $_T->printHeader();
        $_T->printTitle('Re-order columns');
        lovd_showInfoTable('The specified category does not exist!', 'stop');
        $_T->printFooter();
        exit;
예제 #3
0
파일: phenotypes.php 프로젝트: LOVDnl/LOVD3
    // Load appropriate user level for this phenotype entry.
    lovd_isAuthorized('phenotype', $nID);
    require ROOT_PATH . 'class/object_phenotypes.php';
    $_DATA = new LOVD_Phenotype('', $nID);
    $zData = $_DATA->viewEntry($nID);
    $aNavigation = array();
    if ($_AUTH && $_AUTH['level'] >= LEVEL_OWNER) {
        $aNavigation[CURRENT_PATH . '?edit'] = array('menu_edit.png', 'Edit phenotype information', 1);
        if ($zData['statusid'] < STATUS_OK && $_AUTH['level'] >= LEVEL_CURATOR) {
            $aNavigation[CURRENT_PATH . '?publish'] = array('check.png', ($zData['statusid'] == STATUS_MARKED ? 'Remove mark from' : 'Publish (curate)') . ' phenotype entry', 1);
        }
        if ($_AUTH['level'] >= LEVEL_CURATOR) {
            $aNavigation[CURRENT_PATH . '?delete'] = array('cross.png', 'Delete phenotype entry', 1);
        }
    }
    lovd_showJGNavigation($aNavigation, 'Phenotypes');
    $_T->printFooter();
    exit;
}
if (PATH_COUNT == 1 && ACTION == 'create' && !empty($_GET['target']) && ctype_digit($_GET['target'])) {
    // URL: /phenotypes?create
    // Create a new entry.
    // FIXME; ik vind nog steeds dat vooral het begin van deze code nog enigszins rommelig is.
    //   De structuur van de code voor de controle van de individual ID en het invullen er van,
    //   is goed af te leiden van transcripts?create.
    define('LOG_EVENT', 'PhenotypeCreate');
    lovd_requireAUTH(LEVEL_SUBMITTER);
    $_GET['target'] = sprintf('%08d', $_GET['target']);
    $z = $_DB->query('SELECT id FROM ' . TABLE_INDIVIDUALS . ' WHERE id = ?', array($_GET['target']))->fetchAssoc();
    if (!$z) {
        define('PAGE_TITLE', 'Create a new phenotype entry');
예제 #4
0
    $nID = sprintf('%08d', $_PE[1]);
    define('PAGE_TITLE', 'View transcript #' . $nID);
    $_T->printHeader();
    $_T->printTitle();
    // Load appropriate user level for this transcript.
    lovd_isAuthorized('transcript', $nID);
    // This call will make database queries if necessary.
    require ROOT_PATH . 'class/object_transcripts.php';
    $_DATA = new LOVD_Transcript();
    $zData = $_DATA->viewEntry($nID);
    $aNavigation = array();
    if ($_AUTH && $_AUTH['level'] >= LEVEL_CURATOR) {
        $aNavigation[CURRENT_PATH . '?edit'] = array('menu_edit.png', 'Edit transcript information', 1);
        $aNavigation[CURRENT_PATH . '?delete'] = array('cross.png', 'Delete transcript entry', 1);
    }
    lovd_showJGNavigation($aNavigation, 'Transcripts');
    $_GET['search_transcriptid'] = $nID;
    print '<BR><BR>' . "\n\n";
    $_T->printTitle('Variants', 'H4');
    require ROOT_PATH . 'class/object_transcript_variants.php';
    $_DATA = new LOVD_TranscriptVariant($zData['geneid']);
    $_DATA->sSortDefault = 'VariantOnTranscript/DNA';
    $_DATA->setRowLink('VOT_for_T_VE', 'javascript:window.location.href=\'' . lovd_getInstallURL() . 'variants/{{ID}}#{{transcriptid}}\'; return false');
    $_DATA->viewList('VOT_for_T_VE', array('geneid', 'transcriptid', 'id_ncbi', 'id_'));
    $_T->printFooter();
    exit;
}
if (PATH_COUNT == 2 && !ctype_digit($_PE[1]) && !ACTION) {
    // URL: /transcripts/NM_004006.2
    // Try to find a transcripts by its NCBI ID and forward.
    // When we have multiple hits, refer to listView.
예제 #5
0
파일: screenings.php 프로젝트: LOVDnl/LOVD3
 lovd_isAuthorized('screening', $nID);
 require ROOT_PATH . 'class/object_screenings.php';
 $_DATA = new LOVD_Screening($nID);
 $zData = $_DATA->viewEntry($nID);
 $aNavigation = array();
 if ($_AUTH && $_AUTH['level'] >= LEVEL_OWNER) {
     $aNavigation[CURRENT_PATH . '?edit'] = array('menu_edit.png', 'Edit screening information', 1);
     if ($zData['variants_found']) {
         $aNavigation['variants?create&amp;target=' . $nID] = array('menu_plus.png', 'Add variant to screening', 1);
         $aNavigation[CURRENT_PATH . '?removeVariants'] = array('cross.png', 'Remove variants from screening', $zData['variants_found_'] > 0 ? 1 : 0);
     }
     if ($_AUTH['level'] >= LEVEL_CURATOR) {
         $aNavigation[CURRENT_PATH . '?delete'] = array('cross.png', 'Delete screening entry', 1);
     }
 }
 lovd_showJGNavigation($aNavigation, 'Screenings');
 if (!empty($zData['search_geneid'])) {
     $_GET['search_geneid'] = html_entity_decode(rawurldecode($zData['search_geneid']));
     print '<BR><BR>' . "\n\n";
     $_T->printTitle('Genes screened', 'H4');
     require ROOT_PATH . 'class/object_genes.php';
     $_DATA = new LOVD_Gene();
     $_DATA->setSortDefault('id');
     $_DATA->viewList('Genes_for_S_VE', array(), true, true);
     unset($_GET['search_geneid']);
 }
 if ($zData['variants_found'] || !empty($zData['variants'])) {
     $_GET['search_screeningid'] = $nID;
     print '<BR><BR>' . "\n\n";
     $_T->printTitle('Variants found', 'H4');
     require ROOT_PATH . 'class/object_custom_viewlists.php';
예제 #6
0
파일: diseases.php 프로젝트: LOVDnl/LOVD3
    $aCol = $_PE;
    unset($aCol[0], $aCol[1], $aCol[2]);
    // 'diseases/00001/columns';
    $sColumnID = implode('/', $aCol);
    define('PAGE_TITLE', 'View settings for custom data column ' . $sColumnID . ' for ' . $sUnit . ' #' . $sParentID);
    $_T->printHeader();
    $_T->printTitle();
    // Load appropriate user level for this gene.
    lovd_isAuthorized($sUnit, $sParentID);
    lovd_requireAUTH(LEVEL_CURATOR);
    // Will also stop user if gene given is fake.
    require ROOT_PATH . 'class/object_shared_columns.php';
    $_DATA = new LOVD_SharedColumn($sParentID, $sCategory . '/' . $sColumnID);
    $zData = $_DATA->viewEntry($sCategory . '/' . $sColumnID);
    $aNavigation = array(CURRENT_PATH . '?edit' => array('menu_edit.png', 'Edit settings for this ' . $sUnit . ' only', 1), 'columns/' . $sCategory . '/' . $sColumnID . '?remove&amp;target=' . $sParentID => array('cross.png', 'Remove column from this ' . $sUnit, !$zData['hgvs']));
    lovd_showJGNavigation($aNavigation, 'ColumnEdit');
    $_T->printFooter();
    exit;
}
if (PATH_COUNT > 3 && ctype_digit($_PE[1]) && $_PE[2] == 'columns' && ACTION == 'edit') {
    // URL: /diseases/00001/columns/IQ?edit
    // URL: /diseases/00001/columns/Blood_pressure/Systolic?edit
    // View specific enabled column for this disease.
    $sUnit = 'disease';
    $sCategory = 'Phenotype';
    $sParentID = rawurldecode($_PE[1]);
    $aCol = $_PE;
    unset($aCol[0], $aCol[1], $aCol[2]);
    // 'diseases/00001/columns';
    $sColumnID = implode('/', $aCol);
    define('PAGE_TITLE', 'Edit settings for custom data column ' . $sColumnID . ' for ' . $sUnit . ' #' . $sParentID);
예제 #7
0
 $aNavigation = array();
 if ($_AUTH && $_AUTH['level'] >= LEVEL_OWNER) {
     $aNavigation[CURRENT_PATH . '?edit'] = array('menu_edit.png', 'Edit individual entry', 1);
     if ($zData['statusid'] < STATUS_OK && $_AUTH['level'] >= LEVEL_CURATOR) {
         $aNavigation[CURRENT_PATH . '?publish'] = array('check.png', ($zData['statusid'] == STATUS_MARKED ? 'Remove mark from' : 'Publish (curate)') . ' individual entry', 1);
     }
     // You can only add phenotype information to this individual, when there are phenotype columns enabled.
     if ($_DB->query('SELECT COUNT(*) FROM ' . TABLE_IND2DIS . ' AS i2d INNER JOIN ' . TABLE_SHARED_COLS . ' AS sc USING(diseaseid) WHERE i2d.individualid = ?', array($nID))->fetchColumn()) {
         $aNavigation['phenotypes?create&amp;target=' . $nID] = array('menu_plus.png', 'Add phenotype information to individual', 1);
     }
     $aNavigation['screenings?create&amp;target=' . $nID] = array('menu_plus.png', 'Add screening to individual', 1);
     if ($_AUTH['level'] >= LEVEL_CURATOR) {
         $aNavigation[CURRENT_PATH . '?delete'] = array('cross.png', 'Delete individual entry', 1);
     }
 }
 lovd_showJGNavigation($aNavigation, 'Individuals');
 print '<BR><BR>' . "\n\n";
 if (!empty($zData['phenotypes'])) {
     // List of phenotype entries associated with this person, per disease.
     $_GET['search_individualid'] = $nID;
     $_T->printTitle('Phenotypes', 'H4');
     // Repeat searching for diseases, since this individual might have phenotype entry for a disease he doesn't have.
     $zData['diseases'] = $_DB->query('SELECT id, symbol, name FROM ' . TABLE_DISEASES . ' WHERE id IN (?' . str_repeat(', ?', count($zData['phenotypes']) - 1) . ')', $zData['phenotypes'])->fetchAllRow();
     require ROOT_PATH . 'class/object_phenotypes.php';
     foreach ($zData['diseases'] as $aDisease) {
         list($nDiseaseID, $sSymbol, $sName) = $aDisease;
         if (in_array($nDiseaseID, $zData['phenotypes'])) {
             $_GET['search_diseaseid'] = $nDiseaseID;
             $_DATA = new LOVD_Phenotype($nDiseaseID);
             print '<B>' . $sName . ' (<A href="diseases/' . $nDiseaseID . '">' . $sSymbol . '</A>)</B>&nbsp;&nbsp;<A href="phenotypes?create&amp;target=' . $nID . '&amp;diseaseid=' . $nDiseaseID . '"><IMG src="gfx/plus.png"></A> Add phenotype for this disease';
             $_DATA->viewList('Phenotypes_for_I_VE_' . $nDiseaseID, array('phenotypeid', 'individualid', 'diseaseid'), true, true);
예제 #8
0
파일: users.php 프로젝트: LOVDnl/LOVD3
            // FIXME; this image is actually too small but it doesn't look too bad.
        }
        $aNavigation[CURRENT_PATH . '?delete'] = array('cross.png', 'Delete user', 1);
        $aNavigation['download/all/user/' . $nID] = array('menu_save.png', 'Download all this user\'s data', 1);
    } elseif ($_AUTH['id'] == $nID) {
        // Viewing himself!
        $aNavigation[CURRENT_PATH . '?edit'] = array('menu_edit.png', 'Update your registration', 1);
        $aNavigation['download/all/mine'] = array('menu_save.png', 'Download all my data', 1);
    } elseif ($_AUTH['level'] >= LEVEL_MANAGER) {
        // Managers and up, not viewing own account, not higher level than other user.
        $aNavigation['download/all/user/' . $nID] = array('menu_save.png', 'Download all this user\'s data', 1);
    }
    if ($_AUTH['id'] == $nID || $_AUTH['level'] > $zData['level']) {
        $aNavigation[CURRENT_PATH . '?share_access'] = array('', 'Share access to ' . ($_AUTH['id'] == $nID ? 'your' : 'user\'s') . ' entries with other users', 1);
    }
    lovd_showJGNavigation($aNavigation, 'Users');
    if ($_AUTH['level'] >= LEVEL_MANAGER) {
        print '<BR><BR>' . "\n\n";
        $_T->printTitle('Log entries by this user', 'H4');
        require ROOT_PATH . 'class/object_logs.php';
        $_DATA = new LOVD_Log();
        $_GET['page_size'] = 10;
        $_GET['search_userid'] = $nID;
        $_DATA->viewList('Logs_for_Users_VE', array('user_', 'del'), true);
    }
    $_T->printFooter();
    exit;
}
if (PATH_COUNT == 1 && in_array(ACTION, array('create', 'register'))) {
    // URL: /users?create
    // URL: /users?register
예제 #9
0
파일: variants.php 프로젝트: LOVDnl/LOVD3
            // FIXME; For loading the BED file, we'll need a gene symbol!
            //            $sURLBedFile = rawurlencode(str_replace('https://', 'http://', ($_CONF['location_url']? $_CONF['location_url'] : lovd_getInstallURL())) . 'api/rest/variants/' . $zData['id'] . '?format=text/bed');
            //            $sURLUCSC = 'http://genome.ucsc.edu/cgi-bin/hgTracks?clade=mammal&amp;org=Human&amp;db=' . $_CONF['refseq_build'] . '&amp;position=chr' . $zData['chromosome'] . ':' . ($zData['position_g_mrna_start'] - 50) . '-' . ($zData['position_g_mrna_end'] + 50) . ($zData['sense']? '' : '&amp;complement_hg19=1') . '&amp;hgt.customText=' . $sURLBedFile;
            //            $zData['ucsc'] = 'Show variants in the UCSC Genome Browser (<A href="' . $sURLUCSC . '" target="_blank">full view</A>, <A href="' . $sURLUCSC . rawurlencode('&visibility=4') . '" target="_blank">compact view</A>)';
            //            // The weird addition in the end is to fake a proper name in Ensembl.
            //            if ($_CONF['refseq_build'] == 'hg18') {
            //                $sURLEnsembl = 'http://may2009.archive.ensembl.org/Homo_sapiens/Location/View?r=' . $zData['chromosome'] . ':' . ($zData['position_g_mrna_start'] - 50) . '-' . ($zData['position_g_mrna_end'] + 50) . ';data_URL=' . $sURLBedFile . rawurlencode('&name=/' . $zData['id'] . ' variants');
            //                //} elseif ($_CONF['refseq_build'] == 'hg19') {
            //            } else {
            //                $sURLEnsembl = 'http://www.ensembl.org/Homo_sapiens/Location/View?r=' . $zData['chromosome'] . ':' . ($zData['position_g_mrna_start'] - 50) . '-' . ($zData['position_g_mrna_end'] + 50) . ';contigviewbottom=url:' . $sURLBedFile . rawurlencode('&name=/' . $zData['id'] . ' variants');
            //            }
            //            $zData['ensembl'] = 'Show variants in the Ensembl Genome Browser (<A href="' . $sURLEnsembl . '=labels" target="_blank">full view</A>, <A href="' . $sURLEnsembl . '=normal" target="_blank">compact view</A>)';
            //            $zData['ncbi'] = 'Show distribution histogram of variants in the <A href="http://www.ncbi.nlm.nih.gov/projects/sviewer/?id=' . $_SETT['human_builds'][$_CONF['refseq_build']]['ncbi_sequences'][$zData['chromosome']] . '&amp;v=' . ($zData['position_g_mrna_start'] - 100) . ':' . ($zData['position_g_mrna_end'] + 100) . '&amp;content=7&amp;url=' . $sURLBedFile . '" target="_blank">NCBI Sequence Viewer</A>';
        }
    }
    lovd_showJGNavigation($aNavigation, 'Variants');
    print '      <BR><BR>' . "\n\n" . '      <DIV id="viewentryDiv">' . "\n" . '      </DIV>' . "\n\n";
    $_GET['search_id_'] = $nID;
    print '      <BR><BR>' . "\n\n";
    $_T->printTitle('Variant on transcripts', 'H4');
    require ROOT_PATH . 'class/object_transcript_variants.php';
    $_DATA = new LOVD_TranscriptVariant('', $nID);
    $_DATA->setRowID('VOT_for_VOG_VE', 'VOT_{{transcriptid}}');
    $_DATA->setRowLink('VOT_for_VOG_VE', 'javascript:window.location.hash = \'{{transcriptid}}\'; return false');
    $_DATA->viewList('VOT_for_VOG_VE', array('id_', 'transcriptid', 'status'), true, true);
    unset($_GET['search_id_']);
    ?>

      <SCRIPT type="text/javascript">
        var prevHash = '';
        $( function () {
예제 #10
0
파일: links.php 프로젝트: LOVDnl/LOVD3
    // URL: /links/001
    // View specific entry.
    $nID = sprintf('%03d', $_PE[1]);
    define('PAGE_TITLE', 'View custom link #' . $nID);
    $_T->printHeader();
    $_T->printTitle();
    // Require manager clearance.
    lovd_requireAUTH(LEVEL_MANAGER);
    require ROOT_PATH . 'class/object_links.php';
    $_DATA = new LOVD_Link();
    $zData = $_DATA->viewEntry($nID);
    $aNavigation = array();
    // Authorized user (admin or manager) is logged in. Provide tools.
    $aNavigation[CURRENT_PATH . '?edit'] = array('menu_edit.png', 'Edit custom link', 1);
    $aNavigation[CURRENT_PATH . '?delete'] = array('cross.png', 'Delete custom link', 1);
    lovd_showJGNavigation($aNavigation, 'Links');
    $_T->printFooter();
    exit;
}
if (PATH_COUNT == 1 && ACTION == 'create') {
    // URL: /links?create
    // Create a new entry.
    define('PAGE_TITLE', 'Create a new custom link');
    define('LOG_EVENT', 'LinkCreate');
    // Require manager clearance.
    lovd_requireAUTH(LEVEL_MANAGER);
    require ROOT_PATH . 'class/object_links.php';
    $_DATA = new LOVD_Link();
    require ROOT_PATH . 'inc-lib-form.php';
    if (!empty($_POST)) {
        lovd_errorClean();