コード例 #1
0
ファイル: genes.php プロジェクト: LOVDnl/LOVD3
    $aForm = array_merge(array(array('POST', '', '', '', '40%', '14', '60%'), array('Emptying ' . $sID . ' gene database', 'All data associated to ' . $sID . ' will be deleted, as long as it\'s not associated with another gene. For instance, a variant that is mapped to ' . $sID . ' as well as another gene, will only lose the mapping to ' . $sID . '. A variant that is only described on ' . $sID . ' however, will be deleted. Also, an individual with a variant in ' . $sID . ', but also in another gene, will not be deleted, but the ' . $sID . ' variant data <I>will</I> be deleted. An individual that only has variants reported in ' . $sID . ' will be removed from the system.', 'print', 'Deleting ' . $nVariants . ' variant' . ($nVariants == 1 ? '' : 's') . ' and all associated data (screenings, individuals, phenotypes).<BR><B>All data (variants, screenings, individuals and phenotypes) only linked to ' . $sID . ' and not linked to any other gene will be deleted!</B>'), 'skip', array('Enter your password for authorization', '', 'password', 'password', 20), array('', '', 'submit', 'Empty gene database')));
    lovd_viewForm($aForm);
    print '</FORM>' . "\n\n";
    $_T->printFooter();
    exit;
}
if (PATH_COUNT == 2 && preg_match('/^[a-z][a-z0-9#@-]*$/i', rawurldecode($_PE[1])) && ACTION == 'delete') {
    // URL: /genes/DMD?delete
    // Drop specific entry.
    $sID = rawurldecode($_PE[1]);
    define('PAGE_TITLE', 'Delete gene information entry ' . $sID);
    define('LOG_EVENT', 'GeneDelete');
    // Require manager clearance.
    lovd_requireAUTH(LEVEL_MANAGER);
    require ROOT_PATH . 'class/object_genes.php';
    $_DATA = new LOVD_Gene();
    $zData = $_DATA->loadEntry($sID);
    // 2015-07-22; 3.0-14; Drop usage of CURRENT_PATH in favor of fixed $sID which may have a gene symbol with incorrect case.
    // Now fix possible issues with capitalization. inc-init.php does this for $_SESSION['currdb'], but we're using $sID.
    $sID = $zData['id'];
    require ROOT_PATH . 'inc-lib-form.php';
    // Check whether user has submitted and confirmed the form/action.
    $bValidPassword = false;
    $bConfirmation = !empty($_GET['confirm']);
    if (POST) {
        lovd_errorClean();
        // Mandatory fields.
        if (empty($_POST['password'])) {
            lovd_errorAdd('password', 'Please fill in the \'Enter your password for authorization\' field.');
        } elseif (!lovd_verifyPassword($_POST['password'], $_AUTH['password'])) {
            lovd_errorAdd('password', 'Please enter your correct password for authorization.');
コード例 #2
0
ファイル: screenings.php プロジェクト: LOVDnl/LOVD3
     $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';
     // VOG needs to be first, so it groups by the VOG ID.
     $_DATA = new LOVD_CustomViewList(array('VariantOnGenome', 'Scr2Var', 'VariantOnTranscript'));
     $_DATA->viewList('CustomVL_VOT_for_S_VE', array('transcriptid'), false, false, (bool) ($_AUTH['level'] >= LEVEL_MANAGER));
 }
 $_T->printFooter();
 exit;
コード例 #3
0
ファイル: variants.php プロジェクト: LOVDnl/LOVD3
     }
     $sViewListID = 'Genes_SubmitVOT' . ($_GET['target'] ? '_' . $_GET['target'] : '');
     $aOptionsList = array('width' => 600);
     $aOptionsList['options'][0]['onclick'] = 'javascript:$(\'#container\').toggle(); lovd_stretchInputs(\'' . $sViewListID . '\');';
     $aOptionsList['options'][0]['option_text'] = '<B>A variant that is located within a gene &raquo;&raquo;</B>';
     $aOptionsList['options'][1]['onclick'] = 'variants?create&amp;reference=Genome' . ($_GET['target'] ? '&amp;target=' . $_GET['target'] : '');
     $aOptionsList['options'][1]['option_text'] = '<B>A variant that was only described on genomic level &raquo;&raquo;</B>';
     if ($_AUTH['level'] >= LEVEL_MANAGER) {
         $aOptionsList['options'][2]['onclick'] = 'variants/upload?create' . ($_GET['target'] ? '&amp;target=' . $_GET['target'] : '');
         $aOptionsList['options'][2]['option_text'] = '<B>I want to upload a file with genomic variant data &raquo;&raquo;</B>';
     }
     print '      What kind of variant would you like to submit?<BR><BR>' . "\n\n";
     print lovd_buildOptionTable($aOptionsList);
     require ROOT_PATH . 'class/object_genes.php';
     $_GET['page_size'] = 10;
     $_DATA = new LOVD_Gene();
     $_DATA->setRowLink($sViewListID, 'variants?create&reference=Transcript&geneid=' . $_DATA->sRowID . ($_GET['target'] ? '&target=' . $_GET['target'] : ''));
     $_GET['search_transcripts'] = '>0';
     print '      <DIV id="container" style="display : none;">' . "\n";
     // Extra div is to prevent "No entries in the database yet!" error to show up if there are no genes in the database yet.
     lovd_showInfoTable('Please find the gene for which you wish to submit this variant below, using the search fields if needed. <B>Click on the gene to proceed to the variant entry form</B>.<BR>If a gene is not shown in this display, but it does exist in this LOVD, then it does not have a transcript configured yet.', 'information', 600);
     $_DATA->viewList($sViewListID, array('transcripts', 'variants', 'diseases_', 'updated_date_'));
     print '      </DIV>' . "\n" . (!$bSubmit ? '' : '      <INPUT type="submit" value="Cancel" onclick="window.location.href=\'' . lovd_getInstallURL() . 'submit/screening/' . $_POST['screeningid'] . '\'; return false;" style="border : 1px solid #FF4422;">' . "\n");
     $_T->printFooter();
     exit;
 } elseif (!in_array($_GET['reference'], array('Genome', 'Transcript')) || $_GET['reference'] == 'Transcript' && empty($_GET['geneid'])) {
     exit;
 }
 // URL: /variants?create&reference=('Genome'|'Transcript')
 // Create a variant on the genome.
 if ($_GET['reference'] == 'Transcript') {