Revert "Swap out button/submit inputs for button elements"
authorcolemanw <coleman@civicrm.org>
Tue, 18 Aug 2020 00:49:42 +0000 (20:49 -0400)
committerGitHub <noreply@github.com>
Tue, 18 Aug 2020 00:49:42 +0000 (20:49 -0400)
55 files changed:
CRM/Admin/Form/Preferences/Display.php
CRM/Admin/Form/Setting/Smtp.php
CRM/Batch/Form/Entry.php
CRM/Case/Form/CaseView.php
CRM/Contact/Form/Contact.php
CRM/Contact/Form/Search.php
CRM/Contact/Form/Task/AddToParentClass.php
CRM/Contribute/Form/ContributionPage.php
CRM/Contribute/Form/ContributionPage/Widget.php
CRM/Contribute/Import/Form/DataSource.php
CRM/Core/BAO/Mapping.php
CRM/Core/Form.php
CRM/Custom/Form/Field.php
CRM/Custom/Form/Group.php
CRM/Custom/Form/Option.php
CRM/Event/Form/ManageEvent/Fee.php
CRM/Financial/Form/BatchTransaction.php
CRM/Financial/Form/Search.php
CRM/Price/Form/Field.php
CRM/Profile/Form.php
CRM/Profile/Form/Edit.php
CRM/Report/Form.php
CRM/UF/Form/Field.php
CRM/UF/Form/Group.php
css/civicrm.css
css/joomla.css
install/template.html
js/Common.js
js/crm.ajax.js
js/crm.searchForm.js
js/jquery/jquery.dashboard.js
setup/plugins/blocks/advanced.tpl.php
setup/plugins/blocks/install.tpl.php
setup/plugins/blocks/requirements.tpl.php
setup/res/template.css
setup/src/Setup/UI/SetupController.php
templates/CRM/Admin/Form/Preferences/Display.tpl
templates/CRM/Admin/Page/APIExplorer.tpl
templates/CRM/Admin/Page/CKEditorConfig.tpl
templates/CRM/Batch/Form/Entry.tpl
templates/CRM/Block/Add.tpl
templates/CRM/Block/FullTextSearch.tpl
templates/CRM/Contact/Form/Contact.tpl
templates/CRM/Contact/Form/Search/Builder.js
templates/CRM/Contact/Page/View/Print.tpl
templates/CRM/Contribute/Form/Contribution/PremiumBlock.tpl
templates/CRM/Event/Form/ManageEvent/Registration.tpl
templates/CRM/Mailing/Page/Event.tpl
templates/CRM/Mailing/Page/Resubscribe.tpl
templates/CRM/Profile/Form/Dynamic.tpl
templates/CRM/Report/Form/Layout/Graph.tpl
templates/CRM/common/TabHeader.js
templates/CRM/common/deferredFinancialType.tpl
templates/CRM/common/formButtons.tpl
templates/CRM/common/navigation.js.tpl

index 0716cdebd233bd0286546e939b66d674702047af..775fa2c04ec57cd741a37d0f837fc4884a88ce70 100644 (file)
@@ -50,17 +50,7 @@ class CRM_Admin_Form_Preferences_Display extends CRM_Admin_Form_Preferences {
     $invoiceSettings = Civi::settings()->get('contribution_invoice_settings');
     $this->assign('invoicing', CRM_Invoicing_Utils::isInvoicingEnabled());
 
-    $this->addElement(
-      'xbutton',
-      'ckeditor_config',
-      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,
-      ]
-    );
+    $this->addElement('submit', 'ckeditor_config', ts('Configure CKEditor'));
 
     $editOptions = CRM_Core_OptionGroup::values('contact_edit_options', FALSE, FALSE, FALSE, 'AND v.filter = 0');
     $this->assign('editOptions', $editOptions);
