In original calendar feature of Moodle, you need to select day and month after entering "New event" button.
If you apply following modifications, you can add a new event directly at the monthly view calendar and the mini monthly view calendar.
(1) calender/view.php, function calendar_show_month_detailed(), Line442.
Adding hyper-link to add a new eventy for "every day" in monthly view calendar.
// Special visual fx if an event is defined
if(isset($eventsbyday[$day])) {
else {
if(isset($eventsbyday[$day])) {
if(isset($typesbyday[$day]['startglobal'])) {
else if(isset($typesbyday[$day]['startcourse'])) {
else if(isset($typesbyday[$day]['startgroup'])) {
else if(isset($typesbyday[$day]['startuser'])) {
if(count($eventsbyday[$day]) == 1) {
else {
$cell = '<div class="day"><a href="'.$dayhref.'" title="'.$title.'">'.$day.'</a></div>';
} $class .= ' event_global';
}else if(isset($typesbyday[$day]['startcourse'])) {
$class .= ' event_course';
}else if(isset($typesbyday[$day]['startgroup'])) {
$class .= ' event_group';
}else if(isset($typesbyday[$day]['startuser'])) {
$class .= ' event_user';
}if(count($eventsbyday[$day]) == 1) {
$title = get_string('oneevent', 'calendar');
}else {
$title = get_string('manyevents', 'calendar', count($eventsbyday[$day]));
}$cell = '<div class="day"><a href="'.$dayhref.'" title="'.$title.'">'.$day.'</a></div>';
else {
// $cell = '<div class="day">'.$day.'</div>';
$cell = '<div class="day"><a href="'.$dayhref.'">'.$day.'</a></div>';
}$cell = '<div class="day"><a href="'.$dayhref.'">'.$day.'</a></div>';
(2) moodle/calendar/lib.php, function calendar_get_mini(), Line270.
Adding hyper-link to add a new eventy for "every day" in mini monthly view calendar.
// Class and cell content
if(isset($typesbyday[$day]['startglobal'])) {
else if(isset($typesbyday[$day]['startcourse'])) {
else if(isset($typesbyday[$day]['startgroup'])) {
else if(isset($typesbyday[$day]['startuser'])) {
$cell = '<a href="'.$dayhref.'" '.$popup.'>'.$day.'</a>';
}if(isset($typesbyday[$day]['startglobal'])) {
$class .= ' event_global';
}else if(isset($typesbyday[$day]['startcourse'])) {
$class .= ' event_course';
}else if(isset($typesbyday[$day]['startgroup'])) {
$class .= ' event_group';
}else if(isset($typesbyday[$day]['startuser'])) {
$class .= ' event_user';
}$cell = '<a href="'.$dayhref.'" '.$popup.'>'.$day.'</a>';
else {
// $cell = $day;
$dayhref = calendar_get_link_href(CALENDAR_URL.'view.php?view=day'.$morehref.'&', $day, $m, $y);
$cell = '<a href="'.$dayhref.'">'.$day.'</a>';
}$dayhref = calendar_get_link_href(CALENDAR_URL.'view.php?view=day'.$morehref.'&', $day, $m, $y);
$cell = '<a href="'.$dayhref.'">'.$day.'</a>';
(3) moodle/calendar/lib.php, function calendar_get_mini(), Line295.
Adding hyper-link to add a new eventy for "today day" pop-up (there is no event) in mini monthly view calendar.
// Special visual fx for today
//Accessibility: hidden text for today, and popup.
if($display->thismonth && $day == $d) {
//Accessibility: hidden text for today, and popup.
if($display->thismonth && $day == $d) {
$class .= ' today';
$today = get_string('today', 'calendar').' '.userdate(time(), get_string('strftimedayshort'));
if(! isset($eventsbyday[$day])) {
$cell = get_accesshide($today.' ').$cell;
}$today = get_string('today', 'calendar').' '.userdate(time(), get_string('strftimedayshort'));
if(! isset($eventsbyday[$day])) {
// $class .= ' eventnone';
// $popup = calendar_get_popup(true, false);
// $cell = '<a href="#" '.$popup.'>'.$day.'</a>';
$dayhref = calendar_get_link_href(CALENDAR_URL.'view.php?view=day'.$morehref.'&', $day, $m, $y);
$popupcontent = '<div><a href="'.$dayhref.'">'.get_string('eventnone', 'calendar').'</a></div>';
$popup = calendar_get_popup(false, time(), $popupcontent);
$cell = '<a href="'.$dayhref.'" '.$popup.'>'.$day.'</a>';
}// $popup = calendar_get_popup(true, false);
// $cell = '<a href="#" '.$popup.'>'.$day.'</a>';
$dayhref = calendar_get_link_href(CALENDAR_URL.'view.php?view=day'.$morehref.'&', $day, $m, $y);
$popupcontent = '<div><a href="'.$dayhref.'">'.get_string('eventnone', 'calendar').'</a></div>';
$popup = calendar_get_popup(false, time(), $popupcontent);
$cell = '<a href="'.$dayhref.'" '.$popup.'>'.$day.'</a>';
$cell = get_accesshide($today.' ').$cell;
Let's try these modifications. You will be able to add new event happily.