소스 검색

Feature #272 - Preparations for change in the installation script: Removing the obsolete files "setting_current_data.csv" and "setting_option_data.csv" and related to them code.

Ivan Tcholakov 15 년 전
부모
커밋
3bf27860ad

+ 0 - 50
main/install/install_upgrade.lib.php

@@ -21,8 +21,6 @@
 */
 define("DOKEOS_MAIN_DATABASE_FILE", "dokeos_main.sql");
 define("COUNTRY_DATA_FILENAME", "country_data.csv");
-define("SETTING_OPTION_DATA_FILENAME", "setting_option_data.csv");
-define("SETTING_CURRENT_DATA_FILENAME", "setting_current_data.csv");
 define("COURSES_HTACCESS_FILENAME", "htaccess.dist");
 define("DOKEOS_CONFIG_FILENAME", "configuration.dist.php");
 
@@ -43,57 +41,9 @@ function set_file_folder_permissions()
 {
 	@chmod('.',0755); //set permissions on install dir
 	@chmod('..',0755); //set permissions on parent dir of install dir
-	@chmod('setting_current_data.csv',0755);
-	@chmod('setting_option_data.csv',0755);
 	@chmod('country_data.csv.csv',0755);
 }
 
-/**
-* Fills the current settings table with the Dokeos default settings.
-* After using the LOAD DATA INFILE instruction, the database stores some
-* variables literally as '$variable'. The instructions after that replace
-* that literal by the actual value of the variable.
-*/
-function fill_current_settings_table($current_settings_table, $installation_settings)
-{
-	$institutionForm = $installation_settings['institution_form'];
-	$institutionUrlForm = $installation_settings['institution_url_form'];
-	$campusForm = $installation_settings['campus_form'];
-	$emailForm = $installation_settings['email_form'];
-	$adminLastName = $installation_settings['admin_last_name'];
-	$adminFirstName = $installation_settings['admin_first_name'];
-	$languageForm = $installation_settings['language_form'];
-	$allowSelfReg = $installation_settings['allow_self_registration'];
-	$allowSelfRegProf = $installation_settings['allow_teacher_self_registration'];
-	$adminPhoneForm = $installation_settings['admin_phone_form'];
-
-	$file_path = dirname(__FILE__).'/'.SETTING_CURRENT_DATA_FILENAME;
-	$add_setting_current_sql = "LOAD DATA INFILE '".mysql_real_escape_string($file_path)."' INTO TABLE $current_settings_table FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\'';";
-	@ mysql_query($add_setting_current_sql);
-
-	//replace literal '$variable' by the contents of variable $variable
-	mysql_query("UPDATE $current_settings_table SET selected_value='$institutionForm' WHERE  selected_value='\$institutionForm'");
-	mysql_query("UPDATE $current_settings_table SET selected_value='$institutionUrlForm' WHERE  selected_value='\$institutionUrlForm'");
-	mysql_query("UPDATE $current_settings_table SET selected_value='$campusForm' WHERE  selected_value='\$campusForm'");
-	mysql_query("UPDATE $current_settings_table SET selected_value='$emailForm' WHERE  selected_value='\$emailForm'");
-	mysql_query("UPDATE $current_settings_table SET selected_value='$adminLastName' WHERE  selected_value='\$adminLastName'");
-	mysql_query("UPDATE $current_settings_table SET selected_value='$adminFirstName' WHERE  selected_value='\$adminFirstName'");
-	mysql_query("UPDATE $current_settings_table SET selected_value='$languageForm' WHERE  selected_value='\$languageForm'");
-	mysql_query("UPDATE $current_settings_table SET selected_value='".trueFalse($allowSelfReg)."' WHERE  selected_value='\$allowSelfReg'");
-	mysql_query("UPDATE $current_settings_table SET selected_value='".trueFalse($allowSelfRegProf)."' WHERE  selected_value='\$allowSelfRegProf'");
-	mysql_query("UPDATE $current_settings_table SET selected_value='$adminPhoneForm' WHERE  selected_value='\$adminPhoneForm'");
-}
-
-/**
-* Fills the table with the possible options for all settings.
-*/
-function fill_settings_options_table($settings_options_table)
-{
-	$file_path = dirname(__FILE__).'/'.SETTING_OPTION_DATA_FILENAME;
-	$add_setting_option_sql = "LOAD DATA INFILE '".mysql_real_escape_string($file_path)."' INTO TABLE $settings_options_table FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\'';";
-	@ mysql_query($add_setting_option_sql);
-}
-
 /**
 * Fills the countries table with a list of countries.
 */

