From f60bea8a3072f2c839cafded204b61d282bd9505 Mon Sep 17 00:00:00 2001 From: ridz1208 Date: Thu, 18 Apr 2019 16:01:30 -0400 Subject: [PATCH 1/3] Add publication module SQL to the schema files --- SQL/0000-00-00-schema.sql | 152 ++++++++++++++++++ .../20.3/2018-05-28_publication_schema.sql | 2 +- 2 files changed, 153 insertions(+), 1 deletion(-) diff --git a/SQL/0000-00-00-schema.sql b/SQL/0000-00-00-schema.sql index d33721c6843..46d129dffd6 100644 --- a/SQL/0000-00-00-schema.sql +++ b/SQL/0000-00-00-schema.sql @@ -2045,3 +2045,155 @@ CREATE TABLE `candidate_consent_history` ( `EntryStaff` varchar(255) DEFAULT NULL, CONSTRAINT `PK_candidate_consent_history` PRIMARY KEY (`CandidateConsentHistoryID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- Publication Status +CREATE TABLE `publication_status` ( + `PublicationStatusID` int(2) unsigned NOT NULL AUTO_INCREMENT, + `Label` varchar(255) NOT NULL, + CONSTRAINT `PK_publication_status` PRIMARY KEY(`PublicationStatusID`), + CONSTRAINT `UK_publication_status_Label` UNIQUE (`Label`) +) ENGINE=InnoDB DEFAULT CHARSET='utf8'; +INSERT INTO publication_status (`Label`) VALUES ('Pending'); +INSERT INTO publication_status (`Label`) VALUES ('Approved'); +INSERT INTO publication_status (`Label`) VALUES ('Rejected'); + +CREATE TABLE `publication_collaborator` ( + `PublicationCollaboratorID` int(10) unsigned NOT NULL AUTO_INCREMENT, + `Name` varchar(255) NOT NULL, + `Email` varchar(255), + CONSTRAINT `PK_publication_collaborator` PRIMARY KEY(`PublicationCollaboratorID`), + CONSTRAINT `UK_publication_collaborator_Email` UNIQUE (`Email`) +) ENGINE=InnoDB DEFAULT CHARSET='utf8'; + +-- Main table +CREATE TABLE `publication` ( + `PublicationID` int(10) unsigned NOT NULL AUTO_INCREMENT, + `PublicationStatusID` int(2) unsigned NOT NULL default 1, + `LeadInvestigatorID` int(10) unsigned NOT NULL, + `UserID` int(10) unsigned NOT NULL, + `RatedBy` int(10) unsigned, + `DateProposed` date NOT NULL, + `DateRated` date default NULL, + `Title` varchar(255) NOT NULL, + `RejectedReason` varchar(255) default NULL, + `Description` text NOT NULL, + CONSTRAINT `PK_publication` PRIMARY KEY(`PublicationID`), + CONSTRAINT `FK_publication_UserID` FOREIGN KEY(`UserID`) REFERENCES `users` (`ID`), + CONSTRAINT `FK_publication_RatedBy` FOREIGN KEY(`RatedBy`) REFERENCES `users` (`ID`), + CONSTRAINT `FK_publication_PublicationStatusID` FOREIGN KEY(`PublicationStatusID`) REFERENCES `publication_status` (`PublicationStatusID`), + CONSTRAINT `FK_publication_LeadInvestigatorID` FOREIGN KEY(`LeadInvestigatorID`) REFERENCES `publication_collaborator` (`PublicationCollaboratorID`), + CONSTRAINT `UK_publication_Title` UNIQUE (`Title`) +) ENGINE=InnoDB DEFAULT CHARSET='utf8'; + +-- Separate table for Keywords +CREATE TABLE `publication_keyword` ( + `PublicationKeywordID` int(10) unsigned NOT NULL AUTO_INCREMENT, + `Label` varchar(255) NOT NULL, + CONSTRAINT `PK_publication_keyword` PRIMARY KEY(`PublicationKeywordID`), + CONSTRAINT `UK_publication_Label` UNIQUE (`Label`) +) ENGINE=InnoDB DEFAULT CHARSET='utf8'; + +-- Publication - Keyword relational table +CREATE TABLE `publication_keyword_rel` ( + `PublicationID` int(10) unsigned NOT NULL, + `PublicationKeywordID` int(10) unsigned NOT NULL, + CONSTRAINT `PK_publication_keyword_rel` PRIMARY KEY(PublicationID, PublicationKeywordID), + CONSTRAINT `FK_publication_keyword_PublicationID` FOREIGN KEY(`PublicationID`) REFERENCES `publication` (`PublicationID`), + CONSTRAINT `FK_publication_keyword_PublicationKeywordID` FOREIGN KEY(`PublicationKeywordID`) REFERENCES `publication_keyword` (`PublicationKeywordID`) +) ENGINE=InnoDB DEFAULT CHARSET='utf8'; + +CREATE TABLE `publication_collaborator_rel` ( + `PublicationID` int(10) unsigned NOT NULL, + `PublicationCollaboratorID` int(10) unsigned NOT NULL, + CONSTRAINT `PK_publication_collaborator_rel` PRIMARY KEY(PublicationID, PublicationCollaboratorID), + CONSTRAINT `FK_publication_collaborator_rel_PublicationID` FOREIGN KEY(`PublicationID`) REFERENCES `publication` (`PublicationID`), + CONSTRAINT `FK_publication_collaborator_rel_PublicationCollaboratorID` FOREIGN KEY(`PublicationCollaboratorID`) REFERENCES `publication_collaborator` (`PublicationCollaboratorID`) +) ENGINE=InnoDB DEFAULT CHARSET='utf8'; + +-- Publication - Variable of Interest relational table +CREATE TABLE `publication_parameter_type_rel` ( + `PublicationID` int(10) unsigned NOT NULL, + `ParameterTypeID` int(10) unsigned NOT NULL, + CONSTRAINT `PK_publication_parameter_type_rel` PRIMARY KEY (PublicationID, ParameterTypeID), + CONSTRAINT `FK_publication_parameter_type_rel_PublicationID` FOREIGN KEY (`PublicationID`) REFERENCES `publication` (`PublicationID`), + CONSTRAINT `FK_publication_parameter_type_rel_ParameterTypeID` FOREIGN KEY (`ParameterTypeID`) REFERENCES `parameter_type` (`ParameterTypeID`) +) ENGINE=InnoDB DEFAULT CHARSET='utf8'; + +CREATE TABLE `publication_test_names_rel` ( + `PublicationID` int(10) unsigned NOT NULL, + `TestNameID` int(10) unsigned NOT NULL, + CONSTRAINT `PK_publication_test_names_rel` PRIMARY KEY(`PublicationID`, `TestNameID`), + CONSTRAINT `FK_publication_test_names_rel_PublicationID` FOREIGN KEY (`PublicationID`) REFERENCES `publication` (`PublicationID`), + CONSTRAINT `FK_publication_test_names_rel_TestNameID` FOREIGN KEY (`TestNameID`) REFERENCES `test_names` (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET='utf8'; + +-- Publication Uploads +CREATE TABLE `publication_upload_type` ( + `PublicationUploadTypeID` int(2) unsigned NOT NULL AUTO_INCREMENT, + `Label` varchar(255) NOT NULL, + CONSTRAINT `PK_publication_upload_type` PRIMARY KEY (`PublicationUploadTypeID`), + CONSTRAINT `UK_publication_Label` UNIQUE (`Label`) +) ENGINE=InnoDB DEFAULT CHARSET='utf8'; + +INSERT INTO publication_upload_type (`Label`) VALUES ('Paper'); +INSERT INTO publication_upload_type (`Label`) VALUES ('Poster'); +INSERT INTO publication_upload_type (`Label`) VALUES ('Presentation'); +INSERT INTO publication_upload_type (`Label`) VALUES ('Other'); + +CREATE TABLE `publication_upload` ( + `PublicationUploadID` int(10) unsigned NOT NULL AUTO_INCREMENT, + `PublicationID` int(10) unsigned NOT NULL, + `PublicationUploadTypeID` int(2) unsigned NOT NULL, + `Filename` varchar(255) NOT NULL, + `Version` varchar(255), + `Citation` text, + CONSTRAINT `PK_publication_upload` PRIMARY KEY (`PublicationUploadID`), + CONSTRAINT `UK_publication_upload_Filename` UNIQUE (Filename), + CONSTRAINT `FK_publication_upload_PublicationID` FOREIGN KEY (`PublicationID`) REFERENCES `publication` (`PublicationID`), + CONSTRAINT `FK_publication_upload_PublicationUploadTypeID` FOREIGN KEY (`PublicationUploadTypeID`) REFERENCES `publication_upload_type` (`PublicationUploadTypeID`) +) ENGINE=InnoDB DEFAULT CHARSET='utf8'; + +CREATE TABLE `publication_users_edit_perm_rel` ( + `PublicationID` int(10) unsigned NOT NULL AUTO_INCREMENT, + `UserID` int(10) unsigned NOT NULL, + CONSTRAINT `FK_publication_users_edit_perm_rel_PublicationID` FOREIGN KEY (`PublicationID`) REFERENCES `publication` (`PublicationID`), + CONSTRAINT `FK_publication_users_edit_perm_rel_UserID` FOREIGN KEY (`UserID`) REFERENCES `users` (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET='utf8'; + +SET @reportsTab = (SELECT ID FROM LorisMenu WHERE Label='Reports'); +SET @orderNum = (SELECT MAX(OrderNumber) + 1 FROM LorisMenu WHERE Parent=@reportsTab); +INSERT INTO LorisMenu (Parent, Label, Link, OrderNumber) VALUES (@reportsTab, 'Publications', 'publication/', @orderNum); +INSERT INTO permissions (code, description, categoryID) VALUES ('publication_view', 'Publication - Access to module', 2); +INSERT INTO permissions (code, description, categoryID) VALUES ('publication_propose', 'Publication - Propose a project', 2); +INSERT INTO permissions (code, description, categoryID) VALUES ('publication_approve', 'Publication - Approve or reject proposed publication projects', 2); +INSERT INTO LorisMenuPermissions (MenuID, PermID) VALUES ((SELECT ID FROM LorisMenu WHERE Label='Publications'), (SELECT permID FROM permissions WHERE code='publication_view')); +INSERT INTO LorisMenuPermissions (MenuID, PermID) VALUES ((SELECT ID FROM LorisMenu WHERE Label='Publications'), (SELECT permID FROM permissions WHERE code='publication_propose')); +INSERT INTO LorisMenuPermissions (MenuID, PermID) VALUES ((SELECT ID FROM LorisMenu WHERE Label='Publications'), (SELECT permID FROM permissions WHERE code='publication_approve')); +INSERT INTO user_perm_rel (userID, permID) VALUES(1, (SELECT permID FROM permissions WHERE code='publication_approve')); +INSERT INTO user_perm_rel (userID, permID) VALUES(1, (SELECT permID FROM permissions WHERE code='publication_view')); +INSERT INTO user_perm_rel (userID, permID) VALUES(1, (SELECT permID FROM permissions WHERE code='publication_propose')); + +INSERT INTO notification_modules (module_name, operation_type, template_file, description) VALUES ('publication', 'submission', 'notifier_publication_submission.tpl', 'Publication: Submission Received'); +INSERT INTO notification_modules (module_name, operation_type, template_file, description) VALUES ('publication', 'review', 'notifier_publication_review.tpl', 'Publication: Proposal has been reviewed'); +INSERT INTO notification_modules (module_name, operation_type, template_file, description) VALUES ('publication', 'edit', 'notifier_publication_edit.tpl', 'Publication: Proposal has been edited'); + +INSERT INTO notification_modules_services_rel (module_id, service_id) VALUES ( + (SELECT id FROM notification_modules WHERE module_name='publication' AND operation_type='submission'), + (SELECT id FROM notification_services WHERE service='email_text') +); +INSERT INTO notification_modules_services_rel (module_id, service_id) VALUES ( + (SELECT id FROM notification_modules WHERE module_name='publication' AND operation_type='review'), + (SELECT id FROM notification_services WHERE service='email_text') +); +INSERT INTO notification_modules_services_rel (module_id, service_id) VALUES ( + (SELECT id FROM notification_modules WHERE module_name='publication' AND operation_type='edit'), + (SELECT id FROM notification_services WHERE service='email_text') +); + +SET @pathID = (SELECT ID FROM ConfigSettings WHERE Name='paths'); +SET @order = (SELECT MAX(OrderNumber) + 1 FROM ConfigSettings WHERE Parent=@pathID); +INSERT INTO ConfigSettings (Name, Description, Visible, Parent, Label, DataType, OrderNumber) VALUES ('publication_uploads', 'Path to uploaded publications', 1, @pathID, 'Publications', 'text', @order + 1); +INSERT INTO Config (ConfigID, Value) VALUES ((SELECT ID FROM ConfigSettings WHERE Name='publication_uploads'), '/data/publication_uploads/'); + +INSERT INTO ConfigSettings (Name, Description, Visible, Parent, Label, DataType, OrderNumber) VALUES ('publication_deletions', 'Path to deleted publications', 1, @pathID, 'Deleted Publications', 'text', @order + 1); +INSERT INTO Config (ConfigID, Value) VALUES ((SELECT ID FROM ConfigSettings WHERE Name='publication_deletions'), '/data/publication_uploads/to_be_deleted/'); diff --git a/SQL/Archive/20.3/2018-05-28_publication_schema.sql b/SQL/Archive/20.3/2018-05-28_publication_schema.sql index 2faac70a65d..2103a16ec35 100644 --- a/SQL/Archive/20.3/2018-05-28_publication_schema.sql +++ b/SQL/Archive/20.3/2018-05-28_publication_schema.sql @@ -77,7 +77,7 @@ CREATE TABLE `publication_test_names_rel` ( CONSTRAINT `PK_publication_test_names_rel` PRIMARY KEY(`PublicationID`, `TestNameID`), CONSTRAINT `FK_publication_test_names_rel_PublicationID` FOREIGN KEY (`PublicationID`) REFERENCES `publication` (`PublicationID`), CONSTRAINT `FK_publication_test_names_rel_TestNameID` FOREIGN KEY (`TestNameID`) REFERENCES `test_names` (`ID`) -) ENGINE=InnoDB DEFAULT CHARSET='utf8mb4'; +) ENGINE=InnoDB DEFAULT CHARSET='utf8'; -- Publication Uploads CREATE TABLE `publication_upload_type` ( From 888d0b4b53d8434b34911594a2630b3fee25ccd6 Mon Sep 17 00:00:00 2001 From: ridz1208 Date: Thu, 18 Apr 2019 16:44:02 -0400 Subject: [PATCH 2/3] split to proper files --- SQL/0000-00-00-schema.sql | 47 +++++---------------------------- SQL/0000-00-01-Permission.sql | 6 ++++- SQL/0000-00-02-Menus.sql | 9 ++++++- SQL/0000-00-03-ConfigTables.sql | 8 +++++- 4 files changed, 26 insertions(+), 44 deletions(-) diff --git a/SQL/0000-00-00-schema.sql b/SQL/0000-00-00-schema.sql index 46d129dffd6..af9e079352f 100644 --- a/SQL/0000-00-00-schema.sql +++ b/SQL/0000-00-00-schema.sql @@ -993,10 +993,13 @@ INSERT INTO notification_modules (module_name, operation_type, as_admin, templat ('document_repository', 'new_category', 'N', 'notifier_document_repository_new_category.tpl', 'Document Repository: New Category'), ('document_repository', 'upload', 'N', 'notifier_document_repository_upload.tpl', 'Document Repository: New Document Uploaded'), ('document_repository', 'delete', 'N', 'notifier_document_repository_delete.tpl', 'Document Repository: Document Deleted'), - ('document_repository', 'edit', 'N', 'notifier_document_repository_edit.tpl', 'Document Repository: Document Edited'); + ('document_repository', 'edit', 'N', 'notifier_document_repository_edit.tpl', 'Document Repository: Document Edited'), + ('publication', 'submission', 'notifier_publication_submission.tpl', 'Publication: Submission Received'), + ('publication', 'review', 'notifier_publication_review.tpl', 'Publication: Proposal has been reviewed'), + ('publication', 'edit', 'notifier_publication_edit.tpl', 'Publication: Proposal has been edited'); --- enable doc repo basic text emails INSERT INTO notification_modules_services_rel SELECT nm.id, ns.id FROM notification_modules nm JOIN notification_services ns WHERE nm.module_name='document_repository' AND ns.service='email_text'; +INSERT INTO notification_modules_services_rel SELECT nm.id, ns.id FROM notification_modules nm JOIN notification_services ns WHERE nm.module_name='publication' AND ns.service='email_text'; -- Transfer Document repository notifications to new system INSERT INTO users_notifications_rel SELECT u.ID, nm.id, ns.id FROM users u JOIN notification_modules nm JOIN notification_services ns WHERE nm.module_name='document_repository' AND ns.service='email_text' AND u.Doc_Repo_Notifications='Y'; @@ -2158,42 +2161,4 @@ CREATE TABLE `publication_users_edit_perm_rel` ( `UserID` int(10) unsigned NOT NULL, CONSTRAINT `FK_publication_users_edit_perm_rel_PublicationID` FOREIGN KEY (`PublicationID`) REFERENCES `publication` (`PublicationID`), CONSTRAINT `FK_publication_users_edit_perm_rel_UserID` FOREIGN KEY (`UserID`) REFERENCES `users` (`ID`) -) ENGINE=InnoDB DEFAULT CHARSET='utf8'; - -SET @reportsTab = (SELECT ID FROM LorisMenu WHERE Label='Reports'); -SET @orderNum = (SELECT MAX(OrderNumber) + 1 FROM LorisMenu WHERE Parent=@reportsTab); -INSERT INTO LorisMenu (Parent, Label, Link, OrderNumber) VALUES (@reportsTab, 'Publications', 'publication/', @orderNum); -INSERT INTO permissions (code, description, categoryID) VALUES ('publication_view', 'Publication - Access to module', 2); -INSERT INTO permissions (code, description, categoryID) VALUES ('publication_propose', 'Publication - Propose a project', 2); -INSERT INTO permissions (code, description, categoryID) VALUES ('publication_approve', 'Publication - Approve or reject proposed publication projects', 2); -INSERT INTO LorisMenuPermissions (MenuID, PermID) VALUES ((SELECT ID FROM LorisMenu WHERE Label='Publications'), (SELECT permID FROM permissions WHERE code='publication_view')); -INSERT INTO LorisMenuPermissions (MenuID, PermID) VALUES ((SELECT ID FROM LorisMenu WHERE Label='Publications'), (SELECT permID FROM permissions WHERE code='publication_propose')); -INSERT INTO LorisMenuPermissions (MenuID, PermID) VALUES ((SELECT ID FROM LorisMenu WHERE Label='Publications'), (SELECT permID FROM permissions WHERE code='publication_approve')); -INSERT INTO user_perm_rel (userID, permID) VALUES(1, (SELECT permID FROM permissions WHERE code='publication_approve')); -INSERT INTO user_perm_rel (userID, permID) VALUES(1, (SELECT permID FROM permissions WHERE code='publication_view')); -INSERT INTO user_perm_rel (userID, permID) VALUES(1, (SELECT permID FROM permissions WHERE code='publication_propose')); - -INSERT INTO notification_modules (module_name, operation_type, template_file, description) VALUES ('publication', 'submission', 'notifier_publication_submission.tpl', 'Publication: Submission Received'); -INSERT INTO notification_modules (module_name, operation_type, template_file, description) VALUES ('publication', 'review', 'notifier_publication_review.tpl', 'Publication: Proposal has been reviewed'); -INSERT INTO notification_modules (module_name, operation_type, template_file, description) VALUES ('publication', 'edit', 'notifier_publication_edit.tpl', 'Publication: Proposal has been edited'); - -INSERT INTO notification_modules_services_rel (module_id, service_id) VALUES ( - (SELECT id FROM notification_modules WHERE module_name='publication' AND operation_type='submission'), - (SELECT id FROM notification_services WHERE service='email_text') -); -INSERT INTO notification_modules_services_rel (module_id, service_id) VALUES ( - (SELECT id FROM notification_modules WHERE module_name='publication' AND operation_type='review'), - (SELECT id FROM notification_services WHERE service='email_text') -); -INSERT INTO notification_modules_services_rel (module_id, service_id) VALUES ( - (SELECT id FROM notification_modules WHERE module_name='publication' AND operation_type='edit'), - (SELECT id FROM notification_services WHERE service='email_text') -); - -SET @pathID = (SELECT ID FROM ConfigSettings WHERE Name='paths'); -SET @order = (SELECT MAX(OrderNumber) + 1 FROM ConfigSettings WHERE Parent=@pathID); -INSERT INTO ConfigSettings (Name, Description, Visible, Parent, Label, DataType, OrderNumber) VALUES ('publication_uploads', 'Path to uploaded publications', 1, @pathID, 'Publications', 'text', @order + 1); -INSERT INTO Config (ConfigID, Value) VALUES ((SELECT ID FROM ConfigSettings WHERE Name='publication_uploads'), '/data/publication_uploads/'); - -INSERT INTO ConfigSettings (Name, Description, Visible, Parent, Label, DataType, OrderNumber) VALUES ('publication_deletions', 'Path to deleted publications', 1, @pathID, 'Deleted Publications', 'text', @order + 1); -INSERT INTO Config (ConfigID, Value) VALUES ((SELECT ID FROM ConfigSettings WHERE Name='publication_deletions'), '/data/publication_uploads/to_be_deleted/'); +) ENGINE=InnoDB DEFAULT CHARSET='utf8'; \ No newline at end of file diff --git a/SQL/0000-00-01-Permission.sql b/SQL/0000-00-01-Permission.sql index 2a69a445ba5..67017734e07 100644 --- a/SQL/0000-00-01-Permission.sql +++ b/SQL/0000-00-01-Permission.sql @@ -111,7 +111,10 @@ INSERT INTO `permissions` VALUES (47,'imaging_browser_phantom_allsites', 'Can access only phantom data from all sites in Imaging Browser', 2), (48,'imaging_browser_phantom_ownsite', 'Can access only phantom data from own site in Imaging Browser', 2), (49,'data_release_upload', 'Data Release: Upload file', 2), - (50,'data_release_edit_file_access', 'Data Release: Grant other users view-file permissions', 2); + (50,'data_release_edit_file_access', 'Data Release: Grant other users view-file permissions', 2), + (51,'publication_view', 'Publication - Access to module', 2), + (52,'publication_propose', 'Publication - Propose a project', 2), + (53,'publication_approve', 'Publication - Approve or reject proposed publication projects', 2); INSERT INTO `user_perm_rel` (userID, permID) @@ -133,3 +136,4 @@ CREATE TABLE `notification_modules_perm_rel` ( -- populate notification perm table INSERT INTO notification_modules_perm_rel SELECT nm.id, p.permID FROM notification_modules nm JOIN permissions p WHERE nm.module_name='media' AND (p.code='media_write' OR p.code='media_read'); INSERT INTO notification_modules_perm_rel SELECT nm.id, p.permID FROM notification_modules nm JOIN permissions p WHERE nm.module_name='document_repository' AND (p.code='document_repository_view' OR p.code='document_repository_delete'); +INSERT INTO notification_modules_perm_rel SELECT nm.id, p.permID FROM notification_modules nm JOIN permissions p WHERE nm.module_name='publication' AND (p.code='publication_view' OR p.code='publication_propose' OR p.code='publication_approve'); diff --git a/SQL/0000-00-02-Menus.sql b/SQL/0000-00-02-Menus.sql index d2be38c4b7d..4225d930d05 100644 --- a/SQL/0000-00-02-Menus.sql +++ b/SQL/0000-00-02-Menus.sql @@ -66,7 +66,8 @@ INSERT INTO LorisMenu (Label, Link, Parent, OrderNumber) VALUES INSERT INTO LorisMenu (Label, Link, Parent, OrderNumber) VALUES ('Statistics', 'statistics/', (SELECT ID FROM LorisMenu as L WHERE Label='Reports'), 1), - ('Data Query Tool', 'dataquery/', (SELECT ID FROM LorisMenu as L WHERE Label='Reports'), 2); + ('Data Query Tool', 'dataquery/', (SELECT ID FROM LorisMenu as L WHERE Label='Reports'), 2), + ('Publications', 'publication/', (SELECT ID FROM LorisMenu as L WHERE Label='Reports'), 3); INSERT INTO LorisMenu (Label, Link, Parent, OrderNumber) VALUES @@ -227,3 +228,9 @@ INSERT INTO LorisMenuPermissions (MenuID, PermID) SELECT m.ID, p.PermID FROM permissions p CROSS JOIN LorisMenu m WHERE p.code='media_write' AND m.Label='Media'; +INSERT INTO LorisMenuPermissions (MenuID, PermID) + SELECT m.ID, p.PermID FROM permissions p CROSS JOIN LorisMenu m WHERE p.code='publication_view' AND m.Label='Publications'; +INSERT INTO LorisMenuPermissions (MenuID, PermID) + SELECT m.ID, p.PermID FROM permissions p CROSS JOIN LorisMenu m WHERE p.code='publication_propose' AND m.Label='Publications'; +INSERT INTO LorisMenuPermissions (MenuID, PermID) + SELECT m.ID, p.PermID FROM permissions p CROSS JOIN LorisMenu m WHERE p.code='publication_approve' AND m.Label='Publications'; diff --git a/SQL/0000-00-03-ConfigTables.sql b/SQL/0000-00-03-ConfigTables.sql index 6722ce5b4b3..bae4eef522a 100644 --- a/SQL/0000-00-03-ConfigTables.sql +++ b/SQL/0000-00-03-ConfigTables.sql @@ -83,7 +83,8 @@ INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'MRIUploadIncomingPath', 'Path to the upload directory for incoming MRI studies', 1, 0, 'text', ID, 'MRI Incoming Directory', 7 FROM ConfigSettings WHERE Name="paths"; INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'GenomicDataPath', 'Path to Genomic data files', 1, 0, 'text', ID, 'Genomic Data Path', 8 FROM ConfigSettings WHERE Name="paths"; INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'mediaPath', 'Path to uploaded media files', 1, 0, 'text', ID, 'Media', 9 FROM ConfigSettings WHERE Name="paths"; - +INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'publication_uploads', 'Path to uploaded publications', 1, 0, 'text', ID, 'Publications', 10 FROM ConfigSettings WHERE Name="paths"; +INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'publication_deletions', 'Path to deleted publications', 1, 0, 'text', ID, 'Deleted Publications', 11 FROM ConfigSettings WHERE Name="paths"; INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, Label, OrderNumber) VALUES ('gui', 'Settings related to the overall display of LORIS', 1, 0, 'GUI', 3); INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'css', 'CSS file used for rendering (default main.css)', 1, 0, 'text', ID, 'CSS file', 1 FROM ConfigSettings WHERE Name="gui"; @@ -156,6 +157,7 @@ INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'compute_snr_modalities', 'Modalities for which the SNR should be computed when running the insertion MRI scripts', 1, 1, 'scan_type', ID, 'Modalities on which SNR should be calculated', 21 FROM ConfigSettings WHERE Name="imaging_pipeline"; INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'reference_scan_type_for_defacing', 'Scan type to use as a reference for registration when defacing anatomical images (typically a T1W image)', 1, 0, 'scan_type', ID, 'Scan type to use as a reference for defacing (typically a T1W image)', 22 FROM ConfigSettings WHERE Name="imaging_pipeline"; INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'modalities_to_deface', 'Modalities for which defacing should be run and defaced image inserted in the database', 1, 1, 'scan_type', ID, 'Modalities on which to run the defacing pipeline', 23 FROM ConfigSettings WHERE Name="imaging_pipeline"; + -- -- Filling Config table with default values -- @@ -196,6 +198,8 @@ INSERT INTO Config (ConfigID, Value) SELECT ID, "/data/%PROJECTNAME%/bin/mri/" F INSERT INTO Config (ConfigID, Value) SELECT ID, "/data/incoming/" FROM ConfigSettings WHERE Name="MRIUploadIncomingPath"; INSERT INTO Config (ConfigID, Value) SELECT ID, "/PATH/TO/Genomic-Data/" FROM ConfigSettings WHERE Name="GenomicDataPath"; INSERT INTO Config (ConfigID, Value) SELECT ID, "/data/uploads/" FROM ConfigSettings WHERE Name="mediaPath"; +INSERT INTO Config (ConfigID, Value) SELECT ID, "/data/publication_uploads/" FROM ConfigSettings WHERE Name="publication_uploads"; +INSERT INTO Config (ConfigID, Value) SELECT ID, "/data/publication_uploads/to_be_deleted/" FROM ConfigSettings WHERE Name="publication_deletions"; INSERT INTO Config (ConfigID, Value) SELECT ID, "main.css" FROM ConfigSettings WHERE Name="css"; @@ -261,3 +265,5 @@ INSERT INTO Config (ConfigID, Value) SELECT ID, 'flair' FROM ConfigSettings WHER INSERT INTO Config (ConfigID, Value) SELECT ID, 't1' FROM ConfigSettings WHERE Name="modalities_to_deface"; INSERT INTO Config (ConfigID, Value) SELECT ID, 't2' FROM ConfigSettings WHERE Name="modalities_to_deface"; INSERT INTO Config (ConfigID, Value) SELECT ID, 'pd' FROM ConfigSettings WHERE Name="modalities_to_deface"; + + From 4c28283878a5aecd2ab0ea73c43d2763f50a136f Mon Sep 17 00:00:00 2001 From: ridz1208 Date: Thu, 25 Apr 2019 10:35:53 -0400 Subject: [PATCH 3/3] wrong number of parameters --- SQL/0000-00-00-schema.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SQL/0000-00-00-schema.sql b/SQL/0000-00-00-schema.sql index af9e079352f..ba296b24786 100644 --- a/SQL/0000-00-00-schema.sql +++ b/SQL/0000-00-00-schema.sql @@ -994,9 +994,9 @@ INSERT INTO notification_modules (module_name, operation_type, as_admin, templat ('document_repository', 'upload', 'N', 'notifier_document_repository_upload.tpl', 'Document Repository: New Document Uploaded'), ('document_repository', 'delete', 'N', 'notifier_document_repository_delete.tpl', 'Document Repository: Document Deleted'), ('document_repository', 'edit', 'N', 'notifier_document_repository_edit.tpl', 'Document Repository: Document Edited'), - ('publication', 'submission', 'notifier_publication_submission.tpl', 'Publication: Submission Received'), - ('publication', 'review', 'notifier_publication_review.tpl', 'Publication: Proposal has been reviewed'), - ('publication', 'edit', 'notifier_publication_edit.tpl', 'Publication: Proposal has been edited'); + ('publication', 'submission', 'N', 'notifier_publication_submission.tpl', 'Publication: Submission Received'), + ('publication', 'review', 'N', 'notifier_publication_review.tpl', 'Publication: Proposal has been reviewed'), + ('publication', 'edit', 'N', 'notifier_publication_edit.tpl', 'Publication: Proposal has been edited'); INSERT INTO notification_modules_services_rel SELECT nm.id, ns.id FROM notification_modules nm JOIN notification_services ns WHERE nm.module_name='document_repository' AND ns.service='email_text'; INSERT INTO notification_modules_services_rel SELECT nm.id, ns.id FROM notification_modules nm JOIN notification_services ns WHERE nm.module_name='publication' AND ns.service='email_text'; @@ -2161,4 +2161,4 @@ CREATE TABLE `publication_users_edit_perm_rel` ( `UserID` int(10) unsigned NOT NULL, CONSTRAINT `FK_publication_users_edit_perm_rel_PublicationID` FOREIGN KEY (`PublicationID`) REFERENCES `publication` (`PublicationID`), CONSTRAINT `FK_publication_users_edit_perm_rel_UserID` FOREIGN KEY (`UserID`) REFERENCES `users` (`ID`) -) ENGINE=InnoDB DEFAULT CHARSET='utf8'; \ No newline at end of file +) ENGINE=InnoDB DEFAULT CHARSET='utf8';