From 57c59c34d645394f946ceda1b21feda8721268bf Mon Sep 17 00:00:00 2001 From: Andrew Hunt Date: Thu, 6 Aug 2020 14:57:11 -0400 Subject: [PATCH] No need for crm-button wrappers for real buttons --- CRM/Admin/Form/Preferences/Display.php | 2 ++ CRM/Batch/Form/Entry.php | 1 + CRM/Contact/Form/Contact.php | 17 ++++++++++++++--- CRM/Core/Form.php | 1 + CRM/Profile/Form.php | 5 ++++- CRM/Profile/Form/Edit.php | 1 + .../CRM/Admin/Form/Preferences/Display.tpl | 4 +--- templates/CRM/Admin/Page/APIExplorer.tpl | 8 +++----- templates/CRM/Batch/Form/Entry.tpl | 4 +--- templates/CRM/Contact/Form/Contact.tpl | 10 +++------- templates/CRM/Profile/Form/Dynamic.tpl | 8 ++++---- templates/CRM/common/formButtons.tpl | 11 ++--------- 12 files changed, 37 insertions(+), 35 deletions(-) diff --git a/CRM/Admin/Form/Preferences/Display.php b/CRM/Admin/Form/Preferences/Display.php index af824f1f02..0716cdebd2 100644 --- a/CRM/Admin/Form/Preferences/Display.php +++ b/CRM/Admin/Form/Preferences/Display.php @@ -56,6 +56,8 @@ class CRM_Admin_Form_Preferences_Display extends CRM_Admin_Form_Preferences { CRM_Core_Page::crmIcon('fa-wrench') . ' ' . ts('Configure CKEditor'), [ 'type' => 'submit', + 'class' => 'crm-button', + 'style' => 'display:inline-block;vertical-align:middle;float:none!important;', 'value' => 1, ] ); diff --git a/CRM/Batch/Form/Entry.php b/CRM/Batch/Form/Entry.php index ceb3868d28..35c407a79f 100644 --- a/CRM/Batch/Form/Entry.php +++ b/CRM/Batch/Form/Entry.php @@ -179,6 +179,7 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form { [ 'type' => 'submit', 'value' => 1, + 'class' => 'crm-button crm-button_qf_Entry_upload_force-save', ] ); diff --git a/CRM/Contact/Form/Contact.php b/CRM/Contact/Form/Contact.php index 5d6ce311bc..798050800c 100644 --- a/CRM/Contact/Form/Contact.php +++ b/CRM/Contact/Form/Contact.php @@ -811,17 +811,28 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form { $this->addElement('xbutton', $this->_dedupeButtonName, ts('Check for Matching Contact(s)'), - ['type' => 'submit'] + [ + 'type' => 'submit', + 'value' => 1, + 'class' => "crm-button crm-button{$this->_dedupeButtonName}", + ] ); $this->addElement('xbutton', $this->_duplicateButtonName, ts('Save Matching Contact'), - ['type' => 'submit'] + [ + 'type' => 'submit', + 'value' => 1, + 'class' => "crm-button crm-button{$this->_duplicateButtonName}", + ] ); $this->addElement('xbutton', $this->getButtonName('next', 'sharedHouseholdDuplicate'), ts('Save With Duplicate Household'), - ['type' => 'submit'] + [ + 'type' => 'submit', + 'value' => 1, + ] ); $buttons = [ diff --git a/CRM/Core/Form.php b/CRM/Core/Form.php index ef81439d24..fe06bb9915 100644 --- a/CRM/Core/Form.php +++ b/CRM/Core/Form.php @@ -714,6 +714,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { } $buttonContents = CRM_Core_Page::crmIcon($button['icon'] ?? $defaultIcon) . ' ' . $button['name']; $buttonName = $this->getButtonName($button['type'], CRM_Utils_Array::value('subName', $button)); + $attrs['class'] .= " crm-button crm-button-type-{$button['type']} crm-button{$buttonName}"; $attrs['type'] = 'submit'; $prevnext[] = $this->createElement('xbutton', $buttonName, $buttonContents, $attrs); } diff --git a/CRM/Profile/Form.php b/CRM/Profile/Form.php index c34f1388dd..c6594fd4bd 100644 --- a/CRM/Profile/Form.php +++ b/CRM/Profile/Form.php @@ -907,7 +907,10 @@ class CRM_Profile_Form extends CRM_Core_Form { 'xbutton', $this->_duplicateButtonName, ts('Save Matching Contact'), - ['type' => 'submit'] + [ + 'type' => 'submit', + 'class' => 'crm-button', + ] ); } } diff --git a/CRM/Profile/Form/Edit.php b/CRM/Profile/Form/Edit.php index 758e971127..b2cfc16bf4 100644 --- a/CRM/Profile/Form/Edit.php +++ b/CRM/Profile/Form/Edit.php @@ -212,6 +212,7 @@ SELECT module,is_reserved $this->addElement('xbutton', $this->_deleteButtonName, ts('Delete'), [ 'type' => 'submit', 'value' => 1, + 'class' => 'crm-button', ]); return; diff --git a/templates/CRM/Admin/Form/Preferences/Display.tpl b/templates/CRM/Admin/Form/Preferences/Display.tpl index 6ee7378d31..b06cb53588 100644 --- a/templates/CRM/Admin/Form/Preferences/Display.tpl +++ b/templates/CRM/Admin/Form/Preferences/Display.tpl @@ -161,9 +161,7 @@ {$form.editor_id.html}   - - {$form.ckeditor_config.html} - + {$form.ckeditor_config.html} diff --git a/templates/CRM/Admin/Page/APIExplorer.tpl b/templates/CRM/Admin/Page/APIExplorer.tpl index 98e6529ca1..2be5f1f3c4 100644 --- a/templates/CRM/Admin/Page/APIExplorer.tpl +++ b/templates/CRM/Admin/Page/APIExplorer.tpl @@ -285,11 +285,9 @@
- - - +
diff --git a/templates/CRM/Batch/Form/Entry.tpl b/templates/CRM/Batch/Form/Entry.tpl
index 70c0a1c350..14581e6343 100644
--- a/templates/CRM/Batch/Form/Entry.tpl
+++ b/templates/CRM/Batch/Form/Entry.tpl
@@ -22,9 +22,7 @@
     
