civicrm-core.git
3 years agominor cleanup
demeritcowboy [Wed, 24 Feb 2021 04:24:30 +0000 (23:24 -0500)]
minor cleanup

3 years agoMerge pull request #19478 from eileenmcnaughton/ref
colemanw [Tue, 23 Feb 2021 22:24:10 +0000 (17:24 -0500)]
Merge pull request #19478 from eileenmcnaughton/ref

[REF] do not needlessly pass as reference, enforce valid param

3 years agoMerge pull request #19610 from ahed-compucorp/dev/core#2372
Eileen McNaughton [Tue, 23 Feb 2021 21:16:49 +0000 (10:16 +1300)]
Merge pull request #19610 from ahed-compucorp/dev/core#2372

dev/core#2372 Enable submitOnce for some forms

3 years agoMerge pull request #19661 from civicrm/5.35
Eileen McNaughton [Tue, 23 Feb 2021 19:50:17 +0000 (08:50 +1300)]
Merge pull request #19661 from civicrm/5.35

5.35 to master

3 years agoMerge pull request #19659 from demeritcowboy/revert-18782
Eileen McNaughton [Tue, 23 Feb 2021 19:49:47 +0000 (08:49 +1300)]
Merge pull request #19659 from demeritcowboy/revert-18782

revert 18782

3 years agoMerge pull request #19655 from mlutfy/tr32fix
Eileen McNaughton [Tue, 23 Feb 2021 19:41:59 +0000 (08:41 +1300)]
Merge pull request #19655 from mlutfy/tr32fix

dev/translation#32 Contribution ThankYou: partial fix for recurring units

3 years agoMerge pull request #19643 from colemanw/searchKitButtons
colemanw [Tue, 23 Feb 2021 18:41:55 +0000 (13:41 -0500)]
Merge pull request #19643 from colemanw/searchKitButtons

SearchKit - Don't save on enter key

3 years agodev/translation#32 Contribution ThankYou: partial fix for recurring units
Mathieu Lutfy [Mon, 22 Feb 2021 21:37:31 +0000 (16:37 -0500)]
dev/translation#32 Contribution ThankYou: partial fix for recurring units

3 years agorevert 18782
demeritcowboy [Tue, 23 Feb 2021 12:11:59 +0000 (07:11 -0500)]
revert 18782

3 years agoMerge pull request #19650 from tapashdatta/Enable-"Do-no-trade"-filter-1
Seamus Lee [Tue, 23 Feb 2021 09:18:42 +0000 (20:18 +1100)]
Merge pull request #19650 from tapashdatta/Enable-"Do-no-trade"-filter-1

Enable-"Do-no-trade"-filter

3 years agoMerge pull request #19645 from colemanw/afformLink
Seamus Lee [Tue, 23 Feb 2021 09:02:09 +0000 (20:02 +1100)]
Merge pull request #19645 from colemanw/afformLink

Afform - Add 'View Page' link from afform edit screen

3 years agoMerge pull request #19657 from totten/master-aff-perm-blank
Seamus Lee [Tue, 23 Feb 2021 09:00:00 +0000 (20:00 +1100)]
Merge pull request #19657 from totten/master-aff-perm-blank

dev/core#2404 - Afform - Resolve ambiguity of omitted permissions

3 years agoMerge pull request #19654 from eileenmcnaughton/member
Monish Deb [Tue, 23 Feb 2021 00:44:59 +0000 (06:14 +0530)]
Merge pull request #19654 from eileenmcnaughton/member

[REF] Simplfy parameter

3 years agoMerge pull request #19648 from eileenmcnaughton/mm
Monish Deb [Tue, 23 Feb 2021 00:32:49 +0000 (06:02 +0530)]
Merge pull request #19648 from eileenmcnaughton/mm

dev/core#778 Do not increment tax on validation error

