mirror of
https://github.com/Karaka-Management/oms-OnlineResourceWatcher.git
synced 2026-01-11 07:58:42 +00:00
bug fixes and subscription improvements
This commit is contained in:
parent
00057a7a2d
commit
83757a469d
|
|
@ -30,6 +30,35 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"1008000002": {
|
||||
"name": "Inform users",
|
||||
"description": {
|
||||
"en": "Inform users about changes",
|
||||
"de": "Informiere Nutzer über Änderungen"
|
||||
},
|
||||
"function_type": "Api",
|
||||
"function": "informUsers",
|
||||
"module": "OnlineResourceWatcher",
|
||||
"inputs": [
|
||||
"unit",
|
||||
"{*}"
|
||||
],
|
||||
"outputs": [
|
||||
"resources[]",
|
||||
"{*}"
|
||||
],
|
||||
"settings": {
|
||||
"unit": {
|
||||
"type": "input",
|
||||
"subtype": "number",
|
||||
"default": null,
|
||||
"title": {
|
||||
"en": "Unit",
|
||||
"de": "Unit"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -186,6 +186,41 @@ final class ApiController extends Controller
|
|||
$this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Resources', 'Resources were checked.', null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Inform users about changed resources
|
||||
*
|
||||
* @param mixed $var Generic variable
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function informUsers(mixed $var = null) : void
|
||||
{
|
||||
$dateTime = new \DateTime('now');
|
||||
$dateTime = $dateTime->modify('-1 hour');
|
||||
|
||||
$reports = ReportMapper::getAll()
|
||||
->where('status', ReportStatus::CHANGE)
|
||||
->where('createdAt', $dateTime, '>=')
|
||||
->execute();
|
||||
|
||||
foreach ($reports as $report) {
|
||||
// @todo: get templates
|
||||
// @todo: get users to inform
|
||||
// @todo: inform users
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks resources for changes
|
||||
*
|
||||
* @param mixed $var Generic variable
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function checkResources(mixed $var = null) : array
|
||||
{
|
||||
$changed = [];
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user