-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add and use API4 Get action for SEPA transaction groups checking Fina…
…ncial ACLs
- Loading branch information
1 parent
0d1de98
commit 3ab15c2
Showing
11 changed files
with
654 additions
and
245 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
/* | ||
* Copyright (C) 2024 SYSTOPIA GmbH | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation in version 3. | ||
* | ||
* This program 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 Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
declare(strict_types = 1); | ||
|
||
namespace Civi\Api4; | ||
|
||
use Civi\Api4\Generic\DAOEntity; | ||
|
||
/** | ||
* SepaContributionGroup entity. | ||
* | ||
* Provided by the CiviSEPA extension. | ||
* | ||
* @package Civi\Api4 | ||
*/ | ||
class SepaContributionGroup extends Generic\DAOEntity { | ||
use Generic\Traits\EntityBridge; | ||
} |
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
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 |
---|---|---|
@@ -1,13 +1,20 @@ | ||
<?php | ||
namespace Civi\Api4; | ||
|
||
use Civi\Sepa\Api4\Action\SepaTransactionGroup\GetAction; | ||
|
||
/** | ||
* Resource entity. | ||
* SepaTransactionGroup entity. | ||
* | ||
* Provided by the CiviCRM Resource Management extension. | ||
* Provided by the CiviSEPA extension. | ||
* | ||
* @package Civi\Api4 | ||
*/ | ||
class SepaTransactionGroup extends Generic\DAOEntity { | ||
|
||
public static function get($checkPermissions = TRUE) { | ||
return (new GetAction(static::getEntityName(), __FUNCTION__)) | ||
->setCheckPermissions($checkPermissions); | ||
} | ||
|
||
} |
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,41 @@ | ||
<?php | ||
/* | ||
* Copyright (C) 2024 SYSTOPIA GmbH | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation in version 3. | ||
* | ||
* This program 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 Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
declare(strict_types = 1); | ||
|
||
namespace Civi\Sepa\Api4\Action\SepaTransactionGroup; | ||
|
||
use Civi\Api4\Generic\DAOGetAction; | ||
use Civi\Api4\Generic\Result; | ||
|
||
class GetAction extends DAOGetAction { | ||
|
||
public function _run(Result $result) { | ||
// Add unique joins for permission checks of Financial ACLs. | ||
if ($this->getCheckPermissions()) { | ||
$contributionAlias = uniqid('contribution_'); | ||
$this | ||
->addJoin( | ||
'Contribution AS ' . $contributionAlias, | ||
'INNER', | ||
'SepaContributionGroup' | ||
); | ||
} | ||
return parent::_run($result); | ||
} | ||
|
||
} |
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
Binary file not shown.
Oops, something went wrong.