3 years ago(dev/core#2404) afform_core - If "permission" is empty-string, then use default
Tim Otten [Mon, 22 Feb 2021 22:59:03 +0000 (14:59 -0800)]
(dev/core#2404) afform_core - If "permission" is empty-string, then use default

3 years ago(dev/core#2404) afform_admin - Treat "permission" as a required field
Tim Otten [Mon, 22 Feb 2021 22:58:43 +0000 (14:58 -0800)]
(dev/core#2404) afform_admin - Treat "permission" as a required field

3 years ago[REF] Simplfiy parameter
eileen [Mon, 22 Feb 2021 20:37:01 +0000 (09:37 +1300)]
[REF] Simplfiy parameter

Rather than pass in contributionParams & params & combine in the function,
combine when passing in. Note receive_date is always 'now' in this
workflow as it is specifically the card payment workflow (for recurring)
being altered here & that field is not displayed on
credit card payments

3 years agoMerge pull request #19656 from civicrm/5.35
Eileen McNaughton [Mon, 22 Feb 2021 21:51:49 +0000 (10:51 +1300)]
Merge pull request #19656 from civicrm/5.35

5.35 to master

3 years agoMerge pull request #19653 from eileenmcnaughton/535
Eileen McNaughton [Mon, 22 Feb 2021 21:51:07 +0000 (10:51 +1300)]
Merge pull request #19653 from eileenmcnaughton/535

dev/core#2360 - Escape the word `rows` in sql query

3 years agoMerge pull request #19652 from JMAConsulting/money_defaults
Eileen McNaughton [Mon, 22 Feb 2021 20:12:57 +0000 (09:12 +1300)]
Merge pull request #19652 from JMAConsulting/money_defaults

Use specific function when formatting money for a default

3 years agoMerge pull request #19651 from lunar-debian/fix-i18n-data-templates-changelog
Eileen McNaughton [Mon, 22 Feb 2021 20:02:14 +0000 (09:02 +1300)]
Merge pull request #19651 from lunar-debian/fix-i18n-data-templates-changelog

Fix i18n issue with changeLog in data templates

3 years agodev/core#2360 - Escape the word `rows` in sql query
Coleman Watts [Thu, 4 Feb 2021 23:10:42 +0000 (18:10 -0500)]
dev/core#2360 - Escape the word `rows` in sql query

3 years agoUse specific function when formatting money for a default
Monish Deb [Mon, 22 Feb 2021 17:40:27 +0000 (23:10 +0530)]
Use specific function when formatting money for a default

3 years agoMerge pull request #19549 from eileenmcnaughton/member
Yashodha Chaku [Mon, 22 Feb 2021 16:50:57 +0000 (22:20 +0530)]
Merge pull request #19549 from eileenmcnaughton/member

[REF] Use form property rather than formValues to pass generated invoice ID on membership forms

3 years agoFix i18n issue with changeLog in data templates
Lunar [Mon, 22 Feb 2021 14:01:51 +0000 (15:01 +0100)]
Fix i18n issue with changeLog in data templates

There was a small mistake with the translation delimiters of `Change Log` in data templates.

3 years agoMerge pull request #19649 from eileenmcnaughton/bfhe
colemanw [Mon, 22 Feb 2021 13:53:15 +0000 (08:53 -0500)]
Merge pull request #19649 from eileenmcnaughton/bfhe

Mark Old Cividiscount hook support deprecated

3 years agoUpdate Form.php
tapashdatta [Mon, 22 Feb 2021 12:30:57 +0000 (12:30 +0000)]
Update Form.php

3 years agodev/core#778 Do not increment tax on validation error
eileen [Mon, 22 Feb 2021 04:34:44 +0000 (17:34 +1300)]
dev/core#778 Do not increment tax on validation error

After digging into & cleaning up the code that handles tax on the membership form
I concluded that we can fix https://lab.civicrm.org/dev/core/-/issues/778 without
regressing https://issues.civicrm.org/jira/browse/CRM-18827 by simply doing less.
If the form has been already submitted, just load up what was submitted, do not
call the script to mess with stuff.

The script does 3 things
1) checks or unchecks the record_contribution checkbox. This is fine
to leave alone as it will have the right values on new & reload
without intervention
2) sets financial type id - ditto - only needs to be changed
when something else changes
3) sets total_amount - ditto
4) sets the text that says how much tax is included

With this patch 4 will not happen on a validation error. I think
this is OK as it is a bit of an edge case and no message is
better than the 2 previous issues of the amount being wrong.

I did think about fixing but it adds a lot of complexity that
will be easy to do once other changes are done to make
accessing the tax_amount easier, but which are relatively hard
now & my guess is that no-one will notice it not being there

3 years agoAssign tax_rate directly rather than looking up via financial_type
eileen [Mon, 22 Feb 2021 04:15:11 +0000 (17:15 +1300)]
Assign tax_rate directly rather than looking up via financial_type

