Added saving Remarks to workorder and to rimo in Preorder
This commit is contained in:
@@ -464,5 +464,38 @@ class Rimoapi {
|
||||
return $resp_data;
|
||||
}
|
||||
|
||||
public static function addRemark($object_id, $text) {
|
||||
if(!$object_id || !$text) return false;
|
||||
|
||||
$log = mfLoghandler::singleton();
|
||||
|
||||
$params = [];
|
||||
$params['apiKey'] = RIMO_API_JSON_APIKEY;
|
||||
$params['objectId'] = $object_id;
|
||||
$params['text'] = $text;
|
||||
|
||||
$ctx_opts = [
|
||||
'http' => [
|
||||
'method' => 'GET',
|
||||
'header' => 'accept: application/json'
|
||||
]
|
||||
];
|
||||
|
||||
$qs = http_build_query($params);
|
||||
|
||||
$addRemarkEp = RIMO_API_JSON_URL.RIMO_API_JSON_EP_ADD_REMARK;
|
||||
|
||||
$get_url = $addRemarkEp."?".$qs;
|
||||
$ctx = stream_context_create($ctx_opts);
|
||||
$log->debug(__METHOD__.": Adding Remark to $object_id: $get_url");
|
||||
$response = file_get_contents($get_url, false, $ctx);
|
||||
|
||||
if($response === false) {
|
||||
$log->error("Error adding Remark to $object_id");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user