Merge with 1.10.x

pull/2487/head
jmontoyaa 9 years ago
commit f7e4a5e35b
  1. 18
      app/Migrations/Schema/V110/Version110.php
  2. 2
      app/Migrations/Schema/V110/Version20150603181728.php
  3. 4
      custompages/index-unlogged-dist.php
  4. 4
      documentation/changelog.html
  5. 4
      documentation/credits.html
  6. 4
      documentation/dependencies.html
  7. 4
      documentation/index.html
  8. 4
      documentation/installation_guide.html
  9. 4
      documentation/installation_guide_es_ES.html
  10. 4
      documentation/installation_guide_fr_FR.html
  11. 4
      documentation/license.html
  12. 4
      documentation/migration-checklist.html
  13. 10
      documentation/optimization.html
  14. 4
      documentation/readme.html
  15. 3
      main/create_course/add_course.php
  16. 3
      main/exercice/fill_blanks.class.php
  17. 38
      main/exercice/question.class.php
  18. 1
      main/forum/forumfunction.inc.php
  19. 3
      main/inc/lib/message.lib.php
  20. 35
      main/inc/lib/tracking.lib.php
  21. 57
      main/newscorm/learnpath.class.php
  22. 2
      main/newscorm/lp_view.php
  23. 4
      main/template/default/layout/login_form.tpl