3 years agoFurther simplification
eileen [Mon, 22 Feb 2021 04:11:27 +0000 (17:11 +1300)]
Further simplification

3 years agoMerge pull request #19647 from eileenmcnaughton/more
Eileen McNaughton [Mon, 22 Feb 2021 05:32:25 +0000 (18:32 +1300)]
Merge pull request #19647 from eileenmcnaughton/more

Remove unreachable code & variable cleanup in membership back office form template

3 years agoMerge pull request #19633 from eileenmcnaughton/campaign
colemanw [Mon, 22 Feb 2021 03:59:47 +0000 (22:59 -0500)]
Merge pull request #19633 from eileenmcnaughton/campaign

[Regression] campaign name no longer accepted

3 years agoAfform Admin - Ensure buttons have 'type' declared
Coleman Watts [Mon, 22 Feb 2021 03:58:59 +0000 (22:58 -0500)]
Afform Admin - Ensure buttons have 'type' declared

3 years agoVariable simplification - assign membershipType to variable
eileen [Mon, 22 Feb 2021 02:46:46 +0000 (15:46 +1300)]
Variable simplification - assign membershipType to variable

3 years ago[REF] Minor clarification - rename membershipType to membershipTypeID
eileen [Mon, 22 Feb 2021 02:38:36 +0000 (15:38 +1300)]
[REF] Minor clarification - rename membershipType to membershipTypeID

3 years agoRemove unreachable code
eileen [Mon, 22 Feb 2021 03:17:25 +0000 (16:17 +1300)]
Remove unreachable code

Term is always set at this point unless we are dealing with a priceset - which
this handling appears to be for, ergo term is always set.

We also know that this code is unreachable as in the 6 years it has been in the
codebase no-one has reported the bug in it. It uses total_amount not total_amount_numerci
in the first part of the calculation - this would fail when the decimal separator
is not a decimal

3 years ago[REF] Remove unused variables
eileen [Mon, 22 Feb 2021 03:10:30 +0000 (16:10 +1300)]
[REF] Remove unused variables

existingAmount is never used except in this if so cannot be true. feeTotal
is used above this point but not below it - so this code is extraneous

3 years agoAfform - Add 'View Page' link from afform edit screen
Coleman Watts [Mon, 22 Feb 2021 02:50:14 +0000 (21:50 -0500)]
Afform - Add 'View Page' link from afform edit screen

3 years agoMark Old Cividiscount hook support deprecated
eileen [Mon, 22 Feb 2021 02:28:50 +0000 (15:28 +1300)]
Mark Old Cividiscount hook support deprecated

This seems to have existed to support a really old approach
(pre regions). It's gone from cividiscount with
https://github.com/civicrm/org.civicrm.module.cividiscount/pull/251
merged so this just adds comments

3 years agoAPIv3 - Legacy support for campaign_id fields which used to have a pseudoconstant
eileen [Fri, 19 Feb 2021 06:18:04 +0000 (19:18 +1300)]
APIv3 - Legacy support for campaign_id fields which used to have a pseudoconstant

3 years agoMerge pull request #19605 from eileenmcnaughton/money
Monish Deb [Mon, 22 Feb 2021 00:59:37 +0000 (06:29 +0530)]
Merge pull request #19605 from eileenmcnaughton/money

dev/translation#65 Further remove moneyValueFormat

3 years agoSearchKit - Don't save on enter key
Coleman Watts [Sun, 21 Feb 2021 22:44:31 +0000 (17:44 -0500)]
SearchKit - Don't save on enter key

3 years agoMerge pull request #19626 from colemanw/multiRecordCustomViewLink
Eileen McNaughton [Sun, 21 Feb 2021 21:56:51 +0000 (10:56 +1300)]
Merge pull request #19626 from colemanw/multiRecordCustomViewLink

SearchKit - Add links to view multi-record custom data

3 years agoMerge pull request #19618 from colemanw/searchAliasFix
Eileen McNaughton [Sun, 21 Feb 2021 21:49:25 +0000 (10:49 +1300)]
Merge pull request #19618 from colemanw/searchAliasFix

dev/core#2388 SearchKit - Fix display of pseudoconstant fields

