Skip to content

Commit

Permalink
Merge pull request #18269 from eileenmcnaughton/finacl
Browse files Browse the repository at this point in the history
Shell Financial ACLs extension
  • Loading branch information
eileenmcnaughton authored Aug 28, 2020
2 parents aa49f05 + e7339d5 commit 610f3cc
Show file tree
Hide file tree
Showing 11 changed files with 1,439 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
!/ext/flexmailer
!/ext/eventcart
!/ext/search
!/ext/financialacls
backdrop/
bower_components
CRM/Case/xml/configuration
Expand Down
42 changes: 42 additions & 0 deletions CRM/Upgrade/Incremental/php/FiveThirty.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,50 @@ public function setPostUpgradeMessage(&$postUpgradeMessage, $rev) {
// // The above is an exception because 'Upgrade DB to %1: SQL' is generic & reusable.
// }

/**
* Upgrade function.
*
* @param string $rev
*/
public function upgrade_5_30_alpha1($rev) {
$this->addTask(ts('Upgrade DB to %1: SQL', [1 => $rev]), 'runSql', $rev);
$this->addTask('Add core (required) extension Financial ACLs', 'installFinancialAcls');
}

// public static function taskFoo(CRM_Queue_TaskContext $ctx, ...) {
// return TRUE;
// }

/**
* Install financialacls extension.
*
* This feature is restructured as a core extension - which is primarily a code cleanup step.
*
* @param \CRM_Queue_TaskContext $ctx
*
* @return bool
*
* @throws \CiviCRM_API3_Exception
* @throws \CRM_Core_Exception
*/
public static function installFinancialAcls(CRM_Queue_TaskContext $ctx) {
// Install via direct SQL manipulation. Note that:
// (1) This extension has no activation logic.
// (2) On new installs, the extension is activated purely via default SQL INSERT.
// (3) Caches are flushed at the end of the upgrade.
// ($) Over long term, upgrade steps are more reliable in SQL. API/BAO sometimes don't work mid-upgrade.
$insert = CRM_Utils_SQL_Insert::into('civicrm_extension')->row([
'type' => 'module',
'full_name' => 'financialacls',
'name' => 'financialacls',
'label' => 'Financial ACLs',
'file' => 'financialacls',
'schema_version' => NULL,
'is_active' => 1,
]);
CRM_Core_DAO::executeQuery($insert->usingReplace()->toSQL());

return TRUE;
}

}
2 changes: 1 addition & 1 deletion bin/regen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ php GenerateData.php

## Prune local data
$MYSQLCMD -e "DROP TABLE IF EXISTS civicrm_install_canary; DELETE FROM civicrm_cache; DELETE FROM civicrm_setting;"
$MYSQLCMD -e "DELETE FROM civicrm_extension WHERE full_name NOT IN ('sequentialcreditnotes', 'eventcart', 'search', 'flexmailer');"
$MYSQLCMD -e "DELETE FROM civicrm_extension WHERE full_name NOT IN ('sequentialcreditnotes', 'eventcart', 'search', 'flexmailer', 'financialacls);"
TABLENAMES=$( echo "show tables like 'civicrm_%'" | $MYSQLCMD | grep ^civicrm_ | xargs )

cd $CIVISOURCEDIR/sql
Expand Down
1 change: 1 addition & 0 deletions distmaker/dists/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ function dm_core_exts() {
echo ext/sequentialcreditnotes
echo ext/flexmailer
echo ext/eventcart
echo ext/financialacls
}

## Copy all packages
Expand Down
667 changes: 667 additions & 0 deletions ext/financialacls/LICENSE.txt

Large diffs are not rendered by default.

44 changes: 44 additions & 0 deletions ext/financialacls/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# financialacls

![Screenshot](/images/screenshot.png)

(*FIXME: In one or two paragraphs, describe what the extension does and why one would download it. *)

The extension is licensed under [AGPL-3.0](LICENSE.txt).

## Requirements

* PHP v7.0+
* CiviCRM (*FIXME: Version number*)

## Installation (Web UI)

This extension has not yet been published for installation via the web UI.

## Installation (CLI, Zip)

Sysadmins and developers may download the `.zip` file for this extension and
install it with the command-line tool [cv](https://github.com/civicrm/cv).

```bash
cd <extension-dir>
cv dl financialacls@https://github.com/FIXME/financialacls/archive/master.zip
```

## Installation (CLI, Git)

Sysadmins and developers may clone the [Git](https://en.wikipedia.org/wiki/Git) repo for this extension and
install it with the command-line tool [cv](https://github.com/civicrm/cv).

```bash
git clone https://github.com/FIXME/financialacls.git
cv en financialacls
```

## Usage

(* FIXME: Where would a new user navigate to get started? What changes would they see? *)

## Known Issues

(* FIXME *)
Loading

0 comments on commit 610f3cc

Please sign in to comment.