Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin UI page pdf formats #29545

Merged
merged 2 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions ext/civicrm_admin_ui/ang/afsearchPrintPagePDFFormats.aff.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<div af-fieldset="">
<div class="af-markup">
<div class="help">
<div>{{:: ts('You can configure one or more PDF Page Formats for your CiviCRM installation. PDF Page Formats may be assigned to Message Templates to use when creating PDF letters.')}}</div>
</div>
</div>
<crm-search-display-table search-name="Print_Page_PDF_Formats" display-name="Option_Values_Table_1"></crm-search-display-table>
</div>
9 changes: 9 additions & 0 deletions ext/civicrm_admin_ui/ang/afsearchPrintPagePDFFormats.aff.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php
use CRM_CivicrmAdminUi_ExtensionUtil as E;

return [
'type' => 'search',
'title' => E::ts('Print Page (PDF) Formats'),
'icon' => 'fa-list-alt',
'server_route' => 'civicrm/admin/pdfFormats',
];
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
<?php
use CRM_CivicrmAdminUi_ExtensionUtil as E;

return [
[
'name' => 'SavedSearch_Print_Page_PDF_Formats',
'entity' => 'SavedSearch',
'cleanup' => 'unused',
'update' => 'unmodified',
'params' => [
'version' => 4,
'values' => [
'name' => 'Print_Page_PDF_Formats',
'label' => E::ts('Print Page (PDF) Formats'),
'api_entity' => 'OptionValue',
'api_params' => [
'version' => 4,
'select' => [
'id',
'label',
'description',
'is_active',
'is_default',
],
'orderBy' => [],
'where' => [
[
'option_group_id:name',
'=',
'pdf_format',
],
],
'groupBy' => [],
'join' => [],
'having' => [],
],
],
'match' => [
'name',
],
],
],
[
'name' => 'SavedSearch_Print_Page_PDF_Formats_SearchDisplay_Option_Values_Table_1',
'entity' => 'SearchDisplay',
'cleanup' => 'unused',
'update' => 'unmodified',
'params' => [
'version' => 4,
'values' => [
'name' => 'Option_Values_Table_1',
'label' => E::ts('Option Values'),
'saved_search_id.name' => 'Print_Page_PDF_Formats',
'type' => 'table',
'settings' => [
'description' => NULL,
'sort' => [],
'limit' => 50,
'pager' => [
'show_count' => FALSE,
'expose_limit' => FALSE,
],
'placeholder' => 5,
'columns' => [
[
'type' => 'field',
'key' => 'label',
'dataType' => 'String',
'label' => E::ts('Name'),
'sortable' => TRUE,
],
[
'type' => 'field',
'key' => 'description',
'dataType' => 'Text',
'label' => E::ts('Description'),
'sortable' => TRUE,
],
[
'type' => 'field',
'key' => 'is_default',
'dataType' => 'Boolean',
'label' => E::ts('Default'),
'sortable' => TRUE,
],
[
'text' => '',
'style' => 'default',
'size' => 'btn-xs',
'icon' => 'fa-bars',
'links' => [
[
'entity' => '',
'action' => '',
'path' => 'civicrm/admin/pdfFormats/edit?action=update&id=[id]&reset=1',
'join' => '',
'target' => 'crm-popup',
'icon' => 'fa-pencil',
'text' => E::ts('Edit'),
'style' => 'default',
'task' => '',
'condition' => [],
],
[
'entity' => 'OptionValue',
'action' => '',
'join' => '',
'target' => 'crm-popup',
'icon' => 'fa-toggle-on',
'text' => E::ts('Enable'),
'style' => 'default',
'path' => '',
'task' => 'enable',
'condition' => ['is_active', '=', FALSE],
],
[
'task' => 'disable',
'entity' => 'OptionValue',
'join' => '',
'target' => 'crm-popup',
'icon' => 'fa-toggle-off',
'text' => E::ts('Disable'),
'style' => 'default',
'path' => '',
'action' => 'disable',
'condition' => ['is_active', '=', TRUE],
],
[
'entity' => 'OptionValue',
'action' => 'delete',
'join' => '',
'target' => 'crm-popup',
'icon' => 'fa-trash',
'text' => E::ts('Delete'),
'style' => 'danger',
'path' => '',
'task' => '',
'condition' => [],
],
],
'type' => 'menu',
'alignment' => 'text-right',
],
],
'actions' => FALSE,
'classes' => [
'table',
'table-striped',
],
'draggable' => 'weight',
'toolbar' => [
[
'path' => 'civicrm/admin/pdfFormats/edit?action=add&reset=1',
'icon' => 'fa-plus',
'text' => E::ts('Add PDF Page Format'),
'style' => 'primary',
'condition' => [],
'task' => '',
'entity' => '',
'action' => '',
'join' => '',
'target' => 'crm-popup',
],
],
'cssRules' => [
[
'disabled',
'is_active',
'=',
FALSE,
],
],
],
],
'match' => [
'saved_search_id',
'name',
],
],
],
];