3 years agoMerge pull request #19640 from mattwire/tokendeprecated
Eileen McNaughton [Sun, 21 Feb 2021 19:59:51 +0000 (08:59 +1300)]
Merge pull request #19640 from mattwire/tokendeprecated

Remove single use of extraParams in CRM_Utils_Token::getTokenDetails()

3 years agoRemove single use of extraParams in CRM_Utils_Token::getTokenDetails()
Matthew Wire [Sun, 21 Feb 2021 17:32:07 +0000 (17:32 +0000)]
Remove single use of extraParams in CRM_Utils_Token::getTokenDetails()

3 years agoMerge pull request #19609 from demeritcowboy/case-views
Eileen McNaughton [Sun, 21 Feb 2021 10:50:45 +0000 (23:50 +1300)]
Merge pull request #19609 from demeritcowboy/case-views

[NFC/Unit Test] dev/core#2385 - Add test for getCaseActivityQuery

3 years agoMerge pull request #19348 from sunilpawar/dev_age_at_deceased_date
Eileen McNaughton [Sun, 21 Feb 2021 00:36:32 +0000 (13:36 +1300)]
Merge pull request #19348 from sunilpawar/dev_age_at_deceased_date

Show Contact age on deceased date

3 years agoMerge pull request #19637 from demeritcowboy/static-event
Eileen McNaughton [Sat, 20 Feb 2021 22:57:14 +0000 (11:57 +1300)]
Merge pull request #19637 from demeritcowboy/static-event

dev/event#50 - Non static function called statically for event ical downloads

3 years agonon static function called statically
demeritcowboy [Sat, 20 Feb 2021 14:15:36 +0000 (09:15 -0500)]
non static function called statically

3 years agoMerge pull request #19631 from colemanw/searchKitLinks
Eileen McNaughton [Fri, 19 Feb 2021 23:04:00 +0000 (12:04 +1300)]
Merge pull request #19631 from colemanw/searchKitLinks

SearchKit - Enable links for implicit joins

3 years agoMerge pull request #19636 from demeritcowboy/saventest
Eileen McNaughton [Fri, 19 Feb 2021 22:53:13 +0000 (11:53 +1300)]
Merge pull request #19636 from demeritcowboy/saventest

dev/core#2398 - Fix save'n'test button on mail account form

3 years agoMerge pull request #19620 from colemanw/searchKitSelectCurrentUser
Eileen McNaughton [Fri, 19 Feb 2021 21:35:00 +0000 (10:35 +1300)]
Merge pull request #19620 from colemanw/searchKitSelectCurrentUser

Search kit select current user

3 years agoMerge pull request #19597 from eileenmcnaughton/nfc
colemanw [Fri, 19 Feb 2021 20:53:50 +0000 (15:53 -0500)]
Merge pull request #19597 from eileenmcnaughton/nfc

[REF] simplify parameter, use preferred strict

3 years agoMerge pull request #19608 from totten/master-wp-status
Eileen McNaughton [Fri, 19 Feb 2021 20:47:28 +0000 (09:47 +1300)]
Merge pull request #19608 from totten/master-wp-status

WordPress - If we hit a "permission denied" error, return HTTP 403

3 years agoMerge pull request #19625 from colemanw/fixTs
Eileen McNaughton [Fri, 19 Feb 2021 20:20:12 +0000 (09:20 +1300)]
Merge pull request #19625 from colemanw/fixTs

Fix incorrect use of ts when setting custom data form title

3 years agofix save'n'test button
demeritcowboy [Fri, 19 Feb 2021 19:08:34 +0000 (14:08 -0500)]
fix save'n'test button

3 years agoMerge pull request #19634 from eileenmcnaughton/iif
Seamus Lee [Fri, 19 Feb 2021 08:19:54 +0000 (19:19 +1100)]
Merge pull request #19634 from eileenmcnaughton/iif

dev/financial#166 Clean up money formatting in iif

3 years agoMerge pull request #19627 from colemanw/readonly
Seamus Lee [Fri, 19 Feb 2021 07:56:27 +0000 (18:56 +1100)]
Merge pull request #19627 from colemanw/readonly

Metadata - Add 'readonly' to id fields, custom fields & contact fields

3 years agodev/financial#166 Clean up money formatting in iif
eileen [Fri, 19 Feb 2021 07:02:10 +0000 (20:02 +1300)]
dev/financial#166 Clean up money formatting in iif