+ 0 - 81
main/install/setting_current_data.csv

@@ -1,81 +0,0 @@
-1,'Institution',NULL,'textfield','Platform','$institutionForm','InstitutionTitle','InstitutionComment','platform',NULL,
-2,'InstitutionUrl',NULL,'textfield','Platform','$institutionUrlForm','InstitutionUrlTitle','InstitutionUrlComment',NULL,NULL,
-3,'siteName',NULL,'textfield','Platform','$campusForm','SiteNameTitle','SiteNameComment',NULL,NULL,
-4,'emailAdministrator',NULL,'textfield','Platform','$emailForm','emailAdministratorTitle','emailAdministratorComment',NULL,NULL,
-5,'administratorSurname',NULL,'textfield','Platform','$adminLastName','administratorSurnameTitle','administratorSurnameComment',NULL,NULL,
-6,'administratorName',NULL,'textfield','Platform','$adminFirstName','administratorNameTitle','administratorNameComment',NULL,NULL,
-7,'show_administrator_data',NULL,'radio','Platform','true','ShowAdministratorDataTitle','ShowAdministratorDataComment',NULL,NULL,
-8,'homepage_view',NULL,'radio','Course','default','HomepageViewTitle','HomepageViewComment',NULL,NULL,
-9,'show_toolshortcuts',NULL,'radio','Course','false','ShowToolShortcutsTitle','ShowToolShortcutsComment',NULL,NULL,
-10,'show_student_view',NULL,'radio','Course','true','ShowStudentViewTitle','ShowStudentViewComment',NULL,NULL,
-11,'allow_group_categories',NULL,'radio','Course','false','AllowGroupCategories','AllowGroupCategoriesComment',NULL,NULL,
-12,'server_type',NULL,'radio','Platform','production','ServerStatusTitle','ServerStatusComment',NULL,NULL,
-13,'platformLanguage',NULL,'link','Languages','$languageForm','PlatformLanguageTitle','PlatformLanguageComment',NULL,NULL,
-14,'showonline','world','checkbox','Platform','true','ShowOnlineTitle','ShowOnlineComment',NULL,'ShowOnlineWorld',
-15,'showonline','users','checkbox','Platform','true','ShowOnlineTitle','ShowOnlineComment',NULL,'ShowOnlineUsers',
-16,'showonline','course','checkbox','Platform','true','ShowOnlineTitle','ShowOnlineComment',NULL,'ShowOnlineCourse',
-17,'profile','name','checkbox','User','false','ProfileChangesTitle','ProfileChangesComment',NULL,'name',
-18,'profile','officialcode','checkbox','User','false','ProfileChangesTitle','ProfileChangesComment',NULL,'officialcode',
-19,'profile','email','checkbox','User','false','ProfileChangesTitle','ProfileChangesComment',NULL,'Email',
-20,'profile','picture','checkbox','User','false','ProfileChangesTitle','ProfileChangesComment',NULL,'UserPicture',
-21,'profile','login','checkbox','User','false','ProfileChangesTitle','ProfileChangesComment',NULL,'Login',
-22,'profile','password','checkbox','User','false','ProfileChangesTitle','ProfileChangesComment',NULL,'UserPassword',
-23,'profile','language','checkbox','User','true','ProfileChangesTitle','ProfileChangesComment',NULL,'Language',
-24,'default_document_quotum',NULL,'textfield','Course','50000000','DefaultDocumentQuotumTitle','DefaultDocumentQuotumComment',NULL,NULL,
-25,'registration','officialcode','checkbox','User','true','RegistrationRequiredFormsTitle','RegistrationRequiredFormsComment',NULL,'OfficialCode',
-26,'registration','email','checkbox','User','true','RegistrationRequiredFormsTitle','RegistrationRequiredFormsComment',NULL,'Email',
-27,'registration','language','checkbox','User','true','RegistrationRequiredFormsTitle','RegistrationRequiredFormsComment',NULL,'Language',
-28,'default_group_quotum',NULL,'textfield','Course','5000000','DefaultGroupQuotumTitle','DefaultGroupQuotumComment',NULL,NULL,
-29,'allow_registration',NULL,'radio','Platform','$allowSelfReg','AllowRegistrationTitle','AllowRegistrationComment',NULL,NULL,
-30,'allow_registration_as_teacher',NULL,'radio','Platform','$allowSelfRegProf','AllowRegistrationAsTeacherTitle','AllowRegistrationAsTeacherComment',NULL,NULL,
-31,'allow_lostpassword',NULL,'radio','Platform','true','AllowLostPasswordTitle','AllowLostPasswordComment',NULL,NULL,
-32,'allow_user_headings',NULL,'radio','Course','false','AllowUserHeadings','AllowUserHeadingsComment',NULL,NULL,
-33,'course_create_active_tools','course_description','checkbox','Tools','true','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'CourseDescription',
-34,'course_create_active_tools','agenda','checkbox','Tools','true','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'Agenda',
-35,'course_create_active_tools','documents','checkbox','Tools','true','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'Documents',
-36,'course_create_active_tools','learning_path','checkbox','Tools','true','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'LearningPath',
-37,'course_create_active_tools','links','checkbox','Tools','true','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'Links',
-38,'course_create_active_tools','announcements','checkbox','Tools','false','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'Announcements',
-39,'course_create_active_tools','forums','checkbox','Tools','false','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'Forums',
-40,'course_create_active_tools','dropbox','checkbox','Tools','false','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'Dropbox',
-41,'course_create_active_tools','quiz','checkbox','Tools','false','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'Quiz',
-42,'course_create_active_tools','users','checkbox','Tools','false','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'Users',
-43,'course_create_active_tools','groups','checkbox','Tools','false','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'Groups',
-44,'course_create_active_tools','chat','checkbox','Tools','false','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'Chat',
-45,'course_create_active_tools','online_conference','checkbox','Tools','false','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'OnlineConference',
-46,'course_create_active_tools','student_publications','checkbox','Tools','false','CourseCreateActiveToolsTitle','CourseCreateActiveToolsComment',NULL,'StudentPublications',
-47,'allow_personal_agenda',NULL,'radio','User','false','AllowPersonalAgendaTitle','AllowPersonalAgendaComment',NULL,NULL,
-48,'display_coursecode_in_courselist',NULL,'radio','Platform','true','DisplayCourseCodeInCourselistTitle','DisplayCourseCodeInCourselistComment',NULL,NULL,
-49,'display_teacher_in_courselist',NULL,'radio','Platform','true','DisplayTeacherInCourselistTitle','DisplayTeacherInCourselistComment',NULL,NULL,
-50,'use_document_title',NULL,'radio','Tools','false','UseDocumentTitleTitle','UseDocumentTitleComment',NULL,NULL,
-51,'permanently_remove_deleted_files',NULL ,'radio','Tools','false','PermanentlyRemoveFilesTitle','PermanentlyRemoveFilesComment',NULL,NULL,
-52,'dropbox_allow_overwrite',NULL,'radio','Tools','true','DropboxAllowOverwriteTitle','DropboxAllowOverwriteComment',NULL,NULL,
-53,'dropbox_max_filesize',NULL,'textfield','Tools','100000000','DropboxMaxFilesizeTitle','DropboxMaxFilesizeComment',NULL,NULL,
-54,'dropbox_allow_just_upload',NULL,'radio','Tools','true','DropboxAllowJustUploadTitle','DropboxAllowJustUploadComment',NULL,NULL,
-55,'dropbox_allow_student_to_student',NULL,'radio','Tools','true','DropboxAllowStudentToStudentTitle','DropboxAllowStudentToStudentComment',NULL,NULL,
-56,'dropbox_allow_group',NULL,'radio','Tools','true','DropboxAllowGroupTitle','DropboxAllowGroupComment',NULL,NULL,
-57,'dropbox_allow_mailing',NULL,'radio','Tools','false','DropboxAllowMailingTitle','DropboxAllowMailingComment',NULL,NULL,
-58,'administratorTelephone',NULL,'textfield','Platform','$adminPhoneForm','administratorTelephoneTitle','administratorTelephoneComment',NULL,NULL,
-59,'extended_profile',NULL,'radio','User','false','ExtendedProfileTitle','ExtendedProfileComment',NULL,NULL,
-61,'show_navigation_menu',NULL,'radio','Course','true','ShowNavigationMenuTitle','ShowNavigationMenuComment',NULL,NULL,
-62,'enable_tool_introduction',NULL,'radio','course','false','EnableToolIntroductionTitle','EnableToolIntroductionComment',NULL,NULL,
-63,'page_after_login', NULL, 'radio','platform','user_portal.php', 'PageAfterLoginTitle','PageAfterLoginComment', NULL, NULL,
-64,'time_limit_whosonline', NULL, 'textfield','Platform','30', 'TimeLimitWhosonlineTitle','TimeLimitWhosonlineComment', NULL, NULL,
-65,'breadcrumbs_course_homepage', NULL, 'radio','Course','course_title','BreadCrumbsCourseHomepageTitle','BreadCrumbsCourseHomepageComment', NULL, NULL,
-66,'example_material_course_creation', NULL, 'radio','Platform','true', 'ExampleMaterialCourseCreationTitle','ExampleMaterialCourseCreationComment', NULL, NULL,
-67,'account_valid_duration',NULL, 'textfield','Platform','3660', 'AccountValidDurationTitle','AccountValidDurationComment', NULL, NULL,
-68, 'use_session_mode', NULL, 'radio','Platform','false', 'UseSessionModeTitle','UseSessionModeComment', NULL, NULL,
-69, 'allow_email_editor', NULL, 'radio', 'Tools', 'false', 'AllowEmailEditorTitle', 'AllowEmailEditorComment', NULL, NULL,
-70, 'registered', NULL, 'textfield', NULL, 'false', NULL, NULL, NULL, NULL,
-71, 'donotlistcampus', NULL, 'textfield', NULL, 'false', NULL, NULL, NULL, NULL,
-72, 'show_email_addresses', NULL,'radio','Platform','false','ShowEmailAddresses','ShowEmailAddressesComment',NULL,NULL,
-73,'profile','phone','checkbox','User','true','ProfileChangesTitle','ProfileChangesComment',NULL,'phone',
-74, 'Ajax_course_tracking_refresh', NULL, 'textfield','Course','0', 'Ajax_course_tracking_refresh','Ajax_course_tracking_refresh_comment', NULL, NULL,
-75, 'service_visio', 'active', 'radio',NULL,'false', 'visio_actived','', NULL, NULL,
-76, 'service_visio', 'url', 'textfield',NULL,'', 'visio_url','', NULL, NULL,
-77, 'service_ppt2lp', 'active', 'radio',NULL,'false', 'ppt2lp_actived','', NULL, NULL,
-78, 'service_ppt2lp', 'host', 'textfield', NULL, NULL, 'Host', NULL, NULL, NULL,
-79, 'service_ppt2lp', 'user', 'textfield', NULL, NULL, 'UserOnHost', NULL, NULL, NULL,
-80, 'service_ppt2lp', 'ftp_password', 'textfield', NULL, NULL, 'FtpPassword', NULL, NULL, NULL,
-81, 'service_ppt2lp', 'path_to_lzx', 'textfield', NULL, NULL, '', NULL, NULL, NULL,
-82, 'wcag_anysurfer_public_pages', NULL, 'radio','Platform','false','PublicPagesComplyToWAITitle','PublicPagesComplyToWAIComment', NULL, NULL,

