Browse Source

Fix new lines when adding an event.

Julio Montoya 9 years ago
parent
commit
30af87dcb7
1 changed files with 6 additions and 1 deletions
  1. 6 1
      main/inc/lib/agenda.lib.php

+ 6 - 1
main/inc/lib/agenda.lib.php

@@ -135,8 +135,9 @@ 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;
-
         $id = null;
         $id = null;
+        $content = nl2br($content);
+
         switch ($this->type) {
         switch ($this->type) {
             case 'personal':
             case 'personal':
                 $attributes = array(
                 $attributes = array(
@@ -1743,6 +1744,10 @@ class Agenda
             $url = api_get_self().'?action='.$action.'&id='.$id.'&type='.$this->type;
             $url = api_get_self().'?action='.$action.'&id='.$id.'&type='.$this->type;
         }
         }
 
 
+        if (isset($params['content'])) {
+            $params['content'] = nl2br($params['content']);
+        }
+
         $form = new FormValidator(
         $form = new FormValidator(
             'add_event',
             'add_event',
             'post',
             'post',