This does not turn out to be necessary but I tested & it works & is more correct

3 years agoMerge pull request #19579 from totten/master-aff-test
Seamus Lee [Fri, 19 Feb 2021 01:17:22 +0000 (12:17 +1100)]
Merge pull request #19579 from totten/master-aff-test

Afform - Allow public submission (PUB-CONTACT). Expand E2E test coverage.

3 years agomockPublicForm.test.php - Relax assertion
Tim Otten [Thu, 18 Feb 2021 22:09:43 +0000 (14:09 -0800)]
mockPublicForm.test.php - Relax assertion

Note that the actual type reported varies slightly by CMS/configuration.
assertContentType() should factor-out those differences. We just need
loose claim here.

3 years agoSearchKit - Enable links for implicit joins
Coleman Watts [Thu, 18 Feb 2021 21:02:25 +0000 (16:02 -0500)]
SearchKit - Enable links for implicit joins

Automatically create links for any implicitly joined entity linked through an fk field

3 years agoFix APIv4 unit test for 'readonly' attribute
Coleman Watts [Thu, 18 Feb 2021 18:44:54 +0000 (13:44 -0500)]
Fix APIv4 unit test for 'readonly' attribute

3 years agoRegenerate DAOs with readonly attribute for id fields
Coleman Watts [Thu, 18 Feb 2021 15:43:47 +0000 (10:43 -0500)]
Regenerate DAOs with readonly attribute for id fields

3 years agoAdd 'readonly' attribute to schema fields
Coleman Watts [Thu, 18 Feb 2021 15:41:28 +0000 (10:41 -0500)]
Add 'readonly' attribute to schema fields

For core fields, applies to primaryKey fields and fields tagged <readonly>.
For custom fields, this comes through via the 'is_view' property.

This will help autogenerated forms to know whether a field is appropriate to show to the user.

3 years agoSearchKit - Add links to view multi-record custom data
Coleman Watts [Thu, 18 Feb 2021 14:16:16 +0000 (09:16 -0500)]
SearchKit - Add links to view multi-record custom data

Ideally custom entities would have a full set of CRUD links, but the form code is a bizarre mess
and requires a bunch of extra url params that have to be calcultated when constructing the links.

Just getting the VIEW link was difficult because I had to remove the requirement of passing CID
& teach the form to look it up.

3 years agoFix incorrect use of ts when setting custom data form title
Coleman Watts [Thu, 18 Feb 2021 13:57:52 +0000 (08:57 -0500)]
Fix incorrect use of ts when setting custom data form title

3 years agoMerge pull request #19598 from eileenmcnaughton/msg_tpl_less
Matthew Wire [Thu, 18 Feb 2021 10:25:54 +0000 (10:25 +0000)]
Merge pull request #19598 from eileenmcnaughton/msg_tpl_less

Convert Smarty & domain token processing to use token processor

3 years agoMerge pull request #19615 from totten/master-joomla-getufid
Seamus Lee [Thu, 18 Feb 2021 10:07:47 +0000 (21:07 +1100)]
Merge pull request #19615 from totten/master-joomla-getufid

Joomla - Implement getUfId(). Fix `@user:<name>`.

3 years agoMerge pull request #19617 from colemanw/searchKitEditAfformLink
Seamus Lee [Thu, 18 Feb 2021 09:29:26 +0000 (20:29 +1100)]
Merge pull request #19617 from colemanw/searchKitEditAfformLink

dev/core#2389 SearchKit - Show edit link to searchDisplay afforms

3 years ago[REF] Use form property rather than formValues to pass generated invoice ID
eileen [Sat, 6 Feb 2021 00:34:38 +0000 (13:34 +1300)]
[REF] Use form property rather than formValues to pass generated invoice ID

formValues is 'sort of' the array for 'submittedValues' but it has stuff added to it
& passed around. This is part of an attempt to make it clearer where
various values come from to faciliate cleaning up the code and
removing some of the very many arrays in use.

3 years agoMerge pull request #19621 from demeritcowboy/reldate
Eileen McNaughton [Wed, 17 Feb 2021 23:01:01 +0000 (12:01 +1300)]
Merge pull request #19621 from demeritcowboy/reldate

dev/core#2392 - Deprecated url parameters in contribution dashboard detail links

