Added saving Remarks to workorder and to rimo in Preorder

This commit is contained in:
Frank Schubert
2025-03-04 18:26:27 +01:00
parent dc4755d7fd
commit cf7f70b7ea
4 changed files with 123 additions and 0 deletions

View File

@@ -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;
}
}