-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
64 changed files
with
1,842 additions
and
1,787 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,6 @@ | |
">=7.4.0" | ||
], | ||
"php": [ | ||
">=7.4" | ||
">=8.0" | ||
] | ||
} |
74 changes: 74 additions & 0 deletions
74
...s/custom/Espo/Modules/RealEstate/Classes/Record/Hooks/RealEstateProperty/BeforeUpdate.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<?php | ||
/************************************************************************ | ||
* This file is part of Real Estate extension for EspoCRM. | ||
* | ||
* EspoCRM - Open Source CRM application. | ||
* Copyright (C) 2014-2024 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko | ||
* Website: https://www.espocrm.com | ||
* | ||
* Real Estate extension is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* Real Estate extension is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with EspoCRM. If not, see http://www.gnu.org/licenses/. | ||
* | ||
* The interactive user interfaces in modified source and object code versions | ||
* of this program must display Appropriate Legal Notices, as required under | ||
* Section 5 of the GNU General Public License version 3. | ||
* | ||
* In accordance with Section 7(b) of the GNU General Public License version 3, | ||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word. | ||
************************************************************************/ | ||
|
||
namespace Espo\Modules\RealEstate\Classes\Record\Hooks\RealEstateProperty; | ||
|
||
use Espo\Core\Exceptions\BadRequest; | ||
use Espo\Core\Exceptions\Forbidden; | ||
use Espo\Core\Record\Hook\UpdateHook; | ||
use Espo\Core\Record\UpdateParams; | ||
use Espo\Core\Select\SearchParams; | ||
use Espo\Modules\RealEstate\Entities\RealEstateProperty; | ||
use Espo\Modules\RealEstate\Entities\RealEstateRequest; | ||
use Espo\Modules\RealEstate\Tools\Property\Service; | ||
use Espo\ORM\Entity; | ||
use Espo\ORM\EntityManager; | ||
|
||
/** | ||
* @noinspection PhpUnused | ||
* @implements UpdateHook<RealEstateProperty> | ||
*/ | ||
class BeforeUpdate implements UpdateHook | ||
{ | ||
public function __construct( | ||
private Service $service, | ||
private EntityManager $entityManager | ||
) {} | ||
|
||
/** | ||
* @param RealEstateProperty $entity | ||
* @throws BadRequest | ||
* @throws Forbidden | ||
*/ | ||
public function process(Entity $entity, UpdateParams $params): void | ||
{ | ||
$matchingRequestCount = null; | ||
|
||
if ($entity->isActual()) { | ||
$query = $this->service->getMatchingRequestsQuery($entity, SearchParams::create()); | ||
|
||
$matchingRequestCount = $this->entityManager | ||
->getRDBRepository(RealEstateRequest::ENTITY_TYPE) | ||
->clone($query) | ||
->count(); | ||
} | ||
|
||
$entity->set('matchingRequestCount', $matchingRequestCount); | ||
} | ||
} |
74 changes: 74 additions & 0 deletions
74
...es/custom/Espo/Modules/RealEstate/Classes/Record/Hooks/RealEstateRequest/BeforeUpdate.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<?php | ||
/************************************************************************ | ||
* This file is part of Real Estate extension for EspoCRM. | ||
* | ||
* EspoCRM - Open Source CRM application. | ||
* Copyright (C) 2014-2024 Yurii Kuznietsov, Taras Machyshyn, Oleksii Avramenko | ||
* Website: https://www.espocrm.com | ||
* | ||
* Real Estate extension is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* Real Estate extension is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with EspoCRM. If not, see http://www.gnu.org/licenses/. | ||
* | ||
* The interactive user interfaces in modified source and object code versions | ||
* of this program must display Appropriate Legal Notices, as required under | ||
* Section 5 of the GNU General Public License version 3. | ||
* | ||
* In accordance with Section 7(b) of the GNU General Public License version 3, | ||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word. | ||
************************************************************************/ | ||
|
||
namespace Espo\Modules\RealEstate\Classes\Record\Hooks\RealEstateRequest; | ||
|
||
use Espo\Core\Exceptions\BadRequest; | ||
use Espo\Core\Exceptions\Forbidden; | ||
use Espo\Core\Record\Hook\UpdateHook; | ||
use Espo\Core\Record\UpdateParams; | ||
use Espo\Core\Select\SearchParams; | ||
use Espo\Modules\RealEstate\Entities\RealEstateProperty; | ||
use Espo\Modules\RealEstate\Entities\RealEstateRequest; | ||
use Espo\Modules\RealEstate\Tools\Request\Service; | ||
use Espo\ORM\Entity; | ||
use Espo\ORM\EntityManager; | ||
|
||
/** | ||
* @noinspection PhpUnused | ||
* @implements UpdateHook<RealEstateRequest> | ||
*/ | ||
class BeforeUpdate implements UpdateHook | ||
{ | ||
public function __construct( | ||
private Service $service, | ||
private EntityManager $entityManager | ||
) {} | ||
|
||
/** | ||
* @param RealEstateRequest $entity | ||
* @throws BadRequest | ||
* @throws Forbidden | ||
*/ | ||
public function process(Entity $entity, UpdateParams $params): void | ||
{ | ||
$matchingRequestCount = null; | ||
|
||
if ($entity->isActual()) { | ||
$query = $this->service->getMatchingPropertiesQuery($entity, SearchParams::create()); | ||
|
||
$matchingRequestCount = $this->entityManager | ||
->getRDBRepository(RealEstateProperty::ENTITY_TYPE) | ||
->clone($query) | ||
->count(); | ||
} | ||
|
||
$entity->set('matchingRequestCount', $matchingRequestCount); | ||
} | ||
} |
34 changes: 0 additions & 34 deletions
34
src/files/custom/Espo/Modules/RealEstate/Controllers/Contact.php
This file was deleted.
Oops, something went wrong.
34 changes: 0 additions & 34 deletions
34
src/files/custom/Espo/Modules/RealEstate/Controllers/Opportunity.php
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 0 additions & 36 deletions
36
src/files/custom/Espo/Modules/RealEstate/Entities/Contact.php
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.