Adding all_day when exporting events see #5499

skala
Julio Montoya 13 years ago
parent 4f83887912
commit fd645009ae
  1. 5
      main/coursecopy/classes/CourseBuilder.class.php
  2. 2
      main/coursecopy/classes/CourseRestorer.class.php
  3. 10
      main/coursecopy/classes/Event.class.php

@ -655,9 +655,8 @@ class CourseBuilder {
$att_filename = $attachment_obj->filename;
$att_size = $attachment_obj->size;
$atth_comment = $attachment_obj->comment;
}
$event = new Event($obj->id, $obj->title, $obj->content, $obj->start_date, $obj->end_date, $att_path, $att_filename, $att_size, $atth_comment);
}
$event = new Event($obj->id, $obj->title, $obj->content, $obj->start_date, $obj->end_date, $att_path, $att_filename, $att_size, $atth_comment, $obj->all_day);
$this->course->add_resource($event);
}

@ -937,8 +937,10 @@ class CourseRestorer
c_id = ".$this->destination_course_id." ,
title = '".self::DBUTF8escapestring($event->title)."',
content = '".self::DBUTF8escapestring($event->content)."',
all_day = '".$event->all_day."',
start_date = '".$event->start_date."',
end_date = '".$event->end_date."'";
Database::query($sql);
$new_event_id = Database::insert_id();
$this->course->resources[RESOURCE_EVENT][$id]->destination_id = $new_event_id;

@ -60,25 +60,25 @@ class Event extends Resource
* @param string $hour
* @param int $duration
*/
function Event($id,$title,$content,$start_date,$end_date, $attachment_path = null, $attachment_filename= null, $attachment_size= null, $attachment_comment= null) {
function Event($id, $title, $content, $start_date, $end_date, $attachment_path = null, $attachment_filename= null, $attachment_size= null, $attachment_comment= null, $all_day = 0) {
parent::Resource($id,RESOURCE_EVENT);
$this->title = $title;
$this->content = $content;
$this->start_date = $start_date;
$this->end_date = $end_date;
$this->all_day = $all_day;
$this->attachment_path = $attachment_path;
$this->attachment_filename = $attachment_filename;
$this->attachment_size = $attachment_size;
$this->attachment_comment = $attachment_comment;
$this->attachment_comment = $attachment_comment;
}
/**
* Show this Event
*/
function show()
{
function show() {
parent::show();
echo $this->title.' ('.$this->start_date.' -> '.$this->end_date.')';
}

Loading…
Cancel
Save