-
-
Notifications
You must be signed in to change notification settings - Fork 825
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DomainEmailAddress - Add search display and formbuilder form
Removes unused handling from the quickform
- Loading branch information
Showing
10 changed files
with
221 additions
and
55 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,12 @@ | ||
<af-form ctrl="afform"> | ||
<af-entity actions="{create: true, update: true}" type="DomainEmailAddress" name="email" label="Site Email Address 1" security="RBAC" url-autofill="1" /> | ||
<fieldset af-fieldset="email" class="af-container" af-title="Site Email Address 1"> | ||
<div class="af-container af-layout-inline"> | ||
<af-field name="name" /> | ||
<af-field name="email" /> | ||
</div> | ||
<af-field name="description" /> | ||
<af-field name="is_default" /> | ||
</fieldset> | ||
<button class="af-button btn btn-primary" crm-icon="fa-check" ng-click="afform.submit()" ng-if="afform.showSubmitButton">Submit</button> | ||
</af-form> |
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,11 @@ | ||
<?php | ||
|
||
return [ | ||
'type' => 'form', | ||
'title' => ts('Site Email Address'), | ||
'icon' => 'fa-list-alt', | ||
'server_route' => 'civicrm/admin/form/site-email-address', | ||
'permission' => [ | ||
'administer CiviCRM system', | ||
], | ||
]; |
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,3 @@ | ||
<div af-fieldset=""> | ||
<crm-search-display-table search-name="Site_Email_Addresses" display-name="Site_Email_Addresses"></crm-search-display-table> | ||
</div> |
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,11 @@ | ||
<?php | ||
|
||
return [ | ||
'type' => 'search', | ||
'title' => ts('Site Email Addresses'), | ||
'icon' => 'fa-list-alt', | ||
'server_route' => 'civicrm/admin/options/from_email_address', | ||
'permission' => [ | ||
'administer CiviCRM system', | ||
], | ||
]; |
179 changes: 179 additions & 0 deletions
179
managed/administer/SavedSearch_Site_Email_Addresses.mgd.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,179 @@ | ||
<?php | ||
|
||
return [ | ||
[ | ||
'name' => 'SavedSearch_Site_Email_Addresses', | ||
'entity' => 'SavedSearch', | ||
'cleanup' => 'unused', | ||
'update' => 'unmodified', | ||
'params' => [ | ||
'version' => 4, | ||
'values' => [ | ||
'name' => 'Site_Email_Addresses', | ||
'label' => ts('Site Email Addresses'), | ||
'api_entity' => 'DomainEmailAddress', | ||
'api_params' => [ | ||
'version' => 4, | ||
'select' => [ | ||
'name', | ||
'email', | ||
'description', | ||
'is_active', | ||
'is_default', | ||
], | ||
'orderBy' => [], | ||
'where' => [ | ||
['domain_id:name', '=', 'current_domain'], | ||
], | ||
'groupBy' => [], | ||
'join' => [], | ||
'having' => [], | ||
], | ||
], | ||
'match' => ['name'], | ||
], | ||
], | ||
[ | ||
'name' => 'SavedSearch_Site_Email_Addresses_SearchDisplay_Site_Email_Addresses', | ||
'entity' => 'SearchDisplay', | ||
'cleanup' => 'unused', | ||
'update' => 'unmodified', | ||
'params' => [ | ||
'version' => 4, | ||
'values' => [ | ||
'name' => 'Site_Email_Addresses', | ||
'label' => ts('Site Email Addresses'), | ||
'saved_search_id.name' => 'Site_Email_Addresses', | ||
'type' => 'table', | ||
'settings' => [ | ||
'description' => ts('You can use this page to define one or more general Email Addresses that can be selected as the From Address.'), | ||
'sort' => [], | ||
'limit' => 50, | ||
'pager' => [ | ||
'hide_single' => TRUE, | ||
'show_count' => TRUE, | ||
], | ||
'placeholder' => 5, | ||
'columns' => [ | ||
[ | ||
'type' => 'field', | ||
'key' => 'name', | ||
'dataType' => 'String', | ||
'label' => ts('Display Name'), | ||
'sortable' => TRUE, | ||
], | ||
[ | ||
'type' => 'field', | ||
'key' => 'email', | ||
'dataType' => 'String', | ||
'label' => ts('Email'), | ||
'sortable' => TRUE, | ||
], | ||
[ | ||
'type' => 'field', | ||
'key' => 'description', | ||
'dataType' => 'Text', | ||
'label' => ts('Description'), | ||
'sortable' => TRUE, | ||
], | ||
[ | ||
'type' => 'field', | ||
'key' => 'is_active', | ||
'dataType' => 'Boolean', | ||
'label' => ts('Enabled'), | ||
'sortable' => TRUE, | ||
], | ||
[ | ||
'type' => 'field', | ||
'key' => 'is_default', | ||
'dataType' => 'Boolean', | ||
'label' => ts('Default'), | ||
'sortable' => TRUE, | ||
'icons' => [ | ||
[ | ||
'icon' => 'fa-circle-check', | ||
'side' => 'left', | ||
'if' => ['is_default', '=', TRUE], | ||
], | ||
], | ||
'rewrite' => ' ', | ||
], | ||
[ | ||
'text' => ts(''), | ||
'style' => 'default', | ||
'size' => 'btn-xs', | ||
'icon' => 'fa-bars', | ||
'links' => [ | ||
[ | ||
'entity' => 'DomainEmailAddress', | ||
'action' => 'update', | ||
'join' => '', | ||
'target' => 'crm-popup', | ||
'icon' => 'fa-pencil', | ||
'text' => ts('Edit Email Address'), | ||
'style' => 'default', | ||
'path' => '', | ||
'task' => '', | ||
'condition' => [], | ||
], | ||
[ | ||
'task' => 'disable', | ||
'entity' => 'DomainEmailAddress', | ||
'join' => '', | ||
'target' => 'crm-popup', | ||
'icon' => 'fa-toggle-off', | ||
'text' => ts('Disable Email Addresses'), | ||
'style' => 'default', | ||
'path' => '', | ||
'action' => '', | ||
'condition' => [], | ||
], | ||
[ | ||
'task' => 'enable', | ||
'entity' => 'DomainEmailAddress', | ||
'join' => '', | ||
'target' => 'crm-popup', | ||
'icon' => 'fa-toggle-on', | ||
'text' => ts('Enable Email Addresses'), | ||
'style' => 'default', | ||
'path' => '', | ||
'action' => '', | ||
'condition' => [], | ||
], | ||
], | ||
'type' => 'menu', | ||
'alignment' => 'text-right', | ||
], | ||
], | ||
'actions' => FALSE, | ||
'classes' => [ | ||
'table', | ||
'table-striped', | ||
'crm-sticky-header', | ||
], | ||
'toolbar' => [ | ||
[ | ||
'entity' => 'DomainEmailAddress', | ||
'text' => ts('Add Email Address'), | ||
'icon' => 'fa-plus', | ||
'target' => 'crm-popup', | ||
'action' => 'add', | ||
'style' => 'primary', | ||
'join' => '', | ||
'path' => '', | ||
'task' => '', | ||
'condition' => [], | ||
], | ||
], | ||
'cssRules' => [ | ||
['disabled', 'is_active', '=', FALSE], | ||
], | ||
], | ||
], | ||
'match' => [ | ||
'saved_search_id', | ||
'name', | ||
], | ||
], | ||
], | ||
]; |
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 |
---|---|---|
|
@@ -23,13 +23,6 @@ | |
<span class="description">{ts}Enter the "class path" for this custom search here.{/ts} | ||
</td> | ||
</tr> | ||
{elseif $gName eq 'from_email_address'} | ||
<tr class="crm-admin-options-form-block-from_email_address"> | ||
<td class="label">{ts}FROM Email Address{/ts} {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_option_value' field='label' id=$id}{/if}</td> | ||
<td>{$form.label.html}<br /> | ||
<span class="description">{ts}Include double-quotes (") around the name and angle-brackets (< >) around the email address.<br />EXAMPLE: <em>"Client Services" <[email protected]></em>{/ts}<span> | ||
</td> | ||
</tr> | ||
{elseif $gName eq 'redaction_rule'} | ||
<tr class="crm-admin-options-form-block-expression"> | ||
<td class="label">{ts}Match Value or Expression{/ts} {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_option_value' field='label' id=$id}{/if}</td> | ||
|
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 |
---|---|---|
|
@@ -42,12 +42,6 @@ | |
{ts}Define participant roles for events here (e.g. Attendee, Host, Speaker...). You can then assign roles and search for participants by role.{/ts} | ||
{elseif $gName eq 'participant_status'} | ||
{ts}Define statuses for event participants here (e.g. Registered, Attended, Cancelled...). You can then assign statuses and search for participants by status.{/ts} {ts}"Counted?" controls whether a person with that status is counted as participant for the purpose of controlling the Maximum Number of Participants.{/ts} | ||
{elseif $gName eq 'from_email_address'} | ||
{if $allowLoggedIn} | ||
{ts}By default, CiviCRM uses the primary email address of the logged in user as the FROM address when sending emails to contacts. However, you can use this page to define one or more general Email Addresses that can be selected as an alternative. EXAMPLE: <em>"Client Services" <[email protected]></em>{/ts} | ||
{else} | ||
{ts}You can use this page to define one or more general Email Addresses that can be selected as the From Address. EXAMPLE: <em>"Client Services" <[email protected]></em>{/ts} | ||
{/if} | ||
{elseif $isLocked} | ||
{ts}This option group is reserved for system use. You cannot add or delete options in this list.{/ts} | ||
{else} | ||
|
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 |
---|---|---|
|
@@ -75,22 +75,6 @@ public function testsOptionGroupDataType($optionGroup, $expectedDataType) { | |
} | ||
} | ||
|
||
public function emailAddressTests() { | ||
$tests[] = ['"Name"<[email protected]>', '"Name" <[email protected]>']; | ||
$tests[] = ['"Name" <[email protected]>', '"Name" <[email protected]>']; | ||
$tests[] = ['"Name" <[email protected]>', '"Name" <[email protected]>']; | ||
return $tests; | ||
} | ||
|
||
/** | ||
* @dataProvider emailAddressTests | ||
*/ | ||
public function testSanitizeFromEmailAddress($dirty, $clean) { | ||
$form = new CRM_Admin_Form_Options(); | ||
$actual = $form->sanitizeFromEmailAddress($dirty); | ||
$this->assertEquals($actual, $clean); | ||
} | ||
|
||
public static function orderByCases(): array { | ||
return [ | ||
['weight', FALSE], | ||
|