Fixing export ical bug in the global agenda

skala
Julio Montoya 13 years ago
parent e3c0921487
commit 78c13d1992
  1. 1
      main/calendar/agenda.lib.php
  2. 8
      main/calendar/ical_export.php
  3. 9
      main/inc/lib/template.lib.php
  4. 4
      main/template/default/agenda/month.tpl

@ -360,6 +360,7 @@ class Agenda {
}
break;
case 'admin':
case 'platform':
$sql = " SELECT * FROM ".$this->tbl_global_agenda." WHERE id=".$id;
$result = Database::query($sql);
if (Database::num_rows($result)) {

@ -44,8 +44,11 @@ $agenda = new Agenda();
$agenda->type = $type; //course,admin or personal
if (isset($_GET['course_id'])) {
$course_info = api_get_course_info_by_id($_GET['course_id']);
$agenda->set_course($course_info);
if (!empty($course_info)) {
$agenda->set_course($course_info);
}
}
$event = $agenda->get_event($id);
if (!empty($event)) {
@ -75,10 +78,11 @@ if (!empty($event)) {
$event['start_date'] = api_get_local_time($event['start_date']);
$event['end_date'] = api_get_local_time($event['end_date']);
//var_dump($event);
switch($type) {
case 'personal':
case 'platform':
$vevent->setProperty( 'summary', api_convert_encoding($event['title'],'UTF-8', $charset));
if(empty($event['start_date'])){header('location:'.Security::remove_XSS($_SERVER['HTTP_REFERER']));}
list($y,$m,$d,$h,$M,$s) = preg_split('/[\s:-]/',$event['start_date']);

@ -25,6 +25,7 @@ class Template extends Smarty {
var $menu_navigation = array();
var $show_learnpath = false;
var $plugin = null;
var $course_id = null;
function __construct($title = '', $show_header = true, $show_footer = true, $show_learnpath = false) {
parent::__construct();
@ -71,6 +72,10 @@ class Template extends Smarty {
$this->set_header_parameters();
$this->set_footer_parameters();
//Setting course id
$course_id = api_get_course_int_id();
$this->course_id = $course_id;
$this->assign('style', $this->style);
//Chamilo plugins
@ -188,8 +193,8 @@ class Template extends Smarty {
}
$this->assign('show_toolbar', $show_toolbar);
//Only if course is available
if (api_get_cidreq()) {
//Only if course is available
if (!empty($this->course_id)) {
if (api_get_setting('show_toolshortcuts') != 'false') {
//Course toolbar
$course_tool = CourseHome::show_navigation_tool_shortcuts();

@ -268,8 +268,8 @@ $(document).ready(function() {
$("#dialog-form").dialog({
buttons: {
'{"ExportiCalConfidential"|get_lang}' : function() {
url = "ical_export.php?id=" + calEvent.id+'&course_id='+calEvent.course_id+"&class=confidential";
'{"ExportiCalConfidential"|get_lang}' : function() {
url = "ical_export.php?id=" + calEvent.id+'&course_id='+calEvent.course_id+"&class=confidential";
window.location.href = url;
},

Loading…
Cancel
Save