+ 0 - 69
main/install/setting_option_data.csv

@@ -1,69 +0,0 @@
-10,'show_administrator_data','true','Yes',
-11,'show_administrator_data','false','No',
-12,'homepage_view','activity','HomepageViewActivity',
-13,'homepage_view','2column','HomepageView3column',
-14,'homepage_view','3column','HomepageView3column',
-15,'show_toolshortcuts','true','Yes',
-16,'show_toolshortcuts','false','No',
-17,'show_student_view','true','Yes',
-18,'show_student_view','false','No',
-19,'allow_group_categories','true','Yes',
-20,'allow_group_categories','false','No',
-22,'server_type','production','ProductionServer',
-23,'server_type','test','TestServer',
-26,'allow_name_change','true','Yes',
-27,'allow_name_change','false','No',
-28,'allow_officialcode_change','true','Yes',
-29,'allow_officialcode_change','false','No',
-30,'allow_registration','true','Yes',
-31,'allow_registration','false','No',
-32,'allow_registration','approval','AfterApproval',
-33,'allow_registration_as_teacher','true','Yes',
-34,'allow_registration_as_teacher','false','No',
-35,'allow_lostpassword','true','Yes',
-36,'allow_lostpassword','false','No',
-37,'allow_user_headings','true','Yes',
-38,'allow_user_headings','false','No',
-39,'allow_personal_agenda','true','Yes',
-40,'allow_personal_agenda','false','No',
-41,'display_coursecode_in_courselist','true','Yes',
-42,'display_coursecode_in_courselist','false','No',
-43,'display_teacher_in_courselist','true','Yes',
-44,'display_teacher_in_courselist','false','No',
-45,'use_document_title','true','Yes',
-46,'use_document_title','false','No',
-47,'permanently_remove_deleted_files','true','Yes',
-48,'permanently_remove_deleted_files','false','No',
-49,'dropbox_allow_overwrite','true','Yes',
-50,'dropbox_allow_overwrite','false','No',
-51,'dropbox_allow_just_upload','true','Yes',
-52,'dropbox_allow_just_upload','false','No',
-53,'dropbox_allow_student_to_student','true','Yes',
-54,'dropbox_allow_student_to_student','false','No',
-55,'dropbox_allow_group','true','Yes',
-56,'dropbox_allow_group','false','No',
-57,'dropbox_allow_mailing','true','Yes',
-58,'dropbox_allow_mailing','false','No',
-59,'extended_profile','true','Yes',
-60,'extended_profile','false','No',
-63,'show_navigation_menu','false','No',
-64,'show_navigation_menu','icons','IconsOnly',
-65,'show_navigation_menu','text','TextOnly',
-66,'show_navigation_menu','iconstext','IconsText',
-67,'enable_tool_introduction','true','Yes',
-68,'enable_tool_introduction','false','No',
-69,'page_after_login', 'index.php', 'CampusHomepage',
-70,'page_after_login', 'user_portal.php', 'MyCourses',
-71,'breadcrumbs_course_homepage', 'get_lang', 'CourseHomepage',
-72,'breadcrumbs_course_homepage', 'course_code', 'CourseCode',
-73,'breadcrumbs_course_homepage', 'course_title', 'CourseTitle',
-74,'example_material_course_creation','true','Yes',
-75,'example_material_course_creation','false','No',
-76,'use_session_mode', 'true', 'Yes',
-77,'use_session_mode', 'false', 'No',
-78,'allow_email_editor', 'true' ,'Yes',
-79,'allow_email_editor', 'false', 'No',
-80,'show_email_addresses','true','Yes',
-81,'show_email_addresses','false','No',
-82,'wcag_anysurfer_public_pages', 'true', 'Yes',
-83,'wcag_anysurfer_public_pages', 'false', 'No',

