Browse Source

Fix create/update agenda event

Julio Montoya 9 years ago
parent
commit
e10203bd24
2 changed files with 5 additions and 2 deletions
  1. 2 2
      main/calendar/agenda_js.php
  2. 3 0
      main/inc/lib/agenda.lib.php

+ 2 - 2
main/calendar/agenda_js.php

@@ -5,7 +5,7 @@
  * @package chamilo.calendar
  * @package chamilo.calendar
  */
  */
 
 
-use \ChamiloSession as Session;
+use ChamiloSession as Session;
 
 
 // use anonymous mode when accessing this course tool
 // use anonymous mode when accessing this course tool
 $use_anonymous = true;
 $use_anonymous = true;
@@ -232,7 +232,7 @@ if ($agenda->type == 'course') {
     $form->addElement('textarea', 'comment', get_lang('Comment'), array('id' => 'comment'));
     $form->addElement('textarea', 'comment', get_lang('Comment'), array('id' => 'comment'));
 }
 }
 
 
-$tpl->assign('form_add', $form->return_form());
+$tpl->assign('form_add', $form->returnForm());
 
 
 // Loading Agenda template.
 // Loading Agenda template.
 $content = $tpl->fetch('default/agenda/month.tpl');
 $content = $tpl->fetch('default/agenda/month.tpl');

+ 3 - 0
main/inc/lib/agenda.lib.php

@@ -137,6 +137,7 @@ class Agenda
         $allDay = isset($allDay) && $allDay == 'true' ? 1 : 0;
         $allDay = isset($allDay) && $allDay == 'true' ? 1 : 0;
         $id = null;
         $id = null;
         $content = nl2br($content);
         $content = nl2br($content);
+        $eventComment = nl2br($eventComment);
 
 
         switch ($this->type) {
         switch ($this->type) {
             case 'personal':
             case 'personal':
@@ -561,6 +562,8 @@ class Agenda
         $start = api_get_utc_datetime($start);
         $start = api_get_utc_datetime($start);
         $end = api_get_utc_datetime($end);
         $end = api_get_utc_datetime($end);
         $allDay = isset($allDay) && $allDay == 'true' ? 1 : 0;
         $allDay = isset($allDay) && $allDay == 'true' ? 1 : 0;
+        $content = nl2br($content);
+        $comment = nl2br($comment);
 
 
         switch ($this->type) {
         switch ($this->type) {
             case 'personal':
             case 'personal':