skala
Laurent Opprecht 14 years ago
commit 3d6e7df79c
  1. 3
      documentation/credits.html
  2. 15
      license.txt
  3. 2
      main/admin/grade_models.php
  4. 10
      main/admin/settings.lib.php
  5. 10
      main/admin/settings.php
  6. 22
      main/auth/cas/authcas.php
  7. 16
      main/auth/cas/logincas.php
  8. 10
      main/css/academica/default.css
  9. 2
      main/css/academica/scorm.css
  10. 12
      main/css/baby_orange/default.css
  11. 4
      main/css/baby_orange/scorm.css
  12. 176
      main/css/base.css
  13. 54
      main/css/base_chamilo.css
  14. 10
      main/css/blue_lagoon/default.css
  15. 8
      main/css/blue_lagoon/scorm.css
  16. 2
      main/css/chamilo/default.css
  17. 38
      main/css/chamilo/scorm.css
  18. 6
      main/css/chamilo_electric_blue/scorm.css
  19. 6
      main/css/chamilo_green/scorm.css
  20. 5
      main/css/chamilo_orange/scorm.css
  21. 3
      main/css/chamilo_red/scorm.css
  22. 11
      main/css/chamilo_sport_red/scorm.css
  23. 10
      main/css/cool_blue/default.css
  24. 6
      main/css/cool_blue/scorm.css
  25. 10
      main/css/corporate/default.css
  26. 4
      main/css/corporate/scorm.css
  27. 10
      main/css/cosmic_campus/default.css
  28. 4
      main/css/cosmic_campus/scorm.css
  29. 12
      main/css/delicious_bordeaux/default.css
  30. 10
      main/css/delicious_bordeaux/scorm.css
  31. 10
      main/css/dokeos_blue/default.css
  32. 6
      main/css/dokeos_blue/scorm.css
  33. 14
      main/css/dokeos_classic/default.css
  34. 5
      main/css/dokeos_classic/scorm.css
  35. 12
      main/css/dokeos_classic_2D/default.css
  36. 4
      main/css/dokeos_classic_2D/scorm.css
  37. 10
      main/css/empire_green/default.css
  38. 10
      main/css/empire_green/scorm.css
  39. 10
      main/css/fruity_orange/default.css
  40. 6
      main/css/fruity_orange/scorm.css
  41. 6
      main/css/medical/default.css
  42. 2
      main/css/medical/scorm.css
  43. 10
      main/css/public_admin/default.css
  44. 4
      main/css/public_admin/scorm.css
  45. 10
      main/css/royal_purple/default.css
  46. 6
      main/css/royal_purple/scorm.css
  47. 11
      main/css/silver_line/default.css
  48. 4
      main/css/silver_line/scorm.css
  49. 12
      main/css/sober_brown/default.css
  50. 4
      main/css/sober_brown/scorm.css
  51. 10
      main/css/tasty_olive/default.css
  52. 6
      main/css/tasty_olive/scorm.css
  53. 10
      main/exercice/exercise.lib.php
  54. 18
      main/gradebook/gradebook_edit_eval.php
  55. 15
      main/gradebook/gradebook_edit_link.php
  56. 149
      main/gradebook/gradebook_flatview.php
  57. 80
      main/gradebook/index.php
  58. 2
      main/gradebook/lib/fe/catform.class.php
  59. 15
      main/gradebook/lib/fe/evalform.class.php
  60. 16
      main/gradebook/lib/fe/gradebooktable.class.php
  61. 14
      main/gradebook/lib/fe/linkaddeditform.class.php
  62. 181
      main/gradebook/lib/gradebook_functions.inc.php
  63. BIN
      main/img/icons/22/zoom_in.png
  64. BIN
      main/img/icons/22/zoom_out.png
  65. BIN
      main/img/icons/32/facebook.png
  66. BIN
      main/img/icons/32/shibboleth.png
  67. BIN
      main/img/icons/32/zoom_in.png
  68. BIN
      main/img/icons/32/zoom_out.png
  69. BIN
      main/img/icons/64/zoom_in.png
  70. BIN
      main/img/icons/64/zoom_out.png
  71. 27
      main/inc/global_error_message.inc.php
  72. 68
      main/inc/lib/add_course.lib.inc.php
  73. 13
      main/inc/lib/course.lib.php
  74. 2
      main/inc/lib/database.constants.inc.php
  75. 30
      main/inc/lib/database.lib.php
  76. 12
      main/inc/lib/database.mysqli.lib.php
  77. 77
      main/inc/lib/events.lib.inc.php
  78. 29
      main/inc/lib/template.lib.php
  79. 34
      main/install/db_main.sql
  80. 1
      main/install/db_stats.sql
  81. 1
      main/install/index.php
  82. 3
      main/install/install.lib.php
  83. 7
      main/install/install_db.inc.php
  84. 25
      main/install/migrate-db-1.8.8-1.9.0-pre.sql
  85. 25
      main/install/update-db-1.8.8-1.9.0.inc.php
  86. 5
      main/lang/bengali/accessibility.inc.php
  87. 5
      main/lang/bengali/admin.inc.php
  88. 5
      main/lang/bengali/agenda.inc.php
  89. 5
      main/lang/bengali/announcements.inc.php
  90. 5
      main/lang/bengali/blog.inc.php
  91. 5
      main/lang/bengali/chat.inc.php
  92. 5
      main/lang/bengali/course_description.inc.php
  93. 5
      main/lang/bengali/course_home.inc.php
  94. 5
      main/lang/bengali/course_info.inc.php
  95. 5
      main/lang/bengali/coursebackup.inc.php
  96. 5
      main/lang/bengali/courses.inc.php
  97. 5
      main/lang/bengali/create_course.inc.php
  98. 5
      main/lang/bengali/document.inc.php
  99. 5
      main/lang/bengali/dropbox.inc.php
  100. 5
      main/lang/bengali/exercice.inc.php
  101. Some files were not shown because too many files have changed in this diff Show More

@ -592,6 +592,8 @@ There are too much translators to list them all. Please check http://translate.c
<li>Erik Das (FKS), for bug reports to 1.8.8</li>
<li>Marc De Caluwé, for patches to 1.8.8.4</li>
<li>Alberto Montes, Contidos Dixitais, for CSS "sport_red" in 1.9</li>
<li>Bart Mollet, Hogeschool Gent, for patches in 1.6 &amp; 1.8</li>
<li>Kristof Van Steenkiste &amp; Sebastien Jacobs (initial Reservation plugin, 2007)</li>
<li>All the supporting parents, partners, children, friends, colleagues and sometimes students, of the very special geeks that we are, for their continous support and inspiration</li>
</ul>
@ -626,6 +628,7 @@ These institutions and companies have either contributed to the Chamilo project
<li>Table of contents<br />
now removed, replaced by learning path<br />
</li>
<li>Facultad de Matematicas, UADY (México) (original asynchronous Message plugin, was later dumped)</li>
</ul>
</div>
<br />

@ -1,15 +1,16 @@
Chamilo - elearning and course management software
Chamilo LMS - elearning and course management software
Copyright (c) 2008-2010 Dokeos Latinoamérica SAC / BeezNest Latino SAC
Copyright (c) 2004-2009 Dokeos SPRL
Copyright (c) 2008-2012 BeezNest Latino SAC, Peru & BeezNest Belgium SPRL, Belgium
Copyright (c) 2012 Université de Genève, Switzerland
Copyright (c) 2010-2012 Université de Grenoble, France
Copyright (c) 2011-2012 CBlue SPRL, Belgium
Copyright (c) Juan Carlos Raña (independent), Spain
Copyright (c) 2004-2009 Dokeos SPRL, Belgium
Copyright (c) 2003-2007 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
Copyright (c) 2001-2004 Universite catholique de Louvain (UCL)
Copyright (c) 2003-2008 Vrije Universiteit Brussel (VUB)
Copyright (c) 2004-2008 Hoogeschool Gent (HoGent)
Copyright (c) Bart Mollet, Hogeschool Gent
Copyright (c) Facultad de Matematicas, UADY (México) (Message plugin)
Copyright (c) Kristof Van Steenkiste & Sebastien Jacobs (Reservation plugin)
For a full list of contributors detaining copyrights over parts of
the Chamilo software, see "documentation/credits.html".

@ -6,7 +6,7 @@
*/
// Language files that need to be included.
$language_file = array('admin');
$language_file = array('admin', 'gradebook');
$cidReset = true;
require_once '../inc/global.inc.php';

@ -1230,16 +1230,6 @@ function generate_settings_form($settings, $settings_by_access_list) {
$form->addElement('select', $row['variable'], array(get_lang($row['title']), get_lang($row['comment'])), call_user_func('select_'.$row['variable']), $hideme);
$default_values[$row['variable']] = $row['selected_value'];
break;
case 'gradebook_ranking':
$value = explode('::', $row['selected_value']);
$form->addElement('text', 'gradebook_display['.$row['variable'].'][text]', array(get_lang($row['title']), get_lang($row['comment'])), array('class' => 'span1', 'value' => $value[0]), $hideme);
$form->addElement('text', 'gradebook_display['.$row['variable'].'][score]', array(get_lang($row['title']), get_lang($row['comment'])), array('class' => 'span3','value' => $value[1]), $hideme);
$renderer = $form -> defaultRenderer();
$renderer->setElementTemplate(' {label}<div class="controls"> {element} %= ', 'gradebook_display['.$row['variable'].'][text]');
$renderer->setElementTemplate(' {element}</div><br />', 'gradebook_display['.$row['variable'].'][score]');
break;
case 'custom':
break;
}