3 years agoadd test for getCaseActivityQuery
demeritcowboy [Tue, 16 Feb 2021 03:38:26 +0000 (22:38 -0500)]
add test for getCaseActivityQuery

3 years agoMerge pull request #19614 from eileenmcnaughton/dispatch
Tim Otten [Wed, 17 Feb 2021 22:17:01 +0000 (14:17 -0800)]
Merge pull request #19614 from eileenmcnaughton/dispatch

Ensure dispatcher has loaded listeners

3 years agoMerge pull request #19622 from demeritcowboy/setting-description-ts
Eileen McNaughton [Wed, 17 Feb 2021 22:07:25 +0000 (11:07 +1300)]
Merge pull request #19622 from demeritcowboy/setting-description-ts

Remove empty {ts}

3 years agothere's no string to translate here
demeritcowboy [Wed, 17 Feb 2021 20:30:44 +0000 (15:30 -0500)]
there's no string to translate here

3 years agodeprecated url parameters
demeritcowboy [Wed, 17 Feb 2021 19:49:03 +0000 (14:49 -0500)]
deprecated url parameters

3 years agoMerge pull request #18299 from tunbola/email-separate-activity
Eileen McNaughton [Wed, 17 Feb 2021 19:35:58 +0000 (08:35 +1300)]
Merge pull request #18299 from tunbola/email-separate-activity

dev/core#1750: Replace Tokens In Activity Content for Sent Emails

3 years agoSearchKit - Use entityRef widget for ID fields
Coleman Watts [Wed, 17 Feb 2021 17:35:30 +0000 (12:35 -0500)]
SearchKit - Use entityRef widget for ID fields

3 years agodev/core#1750 Create separate email per contact and maintaining the file ids for...
Tunbola Ogunwande [Mon, 31 Aug 2020 12:34:37 +0000 (13:34 +0100)]
dev/core#1750 Create separate email per contact and maintaining the file ids for all email attachments

3 years agoSearchKit - permit selection of current user id for dynamic searches
Coleman Watts [Wed, 17 Feb 2021 16:56:56 +0000 (11:56 -0500)]
SearchKit - permit selection of current user id for dynamic searches

3 years agoSearchKit - Fix display of pseudoconstant fields
Coleman Watts [Wed, 17 Feb 2021 14:21:20 +0000 (09:21 -0500)]
SearchKit - Fix display of pseudoconstant fields

3 years agoMerge pull request #19566 from eileenmcnaughton/mem_recur
Yashodha Chaku [Wed, 17 Feb 2021 13:57:20 +0000 (19:27 +0530)]
Merge pull request #19566 from eileenmcnaughton/mem_recur

Remove always-true-if

3 years agoSearchKit - Show edit link to searchDisplay afforms
Coleman Watts [Wed, 17 Feb 2021 13:37:55 +0000 (08:37 -0500)]
SearchKit - Show edit link to searchDisplay afforms

3 years agoJoomla - Implement getUfId(). Fix '@user:<name>'.
Tim Otten [Wed, 17 Feb 2021 08:19:11 +0000 (00:19 -0800)]
Joomla - Implement getUfId(). Fix '@user:<name>'.

Overview
--------

APIv3 includes shorthand support for referencing a contact by their username, e.g.

```
cv api contact.get id=@user:admin return=display_name
```

Before
------

On Joomla, this emits an error because `getUfId($username):int` is
not implemented.

After
-----

On Joomla, this works.

Comments
--------

There is implicit E2E test-coverage in the pending work for authx.

3 years agoAfform Admin - If "security" and "actions" are missing, indicate the defaults
Tim Otten [Thu, 11 Feb 2021 07:35:41 +0000 (23:35 -0800)]
Afform Admin - If "security" and "actions" are missing, indicate the defaults

Note that this matches the defaults as interpreted by FormDataModel.

3 years agoAfform Admin - Expose options for "security" and "actions"
Tim Otten [Thu, 11 Feb 2021 07:35:02 +0000 (23:35 -0800)]
Afform Admin - Expose options for "security" and "actions"

3 years agoAfform - Allow `af-entity` to specify the `security` and `actions`
Tim Otten [Thu, 11 Feb 2021 02:47:52 +0000 (18:47 -0800)]
Afform - Allow `af-entity` to specify the `security` and `actions`

