added configuration for allow_send_message_to_all_platform_users and allow_students_to_create_groups_in_social in message and social tool - partial CT#190

skala
Cristian Fasanando 16 years ago
parent 20883126b0
commit 8cc51de8e9
  1. 24
      main/install/dokeos_main.sql
  2. 18
      main/install/migrate-db-1.8.6.1-1.8.6.2-pre.sql
  3. 7
      main/messages/find_users.php
  4. 10
      main/social/groups.php

@ -741,7 +741,10 @@ VALUES
('youtube_for_students',NULL,'radio','Editor','true','YoutubeForStudentsTitle','YoutubeForStudentsComment',NULL,NULL, 0),
('block_copy_paste_for_students',NULL,'radio','Editor','false','BlockCopyPasteForStudentsTitle','BlockCopyPasteForStudentsComment',NULL,NULL, 0),
('more_buttons_maximized_mode',NULL,'radio','Editor','false','MoreButtonsForMaximizedModeTitle','MoreButtonsForMaximizedModeComment',NULL,NULL, 0),
('students_download_folders',NULL,'radio','Tools','true','AllowStudentsDownloadFoldersTitle','AllowStudentsDownloadFoldersComment',NULL,NULL, 0);
('students_download_folders',NULL,'radio','Tools','true','AllowStudentsDownloadFoldersTitle','AllowStudentsDownloadFoldersComment',NULL,NULL, 0),
('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);
UNLOCK TABLES;
/*!40000 ALTER TABLE settings_current ENABLE KEYS */;
@ -943,8 +946,11 @@ VALUES
('more_buttons_maximized_mode','true','Yes'),
('more_buttons_maximized_mode','false','No'),
('students_download_folders','true','Yes'),
('students_download_folders','false','No');
('students_download_folders','false','No'),
('allow_students_to_create_groups_in_social','true','Yes'),
('allow_students_to_create_groups_in_social','false','No'),
('allow_send_message_to_all_platform_users','true','Yes'),
('allow_send_message_to_all_platform_users','false','No');
UNLOCK TABLES;
/*!40000 ALTER TABLE settings_options ENABLE KEYS */;
@ -2331,6 +2337,8 @@ CREATE TABLE group_rel_tag (
group_id int NOT NULL,
PRIMARY KEY (id)
);
ALTER TABLE `group_rel_tag` ADD INDEX ( group_id );
ALTER TABLE `group_rel_tag` ADD INDEX ( tag_id );
CREATE TABLE group_rel_user (
id int NOT NULL AUTO_INCREMENT,
@ -2339,7 +2347,9 @@ CREATE TABLE group_rel_user (
relation_type int NOT NULL,
PRIMARY KEY (id)
);
ALTER TABLE `group_rel_user` ADD INDEX ( group_id );
ALTER TABLE `group_rel_user` ADD INDEX ( user_id );
ALTER TABLE `group_rel_user` ADD INDEX ( relation_type );
--
-- Table structure for table message attachment
--
@ -2352,9 +2362,7 @@ CREATE TABLE IF NOT EXISTS message_attachment (
message_id int NOT NULL,
filename varchar(255) NOT NULL,
PRIMARY KEY (id)
)
);
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 (9, 'rssfeeds','RSS',0,0);
INSERT INTO user_field (field_type, field_variable, field_display_text, field_visible, field_changeable) values (9, 'rssfeeds','RSS',0,0);

@ -69,6 +69,22 @@ UPDATE TABLE settings_current SET selected_value = '1.8.6.2.9070' WHERE variable
INSERT INTO course_field (field_type, field_variable, field_display_text, field_default_value, field_visible, field_changeable) values (10, 'special_course','SpecialCourse', 'Yes', 1 , 1);
ALTER TABLE `group_rel_user` ADD INDEX ( group_id );
ALTER TABLE `group_rel_user` ADD INDEX ( user_id );
ALTER TABLE `group_rel_user` ADD INDEX ( relation_type );
ALTER TABLE `group_rel_tag` ADD INDEX ( group_id );
ALTER TABLE `group_rel_tag` ADD INDEX ( tag_id );
INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('allow_students_to_create_groups_in_social', NULL, 'radio', 'Tools', 'false', 'AllowStudentsToCreateGroupsInSocialTitle', 'AllowStudentsToCreateGroupsInSocialComment', NULL, NULL, 0);
INSERT INTO settings_options (variable, value, display_text) VALUES ('allow_students_to_create_groups_in_social', 'true', 'Yes');
INSERT INTO settings_options (variable, value, display_text) VALUES ('allow_students_to_create_groups_in_social', 'false', 'No');
INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('allow_send_message_to_all_platform_users', NULL, 'radio', 'Tools', 'false', 'AllowSendMessageToAllPlatformUsersTitle', 'AllowSendMessageToAllPlatformUsersComment', NULL, NULL, 0);
INSERT INTO settings_options (variable, value, display_text) VALUES ('allow_send_message_to_all_platform_users', 'true', 'Yes');
INSERT INTO settings_options (variable, value, display_text) VALUES ('allow_send_message_to_all_platform_users', 'false', 'No');
-- xxSTATSxx
ALTER TABLE track_e_exercices ADD COLUMN expired_time_control datetime NOT NULL DEFAULT '0000-00-00 00:00:00';
ALTER TABLE track_e_online ADD INDEX (course);
@ -94,4 +110,4 @@ ALTER TABLE student_publication ADD COLUMN weight float(6,2) UNSIGNED NOT NULL D
ALTER TABLE course_description ADD COLUMN description_type TINYINT NOT NULL DEFAULT 0;
ALTER TABLE dropbox_category ADD COLUMN session_id smallint NOT NULL DEFAULT 0, ADD INDEX (session_id);
ALTER TABLE quiz ADD COLUMN random_answers TINYINT UNSIGNED NOT NULL DEFAULT 0 AFTER random;
ALTER TABLE quiz_answer ADD COLUMN id_auto INT NOT NULL AUTO_INCREMENT, ADD UNIQUE INDEX (id_auto);
ALTER TABLE quiz_answer ADD COLUMN id_auto INT NOT NULL AUTO_INCREMENT, ADD UNIQUE INDEX (id_auto);

@ -21,15 +21,12 @@ $user_id = api_get_user_id();
$is_western_name_order = api_is_western_name_order();
if (api_get_setting('allow_social_tool')=='true' && api_get_setting('allow_message_tool')=='true') {
//if (api_get_setting('allow_social_tool')=='true')) {
//all users
//@todo implement an api_get_setting() funcionality
if (1) {
if (api_get_setting('display_all_platform_users_in_message_tool') == 'true') {
$sql = 'SELECT DISTINCT u.user_id as id, '.($is_western_name_order ? 'concat(u.firstname," ",u.lastname," ","( ",u.email," )")' : 'concat(u.lastname," ",u.firstname," ","( ",u.email," )")').' as name
FROM '.$tbl_user.' u
WHERE u.user_id <>'.(int)$user_id.' AND '.($is_western_name_order ? 'concat(u.firstname, " ", u.lastname)' : 'concat(u.lastname, " ", u.firstname)').' like CONCAT("%","'.$search.'","%") LIMIT 15';
WHERE u.user_id <>'.(int)$user_id.' AND '.($is_western_name_order ? 'concat(u.firstname, " ", u.lastname)' : 'concat(u.lastname, " ", u.firstname)').' like CONCAT("%","'.$search.'","%") LIMIT 15';
} else {
//only my contacts
$sql = 'SELECT DISTINCT u.user_id as id, '.($is_western_name_order ? 'concat(u.firstname," ",u.lastname," ","( ",u.email," )")' : 'concat(u.lastname," ",u.firstname," ","( ",u.email," )")').' as name

@ -188,7 +188,15 @@ if ($group_id != 0 ) {
$groups[]= array($url_open.$result['picture_uri'].$url_close, $url_open.$result['name'].$url_close,cut($result['description'],140));
}
echo '<h1>'.get_lang('MyGroups').'</h1>';
echo '<a href="group_add.php">'.get_lang('CreateAgroup').'</a>';
if (api_get_setting('allow_students_to_create_groups_in_social') == 'true') {
echo '<a href="group_add.php">'.get_lang('CreateAgroup').'</a>';
} else {
if (api_is_allowed_to_edit(null,true)) {
echo '<a href="group_add.php">'.get_lang('CreateAgroup').'</a>';
}
}
if (count($groups) > 0) {
Display::display_sortable_grid('groups', array(), $groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true,false));
}

Loading…
Cancel
Save