diff --git a/.phan/config.php b/.phan/config.php index a9467962613..fe24edcfb13 100644 --- a/.phan/config.php +++ b/.phan/config.php @@ -8,9 +8,7 @@ // This is false on the assumption that that's a typo. // It doesn't seem to have any effect on LORIS's codebase anyways. "quick_mode" => false, - // FIXME: analyze signature compatibility should be true, but - // there's too many other things to fix first. - "analyze_signature_compatibility" => false, + "analyze_signature_compatibility" => true, // FIXME: allow_missing_properties should be false, but there's // too many other things to fix first. "allow_missing_properties" => true, @@ -31,8 +29,6 @@ "PhanUndeclaredClassMethod", "PhanUndeclaredTypeParameter", "PhanUndeclaredConstant", - "PhanUndeclaredClass", - "PhanUndeclaredExtendedClass", "PhanTypeMismatchForeach", "PhanTypeMismatchDefault", "PhanTypeMismatchArgument", @@ -51,7 +47,7 @@ "directory_list" => [ /* This doesn't include php/installer, because there's (intentionally) classes in the installer namespace - which redeclare classes from php/libraries, in order + which redeclare classes from php/libraries, in order to bootstrap the installer before the config/database is set up */ "php/libraries", @@ -60,8 +56,14 @@ "modules", "src", "vendor", + "test" ], "exclude_analysis_directory_list" => [ "vendor", ], + 'autoload_internal_extension_signatures' => [ + // Xdebug stubs are bundled with Phan 0.10.1+/0.8.9+ for usage, + // because Phan disables xdebug by default. + 'xdebug' => 'vendor/phan/phan/.phan/internal_stubs/xdebug.phan_php', + ], ]; diff --git a/.travis.yml b/.travis.yml index 13066452533..02072613311 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,12 @@ language: php + cache: directories: - vendor - php: - - "7.2" - "7.1" - -sudo: false + - "7.2" addons: firefox: "44.0" @@ -24,22 +22,26 @@ before_install: - nvm install node - mkdir -p project project/libraries - phpenv config-rm xdebug.ini +<<<<<<< HEAD - pecl install -f ast-0.1.6 +======= + - if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.0" ]]; then Dir="router.php" ; fi + - if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.1" ]]; then Dir="htdocs/router.php" ; fi + - php -S localhost:8000 -t htdocs $Dir 2>1 > /dev/null & +>>>>>>> aces/minor install: # Install composer modules - composer install - composer require --dev - phpenv rehash + # Install node modules specified in package.json - npm install # Download a Selenium Web Driver release - wget "http://selenium-release.storage.googleapis.com/2.52/selenium-server-standalone-2.52.0.jar" - - - php -S localhost:8000 -t htdocs htdocs/router.php 2>1 > /dev/null & - # Extracting firefox and setting PATH variable... - tar -xjf /tmp/firefox-44.0.tar.bz2 --directory /tmp - export PATH="/tmp/firefox:$PATH" @@ -51,6 +53,8 @@ install: - DISPLAY=:99.0 java -jar selenium-server-standalone-2.52.0.jar 2>1 > /dev/null & before_script: + + # Set up the Loris environment - mkdir -p project smarty/templates_c project/instruments project/tables_sql - chmod 777 smarty/templates_c project/instruments project/tables_sql @@ -95,7 +99,10 @@ before_script: # - "LORIS_DB_CONFIG=test/config.xml" script: +<<<<<<< HEAD - vendor/bin/phan +======= +>>>>>>> aces/minor - npm run lint:php && npm run lint:javascript && vendor/bin/phpunit --configuration test/phpunit.xml dist: precise diff --git a/SQL/0000-00-00-schema.sql b/SQL/0000-00-00-schema.sql index 827cc478b16..63e0305a499 100644 --- a/SQL/0000-00-00-schema.sql +++ b/SQL/0000-00-00-schema.sql @@ -532,27 +532,26 @@ CREATE TABLE `tarchive_files` ( CREATE TABLE `ImagingFileTypes` ( - `type` varchar(255) NOT NULL PRIMARY KEY + `type` varchar(12) NOT NULL PRIMARY KEY, + `description` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -INSERT INTO `ImagingFileTypes` VALUES - ('mnc'), - ('obj'), - ('xfm'), - ('xfmmnc'), - ('imp'), - ('vertstat'), - ('xml'), - ('txt'), - ('nii'), - ('nii.gz'), - ('nrrd'); +INSERT INTO `ImagingFileTypes` (type, description) VALUES + ('mnc', 'MINC file'), + ('obj', 'MNI BIC imaging format for a surface'), + ('xfm', 'MNI BIC linear transformation matrix file'), + ('vertstat', 'MNI BIC imaging format for a field on a surface (e.g. cortical thickness)'), + ('xml', 'XML file'), + ('txt', 'text file'), + ('nii', 'NIfTI file'), + ('nrrd', 'NRRD file format (used by DTIPrep)'), + ('grid_0', 'MNI BIC non-linear field for non-linear transformation'); CREATE TABLE `mri_processing_protocol` ( `ProcessProtocolID` int(11) unsigned NOT NULL AUTO_INCREMENT, `ProtocolFile` varchar(255) NOT NULL DEFAULT '', - `FileType` varchar(255) DEFAULT NULL, + `FileType` varchar(12) DEFAULT NULL, `Tool` varchar(255) NOT NULL DEFAULT '', `InsertTime` int(10) unsigned NOT NULL DEFAULT '0', `md5sum` varchar(32) DEFAULT NULL, @@ -620,7 +619,7 @@ CREATE TABLE `files` ( `CoordinateSpace` varchar(255) default NULL, `OutputType` varchar(255) NOT NULL default '', `AcquisitionProtocolID` int(10) unsigned default NULL, - `FileType` varchar(255) default NULL, + `FileType` varchar(12) default NULL, `PendingStaging` tinyint(1) NOT NULL default '0', `InsertedByUserID` varchar(255) NOT NULL default '', `InsertTime` int(10) unsigned NOT NULL default '0', @@ -1340,11 +1339,13 @@ CREATE TABLE `media` ( `uploaded_by` varchar(255) DEFAULT NULL, `hide_file` tinyint(1) DEFAULT '0', `date_uploaded` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `language_id` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `file_name` (`file_name`), FOREIGN KEY (`session_id`) REFERENCES `session` (`ID`), - FOREIGN KEY (`instrument`) REFERENCES `test_names` (`Test_name`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; + FOREIGN KEY (`instrument`) REFERENCES `test_names` (`Test_name`), + CONSTRAINT `FK_media_language` FOREIGN KEY (`language_id`) REFERENCES `language` (`language_id`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ******************************** -- issues tables @@ -1410,7 +1411,7 @@ CREATE TABLE `issues_history` ( `addedBy` varchar(255) NOT NULL DEFAULT '', PRIMARY KEY (`issueHistoryID`), KEY `fk_issues_comments_1` (`issueID`), - CONSTRAINT `fk_issues_comments_1` FOREIGN KEY (`issueID`) REFERENCES `issues` (`issueID`) + CONSTRAINT `fk_issues_comments_1` FOREIGN KEY (`issueID`) REFERENCES `issues` (`issueID`) ON DELETE CASCADE ON UPDATE RESTRICT ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `issues_comments` ( @@ -1421,7 +1422,7 @@ CREATE TABLE `issues_comments` ( `issueComment` text NOT NULL, PRIMARY KEY (`issueCommentID`), KEY `fk_issue_comments_1` (`issueID`), - CONSTRAINT `fk_issue_comments_1` FOREIGN KEY (`issueID`) REFERENCES `issues` (`issueID`) + CONSTRAINT `fk_issue_comments_1` FOREIGN KEY (`issueID`) REFERENCES `issues` (`issueID`) ON DELETE CASCADE ON UPDATE RESTRICT ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `issues_comments_history` ( @@ -1432,7 +1433,7 @@ CREATE TABLE `issues_comments_history` ( `editedBy` varchar(255) NOT NULL DEFAULT '', PRIMARY KEY (`issueCommentHistoryID`), KEY `fk_issues_comments_history` (`issueCommentID`), - CONSTRAINT `fk_issues_comments_history` FOREIGN KEY (`issueCommentID`) REFERENCES `issues_comments` (`issueCommentID`) + CONSTRAINT `fk_issues_comments_history` FOREIGN KEY (`issueCommentID`) REFERENCES `issues_comments` (`issueCommentID`) ON DELETE CASCADE ON UPDATE RESTRICT ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `issues_watching` ( @@ -1545,7 +1546,7 @@ CREATE TABLE `parameter_session` ( KEY `session_type` (`SessionID`,`ParameterTypeID`), KEY `parameter_value` (`ParameterTypeID`,`Value`(64)), CONSTRAINT `FK_parameter_session_2` FOREIGN KEY (`ParameterTypeID`) REFERENCES `parameter_type` (`ParameterTypeID`), - CONSTRAINT `FK_parameter_session_1` FOREIGN KEY (`SessionID`) REFERENCES `session` (`ID`) + CONSTRAINT `FK_parameter_session_1` FOREIGN KEY (`SessionID`) REFERENCES `session` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `parameter_type_override` ( @@ -1779,8 +1780,8 @@ CREATE TABLE `genomic_cpg` ( `beta_value` decimal(4,3) DEFAULT NULL, PRIMARY KEY (`sample_label`,`cpg_name`), KEY `cpg_name` (`cpg_name`), - CONSTRAINT `genomic_cpg_ibfk_1` FOREIGN KEY (`sample_label`) REFERENCES `genomic_sample_candidate_rel` (`sample_label`), - CONSTRAINT `genomic_cpg_ibfk_2` FOREIGN KEY (`cpg_name`) REFERENCES `genomic_cpg_annotation` (`cpg_name`) + CONSTRAINT `genomic_cpg_ibfk_1` FOREIGN KEY (`sample_label`) REFERENCES `genomic_sample_candidate_rel` (`sample_label`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `genomic_cpg_ibfk_2` FOREIGN KEY (`cpg_name`) REFERENCES `genomic_cpg_annotation` (`cpg_name`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ******************************** diff --git a/SQL/0000-00-03-ConfigTables.sql b/SQL/0000-00-03-ConfigTables.sql index b0dfb4e1e1b..47f0a5fcceb 100644 --- a/SQL/0000-00-03-ConfigTables.sql +++ b/SQL/0000-00-03-ConfigTables.sql @@ -108,6 +108,7 @@ INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'LivingPhantomRegex', 'Regex to be used on Living Phantom scan header', 1, 0, 'text', ID, 'Living phantom regex', 4 FROM ConfigSettings WHERE Name="imaging_modules"; INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'showTransferStatus', 'Show transfer status in the DICOM Archive table', 1, 0, 'boolean', ID, 'Show transfer status', 5 FROM ConfigSettings WHERE Name="imaging_modules"; INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'tblScanTypes', 'Scan types from the mri_scan_type table that the project wants to see displayed in Imaging Browser table', 1, 1, 'scan_type', ID, 'Imaging Browser Tabulated Scan Types', 6 FROM ConfigSettings WHERE Name="imaging_modules"; +INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'ImagingBrowserLinkedInstruments', 'Instruments that the users want to see linked from Imaging Browser', 1, 1, 'instrument', ID, 'Imaging Browser Links to Instruments', 7 FROM ConfigSettings WHERE Name="imaging_modules"; INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, Label, OrderNumber) VALUES ('statistics', 'Statistics module settings', 1, 0, 'Statistics', 7); @@ -136,14 +137,13 @@ INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'prefix', 'Study prefix or study name', 1, 0, 'text', ID, 'Study Name', 2 FROM ConfigSettings WHERE Name="imaging_pipeline"; INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'mail_user', 'User to be notified during imaging pipeline execution', 1, 0, 'text', ID, 'User to notify when executing the pipeline', 3 FROM ConfigSettings WHERE Name="imaging_pipeline"; INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'get_dicom_info', 'Full path to get_dicom_info.pl', 1, 0, 'text', ID, 'Full path to get_dicom_info.pl script', 4 FROM ConfigSettings WHERE Name="imaging_pipeline"; -INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'horizontalPics', 'Generate horizontal pictures', 1, 0, 'boolean', ID, 'Horizontal pictures creation', 5 FROM ConfigSettings WHERE Name="imaging_pipeline"; -INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'no_nii', 'Create NIFTII files if set to 0', 1, 0, 'boolean', ID, 'NIFTII file creation', 6 FROM ConfigSettings WHERE Name="imaging_pipeline"; +INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'horizontalPics', 'Enable generation of horizontal pictures', 1, 0, 'boolean', ID, 'Horizontal pictures creation', 5 FROM ConfigSettings WHERE Name="imaging_pipeline"; +INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'create_nii', 'Enable creation of NIfTI files', 1, 0, 'boolean', ID, 'NIfTI file creation', 6 FROM ConfigSettings WHERE Name="imaging_pipeline"; INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'converter', 'If converter is set to dcm2mnc, the c-version of dcm2mnc will be used. If however you want to use any of the various versions of the converter, you will have to specify what it is called and the uploader will try to invoke it', 1, 0, 'text', ID, 'dcm2mnc binary to use when converting', 7 FROM ConfigSettings WHERE Name="imaging_pipeline"; INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'tarchiveLibraryDir', 'Location of storing the library of used tarchives. If this is not set, they will not be moved', 1, 0, 'text', ID, 'Path to Tarchives', 8 FROM ConfigSettings WHERE Name="imaging_pipeline"; -INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'lookupCenterNameUsing', 'The element of the tarchive table to be used in getPSC(), being either PatientID or PatientName', 1, 0, 'text', ID, 'Center name lookup variable', 9 FROM ConfigSettings WHERE Name="imaging_pipeline"; -INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'createCandidates', 'Creation of candidates if set to 1', 1, 0, 'boolean', ID, 'Upload creation of candidates', 10 FROM ConfigSettings WHERE Name="imaging_pipeline"; -INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'is_qsub', 'Do not use batch management if qsub is set to 0', 1, 0, 'boolean', ID, 'Project batch management used', 11 FROM ConfigSettings WHERE Name="imaging_pipeline"; -INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'if_site', 'Use site if set to 1', 1, 0, 'boolean', ID, 'If site is used', 12 FROM ConfigSettings WHERE Name="imaging_pipeline"; +INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'lookupCenterNameUsing', 'DICOM field (either PatientName or PatientID) to use to get the patient identifiers and the center name of the DICOM study', 1, 0, 'text', ID, 'Patient identifiers and center name lookup variable', 9 FROM ConfigSettings WHERE Name="imaging_pipeline"; +INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'createCandidates', 'Enable candidate creation in the imaging pipeline', 1, 0, 'boolean', ID, 'Upload creation of candidates', 10 FROM ConfigSettings WHERE Name="imaging_pipeline"; +INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'is_qsub', 'Enable use of batch management in the imaging pipeline', 1, 0, 'boolean', ID, 'Project batch management used', 11 FROM ConfigSettings WHERE Name="imaging_pipeline"; INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'DTI_volumes', 'Number of volumes in native DTI acquisitions', 1, 0, 'text', ID, 'Number of volumes in native DTI acquisitions', 13 FROM ConfigSettings WHERE Name="imaging_pipeline"; INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 't1_scan_type', 'Scan type of native T1 acquisition (as in the mri_scan_type table)', 1, 0, 'text', ID, 'Scan type of native T1 acquisition', 14 FROM ConfigSettings WHERE Name="imaging_pipeline"; INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'reject_thresh', 'Max number of directions that can be rejected to PASS QC', 1, 0, 'text', ID, 'Max number of DTI rejected directions for passing QC', 15 FROM ConfigSettings WHERE Name="imaging_pipeline"; @@ -210,7 +210,8 @@ INSERT INTO Config (ConfigID, Value) SELECT ID, "/phantom/i" FROM ConfigSettings INSERT INTO Config (ConfigID, Value) SELECT ID, "false" FROM ConfigSettings WHERE Name="showTransferStatus"; INSERT INTO Config (ConfigID, Value) SELECT cs.ID, GROUP_CONCAT(mst.Scan_Type) FROM ConfigSettings cs JOIN mri_scan_type mst WHERE cs.Name="tblScanTypes" AND mst.ID=44; INSERT INTO Config (ConfigID, Value) SELECT cs.ID, GROUP_CONCAT(mst.Scan_Type) FROM ConfigSettings cs JOIN mri_scan_type mst WHERE cs.Name="tblScanTypes" AND mst.ID=45; - +INSERT INTO Config (ConfigID, Value) SELECT cs.ID, "mri_parameter_form" FROM ConfigSettings cs WHERE cs.Name="ImagingBrowserLinkedInstruments"; +INSERT INTO Config (ConfigID, Value) SELECT cs.ID, "radiology_review" FROM ConfigSettings cs WHERE cs.Name="ImagingBrowserLinkedInstruments"; INSERT INTO Config (ConfigID, Value) SELECT ID, "radiology_review" FROM ConfigSettings WHERE Name="excludedMeasures"; INSERT INTO Config (ConfigID, Value) SELECT ID, "mri_parameter_form" FROM ConfigSettings WHERE Name="excludedMeasures"; @@ -229,13 +230,12 @@ INSERT INTO Config (ConfigID, Value) SELECT ID, "project" FROM ConfigSettings cs INSERT INTO Config (ConfigID, Value) SELECT ID, "yourname\@example.com" FROM ConfigSettings cs WHERE cs.Name="mail_user"; INSERT INTO Config (ConfigID, Value) SELECT ID, "/PATH/TO/get_dicom_info.pl" FROM ConfigSettings cs WHERE cs.Name="get_dicom_info"; INSERT INTO Config (ConfigID, Value) SELECT ID, 1 FROM ConfigSettings cs WHERE cs.Name="horizontalPics"; -INSERT INTO Config (ConfigID, Value) SELECT ID, 0 FROM ConfigSettings cs WHERE cs.Name="no_nii"; +INSERT INTO Config (ConfigID, Value) SELECT ID, 1 FROM ConfigSettings cs WHERE cs.Name="create_nii"; INSERT INTO Config (ConfigID, Value) SELECT ID, "dcm2mnc" FROM ConfigSettings cs WHERE cs.Name="converter"; INSERT INTO Config (ConfigID, Value) SELECT ID, "/PATH/TO/dicomlib/" FROM ConfigSettings cs WHERE cs.Name="tarchiveLibraryDir"; INSERT INTO Config (ConfigID, Value) SELECT ID, "PatientName" FROM ConfigSettings cs WHERE cs.Name="lookupCenterNameUsing"; INSERT INTO Config (ConfigID, Value) SELECT ID, 1 FROM ConfigSettings cs WHERE cs.Name="createCandidates"; INSERT INTO Config (ConfigID, Value) SELECT ID, 0 FROM ConfigSettings cs WHERE cs.Name="is_qsub"; -INSERT INTO Config (ConfigID, Value) SELECT ID, 1 FROM ConfigSettings cs WHERE cs.Name="if_site"; INSERT INTO Config (ConfigID, Value) SELECT ID, 65 FROM ConfigSettings cs WHERE cs.Name="DTI_volumes"; INSERT INTO Config (ConfigID, Value) SELECT ID, "adniT1" FROM ConfigSettings cs WHERE cs.Name="t1_scan_type"; INSERT INTO Config (ConfigID, Value) SELECT ID, 19 FROM ConfigSettings cs WHERE cs.Name="reject_thresh"; diff --git a/SQL/New_patches/2017-06-13-addUserLanguagePreference.sql b/SQL/Archive/19.1/2017-06-13-addUserLanguagePreference.sql similarity index 86% rename from SQL/New_patches/2017-06-13-addUserLanguagePreference.sql rename to SQL/Archive/19.1/2017-06-13-addUserLanguagePreference.sql index b8ebcf6ae82..2b695cc3f88 100644 --- a/SQL/New_patches/2017-06-13-addUserLanguagePreference.sql +++ b/SQL/Archive/19.1/2017-06-13-addUserLanguagePreference.sql @@ -7,7 +7,6 @@ CREATE TABLE `language` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8; INSERT INTO language (language_code, language_label) VALUES ('en-CA', 'English'); ---INSERT INTO language (language_code, language_label) VALUES ('fr-CA', 'French'); ALTER TABLE users ADD language_preference integer unsigned DEFAULT NULL; ALTER TABLE users ADD CONSTRAINT `FK_users_2` FOREIGN KEY (`language_preference`) REFERENCES `language` (`language_id`); \ No newline at end of file diff --git a/SQL/Archive/19.1/2017-12-15_media_add_language_to_UploadFile.sql b/SQL/Archive/19.1/2017-12-15_media_add_language_to_UploadFile.sql new file mode 100644 index 00000000000..eadf425064a --- /dev/null +++ b/SQL/Archive/19.1/2017-12-15_media_add_language_to_UploadFile.sql @@ -0,0 +1,3 @@ +ALTER TABLE media ADD COLUMN language_id INT UNSIGNED DEFAULT NULL; +ALTER TABLE media ADD CONSTRAINT `FK_media_language` FOREIGN KEY (`language_id`) REFERENCES `language` (`language_id`); + diff --git a/SQL/Archive/19.1/2018-01-30_Add_description_to_ImagingFileTypes.sql b/SQL/Archive/19.1/2018-01-30_Add_description_to_ImagingFileTypes.sql new file mode 100644 index 00000000000..25cfa175d34 --- /dev/null +++ b/SQL/Archive/19.1/2018-01-30_Add_description_to_ImagingFileTypes.sql @@ -0,0 +1,80 @@ +-- Disable Foreign key to be able to change type +-- of FileType to VARCHAR(12) in files, +-- mri_processing_protocol and ImagingFileType +SET FOREIGN_KEY_CHECKS=0; + +-- ALTER files to drop the FK_files_FileTypes +ALTER TABLE files + MODIFY `FileType` VARCHAR(12); + +-- ALTER mri_processing_protocol to drop the +-- FK_mri_processing_protocol_FileTypes +ALTER TABLE mri_processing_protocol + MODIFY `FileType` VARCHAR(12); + +-- ALTER ImagingFileTypes table to add a `description` column +ALTER TABLE ImagingFileTypes + MODIFY `type` VARCHAR(12) NOT NULL, + ADD `description` VARCHAR(255) DEFAULT NULL; + +-- Re-enable the forein keys +SET FOREIGN_KEY_CHECKS=1; + +-- ADD description to the different type +UPDATE ImagingFileTypes + SET description='MINC file' + WHERE type='mnc'; + +UPDATE ImagingFileTypes + SET description='3D imaging format' + WHERE type='obj'; + +UPDATE ImagingFileTypes + SET description='transformation matrix file' + WHERE type='xfm'; + +UPDATE ImagingFileTypes + SET description=NULL + WHERE type='xfmmnc'; + +UPDATE ImagingFileTypes + SET description='audition impulse file' + WHERE type='imp'; + +UPDATE ImagingFileTypes + SET description='file describing the cortical thickness in a single column' + WHERE type='vertstat'; + +UPDATE ImagingFileTypes + SET description='XML file' + WHERE type='xml'; + +UPDATE ImagingFileTypes + SET description='text file' + WHERE type='txt'; + +UPDATE ImagingFileTypes + SET description='NIfTI file' + WHERE type='nii'; + +UPDATE ImagingFileTypes + SET description='NRRD file format (used by DTIPrep)' + WHERE type='nrrd'; + +INSERT INTO ImagingFileTypes (type, description) + VALUES ('grid_0', 'MNI BIC non-linear field for non-linear transformation'); + +-- DELETE xfmmnc entry as no one understand what it is referring to +DELETE FROM ImagingFileTypes + WHERE type='xfmmnc'; + +-- MAP .nii.gz file type in files table to .nii and delete .nii +UPDATE files + SET FileType='nii' + WHERE FileType='nii.gz'; +DELETE FROM ImagingFileTypes + WHERE type='nii.gz'; + +-- delete .imp (obscure file type not used currently in any project) +DELETE FROM ImagingFileTypes + WHERE type='imp'; diff --git a/SQL/Archive/19.1/2018-02-15_AddCustomizableCRFsUnderLinksInImagBrowser.sql b/SQL/Archive/19.1/2018-02-15_AddCustomizableCRFsUnderLinksInImagBrowser.sql new file mode 100644 index 00000000000..3c033c2e788 --- /dev/null +++ b/SQL/Archive/19.1/2018-02-15_AddCustomizableCRFsUnderLinksInImagBrowser.sql @@ -0,0 +1,33 @@ +-- Add Imaging Browser to Imaging Modules +INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'ImagingBrowserLinkedInstruments', 'Instruments that the users want to see linked from Imaging Browser', 1, 1, 'instrument', ID, 'Imaging Browser Links to Instruments', 7 FROM ConfigSettings WHERE Name="imaging_modules"; + +-- Default imaging_browser settings for Linked instruments +-- This will be the two tables mri_parameter_form and radiology_review; IF they exist in the database +SET @s1 = (SELECT IF( + (SELECT COUNT(*) + FROM INFORMATION_SCHEMA.TABLES + WHERE table_name = 'mri_parameter_form' + AND table_schema = DATABASE() + ) > 0, + "INSERT INTO Config (ConfigID, Value) SELECT cs.ID, 'mri_parameter_form' FROM ConfigSettings cs WHERE cs.Name='ImagingBrowserLinkedInstruments'", + "SELECT 'No. It is therefore not inserted into the Configuration module under Imaging Modules' as 'mri parameter_form table exists?'" +)); + +PREPARE stmt1 FROM @s1; +EXECUTE stmt1; +DEALLOCATE PREPARE stmt1; + +SET @s2 = (SELECT IF( + (SELECT COUNT(*) + FROM INFORMATION_SCHEMA.TABLES + WHERE table_name = 'radiology_review' + AND table_schema = DATABASE() + ) > 0, + "INSERT INTO Config (ConfigID, Value) SELECT cs.ID, 'mri_parameter_form' FROM ConfigSettings cs WHERE cs.Name='ImagingBrowserLinkedInstruments'", + "SELECT 'No. It is therefore not inserted into the Configuration module under Imaging Modules' as 'radiology_review table exists?'" +)); + +PREPARE stmt2 FROM @s2; +EXECUTE stmt2; +DEALLOCATE PREPARE stmt2; + diff --git a/SQL/Archive/2018-02-28_issues_add_cascade.sql b/SQL/Archive/2018-02-28_issues_add_cascade.sql new file mode 100644 index 00000000000..8b42fa8b34c --- /dev/null +++ b/SQL/Archive/2018-02-28_issues_add_cascade.sql @@ -0,0 +1,8 @@ +ALTER TABLE issues_history DROP FOREIGN KEY `fk_issues_comments_1`; +ALTER TABLE issues_history ADD CONSTRAINT `fk_issues_comments_1` FOREIGN KEY (`issueID`) REFERENCES `issues` (`issueID`) ON DELETE CASCADE ON UPDATE RESTRICT; + +ALTER TABLE issues_comments DROP FOREIGN KEY `fk_issue_comments_1`; +ALTER TABLE issues_comments ADD CONSTRAINT `fk_issue_comments_1` FOREIGN KEY (`issueID`) REFERENCES `issues` (`issueID`) ON DELETE CASCADE ON UPDATE RESTRICT; + +ALTER TABLE issues_comments_history DROP FOREIGN KEY `fk_issues_comments_history`; +ALTER TABLE issues_comments_history ADD CONSTRAINT `fk_issues_comments_history` FOREIGN KEY (`issueCommentID`) REFERENCES `issues_comments` (`issueCommentID`) ON DELETE CASCADE ON UPDATE RESTRICT; diff --git a/SQL/Archive/2018-03-01_genomics_add_cascade.sql b/SQL/Archive/2018-03-01_genomics_add_cascade.sql new file mode 100644 index 00000000000..b26bb9834f9 --- /dev/null +++ b/SQL/Archive/2018-03-01_genomics_add_cascade.sql @@ -0,0 +1,4 @@ +ALTER TABLE genomic_cpg DROP FOREIGN KEY `genomic_cpg_ibfk_1`; +ALTER TABLE genomic_cpg DROP FOREIGN KEY `genomic_cpg_ibfk_2`; +ALTER TABLE genomic_cpg ADD CONSTRAINT `genomic_cpg_ibfk_1` FOREIGN KEY (`sample_label`) REFERENCES `genomic_sample_candidate_rel` (`sample_label`) ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE genomic_cpg ADD CONSTRAINT `genomic_cpg_ibfk_2` FOREIGN KEY (`cpg_name`) REFERENCES `genomic_cpg_annotation` (`cpg_name`) ON DELETE CASCADE ON UPDATE CASCADE; diff --git a/SQL/Archive/2018-03-02_session_add_cascade.sql b/SQL/Archive/2018-03-02_session_add_cascade.sql new file mode 100644 index 00000000000..af0945536bf --- /dev/null +++ b/SQL/Archive/2018-03-02_session_add_cascade.sql @@ -0,0 +1,3 @@ +ALTER TABLE parameter_session DROP FOREIGN KEY `FK_parameter_session_1`; +ALTER TABLE parameter_session ADD CONSTRAINT `FK_parameter_session_1` FOREIGN KEY (`SessionID`) REFERENCES `session` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE + diff --git a/SQL/Archive/2018-04-05_remove_if_site_from_imaging_pipeline_in_Config_tables.sql b/SQL/Archive/2018-04-05_remove_if_site_from_imaging_pipeline_in_Config_tables.sql new file mode 100644 index 00000000000..9d3cb12baf6 --- /dev/null +++ b/SQL/Archive/2018-04-05_remove_if_site_from_imaging_pipeline_in_Config_tables.sql @@ -0,0 +1,5 @@ +-- Removing the config setting if_site of the imaging pipeline section as discussed during a LORIS imaging meeting +DELETE FROM Config WHERE ConfigID=( + SELECT ID FROM ConfigSettings WHERE Name='if_site' +); +DELETE FROM ConfigSettings WHERE Name='if_site'; diff --git a/SQL/Archive/2018-04-06_Change_no_nii_option_to_create_nii.sql b/SQL/Archive/2018-04-06_Change_no_nii_option_to_create_nii.sql new file mode 100644 index 00000000000..d6e3a5ebbf6 --- /dev/null +++ b/SQL/Archive/2018-04-06_Change_no_nii_option_to_create_nii.sql @@ -0,0 +1,12 @@ +UPDATE ConfigSettings + SET Name="create_nii", + Description="Create NIfTI files if set to 1", + Label="NIfTI file creation" + WHERE Name="no_nii"; +UPDATE Config + SET Value=IF( + (SELECT Value FROM ConfigSettings cs WHERE cs.Name="create_nii")=0, 1, 0 + ) + WHERE ConfigID=( + SELECT ID FROM ConfigSettings cs WHERE cs.Name="create_nii" + ); diff --git a/SQL/Archive/2018-04-06_ImprovedDescriptionOfLookupCenterNameUsing.sql b/SQL/Archive/2018-04-06_ImprovedDescriptionOfLookupCenterNameUsing.sql new file mode 100644 index 00000000000..5cdc659e44d --- /dev/null +++ b/SQL/Archive/2018-04-06_ImprovedDescriptionOfLookupCenterNameUsing.sql @@ -0,0 +1,5 @@ +-- Change description and label of the ConfigSetting named lookupCenterNameUsing +UPDATE ConfigSettings SET + Description = "DICOM field (either PatientName or PatientID) to use to get the patient identifiers and the center name of the DICOM study", + Label = "Patient identifiers and center name lookup variable" + WHERE Name = "lookupCenterNameUsing"; diff --git a/SQL/Archive/2018-04-09_ClarifyingImagingPipelineConfigDescriptions.sql b/SQL/Archive/2018-04-09_ClarifyingImagingPipelineConfigDescriptions.sql new file mode 100644 index 00000000000..75fc0bee91e --- /dev/null +++ b/SQL/Archive/2018-04-09_ClarifyingImagingPipelineConfigDescriptions.sql @@ -0,0 +1,16 @@ +UPDATE ConfigSettings + SET Description='Enable generation of horizontal pictures' + WHERE Name='horizontalPics'; + +UPDATE ConfigSettings + SET Description='Enable creation of NIfTI files' + WHERE Name="create_nii"; + +UPDATE ConfigSettings + SET Description='Enable candidate creation in the imaging pipeline' + WHERE Name='createCandidates'; + +UPDATE ConfigSettings + SET Description='Enable use of batch management in the imaging pipeline' + WHERE Name='is_qsub'; + diff --git a/SQL/Release_patches/19.0_To_19.1_upgrade.sql b/SQL/Release_patches/19.0_To_19.1_upgrade.sql new file mode 100644 index 00000000000..a5f09ec27cf --- /dev/null +++ b/SQL/Release_patches/19.0_To_19.1_upgrade.sql @@ -0,0 +1,130 @@ +CREATE TABLE `language` ( + `language_id` integer unsigned NOT NULL AUTO_INCREMENT, + `language_code` varchar(255) NOT NULL, + `language_label` varchar(255) NOT NULL, + PRIMARY KEY (`language_id`), + UNIQUE KEY (`language_code`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +INSERT INTO language (language_code, language_label) VALUES ('en-CA', 'English'); + +ALTER TABLE users ADD language_preference integer unsigned DEFAULT NULL; +ALTER TABLE users ADD CONSTRAINT `FK_users_2` FOREIGN KEY (`language_preference`) REFERENCES `language` (`language_id`); + +ALTER TABLE media ADD COLUMN language_id INT UNSIGNED DEFAULT NULL; +ALTER TABLE media ADD CONSTRAINT `FK_media_language` FOREIGN KEY (`language_id`) REFERENCES `language` (`language_id`); + +-- Disable Foreign key to be able to change type +-- of FileType to VARCHAR(12) in files, +-- mri_processing_protocol and ImagingFileType +SET FOREIGN_KEY_CHECKS=0; + +-- ALTER files to drop the FK_files_FileTypes +ALTER TABLE files + MODIFY `FileType` VARCHAR(12); + +-- ALTER mri_processing_protocol to drop the +-- FK_mri_processing_protocol_FileTypes +ALTER TABLE mri_processing_protocol + MODIFY `FileType` VARCHAR(12); + +-- ALTER ImagingFileTypes table to add a `description` column +ALTER TABLE ImagingFileTypes + MODIFY `type` VARCHAR(12) NOT NULL, + ADD `description` VARCHAR(255) DEFAULT NULL; + +-- Re-enable the forein keys +SET FOREIGN_KEY_CHECKS=1; + +-- ADD description to the different type +UPDATE ImagingFileTypes + SET description='MINC file' + WHERE type='mnc'; + +UPDATE ImagingFileTypes + SET description='3D imaging format' + WHERE type='obj'; + +UPDATE ImagingFileTypes + SET description='transformation matrix file' + WHERE type='xfm'; + +UPDATE ImagingFileTypes + SET description=NULL + WHERE type='xfmmnc'; + +UPDATE ImagingFileTypes + SET description='audition impulse file' + WHERE type='imp'; + +UPDATE ImagingFileTypes + SET description='file describing the cortical thickness in a single column' + WHERE type='vertstat'; + +UPDATE ImagingFileTypes + SET description='XML file' + WHERE type='xml'; + +UPDATE ImagingFileTypes + SET description='text file' + WHERE type='txt'; + +UPDATE ImagingFileTypes + SET description='NIfTI file' + WHERE type='nii'; + +UPDATE ImagingFileTypes + SET description='NRRD file format (used by DTIPrep)' + WHERE type='nrrd'; + +INSERT INTO ImagingFileTypes (type, description) + VALUES ('grid_0', 'MNI BIC non-linear field for non-linear transformation'); + +-- DELETE xfmmnc entry as no one understand what it is referring to +DELETE FROM ImagingFileTypes + WHERE type='xfmmnc'; + +-- MAP .nii.gz file type in files table to .nii and delete .nii +UPDATE files + SET FileType='nii' + WHERE FileType='nii.gz'; +DELETE FROM ImagingFileTypes + WHERE type='nii.gz'; + +-- delete .imp (obscure file type not used currently in any project) +DELETE FROM ImagingFileTypes + WHERE type='imp'; + +-- Add Imaging Browser to Imaging Modules +INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'ImagingBrowserLinkedInstruments', 'Instruments that the users want to see linked from Imaging Browser', 1, 1, 'instrument', ID, 'Imaging Browser Links to Instruments', 7 FROM ConfigSettings WHERE Name="imaging_modules"; + +-- Default imaging_browser settings for Linked instruments +-- This will be the two tables mri_parameter_form and radiology_review; IF they exist in the database +SET @s1 = (SELECT IF( + (SELECT COUNT(*) + FROM INFORMATION_SCHEMA.TABLES + WHERE table_name = 'mri_parameter_form' + AND table_schema = DATABASE() + ) > 0, + "INSERT INTO Config (ConfigID, Value) SELECT cs.ID, 'mri_parameter_form' FROM ConfigSettings cs WHERE cs.Name='ImagingBrowserLinkedInstruments'", + "SELECT 'No. It is therefore not inserted into the Configuration module under Imaging Modules' as 'mri parameter_form table exists?'" +)); + +PREPARE stmt1 FROM @s1; +EXECUTE stmt1; +DEALLOCATE PREPARE stmt1; + +SET @s2 = (SELECT IF( + (SELECT COUNT(*) + FROM INFORMATION_SCHEMA.TABLES + WHERE table_name = 'radiology_review' + AND table_schema = DATABASE() + ) > 0, + "INSERT INTO Config (ConfigID, Value) SELECT cs.ID, 'mri_parameter_form' FROM ConfigSettings cs WHERE cs.Name='ImagingBrowserLinkedInstruments'", + "SELECT 'No. It is therefore not inserted into the Configuration module under Imaging Modules' as 'radiology_review table exists?'" +)); + +PREPARE stmt2 FROM @s2; +EXECUTE stmt2; +DEALLOCATE PREPARE stmt2; + diff --git a/docs/API/InstrumentFormat.md b/docs/API/InstrumentFormat.md index cff8a6372c1..d176bd832e6 100644 --- a/docs/API/InstrumentFormat.md +++ b/docs/API/InstrumentFormat.md @@ -45,13 +45,13 @@ Where each key should be interpreted as so: are no restrictions on how to determine the InstrumentVersion, but it SHOULD change with any changes to the instrument object. - For instance, if an `InstrumentVersion` of "MyInstrument-V1" exists + For instance, if an `InstrumentVersion` of "MyInstrument-V1" exists and the options were changed in a `SelectPageElement` to better match the paper copy of the instrument, the InstrumentVersion of the new version SHOULD be changed to "MyInstrument-V2" or in some other way that could differentiate the instrument objects. - The `InstrumentVersion` is a self-contained string which can be interpreted + The `InstrumentVersion` is a self-contained string which can be interpreted independently of the `ShortName` or `LongName` of the instrument. `Meta.InstrumentFormatVersion`: A hardcoded string specifying what version of this spec @@ -116,9 +116,9 @@ the following format: ## 2.1: Specific element types -2.1.x describes input related types -2.2.x describes layout related types -3.x describes element group related types. +2.1.x describes input related types +2.2.x describes layout related types +3.x describes element group related types. ### 2.1.1: Select Element @@ -151,7 +151,7 @@ as follows. It denotes a group of values of which the user must select one optio `Options.Values`: REQUIRED. Contains a JSON object specifying the options to be selected. Each key/value corresponds - to in an + to `` in an HTML implementation. The JSONKey contains the value to be saved if selected, and the JSONValue contains the human friendly text to display to the user. @@ -192,7 +192,7 @@ save it. The format is as follows: } ``` -`Type`: MUST be "text" +`Type`: MUST be "text". `Name`: Required. Follows PageElement.Name rules. @@ -200,9 +200,9 @@ save it. The format is as follows: `Options.Type`: Either "large" or "small". If "large", the user is meant to enter a lot of text (ie. a comment box) and is likely to be represented - by a textarea in an HTML implementation. + by a `