diff --git a/CRM/Admin/Form/Preferences/Display.php b/CRM/Admin/Form/Preferences/Display.php index 775fa2c04ec5..0716cdebd233 100644 --- a/CRM/Admin/Form/Preferences/Display.php +++ b/CRM/Admin/Form/Preferences/Display.php @@ -50,7 +50,17 @@ public function buildQuickForm() { $invoiceSettings = Civi::settings()->get('contribution_invoice_settings'); $this->assign('invoicing', CRM_Invoicing_Utils::isInvoicingEnabled()); - $this->addElement('submit', 'ckeditor_config', ts('Configure CKEditor')); + $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, + ] + ); $editOptions = CRM_Core_OptionGroup::values('contact_edit_options', FALSE, FALSE, FALSE, 'AND v.filter = 0'); $this->assign('editOptions', $editOptions); diff --git a/CRM/Admin/Form/Setting/Smtp.php b/CRM/Admin/Form/Setting/Smtp.php index da909c7f0877..79e0da4f7782 100644 --- a/CRM/Admin/Form/Setting/Smtp.php +++ b/CRM/Admin/Form/Setting/Smtp.php @@ -61,7 +61,12 @@ public function buildQuickForm() { $this->addFormRule(['CRM_Admin_Form_Setting_Smtp', 'formRule']); parent::buildQuickForm(); $buttons = $this->getElement('buttons')->getElements(); - $buttons[] = $this->createElement('submit', $this->_testButtonName, ts('Save & Send Test Email'), ['crm-icon' => 'fa-envelope-o']); + $buttons[] = $this->createElement( + 'xbutton', + $this->_testButtonName, + CRM_Core_Page::crmIcon('fa-envelope-o') . ' ' . ts('Save & Send Test Email'), + ['type' => 'submit'] + ); $this->getElement('buttons')->setElements($buttons); if (!empty($setStatus)) { diff --git a/CRM/Batch/Form/Entry.php b/CRM/Batch/Form/Entry.php index e60ababdb45c..35c407a79f26 100644 --- a/CRM/Batch/Form/Entry.php +++ b/CRM/Batch/Form/Entry.php @@ -173,9 +173,14 @@ public function buildQuickForm() { // add the force save button $forceSave = $this->getButtonName('upload', 'force'); - $this->addElement('submit', + $this->addElement('xbutton', $forceSave, - ts('Ignore Mismatch & Process the Batch?') + ts('Ignore Mismatch & Process the Batch?'), + [ + 'type' => 'submit', + 'value' => 1, + 'class' => 'crm-button crm-button_qf_Entry_upload_force-save', + ] ); $this->addButtons([ diff --git a/CRM/Case/Form/CaseView.php b/CRM/Case/Form/CaseView.php index 646d48cfd054..4c21b837e1c1 100644 --- a/CRM/Case/Form/CaseView.php +++ b/CRM/Case/Form/CaseView.php @@ -272,7 +272,10 @@ public function buildQuickForm() { ['class' => 'crm-select2 crm-action-menu fa-list-ol'] ); } - $this->addElement('submit', $this->getButtonName('next'), ' ', ['class' => 'hiddenElement']); + $this->addElement('xbutton', $this->getButtonName('next'), ' ', [ + 'class' => 'hiddenElement', + 'type' => 'submit', + ]); $this->buildMergeCaseForm(); @@ -517,11 +520,12 @@ public function buildMergeCaseForm() { FALSE, ['class' => 'crm-select2 huge'] ); - $this->addElement('submit', + $this->addElement('xbutton', $this->getButtonName('next', 'merge_case'), ts('Merge'), [ 'class' => 'hiddenElement', + 'type' => 'submit', ] ); } diff --git a/CRM/Contact/Form/Contact.php b/CRM/Contact/Form/Contact.php index 04e3c8a897e7..798050800c35 100644 --- a/CRM/Contact/Form/Contact.php +++ b/CRM/Contact/Form/Contact.php @@ -808,17 +808,31 @@ public function buildQuickForm() { $this->addField('image_URL', ['maxlength' => '255', 'label' => ts('Browse/Upload Image')]); // add the dedupe button - $this->addElement('submit', + $this->addElement('xbutton', $this->_dedupeButtonName, - ts('Check for Matching Contact(s)') + ts('Check for Matching Contact(s)'), + [ + 'type' => 'submit', + 'value' => 1, + 'class' => "crm-button crm-button{$this->_dedupeButtonName}", + ] ); - $this->addElement('submit', + $this->addElement('xbutton', $this->_duplicateButtonName, - ts('Save Matching Contact') + ts('Save Matching Contact'), + [ + 'type' => 'submit', + 'value' => 1, + 'class' => "crm-button crm-button{$this->_duplicateButtonName}", + ] ); - $this->addElement('submit', + $this->addElement('xbutton', $this->getButtonName('next', 'sharedHouseholdDuplicate'), - ts('Save With Duplicate Household') + ts('Save With Duplicate Household'), + [ + 'type' => 'submit', + 'value' => 1, + ] ); $buttons = [ diff --git a/CRM/Contact/Form/Search.php b/CRM/Contact/Form/Search.php index 322dc47e317b..dcaa084d0e98 100644 --- a/CRM/Contact/Form/Search.php +++ b/CRM/Contact/Form/Search.php @@ -468,8 +468,9 @@ public function buildQuickForm() { // 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('submit', $this->_actionButtonName, ts('Add Contacts to %1', [1 => $this->_group[$this->_amtgID]]), + $this->add('xbutton', $this->_actionButtonName, ts('Add Contacts to %1', [1 => $this->_group[$this->_amtgID]]), [ + 'type' => 'submit', 'class' => 'crm-form-submit', ] ); diff --git a/CRM/Contact/Form/Task/AddToParentClass.php b/CRM/Contact/Form/Task/AddToParentClass.php index f98aa34e324f..aee54878d475 100644 --- a/CRM/Contact/Form/Task/AddToParentClass.php +++ b/CRM/Contact/Form/Task/AddToParentClass.php @@ -65,8 +65,13 @@ public function buildQuickForm() { $this->assign('searchCount', $searchCount); $this->assign('searchDone', $this->get('searchDone')); $this->assign('contact_type_display', $contactType); - $this->addElement('submit', $this->getButtonName('refresh'), ts('Search'), ['class' => 'crm-form-submit']); - $this->addElement('submit', $this->getButtonName('cancel'), ts('Cancel'), ['class' => 'crm-form-submit']); + $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->addButtons([ [ 'type' => 'next', diff --git a/CRM/Contribute/Form/ContributionPage.php b/CRM/Contribute/Form/ContributionPage.php index ba8bb64ec087..76e245eabdb7 100644 --- a/CRM/Contribute/Form/ContributionPage.php +++ b/CRM/Contribute/Form/ContributionPage.php @@ -222,7 +222,10 @@ public function buildQuickForm() { // views are implemented as frozen form if ($this->_action & CRM_Core_Action::VIEW) { $this->freeze(); - $this->addElement('button', 'done', ts('Done'), ['onclick' => "location.href='civicrm/admin/custom/group?reset=1&action=browse'"]); + $this->addElement('xbutton', 'done', ts('Done'), [ + 'type' => 'button', + 'onclick' => "location.href='civicrm/admin/custom/group?reset=1&action=browse'", + ]); } // don't show option for contribution amounts section if membership price set diff --git a/CRM/Contribute/Form/ContributionPage/Widget.php b/CRM/Contribute/Form/ContributionPage/Widget.php index d59c1f6c45bc..4b8b5adc3b92 100644 --- a/CRM/Contribute/Form/ContributionPage/Widget.php +++ b/CRM/Contribute/Form/ContributionPage/Widget.php @@ -188,9 +188,10 @@ public function buildQuickForm() { $this->assign_by_ref('colorFields', $this->_colorFields); $this->_refreshButtonName = $this->getButtonName('refresh'); - $this->addElement('submit', + $this->addElement('xbutton', $this->_refreshButtonName, - ts('Save and Preview') + ts('Save and Preview'), + ['type' => 'submit'] ); parent::buildQuickForm(); $this->addFormRule(['CRM_Contribute_Form_ContributionPage_Widget', 'formRule'], $this); diff --git a/CRM/Contribute/Import/Form/DataSource.php b/CRM/Contribute/Import/Form/DataSource.php index f1c72357c7bf..6833eafd0e25 100644 --- a/CRM/Contribute/Import/Form/DataSource.php +++ b/CRM/Contribute/Import/Form/DataSource.php @@ -38,7 +38,10 @@ public function buildQuickForm() { $this->setDefaults(['onDuplicate' => CRM_Import_Parser::DUPLICATE_SKIP]); - $this->addElement('submit', 'loadMapping', ts('Load Mapping'), NULL, ['onclick' => 'checkSelect()']); + $this->addElement('xbutton', 'loadMapping', ts('Load Mapping'), [ + 'type' => 'submit', + 'onclick' => 'checkSelect()', + ]); $this->addContactTypeSelector(); } diff --git a/CRM/Core/BAO/Mapping.php b/CRM/Core/BAO/Mapping.php index e2e0e7057a29..3c9bf18beaa7 100644 --- a/CRM/Core/BAO/Mapping.php +++ b/CRM/Core/BAO/Mapping.php @@ -318,8 +318,12 @@ public static function buildMappingForm(&$form, $mappingId, $columnNo, $blockCou $hasRelationTypes = []; $columnCount = $columnNo; - $form->addElement('submit', 'addBlock', ts('Also include contacts where'), - ['class' => 'submit-link'] + $form->addElement('xbutton', 'addBlock', ts('Also include contacts where'), + [ + 'type' => 'submit', + 'class' => 'submit-link', + 'value' => 1, + ] ); $contactTypes = CRM_Contact_BAO_ContactType::basicTypes(); @@ -553,7 +557,11 @@ public static function buildMappingForm(&$form, $mappingId, $columnNo, $blockCou $form->add('text', "value[$x][$i]", ''); } - $form->addElement('submit', "addMore[$x]", ts('Another search field'), ['class' => 'submit-link']); + $form->addElement('xbutton', "addMore[$x]", ts('Another search field'), [ + 'type' => 'submit', + 'class' => 'submit-link', + 'value' => 1, + ]); } //end of block for diff --git a/CRM/Core/Form.php b/CRM/Core/Form.php index 9f589ff1532d..158a6eedbb51 100644 --- a/CRM/Core/Form.php +++ b/CRM/Core/Form.php @@ -668,6 +668,13 @@ public function addButtons($params) { $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']; } @@ -686,7 +693,8 @@ public function addButtons($params) { } if ($button['type'] === 'reset') { - $prevnext[] = $this->createElement($button['type'], 'reset', $button['name'], $attrs); + $attrs['type'] = 'reset'; + $prevnext[] = $this->createElement('xbutton', 'reset', $button['name'], $attrs); } else { if (!empty($button['subName'])) { @@ -704,12 +712,11 @@ public function addButtons($params) { if (in_array($button['type'], ['next', 'upload', 'done']) && $button['name'] === ts('Save')) { $attrs['accesskey'] = 'S'; } - $icon = CRM_Utils_Array::value('icon', $button, $defaultIcon); - if ($icon) { - $attrs['crm-icon'] = $icon; - } + $buttonContents = CRM_Core_Page::crmIcon($button['icon'] ?? $defaultIcon) . ' ' . $button['name']; $buttonName = $this->getButtonName($button['type'], CRM_Utils_Array::value('subName', $button)); - $prevnext[] = $this->createElement('submit', $buttonName, $button['name'], $attrs); + $attrs['class'] .= " crm-button crm-button-type-{$button['type']} crm-button{$buttonName}"; + $attrs['type'] = 'submit'; + $prevnext[] = $this->createElement('xbutton', $buttonName, $buttonContents, $attrs); } if (!empty($button['isDefault'])) { $this->setDefaultAction($button['type']); @@ -2445,7 +2452,10 @@ public function addTaskMenu($tasks) { $this->_actionButtonName = $this->getButtonName('next', 'action'); } $this->assign('actionButtonName', $this->_actionButtonName); - $this->add('submit', $this->_actionButtonName, ts('Go'), ['class' => 'hiddenElement crm-search-go-button']); + $this->add('xbutton', $this->_actionButtonName, ts('Go'), [ + 'type' => 'submit', + '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']); diff --git a/CRM/Custom/Form/Field.php b/CRM/Custom/Form/Field.php index f5e6096c0e6c..f214af7026b0 100644 --- a/CRM/Custom/Form/Field.php +++ b/CRM/Custom/Form/Field.php @@ -565,10 +565,13 @@ public function buildQuickForm() { 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('button', + $this->addElement('xbutton', 'done', ts('Done'), - ['onclick' => "location.href='$url'"] + [ + 'type' => 'button', + 'onclick' => "location.href='$url'", + ] ); } } diff --git a/CRM/Custom/Form/Group.php b/CRM/Custom/Form/Group.php index 0c37d9037416..09cffc753310 100644 --- a/CRM/Custom/Form/Group.php +++ b/CRM/Custom/Form/Group.php @@ -351,7 +351,10 @@ public function buildQuickForm() { // TODO: Is this condition ever true? Can this code be removed? if ($this->_action & CRM_Core_Action::VIEW) { $this->freeze(); - $this->addElement('button', 'done', ts('Done'), ['onclick' => "location.href='civicrm/admin/custom/group?reset=1&action=browse'"]); + $this->addElement('xbutton', 'done', ts('Done'), [ + 'type' => 'button', + 'onclick' => "location.href='civicrm/admin/custom/group?reset=1&action=browse'", + ]); } } diff --git a/CRM/Custom/Form/Option.php b/CRM/Custom/Form/Option.php index 3bb6a5fb6c04..05f6dcd81e72 100644 --- a/CRM/Custom/Form/Option.php +++ b/CRM/Custom/Form/Option.php @@ -201,10 +201,14 @@ public function buildQuickForm() { 'reset=1&action=browse&fid=' . $this->_fid . '&gid=' . $this->_gid, TRUE, NULL, FALSE ); - $this->addElement('button', + $this->addElement('xbutton', 'done', - ts('Done'), - ['onclick' => "location.href='$url'", 'class' => 'crm-form-submit cancel', 'crm-icon' => 'fa-times'] + CRM_Core_Page::crmIcon('fa-times') . ' ' . ts('Done'), + [ + 'type' => 'button', + 'onclick' => "location.href='$url'", + 'class' => 'crm-form-submit cancel', + ] ); } } diff --git a/CRM/Event/Form/ManageEvent/Fee.php b/CRM/Event/Form/ManageEvent/Fee.php index 1462a3697c73..60c124a6791d 100644 --- a/CRM/Event/Form/ManageEvent/Fee.php +++ b/CRM/Event/Form/ManageEvent/Fee.php @@ -355,8 +355,12 @@ public function buildQuickForm() { $this->add('datepicker', 'discount_end_date[' . $i . ']', ts('Discount End Date'), [], FALSE, ['time' => FALSE]); } $_showHide->addToTemplate(); - $this->addElement('submit', $this->getButtonName('submit'), ts('Add Discount Set to Fee Table'), - ['class' => 'crm-form-submit cancel'] + $this->addElement('xbutton', $this->getButtonName('submit'), ts('Add Discount Set to Fee Table'), + [ + 'type' => 'submit', + 'class' => 'crm-form-submit cancel', + 'value' => 1, + ] ); if (Civi::settings()->get('deferred_revenue_enabled')) { $deferredFinancialType = CRM_Financial_BAO_FinancialAccount::getDeferredFinancialType(); diff --git a/CRM/Financial/Form/BatchTransaction.php b/CRM/Financial/Form/BatchTransaction.php index 408a84e72911..20848b58ecae 100644 --- a/CRM/Financial/Form/BatchTransaction.php +++ b/CRM/Financial/Form/BatchTransaction.php @@ -75,7 +75,7 @@ public function preProcess() { */ public function buildQuickForm() { if ($this->_batchStatus == 'Closed') { - $this->add('submit', 'export_batch', ts('Export Batch')); + $this->add('xbutton', 'export_batch', ts('Export Batch'), ['type' => 'submit']); } // do not build rest of form unless it is open/reopened batch @@ -85,9 +85,9 @@ public function buildQuickForm() { parent::buildQuickForm(); if (CRM_Batch_BAO_Batch::checkBatchPermission('close', $this->_values['created_id'])) { - $this->add('submit', 'close_batch', ts('Close Batch')); + $this->add('xbutton', 'close_batch', ts('Close Batch'), ['type' => 'submit']); if (CRM_Batch_BAO_Batch::checkBatchPermission('export', $this->_values['created_id'])) { - $this->add('submit', 'export_batch', ts('Close & Export Batch')); + $this->add('xbutton', 'export_batch', ts('Close & Export Batch'), ['type' => 'submit']); } } @@ -99,8 +99,9 @@ public function buildQuickForm() { ts('Task'), ['' => ts('- actions -')] + ['Remove' => ts('Remove from Batch')]); - $this->add('submit', 'rSubmit', ts('Go'), + $this->add('xbutton', 'rSubmit', ts('Go'), [ + 'type' => 'submit', 'class' => 'crm-form-submit', 'id' => 'GoRemove', ]); @@ -123,8 +124,9 @@ public function buildQuickForm() { ts('Task'), ['' => ts('- actions -')] + ['Assign' => ts('Assign to Batch')]); - $this->add('submit', 'submit', ts('Go'), + $this->add('xbutton', 'submit', ts('Go'), [ + 'type' => 'submit', 'class' => 'crm-form-submit', 'id' => 'Go', ]); diff --git a/CRM/Financial/Form/Search.php b/CRM/Financial/Form/Search.php index 985d9ddfbb67..069c6e0a9abd 100644 --- a/CRM/Financial/Form/Search.php +++ b/CRM/Financial/Form/Search.php @@ -93,8 +93,9 @@ public function buildQuickForm() { ts('Task'), ['' => ts('- actions -')] + $batchAction); - $this->add('submit', 'submit', ts('Go'), + $this->add('xbutton', 'submit', ts('Go'), [ + 'type' => 'submit', 'class' => 'crm-form-submit', 'id' => 'Go', ]); diff --git a/CRM/Price/Form/Field.php b/CRM/Price/Form/Field.php index 571ab77be16e..aed5e90a8d8e 100644 --- a/CRM/Price/Form/Field.php +++ b/CRM/Price/Form/Field.php @@ -376,10 +376,13 @@ public function buildQuickForm() { 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('button', + $this->addElement('xbutton', 'done', ts('Done'), - ['onclick' => "location.href='$url'"] + [ + 'type' => 'button', + 'onclick' => "location.href='$url'", + ] ); } } diff --git a/CRM/Profile/Form.php b/CRM/Profile/Form.php index 8d8f46cd881f..c6594fd4bd97 100644 --- a/CRM/Profile/Form.php +++ b/CRM/Profile/Form.php @@ -904,9 +904,13 @@ public function buildQuickForm() { if ($this->_context == 'dialog') { $this->addElement( - 'submit', + 'xbutton', $this->_duplicateButtonName, - ts('Save Matching Contact') + ts('Save Matching Contact'), + [ + 'type' => 'submit', + 'class' => 'crm-button', + ] ); } } diff --git a/CRM/Profile/Form/Edit.php b/CRM/Profile/Form/Edit.php index 7564dc37fc28..b2cfc16bf447 100644 --- a/CRM/Profile/Form/Edit.php +++ b/CRM/Profile/Form/Edit.php @@ -209,7 +209,11 @@ public function buildQuickForm() { if (($this->_multiRecord & CRM_Core_Action::DELETE) && $this->_recordExists) { $this->_deleteButtonName = $this->getButtonName('upload', 'delete'); - $this->addElement('submit', $this->_deleteButtonName, ts('Delete')); + $this->addElement('xbutton', $this->_deleteButtonName, ts('Delete'), [ + 'type' => 'submit', + 'value' => 1, + 'class' => 'crm-button', + ]); return; } diff --git a/CRM/Report/Form.php b/CRM/Report/Form.php index d202b845611e..07bd815673b4 100644 --- a/CRM/Report/Form.php +++ b/CRM/Report/Form.php @@ -1535,7 +1535,7 @@ public function addChartOptions() { if (!empty($this->_charts)) { $this->addElement('select', "charts", ts('Chart'), $this->_charts); $this->assign('charts', $this->_charts); - $this->addElement('submit', $this->_chartButtonName, ts('View')); + $this->addElement('xbutton', $this->_chartButtonName, ts('View'), ['type' => 'submit']); } } @@ -1660,7 +1660,10 @@ public function buildInstanceAndButtons() { $this->assign('group', TRUE); } - $this->addElement('submit', $this->_groupButtonName, '', ['style' => 'display: none;']); + $this->addElement('xbutton', $this->_groupButtonName, '', [ + 'type' => 'submit', + 'style' => 'display: none;', + ]); $this->addChartOptions(); $showResultsLabel = $this->getResultsLabel(); diff --git a/CRM/UF/Form/Field.php b/CRM/UF/Form/Field.php index 4bfcb214af81..997962cd40b1 100644 --- a/CRM/UF/Form/Field.php +++ b/CRM/UF/Form/Field.php @@ -467,8 +467,11 @@ public function buildQuickForm() { // if view mode pls freeze it with the done button. if ($this->_action & CRM_Core_Action::VIEW) { $this->freeze(); - $this->addElement('button', 'done', ts('Done'), - ['onclick' => "location.href='civicrm/admin/uf/group/field?reset=1&action=browse&gid=" . $this->_gid . "'"] + $this->addElement('xbutton', 'done', ts('Done'), + [ + 'type' => 'button', + 'onclick' => "location.href='civicrm/admin/uf/group/field?reset=1&action=browse&gid=" . $this->_gid . "'", + ] ); } diff --git a/CRM/UF/Form/Group.php b/CRM/UF/Form/Group.php index a9fef4dc8fef..5a4d3dd570a5 100644 --- a/CRM/UF/Form/Group.php +++ b/CRM/UF/Form/Group.php @@ -231,7 +231,10 @@ public function buildQuickForm() { // views are implemented as frozen form if ($this->_action & CRM_Core_Action::VIEW) { $this->freeze(); - $this->addElement('button', 'done', ts('Done'), ['onclick' => "location.href='civicrm/admin/uf/group?reset=1&action=browse'"]); + $this->addElement('xbutton', 'done', ts('Done'), [ + 'type' => 'button', + 'onclick' => "location.href='civicrm/admin/uf/group?reset=1&action=browse'", + ]); } $this->addFormRule(['CRM_UF_Form_Group', 'formRule'], $this); diff --git a/css/civicrm.css b/css/civicrm.css index cf61ef5a7d05..a2d6695b68f1 100644 --- a/css/civicrm.css +++ b/css/civicrm.css @@ -1173,7 +1173,7 @@ input.crm-form-entityref { cursor: pointer; } -#crm-container input.submit-link { +#crm-container button.submit-link { color: #285286; background: none transparent; border: none; @@ -1833,17 +1833,6 @@ 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; @@ -1858,9 +1847,7 @@ 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; @@ -1872,48 +1859,15 @@ 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%; -} - -/* 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; + border-radius: 3px; } .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, @@ -1924,28 +1878,24 @@ 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, @@ -2888,15 +2838,6 @@ 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, diff --git a/css/joomla.css b/css/joomla.css index a59b3a047ad5..80b9ad96f053 100644 --- a/css/joomla.css +++ b/css/joomla.css @@ -352,7 +352,7 @@ div#toolbar-box, div#toolbar-box div.m{ .crm-container input { height: auto; } -.crm-container input[type=submit] { +.crm-container button[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; } diff --git a/install/template.html b/install/template.html index e95165536b2e..eb12944d220e 100644 --- a/install/template.html +++ b/install/template.html @@ -34,7 +34,7 @@

- +

?> 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.

-

+

diff --git a/js/Common.js b/js/Common.js index 88acc9ef4d40..056c11cfe059 100644 --- a/js/Common.js +++ b/js/Common.js @@ -145,32 +145,6 @@ 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 @@ -218,7 +192,7 @@ if (!CRM.vars) CRM.vars = {}; $.propHooks.disabled = { set: function (el, value, name) { // Sync button enabled status with wrapper css - if ($(el).is('span.crm-button > input.crm-form-submit')) { + if ($(el).is('.crm-button.crm-form-submit')) { $(el).parent().toggleClass('crm-button-disabled', !!value); } // Sync button enabled status with dialog button @@ -997,7 +971,7 @@ if (!CRM.vars) CRM.vars = {}; $('form[data-submit-once]', e.target) .submit(submitOnceForm) .on('invalid-form', submitFormInvalid); - $('form[data-submit-once] input[type=submit]', e.target).click(function(e) { + $('form[data-submit-once] button[type=submit]', e.target).click(function(e) { submitButton = e.target; }); }) diff --git a/js/crm.ajax.js b/js/crm.ajax.js index e65bd7b2a22c..757ebef06335 100644 --- a/js/crm.ajax.js +++ b/js/crm.ajax.js @@ -498,7 +498,7 @@ var buttonContainers = '.crm-submit-buttons, .action-link', buttons = [], added = []; - $(buttonContainers, $el).find('input.crm-form-submit, a.button, button').each(function() { + $(buttonContainers, $el).find('.crm-form-submit, .crm-form-xbutton, a.button, button').each(function() { var $el = $(this), label = $el.is('input') ? $el.attr('value') : $el.text(), identifier = $el.attr('name') || $el.attr('href'); @@ -522,7 +522,7 @@ $el.dialog('option', 'buttons', buttons); } // Allow a button to prevent ajax submit - $('input[data-no-ajax-submit=true]').click(function() { + $('input[data-no-ajax-submit=true], button[data-no-ajax-submit=true]').click(function() { $(this).closest('form').ajaxFormUnbind(); }); // For convenience, focus the first field diff --git a/js/crm.searchForm.js b/js/crm.searchForm.js index 42a371dcecf4..c84d0f5ec292 100644 --- a/js/crm.searchForm.js +++ b/js/crm.searchForm.js @@ -134,7 +134,7 @@ // When selecting a task .on('change', 'select#task', function(e) { var $form = $(this).closest('form'), - $go = $('input.crm-search-go-button', $form); + $go = $('button.crm-search-go-button', $form); var $selectedOption = $(this).find(':selected'); if (!$selectedOption.val()) { // do not blank refresh the empty option. diff --git a/js/jquery/jquery.dashboard.js b/js/jquery/jquery.dashboard.js index 4191285449ba..00c65260ec2f 100644 --- a/js/jquery/jquery.dashboard.js +++ b/js/jquery/jquery.dashboard.js @@ -526,8 +526,8 @@ html += '
'; html += '
'; html += '
'; - html += ' '; - html += ' '; + html += ' '; + html += ' '; html += '
'; html += '
'; return html; diff --git a/setup/plugins/blocks/advanced.tpl.php b/setup/plugins/blocks/advanced.tpl.php index 971d22c1fd5a..abfc03926049 100644 --- a/setup/plugins/blocks/advanced.tpl.php +++ b/setup/plugins/blocks/advanced.tpl.php @@ -26,7 +26,7 @@
- +