mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-19 15:22:17 +02:00
(Retrofit from trunk) N.519 REST/JSON Add a comment in pure text into the case log (only for add_item/items syntaxes, use format="text")
SVN:2.3[4620]
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
// Copyright (C) 2010-2016 Combodo SARL
|
// Copyright (C) 2010-2017 Combodo SARL
|
||||||
//
|
//
|
||||||
// This file is part of iTop.
|
// This file is part of iTop.
|
||||||
//
|
//
|
||||||
@@ -23,7 +23,7 @@ define('CASELOG_SEPARATOR', "\n".'========== %1$s : %2$s (%3$d) ============'."\
|
|||||||
/**
|
/**
|
||||||
* Class to store a "case log" in a structured way, keeping track of its successive entries
|
* Class to store a "case log" in a structured way, keeping track of its successive entries
|
||||||
*
|
*
|
||||||
* @copyright Copyright (C) 2010-2016 Combodo SARL
|
* @copyright Copyright (C) 2010-2017 Combodo SARL
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
class ormCaseLog {
|
class ormCaseLog {
|
||||||
@@ -568,8 +568,6 @@ class ormCaseLog {
|
|||||||
|
|
||||||
public function AddLogEntryFromJSON($oJson, $bCheckUserId = true)
|
public function AddLogEntryFromJSON($oJson, $bCheckUserId = true)
|
||||||
{
|
{
|
||||||
$sText = HTMLSanitizer::Sanitize(isset($oJson->message) ? $oJson->message : '');
|
|
||||||
|
|
||||||
if (isset($oJson->user_id))
|
if (isset($oJson->user_id))
|
||||||
{
|
{
|
||||||
if (!UserRights::IsAdministrator())
|
if (!UserRights::IsAdministrator())
|
||||||
@@ -616,10 +614,16 @@ class ormCaseLog {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// TODO: what is the default format ? text ?
|
// The default is HTML
|
||||||
$sFormat = 'html';
|
$sFormat = 'html';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$sText = isset($oJson->message) ? $oJson->message : '';
|
||||||
|
if ($sFormat == 'html')
|
||||||
|
{
|
||||||
|
$sText = HTMLSanitizer::Sanitize($sText);
|
||||||
|
}
|
||||||
|
|
||||||
$sDate = date(AttributeDateTime::GetInternalFormat(), $iDate);
|
$sDate = date(AttributeDateTime::GetInternalFormat(), $iDate);
|
||||||
|
|
||||||
$sSeparator = sprintf(CASELOG_SEPARATOR, $sDate, $sOnBehalfOf, $iUserId);
|
$sSeparator = sprintf(CASELOG_SEPARATOR, $sDate, $sOnBehalfOf, $iUserId);
|
||||||
|
|||||||
Reference in New Issue
Block a user