예제 #1
0
파일: references.php 프로젝트: LOVDnl/LOVD3
     $_T->printFooter();
     exit;
 }
 // Check which tab is active and which must be disabled. Depending on available data
 $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();
예제 #2
0
파일: screenings.php 프로젝트: LOVDnl/LOVD3
            // Because we're sending the data back to the form, I need to unset the password fields!
            unset($_POST['password']);
        }
    } else {
        // Default session values.
        $_SESSION['viewlists']['Screenings_' . $nID . '_removeVariants']['checked'] = array();
    }
    $_T->printHeader();
    $_T->printTitle();
    lovd_errorPrint();
    lovd_showInfoTable('The variant entries below are all variants that can be removed from this screening. Variants that are not also added to another screening can not be removed.', 'information');
    $_GET['page_size'] = 10;
    $_GET['search_screeningids'] = $nID;
    $_GET['search_id_'] = count($aInvalidVariants) ? '!' . implode(' !', $aInvalidVariants) : '';
    require ROOT_PATH . 'class/object_genome_variants.php';
    $_DATA = new LOVD_GenomeVariant();
    $_DATA->viewList('Screenings_' . $nID . '_removeVariants', array('id_', 'screeningids', 'chromosome'), true, false, true, false, true);
    print '      <BR><BR>' . "\n\n";
    // Table.
    print '      <FORM id="removeVariants" action="' . CURRENT_PATH . '?' . ACTION . '" method="post">' . "\n";
    // Array which will make up the form table.
    $aForm = array(array('POST', '', '', '', '0%', '0', '100%'), array('', '', 'print', 'Enter your password for authorization'), array('', '', 'password', 'password', 20), array('', '', 'print', '<INPUT type="submit" value="Save variant list" onclick="lovd_AJAX_viewListSubmit(\'Screenings_' . $nID . '_removeVariants\', function () { $(\'#removeVariants\').submit(); }); return false;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<INPUT type="submit" value="Cancel" onclick="window.location.href=\'' . lovd_getInstallURL() . ($bSubmit ? 'submit/screening/' : 'screenings/') . $nID . '\'; return false;" style="border : 1px solid #FF4422;">'));
    lovd_viewForm($aForm);
    $_T->printFooter();
    exit;
}
if (PATH_COUNT == 2 && ctype_digit($_PE[1]) && ACTION == 'delete') {
    // URL: /screenings/0000000001?delete
    // Drop specific entry.
    $nID = sprintf('%010d', $_PE[1]);
    define('PAGE_TITLE', 'Delete screening information entry ' . $nID);
예제 #3
0
파일: variants.php 프로젝트: LOVDnl/LOVD3
    }
    print '</TABLE>';
    $_T->printFooter();
    exit;
}
if (PATH_COUNT == 2 && ctype_digit($_PE[1]) && ACTION == 'map') {
    // URL: /variants/0000000001?map
    // Map a variant to additional transcript.
    $nID = sprintf('%010d', $_PE[1]);
    define('PAGE_TITLE', 'Map variant entry #' . $nID);
    define('LOG_EVENT', 'VariantMap');
    // Require manager clearance.
    lovd_isAuthorized('variant', $nID);
    lovd_requireAUTH(LEVEL_OWNER);
    require ROOT_PATH . 'class/object_genome_variants.php';
    $_DATA = new LOVD_GenomeVariant();
    $zData = $_DATA->loadEntry($nID);
    // Load all transcript ID's that are currently present in the database connected to this variant.
    $aCurrentTranscripts = $_DB->query('SELECT t.id, t.geneid FROM ' . TABLE_TRANSCRIPTS . ' AS t INNER JOIN ' . TABLE_VARIANTS_ON_TRANSCRIPTS . ' AS vot ON (t.id = vot.transcriptid) WHERE vot.id = ? ORDER BY t.geneid', array($nID))->fetchAllCombine();
    require ROOT_PATH . 'inc-lib-form.php';
    if (POST) {
        lovd_errorClean();
        // Preventing notices...
        // $_POST['transcripts'] stores the IDs of the transcripts that are supposed to go in TABLE_VARIANTS_ON_TRANSCRIPTS.
        if (empty($_POST['transcripts']) || !is_array($_POST['transcripts'])) {
            $_POST['transcripts'] = array();
        } else {
            // Verify all given IDs; they need to exist in the database, and they need to be on the same chromosome.
            $aTranscripts = $_DB->query('SELECT t.id, t.geneid FROM ' . TABLE_TRANSCRIPTS . ' AS t LEFT OUTER JOIN ' . TABLE_GENES . ' AS g ON (t.geneid = g.id) WHERE g.chromosome = ? AND t.id IN (?' . str_repeat(', ?', count($_POST['transcripts']) - 1) . ')', array_merge(array($zData['chromosome']), $_POST['transcripts']))->fetchAllCombine();
            foreach ($_POST['transcripts'] as $nTranscript) {
                if (!isset($aTranscripts[$nTranscript])) {