{ts}Total for amounts entered below does not match the expected batch total.{/ts}
- - {$form._qf_Entry_upload_force.html} - + {$form._qf_Entry_upload_force.html}
{/if} diff --git a/templates/CRM/Contact/Form/Contact.tpl b/templates/CRM/Contact/Form/Contact.tpl index 2acbff7dcc..2844d09e35 100644 --- a/templates/CRM/Contact/Form/Contact.tpl +++ b/templates/CRM/Contact/Form/Contact.tpl @@ -66,14 +66,10 @@
{*add dupe buttons *} - - {$form._qf_Contact_refresh_dedupe.html} - + {$form._qf_Contact_refresh_dedupe.html} {if $isDuplicate}    - - {$form._qf_Contact_upload_duplicate.html} - + {$form._qf_Contact_upload_duplicate.html} {/if}
@@ -212,7 +208,7 @@ loadMultiRecordFields(); {/literal}{if $oldSubtypes}{literal} - $('input[name=_qf_Contact_upload_view], input[name=_qf_Contact_upload_new]').click(function() { + $('button[name=_qf_Contact_upload_view], button[name=_qf_Contact_upload_new]').click(function() { var submittedSubtypes = $('#contact_sub_type').val(); var oldSubtypes = {/literal}{$oldSubtypes}{literal}; diff --git a/templates/CRM/Profile/Form/Dynamic.tpl b/templates/CRM/Profile/Form/Dynamic.tpl index 2d0240fb88..09ed9986dd 100644 --- a/templates/CRM/Profile/Form/Dynamic.tpl +++ b/templates/CRM/Profile/Form/Dynamic.tpl @@ -19,7 +19,7 @@
- {$form._qf_Edit_upload_delete.html} + {$form._qf_Edit_upload_delete.html} {if $includeCancelButton} {$cancelButtonText} {/if} @@ -37,7 +37,7 @@ {if $isDuplicate and ( ($action eq 1 and $mode eq 4 ) or ($action eq 2) or ($action eq 8192) ) }
- {$form._qf_Edit_upload_duplicate.html} + {$form._qf_Edit_upload_duplicate.html}
{/if} {if $mode eq 1 || $activeComponent neq "CiviCRM"} @@ -53,7 +53,7 @@ {if $action eq 2 and $multiRecordFieldListing}

{ts}Edit Details{/ts}

- {include file="CRM/common/formButtons.tpl"}{if $isDuplicate}{$form._qf_Edit_upload_duplicate.html}{/if} + {include file="CRM/common/formButtons.tpl"}{if $isDuplicate}{$form._qf_Edit_upload_duplicate.html}{/if}
{/if} @@ -209,7 +209,7 @@
{/if}