Unverified Commit 9eb97190 authored by Ivo Fokkema's avatar Ivo Fokkema Committed by GitHub

Merge pull request #398 from LOVDnl/release/3.0-22

Release 3.0-22.
parents 4537ce05 c18eb464
This diff is collapsed.
Release LOVD?
=============
Did you run all unit tests?
Changed something? Change the manual, too! Don't forget setting the LOVD version and last updated time in the manual, too!!!
Check changelog and release date in it (and don't use "mutation") && inc-upgrade.php, edit inc-init.php, update manual PDF size in docs/index.php.
If bugs have been closed, mark them in the changelog.
git pull, git commit, git log, git tag -a -m 'Tag 3.0-15' '3.0-15', git push, git push --tags
ER MOGEN GEEN ONGECOMMITTE CHANGES IN STAAN IN DEZE STAP (INCL. NIEUWE FILES!!!), TENZIJ GEMARKEERD ALS DMD_SPECIFIC, ANDERS WORDEN DEZE GEPACKAGED!!!
Run package script, follow instructions.
......@@ -11,10 +9,9 @@ Update download.php, news.php (mark closed bugs), package_update.php, sync docs
Update LOVD installations:
(De LOVD3 databases zouden misschien een eigen /www/LOVD_upgrade.php versie moeten krijgen?)
/antwerpen/ heeft aangepaste .htaccess.
/DNA_profiles/ heeft aangepaste index.php.
/my_genome/ heeft veel aangepaste files (ajax/map_variants.php, ajax/viewlist.php, class/object_custom_viewlist.php, class/object_genes.php, class/object_individuals.php, individuals.php, screenings.php, variants.php), NOOIT ZOMAAR OVERSCHRIJVEN!!! Also this install no longer has a key on id_ncbi, because duplicate values already existed (????????) and altering the table in any way (to increase the transcriptid length) was rejected because of this.
/shared/ heeft een aangepaste ajax/viewlist.php, class/template.php, import.php en individuals.php en een paar eigen files die niet overschreven mag worden (zoals export.php).
/shared/ heeft een aangepaste class/template.php, download.php, import.php en individuals.php en een paar eigen files die niet overschreven mag worden (zoals export.php).
/whole_genome/ heeft aangepaste files (class/api.php, class/object_custom_viewlists.php, class/object_genes.php, class/object_genome_variants.php, class/template.php, api.php, genes.php, variants.php), NOOIT ZOMAAR OVERSCHRIJVEN!!!
After updating all installations, send email to team with all improvements summarized.
......@@ -29,11 +26,6 @@ Columns we no longer use that can be removed:
- TABLE_TRANSCRIPTS/id_mutalyzer
- TABLE_USERS/reference
\item[$\circ$] LSDB list: Adding data from dead LSDBs: Brenda?
Website:
- Create search interface w/ Ajax for ww query service, but in a secure way, so it can't be abused.
- Access sharing: Users zouden moeten worden gesorteerd op naam.
- Gerard: Als ik bij (bijv.) Age examined (Phenotype) '<00y' invul, dus onderzoek aan een ongeboren kind, komt er '<00y (before )' te staan, zou dit '<00y (before birth)' moeten zijn?
......
......@@ -4,7 +4,7 @@
* LEIDEN OPEN VARIATION DATABASE (LOVD)
*
* Created : 2010-02-18
* Modified : 2019-08-28
* Modified : 2019-10-01
* For LOVD : 3.0-22
*
* Copyright : 2004-2019 Leiden University Medical Center; http://www.LUMC.nl/
......@@ -256,9 +256,18 @@ if (POST && ACTION == 'applyFR') {
die(AJAX_DATA_ERROR);
}
// Restrict the columns of this VL, if given.
if (LOVD_plus && isset($_INSTANCE_CONFIG['viewlists'][$_GET['viewlistid']]['cols_to_show'])) {
$_DATA->setViewListCols($_INSTANCE_CONFIG['viewlists'][$_GET['viewlistid']]['cols_to_show']);
}
// Show the viewlist.
// Parameters are assumed to be in $_SESSION, only cols_to_skip can be overridden. This is for the external viewer.
$aOptions = array();
// Parameters could be assumed to be in $_SESSION. However, certain options we send through here.
// only_rows is checked and sent here because of the logs retrieving single rows from the next page.
// cols_to_skip can be overridden for the external viewer.
$aOptions = array(
'only_rows' => (!empty($_GET['only_rows'])),
);
if ($aColsToSkip) {
// Don't let the requested list of columns overwrite the original one. Only additional columns may be hidden.
$aOptions['cols_to_skip'] = array_unique(array_merge(
......
......@@ -4,6 +4,84 @@
*
*************/
/***************************
* 3.0 Build 22 (tag:3.0-22)
* 2019-10-02
*********/
* Fixed bug; Curators were no longer able to see non-public individuals in the
gene-specific Individual view.
* Fixed bug; Submitters could submit data without a variant effect by disabling
all transcripts of the gene they selected.
* Sending format=application/json in GET queries to the LOVD2-style API will
make the API return JSON.
Closes #348: "Make current REST API reply in JSON, too".
* Included version 3.0-22 of the official LOVD Reference Sequence Parser
script.
- Updated the script to only show transcripts of the gene passed to it.
Closes #314: "Refseq parser widget hangs in Firefox 57".
* Fixed bug; When confirming variants with a different screening, but not
selecting any variants, a query error occured.
- Also, when confirming variants with another screening, clicking the row no
longer forwards to that variant. It now captures the click and switches the
row's checkbox.
Closes #289: "Improve confirming a variant with a screening".
* Fixed bug; Incomplete custom links could break the unique variant view's
HTML.
* Various improvements to the submission API.
- Added support for dbSNP IDs, PubMed links, Genetic origin and Pathogenicity
and Variant comments.
- Fixed a minor data formatting bug in HPO terms.
- Added some automated data formatting for RNA and protein fields.
- If a gene is given for a variant, and it exists in LOVD, it must match with
the given transcript.
* Fix broken links to the gene pages on the HGNC website after their updates.
* Made several improvements to the speed of LOVD. Improved the speed of the
update import, the Individual listings on Disease pages, and complex Variant
listings.
Closes #386: "The variants/in_gene page is extremely slow on the GV shared".
* Fix username field to also allow for an email address.
* Fixed bug in Find & Replace; Selection lists were not compared correctly.
* Fixed bug; Delins variants were recognized as deletions in the statistics.
* Allow some support for JSON data in LOVD3 data fields. If the fields contain
JSON data, LOVD will format the data nicely and will not display the full
contents in data listings.
* Included version 3.0-22 of the official LOVD Reading Frame Checker.
- Updated the HGVS description of the DNA change to the new HGVS format.
* Fixed bug; The variant mapper didn't fill in the variant effect on the new
transcript mappings, but left it at its default.
* Several improvements to the download feature.
- The public gene-specific downloads had some system columns included.
- A download will now no longer show inactive Phenotype and
VariantOnTranscript columns, if filters are active for Diseases or Genes,
respectively.
* When creating a transcript without selecting a gene first, LOVD no longer
uses a dropdown but instead uses a more efficient data listing.
* Enlarge the DNA and protein fields to support longer insertions.
Closes #251: "VariantOnGenome/DNA field in lovd_variants table too small by
default".
* Allow for publisher and journal-specific queries using the DOI reference
search.
Closes #257: "Make DOI reference search be partial if requested".
* Updated the LOVD2 to LOVD3 converter; It can now also handle DOIs, updated
column mappings and handling, added support for converting phenotype OMIM IDs
to LOVD3 Diseases.
* Changed the icon of the update checker when there are no updates available,
and added Alt and Title tags.
* Fixed security issue in loading the authorization for ViewLists, which
allowed Curators to craft special requests to load data listings with
non-public data of other genes.
* Fixed bug; Some data listings were not authorized for Curators at all, which
hid non-public data from them that they should have been able to see.
* Allow Curators to download more data listings.
* Fixed bug; When importing, LOVD could use the wrong data for checking the
panelid, fatherid and motherid links.
* Added inheritance field for diseases.
Closes #275: "Copy the inheritance field feature from LOVD+".
* Upgraded jQuery, jQuery UI and the cupertino theme.
* Fixed bug; Deleting a single log entry didn't load the next page's first log
entry anymore.
/***************************
* 3.0 Build 21 (tag:3.0-21)
* 2018-03-14
......
......@@ -1288,7 +1288,7 @@ class LOVD_API_Submissions {
// Check next level of variation (cDNA), if present.
// Check next level of variant (cDNA), if present.
if (isset($aVariant['seq_changes']) && isset($aVariant['seq_changes']['variant'])) {
// We collect the genes and transcripts annotated for this variant.
// If we cannot find *any* of the transcripts that are annotated for this variant, we throw an error.
......@@ -1454,7 +1454,7 @@ class LOVD_API_Submissions {
// Check next level of variation (RNA or Protein), if present.
// Check next level of variant (RNA or Protein), if present.
if (isset($aVariantLevel2['seq_changes']) && isset($aVariantLevel2['seq_changes']['variant'])) {
foreach ($aVariantLevel2['seq_changes']['variant'] as $iVariantLevel3 => $aVariantLevel3) {
$nVariantLevel3 = $iVariantLevel3 + 1; // We start counting at 1, like most humans do.
......@@ -1493,7 +1493,7 @@ class LOVD_API_Submissions {
// Check next level of variation (only AA allowed, only if this variant was RNA).
// Check next level of variant (only AA allowed, only if this variant was RNA).
if (isset($aVariantLevel3['seq_changes']) && isset($aVariantLevel3['seq_changes']['variant'])) {
// If the previous level was already AA, we should not be seeing any children, actually.
......
......@@ -4,7 +4,7 @@
* LEIDEN OPEN VARIATION DATABASE (LOVD)
*
* Created : 2011-02-17
* Modified : 2019-08-28
* Modified : 2019-10-01
* For LOVD : 3.0-22
*
* Copyright : 2004-2019 Leiden University Medical Center; http://www.LUMC.nl/
......@@ -321,10 +321,11 @@ class LOVD_Custom extends LOVD_Object {
{
// Gathers the columns which are active for the current data type and returns them in a viewEntry format
// Note: object_custom_viewlists.php implements their own version of this code.
global $_AUTH;
global $_AUTH, $_SETT;
$aViewEntry = array();
foreach ($this->aColumns as $sID => $aCol) {
if (!$aCol['public_view'] && $_AUTH['level'] < LEVEL_COLLABORATOR) {
if (!$aCol['public_view'] && $_AUTH['level'] < $_SETT['user_level_settings']['see_nonpublic_data']) {
continue;
}
$aViewEntry[$sID] = $aCol['head_column'];
......@@ -340,13 +341,13 @@ class LOVD_Custom extends LOVD_Object {
{
// Gathers the columns which are active for the current data type and returns them in a viewList format
// Note: object_custom_viewlists.php implements their own version of this code.
global $_AUTH;
global $_AUTH, $_SETT;
$aViewList = array();
foreach ($this->aColumns as $sID => $aCol) {
// In LOVD_plus, the public_view field is used to set if a custom column will be displayed in a VL or not.
// So, in LOVD_plus we need to check for ALL USERS if a custom column has public_view flag turned on or not.
if (!$aCol['public_view'] && (LOVD_plus? true : $_AUTH['level'] < LEVEL_COLLABORATOR)) {
if (!$aCol['public_view'] && (LOVD_plus? true : $_AUTH['level'] < $_SETT['user_level_settings']['see_nonpublic_data'])) {
continue;
}
$bAlignRight = preg_match('/^(DEC|FLOAT|(TINY|SMALL|MEDIUM|BIG)?INT)/', $aCol['mysql_type']);
......
......@@ -4,7 +4,7 @@
* LEIDEN OPEN VARIATION DATABASE (LOVD)
*
* Created : 2011-08-15
* Modified : 2019-08-28
* Modified : 2019-10-01
* For LOVD : 3.0-22
*
* Copyright : 2004-2019 Leiden University Medical Center; http://www.LUMC.nl/
......@@ -79,13 +79,13 @@ class LOVD_CustomViewList extends LOVD_Object {
// Note: objects inheriting LOVD_custom implement selection of
// viewable columns in buildViewList().
$sSQL = 'SELECT c.id, c.width, c.head_column, c.description_legend_short, c.description_legend_full, c.mysql_type, c.form_type, c.select_options, c.col_order, GROUP_CONCAT(sc.geneid, ":", sc.public_view SEPARATOR ";") AS public_view FROM ' . TABLE_ACTIVE_COLS . ' AS ac INNER JOIN ' . TABLE_COLS . ' AS c ON (c.id = ac.colid) LEFT OUTER JOIN ' . TABLE_SHARED_COLS . ' AS sc ON (sc.colid = ac.colid) ' .
'WHERE ' . ($_AUTH['level'] >= ($sGene? LEVEL_COLLABORATOR : LEVEL_MANAGER)? '' : '((c.id NOT LIKE "VariantOnTranscript/%" AND c.public_view = 1) OR sc.public_view = 1) AND ') . '(c.id LIKE ?' . str_repeat(' OR c.id LIKE ?', count($aObjects)-1) . ') ' .
'WHERE ' . ($_AUTH['level'] >= ($sGene? $_SETT['user_level_settings']['see_nonpublic_data'] : LEVEL_MANAGER)? '' : '((c.id NOT LIKE "VariantOnTranscript/%" AND c.public_view = 1) OR sc.public_view = 1) AND ') . '(c.id LIKE ?' . str_repeat(' OR c.id LIKE ?', count($aObjects)-1) . ') ' .
(!$sGene? 'GROUP BY c.id ' :
// If gene is given, only shown VOT columns active in the given gene! We'll use an UNION for that, so that we'll get the correct width and order also.
'AND c.id NOT LIKE "VariantOnTranscript/%" GROUP BY c.id ' . // Exclude the VOT columns from the normal set, we'll load them below.
'UNION ' .
'SELECT c.id, sc.width, c.head_column, c.description_legend_short, c.description_legend_full, c.mysql_type, c.form_type, c.select_options, sc.col_order, CONCAT(sc.geneid, ":", sc.public_view) AS public_view FROM ' . TABLE_COLS . ' AS c INNER JOIN ' . TABLE_SHARED_COLS . ' AS sc ON (c.id = sc.colid) WHERE sc.geneid = ? ' .
($_AUTH['level'] >= LEVEL_COLLABORATOR? '' : 'AND sc.public_view = 1 ')) .
($_AUTH['level'] >= $_SETT['user_level_settings']['see_nonpublic_data']? '' : 'AND sc.public_view = 1 ')) .
'ORDER BY col_order';
if (LOVD_plus) {
// In LOVD_plus, the shared cols table is empty and the public_view field is used to set if a custom column will be displayed in a VL or not.
......@@ -750,7 +750,7 @@ class LOVD_CustomViewList extends LOVD_Object {
if (in_array('Individual', $aObjects)) {
unset($this->aColumnsViewList['owned_by_']);
}
if ($_AUTH['level'] < LEVEL_COLLABORATOR) {
if ($_AUTH['level'] < $_SETT['user_level_settings']['see_nonpublic_data']) {
// Unset status column for non-collaborators. We're assuming here, that lovd_isAuthorized() only gets called for gene-specific overviews.
unset($this->aColumnsViewList['var_status']);
}
......@@ -773,7 +773,7 @@ class LOVD_CustomViewList extends LOVD_Object {
'view' => array('Ind. status', 70),
'db' => array('dsi.name', false, true)),
));
if ($_AUTH['level'] < LEVEL_COLLABORATOR) {
if ($_AUTH['level'] < $_SETT['user_level_settings']['see_nonpublic_data']) {
// Unset status column for non-collaborators. We're assuming here, that lovd_isAuthorized() only gets called for gene-specific overviews.
unset($this->aColumnsViewList['ind_status']);
}
......
......@@ -4,7 +4,7 @@
* LEIDEN OPEN VARIATION DATABASE (LOVD)
*
* Created : 2010-07-28
* Modified : 2019-09-05
* Modified : 2019-10-01
* For LOVD : 3.0-22
*
* Copyright : 2004-2019 Leiden University Medical Center; http://www.LUMC.nl/
......@@ -159,8 +159,8 @@ class LOVD_Disease extends LOVD_Object {
// SQL code for viewing an entry.
$this->aSQLViewEntry['SELECT'] = 'd.*, ' .
'(SELECT COUNT(*) FROM ' . TABLE_INDIVIDUALS . ' AS i INNER JOIN ' . TABLE_IND2DIS . ' AS i2d ON (i.id = i2d.individualid) WHERE i2d.diseaseid = d.id' . ($_AUTH['level'] >= LEVEL_COLLABORATOR? '' : ' AND i.statusid >= ' . STATUS_MARKED) . ') AS individuals, ' .
'(SELECT COUNT(*) FROM ' . TABLE_PHENOTYPES . ' AS p WHERE p.diseaseid = d.id' . ($_AUTH['level'] >= LEVEL_COLLABORATOR? '' : ' AND p.statusid >= ' . STATUS_MARKED) . ') AS phenotypes, ' .
'(SELECT COUNT(*) FROM ' . TABLE_INDIVIDUALS . ' AS i INNER JOIN ' . TABLE_IND2DIS . ' AS i2d ON (i.id = i2d.individualid) WHERE i2d.diseaseid = d.id' . ($_AUTH['level'] >= $_SETT['user_level_settings']['see_nonpublic_data']? '' : ' AND i.statusid >= ' . STATUS_MARKED) . ') AS individuals, ' .
'(SELECT COUNT(*) FROM ' . TABLE_PHENOTYPES . ' AS p WHERE p.diseaseid = d.id' . ($_AUTH['level'] >= $_SETT['user_level_settings']['see_nonpublic_data']? '' : ' AND p.statusid >= ' . STATUS_MARKED) . ') AS phenotypes, ' .
'GROUP_CONCAT(DISTINCT g2d.geneid ORDER BY g2d.geneid SEPARATOR ";") AS _genes, ' .
'uc.name AS created_by_, ' .
'ue.name AS edited_by_';
......@@ -172,8 +172,8 @@ class LOVD_Disease extends LOVD_Object {
// SQL code for viewing a list of entries.
$this->aSQLViewList['SELECT'] = 'd.*, d.id AS diseaseid, ' .
'(SELECT COUNT(DISTINCT i.id) FROM ' . TABLE_IND2DIS . ' AS i2d LEFT OUTER JOIN ' . TABLE_INDIVIDUALS . ' AS i ON (i2d.individualid = i.id' . ($_AUTH['level'] >= LEVEL_COLLABORATOR? '' : ' AND i.statusid >= ' . STATUS_MARKED) . ') WHERE i2d.diseaseid = d.id) AS individuals, ' .
'(SELECT COUNT(*) FROM ' . TABLE_PHENOTYPES . ' AS p WHERE p.diseaseid = d.id' . ($_AUTH['level'] >= LEVEL_COLLABORATOR? '' : ' AND p.statusid >= ' . STATUS_MARKED) . ') AS phenotypes, ' .
'(SELECT COUNT(DISTINCT i.id) FROM ' . TABLE_IND2DIS . ' AS i2d LEFT OUTER JOIN ' . TABLE_INDIVIDUALS . ' AS i ON (i2d.individualid = i.id' . ($_AUTH['level'] >= $_SETT['user_level_settings']['see_nonpublic_data']? '' : ' AND i.statusid >= ' . STATUS_MARKED) . ') WHERE i2d.diseaseid = d.id) AS individuals, ' .
'(SELECT COUNT(*) FROM ' . TABLE_PHENOTYPES . ' AS p WHERE p.diseaseid = d.id' . ($_AUTH['level'] >= $_SETT['user_level_settings']['see_nonpublic_data']? '' : ' AND p.statusid >= ' . STATUS_MARKED) . ') AS phenotypes, ' .
'COUNT(g2d.geneid) AS gene_count, ' .
'GROUP_CONCAT(DISTINCT g2d.geneid ORDER BY g2d.geneid SEPARATOR ";") AS _genes';
$this->aSQLViewList['FROM'] = TABLE_DISEASES . ' AS d ' .
......@@ -201,10 +201,10 @@ class LOVD_Disease extends LOVD_Object {
'tissues' => 'Associated tissues',
'features' => 'Disease features',
'remarks' => 'Remarks',
'created_by_' => array('Created by', LEVEL_COLLABORATOR),
'created_date_' => array('Date created', LEVEL_COLLABORATOR),
'edited_by_' => array('Last edited by', LEVEL_COLLABORATOR),
'edited_date_' => array('Date last edited', LEVEL_COLLABORATOR),
'created_by_' => array('Created by', $_SETT['user_level_settings']['see_nonpublic_data']),
'created_date_' => array('Date created', $_SETT['user_level_settings']['see_nonpublic_data']),
'edited_by_' => array('Last edited by', $_SETT['user_level_settings']['see_nonpublic_data']),
'edited_date_' => array('Date last edited', $_SETT['user_level_settings']['see_nonpublic_data']),
);
// List of columns and (default?) order for viewing a list of entries.
......
......@@ -4,7 +4,7 @@
* LEIDEN OPEN VARIATION DATABASE (LOVD)
*
* Created : 2010-12-15
* Modified : 2019-08-28
* Modified : 2019-10-01
* For LOVD : 3.0-22
*
* Copyright : 2004-2019 Leiden University Medical Center; http://www.LUMC.nl/
......@@ -53,7 +53,7 @@ class LOVD_Gene extends LOVD_Object {
function __construct ()
{
// Default constructor.
global $_AUTH, $_DB;
global $_AUTH, $_DB, $_SETT;
// SQL code for loading an entry for an edit form.
$this->sSQLLoadEntry = 'SELECT g.*, ' .
......@@ -82,7 +82,7 @@ class LOVD_Gene extends LOVD_Object {
'LEFT OUTER JOIN ' . TABLE_GEN2DIS . ' AS g2d ON (g.id = g2d.geneid) ' .
'LEFT OUTER JOIN ' . TABLE_DISEASES . ' AS d ON (g2d.diseaseid = d.id) ' .
'LEFT OUTER JOIN ' . TABLE_CURATES . ' AS u2g ON (g.id = u2g.geneid) ' .
'LEFT OUTER JOIN ' . TABLE_USERS . ' AS ua ON (u2g.userid = ua.id' . ($_AUTH['level'] >= LEVEL_COLLABORATOR? '' : ' AND u2g.show_order > 0') . ') ' .
'LEFT OUTER JOIN ' . TABLE_USERS . ' AS ua ON (u2g.userid = ua.id' . ($_AUTH['level'] >= $_SETT['user_level_settings']['see_nonpublic_data']? '' : ' AND u2g.show_order > 0') . ') ' .
'LEFT OUTER JOIN ' . TABLE_USERS . ' AS uc ON (g.created_by = uc.id) ' .
'LEFT OUTER JOIN ' . TABLE_USERS . ' AS ue ON (g.edited_by = ue.id) ' .
'LEFT OUTER JOIN ' . TABLE_USERS . ' AS uu ON (g.updated_by = uu.id) ' .
......@@ -107,7 +107,7 @@ class LOVD_Gene extends LOVD_Object {
(LOVD_plus? '' :
// Speed optimization by skipping variant counts.
'LEFT OUTER JOIN ' . TABLE_VARIANTS_ON_TRANSCRIPTS . ' AS vot ON (t.id = vot.transcriptid) ' .
'LEFT OUTER JOIN ' . TABLE_VARIANTS . ' AS vog ON (vot.id = vog.id' . ($_AUTH['level'] >= LEVEL_COLLABORATOR? '' : ' AND vog.statusid >= ' . STATUS_MARKED) . ') ') .
'LEFT OUTER JOIN ' . TABLE_VARIANTS . ' AS vog ON (vot.id = vog.id' . ($_AUTH['level'] >= $_SETT['user_level_settings']['see_nonpublic_data']? '' : ' AND vog.statusid >= ' . STATUS_MARKED) . ') ') .
'LEFT OUTER JOIN ' . TABLE_DISEASES . ' AS d ON (g2d.diseaseid = d.id)';
$this->aSQLViewList['GROUP_BY'] = 'g.id';
......@@ -129,19 +129,19 @@ class LOVD_Gene extends LOVD_Object {
'reference' => 'Citation reference(s)',
'refseq_url_' => 'Refseq URL',
'curators_' => 'Curators',
'collaborators_' => array('Collaborators', LEVEL_COLLABORATOR),
'collaborators_' => array('Collaborators', $_SETT['user_level_settings']['see_nonpublic_data']),
'variants_' => 'Total number of public variants reported',
'uniq_variants_' => 'Unique public DNA variants reported',
'count_individuals' => 'Individuals with public variants',
'hidden_variants_' => 'Hidden variants',
'allow_download_' => array('Allow public to download linked information', LEVEL_COLLABORATOR),
'allow_download_' => array('Allow public to download linked information', $_SETT['user_level_settings']['see_nonpublic_data']),
'download_' => 'Download all this gene\'s data',
'note_index' => 'Notes',
'created_by_' => array('Created by', LEVEL_COLLABORATOR),
'created_by_' => array('Created by', $_SETT['user_level_settings']['see_nonpublic_data']),
'created_date_' => 'Date created',
'edited_by_' => array('Last edited by', LEVEL_COLLABORATOR),
'edited_date_' => array('Date last edited', LEVEL_COLLABORATOR),
'updated_by_' => array('Last updated by', LEVEL_COLLABORATOR),
'edited_by_' => array('Last edited by', $_SETT['user_level_settings']['see_nonpublic_data']),
'edited_date_' => array('Date last edited', $_SETT['user_level_settings']['see_nonpublic_data']),
'updated_by_' => array('Last updated by', $_SETT['user_level_settings']['see_nonpublic_data']),
'updated_date_' => 'Date last updated',
'version_' => 'Version',
'TableEnd_General' => '',
......@@ -584,7 +584,7 @@ class LOVD_Gene extends LOVD_Object {
}
$this->aColumnsViewEntry['curators_'] .= ' (' . $nCurators . ')';
if ($_AUTH['level'] >= LEVEL_COLLABORATOR) {
if ($_AUTH['level'] >= $_SETT['user_level_settings']['see_nonpublic_data']) {
// Collaborator string.
$i = 0;
foreach ($aCollaborators as $nUserID => $sName) {
......@@ -620,12 +620,12 @@ class LOVD_Gene extends LOVD_Object {
$zData['version_'] = '<B>' . $zData['id'] . date(':ymd', strtotime($zData['updated_date_'])) . '</B>';
} else {
unset($this->aColumnsViewEntry['version_']);
if ($_AUTH['level'] < LEVEL_COLLABORATOR) {
if ($_AUTH['level'] < $_SETT['user_level_settings']['see_nonpublic_data']) {
// Also unset the empty updated_date field; users lower than collaborator don't see the updated_by field, either.
unset($this->aColumnsViewEntry['updated_date_']);
}
}
if ($_AUTH['level'] < LEVEL_COLLABORATOR) {
if ($_AUTH['level'] < $_SETT['user_level_settings']['see_nonpublic_data']) {
// Public, change date timestamps to human readable format.
$zData['created_date_'] = date('F d, Y', strtotime($zData['created_date_']));
$zData['updated_date_'] = date('F d, Y', strtotime($zData['updated_date_']));
......
......@@ -4,7 +4,7 @@
* LEIDEN OPEN VARIATION DATABASE (LOVD)
*
* Created : 2010-12-20
* Modified : 2019-09-05
* Modified : 2019-10-01
* For LOVD : 3.0-22
*
* Copyright : 2004-2019 Leiden University Medical Center; http://www.LUMC.nl/
......@@ -122,14 +122,14 @@ class LOVD_GenomeVariant extends LOVD_Custom {
),
$this->buildViewEntry(),
array(
'mapping_flags_' => array('Automatic mapping', LEVEL_COLLABORATOR),
'mapping_flags_' => array('Automatic mapping', $_SETT['user_level_settings']['see_nonpublic_data']),
'average_frequency_' => 'Average frequency (large NGS studies)',
'owned_by_' => 'Owner',
'status' => array('Variant data status', LEVEL_COLLABORATOR),
'created_by_' => array('Created by', LEVEL_COLLABORATOR),
'created_date_' => array('Date created', LEVEL_COLLABORATOR),
'edited_by_' => array('Last edited by', LEVEL_COLLABORATOR),
'edited_date_' => array('Date last edited', LEVEL_COLLABORATOR),
'status' => array('Variant data status', $_SETT['user_level_settings']['see_nonpublic_data']),
'created_by_' => array('Created by', $_SETT['user_level_settings']['see_nonpublic_data']),
'created_date_' => array('Date created', $_SETT['user_level_settings']['see_nonpublic_data']),
'edited_by_' => array('Last edited by', $_SETT['user_level_settings']['see_nonpublic_data']),
'edited_date_' => array('Date last edited', $_SETT['user_level_settings']['see_nonpublic_data']),
));
if (!LOVD_plus) {
unset($this->aColumnsViewEntry['curation_status_']);
......@@ -176,7 +176,7 @@ class LOVD_GenomeVariant extends LOVD_Custom {
'status' => array(
'view' => array('Status', 70),
'db' => array('ds.name', false, true),
'auth' => LEVEL_COLLABORATOR),
'auth' => $_SETT['user_level_settings']['see_nonpublic_data']),
'created_by' => array(
'view' => false,
'db' => array('vog.created_by', false, true)),
......@@ -464,7 +464,7 @@ class LOVD_GenomeVariant extends LOVD_Custom {
foreach ($zData['individuals'] as $aIndividual) {
list($nID, $nStatusID) = $aIndividual;
$zData['individualid_'] .= ($zData['individualid_']? ', ' : '') . '<A href="individuals/' . $nID . '">' . $nID . '</A>';
if ($_AUTH['level'] >= LEVEL_COLLABORATOR) {
if ($_AUTH['level'] >= $_SETT['user_level_settings']['see_nonpublic_data']) {
$zData['individualid_'] .= ' <SPAN style="color : #' . $this->getStatusColor($nStatusID) . '">(' . $_SETT['data_status'][$nStatusID] . ')</SPAN>';
}
}
......
......@@ -4,7 +4,7 @@
* LEIDEN OPEN VARIATION DATABASE (LOVD)
*
* Created : 2011-02-16
* Modified : 2019-08-28
* Modified : 2019-10-01
* For LOVD : 3.0-22
*
* Copyright : 2004-2019 Leiden University Medical Center; http://www.LUMC.nl/
......@@ -100,7 +100,7 @@ class LOVD_Individual extends LOVD_Custom {
(LOVD_plus? '' :
'GROUP_CONCAT(DISTINCT s2g.geneid ORDER BY s2g.geneid SEPARATOR ", ") AS genes_screened_, ' .
'GROUP_CONCAT(DISTINCT t.geneid ORDER BY t.geneid SEPARATOR ", ") AS variants_in_genes_, ' .
'COUNT(DISTINCT ' . ($_AUTH['level'] >= LEVEL_COLLABORATOR? 's2v.variantid' : 'vog.id') . ') AS variants_, ' // Counting s2v.variantid will not include the limit opposed to vog in the join's ON() clause.
'COUNT(DISTINCT ' . ($_AUTH['level'] >= $_SETT['user_level_settings']['see_nonpublic_data']? 's2v.variantid' : 'vog.id') . ') AS variants_, ' // Counting s2v.variantid will not include the limit opposed to vog in the join's ON() clause.
) .
'uo.name AS owned_by_, ' .
'CONCAT_WS(";", uo.id, uo.name, uo.email, uo.institute, uo.department, IFNULL(uo.countryid, "")) AS _owner, ' .
......@@ -116,10 +116,10 @@ class LOVD_Individual extends LOVD_Custom {
'LEFT OUTER JOIN ' . TABLE_SCREENINGS . ' AS s ON (i.id = s.individualid) ' .
(LOVD_plus? '' :
'LEFT OUTER JOIN ' . TABLE_SCR2VAR . ' AS s2v ON (s2v.screeningid = s.id) ' .
($_AUTH['level'] >= LEVEL_COLLABORATOR? '' :
($_AUTH['level'] >= $_SETT['user_level_settings']['see_nonpublic_data']? '' :
'LEFT OUTER JOIN ' . TABLE_VARIANTS . ' AS vog ON (s2v.variantid = vog.id AND (vog.statusid >= ' . STATUS_MARKED . (!$_AUTH? '' : ' OR vog.created_by = "' . $_AUTH['id'] . '" OR vog.owned_by IN (' . $sOwnerIDsSQL . ')') . ')) ') .
'LEFT OUTER JOIN ' . TABLE_SCR2GENE . ' AS s2g ON (s.id = s2g.screeningid) ' .
'LEFT OUTER JOIN ' . TABLE_VARIANTS_ON_TRANSCRIPTS . ' AS vot ON (' . ($_AUTH['level'] >= LEVEL_COLLABORATOR? 's2v.variantid' : 'vog.id') . ' = vot.id) ' .
'LEFT OUTER JOIN ' . TABLE_VARIANTS_ON_TRANSCRIPTS . ' AS vot ON (' . ($_AUTH['level'] >= $_SETT['user_level_settings']['see_nonpublic_data']? 's2v.variantid' : 'vog.id') . ' = vot.id) ' .
'LEFT OUTER JOIN ' . TABLE_TRANSCRIPTS . ' AS t ON (t.id = vot.transcriptid) '
) .
'LEFT OUTER JOIN ' . TABLE_USERS . ' AS uo ON (i.owned_by = uo.id) ' .
......@@ -147,11 +147,11 @@ class LOVD_Individual extends LOVD_Custom {
'diseases_' => 'Diseases',
'parents_' => 'Parent(s)',
'owned_by_' => 'Owner name',
'status' => array('Individual data status', LEVEL_COLLABORATOR),
'created_by_' => array('Created by', LEVEL_COLLABORATOR),
'created_date_' => array('Date created', LEVEL_COLLABORATOR),
'edited_by_' => array('Last edited by', LEVEL_COLLABORATOR),
'edited_date_' => array('Date last edited', LEVEL_COLLABORATOR),
'status' => array('Individual data status', $_SETT['user_level_settings']['see_nonpublic_data']),
'created_by_' => array('Created by', $_SETT['user_level_settings']['see_nonpublic_data']),
'created_date_' => array('Date created', $_SETT['user_level_settings']['see_nonpublic_data']),
'edited_by_' => array('Last edited by', $_SETT['user_level_settings']['see_nonpublic_data']),
'edited_date_' => array('Date last edited', $_SETT['user_level_settings']['see_nonpublic_data']),
));
// List of columns and (default?) order for viewing a list of entries.
......@@ -212,7 +212,7 @@ class LOVD_Individual extends LOVD_Custom {
'status' => array(
'view' => array('Status', 70),
'db' => array('ds.name', false, true),
'auth' => LEVEL_COLLABORATOR),
'auth' => $_SETT['user_level_settings']['see_nonpublic_data']),
'created_by' => array(
'view' => false,
'db' => array('i.created_by', false, true)),
......@@ -299,8 +299,8 @@ class LOVD_Individual extends LOVD_Custom {
}
}
$aDiseases = array_keys($this->aFormData['aDiseases'][5]);
if (!empty($aData['active_diseases'])) {
$aDiseases = array_keys($this->aFormData['aDiseases'][5]);
if (count($aData['active_diseases']) > 1 && in_array('00000', $aData['active_diseases'])) {
lovd_errorAdd('active_diseases', 'You cannot select both "Healthy/Control" and a disease for the same individual entry.');
} else {
......
......@@ -4,7 +4,7 @@
* LEIDEN OPEN VARIATION DATABASE (LOVD)
*
* Created : 2011-02-16
* Modified : 2019-09-04
* Modified : 2019-10-01
* For LOVD : 3.0-22
*
* Copyright : 2004-2019 Leiden University Medical Center; http://www.LUMC.nl/
......@@ -54,6 +54,7 @@ class LOVD_Phenotype extends LOVD_Custom {
function __construct ($sObjectID = '', $nID = '')
{
// Default constructor.
global $_SETT;
if (LOVD_plus) {
// We don't have shared custom columns in LOVD+.
......@@ -107,11 +108,11 @@ class LOVD_Phenotype extends LOVD_Custom {
$this->buildViewEntry(),
array(
'owned_by_' => 'Owner name',
'status' => array('Phenotype data status', LEVEL_COLLABORATOR),
'created_by_' => array('Created by', LEVEL_COLLABORATOR),
'created_date_' => array('Date created', LEVEL_COLLABORATOR),
'edited_by_' => array('Last edited by', LEVEL_COLLABORATOR),
'edited_date_' => array('Date last edited', LEVEL_COLLABORATOR),
'status' => array('Phenotype data status', $_SETT['user_level_settings']['see_nonpublic_data']),
'created_by_' => array('Created by', $_SETT['user_level_settings']['see_nonpublic_data']),
'created_date_' => array('Date created', $_SETT['user_level_settings']['see_nonpublic_data']),
'edited_by_' => array('Last edited by', $_SETT['user_level_settings']['see_nonpublic_data']),
'edited_date_' => array('Date last edited', $_SETT['user_level_settings']['see_nonpublic_data']),
));
// List of columns and (default?) order for viewing a list of entries.
......@@ -132,7 +133,7 @@ class LOVD_Phenotype extends LOVD_Custom {
'status' => array(
'view' => array('Status', 70),
'db' => array('ds.name', false, true),
'auth' => LEVEL_COLLABORATOR),
'auth' => $_SETT['user_level_settings']['see_nonpublic_data']),
'individualid' => array(
'view' => array('Individual ID', 70, 'style="text-align : right;"'),
'db' => array('p.individualid', 'ASC', true)),
......@@ -258,7 +259,7 @@ class LOVD_Phenotype extends LOVD_Custom {
if ($sView == 'entry') {
$zData['individualid_'] = '<A href="individuals/' . $zData['individualid'] . '">' . $zData['individualid'] . '</A>';
if ($_AUTH['level'] >= LEVEL_COLLABORATOR) {
if ($_AUTH['level'] >= $_SETT['user_level_settings']['see_nonpublic_data']) {
$zData['individualid_'] .= ' <SPAN style="color : #' . $this->getStatusColor($zData['individual_statusid']) . '">(' . $_SETT['data_status'][$zData['individual_statusid']] . ')</SPAN>';
}
$zData['disease_'] = '<A href="diseases/' . $zData['diseaseid'] . '">' . $zData['disease'] . '</A>';
......
......@@ -4,10 +4,10 @@
* LEIDEN OPEN VARIATION DATABASE (LOVD)
*
* Created : 2011-03-18
* Modified : 2017-11-30
* For LOVD : 3.0-21
* Modified : 2019-10-01
* For LOVD : 3.0-22
*
* Copyright : 2004-2017 Leiden University Medical Center; http://www.LUMC.nl/
* Copyright : 2004-2019 Leiden University Medical Center; http://www.LUMC.nl/
* Programmers : Ivar C. Lugtenburg <I.C.Lugtenburg@LUMC.nl>
* Ivo F.A.C. Fokkema <I.F.A.C.Fokkema@LUMC.nl>
* Daan Asscheman <D.Asscheman@LUMC.nl>
......@@ -54,7 +54,7 @@ class LOVD_Screening extends LOVD_Custom {
function __construct ()
{
// Default constructor.
global $_AUTH;
global $_AUTH, $_SETT;
// SQL code for loading an entry for an edit form.
// FIXME; change owner to owned_by_ in the load entry query below.
......@@ -71,7 +71,7 @@ class LOVD_Screening extends LOVD_Custom {
$this->aSQLViewEntry['SELECT'] = 's.*, ' .
'i.statusid AS individual_statusid, ' .
'GROUP_CONCAT(DISTINCT "=\"", s2g.geneid, "\"" SEPARATOR "|") AS search_geneid, ' .
'IF(s.variants_found = 1 AND COUNT(s2v.variantid) = 0, -1, COUNT(DISTINCT ' . ($_AUTH['level'] >= LEVEL_COLLABORATOR? 's2v.variantid' : 'vog.id') . ')) AS variants_found_, ' .
'IF(s.variants_found = 1 AND COUNT(s2v.variantid) = 0, -1, COUNT(DISTINCT ' . ($_AUTH['level'] >= $_SETT['user_level_settings']['see_nonpublic_data']? 's2v.variantid' : 'vog.id') . ')) AS variants_found_, ' .
'uo.name AS owned_by_, ' .
'uc.name AS created_by_, ' .
'ue.name AS edited_by_';
......@@ -83,7 +83,7 @@ class LOVD_Screening extends LOVD_Custom {
$this->aSQLViewEntry['FROM'] = TABLE_SCREENINGS . ' AS s ' .
'LEFT OUTER JOIN ' . TABLE_SCR2GENE . ' AS s2g ON (s.id = s2g.screeningid) ' .
'LEFT OUTER JOIN ' . TABLE_SCR2VAR . ' AS s2v ON (s.id = s2v.screeningid) ' .
($_AUTH['level'] >= LEVEL_COLLABORATOR? '' :
($_AUTH['level'] >= $_SETT['user_level_settings']['see_nonpublic_data']? '' :
'LEFT OUTER JOIN ' . TABLE_VARIANTS . ' AS vog ON (s2v.variantid = vog.id AND (vog.statusid >= ' . STATUS_MARKED . (!$_AUTH? '' : ' OR vog.created_by = "' . $_AUTH['id'] . '" OR vog.owned_by IN (' . $sOwnerIDsSQL . ')') . ')) ') .
'LEFT OUTER JOIN ' . TABLE_USERS . ' AS uo ON (s.owned_by = uo.id) ' .
'LEFT OUTER JOIN ' . TABLE_INDIVIDUALS . ' AS i ON (s.individualid = i.id) ' .
......@@ -94,14 +94,14 @@ class LOVD_Screening extends LOVD_Custom {
// SQL code for viewing the list of screenings
$this->aSQLViewList['SELECT'] = 's.*, ' .
's.id AS screeningid, ' .
'IF(s.variants_found = 1 AND COUNT(s2v.variantid) = 0, -1, COUNT(DISTINCT ' . ($_AUTH['level'] >= LEVEL_COLLABORATOR? 's2v.variantid' : 'vog.id') . ')) AS variants_found_, ' .
'IF(s.variants_found = 1 AND COUNT(s2v.variantid) = 0, -1, COUNT(DISTINCT ' . ($_AUTH['level'] >= $_SETT['user_level_settings']['see_nonpublic_data']? 's2v.variantid' : 'vog.id') . ')) AS variants_found_, ' .
'GROUP_CONCAT(DISTINCT s2g.geneid SEPARATOR ", ") AS genes, ' .
'i.statusid, ' .
'uo.name AS owned_by_, ' .
'CONCAT_WS(";", uo.id, uo.name, uo.email, uo.institute, uo.department, IFNULL(uo.countryid, "")) AS _owner';
$this->aSQLViewList['FROM'] = TABLE_SCREENINGS . ' AS s ' .
'LEFT OUTER JOIN ' . TABLE_SCR2VAR . ' AS s2v ON (s.id = s2v.screeningid) ' .
($_AUTH['level'] >= LEVEL_COLLABORATOR? '' :
($_AUTH['level'] >= $_SETT['user_level_settings']['see_nonpublic_data']? '' :
'LEFT OUTER JOIN ' . TABLE_VARIANTS . ' AS vog ON (s2v.variantid = vog.id AND (vog.statusid >= ' . STATUS_MARKED . (!$_AUTH? '' : ' OR vog.created_by = "' . $_AUTH['id'] . '" OR vog.owned_by IN (' . $sOwnerIDsSQL . ')') . ')) ') .
'LEFT OUTER JOIN ' . TABLE_SCR2GENE . ' AS s2g ON (s.id = s2g.screeningid) ' .
'LEFT OUTER JOIN ' . TABLE_INDIVIDUALS . ' AS i ON (s.individualid = i.id) ' .
......@@ -120,10 +120,10 @@ class LOVD_Screening extends LOVD_Custom {
array(
'variants_found_' => 'Variants found?',
'owned_by_' => 'Owner name',
'created_by_' => array('Created by', LEVEL_COLLABORATOR),
'created_date' => array('Date created', LEVEL_COLLABORATOR),
'edited_by_' => array('Last edited by', LEVEL_COLLABORATOR),
'edited_date_' => array('Date last edited', LEVEL_COLLABORATOR),
'created_by_' => array('Created by', $_SETT['user_level_settings']['see_nonpublic_data']),
'created_date' => array('Date created', $_SETT['user_level_settings']['see_nonpublic_data']),
'edited_by_' => array('Last edited by', $_SETT['user_level_settings']['see_nonpublic_data']),
'edited_date_' => array('Date last edited', $_SETT['user_level_settings']['see_nonpublic_data']),
));
// List of columns and (default?) order for viewing a list of entries.
......@@ -278,7 +278,7 @@ class LOVD_Screening extends LOVD_Custom {
if ($sView == 'entry') {
$zData['individualid_'] = '<A href="individuals/' . $zData['individualid'] . '">' . $zData['individualid'] . '</A>';
if ($_AUTH['level'] >= LEVEL_COLLABORATOR) {
if ($_AUTH['level'] >= $_SETT['user_level_settings']['see_nonpublic_data']) {
$zData['individualid_'] .= ' <SPAN style="color : #' . $this->getStatusColor($zData['individual_statusid']) . '">(' . $_SETT['data_status'][$zData['individual_statusid']] . ')</SPAN>';
}
}
......
......@@ -4,7 +4,7 @@
* LEIDEN OPEN VARIATION DATABASE (LOVD)
*
* Created : 2011-05-12
* Modified : 2019-09-04
* Modified : 2019-10-01
* For LOVD : 3.0-22
*
* Copyright : 2004-2019 Leiden University Medical Center; http://www.LUMC.nl/
......@@ -59,7 +59,7 @@ class LOVD_TranscriptVariant extends LOVD_Custom {
function __construct ($sObjectID = '', $nID = '', $bLoadAllTranscripts = true)
{
// Default constructor.
global $_DB;
global $_DB, $_SETT;
if (LOVD_plus) {
// We don't have shared custom columns in LOVD+.
......@@ -154,7 +154,7 @@ class LOVD_TranscriptVariant extends LOVD_Custom {
'status' => array(
'view' => array('Status', 70),
'db' => array('ds.name', false, true),
'auth' => LEVEL_COLLABORATOR),
'auth' => $_SETT['user_level_settings']['see_nonpublic_data']),
));
if (LOVD_plus) {
unset($this->aColumnsViewList['effect']);
......