bugfix/HOR-3556

udpate

update

update

update

update

update

update

change function to static

update

update
This commit is contained in:
hjonathan
2017-09-12 08:28:55 -04:00
parent 8699650919
commit 2e46e670c7
5 changed files with 40 additions and 15 deletions

View File

@@ -6969,11 +6969,20 @@ class Cases
return $response;
}
/**
* This method return the cases notes
* @param $applicationID
* @param string $type
* @param string $userUid
* @return array|stdclass|string
*/
public function getCaseNotes($applicationID, $type = 'array', $userUid = '')
{
require_once("classes/model/AppNotes.php");
$appNotes = new AppNotes();
$appNotes = $appNotes->getNotesList($applicationID, $userUid);
$appNotes = AppNotes::applyHtmlentitiesInNotes($appNotes);
$response = '';
if (is_array($appNotes)) {
switch ($type) {
@@ -7005,10 +7014,10 @@ class Cases
$response = '';
foreach ($appNotes['array']['notes'] as $key => $value) {
$response .= $value['USR_FIRSTNAME'] . " " .
$value['USR_LASTNAME'] . " " .
"(" . $value['USR_USERNAME'] . ")" .
" " . $value['NOTE_CONTENT'] . " " . " (" . $value['NOTE_DATE'] . " ) " .
" \n";
$value['USR_LASTNAME'] . " " .
"(" . $value['USR_USERNAME'] . ")" .
" " . $value['NOTE_CONTENT'] . " " . " (" . $value['NOTE_DATE'] . " ) " .
" \n";
}
break;
}

View File

@@ -2788,7 +2788,7 @@ class WsBase
public function getCaseNotes($applicationID, $userUid = '')
{
try {
$result = new wsGetCaseNotesResponse(0, G::loadTranslation('ID_SUCCESS'), Cases::getCaseNotes($applicationID, 'array', $userUid));
$result = new WsGetCaseNotesResponse(0, G::loadTranslation('ID_SUCCESS'), Cases::getCaseNotes($applicationID, 'array', $userUid));
$var = array();

View File

@@ -83,7 +83,7 @@ class AppNotes extends BaseAppNotes
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$aRow['NOTE_CONTENT'] = htmlentities(stripslashes($aRow['NOTE_CONTENT']), ENT_QUOTES, 'UTF-8');
$aRow['NOTE_CONTENT'] = stripslashes($aRow['NOTE_CONTENT']);
$response['notes'][] = $aRow;
$oDataset->next();
}
@@ -240,5 +240,21 @@ class AppNotes extends BaseAppNotes
return $response;
}
/**
* Add htmlEntities to notes in node_content
* @param $notes
* @return array
*/
public static function applyHtmlentitiesInNotes($notes)
{
if (isset($notes) && isset($notes["array"])) {
foreach ($notes["array"]["notes"] as &$note) {
$note["NOTE_CONTENT"] = htmlentities($note["NOTE_CONTENT"], ENT_QUOTES, 'UTF-8');
}
}
return $notes;
}
}