@ -34,6 +34,7 @@ class Version110 extends AbstractMigrationChamilo
public function up(Schema $schema)
{
// Use $schema->createTable
$this->addSql('set sql_mode=""');
$this->addSql("CREATE TABLE IF NOT EXISTS course_field_options (id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, field_id INT NOT NULL, option_value TEXT, option_display_text VARCHAR(64), option_order INT, tms DATETIME)");
$this->addSql("CREATE TABLE IF NOT EXISTS session_field_options (id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, field_id INT NOT NULL, option_value TEXT, option_display_text VARCHAR(64), option_order INT, tms DATETIME)");
@ -49,8 +50,17 @@ class Version110 extends AbstractMigrationChamilo
$this->addSql("ALTER TABLE skill_rel_user MODIFY COLUMN acquired_skill_at datetime default NULL");
$this->addSql("ALTER TABLE track_e_access MODIFY COLUMN access_date datetime DEFAULT NULL");
$this->addSql("ALTER TABLE track_e_lastaccess MODIFY COLUMN access_date datetime DEFAULT NULL");
$this->addSql("ALTER TABLE skill_rel_user ADD COLUMN course_id INT NOT NULL DEFAULT 0 AFTER id");
$this->addSql("ALTER TABLE skill_rel_user ADD COLUMN session_id INT NOT NULL DEFAULT 0 AFTER course_id");
$table = $schema->getTable('skill_rel_user');
if (!$table->hasColumn('course_id')) {
$this->addSql("ALTER TABLE skill_rel_user ADD COLUMN course_id INT NOT NULL DEFAULT 0 AFTER id");
}
if (!$table->hasColumn('session_id')) {
$this->addSql("ALTER TABLE skill_rel_user ADD COLUMN session_id INT NOT NULL DEFAULT 0 AFTER course_id");
}
$this->addSql("ALTER TABLE skill_rel_user ADD INDEX idx_select_cs (course_id, session_id)");
// Delete info of session_rel_user if session does not exists;
@ -113,9 +123,9 @@ class Version110 extends AbstractMigrationChamilo
$this->addSql("ALTER TABLE track_e_online CHANGE COLUMN login_ip user_ip varchar(39) NOT NULL DEFAULT ''");
$this->addSql("ALTER TABLE track_e_login CHANGE COLUMN login_ip user_ip varchar(39) NOT NULL DEFAULT ''");
$this->addSql("ALTER TABLE user MODIFY COLUMN user_id int unsigned DEFAULT null");
$this->addSql("ALTER TABLE user MODIFY COLUMN user_id int unsigned DEFAULT NULL");
$this->addSql("ALTER TABLE user DROP PRIMARY KEY");
$this->addSql("ALTER TABLE user ADD COLUMN id INT DEFAULT null");
$this->addSql("ALTER TABLE user ADD COLUMN id INT DEFAULT NULL");
$this->addSql("UPDATE user SET id = user_id");
$this->addSql("ALTER TABLE user MODIFY COLUMN id INT NOT NULL PRIMARY KEY AUTO_INCREMENT AFTER user_id");

@ -66,6 +66,8 @@ class Version20150603181728 extends AbstractMigrationChamilo
$this->addSql("DELETE FROM c_item_property WHERE c_id NOT IN (SELECT id FROM course)");
$this->addSql("DELETE FROM c_item_property WHERE to_group_id NOT IN (SELECT id FROM c_group_info)");
$this->addSql('UPDATE c_item_property cip SET cip.to_group_id = (SELECT cgi.iid FROM c_group_info cgi WHERE cgi.c_id = cip.c_id AND cgi.id = cip.to_group_id)');
$this->addSql('ALTER TABLE c_item_property ADD CONSTRAINT FK_1D84C18191D79BD3 FOREIGN KEY (c_id) REFERENCES course(id)');
$this->addSql('ALTER TABLE c_item_property ADD CONSTRAINT FK_1D84C181330D47E9 FOREIGN KEY (to_group_id) REFERENCES c_group_info (iid)');
$this->addSql('ALTER TABLE c_item_property ADD CONSTRAINT FK_1D84C18129F6EE60 FOREIGN KEY (to_user_id) REFERENCES user (id)');

@ -101,12 +101,12 @@ $rootWeb = api_get_path('WEB_PATH');
<div id="links">
<?php if (api_get_setting('allow_registration') === 'true') { ?>
<a href="<?php echo api_get_path(WEB_PATH); ?>main/auth/inscription.php?language=<?php echo api_get_interface_language(); ?>">
<a href="<?php echo api_get_path(WEB_CODE_PATH); ?>auth/inscription.php?language=<?php echo api_get_interface_language(); ?>">
<?php echo custompages_get_lang('Registration')?>
</a><br />
<?php } ?>
<a href="<?php echo api_get_path(WEB_PATH); ?>main/auth/lostPassword.php?language=<?php echo api_get_interface_language(); ?>">
<a href="<?php echo api_get_path(WEB_CODE_PATH); ?>auth/lostPassword.php?language=<?php echo api_get_interface_language(); ?>">
<?php echo custompages_get_lang('LostPassword')?>
</a>
</div>

@ -5085,9 +5085,9 @@ a simple videoconferencing interface.</p>
</ul>
</div>
<hr />
<a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10-blue" alt="Valid XHTML 1.0 Transitional" style="margin: 1em; float: right;" height="31" width="88" /></a>
<a href="http://validator.w3.org/check?uri=referer"><img src="//www.w3.org/Icons/valid-xhtml10-blue" alt="Valid XHTML 1.0 Transitional" style="margin: 1em; float: right;" height="31" width="88" /></a>
<a href="http://jigsaw.w3.org/css-validator/">
<img src="http://jigsaw.w3.org/css-validator/images/vcss-blue" style="margin: 1em; float: right;" alt="Valid CSS" />
<img src="//jigsaw.w3.org/css-validator/images/vcss-blue" style="margin: 1em; float: right;" alt="Valid CSS" />
</a>
</body>
</html>

@ -765,8 +765,8 @@ To know more about the Chamilo Association and how to get involve, <a href="http
</div>
<hr />
<a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10-blue" alt="Valid XHTML 1.0 Transitional" style="margin: 1em; float: right;" height="31" width="88" /></a>
<a href="http://validator.w3.org/check?uri=referer"><img src="//www.w3.org/Icons/valid-xhtml10-blue" alt="Valid XHTML 1.0 Transitional" style="margin: 1em; float: right;" height="31" width="88" /></a>
<a href="http://jigsaw.w3.org/css-validator/">
<img src="http://jigsaw.w3.org/css-validator/images/vcss-blue" style="margin: 1em; float: right;" alt="Valid CSS" />
<img src="//jigsaw.w3.org/css-validator/images/vcss-blue" style="margin: 1em; float: right;" alt="Valid CSS" />
</a>
</body></html>

@ -137,9 +137,9 @@ ensure all components are installed by an expert in the field.<br />
</ul>
</div>
<hr />
<a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10-blue" alt="Valid XHTML 1.0 Transitional" style="margin: 1em; float: right;" height="31" width="88" /></a>
<a href="http://validator.w3.org/check?uri=referer"><img src="//www.w3.org/Icons/valid-xhtml10-blue" alt="Valid XHTML 1.0 Transitional" style="margin: 1em; float: right;" height="31" width="88" /></a>
<a href="http://jigsaw.w3.org/css-validator/">
<img src="http://jigsaw.w3.org/css-validator/images/vcss-blue" style="margin: 1em; float: right;" alt="Valid CSS" />
<img src="//jigsaw.w3.org/css-validator/images/vcss-blue" style="margin: 1em; float: right;" alt="Valid CSS" />
</a>
</body>
</html>

@ -56,8 +56,8 @@
</div>
<hr />
<a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10-blue" alt="Valid XHTML 1.0 Transitional" style="margin: 1em; float: right;" height="31" width="88" /></a>
<a href="http://validator.w3.org/check?uri=referer"><img src="//www.w3.org/Icons/valid-xhtml10-blue" alt="Valid XHTML 1.0 Transitional" style="margin: 1em; float: right;" height="31" width="88" /></a>
<a href="http://jigsaw.w3.org/css-validator/">
<img src="http://jigsaw.w3.org/css-validator/images/vcss-blue" style="margin: 1em; float: right;" alt="Valid CSS" />
<img src="//jigsaw.w3.org/css-validator/images/vcss-blue" style="margin: 1em; float: right;" alt="Valid CSS" />
</a>
</body></html>

@ -787,9 +787,9 @@ If you have issues with files taking a long time to download, make sure you reco
</div>
<hr />
<a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10-blue" alt="Valid XHTML 1.0 Transitional" style="margin: 1em; float: right;" height="31" width="88" /></a>
<a href="http://validator.w3.org/check?uri=referer"><img src="//www.w3.org/Icons/valid-xhtml10-blue" alt="Valid XHTML 1.0 Transitional" style="margin: 1em; float: right;" height="31" width="88" /></a>
<a href="http://jigsaw.w3.org/css-validator/">
<img src="http://jigsaw.w3.org/css-validator/images/vcss-blue" style="margin: 1em; float: right;" alt="Valid CSS" />
<img src="//jigsaw.w3.org/css-validator/images/vcss-blue" style="margin: 1em; float: right;" alt="Valid CSS" />
</a>
</body>
</html>

@ -805,9 +805,9 @@ Apache2: La configuración para nuestro sitio de ejemplo my.chamilo10.net sería
</div>
<hr />
<a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10-blue" alt="Valid XHTML 1.0 Transitional" style="margin: 1em; float: right;" height="31" width="88" /></a>
<a href="http://validator.w3.org/check?uri=referer"><img src="//www.w3.org/Icons/valid-xhtml10-blue" alt="Valid XHTML 1.0 Transitional" style="margin: 1em; float: right;" height="31" width="88" /></a>
<a href="http://jigsaw.w3.org/css-validator/">
<img src="http://jigsaw.w3.org/css-validator/images/vcss-blue" style="margin: 1em; float: right;" alt="Valid CSS" />
<img src="//jigsaw.w3.org/css-validator/images/vcss-blue" style="margin: 1em; float: right;" alt="Valid CSS" />
</a>
</body>
</html>

@ -818,9 +818,9 @@ Ce sont uniquement les redirections à placer dans un bloc server{}, comme les a
</div>
<hr />
<a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10-blue" alt="Valid XHTML 1.0 Transitional" style="margin: 1em; float: right;" height="31" width="88" /></a>
<a href="http://validator.w3.org/check?uri=referer"><img src="//www.w3.org/Icons/valid-xhtml10-blue" alt="Valid XHTML 1.0 Transitional" style="margin: 1em; float: right;" height="31" width="88" /></a>
<a href="http://jigsaw.w3.org/css-validator/">
<img src="http://jigsaw.w3.org/css-validator/images/vcss-blue" style="margin: 1em; float: right;" alt="Valid CSS" />
<img src="//jigsaw.w3.org/css-validator/images/vcss-blue" style="margin: 1em; float: right;" alt="Valid CSS" />
</a>
</body>
</html>

@ -733,10 +733,10 @@ Public License instead of this License. But first, please read
</div
<hr/>
<a href="http://validator.w3.org/check?uri=referer"><img
src="http://www.w3.org/Icons/valid-xhtml10-blue"
src="//www.w3.org/Icons/valid-xhtml10-blue"
alt="Valid XHTML 1.0 Transitional" height="31" width="88" style="float: right; margin: 1em;" /></a>
<a href="http://jigsaw.w3.org/css-validator/">
<img src="http://jigsaw.w3.org/css-validator/images/vcss-blue" style="float: right; margin: 1em;"
<img src="//jigsaw.w3.org/css-validator/images/vcss-blue" style="float: right; margin: 1em;"
alt="Valid CSS" />
</a>
</body>

@ -55,9 +55,9 @@
<hr />
Don't have time or resources to optimize your Chamilo installation yourself? Hire an <a href="http://www.chamilo.org/en/providers">official Chamilo provider</a> and get it sorted out professionally by specialists.
<a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10-blue" alt="Valid XHTML 1.0 Transitional" style="margin: 1em; float: right;" height="31" width="88" /></a>
<a href="http://validator.w3.org/check?uri=referer"><img src="//www.w3.org/Icons/valid-xhtml10-blue" alt="Valid XHTML 1.0 Transitional" style="margin: 1em; float: right;" height="31" width="88" /></a>
<a href="http://jigsaw.w3.org/css-validator/">
<img src="http://jigsaw.w3.org/css-validator/images/vcss-blue" style="margin: 1em; float: right;" alt="Valid CSS" />
<img src="//jigsaw.w3.org/css-validator/images/vcss-blue" style="margin: 1em; float: right;" alt="Valid CSS" />
</a>
<hr />
<h2>Authors</h2>

@ -406,9 +406,9 @@ Header append Vary User-Agent env=!dont-vary
</pre>
<hr />
Don't have time or resources to optimize your Chamilo installation yourself? Hire an <a href="http://www.chamilo.org/en/providers">official Chamilo provider</a> and get it sorted out professionally by specialists.
<a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10-blue" alt="Valid XHTML 1.0 Transitional" style="margin: 1em; float: right;" height="31" width="88" /></a>
<a href="http://validator.w3.org/check?uri=referer"><img src="//www.w3.org/Icons/valid-xhtml10-blue" alt="Valid XHTML 1.0 Transitional" style="margin: 1em; float: right;" height="31" width="88" /></a>
<a href="http://jigsaw.w3.org/css-validator/">
<img src="http://jigsaw.w3.org/css-validator/images/vcss-blue" style="margin: 1em; float: right;" alt="Valid CSS" />
<img src="//jigsaw.w3.org/css-validator/images/vcss-blue" style="margin: 1em; float: right;" alt="Valid CSS" />
</a>
<hr />
@ -604,10 +604,10 @@ This should have an immediate effect on the load average on your server.
</ul>
<hr />
Don't have time or resources to optimize your Chamilo installation
yourself? Hire an <a href="http://www.chamilo.org/en/providers">official Chamilo provider</a> and get it sorted out professionally by specialists.
<a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10-blue" alt="Valid XHTML 1.0 Transitional" style="margin: 1em; float: right;" height="31" width="88" /></a>
yourself? Hire an <a href="//www.chamilo.org/en/providers">official Chamilo provider</a> and get it sorted out professionally by specialists.
<a href="http://validator.w3.org/check?uri=referer"><img src="//www.w3.org/Icons/valid-xhtml10-blue" alt="Valid XHTML 1.0 Transitional" style="margin: 1em; float: right;" height="31" width="88" /></a>
<a href="http://jigsaw.w3.org/css-validator/">
<img src="http://jigsaw.w3.org/css-validator/images/vcss-blue" style="margin: 1em; float: right;" alt="Valid CSS" />
<img src="//jigsaw.w3.org/css-validator/images/vcss-blue" style="margin: 1em; float: right;" alt="Valid CSS" />
</a>
</div>
</body>

@ -140,9 +140,9 @@ Mail: <a href="mailto:info@chamilo.org">info@chamilo.org</a>
</div>
<hr />
<a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10-blue" alt="Valid XHTML 1.0 Transitional" style="margin: 1em; float: right;" height="31" width="88" /></a>
<a href="http://validator.w3.org/check?uri=referer"><img src="//www.w3.org/Icons/valid-xhtml10-blue" alt="Valid XHTML 1.0 Transitional" style="margin: 1em; float: right;" height="31" width="88" /></a>
<a href="http://jigsaw.w3.org/css-validator/">
<img src="http://jigsaw.w3.org/css-validator/images/vcss-blue" style="margin: 1em; float: right;" alt="Valid CSS" />
<img src="//jigsaw.w3.org/css-validator/images/vcss-blue" style="margin: 1em; float: right;" alt="Valid CSS" />
</a>
</body>

@ -183,8 +183,7 @@ if ($course_validation_feature) {
// if it is activated.
if (empty($terms_and_conditions_url)) {
if (api_get_setting('allow_terms_conditions') == 'true') {
$terms_and_conditions_url = api_get_path(WEB_CODE_PATH);
$terms_and_conditions_url .= 'auth/inscription.php?legal';
$terms_and_conditions_url = api_get_path(WEB_CODE_PATH).'auth/inscription.php?legal';
}
}

@ -118,7 +118,8 @@ class FillBlanks extends Question
// get input size
var lainputsize = 200;
if ($("#samplesize\\\["+i+"\\\]").width()) {
lainputsize = $("#samplesize\\\["+i+"\\\]").width();
// this is a weird patch to avoid to reduce the size of input blank when you are writing in the ckeditor.
lainputsize = $("#samplesize\\\["+i+"\\\]").width() + 9;
}
if (document.getElementById("weighting["+i+"]")) {

@ -1190,7 +1190,7 @@ abstract class Question
* @author Olivier Brouckaert
* @param integer $deleteFromEx - exercise ID if the question is only removed from one exercise
*/
function delete($deleteFromEx = 0)
public function delete($deleteFromEx = 0)
{
$course_id = api_get_course_int_id();
@ -1199,7 +1199,7 @@ abstract class Question
$TBL_REPONSES = Database::get_course_table(TABLE_QUIZ_ANSWER);
$TBL_QUIZ_QUESTION_REL_CATEGORY = Database::get_course_table(TABLE_QUIZ_QUESTION_REL_CATEGORY);
$id = $this->id;
$id = intval($this->id);
// if the question must be removed from all exercises
if (!$deleteFromEx) {
@ -1223,27 +1223,33 @@ abstract class Question
}
$sql = "DELETE FROM $TBL_EXERCISE_QUESTION
WHERE c_id = $course_id AND question_id = " . intval($id) . "";
WHERE c_id = $course_id AND question_id = " . $id;
Database::query($sql);
$sql = "DELETE FROM $TBL_QUESTIONS
WHERE c_id = $course_id AND id = " . intval($id) . "";
WHERE c_id = $course_id AND id = " . $id;
Database::query($sql);
$sql = "DELETE FROM $TBL_REPONSES
WHERE c_id = $course_id AND question_id = " . intval($id) . "";
WHERE c_id = $course_id AND question_id = " . $id;
Database::query($sql);
// remove the category of this question in the question_rel_category table
$sql = "DELETE FROM $TBL_QUIZ_QUESTION_REL_CATEGORY
WHERE c_id = $course_id AND question_id = " . intval($id) . " AND c_id=" . api_get_course_int_id();
WHERE
c_id = $course_id AND
question_id = " . $id;
Database::query($sql);
api_item_property_update($this->course, TOOL_QUIZ, $id, 'QuizQuestionDeleted', api_get_user_id());
api_item_property_update(
$this->course,
TOOL_QUIZ,
$id,
'QuizQuestionDeleted',
api_get_user_id()
);
$this->removePicture();
// resets the object
$this->Question();
} else {
// just removes the exercise from the list
$this->removeFromList($deleteFromEx);
@ -1251,7 +1257,14 @@ abstract class Question
// disassociate question with this exercise
$this->search_engine_edit($deleteFromEx, FALSE, TRUE);
}
api_item_property_update($this->course, TOOL_QUIZ, $id, 'QuizQuestionDeleted', api_get_user_id());
api_item_property_update(
$this->course,
TOOL_QUIZ,
$id,
'QuizQuestionDeleted',
api_get_user_id()
);
}
}
@ -1259,10 +1272,10 @@ abstract class Question
* Duplicates the question
*
* @author Olivier Brouckaert
* @param array Course info of the destination course
* @param array $course_info Course info of the destination course
* @return int ID of the new question
*/
public function duplicate($course_info = null)
public function duplicate($course_info = [])
{
if (empty($course_info)) {
$course_info = $this->course;
@ -1348,6 +1361,7 @@ abstract class Question
public function get_question_type_name()
{
$key = self::$questionTypes[$this->type];
return get_lang($key[1]);
}

@ -1922,7 +1922,6 @@ function getPosts($forumInfo, $threadId, $orderDirection = 'ASC', $recursive = f
->addCriteria($criteria)
->addOrderBy('p.postId', $orderDirection);
$posts = $qb->getQuery()->getResult();
$depth++;

@ -406,7 +406,8 @@ class MessageManager
$new_user_list,
$subject,
$content,
$group_info
$group_info,
$file_attachments
);
}

@ -2266,16 +2266,12 @@ class Tracking
$groupBy";*/
$sql = "
SELECT
lp_id,
view_count,
progress
FROM $lpViewTable lp_view
SELECT lp_id, view_count, progress FROM $lpViewTable lp_view
WHERE
$conditionToString
$groupBy
$conditionToString
$groupBy
ORDER BY view_count DESC
";
";
$result = Database::query($sql);
@ -2787,8 +2783,8 @@ class Tracking
// Check the real number of LPs corresponding to the filter in the
// database (and if no list was given, get them all)
$res_row_lp = Database::query("SELECT DISTINCT(id) FROM $lp_table WHERE c_id = $course_id $condition_lp");
$sql = "SELECT DISTINCT(id) FROM $lp_table WHERE c_id = $course_id $condition_lp";
$res_row_lp = Database::query($sql);
$count_row_lp = Database::num_rows($res_row_lp);
// calculates time
@ -2796,15 +2792,18 @@ class Tracking
while ($row_lp = Database::fetch_array($res_row_lp)) {
$lp_id = intval($row_lp['id']);
$sql = 'SELECT SUM(total_time)
FROM '.$t_lpiv.' AS item_view
INNER JOIN '.$t_lpv.' AS view
ON item_view.lp_view_id = view.id
FROM '.$t_lpiv.' AS item_view
INNER JOIN '.$t_lpv.' AS view
ON (
item_view.lp_view_id = view.id AND
item_view.c_id = view.c_id
)
WHERE
item_view.c_id = '.$course_id.' AND
view.c_id = '.$course_id.' AND
view.lp_id = '.$lp_id.'
AND view.user_id = '.$student_id.' AND
session_id = '.$session_id;
item_view.c_id = '.$course_id.' AND
view.c_id = '.$course_id.' AND
view.lp_id = '.$lp_id.' AND
view.user_id = '.$student_id.' AND
session_id = '.$session_id;
$rs = Database::query($sql);
if (Database :: num_rows($rs) > 0) {

@ -1595,7 +1595,8 @@ class learnpath
error_log('New LP - In learnpath::get_brother_chapters()', 0);
}
if (empty($id)|| $id != strval(intval($id))) {
if (empty($id) || $id != strval(intval($id))) {
return array ();
}
@ -1606,21 +1607,24 @@ class learnpath
if (Database :: num_rows($res_parent) > 0) {
$row_parent = Database :: fetch_array($res_parent);
$parent = $row_parent['parent_item_id'];
$sql_bros = "SELECT * FROM $lp_item
WHERE
c_id = ".$course_id." AND
parent_item_id = $parent AND
id = $id AND
item_type='dokeos_chapter'
ORDER BY display_order";
$res_bros = Database::query($sql_bros);
$list = array ();
$sql = "SELECT * FROM $lp_item
WHERE
c_id = ".$course_id." AND
parent_item_id = $parent AND
id = $id AND
item_type='dokeos_chapter'
ORDER BY display_order";
$res_bros = Database::query($sql);
$list = array();
while ($row_bro = Database :: fetch_array($res_bros)) {
$list[] = $row_bro;
}
return $list;
}
return array ();
return array();
}
/**
@ -1959,7 +1963,7 @@ class learnpath
* Gets the navigation bar for the learnpath display screen
* @return string The HTML string to use as a navigation bar
*/
public function get_navigation_bar($idBar = null, $display=null) {
public function get_navigation_bar($idBar = null, $display = null) {
if ($this->debug > 0) {
error_log('New LP - In learnpath::get_navigation_bar()', 0);
}
@ -3295,6 +3299,7 @@ class learnpath
$html .= '</div>';
}
}
return $html;
}
@ -6355,18 +6360,18 @@ class learnpath
$res = Database::query($sql);
$row = Database::fetch_array($res);
switch ($row['item_type']) {
case 'dokeos_chapter' :
case 'dir' :
case 'asset' :
case 'sco' :
if (isset ($_GET['view']) && $_GET['view'] == 'build') {
case 'dokeos_chapter':
case 'dir':
case 'asset':
case 'sco':
if (isset($_GET['view']) && $_GET['view'] == 'build') {
$return .= $this->display_manipulate($item_id, $row['item_type']);
$return .= $this->display_item_form($row['item_type'], get_lang('EditCurrentChapter') . ' :', 'edit', $item_id, $row);
} else {
$return .= $this->display_item_small_form($row['item_type'], get_lang('EditCurrentChapter') . ' :', $row);
}
break;
case TOOL_DOCUMENT :
case TOOL_DOCUMENT:
$tbl_doc = Database :: get_course_table(TABLE_DOCUMENT);
$sql = "SELECT lp.*, doc.path as dir
FROM " . $tbl_lp_item . " as lp
@ -6381,7 +6386,7 @@ class learnpath
$return .= $this->display_manipulate($item_id, $row['item_type']);
$return .= $this->display_document_form('edit', $item_id, $row_step);
break;
case TOOL_LINK :
case TOOL_LINK:
$link_id = (string) $row['path'];
if (ctype_digit($link_id)) {
$tbl_link = Database :: get_course_table(TABLE_LINK);
@ -6396,7 +6401,7 @@ class learnpath
$return .= $this->display_manipulate($item_id, $row['item_type']);
$return .= $this->display_link_form('edit', $item_id, $row);
break;
case TOOL_LP_FINAL_ITEM :
case TOOL_LP_FINAL_ITEM:
$_SESSION['finalItem'] = true;
$tbl_doc = Database :: get_course_table(TABLE_DOCUMENT);
$sql = "SELECT lp.*, doc.path as dir
@ -6412,7 +6417,7 @@ class learnpath
$return .= $this->display_manipulate($item_id, $row['item_type']);
$return .= $this->display_document_form('edit', $item_id, $row_step);
break;
case 'dokeos_module' :
case 'dokeos_module':
if (isset ($_GET['view']) && $_GET['view'] == 'build') {
$return .= $this->display_manipulate($item_id, $row['item_type']);
$return .= $this->display_item_form($row['item_type'], get_lang('EditCurrentModule') . ' :', 'edit', $item_id, $row);
@ -6420,23 +6425,23 @@ class learnpath
$return .= $this->display_item_small_form($row['item_type'], get_lang('EditCurrentModule') . ' :', $row);
}
break;
case TOOL_QUIZ :
case TOOL_QUIZ:
$return .= $this->display_manipulate($item_id, $row['item_type']);
$return .= $this->display_quiz_form('edit', $item_id, $row);
break;
case TOOL_HOTPOTATOES :
case TOOL_HOTPOTATOES:
$return .= $this->display_manipulate($item_id, $row['item_type']);
$return .= $this->display_hotpotatoes_form('edit', $item_id, $row);
break;
case TOOL_STUDENTPUBLICATION :
case TOOL_STUDENTPUBLICATION:
$return .= $this->display_manipulate($item_id, $row['item_type']);
$return .= $this->display_student_publication_form('edit', $item_id, $row);
break;
case TOOL_FORUM :
case TOOL_FORUM:
$return .= $this->display_manipulate($item_id, $row['item_type']);
$return .= $this->display_forum_form('edit', $item_id, $row);
break;
case TOOL_THREAD :
case TOOL_THREAD:
$return .= $this->display_manipulate($item_id, $row['item_type']);
$return .= $this->display_thread_form('edit', $item_id, $row);
break;

@ -272,7 +272,7 @@ if (
$time_start_date = api_strtotime($row_dates['start_date'], 'UTC');
$time_exe_date = api_strtotime($row_dates['exe_date'], 'UTC');
$mytime = ((int) $time_exe_date - (int) $time_start_date);
$mytime = (int) $time_exe_date - (int) $time_start_date;
$score = (float) $row_dates['exe_result'];
$max_score = (float) $row_dates['exe_weighting'];

@ -16,11 +16,11 @@
{% if "allow_lostpassword" | get_setting == 'true' or "allow_registration" | get_setting == 'true' %}
<ul class="nav nav-pills nav-stacked">
{% if "allow_registration" | get_setting != 'false' %}
<li><a href="main/auth/inscription.php"> {{ 'SignUp' | get_lang }} </a></li>
<li><a href="{{ _p.web_main }}auth/inscription.php"> {{ 'SignUp' | get_lang }} </a></li>
{% endif %}
{% if "allow_lostpassword" | get_setting == 'true' %}
<li><a href="main/auth/lostPassword.php"> {{ 'LostPassword' | get_lang }} </a></li>
<li><a href="{{ _p.web_main }}auth/lostPassword.php"> {{ 'LostPassword' | get_lang }} </a></li>
{% endif %}
</ul>
{% endif %}

Loading…
Cancel
Save