Adding group events + colors

skala
Julio Montoya 14 years ago
parent 766eff34b9
commit 0fcb988ab7
  1. 14
      main/calendar/agenda.lib.php
  2. 5
      main/inc/ajax/agenda.ajax.php

@ -7,10 +7,11 @@ class Agenda {
$this->tbl_personal_agenda = Database::get_user_personal_table(TABLE_PERSONAL_AGENDA);
$this->events = array();
$this->event_platform_color = 'red';
$this->event_course_color = 'green';
$this->event_session_color = 'blue';
$this->event_personal_color = 'light blue';
$this->event_platform_color = 'red';//red
$this->event_course_color = '#6B8E23'; //green
$this->event_group_color = '#A0522D'; //siena
$this->event_session_color = '#000080'; // blue
$this->event_personal_color = 'steel blue'; //steel blue
}
@ -195,11 +196,16 @@ class Agenda {
$event['title'] = $row['title'];
$event['className'] = 'course';
$event['allDay'] = 'false';
// var_dump($row);
$event['borderColor'] = $event['backgroundColor'] = $this->event_course_color;
if (isset($row['session_id']) && !empty($row['session_id'])) {
$event['borderColor'] = $event['backgroundColor'] = $this->event_session_color;
}
if (isset($row['to_group_id']) && !empty($row['to_group_id'])) {
$event['borderColor'] = $event['backgroundColor'] = $this->event_group_color;
}
$event['editable'] = false;
if (!empty($row['start_date']) && $row['start_date'] != '0000-00-00 00:00:00') {

@ -10,8 +10,6 @@ require_once api_get_path(SYS_CODE_PATH).'calendar/agenda.inc.php';
require_once api_get_path(SYS_CODE_PATH).'calendar/myagenda.inc.php';
require_once api_get_path(SYS_CODE_PATH).'calendar/agenda.lib.php';
api_protect_admin_script();
$action = $_REQUEST['a'];
$agenda = new Agenda();
@ -33,6 +31,9 @@ switch ($action) {
echo $events;
break;
case 'get_user_agenda':
api_protect_admin_script();
if (api_is_allowed_to_edit(null, true)) {
//@todo move this in the agenda class
$DaysShort = api_get_week_days_short();

Loading…
Cancel
Save