+ 0 - 10
main/install/update_db.inc.php

@@ -193,8 +193,6 @@ if (defined('DOKEOS_INSTALL') || defined('DOKEOS_COURSE_UPDATE'))
 		die();
 		//TODO only update this table
 		/*
-		$language_table = "`$dbNameForm`.`language`";
-
 		//set the settings from the form or the old config into config settings.
 		//These settings are considered "safe" because they are entered by the admin
 		$installation_settings['institution_form'] = $institutionForm;
@@ -208,14 +206,6 @@ if (defined('DOKEOS_INSTALL') || defined('DOKEOS_COURSE_UPDATE'))
 		$installation_settings['allow_teacher_self_registration'] = $allowSelfRegProf;
 		$installation_settings['admin_phone_form'] = $adminPhoneForm;
 
-		//put the settings into the settings table (taken from CSV file)
-		$current_settings_table = "`$dbNameForm`.`settings_current`";
-		fill_current_settings_table($current_settings_table, $installation_settings);
-
-		//put the options into the options table (taken from CSV file)
-		$settings_options_table = "`$dbNameForm`.`settings_options`";
-		fill_settings_options_table($settings_options_table);
-
 		//mysql_query("INSERT INTO `$dbNameForm`.`course_module` (`name`,`link`,`image`,`row`,`column`,`position`) VALUES
 		//								('AddedLearnpath', NULL, 'scormbuilder.gif', 0, 0, 'external'),
 		//								('".TOOL_BACKUP."', 'coursecopy/backup.php' , 'backup.gif', 2, 1, 'courseadmin'),

+ 0 - 7
tests/main/install/install_upgrade.lib.test.php

@@ -15,13 +15,6 @@ class TestInstallUpgrade extends UnitTestCase{
 		//var_dump($res);
 	}
 
-	public function testFillSettingsTable() {
-		$settings_options_table='';
-		$res = fill_settings_options_table($settings_options_table);
-		$this->assertTrue(is_null($res));
-		//var_dump($res);
-	}
-
 	public function testFillTrackCountriesTable() {
 		$track_countries_table='';
 		$res = fill_track_countries_table($track_countries_table);