mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 12:32:08 +02:00
MDL-36621 calendar: Ical event should display source info
This commit is contained in:
parent
ca48fe5f97
commit
8a7326ed4e
@ -1895,7 +1895,7 @@ class calendar_event {
|
||||
* an event
|
||||
*/
|
||||
public function __construct($data=null) {
|
||||
global $CFG, $USER;
|
||||
global $CFG, $USER, $DB;
|
||||
|
||||
// First convert to object if it is not already (should either be object or assoc array)
|
||||
if (!is_object($data)) {
|
||||
@ -1910,6 +1910,10 @@ class calendar_event {
|
||||
$data->id = null;
|
||||
}
|
||||
|
||||
if (!empty($data->subscriptionid)) {
|
||||
$data->subscription = $DB->get_record('event_subscriptions', array('id' => $data->subscriptionid));
|
||||
}
|
||||
|
||||
// Default to a user event
|
||||
if (empty($data->eventtype)) {
|
||||
$data->eventtype = 'user';
|
||||
|
@ -307,6 +307,11 @@ class core_calendar_renderer extends plugin_renderer_base {
|
||||
if (!empty($event->courselink)) {
|
||||
$table->data[0]->cells[1]->text .= html_writer::tag('div', $event->courselink, array('class'=>'course'));
|
||||
}
|
||||
if (!empty($event->subscription)) {
|
||||
$table->data[0]->cells[1]->text .= html_writer::tag('div',
|
||||
html_writer::link($event->subscription->url, get_string('subsource', 'calendar',
|
||||
$event->subscription)), array('class' => 'subscription'));
|
||||
}
|
||||
if (!empty($event->time)) {
|
||||
$table->data[0]->cells[1]->text .= html_writer::tag('span', $event->time, array('class'=>'date'));
|
||||
} else {
|
||||
|
@ -167,6 +167,7 @@ $string['subscriptions'] = 'Subscriptions';
|
||||
$string['subscriptionname'] = 'Calendar name';
|
||||
$string['subscriptionremoved'] = 'Calendar subscription {$a} removed';
|
||||
$string['subscriptionupdated'] = 'Calendar subscription {$a} updated';
|
||||
$string['subsource'] = 'Event source: {$a->name}';
|
||||
$string['sun'] = 'Sun';
|
||||
$string['sunday'] = 'Sunday';
|
||||
$string['thu'] = 'Thu';
|
||||
|
@ -32,6 +32,8 @@
|
||||
.dir-rtl.path-calendar .maincalendar .eventlist .event .topic .name {float:right;}
|
||||
.path-calendar .maincalendar .eventlist .event .topic .date {float:right;}
|
||||
.dir-rtl.path-calendar .maincalendar .eventlist .event .topic .date {float:left;}
|
||||
.path-calendar .maincalendar .eventlist .event .subscription {float:left;clear:left;}
|
||||
.dir-rtl.path-calendar .maincalendar .eventlist .event .subscription {float:right;clear:right;}
|
||||
.path-calendar .maincalendar .eventlist .event .course {float:left;clear:left;}
|
||||
.dir-rtl.path-calendar .maincalendar .eventlist .event .course {float:right;clear:right;}
|
||||
.path-calendar .maincalendar .eventlist .event .side {width:32px;}
|
||||
|
Loading…
x
Reference in New Issue
Block a user