mirror of
https://github.com/espocrm/espocrm.git
synced 2026-06-28 06:56:05 +00:00
dev scheduled job
This commit is contained in:
@@ -12,7 +12,7 @@ class Admin extends \Espo\Core\Controllers\Base
|
||||
if (!$this->getUser()->isAdmin()) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function actionRebuild($params, $data)
|
||||
{
|
||||
|
||||
14
application/Espo/Controllers/ScheduledJob.php
Normal file
14
application/Espo/Controllers/ScheduledJob.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace Espo\Controllers;
|
||||
|
||||
class ScheduledJob extends \Espo\Core\Controllers\Record
|
||||
{
|
||||
protected function checkGlobalAccess()
|
||||
{
|
||||
if (!$this->getUser()->isAdmin()) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
14
application/Espo/Controllers/ScheduledJobLogRecord.php
Normal file
14
application/Espo/Controllers/ScheduledJobLogRecord.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace Espo\Controllers;
|
||||
|
||||
class ScheduledJobLogRecord extends \Espo\Core\Controllers\Record
|
||||
{
|
||||
protected function checkGlobalAccess()
|
||||
{
|
||||
if (!$this->getUser()->isAdmin()) {
|
||||
throw new Forbidden();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
8
application/Espo/Entities/ScheduledJob.php
Normal file
8
application/Espo/Entities/ScheduledJob.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Espo\Entities;
|
||||
|
||||
class ScheduledJob extends \Espo\Core\ORM\Entity
|
||||
{
|
||||
|
||||
}
|
||||
8
application/Espo/Entities/ScheduledJobLogRecord.php
Normal file
8
application/Espo/Entities/ScheduledJobLogRecord.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Espo\Entities;
|
||||
|
||||
class ScheduledJobLogRecord extends \Espo\Core\ORM\Entity
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
[
|
||||
{
|
||||
"rows": [
|
||||
[{"name": "name"}, {"name": "status"}],
|
||||
[{"name": "job"}],
|
||||
[{"name": "scheduling"}]
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1 @@
|
||||
[{"name":"name","width":30,"link":true},{"name":"job"},{"name":"status"}]
|
||||
@@ -0,0 +1 @@
|
||||
["log"]
|
||||
@@ -0,0 +1 @@
|
||||
[{"name":"name"},{"name":"status"},{"name":"executionTime"},{"name":"createdAt"}]
|
||||
@@ -7,6 +7,11 @@
|
||||
"label":"Settings",
|
||||
"description":"System settings of application."
|
||||
},
|
||||
{
|
||||
"url":"#ScheduledJob",
|
||||
"label":"Scheduled Jobs",
|
||||
"description":"Jobs which are executed by cron."
|
||||
},
|
||||
{
|
||||
"url":"#Admin/clearCache",
|
||||
"label":"Clear Cache",
|
||||
|
||||
@@ -4,10 +4,6 @@
|
||||
"type": "varchar",
|
||||
"required": true
|
||||
},
|
||||
"subject": {
|
||||
"type": "varchar",
|
||||
"required": true
|
||||
},
|
||||
"body": {
|
||||
"type": "text"
|
||||
},
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"fields": {
|
||||
"name": {
|
||||
"type": "varchar",
|
||||
"required": true
|
||||
},
|
||||
"job": {
|
||||
"type": "varchar",
|
||||
"required": true
|
||||
},
|
||||
"status": {
|
||||
"type": "enum",
|
||||
"options": ["Active", "Inactive"]
|
||||
},
|
||||
"scheduling": {
|
||||
"type": "varchar",
|
||||
"required": true
|
||||
},
|
||||
"createdAt": {
|
||||
"type": "datetime",
|
||||
"readOnly": true
|
||||
},
|
||||
"modifiedAt": {
|
||||
"type": "datetime",
|
||||
"readOnly": true
|
||||
},
|
||||
"createdBy": {
|
||||
"type": "link",
|
||||
"readOnly": true
|
||||
},
|
||||
"modifiedBy": {
|
||||
"type": "link",
|
||||
"readOnly": true
|
||||
}
|
||||
},
|
||||
"links": {
|
||||
"createdBy": {
|
||||
"type": "belongsTo",
|
||||
"entity": "User"
|
||||
},
|
||||
"modifiedBy": {
|
||||
"type": "belongsTo",
|
||||
"entity": "User"
|
||||
},
|
||||
"log": {
|
||||
"type": "hasMany",
|
||||
"entity": "ScheduledJobLogRecord",
|
||||
"foreign": "scheduledJob"
|
||||
}
|
||||
},
|
||||
"collection": {
|
||||
"sortBy": "name",
|
||||
"asc": true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"fields": {
|
||||
"name": {
|
||||
"type": "varchar",
|
||||
"required": true,
|
||||
"readOnly": true
|
||||
},
|
||||
"status": {
|
||||
"type": "varchar",
|
||||
"readOnly": true
|
||||
},
|
||||
"executionTime": {
|
||||
"type": "varchar",
|
||||
"readOnly": true
|
||||
},
|
||||
"createdAt": {
|
||||
"type": "datetime",
|
||||
"readOnly": true
|
||||
},
|
||||
"scheduledJob": {
|
||||
"type": "link"
|
||||
}
|
||||
},
|
||||
"links": {
|
||||
"scheduledJob": {
|
||||
"type": "belongsTo",
|
||||
"entity": "ScheduledJob"
|
||||
}
|
||||
},
|
||||
"collection": {
|
||||
"sortBy": "createdAt",
|
||||
"asc": false
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"entity": true,
|
||||
"layouts": false,
|
||||
"tab": false,
|
||||
"acl": false,
|
||||
"customizable":false
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"entity": true,
|
||||
"layouts": false,
|
||||
"tab": false,
|
||||
"acl": false,
|
||||
"customizable":false
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"relationshipPanels":{
|
||||
"log":{
|
||||
"readOnly": true
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user