* `actions` indicates whether this entity can be used for creating or updating data
* `security` indicates whether it uses role-based access-control (like the standard Civi admin UI)
  or form-based access-control (dependent entirely on form configuration)

3 years agoAfform - Delegated API calls should use a security helper
Tim Otten [Thu, 11 Feb 2021 02:25:23 +0000 (18:25 -0800)]
Afform - Delegated API calls should use a security helper

Before
------

The `Prefill`, `Submit`, and `AbstractProcessor` have various calls to `civicrm_api4()`
which are meant to read/write data for a specific entity.

These calls may or may not have `checkPermissions` sprinkled in.

After
-----

Those calls to `civicrm_api4()` now go through a wrapper. For example:

```php
$formDataModel->getSecureApi4('spouse')('Contact', 'get', [...]);
```

In this call, we use the settings for the `spouse` entity to pick a security
policy.  Then, we execute the `Contact.get` API within that security policy.

3 years ago(REF) AfformSubmitEvent - Provide $afform, $formDataModel, and $apiRequest
Tim Otten [Thu, 11 Feb 2021 01:39:06 +0000 (17:39 -0800)]
(REF) AfformSubmitEvent - Provide $afform, $formDataModel, and $apiRequest

3 years agoExtract 2 tests from AfformRoutingTest to mockPublicForm. Make example work.
Tim Otten [Wed, 10 Feb 2021 22:33:30 +0000 (14:33 -0800)]
Extract 2 tests from AfformRoutingTest to mockPublicForm. Make example work.

These two cases rely on setting up the same fixture. It's easier to try out/debug if
the fixture is live/available as a matter of course.

Tangentially, if you try to use this form (whether as anonymous or as admin, it doesn't -- e.g.
because it doesn't have a "Submit" button. So this updates it.

3 years agoAfformRoutingTest - For public form, split test for creating vs editing
Tim Otten [Fri, 22 Jan 2021 09:16:59 +0000 (01:16 -0800)]
AfformRoutingTest - For public form, split test for creating vs editing

3 years agoAfformRoutingTest - Add test case for anonymous submission
Seamus Lee [Fri, 5 Feb 2021 03:45:24 +0000 (19:45 -0800)]
AfformRoutingTest - Add test case for anonymous submission

3 years agoREADME.md - Describe test organization
Tim Otten [Wed, 10 Feb 2021 22:45:25 +0000 (14:45 -0800)]
README.md - Describe test organization

3 years agoAdd basic support for `ang/*.test.php` test suite.
Tim Otten [Wed, 10 Feb 2021 22:22:36 +0000 (14:22 -0800)]
Add basic support for `ang/*.test.php` test suite.

The previous pattern was to put all tests in `tests/phpunit/`. They would use
fixtures in a few ways, eg

* Work with example forms from the `ang/` folder. This is useful for testing specific configurations/features
  (e.g. if a form is configured with `permission` of `X`, then the form should behave accordingly).
* Dynamically create/destroy forms. This is useful for testing the API mechanism (eg ensuring the `Afform.create`
  and `Afform.revert` actually do create and revert things).

The two styles are both necessary. However:

1. The first style is easer to work with -- if a form fails its test, then
   you can run that form interactively.  If you want to add a new test-case,
   you can simply copy in a working example -- you don't need to code-up
   some PHPUnit logic to build the example.

2. If you have something written in the first style, then it's easier keep
   the `*.aff.html` and the PHPUnit `*.php` next to each other.

3 years agoMerge pull request #19612 from colemanw/calcFields
Eileen McNaughton [Wed, 17 Feb 2021 06:53:58 +0000 (19:53 +1300)]
Merge pull request #19612 from colemanw/calcFields

Afform - SearchKit support for calculated fields

3 years ago(NFC) Tweak comment
Tim Otten [Wed, 17 Feb 2021 06:33:48 +0000 (22:33 -0800)]
(NFC) Tweak comment

3 years agoEnsure dispatcher has loaded listeners
eileen [Wed, 17 Feb 2021 06:26:46 +0000 (19:26 +1300)]
Ensure dispatcher has loaded listeners

3 years agoMerge pull request #19613 from eileenmcnaughton/catch
Seamus Lee [Wed, 17 Feb 2021 06:06:36 +0000 (17:06 +1100)]
Merge pull request #19613 from eileenmcnaughton/catch

Fix on recently merged asset builder catch patch