skala
cfasanando 16 years ago
commit 26f5c2c4b5
  1. 36
      main/admin/legal_add.php
  2. 2
      main/install/db_main.sql
  3. 10
      main/install/db_stats.sql
  4. 4
      main/install/migrate-db-1.6.x-1.8.0-pre.sql
  5. 2
      main/install/migrate-db-1.8.3-1.8.4-pre.sql
  6. 2
      main/install/migrate-db-1.8.4-1.8.5-pre.sql
  7. 2
      main/install/migrate-db-1.8.6.1-1.8.6.2-pre.sql
  8. 47
      tests/test_suite.php

@ -1,19 +1,20 @@
<?php // $Id: user_list.php 22041 2009-07-13 18:29:45Z juliomontoya $ <?php
/* For licensing terms, see /dokeos_license.txt */ /* For licensing terms, see /license.txt */
$language_file = array('admin','registration'); $language_file = array('admin','registration');
$cidReset = true; $cidReset = true;
require '../inc/global.inc.php'; require_once '../inc/global.inc.php';
$this_section = SECTION_PLATFORM_ADMIN; $this_section = SECTION_PLATFORM_ADMIN;
api_protect_admin_script(); api_protect_admin_script();
require_once api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php'; require_once api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php';
require_once api_get_path(LIBRARY_PATH).'security.lib.php'; require_once api_get_path(LIBRARY_PATH).'security.lib.php';
require_once api_get_path(LIBRARY_PATH).'legal.lib.php'; require_once api_get_path(LIBRARY_PATH).'legal.lib.php';
//var_dump($_POST);
// Create the form // Create the form
$form = new FormValidator('addlegal'); $form = new FormValidator('addlegal');
//var_dump($_POST);// var_dump($_GET);
$defaults=array(); $defaults=array();
if( $form->validate()) { if( $form->validate()) {
$check = Security::check_token('post'); $check = Security::check_token('post');
@ -36,9 +37,8 @@ if( $form->validate()) {
} elseif (isset($values['back'])) { } elseif (isset($values['back'])) {
$submit ='back'; $submit ='back';
} }
}else { } else {
$submit = $values['send']; $submit = $values['send'];
} }
$default[content]=$content; $default[content]=$content;
@ -97,7 +97,7 @@ if( $form->validate()) {
}*/ }*/
} }
$form->setDefaults($default); $form->setDefaults($default);
//var_dump($term_preview);
if(isset($_POST['send'])) { if(isset($_POST['send'])) {
Security::clear_token(); Security::clear_token();
} }
@ -120,8 +120,8 @@ $form->addElement('html',$text);
if (isset($_POST['language'])) { if (isset($_POST['language'])) {
//$form->addElement('html_editor', 'content', null, null, array('ToolbarSet' => 'Basic', 'Width' => '100%', 'Height' => '250')); //$form->addElement('html_editor', 'content', null, null, array('ToolbarSet' => 'Basic', 'Width' => '100%', 'Height' => '250'));
$form->addElement('static', $_POST['language']); $form->addElement('static', Security::remove_XSS($_POST['language']));
$form->addElement('hidden', 'language',$_POST['language']); $form->addElement('hidden', 'language',Security::remove_XSS($_POST['language']));
$form->add_html_editor('content', get_lang('Content'), true, false, array('ToolbarSet' => 'terms_and_conditions', 'Width' => '100%', 'Height' => '250')); $form->add_html_editor('content', get_lang('Content'), true, false, array('ToolbarSet' => 'terms_and_conditions', 'Width' => '100%', 'Height' => '250'));
//$form->addElement('textarea', 'content', get_lang('Content'),array('cols'=>'120','rows'=>'10')); //$form->addElement('textarea', 'content', get_lang('Content'),array('cols'=>'120','rows'=>'10'));
$form->addElement('radio', 'type', '', get_lang('HTMLText') ,'0'); $form->addElement('radio', 'type', '', get_lang('HTMLText') ,'0');
@ -143,7 +143,6 @@ if (isset($_POST['language'])) {
$navigator_info = api_get_navigator(); $navigator_info = api_get_navigator();
//ie6 fix //ie6 fix
if ($navigator_info['name']=='Internet Explorer' && $navigator_info['version']=='6') { if ($navigator_info['name']=='Internet Explorer' && $navigator_info['version']=='6') {
$buttons = '<div class="row" align="center"> $buttons = '<div class="row" align="center">
<div class="formw"> <div class="formw">
<input type="submit" name="back" value="'.get_lang('Back').'"/> <input type="submit" name="back" value="'.get_lang('Back').'"/>
@ -162,15 +161,6 @@ if (isset($_POST['language'])) {
</div>'; </div>';
$form->addElement('html',$buttons); $form->addElement('html',$buttons);
} }
/* $buttons = '<div class="row">
<div class="formw">
<button type="submit" class="back" name="send" value="back">'.get_lang('Back').'</button>
<button type="submit" class="search" name="send" value="preview">'.get_lang('Preview').'</button>
<button type="submit" class="save" name="send" value="save">'.get_lang('Save').'</button>
</div>
</div>'; */
} else { } else {
$form->addElement('select_language', 'language', get_lang('Language'),null,array()); $form->addElement('select_language', 'language', get_lang('Language'),null,array());
$buttons = '<div class="row"> $buttons = '<div class="row">
@ -181,8 +171,6 @@ if (isset($_POST['language'])) {
$form->addElement('html',$buttons); $form->addElement('html',$buttons);
} }
//var_dump($defaults);
$tool_name = get_lang('AddTermsAndConditions'); $tool_name = get_lang('AddTermsAndConditions');
$interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAdmin')); $interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAdmin'));
@ -191,7 +179,6 @@ Display :: display_header($tool_name);
echo '<script> echo '<script>
function sendlang(){ function sendlang(){
//document.addlegal.send.value=\'load\'; //document.addlegal.send.value=\'load\';
// alert(document.addlegal.send.value);
document.addlegal.sec_token.value=\''.$token.'\'; document.addlegal.sec_token.value=\''.$token.'\';
document.addlegal.submit(); document.addlegal.submit();
} }
@ -212,9 +199,6 @@ if (isset ($_GET['action'])) {
} }
} }
//var_dump($defaults);
$form->setDefaults($defaults); $form->setDefaults($defaults);
$form->display(); $form->display();
?> ?>

