From aa2238f8283d9ad799a3ebd308f906d3910c3804 Mon Sep 17 00:00:00 2001 From: NeuroPastor Date: Tue, 21 May 2019 16:11:15 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=BA=D0=B0=D1=81=D1=82=D0=BE=D0=BC=D0=BD=D0=B0?= =?UTF-8?q?=D1=8F=20=D0=B4=D0=B0=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Кастомная дата необходима для импорта комментариев в Tickets с сохранением оригинальной даты комментария --- .../tickets/processors/web/comment/create.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/components/tickets/processors/web/comment/create.class.php b/core/components/tickets/processors/web/comment/create.class.php index b7872a1..2ff22f9 100644 --- a/core/components/tickets/processors/web/comment/create.class.php +++ b/core/components/tickets/processors/web/comment/create.class.php @@ -87,12 +87,17 @@ public function beforeSet() unset($properties['requiredFields']); // Comment values + if($this->getProperty("date")){ + $date = $this->getProperty("date"); + } else { + $date = date('Y-m-d H:i:s'); + } $ip = $this->modx->request->getClientIp(); $this->setProperties(array( 'text' => $text, 'thread' => $this->thread->id, 'ip' => $ip['ip'], - 'createdon' => date('Y-m-d H:i:s'), + 'createdon' => $date, 'createdby' => $this->modx->user->isAuthenticated($this->modx->context->key) ? $this->modx->user->id : 0,