From 482192d46cf78ea67a9c24ccdc946fb6c132f884 Mon Sep 17 00:00:00 2001 From: Noel Dieschburg Date: Tue, 28 Jun 2011 16:17:04 +0200 Subject: [PATCH 01/11] Conditional login : example for first login --- main/auth/conditional_login/first_login.php | 37 +++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 main/auth/conditional_login/first_login.php diff --git a/main/auth/conditional_login/first_login.php b/main/auth/conditional_login/first_login.php new file mode 100644 index 0000000000..f4ab71fd75 --- /dev/null +++ b/main/auth/conditional_login/first_login.php @@ -0,0 +1,37 @@ + + + + + + + +

First login

+

This is your first login please complete those fields :

+
+ Téléphone : + +
+ + + From 184a7f26c3871c9352da780db6edeadfe152e9a7 Mon Sep 17 00:00:00 2001 From: Noel Dieschburg Date: Thu, 30 Jun 2011 17:05:58 +0200 Subject: [PATCH 02/11] Scorm time : avoid chamilo to update the scorm time with incoherent value at initalisation --- main/newscorm/learnpathItem.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main/newscorm/learnpathItem.class.php b/main/newscorm/learnpathItem.class.php index 2d78ef683a..33bf54674b 100644 --- a/main/newscorm/learnpathItem.class.php +++ b/main/newscorm/learnpathItem.class.php @@ -1656,6 +1656,10 @@ class learnpathItem { public function restart() { if(self::debug>0){error_log('New LP - In learnpathItem::restart()',0);} + if ($this->type == 'sco') { //If this is a sco, chamilo can't update the time without explicit scorm call + $this->current_start_time = 0; + $this->curtrent_stop_time = 0; //Those 0 value have this effect + } $this->save(); $allowed = $this->is_restart_allowed(); if($allowed === -1){ @@ -2525,4 +2529,4 @@ class learnpathItem { if(self::debug>2){error_log('New LP - End of learnpathItem::write_to_db()',0);} return true; } -} \ No newline at end of file +} From 557a5ae4084797e1f59b0bb42c99be3e0fb60309 Mon Sep 17 00:00:00 2001 From: Noel Dieschburg Date: Wed, 6 Jul 2011 11:10:28 +0200 Subject: [PATCH 03/11] SCORM attempts : adds a seriousgame mode flag to lp --- main/img/gamepad.gif | Bin 0 -> 1106 bytes main/inc/lib/add_course.lib.inc.php | 3 +- main/install/migrate-db-1.8.6.2-1.8.7-pre.sql | 2 + main/newscorm/learnpath.class.php | 134 ++++++++++++++++++ main/newscorm/learnpathItem.class.php | 50 ++++++- main/newscorm/learnpathList.class.php | 1 + main/newscorm/lp_controller.php | 16 +++ main/newscorm/lp_list.php | 35 +++-- 8 files changed, 221 insertions(+), 20 deletions(-) create mode 100644 main/img/gamepad.gif diff --git a/main/img/gamepad.gif b/main/img/gamepad.gif new file mode 100644 index 0000000000000000000000000000000000000000..81a0c0ec9fffe6dd61abc924a3a4c5ec45231ece GIT binary patch literal 1106 zcmdthk5iHd9LMnoN1W9*-F55QYMyzuU0%CuciSDU?QW%lkE!`1b6fM$g+rKa{)lPa zn(}~n>S^|49i46x4n_=Wgq&g%MHHB40%{06&m#{!umJN%{z6l8kL|zM>)zkbfAFP) zH0sfU-N0_(Nf$s%NT4SrCDUjioeqLv3J9j9rKP8*XJ%z(=e(4gd-mM9yn+G-gOSht zhRI}BekEbBSS&WXu(k{r!D?dP1Mx{=jTD8q8XgdB|We4GbBL z29wG3$Y|Hudb@3-BO@ag%Oi`0Sj*p|L*_BN%{FQrw;SyfgA)$NnA6Pa+LPN&o5vLP-j;&Q{V8-a=SIZzlyut@~NVK<7R2#TSoXOd{r z>n3u0-Iy1{d>+h)c?fQg$LICCc`u#q_6GA9J6bJ+ZAv_ce z1p~p*R45dBIyE&tJv}osJv%!)H#hg}+5G%Gaf=HJ3yWKp7nlCCyu7?bTsXWG4u@A( zR#vw>Ut1$uTVG$_*x1oxHw_nxZzYu}e;(SqyQT?~Ew!JzTl`^7VR zQcg4jjj1v=$kFV`d5>B(+@<0%ji0@C`#a6`HyfVb%@oEQj5|;i_0Hiaa#IE;iE=fm z5X@uqW!BhFzqdx-IdUXLxbv;Ju9ed%yV_6uG=Fn7ZXhB8`ug%|z(%ThJG1fm@X>_< z0hvV67CEb-ZM7eXA|%`_@o`ekv3P%^N<4VrR4f`2XXFVJ#Xi0ssM~yZuh~gH d)O3@AZHxIl`n|fC<<_`b> literal 0 HcmV?d00001 diff --git a/main/inc/lib/add_course.lib.inc.php b/main/inc/lib/add_course.lib.inc.php index ed6e808329..79054bb2b2 100644 --- a/main/inc/lib/add_course.lib.inc.php +++ b/main/inc/lib/add_course.lib.inc.php @@ -1208,7 +1208,8 @@ function update_Db_course($courseDbName, $language = null) "author varchar(255) not null default '', " . //stores the theme of the LP "session_id int unsigned not null default 0, " . //the session_id "prerequisite int unsigned not null default 0," . // pre requisite for next lp - "hide_toc_frame tinyint NOT NULL DEFAULT 0". + "hide_toc_frame tinyint NOT NULL DEFAULT 0,". + "seriousgame_mode tinyint NOT NULL DEFAULT 0". ")" . $charset_clause; if(!Database::query($sql)) { 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 f120b9525a..e1d688255d 100644 --- 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 @@ -216,6 +216,8 @@ ALTER TABLE lp ADD prerequisite int unsigned NOT NULL DEFAULT 0; ALTER TABLE student_publication MODIFY COLUMN description TEXT DEFAULT NULL; ALTER TABLE student_publication ADD COLUMN user_id INTEGER NOT NULL AFTER session_id; INSERT INTO course_setting(variable,value,category) VALUES ('email_alert_students_on_new_homework',0,'work'); +-- CBlue custom ALTER TABLE lp ADD COLUMN hide_toc_frame TINYINT NOT NULL DEFAULT 0; +ALTER TABLE lp ADD COLUMN seriousgame_mode TINYINT NOT NULL DEFAULT 0; alter table lp_item_view modify column suspend_data longtext; diff --git a/main/newscorm/learnpath.class.php b/main/newscorm/learnpath.class.php index 70d4272a5a..c5caf7b98b 100644 --- a/main/newscorm/learnpath.class.php +++ b/main/newscorm/learnpath.class.php @@ -47,6 +47,9 @@ class learnpath { // Tells if all the items of the learnpath can be tried again. Defaults to "no" (=1) public $prevent_reinit = 1; + // Set KTM mode for scorm lp + public $seriousgame_mode = 0; + // Describes the mode of progress bar display public $progress_bar_mode = '%'; @@ -127,6 +130,7 @@ class learnpath { $this->theme = $row['theme']; $this->maker = $row['content_maker']; $this->prevent_reinit = $row['prevent_reinit']; + $this->seriousgame_mode = $row['seriousgame_mode']; $this->license = $row['content_license']; $this->scorm_debug = $row['debug']; $this->js_lib = $row['js_lib']; @@ -4212,6 +4216,136 @@ class learnpath { } return -1; } + + /** + * Determine the attempt_mode thanks to prevent_reinit and seriousgame_mode db flag + * + * @return string 'single', 'multi' or 'seriousgame' + * @author ndiechburg + **/ + public function get_attempt_mode() + { + if (!isset($this->seriousgame_mode)) { //Set default value for seriousgame_mode + $this->seriousgame_mode=0; + } + if (!isset($this->prevent_reinit)) { // Set default value for prevent_reinit + $this->prevent_reinit =1; + } + if ($this->seriousgame_mode == 1 && $this->prevent_reinit == 1) { + return 'seriousgame'; + } + if ($this->seriousgame_mode == 0 && $this->prevent_reinit == 1) { + return 'single'; + } + if ($this->seriousgame_mode == 0 && $this->prevent_reinit == 0) { + return 'multiple'; + } + return 'single'; + } + + /** + * Register the attempt mode into db thanks to flags prevent_reinit and seriousgame_mode flags + * + * @param string 'seriousgame', 'single' or 'multiple' + * @return boolean + * @author ndiechburg + **/ + public function set_attempt_mode($mode) + { + switch ($mode) { + case 'seriousgame' : + $sg_mode = 1; + $prevent_reinit = 1; + break; + case 'single' : + $sg_mode = 0; + $prevent_reinit = 1; + break; + case 'multiple' : + $sg_mode = 0; + $prevent_reinit = 0; + break; + default : + $sg_mode = 0; + $prevent_reinit = 0; + break; + } + $this->prevent_reinit = $prevent_reinit; + $this->seriousgame_mode = $sg_mode; + $lp_table = Database :: get_course_table(TABLE_LP_MAIN); + $sql = "UPDATE $lp_table SET prevent_reinit = $prevent_reinit , seriousgame_mode = $sg_mode WHERE id = " . $this->get_id(); + $res = Database::query($sql); + if ($res) { + return true; + } + else { + return false; + } + } + + /** + * switch between multiple attempt, single attempt or serious_game mode (only for scorm) + * + * @return boolean + * @author ndiechburg + **/ + public function switch_attempt_mode() + { + if ($this->debug > 0) { + error_log('New LP - In learnpath::switch_attempt_mode()', 0); + } + $mode = $this->get_attempt_mode(); + switch ($mode) { + case 'single' : + $next_mode = 'multiple'; + break; + case 'multiple' : + $next_mode = 'seriousgame'; + break; + case 'seriousgame' : + $next_mode = 'single'; + break; + default : + $next_mode = 'single'; + break; + } + $this->set_attempt_mode($next_mode); + } + + /** + * Swithc the lp in ktm mode. This is a special scorm mode with unique attempt but possibility to do again a completed item. + * + * @return boolean true if seriousgame_mode has been set to 1, false otherwise + * @author ndiechburg + **/ + public function set_seriousgame_mode() + { + if ($this->debug > 0) { + error_log('New LP - In learnpath::set_seriousgame_mode()', 0); + } + $lp_table = Database :: get_course_table(TABLE_LP_MAIN); + $sql = "SELECT * FROM $lp_table WHERE id = " . $this->get_id(); + $res = Database::query($sql); + if (Database :: num_rows($res) > 0) { + $row = Database :: fetch_array($res); + $force = $row['seriousgame_mode']; + if ($force == 1) { + $force = 0; + } elseif ($force == 0) { + $force = 1; + } + $sql = "UPDATE $lp_table SET seriousgame_mode = $force WHERE id = " . $this->get_id(); + $res = Database::query($sql); + $this->seriousgame_mode = $force; + return $force; + } else { + if ($this->debug > 2) { + error_log('New LP - Problem in set_seriousgame_mode() - could not find LP ' . $this->get_id() . ' in DB', 0); + } + } + return -1; + + } /** * Updates the "scorm_debug" value that shows or hide the debug window * @return boolean True if scorm_debug has been set to 'on', false otherwise (or 1 or 0 in this case) diff --git a/main/newscorm/learnpathItem.class.php b/main/newscorm/learnpathItem.class.php index 33bf54674b..cc3336b532 100644 --- a/main/newscorm/learnpathItem.class.php +++ b/main/newscorm/learnpathItem.class.php @@ -47,6 +47,7 @@ class learnpathItem { public $prereqs = array(); public $previous; public $prevent_reinit = 1; // 0 = multiple attempts 1 = one attempt + public $seriousgame_mode; public $ref; public $save_on_close = true; public $search_did = NULL; @@ -101,6 +102,7 @@ class learnpathItem { } $this->save_on_close = true; $this->db_id = $id; + $this->seriousgame_mode = $this->get_seriousgame_mode(); // get search_did if (api_get_setting('search_enabled')=='true') { @@ -644,6 +646,37 @@ class learnpathItem { if(self::debug>2){error_log('New LP - End of learnpathItem::get_prevent_reinit() - Returned '.$this->prevent_reinit,0);} return $this->prevent_reinit; } + /** + * Returns 1 if seriousgame_mode is activated, 0 otherwise + * + * @return int (0 or 1) + * @author ndiechburg + **/ + public function get_seriousgame_mode() + { + if(self::debug>2){error_log('New LP - In learnpathItem::get_seriousgame_mode()',0);} + if(!isset($this->seriousgame_mode)){ + if(!empty($this->lp_id)){ + $db = Database::get_course_table(TABLE_LP_MAIN); + $sql = "SELECT * FROM $db WHERE id = ".$this->lp_id; + $res = @Database::query($sql); + if(Database::num_rows($res)<1) + { + $this->error = "Could not find parent learnpath in learnpath table"; + if(self::debug>2){error_log('New LP - End of learnpathItem::get_seriousgame_mode() - Returning false',0);} + return false; + }else{ + $row = Database::fetch_array($res); + $this->seriousgame_mode = $row['seriousgame_mode']; + } + }else{ + $this->seriousgame_mode = 0; //KTM mode is always off by default + } + } + if(self::debug>2){error_log('New LP - End of learnpathItem::get_seriousgame_mode() - Returned '.$this->seriousgame_mode,0);} + return $this->seriousgame_mode; + } + /** * Gets the item's reference column * @return string The item's reference field (generally used for SCORM identifiers) @@ -1656,17 +1689,23 @@ class learnpathItem { public function restart() { if(self::debug>0){error_log('New LP - In learnpathItem::restart()',0);} - if ($this->type == 'sco') { //If this is a sco, chamilo can't update the time without explicit scorm call + if ($this->type == 'sco') { //If this is a sco, chamilo can't update the time without explicit scorm call $this->current_start_time = 0; $this->curtrent_stop_time = 0; //Those 0 value have this effect } $this->save(); + //SPECIAL KTM : We reuse same attempt_id + if ($this->get_seriousgame_mode() == 1 && $this->type == 'sco') { + $this->current_start_time = 0; + $this->current_stop_time = 0; + return true; + } $allowed = $this->is_restart_allowed(); if($allowed === -1){ //nothing allowed, do nothing }elseif($allowed === 1){ //restart as new attempt is allowed, record a new attempt - $this->attempt_id = $this->attempt_id + 1; //simply reuse the previous attempt_id + $this->attempt_id = $this->attempt_id + 1; //simply reuse the previous attempt_id $this->current_score = 0; $this->current_start_time = 0; $this->current_stop_time = 0; @@ -2255,7 +2294,7 @@ class learnpathItem { $save=true; } - if (($save===false && $this->type == 'sco') ||(($this->type == 'sco') && ($credit == 'no-credit' OR $mode == 'review' OR $mode == 'browse'))) + if ((($save===false && $this->type == 'sco') ||(($this->type == 'sco') && ($credit == 'no-credit' OR $mode == 'review' OR $mode == 'browse'))) && ($this->seriousgame_mode!=1 && $this->type == 'sco')) { //this info shouldn't be saved as the credit or lesson mode info prevent it if(self::debug>1){error_log('New LP - In learnpathItem::write_to_db() - credit('.$credit.') or lesson_mode('.$mode.') prevent recording!',0);} @@ -2379,7 +2418,10 @@ class learnpathItem { $case_completed=array('completed','passed','browsed'); //is not multiple attempts - if ($this->get_prevent_reinit()==1) { + if ($this->seriousgame_mode==1 && $this->type=='sco') { + $total_time =" total_time = total_time +".$this->get_total_time().", "; + $my_status = " status = '".$this->get_status(false)."' ,"; + } elseif ($this->get_prevent_reinit()==1) { // process of status verified into data base $sql_verified='SELECT status FROM '.$item_view_table.' WHERE lp_item_id="'.$this->db_id.'" AND lp_view_id="'.$this->view_id.'" AND view_count="'.$this->attempt_id.'" ;'; diff --git a/main/newscorm/learnpathList.class.php b/main/newscorm/learnpathList.class.php index ffd542f3e6..f5ec44db3e 100644 --- a/main/newscorm/learnpathList.class.php +++ b/main/newscorm/learnpathList.class.php @@ -87,6 +87,7 @@ class learnpathList { 'lp_visibility' => $vis, 'lp_published' => $pub, 'lp_prevent_reinit' => $row['prevent_reinit'], + 'seriousgame_mode' => $row['seriousgame_mode'], 'lp_scorm_debug' => $row['debug'], 'lp_display_order' => $row['display_order'], 'lp_preview_image' => stripslashes($row['preview_image']) diff --git a/main/newscorm/lp_controller.php b/main/newscorm/lp_controller.php index 59584387f2..e3f3f9dfb2 100644 --- a/main/newscorm/lp_controller.php +++ b/main/newscorm/lp_controller.php @@ -817,6 +817,7 @@ switch($action) $_SESSION['oLP']->update_default_scorm_commit(); require 'lp_list.php'; break; + /* Those 2 switches have been replaced by switc_attempt_mode switch case 'switch_reinit': if($debug>0) error_log('New LP - switch_reinit action triggered',0); if(!$lp_found){ error_log('New LP - No learnpath given for switch',0); require 'lp_list.php'; } @@ -824,6 +825,21 @@ switch($action) $_SESSION['oLP']->update_reinit(); require 'lp_list.php'; break; + case 'switch_seriousgame_mode': + if($debug>0) error_log('New LP - switch_seriousgame_mode action triggered',0); + if(!$lp_found){ error_log('New LP - No learnpath given for switch',0); require 'lp_list.php'; } + $_SESSION['refresh'] = 1; + $_SESSION['oLP']->set_seriousgame_mode(); + require 'lp_list.php'; + break; + */ + case 'switch_attempt_mode': + if($debug>0) error_log('New LP - switch_reinit action triggered',0); + if(!$lp_found){ error_log('New LP - No learnpath given for switch',0); require 'lp_list.php'; } + $_SESSION['refresh'] = 1; + $_SESSION['oLP']->switch_attempt_mode(); + require 'lp_list.php'; + break; case 'switch_scorm_debug': if($debug>0) error_log('New LP - switch_scorm_debug action triggered',0); if(!$lp_found){ error_log('New LP - No learnpath given for switch',0); require 'lp_list.php'; } diff --git a/main/newscorm/lp_list.php b/main/newscorm/lp_list.php index 3c1aaa1820..45ddf328cf 100644 --- a/main/newscorm/lp_list.php +++ b/main/newscorm/lp_list.php @@ -341,24 +341,29 @@ if (is_array($flat_list)) { } - /* MULTIPLE ATTEMPTS */ - if ($current_session == $details['lp_session']) { - if($details['lp_prevent_reinit']==1){ - $dsp_reinit = '' . - 'Allow reinit' . - ' '; - }else{ - $dsp_reinit = '' . - 'Prevent reinit' . - ' '; - } + /* MULTIPLE ATTEMPTS OR SERIOUS GAME MODE */ + + if ($current_session == $details['lp_session']) { + if ($details['seriousgame_mode'] == 1 && $details['lp_prevent_reinit'] == 1) { //seriousgame mode | next = single + dir('serious'); + $dsp_reinit = '' . + 'Prevent reinit' . + ' '; + } + if ($details['seriousgame_mode'] == 0 && $details['lp_prevent_reinit'] == 1) { //single mode | next = multiple + $dsp_reinit = '' . + 'Allow reinit' . + ' '; + } + if ($details['seriousgame_mode'] == 0 && $details['lp_prevent_reinit'] == 0) { //multiple mode | next = seriousgame + $dsp_reinit = '' . + 'Serious game mode' . + ' '; + } } else { - $dsp_reinit = 'Allow reinit'; + $dsp_reinit .= ''; } - - - /* FUll screen VIEW */ if ($current_session == $details['lp_session']) { From 51236ef53ecb5f8ec3f2e6d8c4804c4e6c525361 Mon Sep 17 00:00:00 2001 From: jkbockstael Date: Wed, 6 Jul 2011 11:58:29 +0200 Subject: [PATCH 04/11] Custom Pages : Added the URL Images feature. --- custompages/url-images/README | 3 +++ main/admin/access_url_edit.php | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 custompages/url-images/README mode change 100755 => 100644 main/admin/access_url_edit.php diff --git a/custompages/url-images/README b/custompages/url-images/README new file mode 100644 index 0000000000..929dca9dac --- /dev/null +++ b/custompages/url-images/README @@ -0,0 +1,3 @@ +Custom Pages : URL Images + +This features allows each access URL to have a number of images (currently three) specific to this URL. This allows easier customization of landing pages by access URL. diff --git a/main/admin/access_url_edit.php b/main/admin/access_url_edit.php old mode 100755 new mode 100644 index a987024ea6..49d2e293f5 --- a/main/admin/access_url_edit.php +++ b/main/admin/access_url_edit.php @@ -43,6 +43,19 @@ if( $form->validate()) { } else { UrlManager::udpate($url_id, $url.'/', $description, $active); } + // URL Images + $url_images_dir = api_get_path(SYS_PATH).'custompages/url-images/'; + $image_fields = array("url_image_1", "url_image_2", "url_image_3"); + foreach ($image_fields as $image_field) { + if ($_FILES[$image_field]['error'] == 0) { + // Hardcoded: only PNG files allowed + if (end(explode('.', $_FILES[$image_field]['name'])) == 'png') { + move_uploaded_file($_FILES[$image_field]['tmp_name'], $url_images_dir.$url_id.'_'.$image_field.'.png'); + } + // else fail silently + } + // else fail silently + } $url_to_go='access_urls.php'; $message=get_lang('URLEdited'); } else { @@ -61,6 +74,21 @@ if( $form->validate()) { $url_to_go='access_url_edit.php'; $message = get_lang('URLAlreadyAdded'); } + // URL Images + $url .= (substr($url,strlen($url)-1, strlen($url))=='/') ? '' : '/'; + $url_id = UrlManager::get_url_id($url); + $url_images_dir = api_get_path(SYS_PATH).'custompages/url-images/'; + $image_fields = array("url_image_1", "url_image_2", "url_image_3"); + foreach ($image_fields as $image_field) { + if ($_FILES[$image_field]['error'] == 0) { + // Hardcoded: only PNG files allowed + if (end(explode('.', $_FILES[$image_field]['name'])) == 'png') { + move_uploaded_file($_FILES[$image_field]['tmp_name'], $url_images_dir.$url_id.'_'.$image_field.'.png'); + } + // else fail silently + } + // else fail silently + } } Security::clear_token(); $tok = Security::get_token(); @@ -122,6 +150,11 @@ if (isset ($_GET['action'])) { } } +// URL Images +$form->addElement('file','url_image_1','URL Image 1 (PNG)'); +$form->addElement('file','url_image_2','URL Image 2 (PNG)'); +$form->addElement('file','url_image_3','URL Image 3 (PNG)'); + // Submit button $form->addElement('style_submit_button', 'submit', $submit_name, 'class="add"'); $form->display(); From c1075c3623f0dc8cd46737c493813ec0881fe632 Mon Sep 17 00:00:00 2001 From: jkbockstael Date: Wed, 6 Jul 2011 12:27:55 +0200 Subject: [PATCH 05/11] Custom Pages : added a function to get the images belonging to the current URL (or any other). --- custompages/url-images/README | 2 ++ main/inc/lib/custompages.lib.php | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/custompages/url-images/README b/custompages/url-images/README index 929dca9dac..543a49d0c2 100644 --- a/custompages/url-images/README +++ b/custompages/url-images/README @@ -1,3 +1,5 @@ Custom Pages : URL Images This features allows each access URL to have a number of images (currently three) specific to this URL. This allows easier customization of landing pages by access URL. + +You can access a URL's images by calling the static function CustomPages::getURLImages() in your custom page. diff --git a/main/inc/lib/custompages.lib.php b/main/inc/lib/custompages.lib.php index 7f1804a737..57425934cd 100644 --- a/main/inc/lib/custompages.lib.php +++ b/main/inc/lib/custompages.lib.php @@ -3,6 +3,8 @@ // Used to implement the loading of custom pages // 2011, Jean-Karim Bockstael +require_once api_get_path(LIBRARY_PATH).'urlmanager.lib.php'; + class CustomPages { public static function displayPage($page_name) { @@ -16,5 +18,20 @@ class CustomPages { error_log('CustomPages::displayPage : could not read file '.$file_name); } } + + public static function getURLImages($url_id = null) { + if (is_null($url_id)) { + $url = 'http://'.$_SERVER['HTTP_HOST'].'/'; + $url_id = UrlManager::get_url_id($url); + } + $url_images_dir = api_get_path(SYS_PATH).'custompages/url-images/'; + $images = array(); + for ($img_id = 1; $img_id <= 3; $img_id++) { + if (file_exists($url_images_dir.$url_id.'_url_image_'.$img_id.'.png')) { + $images[] = api_get_path(WEB_PATH).'custompages/url-images/'.$url_id.'_url_image_'.$img_id.'.png'; + } + } + return $images; + } } ?> From c38ead027bbe7b5fcd7f8de0441fe311025f187c Mon Sep 17 00:00:00 2001 From: Noel Dieschburg Date: Wed, 6 Jul 2011 15:11:58 +0200 Subject: [PATCH 06/11] Scorm time : setting scorm_cumulative_session_time and scorm time partly recoding --- main/install/db_main.sql | 8 ++- main/install/migrate-db-1.8.6.2-1.8.7-pre.sql | 2 + main/lang/english/admin.inc.php | 2 + main/lang/french/admin.inc.php | 2 + main/newscorm/learnpathItem.class.php | 67 +++++++++++++++++-- 5 files changed, 73 insertions(+), 8 deletions(-) diff --git a/main/install/db_main.sql b/main/install/db_main.sql index 4aae20d78f..118f9519a9 100644 --- a/main/install/db_main.sql +++ b/main/install/db_main.sql @@ -795,7 +795,8 @@ VALUES ('languagePriority2', NULL, 'radio', 'Languages','user_profil_lang', 'LanguagePriority2Title', 'LanguagePriority2Comment', NULL, NULL, 0), ('languagePriority3', NULL, 'radio', 'Languages','user_selected_lang', 'LanguagePriority3Title', 'LanguagePriority3Comment', NULL, NULL, 0), ('languagePriority4', NULL, 'radio', 'Languages', 'platform_lang','LanguagePriority4Title', 'LanguagePriority4Comment', NULL, NULL, 0), -('activate_send_event_by_mail', NULL, 'radio', 'Platform', 'false', 'ActivateSendEventByMailTitle', 'ActivateSendEventByMailComment', NULL, NULL, 0); +('activate_send_event_by_mail', NULL, 'radio', 'Platform', 'false', 'ActivateSendEventByMailTitle', 'ActivateSendEventByMailComment', NULL, NULL, 0), +('scorm_cumulative_session_time', NULL, 'textfield', 'Course', 'true', 'ScormCumulativeSessionTimeTitle', 'ScormCumulativeSessionTimeComment', NULL, NULL, 0); @@ -1037,8 +1038,9 @@ VALUES ('languagePriority4','user_selected_lang','UserSelectedLanguage'), ('languagePriority4','course_lang','CourseLanguage'), ('activate_send_event_by_mail', 'true', 'Yes'), -('activate_send_event_by_mail', 'false', 'No'); - +('activate_send_event_by_mail', 'false', 'No'), +('scorm_cumulative_session_time','true','Yes'), +('scorm_cumulative_session_time','false','No'); UNLOCK TABLES; 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 e1d688255d..68f9a6a9f7 100644 --- 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 @@ -128,6 +128,8 @@ INSERT INTO settings_current (variable, subkey, type, category, selected_value, INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES('custom_tab_2_url', NULL, 'textfield', 'Platform', '', 'CustomTab2URLTitle', 'CustomTab2URLComment', NULL, NULL, 0); INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES('custom_tab_3_name', NULL, 'textfield', 'Platform', '', 'CustomTab3NameTitle', 'CustomTab3NameComment', NULL, NULL, 0); INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES('custom_tab_3_url', NULL, 'textfield', 'Platform', '', 'CustomTab3URLTitle', 'CustomTab3URLComment', NULL, NULL, 0); +INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES('scorm_cumulative_session_time', NULL, 'textfield', 'Course', 'true', 'ScormCumulativeSessionTimeTitle', 'ScormCumulativeSessionTimeComment', NULL, NULL, 0); +INSERT INTO settings_options (variable, value, display_text) VALUES ('scorm_cumulative_session_time','true','Yes'), ('scorm_cumulative_session_time','false','No'); INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('activate_send_event_by_mail', NULL, 'radio', 'Platform', 'false', 'ActivateSendEventByMailTitle', 'ActivateSendEventByMailComment', NULL, NULL, 0); INSERT INTO settings_options (variable, value, display_text) VALUES ('activate_send_event_by_mail', 'true', 'Yes'),('activate_send_event_by_mail', 'false', 'No'); diff --git a/main/lang/english/admin.inc.php b/main/lang/english/admin.inc.php index 1ca1aa2fb2..d8269bff10 100644 --- a/main/lang/english/admin.inc.php +++ b/main/lang/english/admin.inc.php @@ -1345,4 +1345,6 @@ $ChooseRelationType = 'Choose a relation type'; $UserListInGroup = 'Users subscribed to this group'; $ActivateSendEventByMailTitle='Activates the send events by mail feature'; $ActivateSendEventByMailComment = ''; +$ScormCumulativeSessionTimeTitle = 'Cumulative incerementation of session_time in scorm contents'; +$ScormCumulativeSessionTimeComment = '' ?> diff --git a/main/lang/french/admin.inc.php b/main/lang/french/admin.inc.php index 8d1fd2c271..dbf1392ba9 100644 --- a/main/lang/french/admin.inc.php +++ b/main/lang/french/admin.inc.php @@ -1322,4 +1322,6 @@ $ChooseRelationType = 'Choisir un type de relation'; $UserListInGroup = 'Utilisateurs inscrits au groupe'; $ActivateSendEventByMailTitle='Activer les envois d\'évènements par email'; $ActivateSendEventByMailComment = ''; +$ScormCumulativeSessionTimeTitle = 'La valeur session_time est incrémentée de manière cumulative dans les contenus scorm'; +$ScormCumulativeSessionTimeComment = '' ?> diff --git a/main/newscorm/learnpathItem.class.php b/main/newscorm/learnpathItem.class.php index cc3336b532..0155b62900 100644 --- a/main/newscorm/learnpathItem.class.php +++ b/main/newscorm/learnpathItem.class.php @@ -55,6 +55,8 @@ class learnpathItem { public $title; public $type; // this attribute can contain chapter|link|student_publication|module|quiz|document|forum|thread public $view_id; + //var used if absolute session time mode is used + private $last_scorm_session_time =0; const debug = 0; //logging param /** @@ -1148,6 +1150,16 @@ class learnpathItem { */ public function get_total_time() { if (self::debug>0){error_log('New LP - In learnpathItem::get_total_time()',0);} + + if ($this->type=='sco'){ //SCO HACK + if (api_get_setting('scorm_absolute_session_time') == 'true'){ + if ($this->session_time > 0) { + return $this->session_time; + } else { + return $this->session_time + $this->total_time; + } + } + } if ($this->current_start_time == 0){ //shouldn't be necessary thanks to the open() method $this->current_start_time = time(); } @@ -1690,8 +1702,9 @@ class learnpathItem { { if(self::debug>0){error_log('New LP - In learnpathItem::restart()',0);} if ($this->type == 'sco') { //If this is a sco, chamilo can't update the time without explicit scorm call - $this->current_start_time = 0; - $this->curtrent_stop_time = 0; //Those 0 value have this effect + $this->current_start_time = 0; + $this->curtrent_stop_time = 0; //Those 0 value have this effect + $this->last_scorm_session_time = 0; } $this->save(); //SPECIAL KTM : We reuse same attempt_id @@ -2117,10 +2130,10 @@ class learnpathItem { $sec = $res[3]; //getting total number of seconds spent $total_sec = $hour*3600 + $min*60 + $sec; - $this->update_time($total_sec); + $this->scorm_update_time($total_sec); } }elseif($format == 'int'){ - $this->update_time($scorm_time); + $this->scorm_update_time($scorm_time); } } } @@ -2206,6 +2219,36 @@ class learnpathItem { }*/ } } + /** + * Special scorm update time function. This function will update time directly into db for scorm objects + **/ + public function scorm_update_time($total_sec=0){ + //Step 1 : get actual total time stored in db + $item_view_table = Database::get_course_table(TABLE_LP_ITEM_VIEW); + $get_view_sql='SELECT total_time FROM '.$item_view_table.' WHERE lp_item_id="'.$this->db_id.'" AND lp_view_id="'.$this->view_id.'" AND view_count="'.$this->attempt_id.'" ;'; + $result=Database::query($get_view_sql); + $row=Database::fetch_array($result); + if (!isset($row['total_time'])) { + $total_time = 0; + } + else { + $total_time = $row['total_time']; + } + + //Step 2.1 : if normal mode total_time = total_time + total_sec + if (api_get_setting('scorm_cumulative_session_time') != 'false'){ + $total_time +=$total_sec; + //$this->last_scorm_session_time = $total_sec; + } + //Step 2.2 : if not cumulative mode total_time = total_time - last_update + total_sec + else{ + $total_time = $total_time - $this->last_scorm_session_time + $total_sec; + $this->last_scorm_session_time = $total_sec; + } + //Step 3 update db + $update_view_sql='UPDATE '.$item_view_table." SET total_time =$total_time".' WHERE lp_item_id="'.$this->db_id.'" AND lp_view_id="'.$this->view_id.'" AND view_count="'.$this->attempt_id.'" ;'; + $result=Database::query($update_view_sql); + } /** * Write objectives to DB. This method is separate from write_to_db() because otherwise * objectives are lost as a side effect to AJAX and session concurrent access @@ -2484,7 +2527,20 @@ class learnpathItem { }*/ } - + + if ($this->type == 'sco'){ //IF scorm scorm_update_time has already updated total_tim in db + $sql = "UPDATE $item_view_table " . + " SET start_time = ".$this->get_current_start_time().", " . //FIXME CBLUE check current sart time + " score = ".$this->get_score().", " . + $my_status. + " max_score = '".$this->get_max()."'," . + " suspend_data = '".Database::escape_string($this->current_data)."'," . + //" max_time_allowed = '".$this->get_max_time_allowed()."'," . + " lesson_location = '".$this->lesson_location."' " . + "WHERE lp_item_id = ".$this->db_id." " . + "AND lp_view_id = ".$this->view_id." " . + "AND view_count = ".$this->attempt_id; + } else { $sql = "UPDATE $item_view_table " . "SET " .$total_time. " start_time = ".$this->get_current_start_time().", " . @@ -2497,6 +2553,7 @@ class learnpathItem { "WHERE lp_item_id = ".$this->db_id." " . "AND lp_view_id = ".$this->view_id." " . "AND view_count = ".$this->attempt_id; + } $this->current_start_time = time(); } From d173b1518b20f476f4095fa7ed9aef57c7ae027f Mon Sep 17 00:00:00 2001 From: Noel Dieschburg Date: Wed, 6 Jul 2011 16:04:39 +0200 Subject: [PATCH 07/11] scorm_cumulative_session_time setting : correction of migration db file --- main/install/migrate-db-1.8.6.2-1.8.7-pre.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 68f9a6a9f7..d81f503876 100644 --- 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 @@ -128,7 +128,7 @@ INSERT INTO settings_current (variable, subkey, type, category, selected_value, INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES('custom_tab_2_url', NULL, 'textfield', 'Platform', '', 'CustomTab2URLTitle', 'CustomTab2URLComment', NULL, NULL, 0); INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES('custom_tab_3_name', NULL, 'textfield', 'Platform', '', 'CustomTab3NameTitle', 'CustomTab3NameComment', NULL, NULL, 0); INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES('custom_tab_3_url', NULL, 'textfield', 'Platform', '', 'CustomTab3URLTitle', 'CustomTab3URLComment', NULL, NULL, 0); -INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES('scorm_cumulative_session_time', NULL, 'textfield', 'Course', 'true', 'ScormCumulativeSessionTimeTitle', 'ScormCumulativeSessionTimeComment', NULL, NULL, 0); +INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES('scorm_cumulative_session_time', NULL, 'radio', 'Course', 'true', 'ScormCumulativeSessionTimeTitle', 'ScormCumulativeSessionTimeComment', NULL, NULL, 0); INSERT INTO settings_options (variable, value, display_text) VALUES ('scorm_cumulative_session_time','true','Yes'), ('scorm_cumulative_session_time','false','No'); INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('activate_send_event_by_mail', NULL, 'radio', 'Platform', 'false', 'ActivateSendEventByMailTitle', 'ActivateSendEventByMailComment', NULL, NULL, 0); From 0658246ef46f1ab8787a42c69d87732c5a51fd2d Mon Sep 17 00:00:00 2001 From: Noel Dieschburg Date: Wed, 6 Jul 2011 23:20:35 +0200 Subject: [PATCH 08/11] Scorm time : total time resets when not in multiple attempt mode and status is not completed --- main/newscorm/learnpathItem.class.php | 48 +++++++++++++++------------ 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/main/newscorm/learnpathItem.class.php b/main/newscorm/learnpathItem.class.php index 0155b62900..fcb67081a3 100644 --- a/main/newscorm/learnpathItem.class.php +++ b/main/newscorm/learnpathItem.class.php @@ -669,10 +669,10 @@ class learnpathItem { return false; }else{ $row = Database::fetch_array($res); - $this->seriousgame_mode = $row['seriousgame_mode']; + $this->seriousgame_mode = isset($row['seriousgame_mode'])? $row['serioudsgame_mode'] : 0; } }else{ - $this->seriousgame_mode = 0; //KTM mode is always off by default + $this->seriousgame_mode = 0; //SeriousGame mode is always off by default } } if(self::debug>2){error_log('New LP - End of learnpathItem::get_seriousgame_mode() - Returned '.$this->seriousgame_mode,0);} @@ -1151,15 +1151,6 @@ class learnpathItem { public function get_total_time() { if (self::debug>0){error_log('New LP - In learnpathItem::get_total_time()',0);} - if ($this->type=='sco'){ //SCO HACK - if (api_get_setting('scorm_absolute_session_time') == 'true'){ - if ($this->session_time > 0) { - return $this->session_time; - } else { - return $this->session_time + $this->total_time; - } - } - } if ($this->current_start_time == 0){ //shouldn't be necessary thanks to the open() method $this->current_start_time = time(); } @@ -1233,7 +1224,7 @@ class learnpathItem { //if status is not attempted or incomplete, authorize retaking (of the same) anyway. Otherwise: if($mystatus != $this->possible_status[0] AND $mystatus != $this->possible_status[1]){ $restart = -1; - }else{ + }else{ //status incompleted or not attempted $restart = 0; } }else{ @@ -1701,13 +1692,13 @@ class learnpathItem { public function restart() { if(self::debug>0){error_log('New LP - In learnpathItem::restart()',0);} - if ($this->type == 'sco') { //If this is a sco, chamilo can't update the time without explicit scorm call - $this->current_start_time = 0; - $this->curtrent_stop_time = 0; //Those 0 value have this effect - $this->last_scorm_session_time = 0; + if ($this->type == 'sco') { //If this is a sco, chamilo can't update the time without explicit scorm call + $this->current_start_time = 0; + $this->current_stop_time = 0; //Those 0 value have this effect + $this->last_scorm_session_time = 0; } $this->save(); - //SPECIAL KTM : We reuse same attempt_id + //For serious game : We reuse same attempt_id if ($this->get_seriousgame_mode() == 1 && $this->type == 'sco') { $this->current_start_time = 0; $this->current_stop_time = 0; @@ -1740,7 +1731,9 @@ class learnpathItem { $this->current_stop_time = 0; $this->current_data = ''; $this->status = $this->possible_status[0]; - $this->interactions_count = $this->get_interactions_count(true); + $this->interactions_count = $this->get_interactions_count(true); + if ($this->type == 'sco') + $this->scorm_init_time(); } return true; } @@ -2225,7 +2218,7 @@ class learnpathItem { public function scorm_update_time($total_sec=0){ //Step 1 : get actual total time stored in db $item_view_table = Database::get_course_table(TABLE_LP_ITEM_VIEW); - $get_view_sql='SELECT total_time FROM '.$item_view_table.' WHERE lp_item_id="'.$this->db_id.'" AND lp_view_id="'.$this->view_id.'" AND view_count="'.$this->attempt_id.'" ;'; + $get_view_sql='SELECT total_time, status FROM '.$item_view_table.' WHERE lp_item_id="'.$this->db_id.'" AND lp_view_id="'.$this->view_id.'" AND view_count="'.$this->attempt_id.'" ;'; $result=Database::query($get_view_sql); $row=Database::fetch_array($result); if (!isset($row['total_time'])) { @@ -2245,8 +2238,19 @@ class learnpathItem { $total_time = $total_time - $this->last_scorm_session_time + $total_sec; $this->last_scorm_session_time = $total_sec; } - //Step 3 update db - $update_view_sql='UPDATE '.$item_view_table." SET total_time =$total_time".' WHERE lp_item_id="'.$this->db_id.'" AND lp_view_id="'.$this->view_id.'" AND view_count="'.$this->attempt_id.'" ;'; + //Step 3 update db only if status != completed, passed, browsed or seriousgamemode not activated + $case_completed=array('completed','passed','browsed'); //TODO COMPLETE + if ($this->seriousgame_mode!=1 || !in_array($row['status'], $case_completed)){ + $update_view_sql='UPDATE '.$item_view_table." SET total_time =$total_time".' WHERE lp_item_id="'.$this->db_id.'" AND lp_view_id="'.$this->view_id.'" AND view_count="'.$this->attempt_id.'" ;'; + $result=Database::query($update_view_sql); + } + } + /** + * Set the total_time to 0 into db + **/ + public function scorm_init_time(){ + $item_view_table = Database::get_course_table(TABLE_LP_ITEM_VIEW); + $update_view_sql='UPDATE '.$item_view_table.' SET total_time = 0, start_time='.time().' WHERE lp_item_id="'.$this->db_id.'" AND lp_view_id="'.$this->view_id.'" AND view_count="'.$this->attempt_id.'" ;'; $result=Database::query($update_view_sql); } /** @@ -2530,7 +2534,7 @@ class learnpathItem { if ($this->type == 'sco'){ //IF scorm scorm_update_time has already updated total_tim in db $sql = "UPDATE $item_view_table " . - " SET start_time = ".$this->get_current_start_time().", " . //FIXME CBLUE check current sart time + " SET ".//start_time = ".$this->get_current_start_time().", " . //scorm_init_time does it " score = ".$this->get_score().", " . $my_status. " max_score = '".$this->get_max()."'," . From c9a7e96038b9de6a49201e1664c7cbf978cb1f1e Mon Sep 17 00:00:00 2001 From: Noel Dieschburg Date: Thu, 7 Jul 2011 17:21:48 +0200 Subject: [PATCH 09/11] Typo correction in seriousgamemode --- main/newscorm/learnpathItem.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/newscorm/learnpathItem.class.php b/main/newscorm/learnpathItem.class.php index fcb67081a3..f66ddd8b38 100644 --- a/main/newscorm/learnpathItem.class.php +++ b/main/newscorm/learnpathItem.class.php @@ -669,7 +669,7 @@ class learnpathItem { return false; }else{ $row = Database::fetch_array($res); - $this->seriousgame_mode = isset($row['seriousgame_mode'])? $row['serioudsgame_mode'] : 0; + $this->seriousgame_mode = isset($row['seriousgame_mode'])? $row['seriousgame_mode'] : 0; } }else{ $this->seriousgame_mode = 0; //SeriousGame mode is always off by default From 1f58f4c94cdcb657a6379aeb1b93d0232129ff54 Mon Sep 17 00:00:00 2001 From: Noel Dieschburg Date: Fri, 8 Jul 2011 14:12:56 +0200 Subject: [PATCH 10/11] scorm_cumulative_session_time setting : change from textfield to radio --- main/install/db_main.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/install/db_main.sql b/main/install/db_main.sql index 118f9519a9..e5b2516eb6 100644 --- a/main/install/db_main.sql +++ b/main/install/db_main.sql @@ -796,7 +796,7 @@ VALUES ('languagePriority3', NULL, 'radio', 'Languages','user_selected_lang', 'LanguagePriority3Title', 'LanguagePriority3Comment', NULL, NULL, 0), ('languagePriority4', NULL, 'radio', 'Languages', 'platform_lang','LanguagePriority4Title', 'LanguagePriority4Comment', NULL, NULL, 0), ('activate_send_event_by_mail', NULL, 'radio', 'Platform', 'false', 'ActivateSendEventByMailTitle', 'ActivateSendEventByMailComment', NULL, NULL, 0), -('scorm_cumulative_session_time', NULL, 'textfield', 'Course', 'true', 'ScormCumulativeSessionTimeTitle', 'ScormCumulativeSessionTimeComment', NULL, NULL, 0); +('scorm_cumulative_session_time', NULL, 'radio', 'Course', 'true', 'ScormCumulativeSessionTimeTitle', 'ScormCumulativeSessionTimeComment', NULL, NULL, 0); From 0de1e542a99052e1e546c4f1241f31ae429e0f35 Mon Sep 17 00:00:00 2001 From: jkbockstael Date: Thu, 14 Jul 2011 14:13:11 +0200 Subject: [PATCH 11/11] Reports, Custom Tabs : modified the install and upgrade scripts to get a "Reports" tab by default. --- main/install/db_main.sql | 6 +++--- main/install/migrate-db-1.8.6.2-1.8.7-pre.sql | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/main/install/db_main.sql b/main/install/db_main.sql index e5b2516eb6..f8ac579101 100644 --- a/main/install/db_main.sql +++ b/main/install/db_main.sql @@ -782,11 +782,11 @@ VALUES ('teacher_autosubscribe', NULL, 'textfield', 'Platform', '', 'TeacherAutosubscribeTitle', 'TeacherAutosubscribeComment', NULL, NULL, 0), ('DRH_autosubscribe', NULL, 'textfield', 'Platform', '', 'DRHAutosubscribeTitle', 'DRHAutosubscribeComment', NULL, NULL, 0), ('sessionadmin_autosubscribe', NULL, 'textfield', 'Platform', '', 'SessionadminAutosubscribeTitle', 'SessionadminAutosubscribeComment', NULL, NULL, 0), -('show_tabs', 'custom_tab_1', 'checkbox', 'Platform', 'false', 'ShowTabsTitle', 'ShowTabsComment', NULL, 'TabsCustom1', 1), +('show_tabs', 'custom_tab_1', 'checkbox', 'Platform', 'true', 'ShowTabsTitle', 'ShowTabsComment', NULL, 'TabsCustom1', 1), ('show_tabs', 'custom_tab_2', 'checkbox', 'Platform', 'false', 'ShowTabsTitle', 'ShowTabsComment', NULL, 'TabsCustom2', 1), ('show_tabs', 'custom_tab_3', 'checkbox', 'Platform', 'false', 'ShowTabsTitle', 'ShowTabsComment', NULL, 'TabsCustom3', 1), -('custom_tab_1_name', NULL, 'textfield', 'Platform', '', 'CustomTab1NameTitle', 'CustomTab1NameComment', NULL, NULL, 0), -('custom_tab_1_url', NULL, 'textfield', 'Platform', '', 'CustomTab1URLTitle', 'CustomTab1URLComment', NULL, NULL, 0), +('custom_tab_1_name', NULL, 'textfield', 'Platform', 'Reports', 'CustomTab1NameTitle', 'CustomTab1NameComment', NULL, NULL, 0), +('custom_tab_1_url', NULL, 'textfield', 'Platform', '/main/reports/', 'CustomTab1URLTitle', 'CustomTab1URLComment', NULL, NULL, 0), ('custom_tab_2_name', NULL, 'textfield', 'Platform', '', 'CustomTab2NameTitle', 'CustomTab2NameComment', NULL, NULL, 0), ('custom_tab_2_url', NULL, 'textfield', 'Platform', '', 'CustomTab2URLTitle', 'CustomTab2URLComment', NULL, NULL, 0), ('custom_tab_3_name', NULL, 'textfield', 'Platform', '', 'CustomTab3NameTitle', 'CustomTab3NameComment', NULL, NULL, 0), 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 d81f503876..bcced49b59 100644 --- 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 @@ -119,11 +119,11 @@ INSERT INTO settings_current (variable, subkey, type, category, selected_value, INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES('teacher_autosubscribe', NULL, 'textfield', 'Platform', '', 'TeacherAutosubscribeTitle', 'TeacherAutosubscribeComment', NULL, NULL, 0); INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES('DRH_autosubscribe', NULL, 'textfield', 'Platform', '', 'DRHAutosubscribeTitle', 'DRHAutosubscribeComment', NULL, NULL, 0); INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES('sessionadmin_autosubscribe', NULL, 'textfield', 'Platform', '', 'SessionadminAutosubscribeTitle', 'SessionadminAutosubscribeComment', NULL, NULL, 0); -INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES('show_tabs', 'custom_tab_1', 'checkbox', 'Platform', 'false', 'ShowTabsTitle', 'ShowTabsComment', NULL, 'TabsCustom1', 1); +INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES('show_tabs', 'custom_tab_1', 'checkbox', 'Platform', 'true', 'ShowTabsTitle', 'ShowTabsComment', NULL, 'TabsCustom1', 1); INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES('show_tabs', 'custom_tab_2', 'checkbox', 'Platform', 'false', 'ShowTabsTitle', 'ShowTabsComment', NULL, 'TabsCustom2', 1); INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES('show_tabs', 'custom_tab_3', 'checkbox', 'Platform', 'false', 'ShowTabsTitle', 'ShowTabsComment', NULL, 'TabsCustom3', 1); -INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES('custom_tab_1_name', NULL, 'textfield', 'Platform', '', 'CustomTab1NameTitle', 'CustomTab1NameComment', NULL, NULL, 0); -INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES('custom_tab_1_url', NULL, 'textfield', 'Platform', '', 'CustomTab1URLTitle', 'CustomTab1URLComment', NULL, NULL, 0); +INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES('custom_tab_1_name', NULL, 'textfield', 'Platform', 'Reports', 'CustomTab1NameTitle', 'CustomTab1NameComment', NULL, NULL, 0); +INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES('custom_tab_1_url', NULL, 'textfield', 'Platform', '/main/reports/', 'CustomTab1URLTitle', 'CustomTab1URLComment', NULL, NULL, 0); INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES('custom_tab_2_name', NULL, 'textfield', 'Platform', '', 'CustomTab2NameTitle', 'CustomTab2NameComment', NULL, NULL, 0); INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES('custom_tab_2_url', NULL, 'textfield', 'Platform', '', 'CustomTab2URLTitle', 'CustomTab2URLComment', NULL, NULL, 0); INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES('custom_tab_3_name', NULL, 'textfield', 'Platform', '', 'CustomTab3NameTitle', 'CustomTab3NameComment', NULL, NULL, 0);