// 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;"> <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); define('LOG_EVENT', 'ScreeningDelete'); lovd_isAuthorized('screening', $nID); lovd_requireAUTH(LEVEL_CURATOR); require ROOT_PATH . 'class/object_screenings.php'; $_DATA = new LOVD_Screening(); $zData = $_DATA->loadEntry($nID); require ROOT_PATH . 'inc-lib-form.php'; $a = $_DB->query('SELECT variantid, screeningid FROM ' . TABLE_SCR2VAR . ' GROUP BY variantid HAVING COUNT(screeningid) = 1 AND screeningid = ?', array($nID))->fetchAllColumn(); $aVariantsRemovable = array(); if (!empty($a)) { $aVariantsRemovable = $_DB->query('SELECT variantid FROM ' . TABLE_SCR2VAR . ' WHERE screeningid = ? AND variantid IN (?' . str_repeat(', ?', count($a) - 1) . ')', array_merge(array($nID), $a))->fetchAllColumn(); } $nVariantsRemovable = count($aVariantsRemovable); 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 (PATH_COUNT == 4 && $_PE[1] == 'individual' && ctype_digit($_PE[2]) && $_PE[3] == 'screenings' && !ACTION) { // URL: /submit/individual/00000001/screenings // Let submitter select screening to add variant to. $nID = sprintf('%08d', $_PE[2]); define('PAGE_TITLE', 'Select screening to add variant to'); $_T->printHeader(); $_T->printTitle(); $bExists = $_DB->query('SELECT COUNT(*) FROM ' . TABLE_INDIVIDUALS . ' WHERE id = ?', array($nID))->fetchColumn(); if (!$bExists || !isset($_AUTH['saved_work']['submissions']['individual'][$nID])) { lovd_showInfoTable('No such ID!', 'stop'); $_T->printFooter(); exit; } require ROOT_PATH . 'class/object_screenings.php'; $_DATA = new LOVD_Screening(); $_GET['search_individualid'] = $nID; $_GET['page_size'] = '10'; $_DATA->setRowLink('Screenings_submissions', 'variants?create&target=' . $_DATA->sRowID); $_DATA->viewList('Screenings_submissions', array('individualid', 'owned_by_', 'created_date'), false, false); $_T->printFooter(); exit; } if (PATH_COUNT == 3 && $_PE[1] == 'screening' && ctype_digit($_PE[2]) && !ACTION) { // URL: /submit/screening/00000001 // Screening submission global $_DB, $_AUTH; define('LOG_EVENT', 'SubmitScreening'); lovd_requireAUTH(LEVEL_SUBMITTER); $nID = sprintf('%010d', $_PE[2]); $zData = $_DB->query('SELECT * FROM ' . TABLE_SCREENINGS . ' WHERE id = ? AND created_by = ?', array($nID, $_AUTH['id']))->fetchAssoc();
$_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)) { require ROOT_PATH . 'class/object_screenings.php'; $_DATA = new LOVD_Screening(); $_GET['search_screeningid'] = implode('|', $aUnfinished); $_GET['page_size'] = '10'; if ($_AUTH['id'] == $nID) { $_DATA->setRowLink('Screenings_submissions', 'submit/screening/' . $_DATA->sRowID); } else { $_DATA->setRowLink('Individuals_submissions', 'screenings/' . $_DATA->sRowID); } $_DATA->viewList('Screenings_submissions', array('owned_by_', 'created_date', 'edited_date'), false, false, true, false, true); } else { lovd_showInfoTable('No submissions of variant screenings found!', 'stop'); } $_T->printFooter(); exit; } if (PATH_COUNT == 2 && ctype_digit($_PE[1]) && ACTION == 'share_access') {
$_DATA = new LOVD_Phenotype($nDiseaseID); print '<B>' . $sName . ' (<A href="diseases/' . $nDiseaseID . '">' . $sSymbol . '</A>)</B> <A href="phenotypes?create&target=' . $nID . '&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); } } unset($_GET['search_individualid']); unset($_GET['search_diseaseid']); } else { lovd_showInfoTable('No phenotypes found for this individual!', 'stop'); } if (count($zData['screeningids'])) { $_GET['search_individualid'] = $nID; print '<BR><BR>' . "\n\n"; $_T->printTitle('Screenings', 'H4'); require ROOT_PATH . 'class/object_screenings.php'; $_DATA = new LOVD_Screening(); $_DATA->setSortDefault('id'); $_DATA->viewList('Screenings_for_I_VE', array('screeningid', 'individualid', 'created_date', 'edited_date'), true, true); unset($_GET['search_individualid']); $_GET['search_screeningid'] = implode('|', $zData['screeningids']); print '<BR><BR>' . "\n\n"; $_T->printTitle('Variants', '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_I_VE', array(), false, false, (bool) ($_AUTH['level'] >= LEVEL_MANAGER)); } $_T->printFooter(); exit; } if (PATH_COUNT == 1 && ACTION == 'create') {
}); prevHash = hash; } else { // The viewList could have been resubmitted now, so reset this value (not very efficient). $( '#VOT_' + hash ).attr('class', 'data bold'); } } } </SCRIPT> <?php if (!empty($zData['screeningids'])) { $_GET['search_screeningid'] = $zData['screeningids']; print '<BR><BR>' . "\n\n"; $_T->printTitle('Screenings', 'H4'); require ROOT_PATH . 'class/object_screenings.php'; $_DATA = new LOVD_Screening(); $_DATA->viewList('Screenings_for_VOG_VE', array('individualid', 'created_date', 'edited_date'), true, true); } $_T->printFooter(); exit; } if ((empty($_PE[1]) || $_PE[1] == 'upload') && ACTION == 'create') { // URL: variants?create // URL: variants/upload?create // Detect whether a valid target screening is given. We do this here so we // don't have to duplicate this code for variants?create and variants/upload?create. // We don't want to show an error message about the screening if the user isn't allowed to come here. // 2012-07-10; 3.0-beta-07; Submitters are no longer allowed to add variants without individual data. if (!isset($_GET['target']) && !lovd_isAuthorized('gene', $_AUTH['curates'], false)) { lovd_requireAUTH(LEVEL_CURATOR); }