diff --git a/app/Migrations/Schema/V111/Version20160715122300.php b/app/Migrations/Schema/V111/Version20160715122300.php
index 456886caf6..8981587a69 100644
--- a/app/Migrations/Schema/V111/Version20160715122300.php
+++ b/app/Migrations/Schema/V111/Version20160715122300.php
@@ -5,7 +5,6 @@ namespace Application\Migrations\Schema\V111;
use Application\Migrations\AbstractMigrationChamilo;
use Doctrine\DBAL\Schema\Schema;
-use Doctrine\DBAL\Types\Type;
/**
* Class Version20160715122300
@@ -23,6 +22,8 @@ class Version20160715122300 extends AbstractMigrationChamilo
{
$this->addSql('ALTER TABLE c_student_publication CHANGE session_id session_id INT DEFAULT NULL');
$this->addSql('UPDATE c_student_publication SET session_id = NULL WHERE session_id = 0');
+ // Fix not existing session id
+ $this->addSql('DELETE FROM c_student_publication WHERE session_id not in (SELECT id FROM session)');
$this->addSql('ALTER TABLE c_student_publication ADD CONSTRAINT fk_session FOREIGN KEY (session_id) REFERENCES session (id)');
}
diff --git a/main/document/showinframes.php b/main/document/showinframes.php
index 37588f2487..72e4d4d42a 100755
--- a/main/document/showinframes.php
+++ b/main/document/showinframes.php
@@ -185,7 +185,7 @@ $js_glossary_in_documents = '
{ type:"stylesheet", id:"_fr5", src:"'.api_get_path(WEB_PUBLIC_PATH).'assets/jquery-ui/themes/smoothness/jquery-ui.min.css"},
{ type:"stylesheet", id:"_fr6", src:"'.api_get_path(WEB_PUBLIC_PATH).'assets/jquery-ui/themes/smoothness/theme.css"},
{ type:"script", id:"_fr2", src:"'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.highlight.js"},
- { type:"script", id:"_fr3", src:"'.api_get_path(WEB_CODE_PATH).'glossary/glossary.js.php"}
+ { type:"script", id:"_fr3", src:"'.api_get_path(WEB_CODE_PATH).'glossary/glossary.js.php?'.api_get_cidreq().'"}
]
});';
diff --git a/main/exercise/exercise_submit.php b/main/exercise/exercise_submit.php
index 44422cae0f..4a49887834 100755
--- a/main/exercise/exercise_submit.php
+++ b/main/exercise/exercise_submit.php
@@ -45,7 +45,7 @@ if ($origin == 'learnpath') {
$showGlossary = in_array($glossaryExtraTools, array('true', 'lp', 'exercise_and_lp'));
}
if ($showGlossary) {
- $htmlHeadXtra[] = '';
+ $htmlHeadXtra[] = '';
$htmlHeadXtra[] = api_get_js('jquery.highlight.js');
}
diff --git a/main/glossary/glossary.js.php b/main/glossary/glossary.js.php
index ec03eb4956..cf94158b2a 100644
--- a/main/glossary/glossary.js.php
+++ b/main/glossary/glossary.js.php
@@ -3,15 +3,27 @@
require_once __DIR__.'/../inc/global.inc.php';
+$origin = api_get_origin();
+
$tpl = new Template();
-$templateName = 'glossary/glossary_auto.js.tpl';
-if (api_get_setting('show_glossary_in_documents') == 'ismanual') {
- $templateName = 'glossary/glossary_manual.js.tpl';
+$glossaryExtraTools = api_get_setting('show_glossary_in_extra_tools');
+
+if ($origin == 'learnpath') {
+ $showGlossary = in_array($glossaryExtraTools, array('lp', 'exercise_and_lp'));
+} else {
+ $showGlossary = in_array($glossaryExtraTools, array('true', 'lp', 'exercise_and_lp'));
}
-$addReady = isset($_GET['add_ready']) ? true : false;
-$tpl->assign('add_ready', $addReady);
-$contentTemplate = $tpl->get_template($templateName);
-header('Content-type: application/x-javascript');
-$tpl->display($contentTemplate);
+if ($showGlossary) {
+ $templateName = 'glossary/glossary_auto.js.tpl';
+ if (api_get_setting('show_glossary_in_documents') == 'ismanual') {
+ $templateName = 'glossary/glossary_manual.js.tpl';
+ }
+
+ $addReady = isset($_GET['add_ready']) ? true : false;
+ $tpl->assign('add_ready', $addReady);
+ $contentTemplate = $tpl->get_template($templateName);
+ header('Content-type: application/x-javascript');
+ $tpl->display($contentTemplate);
+}
\ No newline at end of file
diff --git a/main/gradebook/index.php b/main/gradebook/index.php
index 73d0db9b30..95d4b58e1a 100755
--- a/main/gradebook/index.php
+++ b/main/gradebook/index.php
@@ -975,8 +975,6 @@ if (isset($first_time) && $first_time == 1 && api_is_allowed_to_edit(null, true)
if ($action == 'export_table') {
ob_clean();
- $sessionName = api_get_session_name(api_get_session_id());
- $sessionName = !empty($sessionName) ? " - $sessionName" : '';
$params = array(
'pdf_title' => sprintf(get_lang('GradeFromX'), $courseInfo['name']),
'course_code' => api_get_course_id(),
@@ -986,16 +984,11 @@ if (isset($first_time) && $first_time == 1 && api_is_allowed_to_edit(null, true)
'student_info' => api_get_user_info(),
'show_grade_generated_date' => true,
'show_real_course_teachers' => false,
- 'show_teacher_as_myself' => false
+ 'show_teacher_as_myself' => false,
+ 'orientation' => 'P'
);
$pdf = new PDF('A4', $params['orientation'], $params);
-
- $address = api_get_setting('institution_address');
- $phone = api_get_setting('administratorTelephone');
- $address = str_replace('\n', '
', $address);
- $pdf->custom_header = array('html' => "