change structure get notes

This commit is contained in:
Ronald Quenta
2015-04-30 20:50:36 -04:00
parent f8b46ff3b1
commit b61ea69be5

View File

@@ -886,11 +886,11 @@ class Light extends Api
$dataList['dateTo'] = $date_to; $dataList['dateTo'] = $date_to;
$dataList['search'] = $search; $dataList['search'] = $search;
$usr_uid = $this->getUserId(); $appNotes = new \AppNotes();
$cases = new \ProcessMaker\BusinessModel\Cases(); $response = $appNotes->getNotesList( $app_uid, '', $start, $limit );
$response = $cases->getCaseNotes($app_uid, $usr_uid, $dataList); $response = $this->parserDataNotes($response['array']['notes']);
$result = $this->parserDataNotes($response['data']);
return $result; return $response;
} catch (\Exception $e) { } catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
} }
@@ -899,11 +899,17 @@ class Light extends Api
public function parserDataNotes ($data) public function parserDataNotes ($data)
{ {
$structure = array( $structure = array(
'app_uid' => 'caseId', 'APP_UID' => 'caseId',
'usr_uid' => 'userId',
'notes' => array( 'notes' => array(
'note_date' => 'date', 'NOTE_DATE' => 'date',
'note_content' => 'content' 'NOTE_CONTENT' => 'content'
),
'user' => array(
'USR_UID' => 'userId',
'USR_USERNAME' => 'name',
'USR_FIRSTNAME' => 'fristName',
'USR_LASTNAME' => 'lastName',
'USR_EMAIL' => 'email'
) )
); );