Initial commit
This commit is contained in:
155
custom/Espo/Modules/Advanced/Entities/BpmnFlowNode.php
Normal file
155
custom/Espo/Modules/Advanced/Entities/BpmnFlowNode.php
Normal file
@@ -0,0 +1,155 @@
|
||||
<?php
|
||||
/***********************************************************************************
|
||||
* The contents of this file are subject to the Extension License Agreement
|
||||
* ("Agreement") which can be viewed at
|
||||
* https://www.espocrm.com/extension-license-agreement/.
|
||||
* By copying, installing downloading, or using this file, You have unconditionally
|
||||
* agreed to the terms and conditions of the Agreement, and You may not use this
|
||||
* file except in compliance with the Agreement. Under the terms of the Agreement,
|
||||
* You shall not license, sublicense, sell, resell, rent, lease, lend, distribute,
|
||||
* redistribute, market, publish, commercialize, or otherwise transfer rights or
|
||||
* usage to the software or any modified version or derivative work of the software
|
||||
* created by or for you.
|
||||
*
|
||||
* Copyright (C) 2015-2025 EspoCRM, Inc.
|
||||
*
|
||||
* License ID: 19bc86a68a7bb01f458cb391d43a9212
|
||||
************************************************************************************/
|
||||
|
||||
namespace Espo\Modules\Advanced\Entities;
|
||||
|
||||
use Espo\Core\ORM\Entity;
|
||||
use stdClass;
|
||||
|
||||
class BpmnFlowNode extends Entity
|
||||
{
|
||||
public const ENTITY_TYPE = 'BpmnFlowNode';
|
||||
|
||||
public const STATUS_CREATED = 'Created';
|
||||
public const STATUS_IN_PROCESS = 'In Process';
|
||||
public const STATUS_PENDING = 'Pending';
|
||||
public const STATUS_STANDBY = 'Standby';
|
||||
public const STATUS_FAILED = 'Failed';
|
||||
public const STATUS_PROCESSED = 'Processed';
|
||||
public const STATUS_REJECTED = 'Rejected';
|
||||
public const STATUS_INTERRUPTED = 'Interrupted';
|
||||
|
||||
public function getStatus(): ?string
|
||||
{
|
||||
return $this->get('status');
|
||||
}
|
||||
|
||||
public function getProcessId(): ?string
|
||||
{
|
||||
return $this->get('processId');
|
||||
}
|
||||
|
||||
public function getTargetId(): ?string
|
||||
{
|
||||
return $this->get('targetId');
|
||||
}
|
||||
|
||||
public function getTargetType(): ?string
|
||||
{
|
||||
return $this->get('targetType');
|
||||
}
|
||||
|
||||
public function getElementType(): ?string
|
||||
{
|
||||
return $this->get('elementType');
|
||||
}
|
||||
|
||||
public function getElementId(): ?string
|
||||
{
|
||||
return $this->get('elementId');
|
||||
}
|
||||
|
||||
public function getFlowchartId(): ?string
|
||||
{
|
||||
return $this->get('flowchartId');
|
||||
}
|
||||
|
||||
public function getElementData(): stdClass
|
||||
{
|
||||
return $this->get('elementData') ?? (object) [];
|
||||
}
|
||||
|
||||
public function getDivergentFlowNodeId(): ?string
|
||||
{
|
||||
return $this->get('divergentFlowNodeId');
|
||||
}
|
||||
|
||||
public function getPreviousFlowNodeId(): ?string
|
||||
{
|
||||
return $this->get('previousFlowNodeId');
|
||||
}
|
||||
|
||||
public function getPreviousFlowNodeElementType(): ?string
|
||||
{
|
||||
return $this->get('previousFlowNodeElementType');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getElementDataItemValue(string $name)
|
||||
{
|
||||
$data = $this->get('elementData');
|
||||
|
||||
if (!$data) {
|
||||
$data = (object) [];
|
||||
}
|
||||
|
||||
if (!property_exists($data, $name)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $data->$name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getDataItemValue(string $name)
|
||||
{
|
||||
$data = $this->get('data');
|
||||
|
||||
if (!$data) {
|
||||
$data = (object) [];
|
||||
}
|
||||
|
||||
if (!property_exists($data, $name)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $data->$name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $value
|
||||
*/
|
||||
public function setDataItemValue(string $name, $value): void
|
||||
{
|
||||
$data = $this->get('data');
|
||||
|
||||
if (!$data) {
|
||||
$data = (object) [];
|
||||
}
|
||||
|
||||
$data->$name = $value;
|
||||
|
||||
$this->set('data', $data);
|
||||
}
|
||||
|
||||
public function setStatus(string $status): self
|
||||
{
|
||||
$this->set('status', $status);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getData(): stdClass
|
||||
{
|
||||
return $this->get('data') ?? (object) [];
|
||||
}
|
||||
}
|
||||
60
custom/Espo/Modules/Advanced/Entities/BpmnFlowchart.php
Normal file
60
custom/Espo/Modules/Advanced/Entities/BpmnFlowchart.php
Normal file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/***********************************************************************************
|
||||
* The contents of this file are subject to the Extension License Agreement
|
||||
* ("Agreement") which can be viewed at
|
||||
* https://www.espocrm.com/extension-license-agreement/.
|
||||
* By copying, installing downloading, or using this file, You have unconditionally
|
||||
* agreed to the terms and conditions of the Agreement, and You may not use this
|
||||
* file except in compliance with the Agreement. Under the terms of the Agreement,
|
||||
* You shall not license, sublicense, sell, resell, rent, lease, lend, distribute,
|
||||
* redistribute, market, publish, commercialize, or otherwise transfer rights or
|
||||
* usage to the software or any modified version or derivative work of the software
|
||||
* created by or for you.
|
||||
*
|
||||
* Copyright (C) 2015-2025 EspoCRM, Inc.
|
||||
*
|
||||
* License ID: 19bc86a68a7bb01f458cb391d43a9212
|
||||
************************************************************************************/
|
||||
|
||||
namespace Espo\Modules\Advanced\Entities;
|
||||
|
||||
use Espo\Core\ORM\Entity;
|
||||
use stdClass;
|
||||
|
||||
class BpmnFlowchart extends Entity
|
||||
{
|
||||
public const ENTITY_TYPE = 'BpmnFlowchart';
|
||||
|
||||
public function getName(): ?string
|
||||
{
|
||||
return $this->get('name');
|
||||
}
|
||||
|
||||
public function getData(): stdClass
|
||||
{
|
||||
return $this->get('data') ?? (object) [];
|
||||
}
|
||||
|
||||
public function getElementsDataHash(): stdClass
|
||||
{
|
||||
return $this->get('elementsDataHash') ?? (object) [];
|
||||
}
|
||||
|
||||
public function getTargetType(): string
|
||||
{
|
||||
return $this->get('targetType');
|
||||
}
|
||||
|
||||
public function getAssignedUserId(): ?string
|
||||
{
|
||||
return $this->get('assignedUserId');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
public function getTeamIdList(): array
|
||||
{
|
||||
return $this->getLinkMultipleIdList('teams');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/***********************************************************************************
|
||||
* The contents of this file are subject to the Extension License Agreement
|
||||
* ("Agreement") which can be viewed at
|
||||
* https://www.espocrm.com/extension-license-agreement/.
|
||||
* By copying, installing downloading, or using this file, You have unconditionally
|
||||
* agreed to the terms and conditions of the Agreement, and You may not use this
|
||||
* file except in compliance with the Agreement. Under the terms of the Agreement,
|
||||
* You shall not license, sublicense, sell, resell, rent, lease, lend, distribute,
|
||||
* redistribute, market, publish, commercialize, or otherwise transfer rights or
|
||||
* usage to the software or any modified version or derivative work of the software
|
||||
* created by or for you.
|
||||
*
|
||||
* Copyright (C) 2015-2025 EspoCRM, Inc.
|
||||
*
|
||||
* License ID: 19bc86a68a7bb01f458cb391d43a9212
|
||||
************************************************************************************/
|
||||
|
||||
namespace Espo\Modules\Advanced\Entities;
|
||||
|
||||
use Espo\Core\Templates\Entities\CategoryTree;
|
||||
|
||||
class BpmnFlowchartCategory extends CategoryTree
|
||||
{
|
||||
public const ENTITY_TYPE = 'BpmnFlowchartCategory';
|
||||
}
|
||||
240
custom/Espo/Modules/Advanced/Entities/BpmnProcess.php
Normal file
240
custom/Espo/Modules/Advanced/Entities/BpmnProcess.php
Normal file
@@ -0,0 +1,240 @@
|
||||
<?php
|
||||
/***********************************************************************************
|
||||
* The contents of this file are subject to the Extension License Agreement
|
||||
* ("Agreement") which can be viewed at
|
||||
* https://www.espocrm.com/extension-license-agreement/.
|
||||
* By copying, installing downloading, or using this file, You have unconditionally
|
||||
* agreed to the terms and conditions of the Agreement, and You may not use this
|
||||
* file except in compliance with the Agreement. Under the terms of the Agreement,
|
||||
* You shall not license, sublicense, sell, resell, rent, lease, lend, distribute,
|
||||
* redistribute, market, publish, commercialize, or otherwise transfer rights or
|
||||
* usage to the software or any modified version or derivative work of the software
|
||||
* created by or for you.
|
||||
*
|
||||
* Copyright (C) 2015-2025 EspoCRM, Inc.
|
||||
*
|
||||
* License ID: 19bc86a68a7bb01f458cb391d43a9212
|
||||
************************************************************************************/
|
||||
|
||||
namespace Espo\Modules\Advanced\Entities;
|
||||
|
||||
use Espo\Core\Field\Link;
|
||||
use Espo\Core\Field\LinkMultiple;
|
||||
use Espo\Core\ORM\Entity;
|
||||
use stdClass;
|
||||
|
||||
class BpmnProcess extends Entity
|
||||
{
|
||||
public const ENTITY_TYPE = 'BpmnProcess';
|
||||
|
||||
public const STATUS_CREATED = 'Created';
|
||||
public const STATUS_STARTED = 'Started';
|
||||
public const STATUS_ENDED = 'Ended';
|
||||
public const STATUS_STOPPED = 'Stopped';
|
||||
public const STATUS_INTERRUPTED = 'Interrupted';
|
||||
public const STATUS_PAUSED = 'Paused';
|
||||
|
||||
public function getStatus(): ?string
|
||||
{
|
||||
return $this->get('status');
|
||||
}
|
||||
|
||||
public function setStatus(string $status): self
|
||||
{
|
||||
$this->set('status', $status);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getAssignedUser(): ?Link
|
||||
{
|
||||
/** @var ?Link */
|
||||
return $this->getValueObject('assignedUser');
|
||||
}
|
||||
|
||||
public function getStartElementId(): ?string
|
||||
{
|
||||
return $this->get('startElementId');
|
||||
}
|
||||
|
||||
public function getTargetId(): ?string
|
||||
{
|
||||
return $this->get('targetId');
|
||||
}
|
||||
|
||||
public function getTargetType(): ?string
|
||||
{
|
||||
return $this->get('targetType');
|
||||
}
|
||||
|
||||
public function getTeams(): LinkMultiple
|
||||
{
|
||||
/** @var LinkMultiple */
|
||||
return $this->getValueObject('teams');
|
||||
}
|
||||
|
||||
public function isSubProcess(): bool
|
||||
{
|
||||
return $this->hasParentProcess();
|
||||
}
|
||||
|
||||
public function hasParentProcess(): bool
|
||||
{
|
||||
return $this->getParentProcessId() && $this->getParentProcessFlowNodeId();
|
||||
}
|
||||
|
||||
public function getParentProcessId(): ?string
|
||||
{
|
||||
return $this->get('parentProcessId');
|
||||
}
|
||||
|
||||
public function getParentProcessFlowNodeId(): ?string
|
||||
{
|
||||
return $this->get('parentProcessFlowNodeId');
|
||||
}
|
||||
|
||||
public function getRootProcessId(): ?string
|
||||
{
|
||||
return $this->get('rootProcessId');
|
||||
}
|
||||
|
||||
public function getFlowchartId(): ?string
|
||||
{
|
||||
return $this->get('flowchartId');
|
||||
}
|
||||
|
||||
public function getVariables(): ?stdClass
|
||||
{
|
||||
return $this->get('variables');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $notSorted
|
||||
* @return string[]
|
||||
*/
|
||||
public function getElementIdList(bool $notSorted = false)
|
||||
{
|
||||
$elementsDataHash = $this->get('flowchartElementsDataHash');
|
||||
|
||||
if (!$elementsDataHash) {
|
||||
$elementsDataHash = (object) [];
|
||||
}
|
||||
|
||||
$elementIdList = array_keys(get_object_vars($elementsDataHash));
|
||||
|
||||
if ($notSorted) {
|
||||
return $elementIdList;
|
||||
}
|
||||
|
||||
usort($elementIdList, function ($id1, $id2) use ($elementsDataHash) {
|
||||
$item1 = $elementsDataHash->$id1;
|
||||
$item2 = $elementsDataHash->$id2;
|
||||
|
||||
if (isset($item1->center) && isset($item2->center)) {
|
||||
if ($item1->center->y > $item2->center->y) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ($item1->center->y == $item2->center->y) {
|
||||
if ($item1->center->x > $item2->center->x) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
});
|
||||
|
||||
return $elementIdList;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
public function getElementNextIdList(string $id): array
|
||||
{
|
||||
$item = $this->getElementDataById($id);
|
||||
|
||||
if (!$item) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return $item->nextElementIdList ?? [];
|
||||
}
|
||||
|
||||
public function getElementDataById(string $id): ?stdClass
|
||||
{
|
||||
if (!$id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$elementsDataHash = $this->get('flowchartElementsDataHash');
|
||||
|
||||
if (!$elementsDataHash) {
|
||||
$elementsDataHash = (object) [];
|
||||
}
|
||||
|
||||
if (!property_exists($elementsDataHash, $id)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $elementsDataHash->$id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
public function getAttachedToFlowNodeElementIdList(BpmnFlowNode $flowNode): array
|
||||
{
|
||||
$elementIdList = [];
|
||||
|
||||
foreach ($this->getElementIdList() as $id) {
|
||||
$item = $this->getElementDataById($id);
|
||||
|
||||
if (!isset($item->attachedToId)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($item->attachedToId === $flowNode->getElementId()) {
|
||||
$elementIdList[] = $id;
|
||||
}
|
||||
}
|
||||
|
||||
return $elementIdList;
|
||||
}
|
||||
|
||||
public function setVariables(stdClass $variables): self
|
||||
{
|
||||
$this->set('variables', $variables);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setCreatedEntitiesData(stdClass $createdEntitiesData): self
|
||||
{
|
||||
$this->set('createdEntitiesData', $createdEntitiesData);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function isLocked(): bool
|
||||
{
|
||||
return (bool) $this->get('isLocked');
|
||||
}
|
||||
|
||||
public function setIsLocked(bool $isLocked): self
|
||||
{
|
||||
$this->set('isLocked', $isLocked);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setVisitTimestampNow(): self
|
||||
{
|
||||
$now = (int) (microtime(true) * 1000);
|
||||
|
||||
$this->set('visitTimestamp', $now);
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
31
custom/Espo/Modules/Advanced/Entities/BpmnSignalListener.php
Normal file
31
custom/Espo/Modules/Advanced/Entities/BpmnSignalListener.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/***********************************************************************************
|
||||
* The contents of this file are subject to the Extension License Agreement
|
||||
* ("Agreement") which can be viewed at
|
||||
* https://www.espocrm.com/extension-license-agreement/.
|
||||
* By copying, installing downloading, or using this file, You have unconditionally
|
||||
* agreed to the terms and conditions of the Agreement, and You may not use this
|
||||
* file except in compliance with the Agreement. Under the terms of the Agreement,
|
||||
* You shall not license, sublicense, sell, resell, rent, lease, lend, distribute,
|
||||
* redistribute, market, publish, commercialize, or otherwise transfer rights or
|
||||
* usage to the software or any modified version or derivative work of the software
|
||||
* created by or for you.
|
||||
*
|
||||
* Copyright (C) 2015-2025 EspoCRM, Inc.
|
||||
*
|
||||
* License ID: 19bc86a68a7bb01f458cb391d43a9212
|
||||
************************************************************************************/
|
||||
|
||||
namespace Espo\Modules\Advanced\Entities;
|
||||
|
||||
use Espo\Core\ORM\Entity;
|
||||
|
||||
class BpmnSignalListener extends Entity
|
||||
{
|
||||
public const ENTITY_TYPE = 'BpmnSignalListener';
|
||||
|
||||
public function getFlowNodeId(): ?string
|
||||
{
|
||||
return $this->get('flowNodeId');
|
||||
}
|
||||
}
|
||||
91
custom/Espo/Modules/Advanced/Entities/BpmnUserTask.php
Normal file
91
custom/Espo/Modules/Advanced/Entities/BpmnUserTask.php
Normal file
@@ -0,0 +1,91 @@
|
||||
<?php
|
||||
/***********************************************************************************
|
||||
* The contents of this file are subject to the Extension License Agreement
|
||||
* ("Agreement") which can be viewed at
|
||||
* https://www.espocrm.com/extension-license-agreement/.
|
||||
* By copying, installing downloading, or using this file, You have unconditionally
|
||||
* agreed to the terms and conditions of the Agreement, and You may not use this
|
||||
* file except in compliance with the Agreement. Under the terms of the Agreement,
|
||||
* You shall not license, sublicense, sell, resell, rent, lease, lend, distribute,
|
||||
* redistribute, market, publish, commercialize, or otherwise transfer rights or
|
||||
* usage to the software or any modified version or derivative work of the software
|
||||
* created by or for you.
|
||||
*
|
||||
* Copyright (C) 2015-2025 EspoCRM, Inc.
|
||||
*
|
||||
* License ID: 19bc86a68a7bb01f458cb391d43a9212
|
||||
************************************************************************************/
|
||||
|
||||
namespace Espo\Modules\Advanced\Entities;
|
||||
|
||||
use Espo\Core\Field\LinkMultiple;
|
||||
use Espo\Core\Field\LinkParent;
|
||||
use Espo\Core\ORM\Entity;
|
||||
|
||||
class BpmnUserTask extends Entity
|
||||
{
|
||||
public const ENTITY_TYPE = 'BpmnUserTask';
|
||||
|
||||
public const RESOLUTION_CANCELED = 'Canceled';
|
||||
|
||||
public function getElementType(): string
|
||||
{
|
||||
return $this->get('elementType');
|
||||
}
|
||||
|
||||
public function setName(?string $name): self
|
||||
{
|
||||
$this->set('name', $name);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setTeams(LinkMultiple $teams): self
|
||||
{
|
||||
$this->setValueObject('teams', $teams);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setTarget(?LinkParent $target): self
|
||||
{
|
||||
$this->setValueObject('target', $target);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setFlowNodeId(?string $flowNodeId): self
|
||||
{
|
||||
$this->set('flowNodeId', $flowNodeId);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setProcessId(?string $processId): self
|
||||
{
|
||||
$this->set('processId', $processId);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setActionType(?string $actionType): self
|
||||
{
|
||||
$this->set('actionType', $actionType);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setDescription(?string $description): self
|
||||
{
|
||||
$this->set('description', $description);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setInstructions(?string $instructions): self
|
||||
{
|
||||
$this->set('instructions', $instructions);
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
231
custom/Espo/Modules/Advanced/Entities/Report.php
Normal file
231
custom/Espo/Modules/Advanced/Entities/Report.php
Normal file
@@ -0,0 +1,231 @@
|
||||
<?php
|
||||
/***********************************************************************************
|
||||
* The contents of this file are subject to the Extension License Agreement
|
||||
* ("Agreement") which can be viewed at
|
||||
* https://www.espocrm.com/extension-license-agreement/.
|
||||
* By copying, installing downloading, or using this file, You have unconditionally
|
||||
* agreed to the terms and conditions of the Agreement, and You may not use this
|
||||
* file except in compliance with the Agreement. Under the terms of the Agreement,
|
||||
* You shall not license, sublicense, sell, resell, rent, lease, lend, distribute,
|
||||
* redistribute, market, publish, commercialize, or otherwise transfer rights or
|
||||
* usage to the software or any modified version or derivative work of the software
|
||||
* created by or for you.
|
||||
*
|
||||
* Copyright (C) 2015-2025 EspoCRM, Inc.
|
||||
*
|
||||
* License ID: 19bc86a68a7bb01f458cb391d43a9212
|
||||
************************************************************************************/
|
||||
|
||||
namespace Espo\Modules\Advanced\Entities;
|
||||
|
||||
use Espo\Core\Field\LinkMultiple;
|
||||
use Espo\Core\ORM\Entity;
|
||||
use stdClass;
|
||||
|
||||
class Report extends Entity
|
||||
{
|
||||
public const ENTITY_TYPE = 'Report';
|
||||
|
||||
public const TYPE_LIST = 'List';
|
||||
public const TYPE_GRID = 'Grid';
|
||||
public const TYPE_JOINT_GRID = 'JointGrid';
|
||||
|
||||
public function getName(): ?string
|
||||
{
|
||||
return $this->get('name');
|
||||
}
|
||||
|
||||
public function getType(): string
|
||||
{
|
||||
return $this->get('type');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
public function getRuntimeFilters(): array
|
||||
{
|
||||
return $this->get('runtimeFilters') ?? [];
|
||||
}
|
||||
|
||||
public function isInternal(): bool
|
||||
{
|
||||
return $this->get('isInternal');
|
||||
}
|
||||
|
||||
public function getTargetEntityType(): ?string
|
||||
{
|
||||
return $this->get('entityType');
|
||||
}
|
||||
|
||||
public function getPortals(): LinkMultiple
|
||||
{
|
||||
/** @var LinkMultiple */
|
||||
return $this->getValueObject('portals');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
protected function _hasJoinedReportsIds()
|
||||
{
|
||||
return $this->has('joinedReportDataList');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
protected function _hasJoinedReportsNames()
|
||||
{
|
||||
return $this->has('joinedReportDataList');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
protected function _hasJoinedReportsColumns()
|
||||
{
|
||||
return $this->has('joinedReportDataList');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[][]
|
||||
*/
|
||||
protected function _getJoinedReportsIds()
|
||||
{
|
||||
$idList = [];
|
||||
$dataList = $this->get('joinedReportDataList');
|
||||
|
||||
if (!is_array($dataList)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
foreach ($dataList as $item) {
|
||||
if (empty($item->id)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$idList[] = $item->id;
|
||||
}
|
||||
|
||||
return $idList;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return object
|
||||
*/
|
||||
protected function _getJoinedReportsNames()
|
||||
{
|
||||
$nameMap = (object) [];
|
||||
$dataList = $this->get('joinedReportDataList');
|
||||
|
||||
if (!is_array($dataList)) {
|
||||
return $nameMap;
|
||||
}
|
||||
|
||||
foreach ($dataList as $item) {
|
||||
if (empty($item->id)) {
|
||||
continue;
|
||||
}
|
||||
$report = $this->entityManager->getEntity('Report', $item->id);
|
||||
|
||||
if (!$report) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$nameMap->{$item->id} = $report->get('name');
|
||||
}
|
||||
|
||||
return $nameMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return object
|
||||
*/
|
||||
protected function _getJoinedReportsColumns()
|
||||
{
|
||||
$map = (object) [];
|
||||
$dataList = $this->get('joinedReportDataList');
|
||||
|
||||
if (!is_array($dataList)) {
|
||||
return $map;
|
||||
}
|
||||
|
||||
foreach ($dataList as $item) {
|
||||
if (empty($item->id)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($item->label)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$map->{$item->id} = (object) [
|
||||
'label' => $item->label
|
||||
];
|
||||
}
|
||||
|
||||
return $map;
|
||||
}
|
||||
|
||||
public function getOrderByList(): ?string
|
||||
{
|
||||
return $this->get('orderByList');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
public function getColumns(): array
|
||||
{
|
||||
return $this->get('columns') ?? [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
public function getGroupBy(): array
|
||||
{
|
||||
return $this->get('groupBy') ?? [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
public function getOrderBy(): array
|
||||
{
|
||||
return $this->get('orderBy') ?? [];
|
||||
}
|
||||
|
||||
public function getColumnsData(): stdClass
|
||||
{
|
||||
return $this->get('columnsData') ?? (object) [];
|
||||
}
|
||||
|
||||
public function getApplyAcl(): bool
|
||||
{
|
||||
return (bool) $this->get('applyAcl');
|
||||
}
|
||||
|
||||
public function setName(string $name): self
|
||||
{
|
||||
$this->set('name', $name);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setApplyAcl(bool $applyAcl = true): self
|
||||
{
|
||||
$this->set('applyAcl', $applyAcl);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
public function getJoinedReportIdList(): array
|
||||
{
|
||||
return $this->get('joinedReportsIds') ?? [];
|
||||
}
|
||||
}
|
||||
26
custom/Espo/Modules/Advanced/Entities/ReportCategory.php
Normal file
26
custom/Espo/Modules/Advanced/Entities/ReportCategory.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/***********************************************************************************
|
||||
* The contents of this file are subject to the Extension License Agreement
|
||||
* ("Agreement") which can be viewed at
|
||||
* https://www.espocrm.com/extension-license-agreement/.
|
||||
* By copying, installing downloading, or using this file, You have unconditionally
|
||||
* agreed to the terms and conditions of the Agreement, and You may not use this
|
||||
* file except in compliance with the Agreement. Under the terms of the Agreement,
|
||||
* You shall not license, sublicense, sell, resell, rent, lease, lend, distribute,
|
||||
* redistribute, market, publish, commercialize, or otherwise transfer rights or
|
||||
* usage to the software or any modified version or derivative work of the software
|
||||
* created by or for you.
|
||||
*
|
||||
* Copyright (C) 2015-2025 EspoCRM, Inc.
|
||||
*
|
||||
* License ID: 19bc86a68a7bb01f458cb391d43a9212
|
||||
************************************************************************************/
|
||||
|
||||
namespace Espo\Modules\Advanced\Entities;
|
||||
|
||||
use Espo\Core\Templates\Entities\CategoryTree;
|
||||
|
||||
class ReportCategory extends CategoryTree
|
||||
{
|
||||
public const ENTITY_TYPE = 'ReportCategory';
|
||||
}
|
||||
24
custom/Espo/Modules/Advanced/Entities/ReportFilter.php
Normal file
24
custom/Espo/Modules/Advanced/Entities/ReportFilter.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/***********************************************************************************
|
||||
* The contents of this file are subject to the Extension License Agreement
|
||||
* ("Agreement") which can be viewed at
|
||||
* https://www.espocrm.com/extension-license-agreement/.
|
||||
* By copying, installing downloading, or using this file, You have unconditionally
|
||||
* agreed to the terms and conditions of the Agreement, and You may not use this
|
||||
* file except in compliance with the Agreement. Under the terms of the Agreement,
|
||||
* You shall not license, sublicense, sell, resell, rent, lease, lend, distribute,
|
||||
* redistribute, market, publish, commercialize, or otherwise transfer rights or
|
||||
* usage to the software or any modified version or derivative work of the software
|
||||
* created by or for you.
|
||||
*
|
||||
* Copyright (C) 2015-2025 EspoCRM, Inc.
|
||||
*
|
||||
* License ID: 19bc86a68a7bb01f458cb391d43a9212
|
||||
************************************************************************************/
|
||||
|
||||
namespace Espo\Modules\Advanced\Entities;
|
||||
|
||||
class ReportFilter extends \Espo\Core\ORM\Entity
|
||||
{
|
||||
public const ENTITY_TYPE = 'ReportFilter';
|
||||
}
|
||||
36
custom/Espo/Modules/Advanced/Entities/ReportPanel.php
Normal file
36
custom/Espo/Modules/Advanced/Entities/ReportPanel.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
/***********************************************************************************
|
||||
* The contents of this file are subject to the Extension License Agreement
|
||||
* ("Agreement") which can be viewed at
|
||||
* https://www.espocrm.com/extension-license-agreement/.
|
||||
* By copying, installing downloading, or using this file, You have unconditionally
|
||||
* agreed to the terms and conditions of the Agreement, and You may not use this
|
||||
* file except in compliance with the Agreement. Under the terms of the Agreement,
|
||||
* You shall not license, sublicense, sell, resell, rent, lease, lend, distribute,
|
||||
* redistribute, market, publish, commercialize, or otherwise transfer rights or
|
||||
* usage to the software or any modified version or derivative work of the software
|
||||
* created by or for you.
|
||||
*
|
||||
* Copyright (C) 2015-2025 EspoCRM, Inc.
|
||||
*
|
||||
* License ID: 19bc86a68a7bb01f458cb391d43a9212
|
||||
************************************************************************************/
|
||||
|
||||
namespace Espo\Modules\Advanced\Entities;
|
||||
|
||||
use Espo\Core\ORM\Entity;
|
||||
|
||||
class ReportPanel extends Entity
|
||||
{
|
||||
public const ENTITY_TYPE = 'ReportPanel';
|
||||
|
||||
public function getReportId(): string
|
||||
{
|
||||
return $this->get('reportId');
|
||||
}
|
||||
|
||||
public function getTargetEntityType(): string
|
||||
{
|
||||
return $this->get('entityType');
|
||||
}
|
||||
}
|
||||
111
custom/Espo/Modules/Advanced/Entities/Workflow.php
Normal file
111
custom/Espo/Modules/Advanced/Entities/Workflow.php
Normal file
@@ -0,0 +1,111 @@
|
||||
<?php
|
||||
/***********************************************************************************
|
||||
* The contents of this file are subject to the Extension License Agreement
|
||||
* ("Agreement") which can be viewed at
|
||||
* https://www.espocrm.com/extension-license-agreement/.
|
||||
* By copying, installing downloading, or using this file, You have unconditionally
|
||||
* agreed to the terms and conditions of the Agreement, and You may not use this
|
||||
* file except in compliance with the Agreement. Under the terms of the Agreement,
|
||||
* You shall not license, sublicense, sell, resell, rent, lease, lend, distribute,
|
||||
* redistribute, market, publish, commercialize, or otherwise transfer rights or
|
||||
* usage to the software or any modified version or derivative work of the software
|
||||
* created by or for you.
|
||||
*
|
||||
* Copyright (C) 2015-2025 EspoCRM, Inc.
|
||||
*
|
||||
* License ID: 19bc86a68a7bb01f458cb391d43a9212
|
||||
************************************************************************************/
|
||||
|
||||
namespace Espo\Modules\Advanced\Entities;
|
||||
|
||||
use Espo\Core\Field\DateTime;
|
||||
use Espo\Core\ORM\Entity;
|
||||
use stdClass;
|
||||
|
||||
class Workflow extends Entity
|
||||
{
|
||||
public const ENTITY_TYPE = 'Workflow';
|
||||
|
||||
public const TYPE_MANUAL = 'manual';
|
||||
public const TYPE_SCHEDULED = 'scheduled';
|
||||
public const TYPE_SEQUENTIAL = 'sequential';
|
||||
public const TYPE_SIGNAL = 'signal';
|
||||
public const TYPE_AFTER_RECORD_SAVED = 'afterRecordSaved';
|
||||
public const TYPE_AFTER_RECORD_CREATED = 'afterRecordCreated';
|
||||
public const TYPE_AFTER_RECORD_UPDATED = 'afterRecordUpdated';
|
||||
|
||||
public const MANUAL_ACCESS_ADMIN = 'admin';
|
||||
public const MANUAL_ACCESS_READ = 'read';
|
||||
|
||||
public function getName(): ?string
|
||||
{
|
||||
return $this->get('name');
|
||||
}
|
||||
|
||||
public function getManualLabel(): ?string
|
||||
{
|
||||
return $this->get('manualLabel');
|
||||
}
|
||||
|
||||
public function getType(): string
|
||||
{
|
||||
return $this->get('type');
|
||||
}
|
||||
|
||||
public function getTargetEntityType(): string
|
||||
{
|
||||
return $this->get('entityType');
|
||||
}
|
||||
|
||||
public function isActive(): bool
|
||||
{
|
||||
return $this->get('isActive');
|
||||
}
|
||||
|
||||
public function getScheduling(): ?string
|
||||
{
|
||||
return $this->get('scheduling');
|
||||
}
|
||||
|
||||
public function getSignalName(): ?string
|
||||
{
|
||||
return $this->get('signalName');
|
||||
}
|
||||
|
||||
public function getManualAccessRequired(): ?string
|
||||
{
|
||||
return $this->get('manualAccessRequired');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ?stdClass[]
|
||||
*/
|
||||
public function getManualDynamicLogicConditionGroup(): ?array
|
||||
{
|
||||
$value = $this->get('manualDynamicLogic');
|
||||
|
||||
if (!$value instanceof stdClass) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $value->conditionGroup ?? [];
|
||||
}
|
||||
|
||||
public function getSchedulingApplyTimezone(): bool
|
||||
{
|
||||
return (bool) $this->get('schedulingApplyTimezone');
|
||||
}
|
||||
|
||||
public function getLastRun(): ?DateTime
|
||||
{
|
||||
/** @var ?DateTime */
|
||||
return $this->getValueObject('lastRun');
|
||||
}
|
||||
|
||||
public function setLastRun(?DateTime $lastRun): self
|
||||
{
|
||||
$this->setValueObject('lastRun', $lastRun);
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
24
custom/Espo/Modules/Advanced/Entities/WorkflowCategory.php
Normal file
24
custom/Espo/Modules/Advanced/Entities/WorkflowCategory.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/***********************************************************************************
|
||||
* The contents of this file are subject to the Extension License Agreement
|
||||
* ("Agreement") which can be viewed at
|
||||
* https://www.espocrm.com/extension-license-agreement/.
|
||||
* By copying, installing downloading, or using this file, You have unconditionally
|
||||
* agreed to the terms and conditions of the Agreement, and You may not use this
|
||||
* file except in compliance with the Agreement. Under the terms of the Agreement,
|
||||
* You shall not license, sublicense, sell, resell, rent, lease, lend, distribute,
|
||||
* redistribute, market, publish, commercialize, or otherwise transfer rights or
|
||||
* usage to the software or any modified version or derivative work of the software
|
||||
* created by or for you.
|
||||
*
|
||||
* Copyright (C) 2015-2025 EspoCRM, Inc.
|
||||
*
|
||||
* License ID: 19bc86a68a7bb01f458cb391d43a9212
|
||||
************************************************************************************/
|
||||
|
||||
namespace Espo\Modules\Advanced\Entities;
|
||||
|
||||
class WorkflowCategory extends \Espo\Core\Templates\Entities\CategoryTree
|
||||
{
|
||||
public const ENTITY_TYPE = 'WorkflowCategory';
|
||||
}
|
||||
26
custom/Espo/Modules/Advanced/Entities/WorkflowLogRecord.php
Normal file
26
custom/Espo/Modules/Advanced/Entities/WorkflowLogRecord.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/***********************************************************************************
|
||||
* The contents of this file are subject to the Extension License Agreement
|
||||
* ("Agreement") which can be viewed at
|
||||
* https://www.espocrm.com/extension-license-agreement/.
|
||||
* By copying, installing downloading, or using this file, You have unconditionally
|
||||
* agreed to the terms and conditions of the Agreement, and You may not use this
|
||||
* file except in compliance with the Agreement. Under the terms of the Agreement,
|
||||
* You shall not license, sublicense, sell, resell, rent, lease, lend, distribute,
|
||||
* redistribute, market, publish, commercialize, or otherwise transfer rights or
|
||||
* usage to the software or any modified version or derivative work of the software
|
||||
* created by or for you.
|
||||
*
|
||||
* Copyright (C) 2015-2025 EspoCRM, Inc.
|
||||
*
|
||||
* License ID: 19bc86a68a7bb01f458cb391d43a9212
|
||||
************************************************************************************/
|
||||
|
||||
namespace Espo\Modules\Advanced\Entities;
|
||||
|
||||
use Espo\Core\ORM\Entity;
|
||||
|
||||
class WorkflowLogRecord extends Entity
|
||||
{
|
||||
public const ENTITY_TYPE = 'WorkflowLogRecord';
|
||||
}
|
||||
24
custom/Espo/Modules/Advanced/Entities/WorkflowRoundRobin.php
Normal file
24
custom/Espo/Modules/Advanced/Entities/WorkflowRoundRobin.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/***********************************************************************************
|
||||
* The contents of this file are subject to the Extension License Agreement
|
||||
* ("Agreement") which can be viewed at
|
||||
* https://www.espocrm.com/extension-license-agreement/.
|
||||
* By copying, installing downloading, or using this file, You have unconditionally
|
||||
* agreed to the terms and conditions of the Agreement, and You may not use this
|
||||
* file except in compliance with the Agreement. Under the terms of the Agreement,
|
||||
* You shall not license, sublicense, sell, resell, rent, lease, lend, distribute,
|
||||
* redistribute, market, publish, commercialize, or otherwise transfer rights or
|
||||
* usage to the software or any modified version or derivative work of the software
|
||||
* created by or for you.
|
||||
*
|
||||
* Copyright (C) 2015-2025 EspoCRM, Inc.
|
||||
*
|
||||
* License ID: 19bc86a68a7bb01f458cb391d43a9212
|
||||
************************************************************************************/
|
||||
|
||||
namespace Espo\Modules\Advanced\Entities;
|
||||
|
||||
class WorkflowRoundRobin extends \Espo\Core\ORM\Entity
|
||||
{
|
||||
public const ENTITY_TYPE = 'WorkflowRoundRobin';
|
||||
}
|
||||
Reference in New Issue
Block a user