diff --git a/main/cron/import_csv.php b/main/cron/import_csv.php index c2b64d4999..dd9f3b82f4 100755 --- a/main/cron/import_csv.php +++ b/main/cron/import_csv.php @@ -1160,7 +1160,7 @@ class ImportCsv } else { $report['mail_not_sent_announcement_exists']++; $this->logger->addInfo( - "Mail NOT sent. An announcement seems to be already saved in $info" + "Mail NOT sent. An announcement seems to be already saved in '$info'" ); } } else { @@ -1168,7 +1168,6 @@ class ImportCsv $report['mail_not_sent_because_date']++; } } - $content = ''; if ($update && isset($item['item_id'])) { //the event already exists, just update @@ -1185,7 +1184,8 @@ class ImportCsv $eventComment, $color, false, - false + false, + $this->defaultAdminId ); if ($eventResult !== false) { @@ -1215,7 +1215,6 @@ class ImportCsv ); if (!empty($eventId)) { - //$extraFieldValue->is_course_model = true; $extraFieldValue->save( array( 'value' => $externalEventId, diff --git a/main/inc/lib/agenda.lib.php b/main/inc/lib/agenda.lib.php index 613eb05ac6..e1172dbab2 100644 --- a/main/inc/lib/agenda.lib.php +++ b/main/inc/lib/agenda.lib.php @@ -675,6 +675,7 @@ class Agenda * @param string $color * @param bool $addAnnouncement * @param bool $updateContent + * @param int $authorId * * @return null|false */ @@ -691,11 +692,13 @@ class Agenda $comment = null, $color = '', $addAnnouncement = false, - $updateContent = true + $updateContent = true, + $authorId = 0 ) { $start = api_get_utc_datetime($start); $end = api_get_utc_datetime($end); $allDay = isset($allDay) && $allDay == 'true' ? 1 : 0; + $authorId = empty($authorId) ? api_get_user_id() : (int) $authorId; switch ($this->type) { case 'personal': @@ -846,7 +849,7 @@ class Agenda TOOL_CALENDAR_EVENT, $id, 'visible', - api_get_user_id(), + $authorId, $groupIid, null, $start, @@ -882,7 +885,7 @@ class Agenda TOOL_CALENDAR_EVENT, $id, 'visible', - api_get_user_id(), + $authorId, $groupIidItem, 0, $start, @@ -924,7 +927,7 @@ class Agenda TOOL_CALENDAR_EVENT, $id, 'visible', - api_get_user_id(), + $authorId, $groupIid, $userId, $start,