Merged in bugfix/HOR-3556-B (pull request #6058)
HOR-3556 Approved-by: Julio Cesar Laura Avendaño <contact@julio-laura.com>
This commit is contained in:
committed by
Julio Cesar Laura Avendaño
commit
d5c8707fcf
@@ -6969,11 +6969,20 @@ class Cases
|
|||||||
return $response;
|
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 = '')
|
public function getCaseNotes($applicationID, $type = 'array', $userUid = '')
|
||||||
{
|
{
|
||||||
require_once("classes/model/AppNotes.php");
|
require_once("classes/model/AppNotes.php");
|
||||||
$appNotes = new AppNotes();
|
$appNotes = new AppNotes();
|
||||||
$appNotes = $appNotes->getNotesList($applicationID, $userUid);
|
$appNotes = $appNotes->getNotesList($applicationID, $userUid);
|
||||||
|
$appNotes = AppNotes::applyHtmlentitiesInNotes($appNotes);
|
||||||
|
|
||||||
$response = '';
|
$response = '';
|
||||||
if (is_array($appNotes)) {
|
if (is_array($appNotes)) {
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
@@ -7005,10 +7014,10 @@ class Cases
|
|||||||
$response = '';
|
$response = '';
|
||||||
foreach ($appNotes['array']['notes'] as $key => $value) {
|
foreach ($appNotes['array']['notes'] as $key => $value) {
|
||||||
$response .= $value['USR_FIRSTNAME'] . " " .
|
$response .= $value['USR_FIRSTNAME'] . " " .
|
||||||
$value['USR_LASTNAME'] . " " .
|
$value['USR_LASTNAME'] . " " .
|
||||||
"(" . $value['USR_USERNAME'] . ")" .
|
"(" . $value['USR_USERNAME'] . ")" .
|
||||||
" " . $value['NOTE_CONTENT'] . " " . " (" . $value['NOTE_DATE'] . " ) " .
|
" " . $value['NOTE_CONTENT'] . " " . " (" . $value['NOTE_DATE'] . " ) " .
|
||||||
" \n";
|
" \n";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2788,7 +2788,7 @@ class WsBase
|
|||||||
public function getCaseNotes($applicationID, $userUid = '')
|
public function getCaseNotes($applicationID, $userUid = '')
|
||||||
{
|
{
|
||||||
try {
|
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();
|
$var = array();
|
||||||
|
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ class AppNotes extends BaseAppNotes
|
|||||||
$oDataset->next();
|
$oDataset->next();
|
||||||
|
|
||||||
while ($aRow = $oDataset->getRow()) {
|
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;
|
$response['notes'][] = $aRow;
|
||||||
$oDataset->next();
|
$oDataset->next();
|
||||||
}
|
}
|
||||||
@@ -240,5 +240,21 @@ class AppNotes extends BaseAppNotes
|
|||||||
|
|
||||||
return $response;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -73,14 +73,11 @@ class AppProxy extends HttpProxyController
|
|||||||
$proUid = $httpData->pro;
|
$proUid = $httpData->pro;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!isset($httpData->tas) || empty($httpData->tas))
|
if (!isset($httpData->tas) || empty($httpData->tas)) {
|
||||||
{
|
$tasUid = isset($_SESSION['TASK']) ? $_SESSION['TASK'] : "";
|
||||||
$tasUid = $_SESSION['TASK'];
|
|
||||||
} else {
|
} else {
|
||||||
$tasUid = $httpData->tas;
|
$tasUid = $httpData->tas;
|
||||||
}
|
}
|
||||||
//$proUid = (!isset($httpData->pro)) ? $_SESSION['PROCESS'] : $httpData->pro;
|
|
||||||
//$tasUid = (!isset($httpData->tas)) ? ((isset($_SESSION['TASK'])) ? $_SESSION['TASK'] : '') : $httpData->tas;
|
|
||||||
$usrUid = $_SESSION['USER_LOGGED'];
|
$usrUid = $_SESSION['USER_LOGGED'];
|
||||||
|
|
||||||
$respView = $case->getAllObjectsFrom($proUid, $appUid, $tasUid, $usrUid, "VIEW", $delIndex);
|
$respView = $case->getAllObjectsFrom($proUid, $appUid, $tasUid, $usrUid, "VIEW", $delIndex);
|
||||||
@@ -91,11 +88,12 @@ class AppProxy extends HttpProxyController
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$usrUid = isset( $_SESSION['USER_LOGGED'] ) ? $_SESSION['USER_LOGGED'] : "";
|
$usrUid = isset($_SESSION['USER_LOGGED']) ? $_SESSION['USER_LOGGED'] : "";
|
||||||
$appNotes = new AppNotes();
|
$appNotes = new AppNotes();
|
||||||
$response = $appNotes->getNotesList( $appUid, '', $httpData->start, $httpData->limit );
|
$response = $appNotes->getNotesList($appUid, '', $httpData->start, $httpData->limit);
|
||||||
|
$response = AppNotes::applyHtmlentitiesInNotes($response);
|
||||||
|
|
||||||
require_once ("classes/model/Application.php");
|
require_once("classes/model/Application.php");
|
||||||
$oApplication = new Application();
|
$oApplication = new Application();
|
||||||
$aApplication = $oApplication->Load($appUid);
|
$aApplication = $oApplication->Load($appUid);
|
||||||
$response['array']['appTitle'] = $aApplication['APP_TITLE'];
|
$response['array']['appTitle'] = $aApplication['APP_TITLE'];
|
||||||
|
|||||||
@@ -544,7 +544,9 @@ class Home extends Controller
|
|||||||
$cases['data'][$i]['APP_DEL_PREVIOUS_USER'] = ucwords( $row['APP_DEL_PREVIOUS_USER'] );
|
$cases['data'][$i]['APP_DEL_PREVIOUS_USER'] = ucwords( $row['APP_DEL_PREVIOUS_USER'] );
|
||||||
}
|
}
|
||||||
// Completting with Notes
|
// Completting with Notes
|
||||||
$notes = $appNotes->getNotesList( $row['APP_UID'], '', $notesStart, $notesLimit );
|
$notes = $appNotes->getNotesList($row['APP_UID'], '', $notesStart, $notesLimit);
|
||||||
|
$notes = AppNotes::applyHtmlentitiesInNotes($notes);
|
||||||
|
|
||||||
$notes = $notes['array'];
|
$notes = $notes['array'];
|
||||||
|
|
||||||
$cases['data'][$i]['NOTES_COUNT'] = $notes['totalCount'];
|
$cases['data'][$i]['NOTES_COUNT'] = $notes['totalCount'];
|
||||||
|
|||||||
Reference in New Issue
Block a user