Exemple #1
0
 * LOVD is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with LOVD.  If not, see <http://www.gnu.org/licenses/>.
 *
 *************/
define('ROOT_PATH', './');
require ROOT_PATH . 'inc-init.php';
require ROOT_PATH . 'inc-lib-form.php';
$_T->printHeader();
$_T->printTitle('Uninstall LOVD');
// Require DB admin clearance.
lovd_requireAUTH(LEVEL_ADMIN);
// If we've gotten this far, we apparently have/had an config, status and user
// table. This should suffice to uninstall LOVD even if we don't have a working
// installation.
// Uninstall lock set?
if (isset($_CONF['lock_uninstall']) && $_CONF['lock_uninstall']) {
    // Sorry, can't remove LOVD...
    lovd_showInfoTable('Can\'t uninstall LOVD - Uninstall lock in place.', 'warning');
    $_T->printFooter();
    exit;
}
if (!empty($_POST)) {
    lovd_errorClean();
    if (!isset($_GET['confirm'])) {
        // Check password.
        if (!lovd_verifyPassword($_POST['password'], $_AUTH['password'])) {
Exemple #2
0
    print '      <FORM action="' . CURRENT_PATH . '?' . ACTION . '" method="post">' . "\n";
    // Array which will make up the form table.
    $aForm = array_merge($_DATA->getForm(), array(array('', '', 'submit', 'Edit announcement')));
    lovd_viewForm($aForm);
    print '</FORM>' . "\n\n";
    $_T->printFooter();
    exit;
}
if (PATH_COUNT == 2 && ctype_digit($_PE[1]) && ACTION == 'delete') {
    // URL: /announcements/00001?delete
    // Delete a specific announcement.
    $nID = sprintf('%05d', $_PE[1]);
    define('PAGE_TITLE', 'Delete announcement #' . $nID);
    define('LOG_EVENT', 'AnnouncementDelete');
    // Require manager clearance.
    lovd_requireAUTH(LEVEL_MANAGER);
    require ROOT_PATH . 'class/object_announcements.php';
    $_DATA = new LOVD_Announcement();
    $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()) {
Exemple #3
0
      print('      <DIV id="container"><BR>' . "\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 select a variant you would like to edit', 'information');
      $_DATA->viewList($sViewListID, array('id_', 'owned_by_', 'status'), true);
      print('      </DIV>' . "\n" .
            '      <SCRIPT type="text/javascript">' . "\n" .
            '        $("#container").hide();' . "\n" .
            '      </SCRIPT>' . "\n");*/
    $_T->printFooter();
    exit;
}
if (PATH_COUNT == 3 && $_PE[1] == 'review' && ctype_digit($_PE[2]) && !ACTION) {
    // URL: /submit/review
    // Review your unfinished submission
    exit;
    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();
    if (empty($zData)) {
        define('PAGE_TITLE', 'Submit');
        $_T->printHeader();
        $_T->printTitle();
        lovd_showInfoTable('No such ID!', 'stop');
        $_T->printFooter();
        exit;
    }
    exit;
}
if (PATH_COUNT == 4 && $_PE[1] == 'finish' && in_array($_PE[2], array('individual', 'screening', 'variant', 'phenotype', 'upload', 'confirmedVariants')) && ctype_digit($_PE[3])) {
    // URL: /submit/finish/(variant|individual|screening|phenotype|upload|confirmedVariants)/00000001
    // URL: /submit/finish/(variant|individual|screening|phenotype)/00000001?edit
Exemple #4
0
    $aForm = array_merge($_DATA->getForm(), array(array('', '', 'print', '<INPUT type="submit" value="Edit phenotype information entry">' . ($bSubmit ? '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<INPUT type="submit" value="Cancel" onclick="window.location.href=\'' . lovd_getInstallURL() . 'submit/individual/' . $zData['individualid'] . '\'; return false;" style="border : 1px solid #FF4422;">' : ''))));
    lovd_viewForm($aForm);
    print '</FORM>' . "\n\n";
    $_T->printFooter();
    exit;
}
if (PATH_COUNT == 2 && ctype_digit($_PE[1]) && ACTION == 'delete') {
    // URL: /phenotypes/0000000001?delete
    // Drop specific entry.
    $nID = sprintf('%010d', $_PE[1]);
    define('PAGE_TITLE', 'Delete phenotype #' . $nID);
    define('LOG_EVENT', 'PhenotypeDelete');
    // FIXME; hier moet een goede controle komen, wanneer lager is toegestaan.
    // Load appropriate user level for this phenotype entry.
    lovd_isAuthorized('phenotype', $nID);
    lovd_requireAUTH(LEVEL_CURATOR);
    require ROOT_PATH . 'class/object_phenotypes.php';
    $_DATA = new LOVD_Phenotype('', $nID);
    $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()) {
Exemple #5
0
        $aHit = array_combine($aHeaders, explode("\"\t\"", trim($sHit, '"')));
        print '  <TR class="data" style="cursor : pointer;" onclick="window.open(\'' . htmlspecialchars($aHit['url']) . '\', \'_blank\');">' . "\n" . '    <TD>' . $aHit['hg_build'] . '</TD>' . "\n" . '    <TD>' . $aHit['gene_id'] . '</TD>' . "\n" . '    <TD>' . $aHit['nm_accession'] . '</TD>' . "\n" . '    <TD>' . $aHit['g_position'] . '</TD>' . "\n" . '    <TD>' . $aHit['DNA'] . '</TD>' . "\n" . '    <TD>' . $aHit['variant_id'] . '</TD>' . "\n" . '    <TD>' . substr($aHit['url'], 0, strpos($aHit['url'], '/variants.php')) . '</TD>' . "\n" . '  </TR>' . "\n";
    }
    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();