index 79e0da4f7782a131935ad6b8b2a2f77bdeb49738..da909c7f0877817e205df640f1c17df749179c8e 100644 (file)
@@ -61,12 +61,7 @@ class CRM_Admin_Form_Setting_Smtp extends CRM_Admin_Form_Setting {
     $this->addFormRule(['CRM_Admin_Form_Setting_Smtp', 'formRule']);
     parent::buildQuickForm();
     $buttons = $this->getElement('buttons')->getElements();
-    $buttons[] = $this->createElement(
-      'xbutton',
-      $this->_testButtonName,
-      CRM_Core_Page::crmIcon('fa-envelope-o') . ' ' . ts('Save & Send Test Email'),
-      ['type' => 'submit']
-    );
+    $buttons[] = $this->createElement('submit', $this->_testButtonName, ts('Save & Send Test Email'), ['crm-icon' => 'fa-envelope-o']);
     $this->getElement('buttons')->setElements($buttons);
 
     if (!empty($setStatus)) {
index 35c407a79f267102716643a7d1e62d989d065c35..e60ababdb45cb910fe6a7ee20aa794e54c5e4d70 100644 (file)
@@ -173,14 +173,9 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form {
     // add the force save button
     $forceSave = $this->getButtonName('upload', 'force');
 
-    $this->addElement('xbutton',
+    $this->addElement('submit',
       $forceSave,
-      ts('Ignore Mismatch & Process the Batch?'),
-      [
-        'type' => 'submit',
-        'value' => 1,
-        'class' => 'crm-button crm-button_qf_Entry_upload_force-save',
-      ]
+      ts('Ignore Mismatch & Process the Batch?')
     );
 
     $this->addButtons([
index 4c21b837e1c187beade765b2482c5132e68744e2..646d48cfd054ea71f88872196b320a05d7ca3691 100644 (file)
@@ -272,10 +272,7 @@ class CRM_Case_Form_CaseView extends CRM_Core_Form {
         ['class' => 'crm-select2 crm-action-menu fa-list-ol']
       );
     }
-    $this->addElement('xbutton', $this->getButtonName('next'), ' ', [
-      'class' => 'hiddenElement',
-      'type' => 'submit',
-    ]);
+    $this->addElement('submit', $this->getButtonName('next'), ' ', ['class' => 'hiddenElement']);
 
     $this->buildMergeCaseForm();
 
@@ -520,12 +517,11 @@ class CRM_Case_Form_CaseView extends CRM_Core_Form {
         FALSE,
         ['class' => 'crm-select2 huge']
       );
-      $this->addElement('xbutton',
+      $this->addElement('submit',
         $this->getButtonName('next', 'merge_case'),
         ts('Merge'),
         [
           'class' => 'hiddenElement',
-          'type' => 'submit',
         ]
       );
     }
index 798050800c35a5800bdfa950e2b5afecadf30513..04e3c8a897e79f52c58a27b38d60bf73bbe1ef31 100644 (file)
@@ -808,31 +808,17 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form {
     $this->addField('image_URL', ['maxlength' => '255', 'label' => ts('Browse/Upload Image')]);
 
     // add the dedupe button
-    $this->addElement('xbutton',
+    $this->addElement('submit',
       $this->_dedupeButtonName,
-      ts('Check for Matching Contact(s)'),
-      [
-        'type' => 'submit',
-        'value' => 1,
-        'class' => "crm-button crm-button{$this->_dedupeButtonName}",
-      ]
+      ts('Check for Matching Contact(s)')
     );
-    $this->addElement('xbutton',
+    $this->addElement('submit',
       $this->_duplicateButtonName,
-      ts('Save Matching Contact'),
-      [
-        'type' => 'submit',
-        'value' => 1,
-        'class' => "crm-button crm-button{$this->_duplicateButtonName}",
-      ]
+      ts('Save Matching Contact')
     );
-    $this->addElement('xbutton',
+    $this->addElement('submit',
       $this->getButtonName('next', 'sharedHouseholdDuplicate'),
-      ts('Save With Duplicate Household'),
-      [
-        'type' => 'submit',
-        'value' => 1,
-      ]
+      ts('Save With Duplicate Household')
     );
 
     $buttons = [
index dcaa084d0e9863fb91813fa8a9f106aef5a08400..322dc47e317bb42c42bd06f7eca146b49ce6b204 100644 (file)
@@ -468,9 +468,8 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search {
       // also set the group title and freeze the action task with Add Members to Group
       $groupValues = ['id' => $this->_amtgID, 'title' => $this->_group[$this->_amtgID]];
       $this->assign_by_ref('group', $groupValues);
-      $this->add('xbutton', $this->_actionButtonName, ts('Add Contacts to %1', [1 => $this->_group[$this->_amtgID]]),
+      $this->add('submit', $this->_actionButtonName, ts('Add Contacts to %1', [1 => $this->_group[$this->_amtgID]]),
         [
-          'type' => 'submit',
           'class' => 'crm-form-submit',
         ]
       );
index aee54878d4754157a8addbf0f0562c59e53ce435..f98aa34e324ff2c48164eed1f66bf3cf5b09734f 100644 (file)
@@ -65,13 +65,8 @@ class CRM_Contact_Form_Task_AddToParentClass extends CRM_Contact_Form_Task {
     $this->assign('searchCount', $searchCount);
     $this->assign('searchDone', $this->get('searchDone'));
     $this->assign('contact_type_display', $contactType);
-    $buttonAttrs = [
-      'type' => 'submit',
-      'class' => 'crm-form-submit',
-      'value' => 1,
-    ];
-    $this->addElement('xbutton', $this->getButtonName('refresh'), ts('Search'), $buttonAttrs);
-    $this->addElement('xbutton', $this->getButtonName('cancel'), ts('Cancel'), $buttonAttrs);
+    $this->addElement('submit', $this->getButtonName('refresh'), ts('Search'), ['class' => 'crm-form-submit']);
+    $this->addElement('submit', $this->getButtonName('cancel'), ts('Cancel'), ['class' => 'crm-form-submit']);
     $this->addButtons([
       [
         'type' => 'next',
index 76e245eabdb77d787ffb02798bfb19176abe2f00..ba8bb64ec08706d24b8822fe9dc816d4af568f4b 100644 (file)
@@ -222,10 +222,7 @@ class CRM_Contribute_Form_ContributionPage extends CRM_Core_Form {
     // views are implemented as frozen form
     if ($this->_action & CRM_Core_Action::VIEW) {
       $this->freeze();
-      $this->addElement('xbutton', 'done', ts('Done'), [
-        'type' => 'button',
-        'onclick' => "location.href='civicrm/admin/custom/group?reset=1&action=browse'",
-      ]);
+      $this->addElement('button', 'done', ts('Done'), ['onclick' => "location.href='civicrm/admin/custom/group?reset=1&action=browse'"]);
     }
 
     // don't show option for contribution amounts section if membership price set
index 4b8b5adc3b92706c36ecb7b3b88ac3eb4605dc7b..d59c1f6c45bc1e29c49753b7b99a4240354ea8b2 100644 (file)
@@ -188,10 +188,9 @@ class CRM_Contribute_Form_ContributionPage_Widget extends CRM_Contribute_Form_Co
     $this->assign_by_ref('colorFields', $this->_colorFields);
 
     $this->_refreshButtonName = $this->getButtonName('refresh');
-    $this->addElement('xbutton',
+    $this->addElement('submit',
       $this->_refreshButtonName,
-      ts('Save and Preview'),
-      ['type' => 'submit']
+      ts('Save and Preview')
     );
     parent::buildQuickForm();
     $this->addFormRule(['CRM_Contribute_Form_ContributionPage_Widget', 'formRule'], $this);
index 6833eafd0e252eba747ee44b164bd80b4aa7094e..f1c72357c7bf9c41b5158909bff8c4db3262f816 100644 (file)
@@ -38,10 +38,7 @@ class CRM_Contribute_Import_Form_DataSource extends CRM_Import_Form_DataSource {
 
     $this->setDefaults(['onDuplicate' => CRM_Import_Parser::DUPLICATE_SKIP]);
 
-    $this->addElement('xbutton', 'loadMapping', ts('Load Mapping'), [
-      'type' => 'submit',
-      'onclick' => 'checkSelect()',
-    ]);
+    $this->addElement('submit', 'loadMapping', ts('Load Mapping'), NULL, ['onclick' => 'checkSelect()']);
 
     $this->addContactTypeSelector();
   }
index 3c9bf18beaa7b6e494e17a46a227bbbee9632d08..e2e0e7057a29de51be7091621772fe334e24e630 100644 (file)
@@ -318,12 +318,8 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping {
     $hasRelationTypes = [];
 
     $columnCount = $columnNo;
-    $form->addElement('xbutton', 'addBlock', ts('Also include contacts where'),
-      [
-        'type' => 'submit',
-        'class' => 'submit-link',
-        'value' => 1,
-      ]
+    $form->addElement('submit', 'addBlock', ts('Also include contacts where'),
+      ['class' => 'submit-link']
     );
 
     $contactTypes = CRM_Contact_BAO_ContactType::basicTypes();
@@ -557,11 +553,7 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping {
         $form->add('text', "value[$x][$i]", '');
       }
 
-      $form->addElement('xbutton', "addMore[$x]", ts('Another search field'), [
-        'type' => 'submit',
-        'class' => 'submit-link',
-        'value' => 1,
-      ]);
+      $form->addElement('submit', "addMore[$x]", ts('Another search field'), ['class' => 'submit-link']);
     }
     //end of block for
 
index 158a6eedbb51adf1329769869710479e33671bc0..9f589ff1532d3ac30beaaa8888da0d8d47ab9839 100644 (file)
@@ -668,13 +668,6 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
 
       $attrs = ['class' => 'crm-form-submit'] + (array) CRM_Utils_Array::value('js', $button);
 
-      // A lot of forms use the hacky method of looking at
-      // `$params['button name']` (dating back to them being inputs with a
-      // "value" of the button label) rather than looking at
-      // `$this->controller->getButtonName()`. It makes sense to give buttons a
-      // value by default as a precaution.
-      $attrs['value'] = 1;
-
       if (!empty($button['class'])) {
         $attrs['class'] .= ' ' . $button['class'];
       }
@@ -693,8 +686,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
       }
 
       if ($button['type'] === 'reset') {
-        $attrs['type'] = 'reset';
-        $prevnext[] = $this->createElement('xbutton', 'reset', $button['name'], $attrs);
+        $prevnext[] = $this->createElement($button['type'], 'reset', $button['name'], $attrs);
       }
       else {
         if (!empty($button['subName'])) {
@@ -712,11 +704,12 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
         if (in_array($button['type'], ['next', 'upload', 'done']) && $button['name'] === ts('Save')) {
           $attrs['accesskey'] = 'S';
         }
-        $buttonContents = CRM_Core_Page::crmIcon($button['icon'] ?? $defaultIcon) . ' ' . $button['name'];
+        $icon = CRM_Utils_Array::value('icon', $button, $defaultIcon);
+        if ($icon) {
+          $attrs['crm-icon'] = $icon;
+        }
         $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);
+        $prevnext[] = $this->createElement('submit', $buttonName, $button['name'], $attrs);
       }
       if (!empty($button['isDefault'])) {
         $this->setDefaultAction($button['type']);
@@ -2452,10 +2445,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
         $this->_actionButtonName = $this->getButtonName('next', 'action');
       }
       $this->assign('actionButtonName', $this->_actionButtonName);
-      $this->add('xbutton', $this->_actionButtonName, ts('Go'), [
-        'type' => 'submit',
-        'class' => 'hiddenElement crm-search-go-button',
-      ]);
+      $this->add('submit', $this->_actionButtonName, ts('Go'), ['class' => 'hiddenElement crm-search-go-button']);
 
       // Radio to choose "All items" or "Selected items only"
       $selectedRowsRadio = $this->addElement('radio', 'radio_ts', NULL, '', 'ts_sel', ['checked' => 'checked']);
index f214af7026b0556a616b331f65a02d9db6385a87..f5e6096c0e6c687804103b6178a78448dd71c5f4 100644 (file)
@@ -565,13 +565,10 @@ class CRM_Custom_Form_Field extends CRM_Core_Form {
     if ($this->_action & CRM_Core_Action::VIEW) {
       $this->freeze();
       $url = CRM_Utils_System::url('civicrm/admin/custom/group/field', 'reset=1&action=browse&gid=' . $this->_gid);
-      $this->addElement('xbutton',
+      $this->addElement('button',
         'done',
         ts('Done'),
-        [
-          'type' => 'button',
-          'onclick' => "location.href='$url'",
-        ]
+        ['onclick' => "location.href='$url'"]
       );
     }
   }
index 09cffc753310635b4b1002abeb9c9fa8abba058c..0c37d9037416f3bc3158bc17170bd53eab0d8013 100644 (file)
@@ -351,10 +351,7 @@ class CRM_Custom_Form_Group extends CRM_Core_Form {
     // TODO: Is this condition ever true? Can this code be removed?
     if ($this->_action & CRM_Core_Action::VIEW) {
       $this->freeze();
-      $this->addElement('xbutton', 'done', ts('Done'), [
-        'type' => 'button',
-        'onclick' => "location.href='civicrm/admin/custom/group?reset=1&action=browse'",
-      ]);
+      $this->addElement('button', 'done', ts('Done'), ['onclick' => "location.href='civicrm/admin/custom/group?reset=1&action=browse'"]);
     }
   }
 
index 05f6dcd81e72784dffd4ce024dbd224208efef91..3bb6a5fb6c0430adc52370d250a4143bfe58cf5d 100644 (file)
@@ -201,14 +201,10 @@ class CRM_Custom_Form_Option extends CRM_Core_Form {
           'reset=1&action=browse&fid=' . $this->_fid . '&gid=' . $this->_gid,
           TRUE, NULL, FALSE
         );
-        $this->addElement('xbutton',
+        $this->addElement('button',
           'done',
-          CRM_Core_Page::crmIcon('fa-times') . ' ' . ts('Done'),
-          [
-            'type' => 'button',
-            'onclick' => "location.href='$url'",
-            'class' => 'crm-form-submit cancel',
-          ]
+          ts('Done'),
+          ['onclick' => "location.href='$url'", 'class' => 'crm-form-submit cancel', 'crm-icon' => 'fa-times']
         );
       }
     }
index 60c124a6791d1ebf6df102603f546c3328b29288..1462a3697c73d1362e23150fda24ab68f864cf91 100644 (file)
@@ -355,12 +355,8 @@ class CRM_Event_Form_ManageEvent_Fee extends CRM_Event_Form_ManageEvent {
       $this->add('datepicker', 'discount_end_date[' . $i . ']', ts('Discount End Date'), [], FALSE, ['time' => FALSE]);
     }
     $_showHide->addToTemplate();
-    $this->addElement('xbutton', $this->getButtonName('submit'), ts('Add Discount Set to Fee Table'),
-      [
-        'type' => 'submit',
-        'class' => 'crm-form-submit cancel',
-        'value' => 1,
-      ]
+    $this->addElement('submit', $this->getButtonName('submit'), ts('Add Discount Set to Fee Table'),
+      ['class' => 'crm-form-submit cancel']
     );
     if (Civi::settings()->get('deferred_revenue_enabled')) {
       $deferredFinancialType = CRM_Financial_BAO_FinancialAccount::getDeferredFinancialType();
index 20848b58ecae0de326618eb1771b00d8ab0b7591..408a84e729118d37b93e14580c91f1a9c0600dc7 100644 (file)
@@ -75,7 +75,7 @@ class CRM_Financial_Form_BatchTransaction extends CRM_Contribute_Form_Search {
    */
   public function buildQuickForm() {
     if ($this->_batchStatus == 'Closed') {
-      $this->add('xbutton', 'export_batch', ts('Export Batch'), ['type' => 'submit']);
+      $this->add('submit', 'export_batch', ts('Export Batch'));
     }
 
     // do not build rest of form unless it is open/reopened batch
@@ -85,9 +85,9 @@ class CRM_Financial_Form_BatchTransaction extends CRM_Contribute_Form_Search {
 
     parent::buildQuickForm();
     if (CRM_Batch_BAO_Batch::checkBatchPermission('close', $this->_values['created_id'])) {
-      $this->add('xbutton', 'close_batch', ts('Close Batch'), ['type' => 'submit']);
+      $this->add('submit', 'close_batch', ts('Close Batch'));
       if (CRM_Batch_BAO_Batch::checkBatchPermission('export', $this->_values['created_id'])) {
-        $this->add('xbutton', 'export_batch', ts('Close & Export Batch'), ['type' => 'submit']);
+        $this->add('submit', 'export_batch', ts('Close & Export Batch'));
       }
     }
 
@@ -99,9 +99,8 @@ class CRM_Financial_Form_BatchTransaction extends CRM_Contribute_Form_Search {
       ts('Task'),
       ['' => ts('- actions -')] + ['Remove' => ts('Remove from Batch')]);
 
-    $this->add('xbutton', 'rSubmit', ts('Go'),
+    $this->add('submit', 'rSubmit', ts('Go'),
       [
-        'type' => 'submit',
         'class' => 'crm-form-submit',
         'id' => 'GoRemove',
       ]);
@@ -124,9 +123,8 @@ class CRM_Financial_Form_BatchTransaction extends CRM_Contribute_Form_Search {
       ts('Task'),
       ['' => ts('- actions -')] + ['Assign' => ts('Assign to Batch')]);
 
-    $this->add('xbutton', 'submit', ts('Go'),
+    $this->add('submit', 'submit', ts('Go'),
       [
-        'type' => 'submit',
         'class' => 'crm-form-submit',
         'id' => 'Go',
       ]);
index 069c6e0a9abdbf9a21f17a6e1ce0554df208d2c5..985d9ddfbb672383331ddf9247b5c97132193e14 100644 (file)
@@ -93,9 +93,8 @@ class CRM_Financial_Form_Search extends CRM_Core_Form {
       ts('Task'),
       ['' => ts('- actions -')] + $batchAction);
 
-    $this->add('xbutton', 'submit', ts('Go'),
+    $this->add('submit', 'submit', ts('Go'),
       [
-        'type' => 'submit',
         'class' => 'crm-form-submit',
         'id' => 'Go',
       ]);
index aed5e90a8d8ec028d836069cdc1ec5a0301dfba2..571ab77be16ee7158efc542d658b88fa9d98a4c6 100644 (file)
@@ -376,13 +376,10 @@ class CRM_Price_Form_Field extends CRM_Core_Form {
     if ($this->_action & CRM_Core_Action::VIEW) {
       $this->freeze();
       $url = CRM_Utils_System::url('civicrm/admin/price/field', 'reset=1&action=browse&sid=' . $this->_sid);
-      $this->addElement('xbutton',
+      $this->addElement('button',
         'done',
         ts('Done'),
-        [
-          'type' => 'button',
-          'onclick' => "location.href='$url'",
-        ]
+        ['onclick' => "location.href='$url'"]
       );
     }
   }
index c6594fd4bd97ae2c3ffcb3851f39836f608d1f9f..8d8f46cd881fd97464027f1e7475434d0a3c5e5a 100644 (file)
@@ -904,13 +904,9 @@ class CRM_Profile_Form extends CRM_Core_Form {
 
     if ($this->_context == 'dialog') {
       $this->addElement(
-        'xbutton',
+        'submit',
         $this->_duplicateButtonName,
-        ts('Save Matching Contact'),
-        [
-          'type' => 'submit',
-          'class' => 'crm-button',
-        ]
+        ts('Save Matching Contact')
       );
     }
   }
index b2cfc16bf4477b5cb2ece554fffe62cf017824ab..7564dc37fc280614971c140e895fd706ebbcc6bf 100644 (file)
@@ -209,11 +209,7 @@ SELECT module,is_reserved
 
     if (($this->_multiRecord & CRM_Core_Action::DELETE) && $this->_recordExists) {
       $this->_deleteButtonName = $this->getButtonName('upload', 'delete');
-      $this->addElement('xbutton', $this->_deleteButtonName, ts('Delete'), [
-        'type' => 'submit',
-        'value' => 1,
-        'class' => 'crm-button',
-      ]);
+      $this->addElement('submit', $this->_deleteButtonName, ts('Delete'));
 
       return;
     }
index 07bd815673b4c781e12d9069513b19ee44137aaa..d202b845611e96f7c86c13feee7c0357f8c91fd4 100644 (file)
@@ -1535,7 +1535,7 @@ class CRM_Report_Form extends CRM_Core_Form {
     if (!empty($this->_charts)) {
       $this->addElement('select', "charts", ts('Chart'), $this->_charts);
       $this->assign('charts', $this->_charts);
-      $this->addElement('xbutton', $this->_chartButtonName, ts('View'), ['type' => 'submit']);
+      $this->addElement('submit', $this->_chartButtonName, ts('View'));
     }
   }
 
@@ -1660,10 +1660,7 @@ class CRM_Report_Form extends CRM_Core_Form {
       $this->assign('group', TRUE);
     }
 
-    $this->addElement('xbutton', $this->_groupButtonName, '', [
-      'type' => 'submit',
-      'style' => 'display: none;',
-    ]);
+    $this->addElement('submit', $this->_groupButtonName, '', ['style' => 'display: none;']);
 
     $this->addChartOptions();
     $showResultsLabel = $this->getResultsLabel();
index 997962cd40b1f77cd35c80b4f1167b66310712b0..4bfcb214af81150eddebdc9b685c6a948d8218f7 100644 (file)
@@ -467,11 +467,8 @@ class CRM_UF_Form_Field extends CRM_Core_Form {
     // if view mode pls freeze it with the done button.
     if ($this->_action & CRM_Core_Action::VIEW) {
       $this->freeze();
-      $this->addElement('xbutton', 'done', ts('Done'),
-        [
-          'type' => 'button',
-          'onclick' => "location.href='civicrm/admin/uf/group/field?reset=1&action=browse&gid=" . $this->_gid . "'",
-        ]
+      $this->addElement('button', 'done', ts('Done'),
+        ['onclick' => "location.href='civicrm/admin/uf/group/field?reset=1&action=browse&gid=" . $this->_gid . "'"]
       );
     }
 
index 5a4d3dd570a5e70c57dcd27212e2bd10ad002db7..a9fef4dc8fef3722bc6db7a0ab440bb258fa02a2 100644 (file)
@@ -231,10 +231,7 @@ class CRM_UF_Form_Group extends CRM_Core_Form {
     // views are implemented as frozen form
     if ($this->_action & CRM_Core_Action::VIEW) {
       $this->freeze();
-      $this->addElement('xbutton', 'done', ts('Done'), [
-        'type' => 'button',
-        'onclick' => "location.href='civicrm/admin/uf/group?reset=1&action=browse'",
-      ]);
+      $this->addElement('button', 'done', ts('Done'), ['onclick' => "location.href='civicrm/admin/uf/group?reset=1&action=browse'"]);
     }
 
     $this->addFormRule(['CRM_UF_Form_Group', 'formRule'], $this);
index a2d6695b68f1fcec95dad5298b28baeb1b6dda36..cf61ef5a7d057e2d95fd9235732a21d89f10b2d3 100644 (file)
@@ -1173,7 +1173,7 @@ input.crm-form-entityref {
   cursor: pointer;
 }
 
-#crm-container button.submit-link {
+#crm-container input.submit-link {
   color: #285286;
   background: none transparent;
   border: none;
@@ -1833,6 +1833,17 @@ input.crm-form-entityref {
   margin-left: .5em;
 }
 
+.crm-container .crm-button input {
+  background: none;
+  border: medium none;
+  color: #FFF;
+  cursor: pointer;
+  font-size: 13px;
+  font-weight: normal;
+  margin: 0;
+  padding: 1px 8px 2px 4px;
+}
+
 .crm-container .crm-button-type-cancel,
 .crm-container .crm-button-type-back {
   margin-left: 20px;
@@ -1847,7 +1858,9 @@ input.crm-form-entityref {
 .crm-container a.button,
 .crm-container a.button:link,
 .crm-container a.button:visited,
+.crm-container input.crm-form-submit,
 .crm-container .ui-dialog-buttonset .ui-button,
+.crm-container input[type=button],
 .crm-container .crm-button {
   text-shadow: 0 1px 0 black;
   background: #696969;
@@ -1859,15 +1872,48 @@ input.crm-form-entityref {
   text-decoration: none;
   cursor: pointer;
   border: 1px solid #3e3e3e;
+}
+
+.crm-container a.button,
+.crm-container a.button:link,
+.crm-container a.button:visited,
+.crm-container span.crm-button {
   display: block;
   float: left;
   overflow: hidden;
   line-height: 135%;
-  border-radius: 3px;
+}
+
+/* Preserving the important but not sure why */
+.crm-container span.crm-button {
+  float: left !important;
+}
+
+.crm-container button.crm-button {
+  padding: 3px 6px;
+}
+
+.crm-container button.crm-button .icon {
+  margin-bottom: -4px;
+}
+
+.crm-container input.crm-form-submit,
+.crm-container input[type=button] {
+  padding: 2px 6px;
+}
+
+.crm-container .crm-button input[type=button],
+.crm-container .crm-button input.crm-form-submit {
+  padding: 0;
+  margin: 0;
+  background: none;
+  border: none;
 }
 
 .crm-container .crm-button:hover,
 .crm-container .crm-button:focus,
+.crm-container input[type=submit]:hover,
+.crm-container input[type=button]:hover,
 .crm-container .ui-dialog-buttonset .ui-button:hover,
 .crm-container .ui-dialog-buttonset .ui-button:focus,
 .crm-container a.button:hover,
@@ -1878,24 +1924,28 @@ input.crm-form-entityref {
 .crm-container .crm-button-disabled,
 .crm-container .crm-button.crm-button-disabled,
 .crm-container .ui-dialog-buttonset .ui-button[disabled],
+.crm-container input.crm-form-submit[disabled],
+.crm-container input[type=button][disabled],
 .crm-container .crm-button[disabled] {
   opacity: .6;
   cursor: default;
 }
 
+.crm-container .crm-button-disabled input[disabled] {
+  opacity: 1;
+}
+
 .crm-container .ui-dialog-buttonpane {
   background: linear-gradient(to bottom, #f2f2f2 0%,#ffffff 35%);
 }
 
+.crm-container .ui-dialog-buttonset .ui-button {
+  padding: 0;
+}
 .crm-container .ui-dialog-buttonset .ui-button .ui-icon {
   background-image: url("../i/icons/jquery-ui-FFFFFF.png");
 }
 
-/* Override of a line in crm-i.css that may not be important anymore */
-.crm-container .ui-dialog-buttonset .ui-button .ui-icon[class*=" fa-"] {
-  margin-top: 0;
-}
-
 /* No crm-button styling for PayPal Express buttons */
 .crm-container input#_qf_Register_upload_express,
 .crm-container input#_qf_Payment_upload_express,
@@ -2838,6 +2888,15 @@ tbody.scrollContent tr.alternateRow {
 }
 
 /* rounded corners */
+.crm-container .crm-button,
+.crm-container a.button,
+.crm-container a.button:link,
+.crm-container input.crm-form-submit,
+.crm-container input[type=button] {
+  border-radius: 3px;
+}
+
+
 .crm-container div.status,
 .crm-container #help,
 .crm-container .help,
index 80b9ad96f05343d1ffd645ef1df7724bbb6ac61f..a59b3a047ad519e61792ace10a87973f8d8c2cdd 100644 (file)
@@ -352,7 +352,7 @@ div#toolbar-box, div#toolbar-box div.m{
 .crm-container input {
   height: auto;
 }
-.crm-container button[type=submit] {
+.crm-container input[type=submit] {
   height: auto;
 }
 
@@ -377,7 +377,7 @@ div#toolbar-box, div#toolbar-box div.m{
 }
 
 /* Remove Joomla subhead toolbar & whitespace border */
-
+       
 body.admin.com_civicrm .subhead-collapse {
        display:none;
 }
index eb12944d220edf6b705eb18a9b4fbcd713cc5080..e95165536b2e43f38345a7bf038babac463aa261 100644 (file)
@@ -34,7 +34,7 @@ if ($text_direction == 'rtl') {
   <?php } ?>
 
   <p>
-  <button id="install_button" type="submit" name="go" onclick="document.getElementById('saving_top').style.display = ''; this.innerHTML = '<?php echo ts('Installing CiviCRM...', ['escape' => 'js']); ?>'"><?php echo ts('Check Requirements and Install CiviCRM', ['escape' => 'js']); ?></button>
+  <input id="install_button" type="submit" name="go" value="<?php echo ts('Check Requirements and Install CiviCRM', array('escape' => 'js')); ?>" onclick="document.getElementById('saving_top').style.display = ''; this.value = '<?php echo ts('Installing CiviCRM...', array('escape' => 'js')); ?>'" />
 
   <span id="saving_top" style="display: none">
   &nbsp;
@@ -73,7 +73,7 @@ if ($text_direction == 'rtl') {
   ?>
 </select>
 <noscript>
-  <button type="submit" name="setlanguage"><?php echo ts('Change language', ['escape' => 'js']); ?></button>
+  <input type="submit" name="setlanguage" value="<?php echo ts('Change language', array('escape' => 'js')); ?>" />
 </noscript>
 <span class="testResults">
   <?php
@@ -135,7 +135,7 @@ if ($text_direction == 'rtl') {
     <span class="testResults">Check this box to pre-populate CiviCRM with sample English contact records, online contribution pages, profile forms, etc. These examples can help you learn about CiviCRM features.</span><br />
 </p>
 
-<p style="margin-left: 2em"><button type="submit"><?php echo ts('Re-check requirements', ['escape' => 'js']); ?></button></p>
+<p style="margin-left: 2em"><input type="submit" value="<?php echo ts('Re-check requirements', array('escape' => 'js')); ?>" /></p>
 
 <a name="dbDetails">
 
index 056c11cfe05919fe5c5181c052e0adb470aaaeaf..88acc9ef4d4055e3916a1692940045f5f7a3dd75 100644 (file)
@@ -145,6 +145,32 @@ function showHideByValue(trigger_field_id, trigger_value, target_element_id, tar
 }
 
 var submitcount = 0;
+/**
+ * Old submit-once function. Will be removed soon.
+ * @deprecated
+ */
+function submitOnce(obj, formId, procText) {
+  // if named button clicked, change text
+  if (obj.value != null) {
+    cj('input[name=' + obj.name + ']').val(procText + " ...");
+  }
+  cj(obj).closest('form').attr('data-warn-changes', 'false');
+  if (document.getElementById) { // disable submit button for newer browsers
+    cj('input[name=' + obj.name + ']').attr("disabled", true);
+    document.getElementById(formId).submit();
+    return true;
+  }
+  else { // for older browsers
+    if (submitcount == 0) {
+      submitcount++;
+      return true;
+    }
+    else {
+      alert("Your request is currently being processed ... Please wait.");
+      return false;
+    }
+  }
+}
 
 /**
  * Function to show / hide the row in optionFields
@@ -192,7 +218,7 @@ if (!CRM.vars) CRM.vars = {};
   $.propHooks.disabled = {
     set: function (el, value, name) {
       // Sync button enabled status with wrapper css
-      if ($(el).is('.crm-button.crm-form-submit')) {
+      if ($(el).is('span.crm-button > input.crm-form-submit')) {
         $(el).parent().toggleClass('crm-button-disabled', !!value);
       }
       // Sync button enabled status with dialog button
@@ -971,7 +997,7 @@ if (!CRM.vars) CRM.vars = {};
       $('form[data-submit-once]', e.target)
         .submit(submitOnceForm)
         .on('invalid-form', submitFormInvalid);
-      $('form[data-submit-once] button[type=submit]', e.target).click(function(e) {
+      $('form[data-submit-once] input[type=submit]', e.target).click(function(e) {
         submitButton = e.target;
       });
     })
index 757ebef0633562eefce72b077e916af2d5b9f155..e65bd7b2a22c946265f100899d9b50b24a6b6a5c 100644 (file)
         var buttonContainers = '.crm-submit-buttons, .action-link',
           buttons = [],
           added = [];
-        $(buttonContainers, $el).find('.crm-form-submit, .crm-form-xbutton, a.button, button').each(function() {
+        $(buttonContainers, $el).find('input.crm-form-submit, a.button, button').each(function() {
           var $el = $(this),
             label = $el.is('input') ? $el.attr('value') : $el.text(),
             identifier = $el.attr('name') || $el.attr('href');
         $el.dialog('option', 'buttons', buttons);
       }
       // Allow a button to prevent ajax submit
-      $('input[data-no-ajax-submit=true], button[data-no-ajax-submit=true]').click(function() {
+      $('input[data-no-ajax-submit=true]').click(function() {
         $(this).closest('form').ajaxFormUnbind();
       });
       // For convenience, focus the first field
index c84d0f5ec292a549a3378a97b82a656f801b288f..42a371dcecf42d18e90d97dae3038d2992d098b7 100644 (file)
       // When selecting a task
       .on('change', 'select#task', function(e) {
         var $form = $(this).closest('form'),
-        $go = $('button.crm-search-go-button', $form);
+        $go = $('input.crm-search-go-button', $form);
         var $selectedOption = $(this).find(':selected');
         if (!$selectedOption.val()) {
           // do not blank refresh the empty option.
index 00c65260ec2fea76b26dac96fd512500c35c7316..4191285449bac84b76339fa5c142b87c4a65ae9d 100644 (file)
         html += '<form class="widget-settings">';
         html += '  <div class="widget-settings-inner"></div>';
         html += '  <div class="widget-settings-buttons">';
-        html += '    <button id="' + widget.id + '-settings-save" class="widget-settings-save" type="submit">Save</button>';
-        html += '    <button id="' + widget.id + '-settings-cancel" class="widget-settings-cancel" type="submit">Cancel</button>';
+        html += '    <input id="' + widget.id + '-settings-save" class="widget-settings-save" value="Save" type="submit" />';
+        html += '    <input id="' + widget.id + '-settings-cancel" class="widget-settings-cancel" value="Cancel" type="submit" />';
         html += '  </div>';
         html += '</form>';
         return html;
index abfc0392604922e9ef9663e0eed42870d09358e0..971d22c1fd5a3fcdc59c00878e969ed806ef1831 100644 (file)
@@ -26,7 +26,7 @@ endif; ?>
           <div>
 
           <input type="text" name="civisetup[advanced][db]" value="<?php echo htmlentities($model->extras['advanced']['db']); ?>" data-original="<?php echo htmlentities($model->extras['advanced']['db']); ?>">
-          <button id="db_apply_button" type="submit" name="civisetup[action][Start]"><?php echo htmlentities(ts('Apply')); ?></button>
+          <input id="db_apply_button" type="submit" name="civisetup[action][Start]" value="<?php echo htmlentities(ts('Apply')); ?>" />
           <a href="" onclick="civisetupAdvancedDbCancel(); return false;" title="<?php echo htmlentities(ts('Cancel')) ?>"><i class="fa fa-close"></i></a>
           <script type="text/javascript">
             function civisetupAdvancedDbCancel() {
index 7785ad2aae5edcf593d9ca3ab9d6afab93dd1e98..81e005f1ab7b5ed4a3f3e5a9f1d48a5de119f0db 100644 (file)
@@ -1,8 +1,9 @@
 <?php if (!defined('CIVI_SETUP')): exit("Installation plugins must only be loaded by the installer.\n");
 endif; ?>
 <div class="action-box">
-  <button id="install_button" type="submit" name="civisetup[action][Install]"
-         onclick="document.getElementById('saving_top').style.display = ''; this.innerHTML = '<?php echo ts('Installing CiviCRM...', array('escape' => 'js')); ?>'"><?php echo htmlentities(ts('Install CiviCRM')); ?></button>
+  <input id="install_button" type="submit" name="civisetup[action][Install]"
+         value="<?php echo htmlentities(ts('Install CiviCRM')); ?>"
+         onclick="document.getElementById('saving_top').style.display = ''; this.value = '<?php echo ts('Installing CiviCRM...', array('escape' => 'js')); ?>'"/>
   <div id="saving_top" style="display: none;">
 &nbsp;   <img src="<?php echo htmlentities($installURLPath . "network-save.gif") ?>"/>
     <?php echo ts('(this will take a few minutes)'); ?>
index 844406249be3738a066b0274459a3d093f72a38d..54979fdf3c87564e3a7846f897450c23e0da9f8d 100644 (file)
@@ -46,7 +46,7 @@ uasort($msgs, function($a, $b) {
 </table>
 
 <div class="action-box">
-  <button id="recheck_button" type="submit" name="civisetup[action][Start]"><?php echo htmlentities(ts('Refresh')); ?></button>
+  <input id="recheck_button" type="submit" name="civisetup[action][Start]" value="<?php echo htmlentities(ts('Refresh')); ?>" />
   <div class="advancedTip">
     <?php echo ts('After updating your system, refresh to test the requirements again.'); ?>
   </div>
index a06f97a2b8441da00e16b87bbee719076768517c..5a2b3ea1060896e84c97e6e4337fa3f7852e78b8 100644 (file)
@@ -15,7 +15,7 @@ body {
   float: left;
   margin-left: 10%;
   margin-top: 50px;
-  margin-right: 20%;
+  margin-right: 20%; 
   display: inline-flex;
 }
 
@@ -39,7 +39,7 @@ body {
     100% { left: 0; color: #555;}
 }
 
-
+  
 .civicrm-setup-header hr{
   border-bottom: 2px solid #fff;
   border-top: 2px solid #ddd;
@@ -217,7 +217,7 @@ body {
   text-align: center;
   margin: 2em 0.5em;
 }
-.civicrm-setup-body button[type=submit] {
+.civicrm-setup-body input[type=submit] {
   padding:15px 25px;
   background:#82C459;
   color: white;
@@ -227,10 +227,10 @@ body {
   border-radius: 5px;
   font-size: 20px;
 }
-.civicrm-setup-body button[type=submit]:hover {
+.civicrm-setup-body input[type=submit]:hover {
   background: #60A237;
 }
-.civicrm-setup-body button[type=submit]:disabled {
+.civicrm-setup-body input[type=submit]:disabled {
   background: #888;
   cursor: not-allowed;
 }
@@ -267,3 +267,4 @@ body {
     width: 95%;
   }
 }
+
index 022929552816a5cb5f39bc6f265ee7f456a60916..c7e685f9fff8ffc7720dfcaf122ee5c375c13a66 100644 (file)
@@ -247,7 +247,7 @@ class SetupController implements SetupControllerInterface {
    *
    * @param array $fields
    *   HTTP inputs -- e.g. with a form element like this:
-   *   `<button type="submit" name="civisetup[action][Foo]">Do the foo</button>`
+   *   `<input type="submit" name="civisetup[action][Foo]" value="Do the foo">`
    * @param string $default
    *   The action-name to return if no other action is identified.
    * @return string
index fe070257596b914d2bc76367b9bb8936849f5088..44ff0ba7aabb548929087fe8bd7763ed6f52833f 100644 (file)
       <td>
         {$form.editor_id.html}
         &nbsp;
-        {$form.ckeditor_config.html}
+        <span class="crm-button" style="display:inline-block;vertical-align:middle;float:none!important;">
+          <i class="crm-i fa-wrench" aria-hidden="true"></i>
+          {$form.ckeditor_config.html}
+        </span>
       </td>
     </tr>
     <tr class="crm-preferences-display-form-block-ajaxPopupsEnabled">
index 2be5f1f3c4abce9ce90fbf526556149db4d08d75..9c127fcb6fca890238e62db6f5eae51953bad866 100644 (file)
         </table>
       </div>
       <div class="crm-submit-buttons">
-        <button type="submit" class="crm-button crm-form-submit" accesskey="S" title="{ts}Execute API call and display results{/ts}">
-          <i class="crm-i fa-bolt" aria-hidden="true"></i> {ts}Execute{/ts}
-        </button>
+        <span class="crm-button">
+          <i class="crm-i fa-bolt" aria-hidden="true"></i> <input type="submit" value="{ts}Execute{/ts}" class="crm-form-submit" accesskey="S" title="{ts}Execute API call and display results{/ts}"/>
+        </span>
       </div>
 
 <pre id="api-result" class="linenums">
index 43ca6d955655c99deb11c4522a3b3cabc87f8df5..ad179df5ab7afbbfb83d2a7fbf01d69c61e41fe7 100644 (file)
     </div>
 
     <div class="crm-submit-buttons">
-      <button type="submit" name="save" class="crm-form-submit crm-button" accesskey="S">
-        <i class="crm-i fa-wrench" aria-hidden="true"></i> {ts}Save{/ts}
-      </button>
-      <button type="submit" name="revert" class="crm-form-submit crm-button" onclick="return confirm('{$revertConfirm}');">
-        <i class="crm-i fa-times" aria-hidden="true"></i> {ts}Revert to Default{/ts}
-      </button>
+      <span class="crm-button">
+        <i class="crm-i fa-wrench" aria-hidden="true"></i> <input type="submit" value="{ts}Save{/ts}" name="save" class="crm-form-submit" accesskey="S"/>
+      </span>
+      <span class="crm-button">
+        <i class="crm-i fa-times" aria-hidden="true"></i> <input type="submit" value="{ts}Revert to Default{/ts}" name="revert" class="crm-form-submit" onclick="return confirm('{$revertConfirm}');"/>
+      </span>
     </div>
     <input type="hidden" value="{$preset}" name="preset" />
   </fieldset>
index 14581e63435925bfbb9896d920435abb20720269..70c0a1c3506996113f34e5d7419882642921be83 100644 (file)
@@ -22,7 +22,9 @@
     <div class="status message status-warning">
       <i class="crm-i fa-exclamation-triangle" aria-hidden="true"></i> {ts}Total for amounts entered below does not match the expected batch total.{/ts}
     </div>
-    {$form._qf_Entry_upload_force.html}
+    <span class="crm-button crm-button_qf_Entry_upload_force-save">
+      {$form._qf_Entry_upload_force.html}
+    </span>
     <div class="clear"></div>
   {/if}
   <table class="form-layout-compressed batch-totals">
index 00bf545715ad9a8661b8d863a0d3612742197607..dd4f36735a8e47ad51ed7f554771fb8af5bb4c59 100644 (file)
@@ -45,7 +45,7 @@
     <input type="hidden" name="qfKey" value="{crmKey name='CRM_Contact_Form_Contact' addSequence=1}" />
 </div>
 
-<div class="form-item"><button type="submit" name="_qf_Contact_next" class="crm-button crm-form-submit">{ts}Save{/ts}</button></div>
+<div class="form-item"><input type="submit" name="_qf_Contact_next" value="{ts}Save{/ts}" class="crm-form-submit" /></div>
 
 </form>
 </div>
index b076bc2f3a1f2d1c6d63a980f9e7c9474194b988..4f85ad1ba25851cd7e47f25331c056127eff04ae 100644 (file)
@@ -24,7 +24,7 @@
 <div class="block-crm crm-container">
     <form method="post" id="id_fulltext_search">
     <div style="margin-bottom: 8px;">
-    <input type="text" name="text" id='text' value="" class="crm-form-text" style="width: 10em;" />&nbsp;<button type="submit" name="submit" id="fulltext_submit" class="crm-button crm-form-submit" onclick='submitForm();'>{ts}Go{/ts}</button>
+    <input type="text" name="text" id='text' value="" class="crm-form-text" style="width: 10em;" />&nbsp;<input type="submit" name="submit" id="fulltext_submit" value="{ts}Go{/ts}" class="crm-form-submit"/ onclick='submitForm();'>
     <input type="hidden" name="qfKey" value="{crmKey name='CRM_Contact_Controller_Search' addSequence=1}" />
   </div>
   <select class="form-select" id="fulltext_table" name="fulltext_table">
index 2844d09e35a4d6fff615ab8af8534c0dd86eb6d5..2acbff7dccbd4e024b3765ba06675a93dff54081 100644 (file)
           </table>
 
           {*add dupe buttons *}
-          {$form._qf_Contact_refresh_dedupe.html}
+          <span class="crm-button crm-button_qf_Contact_refresh_dedupe">
+            {$form._qf_Contact_refresh_dedupe.html}
+          </span>
           {if $isDuplicate}
             &nbsp;&nbsp;
-            {$form._qf_Contact_upload_duplicate.html}
+              <span class="crm-button crm-button_qf_Contact_upload_duplicate">
+                {$form._qf_Contact_upload_duplicate.html}
+              </span>
           {/if}
           <div class="spacer"></div>
         </div>
     loadMultiRecordFields();
 
     {/literal}{if $oldSubtypes}{literal}
-    $('button[name=_qf_Contact_upload_view], button[name=_qf_Contact_upload_new]').click(function() {
+    $('input[name=_qf_Contact_upload_view], input[name=_qf_Contact_upload_new]').click(function() {
       var submittedSubtypes = $('#contact_sub_type').val();
       var oldSubtypes = {/literal}{$oldSubtypes}{literal};
 
index 4dc3523571e949d94e59e099d407dcf72bb3e06f..fd6a984c13947535d125fd947feb8af9d727ed85 100644 (file)
       })
       // Add new field - if there's a hidden one, show it
       // Otherwise allow form to submit and fetch more from the server
-      .on('click', 'button[name^=addMore]', function() {
+      .on('click', 'input[name^=addMore]', function() {
         var table = $(this).closest('table');
         if ($('tr:hidden', table).length) {
           $('tr:hidden', table).first().show();
index 6031bf210b8f9c33b14aba9a91915cd312768b5c..1fb9798cc53f151a7e20d59f9a8f33be5df50c36 100644 (file)
@@ -19,7 +19,7 @@
 {/literal}
 <form action="{crmURL p='civicrm/contact/view' q="cid=`$contactId`&reset=1"}" method="post" id="Print1" >
   <div class="form-item">
-       <span class="element-right"><button onclick="window.print(); return false" class="crm-button crm-form-submit default" name="_qf_Print_next" type="submit">{ts}Print{/ts}</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button class="crm-button crm-form-submit" name="_qf_Print_back" type="submit">{ts}Done{/ts}</button></span>
+       <span class="element-right"><input onclick="window.print(); return false" class="crm-form-submit default" name="_qf_Print_next" value="{ts}Print{/ts}" type="submit" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input class="crm-form-submit" name="_qf_Print_back" value="{ts}Done{/ts}" type="submit" /></span>
   </div>
 </form>
 <br />
index 5a3bd098639cbdae1bbf529889be7cfb22b0570c..6ca766cc26b31a2dbd8d4009d9d201ecc68647fd 100644 (file)
@@ -62,7 +62,7 @@
               <div class="premium-full-title">{$row.name}</div>
               <div class="premium-full-disabled">
                 {ts 1=$row.min_contribution|crmMoney}You must contribute at least %1 to get this item{/ts}<br/>
-                <button type="button" value="{ts 1=$row.min_contribution|crmMoney}Contribute %1 Instead{/ts}" amount="{$row.min_contribution}" />
+                <input type="button" value="{ts 1=$row.min_contribution|crmMoney}Contribute %1 Instead{/ts}" amount="{$row.min_contribution}" />
               </div>
               <div class="premium-full-description">
                 {$row.description}
         amounts.sort(function(a,b){return a - b});
 
         // make contribution instead buttons work
-        $('.premium-full-disabled button').click(function(){
+        $('.premium-full-disabled input').click(function(){
           var amount = Number($(this).attr('amount'));
           if (price_sets[amount]) {
             if (!$(price_sets[amount]).length) {
     {/literal}
   {/if}
 {/if}
+
index 27c4cdb59b21a20a2da34f076a9fc478639a1a34..4858e9803259849346fd504d596704290e30d18a 100644 (file)
@@ -396,7 +396,7 @@ invert              = 0
 <script type="text/javascript">
 {literal}    (function($, _) { // Generic Closure
 
-    $(".crm-submit-buttons button").click( function() {
+    $(".crm-submit-buttons input").click( function() {
       $(".dedupenotify .ui-notify-close").click();
     });
 
index e54646eaf4cffdb47e7d1c2a344ecdf47202ea78..4636f96d5e1217fa3cbdff9fec5afa6e359c11ea 100644 (file)
@@ -56,7 +56,7 @@
   <script type="text/javascript">
     var totalPages = {/literal}{$pager->_totalPages}{literal};
     CRM.$(function($) {
-      $("#crm-container .crm-pager button.crm-form-submit").click(function () {
+      $("#crm-container .crm-pager input.crm-form-submit").click(function () {
         submitPagerData(this);
       });
     });
index 98c0f9f3be0027be61e50c5380b36bc448508eef..47b413d078af6abc0ca1c9be8b891d9131b45b19 100644 (file)
@@ -18,9 +18,9 @@
 {ts 1=$display_name 2=$email}Are you sure you want to resubscribe: %1 (%2){/ts}
 <br/>
 <center>
-<button type="submit" name="_qf_resubscribe_next" class="crm-button crm-form-submit">{ts}Resubscribe{/ts}</button>
+<input type="submit" name="_qf_resubscribe_next" value="{ts}Resubscribe{/ts}" class="crm-form-submit" />
 &nbsp;&nbsp;&nbsp;
-<button type="submit" name="_qf_resubscribe_cancel" class="crm-button crm-form-submit">{ts}Cancel{/ts}</button>
+<input type="submit" name="_qf_resubscribe_cancel" value="{ts}Cancel{/ts}" class="crm-form-submit" />
 </center>
 </form>
 </div>
index 09ed9986ddd17fa09caafedfecccf6ecf7c949f1..2d0240fb886bb3f1ad93a97671dc7f714daa73a0 100644 (file)
@@ -19,7 +19,7 @@
   </div>
 
   <div class="crm-submit-buttons">
-    {$form._qf_Edit_upload_delete.html}
+    <span class="crm-button">{$form._qf_Edit_upload_delete.html}</span>
     {if $includeCancelButton}
       <a class="button cancel" href="{$cancelURL}">{$cancelButtonText}</a>
     {/if}
@@ -37,7 +37,7 @@
 
   {if $isDuplicate and ( ($action eq 1 and $mode eq 4 ) or ($action eq 2) or ($action eq 8192) ) }
     <div class="crm-submit-buttons">
-      {$form._qf_Edit_upload_duplicate.html}
+      <span class="crm-button">{$form._qf_Edit_upload_duplicate.html}</span>
     </div>
   {/if}
   {if $mode eq 1 || $activeComponent neq "CiviCRM"}
@@ -53,7 +53,7 @@
     {if $action eq 2 and $multiRecordFieldListing}
       <h1>{ts}Edit Details{/ts}</h1>
       <div class="crm-submit-buttons" style='float:right'>
-      {include file="CRM/common/formButtons.tpl"}{if $isDuplicate}{$form._qf_Edit_upload_duplicate.html}{/if}
+      {include file="CRM/common/formButtons.tpl"}{if $isDuplicate}<span class="crm-button">{$form._qf_Edit_upload_duplicate.html}</span>{/if}
       </div>
     {/if}
 
         </div>
       {/if}
       <div class="crm-submit-buttons" style='{$floatStyle}'>
-        {include file="CRM/common/formButtons.tpl"}{if $isDuplicate}{$form._qf_Edit_upload_duplicate.html}{/if}
+        {include file="CRM/common/formButtons.tpl"}{if $isDuplicate}<span class="crm-button">{$form._qf_Edit_upload_duplicate.html}</span>{/if}
         {if $includeCancelButton}
           <a class="button cancel" href="{$cancelURL}">
             <span>
index 33eedecb86a40cc9cf2e661392757cc0d1d7d948..508d39ca48f2c28866424d515f99f74a548e9360 100644 (file)
@@ -35,7 +35,6 @@
            createChart( chartID, divName, chartValues.size.xSize, chartValues.size.ySize, allData[chartID].object );
          });
 
-         // FIXME
          $("input[id$='submit_print'],input[id$='submit_pdf']").bind('click', function(e){
            // image creator php file path and append image name
            var url = CRM.url('civicrm/report/chart', 'name=' + '{/literal}{$chartId}{literal}' + '.png');
index ba514b81268fb2719b1485a598b685f1240a61c7..e816f0baacd46b33bf5416e39fe6661d2a29a22a 100644 (file)
@@ -23,7 +23,7 @@ CRM.$(function($) {
           params.autoClose = params.openInline = params.cancelButton = params.refreshAction = false;
           ui.panel.on('crmFormLoad', function() {
             // Hack: "Save and done" and "Cancel" buttons submit without ajax
-            $('.cancel.crm-form-submit, button[name$=upload_done]', this).on('click', function(e) {
+            $('.cancel.crm-form-submit, input[name$=upload_done]', this).on('click', function(e) {
               $(this).closest('form').ajaxFormUnbind();
             });
           });
index 10c9628b2dbd36daa610a2d3ccbeb3dad50e1489..0b8f6645c1582466ab42b5ab0aed32f79a74afbd 100644 (file)
@@ -12,7 +12,7 @@
 {literal}
 <script type="text/javascript">
 CRM.$(function($) {
-  var more = $('.crm-button.validate').click(function(e) {
+  var more = $('.crm-button input.validate').click(function(e) {
     var message = "{/literal} {if $context eq 'Event'}
         {ts escape='js'}Note: Revenue for this event registration will not be deferred as the financial type does not have a deferred revenue account setup for it. If you want the revenue to be deferred, please select a different Financial Type with a Deferred Revenue account setup for it, or setup a Deferred Revenue account for this Financial Type.{/ts}
       {else if $context eq 'MembershipType'}
index 10b848a154d29647455a041e32a09b9ffefcb170..7af01e646bec483f29db5b938c76eeeea01635b1 100644 (file)
   {/foreach}
 {/if}
 
+{* Loops through $form.buttons.html array and assigns separate spans with classes to allow theming by button and name.
+ * crmBtnType grabs type keyword from button name (e.g. 'upload', 'next', 'back', 'cancel') so types of buttons can be styled differently via css.
+ *}
 {foreach from=$form.buttons item=button key=key name=btns}
   {if $key|substring:0:4 EQ '_qf_'}
     {if $location}
-      {$form.buttons.$key.html|crmReplace:id:"$key-$location"}
+      {assign var='html' value=$form.buttons.$key.html|crmReplace:id:"$key-$location"}
     {else}
-      {$form.buttons.$key.html}
+      {assign var='html' value=$form.buttons.$key.html}
     {/if}
+    {crmGetAttribute html=$html attr='crm-icon' assign='icon'}
+    {capture assign=iconPrefix}{$icon|truncate:3:"":true}{/capture}
+    {if $icon && $iconPrefix eq 'fa-'}
+      {capture assign=iconDisp}<i class="crm-i {$icon}" aria-hidden="true"></i>{/capture}
+    {/if}
+    {crmGetAttribute html=$html attr='disabled' assign='disabled'}
+    <span class="crm-button crm-button-type-{$key|crmBtnType} crm-button{$key}{if $disabled} crm-button-disabled{/if}"{if $buttonStyle} style="{$buttonStyle}"{/if}>
+      {$iconDisp}
+      {$html}
+    </span>
   {/if}
 {/foreach}
 {/crmRegion}
index 5ec824a85e46250e75f26587a78cf8def7fabcc7..866769185c51e2d61c862b3577e5ac1490019480 100644 (file)
@@ -17,7 +17,7 @@
             <input type="hidden" name="hidden_location" value="1" />
             <input type="hidden" name="hidden_custom" value="1" />
             <input type="hidden" name="qfKey" value="" />
-            <div style="height:1px; overflow:hidden;"><button type="submit" name="_qf_Advanced_refresh" class="crm-button crm-form-submit default">{ts}Go{/ts}</button></div>
+            <div style="height:1px; overflow:hidden;"><input type="submit" value="{ts}Go{/ts}" name="_qf_Advanced_refresh" class="crm-form-submit default" /></div>
           </div>
         </form>
         <ul>