@ -2302,7 +2302,7 @@ CREATE TABLE search_engine_ref (
-- --
CREATE TABLE session_category ( CREATE TABLE session_category (
id int(11) NOT NULL auto_increment, id int NOT NULL auto_increment,
name varchar(100) default NULL, name varchar(100) default NULL,
date_start date default NULL, date_start date default NULL,
date_end date default NULL, date_end date default NULL,

@ -219,12 +219,12 @@ CREATE TABLE track_e_course_access (
); );
CREATE TABLE track_e_hotspot ( CREATE TABLE track_e_hotspot (
hotspot_id int(11) NOT NULL auto_increment, hotspot_id int NOT NULL auto_increment,
hotspot_user_id int(11) NOT NULL, hotspot_user_id int NOT NULL,
hotspot_course_code varchar(50) NOT NULL, hotspot_course_code varchar(50) NOT NULL,
hotspot_exe_id int(11) NOT NULL, hotspot_exe_id int NOT NULL,
hotspot_question_id int(11) NOT NULL, hotspot_question_id int NOT NULL,
hotspot_answer_id int(11) NOT NULL, hotspot_answer_id int NOT NULL,
hotspot_correct tinyint(3) unsigned NOT NULL, hotspot_correct tinyint(3) unsigned NOT NULL,
hotspot_coordinate text NOT NULL, hotspot_coordinate text NOT NULL,
PRIMARY KEY (hotspot_id), PRIMARY KEY (hotspot_id),

@ -261,9 +261,9 @@ CREATE TABLE group_rel_tutor(id int NOT NULL auto_increment, user_id int NOT NUL
-- tool_intro table -- tool_intro table
-- dropbox_file table -- dropbox_file table
ALTER TABLE dropbox_file ADD cat_id INT(11) NOT NULL ; ALTER TABLE dropbox_file ADD cat_id INT NOT NULL ;
-- dropbox_post table -- dropbox_post table
ALTER TABLE dropbox_post ADD cat_id INT(11) NOT NULL ; ALTER TABLE dropbox_post ADD cat_id INT NOT NULL ;
-- dropbox_person table -- dropbox_person table
CREATE TABLE dropbox_category(cat_id int NOT NULL auto_increment, cat_name text NOT NULL, received tinyint unsigned NOT NULL default 0, sent tinyint unsigned NOT NULL default 0, user_id int NOT NULL default 0, PRIMARY KEY (cat_id)); CREATE TABLE dropbox_category(cat_id int NOT NULL auto_increment, cat_name text NOT NULL, received tinyint unsigned NOT NULL default 0, sent tinyint unsigned NOT NULL default 0, user_id int NOT NULL default 0, PRIMARY KEY (cat_id));
CREATE TABLE dropbox_feedback(feedback_id int NOT NULL auto_increment, file_id int NOT NULL default 0, author_user_id int NOT NULL default 0, feedback text NOT NULL, feedback_date datetime NOT NULL default '0000-00-00 00:00:00', PRIMARY KEY (feedback_id), KEY file_id (file_id), KEY author_user_id (author_user_id)); CREATE TABLE dropbox_feedback(feedback_id int NOT NULL auto_increment, file_id int NOT NULL default 0, author_user_id int NOT NULL default 0, feedback text NOT NULL, feedback_date datetime NOT NULL default '0000-00-00 00:00:00', PRIMARY KEY (feedback_id), KEY file_id (file_id), KEY author_user_id (author_user_id));

@ -26,7 +26,7 @@ INSERT INTO settings_options(variable,value,display_text) VALUES ('default_forum
INSERT INTO settings_options(variable,value,display_text) VALUES ('default_forum_view', 'nested', 'Nested'); INSERT INTO settings_options(variable,value,display_text) VALUES ('default_forum_view', 'nested', 'Nested');
-- xxSTATSxx -- xxSTATSxx
CREATE TABLE track_e_hotspot (hotspot_id int NOT NULL auto_increment, hotspot_user_id int NOT NULL, hotspot_course_code varchar(50) NOT NULL, hotspot_exe_id int NOT NULL, hotspot_question_id int(11) NOT NULL, hotspot_answer_id int NOT NULL, hotspot_correct tinyint unsigned NOT NULL, hotspot_coordinate varchar(50) NOT NULL, PRIMARY KEY (hotspot_id), KEY hotspot_course_code (hotspot_course_code), KEY hotspot_user_id (hotspot_user_id), KEY hotspot_exe_id (hotspot_exe_id), KEY hotspot_question_id (hotspot_question_id)); CREATE TABLE track_e_hotspot (hotspot_id int NOT NULL auto_increment, hotspot_user_id int NOT NULL, hotspot_course_code varchar(50) NOT NULL, hotspot_exe_id int NOT NULL, hotspot_question_id int NOT NULL, hotspot_answer_id int NOT NULL, hotspot_correct tinyint unsigned NOT NULL, hotspot_coordinate varchar(50) NOT NULL, PRIMARY KEY (hotspot_id), KEY hotspot_course_code (hotspot_course_code), KEY hotspot_user_id (hotspot_user_id), KEY hotspot_exe_id (hotspot_exe_id), KEY hotspot_question_id (hotspot_question_id));
-- xxUSERxx -- xxUSERxx

@ -149,7 +149,7 @@ CREATE TABLE blog_attachment ( id int unsigned NOT NULL auto_increment, path var
CREATE TABLE forum_attachment (id int NOT NULL auto_increment, path varchar(255) NOT NULL, comment text, size int NOT NULL default 0, post_id int NOT NULL, filename varchar(255) NOT NULL, PRIMARY KEY (id)); CREATE TABLE forum_attachment (id int NOT NULL auto_increment, path varchar(255) NOT NULL, comment text, size int NOT NULL default 0, post_id int NOT NULL, filename varchar(255) NOT NULL, PRIMARY KEY (id));
ALTER TABLE group_category ADD forum_state TINYINT DEFAULT 0 AFTER announcements_state; ALTER TABLE group_category ADD forum_state TINYINT DEFAULT 0 AFTER announcements_state;
UPDATE tool SET category='interaction', admin='0', visibility='0' WHERE name='survey'; UPDATE tool SET category='interaction', admin='0', visibility='0' WHERE name='survey';
CREATE TABLE forum_notification (user_id int(11) , forum_id varchar(11), thread_id varchar(11), post_id varchar(11), KEY user_id (user_id), KEY forum_id (forum_id)); CREATE TABLE forum_notification (user_id int, forum_id varchar(11), thread_id varchar(11), post_id varchar(11), KEY user_id (user_id), KEY forum_id (forum_id));
ALTER TABLE quiz ADD access_condition text DEFAULT NULL; ALTER TABLE quiz ADD access_condition text DEFAULT NULL;
ALTER TABLE survey ADD access_condition text DEFAULT NULL; ALTER TABLE survey ADD access_condition text DEFAULT NULL;
UPDATE tool SET category='authoring' WHERE name = 'announcement'; UPDATE tool SET category='authoring' WHERE name = 'announcement';

@ -18,7 +18,7 @@ ALTER TABLE session ADD COLUMN session_category_id INT NOT NULL;
ALTER TABLE session_rel_course_rel_user ADD COLUMN visibility int NOT NULL default 1; ALTER TABLE session_rel_course_rel_user ADD COLUMN visibility int NOT NULL default 1;
ALTER TABLE session_rel_course_rel_user ADD COLUMN status int NOT NULL default 0; ALTER TABLE session_rel_course_rel_user ADD COLUMN status int NOT NULL default 0;
CREATE TABLE session_category (id int(11) NOT NULL auto_increment, name varchar(100) default NULL, date_start date default NULL, date_end date default NULL, PRIMARY KEY (id)); CREATE TABLE session_category (id int NOT NULL auto_increment, name varchar(100) default NULL, date_start date default NULL, date_end date default NULL, PRIMARY KEY (id));
INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('allow_coach_to_edit_course_session', NULL, 'radio', 'Course', 'false', 'AllowCoachsToEditInsideTrainingSessions', 'AllowCoachsToEditInsideTrainingSessionsComment', NULL, NULL, 0); INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('allow_coach_to_edit_course_session', NULL, 'radio', 'Course', 'false', 'AllowCoachsToEditInsideTrainingSessions', 'AllowCoachsToEditInsideTrainingSessionsComment', NULL, NULL, 0);
INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url, access_url_changeable) VALUES ('show_courses_descriptions_in_catalog', NULL, 'radio', 'Course', 'true', 'ShowCoursesDescriptionsInCatalogTitle', 'ShowCoursesDescriptionsInCatalogComment', NULL, NULL, 1, 1); INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url, access_url_changeable) VALUES ('show_courses_descriptions_in_catalog', NULL, 'radio', 'Course', 'true', 'ShowCoursesDescriptionsInCatalogTitle', 'ShowCoursesDescriptionsInCatalogComment', NULL, NULL, 1, 1);

@ -1,19 +1,15 @@
<?php <?php
// $Id: test_suite.php 2010-02-17 12:07:00Z aportugal $ /* For licensing terms, see /license.txt */
/* For licensing terms, see /chamilo_license.txt */
/** /**
==============================================================================
* This is the index file load when a user is testing functions in Chamilo. * This is the index file load when a user is testing functions in Chamilo.
* *
* It load: * Libraries loaded:
* - global.inc * - global.inc
* - files of simpletest * - files of simpletest
* - files with functions tests * - files with functions tests
* *
* @todo rewrite code to separate display, logic, database code * @todo rewrite code to separate display, logic, database code
* @package chamilo.main * @package chamilo.main
==============================================================================
*/ */
/** /**
@ -24,11 +20,35 @@
* @author aportugal * @author aportugal
*/ */
/* /**
----------------------------------------------------------- * Helpful info for newcomers
Included libraries *
----------------------------------------------------------- * @todo maybe not the right place?
*
* http://simpletest.sourceforge.net/en/unit_test_documentation.html
*
assertTrue($x) Fail if $x is false
assertFalse($x) Fail if $x is true
assertNull($x) Fail if $x is set
assertNotNull($x) Fail if $x not set
assertIsA($x, $t) Fail if $x is not the class or type $t
assertNotA($x, $t) Fail if $x is of the class or type $t
assertEqual($x, $y) Fail if $x == $y is false
assertNotEqual($x, $y) Fail if $x == $y is true
assertWithinMargin($x, $y, $m) Fail if abs($x - $y) < $m is false
assertOutsideMargin($x, $y, $m) Fail if abs($x - $y) < $m is true
assertIdentical($x, $y) Fail if $x == $y is false or a type mismatch
assertNotIdentical($x, $y) Fail if $x == $y is true and types match
assertReference($x, $y) Fail unless $x and $y are the same variable
assertClone($x, $y) Fail unless $x and $y are identical copies
assertPattern($p, $x) Fail unless the regex $p matches $x
assertNoPattern($p, $x) Fail if the regex $p matches $x
expectError($x) Swallows any upcoming matching error
assert($e) Fail on failed expectation object $e
*/ */
/* Included libraries */
//The global.inc.php be need be load here to can load the settings files //The global.inc.php be need be load here to can load the settings files
$incdir = dirname(__FILE__).'/../main/inc/'; $incdir = dirname(__FILE__).'/../main/inc/';
require_once $incdir.'global.inc.php'; require_once $incdir.'global.inc.php';
@ -42,11 +62,8 @@ require_once 'simpletest/web_tester.php';
require_once 'simpletest/mock_objects.php'; require_once 'simpletest/mock_objects.php';
require_once 'simpletest/autorun.php'; require_once 'simpletest/autorun.php';
/* /* TEST SUITE
============================================================================== * Start to load the tests files
TEST SUITE
==============================================================================
Start to load the tests files
*/ */
class TestsSuite extends TestSuite { class TestsSuite extends TestSuite {

Loading…
Cancel
Save