From d3464efa24fb4d3f9cc510eb9c9d07db3bb0c1b3 Mon Sep 17 00:00:00 2001 From: Cristian Fasanando Date: Fri, 12 Feb 2010 11:39:15 -0500 Subject: [PATCH] added table block for dashboard blocks, new tab dashboard and new row inside extra_user_field table - partial CT#567 --- main/inc/lib/database.lib.php | 3 +++ main/install/dokeos_main.sql | 22 +++++++++++++++++-- main/install/migrate-db-1.8.6.2-1.8.7-pre.sql | 5 +++++ 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/main/inc/lib/database.lib.php b/main/inc/lib/database.lib.php index 76095e2902..01c3deca6b 100755 --- a/main/inc/lib/database.lib.php +++ b/main/inc/lib/database.lib.php @@ -111,6 +111,9 @@ define('TABLE_MAIN_MESSAGE', 'message'); // Term and conditions define('TABLE_MAIN_LEGAL', 'legal'); +// Dashboard blocks plugin +define('TABLE_MAIN_BLOCK', 'block'); + // Statistic database tables define('TABLE_STATISTIC_TRACK_E_LASTACCESS', 'track_e_lastaccess'); define('TABLE_STATISTIC_TRACK_E_ACCESS', 'track_e_access'); diff --git a/main/install/dokeos_main.sql b/main/install/dokeos_main.sql index cb5fa44bce..623c0991f8 100755 --- a/main/install/dokeos_main.sql +++ b/main/install/dokeos_main.sql @@ -751,7 +751,8 @@ VALUES ('show_tabs', 'social', 'checkbox', 'Platform', 'true', 'ShowTabsTitle','ShowTabsComment',NULL,'TabsSocial', 0), ('allow_students_to_create_groups_in_social',NULL,'radio','Tools','false','AllowStudentsToCreateGroupsInSocialTitle','AllowStudentsToCreateGroupsInSocialComment',NULL,NULL, 0), ('allow_send_message_to_all_platform_users',NULL,'radio','Tools','false','AllowSendMessageToAllPlatformUsersTitle','AllowSendMessageToAllPlatformUsersComment',NULL,NULL, 0), -('message_max_upload_filesize',NULL,'textfield','Tools','20971520','MessageMaxUploadFilesizeTitle','MessageMaxUploadFilesizeComment',NULL,NULL, 0); +('message_max_upload_filesize',NULL,'textfield','Tools','20971520','MessageMaxUploadFilesizeTitle','MessageMaxUploadFilesizeComment',NULL,NULL, 0), +('show_tabs', 'dashboard', 'checkbox', 'Platform', 'true', 'ShowTabsTitle', 'ShowTabsComment', NULL, 'TabsDashboard', 1); UNLOCK TABLES; /*!40000 ALTER TABLE settings_current ENABLE KEYS */; @@ -2375,4 +2376,21 @@ CREATE TABLE IF NOT EXISTS message_attachment ( INSERT INTO user_field (field_type, field_variable, field_display_text, field_visible, field_changeable) values (10, 'tags','tags',0,0); INSERT INTO user_field (field_type, field_variable, field_display_text, field_visible, field_changeable) values (1, 'rssfeeds','RSS',0,0); -INSERT INTO course_field (field_type, field_variable, field_display_text, field_default_value, field_visible, field_changeable) values (10, 'special_course','Special course', 'Yes', 1 , 1); \ No newline at end of file +INSERT INTO course_field (field_type, field_variable, field_display_text, field_default_value, field_visible, field_changeable) values (10, 'special_course','Special course', 'Yes', 1 , 1); + +-- +-- Table structure for table block +-- + +CREATE TABLE IF NOT EXISTS block ( +id INT NOT NULL AUTO_INCREMENT, +name VARCHAR(255) NULL, +description TEXT NULL, +path VARCHAR(255) NOT NULL, +controller VARCHAR(100) NOT NULL, +enable TINYINT(1) NOT NULL DEFAULT 1, +PRIMARY KEY(id) +); +ALTER TABLE block ADD UNIQUE(path); + +INSERT INTO user_field(field_type, field_variable, field_display_text, field_visible, field_changeable) VALUES(1, 'dashboard', 'dashboard', 0, 0); \ No newline at end of file diff --git a/main/install/migrate-db-1.8.6.2-1.8.7-pre.sql b/main/install/migrate-db-1.8.6.2-1.8.7-pre.sql index 49075830e0..62c78fb609 100755 --- a/main/install/migrate-db-1.8.6.2-1.8.7-pre.sql +++ b/main/install/migrate-db-1.8.6.2-1.8.7-pre.sql @@ -23,6 +23,11 @@ INSERT INTO course_module (name, link, image, `row`, `column`, position) VALUES UPDATE settings_current SET selected_value = '1.8.7.10004' WHERE variable = 'dokeos_database_version'; ALTER TABLE course DROP PRIMARY KEY , ADD UNIQUE KEY code (code); ALTER TABLE course ADD id int NOT NULL auto_increment PRIMARY KEY FIRST; +CREATE TABLE block (id INT NOT NULL auto_increment, name VARCHAR(255) NULL, description TEXT NULL, path VARCHAR(255) NOT NULL, controller VARCHAR(100) NOT NULL, enable TINYINT(1) NOT NULL default 1, PRIMARY KEY(id)); +ALTER TABLE block ADD UNIQUE(path); +INSERT INTO user_field(field_type, field_variable, field_display_text, field_visible, field_changeable) VALUES(1, 'dashboard', 'dashboard', 0, 0); +INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES('show_tabs', 'dashboard', 'checkbox', 'Platform', 'true', 'ShowTabsTitle','ShowTabsComment',NULL,'TabsDashboard', 1); + -- xxSTATSxx CREATE TABLE track_e_item_property(id int NOT NULL auto_increment PRIMARY KEY, course_id int NOT NULL, item_property_id int NOT NULL, title varchar(255), content text, progress int NOT NULL default 0, lastedit_date datetime NOT NULL default '0000-00-00 00:00:00', lastedit_user_id int NOT NULL, session_id int NOT NULL default 0);