@ -179,14 +179,6 @@ if (!empty($_GET['category']) && !in_array($_GET['category'], array('Plugins', '
foreach ($values as $key => $value) {
if (in_array($key, $settings_to_avoid)) { continue; }
//Gradebook fix
if ($key == 'gradebook_display') {
foreach ($value as $new_key => $item) {
$final_value = $item['text'].'::'.$item['score'];
$result = api_set_setting($new_key, $final_value, 'ranking', null, $_configuration['access_url']);
}
}
//
// Treat gradebook values in separate function.
//if (strpos($key, 'gradebook_score_display_custom_values') === false) {
@ -320,6 +312,8 @@ $action_images['search'] = 'search.png';
$action_images['stylesheets'] = 'stylesheets.png';
$action_images['templates'] = 'template.png';
$action_images['plugins'] = 'plugins.png';
$action_images['shibboleth'] = 'shibboleth.png';
$action_images['facebook'] = 'facebook.png';
// Grabbing the categories.
$resultcategories = api_get_settings_categories(array('stylesheets', 'Plugins', 'Templates', 'Search'));

@ -9,18 +9,38 @@ require_once(api_get_path(SYS_PATH).'main/auth/cas/cas_var.inc.php');
require_once(api_get_path(SYS_PATH).'main/auth/external_login/ldap.inc.php');
require_once(api_get_path(SYS_PATH).'main/auth/external_login/functions.inc.php');
/**
* @return true if cas is configured
*
**/
function cas_configured() {
global $cas_auth_ver, $cas_auth_server, $cas_auth_port, $cas_auth_uri;
$res = false;
if (!empty($cas_auth_ver) && !empty($cas_auth_server) && !empty($cas_auth_port)) {
$res = true;
}
return $res;
}
/**
* checks if the user already get a session
* @return the user login if the user already has a session ,false otherwise
**/
function cas_is_authenticated()
{
global $cas_auth_ver, $cas_auth_server, $cas_auth_port, $cas_auth_uri;
global $PHPCAS_CLIENT;
global $logout;
if (!cas_configured()) {
return;
}
if (!is_object($PHPCAS_CLIENT) )
{

@ -16,9 +16,15 @@ require_once (api_get_path(LIBRARY_PATH).'events.lib.inc.php');
require_once('authcas.php');
global $cas_auth_ver, $cas_auth_server, $cas_auth_port, $cas_auth_uri;
// phpCAS
if (!is_object($PHPCAS_CLIENT) ) {
phpCAS::client($cas_auth_ver,$cas_auth_server,$cas_auth_port,$cas_auth_uri);
phpCAS::setNoCasServerValidation();
if (cas_configured()) {
if (!is_object($PHPCAS_CLIENT) ) {
phpCAS::client($cas_auth_ver,$cas_auth_server,$cas_auth_port,$cas_auth_uri);
phpCAS::setNoCasServerValidation();
}
phpCAS::forceAuthentication();
header('Location: '.api_get_path(WEB_PATH).api_get_setting('page_after_login'));
}
else {
header('Location: '.api_get_path(WEB_PATH));
}
phpCAS::forceAuthentication();
header('Location: '.api_get_path(WEB_PATH).api_get_setting('page_after_login'));

@ -326,19 +326,11 @@ form span.form_error {
background:#F8F8F8;
border-bottom:1px solid #4171b5;
border-top:1px solid #4171b5;
height:29px;
padding-left: -17px;
margin: 5px 2px 1px 12px;
vertical-align:middle;
width: 90%;
height:29px;
}
.actions_lp img {
vertical-align:middle;
}
.actions_lp a {
margin-right: 10px;
vertical-align:middle;
}
.actions_lp span {
margin-right: 10px;
vertical-align:middle;

@ -20,8 +20,6 @@
overflow: auto;
background-color: white;
height: 210px;
width: 94%;
border-left: 10px #FFF solid;
}
.inner_lp_toc .scorm_item {
font-size: 11px;

@ -306,20 +306,12 @@ form span.form_error {
background-color:#FDDEAA;
border-bottom:1px solid #EE4C03;
border-top:1px solid #EE4C03;
height:29px;
padding-left: -17px;
margin-bottom: 1px;
vertical-align:middle;
width: 90%;
margin-left:17px;
height:29px;
margin-bottom: 1px;
}
.actions_lp img {
vertical-align:middle;
}
.actions_lp a {
margin-right: 10px;
vertical-align:middle;
}
.actions_lp span {
margin-right: 10px;
vertical-align:middle;

@ -19,9 +19,7 @@
.inner_lp_toc {
overflow: auto;
background-color: white;
height: 210px;
width: 96%;
border-left: 10px #FFF solid;
height: 210px;
}
.inner_lp_toc .scorm_item {
font-size: 11px;

@ -3457,12 +3457,12 @@ a.forum_group_link {
/* actions */
.actions_lp {
background:#F8F8F8;
height: 40px;
padding-left: -17px;
margin: 5px 2px 1px 12px;
vertical-align:middle;
width: 90%;
background:#F8F8F8;
margin: 0px;
padding:9px 0px 9px 0px;
width:100%;
text-align: center;
}
.actions_lp .btn-group {
margin-left: 25px;
@ -3644,7 +3644,169 @@ footer {
background-image: -webkit-linear-gradient(top, #F5F5F5 0%, #EEEEEE 100%); /* Chrome 10+,Safari 5.1+ */
background-image: -ms-linear-gradient(top, #F5F5F5 0%,#EEEEEE 100%); /* IE10+ */
background-image: -o-linear-gradient(top, #F5F5F5 0%,#EEEEEE 100%); /* Opera 11.10+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#F5F5F5', endColorstr='#EEEEEE',GradientType=0 ); /* IE6-9 */
/* Fixes bug in ie8 */
/* filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#F5F5F5', endColorstr='#EEEEEE',GradientType=0 ); */ /* IE6-9 */
background-image: linear-gradient(top, #F5F5F5 0%, #EEEEEE 100%); /* W3C */
}
/* Default LP left column values */
#learning_path_left_zone {
float:left;
width:280px;
height:100%;
padding-left: 8px;
padding-right: 4px;
}
#learning_path_left_zone #header {
font-size:14px;
}
#author_icon {
float:left;
}
#lp_navigation_elem {
float:left;
}
#author_image {
border: 1px solid #CCCCCC;
float: left;
margin: 0;
padding: 8px;
position: relative;
width: 94%;
}
#author_name {
float: left;
text-align:center;
width: 100%;
font-size: 11px;
color: #888;
margin-top: 2px;
}
#learning_path_toc {
font-size:9pt;
margin:0;
}
#scorm_title {
background: none repeat scroll 0 0 #EEEEEE;
color: #444444;
font-size: 16px;
font-weight: bold;
padding: 1px 5px 3px 8px;
}
.progresstext {
text-align: center;
}
.inner_lp_toc {
overflow: auto;
background-color: white;
height: 210px;
}
.inner_lp_toc .scorm_item a {
font-weight: bold;
font-size: 14px;
margin-right: 1px;
padding-bottom: 2px;
text-decoration: none;
color: #2F3E46;
}
.inner_lp_toc .scorm_item a.chapter_module {
font-weight: normal;
margin-right: 10px;
}
.inner_lp_toc .scorm_item_highlight {
border: 1px solid #999;
background:#999;
font-weight:bold;
text-shadow:0 -1px 1px #666;
background-image:-webkit-gradient(linear,left top,left bottom,from(#666),to(#999));
background-image:-webkit-linear-gradient(top,#666,#999);
background-image:-moz-linear-gradient(top,#666,#999);
background-image:-ms-linear-gradient(top,#666,#999);
background-image:-o-linear-gradient(top,#666,#999);
background-image:linear-gradient(top,#666,#999);
margin-right: 0px;
padding: 10px 0px 10px 0px;
text-decoration: none;
}
.inner_lp_toc .scorm_item_highlight a {
color:#fff;
margin-right: 1px;
text-decoration: none;
font-weight: bold;
}
.inner_lp_toc .scorm_item_section {
border:1px solid #222;
background:#333;
font-weight:bold;
color:#fff;
text-shadow:0 -1px 1px #000;
background-image:-webkit-gradient(linear,left top,left bottom,from(#555),to(#333));
background-image:-webkit-linear-gradient(top,#555,#333);
background-image:-moz-linear-gradient(top,#555,#333);
background-image:-ms-linear-gradient(top,#555,#333);
background-image:-o-linear-gradient(top,#555,#333);
background-image:linear-gradient(top,#555,#333);
margin-right: 1px;
padding: 10px 0px 10px 0px;
text-decoration: none;
}
.inner_lp_toc .scorm_item {
font-size: 16px;
margin-left: 10px;
margin-right:10px;
text-decoration: none;
border-color: rgba(255, 255, 255, 0.3);
}
.inner_lp_toc .scorm_item_1 {
border-bottom: 1px solid #CCCCCC;
background:#eee;
font-weight:bold;
color:#444;
text-shadow:0 1px 1px #f6f6f6;
background-image:-webkit-gradient(linear,left top,left bottom,from(#fdfdfd),to(#eee));
background-image:-webkit-linear-gradient(top,#fdfdfd,#eee);
background-image:-moz-linear-gradient(top,#fdfdfd,#eee);
background-image:-ms-linear-gradient(top,#fdfdfd,#eee);
background-image:-o-linear-gradient(top,#fdfdfd,#eee);
background-image:linear-gradient(top,#fdfdfd,#eee);
margin-right: 1px;
padding: 10px 0px 10px 0px;
text-decoration: none;
font-weight: normal;
/* background:#FDFDFD; */
}
.inner_lp_toc .scorm_item_2 {
background-image:-webkit-gradient(linear,left top,left bottom,from(#fdfdfd),to(#eee));
background-image:-webkit-linear-gradient(top,#fdfdfd,#eee);
background-image:-moz-linear-gradient(top,#fdfdfd,#eee);
background-image:-ms-linear-gradient(top,#fdfdfd,#eee);
background-image:-o-linear-gradient(top,#fdfdfd,#eee);
background-image:linear-gradient(top,#fdfdfd,#eee);
border-bottom: 1px solid #CCCCCC;
color: #444444;
font-weight: bold;
text-shadow: 0 1px 1px #F6F6F6;
margin-right: 1px;
padding: 10px 0px 10px 0px;
text-decoration: none;
font-weight: normal;
}

@ -186,56 +186,6 @@ a.invisible:link, a.invisible:visited {
line-height: 0px;
height: 0;
}
input.link_alike {
background-color: #FFFFFF;
border-width: 0px;
color: #4171b5;
font-weight: bold;
text-align: left;
padding: 0px;
margin: 0px;
-moz-border-radius-bottomleft:5px;
-moz-border-radius-bottomright:5px;
-moz-border-radius-topleft:5px;
-moz-border-radius-topright:5px;
border:1px solid #E1E1E0;
}
input.link_alike:hover {
background-color: #FFFFFF;
border-width: 0px;
color: #f3840d;
font-weight: bold;
text-align: left;
padding: 0px;
margin: 0px;
-moz-border-radius-bottomleft:5px;
-moz-border-radius-bottomright:5px;
-moz-border-radius-topleft:5px;
-moz-border-radius-topright:5px;
border:1px solid #E1E1E0;
}
/*****************************************************
* HEADER STYLES *
*****************************************************/
#header {
}
/********************************************************
* HEADER 1: Title, portal, organisation, course title *
********************************************************/
#header1 a {
font-size:12px;
font-weight:normal;
color: #666666;
text-decoration: none;
}
#header1 a:hover {
text-decoration: underline;
}
#sitename {
margin: 0;
}
@ -1809,10 +1759,6 @@ span.form_required {
cursor: pointer;
}
.progresstext {
text-align:center;
}
/* tips Abbr-plugin for FCKeditor */
abbr {
border-bottom: 1px dotted rgb(102, 102, 102);

@ -2055,19 +2055,11 @@ div.comments {
/* actions */
.actions_lp {
background:#F8F8F8;
height:29px;
padding-left: -17px;
margin: 5px 2px 1px 12px;
vertical-align:middle;
width: 90%;
height:29px;
}
.actions_lp img {
vertical-align:middle;
}
.actions_lp a {
margin-right: 10px;
vertical-align:middle;
}
.actions_lp span {
margin-right: 10px;
vertical-align:middle;

@ -19,16 +19,12 @@
.inner_lp_toc {
overflow: auto;
background-color: white;
height: 210px;
width: 94%;
border-left: 10px #FFF solid;
height: 210px;
}
.inner_lp_toc .scorm_item {
font-size: 11px;
margin-left: 10px;
margin-right:10px;
//it was 20px padding-bottom: 2px;
text-decoration: none;
margin-right:10px;
}
.inner_lp_toc .scorm_item A {
font-size: 11px;

@ -60,7 +60,7 @@ a:active {
/*****************************************************
* FOOTER STYLES *
*****************************************************/
footer {
footer {
background-color: #037fb2;
background-image: url(images/bg-footer.gif);
background-repeat:repeat-x;

@ -16,25 +16,23 @@
width: 99%;
border-right: 1px none;
}
.inner_lp_toc {
overflow: auto;
background-color: white;
height: 210px;
width: 94%;
border-left: 5px #FFF solid;
height: 210px;
}
.inner_lp_toc .scorm_item a {
font-weight: bold;
/* text-shadow: 0 1px 1px #F6F6F6; */
font-size: 14px;
margin-right: 1px;
padding-bottom: 2px;
text-decoration: none;
font-family: Helvetica,Arial,sans-serif;
color: #2F3E46;
font-family: Helvetica,Arial,sans-serif;
color: #2F3E46;
}
.inner_lp_toc .scorm_item a.chapter_module {
font-weight: normal;
margin-right: 10px;
@ -50,12 +48,12 @@
background-image:-moz-linear-gradient(top,#72b0d4,#4b88b6);
background-image:-ms-linear-gradient(top,#72b0d4,#4b88b6);
background-image:-o-linear-gradient(top,#72b0d4,#4b88b6);
background-image:linear-gradient(top,#72b0d4,#4b88b6)
margin-right: 1px;
background-image:linear-gradient(top,#72b0d4,#4b88b6);
margin-right: 0px;
padding: 10px 0px 10px 0px;
text-decoration: none;
}
.inner_lp_toc .scorm_item_highlight a {
color:#fff;
margin-right: 1px;
@ -76,7 +74,7 @@
background-image:-o-linear-gradient(top,#555,#333);
background-image:linear-gradient(top,#555,#333);
margin-right: 1px;
margin-right: 1px;
padding: 10px 0px 10px 0px;
text-decoration: none;
@ -110,27 +108,23 @@
/* background:#FDFDFD; */
}
.inner_lp_toc .scorm_item_2 {
.inner_lp_toc .scorm_item_2 {
background-image:-webkit-gradient(linear,left top,left bottom,from(#fdfdfd),to(#eee));
background-image:-webkit-linear-gradient(top,#fdfdfd,#eee);
background-image:-moz-linear-gradient(top,#fdfdfd,#eee);
background-image:-ms-linear-gradient(top,#fdfdfd,#eee);
background-image:-o-linear-gradient(top,#fdfdfd,#eee);
background-image:linear-gradient(top,#fdfdfd,#eee);
background-image:linear-gradient(top,#fdfdfd,#eee);
border-bottom: 1px solid #CCCCCC;
color: #444444;
font-weight: bold;
text-shadow: 0 1px 1px #F6F6F6;
margin-right: 1px;
padding: 10px 0px 10px 0px;
text-decoration: none;
font-weight: normal;
}
.inner_lp_toc .scorm_title {
font-weight: bold;
background:#ccc;
@ -164,8 +158,6 @@
/*.scormpage .menu */
.lp_navigation_elem .progresstext {
margin-top: -20px;
// margin-left: 40%;
//em font-size: normal;
}
/*.scormpage .menu */
.lp_navigation_elem .buttons {
@ -206,12 +198,6 @@
#image_preview {
padding-left: 17px;
}
#author_name {
padding-left: 5px;
padding-top: 5px;
font-size: 11px;
color:#888;
}
#msg_div_id {
padding-left: 17px;
padding-top: 4px;

@ -19,16 +19,12 @@
.inner_lp_toc {
overflow: auto;
background-color: white;
height: 210px;
width: 94%;
border-left: 10px #FFF solid;
height: 210px;
}
.inner_lp_toc .scorm_item {
font-size: 11px;
margin-left: 10px;
margin-right:10px;
//cambiado era 20 padding-bottom: 2px;
text-decoration: none;
}
.inner_lp_toc .scorm_item A {
font-size: 11px;

@ -19,16 +19,12 @@
.inner_lp_toc {
overflow: auto;
background-color: white;
height: 210px;
width: 94%;
border-left: 10px #FFF solid;
height: 210px;
}
.inner_lp_toc .scorm_item {
font-size: 11px;
margin-left: 10px;
margin-right:10px;
//cambiado era 20 padding-bottom: 2px;
text-decoration: none;
}
.inner_lp_toc .scorm_item A {
font-size: 11px;

@ -19,15 +19,12 @@
.inner_lp_toc {
overflow: auto;
background-color: white;
height: 210px;
width: 94%;
border-left: 10px #FFF solid;
height: 210px;
}
.inner_lp_toc .scorm_item {
font-size: 11px;
margin-left: 10px;
margin-right:10px;
//cambiado era 20 padding-bottom: 2px;
text-decoration: none;
}
.inner_lp_toc .scorm_item A {

@ -20,14 +20,11 @@
overflow: auto;
background-color: white;
height: 210px;
width: 94%;
border-left: 10px #FFF solid;
}
.inner_lp_toc .scorm_item {
font-size: 11px;
margin-left: 10px;
margin-right:10px;
//cambiado era 20 padding-bottom: 2px;
text-decoration: none;
}
.inner_lp_toc .scorm_item A {

@ -19,15 +19,12 @@
.inner_lp_toc {
overflow: auto;
background-color: white;
height: 210px;
width: 94%;
border-left: 10px #FFF solid;
height: 210px;
}
.inner_lp_toc .scorm_item {
font-size: 11px;
margin-left: 10px;
margin-right:10px;
//cambiado era 20 padding-bottom: 2px;
text-decoration: none;
}
.inner_lp_toc .scorm_item A {
@ -79,8 +76,6 @@
}
.inner_lp_toc .scorm_title_text {
margin-left: 10px;
//padding: 2px;
//cambiado no existe
}
.inner_lp_toc .scorm_status_img {
margin:0px;
@ -105,9 +100,7 @@
}
/*.scormpage .menu */
.lp_navigation_elem .progresstext {
margin-top: -20px;
//margin-left: 40%;
//em font-size: normal;
margin-top: -20px;
}
/*.scormpage .menu */
.lp_navigation_elem .buttons {

@ -2003,19 +2003,11 @@ div.comments {
/* actions */
.actions_lp {
background:#F8F8F8;
height:29px;
padding-left: -17px;
margin: 5px 2px 1px 12px;
vertical-align:middle;
width: 90%;
height:29px;
}
.actions_lp img {
vertical-align:middle;
}
.actions_lp a {
margin-right: 10px;
vertical-align:middle;
}
.actions_lp span {
margin-right: 10px;
vertical-align:middle;

@ -19,15 +19,12 @@
.inner_lp_toc {
overflow: auto;
background-color: white;
height: 210px;
width: 94%;
border-left: 10px #FFF solid;
height: 210px;
}
.inner_lp_toc .scorm_item {
font-size: 11px;
margin-left: 10px;
margin-right:10px;
//cambiado era 20 padding-bottom: 2px;
text-decoration: none;
}
.inner_lp_toc .scorm_item A {
@ -107,7 +104,6 @@
.lp_navigation_elem .progresstext {
margin-top: -20px;
margin-left: 40%;
//em font-size: normal;
}
/*.scormpage .menu */
.lp_navigation_elem .buttons {

@ -415,19 +415,11 @@ ul#navigation .help a{
/* actions */
.actions_lp {
background:#F8F8F8;
height:29px;
padding-left: -17px;
margin: 5px 2px 1px 12px;
vertical-align:middle;
width: 90%;
height:29px;
}
.actions_lp img {
vertical-align:middle;
}
.actions_lp a {
margin-right: 10px;
vertical-align:middle;
}
.actions_lp span {
margin-right: 10px;
vertical-align:middle;

@ -19,9 +19,7 @@
.inner_lp_toc {
overflow: auto;
background-color: white;
height: 210px;
width: 94%;
border-left: 10px #FFF solid;
height: 210px;
}
.inner_lp_toc .scorm_item {
font-size: 11px;

@ -352,19 +352,11 @@ form span.form_error {
/* actions */
.actions_lp {
background:#F8F8F8;
height:29px;
padding-left: -17px;
margin: 5px 2px 1px 12px;
vertical-align:middle;
width: 90%;
height:29px;
}
.actions_lp img {
vertical-align:middle;
}
.actions_lp a {
margin-right: 10px;
vertical-align:middle;
}
.actions_lp span {
margin-right: 10px;
vertical-align:middle;

@ -19,9 +19,7 @@
.inner_lp_toc {
overflow: auto;
background-color: white;
height: 210px;
width: 94%;
border-left: 10px #FFF solid;
height: 210px;
}
.inner_lp_toc .scorm_item {
font-size: 11px;

@ -16,8 +16,6 @@ body {
background-color: #fff;
height: 100%; /* stick */
}
/*
-----------------------------------------------------------------------------
Side-Menu Slider (JQuery) see banner.inc.php
@ -2017,19 +2015,11 @@ div.comments {
/* actions */
.actions_lp {
background:#F8F8F8;
height:29px;
padding-left: -17px;
margin: 5px 2px 1px 12px;
vertical-align:middle;
width: 90%;
height:29px;
}
.actions_lp img {
vertical-align:middle;
}
.actions_lp a {
margin-right: 10px;
vertical-align:middle;
}
.actions_lp span {
margin-right: 10px;
vertical-align:middle;

@ -19,15 +19,12 @@
.inner_lp_toc {
overflow: auto;
background-color: white;
height: 210px;
width: 94%;
border-left: 10px #FFF solid;
height: 210px;
}
.inner_lp_toc .scorm_item {
font-size: 11px;
margin-left: 10px;
margin-right:10px;
//cambiado era 20 padding-bottom: 2px;
text-decoration: none;
}
.inner_lp_toc .scorm_item A {
@ -78,9 +75,7 @@
color: #444;
}
.inner_lp_toc .scorm_title_text {
margin-left: 10px;
//padding: 2px;
//cambiado no existe
margin-left: 10px;
}
.inner_lp_toc .scorm_status_img {
margin:0px;
@ -107,7 +102,6 @@
.lp_navigation_elem .progresstext {
margin-top: -20px;
margin-left: 40%;
//em font-size: normal;
}
/*.scormpage .menu */
.lp_navigation_elem .buttons {

@ -2025,19 +2025,11 @@ div.comments {
/* actions */
.actions_lp {
background:#F8F8F8;
height:29px;
padding-left: -17px;
margin: 5px 2px 1px 12px;
vertical-align:middle;
width: 90%;
height:29px;
}
.actions_lp img {
vertical-align:middle;
}
.actions_lp a {
margin-right: 10px;
vertical-align:middle;
}
.actions_lp span {
margin-right: 10px;
vertical-align:middle;

@ -19,15 +19,12 @@
.inner_lp_toc {
overflow: auto;
background-color: white;
height: 210px;
width: 94%;
border-left: 10px #FFF solid;
height: 210px;
}
.inner_lp_toc .scorm_item {
font-size: 11px;
margin-left: 10px;
margin-right:10px;
//cambiado era 20 padding-bottom: 2px;
text-decoration: none;
}
.inner_lp_toc .scorm_item A {
@ -107,7 +104,6 @@
.lp_navigation_elem .progresstext {
margin-top: -20px;
margin-left: 40%;
//em font-size: normal;
}
/*.scormpage .menu */
.lp_navigation_elem .buttons {

@ -1897,22 +1897,12 @@ padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;}
}
/* actions */
.actions_lp {
background:#F8F8F8;
//border-bottom:1px solid #999999;
//border-top:1px solid #999999;
height:29px;
padding-left: -17px;
margin: 5px 2px 1px 12px;
vertical-align:middle;
width: 90%;
background:#F8F8F8;
height:29px;
}
.actions_lp img {
vertical-align:middle;
}
.actions_lp a {
margin-right: 10px;
vertical-align:middle;
}
.actions_lp span {
margin-right: 10px;
vertical-align:middle;

@ -19,9 +19,7 @@
.inner_lp_toc {
overflow: auto;
background-color: white;
height: 210px;
width: 94%;
border-left: 10px #FFF solid;
height: 210px;
}
.inner_lp_toc .scorm_item {
font-size: 11px;
@ -105,7 +103,6 @@
.lp_navigation_elem .progresstext {
margin-top: -20px;
margin-left: 40%;
//em font-size: normal;
}
/*.scormpage .menu */
.lp_navigation_elem .buttons {

@ -2017,21 +2017,11 @@ input.forms {
/* actions */
.actions_lp {
background:#F8F8F8;
/*border-bottom:1px solid #999999; */
/*border-top:1px solid #999999; */
height:29px;
padding-left: -17px;
margin: 5px 2px 1px 12px;
vertical-align:middle;
width: 90%;
height:29px;
}
.actions_lp img {
vertical-align:middle;
}
.actions_lp a {
margin-right: 10px;
vertical-align:middle;
}
.actions_lp span {
margin-right: 10px;
vertical-align:middle;

@ -19,9 +19,7 @@
.inner_lp_toc {
overflow: auto;
background-color: white;
height: 210px;
width: 94%;
border-left: 10px #FFF solid;
height: 210px;
}
.inner_lp_toc .scorm_item {
font-size: 11px;

@ -2013,19 +2013,11 @@ div.comments {
/* actions */
.actions_lp {
background:#F8F8F8;
height:29px;
padding-left: -17px;
margin: 5px 2px 1px 12px;
vertical-align:middle;
width: 90%;
height:29px;
}
.actions_lp img {
vertical-align:middle;
}
.actions_lp a {
margin-right: 10px;
vertical-align:middle;
}
.actions_lp span {
margin-right: 10px;
vertical-align:middle;

@ -19,15 +19,12 @@
.inner_lp_toc {
overflow: auto;
background-color: white;
height: 210px;
width: 94%;
border-left: 10px #FFF solid;
height: 210px;
}
.inner_lp_toc .scorm_item {
font-size: 11px;
margin-left: 10px;
margin-right:10px;
//cambiado era 20 padding-bottom: 2px;
text-decoration: none;
}
.inner_lp_toc .scorm_item A {
@ -79,9 +76,7 @@
}
.inner_lp_toc .scorm_title_text {
margin-left: 10px;
//padding: 2px;
//cambiado no existe
}
}
.inner_lp_toc .scorm_status_img {
margin:0px;
margin-left: -10px;
@ -107,7 +102,6 @@
.lp_navigation_elem .progresstext {
margin-top: -20px;
margin-left: 40%;
//em font-size: normal;
}
/*.scormpage .menu */
.lp_navigation_elem .buttons {

@ -2021,19 +2021,11 @@ div.comments {
/* actions */
.actions_lp {
background:#F8F8F8;
height:29px;
padding-left: -17px;
margin: 5px 2px 1px 12px;
vertical-align:middle;
width: 90%;
height:29px;
}
.actions_lp img {
vertical-align:middle;
}
.actions_lp a {
margin-right: 10px;
vertical-align:middle;
}
.actions_lp span {
margin-right: 10px;
vertical-align:middle;

@ -19,15 +19,12 @@
.inner_lp_toc {
overflow: auto;
background-color: white;
height: 210px;
width: 94%;
border-left: 10px #FFF solid;
height: 210px;
}
.inner_lp_toc .scorm_item {
font-size: 11px;
margin-left: 10px;
margin-right:10px;
//cambiado era 20 padding-bottom: 2px;
text-decoration: none;
}
.inner_lp_toc .scorm_item A {
@ -107,7 +104,6 @@
.lp_navigation_elem .progresstext {
margin-top: -20px;
margin-left: 40%;
//em font-size: normal;
}
/*.scormpage .menu */
.lp_navigation_elem .buttons {

@ -1970,11 +1970,7 @@ padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;}
/* actions */
.actions_lp {
background:#F8F8F8;
height:29px;
padding-left: -17px;
margin: 5px 2px 1px 12px;
vertical-align:middle;
width: 90%;
height:29px;
}
.actions_lp img {
vertical-align:middle;

@ -20,8 +20,6 @@
overflow: auto;
background-color: white;
height: 210px;
width: 94%;
border-left: 10px #FFF solid;
}
.inner_lp_toc .scorm_item {
font-size: 11px;

@ -1746,19 +1746,11 @@ padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;}
/* actions */
.actions_lp {
background:#F8F8F8;
height:29px;
padding-left: -17px;
margin: 5px 2px 1px 12px;
vertical-align:middle;
width: 90%;
height:29px;
}
.actions_lp img {
vertical-align:middle;
}
.actions_lp a {
margin-right: 10px;
vertical-align:middle;
}
.actions_lp span {
margin-right: 10px;
vertical-align:middle;

@ -20,14 +20,11 @@
overflow: auto;
background-color: white;
height: 210px;
width: 94%;
border-left: 10px #FFF solid;
}
.inner_lp_toc .scorm_item {
font-size: 11px;
margin-left: 10px;
margin-right:10px;
//cambiado era 20 padding-bottom: 2px;
text-decoration: none;
}
.inner_lp_toc .scorm_item A {
@ -102,7 +99,6 @@
.lp_navigation_elem .progresstext {
margin-top: -20px;
margin-left: 40%;
//em font-size: normal;
}
/*.scormpage .menu */
.lp_navigation_elem .buttons {

@ -1973,19 +1973,11 @@ div.comments {
/* actions */
.actions_lp {
background:#F8F8F8;
height:29px;
padding-left: -17px;
margin: 5px 2px 1px 12px;
vertical-align:middle;
width: 90%;
height:29px;
}
.actions_lp img {
vertical-align:middle;
}
.actions_lp a {
margin-right: 10px;
vertical-align:middle;
}
.actions_lp span {
margin-right: 10px;
vertical-align:middle;

@ -19,15 +19,12 @@
.inner_lp_toc {
overflow: auto;
background-color: white;
height: 210px;
width: 94%;
border-left: 10px #FFF solid;
height: 210px;
}
.inner_lp_toc .scorm_item {
font-size: 11px;
margin-left: 10px;
margin-right:10px;
//cambiado era 20 padding-bottom: 2px;
text-decoration: none;
}
.inner_lp_toc .scorm_item A {
@ -107,7 +104,6 @@
.lp_navigation_elem .progresstext {
margin-top: -20px;
margin-left: 40%;
//em font-size: normal;
}
/*.scormpage .menu */
.lp_navigation_elem .buttons {

@ -1467,20 +1467,11 @@ div.system_announcement {
/* actions */
.actions_lp {
background:#F8F8F8;
height:29px;
padding-left: -17px;
margin-bottom: 1px;
vertical-align:middle;
width: 90%;
margin-left:17px;
height:29px;
}
.actions_lp img {
vertical-align:middle;
}
.actions_lp a {
margin-right: 10px;
vertical-align:middle;
}
.actions_lp span {
margin-right: 10px;
vertical-align:middle;

@ -19,9 +19,7 @@
.inner_lp_toc {
overflow: auto;
background-color: white;
height: 210px;
width: 94%;
border-left: 10px #FFF solid;
height: 210px;
}
.inner_lp_toc .scorm_item {
font-size: 11px;

@ -1686,21 +1686,11 @@ padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;}
/* actions */
.actions_lp {
background:#F8F8F8;
//border-bottom:1px solid #999999;
//border-top:1px solid #999999;
height:29px;
padding-left: -17px;
margin: 5px 2px 1px 12px;
vertical-align:middle;
width: 90%;
height:29px;
}
.actions_lp img {
vertical-align:middle;
}
.actions_lp a {
margin-right: 10px;
vertical-align:middle;
}
.actions_lp span {
margin-right: 10px;
vertical-align:middle;

@ -19,9 +19,7 @@
.inner_lp_toc {
overflow: auto;
background-color: white;
height: 210px;
width: 94%;
border-left: 10px #FFF solid;
height: 210px;
}
.inner_lp_toc .scorm_item {
font-size: 11px;

@ -1946,19 +1946,11 @@ div.comments {
/* actions */
.actions_lp {
background:#F8F8F8;
height:29px;
padding-left: -17px;
margin: 5px 2px 1px 12px;
vertical-align:middle;
width: 90%;
height:29px;
}
.actions_lp img {
vertical-align:middle;
}
.actions_lp a {
margin-right: 10px;
vertical-align:middle;
}
.actions_lp span {
margin-right: 10px;
vertical-align:middle;

@ -19,15 +19,12 @@
.inner_lp_toc {
overflow: auto;
background-color: white;
height: 210px;
width: 94%;
border-left: 10px #FFF solid;
height: 210px;
}
.inner_lp_toc .scorm_item {
font-size: 11px;
margin-left: 10px;
margin-right:10px;
//cambiado era 20 padding-bottom: 2px;
text-decoration: none;
}
.inner_lp_toc .scorm_item A {
@ -107,7 +104,6 @@
.lp_navigation_elem .progresstext {
margin-top: -20px;
margin-left: 40%;
//em font-size: normal;
}
/*.scormpage .menu */
.lp_navigation_elem .buttons {

@ -1333,7 +1333,7 @@ function get_all_exercises_for_course_id($course_info = null, $session_id = 0, $
* @param int session id
* @return int the position of the user between his friends in a course (or course within a session)
*/
function get_exercise_result_ranking($my_score, $my_exe_id, $exercise_id, $course_code, $session_id = 0, $user_list, $return_string = true) {
function get_exercise_result_ranking($my_score, $my_exe_id, $exercise_id, $course_code, $session_id = 0, $user_list = array(), $return_string = true) {
//No score given we return
if (is_null($my_score)) {
return '-';
@ -1341,9 +1341,9 @@ function get_exercise_result_ranking($my_score, $my_exe_id, $exercise_id, $cours
if (empty($user_list)) {
return '-';
}
$best_attempts = array();
foreach($user_list as $user_data) {
$best_attempts = array();
foreach ($user_list as $user_data) {
$user_id = $user_data['user_id'];
$best_attempts[$user_id]= get_best_attempt_by_user($user_id, $exercise_id, $course_code, $session_id);
}
@ -1364,7 +1364,7 @@ function get_exercise_result_ranking($my_score, $my_exe_id, $exercise_id, $cours
asort($my_ranking);
$position = count($my_ranking);
if (!empty($my_ranking)) {
foreach($my_ranking as $user_id => $ranking) {
foreach ($my_ranking as $user_id => $ranking) {
if ($my_score >= $ranking) {
if ($my_score == $ranking) {
$exe_id = $best_attempts[$user_id]['exe_id'];

@ -27,13 +27,19 @@ if ($form->validate()) {
$eval->set_user_id($values['hid_user_id']);
$eval->set_course_code($values['hid_course_code']);
$eval->set_category_id($values['hid_category_id']);
$parent_cat = Category :: load($values['hid_category_id']);
$cat = Category :: load($parent_cat[0]->get_parent_id());
$global_weight = $cat[0] -> get_weight();
$values['weight'] = $values['weight_mask']/$global_weight*$parent_cat[0]->get_weight();
$eval->set_weight($values['weight']);
$parent_cat = Category :: load($values['hid_category_id']);
$final_weight = null;
if ($parent_cat[0]->get_parent_id() == 0) {
$final_weight = $values['weight_mask'];
} else {
$cat = Category :: load($parent_cat[0]->get_parent_id());
$global_weight = $cat[0]->get_weight();
$final_weight = $values['weight_mask']/$global_weight*$parent_cat[0]->get_weight();
}
$eval->set_weight($final_weight);
$eval->set_max($values['max']);
if (empty ($values['visible'])) {

@ -34,10 +34,17 @@ $form = new LinkAddEditForm(LinkAddEditForm :: TYPE_EDIT, $cats, null, $link, 'e
if ($form->validate()) {
$values = $form->exportValues();
$parent_cat = Category :: load($values['select_gradebook']);
$cat = Category :: load($parent_cat[0]->get_parent_id());
$global_weight = $cat[0]->get_weight();
$values['weight'] = $values['weight_mask']/$global_weight*$parent_cat[0]->get_weight();
$link->set_weight($values['weight']);
$final_weight = null;
if ($parent_cat[0]->get_parent_id() == 0) {
$final_weight = $values['weight_mask'];
} else {
$cat = Category :: load($parent_cat[0]->get_parent_id());
$global_weight = $cat[0]->get_weight();
$final_weight = $values['weight_mask']/$global_weight*$parent_cat[0]->get_weight();
}
$link->set_weight($final_weight);
if (!empty($values['select_gradebook'])) {
$link->set_category_id($values['select_gradebook']);

@ -107,152 +107,9 @@ if (isset($_GET['exportpdf'])) {
$export_pdf_form = new DataForm(DataForm::TYPE_EXPORT_PDF, 'export_pdf_form', null, api_get_self().'?exportpdf=&offset='.intval($_GET['offset']).'&selectcat='.intval($_GET['selectcat']), '_blank', '');
if ($export_pdf_form->validate()) {
// Beginning of PDF report creation
$printable_data = get_printable_data($cat[0], $users, $alleval, $alllinks);
$export = $export_pdf_form->exportValues();
// Reading report's CSS
//$css_file = api_get_path(TO_SYS, WEB_CSS_PATH).api_get_setting('stylesheets').'/print.css';
$css_file = api_get_path(SYS_CODE_PATH).'gradebook/print.css';
$css = file_exists($css_file) ? @file_get_contents($css_file) : '';
// HTML report creation first
$time = time();
$course_code = trim($cat[0]->get_course_code());
$organization = api_get_setting('Institution');
$displayscore = ScoreDisplay :: instance();
$customdisplays = $displayscore->get_custom_score_display_settings();
if (is_array($customdisplays) && count(($customdisplays))) {
$total = array();
foreach($customdisplays as $custom) {
$total[$custom['display']] = 0;
}
$user_results = $flatviewtable->datagen->get_data_to_graph2();
foreach($user_results as $user_result) {
$total[$user_result[count($user_result)-1][1]]++;
}
}
$html = '';
$img = api_get_path(SYS_CODE_PATH).'css/'.api_get_visual_theme().'/images/header-logo.png';
if (file_exists($img)) {
$img = api_get_path(WEB_CODE_PATH).'css/'.api_get_visual_theme().'/images/header-logo.png';
$html .= "<img src='$img'>";
} else {
if (!empty($organization)) {
$html .= '<h2 align="left">'.$organization.'</h2>';
}
}
$html .= '<h2 align="center">'.get_lang('FlatView').'</h2>';
$html .= '<table align="center" width="100%"><tr><td valign="top">';
$html .= '<table align="left" width="33%">';
$session_name = api_get_session_name(api_get_session_id());
$teacher_list = CourseManager::get_teacher_list_from_course_code_to_string($course_code);
if (!empty($session_name)) {
$html .= Display::tag('tr', Display::tag('td', get_lang('Session')).Display::tag('td', Display::tag('strong', $session_name)));
}
$html .= Display::tag('tr', Display::tag('td', get_lang('Course')).Display::tag('td', Display::tag('strong', $course_code)));
$html .= Display::tag('tr', Display::tag('td', get_lang('Date')).Display::tag('td', Display::tag('strong', api_convert_and_format_date(date('Y-m-d', time()), DATE_TIME_FORMAT_LONG))));
$html .= Display::tag('tr', Display::tag('td', get_lang('Teacher')).Display::tag('td', Display::tag('strong', $teacher_list)));
$html .= '</table></td>';
$html .= '<td valign="top"><table align="left" width="33%">';
if (!empty($total)) {
foreach($total as $label => $count) {
$total_custom_score = round($count/count($user_results), 2) *100;
$html .= Display::tag('tr', Display::tag('td', $label).': '.Display::tag('td', Display::tag('strong', $total_custom_score.' %')));
}
}
$html .= '</table></td>';
$html .= '<td valign="top"><table align="left" width="33%">';
$headers = $printable_data[0];
unset($headers[0]);
unset($headers[1]);
unset($headers[count($headers)+1]);
foreach ($headers as $head) {
//$html .= Display::tag('tr', Display::tag('td', 'P1').Display::tag('td', Display::tag('strong', $head)));
$html .= Display::tag('tr', Display::tag('td', Display::tag('strong', $head)));
}
$html .= '</table></td></table><br />';
$columns = count($printable_data[0]);
$has_data = is_array($printable_data[1]) && count($printable_data[1]) > 0;
if (api_is_western_name_order()) {
// Choosing the right person name order according to the current language.
list($printable_data[0][0], $printable_data[0][1]) = array($printable_data[0][1], $printable_data[0][0]);
if ($has_data) {
foreach ($printable_data[1] as &$printable_data_row) {
list($printable_data_row[0], $printable_data_row[1]) = array($printable_data_row[1], $printable_data_row[0]);
}
}
}
$table = new HTML_Table(array('class' => 'data_table'));
$row = 0;
$column = 0;
foreach ($printable_data[0] as $printable_data_cell) {
$table->setHeaderContents($row, $column, $printable_data_cell);
$column++;
}
$row++;
if ($has_data) {
foreach ($printable_data[1] as &$printable_data_row) {
$column = 0;
foreach ($printable_data_row as &$printable_data_cell) {
$table->setCellContents($row, $column, $printable_data_cell);
$table->updateCellAttributes($row, $column, 'align="center"');
$column++;
}
$table->updateRowAttributes($row, $row % 2 ? 'class="row_even"' : 'class="row_odd"', true);
$row++;
}
} else {
$column = 0;
$table->setCellContents($row, $column, get_lang('NoResults'));
$table->updateCellAttributes($row, $column, 'colspan="'.$columns.'" align="center" class="row_odd"');
}
$html .= $table->toHtml();
//echo $html;exit;
// Memory release
unset($printable_data);
unset($table);
// Conversion of the created HTML report to a PDF report
$html = api_utf8_encode($html);
//@todo this is really a must?
$creator_pdf = api_utf8_encode($creator);
$title_pdf = api_utf8_encode($report_name);
$subject_pdf = api_utf8_encode(get_lang('FlatView'));
$keywods_pdf = api_utf8_encode($course_code);
$page_format = $export['orientation'] == 'landscape' ? 'A4-L' : 'A4';
$pdf = new PDF($page_format, $export['orientation']);
// Sending the created PDF report to the client
$file_name = date('YmdHi_', $time);
if (!empty($course_code)) {
$file_name .= $course_code.'_';
}
$file_name .= get_lang('FlatView').'.pdf';
$pdf->content_to_pdf($html, $css, $file_name, api_get_course_id());
exit;
if ($export_pdf_form->validate()) {
$params = $export_pdf_form->exportValues();
export_pdf_flatview($cat, $users, $alleval, $alllinks, $params);
} else {
Display :: display_header(get_lang('ExportPDF'));
}

@ -815,53 +815,59 @@ if (isset($first_time) && $first_time==1 && api_is_allowed_to_edit(null,true)) {
if (!empty($cats)) {
if (api_is_allowed_to_edit(null, true)) {
if (api_is_allowed_to_edit(null, true) && api_get_setting('teachers_can_change_grade_model_settings') == 'true') {
//Getting grade models
$obj = new GradeModel();
$grade_models = $obj->get_all();
$options = array('-1' => get_lang('none'));
foreach ($grade_models as $item) {
$options[$item['id']] = $item['name'];
}
if (!empty($grade_models)) {
foreach ($grade_models as $item) {
$options[$item['id']] = $item['name'];
}
}
$grade_model_id = $cats[0]->get_grade_model_id();
//No children
if (count($cats) == 1 && empty($grade_model_id)) {
$form = new FormValidator('grade_model_settings');
$form->addElement('select', 'grade_model', get_lang('SelectGradeModel'), $options);
$form->addElement('style_submit_button', 'submit', get_lang('Save'), 'class="save"');
if (!empty($grade_models)) {
if ($form->validate()) {
$value = $form->exportValue('grade_model');
$gradebook = new Gradebook();
$gradebook->update(array('id'=> $cats[0]->get_id(), 'grade_model_id' => $value), true);
//do something
$obj = new GradeModel();
$components = $obj->get_components($value);
foreach ($components as $component) {
$gradebook = new Gradebook();
$params = array();
$params['name'] = $component['acronym'];
$params['description'] = $component['title'];
$params['user_id'] = api_get_user_id();
$params['parent_id'] = $cats[0]->get_id();
$params['weight'] = $component['percentage'];
$params['session_id'] = api_get_session_id();
$params['course_code'] = api_get_course_id();
$params['grade_model_id'] = api_get_session_id();
$gradebook->save($params);
}
//Reloading cats
$cats = Category :: load(null, null, $course_code, null, null, $session_id, false); //already init
} else {
$form->display();
}
$form = new FormValidator('grade_model_settings');
$form->addElement('select', 'grade_model', get_lang('SelectGradeModel'), $options);
$form->addElement('style_submit_button', 'submit', get_lang('Save'), 'class="save"');
if ($form->validate()) {
$value = $form->exportValue('grade_model');
$gradebook = new Gradebook();
$gradebook->update(array('id'=> $cats[0]->get_id(), 'grade_model_id' => $value), true);
//do something
$obj = new GradeModel();
$components = $obj->get_components($value);
foreach ($components as $component) {
$gradebook = new Gradebook();
$params = array();
$params['name'] = $component['acronym'];
$params['description'] = $component['title'];
$params['user_id'] = api_get_user_id();
$params['parent_id'] = $cats[0]->get_id();
$params['weight'] = $component['percentage'];
$params['session_id'] = api_get_session_id();
$params['course_code'] = api_get_course_id();
$params['grade_model_id'] = api_get_session_id();
$gradebook->save($params);
}
//Reloading cats
$cats = Category :: load(null, null, $course_code, null, null, $session_id, false); //already init
} else {
$form->display();
}
}
}
}

@ -193,7 +193,7 @@ class CatForm extends FormValidator {
$this->addElement('hidden','hid_parent_id');
$this->addElement('textarea', 'description', get_lang('Description'),array('class'=>'span3','cols' => '34'));
if (isset($this->category_object) && $this->category_object->get_parent_id() == 0) {
if (isset($this->category_object) && $this->category_object->get_parent_id() == 0 && api_get_setting('teachers_can_change_grade_model_settings') == 'true') {
//Getting grade models
$obj = new GradeModel();
$grade_models = $obj->get_all();

@ -172,7 +172,7 @@ class EvalForm extends FormValidator
}
usort($results_and_users, array ('EvalForm', 'sort_by_user'));
$defaults= array ();
$defaults = array();
foreach ($results_and_users as $result_and_user) {
$user = $result_and_user['user'];
@ -383,10 +383,13 @@ class EvalForm extends FormValidator
*/
protected function build_editing_form() {
$parent_cat = Category :: load($this->evaluation_object->get_category_id());
$cat = Category :: load($parent_cat[0]->get_parent_id());
$global_weight = $cat[0]->get_weight();
//$values['weight'] = $values['weight_mask']/$global_weight*$parent_cat[0]->get_weight();
$weight_mask = $global_weight*$this->evaluation_object->get_weight()/$parent_cat[0]->get_weight() ;
if ($parent_cat[0]->get_parent_id() == 0) {
$weight_mask = $this->evaluation_object->get_weight();
} else {
$cat = Category :: load($parent_cat[0]->get_parent_id());
$global_weight = $cat[0]->get_weight();
$weight_mask = $global_weight*$this->evaluation_object->get_weight()/$parent_cat[0]->get_weight() ;
}
$this->setDefaults(array ( 'hid_id' => $this->evaluation_object->get_id(),
'name' => $this->evaluation_object->get_name(),
@ -434,7 +437,7 @@ class EvalForm extends FormValidator
if (count($all_categories) == 1) {
$this->addElement('hidden', 'hid_category_id', $cat_id);
} else {
} else {
$select_gradebook = $this->addElement('select', 'hid_category_id', get_lang('SelectGradebook'), array(), array('id' => 'hid_category_id'));
$this->addRule('hid_category_id', get_lang('ThisFieldIsRequired'), 'nonzero');

@ -215,13 +215,17 @@ class GradebookTable extends SortableTable {
$row[] = $this->build_edit_column($item);
}
} else {
//students get the results and certificates columns
if (count($this->evals_links)>0 && $status_user!=1 ) {
$value_data = isset($data[4]) ? $data[4] : null;
if (!is_null($value_data)) {
//students get the results and certificates columns
if (count($this->evals_links) > 0 && $status_user != 1) {
$value_data = isset($data[4]) ? $data[4] : null;
if (!is_null($value_data)) {
$row[] = Display::tag('h4', $value_data);
}
}
} else {
$row[] = $this->build_edit_column($item);
}
} else {
$row[] = $this->build_edit_column($item);
}
}
//Category added

@ -112,12 +112,16 @@ class LinkAddEditForm extends FormValidator
$this->addRule('weight_mask',get_lang('OnlyNumbers'),'numeric');
$this->addRule(array ('weight_mask', 'zero'), get_lang('NegativeValue'), 'compare', '>=');
if ($form_type == self :: TYPE_EDIT) {
$parent_cat = Category :: load($link->get_category_id());
$cat = Category :: load($parent_cat[0]->get_parent_id());
$global_weight = $cat[0]->get_weight();
$parent_cat = Category :: load($link->get_category_id());
$values['weight'] = $link->get_weight()/$parent_cat[0]->get_weight()*$global_weight;
//$defaults['weight'] = $link->get_weight();
if ($parent_cat[0]->get_parent_id() == 0) {
$values['weight'] = $link->get_weight();
} else {
$cat = Category :: load($parent_cat[0]->get_parent_id());
$global_weight = $cat[0]->get_weight();
$values['weight'] = $link->get_weight()/$parent_cat[0]->get_weight()*$global_weight;
}
$defaults['weight_mask'] = $values['weight'] ;
$defaults['select_gradebook'] = $link->get_category_id();

@ -207,27 +207,32 @@ function build_edit_icons_cat($cat, $selectcat) {
$modify_icons .= '<a class="view_children" data-cat-id="'.$cat->get_id().'" href="javascript:void(0);">'.Display::return_icon('view_more_stats.gif', get_lang('Show'),'',ICON_SIZE_SMALL).'</a>';
if (empty($grade_model_id) || $grade_model_id == -1) {
$modify_icons .= '<a href="gradebook_edit_cat.php?editcat='.$cat->get_id().'&amp;cidReq='.$cat->get_course_code().'">'.Display::return_icon('edit.png', get_lang('Modify'),'',ICON_SIZE_SMALL).'</a>';
}
$modify_icons .= '&nbsp;<a href="' . api_get_self() . '?visiblecat=' . $cat->get_id() . '&amp;' . $visibility_command . '=&amp;selectcat=' . $selectcat . ' ">'.Display::return_icon($visibility_icon.'.png', get_lang('Visible'),'',ICON_SIZE_SMALL).'</a>';
//no move ability for root categories
if ($cat->is_movable()) {
/*$modify_icons .= '&nbsp;<a href="' . api_get_self() . '?movecat=' . $cat->get_id() . '&amp;selectcat=' . $selectcat . ' &amp;cidReq='.$cat->get_course_code().'">
<img src="../img/icons/22/move.png" border="0" title="' . get_lang('Move') . '" alt="" /></a>';*/
} else {
//$modify_icons .= '&nbsp;<img src="../img/deplacer_fichier_na.gif" border="0" title="' . get_lang('Move') . '" alt="" />';
}
if (empty($grade_model_id) || $grade_model_id == -1) {
/*$modify_icons .= ' <a href="gradebook_edit_all.php?id_session='.api_get_session_id().'&amp;cidReq='.$cat->get_course_code().'&selectcat=' . $cat->get_id() . '"> '.
Display::return_icon('percentage.png', get_lang('EditAllWeights'),'',ICON_SIZE_SMALL).' </a>'; */
if (api_is_allowed_to_edit(null, true)) {
//PDF
$modify_icons .= '&nbsp;<a href="gradebook_flat_view.php?export_pdf=category&selectcat=' . $cat->get_id() . '" >'.Display::return_icon('pdf.png', get_lang('ExportToPDF'),'',ICON_SIZE_SMALL).'</a>';
if (empty($grade_model_id) || $grade_model_id == -1) {
$modify_icons .= '<a href="gradebook_edit_cat.php?editcat='.$cat->get_id().'&amp;cidReq='.$cat->get_course_code().'">'.Display::return_icon('edit.png', get_lang('Modify'),'',ICON_SIZE_SMALL).'</a>';
}
$modify_icons .= '&nbsp;<a href="' . api_get_self() . '?visiblecat=' . $cat->get_id() . '&amp;' . $visibility_command . '=&amp;selectcat=' . $selectcat . ' ">'.Display::return_icon($visibility_icon.'.png', get_lang('Visible'),'',ICON_SIZE_SMALL).'</a>';
//no move ability for root categories
if ($cat->is_movable()) {
/*$modify_icons .= '&nbsp;<a href="' . api_get_self() . '?movecat=' . $cat->get_id() . '&amp;selectcat=' . $selectcat . ' &amp;cidReq='.$cat->get_course_code().'">
<img src="../img/icons/22/move.png" border="0" title="' . get_lang('Move') . '" alt="" /></a>';*/
} else {
//$modify_icons .= '&nbsp;<img src="../img/deplacer_fichier_na.gif" border="0" title="' . get_lang('Move') . '" alt="" />';
}
if (empty($grade_model_id) || $grade_model_id == -1) {
/*$modify_icons .= ' <a href="gradebook_edit_all.php?id_session='.api_get_session_id().'&amp;cidReq='.$cat->get_course_code().'&selectcat=' . $cat->get_id() . '"> '.
Display::return_icon('percentage.png', get_lang('EditAllWeights'),'',ICON_SIZE_SMALL).' </a>'; */
}
$modify_icons .= '&nbsp;<a href="' . api_get_self() . '?deletecat=' . $cat->get_id() . '&amp;selectcat=' . $selectcat . '&amp;cidReq='.$cat->get_course_code().'" onclick="return confirmation();">'.Display::return_icon('delete.png', get_lang('DeleteAll'),'',ICON_SIZE_SMALL).'</a>';
}
$modify_icons .= '&nbsp;<a href="' . api_get_self() . '?deletecat=' . $cat->get_id() . '&amp;selectcat=' . $selectcat . '&amp;cidReq='.$cat->get_course_code().'" onclick="return confirmation();">'.Display::return_icon('delete.png', get_lang('DeleteAll'),'',ICON_SIZE_SMALL).'</a>';
return $modify_icons;
}
}
@ -242,7 +247,8 @@ function build_edit_icons_eval($eval, $selectcat) {
$eval->get_course_code();
$cat=new Category();
$message_eval=$cat->show_message_resource_delete($eval->get_course_code());
if ($message_eval===false) {
if ($message_eval===false && api_is_allowed_to_edit(null, true)) {
$visibility_icon= ($eval->is_visible() == 0) ? 'invisible' : 'visible';
$visibility_command= ($eval->is_visible() == 0) ? 'set_visible' : 'set_invisible';
$modify_icons= '<a href="gradebook_edit_eval.php?editeval=' . $eval->get_id() . ' &amp;cidReq='.$eval->get_course_code().'">
@ -603,3 +609,138 @@ function get_user_certificate_content($user_id, $course_code, $is_preview = fals
$new_content_html = $new_content[0].$print.'</head>'.$new_content_html;
return array('content' => $new_content_html, 'variables'=>$content_html['variables']);
}
function export_pdf_flatview($cat, $users, $alleval, $alllinks, $params = array()) {
// Beginning of PDF report creation
$printable_data = get_printable_data($cat[0], $users, $alleval, $alllinks);
// Reading report's CSS
$css_file = api_get_path(SYS_CODE_PATH).'gradebook/print.css';
$css = file_exists($css_file) ? @file_get_contents($css_file) : '';
// HTML report creation first
$time = time();
$course_code = trim($cat[0]->get_course_code());
$organization = api_get_setting('Institution');
$displayscore = ScoreDisplay :: instance();
$customdisplays = $displayscore->get_custom_score_display_settings();
$total = array();
if (is_array($customdisplays) && count(($customdisplays))) {
foreach($customdisplays as $custom) {
$total[$custom['display']] = 0;
}
$user_results = $flatviewtable->datagen->get_data_to_graph2();
foreach($user_results as $user_result) {
$total[$user_result[count($user_result)-1][1]]++;
}
}
$html = '';
$img = api_get_path(SYS_CODE_PATH).'css/'.api_get_visual_theme().'/images/header-logo.png';
if (file_exists($img)) {
$img = api_get_path(WEB_CODE_PATH).'css/'.api_get_visual_theme().'/images/header-logo.png';
$html .= "<img src='$img'>";
} else {
if (!empty($organization)) {
$html .= '<h2 align="left">'.$organization.'</h2>';
}
}
$html .= '<h2 align="center">'.get_lang('FlatView').'</h2>';
$html .= '<table align="center" width="100%"><tr><td valign="top">';
$html .= '<table align="left" width="33%">';
$session_name = api_get_session_name(api_get_session_id());
$teacher_list = CourseManager::get_teacher_list_from_course_code_to_string($course_code);
if (!empty($session_name)) {
$html .= Display::tag('tr', Display::tag('td', get_lang('Session')).Display::tag('td', Display::tag('strong', $session_name)));
}
$html .= Display::tag('tr', Display::tag('td', get_lang('Course')).Display::tag('td', Display::tag('strong', $course_code)));
$html .= Display::tag('tr', Display::tag('td', get_lang('Date')).Display::tag('td', Display::tag('strong', api_convert_and_format_date(date('Y-m-d', time()), DATE_TIME_FORMAT_LONG))));
$html .= Display::tag('tr', Display::tag('td', get_lang('Teacher')).Display::tag('td', Display::tag('strong', $teacher_list)));
$html .= '</table></td>';
$html .= '<td valign="top"><table align="left" width="33%">';
if (!empty($total)) {
foreach($total as $label => $count) {
$total_custom_score = round($count/count($user_results), 2) *100;
$html .= Display::tag('tr', Display::tag('td', $label).': '.Display::tag('td', Display::tag('strong', $total_custom_score.' %')));
}
}
$html .= '</table></td>';
$html .= '<td valign="top"><table align="left" width="33%">';
$headers = $printable_data[0];
unset($headers[0]);
unset($headers[1]);
unset($headers[count($headers)+1]);
foreach ($headers as $head) {
$html .= Display::tag('tr', Display::tag('td', Display::tag('strong', $head)));
}
$html .= '</table></td></table><br />';
$columns = count($printable_data[0]);
$has_data = is_array($printable_data[1]) && count($printable_data[1]) > 0;
if (api_is_western_name_order()) {
// Choosing the right person name order according to the current language.
list($printable_data[0][0], $printable_data[0][1]) = array($printable_data[0][1], $printable_data[0][0]);
if ($has_data) {
foreach ($printable_data[1] as &$printable_data_row) {
list($printable_data_row[0], $printable_data_row[1]) = array($printable_data_row[1], $printable_data_row[0]);
}
}
}
$table = new HTML_Table(array('class' => 'data_table'));
$row = 0;
$column = 0;
foreach ($printable_data[0] as $printable_data_cell) {
$table->setHeaderContents($row, $column, $printable_data_cell);
$column++;
}
$row++;
if ($has_data) {
foreach ($printable_data[1] as &$printable_data_row) {
$column = 0;
foreach ($printable_data_row as &$printable_data_cell) {
$table->setCellContents($row, $column, $printable_data_cell);
$table->updateCellAttributes($row, $column, 'align="center"');
$column++;
}
$table->updateRowAttributes($row, $row % 2 ? 'class="row_even"' : 'class="row_odd"', true);
$row++;
}
} else {
$column = 0;
$table->setCellContents($row, $column, get_lang('NoResults'));
$table->updateCellAttributes($row, $column, 'colspan="'.$columns.'" align="center" class="row_odd"');
}
$html .= $table->toHtml();
unset($printable_data);
unset($table);
// Conversion of the created HTML report to a PDF report
$html = api_utf8_encode($html);
$page_format = $params['orientation'] == 'landscape' ? 'A4-L' : 'A4';
$pdf = new PDF($page_format, $params['orientation']);
// Sending the created PDF report to the client
$file_name = date('YmdHi_', $time);
if (!empty($course_code)) {
$file_name .= $course_code.'_';
}
$file_name .= get_lang('FlatView').'.pdf';
$pdf->content_to_pdf($html, $css, $file_name, api_get_course_id());
exit;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

@ -84,12 +84,14 @@ if (is_int($global_error_code) && $global_error_code > 0) {
$css_def = '';
foreach ($css_list as $css_item) {
$css_base_chamilo_file = $root_sys.$css_item;
if (file_exists($css_base_chamilo_file)) {
if (file_exists($css_base_chamilo_file)) {
$css_def .= @file_get_contents($css_base_chamilo_file);
}
}
$css_def = str_replace('behavior:url("/main/css/csshover3.htc");', '', $css_def);
$css_def = str_replace("@import url('bootstrap.css');", '', $css_def);
$css_def = str_replace('behavior:url("/main/css/csshover3.htc");', '', $css_def);
$css_def = str_replace('main/', $root_rel.'main/', $css_def);
$css_def = str_replace('images/', $root_rel.$css_path.$theme.'images/', $css_def);
$css_def = str_replace('../../img/', $root_rel.'main/img/', $css_def);
@ -118,14 +120,14 @@ if (is_int($global_error_code) && $global_error_code > 0) {
$global_error_message['title'] = $InstallationTitle;
if (($pos = strpos($InstallationDescription, '%s')) === false) {
$InstallationDescription = 'Click to INSTALL Chamilo %s or read the installation guide';
}
$click_to_install = substr($InstallationDescription, 0, $pos);
}
$read_installation_guide = substr($InstallationDescription, $pos + 2);
$InstallationDescription = '<form action="'.$root_rel.'main/install/index.php" method="get">
<button class="btn btn-primary btn-large" type="submit" value="&nbsp;&nbsp; '.$click_to_install.' &nbsp;&nbsp;" >
'.$click_to_install.'</button>
</form><br />
<a href="'.$installation_guide_url.'" target="_blank">'.$read_installation_guide.'</a>';
<p class="download-info">
<button class="btn btn-primary btn-large" type="submit" value="INSTALL Chamilo" >INSTALL Chamilo</button>
<a class="btn btn-large" href="'.$installation_guide_url.'" target="_blank">'.$read_installation_guide.'</a>
</p>
</form>';
$global_error_message['description'] = $InstallationDescription;
break;
case 3:
@ -181,11 +183,10 @@ if (is_int($global_error_code) && $global_error_code > 0) {
<div id="logo">
<img vspace="10" hspace="10" alt="Chamilo" src="{CHAMILO_LOGO}">
</div>
<div class="breadcrumb">
<ul>
<li><a href="#">{SECTION}</a></li>
</ul>
</div>
<ul class="breadcrumb">
<li><a href="#">{SECTION}</a></li>
</ul>
</div>
<div class="clear"> </div>

@ -74,21 +74,6 @@ function define_course_keys($wanted_code, $prefix_for_all = '', $prefix_for_base
$try_new_fsc_id ++;
$final_suffix['CourseId'] = substr(md5(uniqid(rand())), 0, 4);
}
/*
if ($_configuration['single_database']) {
$query = "SHOW TABLES FROM ".$_configuration['main_database']." LIKE '".$_configuration['table_prefix'].$keys_course_db_name.$_configuration['db_glue']."%'";
$result = Database::query($query);
} else {
$query = "SHOW DATABASES LIKE '$keys_course_db_name'";
$result = Database::query($query);
}
if (Database::num_rows($result)) {
$keys_are_unique = false;
$try_new_fsc_db ++;
$final_suffix['CourseDb'] = substr('_'.md5(uniqid(rand())), 0, 4);
}*/
if (file_exists(api_get_path(SYS_COURSE_PATH).$keys_course_repository)) {
$keys_are_unique = false;
$try_new_fsc_dir ++;
@ -99,15 +84,9 @@ function define_course_keys($wanted_code, $prefix_for_all = '', $prefix_for_base
return $keys;
}
}
/*
// Db name can't begin with a number.
if (stripos('abcdefghijklmnopqrstuvwxyz', $keys_course_db_name[0]) === false) {
$keys_course_db_name = $prefixAntiNumber . $keys_course_db_name;
}*/
$keys['currentCourseCode'] = $keys_course_code;
$keys['currentCourseId'] = $keys_course_id;
//$keys['currentCourseDbName'] = $keys_course_db_name;
$keys['currentCourseRepository'] = $keys_course_repository;
return $keys;
@ -185,15 +164,11 @@ function get_course_tables() {
$tables[]= 'tool';
$tables[]= 'tool_intro';
// Group tool
$tables[]= 'group_info';
$tables[]= 'group_category';
$tables[]= 'group_rel_user';
$tables[]= 'group_rel_tutor';
$tables[]= 'item_property';
$tables[]= 'userinfo_content';
$tables[]= 'userinfo_def';
$tables[]= 'course_description';
@ -264,7 +239,6 @@ function get_course_tables() {
$tables[]= 'wiki_conf';
$tables[]= 'wiki_discuss';
$tables[]= 'wiki_mailcue';
//$tables[]= 'audiorecorder';
$tables[]= 'course_setting';
$tables[]= 'glossary';
$tables[]= 'notebook';
@ -276,18 +250,26 @@ function get_course_tables() {
$tables[]= 'thematic';
$tables[]= 'thematic_plan';
$tables[]= 'thematic_advance';
$tables[]= 'metadata';
return $tables;
return $tables;
}
/* Executed only before create_course_tables() */
function drop_course_tables() {
$list = get_course_tables();
foreach ($list as $table) {
$sql = "DROP TABLE IF EXISTS ".DB_COURSE_PREFIX.$table;
Database::query($sql);
}
}
/**
* Creates all the necessary tables for a new course
*/
function update_db_course($course_db_name = null) {
global $_configuration;
$charset_clause = ' DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci';
function create_course_tables($course_db_name = null) {
global $_configuration;
$charset_clause = ' DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci';
$use_one_db = true;
if ($use_one_db) {
@ -302,24 +284,19 @@ function update_db_course($course_db_name = null) {
//@todo define the backticks inside those table names directly (instead of adding them afterwards)
$tbl_course_homepage = $course_db_name . 'tool';
$TABLEINTROS = $course_db_name . 'tool_intro';
// Group tool
$TABLEGROUPS = $course_db_name . 'group_info';
$TABLEGROUPCATEGORIES = $course_db_name . 'group_category';
$TABLEGROUPUSER = $course_db_name . 'group_rel_user';
$TABLEGROUPTUTOR = $course_db_name . 'group_rel_tutor';
$TABLEITEMPROPERTY = $course_db_name . 'item_property';
$TABLETOOLUSERINFOCONTENT = $course_db_name . 'userinfo_content';
$TABLETOOLUSERINFODEF = $course_db_name . 'userinfo_def';
$TABLETOOLCOURSEDESC = $course_db_name . 'course_description';
$TABLETOOLAGENDA = $course_db_name . 'calendar_event';
$TABLETOOLAGENDAREPEAT = $course_db_name . 'calendar_event_repeat';
$TABLETOOLAGENDAREPEATNOT = $course_db_name . 'calendar_event_repeat_not';
$TABLETOOLAGENDAATTACHMENT = $course_db_name . 'calendar_event_attachment';
// Announcements
$TABLETOOLANNOUNCEMENTS = $course_db_name . 'announcement';
$TABLETOOLANNOUNCEMENTSATTACHMENT = $course_db_name . 'announcement_attachment';
@ -360,8 +337,7 @@ function update_db_course($course_db_name = null) {
$TABLEQUIZQUESTION = $course_db_name . 'quiz_rel_question';
$TABLEQUIZQUESTIONLIST = $course_db_name . 'quiz_question';
$TABLEQUIZANSWERSLIST = $course_db_name . 'quiz_answer';
$TABLEQUIZQUESTIONOPTION = $course_db_name . 'quiz_question_option';
$TABLEQUIZQUESTIONOPTION = $course_db_name . 'quiz_question_option';
$table_quiz_question_category = $course_db_name . 'quiz_question_category';
$table_quiz_question_rel_category = $course_db_name . 'quiz_question_rel_category';
@ -415,9 +391,6 @@ function update_db_course($course_db_name = null) {
$TABLEWIKIDISCUSS = $course_db_name . 'wiki_discuss';
$TABLEWIKIMAILCUE = $course_db_name . 'wiki_mailcue';
// audiorecorder
//$TABLEAUDIORECORDER = $course_db_name . 'audiorecorder';
// Course settings
$TABLESETTING = $course_db_name . 'course_setting';
@ -437,8 +410,7 @@ function update_db_course($course_db_name = null) {
// Thematic
$TBL_THEMATIC = $course_db_name . 'thematic';
$TBL_THEMATIC_PLAN = $course_db_name . 'thematic_plan';
$TBL_THEMATIC_ADVANCE = $course_db_name . 'thematic_advance';
$TBL_THEMATIC_ADVANCE = $course_db_name . 'thematic_advance';
$TBL_METADATA = $course_db_name . 'metadata';
$add_to_all_tables = ' c_id INT NOT NULL, ';
@ -519,7 +491,7 @@ function update_db_course($course_db_name = null) {
)" . $charset_clause;
Database::query($sql);
/* Forum tool */
/* Forum tool */
// Forum Category
$sql = "

@ -434,7 +434,7 @@ class CourseManager {
}
$status = ($status == STUDENT || $status == COURSEMANAGER) ? $status : STUDENT;
$role_id = ($status == COURSEMANAGER) ? COURSE_ADMIN : NORMAL_COURSE_MEMBER;
//$role_id = ($status == COURSEMANAGER) ? COURSE_ADMIN : NORMAL_COURSE_MEMBER;
// A preliminary check whether the user has bben already registered on the platform.
if (Database::num_rows(@Database::query("SELECT status FROM ".Database::get_main_table(TABLE_MAIN_USER)."
@ -1661,10 +1661,8 @@ class CourseManager {
$table_course = Database::get_main_table(TABLE_MAIN_COURSE);
$table_course_user = Database::get_main_table(TABLE_MAIN_COURSE_USER);
$table_course_class = Database::get_main_table(TABLE_MAIN_COURSE_CLASS);
$user_role_table = Database::get_main_table(MAIN_USER_ROLE_TABLE);
$location_table = Database::get_main_table(MAIN_LOCATION_TABLE);
$role_right_location_table = Database::get_main_table(MAIN_ROLE_RIGHT_LOCATION_TABLE);
$table_course_class = Database::get_main_table(TABLE_MAIN_COURSE_CLASS);
$table_session_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
$table_session_course_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
$table_course_survey = Database::get_main_table(TABLE_MAIN_SHARED_SURVEY);
@ -1691,7 +1689,7 @@ class CourseManager {
return;
}
$this_course = Database::fetch_array($res);
$db_name = $this_course['db_name'];
self::create_database_dump($code);
if (!self::is_virtual_course_from_system_code($code)) {
// If this is not a virtual course, look for virtual courses that depend on this one, if any
@ -1813,8 +1811,7 @@ class CourseManager {
$sql = "DELETE FROM $table_stats_links WHERE links_cours_id = '".$code."'";
Database::query($sql);
$sql = "DELETE FROM $table_stats_uploads WHERE upload_cours_id = '".$code."'";
Database::query($sql);
Database::query($sql);
global $_configuration;
if ($_configuration['multiple_access_urls']) {

@ -143,7 +143,7 @@ define('TABLE_STATISTIC_TRACK_COURSE_RANKING', 'track_course_ranking');
define('TABLE_MAIN_USER_REL_COURSE_VOTE', 'user_rel_course_vote');
// SCORM database tables
// SCORM database tables this is used only during the migration from 1.6 to 1.8 see update-db-scorm-1.6.x-1.8.0.inc
define('TABLE_SCORM_MAIN', 'scorm_main');
define('TABLE_SCORM_SCO_DATA', 'scorm_sco_data');

@ -17,6 +17,7 @@
* Constants definition
*/
require_once 'database.constants.inc.php';
/**
* Database class definition
* @package chamilo.database
@ -43,17 +44,7 @@ class Database {
*/
public static function get_statistic_database() {
global $_configuration;
return $_configuration['statistics_database'];
}
/**
* Returns the name of the SCORM database.
* @todo use main_database
* @deprecated
*/
public static function get_scorm_database() {
global $_configuration;
return $_configuration['scorm_database'];
return $_configuration['main_database'];
}
/**
@ -62,7 +53,7 @@ class Database {
*/
public static function get_user_personal_database() {
global $_configuration;
return $_configuration['user_personal_database'];
return $_configuration['main_database'];
}
/**
@ -192,19 +183,7 @@ class Database {
}
/**
* This generic method returns the correct and complete name of any scorm
* table of which you pass the short name as a parameter. Please, define
* table names as constants in this library and use them instead of directly
* using magic words in your tool code.
*
* @param string $short_table_name, the name of the table
*/
public static function get_scorm_table($short_table_name) {
return self::format_table_name(self::get_scorm_database(), $short_table_name);
}
/**
* This generic method returns the correct and complete name of any scorm
* This generic method returns the correct and complete name of any user
* table of which you pass the short name as a parameter. Please, define
* table names as constants in this library and use them instead of directly
* using magic words in your tool code.
@ -704,6 +683,7 @@ class Database {
if (strpos($query, 'c_')) {
//Check if the table contains inner joins
if (
strpos($query, 'DROP TABLE IF EXISTS') === false &&
strpos($query, 'thematic_advance') === false &&
strpos($query, 'thematic_plan') === false &&
strpos($query, 'track_c_countries') === false &&

@ -180,18 +180,6 @@ class Database {
return self::format_table_name(self::get_statistic_database(), $short_table_name);
}
/**
* This generic method returns the correct and complete name of any scorm
* table of which you pass the short name as a parameter. Please, define
* table names as constants in this library and use them instead of directly
* using magic words in your tool code.
*
* @param string $short_table_name, the name of the table
*/
public static function get_scorm_table($short_table_name) {
return self::format_table_name(self::get_scorm_database(), $short_table_name);
}
/**
* This generic method returns the correct and complete name of any scorm
* table of which you pass the short name as a parameter. Please, define

@ -562,7 +562,7 @@ function exercise_attempt_hotspot($exe_id, $question_id, $answer_id, $correct, $
* @param integer User ID (defaults to null)
* @param string Course code (defaults to null)
*/
function event_system($event_type, $event_value_type, $event_value, $datetime = null, $user_id=null, $course_code=null) {
function event_system($event_type, $event_value_type, $event_value, $datetime = null, $user_id = null, $course_code = null) {
global $_user;
global $TABLETRACK_DEFAULT;
@ -579,18 +579,25 @@ function event_system($event_type, $event_value_type, $event_value, $datetime =
unset($event_value['avatar']);
unset($event_value['password']);
unset($event_value['lastLogin']);
unset($event_value['picture_uri']);
unset($event_value['picture_uri']);
$event_value = serialize($event_value);
}
}
$event_value = Database::escape_string($event_value);
$user_id = Database::escape_string($user_id);
$course_code = Database::escape_string($course_code);
$course_info = api_get_course_info($course_code);
$course_id = null;
if (!empty($course_info)) {
$course_id = $course_info['real_id'];
}
if (!isset($datetime)) {
$datetime = api_get_utc_datetime();
}
$datetime = Database::escape_string($datetime);
if(!isset($user_id)) {
@ -599,17 +606,19 @@ function event_system($event_type, $event_value_type, $event_value, $datetime =
if(!isset($course_code)) {
$course_code = '';
}
$sql = "INSERT INTO $TABLETRACK_DEFAULT
(default_user_id,
default_cours_code,
c_id,
default_date,
default_event_type,
default_value_type,
default_value
)
VALUES
('$user_id.',
VALUES('$user_id.',
'$course_code',
'$course_id',
'$datetime',
'$event_type',
'$event_value_type',
@ -617,37 +626,37 @@ function event_system($event_type, $event_value_type, $event_value, $datetime =
$res = Database::query($sql);
//Sending notifications to users
$send_event_setting = api_get_setting('activate_send_event_by_mail');
if (!empty($send_event_setting) && $send_event_setting == 'true') {
global $language_file;
//prepare message
list($message, $subject) = get_event_message_and_subject($event_type);
$mail_body=$message;
if ( is_array($notification_infos) ){
foreach ($notification_infos as $variable => $value) {
$mail_body = str_replace('%'.$variable.'%',$value,$mail_body);
}
}
$send_event_setting = api_get_setting('activate_send_event_by_mail');
if (!empty($send_event_setting) && $send_event_setting == 'true') {
global $language_file;
//prepare message
list($message, $subject) = get_event_message_and_subject($event_type);
$mail_body=$message;
if (is_array($notification_infos)) {
foreach ($notification_infos as $variable => $value) {
$mail_body = str_replace('%'.$variable.'%',$value,$mail_body);
}
}
//prepare mail common variables
if(empty($subject)) {
$subject = $event_type;
}
$mail_subject = '['.api_get_setting('siteName').'] '.$subject;
$sender_name = api_get_person_name(api_get_setting('administratorName'), api_get_setting('administratorSurname'), null, PERSON_NAME_EMAIL_ADDRESS);
$email_admin = api_get_setting('emailAdministrator');
$emailfromaddr = api_get_setting('emailAdministrator');
$emailfromname = api_get_setting('siteName');
//Send mail to all subscribed users
$users_arr = get_users_subscribed_to_event($event_type);
foreach ($users_arr as $user) {
$recipient_name = api_get_person_name($user['firstname'], $user['lastname']);
$email = $user['email'];
@api_mail($recipient_name, $email, $mail_subject, $mail_body, $sender_name, $email_admin);
//prepare mail common variables
if(empty($subject)) {
$subject = $event_type;
}
$mail_subject = '['.api_get_setting('siteName').'] '.$subject;
$sender_name = api_get_person_name(api_get_setting('administratorName'), api_get_setting('administratorSurname'), null, PERSON_NAME_EMAIL_ADDRESS);
$email_admin = api_get_setting('emailAdministrator');
$emailfromaddr = api_get_setting('emailAdministrator');
$emailfromname = api_get_setting('siteName');
//Send mail to all subscribed users
$users_arr = get_users_subscribed_to_event($event_type);
foreach ($users_arr as $user) {
$recipient_name = api_get_person_name($user['firstname'], $user['lastname']);
$email = $user['email'];
@api_mail($recipient_name, $email, $mail_subject, $mail_body, $sender_name, $email_admin);
}
}
}
return true;
}

@ -42,13 +42,28 @@ class Template {
$loader = new Twig_Loader_Filesystem($template_paths);
$this->twig = new Twig_Environment($loader, array(
//'cache' => api_get_path(SYS_ARCHIVE_PATH), //path to the cache folder
'autoescape' => false,
//'debug' => true,
//'auto_reload' => true
//'optimizations' => 0 // turn on optimizations with -1
));
//Setting Twig options depending on the server see http://twig.sensiolabs.org/doc/api.html#environment-options
if (api_get_setting('server_type') == 'test') {
$options = array (
//'cache' => api_get_path(SYS_ARCHIVE_PATH), //path to the cache folder
'autoescape' => false,
'debug' => true,
'auto_reload' => true,
'optimizations' => 0, // turn on optimizations with -1
'strict_variables' => true, //If set to false, Twig will silently ignore invalid variables
);
} else {
$options = array (
'cache' => api_get_path(SYS_ARCHIVE_PATH), //path to the cache folder
'autoescape' => false,
'debug' => false,
'auto_reload' => false,
'optimizations' => -1, // turn on optimizations with -1
'strict_variables' => false //If set to false, Twig will silently ignore invalid variables
);
}
$this->twig = new Twig_Environment($loader, $options);
$this->twig->addFilter('get_lang', new Twig_Filter_Function('get_lang'));
$this->twig->addFilter('get_path', new Twig_Filter_Function('api_get_path'));

@ -374,6 +374,7 @@ LOCK TABLES language WRITE;
INSERT INTO language (original_name, english_name, isocode, dokeos_folder, available) VALUES
('&#1575;&#1604;&#1593;&#1585;&#1576;&#1610;&#1577;','arabic','ar','arabic',0),
('Asturianu','asturian','ast','asturian',0),
('&#2476;&#2494;&#2434;&#2482;&#2494;','bengali','bn','bengali',0),
('&#1041;&#1098;&#1083;&#1075;&#1072;&#1088;&#1089;&#1082;&#1080;','bulgarian','bg','bulgarian',1),
('Bosanski','bosnian','bs','bosnian',1),
('Catal&agrave;','catalan','ca','catalan',0),
@ -417,6 +418,7 @@ INSERT INTO language (original_name, english_name, isocode, dokeos_folder, avail
('&#1056;&#1091;&#1089;&#1089;&#1082;&#1080;&#1081;','russian','ru','russian',0),
('Sloven&#269;ina','slovak','sk','slovak',0),
('Sloven&scaron;&#269;ina','slovenian','sl','slovenian',1),
('&#1575;&#1604;&#1589;&#1608;&#1605;&#1575;&#1604;&#1610;&#1577;','somali','so','somali',0),
('Srpski','serbian','sr','serbian',0),
('Suomi','finnish','fi','finnish',0),
('Svenska','swedish','sv','swedish',0),
@ -852,17 +854,12 @@ VALUES
('allow_browser_sniffer', NULL, 'radio', 'Tuning', 'false', 'AllowBrowserSnifferTitle', 'AllowBrowserSnifferComment', NULL, NULL, 0),
('enable_wami_record',NULL,'radio','Tools','false','EnableWamiRecordTitle','EnableWamiRecordComment',NULL,NULL, 0),
('gradebook_default_weight', NULL, 'textfield', 'Gradebook', '100', 'GradebookDefaultWeightTitle', 'GradebookDefaultWeightComment', NULL, NULL, 0),
('gradebook_ranking_1', 'ranking', 'gradebook_ranking', 'Gradebook', '', '', '', NULL, NULL, 1),
('gradebook_ranking_2', 'ranking', 'gradebook_ranking', 'Gradebook', '', '', '', NULL, NULL, 1),
('gradebook_ranking_3', 'ranking', 'gradebook_ranking', 'Gradebook', '', '', '', NULL, NULL, 1),
('gradebook_ranking_4', 'ranking', 'gradebook_ranking', 'Gradebook', '', '', '', NULL, NULL, 1),
('gradebook_ranking_5', 'ranking', 'gradebook_ranking', 'Gradebook', '', '', '', NULL, NULL, 1),
('gradebook_ranking_6', 'ranking', 'gradebook_ranking', 'Gradebook', '', '', '', NULL, NULL, 1),
('gradebook_ranking_7', 'ranking', 'gradebook_ranking', 'Gradebook', '', '', '', NULL, NULL, 1),
('gradebook_ranking_8', 'ranking', 'gradebook_ranking', 'Gradebook', '', '', '', NULL, NULL, 1),
('gradebook_ranking_9', 'ranking', 'gradebook_ranking', 'Gradebook', '', '', '', NULL, NULL, 1),
('gradebook_ranking_10', 'ranking', 'gradebook_ranking', 'Gradebook', '', '', '', NULL, NULL, 1),
('chamilo_database_version',NULL,'textfield',NULL, '1.9.0.17733','DatabaseVersion','', NULL, NULL, 0);
('teachers_can_change_score_settings', NULL, 'radio', 'Gradebook', 'true', 'TeachersCanChangeScoreSettingsTitle', 'TeachersCanChangeScoreSettingsComment', NULL, NULL, 1),
('teachers_can_change_grade_model_settings', NULL, 'radio', 'Gradebook', 'true', 'TeachersCanChangeGradeModelSettingsTitle', 'TeachersCanChangeGradeModelSettingsComment', NULL, NULL, 1),
('shibboleth_description', NULL, 'radio', 'Shibboleth', 'false', 'ShibbolethMainActivateTitle', 'ShibbolethMainActivateComment', NULL, NULL, 0),
('facebook_description', NULL, 'radio', 'Facebook', 'false', 'FacebookMainActivateTitle', 'FacebookMainActivateComment', NULL, NULL, 0),
('gradebook_locking_enabled', NULL, 'radio', 'Gradebook', 'false', 'GradebookEnableLockingTitle', 'GradebookEnableLockingComment', NULL, NULL, 0),
('chamilo_database_version',NULL,'textfield',NULL, '1.9.0.17769','DatabaseVersion','', NULL, NULL, 0);
/*
('show_tabs', 'custom_tab_1', 'checkbox', 'Platform', 'true', 'ShowTabsTitle', 'ShowTabsComment', NULL, 'TabsCustom1', 1),
@ -1197,13 +1194,12 @@ VALUES
('allow_browser_sniffer', 'false', 'No'),
('enable_wami_record', 'true', 'Yes'),
('enable_wami_record', 'false', 'No'),
('cas_add_user_activate', 'extldap', 'casAddUserActivateLDAP'),
('update_user_info_cas_with_ldap', 'true', 'Yes'),
('update_user_info_cas_with_ldap', 'false', 'No'),
('teachers_can_change_score_settings', 'false', 'Yes'),
('teachers_can_change_score_settings', 'false', 'No');
('teachers_can_change_score_settings', 'true', 'Yes'),
('teachers_can_change_score_settings', 'false', 'No'),
('teachers_can_change_grade_model_settings', 'true', 'Yes'),
('teachers_can_change_grade_model_settings', 'false', 'No'),
('gradebook_locking_enabled', 'true', 'Yes'),
('gradebook_locking_enabled', 'false', 'No');
UNLOCK TABLES;
/*
('activate_send_event_by_mail', 'true', 'Yes'),
@ -2989,4 +2985,4 @@ CREATE TABLE grade_components (
PRIMARY KEY (id)
);
ALTER TABLE gradebook_category ADD COLUMN grade_model_id INT DEFAULT 0;
ALTER TABLE gradebook_category ADD COLUMN grade_model_id INT DEFAULT 0;

@ -85,6 +85,7 @@ CREATE TABLE track_e_default (
default_event_type varchar(20) NOT NULL default '',
default_value_type varchar(20) NOT NULL default '',
default_value text NOT NULL,
c_id int unsigned default NULL,
PRIMARY KEY (default_id)
);

@ -811,7 +811,6 @@ if (@$_POST['step2']) {
break;
}
} else {
set_file_folder_permissions();
database_server_connect();

@ -427,7 +427,7 @@ function get_config_param($param, $updatePath = '') {
$updateFromConfigFile = 'claroline/inc/conf/claro_main.conf.php';
} else {
// Give up recovering.
error_log('Chamilo Notice: Could not find previous config file at '.$updatePath.'main/inc/conf/configuration.php nor at '.$updatePath.'claroline/inc/conf/claro_main.conf.php in get_config_param(). Will start new config (in '.__FILE__.', line '.__LINE__.')', 0);
//error_log('Chamilo Notice: Could not find previous config file at '.$updatePath.'main/inc/conf/configuration.php nor at '.$updatePath.'claroline/inc/conf/claro_main.conf.php in get_config_param(). Will start new config (in '.__FILE__.', line '.__LINE__.')', 0);
return null;
}
}
@ -2053,5 +2053,4 @@ function locking_settings() {
$sql = "UPDATE $table SET access_url_locked = 1 WHERE variable = '$setting'";
Database::query($sql);
}
}

@ -8,7 +8,8 @@
* @package chamilo.install
*/
// This page can only be access through including from the install script.
/* This page is called only during a NEW chamilo installation */
/* This page can only be access through including from the install script. */
if (!defined('SYSTEM_INSTALLATION')) {
echo 'You are not allowed here!';
@ -117,7 +118,9 @@ load_main_database($installation_settings);
//Adds the c_XXX courses tables see #3910
require_once api_get_path(LIBRARY_PATH).'add_course.lib.inc.php';
update_db_course();
drop_course_tables();
create_course_tables();
load_database_script('db_stats.sql');

@ -96,6 +96,14 @@ INSERT INTO settings_current (variable, subkey, type, category, selected_value,
INSERT INTO settings_options (variable, value, display_text) VALUES ('teachers_can_change_score_settings', 'true', 'Yes');
INSERT INTO settings_options (variable, value, display_text) VALUES ('teachers_can_change_score_settings', 'false', 'No');
INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('teachers_can_change_grade_model_settings', NULL, 'radio', 'Gradebook', 'true', 'TeachersCanChangeGradeModelSettingsTitle', 'TeachersCanChangeGradeModelSettingsComment', NULL, NULL, 1);
INSERT INTO settings_options (variable, value, display_text) VALUES ('teachers_can_change_grade_model_settings', 'true', 'Yes');
INSERT INTO settings_options (variable, value, display_text) VALUES ('teachers_can_change_grade_model_settings', 'false', 'No');
INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('gradebook_locking_enabled', NULL, 'radio', 'Gradebook', 'false', 'GradebookEnableLockingTitle', 'GradebookEnableLockingComment', NULL, NULL, 0);
INSERT INTO settings_options (variable, value, display_text) VALUES ('gradebook_locking_enabled', 'true', 'Yes');
INSERT INTO settings_options (variable, value, display_text) VALUES ('gradebook_locking_enabled', 'false', 'No');
INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('allow_users_to_change_email_with_no_password', NULL, 'radio', 'User', 'false', 'AllowUsersToChangeEmailWithNoPasswordTitle', 'AllowUsersToChangeEmailWithNoPasswordComment', NULL, NULL, 0);
INSERT INTO settings_options (variable, value, display_text) VALUES ('allow_users_to_change_email_with_no_password', 'true', 'Yes');
INSERT INTO settings_options (variable, value, display_text) VALUES ('allow_users_to_change_email_with_no_password', 'false', 'No');
@ -148,20 +156,10 @@ INSERT INTO settings_options (variable, value, display_text) VALUES ('enable_wam
INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('gradebook_default_weight', NULL, 'textfield', 'Gradebook', '100', 'GradebookDefaultWeightTitle', 'GradebookDefaultWeightComment', NULL, NULL, 1);
INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('gradebook_ranking_1', 'ranking', 'gradebook_ranking', 'Gradebook', '', 'GradebookRankingTitle', '', NULL, NULL, 1);
INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('gradebook_ranking_2', 'ranking', 'gradebook_ranking', 'Gradebook', '', '', '', NULL, NULL, 1);
INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('gradebook_ranking_3', 'ranking', 'gradebook_ranking', 'Gradebook', '', '', '', NULL, NULL, 1);
INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('gradebook_ranking_4', 'ranking', 'gradebook_ranking', 'Gradebook', '', '', '', NULL, NULL, 1);
INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('gradebook_ranking_5', 'ranking', 'gradebook_ranking', 'Gradebook', '', '', '', NULL, NULL, 1);
INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('gradebook_ranking_6', 'ranking', 'gradebook_ranking', 'Gradebook', '', '', '', NULL, NULL, 1);
INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('gradebook_ranking_7', 'ranking', 'gradebook_ranking', 'Gradebook', '', '', '', NULL, NULL, 1);
INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('gradebook_ranking_8', 'ranking', 'gradebook_ranking', 'Gradebook', '', '', '', NULL, NULL, 1);
INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('gradebook_ranking_9', 'ranking', 'gradebook_ranking', 'Gradebook', '', '', '', NULL, NULL, 1);
INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('gradebook_ranking_10', 'ranking', 'gradebook_ranking', 'Gradebook', '', '', '', NULL, NULL, 1);
INSERT INTO language (original_name, english_name, isocode, dokeos_folder, available) VALUES ('&#2476;&#2494;&#2434;&#2482;&#2494;','bengali','bn','bengali',0), ('&#1575;&#1604;&#1589;&#1608;&#1605;&#1575;&#1604;&#1610;&#1577;','somali','so','somali',0);
-- Course ranking
CREATE TABLE track_course_ranking (id int unsigned not null PRIMARY KEY AUTO_INCREMENT,c_id int unsigned not null, session_id int unsigned not null default 0, url_id int unsigned not null default 0, accesses int unsigned not null default 0, total_score int unsigned not null default 0, users int unsigned not null default 0, creation_date datetime not null);
CREATE TABLE track_course_ranking (id int unsigned not null PRIMARY KEY AUTO_INCREMENT, c_id int unsigned not null, session_id int unsigned not null default 0, url_id int unsigned not null default 0, accesses int unsigned not null default 0, total_score int unsigned not null default 0, users int unsigned not null default 0, creation_date datetime not null);
ALTER TABLE track_course_ranking ADD INDEX idx_tcc_cid (c_id);
ALTER TABLE track_course_ranking ADD INDEX idx_tcc_sid (session_id);
@ -196,7 +194,7 @@ DELETE FROM settings_current WHERE variable = 'use_document_title';
DELETE FROM settings_options WHERE variable = 'use_document_title';
-- Do not move this query
UPDATE settings_current SET selected_value = '1.9.0.17733' WHERE variable = 'chamilo_database_version';
UPDATE settings_current SET selected_value = '1.9.0.17769' WHERE variable = 'chamilo_database_version';
-- xxSTATSxx
ALTER TABLE track_e_exercices ADD COLUMN questions_to_check TEXT NOT NULL DEFAULT '';
@ -209,6 +207,7 @@ ALTER TABLE stored_values_stack ADD KEY (user_id, sco_id, course_id, sv_key, sta
ALTER TABLE stored_values_stack ADD UNIQUE (user_id, sco_id, course_id, sv_key, stack_order);
ALTER TABLE track_e_attempt ADD COLUMN filename VARCHAR(255) DEFAULT NULL;
ALTER TABLE track_e_default ADD COLUMN c_id INTEGER DEFAULT NULL;
-- xxUSERxx

@ -57,6 +57,7 @@ if (defined('SYSTEM_INSTALLATION')) {
// that we want to change the main databases as well...
$only_test = false;
if (defined('SYSTEM_INSTALLATION')) {
if ($singleDbForm) {
$dbStatsForm = $dbNameForm;
$dbScormForm = $dbNameForm;
@ -126,7 +127,7 @@ if (defined('SYSTEM_INSTALLATION')) {
}
}
//Moving Stats DB to the main database
//Moving Stats DB to the main DB
$stats_table = array(
"track_c_browsers",
@ -159,14 +160,30 @@ if (defined('SYSTEM_INSTALLATION')) {
if ($dbNameForm != $dbStatsForm) {
iDatabase::select_db($dbStatsForm);
foreach($stats_table as $stat_table) {
foreach ($stats_table as $stat_table) {
$sql = "ALTER TABLE $dbStatsForm.$stat_table RENAME $dbNameForm.$stat_table";
iDatabase::query($sql);
}
iDatabase::select_db($dbNameForm);
}
//Renaming user tables in the main DB
$user_tables = array(
'personal_agenda',
'personal_agenda_repeat',
'personal_agenda_repeat_not',
'user_course_category',
);
if ($dbNameForm != $dbUserForm) {
Database::select_db($dbUserForm);
foreach ($user_tables as $table) {
$sql = "ALTER TABLE $dbUserForm.$table RENAME $dbNameForm.$table";
Database::query($sql);
}
Database::select_db($dbNameForm);
}
// Get the user queries list (u_q_list)
$u_q_list = get_sql_file_contents('migrate-db-'.$old_file_version.'-'.$new_file_version.'-pre.sql', 'user');

@ -0,0 +1,5 @@
<?php
/*
for more information: see languages.txt in the lang folder.
*/
?>

@ -0,0 +1,5 @@
<?php
/*
for more information: see languages.txt in the lang folder.
*/
?>

@ -0,0 +1,5 @@
<?php
/*
for more information: see languages.txt in the lang folder.
*/
?>

@ -0,0 +1,5 @@
<?php
/*
for more information: see languages.txt in the lang folder.
*/
?>

@ -0,0 +1,5 @@
<?php
/*
for more information: see languages.txt in the lang folder.
*/
?>

@ -0,0 +1,5 @@
<?php
/*
for more information: see languages.txt in the lang folder.
*/
?>

@ -0,0 +1,5 @@
<?php
/*
for more information: see languages.txt in the lang folder.
*/
?>

@ -0,0 +1,5 @@
<?php
/*
for more information: see languages.txt in the lang folder.
*/
?>

@ -0,0 +1,5 @@
<?php
/*
for more information: see languages.txt in the lang folder.
*/
?>

@ -0,0 +1,5 @@
<?php
/*
for more information: see languages.txt in the lang folder.
*/
?>

@ -0,0 +1,5 @@
<?php
/*
for more information: see languages.txt in the lang folder.
*/
?>

@ -0,0 +1,5 @@
<?php
/*
for more information: see languages.txt in the lang folder.
*/
?>

@ -0,0 +1,5 @@
<?php
/*
for more information: see languages.txt in the lang folder.
*/
?>

@ -0,0 +1,5 @@
<?php
/*
for more information: see languages.txt in the lang folder.
*/
?>

@ -0,0 +1,5 @@
<?php
/*
for more information: see languages.txt in the lang folder.
*/
?>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save